|
|
@@ -7,10 +7,10 @@ export default function () { |
|
|
|
const tableProps = [ |
|
|
|
{ type: 'index', label: '序号' }, |
|
|
|
{ prop: "createTime", label: "添加时间", filter: timeFilter }, |
|
|
|
{ prop: "name", label: "物料名称" }, |
|
|
|
{ prop: "code", label: "物料编码" }, |
|
|
|
{ prop: "name", label: "原料名称" }, |
|
|
|
{ prop: "code", label: "原料编码" }, |
|
|
|
{ prop: "typeDictValue", label: "类别", filter: dictFilter("material_category") }, // subcomponent: {/** TODO: create a new component for this option */} }, |
|
|
|
{ prop: "type", label: "物料类型" }, |
|
|
|
{ prop: "type", label: "原料类型" }, |
|
|
|
{ prop: "enName", label: "英文名称" }, |
|
|
|
{ prop: "enAb", label: "英文缩写" }, |
|
|
|
{ prop: "density", label: "堆积密度" }, |
|
|
@@ -30,11 +30,11 @@ export default function () { |
|
|
|
|
|
|
|
const headFormFields = [ |
|
|
|
{ |
|
|
|
label: "物料名称/编码", |
|
|
|
label: "原料名称/编码", |
|
|
|
prop: "key", |
|
|
|
input: true, |
|
|
|
default: { value: "" }, |
|
|
|
bind: { placeholder: "请输入物料名称或编码" }, |
|
|
|
bind: { placeholder: "请输入原料名称或编码" }, |
|
|
|
}, |
|
|
|
{ |
|
|
|
button: { |
|
|
@@ -62,8 +62,8 @@ export default function () { |
|
|
|
const dictList = JSON.parse(localStorage.getItem("dictList")); |
|
|
|
const dialogConfigs = { |
|
|
|
menu: [ |
|
|
|
{ name: "物料信息", key: "info" }, |
|
|
|
{ name: "物料属性信息", key: "attr", onlyEditMode: true }, |
|
|
|
{ name: "原料信息", key: "info" }, |
|
|
|
{ name: "原料属性信息", key: "attr", onlyEditMode: true }, |
|
|
|
// { name: "添加子类", key: "add-sub", onlyEditMode: true }, |
|
|
|
], |
|
|
|
form: { |
|
|
@@ -71,59 +71,64 @@ export default function () { |
|
|
|
[ |
|
|
|
{ |
|
|
|
input: true, |
|
|
|
label: "物料名称", |
|
|
|
label: "原料名称", |
|
|
|
prop: "name", |
|
|
|
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, |
|
|
|
elparams: { placeholder: "请输入物料名称" }, |
|
|
|
elparams: { placeholder: "请输入原料名称" }, |
|
|
|
}, |
|
|
|
{ |
|
|
|
input: true, |
|
|
|
label: "物料编码", |
|
|
|
label: "原料编码", |
|
|
|
prop: "code", |
|
|
|
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, |
|
|
|
elparams: { placeholder: "请输入物料编码" }, |
|
|
|
elparams: { placeholder: "请输入原料编码" }, |
|
|
|
}, |
|
|
|
{ input: true, label: "堆积密度(g/cm³)", prop: "density", elparams: { placeholder: "堆积密度" } }, |
|
|
|
|
|
|
|
], |
|
|
|
[ |
|
|
|
{ |
|
|
|
cascader: true, |
|
|
|
label: "父级物料", |
|
|
|
prop: "parentId", |
|
|
|
// TODO: 待解决:DialogWithMenu 中设置default只在初始化的时候有效,一旦清空过就无效了 |
|
|
|
// default: '0', |
|
|
|
// rules: { required: true, message: "必填项不能为空", trigger: "blur" }, |
|
|
|
options: [{ id: '0', name: '无' }], // 手动注入额外选项,用到的场景不多... |
|
|
|
fetchData: () => this.$http.get('/pms/material/page', { params: { page: 1, limit: 999, key: '' } }), |
|
|
|
elparams: { placeholder: "请选择父级物料", filterable: true, clearable: true }, |
|
|
|
// fetchTreeData: () => { |
|
|
|
// // TODO:前提是工厂里总的设备类型数不会超过 999 |
|
|
|
// return this.$http.get('/pms/material/tree', { |
|
|
|
// params: { rootId: '0' } |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
// elparams: { placeholder: "请选择父级物料", 'show-all-levels': false, props: { checkStrictly: true } }, |
|
|
|
select: true, |
|
|
|
label: "单位", |
|
|
|
prop: "unitDictValue", |
|
|
|
options: dictList["unit"].map((u) => ({ label: u.dictLabel, value: u.dictValue })), |
|
|
|
elparams: { placeholder: "单位" }, |
|
|
|
}, |
|
|
|
], |
|
|
|
[ |
|
|
|
// { |
|
|
|
// cascader: true, |
|
|
|
// label: "父级原料", |
|
|
|
// prop: "parentId", |
|
|
|
// // TODO: 待解决:DialogWithMenu 中设置default只在初始化的时候有效,一旦清空过就无效了 |
|
|
|
// // default: '0', |
|
|
|
// // rules: { required: true, message: "必填项不能为空", trigger: "blur" }, |
|
|
|
// options: [{ id: '0', name: '无' }], // 手动注入额外选项,用到的场景不多... |
|
|
|
// fetchData: () => this.$http.get('/pms/material/page', { params: { page: 1, limit: 999, key: '' } }), |
|
|
|
// elparams: { placeholder: "请选择父级原料", filterable: true, clearable: true }, |
|
|
|
// // fetchTreeData: () => { |
|
|
|
// // // TODO:前提是工厂里总的设备类型数不会超过 999 |
|
|
|
// // return this.$http.get('/pms/material/tree', { |
|
|
|
// // params: { rootId: '0' } |
|
|
|
// // }) |
|
|
|
// // }, |
|
|
|
// // elparams: { placeholder: "请选择父级原料", 'show-all-levels': false, props: { checkStrictly: true } }, |
|
|
|
// }, |
|
|
|
{ |
|
|
|
select: true, |
|
|
|
label: "物料类型", |
|
|
|
label: "原料类型", |
|
|
|
prop: "typeId", |
|
|
|
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, |
|
|
|
options: [], |
|
|
|
fetchData: () => this.$http.get('/pms/materialType/page', { params: { page: 1, limit: 999 } }), |
|
|
|
elparams: { placeholder: "请输入物料类型" }, |
|
|
|
elparams: { placeholder: "请输入原料类型" }, |
|
|
|
// autoDisabled: true, // 有某个条件触发后,自动变成 disabled 状态 |
|
|
|
}, |
|
|
|
{ |
|
|
|
select: true, |
|
|
|
label: "物料类别", |
|
|
|
label: "原料类别", |
|
|
|
prop: "typeDictValue", |
|
|
|
options: dictList["material_category"].map((u) => ({ label: u.dictLabel, value: u.dictValue })), |
|
|
|
elparams: { placeholder: "物料类别" }, |
|
|
|
elparams: { placeholder: "原料类别" }, |
|
|
|
// autoDisabled: true |
|
|
|
}, |
|
|
|
|
|
|
|
{ input: true, label: "堆积密度(g/cm³)", prop: "density", elparams: { placeholder: "堆积密度" } }, |
|
|
|
// { |
|
|
|
// input: true, |
|
|
|
// label: "设备类型", |
|
|
@@ -133,14 +138,6 @@ export default function () { |
|
|
|
// }, |
|
|
|
], |
|
|
|
[ |
|
|
|
|
|
|
|
{ |
|
|
|
select: true, |
|
|
|
label: "单位", |
|
|
|
prop: "unitDictValue", |
|
|
|
options: dictList["unit"].map((u) => ({ label: u.dictLabel, value: u.dictValue })), |
|
|
|
elparams: { placeholder: "单位" }, |
|
|
|
}, |
|
|
|
{ |
|
|
|
input: true, |
|
|
|
label: "英文名称", |
|
|
@@ -153,9 +150,6 @@ export default function () { |
|
|
|
prop: "enAb", |
|
|
|
elparams: { placeholder: "请输入缩写" }, |
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
[ |
|
|
|
{ input: true, label: "原料描述", prop: "description", elparams: { placeholder: "原料描述" } }, |
|
|
|
], |
|
|
|
[{ input: true, label: "中文描述", prop: "remark", elparams: { placeholder: "备注" } }], |
|
|
|