|
@@ -10,6 +10,9 @@ import {
|
|
|
Input,
|
|
|
Cascader,
|
|
|
Select,
|
|
|
+ InputNumber,
|
|
|
+ AutoComplete,
|
|
|
+ Tag
|
|
|
} from "antd";
|
|
|
import $ from "jquery/src/ajax";
|
|
|
import AddContact from "../../../customer/NEW/signCustomer/followDetail/addContact";
|
|
@@ -194,6 +197,9 @@ const ContactPerson = React.createClass({
|
|
|
dataArrar: [],
|
|
|
newintroduction: "",
|
|
|
newtype: 0,
|
|
|
+ enterpriseCount: 0,
|
|
|
+ channelIndicators: "",
|
|
|
+ cooperationProjects: [],
|
|
|
};
|
|
|
},
|
|
|
//tab2删除
|
|
@@ -334,7 +340,11 @@ const ContactPerson = React.createClass({
|
|
|
locationProvince: (data.province || "") + (!data.city ? "" : "-") + (data.city || "") + (!data.area ? "" : "-") + (data.area || ""),
|
|
|
introduction: this.props.data.introduction,
|
|
|
type: this.props.data.type,
|
|
|
+ enterpriseCount: this.props.data.enterpriseCount,
|
|
|
+ channelIndicators: this.props.data.channelIndicators,
|
|
|
+ intendedProject: this.props.data.intendedProject,
|
|
|
});
|
|
|
+ this.queryByUid(this.props.data.id)
|
|
|
},
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
// if (nextProps.data.id && nextProps.contactState) {
|
|
@@ -342,6 +352,84 @@ const ContactPerson = React.createClass({
|
|
|
this.contactLists(nextProps.data.id);
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ // 查询企业信息
|
|
|
+ queryByUid() {
|
|
|
+ this.setState({
|
|
|
+ loading: true
|
|
|
+ });
|
|
|
+ $.ajax({
|
|
|
+ method: "get",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/api/admin/userArchives/queryByUid",
|
|
|
+ data: {
|
|
|
+ id: this.props.data.id,
|
|
|
+ },
|
|
|
+ success: function (data) {
|
|
|
+ if (data.error.length || data.data.list == "") {
|
|
|
+ if (data.error && data.error.length) {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.setState({
|
|
|
+ interviewDistribution: data.data.interviewDistribution,
|
|
|
+ interviewIdeas: data.data.interviewIdeas,
|
|
|
+ // detail: data.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }.bind(this)
|
|
|
+ }).always(
|
|
|
+ function () {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ }.bind(this)
|
|
|
+ );
|
|
|
+ },
|
|
|
+
|
|
|
+ supervisor(value) {
|
|
|
+ $.ajax({
|
|
|
+ method: "get",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + '/api/admin/order/getBusinessProjectByName',
|
|
|
+ data: {
|
|
|
+ businessName: value
|
|
|
+ },
|
|
|
+ success: function (data) {
|
|
|
+ let thedata = data.data;
|
|
|
+ if (data.error.length === 0) {
|
|
|
+ this.setState({
|
|
|
+ cooperationProjects: thedata,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ }
|
|
|
+ }.bind(this),
|
|
|
+ }).always(
|
|
|
+ function () {
|
|
|
+
|
|
|
+ }.bind(this)
|
|
|
+ );
|
|
|
+ },
|
|
|
+ onSelect(value) {
|
|
|
+ let arr = this.state.cooperationProjects.filter(v => v.id === value);
|
|
|
+ let arr1 = this.state.dataArrar.filter(v => v.value === value);
|
|
|
+ if (arr.length > 0) {
|
|
|
+ if (arr1.length > 0) {
|
|
|
+ message.warning('选项已存在');
|
|
|
+ } else {
|
|
|
+ this.state.dataArrar.push({
|
|
|
+ label: arr[0].bname,
|
|
|
+ value: arr[0].id,
|
|
|
+ })
|
|
|
+ this.setState({
|
|
|
+ dataArrar: this.state.dataArrar
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
// 修改渠道名称
|
|
|
onOk() {
|
|
|
if (!this.state.newname) {
|
|
@@ -377,7 +465,7 @@ const ContactPerson = React.createClass({
|
|
|
},
|
|
|
// 修改信息
|
|
|
updateDate() {
|
|
|
- const { dataArrar, visible, newintroduction, newtype } = this.state;
|
|
|
+ const { dataArrar, visible, newintroduction, newtype, newenterpriseCount, newchannelIndicators, newinterviewIdeas, newinterviewDistribution } = this.state;
|
|
|
if (dataArrar.length === 0 && visible == "city") {
|
|
|
message.warning("请选择省-市-区");
|
|
|
return;
|
|
@@ -390,6 +478,26 @@ const ContactPerson = React.createClass({
|
|
|
message.warning("请选择渠道类别");
|
|
|
return;
|
|
|
}
|
|
|
+ if (!newenterpriseCount && newenterpriseCount != 0 && visible == "enterpriseCount") {
|
|
|
+ message.warning("请输入渠道覆盖企业数");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!newchannelIndicators && visible == "channelIndicators") {
|
|
|
+ message.warning("请输入渠道考核标准");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (dataArrar.length == 0 && visible == "intendedProject") {
|
|
|
+ message.warning("请输入面谈项目");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!newinterviewIdeas && visible == "interviewIdeas") {
|
|
|
+ message.warning("请输入面谈思路及目的");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!newinterviewDistribution && visible == "interviewDistribution") {
|
|
|
+ message.warning("请输入我方主要面谈及分工");
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.setState({
|
|
|
loading: true,
|
|
|
});
|
|
@@ -407,8 +515,32 @@ const ContactPerson = React.createClass({
|
|
|
if (visible == "type") {
|
|
|
data.channelType = newtype;
|
|
|
}
|
|
|
+ if (visible == "enterpriseCount") {
|
|
|
+ data.enterpriseCount = newenterpriseCount;
|
|
|
+ }
|
|
|
+ if (visible == "channelIndicators") {
|
|
|
+ data.channelIndicators = newchannelIndicators
|
|
|
+ }
|
|
|
+ if (visible == "intendedProject") {
|
|
|
+ let arr = [];
|
|
|
+ for (let i of dataArrar) {
|
|
|
+ arr.push(i.label)
|
|
|
+ }
|
|
|
+ data.intendedProject = arr.join(',')
|
|
|
+ }
|
|
|
+ if (visible == "interviewIdeas") {
|
|
|
+ data.interviewIdeas = newinterviewIdeas
|
|
|
+ }
|
|
|
+ if (visible == "interviewDistribution") {
|
|
|
+ data.interviewDistribution = newinterviewDistribution
|
|
|
+ }
|
|
|
$.ajax({
|
|
|
- url: globalConfig.context + "/api/admin/customer/updateUserDate",
|
|
|
+ url: globalConfig.context +
|
|
|
+ visible == "channelIndicators"
|
|
|
+ ? "/api/admin/userArchives/update" : visible == "enterpriseCount"
|
|
|
+ ? "/api/admin/userArchives/update" : visible == "interviewIdeas"
|
|
|
+ ? "/api/admin/userArchives/update" : visible == "interviewDistribution"
|
|
|
+ ? "/api/admin/userArchives/update" : "/api/admin/customer/updateUserDate",
|
|
|
method: "post",
|
|
|
data: data,
|
|
|
}).done(
|
|
@@ -440,6 +572,35 @@ const ContactPerson = React.createClass({
|
|
|
type: newtype,
|
|
|
});
|
|
|
}
|
|
|
+ if (visible == "enterpriseCount") {
|
|
|
+ this.setState({
|
|
|
+ enterpriseCount: newenterpriseCount,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (visible == "channelIndicators") {
|
|
|
+ this.setState({
|
|
|
+ channelIndicators: newchannelIndicators,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (visible == "intendedProject") {
|
|
|
+ let arr = [];
|
|
|
+ for (let i of dataArrar) {
|
|
|
+ arr.push(i.label)
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ intendedProject: arr.join(',')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (visible == "interviewIdeas") {
|
|
|
+ this.setState({
|
|
|
+ interviewIdeas: newinterviewIdeas,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (visible == "interviewDistribution") {
|
|
|
+ this.setState({
|
|
|
+ interviewDistribution: newinterviewDistribution,
|
|
|
+ });
|
|
|
+ }
|
|
|
} else {
|
|
|
message.warning(data.error[0].message);
|
|
|
}
|
|
@@ -447,6 +608,11 @@ const ContactPerson = React.createClass({
|
|
|
);
|
|
|
},
|
|
|
|
|
|
+ handleCloseCooperation(removedTag) {
|
|
|
+ let dataArrar = this.state.dataArrar.filter(tag => { return tag.value !== removedTag.value });
|
|
|
+ this.setState({ dataArrar });
|
|
|
+ },
|
|
|
+
|
|
|
render() {
|
|
|
const { visible } = this.state;
|
|
|
return (
|
|
@@ -535,7 +701,37 @@ const ContactPerson = React.createClass({
|
|
|
onClick={() => {
|
|
|
this.setState({
|
|
|
visible: "introduction",
|
|
|
- newintroduction: [],
|
|
|
+ newintroduction: "",
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 修改
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ <div style={{ padding: "5px 0" }}>
|
|
|
+ <span>渠道覆盖企业数:{this.state.enterpriseCount}</span>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ style={{ marginLeft: "20px" }}
|
|
|
+ onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ visible: "enterpriseCount",
|
|
|
+ newenterpriseCount: "",
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 修改
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ <div style={{ padding: "5px 0" }}>
|
|
|
+ <span>渠道考核指标:{this.state.channelIndicators}</span>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ style={{ marginLeft: "20px" }}
|
|
|
+ onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ visible: "channelIndicators",
|
|
|
+ newchannelIndicators: "",
|
|
|
});
|
|
|
}}
|
|
|
>
|
|
@@ -561,6 +757,68 @@ const ContactPerson = React.createClass({
|
|
|
/>
|
|
|
</Spin>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div style={{
|
|
|
+ fontSize: 14,
|
|
|
+ marginTop: 20,
|
|
|
+ }}>
|
|
|
+ <div style={{ fontWeight: "bold", marginBottom: 5, color: "#58A3FF" }}>面谈的渠道情况</div>
|
|
|
+ <div style={{ fontWeight: "bold", marginTop: 10 }}>
|
|
|
+ 面谈项目
|
|
|
+ {
|
|
|
+ !this.props.isCustomerAdmin &&
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ visible: "intendedProject",
|
|
|
+ dataArrar: [],
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 修改
|
|
|
+ </Button>
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ <div style={{ fontSize: 12, }}>{this.state.intendedProject || "无"}</div>
|
|
|
+ <div style={{ fontWeight: "bold", marginTop: 10 }}>
|
|
|
+ 面谈思路及目的
|
|
|
+ {
|
|
|
+ !this.props.isCustomerAdmin &&
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ visible: "interviewIdeas",
|
|
|
+ newinterviewIdeas: "",
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 修改
|
|
|
+ </Button>
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ <div style={{ fontSize: 12, }}>{this.state.interviewIdeas || "无"}</div>
|
|
|
+ <div style={{ fontWeight: "bold", marginTop: 10 }}>
|
|
|
+ 我方主要面谈人及分工
|
|
|
+ {
|
|
|
+ !this.props.isCustomerAdmin &&
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ visible: "interviewDistribution",
|
|
|
+ newinterviewDistribution: "",
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 修改
|
|
|
+ </Button>
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ <div style={{ fontSize: 12, }}>{this.state.interviewDistribution || "无"}</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
{/* 新增联系人 */}
|
|
|
<AddContact
|
|
|
addcontactModul={this.state.addcontactModul}
|
|
@@ -694,7 +952,139 @@ const ContactPerson = React.createClass({
|
|
|
</div>
|
|
|
</div>
|
|
|
)}
|
|
|
-
|
|
|
+ {visible == "enterpriseCount" && (
|
|
|
+ <div className="enterpriseNameContent">
|
|
|
+ <div className="enterpriseNameItem">
|
|
|
+ <div className="enterpriseNameTitle">更改前:</div>
|
|
|
+ <div className="enterpriseNameValue">{this.state.enterpriseCount}</div>
|
|
|
+ </div>
|
|
|
+ <div className="enterpriseNameItem">
|
|
|
+ <div className="enterpriseNameTitle">更改后:</div>
|
|
|
+ <div className="enterpriseNameValue">
|
|
|
+ <InputNumber
|
|
|
+ value={this.state.newenterpriseCount}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({
|
|
|
+ newenterpriseCount: e,
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ {visible == "channelIndicators" && (
|
|
|
+ <div className="enterpriseNameContent">
|
|
|
+ <div className="enterpriseNameItem">
|
|
|
+ <div className="enterpriseNameTitle">更改前:</div>
|
|
|
+ <div className="enterpriseNameValue">
|
|
|
+ {this.state.channelIndicators}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className="enterpriseNameItem">
|
|
|
+ <div className="enterpriseNameTitle">更改后:</div>
|
|
|
+ <div className="enterpriseNameValue">
|
|
|
+ <TextArea
|
|
|
+ style={{ width: "200px" }}
|
|
|
+ value={this.state.newchannelIndicators}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({
|
|
|
+ newchannelIndicators: e.target.value,
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ {visible == "intendedProject" && (
|
|
|
+ <div className="enterpriseNameContent">
|
|
|
+ <div className="enterpriseNameItem">
|
|
|
+ <div className="enterpriseNameTitle">意向合作项目:</div>
|
|
|
+ <div className="enterpriseNameValue">
|
|
|
+ {this.state.intendedProject}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className="enterpriseNameItem">
|
|
|
+ <div className="enterpriseNameTitle">更改后:</div>
|
|
|
+ <div className="enterpriseNameValue">
|
|
|
+ <div style={{ paddingBottom: this.state.dataArrar.length === 0 ? 0 : '10px' }}>
|
|
|
+ {this.state.dataArrar.map((tag, index) => {
|
|
|
+ const isLongTag = tag.label.length > 20;
|
|
|
+ const tagElem = (
|
|
|
+ <Tag closable key={tag.label} afterClose={() => this.handleCloseCooperation(tag)}>
|
|
|
+ {isLongTag ? `${tag.label.slice(0, 20)}...` : tag.label}
|
|
|
+ </Tag>
|
|
|
+ );
|
|
|
+ return isLongTag ? <Tooltip title={tag.label} key={tag.label}>{tagElem}</Tooltip> : tagElem;
|
|
|
+ })}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <AutoComplete
|
|
|
+ style={{ width: 200 }}
|
|
|
+ onSearch={this.supervisor}
|
|
|
+ onSelect={this.onSelect}
|
|
|
+ placeholder="请输入关键字"
|
|
|
+ >
|
|
|
+ {
|
|
|
+ this.state.cooperationProjects.map(function (item) {
|
|
|
+ return <Select.Option key={item.id} value={item.id}>{item.bname}</Select.Option>
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </AutoComplete>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ {visible == "interviewIdeas" && (
|
|
|
+ <div className="enterpriseNameContent">
|
|
|
+ <div className="enterpriseNameItem">
|
|
|
+ <div className="enterpriseNameTitle">更改前:</div>
|
|
|
+ <div className="enterpriseNameValue">
|
|
|
+ {this.state.interviewIdeas}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className="enterpriseNameItem">
|
|
|
+ <div className="enterpriseNameTitle">更改后:</div>
|
|
|
+ <div className="enterpriseNameValue">
|
|
|
+ <TextArea
|
|
|
+ style={{ width: "200px" }}
|
|
|
+ value={this.state.newinterviewIdeas}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({
|
|
|
+ newinterviewIdeas: e.target.value,
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ {visible == "interviewDistribution" && (
|
|
|
+ <div className="enterpriseNameContent">
|
|
|
+ <div className="enterpriseNameItem">
|
|
|
+ <div className="enterpriseNameTitle">更改前:</div>
|
|
|
+ <div className="enterpriseNameValue">
|
|
|
+ {this.state.interviewDistribution}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className="enterpriseNameItem">
|
|
|
+ <div className="enterpriseNameTitle">更改后:</div>
|
|
|
+ <div className="enterpriseNameValue">
|
|
|
+ <TextArea
|
|
|
+ style={{ width: "200px" }}
|
|
|
+ value={this.state.newinterviewDistribution}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({
|
|
|
+ newinterviewDistribution: e.target.value,
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
<Popconfirm
|
|
|
placement="top"
|
|
|
title="确定要修改吗?"
|