Browse Source

优化长链重连问题

li.shaoyi 3 năm trước cách đây
mục cha
commit
2ab194cde8

+ 4 - 2
src/services/index.ts

@@ -101,8 +101,6 @@ export default new (class LifeCycleCtr {
                 resolve('ok');
             };
             this.Socket[socket].onClosed = () => {
-                //  清空心跳定时器
-                this.Socket[socket].stopBeatTimer(socket);
                 console.error(`${socket},${ws},断开链接了!`);
             };
             this.Socket[socket].onError = (obj: MTP2WebSocket<Package40> | MTP2WebSocket<Package50>, err: Error) => {
@@ -131,10 +129,14 @@ export default new (class LifeCycleCtr {
     }
     /** 主动关闭行情服务 */
     closeQuote() {
+        //  清空心跳定时器
+        this.Socket['quote'].stopBeatTimer('quote');
         this.Socket['quote'].close();
     }
     /** 主动关闭长链接 */
     closeServer(): void {
+        //  清空心跳定时器
+        this.Socket['trade'].stopBeatTimer('trade');
         this.Socket['trade'].close();
         this.dataCenter.reset();
         // sessionStorage.clear();

+ 160 - 189
src/views/market/spot_trade/components/filter/index.vue

@@ -2,55 +2,26 @@
   <!-- 报表通用过滤 -->
   <div class="filterTable">
     <div class="filter-custom-table">
-      <a-tree-select v-model:value="selectedFT"
-                     @select="changeFT"
-                     style="width: 200px"
-                     :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
-                     :tree-data="FtDeliveryGoods"
-                     placeholder="全部商品"
-                     :showCheckedStrategy="ALL"
-                     tree-default-expand-all></a-tree-select>
-      <a-select label-in-value
-                class="conditionSelect"
-                v-for="(item, index) in wrLsit"
-                :key="index + '11'"
-                style="width: 120px"
-                v-model:value="item.selected"
-                :placeholder="`全部${item.itemtypename}`">
-        <a-select-option v-for="sub in item.itemlst"
-                         :key="sub.dgfactoryitemid">{{sub.dgfactoryitemvalue}}</a-select-option>
+      <a-tree-select v-model:value="selectedFT" @select="changeFT" style="width: 200px" :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" :tree-data="FtDeliveryGoods" placeholder="全部商品" :showCheckedStrategy="ALL" tree-default-expand-all></a-tree-select>
+      <a-select label-in-value class="conditionSelect" v-for="(item, index) in wrLsit" :key="index + '11'" style="width: 120px" v-model:value="item.selected" :placeholder="`全部${item.itemtypename}`">
+        <a-select-option v-for="sub in item.itemlst" :key="sub.dgfactoryitemid">{{sub.dgfactoryitemvalue}}</a-select-option>
       </a-select>
-      <a-space direction="vertical"
-               v-if="!isWR()">
-        <a-month-picker :allowClear="false"
-                        :style="{marginRight: '10px' }"
-                        placeholder="全部交收月"
-                        v-model:value="time"
-                        class="commonDatePicker conditionPicker allDatePicker" />
+      <a-space direction="vertical" v-if="!isWR()">
+        <a-month-picker :allowClear="false" :style="{marginRight: '10px' }" placeholder="全部交收月" v-model:value="time" class="commonDatePicker conditionPicker allDatePicker" />
       </a-space>
-      <a-select class="conditionSelect"
-                v-if="isFloat()"
-                :style="{width: '180px', maxHeight: '400px', overflow: 'auto' }"
-                @change="goodsChange"
-                v-model:value="goodsid"
-                placeholder="全部期货合约">
-        <a-select-option v-for="item in goodsList"
-                         :value="item.goodsid"
-                         :key="item.goodsid">{{item.goodscode}}({{item.goodsname}})
+      <a-select class="conditionSelect" v-if="isFloat()" :style="{width: '180px', maxHeight: '400px', overflow: 'auto' }" @change="goodsChange" v-model:value="goodsid" placeholder="全部期货合约">
+        <a-select-option v-for="item in goodsList" :value="item.goodsid" :key="item.goodsid">{{item.goodscode}}({{item.goodsname}})
         </a-select-option>
       </a-select>
-      <a-button class="btnDeafault"
-                @click="search(true)"
-                style="width: 80px">筛选</a-button>
-      <a-button class="operBtn"
-                @click="listingAction">挂牌求购</a-button>
+      <a-button class="btnDeafault" @click="search(true)" style="width: 80px">筛选</a-button>
+      <a-button class="operBtn" @click="listingAction">挂牌求购</a-button>
     </div>
   </div>
 </template>
 
 <script lang="ts">
 import FilterOption from '@/common/components/filter/index.vue';
-import { defineComponent, onMounted, PropType } from 'vue';
+import { defineComponent, onBeforeUnmount, PropType } from 'vue';
 import { ref } from 'vue';
 import { initData } from '@/common/methods';
 import { handleFtDeliveryGoods } from '../../setup';
@@ -72,167 +43,167 @@ import TimerUtils from '@/utils/timer/timerUtil';
 const ALL = TreeSelect.SHOW_ALL;
 
 interface SelectList extends WrStandardFactoryItemEx {
-    selected: { key: number; label: Object; value: number } | undefined;
+  selected: { key: number; label: Object; value: number } | undefined;
 }
 
 export default defineComponent({
-    name: 'exposure-filter-table',
-    components: { FilterOption },
-    props: {
-        enumName: {
-            default: '',
-            type: String as PropType<EnumRouterName>,
-        },
+  name: 'exposure-filter-table',
+  components: { FilterOption },
+  props: {
+    enumName: {
+      default: '',
+      type: String as PropType<EnumRouterName>,
     },
-    setup(props, context) {
-        const { isWR, isFloat } = handleIs(props.enumName, BuyOrSell.buy);
-        const loading = ref<boolean>(false);
-        // 商品
-        const { FtDeliveryGoods } = handleFtDeliveryGoods();
-        const selectedFT = ref<number>();
+  },
+  setup(props, context) {
+    const { isWR, isFloat } = handleIs(props.enumName, BuyOrSell.buy);
+    const loading = ref<boolean>(false);
+    // 商品
+    const { FtDeliveryGoods } = handleFtDeliveryGoods();
+    const selectedFT = ref<number>();
 
-        // 仓单要素
-        const wrLsit = ref<SelectList[]>([]);
-        function changeFT(value: number, label: any, extra: any) {
-            const children = label?.children;
-            if (Array.isArray(children) && children.length) {
-                TimerUtils.setTimeout(
-                    () => {
-                        selectedFT.value = undefined;
-                        wrLsit.value = [];
-                    },
-                    100,
-                    'filterTimer'
-                );
-            } else {
-                queryWrStandardFactoryItem({ wrstandardid: value }).then((res) => {
-                    const result: SelectList[] = [];
-                    res.forEach((el) => {
-                        result.push({ selected: undefined, ...el });
-                    });
-                    wrLsit.value = result;
-                });
-            }
-        }
+    // 仓单要素
+    const wrLsit = ref<SelectList[]>([]);
+    function changeFT(value: number, label: any, extra: any) {
+      const children = label?.children;
+      if (Array.isArray(children) && children.length) {
+        TimerUtils.setTimeout(
+          () => {
+            selectedFT.value = undefined;
+            wrLsit.value = [];
+          },
+          100,
+          'filterTimer'
+        );
+      } else {
+        queryWrStandardFactoryItem({ wrstandardid: value }).then((res) => {
+          const result: SelectList[] = [];
+          res.forEach((el) => {
+            result.push({ selected: undefined, ...el });
+          });
+          wrLsit.value = result;
+        });
+      }
+    }
 
-        // 全部期货合约
-        const goodsList = getGoodsListByTrade(TradeMode.quote99);
-        const selectedGoods = ref<Goods>();
+    // 全部期货合约
+    const goodsList = getGoodsListByTrade(TradeMode.quote99);
+    const selectedGoods = ref<Goods>();
 
-        const uuid = v4();
-        // 切换商品
-        function goodsChange(id: number) {
-            console.log('id', id);
-            //行情订阅
-            removeSubscribeQuotation(uuid);
-            const goods = goodsList.value.find((e) => e.goodsid === id);
-            selectedGoods.value = goods;
-            const arr = [{ exchangeCode: 250, goodsCode: goods!.goodscode, subState: 0 }];
-            addSubscribeQuotation(uuid, arr);
-            context.emit('filterGoods', id);
-        }
-        onMounted(() => {
-            removeSubscribeQuotation(uuid);
-        });
-        // 交收月
-        const time = ref<Moment>(); // string 交收月
-        // 期货合约
-        const goodsid = ref<number | undefined>(undefined);
-        function search(isQuery: boolean) {
-            const result: any = {};
-            if (selectedFT.value) {
-                //  商品名称(筛选条件)
-                const id = selectedFT.value;
-                result.wrstandardid = id;
-                FtDeliveryGoods.value.forEach((item) => {
-                    item.children?.forEach((el) => {
-                        if (el.key === id) {
-                            //  品种id
-                            result.deliverygoodsid = +(item.key as string).replace('--', '');
-                            result.enumdicname = el.enumdicname;
-                            result.minivalue = el.minivalue;
-                        }
-                    });
-                });
-            }
-            const wrResult: { dgfactoryitemtypeid: number; dgfactoryitemid: number }[] = [];
-            wrLsit.value.forEach((el) => {
-                const { selected, itemtypename, dgfactoryitemtypeid } = el;
-                if (selected) {
-                    const { key } = selected;
-                    if (itemtypename === '仓库') {
-                        result.warehouseid = el.itemlst.find((e) => e.dgfactoryitemid === key)!.warehouseid;
-                    } else {
-                        // 商品要素项名称模糊匹配, 逗号隔开, 如 产地1,品牌1,规格12mm
-                        const name = el.itemlst.find((e) => e.dgfactoryitemid === key)!.dgfactoryitemvalue;
-                        result.dgitemname = result.dgitemname ? `${result.dgitemname},${name}` : name;
-                    }
-                    wrResult.push({ dgfactoryitemtypeid, dgfactoryitemid: key });
-                }
-            });
-            if (!isWR()) {
-                // 预售
-                if (time.value) {
-                    //   交收月(yyyy-mm) 仓单预售填写
-                    result.deliverymonth = moment(time.value).format('YYYY-MM');
-                }
-            }
-            if (isQuery) {
-                context.emit('search', result);
+    const uuid = v4();
+    // 切换商品
+    function goodsChange(id: number) {
+      console.log('id', id);
+      //行情订阅
+      removeSubscribeQuotation(uuid);
+      const goods = goodsList.value.find((e) => e.goodsid === id);
+      selectedGoods.value = goods;
+      const arr = [{ exchangeCode: 250, goodsCode: goods!.goodscode, subState: 0 }];
+      addSubscribeQuotation(uuid, arr);
+      context.emit('filterGoods', id);
+    }
+    onBeforeUnmount(() => {
+      removeSubscribeQuotation(uuid);
+    });
+    // 交收月
+    const time = ref<Moment>(); // string 交收月
+    // 期货合约
+    const goodsid = ref<number | undefined>(undefined);
+    function search(isQuery: boolean) {
+      const result: any = {};
+      if (selectedFT.value) {
+        //  商品名称(筛选条件)
+        const id = selectedFT.value;
+        result.wrstandardid = id;
+        FtDeliveryGoods.value.forEach((item) => {
+          item.children?.forEach((el) => {
+            if (el.key === id) {
+              //  品种id
+              result.deliverygoodsid = +(item.key as string).replace('--', '');
+              result.enumdicname = el.enumdicname;
+              result.minivalue = el.minivalue;
             }
-            result.wrResult = wrResult;
-            return result;
+          });
+        });
+      }
+      const wrResult: { dgfactoryitemtypeid: number; dgfactoryitemid: number }[] = [];
+      wrLsit.value.forEach((el) => {
+        const { selected, itemtypename, dgfactoryitemtypeid } = el;
+        if (selected) {
+          const { key } = selected;
+          if (itemtypename === '仓库') {
+            result.warehouseid = el.itemlst.find((e) => e.dgfactoryitemid === key)!.warehouseid;
+          } else {
+            // 商品要素项名称模糊匹配, 逗号隔开, 如 产地1,品牌1,规格12mm
+            const name = el.itemlst.find((e) => e.dgfactoryitemid === key)!.dgfactoryitemvalue;
+            result.dgitemname = result.dgitemname ? `${result.dgitemname},${name}` : name;
+          }
+          wrResult.push({ dgfactoryitemtypeid, dgfactoryitemid: key });
         }
-        function listingAction() {
-            if (!selectedFT.value) {
-                message.warn('请选中商品!');
-                return;
-            }
-            let flag = true;
-            for (const item of wrLsit.value) {
-                if (!item.selected) {
-                    message.warn(`请选择${item.itemtypename}`);
-                    flag = false;
-                    return;
-                }
-            }
-
-            if (flag) {
-                if (!isWR()) {
-                    if (!time.value) {
-                        message.warn('请选中交收月!');
-                        return;
-                    }
-                }
-                if (isFloat()) {
-                    if (!selectedGoods.value) {
-                        message.warn('请选中期货合约!');
-                        return;
-                    }
-                    const result = getQuoteDayInfoByCodeFindPrice(selectedGoods.value.goodscode);
-                    setGoodsPrice(result);
-                }
-                const result = search(false);
+      });
+      if (!isWR()) {
+        // 预售
+        if (time.value) {
+          //   交收月(yyyy-mm) 仓单预售填写
+          result.deliverymonth = moment(time.value).format('YYYY-MM');
+        }
+      }
+      if (isQuery) {
+        context.emit('search', result);
+      }
+      result.wrResult = wrResult;
+      return result;
+    }
+    function listingAction() {
+      if (!selectedFT.value) {
+        message.warn('请选中商品!');
+        return;
+      }
+      let flag = true;
+      for (const item of wrLsit.value) {
+        if (!item.selected) {
+          message.warn(`请选择${item.itemtypename}`);
+          flag = false;
+          return;
+        }
+      }
 
-                context.emit('buy', result, selectedGoods.value);
-            }
+      if (flag) {
+        if (!isWR()) {
+          if (!time.value) {
+            message.warn('请选中交收月!');
+            return;
+          }
         }
-        return {
-            FtDeliveryGoods,
-            selectedFT,
-            wrLsit,
-            changeFT,
-            search,
-            listingAction,
-            ALL,
-            time,
-            goodsList,
-            goodsChange,
-            isWR,
-            isFloat,
-            goodsid,
-        };
-    },
+        if (isFloat()) {
+          if (!selectedGoods.value) {
+            message.warn('请选中期货合约!');
+            return;
+          }
+          const result = getQuoteDayInfoByCodeFindPrice(selectedGoods.value.goodscode);
+          setGoodsPrice(result);
+        }
+        const result = search(false);
+
+        context.emit('buy', result, selectedGoods.value);
+      }
+    }
+    return {
+      FtDeliveryGoods,
+      selectedFT,
+      wrLsit,
+      changeFT,
+      search,
+      listingAction,
+      ALL,
+      time,
+      goodsList,
+      goodsChange,
+      isWR,
+      isFloat,
+      goodsid,
+    };
+  },
 });
 </script>
 

+ 299 - 410
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_order_summary/components/listed/index.vue

@@ -1,10 +1,6 @@
 <template>
   <!-- 预售仓单 现货明细 挂牌 -->
-  <Drawer :title="'挂牌'"
-          :placement="'right'"
-          class="delistingBottom650"
-          :visible="visible"
-          @cancel="cancel">
+  <Drawer :title="'挂牌'" :placement="'right'" class="delistingBottom650" :visible="visible" @cancel="cancel">
     <div class="listed">
       <div class="condition">
         <a-button class="conditionBtn">{{selectedRow.deliverygoodsname}}</a-button>
@@ -12,20 +8,12 @@
         <a-button class="conditionBtn">{{selectedRow.warehousename}}</a-button>
       </div>
 
-      <a-form class="inlineForm dialogForm"
-              ref="formRef"
-              :model="formState"
-              :rules="rules">
+      <a-form class="inlineForm dialogForm" ref="formRef" :model="formState" :rules="rules">
         <div class="formBar">
           <a-row :gutter="24">
             <a-col :span="12">
-              <a-form-item label="挂牌方式"
-                           name="WRPriceType">
-                <a-select class="inlineFormSelect"
-                          v-model:value="formState.marketid"
-                          @change="handleMarket"
-                          style="width: 140px"
-                          placeholder="请选择挂牌市场">
+              <a-form-item label="挂牌方式" name="WRPriceType">
+                <a-select class="inlineFormSelect" v-model:value="formState.marketid" @change="handleMarket" style="width: 140px" placeholder="请选择挂牌市场">
                   <!-- <a-select-option :value="1">一口价</a-select-option>
                   <a-select-option :value="2">浮动价</a-select-option>
                   <a-select-option :value="3">贸易圈</a-select-option> -->
@@ -34,87 +22,47 @@
               </a-form-item>
             </a-col>
 
-            <a-col :span="12"
-                   v-if="isFixed()">
-              <a-form-item label="挂牌价"
-                           name="FixedPrice">
-                <a-input-number class="dialogInput"
-                                :min="0"
-                                style="width: 140px"
-                                v-model:value="formState.FixedPrice"
-                                placeholder="请输入挂牌价" />
+            <a-col :span="12" v-if="isFixed()">
+              <a-form-item label="挂牌价" name="FixedPrice">
+                <a-input-number class="dialogInput" :min="0" style="width: 140px" v-model:value="formState.FixedPrice" placeholder="请输入挂牌价" />
               </a-form-item>
             </a-col>
-            <a-col :span="12"
-                   v-if="isBlocs()">
-              <a-form-item label="挂牌价格"
-                           name="FixedPrice"
-                           class="inputIconBox">
-                <a-input-number class="commonInput"
-                                style="width: 140px"
-                                :min="0"
-                                v-model:value="formState.FixedPrice" />
-                <a-checkbox class="commonCheckbox"
-                            v-model:checked="priceCheck">可议价</a-checkbox>
+            <a-col :span="12" v-if="isBlocs()">
+              <a-form-item label="挂牌价格" name="FixedPrice" class="inputIconBox">
+                <a-input-number class="commonInput" style="width: 140px" :min="0" v-model:value="formState.FixedPrice" />
+                <a-checkbox class="commonCheckbox" v-model:checked="priceCheck">可议价</a-checkbox>
               </a-form-item>
             </a-col>
 
           </a-row>
-          <a-row :gutter="24"
-                 v-if="isFloat()">
+          <a-row :gutter="24" v-if="isFloat()">
             <a-col :span="24">
-              <a-form-item label="行情商品"
-                           name="goodsid">
+              <a-form-item label="行情商品" name="goodsid">
                 <!-- <a-select class="inlineFormSelect"
                           style="width: 135px"
                           placeholder="请择交易所">
                                 </a-select>-->
-                <a-select class="inlineFormSelect ml5"
-                          @change="handleGoodsGroups"
-                          style="width: 180px"
-                          v-model:value="formState.goodsgroupid"
-                          placeholder="请选择商品">
-                  <a-select-option v-for="item in goodsGroup"
-                                   :value="item.goodsgroupid"
-                                   :key="item.goodsgroupid">{{item.goodsgroupname}}
+                <a-select class="inlineFormSelect ml5" @change="handleGoodsGroups" style="width: 180px" v-model:value="formState.goodsgroupid" placeholder="请选择商品">
+                  <a-select-option v-for="item in goodsGroup" :value="item.goodsgroupid" :key="item.goodsgroupid">{{item.goodsgroupname}}
                   </a-select-option>
                 </a-select>
-                <a-select class="inlineFormSelect ml5"
-                          style="width: 180px"
-                          @change="handleGoodsChange"
-                          v-model:value="formState.goodsid"
-                          placeholder="请选择合约">
-                  <a-select-option v-for="item in goodsList"
-                                   :value="item.goodsid"
-                                   :key="item.goodsid">{{item.goodsname}}</a-select-option>
+                <a-select class="inlineFormSelect ml5" style="width: 180px" @change="handleGoodsChange" v-model:value="formState.goodsid" placeholder="请选择合约">
+                  <a-select-option v-for="item in goodsList" :value="item.goodsid" :key="item.goodsid">{{item.goodsname}}</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
           </a-row>
           <a-row :gutter="24">
             <a-col :span="12">
-              <a-form-item label="挂牌数量"
-                           name="OrderQty">
-                <a-input-number class="dialogInput"
-                                style="width: 140px !important"
-                                :min="0"
-                                v-model:value="formState.OrderQty"
-                                placeholder="请输入挂牌数量" />
+              <a-form-item label="挂牌数量" name="OrderQty">
+                <a-input-number class="dialogInput" style="width: 140px !important" :min="0" v-model:value="formState.OrderQty" placeholder="请输入挂牌数量" />
                 <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
-                <a-checkbox class="commonCheckbox"
-                            v-if="isBlocs()"
-                            v-model:checked="numCheck">整单</a-checkbox>
+                <a-checkbox class="commonCheckbox" v-if="isBlocs()" v-model:checked="numCheck">整单</a-checkbox>
               </a-form-item>
             </a-col>
-            <a-col :span="12"
-                   v-if="!numCheck">
-              <a-form-item label="起摘数量"
-                           class="relative"
-                           name="DelistMinQty">
-                <a-input-number class="commonInput"
-                                :min="0"
-                                v-model:value="formState.DelistMinQty"
-                                style="width: 140px !important" />
+            <a-col :span="12" v-if="!numCheck">
+              <a-form-item label="起摘数量" class="relative" name="DelistMinQty">
+                <a-input-number class="commonInput" :min="0" v-model:value="formState.DelistMinQty" style="width: 140px !important" />
                 <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
                 <div class="tip-listing">
                   <span>最小单位:</span>
@@ -124,14 +72,9 @@
             </a-col>
           </a-row>
           <a-row :gutter="24">
-            <a-col :span="12"
-                   class="mt-20">
+            <a-col :span="12" class="mt-20">
               <a-form-item>
-                <a-slider v-model:value="formState.OrderQty"
-                          :min="0"
-                          :max="selectedRow.enableqty"
-                          class="formSlider"
-                          style="width: 140px;" />
+                <a-slider v-model:value="formState.OrderQty" :min="0" :max="selectedRow.enableqty" class="formSlider" style="width: 140px;" />
                 <div class="unit">
                   <span>0</span>
                   <span>{{selectedRow.enableqty}}{{selectedRow.enumdicname}}</span>
@@ -142,118 +85,79 @@
           </a-row>
           <a-row :gutter="24">
             <a-col :span="12">
-              <a-form-item label="交收月"
-                           name="DeliveryMonth">
-                <a-month-picker style="width: 140px"
-                                v-model:value="formState.DeliveryMonth"
-                                :allowClear="false"
-                                class="commonDatePicker dialogDatePicker" />
+              <a-form-item label="交收月" name="DeliveryMonth">
+                <a-month-picker style="width: 140px" v-model:value="formState.DeliveryMonth" :allowClear="false" class="commonDatePicker dialogDatePicker" />
               </a-form-item>
             </a-col>
-            <a-col :span="12"
-                   v-if="isFloat()">
-              <a-form-item label="基差"
-                           name="PriceMove">
-                <a-input-number class="commonInput"
-                                v-model:value="formState.PriceMove"
-                                style="width: 140px" />
+            <a-col :span="12" v-if="isFloat()">
+              <a-form-item label="基差" name="PriceMove">
+                <a-input-number class="commonInput" v-model:value="formState.PriceMove" style="width: 140px" />
               </a-form-item>
             </a-col>
           </a-row>
-            <a-row :gutter="24">
-              <a-col :span="12">
-                <a-form-item label="履约保证金"
-                             name="margin">
-                  <a-input-number class="commonInput"
-                                  v-model:value="formState.margin"
-                                  :min="0"
-                                  style="width: 140px" />
-                  <span class="input-enumdicname">%</span>
-                </a-form-item>
-              </a-col>
-              <a-col :span="12">
-                <a-form-item label="挂牌有效期"
-                             name="vidaliteTime"
-                             class="inputIconBox">
-                  <a-date-picker style="width: 140px"
-                                 v-model:value="formState.vidaliteTime"
-                                 :allowClear="false"
-                                 class="commonDatePicker dialogDatePicker" />
-                </a-form-item>
-              </a-col>
-            </a-row>
-            <a-row :gutter="24">
+          <a-row :gutter="24">
+            <a-col :span="12">
+              <a-form-item label="履约保证金" name="margin">
+                <a-input-number class="commonInput" v-model:value="formState.margin" :min="0" style="width: 140px" />
+                <span class="input-enumdicname">%</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-item label="挂牌有效期" name="vidaliteTime" class="inputIconBox">
+                <a-date-picker style="width: 140px" v-model:value="formState.vidaliteTime" :allowClear="false" class="commonDatePicker dialogDatePicker" />
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="12">
+              <a-form-item label="履约模板" class="inputIconBox">
+                <span :class="['clickBox', formState.permanceTempName ? 'white' : '']" style="width: 140px" @click="handlePermance">{{formState.permanceTempName ? formState.permanceTempName : '选择履约模板'}}</span>
+                <svg class="icon svg-icon" aria-hidden="true" @click="handlePermance">
+                  <use xlink:href="#icon-moban" />
+                </svg>
+              </a-form-item>
+            </a-col>
+            <template v-if="isBlocs()">
               <a-col :span="12">
-                <a-form-item label="履约模板"
-                             class="inputIconBox">
-                  <span :class="['clickBox', formState.permanceTempName ? 'white' : '']"
-                        style="width: 140px"
-                        @click="handlePermance">{{formState.permanceTempName ? formState.permanceTempName : '选择履约模板'}}</span>
-                  <svg class="icon svg-icon"
-                       aria-hidden="true"
-                       @click="handlePermance">
-                    <use xlink:href="#icon-moban" />
+                <a-form-item label="指定朋友" class="inputIconBox">
+                  <span :class="['clickBox', getFriendLength() ? 'white' : '']" style="width: 140px" @click="openFriend">{{getFriendLength() ? `已选${getFriendLength() }人` : '选择朋友'}}</span>
+                  <svg class="icon svg-icon" aria-hidden="true" @click="openFriend">
+                    <use xlink:href="#icon-pengyou1" />
                   </svg>
+                  <a-checkbox class="commonCheckbox" v-model:checked="friendCheck" @change="limiteFriends">不限</a-checkbox>
                 </a-form-item>
               </a-col>
-              <template v-if="isBlocs()">
-                <a-col :span="12">
-                  <a-form-item label="指定朋友"
-                              class="inputIconBox">
-                    <span :class="['clickBox', getFriendLength() ? 'white' : '']"
-                          style="width: 140px"
-                          @click="openFriend">{{getFriendLength() ? `已选${getFriendLength() }人` : '选择朋友'}}</span>
-                    <svg class="icon svg-icon"
-                        aria-hidden="true"
-                        @click="openFriend">
-                      <use xlink:href="#icon-pengyou1" />
-                    </svg>
-                    <a-checkbox class="commonCheckbox"
-                                v-model:checked="friendCheck"
-                                @change="limiteFriends">不限</a-checkbox>
-                  </a-form-item>
-                </a-col>
-              </template>
-            </a-row>
+            </template>
+          </a-row>
           <a-row :gutter="24">
-            <a-col :span="24"
-                   v-if="isFloat()"
-                   class="relative">
+            <a-col :span="24" v-if="isFloat()" class="relative">
               <a-form-item :label="'估算价'">
                 <span class="white ml8">{{getPrice()}}</span>
               </a-form-item>
             </a-col>
           </a-row>
           <a-row :gutter="24">
-            <a-col :span="24"
-                   v-if="isFloat()"
-                   class="relative">
+            <a-col :span="24" v-if="isFloat()" class="relative">
               <a-form-item :label="'估算金额'">
                 <span class="white ml8">{{getWrMoney()}}</span>
               </a-form-item>
             </a-col>
-            <a-col :span="24"
-                   v-if="isFixed()"
-                   class="relative">
+            <a-col :span="24" v-if="isFixed()" class="relative">
               <a-form-item :label="'挂牌金额'">
                 <span class="white ml8">{{getWrMoney()}}</span>
               </a-form-item>
             </a-col>
-            <a-col :span="24"
-                   v-if="isBlocs()"
-                   class="relative">
+            <a-col :span="24" v-if="isBlocs()" class="relative">
               <a-form-item :label="'挂牌金额'">
                 <span class="white ml8">{{getMoney()}}</span>
               </a-form-item>
             </a-col>
-            <a-col :span="24"
-                   v-if="getWrMargin() && !isBlocs()">
+            <a-col :span="24" v-if="getWrMargin() && !isBlocs()">
               <a-form-item :label="getWrMargin() ? '履约保证金' : ''">
                 <span class="white ml8">{{getWrMargin()}}</span>
               </a-form-item>
             </a-col>
-            <a-col :span="24"
-                   v-if="isBlocs()">
+            <a-col :span="24" v-if="isBlocs()">
               <a-form-item label="履约保证金">
                 <span class="white ml8">{{getMargin()}}</span>
               </a-form-item>
@@ -266,17 +170,10 @@
           </a-row>
         </div>
         <a-row :gutter="24">
-          <a-col :span="24"
-                 class="fixedBtns">
+          <a-col :span="24" class="fixedBtns">
             <a-form-item class="btnCenter">
-              <a-button class="listedBtn"
-                        :loading="loading"
-                        :disabled="loading"
-                        @click="submit">卖出</a-button>
-              <a-button class="ml10 cancelBtn"
-                        :loading="loading"
-                        :disabled="loading"
-                        @click="cancel">取消</a-button>
+              <a-button class="listedBtn" :loading="loading" :disabled="loading" @click="submit">卖出</a-button>
+              <a-button class="ml10 cancelBtn" :loading="loading" :disabled="loading" @click="cancel">取消</a-button>
             </a-form-item>
           </a-col>
         </a-row>
@@ -284,17 +181,9 @@
     </div>
   </Drawer>
   <!-- 选择朋友 -->
-  <Friend v-if="showFriend"
-          :friends="formState.friends"
-          :position="'bottom'"
-          @cancel="chooseFriend"
-          @update="chooseFriend" />
+  <Friend v-if="showFriend" :friends="formState.friends" :position="'bottom'" @cancel="chooseFriend" @update="chooseFriend" />
   <!-- 选择履约模板 -->
-  <Permance v-if="showPermance"
-            :position="'bottom'"
-            :marketid="formState.marketid"
-            @cancel="choosePermance"
-            @update="choosePermance" />
+  <Permance v-if="showPermance" :position="'bottom'" :marketid="formState.marketid" @cancel="choosePermance" @update="choosePermance" />
 </template>
 
 <script lang="ts">
@@ -318,255 +207,255 @@ import Bus from '@/utils/eventBus';
 import { message } from 'ant-design-vue';
 import moment from 'moment';
 import { v4 as uuidv4, v4 } from 'uuid';
-import { defineComponent, onMounted, PropType, ref } from 'vue';
+import { defineComponent, onBeforeUnmount, PropType, ref } from 'vue';
 import { ListingForm } from './interface';
 import { handleForm, handleGoods, handleNumAndPrice, queryMarketSection } from './setup';
 
 export default defineComponent({
-    name: ModalEnum.spot_warrant_spot_details_listed,
-    components: { Drawer, Friend, Permance },
-    emits: ['cancel', 'update'],
-    props: {
-        selectedRow: {
-            type: Object as PropType<WrPosition>,
-            default: {},
-        },
+  name: ModalEnum.spot_warrant_spot_details_listed,
+  components: { Drawer, Friend, Permance },
+  emits: ['cancel', 'update'],
+  props: {
+    selectedRow: {
+      type: Object as PropType<WrPosition>,
+      default: {},
     },
-    setup(props, context) {
-        const loading = ref<boolean>(false);
-        const { visible, cancel } = _closeModal(context);
-        const { rules, formState, formRef } = handleForm(props.selectedRow);
+  },
+  setup(props, context) {
+    const loading = ref<boolean>(false);
+    const { visible, cancel } = _closeModal(context);
+    const { rules, formState, formRef } = handleForm(props.selectedRow);
 
-        // 选择朋友
-        const { friendCheck, showFriend, chooseFriend, openFriend, getFriendLength, limiteFriends } = useBlocksFriends(formState);
-        // 履约模板
-        const { showPermance, choosePermance, openPermance } = useBlocksPermaceTemp(formState);
-        // 价格
-        const { priceCheck, increasePrice, decreasePrice } = useBlocksPrice(formState);
-        // 摘牌数量
-        const { numCheck, increaseNumber, decreaseNumber } = useBlocksNumber(formState);
+    // 选择朋友
+    const { friendCheck, showFriend, chooseFriend, openFriend, getFriendLength, limiteFriends } = useBlocksFriends(formState);
+    // 履约模板
+    const { showPermance, choosePermance, openPermance } = useBlocksPermaceTemp(formState);
+    // 价格
+    const { priceCheck, increasePrice, decreasePrice } = useBlocksPrice(formState);
+    // 摘牌数量
+    const { numCheck, increaseNumber, decreaseNumber } = useBlocksNumber(formState);
 
-        const { goodsGroup, goodsList, groupsChange, findGoodsCode } = handleGoods();
+    const { goodsGroup, goodsList, groupsChange, findGoodsCode } = handleGoods();
 
-        // 获取仓单贸易市场
-        const { spotMarkets } = queryMarketSection(true)
+    // 获取仓单贸易市场
+    const { spotMarkets } = queryMarketSection(true)
 
-        // 切换市场
-        function handleMarket(value: number) {
-          const market = spotMarkets.value.find(item => item.marketid === value)
-          if (!market) return
+    // 切换市场
+    function handleMarket(value: number) {
+      const market = spotMarkets.value.find(item => item.marketid === value)
+      if (!market) return
 
-          // 判断所选择市场挂牌方式 1:一口价 2:浮动价 3:贸易圈 4:协议指定
-          if (market.listingmode === 1) {
-            formState.WRPriceType = 1
-          } else if (market.listingmode === 2) {
-            formState.WRPriceType = 2
-          } else {
-            formState.WRPriceType = 3
-          }
-        }
+      // 判断所选择市场挂牌方式 1:一口价 2:浮动价 3:贸易圈 4:协议指定
+      if (market.listingmode === 1) {
+        formState.WRPriceType = 1
+      } else if (market.listingmode === 2) {
+        formState.WRPriceType = 2
+      } else {
+        formState.WRPriceType = 3
+      }
+    }
 
-        // 点选履约模板
-        function handlePermance() {
-          // 必须先选择市场再选择对应的履约模板
-          if (!formState.marketid) {
-            message.info('请先选择市场')
-            return
-          }
+    // 点选履约模板
+    function handlePermance() {
+      // 必须先选择市场再选择对应的履约模板
+      if (!formState.marketid) {
+        message.info('请先选择市场')
+        return
+      }
 
-          openPermance()
-        }
+      openPermance()
+    }
 
 
-        // 切换商品组
-        function handleGoodsGroups(value: number) {
-            formState.goodsid = undefined;
-            groupsChange(value);
-            // formRef.value.validate();
-        }
-        const uuid = v4();
-        const goodsCode = ref<string>('');
-        // 切换商品
-        function handleGoodsChange(id: number) {
-            //行情订阅
-            removeSubscribeQuotation(uuid);
-            goodsCode.value = goodsList.value.find((e) => e.goodsid === id)?.goodscode as string;
-            const arr = [{ exchangeCode: 250, goodsCode: goodsCode.value, subState: 0 }];
-            addSubscribeQuotation(uuid, arr);
-            formRef.value.validate();
+    // 切换商品组
+    function handleGoodsGroups(value: number) {
+      formState.goodsid = undefined;
+      groupsChange(value);
+      // formRef.value.validate();
+    }
+    const uuid = v4();
+    const goodsCode = ref<string>('');
+    // 切换商品
+    function handleGoodsChange(id: number) {
+      //行情订阅
+      removeSubscribeQuotation(uuid);
+      goodsCode.value = goodsList.value.find((e) => e.goodsid === id)?.goodscode as string;
+      const arr = [{ exchangeCode: 250, goodsCode: goodsCode.value, subState: 0 }];
+      addSubscribeQuotation(uuid, arr);
+      formRef.value.validate();
+    }
+    // 估算价
+    // 估算价
+    function getPrice() {
+      let result = '--';
+      if (goodsCode.value) {
+        const goodsPrice = getQuoteDayInfoByCodeFindPrice(goodsCode.value);
+        if (goodsPrice && goodsPrice !== '--') {
+          // 有实时行情价格
+          result = ((goodsPrice as number) + formState.PriceMove).toFixed(2);
         }
-        // 估算价
-        // 估算价
-        function getPrice() {
-            let result = '--';
-            if (goodsCode.value) {
-                const goodsPrice = getQuoteDayInfoByCodeFindPrice(goodsCode.value);
-                if (goodsPrice && goodsPrice !== '--') {
-                    // 有实时行情价格
-                    result = ((goodsPrice as number) + formState.PriceMove).toFixed(2);
-                }
-            }
+      }
 
-            return result;
-        }
-        onMounted(() => {
-            removeSubscribeQuotation(uuid);
-        });
-        const { getWrMoney, getWrMargin, isFloat, isFixed, isBlocs } = handleNumAndPrice();
-        // 处理内部资金账号
-        function handleSelectedAccount() {
-            const item = getSelectedAccount();
-            const list = getAccountTypeList([2]);
-            return item.taaccounttype === 2 ? item : list[0];
-        }
-        function submit() {
-            // 市场信息
-            if (!formState.marketid) { 
-              message.info("请选择市场")
-              return
-            }
+      return result;
+    }
+    onBeforeUnmount(() => {
+      removeSubscribeQuotation(uuid);
+    });
+    const { getWrMoney, getWrMargin, isFloat, isFixed, isBlocs } = handleNumAndPrice();
+    // 处理内部资金账号
+    function handleSelectedAccount() {
+      const item = getSelectedAccount();
+      const list = getAccountTypeList([2]);
+      return item.taaccounttype === 2 ? item : list[0];
+    }
+    function submit() {
+      // 市场信息
+      if (!formState.marketid) {
+        message.info("请选择市场")
+        return
+      }
 
-            // const marketInfo = getMarketRunByTradeMode(17);
-            const market = spotMarkets.value.find(item => item.marketid === formState.marketid)
-            if (!market) {
-              message.info("市场信息异常,请稍后重试")
-              return
-            }
+      // const marketInfo = getMarketRunByTradeMode(17);
+      const market = spotMarkets.value.find(item => item.marketid === formState.marketid)
+      if (!market) {
+        message.info("市场信息异常,请稍后重试")
+        return
+      }
 
-            // 履约模板
-            if (!formState.permanceTempName) {
-              message.info('请选择履约模板')
-              return
-            }
+      // 履约模板
+      if (!formState.permanceTempName) {
+        message.info('请选择履约模板')
+        return
+      }
 
-            const marketInfo = getMarketRunByTradeMode(market!.trademode)
-            if (marketInfo) {
-                // 无仓单挂牌
-                validateAction<ListingForm>(formRef, formState).then((res) => {
-                    const wrGoodsInfo: WRGoodsInfo = {
-                        GoodsID: props.selectedRow.deliverygoodsid as number, // uint32 配置商品ID
-                        GoodsCode: findGoodsCode(res.goodsid as number) as string, // string 配置商品代码
-                        PriceFactor: 1, // double 商品价格系数
-                        PriceMove: 0, // double 商品升贴水值
-                        WeightRatio: 1, // double 商品重量系数
-                    };
-                    const param = {
-                        AccountID: getInTaAccount(),
-                        ClientSerialNo: uuidv4(), // 客户端流水号
-                        // OperateSrc: 2,
-                        ClientType: 4,
-                        MarketID: formState.marketid,
-                        LadingBillId: props.selectedRow.ladingbillid ? props.selectedRow.ladingbillid : 0, // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
-                        // LadingBillId: 'uint642081626946446000001', // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
-                        TradeDate: moment(marketInfo.tradedate).format('YYYYMMDD'), // 交易日 string
-                        // SubNum: '0', // 提单子单号
-                        SubNum: props.selectedRow.subnum ? props.selectedRow.subnum : 0,
-                        // WRFactorTypeId: '2121626946446000001', // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
-                        WRFactorTypeId: props.selectedRow.wrfactortypeid, // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
-                        IsSpecified: 0, // 是否指定对手 0:不指定 1:指定 uint32
-                        MatchAccIDs: [], // 仓单贸易对手资金账号ID集合(指定对手时填写) uint32
-                        OrderQty: res.OrderQty, // 委托数量(可挂部分数据量) ======
-                        DeliveryGoodsID: props.selectedRow.deliverygoodsid, // 交割商品商品ID
-                        WRPriceType: res.WRPriceType, // 价格方式 1:固定价 2:浮动价
-                        FixedPrice: res.FixedPrice, // 固定价格
-                        PriceFactor: 1, // 价格系数(浮动价时填写)
-                        PriceMove: res.PriceMove, // 升贴水(浮动价时填写)
-                        TimevalidType: 4, // 时间有效类型 1:当日有效 2:本周有效 3:指定时间有效 4:一直有效
-                        // ValidTime: moment('2021-08-25 00:00:00').format('YYYY-MM-DD HH:mm:ss'), // 有效期限
-                        ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'),
-                        FirstRatio: 0, // 首付比例
-                        PerformanceTemplateID: res.permaceTempId, // 履约计划模板ID
-                        UserID: getUserId(),
-                        OperatorID: getUserId(), // 操作员账号ID
-                        BuyOrSell: BuyOrSell.sell, // 买卖方向 0买1卖
-                        PriceDisplayMode: 1, // 浮动价显示方式 1:合并显示 2:分开显示
-                        CanBargain: priceCheck.value ? 1 : 0, // 挂牌是否可议价0:不可1:可-摘牌是否议价
-                        Attachment1: '', // 附件1
-                        Attachment2: '', // 附件2
-                        Remark: '', // 备注
-                        ApplyID: 0, // 申请ID
-                        CanPart: numCheck.value ? 0 : 1, // 是否允许部份摘牌0:不允许;1:允许
-                        WRTradeGoods: [wrGoodsInfo],
-                        wrstandardid: props.selectedRow.wrstandardid,
-                        DeliveryMonth: moment(res.DeliveryMonth).format('YYYY-MM'), // string 交收月
-                        HasWr: 0, // 0 无仓单  1: 有仓单
-                        MarginFlag: 0,
-                        DelistMinQty: res.DelistMinQty, // 起摘数量
-                    };
-                    if (isBlocs()) {
-                        // 贸易圈 是后加的, 处理贸易圈
-                        // if (!formState.permanceTempName) {
-                        //     message.error('请选择履约模板');
-                        //     return;
-                        // }
-                        if (!friendCheck.value) {
-                            if (formState.friends.length === 0) {
-                                message.error('请选择朋友');
-                                return;
-                            }
-                        }
-                        const obj = {
-                            IsSpecified: 1,
-                            MatchAccIDs: res.friends,
-                            WRPriceType: 1,
-                            TimevalidType: 3, // 时间有效类型 1:当日有效 2:本周有效 3:指定时间有效 4:一直有效
-                            MarginFlag: 1, // 挂牌是否指定保证金 0:否 1:是
-                            MarginAlgorithm: 1, // 指定保证金方式 1:比率 2:固定
-                            ValidTime: moment(res.vidaliteTime).format('YYYY-MM-DD HH:mm:ss'), // 有效期限
-                            MarginValue: +(formState.margin / 100).toFixed(2), // 指定保证金设置值
-                            AllFriendsFlag: friendCheck.value ? 1 : 0, //是否全好友可见 0:否 1:是
-                        };
-                        Object.assign(param, obj);
-                    }
-                    requestResultLoadingAndInfo(hdWROrder, param, loading, ['挂牌成功', '挂牌失败:']).then(() => {
-                        Bus.$emit('spotTrade', true);
-                        cancel(true);
-                    });
-                });
+      const marketInfo = getMarketRunByTradeMode(market!.trademode)
+      if (marketInfo) {
+        // 无仓单挂牌
+        validateAction<ListingForm>(formRef, formState).then((res) => {
+          const wrGoodsInfo: WRGoodsInfo = {
+            GoodsID: props.selectedRow.deliverygoodsid as number, // uint32 配置商品ID
+            GoodsCode: findGoodsCode(res.goodsid as number) as string, // string 配置商品代码
+            PriceFactor: 1, // double 商品价格系数
+            PriceMove: 0, // double 商品升贴水值
+            WeightRatio: 1, // double 商品重量系数
+          };
+          const param = {
+            AccountID: getInTaAccount(),
+            ClientSerialNo: uuidv4(), // 客户端流水号
+            // OperateSrc: 2,
+            ClientType: 4,
+            MarketID: formState.marketid,
+            LadingBillId: props.selectedRow.ladingbillid ? props.selectedRow.ladingbillid : 0, // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
+            // LadingBillId: 'uint642081626946446000001', // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
+            TradeDate: moment(marketInfo.tradedate).format('YYYYMMDD'), // 交易日 string
+            // SubNum: '0', // 提单子单号
+            SubNum: props.selectedRow.subnum ? props.selectedRow.subnum : 0,
+            // WRFactorTypeId: '2121626946446000001', // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
+            WRFactorTypeId: props.selectedRow.wrfactortypeid, // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
+            IsSpecified: 0, // 是否指定对手 0:不指定 1:指定 uint32
+            MatchAccIDs: [], // 仓单贸易对手资金账号ID集合(指定对手时填写) uint32
+            OrderQty: res.OrderQty, // 委托数量(可挂部分数据量) ======
+            DeliveryGoodsID: props.selectedRow.deliverygoodsid, // 交割商品商品ID
+            WRPriceType: res.WRPriceType, // 价格方式 1:固定价 2:浮动价
+            FixedPrice: res.FixedPrice, // 固定价格
+            PriceFactor: 1, // 价格系数(浮动价时填写)
+            PriceMove: res.PriceMove, // 升贴水(浮动价时填写)
+            TimevalidType: 4, // 时间有效类型 1:当日有效 2:本周有效 3:指定时间有效 4:一直有效
+            // ValidTime: moment('2021-08-25 00:00:00').format('YYYY-MM-DD HH:mm:ss'), // 有效期限
+            ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'),
+            FirstRatio: 0, // 首付比例
+            PerformanceTemplateID: res.permaceTempId, // 履约计划模板ID
+            UserID: getUserId(),
+            OperatorID: getUserId(), // 操作员账号ID
+            BuyOrSell: BuyOrSell.sell, // 买卖方向 0买1卖
+            PriceDisplayMode: 1, // 浮动价显示方式 1:合并显示 2:分开显示
+            CanBargain: priceCheck.value ? 1 : 0, // 挂牌是否可议价0:不可1:可-摘牌是否议价
+            Attachment1: '', // 附件1
+            Attachment2: '', // 附件2
+            Remark: '', // 备注
+            ApplyID: 0, // 申请ID
+            CanPart: numCheck.value ? 0 : 1, // 是否允许部份摘牌0:不允许;1:允许
+            WRTradeGoods: [wrGoodsInfo],
+            wrstandardid: props.selectedRow.wrstandardid,
+            DeliveryMonth: moment(res.DeliveryMonth).format('YYYY-MM'), // string 交收月
+            HasWr: 0, // 0 无仓单  1: 有仓单
+            MarginFlag: 0,
+            DelistMinQty: res.DelistMinQty, // 起摘数量
+          };
+          if (isBlocs()) {
+            // 贸易圈 是后加的, 处理贸易圈
+            // if (!formState.permanceTempName) {
+            //     message.error('请选择履约模板');
+            //     return;
+            // }
+            if (!friendCheck.value) {
+              if (formState.friends.length === 0) {
+                message.error('请选择朋友');
+                return;
+              }
             }
-        }
+            const obj = {
+              IsSpecified: 1,
+              MatchAccIDs: res.friends,
+              WRPriceType: 1,
+              TimevalidType: 3, // 时间有效类型 1:当日有效 2:本周有效 3:指定时间有效 4:一直有效
+              MarginFlag: 1, // 挂牌是否指定保证金 0:否 1:是
+              MarginAlgorithm: 1, // 指定保证金方式 1:比率 2:固定
+              ValidTime: moment(res.vidaliteTime).format('YYYY-MM-DD HH:mm:ss'), // 有效期限
+              MarginValue: +(formState.margin / 100).toFixed(2), // 指定保证金设置值
+              AllFriendsFlag: friendCheck.value ? 1 : 0, //是否全好友可见 0:否 1:是
+            };
+            Object.assign(param, obj);
+          }
+          requestResultLoadingAndInfo(hdWROrder, param, loading, ['挂牌成功', '挂牌失败:']).then(() => {
+            Bus.$emit('spotTrade', true);
+            cancel(true);
+          });
+        });
+      }
+    }
 
-        return {
-            submit,
-            visible,
-            cancel,
-            loading,
-            rules,
-            formState,
-            formRef,
-            goodsGroup,
-            goodsList,
-            handleGoodsGroups,
-            handleGoodsChange,
-            getWrMoney,
-            getWrMargin,
-            isFloat,
-            isFixed,
-            isBlocs,
-            getCanUseMoney,
-            priceCheck,
-            increasePrice,
-            decreasePrice,
-            ...useBlocksAccount(formState),
-            ...useBlocksMoney(formState),
-            showPermance,
-            choosePermance,
-            openPermance,
-            numCheck,
-            increaseNumber,
-            decreaseNumber,
-            friendCheck,
-            showFriend,
-            chooseFriend,
-            openFriend,
-            getFriendLength,
-            limiteFriends,
-            getPrice,
-            spotMarkets,
-            handleMarket,
-            handlePermance,
-        };
-    },
+    return {
+      submit,
+      visible,
+      cancel,
+      loading,
+      rules,
+      formState,
+      formRef,
+      goodsGroup,
+      goodsList,
+      handleGoodsGroups,
+      handleGoodsChange,
+      getWrMoney,
+      getWrMargin,
+      isFloat,
+      isFixed,
+      isBlocs,
+      getCanUseMoney,
+      priceCheck,
+      increasePrice,
+      decreasePrice,
+      ...useBlocksAccount(formState),
+      ...useBlocksMoney(formState),
+      showPermance,
+      choosePermance,
+      openPermance,
+      numCheck,
+      increaseNumber,
+      decreaseNumber,
+      friendCheck,
+      showFriend,
+      chooseFriend,
+      openFriend,
+      getFriendLength,
+      limiteFriends,
+      getPrice,
+      spotMarkets,
+      handleMarket,
+      handlePermance,
+    };
+  },
 });
 </script>
 

+ 15 - 15
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/index.vue

@@ -81,19 +81,19 @@
             <a-col :span="12">&nbsp;</a-col>
           </a-row>
           <template v-if="isBlocs()">
-          <a-row :gutter="24">
-            <a-col :span="12">
-              <a-form-item label="履约保证金" name="margin">
-                <a-input-number class="commonInput" v-model:value="formState.margin" :min="0" style="width: 140px" />
-                <span class="input-enumdicname">%</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="12">
-              <a-form-item label="挂牌有效期" name="vidaliteTime" class="inputIconBox">
-                <a-date-picker style="width: 140px" v-model:value="formState.vidaliteTime" :allowClear="false" class="commonDatePicker dialogDatePicker" />
-              </a-form-item>
-            </a-col>
-          </a-row>
+            <a-row :gutter="24">
+              <a-col :span="12">
+                <a-form-item label="履约保证金" name="margin">
+                  <a-input-number class="commonInput" v-model:value="formState.margin" :min="0" style="width: 140px" />
+                  <span class="input-enumdicname">%</span>
+                </a-form-item>
+              </a-col>
+              <a-col :span="12">
+                <a-form-item label="挂牌有效期" name="vidaliteTime" class="inputIconBox">
+                  <a-date-picker style="width: 140px" v-model:value="formState.vidaliteTime" :allowClear="false" class="commonDatePicker dialogDatePicker" />
+                </a-form-item>
+              </a-col>
+            </a-row>
           </template>
           <a-row :gutter="24">
             <a-col :span="12">
@@ -201,7 +201,7 @@ import Bus from '@/utils/eventBus/index';
 import { message } from 'ant-design-vue';
 import moment from 'moment';
 import { v4 } from 'uuid';
-import { defineComponent, onMounted, PropType, ref } from 'vue';
+import { defineComponent, onBeforeUnmount, PropType, ref } from 'vue';
 import { ListingForm } from './interface';
 import { handleForm, handleGoods, handleNumAndPrice, queryMarketSection } from './setup';
 
@@ -290,7 +290,7 @@ export default defineComponent({
 
       return result;
     }
-    onMounted(() => {
+    onBeforeUnmount(() => {
       removeSubscribeQuotation(uuid);
     });
     const { getWrMoney, getWrMargin, isFloat, isFixed, isBlocs } = handleNumAndPrice();