HW 3 years ago
parent
commit
f3b671afc2

+ 6 - 1
js/component/dataDic.js

@@ -1530,7 +1530,7 @@ module.exports = {
     },
   ],
   //渠道分配状态
-  //0未分配  1已分配经理 2已分配营销员 3已存在私有 4已存在公共 5已存在签单 6回退 7已签单 8已释放
+  //0未分配  1已分配经理 2已分配营销员 3已存在私有 4已存在公共 5已存在签单 6回退 7已签单 8已释放 9非法名称
   channelAllocationStatus:[
     {
       value: "0",
@@ -1577,6 +1577,11 @@ module.exports = {
       key: "已释放",
       color:'#0c0c0c'
     },
+    {
+      value: "9",
+      key: "客户名称含过滤关键词",
+      color:'#461ddb'
+    },
   ],
   //账户状态
   statuslist: [

+ 46 - 7
js/component/manageCenter/customer/NEW/intentionCustomer/channel.jsx

@@ -42,7 +42,9 @@ class Channel extends Component{
     constructor(props) {
         super(props);
         this.state={
-            channelAllocationStatusList : channelAllocationStatus.slice(0,channelAllocationStatus.length-1),
+            isEditLv:false,
+            upLoadFileLoading:false,
+            channelAllocationStatusList : channelAllocationStatus.slice(0,channelAllocationStatus.length-2),
             columns: [
                 {
                     title: "客户名称",
@@ -146,6 +148,9 @@ class Channel extends Component{
                 },
                 onChange: info => {
                     if (info.file.status === "done") {
+                        this.setState({
+                            upLoadFileLoading:false
+                        })
                         if (info.file.response && info.file.response.error.length === 0) {
                             if(info.file.response.data === 1){
                                 message.success("导入成功!");
@@ -160,6 +165,15 @@ class Channel extends Component{
                         } else {
                             message.warning(info.file.response.error[0].message);
                         }
+                    }else if(info.file.status === "uploading"){
+                        this.setState({
+                            upLoadFileLoading:true
+                        })
+                    }else{
+                        this.loadData(this.state.pageNo);
+                        this.setState({
+                            upLoadFileLoading:false
+                        })
                     }
                 }
             },
@@ -479,6 +493,12 @@ class Channel extends Component{
     }
 
     tableRowClick(record) {
+        if(record.status === 2 && this.props.isEditGuidanceLv){
+            this.setState({
+                isEditLv: true,
+                tabsKey:"4",
+            })
+        }
         this.setState({
             rowData:record,
             modalVisible: true,
@@ -494,7 +514,9 @@ class Channel extends Component{
             modalVisible: false,
             basicState: false,
             contactState: false,
-            modalName: ''
+            modalName: '',
+            isEditLv: false,
+            tabsKey: '',
         })
     }
 
@@ -560,7 +582,8 @@ class Channel extends Component{
         //type   0 总监分配 1经理分配 2回收
         let arr = this.state.selectedRows.filter(v=>v.status === 1);
         let arr1 = this.state.selectedRows.filter(v=>v.status === 2);
-        let arr2 = this.state.selectedRows.filter(v=>v.status !== 1);
+        let arr2 = this.state.selectedRows.filter(v=>v.status === 7);
+        let arr3 = this.state.selectedRows.filter(v=>v.status === 6);
         if(type === 0 && (arr.length>0 || arr1.length>0)){
             message.warning('选中的信息中存在“已分配”数据,请取消这些选项后重新提交')
             return;
@@ -569,9 +592,18 @@ class Channel extends Component{
             message.warning('选中的信息中存在“经理已分配”数据,请取消这些选项后重新提交')
             return;
         }
+        //处于回收状态的客户经理和营销员不能点击回收
+        if(this.props.deliver !== 1 && arr3.length>0){
+            message.warning('渠道客户已回收!待营销总监,重新分配')
+            return;
+        }
         //this.props.deliver && this.props.recovery   用于判断是否为经理
-        if(this.props.deliver === 2 && this.props.recovery && type === 2 && arr2.length>0){
-            message.warning('您只能回收分配状态为"已分配经理"的客户')
+        if(this.props.deliver === 2 && this.props.recovery && type === 2 && arr1.length>0){
+            message.warning('操作失败,存在客户已被分配营销员')
+            return;
+        }
+        if(arr2.length>0){
+            message.warning('不能操作已签单客户')
             return;
         }
         if(!remarks){
@@ -579,6 +611,9 @@ class Channel extends Component{
             return;
         }
         if (this.state.theTypes || lv) {
+            this.setState({
+                listLoading: true,
+            })
             let changeIds  = '';
             let oldAid = '';
             for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
@@ -619,6 +654,9 @@ class Channel extends Component{
                 },
             }).done(
                 function (data) {
+                    this.setState({
+                        listLoading: false,
+                    })
                     if (!data.error.length) {
                         message.success(type === 1 ? "分配成功!" : type === 2 ? "回收成功!" : type === 0 ? "分配成功!" : "");
                         this.setState({
@@ -803,8 +841,9 @@ class Channel extends Component{
                                 >
                                     日志
                                 </Button> : ''}
-                                {this.props.channel ? <Upload {...this.state.upLoad}>
+                                {this.props.channel ? <Upload {...this.state.upLoad} disabled={this.state.upLoadFileLoading}>
                                     <Button
+                                        loading={this.state.upLoadFileLoading}
                                         type="primary"
                                         style={{ marginRight: "10px" }}
                                     >
@@ -890,7 +929,7 @@ class Channel extends Component{
                     closeDesc={this.detailCloseDesc}
                     basicState={this.state.basicState}
                     contactState={this.state.contactState}
-                    isGuidanceLv={this.props.isGuidanceLv}
+                    isGuidanceLv={this.props.isGuidanceLv || this.state.isEditLv}
                     isEditGuidanceLv={this.props.isEditGuidanceLv}
                 />
                 {this.state.duplicateDataVisible ? <DuplicateData

+ 9 - 9
js/component/manageCenter/customer/NEW/intentionCustomer/intentionDetail/intentionDetail.jsx

@@ -6,7 +6,7 @@ import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import ContactPerson from './detail/contactPerson.jsx';  //联系人
 import Account from './detail/account.jsx';  //账户信息
-import Visit from './detail/visit.jsx'; 
+import Visit from './detail/visit.jsx';
 import Business from './detail/business.jsx';
 import BasicPerson from './detail/basicPerson.jsx';
 
@@ -101,7 +101,7 @@ const IntentionDetail = React.createClass({
 		if(nextProps.modalVisible && nextProps.IntentionData.id) {
 			this.setState({
 				modalVisible:true,
-				callnub:this.props.isGuidanceLv ? (this.props.tabsKey ? this.props.tabsKey : "4") : (this.props.tabsKey ? this.props.tabsKey : (this.props.detailApi.indexOf('Organization'))>0?"2":'1'),
+				callnub:nextProps.isGuidanceLv ? (nextProps.tabsKey ? nextProps.tabsKey : "4") : (nextProps.tabsKey ? nextProps.tabsKey : (nextProps.detailApi.indexOf('Organization'))>0?"2":'1'),
 			})
 		};
 		this.setState({
@@ -113,28 +113,28 @@ const IntentionDetail = React.createClass({
 		return(
 			<div>
 				{this.state.modalVisible ? <Modal
-				      className="customeDetails"				      
+				      className="customeDetails"
 			          title="意向客户详情"
 			          width='1300px'
 			          visible={this.state.modalVisible}
 			          onOk={this.detailsModal}
 			          onCancel={this.detailsModal}
 			          footer=''
-			        >				    
+			        >
 					     <Tabs onChange={this.callback} activeKey={this.state.callnub}>
 						    {this.props.isGuidanceLv || this.props.detailApi.indexOf('Organization')>0?"":
 						    <TabPane tab="基本信息" key="1">
-						        <BasicPerson 
+						        <BasicPerson
 						        	detailApi={this.props.detailApi}
 						        	closeDetail={this.closeDetail}
 						        	data={this.props.IntentionData}
 						        	IntentionState={this.state.IntentionState}
 						        	basicState={this.state.basicState}
 						        />
-						       
+
 							</TabPane>}
 							 {!this.props.isGuidanceLv ? <TabPane tab="联系人信息" key="2">
-						        <ContactPerson 
+						        <ContactPerson
 									closeDetail={this.closeDetail}
 									name={this.props.name}
 							        data={this.props.IntentionData}
@@ -158,9 +158,9 @@ const IntentionDetail = React.createClass({
 							        data={this.props.IntentionData}
 							        visitState={this.state.visitState}
 							     />
-							</TabPane>						
+							</TabPane>
 							<TabPane tab="业务意向" key="5">
-							    <Business 
+							    <Business
 							    	closeDetail={this.closeDetail}
 								    data={this.props.IntentionData}
 								    businessState={this.state.businessState}