Browse Source

修改 成交 指定成交 提货

huangbin 3 years ago
parent
commit
a1866424ad

+ 3 - 3
src/views/order/spot_warran/components/spot_warrant_bargain/index.vue

@@ -4,15 +4,15 @@
     <template #default="{ scroll }">
       <a-table
         :columns="columns"
-        class="srcollYTable expandLeftTable"
-        :scroll="{ x: '100%', y: '190px' }"
+        class="srcollYTable"
+        :scroll="scroll"
         :pagination="false"
         :loading="loading"
         :expandedRowKeys="expandedRowKeys"
         :customRow="Rowclick"
         :expandIcon="expandIcon"
         :expandIconAsCell="false"
-        rowKey="key"
+        :rowKey="(record, index) => index"
         :data-source="tableList"
       >
         <!-- 额外的展开行 -->

+ 3 - 3
src/views/order/spot_warran/components/spot_warrant_deal/index.vue

@@ -4,15 +4,15 @@
         <template #default="{ scroll }">
             <a-table
                 :columns="columns"
-                class="srcollYTable expandLeftTable"
-                :scroll="{ x: '100%', y: '190px' }"
+                class="srcollYTable"
+                :scroll="scroll"
                 :pagination="false"
                 :loading="loading"
                 :expandedRowKeys="expandedRowKeys"
                 :customRow="Rowclick"
                 :expandIcon="expandIcon"
                 :expandIconAsCell="false"
-                rowKey="key"
+                :rowKey="(record, index) => index"
                 :data-source="tableList"
             >
                 <!-- 额外的展开行 -->

+ 36 - 27
src/views/order/spot_warran/components/spot_warrant_designated_deal/index.vue

@@ -1,30 +1,38 @@
 <template>
-  <!-- 指定成交 -->
-  <section>
-    <a-table :columns="columns"
-             class="srcollYTable"
-             :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }"
-             :pagination="false"
-             :loading="loading"
-             :expandedRowKeys="expandedRowKeys"
-             :customRow="Rowclick"
-             :expandIcon="expandIcon"
-             :expandIconAsCell="false"
-             rowKey="key"
-             :data-source="tableList">
-      <!-- 额外的展开行 -->
-      <template #expandedRowRender="{ record }">
-        <BtnList :btnList="btnList"
-                 :record="record"
-                 class="btn-list-sticky"
-                 @click="openComponent" />
-      </template>
-    </a-table>
-    <component :is="componentId"
-               v-if="componentId"
-               :selectedRow="selectedRow"
-               @cancel="closeComponent"></component>
-  </section>
+    <!-- 指定成交 -->
+    <mtp-table-scroll>
+        <template #default="{ scroll }">
+            <a-table
+                :columns="columns"
+                class="srcollYTable"
+                :scroll="scroll"
+                :pagination="false"
+                :loading="loading"
+                :expandedRowKeys="expandedRowKeys"
+                :customRow="Rowclick"
+                :expandIcon="expandIcon"
+                :expandIconAsCell="false"
+                :rowKey="(record, index) => index"
+                :data-source="tableList"
+            >
+                <!-- 额外的展开行 -->
+                <template #expandedRowRender="{ record }">
+                    <BtnList
+                        :btnList="btnList"
+                        :record="record"
+                        class="btn-list-sticky"
+                        @click="openComponent"
+                    />
+                </template>
+            </a-table>
+        </template>
+    </mtp-table-scroll>
+    <component
+        :is="componentId"
+        v-if="componentId"
+        :selectedRow="selectedRow"
+        @cancel="closeComponent"
+    ></component>
 </template>
 
 <script lang="ts">
@@ -36,11 +44,12 @@ import { getRecordItemTab } from '@/common/setup/order/orderData';
 import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
 import { expandIcon } from '@/common/setup/table/clolumn';
