From 05297626a071c8a15e28e66961e54c0ff067a57a Mon Sep 17 00:00:00 2001 From: lb Date: Fri, 24 Mar 2023 10:51:13 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=96=B0=E5=A2=9E=E8=BD=BD=E7=A0=96?= =?UTF-8?q?=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DialogJustForm.vue | 14 +- .../components/ListViewWithHead.vue | 540 ++++++++++++++++++ .../modules/pms/palletizingLine/config.js | 96 +++- .../modules/pms/palletizingLine/index.vue | 6 +- 4 files changed, 632 insertions(+), 24 deletions(-) create mode 100644 src/views/modules/pms/palletizingLine/components/ListViewWithHead.vue diff --git a/src/components/DialogJustForm.vue b/src/components/DialogJustForm.vue index 99abf47..ae7bc01 100644 --- a/src/components/DialogJustForm.vue +++ b/src/components/DialogJustForm.vue @@ -344,7 +344,7 @@ export default { console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]); }, - addOrUpdate(method = "POST") { + addOrUpdate(method = "POST", url) { if ("parentId" in this.dataForm) { console.log("[DialogJustForm parentId]", this.dataForm.parentId); // 对特殊的键做特殊处理,如 parentId 是一个 cascader,获取的值是 ["xxx"],后端只需要xxx @@ -388,7 +388,8 @@ export default { /** 发送 */ return this.$http({ - url: this.urls.formUrl ? this.urls.formUrl : this.urls.base, + // url: this.urls.formUrl ? this.urls.formUrl : this.urls.base, + url: url ?? this.urls.base, method, data: httpPayload, }) @@ -432,6 +433,15 @@ export default { case "update": this.addOrUpdate(payload.name === "add" ? "POST" : "PUT"); break; + case "add-pos-manually": { + this.addOrUpdate("POST", this.urls.posFormUrl); + break; + } + case "add-car-payload": { + console.log('edit-car-payload', payload) + this.addOrUpdate("POST", this.urls.payloadFormUrl); + break; + } } } else { console.log("[x] 不是这么用的! 缺少name属性"); diff --git a/src/views/modules/pms/palletizingLine/components/ListViewWithHead.vue b/src/views/modules/pms/palletizingLine/components/ListViewWithHead.vue new file mode 100644 index 0000000..aabcdb3 --- /dev/null +++ b/src/views/modules/pms/palletizingLine/components/ListViewWithHead.vue @@ -0,0 +1,540 @@ + + + + + + diff --git a/src/views/modules/pms/palletizingLine/config.js b/src/views/modules/pms/palletizingLine/config.js index 46b5c30..7dd21cf 100644 --- a/src/views/modules/pms/palletizingLine/config.js +++ b/src/views/modules/pms/palletizingLine/config.js @@ -2,6 +2,7 @@ import TableOperaionComponent from "@/components/noTemplateComponents/operationC import request from "@/utils/request"; import { timeFilter } from '@/utils/filters' +import { getDictDataList } from '@/utils' export default function () { const tableProps = [ @@ -78,24 +79,14 @@ export default function () { fetchData: () => this.$http.get('/pms/car/page', { params: { limit: 999, page: 1, code: '' } }), optionLabel: 'code', rules: { required: true, message: "必填项不能为空", trigger: "blur" }, - elparams: { placeholder: "请选择窑车" }, + elparams: { filterable: true, placeholder: "请选择窑车" }, }, { select: true, label: "位置", prop: "pos", - // options: [ - // { id: 0, value: 0 }, - // { id: 1, value: 1 }, - // { id: 2, value: 2 }, - // { id: 3, value: 3 }, - // { id: 4, value: 4 }, - // { id: 5, value: 5 }, - // { id: 6, value: 6 }, - // { id: 7, value: 7 }, - // ], options: [], - fetchData: () => this.$http.post('/pms/carHandle/listPos', { limit: 999, page: 1 }), + fetchData: () => this.$http.post('/pms/carHandle/listPos', { limit: 999, page: 1, pos: [1, 7] }), rules: { required: true, message: "必填项不能为空", trigger: "blur" }, elparams: { placeholder: "请选择窑车位置" }, }, @@ -112,6 +103,7 @@ export default function () { datetime: true, label: "结束时间", prop: "endTime", + default: null, // rules: { required: true, message: "必填项不能为空", trigger: "blur" }, elparams: { placeholder: "请选择结束时间" }, }, @@ -121,10 +113,7 @@ export default function () { select: true, label: "窑车状态", prop: "stateDictValue", - options: [ - { value: 0, label: '正常' }, - { value: 1, label: '报废' } - ], + options: getDictDataList('car_state').map(_ => ({ label: _.dictLabel, value: _.dictValue })), rules: { required: true, message: "必填项不能为空", trigger: "blur" }, elparams: { placeholder: "请选择窑车状态" }, }, @@ -132,9 +121,74 @@ export default function () { ], ], operations: [ - { name: "add", label: "保存", type: "primary", permission: "pms:car:save", showOnEdit: false }, - { name: "update", label: "更新", type: "primary", permission: "pms:car:update", showOnEdit: true }, - { name: "reset", label: "重置", type: "warning", showAlways: true }, + { name: "add-pos-manually", label: "保存", type: "primary", permission: "", showOnEdit: false }, + // { name: "update", label: "更新", type: "primary", permission: "", showOnEdit: true }, + // { name: "reset", label: "重置", type: "warning", showAlways: true }, + // { name: 'cancel', label: '取消', showAlways: true }, + ], + }, + }; + + const carPayloadAddConfigs = { + clickModalToClose: true, + form: { + rows: [ + [ + { + select: true, + prop: "orderId", + label: "订单号", + options: [], + fetchData: () => this.$http.post('/pms/order/pageCom', { limit: 999, page: 1, code: '', type: 1 }), + rules: { required: true, message: "必填项不能为空", trigger: "blur" }, + elparams: { filterable: true, placeholder: "请选择订单" }, + }, + { + input: true, + label: "窑车载量", + prop: "qty", + rules: [ + { required: true, message: "必填项不能为空", trigger: "blur" }, + { type: 'number', message: "请输入大于0的整数", trigger: "blur", transform: val => Number(val) > 0 && Number.isInteger(Number(val)) && Number(val) }, + ], + elparams: { placeholder: "请输入窑车载量" }, + }, + ], + // [ + // { + // input: true, + // label: "合格砖数", + // prop: "goodqty", + // rules: [ + // { required: true, message: "必填项不能为空", trigger: "blur" }, + // { type: 'number', message: "请输入正确的数字类型", trigger: "blur", transform: val => Number(val) }, + // ], + // elparams: { placeholder: "请输入合格砖数" }, + // }, + // { + // input: true, + // label: "废砖数", + // prop: "badqty", + // rules: [ + // { required: true, message: "必填项不能为空", trigger: "blur" }, + // { type: 'number', message: "请输入正确的数字类型", trigger: "blur", transform: val => Number(val) }, + // ], + // elparams: { placeholder: "请输入废砖数" }, + // }, + // ], + // [ + // { + // input: true, + // label: "备注", + // prop: "remark", + // elparams: { placeholder: "请输入备注" }, + // } + // ], + ], + operations: [ + { name: "add-car-payload", label: "保存", type: "primary", permission: "", showOnEdit: false }, + // { name: "update", label: "更新", type: "primary", permission: "", showOnEdit: true }, + // { name: "reset", label: "重置", type: "warning", showAlways: true }, // { name: 'cancel', label: '取消', showAlways: true }, ], }, @@ -164,6 +218,7 @@ export default function () { return { + carPayloadAddConfigs, carPayloadDialogConfigs, dialogConfigs: dialogJustFormConfigs, tableConfig: { @@ -178,7 +233,8 @@ export default function () { base: "/pms/carHandle", page: "/pms/carHandle/pageHis", pageIsPostApi: true, - formUrl: "/pms/trans/inputCurrent" + posFormUrl: "/pms/trans/inputCurrent", + payloadFormUrl: '/pms/trans/inputDetail', // 载砖详情 url // subase: '/pms/blenderStepParam', // subpage: '/pms/blenderStepParam/page', // more... diff --git a/src/views/modules/pms/palletizingLine/index.vue b/src/views/modules/pms/palletizingLine/index.vue index c79cdec..4623819 100644 --- a/src/views/modules/pms/palletizingLine/index.vue +++ b/src/views/modules/pms/palletizingLine/index.vue @@ -4,6 +4,7 @@ :head-config="headFormConfigs" :dialog-configs="dialogConfigs" :car-payload-dialog-configs="carPayloadDialogConfigs" + :car-payload-add-configs="carPayloadAddConfigs" :listQueryExtra="[{ pos: [1, 7] }]" :trigger-update="triggerUpdateKey" key="pallet" @@ -13,7 +14,7 @@