From 798dcfbbc3ab2a81d1e873b25e00bf5e4ed03aa7 Mon Sep 17 00:00:00 2001 From: liukangdong <898885815@qq.com> Date: 星期一, 02 十二月 2024 18:11:54 +0800 Subject: [PATCH] ll --- admin/src/views/Inspection/task.vue | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/admin/src/views/Inspection/task.vue b/admin/src/views/Inspection/task.vue index e3a57eb..b11267c 100644 --- a/admin/src/views/Inspection/task.vue +++ b/admin/src/views/Inspection/task.vue @@ -56,7 +56,7 @@ > <template slot-scope="{row}"> <el-button type="text" @click="handleDetail(row)">鏌ョ湅璇︽儏</el-button> - <el-button type="text" @click="cancelById(row)" v-permissions="['business:ywpatroltask:delete']">鍙栨秷</el-button> + <el-button v-if="row.status == 0" type="text" class="red" @click="cancelById(row)" v-permissions="['business:ywpatroltask:delete']">鍙栨秷</el-button> </template> </el-table-column> </el-table> @@ -77,6 +77,8 @@ import TableLayout from '@/layouts/TableLayout' import Pagination from '@/components/common/Pagination' import TaskDetail from './components/taskDetail' +import { cancelById } from '@/api/Inspection/ywPatrolTask' +import { Message } from 'element-ui' export default { name: 'YwPatrolTask', extends: BaseTable, @@ -105,8 +107,18 @@ this.$refs.TaskDetailRef.id = row.id this.$refs.TaskDetailRef.getDetail() }, - cancelById() { - + cancelById(row) { + this.$confirm('纭畾鍙栨秷褰撳墠浠诲姟, 鏄惁缁х画?', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + cancelById(row.id).then(res => { + Message.success('鍙栨秷鎴愬姛') + this.search() + }) + }) + // }, } } -- Gitblit v1.9.3