From 8e02bd10547b33e0ad115764474166bf1cccce7a Mon Sep 17 00:00:00 2001
From: jhzh <1628036192@qq.com>
Date: Fri, 06 Mar 2026 14:31:55 +0800
Subject: [PATCH] 1
---
src/page/user/Warehouse/data.list.vue | 274 ++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 244 insertions(+), 30 deletions(-)
diff --git a/src/page/user/Warehouse/data.list.vue b/src/page/user/Warehouse/data.list.vue
index 4a21710..03e2e22 100644
--- a/src/page/user/Warehouse/data.list.vue
+++ b/src/page/user/Warehouse/data.list.vue
@@ -17,16 +17,16 @@
:loading-text="$t('hj430')"
@load="onLoad"
>
- <div
+ <div v-if="actives === 0"
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}`)"
- >
+ @click="$router.push(`/Stockdetail?codes=${item.positionSn}`)" >
<div @click.stop="pushRouter(item)">
- <div class="title-box">
- <div class="span">{{ item.stockName }}</div>
+
+ <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' : ''"
@@ -36,15 +36,14 @@
</div>
{{ item.stockSpell }}
</div>
- <!-- <div @click="$router.push('/Stockdetail')"></div> -->
<van-row>
<van-col span="8">
<div style="text-align: left">
- <div class="sport-content-title2">
+ <div class="sport-content-title2" >
{{ $t("盈虧") }} ({{ activeObj.symbolCode }})
</div>
- <div class="sport-content-text" style="color: #d04b64">
- {{ item.profitAndLose | _toString }}
+ <div class="sport-content-text2" :style="item.profitAndLoseParent.charAt(0)=='-'?'color:#cc1b1b;':'color:#3e9976;'">
+ ₹{{ item.profitAndLose | _toLocaleString }}
</div>
</div>
</van-col>
@@ -53,7 +52,7 @@
<div class="sport-content-title2">
{{ $t("hj141") }} ({{ activeObj.symbolCode }})
</div>
- <div class="sport-content-text2">
+ <div class="sport-content-text2" :style="item.profitAndLoseParent.charAt(0)=='-'?'color:#cc1b1b;':'color:#3e9976;'">
{{ item.profitAndLoseParent }}
</div>
</div>
@@ -61,7 +60,7 @@
<van-col span="8">
<div style="text-align: right">
<div class="sport-content-title2">{{ $t("倉位(股)") }}</div>
- <div class="sport-content-text">{{ item.orderNum }}</div>
+ <div class="sport-content-text2">{{ item.orderNum }}</div>
</div></van-col
>
</van-row>
@@ -72,7 +71,7 @@
{{ $t("hj40") }}({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- {{ item.now_price | _toString }}
+ ₹{{ item.now_price | _toLocaleString }}
</div>
</div>
</van-col>
@@ -82,7 +81,7 @@
{{ $t("持倉價") }} ({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- {{ item.buyOrderPrice | _toString }}
+ ₹{{ item.buyOrderPrice | _toLocaleString }}
</div>
</div>
</van-col>
@@ -92,7 +91,151 @@
{{ $t("訂單金額") }} ({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- {{ item.orderTotalPrice | _toString }}
+ ₹{{ item.orderTotalPrice | _toLocaleString }}
+ </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 | _toLocaleString }}
+ </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 | _toLocaleString }}
+ </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 | _toLocaleString }}
+ </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 | _toLocaleString }}
+ </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("訂單編號") }}</div>
+ <div class="sport-content-text2">{{ item.buyOrderId }}</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>
+
+
+ <div v-if="actives === 1"
+ class="sport-content-li"
+ :style="actives === 1 ? 'height:5.52rem' : 'height:7.52rem'"
+ v-for="(item, index) in newdataList"
+ :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">{{ 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 | _toLocaleString }}
+ </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">
+ <div style="text-align: left">
+ <div class="sport-content-title2">
+ {{ $t("hj40") }}({{ activeObj.symbolCode }})
+ </div>
+ <div class="sport-content-text2">
+ ₹{{ item.now_price | _toLocaleString }}
+ </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.buyOrderPrice | _toLocaleString }}
+ </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 | _toLocaleString }}
</div>
</div>
</van-col>
@@ -104,17 +247,17 @@
{{ $t("hj44") }} ({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- {{ item.orderFee | _toString }}
+ ₹{{ item.orderFee | _toLocaleString }}
</div>
</div>
</van-col>
- <van-col span="8">
+ <!-- <van-col span="8">
<div style="text-align: center">
<div class="sport-content-title2">
{{ $t("止損價") }} ({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- {{ item.profitTargetPrice | _toString }}
+ {{ item.stopTargetPrice | _toLocaleString }}
</div>
</div>
</van-col>
@@ -124,10 +267,10 @@
{{ $t("止盈價") }} ({{ activeObj.symbolCode }})
</div>
<div class="sport-content-text2">
- {{ item.stopTargetPrice | _toString }}
+ {{ item.profitTargetPrice | _toLocaleString }}
</div>
</div>
- </van-col>
+ </van-col> -->
</van-row>
<van-row>
<van-col span="12">
@@ -168,9 +311,10 @@
</div>
<div class="hang">
<div class="left">{{ $t("倉位(股)") }}</div>
- <div class="right" style="color: rgb(3, 173, 143)">
+ <!-- <div class="right" style="color: rgb(3, 173, 143)">
{{ closeSell.orderNum }}
- </div>
+ </div> -->
+ <input class="input_box" type="number" :max="closeSell.orderNum" :placeholder="$t('hj262')" v-model="ordernum" />
</div>
<div class="hang">
<div class="left">{{ $t("類型") }}</div>
@@ -206,7 +350,10 @@
closeSell: {},
show: false,
actives: 0,
+ ordernum:'',
dataList: [],
+ newdataList:[],
+ timer: null,
tabsList: [
{
title: this.$t("持倉"),
@@ -220,8 +367,19 @@
],
};
},
-
+ created(){
+ this.dsq()
+ },
+ beforeDestroy() {
+ clearInterval(this.timer); // 在组件销毁前清除定时器
+ },
methods: {
+ dsq(){
+ // this.dataList = [];
+ this.timer = setInterval(() => {
+ this.getList();
+ }, 1000);
+ },
pushRouter(item) {
const obj = {
pid: item.stockCode || "",
@@ -245,22 +403,47 @@
});
},
onLoad() {
- this.pageNum++;
+ // this.pageNum++;
this.loading = true;
},
async confirm() {
+ this.$refs.closeDialog.show = false;
const res = await sell({
positionSn: this.closeSell.positionSn,
+ number:this.ordernum
});
if (res.status === 0) {
- this.$refs.closeDialog.show = false;
this.dataList = [];
this.pageNum = 1;
this.finished = false;
+ Notify({ type: "success", message: res.msg });
this.getList();
this.$emit("closingPosition");
} else {
Notify({ type: "danger", message: res.msg });
+ }
+ },
+ // 获取仓位列表
+ async getLists(laber) {
+ if (laber) {
+ this.dataList = [];
+ this.pageNum = 1;
+ this.finished = false;
+ }
+ const res = await getchicang({
+ state: this.actives,
+ stockType: laber || this.activeObj.laber,
+ pageNum: 1,
+ pageSize: 30,
+ });
+
+ this.loading = false;
+ if (res.status === 0) {
+ this.newdataList = res.data.list;
+ this.finished = true;
+ } else {
+ this.loading = false;
+ this.finished = true;
}
},
// 获取仓位列表
@@ -273,16 +456,15 @@
const res = await getchicang({
state: this.actives,
stockType: laber || this.activeObj.laber,
- pageNum: this.pageNum,
- pageSize: this.pageSize,
+ pageNum: 1,
+ pageSize: 30,
});
this.loading = false;
if (res.status === 0) {
+ this.dataList = []
this.dataList = res.data.list;
- // if (res.data.total <= this.dataList.length) {
this.finished = true;
- // }
} else {
this.loading = false;
this.finished = true;
@@ -291,19 +473,51 @@
close(item) {
this.closeSell = item;
this.$refs.closeDialog.show = true;
+ this.ordernum = ''
},
+
clickTabs(e) {
- this.dataList = [];
this.pageNum = 1;
this.finished = false;
this.actives = e.key;
- this.getList();
+ this.newdataList = []
+ this.dataList = []
+
+ if(e.key==1){
+ clearInterval(this.timer); // 在组件销毁前清除定时器
+ // clearTimeout(this.timer);
+ // setTimeout(()=>{
+ // clearInterval(this.timer); // 在组件销毁前清除定时器
+ // },3000)
+ this.getLists()
+ // this.startPolling();
+ // this.dsq()
+ }else{
+ clearInterval(this.timer); // 在组件销毁前清除定时器
+ this.dsq()
+ }
+ this.$forceUpdate(); // 强制Vue重新渲染
+
+ // this.getList()
+ // if(e.key !=this.actives){
+
+
+ // }else{
+ // this.actives = e.key;
+ // this.dsq()
+ // }
},
},
};
</script>
<style lang="less" scoped>
+ .input_box{
+ text-align: right;
+ font-size: 16px;
+
+ padding: 0 4px;
+ }
.sport-tabs {
// font-family: PingFang SC;
font-family: "DINPro";
--
Gitblit v1.9.3