OffCreditCard.tsx 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  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 {Upload} from 'antd'
  5. import { SDPage,SDFormText,SDModalForm,SDTable,SDFormItem,SDButton,SDForm,SDSubmitButton,EditType, SDAreaTtile, SDLayout, SDOperate, baseFun, } from "@sundata/ui-frame";
  6. import {getDataList,selectDetailData,exportExcelModel, SysListModel} from '@/services/rwa/dataquality/OffCreditCard';
  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 OffCreditCard : 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: true,
  48. width:150,
  49. ellipsis:true
  50. },
  51. {
  52. title: '截止数据日期',
  53. dataIndex: 'endDate',
  54. search: false,
  55. hideInTable: true,
  56. width:150,
  57. ellipsis:true
  58. },
  59. {
  60. title: '年月',
  61. dataIndex: 'yearMonth',
  62. search: false,
  63. hideInTable: true,
  64. width:150,
  65. ellipsis:true
  66. },
  67. {
  68. title: '数据日期',
  69. dataIndex: 'dataDate',
  70. hideInTable: false,
  71. width:150,
  72. ellipsis:true,
  73. valueType:'date',
  74. order:-1
  75. },
  76. {
  77. title: '核心客户号',
  78. dataIndex: 'coreClientNo',
  79. hideInTable: false,
  80. width:150,
  81. ellipsis:true,
  82. order:-2
  83. },
  84. {
  85. title: '客户编号',
  86. dataIndex: 'clientNo',
  87. hideInTable: false,
  88. width:150,
  89. ellipsis:true,
  90. order:-3
  91. },
  92. {
  93. title: '客户名称',
  94. dataIndex: 'clientName',
  95. hideInTable: false,
  96. width:150,
  97. ellipsis:true,
  98. order:-4
  99. },
  100. {
  101. title: '币种代码',
  102. dataIndex: 'ccy',
  103. search: false,
  104. hideInTable: false,
  105. width:150,
  106. ellipsis:true
  107. },
  108. {
  109. title: '币种',
  110. dataIndex: 'ccyDesc',
  111. search: false,
  112. hideInTable: false,
  113. width:150,
  114. ellipsis:true
  115. },
  116. {
  117. title: '资产余额',
  118. dataIndex: 'assetBal',
  119. search: false,
  120. hideInTable: false,
  121. width:150,
  122. ellipsis:true
  123. },
  124. {
  125. title: '应收利息',
  126. dataIndex: 'receivableInt',
  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: 'charge',
  159. search: false,
  160. hideInTable: false,
  161. width:150,
  162. ellipsis:true
  163. },
  164. {
  165. title: '计提准备金',
  166. dataIndex: 'provisionReserve',
  167. search: false,
  168. hideInTable: false,
  169. width:150,
  170. ellipsis:true
  171. },
  172. {
  173. title: '本金科目号',
  174. dataIndex: 'prinAccountNo',
  175. search: false,
  176. hideInTable: false,
  177. width:150,
  178. ellipsis:true
  179. },
  180. {
  181. title: '应收利息科目号',
  182. dataIndex: 'receivableIntAccountNo',
  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: 'chargeAccountNo',
  215. search: false,
  216. hideInTable: false,
  217. width:150,
  218. ellipsis:true
  219. },
  220. {
  221. title: '准备金科目号',
  222. dataIndex: 'reserveAccountNo',
  223. search: false,
  224. hideInTable: false,
  225. width:150,
  226. ellipsis:true
  227. },
  228. {
  229. title: '产品编号',
  230. dataIndex: 'productNo',
  231. hideInTable: false,
  232. search: false,
  233. width:150,
  234. ellipsis:true
  235. },
  236. {
  237. title: '产品名称',
  238. dataIndex: 'productName',
  239. hideInTable: false,
  240. width:150,
  241. ellipsis:true,
  242. order:-6
  243. },
  244. {
  245. title: '表内外标识代码',
  246. dataIndex: 'onbalshOffbalshFlag',
  247. search: false,
  248. hideInTable: false,
  249. },
  250. {
  251. title: '表内外标识',
  252. dataIndex: 'onbalshOffbalshFlag',
  253. search: false,
  254. hideInTable: false,
  255. valueType: 'treeSelect',
  256. request: () => fetchDict('ONOROFF'),
  257. fieldProps: {
  258. treeDefaultExpandAll: true,
  259. },
  260. },
  261. {
  262. title: '账簿类型代码',
  263. dataIndex: 'accountBookType',
  264. search: false,
  265. hideInTable: false,
  266. },
  267. {
  268. title: '账簿类型',
  269. dataIndex: 'accountBookType',
  270. search: false,
  271. hideInTable: false,
  272. valueType: 'treeSelect',
  273. request: () => fetchDict('ACCOUNT_TYPE'),
  274. fieldProps: {
  275. treeDefaultExpandAll: true,
  276. },
  277. },
  278. {
  279. title: '生效日',
  280. dataIndex: 'effectDate',
  281. search: false,
  282. hideInTable: false,
  283. width:150,
  284. ellipsis:true
  285. },
  286. {
  287. title: '到期日',
  288. dataIndex: 'expiryDate',
  289. search: false,
  290. hideInTable: false,
  291. width:150,
  292. ellipsis:true
  293. },
  294. {
  295. title: '五级分类代码',
  296. dataIndex: 'fiveClass',
  297. search: false,
  298. hideInTable: false,
  299. width:150,
  300. ellipsis:true
  301. },
  302. {
  303. title: '五级分类',
  304. dataIndex: 'fiveClassDesc',
  305. search: false,
  306. hideInTable: false,
  307. width:150,
  308. ellipsis:true,
  309. valueType: 'treeSelect',
  310. request: () => fetchDict('FIVECLASS'),
  311. fieldProps: {
  312. treeDefaultExpandAll: true,
  313. },
  314. },
  315. {
  316. title: '账务机构编号',
  317. dataIndex: 'accountOrgnNo',
  318. search: false,
  319. hideInTable: false,
  320. width:150,
  321. },
  322. {
  323. title: '账务机构名称',
  324. dataIndex: 'accountOrgnName',
  325. search: false,
  326. hideInTable: false,
  327. width:150,
  328. },
  329. {
  330. title: '经营机构编号',
  331. dataIndex: 'manageOrgnNo',
  332. search: false,
  333. hideInTable: false,
  334. width:150,
  335. },
  336. {
  337. title: '经营机构编名称',
  338. dataIndex: 'manageOrgnName',
  339. search: false,
  340. hideInTable: false,
  341. width:150,
  342. },
  343. {
  344. title: '经营机构编',
  345. dataIndex: 'manageOrgnNos',
  346. hideInTable: true,
  347. valueType: 'treeSelect',
  348. request: () => fetchDict('org'),
  349. fieldProps: {
  350. treeDefaultExpandAll: true,
  351. treeCheckable:true,
  352. },
  353. order:-5
  354. },
  355. {
  356. title: '符合标准未使用额度标签代码',
  357. dataIndex: 'accordStandardUnuseLimitLabel',
  358. search: false,
  359. hideInTable: false,
  360. width:150,
  361. ellipsis:true,
  362. },
  363. {
  364. title: '符合标准未使用额度标签',
  365. dataIndex: 'accordStandardUnuseLimitLabel',
  366. hideInTable: true,
  367. width:150,
  368. ellipsis:true,
  369. valueType: 'treeSelect',
  370. request: () => fetchDict('TORF'),
  371. fieldProps: {
  372. treeDefaultExpandAll: true,
  373. },
  374. order:-8
  375. },
  376. {
  377. title: '合格交易者标志代码',
  378. dataIndex: 'qualifiedTradersFlag',
  379. search: false,
  380. hideInTable: false,
  381. width:150,
  382. ellipsis:true
  383. },
  384. {
  385. title: '合格交易者标志',
  386. dataIndex: 'qualifiedTradersFlag',
  387. hideInTable: false,
  388. width:150,
  389. ellipsis:true,
  390. valueType: 'treeSelect',
  391. request: () => fetchDict('TORF'),
  392. fieldProps: {
  393. treeDefaultExpandAll: true,
  394. },
  395. order:-7
  396. },
  397. ];
  398. return (
  399. <SDPage>
  400. <SDTable
  401. title="查询表格"
  402. rowKey="customerName"
  403. request={async (formdata:SysListModel) =>{
  404. const formDatas = await getDataList(formdata);
  405. // 解构数组(导出用)
  406. formDataList=[...formDatas];
  407. return {data: formDatas}
  408. } }
  409. columns={columns}
  410. toolBarRender={(_, { selectedRows }) => [
  411. <SDButton
  412. key="export"
  413. successMessage=''
  414. onClick={() => {
  415. baseFun.confirm('确认导出数据?',async() => { exportExcelModel(formDataList,"OffCreditCard")});;
  416. }}
  417. >
  418. 全部导出
  419. </SDButton>,
  420. ]}
  421. actionRef={actionRef}
  422. formRef={formRef}
  423. setDetailVisible={() => {setDetailVisible(true)}}
  424. setEditType={setEditType}
  425. setCurrentRow={setCurrentRow}
  426. />
  427. </SDPage>
  428. );
  429. }
  430. export default OffCreditCard;