|
@@ -1,15 +1,15 @@
|
|
|
-import React,{Component} from "react";
|
|
|
-import {AutoComplete, Button, Cascader, message, Modal, Popconfirm, Select, Spin, Table, Tag, Tooltip} from "antd";
|
|
|
-import { areaSelect,getProvince } from '@/NewDicProvinceList';
|
|
|
+import React, { Component } from "react";
|
|
|
+import { AutoComplete, Button, Cascader, Input, message, Modal, Popconfirm, Select, Spin, Table, Tag, Tooltip } from "antd";
|
|
|
+import { areaSelect, getProvince } from '@/NewDicProvinceList';
|
|
|
import $ from "jquery/src/ajax";
|
|
|
import TextArea from "antd/es/input/TextArea";
|
|
|
|
|
|
-class InforChange extends Component{
|
|
|
+class InforChange extends Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
- this.state={
|
|
|
- visible:false,
|
|
|
- changeType:0,
|
|
|
+ this.state = {
|
|
|
+ visible: false,
|
|
|
+ changeType: 0,
|
|
|
colunmn: [
|
|
|
{
|
|
|
title: "操作人名称",
|
|
@@ -20,14 +20,14 @@ class InforChange extends Component{
|
|
|
title: "客户名称",
|
|
|
dataIndex: "name",
|
|
|
key: "name",
|
|
|
- render:(text)=>{
|
|
|
+ render: (text) => {
|
|
|
return (
|
|
|
<Tooltip title={text}>
|
|
|
<div style={{
|
|
|
- maxWidth:'150px',
|
|
|
- overflow:'hidden',
|
|
|
+ maxWidth: '150px',
|
|
|
+ overflow: 'hidden',
|
|
|
textOverflow: "ellipsis",
|
|
|
- whiteSpace:'nowrap',
|
|
|
+ whiteSpace: 'nowrap',
|
|
|
}}>{text}</div>
|
|
|
</Tooltip>
|
|
|
)
|
|
@@ -39,16 +39,16 @@ class InforChange extends Component{
|
|
|
key: "createTimes",
|
|
|
},
|
|
|
],
|
|
|
- dataSource:[],
|
|
|
- inputVisible:false,
|
|
|
- inputValue:'',
|
|
|
+ dataSource: [],
|
|
|
+ inputVisible: false,
|
|
|
+ inputValue: '',
|
|
|
|
|
|
- dataArrar:[],
|
|
|
- cooperationProjects:[],
|
|
|
-
|
|
|
- locationProvince:props.data.locationProvince,
|
|
|
- businessScope:props.data.businessScope,
|
|
|
- intendedProject:props.data.intendedProject
|
|
|
+ dataArrar: [],
|
|
|
+ cooperationProjects: [],
|
|
|
+ orgCode: props.data.orgCode,
|
|
|
+ locationProvince: props.data.locationProvince,
|
|
|
+ businessScope: props.data.businessScope,
|
|
|
+ intendedProject: props.data.intendedProject
|
|
|
}
|
|
|
this.onChange = this.onChange.bind(this);
|
|
|
this.onCancel = this.onCancel.bind(this);
|
|
@@ -62,20 +62,20 @@ class InforChange extends Component{
|
|
|
this.onSelect = this.onSelect.bind(this);
|
|
|
}
|
|
|
|
|
|
- onChange(type){
|
|
|
+ onChange(type) {
|
|
|
this.setState({
|
|
|
- visible:true,
|
|
|
- changeType:type,
|
|
|
+ visible: true,
|
|
|
+ changeType: type,
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- onCancel(){
|
|
|
+ onCancel() {
|
|
|
this.setState({
|
|
|
- visible:false,
|
|
|
- loading:false,
|
|
|
- changeType:0,
|
|
|
+ visible: false,
|
|
|
+ loading: false,
|
|
|
+ changeType: 0,
|
|
|
|
|
|
- dataArrar:[]
|
|
|
+ dataArrar: []
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -98,9 +98,9 @@ class InforChange extends Component{
|
|
|
}
|
|
|
} else {
|
|
|
this.setState({
|
|
|
- initialName:data.data[0] ? data.data[0].name : ''
|
|
|
+ initialName: data.data[0] ? data.data[0].name : ''
|
|
|
})
|
|
|
- data.data.splice(0,1);
|
|
|
+ data.data.splice(0, 1);
|
|
|
this.setState({
|
|
|
dataSource: data.data,
|
|
|
});
|
|
@@ -116,80 +116,92 @@ class InforChange extends Component{
|
|
|
|
|
|
}
|
|
|
|
|
|
- onOk(){
|
|
|
- const {dataArrar} = this.state;
|
|
|
- if(this.state.changeType=== 0 && dataArrar.length === 0){
|
|
|
+ onOk() {
|
|
|
+ const { dataArrar } = this.state;
|
|
|
+ if (this.state.changeType === 3 && !/^[A-Z0-9]{15}$|^[A-Z0-9]{17}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/.test(dataArrar)) {
|
|
|
+ message.warning('请输入正确的统一社会信用代码')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.state.changeType === 0 && dataArrar.length === 0) {
|
|
|
message.warning('请输入省-市-区');
|
|
|
return;
|
|
|
}
|
|
|
- if(this.state.changeType=== 1 && dataArrar.length === 0){
|
|
|
+ if (this.state.changeType === 1 && dataArrar.length === 0) {
|
|
|
message.warning('请输入企业主管产品/服务');
|
|
|
return;
|
|
|
}
|
|
|
- if(this.state.changeType=== 2 && dataArrar.length === 0){
|
|
|
+ if (this.state.changeType === 2 && dataArrar.length === 0) {
|
|
|
message.warning('请输入意向合作项目');
|
|
|
return;
|
|
|
}
|
|
|
this.setState({
|
|
|
loading: true
|
|
|
});
|
|
|
- let data ={
|
|
|
- uid:this.props.enterpriseId,
|
|
|
+ let data = {
|
|
|
+ uid: this.props.enterpriseId,
|
|
|
}
|
|
|
- if(this.state.changeType=== 0){
|
|
|
+ if (this.state.changeType === 0) {
|
|
|
data.province = dataArrar[0] || undefined;
|
|
|
data.city = dataArrar[1] || undefined;
|
|
|
data.area = dataArrar[2] || undefined;
|
|
|
}
|
|
|
- if(this.state.changeType=== 1){
|
|
|
+ if (this.state.changeType === 1) {
|
|
|
data.businessScope = dataArrar.join(',')
|
|
|
}
|
|
|
- if(this.state.changeType=== 2){
|
|
|
+ if (this.state.changeType === 2) {
|
|
|
let arr = [];
|
|
|
- for(let i of dataArrar){
|
|
|
+ for (let i of dataArrar) {
|
|
|
arr.push(i.label)
|
|
|
}
|
|
|
data.intendedProject = arr.join(',')
|
|
|
}
|
|
|
+ if (this.state.changeType === 3) {
|
|
|
+ data.orgCode = dataArrar
|
|
|
+ }
|
|
|
$.ajax({
|
|
|
url: globalConfig.context + "/api/admin/customer/updateUserDate",
|
|
|
method: "post",
|
|
|
data: data
|
|
|
}).done(
|
|
|
- function(data) {
|
|
|
+ function (data) {
|
|
|
this.setState({
|
|
|
loading: false
|
|
|
});
|
|
|
if (data.error.length === 0) {
|
|
|
message.success("恭喜您,更改成功!");
|
|
|
- if(this.state.changeType=== 0){
|
|
|
+ if (this.state.changeType === 0) {
|
|
|
this.setState({
|
|
|
- locationProvince:getProvince(dataArrar[0],dataArrar[1],dataArrar[2])
|
|
|
+ locationProvince: getProvince(dataArrar[0], dataArrar[1], dataArrar[2])
|
|
|
})
|
|
|
}
|
|
|
- if(this.state.changeType=== 1){
|
|
|
+ if (this.state.changeType === 1) {
|
|
|
this.setState({
|
|
|
- businessScope:dataArrar.join(',')
|
|
|
+ businessScope: dataArrar.join(',')
|
|
|
})
|
|
|
}
|
|
|
- if(this.state.changeType=== 2){
|
|
|
+ if (this.state.changeType === 2) {
|
|
|
let arr = [];
|
|
|
- for(let i of dataArrar){
|
|
|
+ for (let i of dataArrar) {
|
|
|
arr.push(i.label)
|
|
|
}
|
|
|
this.setState({
|
|
|
- intendedProject:arr.join(',')
|
|
|
+ intendedProject: arr.join(',')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (this.state.changeType === 3) {
|
|
|
+ this.setState({
|
|
|
+ orgCode: dataArrar
|
|
|
})
|
|
|
}
|
|
|
this.onCancel();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
message.warning(data.error[0].message);
|
|
|
}
|
|
|
}.bind(this)
|
|
|
)
|
|
|
}
|
|
|
|
|
|
- showInput(){
|
|
|
+ showInput() {
|
|
|
let str = this.state.dataArrar.join('/')
|
|
|
this.setState({
|
|
|
inputVisible: true,
|
|
@@ -197,35 +209,35 @@ class InforChange extends Component{
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- handleInputConfirm(){
|
|
|
+ handleInputConfirm() {
|
|
|
let inputValue = this.state.inputValue;
|
|
|
let arr = inputValue.split('/');
|
|
|
let lv = true;
|
|
|
- for(let i of arr){
|
|
|
- if(i.length > 16){
|
|
|
+ for (let i of arr) {
|
|
|
+ if (i.length > 16) {
|
|
|
message.warning('单个标签字数不能超过16个字符')
|
|
|
lv = false;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- if(lv){
|
|
|
+ if (lv) {
|
|
|
arr = Array.from(new Set(arr));
|
|
|
- arr = arr.filter(v=>v);
|
|
|
+ arr = arr.filter(v => v);
|
|
|
this.setState({
|
|
|
- dataArrar:arr,
|
|
|
+ dataArrar: arr,
|
|
|
inputVisible: false,
|
|
|
inputValue: '',
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- handleClose(removedTag){
|
|
|
- let dataArrar = this.state.dataArrar.filter(tag => {return tag !== removedTag});
|
|
|
+ handleClose(removedTag) {
|
|
|
+ let dataArrar = this.state.dataArrar.filter(tag => { return tag !== removedTag });
|
|
|
this.setState({ dataArrar });
|
|
|
}
|
|
|
|
|
|
- handleCloseCooperation(removedTag){
|
|
|
- let dataArrar = this.state.dataArrar.filter(tag => {return tag.value !== removedTag.value});
|
|
|
+ handleCloseCooperation(removedTag) {
|
|
|
+ let dataArrar = this.state.dataArrar.filter(tag => { return tag.value !== removedTag.value });
|
|
|
this.setState({ dataArrar });
|
|
|
}
|
|
|
|
|
@@ -244,7 +256,7 @@ class InforChange extends Component{
|
|
|
this.setState({
|
|
|
cooperationProjects: thedata,
|
|
|
});
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
message.warning(data.error[0].message);
|
|
|
}
|
|
|
}.bind(this),
|
|
@@ -255,19 +267,19 @@ class InforChange extends Component{
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- 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){
|
|
|
+ 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{
|
|
|
+ } else {
|
|
|
this.state.dataArrar.push({
|
|
|
label: arr[0].bname,
|
|
|
value: arr[0].id,
|
|
|
})
|
|
|
this.setState({
|
|
|
- dataArrar:this.state.dataArrar
|
|
|
+ dataArrar: this.state.dataArrar
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -281,50 +293,64 @@ class InforChange extends Component{
|
|
|
marginTop: 20,
|
|
|
}}>
|
|
|
<div style={{
|
|
|
- display:'flex',
|
|
|
- alignItems:'center',
|
|
|
- paddingBottom:'5px'
|
|
|
+ display: 'flex',
|
|
|
+ alignItems: 'center',
|
|
|
+ paddingBottom: '5px'
|
|
|
}}>
|
|
|
- <div style={{width:'123px'}}>省-市-区:</div>
|
|
|
+ <div style={{ width: '123px', color: "#58A3FF" }}>统一社会信用代码:</div>
|
|
|
+ <div style={{ color: "#58A3FF" }}>
|
|
|
+ {
|
|
|
+ !this.state.orgCode ? "待补充" : this.state.orgCode
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ {this.props.type === 'modify' && <Button style={{ marginLeft: '5px' }} type="primary" onClick={(e) => { e.stopPropagation(); this.onChange(3) }}>修改</Button>}
|
|
|
+ {this.props.type === 'modify' && <span style={{ color: "red", marginLeft: 20 }}>如,科德集团则填写91430105670766451M</span>}
|
|
|
+ </div>
|
|
|
+ <div style={{
|
|
|
+ display: 'flex',
|
|
|
+ alignItems: 'center',
|
|
|
+ paddingBottom: '5px'
|
|
|
+ }}>
|
|
|
+ <div style={{ width: '123px' }}>省-市-区:</div>
|
|
|
<div>
|
|
|
{
|
|
|
this.state.locationProvince
|
|
|
}
|
|
|
</div>
|
|
|
- {this.props.type === 'modify' && <Button style={{marginLeft:'5px'}} type="primary" onClick={(e)=>{e.stopPropagation();this.onChange(0)}}>修改</Button>}
|
|
|
+ {this.props.type === 'modify' && <Button style={{ marginLeft: '5px' }} type="primary" onClick={(e) => { e.stopPropagation(); this.onChange(0) }}>修改</Button>}
|
|
|
</div>
|
|
|
<div style={{
|
|
|
- display:'flex',
|
|
|
- alignItems:'center',
|
|
|
- paddingBottom:'5px'
|
|
|
+ display: 'flex',
|
|
|
+ alignItems: 'center',
|
|
|
+ paddingBottom: '5px'
|
|
|
}}>
|
|
|
- <div style={{width:'123px'}}>企业主营产品/服务:</div>
|
|
|
+ <div style={{ width: '123px' }}>企业主营产品/服务:</div>
|
|
|
<div>
|
|
|
{
|
|
|
this.state.businessScope
|
|
|
}
|
|
|
</div>
|
|
|
- {this.props.type === 'modify' && <Button style={{marginLeft:'5px'}} type="primary" onClick={(e)=>{e.stopPropagation();this.onChange(1)}}>修改</Button>}
|
|
|
+ {this.props.type === 'modify' && <Button style={{ marginLeft: '5px' }} type="primary" onClick={(e) => { e.stopPropagation(); this.onChange(1) }}>修改</Button>}
|
|
|
</div>
|
|
|
<div style={{
|
|
|
- display:'flex',
|
|
|
- alignItems:'center',
|
|
|
- paddingBottom:'5px'
|
|
|
+ display: 'flex',
|
|
|
+ alignItems: 'center',
|
|
|
+ paddingBottom: '5px'
|
|
|
}}>
|
|
|
- <div style={{width:'123px'}}>意向合作项目:</div>
|
|
|
+ <div style={{ width: '123px' }}>意向合作项目:</div>
|
|
|
<div>
|
|
|
{
|
|
|
this.state.intendedProject
|
|
|
}
|
|
|
</div>
|
|
|
- {this.props.type === 'modify' && <Button style={{marginLeft:'5px'}} type="primary" onClick={(e)=>{e.stopPropagation();this.onChange(2)}}>修改</Button>}
|
|
|
+ {this.props.type === 'modify' && <Button style={{ marginLeft: '5px' }} type="primary" onClick={(e) => { e.stopPropagation(); this.onChange(2) }}>修改</Button>}
|
|
|
</div>
|
|
|
|
|
|
<Modal
|
|
|
footer={null}
|
|
|
maskClosable={false}
|
|
|
- width={this.props.type === 'journal' ? '1200px': this.props.type === 'modify' ? (this.state.changeType === 0 ? '300px' : '800px'): ''}
|
|
|
- title={this.props.type === 'journal' ? '操作日志': this.props.type === 'modify' ? '信息修改': ''}
|
|
|
+ width={this.props.type === 'journal' ? '1200px' : this.props.type === 'modify' ? '400px' : '800px'}
|
|
|
+ title={this.props.type === 'journal' ? '操作日志' : this.props.type === 'modify' ? '信息修改' : ''}
|
|
|
visible={this.state.visible}
|
|
|
onCancel={this.onCancel}>
|
|
|
<div>
|
|
@@ -335,7 +361,8 @@ class InforChange extends Component{
|
|
|
{
|
|
|
this.state.changeType === 0 ? '省-市-区' :
|
|
|
this.state.changeType === 1 ? '企业主管产品/服务' :
|
|
|
- this.state.changeType === 2 ? '意向合作项目' : ''
|
|
|
+ this.state.changeType === 2 ? '意向合作项目' :
|
|
|
+ this.state.changeType === 3 ? '统一社会信用代码' : ''
|
|
|
}
|
|
|
:
|
|
|
</div>
|
|
@@ -343,7 +370,8 @@ class InforChange extends Component{
|
|
|
{
|
|
|
this.state.changeType === 0 ? this.state.locationProvince :
|
|
|
this.state.changeType === 1 ? this.state.businessScope :
|
|
|
- this.state.changeType === 2 ? this.state.intendedProject : ''
|
|
|
+ this.state.changeType === 2 ? this.state.intendedProject :
|
|
|
+ this.state.changeType === 3 ? this.state.orgCode : ''
|
|
|
}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -352,14 +380,14 @@ class InforChange extends Component{
|
|
|
<div className='enterpriseNameValue'>
|
|
|
{
|
|
|
this.state.changeType === 0 ? <Cascader
|
|
|
- options={areaSelect()}
|
|
|
- placeholder="选择城市"
|
|
|
- onChange={(e, pre) => {
|
|
|
- this.setState({
|
|
|
- dataArrar:e
|
|
|
- })
|
|
|
- }}
|
|
|
- /> :
|
|
|
+ options={areaSelect()}
|
|
|
+ placeholder="选择城市"
|
|
|
+ onChange={(e, pre) => {
|
|
|
+ this.setState({
|
|
|
+ dataArrar: e
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ /> :
|
|
|
this.state.changeType === 1 ?
|
|
|
<div>
|
|
|
<div>
|
|
@@ -384,14 +412,14 @@ class InforChange extends Component{
|
|
|
</div>
|
|
|
{this.state.inputVisible && (<div>
|
|
|
<TextArea
|
|
|
- style={{width:'300px',height:'100px'}}
|
|
|
+ style={{ width: '300px', height: '100px' }}
|
|
|
value={this.state.inputValue}
|
|
|
- onChange={(e)=>{
|
|
|
+ onChange={(e) => {
|
|
|
this.setState({
|
|
|
inputValue: e.target.value
|
|
|
})
|
|
|
- }}/>
|
|
|
- <div style={{color:'#f00'}}>提示:请用 / 符号隔开关键字</div>
|
|
|
+ }} />
|
|
|
+ <div style={{ color: '#f00' }}>提示:请用 / 符号隔开关键字</div>
|
|
|
<div>
|
|
|
<Button
|
|
|
size="small"
|
|
@@ -401,8 +429,8 @@ class InforChange extends Component{
|
|
|
</Button>
|
|
|
<Button
|
|
|
size="small"
|
|
|
- style={{marginLeft:'5px'}}
|
|
|
- onClick={()=>{
|
|
|
+ style={{ marginLeft: '5px' }}
|
|
|
+ onClick={() => {
|
|
|
this.setState({
|
|
|
inputVisible: false,
|
|
|
inputValue: ''
|
|
@@ -416,7 +444,7 @@ class InforChange extends Component{
|
|
|
:
|
|
|
this.state.changeType === 2 ?
|
|
|
<div>
|
|
|
- <div style={{paddingBottom: this.state.dataArrar.length === 0 ? 0 : '10px'}}>
|
|
|
+ <div style={{ paddingBottom: this.state.dataArrar.length === 0 ? 0 : '10px' }}>
|
|
|
{this.state.dataArrar.map((tag, index) => {
|
|
|
const isLongTag = tag.label.length > 20;
|
|
|
const tagElem = (
|
|
@@ -436,13 +464,29 @@ class InforChange extends Component{
|
|
|
>
|
|
|
{
|
|
|
this.state.cooperationProjects.map(function (item) {
|
|
|
- return <Select.Option key={item.id} value={item.id}>{item.bname}</Select.Option>
|
|
|
+ return <Select.Option key={item.id} value={item.id}>{item.bname}</Select.Option>
|
|
|
})
|
|
|
}
|
|
|
</AutoComplete>
|
|
|
</div>
|
|
|
</div>
|
|
|
- : ''
|
|
|
+ :
|
|
|
+ this.state.changeType === 3 ?
|
|
|
+ <div>
|
|
|
+ <div>
|
|
|
+ <Input
|
|
|
+ style={{ width: 200 }}
|
|
|
+ placeholder="请输入统一社会信用代码"
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({
|
|
|
+ dataArrar: e.target.value
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div style={{ color: "red", position: "absolute" }}>如,科德集团则填写91430105670766451M</div>
|
|
|
+ </div>
|
|
|
+ : ''
|
|
|
}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -462,7 +506,7 @@ class InforChange extends Component{
|
|
|
}
|
|
|
{
|
|
|
this.props.type === 'modify' ?
|
|
|
- <Popconfirm placement="top" title="确定要修改吗?" onConfirm={(e)=>{
|
|
|
+ <Popconfirm placement="top" title="确定要修改吗?" onConfirm={(e) => {
|
|
|
e.stopPropagation();
|
|
|
this.onOk();
|
|
|
}} okText="确定" cancelText="取消">
|
|
@@ -472,8 +516,8 @@ class InforChange extends Component{
|
|
|
</Popconfirm> : null
|
|
|
}
|
|
|
</div>
|
|
|
- </Modal>
|
|
|
- </div>
|
|
|
+ </Modal >
|
|
|
+ </div >
|
|
|
)
|
|
|
}
|
|
|
}
|