| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405 | 
							- import React, { Component } from "react";
 
- import TabelContent from "../../../common/tabelContent";
 
- import LegalRecd from "../collectioning/legalRecd";
 
- import DunningRecord from "../../order/pressMoney/dunningRecord";
 
- import { Form, Button, message, Modal, Icon, Input } from "antd";
 
- import $ from "jquery/src/ajax";
 
- import dayjs from "dayjs";
 
- const { TextArea } = Input;
 
- const formItemLayout = {
 
-   labelCol: {
 
-     xs: { span: 24 },
 
-     sm: { span: 6 },
 
-   },
 
-   wrapperCol: {
 
-     xs: { span: 24 },
 
-     sm: { span: 14 },
 
-   },
 
- };
 
- class DelayLegalAffairs extends Component {
 
-   constructor(props) {
 
-     super(props);
 
-     this.state = {
 
-       columns: [
 
-         {
 
-           title: "序号",
 
-           dataIndex: "key",
 
-           key: "key",
 
-           width: 45,
 
-         },
 
-         {
 
-           title: "合同编号",
 
-           dataIndex: "contractNo",
 
-           key: "contractNo",
 
-           width: 70,
 
-         },
 
-         {
 
-           title: "客户名称",
 
-           dataIndex: "buyerName",
 
-           key: "buyerName",
 
-           width: 150,
 
-         },
 
-         {
 
-           title: "订单负责人",
 
-           dataIndex: "salesmanName",
 
-           key: "salesmanName",
 
-           width: 120,
 
-         },
 
-         {
 
-           title: "订单部门",
 
-           dataIndex: "depName",
 
-           key: "depName",
 
-           width: 120,
 
-         },
 
-         {
 
-           title: "签单金额(万元)",
 
-           dataIndex: "totalAmount",
 
-           key: "totalAmount",
 
-           width: 80,
 
-         },
 
-         {
 
-           title: "已收款(万元)",
 
-           dataIndex: "settlementAmount",
 
-           key: "settlementAmount",
 
-           width: 80,
 
-         },
 
-         {
 
-           title: "欠款(万元)",
 
-           dataIndex: "orderArrears",
 
-           key: "orderArrears",
 
-           width: 80,
 
-         },
 
-         {
 
-           title: "法务类型",
 
-           dataIndex: "type",
 
-           key: "type",
 
-           width: 80,
 
-         },
 
-         {
 
-           title: "法务时间",
 
-           dataIndex: "operationDate",
 
-           key: "operationDate",
 
-           width: 125,
 
-         },
 
-         {
 
-           title: "操作",
 
-           dataIndex: "id",
 
-           key: "id",
 
-           width: 290,
 
-           render: (text, record, index) => {
 
-             let _this = this;
 
-             return (
 
-               <div style={{ display: "flex", alignItems: "center" }}>
 
-                 {/* <Button
 
-                   disabled={record.daysRemaining === 0}
 
-                   type="primary"
 
-                   style={{ marginRight: "10px" }}
 
-                   onClick={(e) => {
 
-                     // alert(123)
 
-                     console.log(e);
 
-                   }}
 
-                 >
 
-                   查看催款凭证
 
-                 </Button> */}
 
-                 <Button
 
-                   type="primary"
 
-                   style={{ marginRight: "10px", display: this.state.adminHid }}
 
-                   onClick={(e) => {
 
-                     e.stopPropagation();
 
-                     // console.log();
 
-                     this.setState({
 
-                       visibleTransfer: true,
 
-                       orderNoTransfer: record.orderNo,
 
-                     });
 
-                   }}
 
-                 >
 
-                   重启催款
 
-                 </Button>
 
-                 <Button
 
-                   type="primary"
 
-                   style={{ marginRight: "10px" }}
 
-                   onClick={(e) => {
 
-                     e.stopPropagation();
 
-                     console.log(record);
 
-                     this.setState({
 
-                       visible: true,
 
-                       dataInfor: record,
 
-                     });
 
-                   }}
 
-                 >
 
-                   催款记录
 
-                 </Button>
 
-                 {/* 法务记录 */}
 
-                 <Button
 
-                   type="primary"
 
-                   style={{ marginRight: "10px" }}
 
-                   onClick={(e) => {
 
-                     e.stopPropagation();
 
-                     console.log(record);
 
-                     this.setState({
 
-                       visibleRecd: true,
 
-                       dataInfor: record,
 
-                     });
 
-                   }}
 
-                 >
 
-                   法务记录
 
-                 </Button>
 
-               </div>
 
-             );
 
-           },
 
-         },
 
-       ],
 
-       searchList: [
 
-         {
 
-           type: "text",
 
-           dataKey: "userName",
 
-           placeholder: "请输入客户名称",
 
-         },
 
-         {
 
-           type: "text",
 
-           dataKey: "contractNo",
 
-           placeholder: "请输入合同编号",
 
-         },
 
-         {
 
-           type: "autoComplete",
 
-           dataKey: "aid",
 
-           api: "/api/admin/customer/listAdminByName",
 
-           search: "adminName",
 
-           placeholder: "请输入营销人名称",
 
-         },
 
-         {
 
-           type: "departmentSelect",
 
-           dataKey: "depId",
 
-           placeholder: "请选择订单部门",
 
-         },
 
-         {
 
-           type: "times",
 
-           title: "法务时间",
 
-           dataKey: ["startTime", "endTime"],
 
-         },
 
-       ],
 
-       visible: false,
 
-       visibleLegal: false,
 
-       visibleRecd: false,
 
-       orderNoTransfer: "",
 
-       visibleTransfer: false,
 
-       transferKey: 0,
 
-       adminHid: "inline-block",
 
-     };
 
-     this.modelBack = this.modelBack.bind(this);
 
-     this.transfer = this.transfer.bind(this);
 
-     this.onFresh = this.onFresh.bind(this);
 
-   }
 
-   componentDidMount() {
 
-     if (!adminData.isLegal) {
 
-       this.setState({
 
-         adminHid: "none",
 
-       });
 
-     }
 
-   }
 
-   transfer(orderNo) {
 
-     this.setState({
 
-       transferLoading: true,
 
-     });
 
-     if (this.state.remarks == "") {
 
-       message.warning("请填写原因");
 
-     }
 
-     $.ajax({
 
-       method: "post",
 
-       dataType: "json",
 
-       crossDomain: false,
 
-       url: globalConfig.context + "/api/admin/lagalAffairs/addLagalAffairsLog",
 
-       data: {
 
-         orderNo,
 
-         type: 0,
 
-         remarks: this.state.remarks,
 
-         status: 0,
 
-         date: dayjs().format("YYYY-MM-DD"),
 
-       },
 
-       success: function (data) {
 
-         if (data.error.length) {
 
-           message.warning(data.error[0].message);
 
-         } else {
 
-           message.success("重启成功");
 
-           this.setState({
 
-             visibleTransfer: false,
 
-             transferKey: this.state.transferKey + 13,
 
-           });
 
-           this.tabelContentRef && this.tabelContentRef.onRefresh();
 
-         }
 
-       }.bind(this),
 
-     }).done(
 
-       function () {
 
-         this.setState({
 
-           transferLoading: false,
 
-         });
 
-       }.bind(this)
 
-     );
 
-   }
 
-   modelBack() {
 
-     this.setState({
 
-       visibleLegal: true,
 
-     });
 
-   }
 
-   onFresh() {
 
-     this.setState({
 
-       visibleRecd: false,
 
-     });
 
-     this.tabelContentRef && this.tabelContentRef.onRefresh();
 
-   }
 
-   render() {
 
-     return (
 
-       <div className="user-content signatureStatistics">
 
-         <div className="content-title">
 
-           <span>延期法务</span>
 
-         </div>
 
-         <TabelContent
 
-           ref={(ref) => (this.tabelContentRef = ref)}
 
-           scroll={{ x: 0, y: 1000 }}
 
-           searchList={this.state.searchList}
 
-           columns={this.state.columns}
 
-           tabelApi={"/api/admin/lagalAffairs/orderList"}
 
-           exportApi={"/api/admin/lagalAffairs/orderList/Exprot"}
 
-           query={{ type: 2 }}
 
-           //修改type类型
 
-           exportExecProcessing={(data) => {
 
-             data.type = 2;
 
-             return data;
 
-           }}
 
-           dataProcessing={(data) => {
 
-             let theArr = [];
 
-             for (let i = 0; i < data.data.list.length; i++) {
 
-               let thisdata = data.data.list[i];
 
-               thisdata.key = i + 1;
 
-               let status;
 
-               if (thisdata.status == 0) {
 
-                 status = "否";
 
-               } else if (thisdata.status == 1) {
 
-                 status = "已回款";
 
-               } else if (thisdata.status == 2) {
 
-                 status = "已诉讼";
 
-               } else if (thisdata.status == 3) {
 
-                 status = "已坏账处理";
 
-               }
 
-               if (thisdata.type == 0) {
 
-                 thisdata.type = "法务催收中";
 
-               } else if (thisdata.type == 1) {
 
-                 thisdata.type = "延期法务";
 
-               } else if (thisdata.type == 2) {
 
-                 thisdata.type = `已完成法务/${status}`;
 
-               }
 
-               theArr.push(thisdata);
 
-             }
 
-             return theArr;
 
-           }}
 
-           onRowClick={this.tableRowClick}
 
-         />
 
-         <Modal
 
-           visible={this.state.visibleTransfer}
 
-           key={this.state.transferKey + 13}
 
-           onCancel={() => {
 
-             this.setState({
 
-               visibleTransfer: false,
 
-               transferKey: this.state.transferKey + 13,
 
-             });
 
-           }}
 
-           width="550px"
 
-           style={{ color: "red" }}
 
-           footer=""
 
-           className="admin-desc-content"
 
-         >
 
-           <div>
 
-             {" "}
 
-             <Icon
 
-               type="exclamation-circle-o"
 
-               style={{ color: "red", fontSize: "16px" }}
 
-             />
 
-             <span
 
-               style={{
 
-                 color: "red",
 
-                 fontSize: "16px",
 
-                 display: "inline-block",
 
-                 marginLeft: "10px",
 
-               }}
 
-             >
 
-               是否重启催款?
 
-             </span>
 
-           </div>
 
-           <div style={{ margin: "30px 0" }}>
 
-             <Form onSubmit={this.handleSubmit} ref={this.formRef}>
 
-               <Form.Item
 
-                 {...formItemLayout}
 
-                 label="请填写重启原因"
 
-                 name="type"
 
-                 hasFeedback
 
-               >
 
-                 <TextArea
 
-                   rows={4}
 
-                   onChange={(e) => {
 
-                     this.setState({
 
-                       remarks: e.target.value,
 
-                     });
 
-                   }}
 
-                 />
 
-               </Form.Item>
 
-             </Form>
 
-           </div>
 
-           <div style={{ display: "flex", justifyContent: "right" }}>
 
-             <Button
 
-               type="primary"
 
-               loading={this.state.loading}
 
-               onClick={() => this.transfer(this.state.orderNoTransfer)}
 
-             >
 
-               提交
 
-             </Button>
 
-             <Button
 
-               type="dashed"
 
-               style={{ marginLeft: "15px" }}
 
-               onClick={() => {
 
-                 this.setState({
 
-                   visibleTransfer: false,
 
-                   transferKey: this.state.transferKey + 13,
 
-                 });
 
-               }}
 
-             >
 
-               取消
 
-             </Button>
 
-           </div>
 
-         </Modal>
 
-         {this.state.visibleRecd && (
 
-           <LegalRecd
 
-             onFresh={this.onFresh}
 
-             hid={this.state.adminHid}
 
-             searchList={this.state.searchList}
 
-             dataInfor={this.state.dataInfor}
 
-             visibleRecd={this.state.visibleRecd}
 
-             modelBack={this.modelBack}
 
-             onCancel={() => {
 
-               this.setState({
 
-                 visibleRecd: false,
 
-                 dataInfor: {},
 
-               });
 
-             }}
 
-           />
 
-         )}
 
-         {this.state.visible ? (
 
-           <DunningRecord
 
-             hid={"none"}
 
-             dataInfor={this.state.dataInfor}
 
-             visible={this.state.visible}
 
-             onCancel={() => {
 
-               this.setState({
 
-                 visible: false,
 
-                 dataInfor: {},
 
-               });
 
-             }}
 
-           />
 
-         ) : (
 
-           ""
 
-         )}
 
-       </div>
 
-     );
 
-   }
 
- }
 
- export default DelayLegalAffairs;
 
 
  |