|
@@ -69,11 +69,6 @@ class ChannelUnit extends Component {
|
|
|
dataIndex: "createTime",
|
|
|
key: "createTime",
|
|
|
},
|
|
|
- // {
|
|
|
- // title: "跟进人",
|
|
|
- // dataIndex: "aName",
|
|
|
- // key: "aName",
|
|
|
- // },
|
|
|
{
|
|
|
title: "操作",
|
|
|
dataIndex: "op",
|
|
@@ -116,18 +111,12 @@ class ChannelUnit extends Component {
|
|
|
areaList: [],
|
|
|
searchInfor: {}, // 查询条件
|
|
|
mvisible: "", //控制弹窗变量
|
|
|
- customerArr: [], //查询到的转交人列表
|
|
|
- rowdata: {}, //双击行数据
|
|
|
- categoryArr: [],
|
|
|
- visitModuls: false,
|
|
|
};
|
|
|
- this.tabelContentRef = null;
|
|
|
- this.autoCompleteSearchRef = {};
|
|
|
+
|
|
|
}
|
|
|
|
|
|
componentWillMount() {
|
|
|
this.loadData();
|
|
|
- this.category();
|
|
|
}
|
|
|
/*单个领取*/
|
|
|
receive(e) {
|
|
@@ -248,70 +237,10 @@ class ChannelUnit extends Component {
|
|
|
}.bind(this)
|
|
|
);
|
|
|
}
|
|
|
- //值改变时请求客户名称
|
|
|
- httpChange(e) {
|
|
|
- if (e.length >= 1) {
|
|
|
- this.supervisor(e);
|
|
|
- }
|
|
|
- this.setState({
|
|
|
- auto: e,
|
|
|
- });
|
|
|
- }
|
|
|
- // 指定转交人自动补全
|
|
|
- supervisor(e) {
|
|
|
- $.ajax({
|
|
|
- method: "get",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/customer/listAdminByName",
|
|
|
- data: {
|
|
|
- adminName: e,
|
|
|
- },
|
|
|
- success: function (data) {
|
|
|
- let thedata = data.data;
|
|
|
- if (!thedata) {
|
|
|
- if (data.error && data.error.length) {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- }
|
|
|
- thedata = {};
|
|
|
- }
|
|
|
- this.setState({
|
|
|
- customerArr: thedata,
|
|
|
- });
|
|
|
- }.bind(this),
|
|
|
- }).always(
|
|
|
- function () {
|
|
|
- this.setState({
|
|
|
- loading: false,
|
|
|
- });
|
|
|
- }.bind(this)
|
|
|
- );
|
|
|
- }
|
|
|
- // 失去焦点
|
|
|
- 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,
|
|
|
- });
|
|
|
- }
|
|
|
// 选择行
|
|
|
onSelectChange(selectedRowKeys) {
|
|
|
this.setState({ selectedRowKeys });
|
|
|
}
|
|
|
- //
|
|
|
- addClick() {
|
|
|
- this.setState({
|
|
|
- mvisible: "add",
|
|
|
- });
|
|
|
- }
|
|
|
// 关闭弹窗
|
|
|
closeDesc() {
|
|
|
this.setState({
|
|
@@ -319,271 +248,6 @@ class ChannelUnit extends Component {
|
|
|
});
|
|
|
this.loadData();
|
|
|
}
|
|
|
- // 转交提示
|
|
|
- showConfirm() {
|
|
|
- const { dataSource, selectedRowKeys } = this.state;
|
|
|
- if (!this.state.theTypes) {
|
|
|
- message.warning("请输入转交人姓名");
|
|
|
- return;
|
|
|
- }
|
|
|
- let _this = this;
|
|
|
- Modal.confirm({
|
|
|
- title: "提示",
|
|
|
- content: (
|
|
|
- <span style={{ color: "red" }}>
|
|
|
- 确定要转交以下渠道吗?
|
|
|
- {/* {this.state.selectedRowKeys.map((value, index) => (
|
|
|
- <div key={index} style={{ marginTop: "5px", color: "#000" }}>
|
|
|
- {value.name}
|
|
|
- </div>
|
|
|
- ))} */}
|
|
|
- <div style={{ marginTop: "5px", color: "#000" }}>
|
|
|
- {dataSource[selectedRowKeys[0]].name}
|
|
|
- </div>
|
|
|
- </span>
|
|
|
- ),
|
|
|
- onOk() {
|
|
|
- _this.setState({
|
|
|
- informationTransferVisible: true,
|
|
|
- });
|
|
|
- },
|
|
|
- onCancel() { },
|
|
|
- });
|
|
|
- }
|
|
|
- //转交
|
|
|
- changeAssigner(infor) {
|
|
|
- const { dataSource, selectedRowKeys } = this.state;
|
|
|
- if (this.state.theTypes) {
|
|
|
- this.setState({
|
|
|
- informationTransferVisible: false,
|
|
|
- });
|
|
|
- let changeIds = dataSource[selectedRowKeys[0]].id;
|
|
|
- let oldAid = dataSource[selectedRowKeys[0]].aid;
|
|
|
- let loading = message.loading("加载中...");
|
|
|
- $.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, //原跟进人ID
|
|
|
- data: infor, // 资料是否一并转交 0否 1是
|
|
|
- },
|
|
|
- }).done(
|
|
|
- function (data) {
|
|
|
- loading();
|
|
|
- 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("请输入转交人姓名");
|
|
|
- }
|
|
|
- }
|
|
|
- // 移出渠道
|
|
|
- remove() {
|
|
|
- const { dataSource, selectedRowKeys, ispage } = this.state;
|
|
|
- const _this = this
|
|
|
- Modal.confirm({
|
|
|
- title: "您确定将以下渠道移至公共渠道吗??",
|
|
|
- content: (
|
|
|
- <span style={{ color: "red" }}>
|
|
|
- 移除后,以下客户将被别人领取!
|
|
|
- <div style={{ marginTop: "5px", color: "#000" }}>
|
|
|
- {dataSource[selectedRowKeys[0]].name}
|
|
|
- </div>
|
|
|
- </span>
|
|
|
- ),
|
|
|
- onOk() {
|
|
|
- let deletedIds = dataSource[selectedRowKeys[0]].id;
|
|
|
- $.ajax({
|
|
|
- method: "get",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/customer/pushReleaseUser",
|
|
|
- data: {
|
|
|
- id: deletedIds,
|
|
|
- },
|
|
|
- success: function (data) {
|
|
|
- let thedata = data.data;
|
|
|
- if (!thedata) {
|
|
|
- if (data.error && data.error.length) {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- }
|
|
|
- thedata = {};
|
|
|
- } else {
|
|
|
- message.success("移除成功");
|
|
|
- }
|
|
|
- _this.loadData(
|
|
|
- dataSource.length === 1
|
|
|
- ? ispage === 1
|
|
|
- ? 1
|
|
|
- : ispage - 1
|
|
|
- : ispage
|
|
|
- )
|
|
|
- }.bind(this),
|
|
|
- }).always(
|
|
|
- function () {
|
|
|
- _this.setState({
|
|
|
- loading: false,
|
|
|
- });
|
|
|
- }.bind(this)
|
|
|
- );
|
|
|
- },
|
|
|
- onCancel() { },
|
|
|
- });
|
|
|
- }
|
|
|
- selectAuto(value, options) {
|
|
|
- this.setState({
|
|
|
- auto: value,
|
|
|
- });
|
|
|
- }
|
|
|
- // 跟进人查询
|
|
|
- followUp(e) {
|
|
|
- const { searchInfor } = this.state;
|
|
|
- this.setState({
|
|
|
- searchInfor: Object.assign(searchInfor, {
|
|
|
- aname: e,
|
|
|
- }),
|
|
|
- });
|
|
|
- $.ajax({
|
|
|
- method: "get",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/customer/listAdminByName",
|
|
|
- data: {
|
|
|
- adminName: e,
|
|
|
- },
|
|
|
- success: function (data) {
|
|
|
- let thedata = data.data;
|
|
|
- if (!thedata) {
|
|
|
- if (data.error && data.error.length) {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- }
|
|
|
- thedata = {};
|
|
|
- }
|
|
|
- this.setState({
|
|
|
- fjlist: thedata,
|
|
|
- });
|
|
|
- }.bind(this),
|
|
|
- }).always(
|
|
|
- function () {
|
|
|
- this.setState({
|
|
|
- loading: false,
|
|
|
- });
|
|
|
- }.bind(this)
|
|
|
- );
|
|
|
- }
|
|
|
- // 选中跟进人
|
|
|
- selectF(value) {
|
|
|
- const { searchInfor, fjlist } = this.state;
|
|
|
- const newdataSources = JSON.stringify(fjlist) == "{}" ? [] : fjlist;
|
|
|
- this.setState({
|
|
|
- searchInfor: Object.assign(searchInfor, {
|
|
|
- aid: newdataSources.find((item) => item.name == value).id,
|
|
|
- }),
|
|
|
- });
|
|
|
- }
|
|
|
- //品类数据获取
|
|
|
- category() {
|
|
|
- $.ajax({
|
|
|
- method: "get",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/Varieties/getSuperList",
|
|
|
- data: {},
|
|
|
- success: function (data) {
|
|
|
- let thedata = data.data;
|
|
|
- let theArr = [];
|
|
|
- if (!thedata) {
|
|
|
- if (data.error && data.error.length) {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- }
|
|
|
- thedata = {};
|
|
|
- } else {
|
|
|
- thedata.map(function (item, index) {
|
|
|
- theArr.push({
|
|
|
- value: item.id,
|
|
|
- key: item.cname,
|
|
|
- });
|
|
|
- });
|
|
|
- }
|
|
|
- this.setState({
|
|
|
- categoryArr: theArr,
|
|
|
- });
|
|
|
- }.bind(this),
|
|
|
- });
|
|
|
- }
|
|
|
- //查看跟进记录列表
|
|
|
- loadVisit(pageNo) {
|
|
|
- this.setState({
|
|
|
- loading: true,
|
|
|
- });
|
|
|
- $.ajax({
|
|
|
- method: "get",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/customer/listFollowHistory",
|
|
|
- data: {
|
|
|
- pageNo: pageNo || 1,
|
|
|
- pageSize: this.state.paginations.pageSize,
|
|
|
- uid: this.props.data.id, //名称1
|
|
|
- },
|
|
|
- success: function (data) {
|
|
|
- let theArr = [];
|
|
|
- if (data.error.length || data.data.list == "") {
|
|
|
- if (data.error && data.error.length) {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- }
|
|
|
- } else {
|
|
|
- for (let i = 0; i < data.data.list.length; i++) {
|
|
|
- let thisdata = data.data.list[i];
|
|
|
- theArr.push(thisdata);
|
|
|
- }
|
|
|
- this.state.paginations.current = data.data.pageNo;
|
|
|
- this.state.paginations.total = data.data.totalCount;
|
|
|
- this.setState({
|
|
|
- ispage: data.data.pageNo,
|
|
|
- });
|
|
|
- }
|
|
|
- if (data.data.list && !data.data.list.length) {
|
|
|
- this.state.paginations.current = 0;
|
|
|
- this.state.paginations.total = 0;
|
|
|
- }
|
|
|
- this.setState({
|
|
|
- visitArrList: theArr,
|
|
|
- paginations: this.state.paginations,
|
|
|
- });
|
|
|
- }.bind(this),
|
|
|
- }).always(
|
|
|
- function () {
|
|
|
- this.setState({
|
|
|
- loading: false,
|
|
|
- });
|
|
|
- }.bind(this)
|
|
|
- );
|
|
|
- }
|
|
|
- close(e, s) {
|
|
|
- this.setState({
|
|
|
- visitModuls: false,
|
|
|
- });
|
|
|
- }
|
|
|
|
|
|
render() {
|
|
|
const {
|
|
@@ -596,26 +260,15 @@ class ChannelUnit extends Component {
|
|
|
channeOb,
|
|
|
dataSource,
|
|
|
} = this.state;
|
|
|
+
|
|
|
const rowSelection = {
|
|
|
selectedRowKeys,
|
|
|
onChange: this.onSelectChange.bind(this),
|
|
|
hideDefaultSelections: true,
|
|
|
type: "radio",
|
|
|
};
|
|
|
+
|
|
|
const hasSelected = this.state.selectedRowKeys.length > 0;
|
|
|
- const dataSources = this.state.customerArr || [];
|
|
|
- const options = dataSources.map((group) => (
|
|
|
- <Select.Option key={group.id} value={group.name}>
|
|
|
- {group.name}
|
|
|
- </Select.Option>
|
|
|
- ));
|
|
|
- const newdataSources =
|
|
|
- JSON.stringify(this.state.fjlist) == "{}" ? [] : this.state.fjlist;
|
|
|
- const newoptions = newdataSources.map((group) => (
|
|
|
- <Select.Option key={group.id} value={group.name}>
|
|
|
- {group.name}
|
|
|
- </Select.Option>
|
|
|
- ));
|
|
|
return (
|
|
|
<div className="user-content">
|
|
|
<div className="content-title" style={{ marginBottom: 10 }}>
|
|
@@ -710,22 +363,6 @@ class ChannelUnit extends Component {
|
|
|
))}
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- {/* <FormItem>
|
|
|
- <AutoComplete
|
|
|
- className="certain-category-search"
|
|
|
- dropdownClassName="certain-category-search-dropdown"
|
|
|
- dropdownMatchSelectWidth={false}
|
|
|
- style={{ width: "120px" }}
|
|
|
- dataSource={newoptions}
|
|
|
- placeholder="跟进人"
|
|
|
- value={searchInfor.aname || undefined}
|
|
|
- onChange={this.followUp.bind(this)}
|
|
|
- filterOption={true}
|
|
|
- onSelect={this.selectF.bind(this)}
|
|
|
- >
|
|
|
- <Input />
|
|
|
- </AutoComplete>
|
|
|
- </FormItem> */}
|
|
|
<FormItem>
|
|
|
<Select
|
|
|
placeholder={"渠道类型"}
|
|
@@ -789,30 +426,6 @@ class ChannelUnit extends Component {
|
|
|
}}
|
|
|
>
|
|
|
<div style={{ flex: 1 }}>
|
|
|
- {/* <AutoComplete
|
|
|
- className="certain-category-search"
|
|
|
- dropdownClassName="certain-category-search-dropdown"
|
|
|
- dropdownMatchSelectWidth={false}
|
|
|
- style={{ width: "120px" }}
|
|
|
- dataSource={options}
|
|
|
- placeholder="输入转交人姓名"
|
|
|
- value={this.state.auto}
|
|
|
- onChange={this.httpChange.bind(this)}
|
|
|
- filterOption={true}
|
|
|
- onBlur={this.blurChange.bind(this)}
|
|
|
- onSelect={this.selectAuto.bind(this)}
|
|
|
- disabled={!hasSelected}
|
|
|
- >
|
|
|
- <Input />
|
|
|
- </AutoComplete>
|
|
|
- <Button
|
|
|
- type="primary"
|
|
|
- onClick={this.showConfirm.bind(this)}
|
|
|
- style={{ marginLeft: 10 }}
|
|
|
- disabled={!hasSelected}
|
|
|
- >
|
|
|
- 转交
|
|
|
- </Button> */}
|
|
|
<Button
|
|
|
type="primary"
|
|
|
onClick={() => {
|
|
@@ -825,14 +438,6 @@ class ChannelUnit extends Component {
|
|
|
>
|
|
|
渠道日志
|
|
|
</Button>
|
|
|
- {/* <Button
|
|
|
- type="primary"
|
|
|
- onClick={this.remove.bind(this)}
|
|
|
- style={{ marginLeft: "10px" }}
|
|
|
- disabled={!hasSelected}
|
|
|
- >
|
|
|
- 移出渠道
|
|
|
- </Button> */}
|
|
|
<Button
|
|
|
type="primary"
|
|
|
onClick={() => {
|
|
@@ -846,13 +451,6 @@ class ChannelUnit extends Component {
|
|
|
更改日志
|
|
|
</Button>
|
|
|
</div>
|
|
|
- {/* <Button
|
|
|
- type="primary"
|
|
|
- onClick={this.addClick.bind(this)}
|
|
|
- style={{ marginLeft: "10px" }}
|
|
|
- >
|
|
|
- 新增渠道
|
|
|
- </Button> */}
|
|
|
</div>
|
|
|
</TabPane>
|
|
|
<TabPane tab="更改表格显示数据" key="3">
|
|
@@ -872,61 +470,13 @@ class ChannelUnit extends Component {
|
|
|
<Table
|
|
|
bordered
|
|
|
size="middle"
|
|
|
- // scroll={this.state.scroll}
|
|
|
columns={changeList ? changeList : columns}
|
|
|
- onRowDoubleClick={(e) => {
|
|
|
- this.setState({
|
|
|
- mvisible: "detail",
|
|
|
- rowdata: e,
|
|
|
- });
|
|
|
- }}
|
|
|
dataSource={this.state.dataSource}
|
|
|
pagination={this.state.pagination}
|
|
|
rowSelection={rowSelection}
|
|
|
/>
|
|
|
</Spin>
|
|
|
</div>
|
|
|
- {this.state.informationTransferVisible && (
|
|
|
- <Modal
|
|
|
- visible={this.state.informationTransferVisible}
|
|
|
- title="提醒"
|
|
|
- onCancel={() => {
|
|
|
- this.setState({
|
|
|
- informationTransferVisible: false,
|
|
|
- });
|
|
|
- }}
|
|
|
- footer={[
|
|
|
- <Button
|
|
|
- key="1"
|
|
|
- size="large"
|
|
|
- type={"primary"}
|
|
|
- onClick={() => {
|
|
|
- this.changeAssigner(1);
|
|
|
- }}
|
|
|
- >
|
|
|
- 需要
|
|
|
- </Button>,
|
|
|
- <Button
|
|
|
- key="2"
|
|
|
- size="large"
|
|
|
- type={"danger"}
|
|
|
- onClick={() => {
|
|
|
- this.changeAssigner(0);
|
|
|
- }}
|
|
|
- >
|
|
|
- 不需要
|
|
|
- </Button>,
|
|
|
- ]}
|
|
|
- >
|
|
|
- 请确定,是否将客户资料一并转交!选择“需要”,系统将全部客户资料一并转交!选择“不需要”,原客户资料保存您的客户资料中,请注意客户资料的更新维护,谢谢
|
|
|
- </Modal>
|
|
|
- )}
|
|
|
- {this.state.mvisible == "add" && (
|
|
|
- <AddChannel
|
|
|
- showDesc={this.state.mvisible}
|
|
|
- closeDesc={this.closeDesc.bind(this)}
|
|
|
- />
|
|
|
- )}
|
|
|
{this.state.mvisible == "channellog" && (
|
|
|
<ChannelLog
|
|
|
cancel={this.closeDesc.bind(this)}
|
|
@@ -941,21 +491,6 @@ class ChannelUnit extends Component {
|
|
|
id={dataSource[selectedRowKeys[0]].id}
|
|
|
/>
|
|
|
)}
|
|
|
- {this.state.mvisible == "detail" && (
|
|
|
- <ChannelDetail
|
|
|
- cancel={this.closeDesc.bind(this)}
|
|
|
- visible={this.state.mvisible}
|
|
|
- IntentionData={this.state.rowdata}
|
|
|
- categoryArr={this.state.categoryArr}
|
|
|
- />
|
|
|
- )}
|
|
|
- <FollowDetail
|
|
|
- categoryArr={this.state.categoryArr}
|
|
|
- followData={this.state.followData}
|
|
|
- visitModul={this.state.visitModuls}
|
|
|
- closeDesc={this.close.bind(this)}
|
|
|
- loadData={this.loadVisit.bind(this)}
|
|
|
- />
|
|
|
</div>
|
|
|
);
|
|
|
}
|