1
PC-20250623MANY\Administrator
2025-09-30 9ddad348a549154e7b328f9d7dd9517d2abd330c
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">
@@ -19,6 +13,20 @@
        </div>
        <div class="pagebox_right">
          <van-icon name="arrow" size="1.2em" />
        </div>
      </div>
      <div class="pagebox">
        <div class="pagebox_left">
          {{ $t("sc") }}
        </div>
        <div class="pagebox_right">{{ pages.stockCode }}</div>
      </div>
      <div class="pagebox">
        <div class="pagebox_left">
          {{ $t("類型") }}
        </div>
        <div class="pagebox_right">
          {{ pages.orderDirection == "买涨" ? $t("gm") : $t("hj78") }}
        </div>
      </div>
      <div class="pagebox">
@@ -88,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">
@@ -104,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>
@@ -132,7 +141,9 @@
  data() {
    return {
      pages: {},
      ordernum: ""
      ordernum: "",
      actions: [{ text: this.$t('确定'), key: '1' }, { text: this.$t('取消'), key: '2' }],
      showPopover: false,
    };
  },
  // 生命周期 - 创建完成(访问当前this实例)
@@ -140,7 +151,7 @@
    this.getInfoSite();
  },
  // 生命周期 - 挂载完成(访问DOM元素)
  mounted() {},
  mounted() { },
  methods: {
    handleBack() {
      // 点击返回/
@@ -190,6 +201,22 @@
      } 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 });
      }
    }
  }
};
@@ -197,9 +224,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%;
@@ -212,6 +241,7 @@
  font-size: 0.48rem;
  color: #14181f;
}
.bottomIfr {
  // position: absolute;
  // top: 1.5rem;
@@ -226,6 +256,7 @@
  .buttonbox {
    padding-top: 1.2em;
    padding-bottom: 1.2em;
    /deep/ .van-button--primary {
      background-color: @green;
@@ -234,6 +265,7 @@
    }
  }
}
.pagebox {
  margin: 0 0.6em;
  height: 3.2em;
@@ -257,6 +289,7 @@
    // color: #777777;
    font-size: 0.9em;
  }
  .pagebox_right {
    color: #969799;
  }
@@ -265,12 +298,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;
@@ -279,6 +314,7 @@
    text-align: right;
  }
}
.conentIfr {
  width: 100%;
  height: 90%;