lxf
2025-04-30 b4c4556a5eddf6708ec55b07e3edc15b2217842e
src/page/user/Warehouse/data.list.vue
@@ -116,7 +116,7 @@
            </div>
          </van-col>
        </van-row>
        <van-row>
        <!-- <van-row>
          <van-col span="12">
            <div style="text-align: left">
              <div class="sport-content-title2">
@@ -136,8 +136,8 @@
                {{ 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 }})
@@ -157,7 +157,7 @@
              </div>
            </div>
          </van-col> -->
        </van-row>
        <!-- </van-row> -->
        <van-row>
          <van-col span="12">
            <div style="text-align: left">
@@ -286,6 +286,12 @@
              </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">
            <div style="text-align: center">
              <div class="sport-content-title2">
@@ -318,14 +324,205 @@
          </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 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">
              <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 === 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(() => {
@@ -475,10 +689,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";
      }
@@ -504,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);
@@ -523,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) {
@@ -535,6 +777,8 @@
      this.newdataList = [];
      this.dataList = [];
      if (e.key == 2) {
      }
      if (e.key == 1) {
        clearInterval(this.timer); // 在组件销毁前清除定时器
        // clearTimeout(this.timer);
@@ -569,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";