diff --git a/src/api/inspection/inspectionobject.js b/src/api/inspection/inspectionobject.js index 1b3c27e..01499fd 100644 --- a/src/api/inspection/inspectionobject.js +++ b/src/api/inspection/inspectionobject.js @@ -42,7 +42,7 @@ export const add = (row) => { export const update = (row) => { return request({ - url: '/api/inspection/inspectionobject/submit', + url: '/api/inspection/inspectionobject/update', method: 'post', data: row }) @@ -50,20 +50,20 @@ export const update = (row) => { export const takeEffect = (ids) => { return request({ - url: '/api/inspection/inspectionRoute/takeEffect', + url: '/api/inspection/inspectionobject/takeEffect', method: 'post', params: { ids, } }) } -export const lapse = (ids) => { +export const lapse = (ids, reason) => { return request({ - url: '/api/inspection/inspectionRoute/lapse', + url: '/api/inspection/inspectionobject/lapse', method: 'post', params: { ids, + reason, } }) } - diff --git a/src/views/inspection/inspectionobject.vue b/src/views/inspection/inspectionobject.vue index 0c07501..768af95 100644 --- a/src/views/inspection/inspectionobject.vue +++ b/src/views/inspection/inspectionobject.vue @@ -56,6 +56,22 @@ 删除 + + + +
+ + 失效 + + +
+
@@ -72,6 +88,7 @@ search:{}, query: {}, loading: true, + cancelBox: false, page: { pageSize: 10, currentPage: 1, @@ -157,12 +174,18 @@ label: "对象状态", prop: "istatus", search:true, + type: "select", span:4.5, rules: [{ required: true, message: "请输入对象状态", trigger: "blur" - }] + }], + dicUrl: "/api/daf-system/dict/dictionary?code=istatus", + props: { + label: "dictValue", + value: "dictKey" + } }, { label: "KKS编号", @@ -185,6 +208,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: [] }; }, @@ -246,6 +288,8 @@ return remove(row.id); }) .then(() => { + const cancelReason = this.findObject(this.cancelOption.column, "cancelReason"); + cancelReason.value = ' '; this.onLoad(this.page); this.$message({ type: "success", @@ -342,21 +386,26 @@ 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.cancelForm.cancelReason = ''; + this.cancelBox = false; this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - this.$refs.crud.toggleSelection(); + this.$refs.crud.toggleSelection() }); }, handleExport() { @@ -365,7 +414,7 @@ cancelButtonText: "取消", type: "warning" }).then(() => { - expUtil.excelExport(`/api/inspection/inspectionRoute/export?daf-auth=${getToken()}`, this.search, ['stations', "istatus"]); + expUtil.excelExport(`/api/inspection/inspectionobject/export?daf-auth=${getToken()}`, this.search, ['stations', "istatus", "objectName"]); }); }, beforeOpen(done, type) { diff --git a/src/views/inspection/inspectionobjectDetail.vue b/src/views/inspection/inspectionobjectDetail.vue index a9fcdb4..07f111f 100644 --- a/src/views/inspection/inspectionobjectDetail.vue +++ b/src/views/inspection/inspectionobjectDetail.vue @@ -11,171 +11,198 @@ + v-if="addUpdateShowButton"> 确定 + + 修改