diff --git a/pages/mine/reception/addreception.vue b/pages/mine/reception/addreception.vue index 315ea21..d2a024f 100644 --- a/pages/mine/reception/addreception.vue +++ b/pages/mine/reception/addreception.vue @@ -2,11 +2,13 @@ 客户信息 - + 客户姓名 - + @@ -19,14 +21,16 @@ 女士 - + 联系电话 - + - + 接待人数 @@ -35,11 +39,12 @@ {{i + 1}} - - + + 客户来源 - + {{showSourceName}} 请选择客户来源 @@ -47,13 +52,14 @@ - + 顾问 接待顾问 - + {{text}} 请选择接待顾问 @@ -61,18 +67,21 @@ - + - - 确定 - 确定 - + + 确定 + - - + + - - + + @@ -83,7 +92,7 @@ export default { data() { return { - Showhiddenunits:false, + Showhiddenunits: false, list: [ // {label: '自然到访',value:'自然到访'}, // {label: '渠道推荐',value:'渠道推荐'}, @@ -96,26 +105,26 @@ source: null, sourceId: null, howMany: 1, - agentId:null, - projectId:'', - replaceReception:0 + agentId: null, + projectId: '', + replaceReception: 0 }, showSourceName: '', // 展示文字 - shifoinfo:0, - freeList:[], - Showhid:false, - text:null, - show:false, + shifoinfo: 0, + freeList: [], + Showhid: false, + text: null, + show: false, content: '东临碣石,以观沧海', - confirmtext:'1',//确认文字 - canceltext:'2',//取消文字 - daitiReceptionobj:{}, - saveisshow:true, - + confirmtext: '1', //确认文字 + canceltext: '2', //取消文字 + daitiReceptionobj: {}, + saveisshow: true, + }; }, onShow() { - this.parames.projectId=uni.getStorageSync('buildingID').id; + this.parames.projectId = uni.getStorageSync('buildingID').id; this.init() this.getFreeList(); this.getFromSource(); @@ -124,7 +133,7 @@ // 获取客户来源 getFromSource() { uni.request({ - url: config.service.sourceList+"?houseId="+this.parames.projectId, + url: config.service.sourceList + "?houseId=" + this.parames.projectId, method: "GET", header: { 'content-type': 'application/json', @@ -132,41 +141,39 @@ }, success: (data) => { console.log(data) - if(data.data.code==10000){ + if (data.data.code == 10000) { // this.shifoinfo=data.data.data.selfAssigned this.list = data.data.data } } }) }, - + //取消 - confirmA(){ - if(this.daitiReceptionobj.assign!=null){ - this.parames.agentId=this.daitiReceptionobj.assign.accountId; + confirmA() { + if (this.daitiReceptionobj.assign != null) { + this.parames.agentId = this.daitiReceptionobj.assign.accountId; this.baochunfun() - }else{ + } else { uni.showToast({ icon: "none", - title: "【"+this.daitiReceptionobj.owner.name+"】正在接待中" + title: "【" + this.daitiReceptionobj.owner.name + "】正在接待中" }) return; } }, // 确认 - confirmB(){ - this.parames.agentId=this.daitiReceptionobj.replacement.accountId; - this.parames.replaceReception=1; + confirmB() { + this.parames.agentId = this.daitiReceptionobj.replacement.accountId; + this.parames.replaceReception = 1; this.baochunfun() }, save() { - this.saveisshow=false; - if (this.parames.name.length==0) { + if (this.parames.name.length == 0) { uni.showToast({ icon: "none", title: "客户姓名不能为空" }) - this.saveisshow=true; return; } if (this.parames.phone && !this.$u.test.mobile(this.parames.phone)) { @@ -174,54 +181,54 @@ icon: "none", title: "手机号码格式不正确" }) - this.saveisshow=true; return; } - const that = this; this.$u.post("customer/daitiReception", { phone: that.parames.phone, projectId: that.parames.projectId, - agentId:that.parames.agentId + agentId: that.parames.agentId }).then(res => { - if(res.unchecked==0){ + if (res.unchecked == 0) { that.baochunfun() - }else{ - if(res.zs==0){ - that.parames.agentId=res.assign.accountId; + } else { + if (res.zs == 0) { + that.parames.agentId = res.assign.accountId; that.baochunfun() - }else{ + } else { console.log("zo") - if(res.assign==null&&res.replacement==null){ + if (res.assign == null && res.replacement == null) { that.baochunfun() - }else{ - if(res.assign==null){ - that.daitiReceptionobj=res; - that.content="此客户的顾问为【"+ res.owner.name +"】,确认让【"+ res.replacement.name +"】代接待吗?" - that.confirmtext=res.replacement.name +"代接待",//确认文字 - that.canceltext=res.owner.name +'接待',//取消文字 - that.show=true; - }else{ - that.daitiReceptionobj=res; + } else { + if (res.assign == null) { + that.daitiReceptionobj = res; + that.content = "此客户的顾问为【" + res.owner.name + "】,确认让【" + res.replacement.name + + "】代接待吗?" + that.confirmtext = res.replacement.name + "代接待", //确认文字 + that.canceltext = res.owner.name + '接待', //取消文字 + that.show = true; + } else { + that.daitiReceptionobj = res; console.log(that.daitiReceptionobj) - that.content="此客户的顾问为【"+ res.owner.name +"】,确认让【"+ res.replacement.name +"】代接待吗?" - that.confirmtext=res.replacement.name +"代接待",//确认文字 - that.canceltext=res.assign.name +'接待',//取消文字 - that.show=true; + that.content = "此客户的顾问为【" + res.owner.name + "】,确认让【" + res.replacement.name + + "】代接待吗?" + that.confirmtext = res.replacement.name + "代接待", //确认文字 + that.canceltext = res.assign.name + '接待', //取消文字 + that.show = true; } } } } }).catch(e => { - that.show=true; + that.show = true; }) }, - baochunfun(){ + baochunfun() { const { dataCode } = uni.getStorageSync("weapp_session_userInfo_data"); - if(this.parames.phone.length==0){ - this.parames.phone=null + if (this.parames.phone.length == 0) { + this.parames.phone = null } uni.showLoading({ title: "保存中", @@ -229,7 +236,7 @@ }) if (dataCode == 6) { this.$u.post("/customer/gwAdd", this.parames).then(res => { - this.saveisshow=true; + this.saveisshow = true; uni.hideLoading(); uni.showToast({ icon: "none", @@ -239,7 +246,7 @@ }) } else { this.$u.post("/customer/add", this.parames).then(res => { - this.saveisshow=true; + this.saveisshow = true; uni.hideLoading(); uni.showToast({ icon: "none", @@ -255,190 +262,201 @@ changeHowMany(num) { this.parames.howMany = num; }, - clickShowhid(){ - if(this.freeList.length==0){ + clickShowhid() { + if (this.freeList.length == 0) { uni.showToast({ - icon:'none', - title: '当前无可用排班顾问', - duration: 2000 + icon: 'none', + title: '当前无可用排班顾问', + duration: 2000 }); - }else{ - this.Showhid=true; + } else { + this.Showhid = true; } }, - cancel1(){ - this.Showhid=false; + cancel1() { + this.Showhid = false; }, confirm1(e) { - this.text=e[0].label; - this.parames.agentId=e[0].value; - this.Showhid=false; + this.text = e[0].label; + this.parames.agentId = e[0].value; + this.Showhid = false; }, - - Buildingselection(){ - this.Showhiddenunits=true; + + Buildingselection() { + this.Showhiddenunits = true; }, - cancel(){ - this.Showhiddenunits=false; + cancel() { + this.Showhiddenunits = false; }, confirm(e) { console.log(e) this.showSourceName = e[0].label; - this.parames.sourceId=e[0].value; - this.Showhiddenunits=false; + this.parames.sourceId = e[0].value; + this.Showhiddenunits = false; }, - init(){ + init() { uni.request({ - url: config.service.getSelfAssignedByHouseId+"?houseId="+this.parames.projectId, + 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 + 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=>{ - if(item.onLine==0){ - item.label=item.name+"(离线)"; - }else if(item.onLine==1){ - item.label=item.name+"(在线)"; - }else{ - item.label=item.name+"(无设备)"; + this.$u.get("/zkAgentPool/freeList?itemId=" + this.parames.projectId).then(res => { + this.freeList = res; + this.freeList.forEach(item => { + if (item.onLine == 0) { + item.label = item.name + "(离线)"; + } else if (item.onLine == 1) { + item.label = item.name + "(在线)"; + } else { + item.label = item.name + "(无设备)"; } - item.value=item.agentId + item.value = item.agentId + }) }) - }) }, } }; diff --git a/utils/domain.js b/utils/domain.js index 654cf98..9905e5c 100644 --- a/utils/domain.js +++ b/utils/domain.js @@ -4,12 +4,12 @@ // const baseUrl = 'http://192.168.31.89:9090/api';// sh // const baseUrl = 'http://121.42.63.138:9091/autoSR/api';// 测试站 // const baseUrl = 'http://192.168.31.92:8080/api';// 测试站 -const baseUrl = 'http://81.70.55.170:9090/autoSR/api';// 测试站 +// const baseUrl = 'http://81.70.55.170:9090/autoSR/api';// 测试站 // const baseUrl = 'http://192.168.31.167:8080/autoSR/api'; // 长龙 // const baseUrl = 'http://192.168.31.134:8080/autoSR/api'; // 佳豪 // const baseUrl = 'http://10.2.1.104:8081/autoSR/api'; // 刘敏 // const baseUrl = 'https://zkgj.quhouse.com/api'; // 质控正式 -// const baseUrl = 'https://hfju.com/api'; // 数智正式 +const baseUrl = 'https://hfju.com/api'; // 数智正式 // config使用域名 /**192.168.31.167