|  |  |  | 
|---|
|  |  |  | <TableLayout :permissions="['business:ywpatroltask:query']"> | 
|---|
|  |  |  | <!-- 搜索表单 --> | 
|---|
|  |  |  | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> | 
|---|
|  |  |  | <el-form-item label="主键" prop="id"> | 
|---|
|  |  |  | <el-input v-model="searchForm.id" 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="creator"> | 
|---|
|  |  |  | <el-input v-model="searchForm.creator" placeholder="请输入创建人编码" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="创建时间" prop="createDate"> | 
|---|
|  |  |  | <el-date-picker v-model="searchForm.createDate" value-format="yyyy-MM-dd" placeholder="请输入创建时间" @change="search"/> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="更新人编码" prop="editor"> | 
|---|
|  |  |  | <el-input v-model="searchForm.editor" placeholder="请输入更新人编码" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="更新时间" prop="editDate"> | 
|---|
|  |  |  | <el-date-picker v-model="searchForm.editDate" value-format="yyyy-MM-dd" placeholder="请输入更新时间" @change="search"/> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="是否删除0否 1是" prop="isdeleted"> | 
|---|
|  |  |  | <el-input v-model="searchForm.isdeleted" placeholder="请输入是否删除0否 1是" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="标题" prop="title"> | 
|---|
|  |  |  | <el-input v-model="searchForm.title" placeholder="请输入标题" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="备注" prop="remark"> | 
|---|
|  |  |  | <el-input v-model="searchForm.remark" placeholder="请输入备注" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="状态 0待开始 1进行中 2已超期 3已完成 4已取消" prop="status"> | 
|---|
|  |  |  | <el-input v-model="searchForm.status" placeholder="请输入状态 0待开始 1进行中 2已超期 3已完成 4已取消" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="排序码" prop="sortnum"> | 
|---|
|  |  |  | <el-input v-model="searchForm.sortnum" placeholder="请输入排序码" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="巡检计划编码(关联yw_patrol_scheme)" prop="schemeId"> | 
|---|
|  |  |  | <el-input v-model="searchForm.schemeId" placeholder="请输入巡检计划编码(关联yw_patrol_scheme)" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="巡检点编码(关联yw_patrol_point)" prop="pointId"> | 
|---|
|  |  |  | <el-input v-model="searchForm.pointId" placeholder="请输入巡检点编码(关联yw_patrol_point)" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="处理人编码(关联system_user)" prop="dealUserId"> | 
|---|
|  |  |  | <el-input v-model="searchForm.dealUserId" placeholder="请输入处理人编码(关联system_user)" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="处理时间" prop="dealDate"> | 
|---|
|  |  |  | <el-date-picker v-model="searchForm.dealDate" value-format="yyyy-MM-dd" placeholder="请输入处理时间" @change="search"/> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="处理备注" prop="dealInfo"> | 
|---|
|  |  |  | <el-input v-model="searchForm.dealInfo" placeholder="请输入处理备注" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="循环周期  0每天 1每周 2每天" prop="circleType"> | 
|---|
|  |  |  | <el-input v-model="searchForm.circleType" placeholder="请输入循环周期  0每天 1每周 2每天" @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> | 
|---|
|  |  |  | <el-form-item label="巡检结果  0正常 1异常" prop="dealStatus"> | 
|---|
|  |  |  | <el-input v-model="searchForm.dealStatus" placeholder="请输入巡检结果  0正常 1异常" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | <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="id" label="主键" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="creator" label="创建人编码" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="createDate" label="创建时间" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="editor" label="更新人编码" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="editDate" label="更新时间" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="isdeleted" label="是否删除0否 1是" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="title" label="标题" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="remark" 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="sortnum" label="排序码" 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="pointId" label="巡检点编码(关联yw_patrol_point)" 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="circleType" label="循环周期  0每天 1每周 2每天" 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> | 
|---|
|  |  |  | <!-- 新建/修改 --> | 
|---|
|  |  |  | <OperaYwPatrolTaskWindow ref="operaYwPatrolTaskWindow" @success="handlePageChange"/> | 
|---|
|  |  |  | <!--  --> | 
|---|
|  |  |  | <TaskDetail ref="TaskDetailRef" /> | 
|---|
|  |  |  | </TableLayout> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | import BaseTable from '@/components/base/BaseTable' | 
|---|
|  |  |  | import TableLayout from '@/layouts/TableLayout' | 
|---|
|  |  |  | import Pagination from '@/components/common/Pagination' | 
|---|
|  |  |  | import OperaYwPatrolTaskWindow from './components/OperaYwPatrolTaskWindow' | 
|---|
|  |  |  | 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, OperaYwPatrolTaskWindow }, | 
|---|
|  |  |  | 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> | 
|---|