快检标准新增
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { JVxeColumn, JVxeTypes } from '/@/components/jeecg/JVxeTable/types';
|
||||
import { checkStdName } from './MesXslRubberQuickTestStd.api';
|
||||
|
||||
const numProps = { style: { width: '100%' }, precision: 6 };
|
||||
|
||||
@@ -72,27 +71,8 @@ export const formSchema: FormSchema[] = [
|
||||
label: '实验标准名称',
|
||||
field: 'stdName',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
componentProps: { placeholder: '同租户内不可重复' },
|
||||
dynamicRules: ({ model }) => [
|
||||
{ required: true, message: '请输入实验标准名称' },
|
||||
{
|
||||
validator: async (_rule, value) => {
|
||||
const v = value == null ? '' : String(value).trim();
|
||||
if (!v) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
try {
|
||||
await checkStdName({ stdName: v, dataId: model?.id });
|
||||
return Promise.resolve();
|
||||
} catch (e: any) {
|
||||
const msg = e?.response?.data?.message || e?.message || '实验标准名称已存在';
|
||||
return Promise.reject(msg);
|
||||
}
|
||||
},
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
slot: 'stdNameDisplay',
|
||||
dynamicDisabled: true,
|
||||
},
|
||||
{
|
||||
label: '实验方法',
|
||||
|
||||
Reference in New Issue
Block a user