From 732c30b33f782c2d2ebb62eacda2fb7a453a7ecd Mon Sep 17 00:00:00 2001
From: admin <344137771@qq.com>
Date: Sat, 31 Jan 2026 11:01:45 +0800
Subject: [PATCH] 1
---
src/page/user/Warehouse/Stockdetail.vue | 62 +++++++++++++++++++++---------
1 files changed, 43 insertions(+), 19 deletions(-)
diff --git a/src/page/user/Warehouse/Stockdetail.vue b/src/page/user/Warehouse/Stockdetail.vue
index 78ee5c9..15a3eae 100644
--- a/src/page/user/Warehouse/Stockdetail.vue
+++ b/src/page/user/Warehouse/Stockdetail.vue
@@ -1,14 +1,8 @@
<!-- -->
<template>
<div style="height: 100%">
- <van-nav-bar
- :placeholder="true"
- :safe-area-inset-top="true"
- :title="$t('订单详情')"
- left-arrow
- :fixed="true"
- @click-left="handleBack"
- >
+ <van-nav-bar :placeholder="true" :safe-area-inset-top="true" :title="$t('订单详情')" left-arrow :fixed="true"
+ @click-left="handleBack">
</van-nav-bar>
<div class="bottomIfr">
@@ -102,7 +96,13 @@
</div>
</div>
<div class="buttonbox flex-center" v-show="!pages.sellOrderTime">
- <van-button type="primary" @click="close"> {{ $t("平仓") }}</van-button>
+ <!-- <van-button type="primary" @click="close"> {{ $t("平仓") }}</van-button> -->
+
+ <van-popover v-model="showPopover" trigger="click" placement="top" :actions="actions" @select="onSelect">
+ <template #reference>
+ <van-button type="primary"> {{ $t("平仓") }}</van-button>
+ </template>
+ </van-popover>
</div>
<Dialog ref="closeDialog" :title="$t('确认平仓')" :confirm="confirm">
@@ -118,13 +118,8 @@
</div>
<div class="hang">
<div class="left">{{ $t("倉位(股)") }}</div>
- <input
- class="input_box"
- type="number"
- :max="pages.orderNum"
- :placeholder="$t('hj262')"
- v-model="ordernum"
- />
+ <input class="input_box" type="number" :max="pages.orderNum" :placeholder="$t('hj262')"
+ v-model="ordernum" />
</div>
<div class="hang">
<div class="left">{{ $t("類型") }}</div>
@@ -146,7 +141,9 @@
data() {
return {
pages: {},
- ordernum: ""
+ ordernum: "",
+ actions: [{ text: this.$t('确定'), key: '1' }, { text: this.$t('取消'), key: '2' }],
+ showPopover: false,
};
},
// 生命周期 - 创建完成(访问当前this实例)
@@ -154,7 +151,7 @@
this.getInfoSite();
},
// 生命周期 - 挂载完成(访问DOM元素)
- mounted() {},
+ mounted() { },
methods: {
handleBack() {
// 点击返回/
@@ -200,7 +197,26 @@
if (res.status === 0) {
this.finished = false;
Notify({ type: "success", message: res.msg });
- this.$router.go(-1);
+ // this.$router.go(-1);
+ this.$router.push({
+ path: "/tradeNew",
+ });
+ } else {
+ Notify({ type: "danger", message: res.msg });
+ }
+ },
+ // 直接全部确认弹框
+ onSelect(action) {
+ if (action.key == 1) this.oneClose();
+ },
+ // 直接全部平仓
+ async oneClose() {
+ const res = await api.sell({
+ positionSn: this.pages.positionSn,
+ number: this.pages.orderNum
+ });
+ if (res.status === 0) {
+ Notify({ type: "success", message: res.msg });
} else {
Notify({ type: "danger", message: res.msg });
}
@@ -211,9 +227,11 @@
<style scoped lang="less">
@dark_green: #07c160;
@green: #c4d600;
+
/deep/ .van-nav-bar__content {
height: 65px;
}
+
/deep/ .van-nav-bar__title {
font-family: "DINPro";
width: 100%;
@@ -226,6 +244,7 @@
font-size: 0.48rem;
color: #14181f;
}
+
.bottomIfr {
// position: absolute;
// top: 1.5rem;
@@ -249,6 +268,7 @@
}
}
}
+
.pagebox {
margin: 0 0.6em;
height: 3.2em;
@@ -272,6 +292,7 @@
// color: #777777;
font-size: 0.9em;
}
+
.pagebox_right {
color: #969799;
}
@@ -280,12 +301,14 @@
.hang {
display: flex;
justify-content: space-between;
+
.left {
font-style: normal;
font-weight: 500;
font-size: 0.34667rem;
color: #8c9fad;
}
+
.right {
font-style: normal;
font-weight: 500;
@@ -294,6 +317,7 @@
text-align: right;
}
}
+
.conentIfr {
width: 100%;
height: 90%;
--
Gitblit v1.9.3