li.shaoyi 4 years ago
parent
commit
f750d7e253
31 changed files with 892 additions and 820 deletions
  1. 43 0
      src/common/constants/enumsName.ts
  2. 3 0
      src/common/setup/table/compose.ts
  3. 2 3
      src/views/business/plan/list/running/index.vue
  4. 17 16
      src/views/business/plan/list/uncommitted/index.vue
  5. 4 5
      src/views/information/account_info/compoments/add-child-traders/index.vue
  6. 6 12
      src/views/information/account_info/compoments/add-traders/index.vue
  7. 4 5
      src/views/information/account_info/compoments/cancel-trader/index.vue
  8. 10 18
      src/views/information/account_info/compoments/detail-commom-trader/index.vue
  9. 11 19
      src/views/information/account_info/compoments/detail-trader/index.vue
  10. 4 5
      src/views/information/account_info/compoments/locked-trader/index.vue
  11. 5 12
      src/views/information/account_info/compoments/modify-child-traders/index.vue
  12. 4 5
      src/views/information/account_info/compoments/modify-traders/index.vue
  13. 4 5
      src/views/information/account_info/compoments/reset-trader/index.vue
  14. 4 5
      src/views/information/account_info/compoments/unlocked-trader/index.vue
  15. 37 50
      src/views/information/account_info/list/account_info_trade/index.vue
  16. 4 5
      src/views/information/custom/index.vue
  17. 4 7
      src/views/information/warehouse-info/compoments/add/index.vue
  18. 5 6
      src/views/information/warehouse-info/compoments/detail/index.vue
  19. 37 41
      src/views/information/warehouse-info/compoments/disable/index.vue
  20. 5 12
      src/views/information/warehouse-info/compoments/modify/index.vue
  21. 38 42
      src/views/information/warehouse-info/compoments/recover/index.vue
  22. 1 1
      src/views/information/warehouse-info/list/index.ts
  23. 70 71
      src/views/information/warehouse-info/list/normal-use/index.vue
  24. 4 47
      src/views/information/warehouse-info/setup.ts
  25. 81 93
      src/views/manage/business-review/components/somepriceDetail/index.vue
  26. 73 94
      src/views/manage/finance-review/components/invoiceDetail/index.vue
  27. 120 138
      src/views/manage/inventory-review/components/checkinDetail/index.vue
  28. 135 0
      src/views/manage/inventory-review/list/audit/index.vue
  29. 9 18
      src/views/search/inventory/components/add/index.vue
  30. 53 59
      src/views/search/inventory/list/inventory_current/index.vue
  31. 95 26
      src/views/search/inventory/list/inventory_current/setup.ts

+ 43 - 0
src/common/constants/enumsName.ts

@@ -1337,4 +1337,47 @@ export function getTaacountStatus(status: number) {
             break
     }
     return result
+}
+
+/**
+ * 仓库类型 - 1 厂库 2 自有库 3 合作库
+ * @param type
+ */
+export function getWareHouseTypeName(type: number): string {
+    let result = "--";
+    switch (type) {
+        case 1:
+            result = "厂库";
+            break
+        case 2:
+            result = "自有库";
+            break
+        case 3:
+            result = "合作库";
+            break
+    }
+    return result
+}
+
+/**
+ * 仓库状态名称 - 1:正常 2:注销 3:待审核 4:审核拒绝
+ * @param status
+ */
+export function gerWareHouseStatusName(status: number): string {
+    let result = "--";
+    switch (status) {
+        case 1:
+            result = "正常";
+            break
+        case 2:
+            result = "注销";
+            break
+        case 3:
+            result = "待审核";
+            break
+        case 4:
+            result = "审核拒绝";
+            break
+    }
+    return result
 }

+ 3 - 0
src/common/setup/table/compose.ts

