From 5dabd1ebef8c189909bff2631271da037d94b5b4 Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Tue, 20 May 2025 16:45:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(market):=20=E6=B7=BB=E5=8A=A0=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=AE=A2=E6=88=B7=E8=B5=84=E6=BA=90=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 xs_editCustomerResources 接口用于编辑客户资源 - 实现编辑客户资源的页面和功能,包括客户基础信息和六要素信息的展示和修改 - 优化客户资源详情页面,增加编辑详情按钮和相关功能 - 修复客户资源详情页面的数据显示问题 --- api/apiRoute.js | 7 ++++ pages/market/clue/clue_info.vue | 9 +++- pages/market/clue/edit_clues.vue | 71 ++++++++++++++++++++++++++------ 3 files changed, 74 insertions(+), 13 deletions(-) diff --git a/api/apiRoute.js b/api/apiRoute.js index 238abee..c2bb466 100644 --- a/api/apiRoute.js +++ b/api/apiRoute.js @@ -146,6 +146,13 @@ export default { return res; }) }, + //销售端-客户资源-编辑 + xs_editCustomerResources(data = {}) { + let url = '/customerResources/edit' + return http.post(url, data).then(res => { + return res; + }) + }, //销售端-资源共享-列表 xs_resourceSharingIndex(data = {}) { let url = '/resourceSharing/index' diff --git a/pages/market/clue/clue_info.vue b/pages/market/clue/clue_info.vue index 91e17b5..5d21baa 100644 --- a/pages/market/clue/clue_info.vue +++ b/pages/market/clue/clue_info.vue @@ -258,7 +258,7 @@ - 编辑详情 + 编辑详情 拨打电话 修改记录 @@ -358,6 +358,13 @@ url: `/pages/market/clue/writing_followUp` }) }, + //跳转页面-编辑客户详情 + openEditClues(){ + let resource_sharing_id = this.resource_sharing_id//共享资源表id + uni.navigateTo({ + url: `/pages/market/clue/edit_clues?resource_sharing_id=${resource_sharing_id}` + }) + }, //跳转页面-转接跟进任务 openViewNewTask() { uni.navigateTo({ diff --git a/pages/market/clue/edit_clues.vue b/pages/market/clue/edit_clues.vue index 02ef163..663475b 100644 --- a/pages/market/clue/edit_clues.vue +++ b/pages/market/clue/edit_clues.vue @@ -586,6 +586,7 @@ export default { is_submit: true,//是否提交(防止重复提交)|true=可提交,false=不可提交 + resource_sharing_id:'',//resource_sharing_id(资源共享表id) //表单 formData: { // 客户基础信息 @@ -701,14 +702,15 @@ export default { ], } }, + onLoad(options) { + this.resource_sharing_id = options.resource_sharing_id//共享资源表id + }, onShow() { this.init() }, methods: { //初始化 async init() { - //获取登录用户信息 - this.getUserInfo() await this.getDict('source_channel')//获取字典-来源渠道 await this.getDict('source')//获取字典-来源 await this.getDict('purchasing_power')//获取字典-购买力 @@ -717,11 +719,17 @@ export default { await this.getDict('status')//获取字典-客户状态 // this.getStaffList()//获取人员列表 // this.getAreaTree()//获取地区树形结构 + + await this.getInfo()//获取资源共享-详情(客户资源详情) }, - //获取用户信息 - async getUserInfo(){ - let res = await apiRoute.getPersonnelInfo({}) + //获取资源共享-详情(客户资源详情) + async getInfo(){ + let params = { + resource_sharing_id: this.resource_sharing_id + } + + let res = await apiRoute.xs_resourceSharingInfo(params)//资源共享-详情(客户资源详情) if (res.code != 1) { uni.showToast({ title: res.msg, @@ -730,11 +738,50 @@ export default { return } - this.userInfo = res.data + let customerResource = res.data.customerResource || {}//客户资源详情 + let sixSpeed = res.data.customerResource.sixSpeed || {}//六要素详情 + console.log('详情',res.data) + + + this.formData = { + resource_sharing_id:this.resource_sharing_id,//资源共享表id + // 客户基础信息 + id: customerResource.id || '',//客户资源表id + source_channel: customerResource.source_channel || '',//来源渠道 + source: customerResource.source || '',//来源 + name: customerResource.name || '',//姓名 + age: customerResource.age || '',//年龄 + gender: customerResource.gender || '',//性别|male-男性, female-女性, other-其他 + phone_number: customerResource.phone_number || '',//联系电话 + demand: customerResource.demand || '',//需求 + decision_maker: customerResource.decision_maker || '',//决策人 + initial_intent: customerResource.initial_intent || '',//客户初步意向度: high-高, medium-中, low-低 + status: customerResource.status || '',//客户状态: active-活跃, inactive-不活跃, pending-待定 + + //六要素信息 + purchasing_power: sixSpeed.purchase_power || '',//购买力 + cognitive_idea: sixSpeed.concept_awareness || '',//认知理念 + communication: sixSpeed.communication || '',//沟通备注 + staff_id: sixSpeed.staff_id || '',//人员ID + distance: sixSpeed.distance || '',//距离 + promised_visit_time: sixSpeed.promised_visit_time || '',//承诺到访时间 + optional_class_time: sixSpeed.preferred_class_time || ''//可选上课时间 + } + + this.formData.promised_visit_time = this.$util.formatToDateTime(sixSpeed.promised_visit_time, 'Y-m-d H:i');//格式化时间(Y-m-d H:i) + this.formData.optional_class_time = this.$util.formatToDateTime(sixSpeed.promised_visit_time, 'Y-m-d H:i');//格式化时间(Y-m-d H:i) + + //下拉窗文本回显 + this.picker_config.source_channel.text = customerResource.source_channel_name || '点击选择'//来源渠道 + this.picker_config.source.text = customerResource.source_name || '点击选择'//来源 + this.picker_config.consultant.text = customerResource.consultant_name || '点击选择'//顾问 + this.picker_config.initial_intent.text = customerResource.initial_intent_name || '点击选择'//客户初步意向度 + this.picker_config.status.text = customerResource.status_name || '点击选择'//客户状态 + + //六要素相关 + this.picker_config.purchasing_power.text = sixSpeed.purchase_power_name || '点击选择'//购买力 + this.picker_config.cognitive_idea.text = sixSpeed.concept_awareness_name || '点击选择'//认知理念 - this.formData.consultant = res.data.id//顾问id - this.formData.staff_id = res.data.id//人员ID - this.picker_config['consultant'].text = res.data.name//顾问名字 }, //获取字典-课程id选择 @@ -1291,7 +1338,7 @@ export default { } this.is_submit = false - let res = await apiRoute.xs_addCustomerResources(data) + let res = await apiRoute.xs_editCustomerResources(data) this.is_submit = true @@ -1308,9 +1355,9 @@ export default { }) //延迟1s执行 setTimeout(() => { - //跳转页面-线索列表 + //跳转页面-客户详情列表 uni.navigateTo({ - url: `/pages/market/clue/index` + url: `/pages/market/clue/clue_info?resource_sharing_id=${this.resource_sharing_id}` }) }, 1000) },