|
@@ -4,27 +4,31 @@ import {
|
|
|
Button,
|
|
|
Cascader,
|
|
|
DatePicker,
|
|
|
- Icon,
|
|
|
Input,
|
|
|
- message, Modal,
|
|
|
+ message,
|
|
|
Select,
|
|
|
Spin,
|
|
|
Table,
|
|
|
- Tabs,
|
|
|
+ Tabs, Tooltip,
|
|
|
Upload
|
|
|
} from "antd";
|
|
|
import {ChooseList} from "../../../order/orderNew/chooseList";
|
|
|
import $ from "jquery/src/ajax";
|
|
|
import {
|
|
|
getSocialAttribute,
|
|
|
- ShowModal
|
|
|
+ ShowModal,
|
|
|
+ getChannelAllocationStatus
|
|
|
} from "@/tools.js";
|
|
|
+import {
|
|
|
+ channelAllocationStatus
|
|
|
+} from "@/dataDic.js";
|
|
|
import { citySelect, provinceList } from '@/NewDicProvinceList';
|
|
|
import moment from "moment";
|
|
|
import FollowDetail from "./followDetail";
|
|
|
import IntentionDetail from "./intentionDetail/intentionDetail";
|
|
|
import TransferRecords from './transferRecords';
|
|
|
import DuplicateData from './duplicateData';
|
|
|
+import OperationTips from './operationTips';
|
|
|
|
|
|
const {TabPane} = Tabs;
|
|
|
const { RangePicker } = DatePicker;
|
|
@@ -38,6 +42,24 @@ class Channel extends Component{
|
|
|
title: "客户名称",
|
|
|
dataIndex: "userName",
|
|
|
key: "userName",
|
|
|
+ render: (text,record) => {
|
|
|
+ return (
|
|
|
+ <span>
|
|
|
+ {record.status === 5 ? <div style={{
|
|
|
+ background:'#ef7207',
|
|
|
+ color:'#FFF',
|
|
|
+ padding: '1px 7px',
|
|
|
+ borderRadius:'5px',
|
|
|
+ fontSize:'12px',
|
|
|
+ display: 'inline-block',
|
|
|
+ marginRight:'10px'
|
|
|
+ }}>
|
|
|
+ 回收
|
|
|
+ </div> : null}
|
|
|
+ {text}
|
|
|
+ </span>
|
|
|
+ )
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
title: "地区",
|
|
@@ -54,8 +76,8 @@ class Channel extends Component{
|
|
|
},
|
|
|
{
|
|
|
title: "渠道专员",
|
|
|
- dataIndex: "aName",
|
|
|
- key: "aName",
|
|
|
+ dataIndex: "channelName",
|
|
|
+ key: "channelName",
|
|
|
},
|
|
|
{
|
|
|
title: "客户联系人",
|
|
@@ -77,12 +99,9 @@ class Channel extends Component{
|
|
|
dataIndex: "status",
|
|
|
key: "status",
|
|
|
render: (text) => (
|
|
|
- text === 0 ? '未分配' :
|
|
|
- text === 1 ? '已存在' :
|
|
|
- text === 2 ? '已分配' : ''
|
|
|
+ getChannelAllocationStatus(text)
|
|
|
)
|
|
|
},
|
|
|
-
|
|
|
],
|
|
|
changeList:[],
|
|
|
dataSource:[],
|
|
@@ -143,7 +162,6 @@ class Channel extends Component{
|
|
|
visitModul: false,
|
|
|
categoryArr:[],
|
|
|
tabsKey:'',
|
|
|
- reasonsTransfer:''
|
|
|
}
|
|
|
this.loadData = this.loadData.bind(this);
|
|
|
this.search = this.search.bind(this);
|
|
@@ -181,6 +199,16 @@ class Channel extends Component{
|
|
|
|
|
|
if(this.props.followUp){
|
|
|
this.state.columns.push({
|
|
|
+ title: "当前跟进人",
|
|
|
+ dataIndex: "adminName",
|
|
|
+ key: "adminName",
|
|
|
+ render: (text, record) => {
|
|
|
+ return (
|
|
|
+ record.status !== 0 ? text : ''
|
|
|
+ )
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.state.columns.push({
|
|
|
title: "跟进操作",
|
|
|
dataIndex: "abc",
|
|
|
key: "abc",
|
|
@@ -209,45 +237,64 @@ class Channel extends Component{
|
|
|
);
|
|
|
},
|
|
|
});
|
|
|
- this.state.columns.push({
|
|
|
- title: "指导意见",
|
|
|
- dataIndex: "guidance",
|
|
|
- key: "guidance",
|
|
|
- render: (text, record, index) => {
|
|
|
- return (
|
|
|
- <div style={{
|
|
|
- display: 'flex',
|
|
|
- flexFlow:'row',
|
|
|
- alignItems:'center',
|
|
|
- }}>
|
|
|
- {/*指导 0无 1未读 2已读*/}
|
|
|
- {text === 1 || text === 2 ? <Button
|
|
|
- style={text === 1 ? {
|
|
|
- background:'#F00000',
|
|
|
- borderColor:'#F00000'
|
|
|
- } : {}}
|
|
|
- onClick={(e)=>{
|
|
|
- e.stopPropagation();
|
|
|
- this.guidanceRead(record.uid).then(()=>{
|
|
|
- this.setState({
|
|
|
- tabsKey:"4",
|
|
|
- },()=>{
|
|
|
- this.tableRowClick(record)
|
|
|
+ if(this.props.isEditGuidanceLv){
|
|
|
+ this.state.columns.push({
|
|
|
+ title: "指导意见",
|
|
|
+ dataIndex: "guidance",
|
|
|
+ key: "guidance",
|
|
|
+ render: (text, record, index) => {
|
|
|
+ return (
|
|
|
+ <div style={{
|
|
|
+ display: 'flex',
|
|
|
+ flexFlow:'row',
|
|
|
+ alignItems:'center',
|
|
|
+ }}>
|
|
|
+ {/*指导 0无 1未读 2已读*/}
|
|
|
+ {text === 1 || text === 2 ? <Button
|
|
|
+ style={text === 1 ? {
|
|
|
+ background:'#F00000',
|
|
|
+ borderColor:'#F00000'
|
|
|
+ } : {}}
|
|
|
+ onClick={(e)=>{
|
|
|
+ e.stopPropagation();
|
|
|
+ this.guidanceRead(record.uid).then(()=>{
|
|
|
+ this.setState({
|
|
|
+ tabsKey:"4",
|
|
|
+ },()=>{
|
|
|
+ this.tableRowClick(record)
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
- }}
|
|
|
- type="primary"
|
|
|
- >
|
|
|
- {text === 1 ? '未读' : '查看'}
|
|
|
- </Button> : <div>暂无指导</div>}
|
|
|
- </div>
|
|
|
- );
|
|
|
- },
|
|
|
- });
|
|
|
- this.setState({
|
|
|
- columns:this.state.columns
|
|
|
- })
|
|
|
+ }}
|
|
|
+ type="primary"
|
|
|
+ >
|
|
|
+ {text === 1 ? '未读' : '查看'}
|
|
|
+ </Button> : <div>暂无指导</div>}
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
+ this.state.columns.push({
|
|
|
+ title: "备注",
|
|
|
+ dataIndex: "remarks",
|
|
|
+ key: "remarks",
|
|
|
+ render: (text) => {
|
|
|
+ return (
|
|
|
+ <Tooltip placement="topLeft" title={text}>
|
|
|
+ <div style={{
|
|
|
+ maxWidth:'150px',
|
|
|
+ overflow:'hidden',
|
|
|
+ textOverflow: "ellipsis",
|
|
|
+ whiteSpace:'nowrap',
|
|
|
+ }}>{text}</div>
|
|
|
+ </Tooltip>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.setState({
|
|
|
+ columns:this.state.columns
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
visit(e) {
|
|
@@ -267,6 +314,7 @@ class Channel extends Component{
|
|
|
crossDomain: false,
|
|
|
url: globalConfig.context + '/api/admin/customer/listChannelCustomer',
|
|
|
data: {
|
|
|
+ type:this.props.channel ? 1 : undefined,
|
|
|
pageNo: pageNo || 1,
|
|
|
pageSize: this.state.pagination.pageSize,
|
|
|
name: this.state.nameSearch,
|
|
@@ -331,6 +379,8 @@ class Channel extends Component{
|
|
|
addressSearch:[],
|
|
|
releaseDate:[],
|
|
|
statusSearch:undefined,
|
|
|
+ },()=>{
|
|
|
+ this.loadData();
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -494,18 +544,12 @@ class Channel extends Component{
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- showConfirm() {
|
|
|
- this.setState({
|
|
|
- visible:true
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- changeAssigner() {
|
|
|
- if(!this.state.reasonsTransfer){
|
|
|
- message.warning("请输入转交原因");
|
|
|
+ changeAssigner(remarks,type,lv) {
|
|
|
+ if(!remarks){
|
|
|
+ message.warning(type === 1 ? "请输入转交原因" : type === 2 ? "请输入回收原因" : type === 0 ? "请输入分配原因" : "");
|
|
|
return;
|
|
|
}
|
|
|
- if (this.state.theTypes) {
|
|
|
+ if (this.state.theTypes || lv) {
|
|
|
let changeIds = '';
|
|
|
let oldAid = '';
|
|
|
for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
|
|
@@ -523,18 +567,19 @@ class Channel extends Component{
|
|
|
data: {
|
|
|
userIds: changeIds, //这一行数据的ID
|
|
|
receiveId: this.state.theTypes, //指定转交人的ID
|
|
|
- remarks: this.state.reasonsTransfer,
|
|
|
+ remarks: remarks,
|
|
|
+ type,// 0分配 1转交 2回退
|
|
|
},
|
|
|
}).done(
|
|
|
function (data) {
|
|
|
if (!data.error.length) {
|
|
|
- message.success("转交成功!");
|
|
|
+ message.success(type === 1 ? "转交成功!" : type === 2 ? "回收成功!" : type === 0 ? "分配成功!" : "");
|
|
|
this.setState({
|
|
|
auto: "",
|
|
|
loading: false,
|
|
|
selectedRowKeys: [],
|
|
|
- reasonsTransfer:'',
|
|
|
- visible:false
|
|
|
+ visible:false,
|
|
|
+ recoveryVisible: false,
|
|
|
},()=>{
|
|
|
this.loadData(
|
|
|
Math.min(
|
|
@@ -597,24 +642,22 @@ class Channel extends Component{
|
|
|
this.setState({ nameSearch: e.target.value });
|
|
|
}}
|
|
|
/>
|
|
|
- {/*0未分配 1已存在 2已分配*/}
|
|
|
+ {/*0未分配 1已分配 2已存在私有 3已存在公共 4已存在签单*/}
|
|
|
<Select
|
|
|
- placeholder="状态"
|
|
|
+ placeholder="分配状态"
|
|
|
style={{ width: 80 }}
|
|
|
value={this.state.statusSearch}
|
|
|
onChange={(e) => {
|
|
|
this.setState({ statusSearch: e });
|
|
|
}}
|
|
|
>
|
|
|
- <Select.Option value={0}>
|
|
|
- 未分配
|
|
|
- </Select.Option>
|
|
|
- <Select.Option value={1}>
|
|
|
- 已存在
|
|
|
- </Select.Option>
|
|
|
- <Select.Option value={2}>
|
|
|
- 已分配
|
|
|
- </Select.Option>
|
|
|
+ {
|
|
|
+ channelAllocationStatus.map((v,key)=>(
|
|
|
+ <Select.Option value={v.value} key={key}>
|
|
|
+ {v.key}
|
|
|
+ </Select.Option>
|
|
|
+ ))
|
|
|
+ }
|
|
|
</Select>
|
|
|
<Select
|
|
|
placeholder="省"
|
|
@@ -683,37 +726,41 @@ class Channel extends Component{
|
|
|
type="primary"
|
|
|
onClick={(e) => {
|
|
|
e.stopPropagation();
|
|
|
- this.showConfirm();
|
|
|
+ this.setState({
|
|
|
+ visible:true
|
|
|
+ })
|
|
|
}}
|
|
|
disabled={!hasSelected}
|
|
|
style={{ marginRight: 10 }}
|
|
|
>
|
|
|
{this.props.deliver === 1 ? '分配' : '转交'}
|
|
|
</Button> : ''}
|
|
|
- {this.props.deliver === 2 ? <Button
|
|
|
+ {this.props.recovery ? <Button
|
|
|
type="primary"
|
|
|
onClick={(e) => {
|
|
|
e.stopPropagation();
|
|
|
this.setState({
|
|
|
- transferVisible:true,
|
|
|
- transferId: this.state.selectedRows[0].uid
|
|
|
+ recoveryVisible:true
|
|
|
})
|
|
|
}}
|
|
|
- disabled={!hasSelected || this.state.selectedRows.length > 1}
|
|
|
+ disabled={!hasSelected}
|
|
|
style={{ marginRight: 10 }}
|
|
|
>
|
|
|
- 转交记录
|
|
|
+ 回收
|
|
|
</Button> : ''}
|
|
|
- {this.props.recovery ? <Button
|
|
|
+ {this.props.deliver || this.props.recovery ? <Button
|
|
|
type="primary"
|
|
|
onClick={(e) => {
|
|
|
e.stopPropagation();
|
|
|
-
|
|
|
+ this.setState({
|
|
|
+ transferVisible:true,
|
|
|
+ transferId: this.state.selectedRows[0].uid
|
|
|
+ })
|
|
|
}}
|
|
|
- disabled={!hasSelected}
|
|
|
+ disabled={!hasSelected || this.state.selectedRows.length > 1}
|
|
|
style={{ marginRight: 10 }}
|
|
|
>
|
|
|
- 回收
|
|
|
+ 日志
|
|
|
</Button> : ''}
|
|
|
{this.props.channel ? <Upload {...this.state.upLoad}>
|
|
|
<Button
|
|
@@ -780,7 +827,7 @@ class Channel extends Component{
|
|
|
: this.state.columns
|
|
|
}
|
|
|
dataSource={this.state.dataSource}
|
|
|
- rowSelection={this.props.deliver ? rowSelection : ''}
|
|
|
+ rowSelection={this.props.deliver || this.props.recovery ? rowSelection : ''}
|
|
|
pagination={this.state.pagination}
|
|
|
onRowDoubleClick={this.tableRowClick}
|
|
|
/>
|
|
@@ -812,54 +859,51 @@ class Channel extends Component{
|
|
|
this.setState({
|
|
|
duplicateData:[],
|
|
|
duplicateDataVisible: false
|
|
|
+ },()=>{
|
|
|
+ this.loadData();
|
|
|
})
|
|
|
}}
|
|
|
/> : null}
|
|
|
- {this.state.transferVisible ? <TransferRecords
|
|
|
+ {this.state.transferVisible || this.state.returnVisible ? <TransferRecords
|
|
|
+ type={this.state.transferVisible ? (this.props.deliver === 1 ? 0 : 1) : this.state.returnVisible ? 2 : 0}
|
|
|
id={this.state.transferId}
|
|
|
- visible={this.state.transferVisible}
|
|
|
+ visible={this.state.transferVisible || this.state.returnVisible}
|
|
|
cancel={()=>{
|
|
|
this.setState({
|
|
|
transferVisible:false,
|
|
|
+ returnVisible: false,
|
|
|
transferId:''
|
|
|
})
|
|
|
}}
|
|
|
/> : '' }
|
|
|
- <Modal
|
|
|
- title="渠道客户转交"
|
|
|
+ {/*渠道客户转交*/}
|
|
|
+ {this.state.visible ? <OperationTips
|
|
|
+ title={'渠道客户转交'}
|
|
|
+ selectedRows={this.state.selectedRows}
|
|
|
visible={this.state.visible}
|
|
|
- onOk={()=>{
|
|
|
- this.changeAssigner()
|
|
|
+ onOk={(value)=>{
|
|
|
+ // 0分配 1转交 2回退
|
|
|
+ this.changeAssigner(value,this.props.deliver === 1 ? 0 : this.props.deliver === 2 ? 1 : '')
|
|
|
}}
|
|
|
onCancel={()=>{
|
|
|
this.setState({
|
|
|
- reasonsTransfer:'',
|
|
|
visible:false
|
|
|
})
|
|
|
+ }}/> : ''}
|
|
|
+ {/*渠道客户回收*/}
|
|
|
+ {this.state.recoveryVisible ? <OperationTips
|
|
|
+ title={'渠道客户回收'}
|
|
|
+ selectedRows={this.state.selectedRows}
|
|
|
+ visible={this.state.recoveryVisible}
|
|
|
+ onOk={(value)=>{
|
|
|
+ this.changeAssigner(value,2,true)
|
|
|
+
|
|
|
}}
|
|
|
- >
|
|
|
- <span style={{ color: "red" }}>
|
|
|
- 确定要转交以下客户吗?
|
|
|
- {
|
|
|
- this.state.selectedRows.map((value,index)=>(
|
|
|
- <div key={index} style={{marginTop:'5px',color: "#000"}}>
|
|
|
- {value.userName}
|
|
|
- </div>
|
|
|
- ))
|
|
|
- }
|
|
|
- <div style={{marginTop:20}}>
|
|
|
- <span style={{marginRight:10,color:'#000'}}>转交原因:</span>
|
|
|
- <Input
|
|
|
- placeholder="转交原因"
|
|
|
- value={this.state.reasonsTransfer}
|
|
|
- style={{ width: 150 }}
|
|
|
- onChange={(e) => {
|
|
|
- this.setState({reasonsTransfer : e.target.value });
|
|
|
- }}
|
|
|
- />
|
|
|
- </div>
|
|
|
- </span>
|
|
|
- </Modal>
|
|
|
+ onCancel={()=>{
|
|
|
+ this.setState({
|
|
|
+ recoveryVisible:false
|
|
|
+ })
|
|
|
+ }}/> : ''}
|
|
|
</div>
|
|
|
)
|
|
|
}
|