客户分配,选择城市地区

This commit is contained in:
老叶
2022-07-04 11:34:34 +08:00
parent 978d67eac1
commit dbf02638ed
12 changed files with 496 additions and 58 deletions
+2
View File
@@ -143,6 +143,8 @@ api = {
appCustomersComments:'app/customers/comments', //用户评论
appCityArea:'app/city/area', //获取省/市/区/街道
+7
View File
@@ -861,5 +861,12 @@ apiQuery.postAppCustomersComments = function (params) {
})
}
//获取省/市/区/街道
apiQuery.getAppCityArea = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appCityArea, 2, params, "GET", resolve, reject)
})
}
export default apiQuery;
+90
View File
@@ -30,6 +30,11 @@ Page({
of2_id:'',
of1Index:-1,
of2Index:-1,
cityIndex:-1,
city_id:'',
countyIndex:-1,
county_id:'',
},
//生命周期函数--监听页面加载
onLoad: function (options) {
@@ -283,6 +288,18 @@ Page({
icon: 'none'
})
}
else if (that.data.city_id == '' ) {
wx.showToast({
title: '请选择所在城市',
icon: 'none'
})
}
else if (that.data.county_id == '' ) {
wx.showToast({
title: '请选择所在地区',
icon: 'none'
})
}
else if (that.data.buy_time == '' ) {
wx.showToast({
title: '请选择预计购车时间',
@@ -326,6 +343,8 @@ Page({
if(this.data.of2_id != ''){
params['of2_id'] = this.data.of2_id;
}
params['city_id'] = this.data.city_id;
params['county_id'] = this.data.county_id;
params['buy_time'] = this.data.buy_time;
_.apiQuery.postAppCustomers(params).then(res => {
@@ -436,8 +455,14 @@ Page({
getAppCustomersTag(){
_.apiQuery.getAppCustomersTag().then(res => {
this.setData({
city_id:res.data.city_id,
county_id:res.data.county_id,
taglList:res.data.tags&&res.data.tags.length>0?res.data.tags:[],
})
//获取城市
this.getAppCityArea_city()
//获取地区
this.getAppCityArea_county()
});
},
@@ -460,4 +485,69 @@ Page({
})
},
//获取城市
getAppCityArea_city(){
let params = {};
params['type'] = 'city';
_.apiQuery.getAppCityArea(params).then(res => {
let cityArr = []
let cityIndex = -1
res.data.list.forEach((item,index) => {
cityArr.push(item.name)
if(this.data.city_id == item.id){
cityIndex = index
}
})
this.setData({
cityIndex,
cityArr,
city:res.data.list
})
});
},
//获取行政区
getAppCityArea_county(){
let params = {};
params['pid'] = this.data.city_id;
params['type'] = 'county';
_.apiQuery.getAppCityArea(params).then(res => {
let countyArr = []
let countyIndex = -1
res.data.list.forEach((item,index) => {
countyArr.push(item.name)
if(this.data.county_id == item.id){
countyIndex = index
}
})
this.setData({
countyIndex,
countyArr,
county:res.data.list
})
});
},
//选择城市
changeCity(e) {
if(this.data.cityIndex!=e.detail.value){
this.setData({
cityIndex:e.detail.value,
city_id:this.data.city[e.detail.value].id,
})
this.getAppCityArea_county()
}
},
//选择地区
changeCounty(e) {
if(this.data.countyIndex!=e.detail.value){
this.setData({
countyIndex:e.detail.value,
county_id:this.data.county[e.detail.value].id,
})
}
},
})
+20
View File
@@ -94,6 +94,26 @@
</view>
</view>
</block>
<view class="relative bbs-1-eb last-b-none pl140 font-28">
<view class="absolute left-0 box-middle">所在城市</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeCity" value="{{cityIndex}}" range="{{cityArr}}">
<text class="color-ccc" wx:if="{{cityIndex == -1}}">请选择</text>
<text wx:else>{{cityArr[cityIndex]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl140 font-28">
<view class="absolute left-0 box-middle">所在地区</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeCounty" value="{{countyIndex}}" range="{{countyArr}}">
<text class="color-ccc" wx:if="{{countyIndex == -1}}">请选择</text>
<text wx:else>{{countyArr[countyIndex]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl190" wx:if="{{status==0}}">
<view class="absolute left-0 box-middle font-28 color-333">预计购车时间</view>
<view class="pt30 pb30 text-right font-28 color-666">
+58 -4
View File
@@ -19,6 +19,12 @@ Page({
weekList:['日','一','二','三','四','五','六'],
dateList:[],
nextIndex:-1,//计划回访时间
distTabId:1,
distBizIndex:-1,
distBiz_id:'',
bizArray: [],
bizobj: [],
},
onLoad(options) {
for (let key in options) {
@@ -108,10 +114,17 @@ Page({
res.data.list.forEach(item => {
employeeArray.push(item.uname)
})
let bizArray = []
res.data.bizs.forEach(item => {
bizArray.push(item.name)
})
this.setData({
employeeArray:employeeArray,
employeeList:res.data.list,
employeeIndex:-1,
distributetabs:res.data.tabs,
bizArray:bizArray,
bizobj: res.data.bizs,
})
}
wx.stopPullDownRefresh()
@@ -134,6 +147,12 @@ Page({
optEmployees(){
this.setData({
isShowEmployees:!this.data.isShowEmployees,
employeeIndex:-1,
employee_id:'',
nextIndex:-1,
distTabId:1,
distBiz_id:'',
distBizIndex:-1,
})
},
@@ -147,26 +166,37 @@ Page({
//分配客户
putAppCustomersAdmins(){
let that = this
if (that.data.employeeIndex == -1 ) {
if (that.data.distTabId==1&&that.data.employeeIndex == -1 ) {
wx.showToast({
title: '请选择店员',
icon: 'none'
})
}
else if (that.data.nextIndex == -1 ) {
else if (that.data.distTabId==1&&that.data.nextIndex == -1 ) {
wx.showToast({
title: '请选择计划回访时间',
icon: 'none'
})
}
else if (that.data.distTabId==2&&that.data.distBizIndex == -1 ) {
wx.showToast({
title: '请选择门店',
icon: 'none'
})
}
else{
that.setData({
submitFlag: true,
})
let params = {};
params['ids'] = that.data.ids;
params['admin_id'] = that.data.admin_id;
params['visit_time'] = that.data.dateList[that.data.nextIndex].year +'-'+ that.data.dateList[that.data.nextIndex].month +'-'+ that.data.dateList[that.data.nextIndex].day;
if(that.data.distTabId==1){
params['admin_id'] = that.data.admin_id;
params['visit_time'] = that.data.dateList[that.data.nextIndex].year +'-'+ that.data.dateList[that.data.nextIndex].month +'-'+ that.data.dateList[that.data.nextIndex].day;
}
if(that.data.distTabId==2){
params['biz_id'] = that.data.distBiz_id;
}
_.apiQuery.putAppCustomersAdmins(params).then(res => {
wx.showToast({
@@ -308,6 +338,30 @@ Page({
}
},
//切换分配本地,其他门店
changeDistTab(e){
this.setData({
distTabId:e.currentTarget.dataset.id,
employeeIndex:-1,
employee_id:'',
nextIndex:-1,
distBiz_id:'',
distBizIndex:-1,
})
},
//分配选择门店
changeDistBiz(e) {
let distBiz_id = ''
if(e.detail.value >= 0){
distBiz_id = this.data.bizobj[e.detail.value].id
}
this.setData({
distBiz_id,
distBizIndex:e.detail.value,
})
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh(){
this.setData({
+30 -13
View File
@@ -38,21 +38,38 @@
<lcb-msg isShow="{{isShowEmployees}}">
<view slot="content">
<view class="inner40">
<view class="mt20 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="{{employeeArray}}">
<text class="color-ccc" wx:if="{{employeeIndex == -1}}">请选择</text>
<text wx:else>{{employeeArray[employeeIndex]}}</text>
<i class="iconfont ml5 icon-gengduo color-ccc"></i>
</picker>
<view class="mt10 font-28 text-center fn-flex" wx:if="{{distributetabs.length > 0}}">
<block wx:for="{{distributetabs}}" wx:key="index">
<view class="fn-flex-item relative ml10 mr10 pt20 pb20 ulib-r10 {{distTabId == item.id?'bg-36afa2 color-fff':'bg-f6'}}" bindtap="changeDistTab" data-id="{{item.id}}">{{item.name}}</view>
</block>
</view>
<view class="mt20 bds-2-eb inner20 font-28 color-666 fn-clear ulib-r10">
<view class="fn-fl">计划回访时间</view>
<view bindtap="optShowTimePicker" class="fn-fr wp60 text-right">
<text class="color-ccc" wx:if="{{nextIndex == -1}}">请选择</text>
<text wx:else>{{dateList[nextIndex].year}}-{{dateList[nextIndex].month}}-{{dateList[nextIndex].day}}</text>
<i class="iconfont ml5 icon-gengduo color-ccc"></i>
<block wx:if="{{distTabId == 1}}">
<view class="mt20 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="{{employeeArray}}">
<text class="color-ccc" wx:if="{{employeeIndex == -1}}">请选择</text>
<text wx:else>{{employeeArray[employeeIndex]}}</text>
<i class="iconfont ml5 icon-gengduo color-ccc"></i>
</picker>
</view>
<view class="mt20 bds-2-eb inner20 font-28 color-666 fn-clear ulib-r10">
<view class="fn-fl">计划回访时间</view>
<view bindtap="optShowTimePicker" class="fn-fr wp60 text-right">
<text class="color-ccc" wx:if="{{nextIndex == -1}}">请选择</text>
<text wx:else>{{dateList[nextIndex].year}}-{{dateList[nextIndex].month}}-{{dateList[nextIndex].day}}</text>
<i class="iconfont ml5 icon-gengduo color-ccc"></i>
</view>
</view>
</block>
<view class="mt20 ml10 mr10 bds-2-eb inner20 font-28 color-666 fn-clear ulib-r10" wx:else>
<view class="fn-fl">门店名称</view>
<picker class="fn-fr wp70 text-right" bindchange="changeDistBiz" value="{{distBizIndex}}" range="{{bizArray}}">
<view class="text-nowrap">
<text class="color-ccc" wx:if="{{distBizIndex == -1}}">请选择</text>
<text wx:else>{{bizArray[distBizIndex]}}</text>
<i class="iconfont ml5 icon-gengduo color-ccc"></i>
</view>
</picker>
</view>
</view>
<view class="fn-flex pl60 pr60 pb50 text-center font-32 color-666">
+89
View File
@@ -20,6 +20,11 @@ Page({
of2_id:'',
of1Index:-1,
of2Index:-1,
cityIndex:-1,
city_id:'',
countyIndex:-1,
county_id:'',
},
//生命周期函数--监听页面加载
onLoad: function (options) {
@@ -350,6 +355,18 @@ Page({
icon: 'none'
})
}
else if (that.data.city_id == '' ) {
wx.showToast({
title: '请选择所在城市',
icon: 'none'
})
}
else if (that.data.county_id == '' ) {
wx.showToast({
title: '请选择所在地区',
icon: 'none'
})
}
// else if(that.data.car_id == '' ){
// wx.showToast({
// title: '请选择车系车型',
@@ -392,6 +409,8 @@ Page({
if(that.data.of2_id != that.data.baseinfo.of_id.of2_id){
params['of2_id'] = that.data.of2_id;
}
params['city_id'] = that.data.city_id;
params['county_id'] = that.data.county_id;
// if(that.data.car_id != that.data.baseinfo.car_id.value){
// params['car_id'] = that.data.car_id;
// }
@@ -518,8 +537,14 @@ Page({
params['id'] = this.data.id;
_.apiQuery.getAppCustomersTag(params).then(res => {
this.setData({
city_id:res.data.city_id,
county_id:res.data.county_id,
taglList:res.data.tags&&res.data.tags.length>0?res.data.tags:[],
})
//获取城市
this.getAppCityArea_city()
//获取地区
this.getAppCityArea_county()
});
},
@@ -542,4 +567,68 @@ Page({
})
},
//获取城市
getAppCityArea_city(){
let params = {};
params['type'] = 'city';
_.apiQuery.getAppCityArea(params).then(res => {
let cityArr = []
let cityIndex = -1
res.data.list.forEach((item,index) => {
cityArr.push(item.name)
if(this.data.city_id == item.id){
cityIndex = index
}
})
this.setData({
cityIndex,
cityArr,
city:res.data.list
})
});
},
//获取行政区
getAppCityArea_county(){
let params = {};
params['pid'] = this.data.city_id;
params['type'] = 'county';
_.apiQuery.getAppCityArea(params).then(res => {
let countyArr = []
let countyIndex = -1
res.data.list.forEach((item,index) => {
countyArr.push(item.name)
if(this.data.county_id == item.id){
countyIndex = index
}
})
this.setData({
countyIndex,
countyArr,
county:res.data.list
})
});
},
//选择城市
changeCity(e) {
if(this.data.cityIndex!=e.detail.value){
this.setData({
cityIndex:e.detail.value,
city_id:this.data.city[e.detail.value].id,
})
this.getAppCityArea_county()
}
},
//选择地区
changeCounty(e) {
if(this.data.countyIndex!=e.detail.value){
this.setData({
countyIndex:e.detail.value,
county_id:this.data.county[e.detail.value].id,
})
}
},
})
+21 -1
View File
@@ -1,6 +1,6 @@
<view class="container">
<view class="inner30">
<view class="pl40 pr40 pt10 pb50 relative ulib-r10 box-shadow-000-10-10 overflowhidden">
<view class="pl40 pr40 pt10 pb10 relative ulib-r10 box-shadow-000-10-10 overflowhidden">
<view class="relative bbs-1-eb last-b-none pl140 font-28">
<view class="absolute left-0 box-middle">客户姓名</view>
<view>
@@ -75,6 +75,26 @@
</view>
</view>
</block>
<view class="relative bbs-1-eb last-b-none pl140 font-28">
<view class="absolute left-0 box-middle">所在城市</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeCity" value="{{cityIndex}}" range="{{cityArr}}">
<text class="color-ccc" wx:if="{{cityIndex == -1}}">请选择</text>
<text wx:else>{{cityArr[cityIndex]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl140 font-28">
<view class="absolute left-0 box-middle">所在地区</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeCounty" value="{{countyIndex}}" range="{{countyArr}}">
<text class="color-ccc" wx:if="{{countyIndex == -1}}">请选择</text>
<text wx:else>{{countyArr[countyIndex]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
</view>
</view>
<block wx:for='{{taglList}}' wx:for-item='list' wx:for-index='i' wx:key='i'>
<view class="relative mt40">
+57 -4
View File
@@ -33,6 +33,12 @@ Page({
weekList:['日','一','二','三','四','五','六'],
dateList:[],
nextIndex:-1,//计划回访时间
distTabId:1,
distBizIndex:-1,
distBiz_id:'',
bizArray: [],
bizobj: [],
},
onLoad(options) {
for (let key in options) {
@@ -253,9 +259,16 @@ Page({
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,
distributetabs:res.data.tabs,
bizArray:bizArray,
bizobj: res.data.bizs,
})
});
},
@@ -277,6 +290,10 @@ Page({
employee_id:'',
cid:[],
optLevel:'',
nextIndex:-1,
distTabId:1,
distBiz_id:'',
distBizIndex:-1,
})
}
},
@@ -296,26 +313,37 @@ Page({
//分配客户
putAppCustomersAdmins(){
let that = this
if (that.data.employeeIndex == -1 ) {
if (that.data.distTabId==1&&that.data.employeeIndex == -1 ) {
wx.showToast({
title: '请选择店员',
icon: 'none'
})
}
else if (that.data.nextIndex == -1 ) {
else if (that.data.distTabId==1&&that.data.nextIndex == -1 ) {
wx.showToast({
title: '请选择计划回访时间',
icon: 'none'
})
}
else if (that.data.distTabId==2&&that.data.distBizIndex == -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;
params['visit_time'] = that.data.dateList[that.data.nextIndex].year +'-'+ that.data.dateList[that.data.nextIndex].month +'-'+ that.data.dateList[that.data.nextIndex].day;
if(that.data.distTabId==1){
params['admin_id'] = that.data.employee_id;
params['visit_time'] = that.data.dateList[that.data.nextIndex].year +'-'+ that.data.dateList[that.data.nextIndex].month +'-'+ that.data.dateList[that.data.nextIndex].day;
}
if(that.data.distTabId==2){
params['biz_id'] = that.data.distBiz_id;
}
_.apiQuery.putAppCustomersAdmins(params).then(res => {
wx.showToast({
@@ -471,6 +499,31 @@ Page({
this.getAppCustomersList()
},
//切换分配本地,其他门店
changeDistTab(e){
this.setData({
distTabId:e.currentTarget.dataset.id,
employeeIndex:-1,
employee_id:'',
nextIndex:-1,
distBiz_id:'',
distBizIndex:-1,
})
},
//分配选择门店
changeDistBiz(e) {
let distBiz_id = ''
if(e.detail.value >= 0){
distBiz_id = this.data.bizobj[e.detail.value].id
}
this.setData({
distBiz_id,
distBizIndex:e.detail.value,
})
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh(){
this.setData({
+33 -16
View File
@@ -92,25 +92,42 @@
<lcb-msg isShow="{{isShowEmployees}}">
<view slot="content">
<view class="inner40">
<view class="mt20 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>
<view class="inner30">
<view class="mt10 font-28 text-center fn-flex" wx:if="{{distributetabs.length > 0}}">
<block wx:for="{{distributetabs}}" wx:key="index">
<view class="fn-flex-item relative ml10 mr10 pt20 pb20 ulib-r10 {{distTabId == item.id?'bg-36afa2 color-fff':'bg-f6'}}" bindtap="changeDistTab" data-id="{{item.id}}">{{item.name}}</view>
</block>
</view>
<block wx:if="{{distTabId == 1}}">
<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 class="mt20 ml10 mr10 bds-2-eb inner20 font-28 color-666 fn-clear ulib-r10">
<view class="fn-fl">计划回访时间</view>
<view bindtap="optShowTimePicker" class="fn-fr wp60 text-right">
<text class="color-ccc" wx:if="{{nextIndex == -1}}">请选择</text>
<text wx:else>{{dateList[nextIndex].year}}-{{dateList[nextIndex].month}}-{{dateList[nextIndex].day}}</text>
<i class="iconfont ml5 icon-gengduo color-ccc"></i>
</view>
</view>
</block>
<view class="mt20 ml10 mr10 bds-2-eb inner20 font-28 color-666 fn-clear ulib-r10" wx:else>
<view class="fn-fl">门店名称</view>
<picker class="fn-fr wp70 text-right" bindchange="changeDistBiz" value="{{distBizIndex}}" range="{{bizArray}}">
<view class="text-nowrap">
<text class="color-ccc" wx:if="{{distBizIndex == -1}}">请选择</text>
<text wx:else>{{bizArray[distBizIndex]}}</text>
<i class="iconfont ml5 icon-gengduo color-ccc"></i>
</view>
</picker>
</view>
<view class="mt20 bds-2-eb inner20 font-28 color-666 fn-clear ulib-r10">
<view class="fn-fl">计划回访时间</view>
<view bindtap="optShowTimePicker" class="fn-fr wp60 text-right">
<text class="color-ccc" wx:if="{{nextIndex == -1}}">请选择</text>
<text wx:else>{{dateList[nextIndex].year}}-{{dateList[nextIndex].month}}-{{dateList[nextIndex].day}}</text>
<i class="iconfont ml5 icon-gengduo color-ccc"></i>
</view>
</view>
</view>
<view class="fn-flex pl60 pr60 pb50 text-center font-32 color-666">
<view class="fn-flex ml10 mr10 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>
+56 -4
View File
@@ -81,6 +81,12 @@ Page({
weekList:['日','一','二','三','四','五','六'],
dateList:[],
nextIndex:-1,//计划回访时间
distTabId:1,
distBizIndex:-1,
distBiz_id:'',
bizArray: [],
bizobj: [],
},
onLoad(options) {
for (let key in options) {
@@ -137,9 +143,16 @@ Page({
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,
distributetabs:res.data.tabs,
bizArray:bizArray,
bizobj: res.data.bizs,
})
});
},
@@ -653,6 +666,10 @@ Page({
employee_id:'',
cid:[],
optLevel:'',
nextIndex:-1,
distTabId:1,
distBiz_id:'',
distBizIndex:-1,
})
}
},
@@ -672,26 +689,37 @@ Page({
//分配客户
putAppCustomersAdmins(){
let that = this
if (that.data.employeeIndex == -1 ) {
if (that.data.distTabId==1&&that.data.employeeIndex == -1 ) {
wx.showToast({
title: '请选择店员',
icon: 'none'
})
}
else if (that.data.nextIndex == -1 ) {
else if (that.data.distTabId==1&&that.data.nextIndex == -1 ) {
wx.showToast({
title: '请选择计划回访时间',
icon: 'none'
})
}
else if (that.data.distTabId==2&&that.data.distBizIndex == -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;
params['visit_time'] = that.data.dateList[that.data.nextIndex].year +'-'+ that.data.dateList[that.data.nextIndex].month +'-'+ that.data.dateList[that.data.nextIndex].day;
if(that.data.distTabId==1){
params['admin_id'] = that.data.employee_id;
params['visit_time'] = that.data.dateList[that.data.nextIndex].year +'-'+ that.data.dateList[that.data.nextIndex].month +'-'+ that.data.dateList[that.data.nextIndex].day;
}
if(that.data.distTabId==2){
params['biz_id'] = that.data.distBiz_id;
}
_.apiQuery.putAppCustomersAdmins(params).then(res => {
wx.showToast({
@@ -833,6 +861,30 @@ Page({
}
},
//切换分配本地,其他门店
changeDistTab(e){
this.setData({
distTabId:e.currentTarget.dataset.id,
employeeIndex:-1,
employee_id:'',
nextIndex:-1,
distBiz_id:'',
distBizIndex:-1,
})
},
//分配选择门店
changeDistBiz(e) {
let distBiz_id = ''
if(e.detail.value >= 0){
distBiz_id = this.data.bizobj[e.detail.value].id
}
this.setData({
distBiz_id,
distBizIndex:e.detail.value,
})
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh(){
this.setData({
+33 -16
View File
@@ -276,25 +276,42 @@
<lcb-msg isShow="{{isShowEmployees}}">
<view slot="content">
<view class="inner40">
<view class="mt20 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>
<view class="inner30">
<view class="mt10 font-28 text-center fn-flex" wx:if="{{distributetabs.length > 0}}">
<block wx:for="{{distributetabs}}" wx:key="index">
<view class="fn-flex-item relative ml10 mr10 pt20 pb20 ulib-r10 {{distTabId == item.id?'bg-36afa2 color-fff':'bg-f6'}}" bindtap="changeDistTab" data-id="{{item.id}}">{{item.name}}</view>
</block>
</view>
<block wx:if="{{distTabId == 1}}">
<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 class="mt20 ml10 mr10 bds-2-eb inner20 font-28 color-666 fn-clear ulib-r10">
<view class="fn-fl">计划回访时间</view>
<view bindtap="optShowTimePicker" class="fn-fr wp60 text-right">
<text class="color-ccc" wx:if="{{nextIndex == -1}}">请选择</text>
<text wx:else>{{dateList[nextIndex].year}}-{{dateList[nextIndex].month}}-{{dateList[nextIndex].day}}</text>
<i class="iconfont ml5 icon-gengduo color-ccc"></i>
</view>
</view>
</block>
<view class="mt20 ml10 mr10 bds-2-eb inner20 font-28 color-666 fn-clear ulib-r10" wx:else>
<view class="fn-fl">门店名称</view>
<picker class="fn-fr wp70 text-right" bindchange="changeDistBiz" value="{{distBizIndex}}" range="{{bizArray}}">
<view class="text-nowrap">
<text class="color-ccc" wx:if="{{distBizIndex == -1}}">请选择</text>
<text wx:else>{{bizArray[distBizIndex]}}</text>
<i class="iconfont ml5 icon-gengduo color-ccc"></i>
</view>
</picker>
</view>
<view class="mt20 bds-2-eb inner20 font-28 color-666 fn-clear ulib-r10">
<view class="fn-fl">计划回访时间</view>
<view bindtap="optShowTimePicker" class="fn-fr wp60 text-right">
<text class="color-ccc" wx:if="{{nextIndex == -1}}">请选择</text>
<text wx:else>{{dateList[nextIndex].year}}-{{dateList[nextIndex].month}}-{{dateList[nextIndex].day}}</text>
<i class="iconfont ml5 icon-gengduo color-ccc"></i>
</view>
</view>
</view>
<view class="fn-flex pl60 pr60 pb50 text-center font-32 color-666">
<view class="fn-flex ml10 mr10 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>