Browse Source

feat(market): 添加编辑客户资源功能

- 新增 xs_editCustomerResources 接口用于编辑客户资源
- 实现编辑客户资源的页面和功能,包括客户基础信息和六要素信息的展示和修改
- 优化客户资源详情页面,增加编辑详情按钮和相关功能
- 修复客户资源详情页面的数据显示问题
master
liutong 10 months ago
parent
commit
5dabd1ebef
  1. 7
      api/apiRoute.js
  2. 9
      pages/market/clue/clue_info.vue
  3. 71
      pages/market/clue/edit_clues.vue

7
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'

9
pages/market/clue/clue_info.vue

@ -258,7 +258,7 @@
<!-- 底部按钮组-->
<view class="bottom-label">
<view @click="openViewWritingFollowUp()">编辑详情</view>
<view @click="openEditClues()">编辑详情</view>
<view @click="callTel(clientInfo.student_phone)">拨打电话</view>
<view @click="openViewNewTask()">修改记录</view>
</view>
@ -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({

71
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)
},

Loading…
Cancel
Save