fix:校验客户名称是否唯一
This commit is contained in:
@@ -7,7 +7,7 @@ import { ref } from 'vue';
|
||||
import { useAccess } from '@vben/access';
|
||||
|
||||
import { z } from '#/adapter/form';
|
||||
import { isCustomerNameExists } from '#/api/license/customer';
|
||||
import { isCustomerNameUnique } from '#/api/license/customer';
|
||||
import { getAreaTree } from '#/api/system/area';
|
||||
import { $t } from '#/locales';
|
||||
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
|
||||
@@ -39,7 +39,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
)
|
||||
.refine(
|
||||
async (value: string) => {
|
||||
return !(await isCustomerNameExists(value, formData.value?.id));
|
||||
return await isCustomerNameUnique(value, formData.value?.id);
|
||||
},
|
||||
(value) => ({
|
||||
message: $t('ui.formRules.alreadyExists', [
|
||||
|
||||
Reference in New Issue
Block a user