配合示方生成混炼示方完善
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { loadTreeData } from '/@/api/common/api';
|
||||
import { checkMaterialName } from './MesMaterial.api';
|
||||
|
||||
function useStatusText(v: unknown) {
|
||||
if (v === 1) return '使用中';
|
||||
@@ -32,6 +33,7 @@ const glueCategoryProps = {
|
||||
placeholder: '请选择胶料类别',
|
||||
};
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260729 for:【胶料】列表/表单去掉胶料编码展示-----------
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '胶料名称', align: 'center', width: 160, dataIndex: 'materialName' },
|
||||
{ title: '胶料类别', align: 'center', width: 140, dataIndex: 'categoryId_dictText' },
|
||||
@@ -92,7 +94,32 @@ export const searchFormSchema: FormSchema[] = [
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{ label: '胶料名称', field: 'materialName', component: 'Input', required: true },
|
||||
//update-begin---author:jiangxh ---date:20260730 for:【胶料】编号隐藏,保存由后端按名称回填-----------
|
||||
// 列表/表单均不展示;新增编辑保存后后端将 materialCode = materialName
|
||||
{ label: '', field: 'materialCode', component: 'Input', show: false },
|
||||
//update-end---author:jiangxh ---date:20260730 for:【胶料】编号隐藏,保存由后端按名称回填-----------
|
||||
{
|
||||
label: '胶料名称',
|
||||
field: 'materialName',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
dynamicRules: ({ model }) => [
|
||||
{ required: true, message: '请输入胶料名称' },
|
||||
{
|
||||
validator: async (_rule, value) => {
|
||||
const v = value == null ? '' : String(value).trim();
|
||||
if (!v) return Promise.resolve();
|
||||
try {
|
||||
await checkMaterialName({ materialName: v, dataId: model?.id });
|
||||
return Promise.resolve();
|
||||
} catch (e: any) {
|
||||
return Promise.reject(e?.response?.data?.message || e?.message || '胶料名称不能重复');
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '胶料类别',
|
||||
field: 'categoryId',
|
||||
@@ -141,3 +168,4 @@ export const formSchema: FormSchema[] = [
|
||||
componentProps: { options: specialRubberOptions },
|
||||
},
|
||||
];
|
||||
//update-end---author:jiangxh ---date:20260729 for:【胶料】列表/表单去掉胶料编码展示-----------
|
||||
|
||||
Reference in New Issue
Block a user