|
@@ -9,13 +9,16 @@ import {
|
|
|
Modal,
|
|
|
Input,
|
|
|
Cascader,
|
|
|
+ Select,
|
|
|
} from "antd";
|
|
|
-const TextArea = Input.TextArea;
|
|
|
import $ from "jquery/src/ajax";
|
|
|
import AddContact from "../../../customer/NEW/signCustomer/followDetail/addContact";
|
|
|
import "./index.less";
|
|
|
import { areaSelect, getProvince } from "@/NewDicProvinceList";
|
|
|
|
|
|
+const TextArea = Input.TextArea;
|
|
|
+const Option = Select.Option;
|
|
|
+
|
|
|
const ContactPerson = React.createClass({
|
|
|
getInitialState() {
|
|
|
return {
|
|
@@ -175,6 +178,13 @@ const ContactPerson = React.createClass({
|
|
|
},
|
|
|
},
|
|
|
],
|
|
|
+ channeOb: [
|
|
|
+ { name: "政府部门", val: 1 },
|
|
|
+ { name: "民主党派", val: 2 },
|
|
|
+ { name: "园区", val: 3 },
|
|
|
+ { name: "民间组织", val: 4 },
|
|
|
+ { name: "其他战略合作单位", val: 5 },
|
|
|
+ ],
|
|
|
visible: "", //修改弹窗状态
|
|
|
name: "",
|
|
|
locationProvince: "",
|
|
@@ -182,6 +192,7 @@ const ContactPerson = React.createClass({
|
|
|
newname: "",
|
|
|
dataArrar: [],
|
|
|
newintroduction: "",
|
|
|
+ newtype: 0,
|
|
|
};
|
|
|
},
|
|
|
//tab2删除
|
|
@@ -324,6 +335,7 @@ const ContactPerson = React.createClass({
|
|
|
"-" +
|
|
|
this.props.data.area,
|
|
|
introduction: this.props.data.introduction,
|
|
|
+ type: this.props.data.type,
|
|
|
});
|
|
|
},
|
|
|
componentWillReceiveProps(nextProps) {
|
|
@@ -332,6 +344,7 @@ const ContactPerson = React.createClass({
|
|
|
this.contactLists(nextProps.data.id);
|
|
|
}
|
|
|
},
|
|
|
+ // 修改渠道名称
|
|
|
onOk() {
|
|
|
if (!this.state.newname) {
|
|
|
message.warning("请输入渠道名称");
|
|
@@ -364,9 +377,9 @@ const ContactPerson = React.createClass({
|
|
|
}.bind(this)
|
|
|
);
|
|
|
},
|
|
|
-
|
|
|
+ // 修改信息
|
|
|
updateDate() {
|
|
|
- const { dataArrar, visible, newintroduction } = this.state;
|
|
|
+ const { dataArrar, visible, newintroduction, newtype } = this.state;
|
|
|
if (dataArrar.length === 0 && visible == "city") {
|
|
|
message.warning("请选择省-市-区");
|
|
|
return;
|
|
@@ -375,6 +388,10 @@ const ContactPerson = React.createClass({
|
|
|
message.warning("请输入简介");
|
|
|
return;
|
|
|
}
|
|
|
+ if (newtype == 0 && visible == "type") {
|
|
|
+ message.warning("请选择渠道类别");
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.setState({
|
|
|
loading: true,
|
|
|
});
|
|
@@ -389,6 +406,9 @@ const ContactPerson = React.createClass({
|
|
|
if (visible == "introduction") {
|
|
|
data.introduction = newintroduction;
|
|
|
}
|
|
|
+ if (visible == "type") {
|
|
|
+ data.channelType = newtype;
|
|
|
+ }
|
|
|
$.ajax({
|
|
|
url: globalConfig.context + "/api/admin/customer/updateUserDate",
|
|
|
method: "post",
|
|
@@ -417,6 +437,11 @@ const ContactPerson = React.createClass({
|
|
|
introduction: newintroduction,
|
|
|
});
|
|
|
}
|
|
|
+ if (visible == "type") {
|
|
|
+ this.setState({
|
|
|
+ type: newtype,
|
|
|
+ });
|
|
|
+ }
|
|
|
} else {
|
|
|
message.warning(data.error[0].message);
|
|
|
}
|
|
@@ -464,6 +489,30 @@ const ContactPerson = React.createClass({
|
|
|
</div>
|
|
|
<div style={{ padding: "5px 0" }}>
|
|
|
<span>
|
|
|
+ 渠道类别:{[
|
|
|
+ "",
|
|
|
+ "政府部门",
|
|
|
+ "民主党派",
|
|
|
+ "园区",
|
|
|
+ "民间组织",
|
|
|
+ "其他战略合作单位",
|
|
|
+ ][this.state.type]}
|
|
|
+ </span>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ style={{ marginLeft: "20px" }}
|
|
|
+ onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ visible: "type",
|
|
|
+ newtype: "",
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 修改
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ <div style={{ padding: "5px 0" }}>
|
|
|
+ <span>
|
|
|
省-市-区:
|
|
|
{this.state.locationProvince}
|
|
|
</span>
|
|
@@ -612,6 +661,41 @@ const ContactPerson = React.createClass({
|
|
|
</div>
|
|
|
</div>
|
|
|
)}
|
|
|
+ {visible == "type" && (
|
|
|
+ <div className="enterpriseNameContent">
|
|
|
+ <div className="enterpriseNameItem">
|
|
|
+ <div className="enterpriseNameTitle">更改前:</div>
|
|
|
+ <div className="enterpriseNameValue">
|
|
|
+ {[
|
|
|
+ "",
|
|
|
+ "政府部门",
|
|
|
+ "民主党派",
|
|
|
+ "园区",
|
|
|
+ "民间组织",
|
|
|
+ "其他战略合作单位",
|
|
|
+ ][this.state.type]}</div>
|
|
|
+ </div>
|
|
|
+ <div className="enterpriseNameItem">
|
|
|
+ <div className="enterpriseNameTitle">更改后:</div>
|
|
|
+ <div className="enterpriseNameValue">
|
|
|
+ <Select
|
|
|
+ style={{ width: 165 }}
|
|
|
+ placeholder="请选择"
|
|
|
+ value={this.state.newtype == 0 ? undefined : this.state.newtype}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({
|
|
|
+ newtype: e,
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {this.state.channeOb.map(it => (
|
|
|
+ <Option key={it.val}>{it.name}</Option>
|
|
|
+ ))}
|
|
|
+ </Select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
|
|
|
<Popconfirm
|
|
|
placement="top"
|