index.jsx 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. import React,{Component} from "react";
  2. import TabelContent from "../../../common/tabelContent";
  3. import {Button, message,Modal} from "antd";
  4. import $ from "jquery/src/ajax";
  5. import DunningRecord from "./dunningRecord";
  6. const confirm = Modal.confirm;
  7. class PressMoney 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: 140,
  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: "orderReceivables",
  57. key: "orderReceivables",
  58. width: 80,
  59. },
  60. {
  61. title: "欠款(万元)",
  62. dataIndex: "orderArrears",
  63. key: "orderArrears",
  64. width: 80,
  65. },
  66. {
  67. title: "催款启动日期",
  68. dataIndex: "dunStartTimes",
  69. key: "dunStartTimes",
  70. width: 125,
  71. },
  72. {
  73. title: "自动移交法务(天)",
  74. dataIndex: "daysRemaining",
  75. key: "daysRemaining",
  76. width: 80,
  77. render: (text) => {
  78. return (
  79. text === 0 ? '已移交法务' : text+'天'
  80. )
  81. }
  82. },
  83. {
  84. title: "操作",
  85. dataIndex: "id",
  86. key: "id",
  87. width: 250,
  88. render: (text, record, index) => {
  89. let _this = this;
  90. return (
  91. <div style={{display:'flex',alignItems:'center'}}>
  92. <Button
  93. disabled={record.daysRemaining === 0}
  94. type="primary"
  95. style={{marginRight: "10px",}}
  96. onClick={e => {
  97. e.stopPropagation();
  98. confirm({
  99. title: '提醒',
  100. content: '你确定移交法务吗?',
  101. okText:'转交',
  102. cancelText:'取消',
  103. onOk() {
  104. _this.transfer(record.orderNo);
  105. }
  106. });
  107. }}
  108. >
  109. 移交法务
  110. </Button>
  111. <Button
  112. type="primary"
  113. style={{marginRight: "10px",}}
  114. onClick={e => {
  115. e.stopPropagation();
  116. this.setState({
  117. visible:true,
  118. dataInfor:record
  119. })
  120. }}
  121. >
  122. 催款记录
  123. </Button>
  124. <Button
  125. type="primary"
  126. style={{marginRight: "10px",}}
  127. onClick={e => {
  128. e.stopPropagation();
  129. }}
  130. >
  131. 法务记录
  132. </Button>
  133. </div>
  134. )
  135. }
  136. }
  137. ],
  138. searchList:[
  139. {
  140. type:'text',
  141. dataKey:'userName',
  142. placeholder:'请输入客户名称'
  143. },
  144. {
  145. type:'text',
  146. dataKey:'contractNo',
  147. placeholder:'请输入合同编号'
  148. },
  149. {
  150. type:'autoComplete',
  151. dataKey:'aid',
  152. api:'/api/admin/customer/listAdminByName',
  153. search:'adminName',
  154. placeholder:'请输入营销人名称'
  155. },
  156. {
  157. type:'departmentSelect',
  158. dataKey:'depId',
  159. placeholder:'请选择订单部门'
  160. },
  161. {
  162. type:'select',
  163. dataKey:'legalAffairs',
  164. placeholder:'请选择是否移交法务',
  165. selectList:[
  166. {
  167. value:'1',
  168. label:'已移交法务'
  169. },
  170. {
  171. value:'0',
  172. label:'未移交法务'
  173. },
  174. ]
  175. },
  176. {
  177. type:'times',
  178. title:'催款启动',
  179. dataKey:['startTime','endTime'],
  180. },
  181. ],
  182. visible: false
  183. }
  184. this.tabelContentRef=null;
  185. this.transfer = this.transfer.bind(this);
  186. }
  187. transfer(orderNo){
  188. this.setState({
  189. transferLoading: true
  190. });
  191. $.ajax({
  192. method: "post",
  193. dataType: "json",
  194. crossDomain: false,
  195. url:
  196. globalConfig.context + "/api/admin/lagalAffairs/transfer",
  197. data: {
  198. orderNo
  199. },
  200. success: function (data) {
  201. if(data.error.length){
  202. message.warning(data.error[0].message);
  203. }else{
  204. message.success('移交成功');
  205. this.tabelContentRef && this.tabelContentRef.onRefresh();
  206. }
  207. }.bind(this)
  208. }).done(
  209. function () {
  210. this.setState({
  211. transferLoading: false
  212. });
  213. }.bind(this)
  214. );
  215. }
  216. render() {
  217. return(
  218. <div className="user-content signatureStatistics">
  219. <div className="content-title">
  220. <span>
  221. 催款记录
  222. </span>
  223. </div>
  224. <TabelContent
  225. ref={ref => this.tabelContentRef = ref}
  226. scroll={{ x: 0, y: 1000 }}
  227. searchList={this.state.searchList}
  228. columns={this.state.columns}
  229. tabelApi={'/api/admin/lagalAffairs/orderList'}
  230. exportApi={'/api/admin/lagalAffairs/orderList/Exprot'}
  231. query={{type:0}}
  232. exportExecProcessing={(data)=>{
  233. data.type = 0;
  234. return data;
  235. }}
  236. dataProcessing={(data)=>{
  237. let theArr = [];
  238. for (let i = 0; i < data.data.list.length; i++) {
  239. let thisdata = data.data.list[i];
  240. thisdata.key=i + 1;
  241. theArr.push(thisdata);
  242. }
  243. return theArr;
  244. }}
  245. />
  246. {this.state.visible && <DunningRecord
  247. dataInfor={this.state.dataInfor}
  248. visible={this.state.visible}
  249. onCancel={()=>{
  250. this.setState({
  251. visible:false,
  252. dataInfor:{}
  253. })
  254. }}
  255. />}
  256. </div>
  257. )
  258. }
  259. }
  260. export default PressMoney;