diff --git a/pages/customer/allot/index.js b/pages/customer/allot/index.js index 7970d25..1a04eab 100644 --- a/pages/customer/allot/index.js +++ b/pages/customer/allot/index.js @@ -14,6 +14,11 @@ Page({ employeeArray:[],//店员选择列表 employeeList:[],//店员信息列表 employeeIndex:-1,//选择店员索引 + + isShowTimePicker:false, + weekList:['日','一','二','三','四','五','六'], + dateList:[], + nextIndex:-1,//计划回访时间 }, onLoad(options) { for (let key in options) { @@ -23,6 +28,8 @@ Page({ } this.getAppCustomersList() this.getAppEmployees() + + this.getTimePicker() }, onShow(){ @@ -145,23 +152,32 @@ Page({ title: '请选择店员', icon: 'none' }) - }else{ + } + else if (that.data.nextIndex == -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; _.apiQuery.putAppCustomersAdmins(params).then(res => { wx.showToast({ title: '分配成功', icon: 'success', - duration: 2000 + duration: 2000, }) that.setData({ isShowEmployees:false, submitFlag:false, + nextIndex:-1, }) that.onPullDownRefresh() @@ -173,6 +189,125 @@ Page({ } }, + //候取当前月日历 + getTimePicker(){ + let date = new Date(); + let cYear = date.getFullYear(); //年份 + let cMonth = date.getMonth()+1; //当前月份 + let cDay = date.getDate();//当前日期 + let fweek = new Date(cYear,cMonth-1,1).getDay();//本月第一天星期几 + let days = new Date(cYear,cMonth,-1) + let cn = days.getDate()+1 //当月天数 + let rn = ''//上个月天数 + if (cMonth === 1) { + rn = 31 + } else { + rn = new Date(cYear,cMonth-1,-1).getDate()+1 + } + + let dateList = [] + for(let i=0;i14){//相差15天以上不用特意补下个月 + let lweek = new Date(cYear,cMonth-1,cn).getDay();//本月最后天星期几 + let sbu = 6 - lweek //最后一周补齐 + for(let i=1;i<=sbu;i++){ + dateList.push({ + isopt:false, + checked:false, + year:cMonth == 12?cYear+1:cYear, + month:cMonth == 12?1:cMonth+1, + day:i + }) + } + }else{ + let zbu = 15 - (cn-cDay) //至少要补多少天 + let bweek = ''//至少要补的最后一天星期几 + if(cMonth==12){ + bweek = new Date(cYear+1,1,zbu).getDay() + }else{ + bweek = new Date(cYear,cMonth,zbu).getDay() + } + let sbu = zbu + 6 - bweek //最后一周补齐 + for(let i=1;i<=sbu;i++){ + dateList.push({ + isopt:false, + checked:false, + year:cMonth == 12?cYear+1:cYear, + month:cMonth == 12?1:cMonth+1, + day:i + }) + } + } + + this.setData({ + cYear, + cMonth, + cDay, + dateList, + }) + + }, + + //显示隐藏时间选择器 + optShowTimePicker(){ + this.setData({ + isShowTimePicker:!this.data.isShowTimePicker, + }) + + let kd = 15 //可操作天数 + // if(this.data.level[this.data.levelIndex]=='H'){ + // kd = 3 + // }else if(this.data.level[this.data.levelIndex]=='A'){ + // kd = 7 + // }else if(this.data.level[this.data.levelIndex]=='B'){ + // kd = 15 + // } + let cindex = '' + let dateList = this.data.dateList + dateList.forEach((item,index) => { + if(item.year == this.data.cYear&&item.month == this.data.cMonth&&item.day == this.data.cDay){ + cindex = index + } + }) + dateList.forEach((item,index) => { + item.isopt = false + if(cindex @@ -30,16 +38,59 @@ - 销售选择 - - 请选择 - {{employeeArray[employeeIndex]}} - - + + 销售顾问 + + 请选择 + {{employeeArray[employeeIndex]}} + + + + + 计划回访时间 + + 请选择 + {{dateList[nextIndex].year}}-{{dateList[nextIndex].month}}-{{dateList[nextIndex].day}} + + + - \ No newline at end of file + + + + + + 计划回访时间 + + + + + {{item}} + + + + {{cMonth}} + + + {{item.day}} + + + + + \ No newline at end of file diff --git a/pages/customer/detail/index.js b/pages/customer/detail/index.js index 346b314..00f13b9 100644 --- a/pages/customer/detail/index.js +++ b/pages/customer/detail/index.js @@ -455,6 +455,7 @@ Page({ photos:[], defeat_reason:'',//战败理由 submitFlag:false, + nextIndex:-1, }) wx.showToast({ title: res.msg, diff --git a/pages/customer/filterList/index.js b/pages/customer/filterList/index.js index fc732a0..f285a5b 100644 --- a/pages/customer/filterList/index.js +++ b/pages/customer/filterList/index.js @@ -28,6 +28,11 @@ Page({ status_tp:'', tab:[],//回访待跟进tab visit_tab_id:'',//回访待跟进tabid + + isShowTimePicker:false, + weekList:['日','一','二','三','四','五','六'], + dateList:[], + nextIndex:-1,//计划回访时间 }, onLoad(options) { for (let key in options) { @@ -42,6 +47,8 @@ Page({ //销售顾问 this.getAppUserAdmins() + this.getTimePicker() + wx.setNavigationBarTitle({ title: this.data.title||'客户' }) @@ -261,6 +268,7 @@ Page({ employeeIndex:-1, employee_id:'', cid:[e.currentTarget.dataset.cid], + optLevel:e.currentTarget.dataset.level, }) }else{ this.setData({ @@ -268,6 +276,7 @@ Page({ employeeIndex:-1, employee_id:'', cid:[], + optLevel:'', }) } }, @@ -292,13 +301,21 @@ Page({ title: '请选择店员', icon: 'none' }) - }else{ + } + else if (that.data.nextIndex == -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; _.apiQuery.putAppCustomersAdmins(params).then(res => { wx.showToast({ @@ -309,6 +326,7 @@ Page({ that.setData({ isShowEmployees:false, submitFlag:false, + nextIndex:-1, }) that.onPullDownRefresh() @@ -320,6 +338,125 @@ Page({ } }, + //候取当前月日历 + getTimePicker(){ + let date = new Date(); + let cYear = date.getFullYear(); //年份 + let cMonth = date.getMonth()+1; //当前月份 + let cDay = date.getDate();//当前日期 + let fweek = new Date(cYear,cMonth-1,1).getDay();//本月第一天星期几 + let days = new Date(cYear,cMonth,-1) + let cn = days.getDate()+1 //当月天数 + let rn = ''//上个月天数 + if (cMonth === 1) { + rn = 31 + } else { + rn = new Date(cYear,cMonth-1,-1).getDate()+1 + } + + let dateList = [] + for(let i=0;i14){//相差15天以上不用特意补下个月 + let lweek = new Date(cYear,cMonth-1,cn).getDay();//本月最后天星期几 + let sbu = 6 - lweek //最后一周补齐 + for(let i=1;i<=sbu;i++){ + dateList.push({ + isopt:false, + checked:false, + year:cMonth == 12?cYear+1:cYear, + month:cMonth == 12?1:cMonth+1, + day:i + }) + } + }else{ + let zbu = 15 - (cn-cDay) //至少要补多少天 + let bweek = ''//至少要补的最后一天星期几 + if(cMonth==12){ + bweek = new Date(cYear+1,1,zbu).getDay() + }else{ + bweek = new Date(cYear,cMonth,zbu).getDay() + } + let sbu = zbu + 6 - bweek //最后一周补齐 + for(let i=1;i<=sbu;i++){ + dateList.push({ + isopt:false, + checked:false, + year:cMonth == 12?cYear+1:cYear, + month:cMonth == 12?1:cMonth+1, + day:i + }) + } + } + + this.setData({ + cYear, + cMonth, + cDay, + dateList, + }) + + }, + + //显示隐藏时间选择器 + optShowTimePicker(){ + this.setData({ + isShowTimePicker:!this.data.isShowTimePicker, + }) + + let kd = 15 //可操作天数 + if(this.data.optLevel=='H'){ + kd = 3 + }else if(this.data.optLevel=='A'){ + kd = 7 + }else if(this.data.optLevel=='B'){ + kd = 15 + } + let cindex = '' + let dateList = this.data.dateList + dateList.forEach((item,index) => { + if(item.year == this.data.cYear&&item.month == this.data.cMonth&&item.day == this.data.cDay){ + cindex = index + } + }) + dateList.forEach((item,index) => { + item.isopt = false + if(cindex {{value}} 待分配 - {{value?'重新分配':'分配'}} + {{value?'重新分配':'分配'}} {{value}} @@ -93,16 +93,59 @@ - 销售选择 - - 请选择 - {{staffArray[employeeIndex]}} - - + + 销售顾问 + + 请选择 + {{staffArray[employeeIndex]}} + + + + + 计划回访时间 + + 请选择 + {{dateList[nextIndex].year}}-{{dateList[nextIndex].month}}-{{dateList[nextIndex].day}} + + + - \ No newline at end of file + + + + + + 计划回访时间 + + + + + {{item}} + + + + {{cMonth}} + + + {{item.day}} + + + + + \ No newline at end of file diff --git a/pages/customer/index.js b/pages/customer/index.js index 430d066..233a3d0 100644 --- a/pages/customer/index.js +++ b/pages/customer/index.js @@ -76,6 +76,11 @@ Page({ cid:[],//分配客户ID employee_id:'',//分配销售ID employeeIndex:-1,//分配销售索引 + + isShowTimePicker:false, + weekList:['日','一','二','三','四','五','六'], + dateList:[], + nextIndex:-1,//计划回访时间 }, onLoad(options) { for (let key in options) { @@ -98,6 +103,9 @@ Page({ this.getAppUserAdmins() //线索来源 this.getAppCustomersOffline_sources() + + this.getTimePicker() + }, onShow(){ @@ -636,6 +644,7 @@ Page({ employeeIndex:-1, employee_id:'', cid:[e.currentTarget.dataset.cid], + optLevel:e.currentTarget.dataset.level, }) }else{ this.setData({ @@ -643,6 +652,7 @@ Page({ employeeIndex:-1, employee_id:'', cid:[], + optLevel:'', }) } }, @@ -667,13 +677,21 @@ Page({ title: '请选择店员', icon: 'none' }) - }else{ + } + else if (that.data.nextIndex == -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; _.apiQuery.putAppCustomersAdmins(params).then(res => { wx.showToast({ @@ -684,6 +702,7 @@ Page({ that.setData({ isShowEmployees:false, submitFlag:false, + nextIndex:-1, }) that.onPullDownRefresh() @@ -695,6 +714,125 @@ Page({ } }, + //候取当前月日历 + getTimePicker(){ + let date = new Date(); + let cYear = date.getFullYear(); //年份 + let cMonth = date.getMonth()+1; //当前月份 + let cDay = date.getDate();//当前日期 + let fweek = new Date(cYear,cMonth-1,1).getDay();//本月第一天星期几 + let days = new Date(cYear,cMonth,-1) + let cn = days.getDate()+1 //当月天数 + let rn = ''//上个月天数 + if (cMonth === 1) { + rn = 31 + } else { + rn = new Date(cYear,cMonth-1,-1).getDate()+1 + } + + let dateList = [] + for(let i=0;i14){//相差15天以上不用特意补下个月 + let lweek = new Date(cYear,cMonth-1,cn).getDay();//本月最后天星期几 + let sbu = 6 - lweek //最后一周补齐 + for(let i=1;i<=sbu;i++){ + dateList.push({ + isopt:false, + checked:false, + year:cMonth == 12?cYear+1:cYear, + month:cMonth == 12?1:cMonth+1, + day:i + }) + } + }else{ + let zbu = 15 - (cn-cDay) //至少要补多少天 + let bweek = ''//至少要补的最后一天星期几 + if(cMonth==12){ + bweek = new Date(cYear+1,1,zbu).getDay() + }else{ + bweek = new Date(cYear,cMonth,zbu).getDay() + } + let sbu = zbu + 6 - bweek //最后一周补齐 + for(let i=1;i<=sbu;i++){ + dateList.push({ + isopt:false, + checked:false, + year:cMonth == 12?cYear+1:cYear, + month:cMonth == 12?1:cMonth+1, + day:i + }) + } + } + + this.setData({ + cYear, + cMonth, + cDay, + dateList, + }) + + }, + + //显示隐藏时间选择器 + optShowTimePicker(){ + this.setData({ + isShowTimePicker:!this.data.isShowTimePicker, + }) + + let kd = 15 //可操作天数 + if(this.data.optLevel=='H'){ + kd = 3 + }else if(this.data.optLevel=='A'){ + kd = 7 + }else if(this.data.optLevel=='B'){ + kd = 15 + } + let cindex = '' + let dateList = this.data.dateList + dateList.forEach((item,index) => { + if(item.year == this.data.cYear&&item.month == this.data.cMonth&&item.day == this.data.cDay){ + cindex = index + } + }) + dateList.forEach((item,index) => { + item.isopt = false + if(cindex {{value}} 待分配 - {{value?'重新分配':'分配'}} + {{value?'重新分配':'分配'}} {{value}} @@ -275,16 +275,59 @@ - 销售选择 - - 请选择 - {{staffArray[employeeIndex]}} - - + + 销售顾问 + + 请选择 + {{staffArray[employeeIndex]}} + + + + + 计划回访时间 + + 请选择 + {{dateList[nextIndex].year}}-{{dateList[nextIndex].month}}-{{dateList[nextIndex].day}} + + + - \ No newline at end of file + + + + + + 计划回访时间 + + + + + {{item}} + + + + {{cMonth}} + + + {{item.day}} + + + + + \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index a576754..b71ae89 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -52,7 +52,7 @@ Page({ isResetbiz:false,//是否重置过BIZID isShowVersionInfo:false,//是否显示版本更新 versionInfo:{ - number:'V3.0.36', + number:'V3.0.38', list:[ // '', // '', @@ -61,8 +61,8 @@ Page({ // '', // '', - '订单新增拍照/上传身份证识别,自动填充信息,避免填错;', - '修复了客户成功经理门店切换偶尔切换不成功的bug;', + '分配客户新增 回访时间的设置;', + '优化跟进逻辑;', ], }, },