-
+import MtpTableScroll from '@/common/components/tableScroll/index.vue';
 export default defineComponent({
     name: enumOrderComponents.spot_warrant_designated_deal,
     components: {
         BtnList,
+        MtpTableScroll,
     },
     setup() {
         // 表格列表数据

+ 85 - 75
src/views/order/spot_warran/components/spot_warrant_in_and_out_warehouse/index.vue

@@ -1,43 +1,51 @@
 <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">
-      <!-- 额外的展开行 -->
-      <template #expandedRowRender="{ record }">
-        <BtnList :btnList="handleBtnList(btnList, record)"
-                 :record="record"
-                 class="btn-list-sticky"
-                 @click="openComponent" />
-      </template>
+  <mtp-table-scroll>
+    <template #default="{ scroll }">
+      <a-table
+        :columns="columns"
+        class="srcollYTable"
+        :scroll="scroll"
+        :pagination="false"
+        :loading="loading"
+        :expandedRowKeys="expandedRowKeys"
+        :customRow="Rowclick"
+        :expandIcon="expandIcon"
+        :expandIconAsCell="false"
+        :rowKey="(record, index) => index"
+        :data-source="tableList"
+      >
+        <!-- 额外的展开行 -->
+        <template #expandedRowRender="{ record }">
+          <BtnList
+            :btnList="handleBtnList(btnList, record)"
+            :record="record"
+            class="btn-list-sticky"
+            @click="openComponent"
+          />
+        </template>
 
-      <!-- applytype 类型-->
-      <template #applytype="{ record }">
-        <span>{{ getPickUpStatusName(record.applytype) }}</span>
-      </template>
-      <template #expresscompany="{ record, text }">
-        <span>{{ (text && text !== '--') ? text +  record.expressnum : '--' }}</span>
-      </template>
+        <!-- applytype 类型-->
+        <template #applytype="{ record }">
+          <span>{{ getPickUpStatusName(record.applytype) }}</span>
+        </template>
+        <template #expresscompany="{ record, text }">
+          <span>{{ (text && text !== '--') ? text + record.expressnum : '--' }}</span>
+        </template>
 
-      <!-- applystatus 状态 -->
-      <template #applystatus="{ record }">
-        <span>{{ getPickUpTypeName(record.applystatus) }}</span>
-      </template>
-    </a-table>
-    <component :is="componentId"
-               v-if="componentId"
-               :selectedRow="selectedRow"
-               @cancel="closeComponent"></component>
-  </section>
+        <!-- applystatus 状态 -->
+        <template #applystatus="{ record }">
+          <span>{{ getPickUpTypeName(record.applystatus) }}</span>
+        </template>
+      </a-table>
+    </template>
+  </mtp-table-scroll>
+  <component
+    :is="componentId"
+    v-if="componentId"
+    :selectedRow="selectedRow"
+    @cancel="closeComponent"
+  ></component>
 </template>
 
 <script lang="ts">
@@ -51,47 +59,49 @@ import { ComposeOrderTableParam } from '@/common/setup/table/interface';
 import { expandIcon } from '@/common/setup/table/clolumn';
 import { BtnListType } from '@/common/components/btnList/interface';
 import { getPickUpStatusName, getPickUpTypeName } from '@/common/constants/enumsName';
+import MtpTableScroll from '@/common/components/tableScroll/index.vue';
 
 export default defineComponent({
-    name: enumOrderComponents.spot_warrant_in_and_out_warehouse,
-    components: {
-        BtnList,
-        [ModalEnum.spot_warrant_in_and_out_warehouse_sure_pick_up]: defineAsyncComponent(() => import('./components/pick_up/index.vue')),
-        [ModalEnum.spot_warrant_in_and_out_warehouse_revoke]: defineAsyncComponent(() => import('./components/cancel/index.vue')),
-    },
-    setup() {
-        // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<WrOutInApply>();
-        // 获取列表数据
-        const queryTableAction = () => {
-            queryTable(queryWrOutInApply);
-        };
-        // 表格通用逻辑
-        const param: ComposeOrderTableParam = {
-            queryFn: queryTableAction,
-            tableName: 'table_pcweb_spot_trade_bottom_spot_warrant_pick_up',
-            recordList: getRecordItemTab(),
-        };
-        function handleBtnList(btnList: BtnListType[], item: WrOutInApply) {
-            const { applystatus, applytype } = item;
-            if (applystatus === 0 && applytype === 4) {
-                return btnList.filter((e) => e.code === ModalEnum.spot_warrant_in_and_out_warehouse_sure_pick_up);
-            } else if (applystatus === 1 && applytype === 2) {
-                return btnList.filter((e) => e.code === ModalEnum.spot_warrant_in_and_out_warehouse_revoke);
-            } else {
-                return [];
-            }
-        }
-        return {
-            ...handleComposeOrderTable<WrOutInApply>(param),
-            loading,
-            tableList,
-            expandIcon,
-            handleBtnList,
-            getPickUpStatusName,
-            getPickUpTypeName,
-        };
-    },
+  name: enumOrderComponents.spot_warrant_in_and_out_warehouse,
+  components: {
+    BtnList,
+    MtpTableScroll,
+    pick_up: defineAsyncComponent(() => import('./components/pick_up/index.vue')),
+    cacel: defineAsyncComponent(() => import('./components/cancel/index.vue')),
+  },
+  setup() {
+    // 表格列表数据
+    const { loading, tableList, queryTable } = queryTableList<WrOutInApply>();
+    // 获取列表数据
+    const queryTableAction = () => {
+      queryTable(queryWrOutInApply);
+    };
+    // 表格通用逻辑
+    const param: ComposeOrderTableParam = {
+      queryFn: queryTableAction,
+      tableName: 'table_pcweb_spot_trade_bottom_spot_warrant_pick_up',
+      recordList: getRecordItemTab(),
+    };
+    function handleBtnList(btnList: BtnListType[], item: WrOutInApply) {
+      const { applystatus, applytype } = item;
+      if (applystatus === 0 && applytype === 4) {
+        return btnList.filter((e) => e.code === ModalEnum.spot_warrant_in_and_out_warehouse_sure_pick_up);
+      } else if (applystatus === 1 && applytype === 2) {
+        return btnList.filter((e) => e.code === ModalEnum.spot_warrant_in_and_out_warehouse_revoke);
+      } else {
+        return [];
+      }
+    }
+    return {
+      ...handleComposeOrderTable<WrOutInApply>(param),
+      loading,
+      tableList,
+      expandIcon,
+      handleBtnList,
+      getPickUpStatusName,
+      getPickUpTypeName,
+    };
+  },
 });
 </script>