Переглянути джерело

修改 协议单 弹窗按钮 code

huangbin 4 роки тому
батько
коміт
fb54f5a75a

+ 92 - 87
src/views/order/swap_the_order/components/swap_commodity_contract_bargain/index.vue

@@ -1,41 +1,44 @@
 <template>
   <!-- 商品订单 - 议价单 -->
   <section>
-    <a-table :columns="columns"
-             class="srcollYTable expandLeftTable"
-             :scroll="{ x: '100%', y: '190px' }"
-             :pagination="false"
-             :loading="loading"
-             :expandedRowKeys="expandedRowKeys"
-             :customRow="Rowclick"
-             :expandIcon="expandIcon"
-             :expandIconAsCell="false"
-             rowKey="key"
-             :data-source="tableList">
+    <a-table
+      :columns="columns"
+      class="srcollYTable expandLeftTable"
+      :scroll="{ x: '100%', y: '190px' }"
+      :pagination="false"
+      :loading="loading"
+      :expandedRowKeys="expandedRowKeys"
+      :customRow="Rowclick"
+      :expandIcon="expandIcon"
+      :expandIconAsCell="false"
+      rowKey="key"
+      :data-source="tableList"
+    >
       <!-- 额外的展开行 -->
-      <template v-if="btnList.length"
-                #expandedRowRender="{ record }">
-        <BtnList :btnList="handleBtnList(record, btnList)"
-                 :record="record"
-                 class="btn-list-sticky"
-                 @click="openComponent" />
+      <template v-if="btnList.length" #expandedRowRender="{ record }">
+        <BtnList
+          :btnList="handleBtnList(record, btnList)"
+          :record="record"
+          class="btn-list-sticky"
+          @click="openComponent"
+        />
       </template>
       <template #applytime="{ text }">
         <span>{{ formatTime(text) }}</span>
       </template>
-      <template #transferamount="{ record , text}">
+      <template #transferamount="{ record, text }">
         <div>
           <!-- 审核拒绝 -->
-          <a-tooltip placement="bottom"
-                     v-if="record.applystatus === 4"
-                     overlayClassName="toolTipTableColumn">
+          <a-tooltip
+            placement="bottom"
+            v-if="record.applystatus === 4"
+            overlayClassName="toolTipTableColumn"
+          >
             <template #title>
               <span>{{ getScfContractStatusName(text) }}</span>
             </template>
-            <span
-                  :class="record.applystatus === 4 ? 'red' : 'white'">{{ record.transferamount }}</span>
-            <ExclamationCircleOutlined class="ml10 red"
-                                       v-if="record.applystatus === 4" />
+            <span :class="record.applystatus === 4 ? 'red' : 'white'">{{ record.transferamount }}</span>
+            <ExclamationCircleOutlined class="ml10 red" v-if="record.applystatus === 4" />
           </a-tooltip>
           <span v-else>{{ record.transferamount }}</span>
         </div>
@@ -47,11 +50,13 @@
         <span>{{ getScfContractStatusName(text) }}</span>
       </template>
     </a-table>
-    <component :is="componentId"
-               v-if="componentId"
-               :selectedRow="selectedRow"
-               :tableList="tableList"
-               @cancel="closeComponent"></component>
+    <component
+      :is="componentId"
+      v-if="componentId"
+      :selectedRow="selectedRow"
+      :tableList="tableList"
+      @cancel="closeComponent"
+    ></component>
   </section>
 </template>
 
