From f08ab71af3e4eda8c54532c7ce451e5303a4f15f Mon Sep 17 00:00:00 2001 From: lancer <1905818361@qq.com> Date: Thu, 26 Aug 2021 13:42:10 +0800 Subject: [PATCH] init --- pages/center/Piabodata/TrendAnalysis.vue | 18 +- pages/center/consumer/edit.vue | 248 ++++++++++++----------- 2 files changed, 149 insertions(+), 117 deletions(-) diff --git a/pages/center/Piabodata/TrendAnalysis.vue b/pages/center/Piabodata/TrendAnalysis.vue index ab4035c..ad44a09 100644 --- a/pages/center/Piabodata/TrendAnalysis.vue +++ b/pages/center/Piabodata/TrendAnalysis.vue @@ -91,24 +91,38 @@ 选择一级: - + + + {{Selectlevelobj.name}} + + + + 选择二级: - + + + {{erSelectlevelobj.name}} + + diff --git a/pages/center/consumer/edit.vue b/pages/center/consumer/edit.vue index 00bde26..6db2e98 100644 --- a/pages/center/consumer/edit.vue +++ b/pages/center/consumer/edit.vue @@ -38,7 +38,7 @@ - + @@ -54,7 +54,7 @@ 客户等级 - + @@ -76,7 +76,7 @@ 备注内容 - + @@ -87,84 +87,33 @@ 客户标签 - - - - 置业需求 - - - - - - {{item.label}} - - - - - - - 意向面积 - - - - - - {{item.label}} - - - - - - - 预算 - - - - - - - - - 关注点 - - - - - - - - - 客户来源 - - - - - - {{item.label}} - - + + + + + + {{item.name}} + + + + + {{item1.label}} + + + + - + 确定 - + @@ -189,20 +138,12 @@ sex:'1', phone:'', chatNo:'', - lelve:'', - demand:{ - // 户型 - roomModel:'', - // 面积 - acreage:'', - // 客户来源 - // 预算 - // 关注点 - } + level:'', + remarks:'', }, selectform:{ - lelve:'', + level:'', stage:'', demand:'', area:'', @@ -211,10 +152,10 @@ soure:'', }, - lelveshow:false, + levelshow:false, customerId:'', // 等级 - lelvelist:[ + levellist:[ { value:1, label:'A' @@ -232,17 +173,18 @@ label:'D' }, ], - stagelist:[], - // 置业需求 - demandlist:[], - // 意向面积 - arealist:[], - // 预算 - budgetlist:[], - // 关注点 - foucelist:[], - // 客户来源 - sourelist:[], + allList:[], + // stagelist:[], + // // 置业需求 + // demandlist:[], + // // 意向面积 + // arealist:[], + // // 预算 + // budgetlist:[], + // // 关注点 + // foucelist:[], + // // 客户来源 + // sourelist:[], } }, onLoad(e) { @@ -252,6 +194,29 @@ this.getdetail() }, methods:{ + Edittag(item,item1,index,i){ + // var selected=''; + // console.log(item,item1,index,i) + // return + if(this.allList[index].children[i].selected==0){ + this.allList[index].children[i].selected=1; + }else{ + this.allList[index].children[i].selected=0; + } + this.$forceUpdate() + + // this.$u.post("/matchKeywords/updatePersonalMatchData", { + // carId: this.customerId, + // selected:selected, + // name:chend.name, + // pid:chend.pid, + // level:chend.level, + // endName:chend.endName, + // keywordsId:chend.keywordsId + // }).then(res => { + + // }) + }, sourecheck(index){ this.sourelist[index].checked=!this.sourelist[index].checked this.$forceUpdate() @@ -264,9 +229,9 @@ this.arealist[index].checked=!this.arealist[index].checked this.$forceUpdate() }, - lelveshowCallback(e){ - this.selectform.lelve=e[0].label - this.form.lelve=e[0].value + levelshowCallback(e){ + this.selectform.level=e[0].label + this.form.level=e[0].value }, // 获取用户数据 getdetail(){ @@ -275,9 +240,9 @@ // console.log(res) this.form=res // 给客户等级赋值 - let idx= this.lelvelist.findIndex(item=>item.value==res.level) + let idx= this.levellist.findIndex(item=>item.value==res.level) if(idx!=-1){ - this.selectform.lelve=this.lelvelist[idx].label + this.selectform.level=this.levellist[idx].label } // 获取置业需求 this.getListByType() @@ -289,23 +254,73 @@ }, // 字典表接口 getListByType(){ - this.$u.get("/matchKeywords/findPersonalMatchData?",{customerId:this.customerId}) + this.$u.get("/matchKeywords/findPersonalMatchData",{customerId:this.customerId}) .then(res=>{ - console.log(res) - return - // 处理回显问题 - - // 置业需求 - // console.log(this.demandlist) - this.demandlist.map(item=>{ - // console.log(this.form.demand.demandType) - if((this.form.demand.demandType+'').includes(item.value)){ - item.checked=true - }else{ - item.checked=false - } + // console.log(res) + res.forEach(item1=>{ + item1.children.map(item=>{ + if(item.isInterval==0){ + item.label=item.name+item.unit+'-'+item.endName+item.unit; + }else{ + item.label=item.name + } + item.value=item.id; }) - // 意向面积 + }) + // console.log(res) + this.allList=res + // return + }) + }, + // 提交 + submit(){ + let param={} + let str=[] + if(this.form.name==''){ + uni.showToast({ + title:'请输入客户姓名', + icon:'none' + }) + return + } + if(this.form.phone==''){ + uni.showToast({ + title:'请输入手机号', + icon:'none' + }) + return + } + if(!(/^1[3456789]\d{9}$/.test(this.form.phone))){ + uni.showToast({ + title: "请检查手机号码格式", + icon:'none' + }); + // this.form.phone='' + return false; + } + + this.allList.map(item=>{ + item.children.map(item1=>{ + if(item1.selected==0){ + str.push(item1.keywordsId) + } + }) + }) + str=str.join(',') + param=this.form + param.keywordIds=str + console.log(param) + // return + this.$u.post("customer/update",param) + .then(res=>{ + // console.log(res) + uni.showToast({ + title:'操作成功', + icon:'none', + success: () => { + uni.navigateBack() + } + }) }) }, @@ -382,6 +397,9 @@ font-weight: 400; color: #FFFFFF; line-height: 88rpx; + position: fixed; + bottom: 20rpx; + left: 20rpx; } } .con-msg-con{