|
@@ -1,5 +1,5 @@
|
|
|
import React from 'react';
|
|
|
-import { Radio, Icon, Button, Cascader, Input, Select, Tabs, Spin, Popconfirm, Popover, Table, Switch, message, DatePicker, Modal, Upload, Form, Row, Col, TimePicker } from 'antd';
|
|
|
+import { Radio, Icon, Button, AutoComplete,Cascader, Input, Select, Tabs, Spin, Popconfirm, Popover, Table, Switch, message, DatePicker, Modal, Upload, Form, Row, Col, TimePicker } from 'antd';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
import moment from 'moment';
|
|
@@ -9,7 +9,7 @@ const { Column, ColumnGroup } = Table;
|
|
|
const TabPane = Tabs.TabPane;
|
|
|
import CustomerDetail from './myClientDesc.jsx';
|
|
|
import { socialAttribute, industry, newFollow, auditStatusL, lvl, currentMember, cityArr, statuslist, customerStatus, intentionalService, sex } from '../../../dataDic.js';
|
|
|
-import { getCompanyIntention, splitUrl,getIndustry, getStatuslist, getAuditStatus, getContactType, getSocialAttribute, getfllowSituation, beforeUploadFile, getWhether, getcityArr, getcustomerStatue, getfllowSituationOn, getCertification, getcustomerTyp, getLvl, getCurrentMember, getprovince } from '../../../tools.js';
|
|
|
+import { getCompanyIntention, splitUrl, getIndustry, getStatuslist, getAuditStatus, getContactType, getSocialAttribute, getfllowSituation, beforeUploadFile, getWhether, getcityArr, getcustomerStatue, getfllowSituationOn, getCertification, getcustomerTyp, getLvl, getCurrentMember, getprovince } from '../../../tools.js';
|
|
|
|
|
|
//图片组件
|
|
|
const PicturesWall = React.createClass({
|
|
@@ -990,6 +990,14 @@ const MyClient = Form.create()(React.createClass({
|
|
|
message.warning('请选择地区');
|
|
|
return false;
|
|
|
};
|
|
|
+ if(isNaN(this.state.registeredCapital)){
|
|
|
+ message.warning('注册资本只能输入数字')
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+ if(isNaN(this.state.enterpriseScale)){
|
|
|
+ message.warning('单位规模只能输入数字')
|
|
|
+ return false;
|
|
|
+ }
|
|
|
this.setState({
|
|
|
selectedRowKeys: [],
|
|
|
});
|
|
@@ -1117,7 +1125,7 @@ const MyClient = Form.create()(React.createClass({
|
|
|
businessScope: thisData.businessScope,
|
|
|
orgCode: thisData.orgCode,
|
|
|
investment: thisData.investment,
|
|
|
- auditStatus: thisData.auditStatus?String(thisData.auditStatus):undefined,
|
|
|
+ auditStatus: thisData.auditStatus ? String(thisData.auditStatus) : undefined,
|
|
|
businessAudit: thisData.businessAudit
|
|
|
});
|
|
|
}.bind(this),
|
|
@@ -1377,6 +1385,14 @@ const MyClient = Form.create()(React.createClass({
|
|
|
},
|
|
|
//点击新增详情
|
|
|
newContacts() {
|
|
|
+ this.state.newsex = undefined;
|
|
|
+ this.state.newname = '';
|
|
|
+ this.state.newmobile = '';
|
|
|
+ this.state.newwechat = '';
|
|
|
+ this.state.newqq = '';
|
|
|
+ this.state.newdepatrment = '';
|
|
|
+ this.state.newposition = '';
|
|
|
+ this.state.newemail = '';
|
|
|
this.setState({
|
|
|
uids: this.state.uid,
|
|
|
addcontactModul: true
|
|
@@ -1852,6 +1868,104 @@ const MyClient = Form.create()(React.createClass({
|
|
|
});
|
|
|
}.bind(this));
|
|
|
},
|
|
|
+ //指定转交人自动补全
|
|
|
+ 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));
|
|
|
+ },
|
|
|
+ //上级主管输入框失去焦点是判断客户是否存在
|
|
|
+ selectAuto(value,options){
|
|
|
+ this.setState({
|
|
|
+ auto:value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ blurChange(e){
|
|
|
+ console.log(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
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //值改变时请求客户名称
|
|
|
+ httpChange(e){
|
|
|
+ if(e.length>=1){
|
|
|
+ this.supervisor(e);
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ auto:e
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //转交
|
|
|
+ changeAssigner() {
|
|
|
+ if(this.state.theTypes){
|
|
|
+ this.setState({
|
|
|
+ selectedRowKeys: [],
|
|
|
+ });
|
|
|
+ let changeIds;
|
|
|
+ for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
|
|
|
+ let rowItem = this.state.selectedRows[idx];
|
|
|
+ if(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
|
|
|
+ }
|
|
|
+ }).done(function(data) {
|
|
|
+ if(!data.error.length) {
|
|
|
+ message.success('转交成功!');
|
|
|
+ this.setState({
|
|
|
+ auto:'',
|
|
|
+ loading: false,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ };
|
|
|
+ this.loadData();
|
|
|
+ }.bind(this));
|
|
|
+ }else{
|
|
|
+ message.warning('请输入转交人姓名')
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
if(!this.props.visible && nextProps.visible) {
|
|
|
if(nextProps.data && nextProps.data.id) {
|
|
@@ -1909,6 +2023,10 @@ const MyClient = Form.create()(React.createClass({
|
|
|
wrapperCol: { span: 14 },
|
|
|
};
|
|
|
const contacts = this.state.contacts || '';
|
|
|
+ const dataSources=this.state.customerArr || [];
|
|
|
+ const options = dataSources.map((group) =>
|
|
|
+ <Select.Option key={group.id} value={group.name}>{group.name}</Select.Option>
|
|
|
+ )
|
|
|
return(
|
|
|
<div className="user-content" >
|
|
|
<div className="content-title">
|
|
@@ -1955,13 +2073,30 @@ const MyClient = Form.create()(React.createClass({
|
|
|
<Button>上传批量内容</Button>
|
|
|
</Upload>
|
|
|
<Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
|
|
|
- <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px'}}
|
|
|
+ <Button type="danger" style={{marginLeft:'10px'}}
|
|
|
disabled={!hasSelected}
|
|
|
>删除<Icon type="minus" />
|
|
|
</Button>
|
|
|
</Popconfirm>
|
|
|
- <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
|
|
|
- disabled={!hasSelected}
|
|
|
+ <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={this.changeAssigner} disabled={!hasSelected} >转交</Button>
|
|
|
+ <Button type='primary' disabled={!hasSelected}
|
|
|
onClick={this.changeRow}>转为公共客户<Icon /></Button>
|
|
|
<span style={{marginLeft:'10px',marginRight:'20px'}}>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
|
|
|
<Button type="primary" className="addButton" onClick={this.addClick}>新增客户<Icon type="plus" /></Button>
|
|
@@ -2165,7 +2300,7 @@ const MyClient = Form.create()(React.createClass({
|
|
|
wrapperCol={{ span: 18 }}
|
|
|
label="注册资本"
|
|
|
>
|
|
|
- <Input placeholder="注册资本" value={this.state.registeredCapital}
|
|
|
+ <Input placeholder="注册资本" value={this.state.registeredCapital} maxLength='6'
|
|
|
onChange={(e)=>{this.setState({registeredCapital:e.target.value})}}/>
|
|
|
</FormItem>
|
|
|
<FormItem className="half-item"
|
|
@@ -2173,7 +2308,7 @@ const MyClient = Form.create()(React.createClass({
|
|
|
wrapperCol={{ span: 18 }}
|
|
|
label="单位规模"
|
|
|
>
|
|
|
- <Input placeholder="单位规模" value={this.state.enterpriseScale}
|
|
|
+ <Input placeholder="单位规模" value={this.state.enterpriseScale} maxLength='1'
|
|
|
onChange={(e)=>{this.setState({enterpriseScale:e.target.value})}}/>
|
|
|
</FormItem>
|
|
|
<FormItem className="half-item"
|
|
@@ -2380,7 +2515,8 @@ const MyClient = Form.create()(React.createClass({
|
|
|
<FormItem className="half-item"
|
|
|
{...formItemLayout}
|
|
|
label="注册手机号" >
|
|
|
- <Input value={this.state.mobile} onChange={(e) => { this.setState({ mobile: e.target.value }); }} style={{width:'200px',marginRight:'50px'}}/>
|
|
|
+ <Input value={this.state.mobile} disabled
|
|
|
+ onChange={(e) => { this.setState({ mobile: e.target.value }); }} style={{width:'200px',marginRight:'50px'}}/>
|
|
|
<Button onClick={this.modifyPassworld}>修改密码</Button>
|
|
|
</FormItem>
|
|
|
<FormItem className="half-item"
|