From a2299a6d4a6f99e9c11132138f5d3e9ec68f03ea Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期五, 06 六月 2025 19:19:34 +0800 Subject: [PATCH] 开发更新 --- admin/src/views/Inspection/components/OperaYwPatrolLineWindow.vue | 48 +++++++++++++++++++++++++++++++++--------------- 1 files changed, 33 insertions(+), 15 deletions(-) diff --git a/admin/src/views/Inspection/components/OperaYwPatrolLineWindow.vue b/admin/src/views/Inspection/components/OperaYwPatrolLineWindow.vue index 2d2b991..432d082 100644 --- a/admin/src/views/Inspection/components/OperaYwPatrolLineWindow.vue +++ b/admin/src/views/Inspection/components/OperaYwPatrolLineWindow.vue @@ -32,7 +32,7 @@ </el-form> <!-- --> - <el-dialog title="娣诲姞宸℃鐐�" :close-on-click-modal="false" append-to-body :visible.sync="isShowModal" width="780px"> + <el-dialog title="娣诲姞宸℃鐐�" :close-on-click-modal="false" append-to-body :visible.sync="isShowModal" width="880px"> <!-- <el-select class="w400" v-model="selPoint" clearable multiple filterable> <el-option v-for="item in pointList" :value="item.id" :label="item.name"></el-option> </el-select> --> @@ -50,16 +50,18 @@ </el-form-item> <el-button type="primary" @click="initData">鎼滅储</el-button> <el-button @click="reset">閲嶇疆</el-button> + <el-button type="primary" @click="editClick()" icon="el-icon-plus" + v-permissions="['business:ywpatrolpoint:create']">鏂板缓宸℃鐐�</el-button> </el-form> <el-table @selection-change="handleSelectionChange" v-loading="isWorking.search" :data="pointList" stripe> <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"> @@ -67,21 +69,23 @@ <el-button type="primary" @click="subModal">纭� 瀹�</el-button> </span> </el-dialog> + <OperaYwPatrolPointWindow ref="operaYwPatrolPointWindow" @success="handlePageChange" /> </GlobalWindow> </template> <script> import BaseOpera from '@/components/base/BaseOpera' import GlobalWindow from '@/components/common/GlobalWindow' +import OperaYwPatrolPointWindow from '@/views/Inspection/components/OperaYwPatrolPointWindow' 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 { name: 'OperaYwPatrolLineWindow', extends: BaseOpera, - components: { GlobalWindow, Pagination }, + components: { GlobalWindow, Pagination,OperaYwPatrolPointWindow }, data() { return { // 琛ㄥ崟鏁版嵁 @@ -120,6 +124,10 @@ }) }, methods: { + editClick(row) { + this.$refs.operaYwPatrolPointWindow.open('鏂板缓宸℃鐐�') + // this.$refs.operaYwPatrolPointWindow.initData() + }, confirm() { const { form, list } = this this.$refs['form'].validate((valid) => { @@ -127,7 +135,7 @@ 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 @@ -155,7 +163,6 @@ }) }, initData() { - this.list = [] const { searchForm, pagination } = this getFetchList({ page: pagination.page, @@ -193,8 +200,8 @@ }, openModal() { - this.selPoint = this.list.map(i => i.id) this.getProject() + this.reset() this.isShowModal = true }, changeSel(e) { @@ -206,12 +213,23 @@ 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 -- Gitblit v1.9.3