InterbankDepositOrLendingTable.tsx 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  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,SDTable,SDButton,EditType, baseFun, } from "@sundata/ui-frame";
  6. import {getDataList,exportExcelModel, SysListModel} from '@/services/rwa/dataquality/InterbankDepositOrLendingTable';
  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 InterbankDepositOrLendingTable : 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: '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: 'assetBal',
  95. search: false,
  96. hideInTable: false,
  97. width:150,
  98. ellipsis:true
  99. },
  100. {
  101. title: '应收利息',
  102. dataIndex: 'receivableInt',
  103. search: false,
  104. hideInTable: false,
  105. width:150,
  106. ellipsis:true
  107. },
  108. {
  109. title: '应计利息',
  110. dataIndex: 'accrInt',
  111. search: false,
  112. hideInTable: false,
  113. width:150,
  114. ellipsis:true
  115. },
  116. {
  117. title: '利息调整',
  118. dataIndex: 'intAdj',
  119. search: false,
  120. hideInTable: false,
  121. width:150,
  122. ellipsis:true
  123. },
  124. {
  125. title: '公允价值变动',
  126. dataIndex: 'fairValueChange',
  127. search: false,
  128. hideInTable: false,
  129. width:150,
  130. ellipsis:true
  131. },
  132. {
  133. title: '计提准备金',
  134. dataIndex: 'provisionReserve',
  135. search: false,
  136. hideInTable: false,
  137. width:150,
  138. ellipsis:true
  139. },
  140. {
  141. title: '本金科目号',
  142. dataIndex: 'prinAccountNo',
  143. search: false,
  144. hideInTable: false,
  145. width:150,
  146. ellipsis:true
  147. },
  148. {
  149. title: '应收利息科目号',
  150. dataIndex: 'receivableIntAccountNo',
  151. search: false,
  152. hideInTable: false,
  153. width:150,
  154. ellipsis:true
  155. },
  156. {
  157. title: '应计利息科目号',
  158. dataIndex: 'accrIntAccountNo',
  159. search: false,
  160. hideInTable: false,
  161. width:150,
  162. ellipsis:true
  163. },
  164. {
  165. title: '利息调整科目号',
  166. dataIndex: 'intAdjAccountNo',
  167. search: false,
  168. hideInTable: false,
  169. width:150,
  170. ellipsis:true
  171. },
  172. {
  173. title: '公允价值变动科目号',
  174. dataIndex: 'fairValueChangeAccountNo',
  175. search: false,
  176. hideInTable: false,
  177. width:150,
  178. ellipsis:true
  179. },
  180. {
  181. title: '准备金科目号',
  182. dataIndex: 'reserveAccountNo',
  183. search: false,
  184. hideInTable: false,
  185. width:150,
  186. ellipsis:true
  187. },
  188. {
  189. title: '产品编号',
  190. dataIndex: 'productNo',
  191. search: false,
  192. hideInTable: false,
  193. width:150,
  194. ellipsis:true
  195. },
  196. {
  197. title: '产品名称',
  198. dataIndex: 'productName',
  199. hideInTable: false,
  200. width:150,
  201. ellipsis:true,
  202. order:-6
  203. },
  204. {
  205. title: '产品细类代码',
  206. dataIndex: 'productSubclass',
  207. search: false,
  208. hideInTable: false,
  209. width:150,
  210. ellipsis:true
  211. },
  212. {
  213. title: '产品细类',
  214. dataIndex: 'productSubclass',
  215. search: false,
  216. hideInTable: false,
  217. width:150,
  218. ellipsis:true,
  219. valueType: 'treeSelect',
  220. request: () => fetchDict(''),
  221. fieldProps: {
  222. treeDefaultExpandAll: true,
  223. },
  224. },
  225. {
  226. title: '生效日',
  227. dataIndex: 'effectDate',
  228. search: false,
  229. hideInTable: false,
  230. width:150,
  231. ellipsis:true
  232. },
  233. {
  234. title: '到期日',
  235. dataIndex: 'expiryDate',
  236. search: false,
  237. hideInTable: false,
  238. width:150,
  239. ellipsis:true
  240. },
  241. {
  242. title: '拆借存放标识代码',
  243. dataIndex: 'lendingStoreFlag',
  244. search: false,
  245. hideInTable: false,
  246. width:150,
  247. ellipsis:true
  248. },
  249. {
  250. title: '拆借存放标识',
  251. dataIndex: 'lendingStoreFlag',
  252. search: false,
  253. hideInTable: false,
  254. width:150,
  255. ellipsis:true,
  256. valueType: 'treeSelect',
  257. request: () => fetchDict(''),
  258. fieldProps: {
  259. treeDefaultExpandAll: true,
  260. },
  261. },
  262. {
  263. title: '表内外标识代码',
  264. dataIndex: 'onbalshOffbalshFlag',
  265. search: false,
  266. hideInTable: false,
  267. width:150,
  268. ellipsis:true,
  269. },
  270. {
  271. title: '表内外标识',
  272. dataIndex: 'onbalshOffbalshFlag',
  273. search: false,
  274. hideInTable: false,
  275. width:150,
  276. ellipsis:true,
  277. valueType: 'treeSelect',
  278. request: () => fetchDict('ONOROFF'),
  279. fieldProps: {
  280. treeDefaultExpandAll: true,
  281. },
  282. },
  283. {
  284. title: '账簿类型代码',
  285. dataIndex: 'accountBookType',
  286. search: false,
  287. hideInTable: false,
  288. width:150,
  289. ellipsis:true,
  290. },
  291. {
  292. title: '账簿类型',
  293. dataIndex: 'accountBookType',
  294. search: false,
  295. hideInTable: false,
  296. width:150,
  297. ellipsis:true,
  298. valueType: 'treeSelect',
  299. request: () => fetchDict('ACCOUNT_TYPE'),
  300. fieldProps: {
  301. treeDefaultExpandAll: true,
  302. },
  303. },
  304. {
  305. title: '账务机构编号',
  306. dataIndex: 'finBranchNo',
  307. search: false,
  308. hideInTable: false,
  309. width:150,
  310. ellipsis:true,
  311. },
  312. {
  313. title: '账务机构名称',
  314. dataIndex: 'finBranchName',
  315. search: false,
  316. hideInTable: false,
  317. width:150,
  318. ellipsis:true,
  319. },
  320. {
  321. title: '经营机构编号',
  322. dataIndex: 'manageOrgnNo',
  323. hideInTable: false,
  324. search:false,
  325. width:150,
  326. ellipsis:true,
  327. order:-5
  328. },
  329. {
  330. title: '经营机构编号',
  331. dataIndex: 'manageOrgnNos',
  332. hideInTable: false,
  333. width:150,
  334. ellipsis:true,
  335. order:-5,
  336. valueType: 'treeSelect',
  337. request: () => fetchDict('org'),
  338. fieldProps: {
  339. treeDefaultExpandAll: true,
  340. treeCheckable:true,
  341. },
  342. },
  343. {
  344. title: '经营机构编名称',
  345. dataIndex: 'manageOrgnName',
  346. search: false,
  347. hideInTable: false,
  348. },
  349. {
  350. title: '客户编号',
  351. dataIndex: 'clientNo',
  352. hideInTable: false,
  353. width:150,
  354. ellipsis:true,
  355. order:-3
  356. },
  357. {
  358. title: '客户名称',
  359. dataIndex: 'clientName',
  360. hideInTable: false,
  361. width:150,
  362. ellipsis:true,
  363. order:-4
  364. },
  365. ];
  366. return (
  367. <SDPage>
  368. <SDTable
  369. title="查询表格"
  370. rowKey="customerName"
  371. request={async (formdata:SysListModel) =>{
  372. const formDatas = await getDataList(formdata);
  373. // 解构数组(导出用)
  374. formDataList=[...formDatas];
  375. return {data: formDatas}
  376. } }
  377. columns={columns}
  378. toolBarRender={(_, { selectedRows }) => [
  379. <SDButton
  380. key="export"
  381. successMessage=''
  382. onClick={() => {
  383. // if (selectedRows === undefined || selectedRows.length < 1) {
  384. // baseFun.warning('请先选择要倒出的模板');
  385. // return;
  386. // }
  387. baseFun.confirm('确认导出数据?',async() => { exportExcelModel(formDataList,"InterbankDepositOrLendingTable")});;
  388. //baseFun.info('处理完成');
  389. }}
  390. >
  391. 全部导出
  392. </SDButton>,
  393. ]}
  394. singleSelect={false}
  395. actionRef={actionRef}
  396. formRef={formRef}
  397. setDetailVisible={() => {setDetailVisible(true)}}
  398. setEditType={setEditType}
  399. setCurrentRow={setCurrentRow}
  400. />
  401. </SDPage>
  402. );
  403. }
  404. export default InterbankDepositOrLendingTable;