From 506cab65a4594b5d6d72195c3634424cfffd7254 Mon Sep 17 00:00:00 2001 From: lb Date: Fri, 22 Sep 2023 14:41:11 +0800 Subject: [PATCH] bugfix 0922 --- public/index.html | 4 +- src/components/DialogWithMenu.vue | 3 + src/components/SmallDialog.vue | 39 ++++++++--- src/views/modules/pms/finishedOrder/config.js | 1 + .../order/components/ListSectionWithHead.vue | 70 +++++++++++++++++++ src/views/modules/pms/order/config.js | 1 + .../shapeStep/components/DialogWithMenu.vue | 3 + .../testingStep/components/DialogWithMenu.vue | 3 + 8 files changed, 111 insertions(+), 13 deletions(-) diff --git a/public/index.html b/public/index.html index 18e8c15..3b60c3f 100644 --- a/public/index.html +++ b/public/index.html @@ -40,8 +40,8 @@ // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.103:8080/pms-am'; // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.67:8080/pms-am'; // wenzhang - window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao - // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv + // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao + window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv // window.SITE_CONFIG['apiURL'] = 'http://localhost:3000/p//////ms-am'; // xv <% } %> diff --git a/src/components/DialogWithMenu.vue b/src/components/DialogWithMenu.vue index ec18cab..9296058 100644 --- a/src/components/DialogWithMenu.vue +++ b/src/components/DialogWithMenu.vue @@ -213,6 +213,7 @@ :url="urls.subase" :configs="configs.subDialog" :related-id="dataForm.id" + :code="extraCode" @refreshDataList="getSubList"> @@ -385,6 +386,7 @@ export default { }); return { + extraCode: null, // configs, btnLoading: false, loadingStatus: false, @@ -1014,6 +1016,7 @@ export default { .catch((err) => {}); } case "edit": { + this.extraCode = this.subList?.find((item) => item.id == data)?.code; this.handleAddParam(data); /** data is ==> id */ break; } diff --git a/src/components/SmallDialog.vue b/src/components/SmallDialog.vue index 828bd12..0849108 100644 --- a/src/components/SmallDialog.vue +++ b/src/components/SmallDialog.vue @@ -36,7 +36,9 @@ :label="opt.label" :value="opt.value"> {{ opt.label }} - + {{ opt[col.customLabel] || "-" }} @@ -96,6 +98,10 @@ export default { type: String, default: "", }, + code: { + type: String, + default: null, + }, }, inject: ["urls"], data() { @@ -112,7 +118,10 @@ export default { col, "options", !col.customLabel - ? res.data.list.map((item) => ({ label: item[col.optionLabel ?? "name"], value: item.id })) + ? res.data.list.map((item) => ({ + label: item[col.optionLabel ?? "name"], + value: item.id, + })) : res.data.list.map((item) => ({ label: item[col.optionLabel ?? "name"], value: item.id, @@ -120,11 +129,11 @@ export default { })) ); //console.log( - // res.data.list.map((item) => ({ - // label: item.name, - // value: item.id, - // [col.customLabel]: item[col.customLabel], - // })) + // res.data.list.map((item) => ({ + // label: item.name, + // value: item.id, + // [col.customLabel]: item[col.customLabel], + // })) // ); } else { this.$set(col, "options", []); @@ -220,14 +229,22 @@ export default { fields[this.configs.extraParam] = this.relatedId; // [this.configs.extraParam]: this.relatedId, // this.configs.extraParam 只能是字符串 if (this.configs.forceAttachCode) fields["code"] = ""; + let body = { + ...this.dataForm, + ...fields, + }; + if (payload.name == "update") { + if (this.code != null) { + body.code = this.code; + } + } + + console.log("body", body); this.$http({ url: this.urls.subase, method, - data: { - ...this.dataForm, - ...fields, - }, + data: body, }).then(({ data: res }) => { //console.log("[add&update] res is: ", res); this.btnLoading = false; diff --git a/src/views/modules/pms/finishedOrder/config.js b/src/views/modules/pms/finishedOrder/config.js index 7b5eeb7..691a6db 100644 --- a/src/views/modules/pms/finishedOrder/config.js +++ b/src/views/modules/pms/finishedOrder/config.js @@ -37,6 +37,7 @@ export default function () { { width: 200, prop: "shortDesc", label: "喷码描述" }, { width: 120, prop: "yieldqty", label: "已生产数量" }, { width: 120, prop: "remark", label: "备注" }, + { width: 120, prop: "description", label: "结束备注" }, // { width: 120, prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "operations", diff --git a/src/views/modules/pms/order/components/ListSectionWithHead.vue b/src/views/modules/pms/order/components/ListSectionWithHead.vue index 9dfa10a..3bcaadc 100644 --- a/src/views/modules/pms/order/components/ListSectionWithHead.vue +++ b/src/views/modules/pms/order/components/ListSectionWithHead.vue @@ -236,6 +236,60 @@ export default { case "destroy-order": // 结束订单 case "end-order": { + this.$prompt("确认结束请输入结束备注", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + }) + .then(({ value }) => { + return value; + }) + .catch(() => { + this.$message({ + type: "info", + message: "取消输入", + }); + return Promise.reject(); + }) + .then((value) => { + return this.$http({ + method: "post", + url: "/pms/order/end", + headers: { + "Content-Type": "application/json", + }, + data: { + id: data, + description: value, + }, + }); + }) + .then(({ data: res }) => { + if (res.code === 0) { + // success + this.$message({ + message: "已结束订单!", + type: "success", + duration: 2000, + onClose: () => { + this.getAList( + Object.assign({}, this.listQuery, this.extraSearchConditions, this.params) + ); + this.$emit("refresh-tables", ["finished"]); + }, + }); + } else { + // failed + throw new Error(res.msg); + } + }) + .catch((err) => { + this.$message({ + type: "error", + message: err, + }); + }); + + return; this.$confirm(`确定${type === "end-order" ? "结束订单" : "废除订单"}?`, "提示", { confirmButtonText: "确定", cancelButtonText: "取消", @@ -344,6 +398,22 @@ export default { this.openDialog(data); /** data is ==> id */ break; } + case "copy": { + this.$http({ + url: "/pms/order/copy", + method: "post", + headers: { + "Content-Type": "application/json", + }, + data, + }).then(({ data: res }) => { + if (res.code === 0) { + this.$message.success("复制成功!"); + this.getAList(Object.assign({}, this.listQuery, this.extraSearchConditions, this.params)); + } + }); + break; + } case "view": case "view-detail-action": { this.openDialog(data, true); diff --git a/src/views/modules/pms/order/config.js b/src/views/modules/pms/order/config.js index 3a6bb7f..a1a9eb3 100644 --- a/src/views/modules/pms/order/config.js +++ b/src/views/modules/pms/order/config.js @@ -33,6 +33,7 @@ export default function () { // { name: "destroy-order", label: "废除", icon: "close" }, ], pending: [ + { name: "copy", label: "复制", icon: "copy-document" }, { name: "edit", label: "编辑", icon: "edit-outline" }, { name: "view", label: "查看详情", icon: "view" }, { name: "confirm-order", label: "确认订单", icon: "success" }, diff --git a/src/views/modules/pms/shapeStep/components/DialogWithMenu.vue b/src/views/modules/pms/shapeStep/components/DialogWithMenu.vue index c0c09da..21b0c85 100644 --- a/src/views/modules/pms/shapeStep/components/DialogWithMenu.vue +++ b/src/views/modules/pms/shapeStep/components/DialogWithMenu.vue @@ -182,6 +182,7 @@ :url="urls.subase" :configs="configs.subDialog" :related-id="dataForm.id" + :code="extraCode" @refreshDataList="getSubList"> @@ -238,6 +239,7 @@ export default { }); return { + extraCode: null, visible: false, btnLoading: false, formLoading: false, @@ -898,6 +900,7 @@ export default { .catch((err) => {}); } case "edit": { + this.extraCode = this.subList.find(item => item.id == data)?.code; this.handleAddParam(data); /** data is ==> id */ break; } diff --git a/src/views/modules/pms/testingStep/components/DialogWithMenu.vue b/src/views/modules/pms/testingStep/components/DialogWithMenu.vue index c0c09da..09b493a 100644 --- a/src/views/modules/pms/testingStep/components/DialogWithMenu.vue +++ b/src/views/modules/pms/testingStep/components/DialogWithMenu.vue @@ -182,6 +182,7 @@ :url="urls.subase" :configs="configs.subDialog" :related-id="dataForm.id" + :code="extraCode" @refreshDataList="getSubList"> @@ -239,6 +240,7 @@ export default { return { visible: false, + extraCode: null, btnLoading: false, formLoading: false, optionsLoading: false, @@ -898,6 +900,7 @@ export default { .catch((err) => {}); } case "edit": { + this.extraCode = this.subList.find(item => item.id == data)?.code; this.handleAddParam(data); /** data is ==> id */ break; }