|
@@ -32,7 +32,16 @@ const VisitDetail = React.createClass({
|
|
|
dataIndex: 'followSituation',
|
|
|
key: 'followSituation',
|
|
|
render: (text, record, index) => {
|
|
|
- return <span>{getfllowSituation(text)}</span>
|
|
|
+ return <div>
|
|
|
+ {!record.readOnly?<Select placeholder="选择最新进度" value={record.followSituation} onChange={(e) => { record.followSituation = e; this.setState({ data: this.state.data }); }}>
|
|
|
+ {
|
|
|
+ newFollow.map(function (item) {
|
|
|
+ return <Select.Option key={item.value} >{item.key}</Select.Option>
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </Select>:
|
|
|
+ <span>{getfllowSituation(text)}</span>}
|
|
|
+ </div>
|
|
|
}
|
|
|
}, {
|
|
|
title: '最新状态',
|
|
@@ -40,7 +49,16 @@ const VisitDetail = React.createClass({
|
|
|
dataIndex: 'customerStatus',
|
|
|
key: 'customerStatus',
|
|
|
render: (text, record, index) => {
|
|
|
- return <span>{getcustomerStatue(text)}</span>
|
|
|
+ return <div>
|
|
|
+ {!record.readOnly?<Select value={record.customerStatus} placeholder="选择最新状态" onChange={(e) => { record.customerStatus = e; this.setState({ data: this.state.data }); }}>
|
|
|
+ {
|
|
|
+ customerStatus.map(function (item) {
|
|
|
+ return <Select.Option key={item.value} >{item.key}</Select.Option>
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </Select>:
|
|
|
+ <span>{getcustomerStatue(text)}</span>}
|
|
|
+ </div>
|
|
|
}
|
|
|
}, {
|
|
|
title: '跟进说明',
|
|
@@ -48,23 +66,9 @@ const VisitDetail = React.createClass({
|
|
|
dataIndex: 'remarks',
|
|
|
key: 'remarks',
|
|
|
render: (text, record, index) => {
|
|
|
- return(
|
|
|
- <div>
|
|
|
- <span title={text}>{text&&text.length>14?(text.substr(0,14)+'…'):text}</span>
|
|
|
- </div>
|
|
|
- )
|
|
|
- }
|
|
|
- }, {
|
|
|
- title: '操作',
|
|
|
- width:120,
|
|
|
- dataIndex: 'rrr',
|
|
|
- key: 'rrr',
|
|
|
- render: (text, record, index) => {
|
|
|
- return <div>
|
|
|
- <Popconfirm title="是否删除?" onConfirm={(e)=>{this.intentionDelet(record,index)}} okText="删除" cancelText="不删除">
|
|
|
- <Button style={{marginRight:'10px',color:'#ffffff',background:'#f00',border:'none'}}>删除</Button>
|
|
|
- </Popconfirm>
|
|
|
- </div>
|
|
|
+ return <Input value={record.remarks} placeholder="跟进说明"
|
|
|
+ onChange={(e) => { record.remarks = e.target.value; this.setState({ data: this.state.data }); }}
|
|
|
+ />
|
|
|
}
|
|
|
}
|
|
|
],
|
|
@@ -96,12 +100,14 @@ const VisitDetail = React.createClass({
|
|
|
for(let i = 0; i < data.data.userBusinessList.length; i++) {
|
|
|
let thisdata = data.data.userBusinessList[i];
|
|
|
theArr.push({
|
|
|
- id: thisdata.businessId,
|
|
|
+ key:i,
|
|
|
+ readOnly:this.props.followData.readOnly,
|
|
|
+ id: thisdata.ufbId,
|
|
|
businessName:thisdata.businessProjectId,
|
|
|
businessVarietiesName:thisdata.businessVarietiesName,
|
|
|
businessProjectName:thisdata.businessProjectName,
|
|
|
- followSituation: String(thisdata.followSituation),
|
|
|
- customerStatus: String(thisdata.customerStatus),
|
|
|
+ followSituation: thisdata.followSituation==null?undefined : String(thisdata.followSituation),
|
|
|
+ customerStatus: thisdata.customerStatus==null?undefined : String(thisdata.customerStatus),
|
|
|
remarks: thisdata.remarks,
|
|
|
});
|
|
|
};
|
|
@@ -109,7 +115,7 @@ const VisitDetail = React.createClass({
|
|
|
followIds: thedata.followId,
|
|
|
contacts: thedata.contacts,
|
|
|
uid: thedata.uid,
|
|
|
- dataBus: theArr,
|
|
|
+ data: theArr,
|
|
|
result: thedata.result,
|
|
|
contactMobile:thedata.contactMobile,
|
|
|
contactType: parseInt(thedata.contactType),
|
|
@@ -179,6 +185,27 @@ const VisitDetail = React.createClass({
|
|
|
let conts = this.state.lastName;
|
|
|
contactsId = this.state.contactsIdArr[conts].id;
|
|
|
}
|
|
|
+ let GlossoryId=false;
|
|
|
+ this.state.data.map(function(item) {
|
|
|
+ if(!item.followSituation||!item.customerStatus||!item.businessName) {
|
|
|
+ GlossoryId = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(this.state.data.length&&GlossoryId) {
|
|
|
+ message.warning("项目名称/最新进度/最新状态不能为空!")
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+ let dataList=this.state.data,
|
|
|
+ idsList=[];
|
|
|
+ dataList.map((item,index) => {
|
|
|
+ idsList.push({
|
|
|
+ ufbId:item.id||'',
|
|
|
+ businessProjectId:item.businessName,
|
|
|
+ customerStatus:item.customerStatus,
|
|
|
+ followSituation:item.followSituation,
|
|
|
+ remarks:item.remarks||''
|
|
|
+ })
|
|
|
+ });
|
|
|
//新增
|
|
|
$.ajax({
|
|
|
method: "post",
|
|
@@ -186,7 +213,7 @@ const VisitDetail = React.createClass({
|
|
|
url: globalConfig.context + '/api/admin/customer/updateFollow',
|
|
|
data: {
|
|
|
followId: this.state.followIds,
|
|
|
- userBusinessList: JSON.stringify(this.state.data),
|
|
|
+ userBusinessList: JSON.stringify(idsList),
|
|
|
uid: this.state.uid,
|
|
|
contactType: this.state.contactType,
|
|
|
result: this.state.result,
|
|
@@ -288,10 +315,9 @@ const VisitDetail = React.createClass({
|
|
|
<div className="clearfix">
|
|
|
<Spin spinning={this.state.loading}>
|
|
|
<Table
|
|
|
- rowKey={record => record.id}
|
|
|
pagination={false}
|
|
|
columns={this.state.intentionList}
|
|
|
- dataSource={this.state.dataBus}
|
|
|
+ dataSource={this.state.data}
|
|
|
/>
|
|
|
</Spin>
|
|
|
</div>
|