From 834dbd729668c4c0a16e5eb5a09e7b7f4e405195 Mon Sep 17 00:00:00 2001 From: wangxiaohua <1214073490@qq.com> Date: Sat, 21 Aug 2021 15:25:11 +0800 Subject: [PATCH] init --- config.js | 3 +- pages/index/customer.vue | 67 ++++++-- pages/mine/reception/addreception.vue | 211 +++++++++++++++++++++++--- pages/mine/reception/consultant.vue | 186 +++++++++++++++-------- static/images/customerEmpty.png | Bin 0 -> 36544 bytes 5 files changed, 369 insertions(+), 98 deletions(-) create mode 100644 static/images/customerEmpty.png diff --git a/config.js b/config.js index ba87998..fa995b0 100644 --- a/config.js +++ b/config.js @@ -70,7 +70,8 @@ var config = { realTimeStatistics:`${host}/cusLvStatistics/realTimeStatistics`, //首页本周工作 workThisWeek:`${host}/cusLvStatistics/workThisWeek`, - + //查询是否开启选择顾问权限 + getSelfAssignedByHouseId:`${host}/user/getSelfAssignedByHouseId`, } }; module.exports = config; \ No newline at end of file diff --git a/pages/index/customer.vue b/pages/index/customer.vue index 1155b40..939be8f 100644 --- a/pages/index/customer.vue +++ b/pages/index/customer.vue @@ -26,16 +26,16 @@ - 接待延时 - 重新指派 - 结束接待 + 接待延时 + 重新指派 + 结束接待 手机号码:{{item.phone || "--"}} - 指派顾问 + 指派顾问 @@ -85,6 +85,45 @@ this.waitCustomList=data; }); }, + //延时接待 + addTime(item) { + uni.showModal({ + content: "确定延长半小时接待时间?", + cancelColor: "#999999", + success: res => { + if (res.confirm) { + this.$u.post("/customer/delayed", { + cusId: item.id + }).then(res => { + uni.showToast({ + icon: "none", + title: "操作成功" + }) + }); + } + } + }) + }, + //结束接待 + changeEnd(id) { + uni.showModal({ + content: "确定更改当前客户接待状态为结束?", + cancelColor: "#999999", + success: res => { + if (res.confirm) { + this.$u.post("/customer/endReception", { + id + }).then(res => { + uni.showToast({ + icon: "none", + title: "操作成功" + }) + this.init(); + }); + } + } + }) + }, //新增接待 addreception(){ const { @@ -99,7 +138,6 @@ }); return } - console.log(this.waitCustomList.length) if(this.waitCustomList.length==0){ uni.navigateTo({ url: "/pages/customer/add/add" @@ -125,18 +163,21 @@ } }else{ uni.navigateTo({ - url: "/pages/customer/add/add" - }) + url: '/pages/mine/reception/addreception' + }); } - // uni.navigateTo({ - // url: '/pages/mine/reception/addreception' - // }); + }, - goConsultant(){ + assign(item) { + let url = `/pages/mine/reception/consultant?id=${item.id}` + if (item.beforeAgentId) { + url += `&beforeAgentId=${item.beforeAgentId}`; + } uni.navigateTo({ - url: '/pages/mine/reception/consultant' - }); + url: url + }) }, + }, }; diff --git a/pages/mine/reception/addreception.vue b/pages/mine/reception/addreception.vue index 4503dc1..fd986d5 100644 --- a/pages/mine/reception/addreception.vue +++ b/pages/mine/reception/addreception.vue @@ -6,7 +6,7 @@ 客户姓名 - + @@ -14,29 +14,33 @@ 客户性别 - - + + 男士 + 女士 联系电话 - + 接待人数 - - + + + {{i + 1}} + - + 客户来源 - - + + {{parames.sourceName||'请选择客户来源'}} @@ -44,22 +48,27 @@ - 顾问 - - + 顾问 + 接待顾问 - - 请选择接待顾问 + + {{text || '请选择接待顾问'}} - - + - 确定 + 确定 + + + + + + + @@ -71,18 +80,178 @@ export default { data() { return { - + Showhiddenunits:false, + list: [ + {label: '自然到访',value:'自然到访'}, + {label: '渠道推荐',value:'渠道推荐'}, + ], + parames: { + name: '', + // 性别1男 2女 + sex: 1, + phone: '', + source: null, + sourceName: null, + howMany: 1, + agentId:null, + projectId:'' + }, + shifoinfo:0, + freeList:[], + Showhid:false, + text:null }; }, onShow: function() { - + this.parames.projectId=uni.getStorageSync('buildingID').id; + this.init() + this.getFreeList(); }, methods: { - + save() { + const { + dataCode + } = uni.getStorageSync("weapp_session_userInfo_data"); + + if (this.parames.name.length==0) { + uni.showToast({ + icon: "none", + title: "客户姓名不能为空" + }) + return; + } + if (this.parames.phone && !this.$u.test.mobile(this.parames.phone)) { + uni.showToast({ + icon: "none", + title: "手机号码格式不正确" + }) + return; + } + uni.showLoading({ + title: "保存中", + mask: true + }) + if (dataCode == 6) { + this.$u.post("/customer/gwAdd", this.parames).then(res => { + uni.hideLoading(); + uni.showToast({ + icon: "none", + title: "保存成功" + }) + // uni.setStorageSync('addcustomer', true) + uni.navigateBack() + }) + } else { + this.$u.post("/customer/add", this.parames).then(res => { + uni.hideLoading(); + uni.showToast({ + icon: "none", + title: "保存成功" + }) + // uni.setStorageSync('addcustomer', true) + uni.navigateBack() + }) + } + }, + changeSex(sex) { + this.parames.sex = sex; + }, + changeHowMany(num) { + this.parames.howMany = num; + }, + clickShowhid(){ + if(this.freeList.length==0){ + uni.showToast({ + icon:'none', + title: '当前无可用排班顾问', + duration: 2000 + }); + }else{ + this.Showhid=true; + } + }, + cancel1(){ + this.Showhid=false; + }, + confirm1(e) { + this.text=e[0].label; + this.parames.agentId=e[0].value; + this.Showhid=false; + }, + + Buildingselection(){ + this.Showhiddenunits=true; + }, + cancel(){ + this.Showhiddenunits=false; + }, + confirm(e) { + this.parames.sourceName=e[0].value; + this.Showhiddenunits=false; + }, + init(){ + uni.request({ + url: config.service.getSelfAssignedByHouseId+"?houseId="+this.parames.projectId, + method: "GET", + header: { + 'content-type': 'application/json', + 'Access-Token': uni.getStorageSync('weapp_session_login_data').token + }, + success: (data) => { + if(data.data.code==10000){ + this.shifoinfo=data.data.data.selfAssigned + } + } + }) + }, + //获取顾问列表 + getFreeList() { + this.$u.get("/zkAgentPool/freeList?itemId="+this.parames.projectId).then(res => { + this.freeList = res; + this.freeList.forEach(item=>{ + item.label=item.name; + item.value=item.agentId + }) + }) + }, } };