From 195ebd54302cf7884e23a3f1464ae2f27309327b Mon Sep 17 00:00:00 2001 From: zuozhengqing <a13193816592@163.com> Date: 星期一, 13 十一月 2023 14:48:15 +0800 Subject: [PATCH] 就绪状态可以取消调拨 --- src/views/overview/AddOverviewDialog.vue | 42 +++++++++++++++++++- src/components/makepager/StatusCommonView.vue | 11 +++++ src/api/overview/overview.js | 18 ++++++++ 3 files changed, 66 insertions(+), 5 deletions(-) diff --git a/src/api/overview/overview.js b/src/api/overview/overview.js index 2420df3..65e2ceb 100644 --- a/src/api/overview/overview.js +++ b/src/api/overview/overview.js @@ -81,7 +81,14 @@ id }) } - +// 鍙栨秷-鐘舵�� +export function stateCancel(id) { + return request({ + url: `/api-wms/v1/operation/cancel/${id}`, + method: "put", + id + }) +} // 鑾峰彇浣嶇疆鍒楄〃 export function getLocationList(data) { return request({ @@ -99,3 +106,12 @@ data }) } + +// 鑾峰彇鐗╂祦鍏徃淇℃伅 +export const getLogisticCompanyList = (data) => { + return request({ + url: "/api-wms/v1/operation/getLogisticCompanyList", + method: "get", + params: data + }) +} \ No newline at end of file diff --git a/src/components/makepager/StatusCommonView.vue b/src/components/makepager/StatusCommonView.vue index 9361001..cc67562 100644 --- a/src/components/makepager/StatusCommonView.vue +++ b/src/components/makepager/StatusCommonView.vue @@ -3,6 +3,7 @@ <div v-if="showButton" style="margin-left: 30px"> <el-button v-if="isValidateClick" plain size="mini" @click="validateClick">楠岃瘉</el-button> <el-button v-if="showOther" plain size="mini" @click="delClick" :disabled="isDelClick">鍒犻櫎</el-button> + <el-button v-if="showCancel" plain size="mini" @click="btnCancel">鍙栨秷</el-button> <el-button v-if="showOther" plain size="mini" disabled>鎵撳嵃</el-button> </div> <div class="arrowsBox"> @@ -66,7 +67,11 @@ showOther: { type: Boolean, default: true - } + }, + showCancel: { + type: Boolean, + default:false + }, }, data() { return {} @@ -79,6 +84,10 @@ // 鍒犻櫎 delClick() { this.$emit("delClick") + }, + // 鍙栨秷 + btnCancel(){ + this.$emit("btnCancel") } } } diff --git a/src/views/overview/AddOverviewDialog.vue b/src/views/overview/AddOverviewDialog.vue index 9451937..2097ac0 100644 --- a/src/views/overview/AddOverviewDialog.vue +++ b/src/views/overview/AddOverviewDialog.vue @@ -37,8 +37,10 @@ :isValidateClick="isValidateClick" :isDelClick="isDelClick" :list="list" + :showCancel="showCancel" @delClick="delClick" @validateClick="validateClick" + @btnCancel="btnCancel" /> </div> <div class="basic-info"> @@ -309,6 +311,7 @@ addOperation, updateOperation, updateStatus, + stateCancel, deleteOperation, getListTransfer, getLogisticCompanyList @@ -361,7 +364,8 @@ { label: "鑽夌", status: "todo", value: 1 }, { label: "姝e湪绛夊緟", status: "todo", value: 2 }, { label: "灏辩华", status: "todo", value: 3 }, - { label: "瀹屾垚", status: "todo", value: 4 } + { label: "瀹屾垚", status: "todo", value: 4 }, + { label: "宸插彇娑�", status: "todo", value: 5 } ], showButton: true, activeName: "first", @@ -388,7 +392,8 @@ waybillNumber:'', weight:0, logisticWeight:0, - } + }, + showCancel:false, // 鍙栨秷鏄惁鍙互鏄剧ず } }, created() { @@ -466,8 +471,12 @@ this.showFooter = false if (this.editConfig.infomation.status === "瀹屾垚") { this.isValidateClick = false - } else { + }else if(this.editConfig.infomation.status === 3){ this.isValidateClick = true + this.showCancel=true + }else{ + this.isValidateClick = true + } } else if (this.editConfig.infomation.status === 4 || this.editConfig.infomation.status === "瀹屾垚") { this.showButton = true @@ -486,6 +495,7 @@ this.showEdit = true this.showFooter = false this.isValidateClick = true + this.showCancel=true } if (this.editConfig.title === "鏂板缓") { this.list[0].status = "active" @@ -752,6 +762,32 @@ this.$parent.getData() } }) + }, + + // 鍙栨秷 + btnCancel(){ + this.$confirm('纭畾鍙栨秷鍚楋紵', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + stateCancel(this.editConfig.infomation.id).then((res) => { + console.log(res) + this.editConfig.visible = false + if (res.code === 200) { + this.$message.success("鍙栨秷璋冩嫧") + this.$parent.getData() + } + }) + this.list.map((item) => { + if (item.label==="宸插彇娑�") { + item.status = "active" + } else { + item.status = "todo" + } + }) + }).catch(() => { + }); } } } -- Gitblit v1.8.0