From 4a8694ca55ce76d18f805efd0a90fe8cd0efb522 Mon Sep 17 00:00:00 2001 From: lb Date: Thu, 30 Mar 2023 10:44:01 +0800 Subject: [PATCH] =?UTF-8?q?bugfix=20=E6=96=99=E4=BB=93=E5=92=8C=E6=96=99?= =?UTF-8?q?=E4=BB=93=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DialogJustForm.vue | 13 +- .../modules/pms/materialStorage/config.js | 4 +- .../pms/materialStorageDynamic/config.js | 160 ++++++++++++++++++ .../pms/materialStorageDynamic/index.vue | 32 ++++ src/views/modules/pms/pallet/config.js | 11 ++ 5 files changed, 212 insertions(+), 8 deletions(-) create mode 100644 src/views/modules/pms/materialStorageDynamic/config.js create mode 100644 src/views/modules/pms/materialStorageDynamic/index.vue diff --git a/src/components/DialogJustForm.vue b/src/components/DialogJustForm.vue index 877b14f..4856dd0 100644 --- a/src/components/DialogJustForm.vue +++ b/src/components/DialogJustForm.vue @@ -23,6 +23,7 @@ + {{ col.label }} item.id === eventValue) - this.shadowDataForm[col.autoUpdateProp] = item.cate ?? null + const item = this.savedDatalist[col.prop].find((item) => item.id === eventValue); + this.shadowDataForm[col.autoUpdateProp] = item.cate ?? null; } this.$forceUpdate(); }, diff --git a/src/views/modules/pms/materialStorage/config.js b/src/views/modules/pms/materialStorage/config.js index 6467248..218d486 100644 --- a/src/views/modules/pms/materialStorage/config.js +++ b/src/views/modules/pms/materialStorage/config.js @@ -150,8 +150,8 @@ export default function () { fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的 }, urls: { - base: "/pms/materialStorageDynamic", - page: "/pms/materialStorageDynamic/page", + base: "/pms/materialStorage", + page: "/pms/materialStorage/page", // subase: '/pms/blenderStepParam', // subpage: '/pms/blenderStepParam/page', // more... diff --git a/src/views/modules/pms/materialStorageDynamic/config.js b/src/views/modules/pms/materialStorageDynamic/config.js new file mode 100644 index 0000000..6467248 --- /dev/null +++ b/src/views/modules/pms/materialStorageDynamic/config.js @@ -0,0 +1,160 @@ +import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; +// import switchBtn from "@/components/noTemplateComponents/switchBtn"; +import request from "@/utils/request"; +import { dictFilter } from '@/utils/filters' +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: "typeDictValue", label: "料仓类型", filter: dictFilter('liaocang') }, + // { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent + { prop: "material", label: "物料" }, + { prop: "materialTypeDictValue", label: "物料类型", filter: dictFilter('material_category') }, + { prop: "density", label: "物料堆积密度" }, + { prop: "dosLow", label: "加料下限" }, + { prop: "dosHigh", label: "加料上限" }, + { prop: "description", label: "描述" }, + { prop: "remark", label: "备注" }, + { + prop: "operations", + name: "操作", + fixed: "right", + width: 90, + subcomponent: TableOperaionComponent, + options: [{ name: "edit", label: "编辑", icon: "edit-outline" }, { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:materialStorage:delete" }], + }, + ]; + + const headFormFields = [ + { + prop: 'name', + label: "料仓名称", + input: true, + default: { value: "" }, + bind: { + // placeholder: '请输入产线名称或编码' + placeholder: '请输入料仓名称' + } + }, + { + button: { + type: "primary", + name: "查询", + }, + }, + { + button: { + type: "primary", + name: "新增", + permission: "pms:materialStorage:save" + }, + bind: { + plain: true, + } + }, + ]; + + /** + * dialog config 有两个版本,一个适用于 DialogWithMenu 组件,另一个适用于 DialogJustForm 组件 + * 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js + * 此为后者的配置: + */ + const dialogJustFormConfigs = { + 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: "请输入料仓编码" }, + }, + ], + [ + { + select: true, + label: "料仓类型", + prop: "typeDictValue", + // fetchData: () => this.$http.get("/pms/factory/page", { params: { limit: 999, page: 1 } }), + options: [ + // TODO: 或许映射可以全权交给数据字典 + { label: '中间仓', value: '0' }, + { label: '日料仓', value: '1' }, + ], + rules: { required: true, message: "必填项不能为空", trigger: "change" }, + elparams: { placeholder: "请选择料仓类型" }, + }, + { + select: true, + label: "物料", + prop: "materialId", + fetchData: () => this.$http.get("/pms/material/page", { params: { key: '', limit: 999, page: 1 } }), + options: [], + rules: { required: true, message: "必填项不能为空", trigger: "change" }, + elparams: { placeholder: "请选择物料" }, + }, + // { + // input: true, + // label: "加料下限", + // prop: "dosLow", + // rules: [ + // { required: true, message: "必填项不能为空", trigger: "blur" }, + // { type: 'number', message: "请输入正确的数字类型", trigger: "blur", transform: val => Number(val) }, + // ], + // elparams: { placeholder: "请输入加料下限" }, + // }, + // { + // input: true, + // label: "加料上限", + // prop: "dosHigh", + // rules: [ + // { required: true, message: "必填项不能为空", trigger: "blur" }, + // { type: 'number', message: "请输入正确的数字类型", trigger: "blur", transform: val => Number(val) }, + // ], + // elparams: { placeholder: "请输入加料上限" }, + // }, + ], + [{ textarea: true, label: "描述信息", prop: "description", elparams: { placeholder: "描述信息" } }], + [{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }], + ], + operations: [ + { name: "add", label: "保存", type: "primary", permission: "pms:materialStorage:save", showOnEdit: false }, + { name: "update", label: "更新", type: "primary", permission: "pms:materialStorage:update", showOnEdit: true }, + { name: "reset", label: "重置", type: "warning", showAlways: true }, + // { name: 'cancel', label: '取消', showAlways: true }, + ], + }, + }; + // 备注:弹窗弹出的时间和网速有关...... + + return { + dialogConfigs: dialogJustFormConfigs, + tableConfig: { + table: null, // 此处可省略,el-table 上的配置项 + column: tableProps, // el-column-item 上的配置项 + }, + headFormConfigs: { + rules: null, // 名称是由 BaseSearchForm.vue 组件固定的 + fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的 + }, + urls: { + base: "/pms/materialStorageDynamic", + page: "/pms/materialStorageDynamic/page", + // subase: '/pms/blenderStepParam', + // subpage: '/pms/blenderStepParam/page', + // more... + }, + }; +} diff --git a/src/views/modules/pms/materialStorageDynamic/index.vue b/src/views/modules/pms/materialStorageDynamic/index.vue new file mode 100644 index 0000000..e0e4632 --- /dev/null +++ b/src/views/modules/pms/materialStorageDynamic/index.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/src/views/modules/pms/pallet/config.js b/src/views/modules/pms/pallet/config.js index 34e6a2f..9bbc756 100644 --- a/src/views/modules/pms/pallet/config.js +++ b/src/views/modules/pms/pallet/config.js @@ -85,6 +85,8 @@ export default function () { fliterable: true } }, + ], + [ { // select: true, input: true, @@ -96,6 +98,14 @@ export default function () { // fliterable: true // } }, + { + label: "查看载砖详情", + button: true, + onClick: (id) => { + console.log(`查看载砖详情`, id) + this.$emit({ type: 'to-car-payload', data: id }) + } + }, ], ], operations: [ @@ -145,6 +155,7 @@ export default function () { }, urls: { base: '/pms/carHistory', + payload: '/pms/carHandle', // hisId 查询 载砖详情 page: "/pms/pallet/pageView", pageIsPostApi: true, printLog: '/pms/pallet/print', // post