客户-重新分配
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
<text>分期信息</text>
|
||||
</view> -->
|
||||
<view class="text-right">
|
||||
<button bindtap="pushLink" data-url="/pages/customer/editCard/index?id={{id}}" class="inline-block btn-36afa2 font-22 color-fff ulib-r10" hover-class="btn-36afa2-hover"><i class="iconfont icon-dengji mr10"></i>编辑</button>
|
||||
<button bindtap="pushLink" data-url="/pages/customer/editCard/index?id={{id}}" class="inline-block btn-36afa2 font-22 color-fff ulib-r10" hover-class="btn-36afa2-hover"><i class="iconfont icon-dengji mr10"></i>修改</button>
|
||||
</view>
|
||||
<view>
|
||||
<view class="relative bbs-1-eb last-b-none pl140 font-28">
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
</view>
|
||||
|
||||
<view class="mt60 pl60 pr60">
|
||||
<button class="wp100 btn-36afa2 pt10 pb10 text-center font-32 color-fff ulib-r750" hover-class="btn-36afa2-hover" disabled="{{submitFlag}}" bindtap="putAppCustomerData">确认编辑</button>
|
||||
<button class="wp100 btn-36afa2 pt10 pb10 text-center font-32 color-fff ulib-r750" hover-class="btn-36afa2-hover" disabled="{{submitFlag}}" bindtap="putAppCustomerData">确认</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -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) {
|
||||
@@ -637,14 +641,68 @@ Page({
|
||||
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({
|
||||
|
||||
@@ -70,9 +70,9 @@
|
||||
<view class="fn-fl color-333">{{key}}</view>
|
||||
<block wx:if="{{key=='销售顾问'}}">
|
||||
<view class="fn-fr wp60 text-nowrap text-right">
|
||||
<text class="inline-block mr10 bg-36afa2 pt5 pb5 pl15 pr15 text-middle font-22 color-fff ulib-r10" catchtap="optEmployees" data-cid="{{item.id}}">分配</text>
|
||||
<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>
|
||||
@@ -269,9 +269,9 @@
|
||||
<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="{{employeeArray}}">
|
||||
<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>{{employeeArray[employeeIndex]}}</text>
|
||||
<text wx:else>{{staffArray[employeeIndex]}}</text>
|
||||
<i class="absolute right-0 box-middle iconfont mr30 color-999 icon-xiala"></i>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<view class="mt40 fn-clear">
|
||||
<view class="fn-fl pt10 font-32">车辆信息</view>
|
||||
<view class="fn-fr">
|
||||
<button bindtap="{{info.edit_status==1?'pushLink':''}}" data-url="/pages/order/edit/index?id={{id}}" class="inline-block font-22 color-fff ulib-r10 {{info.edit_status==1?'btn-36afa2':'bg-999'}}" hover-class="btn-36afa2-hover"><i class="iconfont icon-dengji mr10"></i>编辑</button>
|
||||
<button bindtap="{{info.edit_status==1?'pushLink':''}}" data-url="/pages/order/edit/index?id={{id}}" class="inline-block font-22 color-fff ulib-r10 {{info.edit_status==1?'btn-36afa2':'bg-999'}}" hover-class="btn-36afa2-hover"><i class="iconfont icon-dengji mr10"></i>修改</button>
|
||||
</view>
|
||||
</view>
|
||||
<block wx:for="{{info.car_data}}" wx:for-index='key' wx:for-item='value' wx:key='i'>
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
</block>
|
||||
<view class="fixed left-0 right-0 bottom-0 bg-fff-op90 inner40 fn-flex safe-pb">
|
||||
<button class="wp100 bds-2-36afa2 bg-fff mr20 pt10 pb10 text-center font-32 color-36afa2 ulib-r750" hover-class="btn-36afa2-hover" bindtap="optPreview">重新编辑</button>
|
||||
<button class="wp100 btn-36afa2 ml20 pt10 pb10 text-center font-32 color-fff ulib-r750" hover-class="btn-36afa2-hover" disabled="{{submitFlag}}" bindtap="putAppCusorder2">确认编辑</button>
|
||||
<button class="wp100 btn-36afa2 ml20 pt10 pb10 text-center font-32 color-fff ulib-r750" hover-class="btn-36afa2-hover" disabled="{{submitFlag}}" bindtap="putAppCusorder2">确认</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user