From da9f152be5575c6442f0f3210d07947bb1f5895e Mon Sep 17 00:00:00 2001 From: yangzhicheng Date: Thu, 11 Jul 2024 17:21:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=B1=E6=95=88=E6=8C=89=E9=92=AE=20=20?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/inspection/inspectionroute.js | 3 +- src/views/inspection/inspectionroute.vue | 50 ++++++++++++++++++- .../inspection/inspectionrouteDetail.vue | 12 +++-- 3 files changed, 59 insertions(+), 6 deletions(-) diff --git a/src/api/inspection/inspectionroute.js b/src/api/inspection/inspectionroute.js index b0b4868..03ab1db 100644 --- a/src/api/inspection/inspectionroute.js +++ b/src/api/inspection/inspectionroute.js @@ -58,12 +58,13 @@ export const takeEffect = (ids) => { }) } -export const lapse = (ids) => { +export const lapse = (ids, reason) => { return request({ url: '/api/inspection/inspectionRoute/lapse', method: 'post', params: { ids, + reason, } }) } diff --git a/src/views/inspection/inspectionroute.vue b/src/views/inspection/inspectionroute.vue index 167e62a..01b2474 100644 --- a/src/views/inspection/inspectionroute.vue +++ b/src/views/inspection/inspectionroute.vue @@ -56,6 +56,22 @@ 删除 + + + +
+ + 失效 + + +
+
@@ -72,6 +88,7 @@ search:{}, query: {}, loading: true, + cancelBox: false, page: { pageSize: 10, currentPage: 1, @@ -136,6 +153,25 @@ }, ] }, + cancelForm: {}, + cancelOption: { + height: 'auto', + calcHeight: 210, + emptyBtn:false, + submitBtn:false, + tip: false, + border: true, + index: false, + selection: true, + column: [ + { + label: "取消原因", + type: "textarea", + prop: "cancelReason", + span: 24 + }, + ] + }, data: [] }; }, @@ -197,6 +233,8 @@ return remove(row.id); }) .then(() => { + const cancelReason = this.findObject(this.cancelOption.column, "cancelReason"); + cancelReason.value = ' '; this.onLoad(this.page); this.$message({ type: "success", @@ -271,21 +309,25 @@ this.$message.warning("请选择至少一条数据"); return; } + this.cancelBox = true; + }, + handleDetailCancel() { this.$confirm("是否将选择数据改为失效状态?", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" }) .then(() => { - return lapse(this.ids); + return lapse(this.ids, this.cancelForm.cancelReason); }) .then(() => { + this.cancelBox = false; this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - this.$refs.crud.toggleSelection(); + this.$refs.crud.toggleSelection() }); }, handleExport() { @@ -350,4 +392,8 @@ background-color: #3366cc !important; color: #FFFFFF !important; } +.container { + display: flex; + justify-content: flex-end; /* 将子元素推到容器的末端 */ +} diff --git a/src/views/inspection/inspectionrouteDetail.vue b/src/views/inspection/inspectionrouteDetail.vue index 7c560f8..c211d70 100644 --- a/src/views/inspection/inspectionrouteDetail.vue +++ b/src/views/inspection/inspectionrouteDetail.vue @@ -39,6 +39,7 @@ { label: "路线编号", prop: "routeNo", + display: true, span: 8, }, { @@ -106,6 +107,7 @@ { label: "取消原因", prop: "cancelReason", + span: 8, }, ] }, @@ -132,9 +134,13 @@ this.addUpdateShowButton = false; this.frame_class = 'frame_class'; }else{ - const column = this.findObject(this.option.column, "routeNo"); - column.value = ' '; - column.disabled = true; + const routeNo = this.findObject(this.option.column, "routeNo"); + routeNo.value = ' '; + routeNo.disabled = true; + const iStatus = this.findObject(this.option.column, "istatus"); + iStatus.display = false; + const cancelReason = this.findObject(this.option.column, "cancelReason"); + cancelReason.display = false; this.readonlyForm = false; this.addUpdateShowButton = true; this.frame_class = null;