From b4c4556a5eddf6708ec55b07e3edc15b2217842e Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Wed, 30 Apr 2025 18:35:59 +0800
Subject: [PATCH] 0430号修改
---
src/page/user/Warehouse/data.list.vue | 329 +++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 297 insertions(+), 32 deletions(-)
diff --git a/src/page/user/Warehouse/data.list.vue b/src/page/user/Warehouse/data.list.vue
index 9870c9a..e280ed9 100644
--- a/src/page/user/Warehouse/data.list.vue
+++ b/src/page/user/Warehouse/data.list.vue
@@ -56,7 +56,7 @@
: 'color:#3e9976;'
"
>
- ₹{{ item.profitAndLose | _toLocaleString }}
+ {{ item.profitAndLose }}
</div>
</div>
</van-col>
@@ -91,7 +91,7 @@
{{ $t("hj40") }}({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- ₹{{ item.now_price | _toLocaleString }}
+ {{ item.now_price }}
</div>
</div>
</van-col>
@@ -101,7 +101,7 @@
{{ $t("持倉價") }} ({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- ₹{{ item.buyOrderPrice | _toLocaleString }}
+ {{ item.buyOrderPrice }}
</div>
</div>
</van-col>
@@ -111,19 +111,19 @@
{{ $t("訂單金額") }} ({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- ₹{{ item.orderTotalPrice | _toLocaleString }}
+ {{ item.orderTotalPrice }}
</div>
</div>
</van-col>
</van-row>
- <van-row>
+ <!-- <van-row>
<van-col span="12">
<div style="text-align: left">
<div class="sport-content-title2">
{{ $t("hj44") }} ({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- ₹{{ item.orderFee | _toLocaleString }}
+ {{ item.orderFee }}
</div>
</div>
</van-col>
@@ -133,17 +133,17 @@
{{ $t("待补金额") }} ({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- ₹{{ item.amountToBeCovered | _toLocaleString }}
+ {{ item.amountToBeCovered }}
</div>
</div>
- </van-col>
- <!-- <van-col span="8">
+ </van-col> -->
+ <!-- <van-col span="8">
<div style="text-align: center">
<div class="sport-content-title2">
{{ $t("止損價") }} ({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- {{ item.stopTargetPrice | _toLocaleString }}
+ {{ item.stopTargetPrice }}
</div>
</div>
</van-col>
@@ -153,11 +153,11 @@
{{ $t("止盈價") }} ({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- {{ item.profitTargetPrice | _toLocaleString }}
+ {{ item.profitTargetPrice }}
</div>
</div>
</van-col> -->
- </van-row>
+ <!-- </van-row> -->
<van-row>
<van-col span="12">
<div style="text-align: left">
@@ -215,7 +215,7 @@
: 'color:#3e9976;'
"
>
- ₹{{ item.profitAndLose | _toLocaleString }}
+ {{ item.profitAndLose }}
</div>
</div>
</van-col>
@@ -250,7 +250,7 @@
{{ $t("hj40") }}({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- ₹{{ item.now_price | _toLocaleString }}
+ {{ item.now_price }}
</div>
</div>
</van-col>
@@ -260,7 +260,7 @@
{{ $t("持倉價") }} ({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- ₹{{ item.buyOrderPrice | _toLocaleString }}
+ {{ item.buyOrderPrice }}
</div>
</div>
</van-col>
@@ -270,7 +270,7 @@
{{ $t("訂單金額") }} ({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- ₹{{ item.orderTotalPrice | _toLocaleString }}
+ {{ item.orderTotalPrice }}
</div>
</div>
</van-col>
@@ -282,8 +282,14 @@
{{ $t("hj44") }} ({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- ₹{{ item.orderFee | _toLocaleString }}
+ {{ item.orderFee }}
</div>
+ </div>
+ </van-col>
+ <van-col span="12">
+ <div style="text-align: right">
+ <div class="sport-content-title2">{{ $t("訂單編號") }}</div>
+ <div class="sport-content-text2">{{ item.buyOrderId }}</div>
</div>
</van-col>
<!-- <van-col span="8">
@@ -292,7 +298,7 @@
{{ $t("止損價") }} ({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- {{ item.stopTargetPrice | _toLocaleString }}
+ {{ item.stopTargetPrice }}
</div>
</div>
</van-col>
@@ -302,11 +308,198 @@
{{ $t("止盈價") }} ({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- {{ item.profitTargetPrice | _toLocaleString }}
+ {{ item.profitTargetPrice }}
</div>
</div>
</van-col> -->
</van-row>
+ <van-row>
+ <van-col span="12">
+ <div style="text-align: left">
+ <div class="sport-content-title2">{{ $t("持倉時間") }}</div>
+ <div class="sport-content-text2">
+ {{ $moment(item.buyOrderTime).format("DD-MM-YYYY hh:mm:ss A") }}
+ </div>
+ </div>
+ </van-col>
+ <van-col span="12">
+ <div style="text-align: right">
+ <div class="sport-content-title2">{{ $t("hj128") }}</div>
+ <div class="sport-content-text2">
+ {{
+ $moment(item.sellOrderTime).format("DD-MM-YYYY hh:mm:ss A")
+ }}
+ </div>
+ </div>
+ </van-col>
+ </van-row>
+
+ <div class="but-box" v-if="actives === 0" @click.stop="close(item)">
+ <div class="but">{{ $t("平仓") }}</div>
+ <!-- <div class="but buts">止盈止损</div> -->
+ </div>
+ </div>
+
+ <van-popover
+ v-if="actives === 2"
+ v-model="pendingShow"
+ trigger="click"
+ :actions="pendingOptions"
+ @select="handleStatusChange"
+ >
+ <template #reference>
+ <van-button type="primary">{{
+ pendingOptions[pendingStatus].text
+ }}</van-button>
+ </template>
+ </van-popover>
+ <div
+ v-if="actives === 2"
+ class="sport-content-li"
+ :style="actives === 1 ? 'height:5.52rem' : 'height:7.52rem'"
+ v-for="(item, index) in dataList"
+ :key="index"
+ @click="$router.push(`/Stockdetail?codes=${item.positionSn}`)"
+ >
+ <div @click.stop="pushRouter(item)">
+ <div class="title-box" style="justify-content: space-between;">
+ <div
+ class="span"
+ :style="item.isListed == false ? 'color:red;' : ''"
+ >
+ {{ item.stockName }}
+ </div>
+ <div
+ class="states"
+ :class="item.orderDirection === '买跌' ? 'states-red' : ''"
+ >
+ {{ $t(item.orderDirection) }}
+ </div>
+ </div>
+ {{ item.stockSpell }}
+ </div>
+ <!-- <van-row> -->
+ <!-- <van-col span="8"> -->
+ <!-- <div style="text-align: left">
+ <div class="sport-content-title2">
+ {{ $t("盈虧") }} ({{ activeObj.symbolCode }})
+ </div>
+ <div
+ class="sport-content-text2"
+ :style="
+ item.profitAndLoseParent.charAt(0) == '-'
+ ? 'color:#cc1b1b;'
+ : 'color:#3e9976;'
+ "
+ >
+ {{ item.profitAndLose }}
+ </div> -->
+ <!-- </div> -->
+ <!-- </van-col> -->
+ <!-- <van-col span="8"> -->
+ <!-- <div style="text-align: center"> -->
+ <!-- <div class="sport-content-title2">
+ {{ $t("hj141") }} ({{ activeObj.symbolCode }})
+ </div> -->
+ <!-- <div
+ class="sport-content-text2"
+ :style="
+ item.profitAndLoseParent.charAt(0) == '-'
+ ? 'color:#cc1b1b;'
+ : 'color:#3e9976;'
+ "
+ >
+ {{ item.profitAndLoseParent }}
+ </div> -->
+ <!-- </div> -->
+ <!-- </van-col> -->
+ <!-- <van-col span="8">
+ <div style="text-align: right">
+ <div class="sport-content-title2">{{ $t("倉位(股)") }}</div>
+ <div class="sport-content-text2">{{ item.orderNum }}</div>
+ </div></van-col
+ > -->
+ <!-- </van-row> -->
+ <van-row>
+ <van-col span="8">
+ <van-col span="8">
+ <div style="text-align: right">
+ <div class="sport-content-title2">{{ $t("倉位(股)") }}</div>
+ <div class="sport-content-text2">{{ item.orderNum }}</div>
+ </div></van-col
+ >
+ <!-- <div style="text-align: left"> -->
+ <!-- <div class="sport-content-title2">
+ {{ $t("hj40") }}({{ activeObj.symbolCode }})
+ </div> -->
+ <!-- <div class="sport-content-text2">
+ {{ item.now_price }}
+ </div> -->
+ <!-- </div> -->
+ </van-col>
+ <van-col span="8">
+ <div style="text-align: center">
+ <div class="sport-content-title2">
+ {{ $t("持倉價") }} ({{ activeObj.symbolCode }})
+ </div>
+ <div class="sport-content-text2">
+ {{ item.sellOrderPrice || item.buyOrderPrice }}
+ </div>
+ </div>
+ </van-col>
+ <van-col span="8">
+ <div style="text-align: right">
+ <div class="sport-content-title2">
+ {{ $t("訂單金額") }} ({{ activeObj.symbolCode }})
+ </div>
+ <div class="sport-content-text2">
+ {{ item.orderTotalPrice }}
+ </div>
+ </div>
+ </van-col>
+ </van-row>
+ <!-- <van-row> -->
+ <!-- <van-col span="12">
+ <div style="text-align: left">
+ <div class="sport-content-title2">
+ {{ $t("hj44") }} ({{ activeObj.symbolCode }})
+ </div>
+ <div class="sport-content-text2">
+ {{ item.orderFee }}
+ </div>
+ </div>
+ </van-col>
+ <van-col span="12">
+ <div style="text-align: right">
+ <div class="sport-content-title2">
+ {{ $t("待补金额") }} ({{ activeObj.symbolCode }})
+ </div>
+ <div class="sport-content-text2">
+ {{ item.amountToBeCovered }}
+ </div>
+ </div>
+ </van-col> -->
+ <!-- <van-col span="8">
+ <div style="text-align: center">
+ <div class="sport-content-title2">
+ {{ $t("止損價") }} ({{ activeObj.symbolCode }})
+ </div>
+ <div class="sport-content-text2">
+ {{ item.stopTargetPrice }}
+ </div>
+ </div>
+ </van-col>
+ <van-col span="8">
+ <div style="text-align: right">
+ <div class="sport-content-title2">
+ {{ $t("止盈價") }} ({{ activeObj.symbolCode }})
+ </div>
+ <div class="sport-content-text2">
+ {{ item.profitTargetPrice }}
+ </div>
+ </div>
+ </van-col> -->
+ <!-- </van-row> -->
<van-row>
<van-col span="12">
<div style="text-align: left">
@@ -324,8 +517,12 @@
</van-col>
</van-row>
- <div class="but-box" v-if="actives === 0" @click.stop="close(item)">
- <div class="but">{{ $t("平仓") }}</div>
+ <div
+ class="but-box"
+ v-if="actives === 2 && pendingStatus === 1"
+ @click.stop="close(item)"
+ >
+ <div class="but">{{ $t("hj126") }}</div>
<!-- <div class="but buts">止盈止损</div> -->
</div>
</div>
@@ -369,8 +566,8 @@
<script>
import Dialog from "@/components/Dialog";
-import { getchicang, sell } from "../../../axios/api";
-import { Notify } from "vant";
+import { getchicang, sell, revocation } from "../../../axios/api";
+import { Notify, Dialog as VanDialog } from "vant";
export default {
components: { Dialog },
props: {
@@ -384,6 +581,13 @@
},
data() {
return {
+ pendingShow: false,
+ pendingStatus: 1, // 默认选中挂单中
+ pendingOptions: [
+ { text: this.$t("挂单成功"), value: 0 },
+ { text: this.$t("挂单中"), value: 1 },
+ { text: this.$t("hj126"), value: 2 }
+ ],
pageNum: 1,
pageSize: 150,
loading: true,
@@ -400,10 +604,13 @@
title: this.$t("持倉"),
key: 0
},
-
{
title: this.$t("平倉"),
key: 1
+ },
+ {
+ title: this.$t("hj109"),
+ key: 2
}
]
};
@@ -415,6 +622,13 @@
clearInterval(this.timer); // 在组件销毁前清除定时器
},
methods: {
+ handleStatusChange(value) {
+ // 状态改变时的处理逻辑
+ console.log("当前状态:", value);
+ this.pendingStatus = value.value;
+ // 这里可以添加获取对应状态数据的逻辑
+ this.getList();
+ },
dsq() {
// this.dataList = [];
this.timer = setInterval(() => {
@@ -471,13 +685,19 @@
this.pageNum = 1;
this.finished = false;
}
- const res = await getchicang({
+ const _laber = laber || this.activeObj.laber;
+ let opt = {
state: this.actives,
- stockType: laber || this.activeObj.laber,
- stockCode: "HJYY",
+ stockType: _laber,
+ pendingStatus: this.pendingStatus, // 1 挂单中 2撤销 0挂单成功
pageNum: 1,
pageSize: 30
- });
+ };
+ if (_laber === "USD") {
+ opt.stockCode = "HJYY";
+ }
+
+ const res = await getchicang(opt);
this.loading = false;
if (res.status === 0) {
@@ -499,10 +719,11 @@
let opt = {
state: this.actives,
stockType: _laber,
+ pendingStatus: this.pendingStatus, // 1 挂单中 2撤销 0挂单成功
pageNum: 1,
pageSize: 30
};
- if (_laber === "USDT") {
+ if (_laber === "USD") {
opt.stockCode = "HJYY";
}
const res = await getchicang(opt);
@@ -518,9 +739,35 @@
}
},
close(item) {
- this.closeSell = item;
- this.$refs.closeDialog.show = true;
- this.ordernum = "";
+ console.log("item: ", item);
+ if (this.actives == 2) {
+ VanDialog.confirm({
+ title: this.$t("确认撤销"),
+ message: this.$t("确定要撤销此挂单吗?"),
+ confirmButtonText: this.$t("确定"),
+ cancelButtonText: this.$t("取消")
+ })
+ .then(async () => {
+ // 用户点击确认后的逻辑
+ const res = await revocation({
+ id: item.id
+ });
+ if (res.status === 0) {
+ Notify({ type: "success", message: res.msg });
+ this.getList(); // 刷新列表
+ } else {
+ Notify({ type: "danger", message: res.msg });
+ }
+ })
+ .catch(() => {
+ // 用户点击取消
+ console.log("取消撤销");
+ });
+ } else {
+ this.closeSell = item;
+ this.$refs.closeDialog.show = true;
+ this.ordernum = "";
+ }
},
clickTabs(e) {
@@ -530,6 +777,8 @@
this.newdataList = [];
this.dataList = [];
+ if (e.key == 2) {
+ }
if (e.key == 1) {
clearInterval(this.timer); // 在组件销毁前清除定时器
// clearTimeout(this.timer);
@@ -564,6 +813,22 @@
padding: 0 4px;
}
+/deep/ .van-dropdown-menu {
+ width: 120px;
+ margin-right: 10px;
+ .van-dropdown-menu__title--active,
+ .van-dropdown-item__option--active,
+ .van-dropdown-item__option--active .van-dropdown-item__icon,
+ .van-dropdown-item {
+ color: #1989fa !important;
+ }
+
+ .van-dropdown-item--active {
+ color: #1989fa !important;
+ font-weight: bold;
+ }
+}
+
.sport-tabs {
// font-family: PingFang SC;
font-family: "DINPro";
--
Gitblit v1.9.3