| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud v-show="!isSetPlanUser&&!detailVisible" :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @row-del="rowDel" |
| | | @row-dblclick="rowClick" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <template slot="routeRangeForm"> |
| | | <open-layers-map ref="OpenLayersMap" @toData="toData" :routeRange="form.routeRange"></open-layers-map> |
| | | </template> |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | size="small" |
| | |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button style="margin-left:10px;" size="small" type="text" icon="el-icon-user" >设置巡检人</el-button> |
| | | <el-button style="margin-left:10px;" size="small" type="text" icon="el-icon-user" @click="goToTaskplanUser(scope.row.id)">设置巡检人</el-button> |
| | | </template> |
| | | <template slot-scope="{type,size,row,index}" slot="menuBtn"> |
| | | <el-row style="width: 150px"> |
| | |
| | | <!--divided 是一个划分线--> |
| | | <el-dropdown-item icon="el-icon-edit" :size="size" :type="type" |
| | | :disabled="row.state >= 1" |
| | | @click.native="$refs.crud.rowEdit(row,index)">修 改</el-dropdown-item> |
| | | @click.native="$refs.crud.rowEdit(row,index)">编 辑</el-dropdown-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-dropdown-item icon="el-icon-delete" :size="size" :type="type" |
| | |
| | | |
| | | </template> |
| | | </avue-crud> |
| | | <!--设置巡检人--> |
| | | <taskplan-user v-show="isSetPlanUser" ref="taskplanUser" @setPlanUser="setPlanUser"></taskplan-user> |
| | | <!--查看详情--> |
| | | <taskinfo-plan-detail v-if="detailVisible" ref="detailVisible" :detailInfo="detailInfo" @isDetail="isDetail"></taskinfo-plan-detail> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove, changeStatus} from "@/api/taskinfo/taskinfoPlan"; |
| | | import {getList, add, update, remove, changeStatus} from "@/api/taskinfo/taskinfoPlan"; |
| | | import option from "@/const/taskinfo/taskinfoPlan"; |
| | | import {mapGetters} from "vuex"; |
| | | import TaskplanUser from "@/views/taskinfo/taskplanUser"; |
| | | import OpenLayersMap from "@/components/OpenLayersMap/index"; |
| | | import TaskinfoPlanDetail from "@/views/taskinfo/taskinfoPlanDetail"; |
| | | |
| | | export default { |
| | | components: {TaskinfoPlanDetail, TaskplanUser,OpenLayersMap}, |
| | | data() { |
| | | return { |
| | | isSetPlanUser:false, |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | |
| | | }, |
| | | selectionList: [], |
| | | option: option, |
| | | data: [] |
| | | data: [], |
| | | detailVisible:false, |
| | | detailInfo:{}, |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } else { |
| | | if (["add"].includes(type)) { |
| | | this.form.status = 2 |
| | | }else if (["edit"].includes(type)) { |
| | | this.form.routeRange = '\'' + this.form.routeRange + '\'' |
| | | } |
| | | done(); |
| | | }, |
| | |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | if (this.query.daterange){ |
| | | this.query.startCreateTime = this.query.daterange[0] |
| | | this.query.endCreateTime = this.query.daterange[1] |
| | | this.query.daterange = null |
| | | } |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }) |
| | | }, |
| | | goToTaskplanUser(planId) { |
| | | // this.$router.push({ path: "/taskinfo/taskplanUser", query: {planId:planId} }); |
| | | var page = { |
| | | currentPage:1, |
| | | pageSize:this.page.pageSize |
| | | } |
| | | this.$refs.taskplanUser.onLoad(page,{planId:planId}); |
| | | this.setPlanUser() |
| | | }, |
| | | setPlanUser() { |
| | | this.isSetPlanUser = !this.isSetPlanUser |
| | | }, |
| | | toData(toData) { |
| | | this.form.routeRange = toData |
| | | }, |
| | | //点击当前行事件 |
| | | rowClick(val){ |
| | | this.detailInfo = val |
| | | this.isDetail(); |
| | | }, |
| | | isDetail(){ |
| | | this.detailVisible = !this.detailVisible |
| | | } |
| | | } |
| | | }; |