import React from 'react';
import { Button, Input, Select, Spin, Table, message, DatePicker, Form, Modal, Tabs, Tooltip } from 'antd';
import $ from 'jquery/src/ajax';
import moment from 'moment';
import { getLiquidationStatus, getjiedian, getNewOrderStatus, getProjectStatus } from '@/tools.js';
import './customer.less';
import { ChooseList } from "./chooseList";
import { getProjectName } from "../../../tools";
import DepartmentList from "../../../common/departmentList";
import Cascaders from "../../../common/cascaders";
const IntentionCustomer = Form.create()(React.createClass({
loadData(pageNo) {
this.setState({
visitModul: false,
loading: true,
ispage: pageNo,
modalVisible: false
});
$.ajax({
method: "get",
dataType: "json",
crossDomain: false,
url: globalConfig.context + "/api/admin/newOrder/dunOrderNewList",
data: {
pageNo: pageNo || 1,
pageSize: this.state.pagination.pageSize,
name: this.state.customerName, //名称
orderNo: this.state.orderNo, //订单编号
deps: this.state.departmenttSearch, //订单部门
adminName: this.state.adminName, //责任人名称
starTime: this.state.releaseDate[0], //开始时间
endTime: this.state.releaseDate[1], //结束时间
newStatus: this.state.newStatus
},
success: function (data) {
let theArr = [];
if (data.error.length || data.data.list == "") {
if (data.error && data.error.length) {
message.warning(data.error[0].message);
}
} else {
for (let i = 0; i < data.data.list.length; i++) {
let thisdata = data.data.list[i];
theArr.push({
key: i + 1,
id: thisdata.id, //ID
orderNo: thisdata.orderNo, //订单编号
totalAmount: thisdata.totalAmount, //签单金额
settlementAmount: thisdata.settlementAmount, //已收款
accountsReceivable: thisdata.accountsReceivable, //应收款
uncollectedAmount: thisdata.uncollectedAmount, //应收款
orderStatus: thisdata.orderStatus, //订单状态
projectStatus: thisdata.projectStatus, //项目状态
liquidationStatus: thisdata.liquidationStatus, //结算状态
signDate: thisdata.signDate, //签单时间
userName: thisdata.userName, //客户名称
salesmanName: thisdata.salesmanName, //营销员名称
dunSubject: thisdata.dunSubject, //催收科目
startDate: thisdata.startDate, //催收启动时间
depName: thisdata.depName, //部门名称
contractNo: thisdata.contractNo,
dunStatus: thisdata.dunStatus == 0 ? "未触发" : "已触发",
commodityName: thisdata.commodityName,
});
}
this.state.pagination.total = data.data.totalCount;
}
if (data.data && data.data.list && !data.data.list.length) {
this.state.pagination.total = 0;
}
this.setState({
dataSource: theArr,
pageNo: pageNo,
pagination: this.state.pagination,
selectedRowKeys: []
});
}.bind(this)
}).always(
function () {
this.setState({
loading: false
});
}.bind(this)
);
},
loadDatas(dunId) {
this.setState({
loading: true,
});
$.ajax({
method: "get",
dataType: "json",
crossDomain: false,
url: globalConfig.context + "/api/admin/newOrder/selectDunLogList",
data: {
dunId: dunId,
},
success: function (data) {
let theArr = [];
if (data.error.length || data.data == "") {
if (data.error && data.error.length) {
message.warning(data.error[0].message);
};
} else {
for (let i = 0; i < data.data.length; i++) {
let thisdata = data.data[i];
theArr.push({
key: i,
id: thisdata.id,//ID
dunId: thisdata.dunId,//催款ID
dumBy: thisdata.dumBy,//催款人
dumTime: thisdata.dumDate,//催款时间
remarks: thisdata.remarks,//备注
});
};
};
this.setState({
dataSources: theArr,
});
}.bind(this),
}).always(function () {
this.setState({
loading: false
});
}.bind(this));
},
getInitialState() {
return {
newStatus: 1,
page: 1,
releaseDate: [],
selectedRowKeys: [],
orgCodeUrl: [],
paginations: false,
pagination: {
defaultCurrent: 1,
defaultPageSize: 10,
showQuickJumper: true,
pageSize: 10,
onChange: function (page) {
this.loadData(page);
}.bind(this),
showTotal: function (total) {
return "共" + total + "条数据";
}
},
columns: [
{
title: "序号",
dataIndex: "key",
key: "key",
fixed: 'left'
},
{
title: "合同编号",
dataIndex: "contractNo",
key: "contractNo",
fixed: 'left'
},
{
title: "订单编号",
dataIndex: "orderNo",
key: "orderNo"
},
{
title: "客户名称",
dataIndex: "userName",
key: "userName",
render: text => {
return (