1
PC-20250623MANY\Administrator
2025-09-30 9ddad348a549154e7b328f9d7dd9517d2abd330c
src/page/user/Warehouse/Stockdetail.vue
@@ -100,7 +100,7 @@
        <van-popover v-model="showPopover" trigger="click" placement="top" :actions="actions" @select="onSelect">
          <template #reference>
            <van-button type="primary"> {{ $t("一键平仓") }}</van-button>
            <van-button type="primary"> {{ $t("平仓") }}</van-button>
          </template>
        </van-popover>
      </div>
@@ -142,9 +142,8 @@
    return {
      pages: {},
      ordernum: "",
      actions: [{ text: this.$t('确定'), key: '1' }, { text: this.$t('取消'), key: '2' }],
      showPopover: false,
      // 通过 actions 属性来定义菜单选项
      actions: [{ text: '确定', key: '1' }, { text: '取消', key: '2' }],
    };
  },
  // 生命周期 - 创建完成(访问当前this实例)
@@ -203,21 +202,18 @@
        Notify({ type: "danger", message: res.msg });
      }
    },
    // 一键平仓确认弹框
    // 直接全部确认弹框
    onSelect(action) {
      console.log(action.key);
      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) {
        this.finished = false;
        Notify({ type: "success", message: res.msg });
        this.$router.go(-1);
      } else {
        Notify({ type: "danger", message: res.msg });
      }