|  |  | 
 |  |  |   <TableLayout :permissions="['business:ywpatrolscheme:query']"> | 
 |  |  |     <!-- 搜索表单 --> | 
 |  |  |     <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> | 
 |  |  |       <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="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="title"> | 
 |  |  |         <el-input v-model="searchForm.title" placeholder="请输入计划名称" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="计划日期" prop="selDate"> | 
 |  |  |         <el-date-picker type="daterange" v-model="searchForm.selDate" clearable value-format="yyyy-MM-dd" | 
 |  |  |           @change="changeDate" /> | 
 |  |  |       </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> | 
 |  |  | 
 |  |  |       <ul class="toolbar" v-permissions="['business:ywpatrolscheme:create', 'business:ywpatrolscheme:delete']"> | 
 |  |  |         <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-column type="selection" width="55"></el-table-column> | 
 |  |  |  | 
 |  |  |         <el-table-column prop="title" label="计划名称" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="lineId" 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"> | 
 |  |  | 
 |  |  |         </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 v-model="scope.row.status" @change="e => changeStatus(scope.row)" :active-value="0" | 
 |  |  |               :inactive-value="1"> | 
 |  |  |             </el-switch> | 
 |  |  |           </template> | 
 |  |  |         </el-table-column> | 
 |  |  | 
 |  |  |     return { | 
 |  |  |       // 搜索 | 
 |  |  |       searchForm: { | 
 |  |  |        title: '' | 
 |  |  |         title: '', | 
 |  |  |         selDate:[], | 
 |  |  |         selDateSec:[] | 
 |  |  |       } | 
 |  |  |     } | 
 |  |  |   }, | 
 |  |  | 
 |  |  |   }, | 
 |  |  |   methods: { | 
 |  |  |     changeStatus(e) { | 
 |  |  |       console.log(e); | 
 |  |  |       console.log(e) | 
 |  |  |       updateStatusById(e).then(res => { | 
 |  |  |         this.search() | 
 |  |  |         Message.success('状态修改成功') | 
 |  |  | 
 |  |  |         this.search() | 
 |  |  |       }) | 
 |  |  |     }, | 
 |  |  |     changeDate(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', '') | 
 |  |  |       } | 
 |  |  |        | 
 |  |  |     }, | 
 |  |  |  | 
 |  |  |     reset() { | 
 |  |  |       this.searchForm = {} | 
 |  |  |       this.search() | 
 |  |  | 
 |  |  |         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', '') | 
 |  |  |       } | 
 |  |  |     }, | 
 |  |  |   } | 
 |  |  | } |