dengzhiguo před 6 roky
rodič
revize
24439b5e7a

+ 12 - 0
js/component/dataDic.js

@@ -2246,6 +2246,18 @@ module.exports = {
 	        key: "优质资料"
 	    }
     ],
+    level:[
+    	{
+	        value: "0",
+	        key: "一般客户"
+	    },{
+	        value: "1",
+	        key: "意向客户"
+	    },{
+	        value: "2",
+	        key: "重点客户"
+	    }
+    ],
     roleResources:[
     	{
 	        value: "0",

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

@@ -6,7 +6,7 @@ import moment from 'moment';
 import { citySelect, provinceList } from '@/NewDicProvinceList';
 import AddIntention from './addIntention.jsx';
 import { socialAttribute, industry, auditStatusL, lvl, currentMember } from '@/dataDic.js';
-import { getSocialAttribute, beforeUploadFile } from '@/tools.js';
+import { getSocialAttribute, beforeUploadFile ,getLevel} from '@/tools.js';
 import FollowDetail from './followDetail.jsx'
 import IntentionDetail from './intentionDetail/intentionDetail.jsx'
 import './customer.less';
@@ -27,6 +27,7 @@ const IntentionCustomer = Form.create()(React.createClass({
 			data: {
 				pageNo: pageNo || 1,
 				pageSize: this.state.pagination.pageSize,
+				level:this.state.level?this.state.level:undefined,
 				name: this.state.nameSearch,
 				province: !(this.state.addressSearch).length ? this.state.provinceSearch : this.state.addressSearch[0],
 				city: !(this.state.addressSearch).length ? '' : this.state.addressSearch[1],
@@ -57,6 +58,7 @@ const IntentionCustomer = Form.create()(React.createClass({
 							surplusFollowTime:thisdata.surplusFollowTime&&thisdata.surplusFollowTime.split(' ')[0],
 							surplusSignTime:thisdata.surplusSignTime&&thisdata.surplusSignTime.split(' ')[0],
 							locationProvince: diqu,
+							level:thisdata.level,
 						});
 					};
 					this.state.pagination.current = data.data.pageNo;
@@ -183,9 +185,14 @@ const IntentionCustomer = Form.create()(React.createClass({
 					title: '剩余签单天数',
 					dataIndex: 'surplusSignTime',
 					key: 'surplusSignTime'
+				},{
+					title: '客户等级',
+					dataIndex: 'level',
+					key: 'level',
+					render:text => { return getLevel(text) }
 				},
 				{
-					title: '操作',
+					title: '跟进操作',
 					dataIndex: 'abc',
 					key: 'abc',
 					render: (text, record, index) => {
@@ -203,7 +210,35 @@ const IntentionCustomer = Form.create()(React.createClass({
 		};
 	},
 	
-	
+	rankO(rank){
+		let deletedIds;
+		for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
+			let rowItem = this.state.selectedRows[idx];
+			if(rowItem.id) {
+				deletedIds = rowItem.id;
+			};
+		};
+		$.ajax({
+			method: "get",
+			dataType: "json",
+			crossDomain: false,
+			url: globalConfig.context + "/api/admin/customer/updateUserLevel",
+			data: {
+				id: deletedIds, //客户的ID
+				level:rank
+			}
+		}).done(function(data) {
+			if(!data.error.length) {
+				message.success('操作成功!');
+				this.setState({
+					loading: false,
+				});
+			} else {
+				message.warning(data.error[0].message);
+			};
+			this.loadData(this.state.ispage);
+		}.bind(this));
+	},
 	
 	//进入新增拜访记录
 	visit(e) {
@@ -306,6 +341,7 @@ const IntentionCustomer = Form.create()(React.createClass({
 	},
 	reset() {
 		this.state.nameSearch = '';
+		this.state.level = undefined;
 		this.state.addressSearch = [];
 		this.state.provinceSearch = undefined;
 		this.state.citySearch = undefined;
@@ -486,11 +522,23 @@ const IntentionCustomer = Form.create()(React.createClass({
 	                     <Cascader options={citySelect()}  value={this.state.addressSearch} placeholder="选择城市"
     						onChange={(e,pre) => { this.setState({ addressSearch: e }) }} />	                 
                     </span>
+                    <Select
+                    	style={{ width: 120 }}
+						value={this.state.level}
+						onChange={(e) => {
+							this.setState({ level: e });
+						}}
+						placeholder="请选择客户等级"
+					>
+						<Select.Option value="0">一般客户</Select.Option>
+						<Select.Option value="1">意向客户</Select.Option>
+						<Select.Option value="2">重点客户</Select.Option>
+					</Select>
                     <RangePicker
 	                        value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
 	                        this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
 	                        onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />    
-                    <Button type="primary" onClick={this.search}>搜索</Button>
+                    <Button type="primary" style={{marginLeft:"10px"}} onClick={this.search}>搜索</Button>
                     <Button onClick={this.reset}>重置</Button>                      
                     {/*<Button onClick={() => { window.open(globalConfig.context + '/api/admin/customer/downloadTemplate?type=1') }}>下载批量导入模板</Button>
                		<Upload 
@@ -542,11 +590,11 @@ const IntentionCustomer = Form.create()(React.createClass({
 				        <Input />
 				      </AutoComplete>  
 					<Button type="primary" onClick={this.changeAssigner}  disabled={!hasSelected} >转交</Button>  
-	                <span style={{marginLeft:'10px',marginRight:'20px'}}>更多搜索<Switch checked={!this.state.searchMore} onChange={this.searchSwitch} /></span>
                     <Button type="primary" className="addButton" onClick={this.addClick}>新增客户<Icon type="plus" /></Button> 
                     <div className='clearfix' style={{marginTop:'5px'}}>
-	                  <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>                    			                  
-			               </div>  
+	                   <Button onClick={(e) =>{ e.stopPropagation(), this.rankO(0)}} type="primary" style={{marginRight:"10px"}} disabled={!hasSelected}>一般客户</Button>
+	                   <Button onClick={(e) =>{ e.stopPropagation(), this.rankO(1)}} type="primary" style={{marginRight:"10px"}} disabled={!hasSelected}>意向客户</Button>
+	                   <Button onClick={(e) =>{ e.stopPropagation(), this.rankO(2)}} type="primary" disabled={!hasSelected}>重点客户</Button>
 		            </div>
                 </div>                                               
                 <div className="patent-table">

+ 18 - 1
js/component/manageCenter/order/myOrder/servicesOrder/addService.jsx

@@ -101,6 +101,7 @@ const NewService = Form.create()(React.createClass({
                              createTimes:thisdata.createTimes,
                              discountFirstPayment:thisdata.discountFirstPayment,
                              remarks:thisdata.remarks,
+                             commodityId:thisdata.commodityId,
                         });
                     };
                    }
@@ -342,7 +343,8 @@ const NewService = Form.create()(React.createClass({
                		//签单
                		orderNo:thisData.orderNo,//订单编号
                		buyerName:thisData.buyerName,
-               		contractNo:thisData.contractNo
+               		contractNo:thisData.contractNo,
+               		buyerId:thisData.buyerId,
                 });
             }.bind(this),
        }).always(function () {
@@ -710,12 +712,27 @@ const NewService = Form.create()(React.createClass({
 		this.setState({
 			loading: true
 		});
+		let dataList=this.state.dataSource,
+			idsList=[];
+		dataList.map((item,index) => {
+			console.log(item);
+			console.log(this.state.commodityId);
+			idsList.push({
+				businessId:'',
+				businessProjectId:item.commodityId,
+				customerStatus:"1",
+				followSituation:"5",
+				remarks:"签单-自动触发"
+			})
+		})
 		$.ajax({
 			method: "POST",
 			dataType: "json",
 			crossDomain: false,
 			url: globalConfig.context +'/api/admin/order/signServiceOrder' ,
 			data: {
+				userBusinessList: JSON.stringify(idsList),
+				uid:this.state.buyerId,
 				orderNo:this.props.datauser.orderNo,
 				signTotalAmount:this.state.signTotalAmount,
 				signFirstPayment:this.state.signFirstPayment,

+ 15 - 1
js/component/tools.js

@@ -75,7 +75,8 @@ import {
     distributeState,
     customerSource,
     slcRedit,
-    dataGrade
+    dataGrade,
+    level
 } from './dataDic.js';
 
 import { provinceList} from './NewDicProvinceList.js';
@@ -1397,5 +1398,18 @@ module.exports = {
             });
             return theType;
         }
+	},
+	//客户等级
+	getLevel:function(e){
+   		if (e||e==0) {
+   			let str=e.toString()
+            let theType = '';
+            level.map(function (item) {
+                if (item.value == str) {
+                    theType = item.key;
+                };
+            });
+            return theType;
+        }
 	}
 }