From a49ae63a6f96d10b8ec9fa479a0c28c5df4537e7 Mon Sep 17 00:00:00 2001 From: songhuangfeng123 <shf18767906695@163.com> Date: 星期四, 31 三月 2022 16:45:59 +0800 Subject: [PATCH] fix --- src/views/safetyproduction/feature.vue | 47 ++++++++++++++++++++++++++++++++++------------- 1 files changed, 34 insertions(+), 13 deletions(-) diff --git a/src/views/safetyproduction/feature.vue b/src/views/safetyproduction/feature.vue index 8ab28c8..a435c47 100644 --- a/src/views/safetyproduction/feature.vue +++ b/src/views/safetyproduction/feature.vue @@ -74,6 +74,7 @@ <el-dialog :title="title" :visible.sync="dialogVisible" + :close-on-click-modal="false" width="40%" > <el-form ref="form" :rules="rules" :model="form" label-width="80px"> @@ -109,6 +110,7 @@ v-model="form.parentId" placeholder="请选择" style="width: 100%" + :disabled="title=='编辑'?true:false" > <el-option v-for="item in parent" @@ -139,7 +141,7 @@ <el-button type="primary" class="btns" @click="AddelementManagement()" >确 定</el-button > - <el-button @click="dialogVisible = false">取 消</el-button> + <el-button @click="cancel()">取 消</el-button> </span> </el-dialog> </div> @@ -303,18 +305,37 @@ }); }, deleteById(val) { - elementManagementDel({id:val}).then((res) => { - if (res.data.code == 200) { - this.elementManagementL(); - this.$notify({ - title: "成功", - message: "删除成功", - type: "success", - duration: 2000, - }); - } - }); + this.$confirm('确认删除吗','提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(()=>{ + elementManagementDel({id:val}).then((res) => { + if (res.data.code == 200) { + this.elementManagementL(); + this.$notify({ + title: "成功", + message: "删除成功", + type: "success", + duration: 2000, + }); + }else { + this.$message({ + type: "warning", + // message: res.data.message, + message: "当前A级要素仍然有已绑定的B级要素,无法删除" + }); + } + }); + }) + .catch(error =>{ + }); }, + cancel(){ + this.elementManagementL(); + this.dialogVisible = false; + }, find(){ this.elementManagementL(); }, @@ -334,4 +355,4 @@ background-color: #034ea2; border: 1px solid #034ea2; } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.2