Browse Source

采购: 全部-

huangbin 4 năm trước cách đây
mục cha
commit
3a7e1aa874
1 tập tin đã thay đổi với 58 bổ sung62 xóa
  1. 58 62
      src/views/business/purchase/list/all/index.vue

+ 58 - 62
src/views/business/purchase/list/all/index.vue

@@ -1,49 +1,52 @@
 <template>
-  <!-- 采购: 履约交收-->
+  <!-- 采购: 全部-->
   <div class="purchase-all"
        :loading="loading">
     <filterCustomTable @search="updateColumn">
-      <BtnList :btnList="commonBtn" />
+      <BtnList :btnList="firstBtn"
+               @click="openComponent" />
     </filterCustomTable>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
-        </template>
-      </a-table>
+    <a-table :columns="columns"
+             class="srcollYTable"
+             :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="key"
+             :data-source="tableList">
+      <!-- 额外的展开行 -->
+      <template #expandedRowRender="{ record }">
+        <BtnList :btnList="secondBtn"
+                 :record="record"
+                 @click="openComponent" />
+      </template>
+    </a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="secondBtn">
     </contextMenu>
-    <!-- 详情 -->
-    <Detail :selectedRow="selectedRow"
-            @refresh="queryTable" />
-    <!-- 采购点价登记 -->
-    <SomePrice :selectedRow="selectedRow"
-               @refresh="queryTable" />
-    <!-- 交收登记 -->
-    <Settlement :selectedRow="selectedRow"
-                @refresh="queryTable" />
-    <!-- 款项登记 -->
-    <Funds :selectedRow="selectedRow"
-           @refresh="queryTable" />
-    <!-- 发票登记 -->
-    <Invoice :selectedRow="selectedRow"
-             @refresh="queryTable" />
-    <!-- 入库登记 -->
-    <Storage :selectedRow="selectedRow"
-             @refresh="queryTable" />
+    <component :is="componentId"
+               v-if="componentId"
+               :selectedRow="selectedRow"
+               @cancel="closeComponent"></component>
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-import { queryTableList, Ermcp3SellBuyContract } from '../index';
-import { Detail, filterCustomTable, Settlement, Funds, Invoice, Storage, SomePrice } from '../../components';
+import { queryTableList, BtnList, contextMenu, defineAsyncComponent, defineComponent, ModalEnum, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
+
+import { Ermcp3SellBuyContract } from '../index';
+import { filterCustomTable } from '../../components';
+import { QueryPurchase } from '@/services/go/ermcp/purchase';
+
+const Detail = defineAsyncComponent(() => import('../../components/detail/index.vue'));
+const Settlement = defineAsyncComponent(() => import('../../components/settlement/index.vue')); //交收登记
+const Funds = defineAsyncComponent(() => import('../../components/funds/index.vue')); // 款项登记
+const Invoice = defineAsyncComponent(() => import('../../components/invoice/index.vue')); // 发票登记
+const Storage = defineAsyncComponent(() => import('../../components/storage/index.vue')); // 入库登记
+const SomePrice = defineAsyncComponent(() => import('../../components/someprice/index.vue')); //采购点价登记
 
 export default defineComponent({
     name: 'purchase-all',
@@ -51,38 +54,31 @@ export default defineComponent({
         contextMenu,
         filterCustomTable,
         Detail,
-        Settlement,
-        Funds,
-        Invoice,
-        Storage,
-        SomePrice,
         BtnList,
+        [ModalEnum.detail]: Detail,
+        [ModalEnum.purchase_pending_settlement]: Settlement,
+        [ModalEnum.purchase_pending_funds]: Funds,
+        [ModalEnum.purchase_pending_invoice]: Invoice,
+        [ModalEnum.purchase_pending_storage]: Storage,
+        [ModalEnum.purchase_pending_someprice]: SomePrice,
     },
     setup() {
-        // 表头数据
-        const { columns, registerColumn, updateColumn } = getTableColumns();
-        // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3SellBuyContract>({});
-        // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('purchase_all', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList(1);
-        initData(() => {
-            // 获取列表数据
-            queryTable();
-            // 注册表头信息 过滤
-            registerColumn('table_pcweb_purchase_all', ['accountname', 'contractno', 'deliverygoodsname', 'convertfactor', 'goodsname']);
-        });
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3SellBuyContract>();
+        // 获取列表数据
+        const queryTableAction = () => queryTable(QueryPurchase, { querytype: 1 });
+        // 表格通用逻辑
+        const param: ComposeTableParam = {
+            queryFn: queryTableAction,
+            menuType: 'purchase_all',
+            tableName: 'table_pcweb_purchase_all',
+            tableFilterKey: ['accountname', 'contractno', 'deliverygoodsname', 'convertfactor', 'goodsname'],
+            isDetail: true,
+        };
         return {
-            columns,
-            expandedRowKeys,
-            selectedRow,
-            Rowclick,
-            commonBtn,
-            forDataBtn,
-            loading,
+            ...handleComposeTable<Ermcp3SellBuyContract>(param),
             tableList,
-            updateColumn,
+            loading,
         };
     },
 });