Browse Source

修改bug

master
王泽彦 9 months ago
parent
commit
105f75417d
  1. 12
      common/util.js
  2. 4
      pages/market/clue/add_clues.vue
  3. 188
      pages/market/clue/edit_clues.vue
  4. 163
      pages/market/clue/index.vue

12
common/util.js

@ -1,5 +1,5 @@
import {img_domian} from "./config";
import marketApi from '@/api/market.js';
import marketApi from '@/api/apiRoute.js';
function formatTime(time) {
if (typeof time !== 'number' || time < 0) {
@ -231,13 +231,17 @@ async function getDict(dictKey) {
return cache.data;
}
// 缓存无效,请求接口
const res = await marketApi.common_Dictionary({ dictKey });
const res = await marketApi.common_Dictionary({ key: dictKey });
if (res && res.code === 1) {
// 处理接口返回的数据,确保返回格式一致
// 接口返回的是 [{name: "抖音", value: "1", sort: 0, memo: ""}, ...]
const formattedData = Array.isArray(res.data) ? res.data : [];
uni.setStorageSync(cacheKey, {
data: res.data,
data: formattedData,
expire: now + 3600 * 1000
});
return res.data;
return formattedData;
} else {
return [];
}

4
pages/market/clue/add_clues.vue

@ -904,8 +904,8 @@ export default {
return
}
let arr = []
//
(dictionary.dictionary || dictionary).forEach((v)=>{
// [{name: "", value: "1", sort: 0, memo: ""}, ...]
dictionary.forEach((v) => {
arr.push({ text: v.name, value: v.value })
})
this.picker_config[inputName].options = arr

188
pages/market/clue/edit_clues.vue

@ -27,6 +27,21 @@
</view>
</view>
</fui-form-item>
<!-- 来源渠道 -->
<fui-form-item
v-if="formData.source == 1"
label="来源渠道"
labelSize='26'
prop="source_channel"
background='#434544'
labelColor='#fff'
:bottomBorder='false'>
<view class="input-title" style="margin-right:14rpx;">
<view class="input-title" style="margin-right:14rpx;" @click="openCicker('source_channel')">
{{ formData.source_channel ? picker_config.source_channel.text : '点击选择' }}
</view>
</view>
</fui-form-item>
<!-- 姓名 -->
<fui-form-item label="姓名" labelSize='26' prop="name" background='#434544' labelColor='#fff' :bottomBorder='false'>
<view class="input-title" style="margin-right:14rpx;">
@ -198,17 +213,17 @@
<fui-form-item label="是否报名" labelSize='26' prop="is_bm" background='#434544' labelColor='#fff' :bottomBorder='false'>
<view class="input-title" style="margin-right:14rpx;">
<fui-radio-group name="radio" v-model="formData.is_bm" >
<fui-radio-group name="radio" v-model="formData.is_bm" :disabled="true">
<view class="fui-list__item" style="display: flex;justify-content: flex-end;">
<fui-label>
<view class="fui-align__center">
<fui-radio :value="1" checked></fui-radio>
<fui-radio :value="1" :disabled="true"></fui-radio>
<text class="fui-text">报名</text>
</view>
</fui-label>
<fui-label :margin="['0','0','0','40rpx']">
<view class="fui-align__center">
<fui-radio :value="2"></fui-radio>
<fui-radio :value="2" :disabled="true"></fui-radio>
<text class="fui-text">未报名</text>
</view>
</fui-label>
@ -463,18 +478,41 @@
methods: {
//
async init() {
await this.getDict('source_channel') //-
await this.getDict('source') //-
await this.getDict('purchasing_power') //-
await this.getDict('initial_intent') //-
await this.getDict('cognitive_idea') //-
await this.getDict('status') //-
await this.getDict('decision_maker') //-
await this.getDict('distance') //-
// this.getStaffList()//
// this.getAreaTree()//
await this.getInfo() //-()
try {
uni.showLoading({
title: '加载中...',
mask: true
});
//
const dictPromises = [
this.getDict('source_channel'), //-
this.getDict('source'), //-
this.getDict('purchasing_power'), //-
this.getDict('initial_intent'), //-
this.getDict('cognitive_idea'), //-
this.getDict('status'), //-
this.getDict('decision_maker'), //-
this.getDict('distance'), //-
];
await Promise.all(dictPromises);
//
await this.get_campus_list();
//
await this.getInfo();
} catch (error) {
console.error('初始化失败:', error);
uni.showToast({
title: '加载数据失败,请重试',
icon: 'none'
});
} finally {
uni.hideLoading();
}
},
async get_campus_list(){
@ -538,6 +576,7 @@
decision_maker: customerResource.decision_maker || '', //
initial_intent: customerResource.initial_intent || '', //: high-, medium-, low-
status: customerResource.status || '', //: active-, inactive-, pending-
campus: customerResource.campus || '', //
//
purchasing_power: sixSpeed.purchase_power || '', //
@ -554,24 +593,72 @@
this.formData.promised_visit_time = this.$util.formatToDateTime(sixSpeed.promised_visit_time,
'Y-m-d'); //(Y-m-d H:i)
this.formData.optional_class_time = this.$util.formatToDateTime(sixSpeed.promised_visit_time,
this.formData.optional_class_time = this.$util.formatToDateTime(sixSpeed.preferred_class_time,
'Y-m-d'); //(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 || '点击选择' //
//
await this.get_campus_list()
this.picker_config.decision_maker.text = customerResource.decision_maker || '点击选择' //
//
await this.setPickerText()
},
//
this.picker_config.purchasing_power.text = sixSpeed.purchase_power_name || '点击选择' //
this.picker_config.cognitive_idea.text = sixSpeed.concept_awareness_name || '点击选择' //
this.picker_config.distance.text = sixSpeed.distance || '点击选择' //
//
async setPickerText() {
const { customerResource = {}, sixSpeed = {} } = await this.getResourceDetail() || {}
//
this.setPickerTextByValue('source_channel', this.formData.source_channel, customerResource.source_channel_name)
this.setPickerTextByValue('source', this.formData.source, customerResource.source_name)
this.setPickerTextByValue('consultant', this.formData.consultant, customerResource.consultant_name)
this.setPickerTextByValue('initial_intent', this.formData.initial_intent, customerResource.initial_intent_name)
this.setPickerTextByValue('status', this.formData.status, customerResource.status_name)
this.setPickerTextByValue('decision_maker', this.formData.decision_maker, customerResource.decision_maker_name || customerResource.decision_maker)
this.setPickerTextByValue('campus', this.formData.campus, customerResource.campus_name)
//
this.setPickerTextByValue('purchasing_power', this.formData.purchasing_power, sixSpeed.purchase_power_name)
this.setPickerTextByValue('cognitive_idea', this.formData.cognitive_idea, sixSpeed.concept_awareness_name)
this.setPickerTextByValue('distance', this.formData.distance, sixSpeed.distance_name || sixSpeed.distance)
},
//
setPickerTextByValue(pickerName, value, defaultText) {
if (!value) {
this.picker_config[pickerName].text = '点击选择'
return
}
await this.get_campus_list()//
//
const options = this.picker_config[pickerName].options || []
const option = options.find(opt => opt.value == value)
if (option) {
this.picker_config[pickerName].text = option.text
} else if (defaultText) {
// 使
this.picker_config[pickerName].text = defaultText
} else {
this.picker_config[pickerName].text = '点击选择'
}
},
//
async getResourceDetail() {
if (this._resourceDetail) {
return this._resourceDetail
}
let params = {
resource_sharing_id: this.resource_sharing_id
}
let res = await apiRoute.xs_resourceSharingInfo(params)
if (res.code == 1) {
this._resourceDetail = res.data
return res.data
}
return null
},
//-id
@ -705,25 +792,17 @@
return
}
let res = await apiRoute.common_Dictionary({
key: key
})
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
// 使 util.getDict
let dictionary = await this.$util.getDict(key)
if(!dictionary || !Array.isArray(dictionary) || dictionary.length === 0){
uni.showToast({ title: '暂无选项', icon: 'none' })
return
}
let dictionary = res.data.dictionary
let arr = []
dictionary.forEach((v, k) => {
arr.push({
text: v.name,
value: v.value,
})
// [{name: "", value: "1", sort: 0, memo: ""}, ...]
dictionary.forEach((v) => {
arr.push({ text: v.name, value: v.value })
})
if (inputName == 'source_channel') {
@ -733,10 +812,6 @@
value: '0',
})
}
if (inputName == 'status') {
//arr
console.log(arr)
}
this.picker_config[inputName].options = arr
},
@ -971,15 +1046,26 @@
changeCicker(e) {
console.log('监听-下拉选择器', this.picker_input_name, e)
let input_name = this.picker_input_name
//
this.formData[input_name] = e.value
this.picker_config[input_name]['text'] = e.text
//
this.picker_config[input_name].text = e.text
//
if (input_name == 'source') {
if (e.value != 1) {
this.formData.source_channel = '0' //0=线
if (e.value == 1) {
// 线
this.formData.source_channel = ''
this.picker_config.source_channel.text = '点击选择'
} else {
this.formData.source_channel = '' //线
// 线
this.formData.source_channel = '0' //0=线
this.picker_config.source_channel.text = '线下'
}
}
this.cancelCicker()
},
//

163
pages/market/clue/index.vue

@ -15,7 +15,8 @@
</view>
</view>
<view class="card" v-for="(v,k) in tableList_1" :key="k">
<view style="width: 70%;" @click="clue_info(v)">
<view class="card-content">
<view class="card-left" @click="clue_info(v)">
<view style="display: flex;align-items: center;padding: 20rpx;">
<view>
<image :src="$util.img('/uniapp_src/static/images/index/myk.png')" class="card-image">
@ -27,44 +28,50 @@
<view class="card-con">
所属校区{{ v.customerResource.campus_name }}
</view>
<view class="card-con">
来源渠道{{ v.customerResource.source_channel }} <!-- <span
class="card-con-span">{{ v.customerResource.source_channel }}</span> -->
来源{{ v.customerResource.source }}
</view>
<view class="card-date">
<view class="card-con">
{{ $util.formatToDateTime((v.customerResource.updated_at || ''), 'm-d H:i') }}
跟进
来源渠道{{ v.customerResource.source_channel }}
</view>
</view>
<view class="card-right">
<!--只有注册了member表的账号才可操作IM对话-->
<view class="btn-item" v-if="v.customerResource.member_id" @click.stop>
<image :src="$util.img('/uniapp_src/static/images/index/message.png')" class="image"
@click.stop="openViewMyMessage(v)"></image>
</view>
<view class="btn-item" v-if="v.customerResource.phone_number" @click.stop>
<image :src="$util.img('/uniapp_src/static/images/index/phone.png')" class="image"
@click.stop="dialTel(v)">
</image>
</view>
</view>
</view>
<view class="card-footer">
<view class="card-date">
<view class="card-con" v-if="v.customerResource.communication_time">
{{ $util.formatToDateTime((v.customerResource.communication_time || ''), 'm-d H:i') }}
拨打电话
</view>
<view class="card-con" v-else>
暂未联系
</view>
<view style="margin-left: 30rpx;">
<view style="display: flex;align-items: center;">
<view class="title-x">
是否有效{{ v.sixSpeed && v.sixSpeed.efficacious === 1 ? '有效' : '无效' }}
</view>
<view style="padding: 12rpx;">
<image v-if="v.customerResource.initial_intent == 'high'"
:src="$util.img('/uniapp_src/static/images/index/intention3.png')"
class="drop-image-x"></image>
<image v-else-if="v.customerResource.initial_intent == 'medium'"
<image v-if="v.sixSpeed.efficacious === 1"
:src="$util.img('/uniapp_src/static/images/index/intention2.png')"
class="drop-image-x"></image>
<image v-else :src="$util.img('/uniapp_src/static/images/index/intention1.png')"
<image v-else :src="$util.img('/uniapp_src/static/images/index/intention3.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">
是否有效{{ v.customerResource && v.customerResource.initial_intent_name || '' }}</view>
</view>
</view>
</view>
</view>
<!--只有注册了member表的账号才可操作IM对话-->
<view style="width: 15%;">
<image v-if="v.customerResource.member_id"
:src="$util.img('/uniapp_src/static/images/index/message.png')" class="image"
@click="openViewMyMessage(v)"></image>
</view>
<view style="width: 15%;">
<image v-if="v.customerResource.phone_number"
:src="$util.img('/uniapp_src/static/images/index/phone.png')" class="image" @click="dialTel(v)">
</image>
</view>
</view>
</scroll-view>
@ -81,7 +88,8 @@
</view>
</view>
<view class="card" v-for="(v,k) in tableList_2" :key="k">
<view style="width: 80%;">
<view class="card-content">
<view class="card-left">
<view style="display: flex;align-items: center;padding: 20rpx;">
<view>
<image :src="$util.img('/uniapp_src/static/images/index/myk.png')" class="card-image">
@ -94,9 +102,20 @@
决策人{{v.customerResource.name}} <span
class="card-con-span">{{v.customerResource.decision_maker}}</span>
</view>
</view>
<view class="card-right">
<view class="btn-item" @click.stop="openAssign(v)">
<view class="ling">分配</view>
</view>
</view>
</view>
<view class="card-footer">
<view class="card-date">
<view class="card-con">
{{ $util.formatToDateTime((v.customerResource.updated_at || ''),'m-d H:i') }} 跟进
<view class="card-con" v-if="v.customerResource.communication_time">
{{ $util.formatToDateTime((v.customerResource.communication_time || ''),'m-d H:i') }} 拨打电话
</view>
<view class="card-con" v-else>
暂未联系
</view>
<view style="margin-left: 30rpx;">
<view style="display: flex;align-items: center;">
@ -116,9 +135,6 @@
</view>
</view>
</view>
<view style="width: 20%;" @click="openAssign(v)">
<view class="ling">分配</view>
</view>
</view>
</scroll-view>
@ -238,7 +254,7 @@
shared_at_str: '', //|(Y-m-d)-(Y-m-d)
phone_number: '', //-
name: '', //-
campus_name:'',
campus_name: '',
},
//
tableList_1: [], //
@ -253,7 +269,7 @@
shared_at_str: '', //|[(Y-m-d),(Y-m-d)]
phone_number: '', //-
name: '', //-
campus_name:'',
campus_name: '',
},
//
tableList_2: [], //
@ -274,7 +290,7 @@
//
showDrawer: false, //|false=
showDrawerForm: {
campus_name:'',
campus_name: '',
shared_at_str: '', //|[(Y-m-d),(Y-m-d)]
phone_number: '', //-
name: '', //-
@ -358,11 +374,11 @@
//
async getPersonnelAll(campus='') {
async getPersonnelAll(campus = '') {
let res = await apiRoute.common_getPersonnelAll({
personnel_id: this.userInfo.id, //id
account_type: 'market', //|teacher=,market=
campus:campus
campus: campus
})
if (res.code != 1) {
uni.showToast({
@ -411,10 +427,6 @@
//
if (this.filteredData_1.page * this.filteredData_1.limit > this.filteredData_1.total) {
this.loading = false
uni.showToast({
title: '暂无更多',
icon: 'none'
})
return
}
@ -470,10 +482,6 @@
//
if (this.filteredData_2.page * this.filteredData_2.limit > this.filteredData_2.total) {
this.loading = false
uni.showToast({
title: '暂无更多',
icon: 'none'
})
return
}
@ -556,7 +564,9 @@
return;
}
uni.makePhoneCall({
phoneNumber: tel,
success: () => {
let param = {
staff_id: this.userInfo.id, //id
resource_id: item.customerResource.id, //ID
@ -566,18 +576,15 @@
remarks: null, //
tag: null, //
}
let res = await apiRoute.xs_communicationRecordsAdd(param) //
if (res.code != 1) {
apiRoute.xs_communicationRecordsAdd(param).then(ressuccess=>{
if(ressuccess.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
uni.makePhoneCall({
phoneNumber: tel
})
}
})
},
@ -756,7 +763,55 @@
background: #434544;
border-radius: 16rpx;
display: flex;
flex-direction: column;
.card-content {
display: flex;
justify-content: space-between;
.card-left {
flex: 1;
padding-right: 10rpx;
}
.card-right {
min-width: 120rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 20rpx;
.btn-item {
margin-bottom: 20rpx;
display: flex;
justify-content: center;
align-items: center;
width: 80rpx;
height: 80rpx;
background-color: rgba(255, 255, 255, 0.1);
border-radius: 50%;
&:last-child {
margin-bottom: 0;
}
.image {
width: 60rpx;
height: 60rpx;
}
}
}
}
.card-footer {
width: 100%;
border-top: 1rpx solid rgba(255, 255, 255, 0.1);
padding: 20rpx;
box-sizing: border-box;
background-color: rgba(0, 0, 0, 0.1);
border-radius: 0 0 16rpx 16rpx;
}
}
.card-image {
@ -810,8 +865,8 @@
}
.image {
width: 70rpx;
height: 70rpx;
width: 60rpx;
height: 60rpx;
}
.neck {

Loading…
Cancel
Save