huangbin 4 anos atrás
pai
commit
feeab5844c

+ 59 - 12
src/views/search/search_financing_inquiry/search_financing_inquiry_contract/index.vue

@@ -29,23 +29,45 @@
       </template>
 
     </a-table>
+    <!-- 明细 -->
+    <Description v-if="visible"
+                 @close="closeDrawer"
+                 :tabList="tabList">
+      <a-table :columns="FeeColumns"
+               class="topTable"
+               :pagination="false"
+               rowKey="key"
+               :data-source="feeList"
+               :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }">
+        <template #updatetime="{ text }">
+          <span>{{ text === '--' ? text :  formatTime(text)}}</span>
+        </template>
+        <template #closeintereststatus="{ text }">
+          <span>{{ getCloseInterRestStatus(text)}}</span>
+        </template>
+      </a-table>
+    </Description>
   </section>
 </template>
 
 <script lang="ts">
-import { queryTableList, defineComponent } from '@/common/export/commonTable';
-import { queryWrScfContract } from '@/services/go/wrtrade';
-import { WrScfContract } from '@/services/go/wrtrade/interface';
-import { getRecordItemTab } from '@/common/setup/order/orderData';
-import { handleComposeOrderTable } from '@/common/setup/table/compose';
-import { ComposeOrderTableParam } from '@/common/setup/table/interface';
+import Description from '@/common/components/description/index.vue';
+import { EnumRouterName } from '@/common/constants/enumRouterName';
+import { getContractName, getFinanceTypeName, getScfContractTypeName } from '@/common/constants/enumsName';
+import { defineComponent, queryTableList } from '@/common/export/commonTable';
 import { formatTime } from '@/common/methods';
 import { expandIcon } from '@/common/setup/table/clolumn';
-import { getContractName, getFinanceTypeName, getScfContractTypeName } from '@/common/constants/enumsName';
-import { EnumRouterName } from '@/common/constants/enumRouterName';
+import { ComposeTableDetailParam, handleComposeTable_detail } from '@/common/setup/table/compose';
+import { queryWrScfContract } from '@/services/go/wrtrade';
+import { WrScfContract } from '@/services/go/wrtrade/interface';
+import { watchEffect } from 'vue';
+import { useFeeDetail } from './setup';
 
 export default defineComponent({
     name: EnumRouterName.search_financing_inquiry_contract,
+    components: {
+        Description,
+    },
     setup() {
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<WrScfContract>();
@@ -53,14 +75,38 @@ export default defineComponent({
         const queryTableAction = () => {
             queryTable(queryWrScfContract);
         };
-        // 表格通用逻辑
-        const param: ComposeOrderTableParam = {
+        const { FeeColumns, feeList, tabList, queryFeeDetail, getCloseInterRestStatus } = useFeeDetail();
+
+        const param: ComposeTableDetailParam = {
             queryFn: queryTableAction,
             tableName: 'table_pcweb_financing_manage_bottom_contract',
-            recordList: getRecordItemTab(),
+            tableFilterKey: [], // 表格过滤字段
+            menuType: EnumRouterName.search_financing_inquiry_apply_order, // 当前tab页对应的code
         };
+        const {
+            visible,
+            closeDrawer, // 控制 drawer 组件是否显示
+            columns,
+            detailTableList, // 明细表头数据
+            expandedRowKeys,
+            selectedRow,
+            Rowclick, // 表格事件
+        } = handleComposeTable_detail<WrScfContract>(param);
+
+        watchEffect(() => {
+            if (visible.value) {
+                queryFeeDetail(selectedRow.value!.scfcontractid);
+            }
+        });
         return {
-            ...handleComposeOrderTable<WrScfContract>(param),
+            visible,
+            closeDrawer, // 控制 drawer 组件是否显示
+            columns,
+            FeeColumns,
+            expandedRowKeys,
+            Rowclick, // 表格事件
+            tabList,
+            feeList,
             loading,
             tableList,
             formatTime,
@@ -68,6 +114,7 @@ export default defineComponent({
             getContractName,
             getFinanceTypeName,
             getScfContractTypeName,
+            getCloseInterRestStatus,
         };
     },
 });

+ 42 - 0
src/views/search/search_financing_inquiry/search_financing_inquiry_contract/setup.ts

@@ -0,0 +1,42 @@
+import { TabList } from "@/common/components/description/interface";
+import { queryTableList } from "@/common/setup/table";
+import { queryWrScfContractInterest } from "@/services/go/wrtrade";
+import { WrScfContractInterest } from "@/services/go/wrtrade/interface";
+
+// 费用明细
+export const useFeeDetail = () => {
+    // 表头
+    const FeeColumns = [
+        { title: '日期', dataIndex: 'updatetime', key: 'updatetime', align: 'center', slots: { customRender: 'updatetime' }, width: 160 },
+        { title: '费用', dataIndex: 'interestamount', key: 'interestamount', align: 'center', width: 160 },
+        { title: '已结', dataIndex: 'closeinterest', key: 'closeinterest', align: 'center', width: 160 },
+        { title: '状态', dataIndex: 'closeintereststatus', key: 'closeintereststatus', align: 'center', slots: { customRender: 'closeintereststatus' }, width: 160 }
+    ];
+    // 表格列表数据
+    const { tableList, queryTable } = queryTableList<WrScfContractInterest>();
+
+    //结息状态 - 1:未结 2:已结
+    const getCloseInterRestStatus = (status: number) => {
+        let result = '--'
+        switch (status) {
+            case 1:
+                result = '未结'
+                break
+            case 2:
+                result = '已结'
+                break
+        }
+        return result
+    }
+    const queryFeeDetail = (scfcontractid: string) => {
+        const param = { scfcontractid }
+        queryTable(queryWrScfContractInterest, param)
+    }
+
+    const tabList: TabList[] = [
+        { lable: '合同明细', code: 'fee-detail' }
+    ]
+
+    return { FeeColumns, feeList: tableList, tabList, queryFeeDetail, getCloseInterRestStatus }
+}
+