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

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

marymelisa 4 роки тому
батько
коміт
69e29d0968
22 змінених файлів з 438 додано та 531 видалено
  1. 9 4
      src/services/bus/user.ts
  2. 1 0
      src/services/dataCenter/index.ts
  3. 1 0
      src/services/dataCenter/interface.ts
  4. 3 4
      src/services/go/useInfo/index.ts
  5. 10 21
      src/views/manage/business-review/components/settlementAudit/index.vue
  6. 4 13
      src/views/manage/business-review/components/settlementCancel/index.vue
  7. 6 10
      src/views/manage/business-review/components/settlementDetail/index.vue
  8. 5 6
      src/views/manage/business-review/components/somepriceAudit/index.vue
  9. 5 10
      src/views/manage/business-review/components/somepriceCancel/index.vue
  10. 4 9
      src/views/manage/business-review/components/somepriceDetail/index.vue
  11. 83 88
      src/views/manage/business-review/list/settlement/index.vue
  12. 82 99
      src/views/manage/business-review/list/someprice/index.vue
  13. 7 15
      src/views/manage/inventory-review/components/checkinAudit/index.vue
  14. 7 10
      src/views/manage/inventory-review/components/checkinCancel/index.vue
  15. 7 10
      src/views/manage/inventory-review/components/checkinDetail/index.vue
  16. 7 15
      src/views/manage/inventory-review/components/checkoutAudit/index.vue
  17. 6 13
      src/views/manage/inventory-review/components/checkoutCancel/index.vue
  18. 6 13
      src/views/manage/inventory-review/components/checkoutDetail/index.vue
  19. 86 91
      src/views/manage/inventory-review/list/checkin/index.vue
  20. 87 90
      src/views/manage/inventory-review/list/checkout/index.vue
  21. 8 1
      src/views/report/components/filter/index.vue
  22. 4 9
      src/views/report/inventory-report/components/filterTable/index.vue

+ 9 - 4
src/services/bus/user.ts

@@ -1,9 +1,9 @@
 import APP from '@/services';
