arrearsList.jsx 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. import React from "react";
  2. import {
  3. Button,
  4. Input,
  5. Select,
  6. Spin,
  7. Table,
  8. message,
  9. DatePicker,
  10. Form,
  11. Modal,
  12. Tabs, Tooltip,
  13. } from "antd";
  14. import $ from "jquery/src/ajax";
  15. import moment from "moment";
  16. import ShowModalDiv from "@/showModal.jsx";
  17. import {
  18. getLiquidationStatus,
  19. getjiedian,
  20. getNewOrderStatus,
  21. getProjectStatus,
  22. ShowModal,
  23. } from "@/tools.js";
  24. import "./customer.less";
  25. import {ChooseList} from "./chooseList";
  26. import {getProjectName} from "../../../tools";
  27. import DepartmentList from "../../../common/departmentList";
  28. const ArrearsList = Form.create()(
  29. React.createClass({
  30. loadData(pageNo) {
  31. this.setState({
  32. visitModul: false,
  33. loading: true,
  34. ispage: pageNo,
  35. modalVisible: false,
  36. });
  37. $.ajax({
  38. method: "get",
  39. dataType: "json",
  40. crossDomain: false,
  41. url: globalConfig.context + "/api/admin/newOrder/arrearsDunList",
  42. data: {
  43. pageNo: pageNo || 1,
  44. pageSize: this.state.pagination.pageSize,
  45. name: this.state.customerName, //名称
  46. orderNo: this.state.orderNo, //订单编号
  47. depId: this.state.departmenttSearch, //订单部门
  48. starTime: this.state.releaseDate[0], //开始时间
  49. endTime: this.state.releaseDate[1], //结束时间
  50. tStarTime: this.state.chufaDate[0], //开始时间
  51. tEndTime: this.state.chufaDate[1], //结束时间
  52. adminName: this.state.adminName,
  53. },
  54. success: function (data) {
  55. ShowModal(this);
  56. let theArr = [];
  57. if (data.error.length || data.data.list == "") {
  58. if (data.error && data.error.length) {
  59. message.warning(data.error[0].message);
  60. }
  61. } else {
  62. for (let i = 0; i < data.data.list.length; i++) {
  63. let thisdata = data.data.list[i];
  64. let obj = thisdata;
  65. obj.key = i + 1;
  66. theArr.push(obj);
  67. }
  68. this.state.pagination.total = data.data.totalCount;
  69. this.state.pagination.current = data.data.pageNo;
  70. }
  71. if (data.data && data.data.list && !data.data.list.length) {
  72. this.state.pagination.total = 0;
  73. }
  74. this.setState({
  75. dataSource: theArr,
  76. pageNo: pageNo,
  77. pagination: this.state.pagination,
  78. selectedRowKeys: [],
  79. });
  80. }.bind(this),
  81. }).always(
  82. function () {
  83. this.setState({
  84. loading: false,
  85. });
  86. }.bind(this)
  87. );
  88. },
  89. getInitialState() {
  90. return {
  91. releaseDate: [],
  92. chufaDate: [],
  93. pagination: {
  94. defaultCurrent: 1,
  95. defaultPageSize: 10,
  96. showQuickJumper: true,
  97. pageSize: 10,
  98. onChange: function (page) {
  99. this.loadData(page);
  100. }.bind(this),
  101. showTotal: function (total) {
  102. return "共" + total + "条数据";
  103. },
  104. },
  105. columns: [
  106. {
  107. title: "序号",
  108. dataIndex: "key",
  109. key: "key",
  110. },
  111. {
  112. title: "合同编号",
  113. dataIndex: "contractNo",
  114. key: "contractNo",
  115. },
  116. {
  117. title: "订单编号",
  118. dataIndex: "orderNo",
  119. key: "orderNo",
  120. },
  121. {
  122. title: "客户名称",
  123. dataIndex: "userName",
  124. key: "userName",
  125. width:100,
  126. render: text => {
  127. return (
  128. <Tooltip title={text}>
  129. <div style={{
  130. maxWidth:'100px',
  131. overflow:'hidden',
  132. textOverflow: "ellipsis",
  133. whiteSpace:'nowrap',
  134. }}>{text}</div>
  135. </Tooltip>
  136. )
  137. }
  138. },
  139. {
  140. title: "订单负责人",
  141. dataIndex: "salesmanName",
  142. key: "salesmanName",
  143. },
  144. {
  145. title: "订单部门",
  146. dataIndex: "depName",
  147. key: "depName",
  148. },
  149. {
  150. title: "订单状态",
  151. dataIndex: "orderStatus",
  152. key: "orderStatus",
  153. render: (text) => {
  154. return getNewOrderStatus(text);
  155. },
  156. },
  157. {
  158. title: "项目状态",
  159. dataIndex: "projectStatus",
  160. key: "projectStatus",
  161. render: (text) => {
  162. return getProjectName(text);
  163. },
  164. },
  165. {
  166. title: "签单金额(万元)",
  167. dataIndex: "totalAmount",
  168. key: "totalAmount",
  169. },
  170. {
  171. title: "已收款(万元)",
  172. dataIndex: "settlementAmount",
  173. key: "settlementAmount",
  174. },
  175. {
  176. title: "应收款(万元)",
  177. dataIndex: "orderReceivables",
  178. key: "orderReceivables",
  179. },
  180. {
  181. title: "欠款(万元)",
  182. dataIndex: "orderArrears",
  183. key: "orderArrears",
  184. },
  185. {
  186. title: "结算状态",
  187. dataIndex: "liquidationStatus",
  188. key: "liquidationStatus",
  189. render: (text) => {
  190. return getLiquidationStatus(text);
  191. },
  192. },
  193. {
  194. title: "催收科目",
  195. dataIndex: "type",
  196. key: "type",
  197. render: text => {
  198. if(text == 0) {
  199. return "按时触发应收欠款"
  200. }
  201. }
  202. },
  203. {
  204. title: "催款状态",
  205. dataIndex: "dunStatus",
  206. key: "dunStatus",
  207. render: (text) => {
  208. if (text == 0) {
  209. return "未启动";
  210. } else if (text == 1) {
  211. return "催款中";
  212. } else if (text == 2) {
  213. return "已完成";
  214. } else if (text == 3) {
  215. return "已停止";
  216. }
  217. },
  218. },
  219. {
  220. title: "催款启动日期",
  221. dataIndex: "startDate",
  222. key: "startDate",
  223. },
  224. {
  225. title: "下单时间",
  226. dataIndex: "signDate",
  227. key: "signDate",
  228. },
  229. ],
  230. dataSource: [],
  231. };
  232. },
  233. //页面加载函数
  234. componentWillMount() {
  235. this.loadData();
  236. },
  237. //搜索
  238. search() {
  239. this.setState({
  240. //signBillVisible:false
  241. });
  242. this.loadData();
  243. },
  244. //导出
  245. exportExec() {
  246. var data = {
  247. name: this.state.customerName ? this.state.customerName : undefined, //客户名称
  248. adminName: this.state.adminName ? this.state.adminName : undefined, //订单负责人
  249. orderNo: this.state.orderNo ? this.state.orderNo : undefined, //订单编号
  250. starTime: this.state.releaseDate[0]
  251. ? this.state.releaseDate[0]
  252. : undefined,
  253. endTime: this.state.releaseDate[1]
  254. ? this.state.releaseDate[1]
  255. : undefined,
  256. tStarTime: this.state.chufaDate[0]
  257. ? this.state.chufaDate[0]
  258. : undefined,
  259. tEndTime: this.state.chufaDate[1] ? this.state.chufaDate[1] : undefined,
  260. depId: this.state.departmenttSearch,
  261. pageSize: 9999,
  262. };
  263. window.location.href =
  264. globalConfig.context +
  265. "/api/admin/newOrder/exportArrearsDunListData?" +
  266. $.param(data);
  267. },
  268. //重置
  269. reset() {
  270. this.state.orderNo = "";
  271. this.state.customerName = "";
  272. this.state.adminName = "";
  273. this.state.departmenttSearch = undefined;
  274. this.state.releaseDate[0] = undefined;
  275. this.state.releaseDate[1] = undefined;
  276. this.state.chufaDate[1] = undefined;
  277. this.state.chufaDate[0] = undefined;
  278. this.loadData();
  279. },
  280. changeList(arr) {
  281. const newArr = [];
  282. this.state.columns.forEach(item => {
  283. arr.forEach(val => {
  284. if (val === item.title) {
  285. newArr.push(item);
  286. }
  287. });
  288. });
  289. this.setState({
  290. changeList: newArr
  291. });
  292. },
  293. render() {
  294. const formItemLayout = {
  295. labelCol: { span: 8 },
  296. wrapperCol: { span: 14 },
  297. };
  298. const FormItem = Form.Item;
  299. const { RangePicker } = DatePicker;
  300. const rowSelection = {
  301. selectedRowKeys: this.state.selectedRowKeys,
  302. onChange: (selectedRowKeys, selectedRows) => {
  303. this.setState({
  304. modalVisible: false,
  305. selectedRows: selectedRows.slice(-1),
  306. selectedRowKeys: selectedRowKeys.slice(-1),
  307. });
  308. },
  309. onSelect: (recordt) => {
  310. this.setState({
  311. modalVisible: false,
  312. recordt: recordt.id,
  313. });
  314. },
  315. };
  316. const { TabPane } = Tabs;
  317. return (
  318. <div className="user-content">
  319. <ShowModalDiv ShowModal={this.state.showModal} />
  320. <div className="content-title" style={{ marginBottom: 10 }}>
  321. <span style={{ fontWeight: 900, fontSize: 16 }}>欠款催收列表</span>
  322. </div>
  323. <div className="user-search">
  324. <Tabs
  325. defaultActiveKey="1"
  326. onChange={this.callback}
  327. className="test"
  328. >
  329. <TabPane tab="搜索" key="1">
  330. <Input
  331. placeholder="客户名称"
  332. style={{
  333. width: "150px",
  334. marginBottom: "10px",
  335. marginLeft: 10,
  336. marginRight: 10,
  337. }}
  338. value={this.state.customerName}
  339. onChange={(e) => {
  340. this.setState({ customerName: e.target.value });
  341. }}
  342. />
  343. <Input
  344. placeholder="订单编号"
  345. style={{ width: "150px", marginRight: 10 }}
  346. value={this.state.orderNo}
  347. onChange={(e) => {
  348. this.setState({ orderNo: e.target.value });
  349. }}
  350. />
  351. <Input
  352. placeholder="营销员名称"
  353. style={{
  354. width: "150px",
  355. marginBottom: "10px",
  356. marginRight: 10,
  357. }}
  358. value={this.state.adminName}
  359. onChange={(e) => {
  360. this.setState({ adminName: e.target.value });
  361. }}
  362. />
  363. <DepartmentList
  364. value={this.state.departmenttSearch}
  365. onChange={e => {
  366. this.setState({ departmenttSearch: e });
  367. }}/>
  368. <span style={{ marginRight: "10px" }}>下单时间 :</span>
  369. <RangePicker
  370. value={[
  371. this.state.releaseDate[0]
  372. ? moment(this.state.releaseDate[0])
  373. : null,
  374. this.state.releaseDate[1]
  375. ? moment(this.state.releaseDate[1])
  376. : null,
  377. ]}
  378. onChange={(data, dataString) => {
  379. this.setState({ releaseDate: dataString });
  380. }}
  381. />
  382. <span style={{ marginRight: "10px", marginLeft: 10 }}>触发时间 :</span>
  383. <RangePicker
  384. value={[
  385. this.state.chufaDate[0]
  386. ? moment(this.state.chufaDate[0])
  387. : null,
  388. this.state.chufaDate[1]
  389. ? moment(this.state.chufaDate[1])
  390. : null,
  391. ]}
  392. onChange={(data, dataString) => {
  393. this.setState({ chufaDate: dataString });
  394. }}
  395. />
  396. <Button
  397. type="primary"
  398. onClick={this.search}
  399. style={{ marginLeft: "10px", marginRight: 10 }}
  400. >
  401. 搜索
  402. </Button>
  403. <Button onClick={this.reset}>重置</Button>
  404. </TabPane>
  405. <TabPane tab="导出催款列表" key="2">
  406. <Button
  407. type="primary"
  408. onClick={this.exportExec}
  409. style={{ marginBottom: 10, marginTop: 10, marginLeft: 10 }}
  410. >
  411. 导出催款列表
  412. </Button>
  413. </TabPane>
  414. <TabPane tab="更改表格显示数据" key="3">
  415. <div style={{ marginLeft: 10 }}>
  416. <ChooseList
  417. columns={this.state.columns}
  418. changeFn={this.changeList}
  419. changeList={this.state.changeList}
  420. top={55}
  421. margin={11}
  422. />
  423. </div>
  424. </TabPane>
  425. </Tabs>
  426. <div className="patent-table">
  427. <Spin spinning={this.state.loading}>
  428. <Table
  429. columns={
  430. this.state.changeList
  431. ? this.state.changeList
  432. : this.state.columns
  433. }
  434. dataSource={this.state.dataSource}
  435. pagination={this.state.pagination}
  436. scroll={{ x: "max-content", y: 0 }}
  437. bordered
  438. size="small"
  439. />
  440. </Spin>
  441. </div>
  442. </div>
  443. </div>
  444. );
  445. },
  446. })
  447. );
  448. export default ArrearsList;