胶料信息
This commit is contained in:
@@ -1,67 +1,143 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { loadTreeData } from '/@/api/common/api';
|
||||
|
||||
function useStatusText(v: unknown) {
|
||||
if (v === 1) return '使用中';
|
||||
if (v === 0) return '停用';
|
||||
return '-';
|
||||
}
|
||||
|
||||
function specialRubberText(v: unknown) {
|
||||
if (v === 1) return '是';
|
||||
if (v === 0) return '否';
|
||||
return '-';
|
||||
}
|
||||
|
||||
const useStatusOptions = [
|
||||
{ label: '使用中', value: 1 },
|
||||
{ label: '停用', value: 0 },
|
||||
];
|
||||
|
||||
const specialRubberOptions = [
|
||||
{ label: '是', value: 1 },
|
||||
{ label: '否', value: 0 },
|
||||
];
|
||||
|
||||
const glueCategoryProps = {
|
||||
api: loadTreeData,
|
||||
params: { pcode: 'XSLMES_MATERIAL' },
|
||||
resultField: '',
|
||||
labelField: 'title',
|
||||
valueField: 'key',
|
||||
placeholder: '请选择胶料类别',
|
||||
};
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '物料编码', align: 'center', dataIndex: 'materialCode' },
|
||||
{ title: '物料名称', align: 'center', dataIndex: 'materialName' },
|
||||
{ title: '分类', align: 'center', dataIndex: 'categoryId_dictText' },
|
||||
{ title: '基础单位', align: 'center', dataIndex: 'baseUnitId_dictText' },
|
||||
{ title: '状态', align: 'center', dataIndex: 'enableFlag' },
|
||||
{ title: '创建时间', align: 'center', dataIndex: 'createTime' },
|
||||
{ title: '胶料名称', align: 'center', width: 160, dataIndex: 'materialName' },
|
||||
{ title: '胶料类别', align: 'center', width: 140, dataIndex: 'categoryId_dictText' },
|
||||
{ title: '胶料别名', align: 'center', width: 140, dataIndex: 'aliasName' },
|
||||
{ title: '胶料客户', align: 'center', width: 140, dataIndex: 'customerId_dictText' },
|
||||
{ title: 'ERP编号', align: 'center', width: 140, dataIndex: 'erpCode' },
|
||||
{ title: '终炼胶保质期(天)', align: 'center', width: 150, dataIndex: 'finalShelfLifeDays' },
|
||||
{ title: '母炼胶保质期(天)', align: 'center', width: 150, dataIndex: 'masterShelfLifeDays' },
|
||||
{ title: '最小停放时间(时)', align: 'center', width: 150, dataIndex: 'minStandingHours' },
|
||||
{
|
||||
title: '使用状态',
|
||||
align: 'center',
|
||||
width: 110,
|
||||
dataIndex: 'enableFlag',
|
||||
customRender: ({ text }) => useStatusText(text),
|
||||
},
|
||||
{
|
||||
title: '是否为特种胶',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
dataIndex: 'isSpecialRubber',
|
||||
customRender: ({ text }) => specialRubberText(text),
|
||||
},
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{ label: '物料编码', field: 'materialCode', component: 'Input', colProps: { span: 6 } },
|
||||
{ label: '物料名称', field: 'materialName', component: 'Input', colProps: { span: 6 } },
|
||||
{ label: '胶料名称', field: 'materialName', component: 'Input', colProps: { span: 6 } },
|
||||
{
|
||||
label: '分类',
|
||||
label: '胶料类别',
|
||||
field: 'categoryId',
|
||||
component: 'ApiSelect',
|
||||
componentProps: glueCategoryProps,
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
label: '胶料客户',
|
||||
field: 'customerId',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: { dictCode: 'mes_material_category,category_name,id' },
|
||||
componentProps: { dictCode: 'mes_xsl_customer,customer_name,id' },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{ label: 'ERP编号', field: 'erpCode', component: 'Input', colProps: { span: 6 } },
|
||||
{
|
||||
label: '使用状态',
|
||||
field: 'enableFlag',
|
||||
component: 'Select',
|
||||
componentProps: { options: useStatusOptions },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
label: '是否为特种胶',
|
||||
field: 'isSpecialRubber',
|
||||
component: 'Select',
|
||||
componentProps: { options: specialRubberOptions },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{ label: '物料编码', field: 'materialCode', component: 'Input', required: true },
|
||||
{ label: '物料名称', field: 'materialName', component: 'Input', required: true },
|
||||
{ label: '别名', field: 'aliasName', component: 'Input' },
|
||||
{ label: '简称', field: 'shortName', component: 'Input' },
|
||||
{ label: '胶料名称', field: 'materialName', component: 'Input', required: true },
|
||||
{
|
||||
label: '分类',
|
||||
label: '胶料类别',
|
||||
field: 'categoryId',
|
||||
component: 'JDictSelectTag',
|
||||
component: 'ApiSelect',
|
||||
required: true,
|
||||
componentProps: { dictCode: 'mes_material_category,category_name,id' },
|
||||
componentProps: glueCategoryProps,
|
||||
},
|
||||
{ label: '胶料别名', field: 'aliasName', component: 'Input' },
|
||||
{
|
||||
label: '基础单位',
|
||||
field: 'baseUnitId',
|
||||
label: '胶料客户',
|
||||
field: 'customerId',
|
||||
component: 'JDictSelectTag',
|
||||
required: true,
|
||||
componentProps: { dictCode: 'mes_unit,unit_name,id' },
|
||||
componentProps: { dictCode: 'mes_xsl_customer,customer_name,id', placeholder: '请选择胶料客户' },
|
||||
},
|
||||
{ label: 'ERP编号', field: 'erpCode', component: 'Input' },
|
||||
{
|
||||
label: '终炼胶保质期(天)',
|
||||
field: 'finalShelfLifeDays',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 0 },
|
||||
},
|
||||
{
|
||||
label: '统计单位',
|
||||
field: 'statUnitId',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: { dictCode: 'mes_unit,unit_name,id' },
|
||||
label: '母炼胶保质期(天)',
|
||||
field: 'masterShelfLifeDays',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 0 },
|
||||
},
|
||||
{ label: '计划价格', field: 'planPrice', component: 'InputNumber' },
|
||||
{ label: '最小库存', field: 'minStock', component: 'InputNumber' },
|
||||
{ label: '最大库存', field: 'maxStock', component: 'InputNumber' },
|
||||
{ label: '换算系数', field: 'unitConvertRate', component: 'InputNumber', defaultValue: 1 },
|
||||
{
|
||||
label: '状态',
|
||||
label: '最小停放时间(时)',
|
||||
field: 'minStandingHours',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 0 },
|
||||
},
|
||||
{
|
||||
label: '使用状态',
|
||||
field: 'enableFlag',
|
||||
component: 'Select',
|
||||
defaultValue: 1,
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '启用', value: 1 },
|
||||
{ label: '停用', value: 0 },
|
||||
],
|
||||
},
|
||||
componentProps: { options: useStatusOptions },
|
||||
},
|
||||
{
|
||||
label: '是否为特种胶',
|
||||
field: 'isSpecialRubber',
|
||||
component: 'Select',
|
||||
defaultValue: 0,
|
||||
componentProps: { options: specialRubberOptions },
|
||||
},
|
||||
{ label: '备注', field: 'remark', component: 'InputTextArea' },
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user