feat: crm receivable
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user