接待 线索类型的客户逻辑
This commit is contained in:
@@ -51,8 +51,17 @@
|
||||
<text>{{ tag.text }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="customer-footer" v-if="item.phone || item.budget">
|
||||
<text class="customer-phone" v-if="item.phone">{{ item.phone }}</text>
|
||||
<view class="customer-footer">
|
||||
<view class="customer-footer-left">
|
||||
<text
|
||||
class="customer-phone"
|
||||
v-if="item.phone"
|
||||
@click.stop="copyPhone(item.phone)"
|
||||
>{{ item.phone }}</text>
|
||||
<view class="reception-link-wrap" @click.stop="goPrepareReception(item)">
|
||||
<text class="reception-link-text">准备接待</text>
|
||||
</view>
|
||||
</view>
|
||||
<text class="customer-budget" v-if="item.budget">{{ item.budget }}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -62,6 +71,9 @@
|
||||
|
||||
<script>
|
||||
import { getApiUrl } from '@/common/config.js';
|
||||
|
||||
/** 与 furniture_reception_entry 读取的 key 一致 */
|
||||
const RECEPTION_FORM_PREFILL_KEY = 'workbench-reception-form-prefill';
|
||||
|
||||
export default {
|
||||
name: 'CustomerList',
|
||||
@@ -88,6 +100,97 @@
|
||||
this.loadCustomerList();
|
||||
},
|
||||
methods: {
|
||||
copyPhone(phone) {
|
||||
const text = (phone || '').toString().trim();
|
||||
if (!text) return;
|
||||
uni.setClipboardData({
|
||||
data: text,
|
||||
success: () => {
|
||||
uni.showToast({ title: '复制成功', icon: 'success' });
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({ title: '复制失败', icon: 'none' });
|
||||
}
|
||||
});
|
||||
},
|
||||
buildReceptionPrefillPayload(item) {
|
||||
const r = item.rawData || {};
|
||||
const s = (v) => {
|
||||
if (v === undefined || v === null) return '';
|
||||
return String(v).trim();
|
||||
};
|
||||
const prefill = {};
|
||||
const idStr = s(r.id);
|
||||
if (idStr) {
|
||||
prefill.id = idStr;
|
||||
}
|
||||
const customerName = s(r.customerName) || s(item.name);
|
||||
if (customerName) {
|
||||
prefill.customerName = customerName;
|
||||
}
|
||||
const contact = s(r.contact) || s(item.phone);
|
||||
if (contact) {
|
||||
prefill.contact = contact;
|
||||
}
|
||||
const customerSource = s(r.customerSource);
|
||||
if (customerSource) {
|
||||
prefill.customerSource = customerSource;
|
||||
}
|
||||
const gender = s(r.gender);
|
||||
if (gender) {
|
||||
prefill.gender = gender;
|
||||
}
|
||||
const age = s(r.age);
|
||||
if (age) {
|
||||
prefill.age = age;
|
||||
}
|
||||
const dealershipId = s(r.dealershipId);
|
||||
if (dealershipId) {
|
||||
prefill.dealershipId = dealershipId;
|
||||
}
|
||||
const dealershipName = s(r.dealershipName);
|
||||
if (dealershipName) {
|
||||
prefill.dealershipName = dealershipName;
|
||||
}
|
||||
const intendedModel = s(r.intendedModel) || s(item.budget);
|
||||
if (intendedModel) {
|
||||
prefill.intendedModel = intendedModel;
|
||||
}
|
||||
const infoCard = s(r.infoCard);
|
||||
if (infoCard) {
|
||||
prefill.infoCard = infoCard;
|
||||
}
|
||||
const remark = s(r.remark);
|
||||
if (remark) {
|
||||
prefill.remark = remark;
|
||||
}
|
||||
const detailedAddress = s(r.detailedAddress);
|
||||
if (detailedAddress) {
|
||||
prefill.detailedAddress = detailedAddress;
|
||||
}
|
||||
const rc = Number(r.recordingCount);
|
||||
prefill.recordingCount = Number.isFinite(rc) ? rc : (Number(item.serviceCount) || 0);
|
||||
const cc = Number(r.contactCount);
|
||||
prefill.contactCount = Number.isFinite(cc) ? cc : (Number(item.serviceCount) || 0);
|
||||
return prefill;
|
||||
},
|
||||
goPrepareReception(item) {
|
||||
try {
|
||||
const prefill = this.buildReceptionPrefillPayload(item);
|
||||
uni.setStorageSync(RECEPTION_FORM_PREFILL_KEY, JSON.stringify(prefill));
|
||||
} catch (e) {
|
||||
console.error('[CustomerList] 准备接待预填写入失败:', e);
|
||||
uni.showToast({ title: '预填数据失败', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages-subpackage/furniture_reception/furniture_reception_entry?tab=reception',
|
||||
fail: (err) => {
|
||||
console.error('[CustomerList] 跳转接待页失败:', err);
|
||||
uni.showToast({ title: '页面跳转失败', icon: 'none' });
|
||||
}
|
||||
});
|
||||
},
|
||||
onInputChange() {
|
||||
// 输入框变化时,可以在这里添加实时搜索逻辑(如果需要)
|
||||
},
|
||||
@@ -413,6 +516,23 @@
|
||||
margin-bottom: 20rpx;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
/* 与 furniture_reception/serviceListFurniture 中状态文案(如 service-status-indicator__text)一致的轻量文字链,接近常见「线索」类入口 */
|
||||
.reception-link-wrap {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
padding: 8rpx 0 6rpx;
|
||||
border-bottom: 1rpx solid rgba(0, 122, 255, 0.38);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.reception-link-text {
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
color: #007aff;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.tag-item {
|
||||
padding: 8rpx 16rpx;
|
||||
@@ -443,16 +563,30 @@
|
||||
align-items: center;
|
||||
padding-top: 16rpx;
|
||||
border-top: 1px solid #F0F0F0;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.customer-footer-left {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 16rpx;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.customer-phone {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
padding: 8rpx 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.customer-budget {
|
||||
font-size: 26rpx;
|
||||
color: #1976D2;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user