|  |  | 
 |  |  |   <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 label="开始日期" prop="startDate"> | 
 |  |  |         <el-date-picker v-model="searchForm.startDate" value-format="yyyy-MM-dd" placeholder="请输入开始日期" @change="search"/> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="结束日期" prop="endDate"> | 
 |  |  |         <el-date-picker v-model="searchForm.endDate" value-format="yyyy-MM-dd" placeholder="请输入结束日期" @change="search"/> | 
 |  |  |       <el-form-item label="任务状态"> | 
 |  |  |         <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-option value="3" label="已完成"></el-option> | 
 |  |  |           <el-option value="4" label="已取消"></el-option> | 
 |  |  |         </el-select> | 
 |  |  |       </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> | 
 |  |  |       <ul class="toolbar" v-permissions="['business:ywpatroltask:create', 'business:ywpatroltask:delete']"> | 
 |  |  |         <li><el-button type="primary" @click="$refs.operaYwPatrolTaskWindow.open('新建巡检任务')" icon="el-icon-plus" v-permissions="['business:ywpatroltask:create']">新建</el-button></li> | 
 |  |  |         <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:ywpatroltask:delete']">删除</el-button></li> | 
 |  |  |       </ul> | 
 |  |  |       <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="title" label="标题" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="status" label="状态 0待开始 1进行中 2已超期 3已完成 4已取消" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="schemeId" label="巡检计划编码(关联yw_patrol_scheme)" min-width="100px"></el-table-column> | 
 |  |  |          | 
 |  |  |         <el-table-column prop="dealUserId" label="处理人编码(关联system_user)" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="dealDate" label="处理时间" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="dealInfo" label="处理备注" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="startDate" label="开始日期" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="endDate" label="结束日期" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="dealStatus" label="巡检结果  0正常 1异常" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column | 
 |  |  |           v-if="containPermissions(['business:ywpatroltask:update', 'business:ywpatroltask:delete'])" | 
 |  |  |           label="操作" | 
 |  |  |           min-width="120" | 
 |  |  |           fixed="right" | 
 |  |  |         > | 
 |  |  |         <el-table-column prop="planTitle" 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="140px"> | 
 |  |  |           <template v-slot="scope"> | 
 |  |  |             <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> | 
 |  |  |         <el-table-column prop="userName" label="执行人" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="dealStatus" label="任务状态" min-width="100px"> | 
 |  |  |           <template v-slot="scope"> | 
 |  |  |             <span class="primaryColor" v-if="scope.row.status == 0">待开始</span> | 
 |  |  |             <span class="green" v-if="scope.row.status == 1">进行中</span> | 
 |  |  |             <span class="red" v-if="scope.row.status == 2">已超期</span> | 
 |  |  |             <span class="gray" v-if="scope.row.status == 3">已完成</span> | 
 |  |  |             <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"> | 
 |  |  |           <template slot-scope="{row}"> | 
 |  |  |             <el-button type="text" @click="$refs.operaYwPatrolTaskWindow.open('编辑巡检任务', row)" icon="el-icon-edit" v-permissions="['business:ywpatroltask:update']">编辑</el-button> | 
 |  |  |             <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> | 
 |  |  |  | 
 |  |  |     <!--  --> | 
 |  |  |     <TaskDetail ref="TaskDetailRef" /> | 
 |  |  |   </TableLayout> | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | 
 |  |  | import BaseTable from '@/components/base/BaseTable' | 
 |  |  | 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 }, | 
 |  |  |   data () { | 
 |  |  |   components: { TableLayout, Pagination, TaskDetail }, | 
 |  |  |   data() { | 
 |  |  |     return { | 
 |  |  |       // 搜索 | 
 |  |  |       searchForm: { | 
 |  |  |         id: '', | 
 |  |  |         creator: '', | 
 |  |  |         createDate: '', | 
 |  |  |         editor: '', | 
 |  |  |         editDate: '', | 
 |  |  |         isdeleted: '', | 
 |  |  |         title: '', | 
 |  |  |         remark: '', | 
 |  |  |         status: '', | 
 |  |  |         sortnum: '', | 
 |  |  |         schemeId: '', | 
 |  |  |         pointId: '', | 
 |  |  |         dealUserId: '', | 
 |  |  |         dealDate: '', | 
 |  |  |         dealInfo: '', | 
 |  |  |         circleType: '', | 
 |  |  |         startDate: '', | 
 |  |  |         endDate: '', | 
 |  |  |         dealStatus: '' | 
 |  |  |         status: '' | 
 |  |  |       } | 
 |  |  |     } | 
 |  |  |   }, | 
 |  |  |   created () { | 
 |  |  |   created() { | 
 |  |  |     this.config({ | 
 |  |  |       module: '运维巡检任务信息表', | 
 |  |  |       api: '/Inspection/ywPatrolTask', | 
 |  |  | 
 |  |  |       'field.main': 'id' | 
 |  |  |     }) | 
 |  |  |     this.search() | 
 |  |  |   }, | 
 |  |  |   methods: { | 
 |  |  |     handleDetail(row) { | 
 |  |  |       this.$refs.TaskDetailRef.isShowModal = true | 
 |  |  |       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> |