@@ -76,64 +81,64 @@ import { ref } from 'vue';
 import { columns } from './setup';
 
 export default defineComponent({
-    name: 'commodity_contract_bargain',
-    components: {
-        ExclamationCircleOutlined,
-        BtnList,
-        commodity_contract_bargain_submit_order: defineAsyncComponent(() => import('./components/commodity_contract_bargain_submit_order/index.vue')),
-        commodity_contract_bargain_cancel_order: defineAsyncComponent(() => import('./components/commodity_contract_bargain_cancel_order/index.vue')),
-        commodity_contract_bargain_refuse_order: defineAsyncComponent(() => import('./components/commodity_contract_bargain_refuse_order/index.vue')),
-    },
-    setup() {
-        // 类型 1-我的申请 2-对方申请
-        const margainType = ref<ApplyType>(ApplyType.my);
-        // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<QueryTjmdTransferApplyRsp>();
-        // 交割商品
-        handleDeliveryRelation();
-        // 获取列表数据
-        const queryTableAction = () => {
-            const param: QueryTjmdTransferApplyReq = {
-                applytype: margainType.value,
-                accountids: getAccoutIdList(),
-            };
-            queryTable(queryTjmdTransferApply, param);
-        };
-        // 表格通用逻辑
-        const param: ComposeOrderTableParam = {
-            queryFn: () => queryTableAction(),
-            recordList: getRecordItemTab(),
-        };
-        // 切换 我的申请和对方申请
-        Bus.$onOnly('bargain', (value: ApplyType) => {
-            margainType.value = value;
-            queryTableAction();
-        });
-        function handleBtnList(record: QueryTjmdTransferApplyRsp, btnList: BtnListType[]) {
-            if (record.applystatus === 1) {
-                if (margainType.value === ApplyType.my) {
-                    // 我的申请
-                    return btnList.filter((e) => e.code === 'commodity_contract_bargain_cancel_order');
-                } else {
-                    // 对方的申请
-                    return btnList.filter((e) => e.code !== 'commodity_contract_bargain_cancel_order');
-                }
-            } else {
-                return [];
-            }
+  name: 'commodity_contract_bargain',
+  components: {
+    ExclamationCircleOutlined,
+    BtnList,
+    commodity_contract_bargain_submit_order: defineAsyncComponent(() => import('./components/commodity_contract_bargain_submit_order/index.vue')),
+    commodity_contract_bargain_cancel_order: defineAsyncComponent(() => import('./components/commodity_contract_bargain_cancel_order/index.vue')),
+    commodity_contract_bargain_refuse_order: defineAsyncComponent(() => import('./components/commodity_contract_bargain_refuse_order/index.vue')),
+  },
+  setup() {
+    // 类型 1-我的申请 2-对方申请
+    const margainType = ref<ApplyType>(ApplyType.my);
+    // 表格列表数据
+    const { loading, tableList, queryTable } = queryTableList<QueryTjmdTransferApplyRsp>();
+    // 交割商品
+    handleDeliveryRelation();
+    // 获取列表数据
+    const queryTableAction = () => {
+      const param: QueryTjmdTransferApplyReq = {
+        applytype: margainType.value,
+        accountids: getAccoutIdList(),
+      };
+      queryTable(queryTjmdTransferApply, param);
+    };
+    // 表格通用逻辑
+    const param: ComposeOrderTableParam = {
+      queryFn: () => queryTableAction(),
+      recordList: getRecordItemTab(),
+    };
+    // 切换 我的申请和对方申请
+    Bus.$onOnly('bargain', (value: ApplyType) => {
+      margainType.value = value;
+      queryTableAction();
+    });
+    function handleBtnList(record: QueryTjmdTransferApplyRsp, btnList: BtnListType[]) {
+      if (record.applystatus === 1) {
+        if (margainType.value === ApplyType.my) {
+          // 我的申请
+          return btnList.filter((e) => e.code === 'swap_commodity_contract_bargain_cancel_order');
+        } else {
+          // 对方的申请
+          return btnList.filter((e) => e.code !== 'swap_commodity_contract_bargain_cancel_order');
         }
-        return {
-            ...handleComposeOrderTable<QueryTradePositionRsp>(param),
-            columns,
-            loading,
-            tableList,
-            formatTime,
-            expandIcon,
-            handleBtnList,
-            getBuyOrSellName,
-            getScfContractStatusName,
-        };
-    },
+      } else {
+        return [];
+      }
+    }
+    return {
+      ...handleComposeOrderTable<QueryTradePositionRsp>(param),
+      columns,
+      loading,
+      tableList,
+      formatTime,
+      expandIcon,
+      handleBtnList,
+      getBuyOrSellName,
+      getScfContractStatusName,
+    };
+  },
 });
 </script>
 

+ 1 - 1
src/views/order/swap_the_order/components/swap_commodity_contract_commission/index.vue

@@ -84,7 +84,7 @@ export default defineComponent({
       //委托状态 - 1:委托请求 2:待冻结 3:委托成功 4:委托失败 5:配对成功 6:已撤 7:已成 8:成交失败 9:委托拒绝 1number;
       const arr = [3, 7];
       if (!arr.includes(record.orderstatus)) {
-        return list.filter((e) => e.code !== 'commodity_contract_commission_cancel_order');
+        return list.filter((e) => e.code !== 'swap_commodity_contract_commission_cancel_order');
       } else {
         return list;
       }