index.jsx 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. import React, { Component } from "react";
  2. import TabelContent from "../../../common/tabelContent";
  3. import LegalRecd from "../collectioning/legalRecd";
  4. import DunningRecord from "../../order/pressMoney/dunningRecord";
  5. import { Form, Button, message } from "antd";
  6. import $ from "jquery/src/ajax";
  7. class CompletedLegalAffairs extends Component {
  8. constructor(props) {
  9. super(props);
  10. this.state = {
  11. columns: [
  12. {
  13. title: "序号",
  14. dataIndex: "key",
  15. key: "key",
  16. width: 45,
  17. },
  18. {
  19. title: "合同编号",
  20. dataIndex: "contractNo",
  21. key: "contractNo",
  22. width: 70,
  23. },
  24. {
  25. title: "客户名称",
  26. dataIndex: "buyerName",
  27. key: "buyerName",
  28. width: 150,
  29. },
  30. {
  31. title: "订单负责人",
  32. dataIndex: "salesmanName",
  33. key: "salesmanName",
  34. width: 120,
  35. },
  36. {
  37. title: "订单部门",
  38. dataIndex: "depName",
  39. key: "depName",
  40. width: 120,
  41. },
  42. {
  43. title: "签单金额(万元)",
  44. dataIndex: "totalAmount",
  45. key: "totalAmount",
  46. width: 80,
  47. },
  48. {
  49. title: "已收款(万元)",
  50. dataIndex: "settlementAmount",
  51. key: "settlementAmount",
  52. width: 80,
  53. },
  54. {
  55. title: "欠款(万元)",
  56. dataIndex: "orderArrears",
  57. key: "orderArrears",
  58. width: 80,
  59. },
  60. {
  61. title: "法务类型",
  62. dataIndex: "type",
  63. key: "type",
  64. width: 80,
  65. },
  66. {
  67. title: "法务时间",
  68. dataIndex: "operationDate",
  69. key: "operationDate",
  70. width: 125,
  71. },
  72. {
  73. title: "操作",
  74. dataIndex: "id",
  75. key: "id",
  76. width: 290,
  77. render: (text, record, index) => {
  78. let _this = this;
  79. return (
  80. <div style={{ display: "flex", alignItems: "center" }}>
  81. <Button
  82. disabled={record.daysRemaining === 0}
  83. type="primary"
  84. style={{ marginRight: "10px" }}
  85. onClick={(e) => {
  86. this.setState({
  87. visible: true,
  88. dataInfor: record,
  89. });
  90. }}
  91. >
  92. 催款记录
  93. </Button>
  94. {/* 法务记录 */}
  95. <Button
  96. type="primary"
  97. style={{ marginRight: "10px" }}
  98. onClick={(e) => {
  99. e.stopPropagation();
  100. this.setState({
  101. visibleRecd: true,
  102. dataInfor: record,
  103. });
  104. }}
  105. >
  106. 法务记录
  107. </Button>
  108. </div>
  109. );
  110. },
  111. },
  112. ],
  113. searchList: [
  114. {
  115. type: "text",
  116. dataKey: "userName",
  117. placeholder: "请输入客户名称",
  118. },
  119. {
  120. type: "text",
  121. dataKey: "contractNo",
  122. placeholder: "请输入合同编号",
  123. },
  124. {
  125. type: "autoComplete",
  126. dataKey: "aid",
  127. api: "/api/admin/customer/listAdminByName",
  128. search: "adminName",
  129. placeholder: "请输入营销人名称",
  130. },
  131. {
  132. type: "newDepartmentSelect",
  133. dataKey: "deps",
  134. placeholder: "请选择订单部门",
  135. },
  136. {
  137. type: "times",
  138. title: "法务时间",
  139. dataKey: ["startTime", "endTime"],
  140. },
  141. {
  142. type: "types",
  143. title: "法务类型",
  144. dataKey: "status",
  145. placeholder: "请选择法务类型",
  146. },
  147. ],
  148. visibleRecd: false,
  149. visible: false,
  150. adminHid:"inline-block"
  151. };
  152. this.onFresh = this.onFresh.bind(this);
  153. }
  154. onFresh() {
  155. this.setState({
  156. visibleRecd: false,
  157. });
  158. this.tabelContentRef && this.tabelContentRef.onRefresh();
  159. }
  160. componentDidMount() {
  161. if(!adminData.isLegal) {
  162. this.setState({
  163. adminHid:"none"
  164. })
  165. // console.log(adminData.isLegal);
  166. }
  167. }
  168. render() {
  169. return (
  170. <div className="user-content signatureStatistics">
  171. <div className="content-title">
  172. <span>已完成法务</span>
  173. </div>
  174. <TabelContent
  175. ref={(ref) => (this.tabelContentRef = ref)}
  176. scroll={{ x: 0, y: 1000 }}
  177. searchList={this.state.searchList}
  178. columns={this.state.columns}
  179. tabelApi={"/api/admin/lagalAffairs/orderList"}
  180. exportApi={"/api/admin/lagalAffairs/orderList/Exprot"}
  181. query={{ type: 3 }}
  182. //修改type类型
  183. exportExecProcessing={(data) => {
  184. data.type = 3;
  185. return data;
  186. }}
  187. dataProcessing={(data) => {
  188. let theArr = [];
  189. for (let i = 0; i < data.data.list.length; i++) {
  190. let thisdata = data.data.list[i];
  191. thisdata.key = i + 1;
  192. let status;
  193. if (thisdata.status == 0) {
  194. status = "否";
  195. } else if (thisdata.status == 1) {
  196. status = "已回款";
  197. } else if (thisdata.status == 2) {
  198. status = "已诉讼";
  199. } else if (thisdata.status == 3) {
  200. status = "已坏账处理";
  201. }
  202. // console.log(status);
  203. //
  204. if (thisdata.type == 0) {
  205. thisdata.type = "法务催收中";
  206. } else if (thisdata.type == 1) {
  207. thisdata.type = "延期法务";
  208. } else if (thisdata.type == 2) {
  209. thisdata.type = `已完成法务/${status || ''}`;
  210. } else if (thisdata.type == 3) {
  211. thisdata.type = "自动转交";
  212. } else if (thisdata.type == 4) {
  213. thisdata.type = "营销转交";
  214. }
  215. theArr.push(thisdata);
  216. }
  217. return theArr;
  218. }}
  219. onRowClick={this.tableRowClick}
  220. />
  221. {this.state.visibleRecd && (
  222. <LegalRecd
  223. hid={this.state.adminHid}
  224. searchList={this.state.searchList}
  225. dataInfor={this.state.dataInfor}
  226. onFresh={this.onFresh}
  227. visibleRecd={this.state.visibleRecd}
  228. modelBack={this.modelBack}
  229. onCancel={() => {
  230. this.setState({
  231. visibleRecd: false,
  232. dataInfor: {},
  233. });
  234. }}
  235. />
  236. )}
  237. {this.state.visible ? (
  238. <DunningRecord
  239. hid={"none"}
  240. dataInfor={this.state.dataInfor}
  241. visible={this.state.visible}
  242. onCancel={() => {
  243. this.setState({
  244. visible: false,
  245. dataInfor: {},
  246. });
  247. }}
  248. />
  249. ) : (
  250. ""
  251. )}
  252. </div>
  253. );
  254. }
  255. }
  256. export default CompletedLegalAffairs;