add product

This commit is contained in:
Timi
2026-09-03 14:27:40 +08:00
parent 7f669621fb
commit 333999fe21
63 changed files with 5662 additions and 2210 deletions
+10 -1
View File
@@ -274,6 +274,9 @@ const customerDisplayText = computed(() => {
async function handleCustomerChange(value: string | string[]): Promise<void> {
selectedCustomerIdList.value = Array.isArray(value) ? value : [value];
if (isPackagePurchaseSelected.value) {
resetPackageRequestNo();
}
await loadSelectedCustomerList();
await loadRecentRecordList();
}
@@ -601,6 +604,7 @@ const {
handleEventSelectionChange,
applySelectedPackageEvent,
resetPackagePurchaseForm,
resetPackageRequestNo,
submitPackagePurchase,
validatePackagePurchaseForm
} = usePackagePurchaseRecord({
@@ -635,8 +639,9 @@ async function submitRecord(): Promise<void> {
return;
}
const packageResult = isPackagePurchaseSelected.value ? await submitPackagePurchase() : undefined;
const success = isPackagePurchaseSelected.value
? await submitPackagePurchase()
? !!packageResult?.id
: await submitEventRecords();
if (!success) {
return;
@@ -645,6 +650,10 @@ async function submitRecord(): Promise<void> {
await loadRecentRecordList();
await settingStore.playRegisterSuccessSound();
Message.success(isPackagePurchaseSelected.value ? "套餐购买已提交" : "登记已提交");
if (packageResult?.id) {
await router.replace(`/management/customer-packages/${packageResult.id}`);
return;
}
await router.replace("/customers");
} finally {
isSaving.value = false;