客户重新分配销售顾问

This commit is contained in:
老叶
2022-03-17 14:58:08 +08:00
parent f77676a5c7
commit 6c63b74afc
2 changed files with 104 additions and 4 deletions
+79 -2
View File
@@ -70,6 +70,10 @@ Page({
of2_id:'',
of1Index:-1,
of2Index:-1,
cid:[],//分配客户ID
employee_id:'',//分配销售ID
employeeIndex:-1,//分配销售索引
},
onLoad(options) {
for (let key in options) {
@@ -77,14 +81,20 @@ Page({
[key]: options[key]
})
}
//客户-tab
this.getAppCustomersTabs()
//获取列表筛选条件
this.getAppCustomersFilter()
this.getAppSeriesBrands()
//获取车型品牌
//this.getAppSeriesBrands()
//销售顾问
this.getAppUserAdmins()
//线索来源
this.getAppCustomersOffline_sources()
},
onShow(){
//获取常用时间段
this.getDateLater()
},
@@ -277,7 +287,7 @@ Page({
})
},
//取常用时间段
//取常用时间段
getDateLater(){
popularData.getDateLater(0,0).then(res => {
this.setData({
@@ -626,6 +636,73 @@ Page({
}
},
//销售弹窗显示隐藏
optEmployees(e){
if(e.currentTarget.dataset.cid){
this.setData({
isShowEmployees:true,
employeeIndex:-1,
employee_id:'',
cid:[e.currentTarget.dataset.cid],
})
}else{
this.setData({
isShowEmployees:!this.data.isShowEmployees,
employeeIndex:-1,
employee_id:'',
cid:[],
})
}
},
//选择店员
changeEmployee(e) {
let employee_id = ''
if(e.detail.value >= 0){
employee_id = this.data.staffobj[e.detail.value].id
}
this.setData({
employee_id,
employeeIndex:e.detail.value,
})
},
//分配客户
putAppCustomersAdmins(){
let that = this
if (that.data.employeeIndex == -1 ) {
wx.showToast({
title: '请选择店员',
icon: 'none'
})
}else{
that.setData({
submitFlag: true,
})
let params = {};
params['ids'] = that.data.cid;
params['admin_id'] = that.data.employee_id;
_.apiQuery.putAppCustomersAdmins(params).then(res => {
wx.showToast({
title: '分配成功',
icon: 'success',
duration: 2000
})
that.setData({
isShowEmployees:false,
submitFlag:false,
})
that.onPullDownRefresh()
}).catch(res=>{
that.setData({
submitFlag: false,
})
});
}
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh(){
this.setData({
+25 -2
View File
@@ -68,7 +68,13 @@
<block wx:for="{{item.other_data}}" wx:for-index='key' wx:for-item='value' wx:key='i'>
<view class="mt25 fn-clear font-28">
<view class="fn-fl color-333">{{key}}</view>
<view wx:if="{{key=='销售顾问'&&!value}}" class="fn-fr wp60 text-nowrap text-right color-f9394d">待分配</view>
<block wx:if="{{key=='销售顾问'}}">
<view class="fn-fr wp60 text-nowrap text-right">
<text class="text-middle color-666" wx:if="{{value}}">{{value}}</text>
<text class="text-middle color-f9394d" wx:else>待分配</text>
<text class="inline-block ml10 bg-36afa2 pt5 pb5 pl15 pr15 text-middle font-22 color-fff ulib-r10" catchtap="optEmployees" data-cid="{{item.id}}" wx:if="{{item.allot == 1}}">{{value?'重新分配':'分配'}}</text>
</view>
</block>
<view wx:else class="fn-fr wp60 text-nowrap text-right color-666">{{value}}</view>
</view>
</block>
@@ -257,4 +263,21 @@
</view>
</view>
<lcb-changeMobile isShow="{{isShowMobile}}"></lcb-changeMobile>
<lcb-changeMobile isShow="{{isShowMobile}}"></lcb-changeMobile>
<lcb-msg isShow="{{isShowEmployees}}">
<view slot="content">
<view class="inner40">
<view class="pb30 text-center font-36">销售选择</view>
<picker class="relative bg-f6 pt20 pb20 pl30 pr30 font-32 ulib-r10" bindchange="changeEmployee" value="{{employeeIndex}}" range="{{staffArray}}">
<text class="color-ccc" wx:if="{{employeeIndex == -1}}">请选择</text>
<text wx:else>{{staffArray[employeeIndex]}}</text>
<i class="absolute right-0 box-middle iconfont mr30 color-999 icon-xiala"></i>
</picker>
</view>
<view class="fn-flex pl60 pr60 pb50 text-center font-32 color-666">
<button bindtap="optEmployees" class="fn-flex-item mr20 bds-2-36afa2 btn-no-bg wp100 font-28 color-36afa2 ulib-r750">取消</button>
<button disabled="{{submitFlag}}" bindtap="putAppCustomersAdmins" class="fn-flex-item ml20 btn-36afa2 wp100 font-28 color-fff ulib-r750" hover-class="btn-36afa2-hover">确定</button>
</view>
</view>
</lcb-msg>