use Message instead of Toast
This commit is contained in:
@@ -172,7 +172,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { type Attachment, AttachmentAPI, useUserStore } from "timi-web";
|
||||
import { Toast } from "tdesign-mobile-vue";
|
||||
import { Message } from "@/utils/message";
|
||||
import CustomerAPI from "@/api/CustomerAPI";
|
||||
import TagAPI from "@/api/TagAPI";
|
||||
import BodyAreaSelector from "@/components/BodyAreaSelector.vue";
|
||||
@@ -266,7 +266,7 @@ async function applyIntroducer(code: string): Promise<void> {
|
||||
formData.introducerCustomer = undefined;
|
||||
introducerCustomerId.value = "";
|
||||
scannerVisible.value = false;
|
||||
Toast.warning(`未匹配到 ${code} 编码介绍人,请选择或扫码已有客户`);
|
||||
Message.warning(`未匹配到 ${code} 编码介绍人,请选择或扫码已有客户`);
|
||||
return;
|
||||
}
|
||||
formData.introducerCustomerId = matched.id;
|
||||
@@ -394,7 +394,7 @@ async function loadDetail() {
|
||||
introducerCustomerId.value = customer.introducerCustomerId || customer.introducerCustomer?.id || "";
|
||||
} catch (err) {
|
||||
console.warn("客户详情加载失败", err);
|
||||
Toast.error("客户详情加载失败");
|
||||
Message.error("客户详情加载失败");
|
||||
}
|
||||
}
|
||||
onMounted(loadDetail);
|
||||
@@ -480,11 +480,11 @@ function validateCustomerPhotoList(): boolean {
|
||||
|
||||
const attachTypeSet = new Set(photoItemList.value.map(item => item.attachType));
|
||||
if (!attachTypeSet.has("PHOTO")) {
|
||||
Toast.warning("请上传客户照片");
|
||||
Message.warning("请上传客户照片");
|
||||
return false;
|
||||
}
|
||||
if (!attachTypeSet.has("POINT_CARD")) {
|
||||
Toast.warning("请上传积分卡照片");
|
||||
Message.warning("请上传积分卡照片");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -523,10 +523,10 @@ async function doSubmit(): Promise<void> {
|
||||
}
|
||||
if (!canSubmit.value) {
|
||||
if (!formData.name?.trim()) {
|
||||
Toast.warning("请填写姓名");
|
||||
Message.warning("请填写姓名");
|
||||
return;
|
||||
}
|
||||
Toast.warning("当前门店未设置");
|
||||
Message.warning("当前门店未设置");
|
||||
return;
|
||||
}
|
||||
if (!validateCustomerPhotoList()) {
|
||||
@@ -552,13 +552,13 @@ async function doSubmit(): Promise<void> {
|
||||
|
||||
if (isCreateMode.value) {
|
||||
await CustomerAPI.create(payload);
|
||||
Toast.success("创建成功");
|
||||
Message.success("创建成功");
|
||||
const redirect = String(route.query.redirect || "");
|
||||
await router.replace(redirect || "/management/customers");
|
||||
return;
|
||||
} else {
|
||||
await CustomerAPI.update(payload);
|
||||
Toast.success("保存成功");
|
||||
Message.success("保存成功");
|
||||
const redirect = String(route.query.redirect || "");
|
||||
if (redirect) {
|
||||
await router.replace(redirect);
|
||||
|
||||
Reference in New Issue
Block a user