From 6ccfef90f60a2d85e4559cab364ec5f7fda9d3d2 Mon Sep 17 00:00:00 2001 From: lb Date: Thu, 30 Mar 2023 09:31:26 +0800 Subject: [PATCH] update --- src/components/DialogJustForm.vue | 9 +++- src/views/atomViews/ListViewWithHead.vue | 5 +++ src/views/modules/pms/pallet/config.js | 54 ++++++++++++++++++++++-- src/views/modules/pms/pallet/index.vue | 5 +-- 4 files changed, 66 insertions(+), 7 deletions(-) diff --git a/src/components/DialogJustForm.vue b/src/components/DialogJustForm.vue index 70699e0..877b14f 100644 --- a/src/components/DialogJustForm.vue +++ b/src/components/DialogJustForm.vue @@ -317,7 +317,14 @@ export default { .get(this.urls.base + `/${this.dataForm.id}`) .then(({ data: res }) => { if (res && res.code === 0) { - this.dataForm = __pick(res.data, Object.keys(this.dataForm)); + if (res.data) this.dataForm = __pick(res.data, Object.keys(this.dataForm)); + else { + this.$message({ + message: '后端返回的数据为 null', + type: 'error', + duration: 2000 + }) + } /** 格式化文件上传列表 */ if (Array.isArray(this.dataForm.files)) { this.dataForm.files = this.dataForm.files.map((file) => ({ diff --git a/src/views/atomViews/ListViewWithHead.vue b/src/views/atomViews/ListViewWithHead.vue index dae9a3e..194f70d 100644 --- a/src/views/atomViews/ListViewWithHead.vue +++ b/src/views/atomViews/ListViewWithHead.vue @@ -293,6 +293,11 @@ export default { }); break; } + case "view-car-record": { + // 查看窑车历史记录 - from 托盘页面 + this.openDialog(data); + break; + } case "status": { console.log("status", data); // TODO: 类似于这种字符串,可以统一集中到一个文件里 diff --git a/src/views/modules/pms/pallet/config.js b/src/views/modules/pms/pallet/config.js index c583259..34e6a2f 100644 --- a/src/views/modules/pms/pallet/config.js +++ b/src/views/modules/pms/pallet/config.js @@ -1,6 +1,8 @@ import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; import request from "@/utils/request"; import { timeFilter, dictFilter } from "@/utils/filters"; +import { getDictDataList } from '@/utils'; + // import StateSelect from '@/components/StateSelect.vue'; @@ -22,7 +24,7 @@ export default function () { subcomponent: TableOperaionComponent, options: [ { name: "print", label: "打印", icon: "printer" }, - { name: "view-car-record", label: "窑车记录", emitFull: true, icon: "shopping-cart-1" }, + { name: "view-car-record", label: "窑车记录", emitField: 'hisId', icon: "shopping-cart-1" }, ], }, ]; @@ -58,7 +60,51 @@ export default function () { }, ]; - const dialogJustFormConfigs = null; + const dialogJustFormConfigs = { + form: { + rows: [ + [ + { + select: true, + label: "窑车号", + prop: "carId", + options: [], + fetchData: () => this.$http.get("/pms/car/page", { params: { page: 1, limit: 999 } }), + rules: { required: true, message: "必填项不能为空", trigger: "blur" }, + elparams: { + fliterable: true + } + }, + { + select: true, + label: "状态", + prop: "stateDictValue", + options: getDictDataList('car_state').map(i => ({ label: i.dictLabel, value: i.dictValue })), + rules: { required: true, message: "必填项不能为空", trigger: "blur" }, + elparams: { + fliterable: true + } + }, + { + // select: true, + input: true, + label: "位置", + prop: "pos", + // options: getDictDataList(), + rules: { required: true, message: "必填项不能为空", trigger: "blur" }, + // elparams: { + // fliterable: true + // } + }, + ], + ], + operations: [ + // { name: "add", label: "保存", type: "primary", permission: "", showOnEdit: false }, + // { name: "update", label: "更新", type: "primary", permission: "", showOnEdit: true }, + // { name: "reset", label: "重置", type: "warning", showAlways: true }, + ], + }, + }; const carPayloadDialogConfigs = { dialogWidth: '70%', @@ -97,9 +143,11 @@ export default function () { rules: null, // 名称是由 BaseSearchForm.vue 组件固定的 fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的 }, - urls: { + urls: { + base: '/pms/carHistory', page: "/pms/pallet/pageView", pageIsPostApi: true, + printLog: '/pms/pallet/print', // post }, }; } diff --git a/src/views/modules/pms/pallet/index.vue b/src/views/modules/pms/pallet/index.vue index 83164aa..4b31b75 100644 --- a/src/views/modules/pms/pallet/index.vue +++ b/src/views/modules/pms/pallet/index.vue @@ -7,8 +7,8 @@ /** { pos: [] } **/ ]" :trigger-update="triggerUpdateKey" - :car-payload-dialog-configs="carPayloadDialogConfigs" /> +