优化提示信息
This commit is contained in:
@@ -172,6 +172,16 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getApiUrl } from "@/common/config.js";
|
import { getApiUrl } from "@/common/config.js";
|
||||||
|
import { store } from "@/common/store.js";
|
||||||
|
|
||||||
|
function firstNonEmptyString(...parts) {
|
||||||
|
for (const p of parts) {
|
||||||
|
if (p === undefined || p === null) continue;
|
||||||
|
const s = String(p).trim();
|
||||||
|
if (s) return s;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -507,8 +517,15 @@ export default {
|
|||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
|
||||||
if (finishRes.statusCode === 200 && finishRes.data && finishRes.data.success) {
|
if (finishRes.statusCode === 200 && finishRes.data && finishRes.data.success) {
|
||||||
|
const rawSuccessMsg = finishRes.data?.message || '结束服务成功';
|
||||||
|
const successTitle = rawSuccessMsg
|
||||||
|
.replace(/[A-Za-z]+/g, '')
|
||||||
|
.split(/\n/)
|
||||||
|
.map((line) => line.trim())
|
||||||
|
.filter(Boolean)
|
||||||
|
.join('\n') || '结束服务成功';
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: finishRes.data?.message || '结束服务成功',
|
title: successTitle,
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
});
|
});
|
||||||
// 结束成功后刷新列表
|
// 结束成功后刷新列表
|
||||||
@@ -608,6 +625,29 @@ export default {
|
|||||||
headers['X-Tenant-Id'] = tenantId;
|
headers['X-Tenant-Id'] = tenantId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let loginResponse = {};
|
||||||
|
try {
|
||||||
|
loginResponse = uni.getStorageSync("backend-login-response") || {};
|
||||||
|
} catch (e) {
|
||||||
|
console.error("读取登录信息失败:", e);
|
||||||
|
}
|
||||||
|
const ui = store.userInfo || {};
|
||||||
|
// 与接待页、列表筛选一致:销售电话优先手机号,否则登录账号
|
||||||
|
const salesPhone = firstNonEmptyString(
|
||||||
|
loginResponse.phone,
|
||||||
|
loginResponse.userName,
|
||||||
|
ui.username
|
||||||
|
);
|
||||||
|
// 姓名:优先后端姓名类字段,再退回昵称、登录名
|
||||||
|
const salesName = firstNonEmptyString(
|
||||||
|
loginResponse.realName,
|
||||||
|
loginResponse.name,
|
||||||
|
loginResponse.nickName,
|
||||||
|
ui.nickname,
|
||||||
|
loginResponse.userName,
|
||||||
|
ui.username
|
||||||
|
);
|
||||||
|
|
||||||
// 构建请求参数(必须包含id)
|
// 构建请求参数(必须包含id)
|
||||||
const params = {
|
const params = {
|
||||||
id: this.currentSupplementItem.id,
|
id: this.currentSupplementItem.id,
|
||||||
@@ -615,7 +655,9 @@ export default {
|
|||||||
customerName: this.supplementForm.customerName?.trim() || "",
|
customerName: this.supplementForm.customerName?.trim() || "",
|
||||||
customerPhone: trimmedContact || "",
|
customerPhone: trimmedContact || "",
|
||||||
recordingName: this.supplementForm.recordingName?.trim() || "",
|
recordingName: this.supplementForm.recordingName?.trim() || "",
|
||||||
remarks: this.supplementForm.remarks?.trim() || ""
|
remarks: this.supplementForm.remarks?.trim() || "",
|
||||||
|
SalesPhone: salesPhone,
|
||||||
|
SalesName: salesName
|
||||||
};
|
};
|
||||||
|
|
||||||
// 调用补录接口
|
// 调用补录接口
|
||||||
|
|||||||
Reference in New Issue
Block a user