From 3f405a3816ce60271ee8191097a092877d07850b Mon Sep 17 00:00:00 2001 From: lb Date: Fri, 24 Feb 2023 10:23:16 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=B5=8B=E8=AF=95=E5=B7=A5=E8=89=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/atomViews/ListViewWithHead.vue | 6 + src/views/modules/pms/blenderStep/config.js | 2 +- src/views/modules/pms/shapeStep/config.js | 54 +++-- src/views/modules/pms/testingStep/config.js | 216 ++++++++++++++++++++ src/views/modules/pms/testingStep/index.vue | 51 +++++ 5 files changed, 309 insertions(+), 20 deletions(-) create mode 100644 src/views/modules/pms/testingStep/config.js create mode 100644 src/views/modules/pms/testingStep/index.vue diff --git a/src/views/atomViews/ListViewWithHead.vue b/src/views/atomViews/ListViewWithHead.vue index d75e820..dfe7abb 100644 --- a/src/views/atomViews/ListViewWithHead.vue +++ b/src/views/atomViews/ListViewWithHead.vue @@ -202,6 +202,12 @@ export default { this.page = 1; this.size = 10; this.getList(); + } else { + this.$message({ + message: `${res.code}: ${res.msg}`, + type: "error", + duration: 1500, + }); } }); }) diff --git a/src/views/modules/pms/blenderStep/config.js b/src/views/modules/pms/blenderStep/config.js index 2f8233a..0b24dec 100644 --- a/src/views/modules/pms/blenderStep/config.js +++ b/src/views/modules/pms/blenderStep/config.js @@ -146,7 +146,7 @@ export default function () { }, subDialog: { - extraParam: "stepId", + extraParam: "techId", rows: [ [ { diff --git a/src/views/modules/pms/shapeStep/config.js b/src/views/modules/pms/shapeStep/config.js index 7c62e60..ddfc471 100644 --- a/src/views/modules/pms/shapeStep/config.js +++ b/src/views/modules/pms/shapeStep/config.js @@ -68,6 +68,7 @@ export default function () { ]; const dialogConfigs = { + extraIds: { wsId: 2 }, // 工艺管理里面的相关模块的 dialogWithMenu 需要额外的工序 id menu: [{ name: "压制工艺", key: 'info' }, { name: "工艺参数", key: 'attr', onlyEditMode: true }], form: { rows: [ @@ -86,15 +87,31 @@ export default function () { rules: { required: true, message: "必填项不能为空", trigger: "blur" }, elparams: { placeholder: "请输入混料程序编码" }, }, + ], + [ + { + forceDisabled: true, + prop: 'shapeCode', + label: '当前砖型' + }, { select: true, - label: "砖型", - prop: "shape", + label: "选择新砖型", + prop: "shapeId", options: [], + refreshOptionsAfterConfirm: true, elparams: { clearable: true, filterable: true, placeholder: "请选择砖型" }, - fetchData: () => this.$http.get("/pms/shape/page", { params: { limit: 999, page: 1 } }), + fetchData: () => this.$http.get("/pms/shape/listUnR", { params: { wsId: 2, externalCode: '', key: '' } }), }, ], + // { + // select: true, + // label: "砖型", + // prop: "shape", + // options: [], + // elparams: { clearable: true, filterable: true, placeholder: "请选择砖型" }, + // fetchData: () => this.$http.get("/pms/shape/page", { params: { limit: 999, page: 1 } }), + // }, [{ textarea: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }], ], operations: [ @@ -105,7 +122,7 @@ export default function () { ], }, table: { - extraParams: "techId ", + extraParams: ["techId", "key"], props: [ // { type: 'index', label: '序号' }, // { prop: "createTime", label: "添加时间", filter: timeFilter }, @@ -134,26 +151,16 @@ export default function () { }, subDialog: { - extraParam: "stepId", + extraParam: "techId", rows: [ [ { input: true, - label: "步骤", - prop: "sort", + label: "参数名称", + prop: "name", rules: { required: true, message: "必填项不能为空", trigger: "blur" }, - elparams: { placeholder: "请输入步骤" }, + elparams: { placeholder: "请输入参数名称" }, }, - { - input: true, - label: "步骤描述", - prop: "description", - rules: { required: true, message: "必填项不能为空", trigger: "blur" }, - elparams: { placeholder: "请输入描述" }, - }, - ], - [ - { input: true, label: "参数名称", prop: "name", elparams: { placeholder: "请输入参数名称" } }, { input: true, label: "参数编码", @@ -166,7 +173,16 @@ export default function () { { input: true, label: "参数值上限", prop: "valueTop", elparams: { placeholder: "请输入参数值上限" } }, { input: true, label: "参数值下限", prop: "valueFloor", elparams: { placeholder: "请输入参数值下限" } }, ], - [{ input: true, label: "参数值", prop: "value", elparams: { placeholder: "请输入参数值" } }], + [ + { input: true, label: "参数值", prop: "value", elparams: { placeholder: "请输入参数值" } }, + { + input: true, + label: "描述", + prop: "description", + // rules: { required: true, message: "必填项不能为空", trigger: "blur" }, + elparams: { placeholder: "请输入描述" }, + }, + ], ], operations: [ { name: "add", label: "保存", type: "primary", permission: "pms:blenderStepParam:save", showOnEdit: false }, diff --git a/src/views/modules/pms/testingStep/config.js b/src/views/modules/pms/testingStep/config.js new file mode 100644 index 0000000..89afd03 --- /dev/null +++ b/src/views/modules/pms/testingStep/config.js @@ -0,0 +1,216 @@ +import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; +import TableTextComponent from "@/components/noTemplateComponents/detailComponent"; +import StatusComponent from "@/components/noTemplateComponents/statusComponent"; +import { timeFilter } from "@/utils/filters"; + +export default function () { + const tableProps = [ + { type: "index", label: "序号" }, + { prop: "createTime", label: "添加时间", filter: timeFilter }, + { prop: "name", label: "工艺名称" }, + { prop: "code", label: "工艺编码" }, + // { prop: 'version', label: '配方号' }, + { prop: "shapeCode", label: "砖型" }, + // { prop: 'status', label: '状态', subcomponent: StatusComponent }, // subcomponent + { prop: "description", label: "详情", subcomponent: TableTextComponent }, + { prop: "remark", label: "备注" }, + { + prop: "operations", + name: "操作", + fixed: "right", + width: 160, + subcomponent: TableOperaionComponent, + options: ["copy", "edit", { name: "delete", emitFull: true, permission: "pms:testingStep:delete" }], + }, + ]; + + const headFormFields = [ + { + prop: "key", + label: "工艺名称/编码", + input: true, + default: { value: "" }, + bind: { + placeholder: "请输入工艺名称或编码", + }, + }, + { + prop: "shape", + label: "砖型", + input: true, + default: { value: "" }, + bind: { + placeholder: "请输入砖型", + }, + }, + // { + // prop: 'bom', + // label: '配方号', + // input: true, + // default: { value: '' }, + // bind: { + // placeholder: '请输入配方号' + // } + // }, + { + button: { + type: "primary", + name: "查询", + }, + }, + { + button: { + type: "plain", + name: "新增", + permission: "pms:testingStep:save", + }, + }, + ]; + + const dialogConfigs = { + extraIds: { wsId: 4 }, // 工艺管理里面的相关模块的 dialogWithMenu 需要额外的工序 id + menu: [{ name: "压制工艺", key: 'info' }, { name: "工艺参数", key: 'attr', onlyEditMode: true }], + form: { + rows: [ + [ + { + input: true, + label: "工艺名称", + prop: "name", + rules: { required: true, message: "必填项不能为空", trigger: "blur" }, + elparams: { placeholder: "请输入混料程序名称" }, + }, + { + input: true, + label: "工艺编码", + prop: "code", + rules: { required: true, message: "必填项不能为空", trigger: "blur" }, + elparams: { placeholder: "请输入混料程序编码" }, + }, + ], + [ + { + forceDisabled: true, + prop: 'shapeCode', + label: '当前砖型' + }, + { + select: true, + label: "选择新砖型", + prop: "shapeId", + options: [], + refreshOptionsAfterConfirm: true, + elparams: { clearable: true, filterable: true, placeholder: "请选择砖型" }, + fetchData: () => this.$http.get("/pms/shape/listUnR", { params: { wsId: 2, externalCode: '', key: '' } }), + }, + ], + // { + // select: true, + // label: "砖型", + // prop: "shape", + // options: [], + // elparams: { clearable: true, filterable: true, placeholder: "请选择砖型" }, + // fetchData: () => this.$http.get("/pms/shape/page", { params: { limit: 999, page: 1 } }), + // }, + [{ textarea: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }], + ], + operations: [ + { name: "add", label: "保存", type: "primary", permission: "pms:testingStep:save", showOnEdit: false }, + { name: "update", label: "更新", type: "primary", permission: "pms:testingStep:update", showOnEdit: true }, + { name: "reset", label: "重置", type: "warning", showAlways: true }, + // { name: 'cancel', label: '取消', showAlways: true }, + ], + }, + table: { + extraParams: ["techId", "key"], + props: [ + // { type: 'index', label: '序号' }, + // { prop: "createTime", label: "添加时间", filter: timeFilter }, + { prop: "name", label: "参数名称", isEditField: true }, + { prop: "code", label: "参数编码", isEditField: true }, + { prop: "specifications", label: "规格", isEditField: true }, + { prop: "description", label: "描述", isEditField: true }, + { prop: "value", label: "设定值", isEditField: true }, + { prop: "valueFloor", label: "值下限", isEditField: true }, + { prop: "valueTop", label: "值上限", isEditField: true }, + { + prop: "operations", + name: "操作", + fixed: "right", + width: 120, + subcomponent: TableOperaionComponent, + options: [ + { name: "edit", permission: "pms:blenderStepParam:update" }, + { name: "delete", emitFull: true, permission: "pms:blenderStepParam:delete" }, + ], + }, + ], + data: [ + // TOOD 暂时用不到,但获取可以考虑把拉取接口数据的函数迁移到此文件(没有太大必要) + ], + }, + + subDialog: { + extraParam: "techId", + rows: [ + [ + { + input: true, + label: "参数名称", + prop: "name", + rules: { required: true, message: "必填项不能为空", trigger: "blur" }, + elparams: { placeholder: "请输入参数名称" }, + }, + { + input: true, + label: "参数编码", + prop: "code", + rules: { required: true, message: "必填项不能为空", trigger: "blur" }, + elparams: { placeholder: "请输入描述" }, + }, + ], + [ + { input: true, label: "参数值上限", prop: "valueTop", elparams: { placeholder: "请输入参数值上限" } }, + { input: true, label: "参数值下限", prop: "valueFloor", elparams: { placeholder: "请输入参数值下限" } }, + ], + [ + { input: true, label: "参数值", prop: "value", elparams: { placeholder: "请输入参数值" } }, + { + input: true, + label: "描述", + prop: "description", + // rules: { required: true, message: "必填项不能为空", trigger: "blur" }, + elparams: { placeholder: "请输入描述" }, + }, + ], + ], + operations: [ + { name: "add", label: "保存", type: "primary", permission: "pms:blenderStepParam:save", showOnEdit: false }, + { name: "update", label: "更新", type: "primary", permission: "pms:blenderStepParam:update", showOnEdit: true }, + // { name: 'reset', label: '重置', type: 'warning', showAlways: true }, + // { name: 'cancel', label: '取消', showAlways: true }, + ], + }, + }; + + return { + dialogConfigs, + tableConfig: { + table: null, // 此处可省略,el-table 上的配置项 + column: tableProps, // el-column-item 上的配置项 + }, + headFormConfigs: { + rules: null, // 名称是由 BaseSearchForm.vue 组件固定的 + fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的 + }, + urls: { + base: "/pms/equipmentTech", + page: "/pms/equipmentTech/pageView", + pageIsPostApi: true, // 使用post接口来获取page数据,极少用,目前基本上只有工艺管理模块里在用 + subase: "/pms/equipmentTechParam", + subpage: "/pms/equipmentTechParam/page", + copyUrl: "/pms/equipmentTech/copy", + // more... + }, + }; +} diff --git a/src/views/modules/pms/testingStep/index.vue b/src/views/modules/pms/testingStep/index.vue new file mode 100644 index 0000000..d619bc7 --- /dev/null +++ b/src/views/modules/pms/testingStep/index.vue @@ -0,0 +1,51 @@ + + + + +