feat: crm receivable

This commit is contained in:
xingyu4j
2025-05-29 19:58:40 +08:00
parent d71d312237
commit 5424775317
6 changed files with 621 additions and 45 deletions

View File

@@ -65,12 +65,28 @@ const [Modal, modalApi] = useVbenModal({
}
// 加载数据
const data = modalApi.getData<CrmReceivableApi.Receivable>();
if (!data || !data.id) {
if (!data) {
return;
}
const { receivable, plan } = data;
modalApi.lock();
try {
formData.value = await getReceivable(data.id as number);
if (receivable) {
formData.value = await getReceivable(receivable.id as number);
} else if (plan) {
formData.value = plan.id
? {
planId: plan.id,
price: plan.price,
returnType: plan.returnType,
customerId: plan.customerId,
contractId: plan.contractId,
}
: {
customerId: plan.customerId,
contractId: plan.contractId,
};
}
// 设置到 values
await formApi.setValues(formData.value);
} finally {