diff --git a/src/views/rain/inspection/inspection.vue b/src/views/rain/inspection/inspection.vue index 45c4b22..961cb6b 100644 --- a/src/views/rain/inspection/inspection.vue +++ b/src/views/rain/inspection/inspection.vue @@ -16,10 +16,10 @@ - - - - + + + + @@ -49,35 +49,39 @@ - +
- + @@ -118,8 +122,8 @@ :page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
- - + + @@ -186,19 +190,20 @@ } from '../../../api/rain/inspection.js' import { getToken - } from '@/utils/auth' - import { - getCurrentMonthFirst,getCurrentMonthLast - } from '@/utils/index' - + } from '@/utils/auth' + import { + getCurrentMonthFirst, + getCurrentMonthLast + } from '@/utils/index' + import { getparameteritem } from '../../../api/system/dictionary.js' import { listarea - } from '../../../api/basic/area.js' - import { - listmaintain + } from '../../../api/basic/area.js' + import { + listmaintain } from '../../../api/basic/unit.js' import { listroad @@ -207,7 +212,7 @@ import showRainEquipmentInfo from '@/views/rain/inspection/components/showRainEquipmentInfo' import showRainSiteInfo from '@/views/rain/inspection/components/showRainSiteInfo' import editEquipment from '@/views/rain/inspection/components/editEquipment' - import editSite from '@/views/rain/inspection/components/editSite' + import editSite from '@/views/rain/inspection/components/editSite' import maps from '@/views/rain/inspection/components/maps' export default { components: { @@ -215,31 +220,31 @@ showRainEquipmentInfo, showRainSiteInfo, editEquipment, - editSite, + editSite, maps }, data() { return { - tableHeight: 0, - formLabelWidth: "120px", + tableHeight: 0, + formLabelWidth: "120px", baseurl: "", rainTypeVisible: false, rainType: 1, - mapArr :[], - tableData: [], - paginations: { - page: 1, - page_size: 15, - total: 0 + mapArr: [], + tableData: [], + paginations: { + page: 1, + page_size: 15, + total: 0 }, searchFields: { - is_export: 0, - is_auth:1 - }, - datesearch: "", - roadsList: [], - roaddisabled: false, + is_export: 0, + is_auth: 1 + }, + datesearch: "", + roadsList: [], + roaddisabled: false, roadloading: false, selects: { sunusualList: [{ @@ -289,26 +294,26 @@ sequiementList: [{ id: "", value: "所有" - }], - maintainList: [{ - id:"", - name:"所有" + }], + maintainList: [{ + id: "", + name: "所有" }] }, - reviewFormVisible: false, - reviewList: [], - reviewForm: { - ids: [], - audit_status: 0, - audit_reamrk: "" - }, - reviewStatusList: [{ - id: 0, - value: "待复核" - }, { - id: 1, - value: "已复核" + reviewFormVisible: false, + reviewList: [], + reviewForm: { + ids: [], + audit_status: 0, + audit_reamrk: "" + }, + reviewStatusList: [{ + id: 0, + value: "待复核" + }, { + id: 1, + value: "已复核" }], rules: { @@ -328,13 +333,13 @@ type: "format", align: "center", width: 180 - }, - { - field: "maintain", - title: "所属养护单位", - type: "maintain", - align: "center", - width: 180 + }, + { + field: "maintain", + title: "所属养护单位", + type: "maintain", + align: "center", + width: 180 }, { field: "askName", @@ -389,7 +394,7 @@ { field: "操作", title: "操作", - width: 220, + width: 180, type: "opt", fixed: "right" } @@ -414,207 +419,212 @@ } }, - methods: { - initLoad() { - var that = this; - var clientHeight = document.documentElement.clientHeight - var lxHeader_height = 96.5; //查询 头部 - var paginationHeight = 37; //分页的高度 - var topHeight = 50; //页面 头部 - let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 60; - that.tableHeight = tableHeight; - - that.baseurl = location.host; - - getparameteritem('equiementList').then(res => { - for (var m of res.detail) { - that.selects.sequiementList.push(m) - } - }) - getparameteritem('unusualList').then(res => { - for (var m of res.detail) { - that.selects.sunusualList.push(m) - } - }) - - listarea({ - page: 1, - page_size: 999 - }).then(res => { - for (var m of res.data) { - that.selects.areasList.push({ - id: m.id, - name: m.name - }) - } - }) - listmaintain({ - page: 1, - page_size: 999, - }).then(response => { - for(var m of response.data){ - this.selects.maintainList.push(m) - } - }).catch(error => { - console.log(error) - reject(error) - }); - }, - load(is_export) { - // return - this.mapArr = [] - listall({ - page: this.paginations.page, - page_size: this.paginations.page_size, - ...this.searchFields - }).then(response => { - let tokens = getToken(); - if (is_export) { - var url = "/api/admin/rain-maintains/index?token=" + tokens - for (var m in this.searchFields) { - url += "&" + m + "=" + this.searchFields[m] - } - url = this.baseurl + url - console.log(url) - window.open("http://" + url, '_blank') - this.searchFields.is_export = 0 - return; - } - for (var m of response.data) { - if (m.rain_equipment_info) { - m.askName = m.rain_equipment_info.ask_content_detail ? m.rain_equipment_info.ask_content_detail : - "" - } - } - this.tableData = response.data; - this.paginations.total = response.total; - }).catch(error => { - console.log(error) - reject(error) - }); - }, - - showMap(){ - this.loadMap(this.searchFields) - this.$nextTick(function(){ - this.$refs.maps.pointArr = this.mapArr - this.$refs.maps.isShow = true - // this.$refs.maps.showMaps() - this.$refs.maps.selects = this.selects - }) - - }, - // 查询地图 点位 - loadMap(search) { - // return - this.mapArr = [] - listall({ - page: 1, - page_size: 9999999, - start_date:getCurrentMonthFirst(), - end_date:getCurrentMonthLast(), - ...search - }).then(response => { - for (var m of response.data) { - if (m.rain_equipment_info) { - this.mapArr.push([ - m.rain_equipment_info.longitude,m.rain_equipment_info.latitude,m.rain_equipment_info.address,m.id,m.type - ]) - } - if (m.building_site_info) { - this.mapArr.push([ - m.building_site_info.building_site.longitude,m.building_site_info.building_site.latitude,m.building_site_info.building_site.address,m.id,m.type - ]) - } - } - this.$refs.maps.showSearch = false - this.$refs.maps.pointArr = this.mapArr - this.$refs.maps.resetPointArr() - }).catch(error => { - console.log(error) - reject(error) - }); - }, - handleCurrentChange(page) { - this.paginations.page = page; - this.load(); - }, - // 新增 编辑 - edit(obj) { - var that = this; - if (obj) { - if (obj.type == 1) { - this.$refs.editEquipment.infoId = obj.id - this.$refs.editEquipment.getEquipmentInfo(obj.id) - this.$refs.editEquipment.isShow = true - } - if (obj.type == 2) { - this.$refs.editSite.infoId = obj.id - this.$refs.editSite.getSiteInfo(obj.id) - this.$refs.editSite.isShow = true - } - } else { - this.rainTypeVisible = true - } - - }, - submitRainType() { - var that = this - this.rainTypeVisible = false - if (that.rainType == 1) { - this.$refs.editEquipment.infoId = "" - this.$refs.editEquipment.getEquipmentInfo() - this.$refs.editEquipment.isShow = true - - } else if (that.rainType == 2) { - this.$refs.editSite.infoId = "" - this.$refs.editSite.getSiteInfo() - this.$refs.editSite.isShow = true - } - }, - resetrainType() { - this.rainTypeVisible = false - this.rainType = 1 - }, - // 审核 办结 查看 - showInfo(obj, formtype) { - // 日常雨水设施 - if (obj.type == 1) { - this.$refs.showRainEquipmentInfo.isShow = true - this.$refs.showRainEquipmentInfo.getEquipmentInfo(obj.id) - this.$refs.showRainEquipmentInfo.infoId = obj.id - this.$refs.showRainEquipmentInfo.formType = formtype - } - // 工地 - if (obj.type == 2) { - this.$refs.showRainSiteInfo.isShow = true - this.$refs.showRainSiteInfo.getSiteInfo(obj.id) - this.$refs.showRainSiteInfo.infoId = obj.id - this.$refs.showRainSiteInfo.formType = formtype - } - - }, - - del(obj) { - var that = this; - if (obj) { - this.$Modal.confirm({ - title: '确认要删除数据?', - onOk: () => { - del(obj.id).then(response => { - this.$Message.success('操作成功'); - that.load(); - }).catch(error => { - console.log(error) - reject(error) - }) - }, - onCancel: () => { - //this.$Message.info('Clicked cancel'); - } - }); - } - }, + methods: { + initLoad() { + var that = this; + var clientHeight = document.documentElement.clientHeight + var lxHeader_height = 96.5; //查询 头部 + var paginationHeight = 37; //分页的高度 + var topHeight = 50; //页面 头部 + let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 60; + that.tableHeight = tableHeight; + + that.baseurl = location.host; + + getparameteritem('equiementList').then(res => { + for (var m of res.detail) { + that.selects.sequiementList.push(m) + } + }) + getparameteritem('unusualList').then(res => { + for (var m of res.detail) { + that.selects.sunusualList.push(m) + } + }) + + listarea({ + page: 1, + page_size: 999 + }).then(res => { + for (var m of res.data) { + that.selects.areasList.push({ + id: m.id, + name: m.name + }) + } + }) + listmaintain({ + page: 1, + page_size: 999, + }).then(response => { + for (var m of response.data) { + this.selects.maintainList.push(m) + } + }).catch(error => { + console.log(error) + reject(error) + }); + }, + load(is_export) { + // return + this.mapArr = [] + listall({ + page: this.paginations.page, + page_size: this.paginations.page_size, + ...this.searchFields + }).then(response => { + let tokens = getToken(); + if (is_export) { + var url = "/api/admin/rain-maintains/index?token=" + tokens + for (var m in this.searchFields) { + url += "&" + m + "=" + this.searchFields[m] + } + url = this.baseurl + url + console.log(url) + window.open("http://" + url, '_blank') + this.searchFields.is_export = 0 + return; + } + for (var m of response.data) { + if (m.rain_equipment_info) { + m.askName = m.rain_equipment_info.ask_content_detail ? m.rain_equipment_info.ask_content_detail : + "" + } + } + this.tableData = response.data; + this.paginations.total = response.total; + }).catch(error => { + console.log(error) + reject(error) + }); + }, + + showMap() { + this.loadMap(this.searchFields) + this.$nextTick(function() { + this.$refs.maps.pointArr = this.mapArr + this.$refs.maps.isShow = true + // this.$refs.maps.showMaps() + this.$refs.maps.selects = this.selects + }) + + }, + // 查询地图 点位 + loadMap(search) { + // return + this.mapArr = [] + listall({ + page: 1, + page_size: 9999999, + start_date: getCurrentMonthFirst(), + end_date: getCurrentMonthLast(), + ...search + }).then(response => { + for (var m of response.data) { + if (m.rain_equipment_info) { + this.mapArr.push([ + m.rain_equipment_info.longitude, m.rain_equipment_info.latitude, m.rain_equipment_info.address, + m.id, m.type + ]) + } + if (m.building_site_info) { + this.mapArr.push([ + m.building_site_info.building_site.longitude, m.building_site_info.building_site.latitude, m + .building_site_info.building_site.address, m.id, m.type + ]) + } + } + this.$refs.maps.showSearch = false + this.$refs.maps.pointArr = this.mapArr + this.$refs.maps.resetPointArr() + }).catch(error => { + console.log(error) + reject(error) + }); + }, + handleCurrentChange(page) { + this.paginations.page = page; + this.load(); + }, + // 新增 编辑 + edit(obj) { + var that = this; + if (obj) { + if (obj.type == 1) { + this.$refs.editEquipment.infoId = obj.id + this.$refs.editEquipment.getEquipmentInfo(obj.id) + this.$refs.editEquipment.isShow = true + } + if (obj.type == 2) { + this.$refs.editSite.infoId = obj.id + this.$refs.editSite.getSiteInfo(obj.id) + this.$refs.editSite.isShow = true + } + } else { + this.rainTypeVisible = true + } + + }, + submitRainType() { + var that = this + this.rainTypeVisible = false + if (that.rainType == 1) { + this.$refs.editEquipment.infoId = "" + this.$refs.editEquipment.getEquipmentInfo() + this.$refs.editEquipment.isShow = true + + } else if (that.rainType == 2) { + this.$refs.editSite.infoId = "" + this.$refs.editSite.getSiteInfo() + this.$refs.editSite.isShow = true + } + }, + resetrainType() { + this.rainTypeVisible = false + this.rainType = 1 + }, + clickShowInfo(row) { + this.showInfo(row, 'showform') + }, + // 审核 办结 查看 + showInfo(obj, formtype) { + // 日常雨水设施 + if (obj.type == 1) { + this.$refs.showRainEquipmentInfo.isShow = true + this.$refs.showRainEquipmentInfo.getEquipmentInfo(obj.id) + this.$refs.showRainEquipmentInfo.infoId = obj.id + this.$refs.showRainEquipmentInfo.formType = formtype + } + // 工地 + if (obj.type == 2) { + this.$refs.showRainSiteInfo.isShow = true + this.$refs.showRainSiteInfo.getSiteInfo(obj.id) + this.$refs.showRainSiteInfo.infoId = obj.id + this.$refs.showRainSiteInfo.formType = formtype + } + + }, + + del(obj) { + var that = this; + if (obj) { + this.$Modal.confirm({ + title: '确认要删除数据?', + onOk: () => { + del(obj.id).then(response => { + this.$Message.success('操作成功'); + that.load(); + }).catch(error => { + console.log(error) + reject(error) + }) + }, + onCancel: () => { + //this.$Message.info('Clicked cancel'); + } + }); + } + }, // 复核 handleSelectionChange(val) { console.log(val) @@ -660,27 +670,27 @@ var that = this that.searchFields.is_export = 1 that.load(true) - }, - getUserName(row) { - if (row.admin) { - return row.admin.name; - } else if (row.user) { - return row.user.name; - } else { - return "未知"; - } - }, - getMaintinName(row) { - if (row.user) { - if(row.user.maintain){ - return row.user.maintain.name; - }else{ - return ""; - } - - } else { - return ""; - } + }, + getUserName(row) { + if (row.admin) { + return row.admin.name; + } else if (row.user) { + return row.user.name; + } else { + return "未知"; + } + }, + getMaintinName(row) { + if (row.user) { + if (row.user.maintain) { + return row.user.maintain.name; + } else { + return ""; + } + + } else { + return ""; + } }, remoteRoad() { this.roadsList = [] @@ -698,7 +708,7 @@ } else { this.roadsList = [] } - } + } } } diff --git a/src/views/rain/maintain/maintain.vue b/src/views/rain/maintain/maintain.vue index baf35ba..e7d0fba 100644 --- a/src/views/rain/maintain/maintain.vue +++ b/src/views/rain/maintain/maintain.vue @@ -45,42 +45,47 @@ - +
- +