OnCreditCard.tsx 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. import React, { useEffect, useRef, useState } from "react";
  2. import type { ProColumns, ActionType, ProFormInstance } from '@ant-design/pro-components';
  3. import type {FormInstance} from 'antd'
  4. import { SDPage,SDTable,SDButton,EditType, baseFun, } from "@sundata/ui-frame";
  5. import {getDataList,selectDetailData,exportExcelModel, SysListModel} from '@/services/rwa/dataquality/OnCreditCard';
  6. import { WomanOutlined } from "@ant-design/icons";
  7. import { ProductProps } from "@/sundataImport";
  8. import { useModel } from '@umijs/max';
  9. type widowRush = {
  10. onCancel: () => void;
  11. onChangeVisible(visible: boolean, type: string): unknown;
  12. onChangeVisdible:(visible:boolean,type ?: 'none' | 'raload' )=>void;
  13. }& ProductProps;
  14. // 信用卡表
  15. const OnCreditCard : React.FC<widowRush> = (prop:widowRush) => {
  16. /** 编辑方式,查看、修改、新增按钮时设置,详细信息表单中使用 */
  17. const [editType, setEditType] = useState<EditType>(prop.editType || 'display');
  18. /** 是否显示详细信息窗口 */
  19. const [detailVisible, setDetailVisible] = useState<boolean>(false);
  20. const [currentRow, setCurrentRow] = useState<SysListModel>();
  21. /** 表格引用对象,刷新表格使用 */
  22. const actionRef = useRef<ActionType>();
  23. const formRef = useRef<FormInstance<any>>();
  24. const { fetchDict } = useModel('dict');
  25. // 页面数据
  26. var formDataList = new Array<SysListModel>;
  27. /**上传文件 */
  28. const [fileData, setFileData] = useState<File>();
  29. // 导入窗口显示
  30. const [importVisible, setImportVisible] = useState<boolean>(false);
  31. useEffect(() => {
  32. }, []);
  33. // 页面展示元素
  34. const columns: ProColumns<SysListModel>[] = [
  35. {
  36. title: '计算实例号',
  37. dataIndex: 'calcindex',
  38. search: false,
  39. hideInTable: true,
  40. width:150,
  41. ellipsis:true
  42. },
  43. {
  44. title: '起始数据日期',
  45. dataIndex: 'startDate',
  46. search: false,
  47. hideInTable: false,
  48. width:150,
  49. ellipsis:true
  50. },
  51. {
  52. title: '截止数据日期',
  53. dataIndex: 'endDate',
  54. search: false,
  55. hideInTable: false,
  56. width:150,
  57. ellipsis:true
  58. },
  59. {
  60. title: '年月',
  61. dataIndex: 'yearMonth',
  62. search: false,
  63. hideInTable: false,
  64. width:150,
  65. ellipsis:true
  66. },
  67. {
  68. title: '数据日期',
  69. dataIndex: 'dataDate',
  70. hideInTable: false,
  71. valueType:'date',
  72. width:150,
  73. ellipsis:true,
  74. order:-1
  75. },
  76. {
  77. title: '债项编号',
  78. dataIndex: 'debtitemNo',
  79. hideInTable: false,
  80. width:150,
  81. ellipsis:true,
  82. order:-2
  83. },
  84. {
  85. title: '合同编号',
  86. dataIndex: 'contractNo',
  87. search: false,
  88. hideInTable: false,
  89. width:150,
  90. ellipsis:true
  91. },
  92. {
  93. title: '币种代码',
  94. dataIndex: 'ccy',
  95. search: false,
  96. hideInTable: false,
  97. width:150,
  98. ellipsis:true
  99. },
  100. {
  101. title: '币种',
  102. dataIndex: 'ccyDesc',
  103. search: false,
  104. hideInTable: false,
  105. width:150,
  106. ellipsis:true
  107. },
  108. {
  109. title: '资产余额',
  110. dataIndex: 'assetBal',
  111. search: false,
  112. hideInTable: false,
  113. width:150,
  114. ellipsis:true
  115. },
  116. {
  117. title: '应收利息',
  118. dataIndex: 'receivableInt',
  119. search: false,
  120. hideInTable: false,
  121. width:150,
  122. ellipsis:true
  123. },
  124. {
  125. title: '手续费',
  126. dataIndex: 'charge',
  127. search: false,
  128. hideInTable: false,
  129. width:150,
  130. ellipsis:true
  131. },
  132. {
  133. title: '应计利息',
  134. dataIndex: 'accrInt',
  135. search: false,
  136. hideInTable: false,
  137. width:150,
  138. ellipsis:true
  139. },
  140. {
  141. title: '利息调整',
  142. dataIndex: 'intAdj',
  143. search: false,
  144. hideInTable: false,
  145. width:150,
  146. ellipsis:true
  147. },
  148. {
  149. title: '公允价值变动',
  150. dataIndex: 'fairValueChange',
  151. search: false,
  152. hideInTable: false,
  153. width:150,
  154. ellipsis:true
  155. },
  156. {
  157. title: '计提准备金',
  158. dataIndex: 'provisionReserve',
  159. search: false,
  160. hideInTable: false,
  161. width:150,
  162. ellipsis:true
  163. },
  164. {
  165. title: '本金科目号',
  166. dataIndex: 'prinAccountNo',
  167. search: false,
  168. hideInTable: false,
  169. width:150,
  170. ellipsis:true
  171. },
  172. {
  173. title: '应收利息科目号',
  174. dataIndex: 'receivableIntAccountNo',
  175. search: false,
  176. hideInTable: false,
  177. width:150,
  178. ellipsis:true
  179. },
  180. {
  181. title: '手续费科目号',
  182. dataIndex: 'chargeAccountNo',
  183. search: false,
  184. hideInTable: false,
  185. width:150,
  186. ellipsis:true
  187. },
  188. {
  189. title: '应计利息科目号',
  190. dataIndex: 'accrIntAccountNo',
  191. search: false,
  192. hideInTable: false,
  193. width:150,
  194. ellipsis:true
  195. },
  196. {
  197. title: '利息调整科目号',
  198. dataIndex: 'intAdjAccountNo',
  199. search: false,
  200. hideInTable: false,
  201. width:150,
  202. ellipsis:true
  203. },
  204. {
  205. title: '公允价值变动科目号',
  206. dataIndex: 'fairValueChangeAccountNo',
  207. search: false,
  208. hideInTable: false,
  209. width:150,
  210. ellipsis:true
  211. },
  212. {
  213. title: '准备金科目号',
  214. dataIndex: 'reserveAccountNo',
  215. search: false,
  216. hideInTable: false,
  217. width:150,
  218. ellipsis:true
  219. },
  220. {
  221. title: '生效日',
  222. dataIndex: 'effectDate',
  223. search: false,
  224. hideInTable: false,
  225. width:150,
  226. ellipsis:true
  227. },
  228. {
  229. title: '到期日',
  230. dataIndex: 'expiryDate',
  231. search: false,
  232. hideInTable: false,
  233. width:150,
  234. ellipsis:true
  235. },
  236. {
  237. title: '五级分类代码',
  238. dataIndex: 'fiveClass',
  239. search: false,
  240. hideInTable: false,
  241. width:150,
  242. ellipsis:true
  243. },
  244. {
  245. title: '五级分类',
  246. dataIndex: 'fiveClassDesc',
  247. search: false,
  248. hideInTable: false,
  249. width:150,
  250. ellipsis:true
  251. },
  252. {
  253. title: '表内外标识代码',
  254. dataIndex: 'onbalshOffbalshFlag',
  255. search: false,
  256. hideInTable: false,
  257. },
  258. {
  259. title: '表内外标识',
  260. dataIndex: 'onbalshOffbalshFlag',
  261. search: false,
  262. hideInTable: false,
  263. valueType: 'treeSelect',
  264. request: () => fetchDict('ONOROFF'),
  265. fieldProps: {
  266. treeDefaultExpandAll: true,
  267. },
  268. },
  269. {
  270. title: '账簿类型代码',
  271. dataIndex: 'accountBookType',
  272. search: false,
  273. hideInTable: false,
  274. },
  275. {
  276. title: '账簿类型',
  277. dataIndex: 'accountBookType',
  278. search: false,
  279. hideInTable: false,
  280. valueType: 'treeSelect',
  281. request: () => fetchDict('ACCOUNT_TYPE'),
  282. fieldProps: {
  283. treeDefaultExpandAll: true,
  284. },
  285. },
  286. {
  287. title: '产品编号',
  288. dataIndex: 'productNo',
  289. search: false,
  290. hideInTable: false,
  291. width:150,
  292. ellipsis:true
  293. },
  294. {
  295. title: '产品名称',
  296. dataIndex: 'productName',
  297. hideInTable: false,
  298. width:150,
  299. ellipsis:true,
  300. order:-6
  301. },
  302. {
  303. title: '账务机构编号',
  304. dataIndex: 'accountOrgnNo',
  305. search: false,
  306. hideInTable: false,
  307. },
  308. {
  309. title: '账务机构名称',
  310. dataIndex: 'accountOrgnName',
  311. search: false,
  312. hideInTable: false,
  313. },
  314. {
  315. title: '经营机构编号',
  316. dataIndex: 'manageOrgnNo',
  317. search: false,
  318. hideInTable: false,
  319. },
  320. {
  321. title: '经营机构编名称',
  322. dataIndex: 'manageOrgnName',
  323. search: false,
  324. hideInTable: false,
  325. },
  326. {
  327. title: '经营机构编名称',
  328. dataIndex: 'manageOrgnNos',
  329. hideInTable: true,
  330. valueType: 'treeSelect',
  331. request: () => fetchDict('org'),
  332. fieldProps: {
  333. treeDefaultExpandAll: true,
  334. treeCheckable:true,
  335. },
  336. order:-7
  337. },
  338. {
  339. title: '核心客户号',
  340. dataIndex: 'coreClientNo',
  341. hideInTable: false,
  342. width:150,
  343. ellipsis:true,
  344. order:-3
  345. },
  346. {
  347. title: '客户编号',
  348. dataIndex: 'clientNo',
  349. hideInTable: false,
  350. width:150,
  351. ellipsis:true,
  352. order:-4
  353. },
  354. {
  355. title: '客户名称',
  356. dataIndex: 'clientName',
  357. hideInTable: false,
  358. width:150,
  359. ellipsis:true,
  360. order:-5
  361. },
  362. {
  363. title: '合格交易者标志代码',
  364. dataIndex: 'qualifiedTradersFlag',
  365. search: false,
  366. hideInTable: false,
  367. width:150,
  368. ellipsis:true
  369. },
  370. {
  371. title: '合格交易者标志',
  372. dataIndex: 'qualifiedTradersFlag',
  373. search: false,
  374. hideInTable: false,
  375. width:150,
  376. ellipsis:true,
  377. valueType: 'treeSelect',
  378. request: () => fetchDict(''),
  379. fieldProps: {
  380. treeDefaultExpandAll: true,
  381. },
  382. },
  383. ];
  384. return (
  385. <SDPage>
  386. <SDTable
  387. title="查询表格"
  388. rowKey="customerName"
  389. request={async (formdata:SysListModel) =>{
  390. const formDatas = await getDataList(formdata);
  391. // 解构数组(导出用)
  392. formDataList=[...formDatas];
  393. return {data: formDatas}
  394. } }
  395. columns={columns}
  396. toolBarRender={(_, { selectedRows }) => [
  397. <SDButton
  398. key="export"
  399. successMessage=''
  400. onClick={() => {
  401. baseFun.confirm('确认导出数据?',async() => { exportExcelModel(formDataList,"OnCreditCard")});;
  402. }}
  403. >
  404. 全部导出
  405. </SDButton>,
  406. <SDButton
  407. key="import"
  408. successMessage=''
  409. onClick={() => {
  410. setImportVisible(true);
  411. }}
  412. >
  413. 导入数据
  414. </SDButton>,
  415. ]}
  416. actionRef={actionRef}
  417. formRef={formRef}
  418. setDetailVisible={() => {setDetailVisible(true)}}
  419. setEditType={setEditType}
  420. setCurrentRow={setCurrentRow}
  421. />
  422. </SDPage>
  423. );
  424. }
  425. export default OnCreditCard;