DiscountTable.tsx 12 KB

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