diff --git a/pages/customer/index.js b/pages/customer/index.js
index 2e88097..28b1d98 100644
--- a/pages/customer/index.js
+++ b/pages/customer/index.js
@@ -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({
diff --git a/pages/customer/index.wxml b/pages/customer/index.wxml
index 5eb18cb..4430921 100644
--- a/pages/customer/index.wxml
+++ b/pages/customer/index.wxml
@@ -68,7 +68,13 @@
{{key}}
- 待分配
+
+
+ {{value}}
+ 待分配
+ {{value?'重新分配':'分配'}}
+
+
{{value}}
@@ -257,4 +263,21 @@
-
\ No newline at end of file
+
+
+
+
+
+ 销售选择
+
+ 请选择
+ {{staffArray[employeeIndex]}}
+
+
+
+
+
+
+
+
+
\ No newline at end of file