diff --git a/pages/customer/allot/index.js b/pages/customer/allot/index.js index f68dad4..4d1ef73 100644 --- a/pages/customer/allot/index.js +++ b/pages/customer/allot/index.js @@ -1,5 +1,4 @@ import _ from '../../../commons/js/commons' -import popularData from '../../../commons/js/lib/popularData'; const app = getApp() Page({ data: { @@ -20,6 +19,9 @@ Page({ v_id:'',//车型级别id cfrom:'',//客户来源 o_type:'',//排序类型 + cid:[],//客户id + clerkid:'',//店员id + isShowEmployees: false, }, onLoad(options) { for (let key in options) { @@ -28,6 +30,7 @@ Page({ }) } this.getAppCustomersList() + this.getAppEmployees() }, onShow(){ @@ -105,14 +108,65 @@ Page({ }) }, - //选择客户 - radioPicker(e){ - if(e.currentTarget.dataset.index != this.data.customerIndex){ - this.setData({ - isSubmiting: false, - customerIndex:e.currentTarget.dataset.index, - }) + //选择订单 + checkboxChange(e) { + const list = this.data.list + const values = e.detail.value + for (let i = 0, lenI = list.length; i < lenI; ++i) { + list[i].checked = false + + for (let j = 0, lenJ = values.length; j < lenJ; ++j) { + if (list[i].id === values[j]) { + list[i].checked = true + break + } + } } + + this.setData({ + list:list, + cid:e.detail.value, + }) + }, + + //获取店员列表 + getAppEmployees(){ + let params = {}; + params['page'] = 1; + params['size'] = 20000; + _.apiQuery.getAppEmployees(params).then(res => { + if(res.data.total>0){ + let employeeArray = [] + res.data.list.forEach(item => { + employeeArray.push(item.uname) + }) + this.setData({ + employeeArray:employeeArray, + employeeList:res.data.list, + employeeIndex:-1, + }) + } + wx.stopPullDownRefresh() + }); + }, + + //选择店员 + changeEmployee(e) { + let clerkid = '' + if(e.detail.value >= 0){ + clerkid = this.data.employeeList[e.detail.value].id + } + this.setData({ + clerkid:clerkid, + employeeIndex:e.detail.value, + }) + }, + + //销售弹窗显示隐藏 + optEmployees(){ + this.setData({ + isShowEmployees:!this.data.isShowEmployees, + }) }, //推送链接 diff --git a/pages/customer/allot/index.wxml b/pages/customer/allot/index.wxml index 37383db..12412f6 100644 --- a/pages/customer/allot/index.wxml +++ b/pages/customer/allot/index.wxml @@ -2,29 +2,43 @@ - - - - {{item.name}} - {{item.mobile}} - - - - + + + + + + + + + + + + - + -