-import { Arearole } from '../go/useInfo/interface';
+import { Arearole, Ermcp3RootUserAccount } from '../go/useInfo/interface';
 
 /**
  * 获取用户账户类型
- * @returns 
+ * @returns
  */
 export function getUserAccountType() {
     return APP.get('userAccount').usertype
@@ -18,14 +18,14 @@ export function getUserInfo() {
 
 /**
  * 获取用户名
- * @returns 
+ * @returns
  */
 export function getUserName() {
     return getUserInfo().customername
 }
 
 /**
- * 获取用户id 
+ * 获取用户id
  * 登录中也写了一个 获取用户id的方法,那个方法是在登录信息里面获取用户id,这个方法是在go服务修改登录请求方法,返回用户信息,后期有时间进行优化
  */
 export function getUsrId() {
@@ -55,4 +55,9 @@ export function getAoletype_string(): string {
     return APP.get('areaRoles').reduce((acc: string, cur: Arearole) => {
         return acc ? `${acc},${cur.roletype}` : `${cur.roletype}`
     }, '')
+}
+
+export function getRootUserInfo(): Ermcp3RootUserAccount | undefined {
+    const temp = APP.get('RootUser');
+    return temp.length ? temp[0] : undefined
 }

+ 1 - 0
src/services/dataCenter/index.ts

@@ -27,6 +27,7 @@ const needClearSourceData: NeedClearSourceDataType = {
     accountList: [],
     selectedAccount: new SelectedAccountModel(),
     quoteDayInfo: [],
+    RootUser: [],
 };
 
 /**

+ 1 - 0
src/services/dataCenter/interface.ts

@@ -41,6 +41,7 @@ export interface NeedClearSourceDataType {
     accountList: AccountListItem[]; // 资金账户列表
     selectedAccount: AccountListItem; // 当前选中的资金账号
     quoteDayInfo: advert.QueryQuoteDayRsp[]; // 行情盘面信息
+    RootUser: useInfo.Ermcp3RootUserAccount[],
 }
 
 export { advert };

+ 3 - 4
src/services/go/useInfo/index.ts

@@ -3,7 +3,6 @@ import { getLongTypeLoginID } from '@/services/bus/login';
 import { getUsrId } from '@/services/bus/user';
 import { commonSearch_go } from '../index';
 import * as type from './interface';
-import { Ermcp3RootUserAccount } from "./interface";
 
 /**
  * 获取登录ID
@@ -69,11 +68,11 @@ export function QueryUserInfo(userID: number, isDecrypt?: boolean): Promise<type
  * 查询顶级用户信息
  * /Ermcp3/QueryRootUserAccount
  */
-export function QueryRootUserAccount(): Promise<Ermcp3RootUserAccount> {
+export function QueryRootUserAccount(): Promise<string> {
     const userid = getUsrId()
     return commonSearch_go('/Ermcp3/QueryRootUserAccount', { userid }).then(res => {
-        console.log('查询顶级用户信息', res)
-        return res
+        APP.set('RootUser', res);
+        return 'ok'
     }).catch((err) => {
         throw new Error(`查询顶级用户信息: ${err}`);
     });

+ 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,
         };
     },
 });

+ 7 - 15
src/views/manage/inventory-review/components/checkinAudit/index.vue

@@ -64,7 +64,8 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="合同签署量">
-              <span class="white">{{ formatValue(selectedRow.contractqty) + " " +  selectedRow.enumdicname }}</span>
+              <span
+                    class="white">{{ formatValue(selectedRow.contractqty) + " " +  selectedRow.enumdicname }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -166,10 +167,11 @@ import { getLongTypeLoginID } from '@/services/bus/login';
 import { LongType } from '@/services/socket/login/interface';
 import { passStockControl, refuseStockControl } from '@/views/manage/inventory-review/components/setup';
 import moment from 'moment';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'inventory_review_checkin_audit',
-    components: {},
+    emits: ['cancel', 'update'],
     props: {
         selectedRow: {
             type: Object as PropType<Ermcp3AreaStockApply>,
@@ -177,16 +179,9 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('inventory_review_checkin_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() {
@@ -202,8 +197,7 @@ export default defineComponent({
                     };
                     passStockControl(param, loading)
                         .then((res) => {
-                            context.emit('refresh');
-                            cancel();
+                            cancel(true);
                         })
                         .catch((err) => {});
                 },
@@ -226,8 +220,7 @@ export default defineComponent({
                     };
                     refuseStockControl(param, loading)
                         .then((res) => {
-                            context.emit('refresh');
-                            cancel();
+                            cancel(true);
                         })
                         .catch((err) => {});
                 },
@@ -237,7 +230,6 @@ export default defineComponent({
         return {
             visible,
             cancel,
-            submit,
             loading,
             formatValue,
             getStatusName,

+ 7 - 10
src/views/manage/inventory-review/components/checkinCancel/index.vue

@@ -11,7 +11,7 @@
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
-                @click="submit">关闭
+                @click="cancel">关闭
       </a-button>
 
       <a-button key="submit"
@@ -58,7 +58,8 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="合同签署量">
-              <span class="white">{{ formatValue(selectedRow.contractqty) + " " +  selectedRow.enumdicname }}</span>
+              <span
+                    class="white">{{ formatValue(selectedRow.contractqty) + " " +  selectedRow.enumdicname }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -160,10 +161,11 @@ import { getLongTypeLoginID } from '@/services/bus/login';
 import { LongType } from '@/services/socket/login/interface';
 import moment from 'moment';
 import { refuseStockControl } from '@/views/manage/inventory-review/components/setup';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'inventory_review_checkin_cancel',
-    components: {},
+    emits: ['cancel', 'update'],
     props: {
         selectedRow: {
             type: Object as PropType<Ermcp3AreaStockApply>,
@@ -171,12 +173,9 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('inventory_review_checkin_cancel');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
-        function submit() {
-            cancel();
-        }
         function back() {
             Modal.confirm({
                 title: '是否确认撤销',
@@ -192,8 +191,7 @@ export default defineComponent({
                     };
                     refuseStockControl(param, loading)
                         .then((res) => {
-                            context.emit('refresh');
-                            cancel();
+                            cancel(true);
                         })
                         .catch((err) => {});
                 },
@@ -203,7 +201,6 @@ export default defineComponent({
         return {
             visible,
             cancel,
-            submit,
             loading,
             formatValue,
             getStatusName,

+ 7 - 10
src/views/manage/inventory-review/components/checkinDetail/index.vue

@@ -11,7 +11,7 @@
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
-                @click="submit">关闭
+                @click="cancel">关闭
       </a-button>
     </template>
     <a-form class="inlineForm"
@@ -54,7 +54,8 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="合同签署量">
-              <span class="white">{{ formatValue(selectedRow.contractqty) + " " +  selectedRow.enumdicname}}</span>
+              <span
+                    class="white">{{ formatValue(selectedRow.contractqty) + " " +  selectedRow.enumdicname}}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -149,29 +150,25 @@ import { InOutTypeName, isShowContractInfo } from '@/views/manage/inventory-revi
 import { getContractTypeName, getPriceTypeName } from '@/common/constants/enumsName';
 
 import { getGoodsUnitEnumItemName, getApplyStatusName } from '@/common/constants/enumsName';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'finance_review_funds_detail',
-    components: {},
+    emits: ['cancel', 'update'],
     props: {
         selectedRow: {
             type: Object as PropType<Ermcp3AreaStockApply>,
             default: {},
         },
     },
-    setup(props) {
-        const { visible, cancel } = closeModal('detail');
+    setup(props, context) {
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
 
-        function submit() {
-            cancel();
-        }
-
         return {
             visible,
             cancel,
-            submit,
             loading,
             formatValue,
             getStatusName,

+ 7 - 15
src/views/manage/inventory-review/components/checkoutAudit/index.vue

@@ -63,7 +63,8 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="合同签署量">
-              <span class="white">{{ formatValue(selectedRow.contractqty)  + " " +  selectedRow.enumdicname}}</span>
+              <span
+                    class="white">{{ formatValue(selectedRow.contractqty)  + " " +  selectedRow.enumdicname}}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -162,10 +163,11 @@ import { AreaInOutApplyAuditPassReq, AuditERMCPAreaInOutStockApplyReq } from '@/
 import { getLongTypeLoginID } from '@/services/bus/login';
 import moment from 'moment';
 import { LongType } from '@/services/socket/login/interface';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'inventory_review_checkout_audit',
-    components: {},
+    emits: ['cancel', 'update'],
     props: {
         selectedRow: {
             type: Object as PropType<Ermcp3AreaStockApply>,
@@ -173,16 +175,9 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('inventory_review_checkout_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() {
@@ -198,8 +193,7 @@ export default defineComponent({
                     };
                     passStockControl(param, loading)
                         .then((res) => {
-                            context.emit('refresh');
-                            cancel();
+                            cancel(true);
                         })
                         .catch((err) => {});
                 },
@@ -222,8 +216,7 @@ export default defineComponent({
                     };
                     refuseStockControl(param, loading)
                         .then((res) => {
-                            context.emit('refresh');
-                            cancel();
+                            cancel(true);
                         })
                         .catch((err) => {});
                 },
@@ -234,7 +227,6 @@ export default defineComponent({
         return {
             visible,
             cancel,
-            submit,
             loading,
             formatValue,
             getStatusName,

+ 6 - 13
src/views/manage/inventory-review/components/checkoutCancel/index.vue

@@ -60,7 +60,8 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="合同签署量">
-              <span class="white">{{ formatValue(selectedRow.contractqty) + " " +  selectedRow.enumdicname }}</span>
+              <span
+                    class="white">{{ formatValue(selectedRow.contractqty) + " " +  selectedRow.enumdicname }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -159,10 +160,11 @@ import { refuseStockControl } from '@/views/manage/inventory-review/components/s
 import { InOutTypeName, isShowContractInfo } from '@/views/manage/inventory-review/setup';
 import { getContractTypeName, getPriceTypeName } from '@/common/constants/enumsName';
 import { getGoodsUnitEnumItemName, getApplyStatusName } from '@/common/constants/enumsName';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'inventory_review_checkout_cancel',
-    components: {},
+    emits: ['cancel', 'update'],
     props: {
         selectedRow: {
             type: Object as PropType<Ermcp3AreaStockApply>,
@@ -170,17 +172,10 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('inventory_review_checkout_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();
-            }, 2000);
-        }
         function back() {
             Modal.confirm({
                 title: '是否确认撤销',
@@ -196,8 +191,7 @@ export default defineComponent({
                     };
                     refuseStockControl(param, loading)
                         .then((res) => {
-                            context.emit('refresh');
-                            cancel();
+                            cancel(true);
                         })
                         .catch((err) => {});
                 },
@@ -208,7 +202,6 @@ export default defineComponent({
         return {
             visible,
             cancel,
-            submit,
             loading,
             formatValue,
             getStatusName,

+ 6 - 13
src/views/manage/inventory-review/components/checkoutDetail/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"
@@ -50,7 +50,8 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="合同签署量">
-              <span class="white">{{ formatValue(selectedRow.contractqty) + " " +  selectedRow.enumdicname }}</span>
+              <span
+                    class="white">{{ formatValue(selectedRow.contractqty) + " " +  selectedRow.enumdicname }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -141,10 +142,11 @@ import { Ermcp3AreaStockApply } from '@/services/go/ermcp/inventory-review/inter
 import { InOutTypeName, isShowContractInfo } from '@/views/manage/inventory-review/setup';
 import { getGoodsUnitEnumItemName, getStatusName, getApplyStatusName } from '@/common/constants/enumsName';
 import { getContractTypeName, getPriceTypeName } from '@/common/constants/enumsName';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'finance_review_invoice_detail',
-    components: {},
+    emits: ['cancel', 'update'],
     props: {
         selectedRow: {
             type: Object as PropType<Ermcp3AreaStockApply>,
@@ -152,21 +154,12 @@ 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() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                context.emit('refresh');
-                cancel();
-            }, 200);
-        }
         return {
             visible,
             cancel,
-            submit,
             loading,
             formatValue,
             getStatusName,

+ 86 - 91
src/views/manage/inventory-review/list/checkin/index.vue

@@ -4,56 +4,55 @@
        :loading="loading">
     <Filter @search="updateColumn"
             :inOrOut="'in'">
-      <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 #applystatus="{ text }">
-          <a>{{ getApplyStatusName(text) }}</a>
-        </template>
-        <!-- 现货合同类型 -->
-        <template #contracttype="{ text }">
-          <a>{{ getContractTypeName(text) }}</a>
-        </template>
-        <!-- 点价类型 -->
-        <template #pricetype="{ text }">
-          <a>{{ getPriceTypeName(text) }}</a>
-        </template>
-        <!-- 出入库类型 -->
-        <template #inouttype="{ text }">
-          <a>{{ InOutTypeName(text) }}</a>
-        </template>
-        <template #buynicknameOrsellusername="{ record }">
-          <a>{{ handleName(record) }}</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 #applystatus="{ text }">
+        <a>{{ getApplyStatusName(text) }}</a>
+      </template>
+      <!-- 现货合同类型 -->
+      <template #contracttype="{ text }">
+        <a>{{ getContractTypeName(text) }}</a>
+      </template>
+      <!-- 点价类型 -->
+      <template #pricetype="{ text }">
+        <a>{{ getPriceTypeName(text) }}</a>
+      </template>
+      <!-- 出入库类型 -->
+      <template #inouttype="{ text }">
+        <a>{{ InOutTypeName(text) }}</a>
+      </template>
+      <template #buynicknameOrsellusername="{ record }">
+        <a>{{ handleName(record) }}</a>
+      </template>
 
-      </a-table>
+    </a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="handlePermissionBtn(firstBtn, selectedRow)">
     </contextMenu>
-    <!-- 审核-->
-    <CheckinAudit :selectedRow="selectedRow"
-                  @refresh="getTableData" />
-    <!-- 撤销 -->
-    <CheckinCancel :selectedRow="selectedRow"
-                   @refresh="getTableData" />
-    <!-- 详情 -->
-    <CheckinDetail :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, CheckinAudit, CheckinCancel, CheckinDetail } from '../../components';
 
@@ -62,6 +61,11 @@ import { getContractTypeName, getPriceTypeName, getApplyStatusName } from '@/com
 import { operateApplyTypeName } from '@/views/manage/finance-review/setup';
 import { InOutTypeName } from '@/views/manage/inventory-review/setup';
 import { Column, ColumnType } from '@/common/setup/table';
+import { EnumRouterName } from '@/common/constants/enumRouterName';
+import { BtnList as BtnListType } from '@/common/components/btnList/interface';
+const Detail = defineAsyncComponent(() => import('../../components/checkinDetail/index.vue'));
+const Audit = defineAsyncComponent(() => import('../../components/checkinAudit/index.vue'));
+const Cancel = defineAsyncComponent(() => import('../../components/checkinCancel/index.vue'));
 
 export default defineComponent({
     name: 'inventory_review_checkin',
@@ -69,70 +73,61 @@ export default defineComponent({
         contextMenu,
         Filter,
         BtnList,
-        CheckinAudit,
-        CheckinCancel,
-        CheckinDetail,
+        [ModalEnum.detail]: Detail,
+        [ModalEnum.inventory_review_checkin_audit]: Audit,
+        [ModalEnum.inventory_review_checkin_cancel]: Cancel,
     },
     setup() {
-        // 表头数据
-        const { columns, registerColumn, updateColumn } = getTableColumns();
-        // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3AreaStockApply>({});
-        // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('inventory_review_checkin', true);
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList({ inouttype: '1,3' });
-        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: Ermcp3AreaStockApply) => {
+                    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_stock_aduit_in', ['contracttype', 'contractno', 'deliverygoodsname'], (e: Column, item: ColumnType, filtered: any) => {
-                if (e.columnfield === 'buynicknameOrsellusername') {
-                    item.onFilter = (value: string, record: Ermcp3AreaStockApply) => {
-                        const { contracttype, buyusername, sellusername } = record;
-                        if (contracttype === 1) {
-                            // 采购
-                            return sellusername.includes(value);
-                        } else {
-                            return buyusername.includes(value);
-                        }
-                    };
-                    item.filteredValue = filtered.buynicknameOrsellusername || null;
+                };
+                item.filteredValue = filtered.buyusernameOrsellusername || null;
+            }
+        };
+        // 表格通用逻辑
+        const param: ComposeTableParam = {
+            queryFn: queryTableAction,
+            menuType: EnumRouterName.inventory_review_checkin,
+            tableName: 'table_pcweb_stock_aduit_in',
+            tableFilterKey: ['contracttype', 'contractno', 'deliverygoodsname'],
+            tableFilterCB: filtrFn,
+            isDetail: true,
+        };
+        function handlePermissionBtn(btnList: BtnListType[], item: Ermcp3AreaStockApply) {
+            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,
-            forDataBtn,
+            ...handleComposeTable<Ermcp3AreaStockApply>(param),
+            handlePermissionBtn,
             loading,
             tableList,
-            updateColumn,
             getApplyStatusName,
             getContractTypeName,
             operateApplyTypeName,
             getPriceTypeName,
             InOutTypeName,
-            getTableData,
             handleName,
         };
     },

+ 87 - 90
src/views/manage/inventory-review/list/checkout/index.vue

@@ -4,55 +4,54 @@
        :loading="loading">
     <Filter @search="updateColumn"
             :inOrOut="'out'">
-      <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 #applystatus="{ text }">
-          <a>{{ getApplyStatusName(text) }}</a>
-        </template>
-        <!-- 现货合同类型 -->
-        <template #contracttype="{ text }">
-          <a>{{ getContractTypeName(text) }}</a>
-        </template>
-        <!-- 点价类型 -->
-        <template #pricetype="{ text }">
-          <a>{{ getPriceTypeName(text) }}</a>
-        </template>
-        <!-- 出入库类型 -->
-        <template #inouttype="{ text }">
-          <a>{{ InOutTypeName(text) }}</a>
-        </template>
-        <template #buynicknameOrsellusername="{ record }">
-          <a>{{ handleName(record) }}</a>
-        </template>
-      </a-table>
+    <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 #applystatus="{ text }">
+        <a>{{ getApplyStatusName(text) }}</a>
+      </template>
+      <!-- 现货合同类型 -->
+      <template #contracttype="{ text }">
+        <a>{{ getContractTypeName(text) }}</a>
+      </template>
+      <!-- 点价类型 -->
+      <template #pricetype="{ text }">
+        <a>{{ getPriceTypeName(text) }}</a>
+      </template>
+      <!-- 出入库类型 -->
+      <template #inouttype="{ text }">
+        <a>{{ InOutTypeName(text) }}</a>
+      </template>
+      <template #buynicknameOrsellusername="{ record }">
+        <a>{{ handleName(record) }}</a>
+      </template>
+    </a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="handlePermissionBtn(firstBtn, selectedRow)">
     </contextMenu>
-    <!-- 详情 -->
-    <CheckoutDetail :selectedRow="selectedRow"
-                    @refresh="getTableData" />
-    <!-- 审核 -->
-    <CheckoutAudit :selectedRow="selectedRow"
-                   @refresh="getTableData" />
-    <!-- 撤销 -->
-    <CheckoutCancel :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 { CheckoutAudit, CheckoutCancel, CheckoutDetail, Filter } from '../../components';
 
@@ -61,6 +60,11 @@ import { getContractTypeName, getPriceTypeName, getApplyStatusName } from '@/com
 import { operateApplyTypeName } from '@/views/manage/finance-review/setup';
 import { InOutTypeName } from '@/views/manage/inventory-review/setup';
 import { Column, ColumnType } from '@/common/setup/table';
+import { EnumRouterName } from '@/common/constants/enumRouterName';
+import { BtnList as BtnListType } from '@/common/components/btnList/interface';
+const Detail = defineAsyncComponent(() => import('../../components/checkoutDetail/index.vue'));
+const Audit = defineAsyncComponent(() => import('../../components/checkoutAudit/index.vue'));
+const Cancel = defineAsyncComponent(() => import('../../components/checkoutCancel/index.vue'));
 
 export default defineComponent({
     name: 'inventory_review_checkout',
@@ -68,70 +72,63 @@ export default defineComponent({
         contextMenu,
         Filter,
         BtnList,
-        CheckoutDetail,
-        CheckoutAudit,
-        CheckoutCancel,
+        [ModalEnum.detail]: Detail,
+        [ModalEnum.inventory_review_checkout_audit]: Audit,
+        [ModalEnum.inventory_review_checkout_cancel]: Cancel,
     },
     setup() {
-        // 表头数据
-        const { columns, registerColumn, updateColumn } = getTableColumns();
-        // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3AreaStockApply>({});
-        // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('inventory_review_checkout', true);
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList({ inouttype: '2,4' });
-        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: Ermcp3AreaStockApply) => {
+                    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_stock_aduit_out', ['contracttype', 'contractno', 'deliverygoodsname'], (e: Column, item: ColumnType, filtered: any) => {
-                if (e.columnfield === 'buynicknameOrsellusername') {
-                    item.onFilter = (value: string, record: Ermcp3AreaStockApply) => {
-                        const { contracttype, buyusername, sellusername } = record;
-                        if (contracttype === 1) {
-                            // 采购
-                            return sellusername.includes(value);
-                        } else {
-                            return buyusername.includes(value);
-                        }
-                    };
-                    item.filteredValue = filtered.buynicknameOrsellusername || null;
+                };
+                item.filteredValue = filtered.buyusernameOrsellusername || null;
+            }
+        };
+        // 表格通用逻辑
+        const param: ComposeTableParam = {
+            queryFn: queryTableAction,
+            menuType: EnumRouterName.inventory_review_checkout,
+            tableName: 'table_pcweb_stock_aduit_out',
+            tableFilterKey: ['contracttype', 'contractno', 'deliverygoodsname'],
+            tableFilterCB: filtrFn,
+            isDetail: true,
+        };
+        function handlePermissionBtn(btnList: BtnListType[], item: Ermcp3AreaStockApply) {
+            if (item) {
+                const { applystatus } = item;
+                if (applystatus === 1) {
+                    return btnList;
+                } else {
+                    return btnList.filter((e) => e.code === 'detail');
                 }
-            });
-        });
+            } else {
+                return [];
+            }
+        }
 
         return {
-            columns,
+            ...handleComposeTable<Ermcp3AreaStockApply>(param),
+            handlePermissionBtn,
             handleName,
-            expandedRowKeys,
-            selectedRow,
-            Rowclick,
-            commonBtn,
-            forDataBtn,
+
             loading,
             tableList,
-            updateColumn,
             getApplyStatusName,
             getContractTypeName,
             operateApplyTypeName,
             getPriceTypeName,
             InOutTypeName,
-            getTableData,
         };
     },
 });

+ 8 - 1
src/views/report/components/filter/index.vue

@@ -27,11 +27,12 @@
                        :format="dateFormat" />
       </a-space>
       <a-select label-in-value
+                v-if="showUser"
                 class="conditionSelect ml10"
                 style="width: 120px"
                 v-model:value="selectedUser"
                 @change="userChange"
-                placeholder="请选择报表类型">
+                placeholder="请选择交易用户">
         <a-select-option v-for="item in userList"
                          :key="item.value">
           {{item.lable}}
@@ -55,6 +56,12 @@ import { handleReprotType } from '../../setup';
 export default defineComponent({
     name: 'report-common-filter-table',
     components: { FilterOption },
+    props: {
+        showUser: {
+            type: Boolean,
+            default: true,
+        },
+    },
     setup(props, context) {
         const { selectedReportType, reportType, reportTypeChange, isMonth, timeChange, dateFormat, time, selectedUser, userChange } = handleReprotType(context);
         const loading = ref<boolean>(false);

+ 4 - 9
src/views/report/inventory-report/components/filterTable/index.vue

@@ -1,9 +1,10 @@
 <template>
   <!-- 过滤客户资料表格 -->
-  <Filter @update="update">
+  <Filter @update="update"
+          :showUser="false">
     <!-- <FilterOption :selectList="selectList"
-                    :inputList="[]"
-                    :fixedBtnList="fixedBtnList" /> -->
+                  :inputList="[]"
+                  :fixedBtnList="fixedBtnList" /> -->
   </Filter>
 </template>
 
@@ -28,12 +29,6 @@ export default defineComponent({
         const select: SelectList[] = [
             {
                 value: undefined,
-                key: 'userId',
-                placeholder: '全部交易用户',
-                list: [],
-            },
-            {
-                value: undefined,
                 key: 'warehousetype',
                 placeholder: '全部套保品种',
                 list: [],