Ver Fonte

修改千海金 充值审核

huangbin há 4 anos atrás
pai
commit
f665d2b1aa

+ 75 - 69
src/views/platinum/platinum_recharge_withdrawal_review/list/recharge/index.vue

@@ -2,40 +2,46 @@
   <!-- 充值审核 -->
   <div class="platinum_recharge_review_tab">
     <Filter @search="search" />
-    <contextMenu :contextMenuList="getBtnListAction()">
-      <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 :btnList="getBtnListAction()"
-                   class="btn-list-sticky"
-                   @onClick="btnClick(record)" />
+    <a-table :columns="columns"
+             class="srcollYTable"
+             :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }"
+             :loading="loading"
+             :pagination="false"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="key"
+             :data-source="tableList">
+      <!-- 额外的展开行 -->
+      <template #expandedRowRender="{ record }">
+        <mtp-table-button class="btn-list-sticky"
+                          :buttons="handleBtn(record)"
+                          :record="record"
+                          @click="openComponent" />
+      </template>
+      <!-- 账户类型 -->
+      <template #userinfotype="{ record }">
+        <a>{{ record.userinfotype === 1 ? "个人" : "企业" }}</a>
+      </template>
+      <template #applystatus="{ }">
+        <a>{{ getTableListStatus() }}</a>
+      </template>
+      <template #certificatephotourl="{ record}">
+        <template v-if="record.certificatephotourl">
+          <a v-for="(item, index) in getUrl(record.certificatephotourl)"
+             :key="item"
+             @click.stop="getVisibleImg(record.certificatephotourl, index)">{{item}}</a>
         </template>
-        <!-- 账户类型 -->
-        <template #userinfotype="{ record }">
-          <a>{{ record.userinfotype === 1 ? "个人" : "企业" }}</a>
-        </template>
-        <template #applystatus="{ }">
-          <a>{{ getTableListStatus() }}</a>
-        </template>
-        <template #certificatephotourl="{ record}">
-          <template v-if="record.certificatephotourl">
-            <a v-for="(item, index) in getUrl(record.certificatephotourl)"
-               :key="item"
-               @click.stop="getVisibleImg(record.certificatephotourl, index)">{{item}}</a>
-          </template>
-          <span v-else></span>
-        </template>
-      </a-table>
-    </contextMenu>
-    <ControlModal :selectedRow="selectedRow"
-                  @refresh="getTableList" />
+        <span v-else></span>
+      </template>
+    </a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="handleBtn(selectedRow)"> </contextMenu>
+    <component :is="componentId"
+               v-if="componentId"
+               :selectedRow="selectedRow"
+               @cancel="closeComponent"> </component>
     <a-modal :visible="previewVisible"
              :footer="null"
              @cancel="cancelImg">
@@ -47,38 +53,51 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, contextMenu, BtnList, queryTableList, _getBtnList } from '@/common/export/table';
+import { EnumRouterName } from '@/common/constants/enumRouterName';
+import { ComposeTableParam, contextMenu, defineAsyncComponent, defineComponent, handleComposeTable, MtpTableButton, queryTableList } from '@/common/export/commonTable';
+import { getTableButton } from '@/common/setup/table/button';
+import { handlePreviewImg } from '@/common/setup/upload';
 import { queryAccountInOutApply } from '@/services/go/ermcp/qhj';
 import { QhjAccountOutInApply } from '@/services/go/ermcp/qhj/interface';
 import Filter from '../../compoments/filter/index.vue';
-import ControlModal from './compoments/controlModal/index.vue';
 import { handleTableStatus, inOrOutStatus } from '../../setup';
-import { BtnListType } from '@/common/components/btnList/interface';
-import { handlePreviewImg } from '@/common/setup/upload';
 
 export default defineComponent({
     name: 'platinum_recharge_review_tab',
-    components: { Filter, contextMenu, BtnList, ControlModal },
+    components: {
+        Filter,
+        contextMenu,
+        MtpTableButton,
+        detail: defineAsyncComponent(() => import('./compoments/detail/index.vue')), // 详情
+        confirm_payment: defineAsyncComponent(() => import('./compoments/payment/index.vue')), // 确认收款
+        review_refuse: defineAsyncComponent(() => import('./compoments/refuse/index.vue')), // 审核拒绝
+    },
     setup() {
-        // 表头数据
-        const { columns, registerColumn, updateColumn } = getTableColumns();
-        // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick, btnClick } = getTableEvent<QhjAccountOutInApply>({});
-        // 表格操作按钮列表
-        const [firstBtn] = _getBtnList('platinum_recharge_review_tab', true).value;
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList();
+        const { loading, tableList, queryTable } = queryTableList<QhjAccountOutInApply>();
+
+        const queryTableAction = () => {
+            queryTable(queryAccountInOutApply, { querytype: 2, applystatus: tableStatus.value });
+        };
+        // 表格通用逻辑
+        const param: ComposeTableParam = {
+            queryFn: queryTableAction,
+            menuType: EnumRouterName.plan_audit,
+            tableName: 'table_pcweb_qhj_pickup_query',
+            tableFilterKey: ['reqtime', 'pickupgoodsname', 'takeorderstatus', 'goodsname'],
+            isDetail: true,
+        };
+
         // 状态
         const { tableStatus, getTableListStatus, search } = handleTableStatus(queryTable, 2);
-        function getBtnListAction(): BtnListType[] {
-            const arr: string[] = ['详情'];
-            switch (tableStatus.value) {
-                case inOrOutStatus.wait:
-                    arr.push('确认收款');
-                    arr.push('审核拒绝');
-                    break;
+        function handleBtn(record: QhjAccountOutInApply) {
+            if (!record) return;
+            const buttons = getTableButton();
+            if (tableStatus.value === inOrOutStatus.wait) {
+                return buttons;
+            } else {
+                return buttons.filter((e) => e.code === 'detail');
             }
-            return firstBtn.filter((e: BtnListType) => arr.includes(e.lable));
         }
         // 预览附件
         const { previewVisible, previewImage, cancelImg, previewImg } = handlePreviewImg();
@@ -92,33 +111,20 @@ export default defineComponent({
         function getTableList() {
             queryTable(queryAccountInOutApply, { querytype: 2, applystatus: tableStatus.value });
         }
-        initData(() => {
-            // 默认 查询待审核状态列表
-            getTableList();
-            // 注册表头信息 过滤
-            registerColumn('table_pcweb_qhj_recharge_review', []);
-        });
 
         return {
+            ...handleComposeTable<QhjAccountOutInApply>(param),
+            loading,
+            handleBtn,
             getTableList,
-            getBtnListAction,
             getTableListStatus,
             previewVisible,
             previewImage,
             getVisibleImg,
             cancelImg,
-            columns,
             search,
             getUrl,
-            expandedRowKeys,
-            selectedRow,
-            Rowclick,
-            firstBtn,
-            loading,
             tableList,
-            updateColumn,
-            queryTable,
-            btnClick,
         };
     },
 });