|  |  |  | 
|---|
|  |  |  | <el-table-column type="selection" width="55" align="center" /> | 
|---|
|  |  |  | <el-table-column prop="code" label="巡检点编码" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="name" label="巡检点名称" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="deviceName" label="巡检点名称" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="areaName" label="巡检点名称" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="deviceName" label="关联设备" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="areaName" label="巡检区域" min-width="100px"></el-table-column> | 
|---|
|  |  |  | </el-table> | 
|---|
|  |  |  | <pagination @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="pagination"> | 
|---|
|  |  |  | <pagination class="mt10" @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="pagination"> | 
|---|
|  |  |  | </pagination> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <span slot="footer" class="dialog-footer"> | 
|---|
|  |  |  | 
|---|
|  |  |  | import GlobalWindow from '@/components/common/GlobalWindow' | 
|---|
|  |  |  | import Pagination from '@/components/common/Pagination' | 
|---|
|  |  |  | import { fetchList as getFetchList } from '@/api/Inspection/ywPatrolPoint' | 
|---|
|  |  |  | import { create,updateById, detailById } from '@/api/Inspection/ywPatrolLine' | 
|---|
|  |  |  | import { create, updateById, detailById } from '@/api/Inspection/ywPatrolLine' | 
|---|
|  |  |  | import { Message } from 'element-ui' | 
|---|
|  |  |  | import { fetchList } from '@/api/business/category' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | 
|---|
|  |  |  | if (list.length == 0) return Message.warning('请先选择巡检点') | 
|---|
|  |  |  | form.linePointList = list | 
|---|
|  |  |  | this.isWorking = true | 
|---|
|  |  |  | let  fn = form.id ? updateById : create | 
|---|
|  |  |  | let fn = form.id ? updateById : create | 
|---|
|  |  |  | fn({ ...form }).then(res => { | 
|---|
|  |  |  | Message.success('保存成功') | 
|---|
|  |  |  | this.isWorking = false | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | initData() { | 
|---|
|  |  |  | this.list = [] | 
|---|
|  |  |  | const { searchForm, pagination } = this | 
|---|
|  |  |  | getFetchList({ | 
|---|
|  |  |  | page: pagination.page, | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | openModal() { | 
|---|
|  |  |  | this.selPoint = this.list.map(i => i.id) | 
|---|
|  |  |  | this.getProject() | 
|---|
|  |  |  | this.reset() | 
|---|
|  |  |  | this.isShowModal = true | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeSel(e) { | 
|---|
|  |  |  | 
|---|
|  |  |  | this.initData() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | subModal() { | 
|---|
|  |  |  | this.list = this.selList.map(item => { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | needScancode: 0, | 
|---|
|  |  |  | pointName: item.name, | 
|---|
|  |  |  | pointId: item.id, | 
|---|
|  |  |  | code: item.code | 
|---|
|  |  |  | // this.list = this.selList.map(item => { | 
|---|
|  |  |  | //   return { | 
|---|
|  |  |  | //     needScancode: 0, | 
|---|
|  |  |  | //     pointName: item.name, | 
|---|
|  |  |  | //     pointId: item.id, | 
|---|
|  |  |  | //     code: item.code | 
|---|
|  |  |  | //   } | 
|---|
|  |  |  | // }) | 
|---|
|  |  |  | this.selList.forEach(item => { | 
|---|
|  |  |  | const index = this.list.findIndex(i => i.code === item.code) | 
|---|
|  |  |  | if (index === -1) { | 
|---|
|  |  |  | this.list.push({ | 
|---|
|  |  |  | needScancode: 0, | 
|---|
|  |  |  | pointName: item.name, | 
|---|
|  |  |  | pointId: item.id, | 
|---|
|  |  |  | code: item.code | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.isShowModal = false | 
|---|