ll
liukangdong
2024-12-02 798dcfbbc3ab2a81d1e873b25e00bf5e4ed03aa7
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()
        })
      })
      //
    },
  }
}