|
@@ -1,5 +1,23 @@
|
|
|
import React from 'react';
|
|
|
-import { Radio, Icon, Button, AutoComplete,Cascader,Input, Select,Tabs, Spin, Popconfirm, Table, Switch, message, DatePicker, Upload, Form } from 'antd';
|
|
|
+import {
|
|
|
+ Radio,
|
|
|
+ Icon,
|
|
|
+ Button,
|
|
|
+ AutoComplete,
|
|
|
+ Cascader,
|
|
|
+ Input,
|
|
|
+ Select,
|
|
|
+ Tabs,
|
|
|
+ Spin,
|
|
|
+ Popconfirm,
|
|
|
+ Table,
|
|
|
+ Switch,
|
|
|
+ message,
|
|
|
+ DatePicker,
|
|
|
+ Upload,
|
|
|
+ Form,
|
|
|
+ Modal
|
|
|
+} from 'antd';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
import moment from 'moment';
|
|
@@ -48,26 +66,13 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
for(let i = 0; i < data.data.list.length; i++) {
|
|
|
let thisdata = data.data.list[i];
|
|
|
let diqu=(thisdata.province==null?"":thisdata.province)+(thisdata.city==null?"":"-"+thisdata.city)+(thisdata.area==null?"":"-"+thisdata.area);
|
|
|
- theArr.push({
|
|
|
- key: i,
|
|
|
- id: thisdata.uid,
|
|
|
- type: thisdata.type,
|
|
|
- name: thisdata.name,
|
|
|
- shareType: thisdata.shareType,
|
|
|
- contacts: thisdata.contacts,
|
|
|
- contactMobile: thisdata.contactMobile,
|
|
|
- societyTag: thisdata.societyTag,
|
|
|
- surplusFollowTime: thisdata.surplusFollowTime,
|
|
|
- surplusSignTime: thisdata.surplusSignTime,
|
|
|
- transferTime:
|
|
|
- thisdata.transferTime && thisdata.transferTime.split(" ")[0],
|
|
|
- lastSignTime:
|
|
|
- thisdata.lastSignTime && thisdata.lastSignTime.split(" ")[0],
|
|
|
- lastFollowTime:
|
|
|
- thisdata.lastFollowTime &&
|
|
|
- thisdata.lastFollowTime.split(" ")[0],
|
|
|
- locationProvince: diqu,
|
|
|
- });
|
|
|
+ thisdata.key = i;
|
|
|
+ thisdata.id = thisdata.uid;
|
|
|
+ thisdata.transferTime = thisdata.transferTime && thisdata.transferTime.split(" ")[0];
|
|
|
+ thisdata.lastSignTime = thisdata.lastSignTime && thisdata.lastSignTime.split(" ")[0];
|
|
|
+ thisdata.lastFollowTime = thisdata.lastFollowTime && thisdata.lastFollowTime.split(" ")[0];
|
|
|
+ locationProvince : diqu
|
|
|
+ theArr.push(thisdata);
|
|
|
};
|
|
|
this.state.pagination.current = data.data.pageNo;
|
|
|
this.state.pagination.total = data.data.totalCount;
|
|
@@ -309,7 +314,7 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
this.state.visitModul=false;
|
|
|
this.state.RowData = record;
|
|
|
this.setState({
|
|
|
- selectedRowKeys: [],
|
|
|
+ // selectedRowKeys: [],
|
|
|
modalVisible:true,
|
|
|
basicState:true,
|
|
|
contactState:true,
|
|
@@ -371,6 +376,103 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
changeList: newArr
|
|
|
});
|
|
|
},
|
|
|
+ //上级主管输入框失去焦点是判断客户是否存在
|
|
|
+ selectAuto(value, options) {
|
|
|
+ this.setState({
|
|
|
+ auto: value,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //值改变时请求客户名称
|
|
|
+ httpChange(e) {
|
|
|
+ if (e.length >= 1) {
|
|
|
+ this.supervisor(e);
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ auto: e,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ showConfirm(fn, record) {
|
|
|
+ Modal.confirm({
|
|
|
+ title: "提示",
|
|
|
+ content: (
|
|
|
+ <span style={{ color: "red" }}>
|
|
|
+ 确定要转交以下客户吗?
|
|
|
+ {
|
|
|
+ this.state.selectedRows.map((value,index)=>(
|
|
|
+ <div key={index} style={{marginTop:'5px',color: "#000"}}>
|
|
|
+ {value.name}
|
|
|
+ </div>
|
|
|
+ ))
|
|
|
+ }
|
|
|
+ </span>
|
|
|
+ ),
|
|
|
+ onOk() {
|
|
|
+ fn(record);
|
|
|
+ },
|
|
|
+ onCancel() {},
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //转交
|
|
|
+ changeAssigner() {
|
|
|
+ if (this.state.theTypes) {
|
|
|
+ let changeIds = '';
|
|
|
+ let oldAid = '';
|
|
|
+ for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
|
|
|
+ let rowItem = this.state.selectedRows[idx];
|
|
|
+ if (rowItem.id) {
|
|
|
+ oldAid = rowItem.aid;
|
|
|
+ changeIds = this.state.selectedRows.length-1 === idx ? changeIds +rowItem.id : changeIds + rowItem.id + ',' ;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ method: "get",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/api/admin/customer/transferToOther",
|
|
|
+ data: {
|
|
|
+ uid: changeIds, //这一行数据的ID
|
|
|
+ aid: this.state.theTypes, //指定转交人的ID
|
|
|
+ oldAid: oldAid,
|
|
|
+ operatorType:4
|
|
|
+ },
|
|
|
+ }).done(
|
|
|
+ function (data) {
|
|
|
+ if (!data.error.length) {
|
|
|
+ message.success("转交成功!");
|
|
|
+ this.setState({
|
|
|
+ auto: "",
|
|
|
+ loading: false,
|
|
|
+ selectedRowKeys: [],
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ }
|
|
|
+ this.loadData(
|
|
|
+ Math.min(
|
|
|
+ this.state.ispage == undefined ? 1 : this.state.ispage,
|
|
|
+ Math.ceil((this.state.pagination.total - 1) / 10)
|
|
|
+ )
|
|
|
+ );
|
|
|
+ }.bind(this)
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ message.warning("请输入转交人姓名");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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,
|
|
|
+ });
|
|
|
+ },
|
|
|
render() {
|
|
|
const rowSelection = {
|
|
|
selectedRowKeys: this.state.selectedRowKeys,
|
|
@@ -411,7 +513,7 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
<div className="content-title">
|
|
|
<span>{!intentionState ? "签单客户" : "签单客户"}</span>
|
|
|
</div>
|
|
|
- <Tabs defaultActiveKey="1" onChange={this.callback} className="test">
|
|
|
+ <Tabs defaultActiveKey="1" className="test">
|
|
|
<TabPane tab="搜索" key="1">
|
|
|
<div className="user-search">
|
|
|
<Input
|
|
@@ -486,7 +588,53 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
</span> */}
|
|
|
</div>
|
|
|
</TabPane>
|
|
|
- <TabPane tab="更改表格显示数据" key="2">
|
|
|
+ <TabPane tab="操作" key="2">
|
|
|
+ <div className="user-search">
|
|
|
+ <AutoComplete
|
|
|
+ className="certain-category-search"
|
|
|
+ dropdownClassName="certain-category-search-dropdown"
|
|
|
+ dropdownMatchSelectWidth={false}
|
|
|
+ dropdownStyle={{ width: 120 }}
|
|
|
+ style={{ width: "120px" }}
|
|
|
+ dataSource={options}
|
|
|
+ placeholder="输入转交人姓名"
|
|
|
+ value={this.state.auto}
|
|
|
+ onChange={this.httpChange}
|
|
|
+ filterOption={true}
|
|
|
+ onBlur={this.blurChange}
|
|
|
+ onSelect={this.selectAuto}
|
|
|
+ disabled={!hasSelected}
|
|
|
+ >
|
|
|
+ <Input />
|
|
|
+ </AutoComplete>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ onClick={(e) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ this.showConfirm(this.changeAssigner);
|
|
|
+ }}
|
|
|
+ disabled={!hasSelected}
|
|
|
+ style={{ marginRight: 10 }}
|
|
|
+ >
|
|
|
+ 转交
|
|
|
+ </Button>
|
|
|
+ <Button
|
|
|
+ disabled={this.state.selectedRows.length === 0}
|
|
|
+ type="primary"
|
|
|
+ onClick={()=>{
|
|
|
+ this.setState({
|
|
|
+ defaultActiveKey: '5'
|
|
|
+ },()=>{
|
|
|
+ this.tableRowClick(this.state.selectedRows[0]);
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ style={{ marginLeft: 10 }}
|
|
|
+ >
|
|
|
+ 转交业务
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </TabPane>
|
|
|
+ <TabPane tab="更改表格显示数据" key="3">
|
|
|
<div style={{ marginLeft: 10 }}>
|
|
|
<ChooseList
|
|
|
columns={this.state.columns}
|
|
@@ -497,24 +645,6 @@ const IntentionCustomer = Form.create()(React.createClass({
|
|
|
/>
|
|
|
</div>
|
|
|
</TabPane>
|
|
|
- <TabPane tab="操作" key="3">
|
|
|
- <div className="user-search">
|
|
|
- <Button
|
|
|
- disabled={this.state.selectedRows.length === 0}
|
|
|
- type="primary"
|
|
|
- onClick={()=>{
|
|
|
- this.setState({
|
|
|
- defaultActiveKey: '5'
|
|
|
- },()=>{
|
|
|
- this.tableRowClick(this.state.selectedRows[0]);
|
|
|
- })
|
|
|
- }}
|
|
|
- style={{ marginLeft: 10 }}
|
|
|
- >
|
|
|
- 转交业务
|
|
|
- </Button>
|
|
|
- </div>
|
|
|
- </TabPane>
|
|
|
</Tabs>
|
|
|
<div className="patent-table">
|
|
|
<Spin spinning={this.state.loading}>
|