import React from "react";
import $ from "jquery/src/ajax";
import { AutoComplete, Button, Input, Spin, Table, DatePicker, Select, message, Tabs, Form, Tooltip, Modal } from "antd";
import { ChooseList } from "../../order/orderNew/chooseList"
import moment from "moment";
import ShowModalDiv from "@/showModal.jsx";
import { ShowModal, getStopStatus } from '@/tools';
import Cascaders from "../../../common/cascaders";
import MySuspend from '../../../common/mysuspend';
import MySuspendLog from '../../../common/logPopup/mysuspendlog';
const { TabPane } = Tabs;
const { RangePicker } = DatePicker;
const FormItem = Form.Item;
//项目暂停&重启审核
const SuspendExamine = React.createClass({
//
getInitialState() {
return {
visible: false,
pageNo: 1,
totalPage: 0,
searchValues: {},//查询条件
loading: false,
changeList: undefined,// 子组件改变的表格title数组
pagination: {
defaultCurrent: 1,
defaultPageSize: 10,
showQuickJumper: true,
pageSize: 10,
onChange: function (page) {
this.setState({
pageNo: page,
});
this.loadData(page);
}.bind(this),
showTotal: function (total) {
return "共" + total + "条数据";
},
},
columns: [
{
title: "时间",
dataIndex: "createTimes",
key: "createTimes",
width: 80,
},
{
title: "省份",
dataIndex: "province",
key: "province"
},
{
title: "合同编号",
dataIndex: "contractNo",
key: "contractNo",
render: (text, record) => {
return (
{
e.stopPropagation();
let input = document.getElementById("copyText");
input.value = text;
input.select();
document.execCommand("copy");
message.success("复制成功");
}}
>
复制
}
>
{text}
);
},
},
{
title: "订单编号",
dataIndex: "orderNo",
key: "orderNo"
},
{
title: "签单客户",
dataIndex: "userName",
key: "userName"
},
{
title: "项目类型",
dataIndex: "cname",
key: "cname"
},
{
title: "项目名称",
dataIndex: "projectName",
key: "projectName"
},
{
title: "数量",
dataIndex: "commodityQuantity",
key: "commodityQuantity",
width: 50,
},
{
title: "服务类型",
dataIndex: "serviceType",
key: "serviceType"
},
{
title: "咨询师/咨询经理",
dataIndex: "receiverName",
key: "receiverName"
},
{
title: "项目状态",
dataIndex: "stopStatus",
key: "stopStatus",
render: (value, record) => (
{getStopStatus(record.stopType, value)}
{
value == 0 &&
}
)
},
{
title: "项目金额",
dataIndex: "commodityPrice",
key: "commodityPrice"
},
{
title: "原因",
dataIndex: "reason",
key: "reason",
width: 250,
},
{
title: "日志",
dataIndex: "rz",
key: "rz",
width: 90,
render: (text, record) => (
)
}
],
dataSource: [],
rowData: {},
};
},
componentWillMount() {
this.loadData();
},
// 列表数据
loadData(pageNo, pageSize) {
const { searchValues, pagination } = this.state
this.setState({
loading: true,
});
let datas = Object.assign(searchValues, {
pageNo: pageNo || 1,
pageSize: pageSize || 10,
shiroType: 1, // 审核
});
$.ajax({
method: "get",
dataType: "json",
crossDomain: false,
url: globalConfig.context + "/api/admin/orderProject/selectProjectStop",
data: datas,
success: function (data) {
ShowModal(this);
this.setState({
loading: false,
});
if (data.error && data.error.length === 0) {
if (data.data.list) {
pagination.current = data.data.pageNo;
pagination.total = data.data.totalCount;
if (data.data && data.data.list && !data.data.list.length) {
pagination.current = 0;
pagination.total = 0;
}
this.setState({
dataSource: data.data.list,
pagination: this.state.pagination,
pageNo: data.data.pageNo,
totalPage: data.data.totalPage,
});
} else {
this.setState({
dataSource: data.data,
pagination: false,
});
}
} else {
message.warning(data.error[0].message);
}
}.bind(this),
}).always(
function () {
this.setState({
loading: false,
});
}.bind(this)
);
},
// 更改表格显示数据
changeList(arr) {
const newArr = [];
this.state.columns.forEach((item) => {
arr.forEach((val) => {
if (val === item.title) {
newArr.push(item);
}
});
});
this.setState({
changeList: newArr,
});
},
// 查询订单负责人列表
followUp(e) {
const { searchValues } = this.state;
this.setState({
searchValues: Object.assign(searchValues, {
aname: e,
}),
});
$.ajax({
method: "get",
dataType: "json",
crossDomain: false,
url: globalConfig.context + "/api/admin/customer/listAdminByName",
data: {
adminName: e,
},
success: function (data) {
let thedata = data.data;
if (!thedata) {
if (data.error && data.error.length) {
message.warning(data.error[0].message);
}
thedata = {};
}
this.setState({
fjlist: thedata,
});
}.bind(this),
}).always(
function () {
this.setState({
loading: false,
});
}.bind(this)
);
},
// 选中订单负责人
selectF(value) {
const { searchValues, fjlist } = this.state;
const newdataSources = JSON.stringify(fjlist) == "{}" ? [] : fjlist;
this.setState({
searchValues: Object.assign(searchValues, {
receiverId: newdataSources.find((item) => item.name == value).id,
}),
});
},
// 失去焦点
blurChange(e) {
let theType = "";
let contactLists = this.state.customerArr || [];
if (e) {
contactLists.map(function (item) {
if (item.name == e.toString()) {
theType = item.id;
}
});
}
this.setState({
theTypes: theType,
});
},
// 双击行
tableRowClick(record) {
this.setState({
visible: true,
rowData: record,
})
},
// 搜索
search() {
this.setState({
selectedRowKeys: []
})
this.loadData();
},
// 重置
reset() {
this.setState({
pageNo: 1,
searchValues: JSON.parse(JSON.stringify({})),
}, () => {
this.Cascaders.empty();
this.loadData();
})
},
render() {
const { searchValues, rowData } = this.state
const dataSources = this.state.fjlist || [];
const options = dataSources.map((group) => (
{group.name}
));
return (
{ this.setState({ showModal: false }) }} />
审核暂停&重启项目
{
searchValues["orderNo"] = e.target.value;
this.setState({
searchValues: searchValues,
});
}}
/>
{
searchValues["contractNo"] = e.target.value;
this.setState({
searchValues: searchValues,
});
}}
/>
{
searchValues["userName"] = e.target.value;
this.setState({
searchValues: searchValues,
});
}}
/>
this.Cascaders = node}
placeholder="订单部门"
id="id"
name="name"
children="list"
height={28}
onSel={(e) => {
searchValues["deps"] = JSON.stringify(e);
this.setState({
searchValues: searchValues,
});
}}
/>
{
searchValues["projectName"] = e.target.value;
this.setState({
searchValues: searchValues,
});
}}
/>
{
this.setState({
searchValues: Object.assign(searchValues, {
startTime: dataString[0],
endTime: dataString[1],
}),
});
}}
/>
{
// 项目详情
this.state.visible &&
{
this.loadData(this.state.pageNo);
this.setState({
visible: false,
rowData: {},
})
}}
/>
}
);
},
});
export default SuspendExamine;