ソースを参照

Merge remote-tracking branch 'origin/master'

yu jie 4 年 前
コミット
a958908efe

+ 7 - 18
src/views/manage/finance-review/components/fundsAudit/index.vue

@@ -13,14 +13,12 @@
                 :loading="loading"
                 @click="cancel">关闭
       </a-button>
-      <a-button key="submit"
-                type="primary"
+      <a-button type="primary"
                 v-if="isShowContractCheck(selectedRow.applystatus)"
                 :loading="loading"
                 @click="pass">审核通过
       </a-button>
-      <a-button key="submit"
-                type="primary"
+      <a-button type="primary"
                 v-if="isShowContractCheck(selectedRow.applystatus)"
                 :loading="loading"
                 @click="refuse">审核拒绝
@@ -103,10 +101,11 @@ import { financeControl } from '@/views/manage/finance-review/components/setup';
 import { stateName } from '@/views/manage/finance-review/setup';
 import { getContractTypeName, getPriceTypeName } from '@/common/constants/enumsName';
 import { isShowContractCheck } from '@/views/manage/inventory-review/setup';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'finance_review_funds_audit',
-    components: {},
+    emits: ['cancel', 'update'],
     props: {
         selectedRow: {
             type: Object as PropType<QryBussinessKxRsp>,
@@ -114,16 +113,9 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('finance_review_funds_audit');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
-        function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 200);
-        }
         // 审核通过
         function pass() {
             Modal.confirm({
@@ -137,8 +129,7 @@ export default defineComponent({
                     };
                     financeControl(param, loading)
                         .then((res) => {
-                            context.emit('refresh');
-                            cancel();
+                            cancel(true);
                         })
                         .catch((err) => {});
                 },
@@ -158,8 +149,7 @@ export default defineComponent({
                     };
                     financeControl(param, loading)
                         .then((res) => {
-                            context.emit('refresh');
-                            cancel();
+                            cancel(true);
                         })
                         .catch((err) => {});
                 },
@@ -171,7 +161,6 @@ export default defineComponent({
             refuse,
             visible,
             cancel,
-            submit,
             loading,
             formatValue,
             getStatusName,

+ 7 - 17
src/views/manage/finance-review/components/fundsCancel/index.vue

@@ -8,14 +8,12 @@
            @cancel="cancel"
            width="890px">
     <template #footer>
-      <a-button key="submit"
-                type="primary"
+      <a-button type="primary"
                 :loading="loading"
-                @click="submit">关闭
+                @click="cancel">关闭
       </a-button>
 
-      <a-button key="submit"
-                type="primary"
+      <a-button type="primary"
                 :loading="loading"
                 @click="back">撤销
       </a-button>
@@ -97,10 +95,11 @@ import { QryBussinessKxRsp } from '@/services/go/ermcp/finance-review/interface'
 import { stateName } from '@/views/manage/finance-review/setup';
 import { getPriceTypeName } from '@/common/constants/enumsName';
 import { getContractTypeName } from '@/common/constants/enumsName';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'finance_review_funds_cancel',
-    components: {},
+    emits: ['cancel', 'update'],
     props: {
         selectedRow: {
             type: Object as PropType<QryBussinessKxRsp>,
@@ -108,16 +107,9 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('finance_review_funds_cancel');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
-        function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 200);
-        }
         function back() {
             Modal.confirm({
                 title: '是否确认撤销',
@@ -130,8 +122,7 @@ export default defineComponent({
                     };
                     financeControl(param, loading)
                         .then((res) => {
-                            context.emit('refresh');
-                            cancel();
+                            cancel(true);
                         })
                         .catch((err) => {});
                 },
@@ -141,7 +132,6 @@ export default defineComponent({
         return {
             visible,
             cancel,
-            submit,
             loading,
             formatValue,
             getStatusName,

+ 4 - 4
src/views/manage/finance-review/components/fundsDetail/index.vue

@@ -84,10 +84,11 @@ import { formatValue, formatTime } from '@/common/methods';
 import { QryBussinessKxRsp } from '@/services/go/ermcp/finance-review/interface';
 import { stateName } from '@/views/manage/finance-review/setup';
 import { getContractTypeName, getPriceTypeName } from '@/common/constants/enumsName';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'finance_review_funds_detail',
-    components: {},
+    emits: ['cancel', 'update'],
     props: {
         selectedRow: {
             type: Object as PropType<QryBussinessKxRsp>,
@@ -95,13 +96,12 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('detail');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
         function submit() {
             loading.value = true;
-            context.emit('refresh');
-            cancel();
+            cancel(true);
         }
         return {
             visible,

+ 97 - 101
src/views/manage/finance-review/list/funds/index.vue

@@ -3,65 +3,65 @@
   <div class="business-review-js"
        :loading="loading">
     <Filter @search="updateColumn">
-      <BtnList :btnList="commonBtn" />
     </Filter>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{ record }">
-          <BtnList :btnList="record.btnList" />
-        </template>
-        <!-- 现货合同类型 -->
-        <template #contractstatus="{ record }">
-          <a>{{ getApplyStatusName(record.applystatus) }}</a>
-        </template>
-        <!-- 合同类型-->
-        <template #contracttype="{ record }">
-          <a>{{ getContractTypeName(record.contracttype) }}</a>
-        </template>
-        <!-- 状态 -->
-        <template #applystatus="{ text }">
-          <a>{{ getApplyStatusName(text) }}</a>
-        </template>
-        <!-- 点价类型 -->
-        <template #operateapplytype="{ text }">
-          <a>{{ operateApplyTypeName(text) }}</a>
-        </template>
-        <!-- 款项类型 -->
-        <template #kxtype="{ record }">
-          <a>{{ stateName(record.deductamount, record.contracttype) }}</a>
-        </template>
-        <!-- 对手方 -->
-        <template #buyusernameOrsellusername="{ record }">
-          <a>{{ record.contracttype === 1 ? record.sellusername : record.buyusername }}</a>
-        </template>
-        <!-- 金额 如果是退款 则使用deductamount  如果是付款则使用payamount-->
-        <template #payamount="{ record }">
-          <a>{{ (record.deductamount === undefined || record.deductamount === 0) ? record.payamount: record.deductamount }}</a>
-        </template>
+    <a-table :columns="columns"
+             class="topTable"
+             :pagination="false"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="key"
+             :data-source="tableList">
+      <!-- 额外的展开行 -->
+      <template #expandedRowRender="{ record }">
+        <BtnList :btnList="handlePermissionBtn(firstBtn, record)"
+                 :record="record"
+                 @click="openComponent" />
+      </template>
+      <!-- 现货合同类型 -->
+      <template #contractstatus="{ record }">
+        <a>{{ getApplyStatusName(record.applystatus) }}</a>
+      </template>
+      <!-- 合同类型-->
+      <template #contracttype="{ record }">
+        <a>{{ getContractTypeName(record.contracttype) }}</a>
+      </template>
+      <!-- 状态 -->
+      <template #applystatus="{ text }">
+        <a>{{ getApplyStatusName(text) }}</a>
+      </template>
+      <!-- 点价类型 -->
+      <template #operateapplytype="{ text }">
+        <a>{{ operateApplyTypeName(text) }}</a>
+      </template>
+      <!-- 款项类型 -->
+      <template #kxtype="{ record }">
+        <a>{{ stateName(record.deductamount, record.contracttype) }}</a>
+      </template>
+      <!-- 对手方 -->
+      <template #buyusernameOrsellusername="{ record }">
+        <a>{{ record.contracttype === 1 ? record.sellusername : record.buyusername }}</a>
+      </template>
+      <!-- 金额 如果是退款 则使用deductamount  如果是付款则使用payamount-->
+      <template #payamount="{ record }">
+        <a>{{ (record.deductamount === undefined || record.deductamount === 0) ? record.payamount: record.deductamount }}</a>
+      </template>
 
-      </a-table>
+    </a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="handlePermissionBtn(firstBtn, selectedRow)">
     </contextMenu>
-    <!-- 点价记录详情 -->
-    <FundsDetail :selectedRow="selectedRow"
-                 @refresh="getTableData" />
-    <!-- 交收审核 -->
-    <FundsAudit :selectedRow="selectedRow"
-                @refresh="getTableData" />
-    <!-- 撤销点价登记 -->
-    <FundsCancel :selectedRow="selectedRow"
-                 @refresh="getTableData" />
+    <component :is="componentId"
+               v-if="componentId"
+               :selectedRow="selectedRow"
+               @cancel="closeComponent"></component>
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import { BtnList, contextMenu, defineAsyncComponent, defineComponent, ModalEnum, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
+import { initData, getTableColumns, getTableEvent, getBtnList } from '@/common/export/table';
 
 import { Filter, FundsAudit, FundsCancel, FundsDetail } from '../../components';
 
@@ -69,6 +69,12 @@ import { queryTableList, QryBussinessKxRsp } from './setup';
 import { invoiceStatusName, operateApplyTypeName, stateName } from '@/views/manage/finance-review/setup';
 import { getContractTypeName, getApplyStatusName } from '@/common/constants/enumsName';
 import { Column, ColumnType } from '@/common/setup/table';
+import { EnumRouterName } from '@/common/constants/enumRouterName';
+import { BtnList as BtnListType } from '@/common/components/btnList/interface';
+
+const Detail = defineAsyncComponent(() => import('../../components/fundsDetail/index.vue'));
+const Audit = defineAsyncComponent(() => import('../../components/fundsAudit/index.vue'));
+const Cancel = defineAsyncComponent(() => import('../../components/fundsCancel/index.vue'));
 
 export default defineComponent({
     name: 'business-review-js',
@@ -76,71 +82,61 @@ export default defineComponent({
         contextMenu,
         Filter,
         BtnList,
-        FundsDetail,
-        FundsAudit,
-        FundsCancel,
+        [ModalEnum.detail]: Detail,
+        [ModalEnum.business_review_settlement_audit]: Audit,
+        [ModalEnum.business_review_settlement_cancel]: Cancel,
     },
     setup() {
-        // 表头数据
-        const { columns, registerColumn, updateColumn } = getTableColumns();
-        // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<QryBussinessKxRsp>({});
-        // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('finance_review_funds', true);
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList({});
-
-        function getTableData() {
-            // 获取列表数据
-            queryTable().then(() => {
-                tableList.value.forEach((el) => {
-                    if (el.applystatus === 1) {
-                        // 1:待审核
-                        Object.assign(el, { btnList: forDataBtn.value });
+        // 获取列表数据
+        const queryTableAction = () => queryTable();
+        const filtrFn = (e: Column, item: ColumnType, filtered: any) => {
+            if (e.columnfield === 'buyusernameOrsellusername') {
+                item.onFilter = (value: string, record: QryBussinessKxRsp) => {
+                    const { contracttype, buyusername, sellusername } = record;
+                    if (contracttype === 1) {
+                        // 采购
+                        return sellusername.includes(value);
                     } else {
-                        const item = forDataBtn.value.find((e) => e.lable === '详情');
-                        item && Object.assign(el, { btnList: [item] });
+                        return buyusername.includes(value);
                     }
-                });
-            });
+                };
+                item.filteredValue = filtered.buyusernameOrsellusername || null;
+            }
+        };
+        // 表格通用逻辑
+        const param: ComposeTableParam = {
+            queryFn: queryTableAction,
+            menuType: EnumRouterName.finance_review_funds,
+            tableName: 'table_pcweb_fincial_aduit_kx',
+            tableFilterKey: ['contracttype', 'contractno', 'deliverygoodsname'],
+            tableFilterCB: filtrFn,
+            isDetail: true,
+        };
+        function handlePermissionBtn(btnList: BtnListType[], item: QryBussinessKxRsp) {
+            if (item) {
+                const { applystatus } = item;
+                if (applystatus === 1) {
+                    return btnList;
+                } else {
+                    return btnList.filter((e) => e.code === 'detail');
+                }
+            } else {
+                return [];
+            }
         }
 
-        initData(() => {
-            // 获取列表数据
-            getTableData();
-            // 注册表头信息 过滤
-            registerColumn('table_pcweb_fincial_aduit_kx', ['contracttype', 'contractno', 'deliverygoodsname'], (e: Column, item: ColumnType, filtered: any) => {
-                if (e.columnfield === 'buyusernameOrsellusername') {
-                    item.onFilter = (value: string, record: QryBussinessKxRsp) => {
-                        const { contracttype, buyusername, sellusername } = record;
-                        if (contracttype === 1) {
-                            // 采购
-                            return sellusername.includes(value);
-                        } else {
-                            return buyusername.includes(value);
-                        }
-                    };
-                    item.filteredValue = filtered.buyusernameOrsellusername || null;
-                }
-            });
-        });
         return {
-            columns,
-
-            expandedRowKeys,
-            selectedRow,
-            Rowclick,
-            commonBtn,
-            forDataBtn,
+            ...handleComposeTable<QryBussinessKxRsp>(param),
             loading,
             tableList,
-            updateColumn,
             invoiceStatusName,
             getApplyStatusName,
             operateApplyTypeName,
             getContractTypeName,
             stateName,
-            getTableData,
+            handlePermissionBtn,
         };
     },
 });

+ 0 - 1
src/views/manage/finance-review/list/invoice/index.vue

@@ -12,7 +12,6 @@
              rowKey="key"
              :data-source="tableList">
       <!-- 额外的展开行 -->
-      <!-- 额外的展开行 -->
       <template #expandedRowRender="{ record }">
         <BtnList :btnList="handlePermissionBtn(firstBtn, record)"
                  :record="record"

+ 2 - 2
src/views/market/spot_trade/components/buy-sell-market/components/buy/index.vue

@@ -44,7 +44,7 @@ import { expandIcon } from '@/common/setup/table/clolumn';
 import { ColumnType } from '@/common/methods/table/interface';
 import { Moment } from 'moment';
 import moment from 'moment';
-import { getHasBottom } from '@/common/setup/order/orderData';
+import { getShowBottomValue } from '@/common/config/constrolBottom';
 
 export default defineComponent({
     emits: ['cancel', 'openComponent'],
@@ -72,7 +72,7 @@ export default defineComponent({
         [ModalEnum.spot_trade_warehouse_delisting]: defineAsyncComponent(() => import('../delisting/index.vue')),
     },
     setup(props, context) {
-        const isBottom = getHasBottom();
+        const isBottom = getShowBottomValue();
         console.log(isBottom.value, 'isBottom');
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<WrOrderQuoteDetail>();

+ 2 - 2
src/views/market/spot_trade/components/buy-sell-market/components/sell/index.vue

@@ -43,7 +43,7 @@ import { expandIcon } from '@/common/setup/table/clolumn';
 import { ColumnType } from '@/common/methods/table/interface';
 import { Moment } from 'moment';
 import moment from 'moment';
-import { getHasBottom } from '@/common/setup/order/orderData';
+import { getShowBottomValue } from '@/common/config/constrolBottom';
 
 export default defineComponent({
     emits: ['cancel', 'openComponent'],
@@ -72,7 +72,7 @@ export default defineComponent({
         [ModalEnum.spot_trade_warehouse_financing_delisting]: defineAsyncComponent(() => import('../financing_delisting/index.vue')),
     },
     setup(props, context) {
-        const isBottom = getHasBottom();
+        const isBottom = getShowBottomValue();
         console.log(isBottom.value, 'isBottom');
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<WrOrderQuoteDetail>();