OffCreditCard.tsx 12 KB

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