fix: bugs

This commit is contained in:
xingyu4j
2025-06-25 18:22:06 +08:00
parent d94dbe73e1
commit 2855eb4e08
19 changed files with 178 additions and 51 deletions

View File

@@ -16,9 +16,11 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
rules: 'required',
componentProps: {
api: getCustomerSimpleList,
labelField: 'name',
valueField: 'id',
api: () => getCustomerSimpleList(),
fieldNames: {
label: 'name',
value: 'id',
},
placeholder: '请选择客户',
},
},
@@ -121,9 +123,11 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '客户',
component: 'ApiSelect',
componentProps: {
api: getCustomerSimpleList,
labelField: 'name',
valueField: 'id',
api: () => getCustomerSimpleList(),
fieldNames: {
label: 'name',
value: 'id',
},
placeholder: '请选择客户',
},
},

View File

@@ -40,7 +40,12 @@ function onRefresh() {
/** 创建回款计划 */
function handleCreate() {
formModalApi.setData(null).open();
formModalApi
.setData({
contractId: props.contractId,
customerId: props.customerId,
})
.open();
}
/** 创建回款 */

View File

@@ -66,6 +66,8 @@ const [Modal, modalApi] = useVbenModal({
// 加载数据
const data = modalApi.getData<CrmReceivablePlanApi.Plan>();
if (!data || !data.id) {
// 设置到 values
await formApi.setValues(data);
return;
}
modalApi.lock();