| | |
| | | |
| | | import { DICT_TYPE } from '@vben/constants'; |
| | | import { getDictOptions } from '@vben/hooks'; |
| | | import { useUserStore } from '@vben/stores'; |
| | | |
| | | import { getSimpleUserList } from '#/api/system/user'; |
| | | import CrmCustomerSelect from '#/components/crm-customer-select.vue'; |
| | | |
| | | /** 新增/修改信用评级 */ |
| | | export function useFormSchema( |
| | | formApi?: VbenFormApi, |
| | | ): VbenFormSchema[] { |
| | | const userStore = useUserStore(); |
| | | return [ |
| | | { |
| | | fieldName: 'id', |
| | |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'operatorName', |
| | | fieldName: 'operatorId', |
| | | label: '评定人', |
| | | component: 'Input', |
| | | component: 'ApiSelect', |
| | | componentProps: { |
| | | placeholder: '请输入评定人姓名', |
| | | api: getSimpleUserList, |
| | | labelField: 'nickname', |
| | | valueField: 'id', |
| | | allowClear: true, |
| | | showSearch: true, |
| | | optionFilterProp: 'label', |
| | | placeholder: '请选择评定人', |
| | | onChange: ( |
| | | _value?: number, |
| | | option?: { nickname?: string }, |
| | | ) => { |
| | | formApi?.setFieldValue('operatorName', option?.nickname); |
| | | }, |
| | | }, |
| | | defaultValue: userStore.userInfo?.id, |
| | | }, |
| | | { |
| | | fieldName: 'operatorName', |
| | | component: 'Input', |
| | | dependencies: { |
| | | triggerFields: [''], |
| | | show: () => false, |
| | | }, |
| | | defaultValue: userStore.userInfo?.nickname, |
| | | }, |
| | | { |
| | | fieldName: 'remark', |