@@ -89,6 +89,8 @@ export function handleComposeTable_detail<T>({ queryFn, tableName, tableFilterKe
     // 表格事件
     const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<T>(events);
     cacheSelectedRow = selectedRow as Ref<T>
+    // 控制异步组件
+    const { componentId, closeComponent, openComponent } = handleModalComponent(queryFn, selectedRow);
     // 明细tab 列表
     const data = getThirdMenuData()
     const list = data.find((e) => e.code === menuType);
@@ -112,6 +114,7 @@ export function handleComposeTable_detail<T>({ queryFn, tableName, tableFilterKe
         columns, registerColumn, updateColumn,  //  表头数据
         columnsDetail, registerColumnDetail, updateColumnDetail, detailTableList,// 明细表头数据
         expandedRowKeys, selectedRow, Rowclick, // 表格事件
+        componentId, closeComponent, openComponent,  // 控制异步组件
         tabList,
     }
 }

+ 2 - 3
src/views/business/plan/list/running/index.vue

@@ -38,6 +38,8 @@ export default defineComponent({
         detail: defineAsyncComponent(() => import('../../components/detail/index.vue')),
     },
     setup() {
+        // 权限按钮
+        const buttons = getTableButton();
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<Ermcp3HedgePlan>();
 
@@ -53,9 +55,6 @@ export default defineComponent({
             isDetail: true,
         };
 
-        // 权限按钮
-        const buttons = getTableButton();
-
         return {
             ...handleComposeTable<Ermcp3HedgePlan>(param),
             loading,

+ 17 - 16
src/views/business/plan/list/uncommitted/index.vue

@@ -1,5 +1,4 @@
 <template>
-    <div style="background: red; color: #fff; padding: 5px 0">待修改-重新提交-plan_uncommitted_resubmit,撤销-plan_uncommitted_cancel</div>
     <!-- 计划: 未提交-->
     <div class="plan-uncommitted" :loading="loading">
         <Filter @search="updateColumn">
@@ -25,7 +24,6 @@
 
 <script lang="ts">
 import { queryTableList, MtpTableButton, contextMenu, defineAsyncComponent, defineComponent, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
-
 import { Filter } from '../../components';
 import { getPlanContractType, getPlanStatusName } from '@/views/business/plan/setup';
 import { BtnListType } from '@/common/components/btnList/interface';
@@ -40,17 +38,23 @@ export default defineComponent({
         contextMenu,
         MtpTableButton,
         Filter,
-        detail: defineAsyncComponent(() => import('../../components/detail/index.vue')),
-        plan_uncommitted_add: defineAsyncComponent(() => import('../../components/add/index.vue')),
-        plan_uncommitted_delete: defineAsyncComponent(() => import('../../components/delete/index.vue')),
-        plan_uncommitted_modify: defineAsyncComponent(() => import('../../components/modify/index.vue')),
+        detail: defineAsyncComponent(() => import('../../components/detail/index.vue')), // 详情
+        add: defineAsyncComponent(() => import('../../components/add/index.vue')), // 新增
+        delete: defineAsyncComponent(() => import('../../components/delete/index.vue')), // 删除
+        modify: defineAsyncComponent(() => import('../../components/modify/index.vue')), // 修改
+        resubmit: defineAsyncComponent(() => import('../../components/recommit/index.vue')), // 重新提交
+        cancel: defineAsyncComponent(() => import('../../components/cancel/index.vue')), // 撤销
+        check: defineAsyncComponent(() => import('../../components/audit/index.vue')), // 审核
     },
     setup() {
+        // 权限按钮
+        const firstBtn = getTableButton(['add']);
+        const secondBtn = getTableButton(['add'], true);
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<Ermcp3HedgePlan>();
 
         // 获取列表数据
-        const queryTableAction = () => queryTable(QueryHedgePlan, '0,4,6');
+        const queryTableAction = () => queryTable(QueryHedgePlan, '1,4,6');
 
         // 表格通用逻辑
         const param: ComposeTableParam = {
@@ -61,16 +65,13 @@ export default defineComponent({
             isDetail: true,
         };
 
-        // 权限按钮
-        const firstBtn = getTableButton(['plan_uncommitted_add']);
-        const secondBtn = getTableButton(['plan_uncommitted_resubmit', 'plan_uncommitted_cancel', 'plan_uncommitted_modify', 'plan_uncommitted_delete', 'detail']);
-
         function handleBtnList(btnList: BtnListType[], item: Ermcp3HedgePlan) {
-            if (item.hedgeplanstatus === 4) {
-                // 审核拒绝
-                return btnList.filter((e) => e.lable !== '修改');
-            } else {
-                return btnList.filter((e) => e.lable !== '重新提交');
+            switch (item.hedgeplanstatus) {
+                case 1: // 待审核
+                    return secondBtn.filter((item) => ['check', 'cancel', 'detail'].includes(item.code));
+                case 4: // 拒绝审核
+                case 6: // 已撤回
+                    return secondBtn.filter((item) => ['resubmit', 'delete', 'detail'].includes(item.code));
             }
         }
 

+ 4 - 5
src/views/information/account_info/compoments/add-child-traders/index.vue

@@ -48,7 +48,7 @@
 </template>
 
 <script lang="ts">
-import { closeModal } from '@/common/setup/modal/index';
+import { _closeModal } from '@/common/setup/modal/modal';
 import { defineComponent, ref, PropType } from 'vue';
 import { ErmcpLoginUserEx, ErmcpTaAccount } from '@/services/go/ermcp/account/interface';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
@@ -60,7 +60,7 @@ import { LoginaccountOperateReq, LoginTaaccount } from '@/services/proto/account
 
 export default defineComponent({
     name: 'account_info_trade_child_btn_add',
-    emits: ['refresh'],
+    emits: ['cancel', 'update'],
     components: {},
     props: {
         selectedData: {
@@ -75,7 +75,7 @@ export default defineComponent({
     setup(props, context) {
         const loading = ref<boolean>(false);
         // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_trade_child_btn_add');
+        const { visible, cancel } = _closeModal(context);
         const { rules, formState, formRef } = handleBusinessForm();
         function close() {
             formRef.value.resetFields();
@@ -102,8 +102,7 @@ export default defineComponent({
                     }), // LoginTaaccount 期货账户(勾选交易员必填)
                 };
                 requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['新增交易员成功', '新增交易员失败:']).then(() => {
-                    close();
-                    context.emit('refresh');
+                    cancel(true);
                 });
             });
         }

+ 6 - 12
src/views/information/account_info/compoments/add-traders/index.vue

@@ -17,7 +17,7 @@
 </template>
 
 <script lang="ts">
-import { closeModal } from '@/common/setup/modal/index';
+import { _closeModal } from '@/common/setup/modal/modal';
 import { defineComponent, ref, PropType } from 'vue';
 import { ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
 import { LoginaccountOperateReq } from '@/services/proto/accountinfo/interface';
@@ -30,7 +30,7 @@ import { getUserId } from '@/services/bus/user';
 
 export default defineComponent({
     name: 'account_info_trade_btn_add',
-    emits: ['refresh'],
+    emits: ['cancel', 'update'],
     props: {
         selectedData: {
             type: Object as PropType<ErmcpLoginUserEx>,
@@ -39,8 +39,9 @@ export default defineComponent({
     },
     setup(props, context) {
         // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_trade_btn_add');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
+
         const { rules, formState, formRef } = handleTradeForm();
         function submit() {
             validateAction<TraderFormState>(formRef, formState).then((res) => {
@@ -51,8 +52,7 @@ export default defineComponent({
                     accountname: res.rolename,
                 };
                 requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['新增成功', '新增失败:']).then(() => {
-                    cancel();
-                    context.emit('refresh');
+                    cancel(true);
                 });
             });
         }
@@ -70,10 +70,4 @@ export default defineComponent({
         };
     },
 });
-</script>
-
-<style lang="less">
-.add-traders {
-}
-</style
->;
+</script>

+ 4 - 5
src/views/information/account_info/compoments/cancel-trader/index.vue

@@ -10,7 +10,7 @@
 </template>
 
 <script lang="ts">
-import { closeModal } from '@/common/setup/modal/index';
+import { _closeModal } from '@/common/setup/modal/modal';
 import { defineComponent, ref, PropType } from 'vue';
 import { Modal } from 'ant-design-vue';
 import { LoginaccountOperateReq } from '@/services/proto/accountinfo/interface';
@@ -21,7 +21,7 @@ import Detail from '../detail-commom-trader/index.vue';
 
 export default defineComponent({
     name: 'account_info_trade_btn_child_logout',
-    emits: ['refresh'],
+    emits: ['cancel', 'update'],
     components: { Detail },
     props: {
         firstBtnData: {
@@ -35,7 +35,7 @@ export default defineComponent({
     },
     setup(props, context) {
         // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_trade_btn_child_logout');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         function submit() {
             Modal.confirm({
@@ -50,8 +50,7 @@ export default defineComponent({
                         logintaaccounts: [],
                     };
                     requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['账户注销成功', '账户注销失败:']).then(() => {
-                        cancel();
-                        context.emit('refresh');
+                        cancel(true);
                     });
                 },
                 onCancel() {},

+ 10 - 18
src/views/information/account_info/compoments/detail-commom-trader/index.vue

@@ -1,22 +1,14 @@
 <template>
-  <!-- 交易账号通用详情-->
-  <Des :list="desList"
-       :slotDesName="'授权期货账户'">
-    <a-checkbox-group class="commonCheckboxGroup"
-                      v-model:value="logintaaccounts">
-      <a-row>
-        <a-col :span="12"
-               v-for="(item, index) in selectedData.acclist"
-               :key="index"
-               :class="[index > 1 ? 'mt10' : '']">
-          <a-checkbox :value="item.accountid"
-                      disabled>
-            {{item.accountname}}/{{item.accountid}}
-          </a-checkbox>
-        </a-col>
-      </a-row>
-    </a-checkbox-group>
-  </Des>
+    <!-- 交易账号通用详情-->
+    <Des :list="desList" :slotDesName="'授权期货账户'">
+        <a-checkbox-group class="commonCheckboxGroup" v-model:value="logintaaccounts">
+            <a-row>
+                <a-col :span="12" v-for="(item, index) in selectedData.acclist" :key="index" :class="[index > 1 ? 'mt10' : '']">
+                    <a-checkbox :value="item.accountid" disabled> {{ item.accountname }}/{{ item.accountid }} </a-checkbox>
+                </a-col>
+            </a-row>
+        </a-checkbox-group>
+    </Des>
 </template>
 
 <script lang="ts">

+ 11 - 19
src/views/information/account_info/compoments/detail-trader/index.vue

@@ -1,30 +1,22 @@
 <template>
-  <!-- 交易账号详情-->
-  <a-modal class="add-custom detail-trader"
-           title="交易账号详情"
-           v-model:visible="visible"
-           centered
-           :maskClosable="false"
-           @cancel="cancel"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                @click="cancel">关闭</a-button>
-    </template>
-    <Detail :firstBtnData="firstBtnData"
-            :selectedData="selectedData" />
-  </a-modal>
+    <!-- 交易账号详情-->
+    <a-modal class="add-custom detail-trader" title="交易账号详情" v-model:visible="visible" centered :maskClosable="false" @cancel="cancel" width="890px">
+        <template #footer>
+            <a-button key="submit" type="primary" @click="cancel">关闭</a-button>
+        </template>
+        <Detail :firstBtnData="firstBtnData" :selectedData="selectedData" />
+    </a-modal>
 </template>
 
 <script lang="ts">
 import { defineComponent, PropType } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
+import { _closeModal } from '@/common/setup/modal/modal';
 import { ErmcpLoginUser, ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
 import Detail from '../detail-commom-trader/index.vue';
 
 export default defineComponent({
     name: 'trader-detail',
+    emits: ['cancel', 'update'],
     components: { Detail },
     props: {
         firstBtnData: {
@@ -36,8 +28,8 @@ export default defineComponent({
             default: {},
         },
     },
-    setup(props) {
-        const { visible, cancel } = closeModal('detail');
+    setup(props, context) {
+        const { visible, cancel } = _closeModal(context);
         return {
             visible,
             cancel,

+ 4 - 5
src/views/information/account_info/compoments/locked-trader/index.vue

@@ -9,7 +9,7 @@
 </template>
 
 <script lang="ts">
-import { closeModal } from '@/common/setup/modal/index';
+import { _closeModal } from '@/common/setup/modal/modal';
 import { defineComponent, ref, PropType } from 'vue';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { loginAccountOperate } from '@/services/proto/accountinfo';
@@ -20,7 +20,7 @@ import Detail from '../detail-commom-trader/index.vue';
 
 export default defineComponent({
     name: 'account_info_trade_btn_locked',
-    emits: ['refresh'],
+    emits: ['cancel', 'update'],
     components: { Detail },
     props: {
         firstBtnData: {
@@ -34,7 +34,7 @@ export default defineComponent({
     },
     setup(props, context) {
         // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_trade_btn_child_locked');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         function submit() {
             Modal.confirm({
@@ -49,8 +49,7 @@ export default defineComponent({
                         logintaaccounts: [],
                     };
                     requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['账户锁定成功', '账户锁定失败:']).then(() => {
-                        cancel();
-                        context.emit('refresh');
+                        cancel(true);
                     });
                 },
                 onCancel() {},

+ 5 - 12
src/views/information/account_info/compoments/modify-child-traders/index.vue

@@ -43,7 +43,7 @@
 </template>
 
 <script lang="ts">
-import { closeModal } from '@/common/setup/modal/index';
+import { _closeModal } from '@/common/setup/modal/modal';
 import { defineComponent, ref, PropType, watchEffect } from 'vue';
 import { ErmcpLoginUser, ErmcpLoginUserEx, ErmcpTaAccount } from '@/services/go/ermcp/account/interface';
 import { LoginaccountOperateReq, LoginTaaccount } from '@/services/proto/accountinfo/interface';
@@ -56,7 +56,7 @@ import { BusinessFormState } from '../interface';
 
 export default defineComponent({
     name: 'account_info_trade_btn_child_modify',
-    emits: ['refresh'],
+    emits: ['cancel', 'update'],
     props: {
         firstBtnData: {
             type: Object as PropType<ErmcpLoginUserEx>,
@@ -77,7 +77,7 @@ export default defineComponent({
     },
     setup(props, context) {
         // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_trade_btn_child_modify');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const { rules, formState, formRef } = handleBusinessForm();
         function filerAccount() {
@@ -110,8 +110,7 @@ export default defineComponent({
                     }), // LoginTaaccount 期货账户(勾选交易员必填)
                 };
                 requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['修改交易员成功', '修改交易员失败:']).then(() => {
-                    cancel();
-                    context.emit('refresh');
+                    cancel(true);
                 });
             });
         }
@@ -127,10 +126,4 @@ export default defineComponent({
         };
     },
 });
-</script>
-
-<style lang="less">
-.add-traders {
-}
-</style
->;
+</script>

+ 4 - 5
src/views/information/account_info/compoments/modify-traders/index.vue

@@ -18,7 +18,7 @@
 </template>
 
 <script lang="ts">
-import { closeModal } from '@/common/setup/modal/index';
+import { _closeModal } from '@/common/setup/modal/modal';
 import { defineComponent, ref, PropType, watchEffect } from 'vue';
 import { ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
 import { LoginaccountOperateReq } from '@/services/proto/accountinfo/interface';
@@ -31,7 +31,7 @@ import { TraderFormState } from '../interface';
 
 export default defineComponent({
     name: 'account_info_trade_btn_modify',
-    emits: ['refresh'],
+    emits: ['cancel', 'update'],
     props: {
         selectedData: {
             type: Object as PropType<ErmcpLoginUserEx>,
@@ -40,7 +40,7 @@ export default defineComponent({
     },
     setup(props, context) {
         // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_trade_btn_modify');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const { rules, formState, formRef } = handleTradeForm();
         watchEffect(() => {
@@ -60,8 +60,7 @@ export default defineComponent({
                     accountname: res.rolename,
                 };
                 requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['修改成功', '修改失败:']).then(() => {
-                    cancel();
-                    context.emit('refresh');
+                    cancel(true);
                 });
             });
         }

+ 4 - 5
src/views/information/account_info/compoments/reset-trader/index.vue

@@ -27,7 +27,7 @@
 </template>
 
 <script lang="ts">
-import { closeModal } from '@/common/setup/modal/index';
+import { _closeModal } from '@/common/setup/modal/modal';
 import { defineComponent, ref, PropType, watchEffect } from 'vue';
 import { ErmcpLoginUser } from '@/services/go/ermcp/account/interface';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
@@ -39,7 +39,7 @@ import { handlePasswordForm } from '../setup';
 
 export default defineComponent({
     name: 'account_info_trade_btn_child_reset',
-    emits: ['refresh'],
+    emits: ['cancel', 'update'],
     props: {
         selectedData: {
             default: {},
@@ -48,7 +48,7 @@ export default defineComponent({
     },
     setup(props, context) {
         // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_trade_btn_child_reset');
+        const { visible, cancel } = _closeModal(context);
         const { rules, formState, formRef } = handlePasswordForm();
         const loading = ref<boolean>(false);
         watchEffect(() => {
@@ -67,8 +67,7 @@ export default defineComponent({
                     password: res.password,
                 };
                 requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['重置登录账户密码成功', '重置登录账户密码失败:']).then(() => {
-                    cancel();
-                    context.emit('refresh');
+                    cancel(true);
                 });
             });
         }

+ 4 - 5
src/views/information/account_info/compoments/unlocked-trader/index.vue

@@ -9,7 +9,7 @@
 </template>
 
 <script lang="ts">
-import { closeModal } from '@/common/setup/modal/index';
+import { _closeModal } from '@/common/setup/modal/modal';
 import { defineComponent, ref, PropType } from 'vue';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { loginAccountOperate } from '@/services/proto/accountinfo';
@@ -20,7 +20,7 @@ import Detail from '../detail-commom-trader/index.vue';
 
 export default defineComponent({
     name: 'account_info_trade_btn_child_unlocked',
-    emits: ['refresh'],
+    emits: ['cancel', 'update'],
     components: { Detail },
     props: {
         firstBtnData: {
@@ -34,7 +34,7 @@ export default defineComponent({
     },
     setup(props, context) {
         // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_trade_btn_child_unlocked');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         function submit() {
             Modal.confirm({
@@ -49,8 +49,7 @@ export default defineComponent({
                         logintaaccounts: [],
                     };
                     requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['解锁解锁成功', '解锁解锁失败:']).then(() => {
-                        cancel();
-                        context.emit('refresh');
+                        cancel(true);
                     });
                 },
                 onCancel() {},

+ 37 - 50
src/views/information/account_info/list/account_info_trade/index.vue

@@ -10,7 +10,7 @@
                 </svg>
                 {{ getUserName() }}
             </span>
-            <BtnList :btnList="firstBtn" />
+            <mtp-table-button :buttons="firstBtn" @click="openComponent" />
         </div>
         <div class="a-collapse-container">
             <a-collapse class="spotCollapse" v-for="(item, i) in tableList" :key="i + '11'" :bordered="false">
@@ -27,7 +27,7 @@
                         <a-row class="headRow">
                             <a-col :span="12"> {{ item.rolename }}({{ item.userlist.length }}) </a-col>
                             <a-col :span="12">
-                                <BtnList :btnList="secondBtn" @onClick="btnClick(item)" />
+                                <mtp-table-button :buttons="secondBtn" :record="item" @click="openComponent" />
                             </a-col>
                         </a-row>
                     </template>
@@ -39,77 +39,67 @@
                                     <a-col :span="12">{{ getRoleTypeName(sub.loginstatus) }}</a-col>
                                 </a-row>
                             </template>
-                            <BtnList :btnList="sub.btnList" @onClick="btnClick(item, sub)" />
+                            <mtp-table-button :buttons="thirdBtn" :record="sub" @click="openComponent" />
                         </a-collapse-panel>
                     </a-collapse>
                 </a-collapse-panel>
             </a-collapse>
         </div>
-        <Add @refresh="handleBtnAction" />
-        <AddChild @refresh="handleBtnAction" :accountList="accountList" :selectedData="firstBtnData" />
-        <Modify @refresh="handleBtnAction" :selectedData="firstBtnData" />
-        <Locked @refresh="handleBtnAction" :firstBtnData="firstBtnData" :accountList="accountList" :tableList="tableList" :selectedData="secondBtnData" />
-        <Unlocked @refresh="handleBtnAction" :firstBtnData="firstBtnData" :accountList="accountList" :tableList="tableList" :selectedData="secondBtnData" />
-        <Cancel @refresh="handleBtnAction" :accountList="accountList" :firstBtnData="firstBtnData" :tableList="tableList" :selectedData="secondBtnData" />
-        <Reset @refresh="handleBtnAction" :accountList="accountList" :tableList="tableList" :selectedData="secondBtnData" />
-        <Detail :selectedData="secondBtnData" :accountList="accountList" :firstBtnData="firstBtnData" :tableList="tableList" />
-        <ModifyChild @refresh="handleBtnAction" :accountList="accountList" :firstBtnData="firstBtnData" :tableList="tableList" :selectedData="secondBtnData" />
+        <component :is="componentId" v-if="componentId" :accountList="accountList" :tableList="tableList" :selectedData="selectedData" @cancel="closeComponent"></component>
     </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getBtnList, contextMenu, BtnList, _getBtnList } from '@/common/export/table';
+import { initData, _getBtnList } from '@/common/export/table';
+import { contextMenu, defineAsyncComponent, defineComponent, MtpTableButton } from '@/common/export/commonTable';
 import filterCustomTable from '@/views/information/goods/components/filterTable/index.vue';
-import { getRoleTypeName, handleBtnClickData } from '../setup';
+import { getRoleTypeName } from '../setup';
 import { getUserName } from '@/services/bus/user';
-import Modify from '../../compoments/modify-traders/index.vue';
-import Add from '../../compoments/add-traders/index.vue';
-import AddChild from '../../compoments/add-child-traders/index.vue';
-import Locked from '../../compoments/locked-trader/index.vue';
-import Unlocked from '../../compoments/unlocked-trader/index.vue';
-import Cancel from '../../compoments/cancel-trader/index.vue';
-import Reset from '../../compoments/reset-trader/index.vue';
-import Detail from '../../compoments/detail-trader/index.vue';
-import ModifyChild from '../../compoments/modify-child-traders/index.vue';
-import { handleModalData, handleTableList } from '../setup';
-import { ErmcpLoginUser, ErmcpLoginUserEx, ErmcpTaAccount, ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
+import { handleTableList } from '../setup';
+import { ErmcpLoginUserEx, ErmcpTaAccount, ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
 import { ref } from 'vue';
 import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { QueryAccMgrTaaccount } from '@/services/go/ermcp/account';
+import { handleModalComponent } from '@/common/setup/asyncComponent';
 import { handlerManagerList } from '@/common/setup/user';
+import { getTableButton } from '@/common/setup/table/button';
 
 export default defineComponent({
     name: 'account_info_trade',
     components: {
         contextMenu,
-        BtnList,
+        MtpTableButton,
         filterCustomTable,
-        Modify,
-        Add,
-        AddChild,
-        Locked,
-        Unlocked,
-        Cancel,
-        Reset,
-        Detail,
-        ModifyChild,
+        account_trade_modify: defineAsyncComponent(() => import('../../compoments/modify-traders/index.vue')),
+        account_trade_add: defineAsyncComponent(() => import('../../compoments/add-traders/index.vue')),
+        add_child: defineAsyncComponent(() => import('../../compoments/add-child-traders/index.vue')),
+        account_trade_child_locked: defineAsyncComponent(() => import('../../compoments/locked-trader/index.vue')),
+        unlocked: defineAsyncComponent(() => import('../../compoments/unlocked-trader/index.vue')),
+        account_trade_child_logout: defineAsyncComponent(() => import('../../compoments/cancel-trader/index.vue')),
+        account_trade_child_reset: defineAsyncComponent(() => import('../../compoments/reset-trader/index.vue')),
+        detail: defineAsyncComponent(() => import('../../compoments/detail-trader/index.vue')),
+        account_trade_child_modify: defineAsyncComponent(() => import('../../compoments/modify-child-traders/index.vue')),
     },
     setup() {
         // 加载状态
         const loading = ref<boolean>(false);
         const { tableList, queryTable } = handlerManagerList(loading, 2);
-        const [firstBtn, secondBtn, thirdBtn] = _getBtnList('account_info_trade', true).value;
-        // 新增弹窗
-        const { selectedData: addModelData, openAction } = handleModalData<ErmcpLoginUserEx>();
-        // 修改 重置密码、详情等弹窗
-        const { selectedData: moreModelData, openAction: moreOptenAction } = handleModalData<ErmcpLoginUser>();
+
+        const firstBtn = getTableButton(['account_trade_add']);
+        const secondBtn = getTableButton(['account_trade_modify', 'add_child']);
+        const thirdBtn = getTableButton(['account_trade_add', 'account_trade_modify', 'add_child'], true);
+
         // 处理根据状态显示对应按钮
         function handleBtnAction() {
             handleTableList(queryTable, tableList, thirdBtn);
         }
-        const { firstBtnData, secondBtnData, btnClick } = handleBtnClickData();
+
         // 授权期货账户
         const accountList = ref<ErmcpTaAccount[]>([]);
+        // 弹窗选中的数据
+        const selectedData = ref<ErmcpLoginUserEx>();
+        // 控制异步组件
+        const { componentId, closeComponent, openComponent } = handleModalComponent(handleBtnAction, selectedData);
 
         initData(() => {
             handleBtnAction();
@@ -131,23 +121,20 @@ export default defineComponent({
         function search(value: any) {}
 
         return {
-            firstBtnData,
-            btnClick,
+            selectedData,
             firstBtn,
-            secondBtnData,
             secondBtn,
             thirdBtn,
             loading,
             search,
             tableList,
+            accountList,
             getRoleTypeName,
-            getUserName,
-            addModelData,
-            openAction,
-            moreModelData,
-            moreOptenAction,
             handleBtnAction,
-            accountList,
+            getUserName,
+            componentId,
+            closeComponent,
+            openComponent,
         };
     },
 });

+ 4 - 5
src/views/information/custom/index.vue

@@ -50,6 +50,10 @@ export default defineComponent({
     },
     setup() {
         const { isRouterName } = useRouteName();
+        // 新增权限按钮
+        const addButton = getTableButton(['add']);
+        // 表格权限按钮
+        const buttons = getTableButton(['add'], true);
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<QueryCustomInfoType>();
 
@@ -76,11 +80,6 @@ export default defineComponent({
             isDetail: true,
         };
 
-        // 权限按钮
-        const buttons = getTableButton(['add'], true);
-        // 新增
-        const addButton = getTableButton(['add']);
-
         return {
             ...handleComposeTable<QueryCustomInfoType>(param),
             loading,

+ 4 - 7
src/views/information/warehouse-info/compoments/add/index.vue

@@ -97,7 +97,7 @@
 
 <script lang="ts">
 import { defineComponent, PropType, ref, toRaw } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
+import { _closeModal } from '@/common/setup/modal/modal';
 import { getAddress } from '@/services/go/adress';
 import { handleForm, FormState } from '../setup';
 import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
@@ -112,7 +112,7 @@ import { isPingAnOem } from '@/common/config/projectName';
 
 export default defineComponent({
     name: 'warehouse_info_btn_add',
-    emits: ['refresh'],
+    emits: ['cancel', 'update'],
     components: {},
     props: {
         selectedRow: {
@@ -121,7 +121,7 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('warehouse_info_btn_add');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const { cityList, districtList, provinceList, getCityList, getDistrictList } = getAddress();
         const warehouseType = ref<AllEnums[]>(getWarehouseTypeEnumList());
@@ -142,8 +142,7 @@ export default defineComponent({
                     contactnum: param.contactnum, // string 联系电话
                 };
                 requestResultLoadingAndInfo(addWarehouseApply, reqParam, loading, ['新建仓库成功', '新建仓库失败']).then(() => {
-                    cancel();
-                    context.emit('refresh');
+                    cancel(true);
                 });
             });
         }
@@ -169,8 +168,6 @@ export default defineComponent({
 </script>
 
 <style lang="less">
-.add-warehouse {
-}
 .upload {
     display: inline-flex;
     .ant-btn.uploadBtn {

+ 5 - 6
src/views/information/warehouse-info/compoments/detail/index.vue

@@ -4,7 +4,7 @@
         <template #footer>
             <a-button key="submit" type="primary" :loading="loading" @click="submit">关闭</a-button>
         </template>
-        <a-form class="inlineForm" :form="form" @submit="handleSearch">
+        <a-form class="inlineForm">
             <a-row :gutter="24">
                 <a-col :span="12">
                     <a-form-item label="仓库类型">
@@ -61,17 +61,17 @@
 
 <script lang="ts">
 import { defineComponent, PropType, ref } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
+import { _closeModal } from '@/common/setup/modal/modal';
 import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
 import { ErmcpWareHouseInfo } from '@/services/go/ermcp/warehouse-info/interface';
-import { gerWareHouseStatusName, getAddressInfo, getWareHouseTypeName } from '@/views/information/warehouse-info/setup';
+import { gerWareHouseStatusName, getWareHouseTypeName } from '@/common/constants/enumsName';
 import { formatValue } from '@/common/methods';
 import { getAddress } from '@/services/go/adress';
 import { isPingAnOem } from '@/common/config/projectName';
 
 export default defineComponent({
     name: 'warehouse_info_btn-detail',
-    emits: ['refresh'],
+    emits: ['cancel', 'update'],
     components: {},
     props: {
         selectedRow: {
@@ -80,13 +80,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);
         const { getProvinceName, getCityName, getDistrictName } = getAddress();
         function submit() {
             cancel();
-            context.emit('refresh');
         }
         return {
             visible,

+ 37 - 41
src/views/information/warehouse-info/compoments/disable/index.vue

@@ -1,11 +1,11 @@
 <template>
     <!-- 停用仓库信息-->
-    <a-modal class="commonModal warehouse-disable" title="停用仓库信息" v-model:visible="visible" centered :maskClosable="false" @cancel="cancel" width="890px">
+    <a-modal class="commonModal warehouse-disable" title="停用仓库信息" v-model:visible="visible" centered :maskClosable="maskClosableFlag" @cancel="cancel" width="890px">
         <template #footer>
             <a-button key="cancel" class="cancelBtn" @click="cancel">取消 </a-button>
             <a-button key="submit" type="primary" :loading="loading" @click="submit">确认停用 </a-button>
         </template>
-        <a-form class="inlineForm" :form="form" @submit="handleSearch">
+        <a-form class="inlineForm">
             <a-row :gutter="24">
                 <a-col :span="12">
                     <a-form-item label="仓库类型">
@@ -25,57 +25,56 @@
                     </a-form-item>
                 </a-col>
                 <a-col :span="12">
+                    <a-form-item label="联系人">
+                        <span class="white">{{ formatValue(selectedRow.contactname) }}</span>
+                    </a-form-item>
+                </a-col>
+            </a-row>
+            <a-row :gutter="24">
+                <a-col :span="12">
+                    <a-form-item label="联系电话">
+                        <span class="white">{{ formatValue(selectedRow.contactnum) }}</span>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
                     <a-form-item label="状态">
                         <span class="white">{{ gerWareHouseStatusName(selectedRow.warehousestatus) }}</span>
                     </a-form-item>
                 </a-col>
             </a-row>
-            <template v-if="!isOemByEnum()">
-                <a-row :gutter="24">
-                    <a-col :span="12">
-                        <a-form-item label="联系电话">
-                            <span class="white">{{ formatValue(selectedRow.contactnum) }}</span>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="联系人">
-                            <span class="white">{{ formatValue(selectedRow.contactname) }}</span>
-                        </a-form-item>
-                    </a-col>
-                </a-row>
-                <a-row :gutter="24">
-                    <a-col :span="12">
-                        <a-form-item label="所在地区">
-                            <span class="white">{{ getProvinceName(selectedRow.provinceid) + getCityName(selectedRow.cityid) + getDistrictName(selectedRow.districtid) }}</span>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="详细地址">
-                            <span class="white">{{ formatValue(selectedRow.address) }}</span>
-                        </a-form-item>
-                    </a-col>
-                </a-row>
-            </template>
+            <a-row :gutter="24">
+                <a-col :span="12">
+                    <a-form-item label="所在地区">
+                        <span class="white">{{ getProvinceName(selectedRow.provinceid) + getCityName(selectedRow.cityid) + getDistrictName(selectedRow.districtid) }}</span>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="详细地址">
+                        <span class="white">{{ formatValue(selectedRow.address) }}</span>
+                    </a-form-item>
+                </a-col>
+            </a-row>
         </a-form>
     </a-modal>
 </template>
 
 <script lang="ts">
 import { defineComponent, PropType, ref } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
+import { _closeModal } from '@/common/setup/modal/modal';
 import { ErmcpWareHouseInfo } from '@/services/go/ermcp/warehouse-info/interface';
 import { Modal } from 'ant-design-vue';
-import { gerWareHouseStatusName, getWareHouseTypeName } from '@/views/information/warehouse-info/setup';
+import { gerWareHouseStatusName, getWareHouseTypeName } from '@/common/constants/enumsName';
 import { formatValue } from '@/common/methods';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { getSelectedAccountId } from '@/services/bus/account';
 import { WarehouseStateChangeReq } from '@/services/proto/warehouse/interface';
 import { warehouseStateChangeReq } from '@/services/proto/warehouse';
 import { isPingAnOem } from '@/common/config/projectName';
+import { getAddress } from '@/services/go/adress';
 
 export default defineComponent({
     name: 'warehouse_info_btn_disable',
-    emits: ['refresh'],
+    emits: ['cancel', 'update'],
     components: {},
     props: {
         selectedRow: {
@@ -84,9 +83,10 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('warehouse_info_btn_disable');
+        const { visible, cancel } = _closeModal(context);
         const maskClosableFlag = ref<boolean>(false);
         const loading = ref<boolean>(false);
+        const { getProvinceName, getCityName, getDistrictName } = getAddress();
 
         function submit() {
             loading.value = true;
@@ -102,8 +102,7 @@ export default defineComponent({
                         warehousestatus: 2,
                     };
                     requestResultLoadingAndInfo(warehouseStateChangeReq, req, loading, ['停用仓库成功', '停用仓库失败:']).then(() => {
-                        context.emit('refresh');
-                        cancel();
+                        cancel(true);
                     });
                 },
                 onCancel() {},
@@ -120,13 +119,10 @@ export default defineComponent({
             getWareHouseTypeName,
             formatValue,
             isPingAnOem,
+            getProvinceName,
+            getCityName,
+            getDistrictName,
         };
     },
 });
-</script>
-
-<style lang="less">
-.warehouse-disable {
-}
-</style
->;
+</script>

+ 5 - 12
src/views/information/warehouse-info/compoments/modify/index.vue

@@ -75,7 +75,7 @@
 
 <script lang="ts">
 import { defineComponent, PropType, ref, toRaw, watchEffect } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
+import { _closeModal } from '@/common/setup/modal/modal';
 import { getAddress } from '@/services/go/adress';
 import { handleForm, FormState, warehouseApply } from '../setup';
 import { AllEnums } from '@/services/go/commonService/interface';
@@ -87,7 +87,7 @@ import { validateAction } from '@/common/setup/form';
 
 export default defineComponent({
     name: 'warehouse_info_btn_modify',
-    emits: ['refresh'],
+    emits: ['cancel', 'update'],
     props: {
         selectedRow: {
             type: Object as PropType<ErmcpWareHouseInfo>,
@@ -96,7 +96,7 @@ export default defineComponent({
     },
     components: {},
     setup(props, context) {
-        const { visible, cancel } = closeModal('warehouse_info_btn_modify');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const { cityList, districtList, provinceList, getCityList, getDistrictList } = getAddress();
         const warehouseType = ref<AllEnums[]>(getWarehouseTypeEnumList());
@@ -126,8 +126,7 @@ export default defineComponent({
                 };
                 warehouseApply(reqParam, loading)
                     .then((res) => {
-                        cancel();
-                        context.emit('refresh');
+                        cancel(true);
                     })
                     .catch((err) => {});
             });
@@ -159,10 +158,4 @@ export default defineComponent({
         };
     },
 });
-</script>
-
-<style lang="less">
-.modify-custom {
-}
-</style
->;
+</script>

+ 38 - 42
src/views/information/warehouse-info/compoments/recover/index.vue

@@ -1,11 +1,11 @@
 <template>
     <!-- 恢复仓库信息-->
-    <a-modal class="commonModal modify-custom" title="恢复仓库信息" v-model:visible="visible" centered :maskClosable="false" @cancel="cancel" width="890px">
+    <a-modal class="commonModal modify-custom" title="恢复仓库信息" v-model:visible="visible" centered :maskClosable="maskClosableFlag" @cancel="cancel" width="890px">
         <template #footer>
-            <a-button key="submit" class="cancelBtn" @click="cancel">取消 </a-button>
+            <a-button key="cancel" class="cancelBtn" @click="cancel">取消 </a-button>
             <a-button key="submit" type="primary" :loading="loading" @click="submit">确认恢复 </a-button>
         </template>
-        <a-form class="inlineForm" :form="form" @submit="handleSearch">
+        <a-form class="inlineForm">
             <a-row :gutter="24">
                 <a-col :span="12">
                     <a-form-item label="仓库类型">
@@ -25,57 +25,56 @@
                     </a-form-item>
                 </a-col>
                 <a-col :span="12">
+                    <a-form-item label="联系人">
+                        <span class="white">{{ formatValue(selectedRow.contactname) }}</span>
+                    </a-form-item>
+                </a-col>
+            </a-row>
+            <a-row :gutter="24">
+                <a-col :span="12">
+                    <a-form-item label="联系电话">
+                        <span class="white">{{ formatValue(selectedRow.contactnum) }}</span>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
                     <a-form-item label="状态">
                         <span class="white">{{ gerWareHouseStatusName(selectedRow.warehousestatus) }}</span>
                     </a-form-item>
                 </a-col>
             </a-row>
-            <template v-if="!isPingAnOem()">
-                <a-row :gutter="24">
-                    <a-col :span="12">
-                        <a-form-item label="联系电话">
-                            <span class="white">{{ formatValue(selectedRow.contactnum) }}</span>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="联系人">
-                            <span class="white">{{ formatValue(selectedRow.contactname) }}</span>
-                        </a-form-item>
-                    </a-col>
-                </a-row>
-                <a-row :gutter="24">
-                    <a-col :span="12">
-                        <a-form-item label="所在地区">
-                            <span class="white">{{ getProvinceName(selectedRow.provinceid) + getCityName(selectedRow.cityid) + getDistrictName(selectedRow.districtid) }}</span>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="详细地址">
-                            <span class="white">{{ formatValue(selectedRow.address) }}</span>
-                        </a-form-item>
-                    </a-col>
-                </a-row>
-            </template>
+            <a-row :gutter="24">
+                <a-col :span="12">
+                    <a-form-item label="所在地区">
+                        <span class="white">{{ getProvinceName(selectedRow.provinceid) + getCityName(selectedRow.cityid) + getDistrictName(selectedRow.districtid) }}</span>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="详细地址">
+                        <span class="white">{{ formatValue(selectedRow.address) }}</span>
+                    </a-form-item>
+                </a-col>
+            </a-row>
         </a-form>
     </a-modal>
 </template>
 
 <script lang="ts">
 import { defineComponent, PropType, ref } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
+import { _closeModal } from '@/common/setup/modal/modal';
 import { ErmcpWareHouseInfo } from '@/services/go/ermcp/warehouse-info/interface';
 import { Modal } from 'ant-design-vue';
-import { gerWareHouseStatusName, getWareHouseTypeName } from '@/views/information/warehouse-info/setup';
+import { gerWareHouseStatusName, getWareHouseTypeName } from '@/common/constants/enumsName';
 import { formatValue } from '@/common/methods';
 import { getSelectedAccountId } from '@/services/bus/account';
 import { WarehouseStateChangeReq } from '@/services/proto/warehouse/interface';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { warehouseStateChangeReq } from '@/services/proto/warehouse';
 import { isPingAnOem } from '@/common/config/projectName';
+import { getAddress } from '@/services/go/adress';
 
 export default defineComponent({
     name: 'warehouse_info_btn_recover',
-    emits: ['refresh'],
+    emits: ['cancel', 'update'],
     components: {},
     props: {
         selectedRow: {
@@ -84,9 +83,10 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('warehouse_info_btn_recover');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
+        const { getProvinceName, getCityName, getDistrictName } = getAddress();
 
         function submit() {
             loading.value = true;
@@ -102,8 +102,7 @@ export default defineComponent({
                         warehousestatus: 1,
                     };
                     requestResultLoadingAndInfo(warehouseStateChangeReq, req, loading, ['恢复仓库成功', '恢复仓库失败:']).then(() => {
-                        context.emit('refresh');
-                        cancel();
+                        cancel(true);
                     });
                 },
                 onCancel() {},
@@ -120,13 +119,10 @@ export default defineComponent({
             getWareHouseTypeName,
             formatValue,
             isPingAnOem,
+            getProvinceName,
+            getCityName,
+            getDistrictName,
         };
     },
 });
-</script>
-
-<style lang="less">
-.modify-custom {
-}
-</style
->;
+</script>

+ 1 - 1
src/views/information/warehouse-info/list/index.ts

@@ -1,5 +1,5 @@
 import { ErmcpWareHouseInfo } from '@/services/go/ermcp/warehouse-info/interface';
-import { gerWareHouseStatusName, getWareHouseTypeName } from '../setup';
+import { gerWareHouseStatusName, getWareHouseTypeName } from '@/common/constants/enumsName';
 import { queryTableList } from './setup';
 
 export {

+ 70 - 71
src/views/information/warehouse-info/list/normal-use/index.vue

@@ -1,100 +1,99 @@
 <template>
-    <div style="background: red; color: #fff; padding: 5px 0">待修改</div>
     <!-- 仓库信息: 正常 -->
     <div class="warehouse-info-normal" :loading="loading">
-        <filterCustomTable @search="updateColumn">
-            <BtnList :btnList="commonBtn" />
-        </filterCustomTable>
-        <contextMenu :contextMenuList="forDataBtn">
-            <a-table :columns="columns" class="srcollYTable" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }" :pagination="false" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" rowKey="key" :data-source="tableList">
-                <!-- 额外的展开行 -->
-                <template #expandedRowRender="{ record }">
-                    <BtnList :selectedData="record" class="btn-list-sticky" :btnList="forDataBtn" @onClick="btnClick" />
-                </template>
-                <template v-if="isPingAnOem()" #index="{ index }">
-                    <span>{{ index + 1 }}</span>
-                </template>
-                <template #warehousetype="{ text }">
-                    <span>{{ getWareHouseTypeName(text) }}</span>
-                </template>
-                <template #warehousestatus="{ text }">
-                    <span>{{ gerWareHouseStatusName(text) }}</span>
-                </template>
-            </a-table>
-        </contextMenu>
-        <!-- 新增仓库信息 -->
-        <Add :selectedRow="selectedRow" @refresh="queryTable" />
-        <!-- 停用仓库信息 -->
-        <Disable :selectedRow="selectedRow" @refresh="queryTable" />
-        <!-- 仓库信息详情 -->
-        <Detail :selectedRow="selectedRow" @refresh="queryTable" />
-        <!-- 修改仓息库信 -->
-        <Modify :selectedRow="selectedRow" @refresh="queryTable" />
+        <Filter @search="updateColumn">
+            <mtp-table-button class="btn-list-sticky" :buttons="addButton" @click="openComponent" />
+        </Filter>
+        <a-table :columns="isPingAnOem() ? pingan_cwarehousecolumn() : columns" class="srcollYTable" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }" :pagination="false" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" rowKey="key" :data-source="tableList">
+            <!-- 额外的展开行 -->
+            <template #expandedRowRender="{ record }">
+                <mtp-table-button class="btn-list-sticky" :buttons="buttons" :record="record" @click="openComponent" />
+            </template>
+            <template v-if="isPingAnOem()" #index="{ index }">
+                <span>{{ index + 1 }}</span>
+            </template>
+            <template #warehousetype="{ text }">
+                <span>{{ getWareHouseTypeName(text) }}</span>
+            </template>
+            <template #warehousestatus="{ text }">
+                <span>{{ gerWareHouseStatusName(text) }}</span>
+            </template>
+        </a-table>
+        <!-- 右键 -->
+        <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="buttons"> </contextMenu>
+        <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 { filterCustomTable, Add, Disable, Detail, Modify } from '../../compoments';
-import { gerWareHouseStatusName, getWareHouseTypeName, queryTableList, ErmcpWareHouseInfo } from '../index';
+import { ComposeTableParam, contextMenu, defineAsyncComponent, defineComponent, handleComposeTable, MtpTableButton, queryTableList } from '@/common/export/commonTable';
+import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { isPingAnOem } from '@/common/config/projectName';
 import { pingan_cwarehousecolumn } from '../setup';
+import { getWareHouseTypeName, gerWareHouseStatusName } from '../index';
+import { QueryWareHouse } from '@/services/go/ermcp/warehouse-info/index';
+import { ErmcpWareHouseInfo } from '@/services/go/ermcp/warehouse-info/interface';
+import Filter from '../../compoments/filterTable/index.vue';
+import { getTableButton } from '@/common/setup/table/button';
+import { useRoute } from 'vue-router';
 
 export default defineComponent({
     name: 'warehouse-info-normal',
     components: {
         contextMenu,
-        filterCustomTable,
-        Add,
-        Disable,
-        Detail,
-        Modify,
-        BtnList,
+        MtpTableButton,
+        Filter,
+        detail: defineAsyncComponent(() => import('../../compoments/detail/index.vue')), // 详情
+        add: defineAsyncComponent(() => import('../../compoments/add/index.vue')), // 新增
+        modify: defineAsyncComponent(() => import('../../compoments/modify/index.vue')), // 修改
+        disable: defineAsyncComponent(() => import('../../compoments/disable/index.vue')), // 停用
+        recover: defineAsyncComponent(() => import('../../compoments/recover/index.vue')), // 恢复
     },
     setup() {
-        // 表头数据
-        const { columns, registerColumn, updateColumn } = getTableColumns();
-        // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick, btnClick } = getTableEvent<ErmcpWareHouseInfo>({});
-        // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal', true);
+        const { name: routeName } = useRoute();
+        // 新增权限按钮
+        const addButton = getTableButton(['add']);
+        // 表格权限按钮
+        const buttons = getTableButton(['add'], true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList('1');
-        initData(() => {
-            // 获取列表数据
-            queryTable();
-            // 注册表头信息 过滤
-            registerColumn('table_pcweb_warehouse', ['warehousetype', 'warehousename', 'address']);
-            // 平安表头
-            if (isPingAnOem()) {
-                columns.value = pingan_cwarehousecolumn();
+        const { loading, tableList, queryTable } = queryTableList<ErmcpWareHouseInfo>();
+
+        // 获取列表数据
+        const queryTableAction = () => {
+            switch (routeName) {
+                // 正常
+                case 'warehouse_normal':
+                    queryTable(QueryWareHouse, '1');
+                    break;
+                // 停用
+                case 'warehouse_disabled':
+                    queryTable(QueryWareHouse, '2');
+                    break;
             }
-        });
+        };
 
-        return {
-            columns,
+        // 表格通用逻辑
+        const param: ComposeTableParam = {
+            queryFn: queryTableAction,
+            menuType: EnumRouterName.warehouse_info_normal,
+            tableName: 'table_pcweb_warehouse',
+            tableFilterKey: ['warehousetype', 'warehousename', 'address'],
+            isDetail: true,
+        };
 
-            expandedRowKeys,
-            selectedRow,
-            Rowclick,
-            commonBtn,
-            forDataBtn,
+        return {
+            ...handleComposeTable<ErmcpWareHouseInfo>(param),
             loading,
             tableList,
-            updateColumn,
+            updateColumn: () => {},
             getWareHouseTypeName,
             gerWareHouseStatusName,
             queryTable,
-            btnClick,
             isPingAnOem,
+            pingan_cwarehousecolumn,
+            buttons,
+            addButton,
         };
     },
 });
-</script>
-
-<style lang="less">
-.warehouse-info-normal {
-}
-</style
->;
-
+</script>

+ 4 - 47
src/views/information/warehouse-info/setup.ts

@@ -1,55 +1,12 @@
 import { ResultInfo } from "@/common/methods/request";
-import {getAddress} from "@/services/go/adress";
-
-/**
- * 仓库状态名称 - 1:正常 2:注销 3:待审核 4:审核拒绝
- * @param status
- */
-export function gerWareHouseStatusName(status: number): string {
-    let result = "--";
-    switch (status) {
-        case 1:
-            result = "正常";
-            break
-        case 2:
-            result = "注销";
-            break
-        case 3:
-            result = "待审核";
-            break
-        case 4:
-            result = "审核拒绝";
-            break
-    }
-    return result
-}
-
-/**
- * 仓库类型 - 1 厂库 2 自有库 3 合作库
- * @param type
- */
-export function getWareHouseTypeName(type: number): string {
-    let result = "--";
-    switch (type) {
-        case 1:
-            result = "厂库";
-            break
-        case 2:
-            result = "自有库";
-            break
-        case 3:
-            result = "合作库";
-            break
-    }
-    return result
-}
+import { getAddress } from "@/services/go/adress";
 
 /**
  * 获取地址信息
  */
-export function getAddressInfo(provinceId: number, cityId: number, districId: number): string{
-   const {getProvinceName, getCityName, getDistrictName} = getAddress();
-   return getProvinceName(provinceId) + getCityName(cityId) + getDistrictName(districId);
+export function getAddressInfo(provinceId: number, cityId: number, districId: number): string {
+    const { getProvinceName, getCityName, getDistrictName } = getAddress();
+    return getProvinceName(provinceId) + getCityName(cityId) + getDistrictName(districId);
 }
 
 

+ 81 - 93
src/views/manage/business-review/components/somepriceDetail/index.vue

@@ -1,98 +1,86 @@
 <template>
-  <!-- 点价记录详情-->
-  <a-modal class="add-custom custom-detail"
-           title="点价记录详情"
-           v-model:visible="visible"
-           centered
-           :maskClosable="false"
-           @cancel="cancel"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="cancel">关闭
-      </a-button>
-    </template>
+    <!-- 点价记录详情-->
+    <a-modal class="add-custom custom-detail" title="点价记录详情" v-model:visible="visible" centered :maskClosable="false" @cancel="cancel" width="890px">
+        <template #footer>
+            <a-button key="submit" type="primary" :loading="loading" @click="cancel">关闭 </a-button>
+        </template>
 
-    <a-form class="inlineForm"
-            :form="form"
-            @submit="handleSearch">
-      <fieldset class="formFieldSet">
-        <legend>合同基本信息</legend>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="合同编号">
-              <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="点价类型">
-              <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="销售方">
-              <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="现货品种">
-              <span class="white">{{ formatValue(selectedRow.buyusername) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </fieldset>
-      <fieldset class="formFieldSet">
-        <legend>待审核登记信息</legend>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="点价合约">
-              <span class="white">{{ formatValue(selectedRow.goodsname) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="点价价格">
-              <span class="white">{{ formatValue(selectedRow.pricedPrice) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="升贴水">
-              <span class="white">{{ formatValue(selectedRow.pricemove) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="点价数量">
-              <span class="white">{{ formatValue(selectedRow.pricedQty) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="点价金额">
-              <span class="white">{{ formatValue(selectedRow.amount) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="登记时间">
-              <span class="white">{{ formatValue(selectedRow.applytime) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="登记人">
-              <span class="white">{{ formatValue(selectedRow.applyname) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </fieldset>
-    </a-form>
-  </a-modal>
+        <a-form class="inlineForm">
+            <fieldset class="formFieldSet">
+                <legend>合同基本信息</legend>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="合同编号">
+                            <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="点价类型">
+                            <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="销售方">
+                            <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="现货品种">
+                            <span class="white">{{ formatValue(selectedRow.buyusername) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </fieldset>
+            <fieldset class="formFieldSet">
+                <legend>待审核登记信息</legend>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="点价合约">
+                            <span class="white">{{ formatValue(selectedRow.goodsname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="点价价格">
+                            <span class="white">{{ formatValue(selectedRow.pricedPrice) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="升贴水">
+                            <span class="white">{{ formatValue(selectedRow.pricemove) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="点价数量">
+                            <span class="white">{{ formatValue(selectedRow.pricedQty) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="点价金额">
+                            <span class="white">{{ formatValue(selectedRow.amount) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="登记时间">
+                            <span class="white">{{ formatValue(selectedRow.applytime) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="登记人">
+                            <span class="white">{{ formatValue(selectedRow.applyname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </fieldset>
+        </a-form>
+    </a-modal>
 </template>
 
 <script lang="ts">

+ 73 - 94
src/views/manage/finance-review/components/invoiceDetail/index.vue

@@ -1,98 +1,77 @@
 <template>
-  <!-- 发票登记详情-->
-  <a-modal class="add-custom custom-detail"
-           title="发票登记详情"
-           v-model:visible="visible"
-           centered
-           :maskClosable="false"
-           @cancel="cancel"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">关闭
-      </a-button>
-    </template>
-    <a-form class="inlineForm"
-            :form="form"
-            @submit="handleSearch">
-      <fieldset class="formFieldSet">
-        <legend>合同基本信息</legend>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="合同编号">
-              <span class="white">{{
-                                    getContractTypeName(selectedRow.contracttype) + '/' + formatValue(selectedRow.contractno)
-                                }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="点价类型">
-              <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="销售方">
-              <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="现货品种">
-              <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </fieldset>
-      <fieldset class="formFieldSet">
-        <legend>待审核登记信息</legend>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="类型">
-              <span class="white">{{ invoiceStatusName(selectedRow.contracttype) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="发票金额">
-              <span class="white">{{ formatValue(selectedRow.InvoiceAmount) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="发票附件">
-              <span class="blue"
-                    v-if="selectedRow.attachurl"
-                    @click="previewImg(selectedRow.attachurl)">查看</span>
-              <span class="white"
-                    v-else>--</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="登记时间">
-              <span class="white">{{ formatValue(selectedRow.applytime) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="登记人">
-              <span class="white">{{ formatValue(selectedRow.applyname) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </fieldset>
-    </a-form>
-  </a-modal>
-  <a-modal :visible="previewVisible"
-           :footer="null"
-           @cancel="cancelImg">
-    <img alt="预览附件"
-         style="width: 100%"
-         :src="previewImage" />
-  </a-modal>
+    <!-- 发票登记详情-->
+    <a-modal class="add-custom custom-detail" title="发票登记详情" v-model:visible="visible" centered :maskClosable="false" @cancel="cancel" width="890px">
+        <template #footer>
+            <a-button key="submit" type="primary" :loading="loading" @click="submit">关闭 </a-button>
+        </template>
+        <a-form class="inlineForm">
+            <fieldset class="formFieldSet">
+                <legend>合同基本信息</legend>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="合同编号">
+                            <span class="white">{{ getContractTypeName(selectedRow.contracttype) + '/' + formatValue(selectedRow.contractno) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="点价类型">
+                            <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="销售方">
+                            <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="现货品种">
+                            <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </fieldset>
+            <fieldset class="formFieldSet">
+                <legend>待审核登记信息</legend>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="类型">
+                            <span class="white">{{ invoiceStatusName(selectedRow.contracttype) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="发票金额">
+                            <span class="white">{{ formatValue(selectedRow.InvoiceAmount) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="发票附件">
+                            <span class="blue" v-if="selectedRow.attachurl" @click="previewImg(selectedRow.attachurl)">查看</span>
+                            <span class="white" v-else>--</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="登记时间">
+                            <span class="white">{{ formatValue(selectedRow.applytime) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="登记人">
+                            <span class="white">{{ formatValue(selectedRow.applyname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </fieldset>
+        </a-form>
+    </a-modal>
+    <a-modal :visible="previewVisible" :footer="null" @cancel="cancelImg">
+        <img alt="预览附件" style="width: 100%" :src="previewImage" />
+    </a-modal>
 </template>
 
 <script lang="ts">

+ 120 - 138
src/views/manage/inventory-review/components/checkinDetail/index.vue

@@ -1,142 +1,124 @@
 <template>
-  <!-- 入库详情-->
-  <a-modal class="add-custom custom-detail"
-           title="入库详情"
-           v-model:visible="visible"
-           centered
-           :maskClosable="false"
-           @cancel="cancel"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="cancel">关闭
-      </a-button>
-    </template>
-    <a-form class="inlineForm"
-            :form="form"
-            @submit="handleSearch">
-      <fieldset class="formFieldSet"
-                v-if="isShowContractInfo(selectedRow.inouttype)">
-        <legend>合同基本信息</legend>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="合同编号">
-              <span class="white">{{
-                                    getContractTypeName(selectedRow.contracttype) + '/' + formatValue(selectedRow.contractno)
-                                }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="定价类型">
-              <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="销售方">
-              <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="现货品种">
-              <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="采购方">
-              <span class="white">{{ formatValue(selectedRow.buyusername) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="合同签署量">
-              <span
-                    class="white">{{ formatValue(selectedRow.contractqty) + " " +  selectedRow.enumdicname}}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </fieldset>
-      <fieldset class="formFieldSet">
-        <legend>登记信息</legend>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="出库类型">
-              <span class="white">{{ InOutTypeName(selectedRow.inouttype) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="品类">
-              <span class="white">{{ formatValue(selectedRow.wrstandardname) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="品牌">
-              <span class="white">{{ formatValue(selectedRow.brandname) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="入库仓库">
-              <span class="white">{{ formatValue(selectedRow.warehousecode) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="入库数量">
-              <span class="white">{{
-                                    formatValue(selectedRow.qty) + getGoodsUnitEnumItemName(selectedRow.unitid)
-                                }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="登记时间">
-              <span class="white">{{ formatValue(selectedRow.applytime) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="登记人">
-              <span class="white">{{ formatValue(selectedRow.applyname) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="状态">
-              <span class="white">{{ getApplyStatusName(selectedRow.applystatus) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </fieldset>
-      <fieldset class="formFieldSet">
-        <legend>审核信息</legend>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="审核时间">
-              <span class="white">{{ formatValue(selectedRow.audittime) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="审核人">
-              <span class="white">{{ formatValue(selectedRow.auditname) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="审核意见">
-              <span class="white">{{ formatValue(selectedRow.auditremark) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </fieldset>
-    </a-form>
-  </a-modal>
+    <!-- 入库详情-->
+    <a-modal class="add-custom custom-detail" title="入库详情" v-model:visible="visible" centered :maskClosable="false" @cancel="cancel" width="890px">
+        <template #footer>
+            <a-button key="submit" type="primary" :loading="loading" @click="cancel">关闭 </a-button>
+        </template>
+        <a-form class="inlineForm">
+            <fieldset class="formFieldSet" v-if="isShowContractInfo(selectedRow.inouttype)">
+                <legend>合同基本信息</legend>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="合同编号">
+                            <span class="white">{{ getContractTypeName(selectedRow.contracttype) + '/' + formatValue(selectedRow.contractno) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="定价类型">
+                            <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="销售方">
+                            <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="现货品种">
+                            <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="采购方">
+                            <span class="white">{{ formatValue(selectedRow.buyusername) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="合同签署量">
+                            <span class="white">{{ formatValue(selectedRow.contractqty) + ' ' + selectedRow.enumdicname }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </fieldset>
+            <fieldset class="formFieldSet">
+                <legend>登记信息</legend>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="出库类型">
+                            <span class="white">{{ InOutTypeName(selectedRow.inouttype) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="品类">
+                            <span class="white">{{ formatValue(selectedRow.wrstandardname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="品牌">
+                            <span class="white">{{ formatValue(selectedRow.brandname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="入库仓库">
+                            <span class="white">{{ formatValue(selectedRow.warehousecode) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="入库数量">
+                            <span class="white">{{ formatValue(selectedRow.qty) + getGoodsUnitEnumItemName(selectedRow.unitid) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="登记时间">
+                            <span class="white">{{ formatValue(selectedRow.applytime) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="登记人">
+                            <span class="white">{{ formatValue(selectedRow.applyname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="状态">
+                            <span class="white">{{ getApplyStatusName(selectedRow.applystatus) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </fieldset>
+            <fieldset class="formFieldSet">
+                <legend>审核信息</legend>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="审核时间">
+                            <span class="white">{{ formatValue(selectedRow.audittime) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="审核人">
+                            <span class="white">{{ formatValue(selectedRow.auditname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="审核意见">
+                            <span class="white">{{ formatValue(selectedRow.auditremark) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </fieldset>
+        </a-form>
+    </a-modal>
 </template>
 
 <script lang="ts">

+ 135 - 0
src/views/manage/inventory-review/list/audit/index.vue

@@ -0,0 +1,135 @@
+<template>
+    <!-- 库存审核 入库-->
+    <div class="inventory_review_checkin" :loading="loading">
+        <Filter @search="updateColumn" :inOrOut="'in'"></Filter>
+        <a-table :columns="columns" class="srcollYTable" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }" :pagination="false" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" rowKey="key" :data-source="tableList">
+            <!-- 额外的展开行 -->
+            <template #expandedRowRender="{ record }">
+                <mtp-table-button class="btn-list-sticky" :buttons="handlePermissionBtn(buttons, 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(buttons, selectedRow)"> </contextMenu>
+        <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
+    </div>
+</template>
+
+<script lang="ts">
+import { MtpTableButton, contextMenu, defineAsyncComponent, defineComponent, handleComposeTable, ComposeTableParam, queryTableList } from '@/common/export/commonTable';
+import { Filter } from '../../components';
+import { QueryAreaStockApply } from '@/services/go/ermcp/inventory-review';
+import { Ermcp3AreaStockApply, handleName } from '../setup';
+import { getContractTypeName, getPriceTypeName, getApplyStatusName } from '@/common/constants/enumsName';
+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 { BtnListType } from '@/common/components/btnList/interface';
+import { getTableButton } from '@/common/setup/table/button';
+import { useRoute } from 'vue-router';
+
+export default defineComponent({
+    name: 'inventory_review_checkin',
+    components: {
+        contextMenu,
+        Filter,
+        MtpTableButton,
+        detail: defineAsyncComponent(() => import('../../components/checkinDetail/index.vue')),
+        check: defineAsyncComponent(() => import('../../components/checkinAudit/index.vue')),
+        cancel: defineAsyncComponent(() => import('../../components/checkinCancel/index.vue')),
+    },
+    setup() {
+        const { name: routeName } = useRoute();
+        // 表格权限按钮
+        const buttons = getTableButton();
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3AreaStockApply>();
+
+        // 获取列表数据
+        const queryTableAction = () => {
+            switch (routeName) {
+                // 待审核
+                case 'stock_checkpending':
+                    queryTable(QueryAreaStockApply, { applystatus: '1' });
+                    break;
+                // 已审核
+                case 'stock_performance':
+                    queryTable(QueryAreaStockApply, { applystatus: '2,5' });
+                    break;
+            }
+        };
+
+        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 {
+                        return buyusername.includes(value);
+                    }
+                };
+                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 {
+            ...handleComposeTable<Ermcp3AreaStockApply>(param),
+            handlePermissionBtn,
+            loading,
+            tableList,
+            getApplyStatusName,
+            getContractTypeName,
+            operateApplyTypeName,
+            getPriceTypeName,
+            InOutTypeName,
+            handleName,
+            buttons,
+        };
+    },
+});
+</script>

+ 9 - 18
src/views/search/inventory/components/add/index.vue

@@ -1,8 +1,8 @@
 <template>
     <!-- 出入库登记-->
-    <a-modal class="commonModal add-spot-contract" :title="`出入库登记(生产${inOrOut()})`" v-model:visible="visible" centered :maskClosable="false" @cancel="closeAction" width="890px">
+    <a-modal class="commonModal add-spot-contract" :title="`出入库登记(生产${inOrOut()})`" v-model:visible="visible" centered :maskClosable="false" @cancel="cancel" width="890px">
         <template #footer>
-            <a-button key="submit" class="cancelBtn" @click="closeAction">取消</a-button>
+            <a-button key="submit" class="cancelBtn" @click="cancel">取消</a-button>
             <a-button key="submit" type="primary" :loading="loading" @click="submit(2)">{{ inOrOut() }}登记</a-button>
         </template>
         <a-form class="inlineForm" ref="formRef" :model="formState" :rules="rules">
@@ -64,7 +64,7 @@
 
 <script lang="ts">
 import { defineComponent, PropType, ref, toRaw, watchEffect } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
+import { _closeModal } from '@/common/setup/modal/modal';
 import { initData } from '@/common/methods';
 import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
 import { handleDeliveryGoods, handleFormState, handleWarehouseList, handleWarehouseType } from './setup';
@@ -76,7 +76,7 @@ import { ERMCPAreaInOutStockApplyReq } from '@/services/proto/warehouse/interfac
 
 export default defineComponent({
     name: 'add-spot-contract',
-    emits: ['refresh'],
+    emits: ['cancel', 'update'],
     components: {},
     props: {
         selectedRow: {
@@ -85,7 +85,7 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('inventory_current_add');
+        const { visible, cancel } = _closeModal(context);
         const { rules, formState, formRef, initFormData } = handleFormState();
         const { warehouseType, inOrOut } = handleWarehouseType(formState);
         const { wareHouseList, getWarehouseList } = handleWarehouseList();
@@ -105,22 +105,18 @@ export default defineComponent({
                     ApplyRemark: '', // string 申请备注
                 };
                 requestResultLoadingAndInfo(ermcpInOutStockApplyReq, reqParam, loading, ['出入库登记成功', '出入库登记失败:']).then(() => {
-                    closeAction();
-                    context.emit('refresh');
+                    Object.assign(formState, initFormData());
+                    cancel(true);
                 });
             });
         }
-        function closeAction() {
-            Object.assign(formState, initFormData());
-            cancel();
-        }
         initData(() => {
             getWarehouseList();
             getDeliveryGoods();
         });
         return {
             visible,
-            closeAction,
+            cancel,
             submit,
             loading,
             maskClosableFlag: false,
@@ -140,9 +136,4 @@ export default defineComponent({
         };
     },
 });
-</script>
-
-<style lang="less">
-.add-spot-contract {
-}
-</style>;
+</script>

+ 53 - 59
src/views/search/inventory/list/inventory_current/index.vue

@@ -1,27 +1,26 @@
 <template>
     <!-- 库存查询: 当前库存-->
     <div class="inventory_current" :loading="loading">
-        <Filter @search="updateColumn"> </Filter>
-        <a-table :columns="columns" class="topTable" :pagination="false" rowKey="key" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :data-source="tableList"> </a-table>
+        <Filter @search="updateColumn">
+            <mtp-table-button class="btn-list-sticky" :buttons="buttons" @click="openComponent" />
+        </Filter>
+        <a-table :columns="columns" class="topTable" :pagination="false" rowKey="key" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :data-source="tableList"></a-table>
         <!-- 明细 -->
         <Description v-if="visible" @close="closeDrawer" @changeTab="changeTab" :tabList="tabList">
-            <a-table :columns="columnsDetail" class="topTable" :pagination="false" rowKey="key" :data-source="detailTableList" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }">
-                <!-- 类型 -->
-                <!-- <template #logtype="{ record }">
-          <span>{{ getLogType(record.logtype) }}</span>
-        </template> -->
-            </a-table>
+            <a-table :columns="columnsDetail" class="topTable" :pagination="false" rowKey="key" :data-source="detailTableList" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }"></a-table>
         </Description>
+        <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
     </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList, _getBtnList } from '@/common/export/table';
+import { ref } from 'vue';
+import { queryTableList, MtpTableButton, contextMenu, defineAsyncComponent, defineComponent } from '@/common/export/commonTable';
 import Filter from '../../components/filterTable/index.vue';
-import Add from '../../components/add/index.vue';
-
-import { getBizTypeName, getContractStatusName, getContractTypeName, getPriceTypeName } from '@/common/constants/enumsName';
-import { Ermcp3AreaStock, queryTableList } from './setup';
+import { QueryAreaStockApply } from '@/services/go/ermcp/search-inventory/index';
+import { Ermcp3AreaStock } from '@/services/go/ermcp/search-inventory/interface';
+import { QueryAreaStock } from '@/services/go/ermcp/search-inventory';
+import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import Description from '@/common/components/description/index.vue';
 import { ComposeTableDetailParam } from '@/common/setup/table/interface';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
@@ -29,27 +28,33 @@ import { handleComposeTable_detail } from '@/common/setup/table/compose';
 import { TabList } from '@/common/components/description/interface';
 import { watchEffect } from 'vue';
 import { getTableButton } from '@/common/setup/table/button';
+import { getDetailColumns } from './setup';
+import { ColumnType } from '@/common/methods/table';
 
 export default defineComponent({
     name: 'inventory_current',
     components: {
         Filter,
         contextMenu,
-        Add,
-        BtnList,
+        add: defineAsyncComponent(() => import('../../components/add/index.vue')),
+        MtpTableButton,
+        Description,
     },
     setup() {
-        // // 表头数据
-        // const { columns, registerColumn, updateColumn } = getTableColumns();
-        // // 表格事件
-        // const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3AreaStock>({});
-        // // 表格操作按钮列表
-        // const [firstBtn, secondBtn] = _getBtnList('inventory_current', false).value;
+        // 按钮权限
+        const buttons = getTableButton(['add']);
+        // 底部明细标签
+        const tabList = getTableButton(['add'], true);
+        const columnsDetail = ref<ColumnType[]>([]);
 
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList();
+
+        // 获取列表数据
+        const queryTableAction = () => queryTable(QueryAreaStock);
+
         const param: ComposeTableDetailParam = {
-            queryFn: queryTable, // 查询表格数据
+            queryFn: queryTableAction, // 查询表格数据
             tableName: 'table_pcweb_current_inventory', // 表头key
             tableFilterKey: ['deliverygoodsid', 'wrstandardid', 'spotgoodsbrandid', 'warehouseinfoid'], // 表格过滤字段
             menuType: EnumRouterName.exposure_realtime, // 当前tab页对应的code
@@ -60,43 +65,37 @@ export default defineComponent({
             closeDrawer, // 控制 drawer 组件是否显示
             columns,
             updateColumn, //  表头数据
-            columnsDetail,
-            registerColumnDetail,
             detailTableList, // 明细表头数据
             expandedRowKeys,
             selectedRow,
             Rowclick, // 表格事件
+            componentId,
+            closeComponent,
+            openComponent,
         } = handleComposeTable_detail<Ermcp3AreaStock>(param);
 
-        // 底部明细标签
-        const tabList = getTableButton();
-
         // 切换明细
         function changeTab(index: number, current: TabList) {
             const { code, lable } = current;
-            let fn = null;
-            // if (code === 'exposure_realtime_spot_details') {
-            //     // 现货明细信息
-            //     // 注册表头
-            //     registerColumnDetail('table_pcweb_exposure_detail', []);
-            //     fn = QueryActualExposureDetail;
-
-            //     queryResultLoadingAndInfo(fn, loading, { middlegoodsid: selectedRow.value?.MiddleGoodsID }).then((res) => {
-            //         detailTableList.value = res;
-            //     });
-            // } else if (code === 'exposure_realtime_futures_details') {
-            //     // 期货明细
-            //     // 注册表头
-            //     registerColumnDetail('table_pcweb_exposure_futures_detail', []);
-            //     fn = QueryAutualExposurePosition;
-            //     queryResultLoadingAndInfo(fn, loading, { middleGoodsId: selectedRow.value?.MiddleGoodsID }).then((res) => {
-            //         detailTableList.value = res;
-            //     });
-            // } else {
-            //     console.error(`${lable}没有配置对应的code: ${code},`);
-            //     return;
-            // }
+            columnsDetail.value = getDetailColumns(code);
+            switch (code) {
+                case 'inventory_manager_inbound_details':
+                    // 入库明细
+                    queryResultLoadingAndInfo(QueryAreaStockApply, loading, { applystatus: '2', inouttype: '5,7' }).then((res) => {
+                        detailTableList.value = res;
+                    });
+                    break;
+                case 'inventory_manager_outbound_details':
+                    // 出库明细
+                    queryResultLoadingAndInfo(QueryAreaStockApply, loading, { applystatus: '2', inouttype: '6,8' }).then((res) => {
+                        detailTableList.value = res;
+                    });
+                    break;
+                default:
+                    console.error(`${lable}没有配置对应的code: ${code},`);
+            }
         }
+
         watchEffect(() => {
             if (visible.value) {
                 if (tabList.length) {
@@ -104,12 +103,7 @@ export default defineComponent({
                 }
             }
         });
-        // initData(() => {
-        //     // 获取列表数据
-        //     queryTable();
-        //     // 注册表头信息 过滤
-        //     registerColumn('table_pcweb_current_inventory', ['deliverygoodsid', 'wrstandardid', 'spotgoodsbrandid', 'warehouseinfoid']);
-        // });
+
         return {
             loading,
             tableList,
@@ -125,10 +119,10 @@ export default defineComponent({
             tabList,
             changeTab,
             queryTable,
-            getBizTypeName,
-            getPriceTypeName,
-            getContractStatusName,
-            getContractTypeName,
+            buttons,
+            componentId,
+            closeComponent,
+            openComponent,
         };
     },
 });

+ 95 - 26
src/views/search/inventory/list/inventory_current/setup.ts

@@ -1,31 +1,100 @@
-import { QueryAreaStock } from "@/services/go/ermcp/search-inventory";
-import { Ermcp3AreaStock } from "@/services/go/ermcp/search-inventory/interface";
-import { message } from "ant-design-vue";
-import { ref } from "vue";
+import { ColumnType } from '@/common/methods/table';
+import { getWareHouseTypeName } from '@/common/constants/enumsName';
 
 /**
- * 获取表格列表数据
- * @param type 
- * @returns 
+ * 明细表头
  */
-export function queryTableList() {
-    // 加载状态
-    const loading = ref<boolean>(false);
-    // 表格数据
-    const tableList = ref<Ermcp3AreaStock[]>([]);
-    function queryTable() {
-        QueryAreaStock()
-            .then((res) => {
-                tableList.value = res.map((e, i) => {
-                    return { ...e, key: String(i) };
-                });
-                console.log('查询列表', tableList);
-            })
-            .catch((err) => {
-                message.error(err);
-            }).finally(() => loading.value = false)
+export function getDetailColumns(code: string): ColumnType[] {
+    let type;
+    switch (code) {
+        case 'inventory_manager_inbound_details':
+            type = '入库';
+            break;
+        case 'inventory_manager_outbound_details':
+            type = '出库';
+            break;
     }
-    return { loading, tableList, queryTable }
-}
-export type { Ermcp3AreaStock };
 
+    return [
+        {
+            title: '现货品种',
+            dataIndex: 'deliverygoodsname',
+            key: 'deliverygoodsname',
+            align: 'center',
+            width: 120,
+        },
+        {
+            title: '商品',
+            dataIndex: 'wrstandardname',
+            key: 'wrstandardname',
+            align: 'center',
+            width: 120,
+        },
+        {
+            title: '品牌',
+            dataIndex: 'brandname',
+            key: 'brandname',
+            align: 'center',
+            width: 120,
+        },
+        {
+            title: '仓库',
+            dataIndex: 'warehousename',
+            key: 'warehousename',
+            align: 'center',
+            width: 120,
+        },
+        {
+            title: type + '类型',
+            dataIndex: 'warehousetype',
+            key: 'warehousetype',
+            align: 'center',
+            width: 120,
+            customRender: ({ text }: { text: number }) => {
+                return getWareHouseTypeName(text);
+            }
+        },
+        {
+            title: type + '数量',
+            dataIndex: 'qty',
+            key: 'qty',
+            align: 'center',
+            width: 120,
+        },
+        {
+            title: '合同编号',
+            dataIndex: 'contractno',
+            key: 'contractno',
+            align: 'center',
+            width: 120,
+        },
+        {
+            title: type + '登记时间',
+            dataIndex: 'applytime',
+            key: 'applytime',
+            align: 'center',
+            width: 120,
+        },
+        {
+            title: type + '登记人',
+            dataIndex: 'applyname',
+            key: 'applyname',
+            align: 'center',
+            width: 120,
+        },
+        {
+            title: type + '审核时间',
+            dataIndex: 'audittime',
+            key: 'audittime',
+            align: 'center',
+            width: 120,
+        },
+        {
+            title: type + '审核人',
+            dataIndex: 'auditname',
+            key: 'auditname',
+            align: 'center',
+            width: 120,
+        },
+    ];
+}