|  |  |  | 
|---|
|  |  |  | <TableLayout :permissions="['business:ywpatrolscheme: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="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" | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" | 
|---|
|  |  |  | v-permissions="['business:ywpatrolscheme:delete']">删除</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-column type="selection" width="55"></el-table-column> | 
|---|
|  |  |  | 
|---|
|  |  |  | </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: '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | changeStatus(e) { | 
|---|
|  |  |  | console.log(e); | 
|---|
|  |  |  | console.log(e) | 
|---|
|  |  |  | updateStatusById(e).then(res => { | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | Message.success('状态修改成功') | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeDate(e) { | 
|---|
|  |  |  | if(e && e.length > 0){ | 
|---|
|  |  |  | if (e && e.length > 0) { | 
|---|
|  |  |  | this.$set(this.searchForm, 'startDate', e[0]) | 
|---|
|  |  |  | this.$set(this.searchForm, 'endDate', e[1]) | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.$set(this.searchForm, 'startDate', '') | 
|---|
|  |  |  | this.$set(this.searchForm, 'endDate', '') | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | reset() { | 
|---|
|  |  |  | this.searchForm = {} | 
|---|
|  |  |  | 
|---|
|  |  |  | this.$refs.operaYwPatrolSchemeWindow.open('新建巡检计划') | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.$refs.operaYwPatrolSchemeWindow.initData() | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|