分配订单
This commit is contained in:
@@ -36,7 +36,7 @@ api = {
|
||||
appCustomerData: "app/customers/data", //获取客户详细信息
|
||||
appCusorder: "app/cusorder", //新建订单 /获取订单列表 /获取订单详情 /修改付款方式 /修改委托协议
|
||||
appCusorderTabs: "app/cusorder/tabs", //获取tab
|
||||
appEmployees: "app/employees", //获取客户详细信息 /获取店员列表 /更新店员信息 /删除店员 //提交离职
|
||||
appEmployees: "app/employees", //获取客户详细信息 /获取店员列表 /更新店员信息 /删除店员
|
||||
appIdcard: "app/idcard", //创建申请开票信息
|
||||
appUserCal: "app/user/cal", //获取用户统计
|
||||
appCusorderCkcar: "app/cusorder/ckcar", //确认交付
|
||||
@@ -145,7 +145,11 @@ api = {
|
||||
|
||||
appCityArea:'app/city/area', //获取省/市/区/街道
|
||||
|
||||
appEmployeesLeave:'app/employees/leave', //获取离职
|
||||
appEmployeesLeave:'app/employees/leave', //获取离职 //提交离职
|
||||
|
||||
appCusorderV2Admins:'app/cusorderV2/admins', //分配订单
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -875,5 +875,18 @@ apiQuery.getAppEmployeesLeave = function (params) {
|
||||
})
|
||||
}
|
||||
|
||||
//提交离职
|
||||
apiQuery.putAppEmployeesLeave = function (params) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
HttpRequest(true, Config.api.appEmployeesLeave, 2, params, "PUT", resolve, reject)
|
||||
})
|
||||
}
|
||||
|
||||
//分配订单
|
||||
apiQuery.putAppCusorderV2Admins = function (params) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
HttpRequest(true, Config.api.appCusorderV2Admins, 2, params, "PUT", resolve, reject)
|
||||
})
|
||||
}
|
||||
|
||||
export default apiQuery;
|
||||
@@ -271,14 +271,15 @@ Page({
|
||||
params['out_id'] = that.data.out_id;
|
||||
params['in_id'] = that.data.adviser.list[that.data.adviserIndex].id;
|
||||
params['transfer'] = that.data.transfer;
|
||||
_.apiQuery.putAppEmployees(params).then(res => {
|
||||
this.setData({
|
||||
_.apiQuery.putAppEmployeesLeave(params).then(res => {
|
||||
that.setData({
|
||||
isShowTransfer:false,
|
||||
})
|
||||
wx.showToast({
|
||||
title: '预交成功',
|
||||
title: '移交成功',
|
||||
icon: 'success'
|
||||
})
|
||||
that.onPullDownRefresh()
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
|
||||
|
||||
@@ -14,6 +14,11 @@ Page({
|
||||
content:'',//短信内容
|
||||
isRefresh:false,//判断返回是否需要刷新
|
||||
v2OrderId:_.config.v2OrderId,//订单id临界切换版本
|
||||
|
||||
staffArray: [],
|
||||
staffobj: [],
|
||||
employeeIndex:-1,//分配销售索引
|
||||
employee_id:'',//分配销售ID
|
||||
},
|
||||
onLoad: function (options) {
|
||||
for (let key in options) {
|
||||
@@ -26,6 +31,9 @@ Page({
|
||||
wx.setNavigationBarTitle({
|
||||
title: this.data.title||'订单'
|
||||
})
|
||||
|
||||
//销售顾问
|
||||
this.getAppUserAdmins()
|
||||
},
|
||||
|
||||
//获取订单列表
|
||||
@@ -135,6 +143,93 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
//获取销售顾问
|
||||
getAppUserAdmins(){
|
||||
let params = {};
|
||||
params['page'] = 1;
|
||||
params['size'] = 1000;
|
||||
_.apiQuery.getAppUserAdmins(params).then(res => {
|
||||
let staffArray = []
|
||||
res.data.list.forEach(item => {
|
||||
staffArray.push(item.uname)
|
||||
})
|
||||
let bizArray = []
|
||||
res.data.bizs.forEach(item => {
|
||||
bizArray.push(item.name)
|
||||
})
|
||||
this.setData({
|
||||
staffArray:staffArray,
|
||||
staffobj: res.data.list,
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
//显示分配订单
|
||||
showTransfer(e) {
|
||||
this.setData({
|
||||
ids:[e.currentTarget.dataset.id],
|
||||
isShowTransfer:true,
|
||||
})
|
||||
},
|
||||
|
||||
//显示隐藏分配订单
|
||||
optTransfer(e) {
|
||||
this.setData({
|
||||
employee_id:'',
|
||||
employeeIndex:-1,
|
||||
isShowTransfer:!this.data.isShowTransfer,
|
||||
})
|
||||
},
|
||||
|
||||
//选择店员
|
||||
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,
|
||||
})
|
||||
},
|
||||
|
||||
//分配订单
|
||||
putAppCusorderV2Admins(){
|
||||
let that = this
|
||||
if (that.data.employeeIndex == -1 ) {
|
||||
wx.showToast({
|
||||
title: '请选择销售顾问',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
else{
|
||||
that.setData({
|
||||
submitFlag: true,
|
||||
})
|
||||
let params = {};
|
||||
params['ids'] = that.data.ids;
|
||||
params['admin_id'] = that.data.employee_id;
|
||||
_.apiQuery.putAppCusorderV2Admins(params).then(res => {
|
||||
|
||||
wx.showToast({
|
||||
title: '分配成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
that.setData({
|
||||
isShowTransfer:false,
|
||||
submitFlag:false,
|
||||
})
|
||||
that.onPullDownRefresh()
|
||||
|
||||
}).catch(res=>{
|
||||
that.setData({
|
||||
submitFlag: false,
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
//页面相关事件处理函数--监听用户下拉动作
|
||||
onPullDownRefresh(){
|
||||
this.setData({
|
||||
|
||||
@@ -26,7 +26,13 @@
|
||||
<block wx:for="{{item.other_data}}" wx:for-index='key' wx:for-item="pin" wx:key='i'>
|
||||
<view class="mt20 fn-clear font-28">
|
||||
<view class="fn-fl color-333">{{key}}</view>
|
||||
<view class="fn-fr wp60 text-nowrap text-right color-666">
|
||||
<block wx:if="{{key=='销售顾问'}}">
|
||||
<view class="fn-fr wp60 text-nowrap text-right">
|
||||
<text class="text-middle color-666" wx:if="{{pin.value}}">{{pin.value}}</text>
|
||||
<text class="inline-block ml10 bg-36afa2 pt5 pb5 pl15 pr15 text-middle font-22 color-fff ulib-r10" catchtap="showTransfer" data-id="{{item.id}}" wx:if="{{item.allot == 1}}">重新分配</text>
|
||||
</view>
|
||||
</block>
|
||||
<view wx:else class="fn-fr wp60 text-nowrap text-right color-666">
|
||||
<block wx:if="{{pin.type=='checkbox'}}">
|
||||
<block wx:for="{{pin.lists}}" wx:for-index='key' wx:for-item="lable" wx:key='j'>
|
||||
<view class="inline-block ml10 mr10"><i class="iconfont font-34 mr5 text-middle {{lable.selected?'icon-danxuan_xuanzhong color-36afa2':'icon-danxuan'}}" /><text class="text-middle">{{lable.value}}</text></view>
|
||||
@@ -54,7 +60,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" wx:if="{{value}}">
|
||||
<view class="fn-fl color-333">{{key}}</view>
|
||||
<view class="fn-fr wp60 text-nowrap text-right color-666">{{value}}</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="inline-block ml10 bg-36afa2 pt5 pb5 pl15 pr15 text-middle font-22 color-fff ulib-r10" catchtap="showTransfer" data-id="{{item.id}}" wx:if="{{item.allot == 1}}">重新分配</text>
|
||||
</view>
|
||||
</block>
|
||||
<view wx:else class="fn-fr wp60 text-nowrap text-right color-666">{{value}}</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
@@ -80,4 +92,23 @@
|
||||
<button disabled="{{submitFlag}}" bindtap="postAppSmsCusorder" class="fn-flex-item ml20 btn-36afa2 wp100 font-28 color-fff ulib-r750" hover-class="btn-36afa2-hover">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</lcb-msg>
|
||||
|
||||
<lcb-msg isShow="{{isShowTransfer}}">
|
||||
<view slot="content">
|
||||
<view class="inner30">
|
||||
<view class="mt20 ml10 mr10 bds-2-eb inner20 font-28 color-666 fn-clear ulib-r10">
|
||||
<view class="fn-fl">销售顾问</view>
|
||||
<picker class="fn-fr wp60 text-right" bindchange="changeEmployee" value="{{employeeIndex}}" range="{{staffArray}}">
|
||||
<text class="color-ccc" wx:if="{{employeeIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{staffArray[employeeIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo color-ccc"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fn-flex ml10 mr10 pl60 pr60 pb50 text-center font-32 color-666">
|
||||
<button bindtap="optTransfer" class="fn-flex-item mr20 bds-2-36afa2 btn-no-bg wp100 font-28 color-36afa2 ulib-r750">取消</button>
|
||||
<button disabled="{{submitFlag}}" bindtap="putAppCusorderV2Admins" class="fn-flex-item ml20 btn-36afa2 wp100 font-28 color-fff ulib-r750" hover-class="btn-36afa2-hover">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</lcb-msg>
|
||||
@@ -23,6 +23,11 @@ Page({
|
||||
type:'',
|
||||
order_s_time:'',//开始时间
|
||||
order_e_time:'',//结束时间
|
||||
|
||||
staffArray: [],
|
||||
staffobj: [],
|
||||
employeeIndex:-1,//分配销售索引
|
||||
employee_id:'',//分配销售ID
|
||||
},
|
||||
onLoad: function (options) {
|
||||
for (let key in options) {
|
||||
@@ -31,6 +36,10 @@ Page({
|
||||
})
|
||||
}
|
||||
this.getAppCusorderV2Tabs()
|
||||
|
||||
//销售顾问
|
||||
this.getAppUserAdmins()
|
||||
|
||||
},
|
||||
|
||||
//客户-tab
|
||||
@@ -218,6 +227,93 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
//获取销售顾问
|
||||
getAppUserAdmins(){
|
||||
let params = {};
|
||||
params['page'] = 1;
|
||||
params['size'] = 1000;
|
||||
_.apiQuery.getAppUserAdmins(params).then(res => {
|
||||
let staffArray = []
|
||||
res.data.list.forEach(item => {
|
||||
staffArray.push(item.uname)
|
||||
})
|
||||
let bizArray = []
|
||||
res.data.bizs.forEach(item => {
|
||||
bizArray.push(item.name)
|
||||
})
|
||||
this.setData({
|
||||
staffArray:staffArray,
|
||||
staffobj: res.data.list,
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
//显示分配订单
|
||||
showTransfer(e) {
|
||||
this.setData({
|
||||
ids:[e.currentTarget.dataset.id],
|
||||
isShowTransfer:true,
|
||||
})
|
||||
},
|
||||
|
||||
//显示隐藏分配订单
|
||||
optTransfer(e) {
|
||||
this.setData({
|
||||
employee_id:'',
|
||||
employeeIndex:-1,
|
||||
isShowTransfer:!this.data.isShowTransfer,
|
||||
})
|
||||
},
|
||||
|
||||
//选择店员
|
||||
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,
|
||||
})
|
||||
},
|
||||
|
||||
//分配订单
|
||||
putAppCusorderV2Admins(){
|
||||
let that = this
|
||||
if (that.data.employeeIndex == -1 ) {
|
||||
wx.showToast({
|
||||
title: '请选择销售顾问',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
else{
|
||||
that.setData({
|
||||
submitFlag: true,
|
||||
})
|
||||
let params = {};
|
||||
params['ids'] = that.data.ids;
|
||||
params['admin_id'] = that.data.employee_id;
|
||||
_.apiQuery.putAppCusorderV2Admins(params).then(res => {
|
||||
|
||||
wx.showToast({
|
||||
title: '分配成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
that.setData({
|
||||
isShowTransfer:false,
|
||||
submitFlag:false,
|
||||
})
|
||||
that.onPullDownRefresh()
|
||||
|
||||
}).catch(res=>{
|
||||
that.setData({
|
||||
submitFlag: false,
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
//页面相关事件处理函数--监听用户下拉动作
|
||||
onPullDownRefresh(){
|
||||
this.setData({
|
||||
|
||||
+34
-3
@@ -70,7 +70,13 @@
|
||||
<block wx:for="{{item.other_data}}" wx:for-index='key' wx:for-item="pin" wx:key='i'>
|
||||
<view class="mt20 fn-clear font-28">
|
||||
<view class="fn-fl color-333">{{key}}</view>
|
||||
<view class="fn-fr wp60 text-nowrap text-right color-666">
|
||||
<block wx:if="{{key=='销售顾问'}}">
|
||||
<view class="fn-fr wp60 text-nowrap text-right">
|
||||
<text class="text-middle color-666" wx:if="{{pin.value}}">{{pin.value}}</text>
|
||||
<text class="inline-block ml10 bg-36afa2 pt5 pb5 pl15 pr15 text-middle font-22 color-fff ulib-r10" catchtap="showTransfer" data-id="{{item.id}}" wx:if="{{item.allot == 1}}">重新分配</text>
|
||||
</view>
|
||||
</block>
|
||||
<view wx:else class="fn-fr wp60 text-nowrap text-right color-666">
|
||||
<block wx:if="{{pin.type=='checkbox'}}">
|
||||
<block wx:for="{{pin.lists}}" wx:for-index='key' wx:for-item="lable" wx:key='j'>
|
||||
<view class="inline-block ml10 mr10"><i class="iconfont font-34 mr5 text-middle {{lable.selected?'icon-danxuan_xuanzhong color-36afa2':'icon-danxuan'}}" /><text class="text-middle">{{lable.value}}</text></view>
|
||||
@@ -98,7 +104,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" wx:if="{{value}}">
|
||||
<view class="fn-fl color-333">{{key}}</view>
|
||||
<view class="fn-fr wp60 text-nowrap text-right color-666">{{value}}</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="inline-block ml10 bg-36afa2 pt5 pb5 pl15 pr15 text-middle font-22 color-fff ulib-r10" catchtap="showTransfer" data-id="{{item.id}}" wx:if="{{item.allot == 1}}">重新分配</text>
|
||||
</view>
|
||||
</block>
|
||||
<view wx:else class="fn-fr wp60 text-nowrap text-right color-666">{{value}}</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
@@ -168,4 +180,23 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="search-bg fixed left-0 right-0 top-0 bottom-0" bindtap="optfilter" hidden="{{!isShowfilter}}" style="background-color:rgba(0,0,0,.5);"></view>
|
||||
<view class="search-bg fixed left-0 right-0 top-0 bottom-0" bindtap="optfilter" hidden="{{!isShowfilter}}" style="background-color:rgba(0,0,0,.5);"></view>
|
||||
|
||||
<lcb-msg isShow="{{isShowTransfer}}">
|
||||
<view slot="content">
|
||||
<view class="inner30">
|
||||
<view class="mt20 ml10 mr10 bds-2-eb inner20 font-28 color-666 fn-clear ulib-r10">
|
||||
<view class="fn-fl">销售顾问</view>
|
||||
<picker class="fn-fr wp60 text-right" bindchange="changeEmployee" value="{{employeeIndex}}" range="{{staffArray}}">
|
||||
<text class="color-ccc" wx:if="{{employeeIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{staffArray[employeeIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo color-ccc"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fn-flex ml10 mr10 pl60 pr60 pb50 text-center font-32 color-666">
|
||||
<button bindtap="optTransfer" class="fn-flex-item mr20 bds-2-36afa2 btn-no-bg wp100 font-28 color-36afa2 ulib-r750">取消</button>
|
||||
<button disabled="{{submitFlag}}" bindtap="putAppCusorderV2Admins" class="fn-flex-item ml20 btn-36afa2 wp100 font-28 color-fff ulib-r750" hover-class="btn-36afa2-hover">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</lcb-msg>
|
||||
Reference in New Issue
Block a user