fix: crm plan
parent
3527b12b84
commit
510d91cb66
|
|
@ -3,6 +3,7 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import { floatToFixed2 } from '@vben/utils';
|
import { floatToFixed2 } from '@vben/utils';
|
||||||
|
|
||||||
|
import { getContractSimpleList } from '#/api/crm/contract';
|
||||||
import { getCustomerSimpleList } from '#/api/crm/customer';
|
import { getCustomerSimpleList } from '#/api/crm/customer';
|
||||||
import { DICT_TYPE, getDictOptions } from '#/utils';
|
import { DICT_TYPE, getDictOptions } from '#/utils';
|
||||||
|
|
||||||
|
|
@ -24,14 +25,32 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||||
{
|
{
|
||||||
fieldName: 'contractId',
|
fieldName: 'contractId',
|
||||||
label: '合同',
|
label: '合同',
|
||||||
component: 'ApiSelect',
|
component: 'Select',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
api: getCustomerSimpleList,
|
options: [],
|
||||||
labelField: 'name',
|
|
||||||
valueField: 'id',
|
|
||||||
placeholder: '请选择合同',
|
placeholder: '请选择合同',
|
||||||
},
|
},
|
||||||
|
dependencies: {
|
||||||
|
triggerFields: ['customerId'],
|
||||||
|
disabled: (values) => !values.customerId,
|
||||||
|
async componentProps(values) {
|
||||||
|
if (!values.customerId) {
|
||||||
|
return {
|
||||||
|
options: [],
|
||||||
|
placeholder: '请选择客户',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
const res = await getContractSimpleList(values.customerId);
|
||||||
|
return {
|
||||||
|
options: res.map((item) => ({
|
||||||
|
label: item.name,
|
||||||
|
value: item.id,
|
||||||
|
})),
|
||||||
|
placeholder: '请选择合同',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'period',
|
fieldName: 'period',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue