查看跟进详细

This commit is contained in:
WindowBird 2025-11-10 10:02:02 +08:00
parent f8d41c7f3b
commit 22554d7638
2 changed files with 57 additions and 21 deletions

View File

@ -281,6 +281,18 @@ export const getCustomerStatusDict = () => {
});
};
/**
* 获取客户跟进方式字典数据
* @returns {Promise} 返回字典数据数组包含 dictLabel dictValue
*/
export const getCustomerFollowTypeDict = () => {
return uni.$uv.http.get(`system/dict/data/type/customer_follow_type`, {
custom: {
auth: true
}
});
};
/**
* 获取微信列表
* @returns {Promise} 返回微信列表 { total: number, rows: array }

View File

@ -24,9 +24,7 @@
<text class="user-name">{{ followupDetail.userName || '--' }}</text>
<text class="user-role">销售经理</text>
</view>
<view class="follow-time">
<text class="time-text">{{ formatDateTime(followupDetail.followTime) }}</text>
</view>
</view>
</view>
@ -66,14 +64,18 @@
<!-- 下次跟进 -->
<view class="info-card" v-if="followupDetail.nextFollowTime">
<view class="card-title">下次跟进</view>
<view class="card-title">时间信息</view>
<view class="info-row">
<text class="info-label">跟进时间</text>
<text class="info-value">{{ formatDateTime(followupDetail.followTime) }}</text>
</view>
<view class="info-row">
<text class="info-label">下次跟进</text>
<text class="info-value">{{ formatDateTime(followupDetail.nextFollowTime) }}</text>
</view>
<view class="info-row" v-if="followupDetail.nextFollowContent">
<text class="info-label">跟进内容</text>
<text class="info-value">{{ followupDetail.nextFollowContent }}</text>
<view class="info-row" v-if="followupDetail.createTime">
<text class="info-label">创建时间</text>
<text class="info-value">{{ followupDetail.createTime }}</text>
</view>
</view>
@ -104,6 +106,10 @@
<text class="info-label">客户意向</text>
<text class="info-value">{{ formatIntents(followupDetail.intents) }}</text>
</view>
<view class="info-row" v-if="followupDetail.followType || followupDetail.followMethod || followupDetail.type">
<text class="info-label">跟进方式</text>
<text class="info-value">{{ getFollowTypeText(followupDetail.followType || followupDetail.followMethod || followupDetail.type) }}</text>
</view>
</view>
<!-- 备注信息 -->
@ -133,18 +139,7 @@
</view>
</view>
<!-- 时间信息 -->
<view class="info-card">
<view class="card-title">时间信息</view>
<view class="info-row" v-if="followupDetail.createTime">
<text class="info-label">创建时间</text>
<text class="info-value">{{ formatDateTime(followupDetail.createTime) }}</text>
</view>
<view class="info-row" v-if="followupDetail.updateTime">
<text class="info-label">更新时间</text>
<text class="info-value">{{ formatDateTime(followupDetail.updateTime) }}</text>
</view>
</view>
</view>
</scroll-view>
@ -166,7 +161,7 @@
<script setup>
import { ref, computed, onMounted } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { getFollowupDetail } from '@/common/api/customer';
import { getFollowupDetail, getCustomerFollowTypeDict } from '@/common/api/customer';
//
const followId = ref('');
@ -174,6 +169,9 @@ const followupDetail = ref({});
const loading = ref(false);
const error = ref('');
//
const followTypeOptions = ref([]);
//
const hasAnalysis = computed(() => {
return followupDetail.value.concern ||
@ -224,6 +222,18 @@ onLoad((options) => {
}
});
//
const loadFollowTypeDict = async () => {
try {
const res = await getCustomerFollowTypeDict();
if (res && Array.isArray(res)) {
followTypeOptions.value = res;
}
} catch (err) {
console.error('加载跟进方式字典失败:', err);
}
};
//
const loadFollowupDetail = async () => {
if (!followId.value) return;
@ -232,7 +242,12 @@ const loadFollowupDetail = async () => {
error.value = '';
try {
const res = await getFollowupDetail(followId.value);
//
const [res] = await Promise.all([
getFollowupDetail(followId.value),
loadFollowTypeDict()
]);
if (res) {
followupDetail.value = res;
} else {
@ -323,6 +338,15 @@ const getIntentStrengthText = (intentLevel) => {
return levelMap[intentLevel] || '--';
};
//
const getFollowTypeText = (followTypeValue) => {
if (!followTypeValue) return '--';
//
const option = followTypeOptions.value.find(item => item.dictValue === String(followTypeValue));
return option ? option.dictLabel : '--';
};
//
const previewFollowupImages = (images, currentIndex) => {
if (!images || images.length === 0) return;