import React, { useEffect, useRef, useState } from "react"; import type { ProColumns, ActionType, ProFormInstance } from '@ant-design/pro-components'; import type {FormInstance} from 'antd' import { SDPage,SDTable,SDButton,EditType, baseFun, } from "@sundata/ui-frame"; import {getDataList,selectDetailData,exportExcelModel, SysListModel} from '@/services/rwa/dataquality/OnCreditCard'; import { WomanOutlined } from "@ant-design/icons"; import { ProductProps } from "@/sundataImport"; import { useModel } from '@umijs/max'; type widowRush = { onCancel: () => void; onChangeVisible(visible: boolean, type: string): unknown; onChangeVisdible:(visible:boolean,type ?: 'none' | 'raload' )=>void; }& ProductProps; // 信用卡表 const OnCreditCard : React.FC = (prop:widowRush) => { /** 编辑方式,查看、修改、新增按钮时设置,详细信息表单中使用 */ const [editType, setEditType] = useState(prop.editType || 'display'); /** 是否显示详细信息窗口 */ const [detailVisible, setDetailVisible] = useState(false); const [currentRow, setCurrentRow] = useState(); /** 表格引用对象,刷新表格使用 */ const actionRef = useRef(); const formRef = useRef>(); const { fetchDict } = useModel('dict'); // 页面数据 var formDataList = new Array; /**上传文件 */ const [fileData, setFileData] = useState(); // 导入窗口显示 const [importVisible, setImportVisible] = useState(false); useEffect(() => { }, []); // 页面展示元素 const columns: ProColumns[] = [ { title: '计算实例号', dataIndex: 'calcindex', search: false, hideInTable: true, width:150, ellipsis:true }, { title: '起始数据日期', dataIndex: 'startDate', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '截止数据日期', dataIndex: 'endDate', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '年月', dataIndex: 'yearMonth', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '数据日期', dataIndex: 'dataDate', hideInTable: false, valueType:'date', width:150, ellipsis:true, order:-1 }, { title: '债项编号', dataIndex: 'debtitemNo', hideInTable: false, width:150, ellipsis:true, order:-2 }, { title: '合同编号', dataIndex: 'contractNo', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '币种代码', dataIndex: 'ccy', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '币种', dataIndex: 'ccyDesc', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '资产余额', dataIndex: 'assetBal', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '应收利息', dataIndex: 'receivableInt', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '手续费', dataIndex: 'charge', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '应计利息', dataIndex: 'accrInt', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '利息调整', dataIndex: 'intAdj', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '公允价值变动', dataIndex: 'fairValueChange', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '计提准备金', dataIndex: 'provisionReserve', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '本金科目号', dataIndex: 'prinAccountNo', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '应收利息科目号', dataIndex: 'receivableIntAccountNo', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '手续费科目号', dataIndex: 'chargeAccountNo', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '应计利息科目号', dataIndex: 'accrIntAccountNo', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '利息调整科目号', dataIndex: 'intAdjAccountNo', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '公允价值变动科目号', dataIndex: 'fairValueChangeAccountNo', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '准备金科目号', dataIndex: 'reserveAccountNo', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '生效日', dataIndex: 'effectDate', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '到期日', dataIndex: 'expiryDate', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '五级分类代码', dataIndex: 'fiveClass', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '五级分类', dataIndex: 'fiveClassDesc', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '表内外标识代码', dataIndex: 'onbalshOffbalshFlag', search: false, hideInTable: false, }, { title: '表内外标识', dataIndex: 'onbalshOffbalshFlag', search: false, hideInTable: false, valueType: 'treeSelect', request: () => fetchDict('ONOROFF'), fieldProps: { treeDefaultExpandAll: true, }, }, { title: '账簿类型代码', dataIndex: 'accountBookType', search: false, hideInTable: false, }, { title: '账簿类型', dataIndex: 'accountBookType', search: false, hideInTable: false, valueType: 'treeSelect', request: () => fetchDict('ACCOUNT_TYPE'), fieldProps: { treeDefaultExpandAll: true, }, }, { title: '产品编号', dataIndex: 'productNo', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '产品名称', dataIndex: 'productName', hideInTable: false, width:150, ellipsis:true, order:-6 }, { title: '账务机构编号', dataIndex: 'accountOrgnNo', search: false, hideInTable: false, }, { title: '账务机构名称', dataIndex: 'accountOrgnName', search: false, hideInTable: false, }, { title: '经营机构编号', dataIndex: 'manageOrgnNo', search: false, hideInTable: false, }, { title: '经营机构编名称', dataIndex: 'manageOrgnName', search: false, hideInTable: false, }, { title: '经营机构编名称', dataIndex: 'manageOrgnNos', hideInTable: true, valueType: 'treeSelect', request: () => fetchDict('org'), fieldProps: { treeDefaultExpandAll: true, treeCheckable:true, }, order:-7 }, { title: '核心客户号', dataIndex: 'coreClientNo', hideInTable: false, width:150, ellipsis:true, order:-3 }, { title: '客户编号', dataIndex: 'clientNo', hideInTable: false, width:150, ellipsis:true, order:-4 }, { title: '客户名称', dataIndex: 'clientName', hideInTable: false, width:150, ellipsis:true, order:-5 }, { title: '合格交易者标志代码', dataIndex: 'qualifiedTradersFlag', search: false, hideInTable: false, width:150, ellipsis:true }, { title: '合格交易者标志', dataIndex: 'qualifiedTradersFlag', search: false, hideInTable: false, width:150, ellipsis:true, valueType: 'treeSelect', request: () => fetchDict(''), fieldProps: { treeDefaultExpandAll: true, }, }, ]; return ( { const formDatas = await getDataList(formdata); // 解构数组(导出用) formDataList=[...formDatas]; return {data: formDatas} } } columns={columns} toolBarRender={(_, { selectedRows }) => [ { baseFun.confirm('确认导出数据?',async() => { exportExcelModel(formDataList,"OnCreditCard")});; }} > 全部导出 , { setImportVisible(true); }} > 导入数据 , ]} actionRef={actionRef} formRef={formRef} setDetailVisible={() => {setDetailVisible(true)}} setEditType={setEditType} setCurrentRow={setCurrentRow} /> ); } export default OnCreditCard;