|  |  |  | 
|---|
|  |  |  | <TableLayout :permissions="['business:ywpatroltask:query']"> | 
|---|
|  |  |  | <!-- 搜索表单 --> | 
|---|
|  |  |  | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> | 
|---|
|  |  |  | <el-form-item label="计划名称" prop="title"> | 
|---|
|  |  |  | <el-input v-model="searchForm.title" placeholder="请输入计划名称" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | <el-form-item label="计划名称" prop="planTitle"> | 
|---|
|  |  |  | <el-input v-model="searchForm.planTitle" placeholder="请输入计划名称" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item > | 
|---|
|  |  |  | <el-select v-model="searchForm.status" filterable clearable> | 
|---|
|  |  |  | <el-form-item label="任务状态" prop="status"> | 
|---|
|  |  |  | <el-select v-model="searchForm.status" label="任务状态" filterable clearable> | 
|---|
|  |  |  | <el-option value="0" label="待开始"></el-option> | 
|---|
|  |  |  | <el-option value="1" label="进行中"></el-option> | 
|---|
|  |  |  | <el-option value="2" label="已超期"></el-option> | 
|---|
|  |  |  | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <section> | 
|---|
|  |  |  | <el-button type="primary" @click="search">搜索</el-button> | 
|---|
|  |  |  | <el-button type="primary" :loading="isWorking.export" v-permissions="['business:ywpatroltask:exportExcel']" @click="exportExcel">导出</el-button> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <el-button @click="reset">重置</el-button> | 
|---|
|  |  |  | </section> | 
|---|
|  |  |  | </el-form> | 
|---|
|  |  |  | <!-- 表格和分页 --> | 
|---|
|  |  |  | <template v-slot:table-wrap> | 
|---|
|  |  |  | <el-table | 
|---|
|  |  |  | v-loading="isWorking.search" | 
|---|
|  |  |  | :data="tableData.list" | 
|---|
|  |  |  | stripe | 
|---|
|  |  |  | @selection-change="handleSelectionChange" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <div> | 
|---|
|  |  |  | <el-button type="primary" plain :loading="isWorking.export" | 
|---|
|  |  |  | v-permissions="['business:ywpatroltask:exportExcel']" @click="exportExcel">导出</el-button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <el-table v-loading="isWorking.search" :data="tableData.list" stripe @selection-change="handleSelectionChange"> | 
|---|
|  |  |  | <el-table-column type="selection" width="55"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="planTitle" label="计划名称" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="schemeId" label="计划编号" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="planCode" label="计划编号" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="code" label="任务编号" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="dealDate" label="任务时间" min-width="100px"> | 
|---|
|  |  |  | <el-table-column prop="dealDate" label="任务时间" min-width="140px"> | 
|---|
|  |  |  | <template v-slot="scope"> | 
|---|
|  |  |  | <span>{{ scope.row.startDate }} {{ scope.row.endDate }}</span> | 
|---|
|  |  |  | <span v-if="scope.row.startDate && scope.row.endDate">{{ scope.row.startDate.slice(0, 16) }} - {{ | 
|---|
|  |  |  | scope.row.endDate.slice(11, 16) }}</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="dealDate" label="实际完成时间" min-width="100px"></el-table-column> | 
|---|
|  |  |  | 
|---|
|  |  |  | <span class="gray" v-if="scope.row.status == 4">已取消</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | v-if="containPermissions(['business:ywpatroltask:update', 'business:ywpatroltask:delete'])" | 
|---|
|  |  |  | label="操作" | 
|---|
|  |  |  | min-width="120" | 
|---|
|  |  |  | fixed="right" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column v-if="containPermissions(['business:ywpatroltask:update', 'business:ywpatroltask:delete'])" | 
|---|
|  |  |  | label="操作" min-width="120" fixed="right"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:ywpatroltask:delete']">取消</el-button> | 
|---|
|  |  |  | <el-button type="text" @click="handleDetail(row)">查看详情</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> | 
|---|
|  |  |  | <pagination | 
|---|
|  |  |  | @size-change="handleSizeChange" | 
|---|
|  |  |  | @current-change="handlePageChange" | 
|---|
|  |  |  | :pagination="tableData.pagination" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <pagination @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="tableData.pagination"> | 
|---|
|  |  |  | </pagination> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | <!--  --> | 
|---|
|  |  |  | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | components: { TableLayout, Pagination, TaskDetail }, | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | // 搜索 | 
|---|
|  |  |  | searchForm: { | 
|---|
|  |  |  | title:'', | 
|---|
|  |  |  | title: '', | 
|---|
|  |  |  | status: '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | created () { | 
|---|
|  |  |  | created() { | 
|---|
|  |  |  | this.config({ | 
|---|
|  |  |  | module: '运维巡检任务信息表', | 
|---|
|  |  |  | api: '/Inspection/ywPatrolTask', | 
|---|
|  |  |  | 
|---|
|  |  |  | this.$refs.TaskDetailRef.id = row.id | 
|---|
|  |  |  | this.$refs.TaskDetailRef.getDetail() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | cancelById(row) { | 
|---|
|  |  |  | this.$confirm('确定取消当前任务, 是否继续?', '提示', { | 
|---|
|  |  |  | confirmButtonText: '确定', | 
|---|
|  |  |  | cancelButtonText: '取消', | 
|---|
|  |  |  | type: 'warning' | 
|---|
|  |  |  | }).then(() => { | 
|---|
|  |  |  | cancelById(row.id).then(res => { | 
|---|
|  |  |  | Message.success('取消成功') | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | // | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|