|  |  |  | 
|---|
|  |  |  | <TableLayout :permissions="['business:ywpatrolscheme: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="selDate"> | 
|---|
|  |  |  | <el-date-picker type="daterange" v-model="searchForm.selDate"  @change="changeSelDate" clearable value-format="yyyy-MM-dd" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </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 label="结束日期" prop="selDateSec"> | 
|---|
|  |  |  | <el-date-picker type="daterange" v-model="searchForm.selDateSec"  @change="changeSelDateSec" clearable value-format="yyyy-MM-dd" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </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禁用" prop="status"> | 
|---|
|  |  |  | <el-input v-model="searchForm.status" placeholder="请输入状态 0启用 1禁用" @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_line)" prop="lineId"> | 
|---|
|  |  |  | <el-input v-model="searchForm.lineId" placeholder="请输入巡检点编码(关联yw_patrol_line)" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="巡检负责人编码集合,多个使用英文逗号隔开" prop="userIds"> | 
|---|
|  |  |  | <el-input v-model="searchForm.userIds" placeholder="请输入巡检负责人编码集合,多个使用英文逗号隔开" @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="循环重复规则 1-31,多个英文逗号隔开" prop="circleDays"> | 
|---|
|  |  |  | <el-input v-model="searchForm.circleDays" placeholder="请输入循环重复规则 1-31,多个英文逗号隔开" @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="开始时间点" prop="startTime"> | 
|---|
|  |  |  | <el-input v-model="searchForm.startTime" placeholder="请输入开始时间点" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="结束时间点" prop="endTime"> | 
|---|
|  |  |  | <el-input v-model="searchForm.endTime" placeholder="请输入结束时间点" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="执行进度 0待开始 1进行中 2超期 3已完成" prop="processStatus"> | 
|---|
|  |  |  | <el-input v-model="searchForm.processStatus" placeholder="请输入执行进度 0待开始 1进行中 2超期 3已完成" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | <el-form-item label="计划名称" prop="title"> | 
|---|
|  |  |  | <el-input v-model="searchForm.title" placeholder="请输入计划名称" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <section> | 
|---|
|  |  |  | <el-button type="primary" @click="search">搜索</el-button> | 
|---|
|  |  |  | <el-button type="primary" :loading="isWorking.export" v-permissions="['business:ywpatrolscheme: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:ywpatrolscheme:create', 'business:ywpatrolscheme:delete']"> | 
|---|
|  |  |  | <li><el-button type="primary" @click="$refs.operaYwPatrolSchemeWindow.open('新建运维巡检计划信息表')" icon="el-icon-plus" v-permissions="['business:ywpatrolscheme:create']">新建</el-button></li> | 
|---|
|  |  |  | <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:ywpatrolscheme:delete']">删除</el-button></li> | 
|---|
|  |  |  | <li><el-button type="primary" @click="editClick()" icon="el-icon-plus" | 
|---|
|  |  |  | v-permissions="['business:ywpatrolscheme:create']">新建</el-button></li> | 
|---|
|  |  |  | <el-button type="primary" plain :loading="isWorking.export" | 
|---|
|  |  |  | v-permissions="['business:ywpatrolscheme:exportExcel']" @click="exportExcel">导出</el-button> | 
|---|
|  |  |  | <!-- <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" | 
|---|
|  |  |  | v-permissions="['business:ywpatrolscheme:delete']">删除</el-button></li> --> | 
|---|
|  |  |  | </ul> | 
|---|
|  |  |  | <el-table | 
|---|
|  |  |  | v-loading="isWorking.search" | 
|---|
|  |  |  | :data="tableData.list" | 
|---|
|  |  |  | stripe | 
|---|
|  |  |  | @selection-change="handleSelectionChange" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <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禁用" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="sortnum" label="排序码" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="lineId" label="巡检点编码(关联yw_patrol_line)" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="userIds" label="巡检负责人编码集合,多个使用英文逗号隔开" 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="circleDays" label="循环重复规则 1-31,多个英文逗号隔开" 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="startTime" label="开始时间点" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="endTime" label="结束时间点" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="processStatus" label="执行进度 0待开始 1进行中 2超期 3已完成" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | v-if="containPermissions(['business:ywpatrolscheme:update', 'business:ywpatrolscheme:delete'])" | 
|---|
|  |  |  | label="操作" | 
|---|
|  |  |  | min-width="120" | 
|---|
|  |  |  | fixed="right" | 
|---|
|  |  |  | > | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <el-table-column prop="title" label="计划名称" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="code" label="计划编号" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="userName" label="负责人员" min-width="100px"></el-table-column> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <el-table-column prop="startDate" label="计划日期" min-width="150px"> | 
|---|
|  |  |  | <template v-slot="scope"> | 
|---|
|  |  |  | <span>{{ scope.row.startDate }} - {{ scope.row.endDate }}</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="startDate" label="执行时间" min-width="130px"> | 
|---|
|  |  |  | <template v-slot="scope"> | 
|---|
|  |  |  | <span>{{ scope.row.startTime }} - {{ scope.row.endTime }}</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="createUserName" label="创建人" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="" label="执行结果" min-width="100px"> | 
|---|
|  |  |  | <template v-slot="scope"> | 
|---|
|  |  |  | <span v-if="scope.row.schemeStatus == 0">待开始</span> | 
|---|
|  |  |  | <span v-if="scope.row.schemeStatus == 1">进行中</span> | 
|---|
|  |  |  | <span v-if="scope.row.schemeStatus == 2">已结束</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="状态" min-width="100px"> | 
|---|
|  |  |  | <template v-slot="scope"> | 
|---|
|  |  |  | <el-switch v-model="scope.row.status" @change="e => changeStatus(scope.row)" :active-value="0" | 
|---|
|  |  |  | :inactive-value="1"> | 
|---|
|  |  |  | </el-switch> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column v-if="containPermissions(['business:ywpatrolscheme:update', 'business:ywpatrolscheme:delete'])" | 
|---|
|  |  |  | label="操作" min-width="120" fixed="right"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <el-button type="text" @click="$refs.operaYwPatrolSchemeWindow.open('编辑运维巡检计划信息表', row)" icon="el-icon-edit" v-permissions="['business:ywpatrolscheme:update']">编辑</el-button> | 
|---|
|  |  |  | <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:ywpatrolscheme:delete']">删除</el-button> | 
|---|
|  |  |  | <el-button type="text" @click="editClick(row)" icon="el-icon-edit" | 
|---|
|  |  |  | v-permissions="['business:ywpatrolscheme:update']">编辑</el-button> | 
|---|
|  |  |  | <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" | 
|---|
|  |  |  | v-permissions="['business:ywpatrolscheme: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> | 
|---|
|  |  |  | <!-- 新建/修改 --> | 
|---|
|  |  |  | <OperaYwPatrolSchemeWindow ref="operaYwPatrolSchemeWindow" @success="handlePageChange"/> | 
|---|
|  |  |  | <OperaYwPatrolSchemeWindow ref="operaYwPatrolSchemeWindow" @success="handlePageChange" /> | 
|---|
|  |  |  | </TableLayout> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | import TableLayout from '@/layouts/TableLayout' | 
|---|
|  |  |  | import Pagination from '@/components/common/Pagination' | 
|---|
|  |  |  | import OperaYwPatrolSchemeWindow from './components/OperaYwPatrolSchemeWindow' | 
|---|
|  |  |  | import { updateStatusById } from '@/api/Inspection/ywPatrolScheme' | 
|---|
|  |  |  | import { Message } from 'element-ui' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'YwPatrolScheme', | 
|---|
|  |  |  | extends: BaseTable, | 
|---|
|  |  |  | components: { TableLayout, Pagination, OperaYwPatrolSchemeWindow }, | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | // 搜索 | 
|---|
|  |  |  | searchForm: { | 
|---|
|  |  |  | id: '', | 
|---|
|  |  |  | creator: '', | 
|---|
|  |  |  | createDate: '', | 
|---|
|  |  |  | editor: '', | 
|---|
|  |  |  | editDate: '', | 
|---|
|  |  |  | isdeleted: '', | 
|---|
|  |  |  | title: '', | 
|---|
|  |  |  | remark: '', | 
|---|
|  |  |  | status: '', | 
|---|
|  |  |  | sortnum: '', | 
|---|
|  |  |  | lineId: '', | 
|---|
|  |  |  | userIds: '', | 
|---|
|  |  |  | dealUserId: '', | 
|---|
|  |  |  | dealDate: '', | 
|---|
|  |  |  | dealInfo: '', | 
|---|
|  |  |  | circleType: '', | 
|---|
|  |  |  | circleDays: '', | 
|---|
|  |  |  | startDate: '', | 
|---|
|  |  |  | endDate: '', | 
|---|
|  |  |  | startTime: '', | 
|---|
|  |  |  | endTime: '', | 
|---|
|  |  |  | processStatus: '' | 
|---|
|  |  |  | selDate:[], | 
|---|
|  |  |  | selDateSec:[] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | created () { | 
|---|
|  |  |  | created() { | 
|---|
|  |  |  | this.config({ | 
|---|
|  |  |  | module: '运维巡检计划信息表', | 
|---|
|  |  |  | api: '/Inspection/ywPatrolScheme', | 
|---|
|  |  |  | 
|---|
|  |  |  | 'field.main': 'id' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | changeStatus(e) { | 
|---|
|  |  |  | console.log(e) | 
|---|
|  |  |  | updateStatusById(e).then(res => { | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | Message.success('状态修改成功') | 
|---|
|  |  |  | }, () => { | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | reset() { | 
|---|
|  |  |  | this.searchForm = {} | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | editClick(row) { | 
|---|
|  |  |  | if (row && row.id) { | 
|---|
|  |  |  | this.$refs.operaYwPatrolSchemeWindow.open('编辑巡检计划') | 
|---|
|  |  |  | this.$refs.operaYwPatrolSchemeWindow.getDetail(row.id) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.$refs.operaYwPatrolSchemeWindow.open('新建巡检计划') | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.$refs.operaYwPatrolSchemeWindow.initData() | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeSelDate(e) { | 
|---|
|  |  |  | if (e && e.length > 0) { | 
|---|
|  |  |  | this.$set(this.searchForm, 'startDate', e[0] ) | 
|---|
|  |  |  | this.$set(this.searchForm, 'endDate', e[1]  ) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.$set(this.searchForm, 'startDate', '') | 
|---|
|  |  |  | this.$set(this.searchForm, 'endDate', '') | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeSelDateSec(e) { | 
|---|
|  |  |  | if (e && e.length > 0) { | 
|---|
|  |  |  | this.$set(this.searchForm, 'startDateSec', e[0] ) | 
|---|
|  |  |  | this.$set(this.searchForm, 'endDateSec', e[1]  ) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.$set(this.searchForm, 'startDateSec', '') | 
|---|
|  |  |  | this.$set(this.searchForm, 'endDateSec', '') | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|