瀏覽代碼

管理-业务审核

huangbin 4 年之前
父節點
當前提交
4f4f98a6fb

+ 10 - 21
src/views/manage/business-review/components/settlementAudit/index.vue

@@ -8,18 +8,15 @@
            @cancel="cancel"
            width="890px">
     <template #footer>
-      <a-button key="submit"
-                type="primary"
+      <a-button type="primary"
                 :loading="loading"
                 @click="submit">关闭</a-button>
-      <a-button key="submit"
-                v-if="isShowContractCheck(selectedRow.applystatus)"
+      <a-button v-if="isShowContractCheck(selectedRow.applystatus)"
                 type="primary"
                 :loading="loading"
                 @click="pass">审核通过
       </a-button>
-      <a-button key="submit"
-                v-if="isShowContractCheck(selectedRow.applystatus)"
+      <a-button v-if="isShowContractCheck(selectedRow.applystatus)"
                 type="primary"
                 :loading="loading"
                 @click="refuse">审核拒绝
@@ -31,7 +28,8 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="合同编号">
-              <span class="white">{{ getContractTypeName(selectedRow.contracttype) + '/' + formatValue(selectedRow.contractno) }}</span>
+              <span
+                    class="white">{{ getContractTypeName(selectedRow.contracttype) + '/' + formatValue(selectedRow.contractno) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
@@ -113,10 +111,11 @@ import Long from 'long';
 import { somePriceControl } from '@/views/manage/business-review/components/setup';
 import { getContractTypeName, getPriceTypeName } from '@/common/constants/enumsName';
 import { isShowContractCheck } from '@/views/manage/inventory-review/setup';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'business_review_settlement_audit',
-    components: {},
+    emits: ['cancel', 'update'],
     props: {
         selectedRow: {
             type: Object as PropType<QryBussinessJsRsp>,
@@ -124,16 +123,9 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('business_review_settlement_audit');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
-        function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 200);
-        }
         // 审核通过
         function pass() {
             Modal.confirm({
@@ -147,8 +139,7 @@ export default defineComponent({
                     };
                     somePriceControl(param, loading)
                         .then((res) => {
-                            context.emit('refresh');
-                            cancel();
+                            cancel(true);
                         })
                         .catch((err) => {});
                 },
@@ -168,8 +159,7 @@ export default defineComponent({
                     };
                     somePriceControl(param, loading)
                         .then((res) => {
-                            context.emit('refresh');
-                            cancel();
+                            cancel(true);
                         })
                         .catch((err) => {});
                 },
@@ -179,7 +169,6 @@ export default defineComponent({
         return {
             visible,
             cancel,
-            submit,
             loading,
             formatValue,
             getStatusName,

+ 4 - 13
src/views/manage/business-review/components/settlementCancel/index.vue

@@ -110,10 +110,11 @@ import { Modal } from 'ant-design-vue';
 import { ContractOperateApplyReq } from '@/services/proto/contract/interface';
 import Long from 'long';
 import { somePriceControl } from '@/views/manage/business-review/components/setup';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'business_review_settlement_cancel',
-    components: {},
+    emits: ['cancel', 'update'],
     props: {
         selectedRow: {
             type: Object as PropType<QryBussinessJsRsp>,
@@ -121,18 +122,10 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('business_review_settlement_cancel');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
 
-        function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 200);
-        }
-
         function back() {
             Modal.confirm({
                 title: '是否确认撤销',
@@ -145,8 +138,7 @@ export default defineComponent({
                     };
                     somePriceControl(param, loading)
                         .then((res) => {
-                            context.emit('refresh');
-                            cancel();
+                            cancel(true);
                         })
                         .catch((err) => {});
                 },
@@ -157,7 +149,6 @@ export default defineComponent({
         return {
             visible,
             cancel,
-            submit,
             loading,
             formatValue,
             getStatusName,

+ 6 - 10
src/views/manage/business-review/components/settlementDetail/index.vue

@@ -11,7 +11,7 @@
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
-                @click="submit">关闭</a-button>
+                @click="cancel">关闭</a-button>
     </template>
     <a-form class="inlineForm">
       <fieldset class="formFieldSet">
@@ -19,7 +19,8 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="合同编号">
-              <span class="white">{{ getContractTypeName(selectedRow.contracttype) + '/' + formatValue(selectedRow.contractno) }}</span>
+              <span
+                    class="white">{{ getContractTypeName(selectedRow.contracttype) + '/' + formatValue(selectedRow.contractno) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
@@ -96,10 +97,11 @@ import { getStatusName } from '@/common/constants/enumsName';
 import { formatValue, formatTime } from '@/common/methods';
 import { getContractTypeName, getPriceTypeName } from '@/common/constants/enumsName';
 import { QryBusinessDjRsp, QryBussinessJsRsp } from '@/services/go/ermcp/business-review/interface';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'settlement-detail',
-    components: {},
+    emits: ['cancel', 'update'],
     props: {
         selectedRow: {
             type: Object as PropType<QryBussinessJsRsp>,
@@ -107,22 +109,16 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('detail');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
         watchEffect(() => {
             if (visible.value) {
             }
         });
-        function submit() {
-            console.log(props.selectedRow.addmargin);
-            context.emit('refresh');
-            cancel();
-        }
         return {
             visible,
             cancel,
-            submit,
             loading,
             formatValue,
             getStatusName,

+ 5 - 6
src/views/manage/business-review/components/somepriceAudit/index.vue

@@ -119,10 +119,11 @@ import { ContractOperateApplyReq } from '@/services/proto/contract/interface';
 import * as Long from 'long';
 import { QryBusinessDjRsp } from '@/services/go/ermcp/business-review/interface';
 import { isShowContractCheck } from '@/views/manage/inventory-review/setup';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'business_review_someprice_audit',
-    components: {},
+    emits: ['cancel', 'update'],
     props: {
         selectedRow: {
             type: Object as PropType<QryBusinessDjRsp>,
@@ -130,7 +131,7 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('business_review_someprice_audit');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
         // 审核通过
@@ -146,8 +147,7 @@ export default defineComponent({
                     };
                     somePriceControl(param, loading)
                         .then((res) => {
-                            context.emit('refresh');
-                            cancel();
+                            cancel(true);
                         })
                         .catch((err) => {});
                 },
@@ -168,8 +168,7 @@ export default defineComponent({
                     };
                     somePriceControl(param, loading)
                         .then((res) => {
-                            context.emit('refresh');
-                            cancel();
+                            cancel(true);
                         })
                         .catch((err) => {});
                 },

+ 5 - 10
src/views/manage/business-review/components/somepriceCancel/index.vue

@@ -11,7 +11,7 @@
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
-                @click="submit">关闭
+                @click="cancel">关闭
       </a-button>
 
       <a-button key="submit"
@@ -113,10 +113,11 @@ import { Modal } from 'ant-design-vue';
 import { ContractOperateApplyReq } from '@/services/proto/contract/interface';
 import Long from 'long';
 import { somePriceControl } from '@/views/manage/business-review/components/setup';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'business_review_someprice_cancel',
-    components: {},
+    emits: ['cancel', 'update'],
     props: {
         selectedRow: {
             type: Object as PropType<QryBusinessDjRsp>,
@@ -124,14 +125,10 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('business_review_someprice_cancel');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
 
-        function submit() {
-            visible.value = false;
-        }
-
         function back() {
             Modal.confirm({
                 title: '是否确认撤销',
@@ -144,8 +141,7 @@ export default defineComponent({
                     };
                     somePriceControl(param, loading)
                         .then((res) => {
-                            context.emit('refresh');
-                            cancel();
+                            cancel(true);
                         })
                         .catch((err) => {});
                 },
@@ -156,7 +152,6 @@ export default defineComponent({
         return {
             visible,
             cancel,
-            submit,
             loading,
             back,
             formatValue,

+ 4 - 9
src/views/manage/business-review/components/somepriceDetail/index.vue

@@ -11,7 +11,7 @@
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
-                @click="submit">关闭
+                @click="cancel">关闭
       </a-button>
     </template>
 
@@ -102,10 +102,11 @@ import { getStatusName } from '@/common/constants/enumsName';
 import { formatValue, formatTime } from '@/common/methods';
 import { QryBusinessDjRsp } from '@/services/go/ermcp/business-review/interface';
 import { getPriceTypeName } from '@/common/constants/enumsName';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'someprice-detail',
-    components: {},
+    emits: ['cancel', 'update'],
     props: {
         selectedRow: {
             type: Object as PropType<QryBusinessDjRsp>,
@@ -113,19 +114,13 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('detail');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
 
-        function submit() {
-            context.emit('refresh');
-            cancel();
-        }
-
         return {
             visible,
             cancel,
-            submit,
             loading,
             formatValue,
             getStatusName,

+ 83 - 88
src/views/manage/business-review/list/settlement/index.vue

@@ -3,56 +3,56 @@
   <div class="business-review-js"
        :loading="loading">
     <Filter @search="updateColumn">
-      <BtnList :btnList="commonBtn" />
     </Filter>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{ record }">
-          <BtnList :btnList="record.btnList" />
-        </template>
-        <template #operateapplytype="{ text }">
-          <a>{{ getPriceTypeName(text) }}</a>
-        </template>
-        <template #contracttype="{ text }">
-          <a>{{ getContractTypeName(text) }}</a>
-        </template>
+    <a-table :columns="columns"
+             class="topTable"
+             :pagination="false"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="key"
+             :data-source="tableList">
+      <!-- 额外的展开行 -->
+      <template #expandedRowRender="{ record }">
+        <BtnList :btnList="handlePermissionBtn(firstBtn, record)"
+                 :record="record"
+                 @click="openComponent" />
+      </template>
+      <template #operateapplytype="{ text }">
+        <a>{{ getPriceTypeName(text) }}</a>
+      </template>
+      <template #contracttype="{ text }">
+        <a>{{ getContractTypeName(text) }}</a>
+      </template>
 
-        <template #applystatus="{ text }">
-          <a>{{ getApplyStatusName(text) }}</a>
-        </template>
-        <template #buyusernameOrsellusername="{ record }">
-          <a>{{ getAnalogueName(record.contracttype, record.buyusername, record.sellusername) }}</a>
-        </template>
-        <template #addmargin||decmargin="{ record }">
-          <a>{{
+      <template #applystatus="{ text }">
+        <a>{{ getApplyStatusName(text) }}</a>
+      </template>
+      <template #buyusernameOrsellusername="{ record }">
+        <a>{{ getAnalogueName(record.contracttype, record.buyusername, record.sellusername) }}</a>
+      </template>
+      <template #addmargin||decmargin="{ record }">
+        <a>{{
                         (record.addmargin !== 0 && record.addmargin !== undefined ?
                         "+" + (record.addmargin) : (record.decmargin === 0 || record.decmargin === undefined ? "" : "-" + (record.decmargin)))
                         }} </a>
-        </template>
+      </template>
 
-      </a-table>
+    </a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="handlePermissionBtn(firstBtn, selectedRow)">
     </contextMenu>
-    <!-- 点价记录详情 -->
-    <SettlementDetail :selectedRow="selectedRow"
-                      @refresh="getTableData" />
-    <!-- 交收审核 -->
-    <SettlementAudit :selectedRow="selectedRow"
-                     @refresh="getTableData" />
-    <!-- 撤销点价登记 -->
-    <SettlementCancel :selectedRow="selectedRow"
-                      @refresh="getTableData" />
+    <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 { BtnList, contextMenu, defineAsyncComponent, defineComponent, ModalEnum, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
+import { initData, getTableColumns, getTableEvent, getBtnList } from '@/common/export/table';
 
 import { SettlementDetail, SettlementAudit, SettlementCancel, Filter } from '../../components';
 
@@ -61,6 +61,11 @@ import { invoiceStatusName } from '@/views/manage/finance-review/setup';
 import { Column, ColumnType } from '@/common/setup/table';
 import { getPriceTypeName, getContractTypeName, getApplyStatusName } from '@/common/constants/enumsName';
 import { getAnalogueName } from '@/views/information/spot-contract/setup';
+import { EnumRouterName } from '@/common/constants/enumRouterName';
+import { BtnList as BtnListType } from '@/common/components/btnList/interface';
+const Detail = defineAsyncComponent(() => import('../../components/settlementDetail/index.vue'));
+const Audit = defineAsyncComponent(() => import('../../components/settlementAudit/index.vue'));
+const Cancel = defineAsyncComponent(() => import('../../components/settlementCancel/index.vue'));
 
 export default defineComponent({
     name: 'business-review-js',
@@ -68,71 +73,61 @@ export default defineComponent({
         contextMenu,
         Filter,
         BtnList,
-        SettlementDetail,
-        SettlementAudit,
-        SettlementCancel,
+        [ModalEnum.detail]: Detail,
+        [ModalEnum.business_review_settlement_audit]: Audit,
+        [ModalEnum.business_review_settlement_cancel]: Cancel,
     },
     setup() {
-        // 表头数据
-        const { columns, registerColumn, updateColumn } = getTableColumns();
-        // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<QryBussinessJsRsp>({});
-        // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('business_review_settlement', true);
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList({});
-
-        function getTableData() {
-            // 获取列表数据
-            queryTable().then(() => {
-                tableList.value.forEach((el) => {
-                    if (el.applystatus === 1) {
-                        // 1:待审核
-                        Object.assign(el, { btnList: forDataBtn.value });
+        // 获取列表数据
+        const queryTableAction = () => queryTable();
+        const filtrFn = (e: Column, item: ColumnType, filtered: any) => {
+            if (e.columnfield === 'buyusernameOrsellusername') {
+                item.onFilter = (value: string, record: QryBussinessJsRsp) => {
+                    const { contracttype, buyusername, sellusername } = record;
+                    if (contracttype === 1) {
+                        // 采购
+                        return sellusername.includes(value);
                     } else {
-                        const item = forDataBtn.value.find((e) => e.lable === '详情');
-                        item && Object.assign(el, { btnList: [item] });
+                        return buyusername.includes(value);
                     }
-                });
-            });
-        }
-
-        initData(() => {
-            // 获取列表数据
-            getTableData();
-            // 注册表头信息 过滤
-            registerColumn('table_pcweb_business_aduit_js', ['contracttype', 'contractno', 'deliverygoodsname'], (e: Column, item: ColumnType, filtered: any) => {
-                if (e.columnfield === 'buyusernameOrsellusername') {
-                    item.onFilter = (value: string, record: QryBussinessJsRsp) => {
-                        const { contracttype, buyusername, sellusername } = record;
-                        if (contracttype === 1) {
-                            // 采购
-                            return sellusername.includes(value);
-                        } else {
-                            return buyusername.includes(value);
-                        }
-                    };
-                    item.filteredValue = filtered.buyusernameOrsellusername || null;
+                };
+                item.filteredValue = filtered.buyusernameOrsellusername || null;
+            }
+        };
+        // 表格通用逻辑
+        const param: ComposeTableParam = {
+            queryFn: queryTableAction,
+            menuType: EnumRouterName.business_review_someprice,
+            tableName: 'table_pcweb_business_aduit_js',
+            tableFilterKey: ['contracttype', 'contractno', 'deliverygoodsname'],
+            tableFilterCB: filtrFn,
+            isDetail: true,
+        };
+        function handlePermissionBtn(btnList: BtnListType[], item: QryBussinessJsRsp) {
+            if (item) {
+                const { applystatus } = item;
+                if (applystatus === 1) {
+                    return btnList;
+                } else {
+                    return btnList.filter((e) => e.code === 'detail');
                 }
-            });
-        });
+            } else {
+                return [];
+            }
+        }
 
         return {
-            columns,
+            ...handleComposeTable<QryBussinessJsRsp>(param),
+            handlePermissionBtn,
             getAnalogueName,
-            expandedRowKeys,
-            selectedRow,
-            Rowclick,
-            commonBtn,
-            forDataBtn,
             loading,
             tableList,
-            updateColumn,
             getPriceTypeName,
             getContractTypeName,
             getApplyStatusName,
             invoiceStatusName,
-            getTableData,
         };
     },
 });

+ 82 - 99
src/views/manage/business-review/list/someprice/index.vue

@@ -3,56 +3,55 @@
   <div class="business-review-dj"
        :loading="loading">
     <Filter @search="updateColumn">
-      <BtnList :btnList="commonBtn" />
     </Filter>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{ record }">
-          <BtnList :btnList="record.btnList" />
-        </template>
+    <a-table :columns="columns"
+             class="topTable"
+             :pagination="false"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="key"
+             :data-source="tableList">
+      <!-- 额外的展开行 -->
+      <template #expandedRowRender="{ record }">
+        <BtnList :btnList="handlePermissionBtn(firstBtn, record)"
+                 :record="record"
+                 @click="openComponent" />
+      </template>
 
-        <template #pricetype="{ text }">
-          <a>{{ getPriceTypeName(text) }}</a>
-        </template>
+      <template #pricetype="{ text }">
+        <a>{{ getPriceTypeName(text) }}</a>
+      </template>
 
-        <template #applystatus="{ text }">
-          <a>{{ getApplyStatusName(text) }}</a>
-        </template>
+      <template #applystatus="{ text }">
+        <a>{{ getApplyStatusName(text) }}</a>
+      </template>
 
-        <template #contracttype="{ text }">
-          <a>{{ getContractTypeName(text) }}</a>
-        </template>
+      <template #contracttype="{ text }">
+        <a>{{ getContractTypeName(text) }}</a>
+      </template>
 
-        <template #contractstatus="{ text }">
-          <a>{{ getContractStatusName(text) }}</a>
-        </template>
+      <template #contractstatus="{ text }">
+        <a>{{ getContractStatusName(text) }}</a>
+      </template>
 
-        <template #buyusernameOrsellusername="{ record }">
-          <a>{{ getAnalogueName(record.contracttype, record.buyusername, record.sellusername) }}</a>
-        </template>
-      </a-table>
+      <template #buyusernameOrsellusername="{ record }">
+        <a>{{ getAnalogueName(record.contracttype, record.buyusername, record.sellusername) }}</a>
+      </template>
+    </a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="handlePermissionBtn(firstBtn, selectedRow)">
     </contextMenu>
-    <!-- 点价记录详情 -->
-    <SomepriceDetail :selectedRow="selectedRow"
-                     @refresh="getTableData" />
-    <!-- 点价审核 -->
-    <SomepriceAudit :selectedRow="selectedRow"
-                    @refresh="getTableData" />
-    <!-- 撤销点价登记 -->
-    <SomepriceCancel :selectedRow="selectedRow"
-                     @refresh="getTableData" />
+    <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 { BtnList, contextMenu, defineAsyncComponent, defineComponent, ModalEnum, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
 
 import { Filter, SomepriceDetail, SomepriceAudit, SomepriceCancel } from '../../components';
 import { queryTableList, QryBusinessDjRsp } from './setup';
@@ -60,88 +59,72 @@ import { getPriceTypeName, getContractStatusName, getContractTypeName, getApplyS
 import { getAnalogueName } from '@/views/information/spot-contract/setup';
 import { Column, ColumnType } from '@/common/setup/table';
 import { ref } from 'vue';
-
+import { BtnList as BtnListType } from '@/common/components/btnList/interface';
+import { EnumRouterName } from '@/common/constants/enumRouterName';
+const Detail = defineAsyncComponent(() => import('../../components/somepriceDetail/index.vue'));
+const Audit = defineAsyncComponent(() => import('../../components/somepriceAudit/index.vue'));
+const Cancel = defineAsyncComponent(() => import('../../components/somepriceCancel/index.vue'));
 export default defineComponent({
     name: 'business-review-dj',
     components: {
         contextMenu,
         Filter,
         BtnList,
-        SomepriceDetail,
-        SomepriceAudit,
-        SomepriceCancel,
+        [ModalEnum.detail]: Detail,
+        [ModalEnum.business_review_someprice_audit]: Audit,
+        [ModalEnum.business_review_someprice_cancel]: Cancel,
     },
     setup() {
-        // 表头数据
-        const { columns, registerColumn, updateColumn } = getTableColumns();
-        // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<QryBusinessDjRsp>({});
-        // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('business_review_someprice', true);
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList({});
-        function handleBtn(applystatus: number) {
-            if (applystatus !== 1) {
-                // 1:待审核
-                const item = forDataBtn.value.find((e) => e.lable === '详情');
-                if (item) {
-                    return ref([item]);
-                }
-            }
-            return forDataBtn;
-        }
-        function getTableData() {
-            // 获取列表数据
-            queryTable().then(() => {
-                tableList.value.forEach((el) => {
-                    if (el.applystatus === 1) {
-                        // 1:待审核
-                        Object.assign(el, { btnList: forDataBtn.value });
+        // 获取列表数据
+        const queryTableAction = () => queryTable();
+        const filtrFn = (e: Column, item: ColumnType, filtered: any) => {
+            if (e.columnfield === 'buyusernameOrsellusername') {
+                item.onFilter = (value: string, record: QryBusinessDjRsp) => {
+                    const { contracttype, buyusername, sellusername } = record;
+                    if (contracttype === 1) {
+                        // 采购
+                        return sellusername.includes(value);
                     } else {
-                        const item = forDataBtn.value.find((e) => e.lable === '详情');
-                        item && Object.assign(el, { btnList: [item] });
+                        return buyusername.includes(value);
                     }
-                });
-            });
-        }
-        initData(() => {
-            // 获取列表数据
-            getTableData();
-            // 注册表头信息 过滤
-            registerColumn('table_pcweb_business_aduit_dj', ['contracttype', 'contractno', 'deliverygoodsname'], (e: Column, item: ColumnType, filtered: any) => {
-                if (e.columnfield === 'buyusernameOrsellusername') {
-                    item.onFilter = (value: string, record: QryBusinessDjRsp) => {
-                        const { contracttype, buyusername, sellusername } = record;
-                        if (contracttype === 1) {
-                            // 采购
-                            return sellusername.includes(value);
-                        } else {
-                            return buyusername.includes(value);
-                        }
-                    };
-                    item.filteredValue = filtered.buyusernameOrsellusername || null;
+                };
+                item.filteredValue = filtered.buyusernameOrsellusername || null;
+            }
+        };
+        // 表格通用逻辑
+        const param: ComposeTableParam = {
+            queryFn: queryTableAction,
+            menuType: EnumRouterName.business_review_someprice,
+            tableName: 'table_pcweb_business_aduit_dj',
+            tableFilterKey: ['contracttype', 'contractno', 'deliverygoodsname'],
+            tableFilterCB: filtrFn,
+            isDetail: true,
+        };
+        function handlePermissionBtn(btnList: BtnListType[], item: QryBusinessDjRsp) {
+            if (item) {
+                const { applystatus } = item;
+                if (applystatus === 1) {
+                    return btnList;
+                } else {
+                    return btnList.filter((e) => e.code === 'detail');
                 }
-            });
-        });
+            } else {
+                return [];
+            }
+        }
 
         return {
-            columns,
-
-            expandedRowKeys,
-            selectedRow,
-            Rowclick,
-            commonBtn,
-            handleBtn,
-            forDataBtn,
+            ...handleComposeTable<QryBusinessDjRsp>(param),
+            handlePermissionBtn,
             loading,
             tableList,
-            updateColumn,
             getPriceTypeName,
             getApplyStatusName,
             getContractTypeName,
             getContractStatusName,
             getAnalogueName,
-            getTableData,
         };
     },
 });