| | |
| | | }) |
| | | } |
| | | |
| | | // 设施和环境条件要求-电源稳定性删除 |
| | | export function deleteLaboratoryFacilityPowerStable(query) { |
| | | return request({ |
| | | url: '/fePowerStable/deleteLaboratoryFacilityPowerStable', |
| | | method: 'delete', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // 电源稳定性-测定量 根据电源稳定性查询 |
| | | export function getFeMeasuredQuantityService(query) { |
| | | return request({ |
| | | url: "/fePowerStable/getFeMeasuredQuantityService", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 电源稳定性-测定量 导出 |
| | | export function exportFePowerStable(query) { |
| | | return request({ |
| | | url: "/fePowerStable/exportFePowerStable", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 设施和环境条件要求-防雷检测查询 |
| | | export function getLightningProtectionDetection(query) { |
| | | return request({ |
| | | url: '/feLightningProtection/getLightningProtectionDetection', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // 设施和环境条件要求-防雷检测新增/修改 |
| | | export function addLightningProtectionDetection(query) { |
| | | return request({ |
| | | url: '/feLightningProtection/addLightningProtectionDetection', |
| | | method: 'post', |
| | | data: query, |
| | | headers: { |
| | | 'Content-Type': 'multipart/form-data' // 必须设置为 multipart |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 设施和环境条件要求-防雷检测删除 |
| | | export function deleteLightningProtectionDetection(query) { |
| | | return request({ |
| | | url: '/feLightningProtection/deleteLightningProtectionDetection', |
| | | method: 'delete', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // 设施和环境条件要求-防雷检测导出 |
| | | export function exportOfLightningProtectionDetection(query) { |
| | | return request({ |
| | | url: "/feLightningProtection/exportOfLightningProtectionDetection", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 设施和环境条件要求-照度记录表-检测区域 查询 |
| | | export function getFeLightningProtection(query) { |
| | | return request({ |
| | | url: '/feIllumination/getFeLightningProtection', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // 设施和环境条件要求-照度记录表-检测区域 新增/修改 |
| | | export function addFeLightningProtection(query) { |
| | | return request({ |
| | | url: '/feIllumination/addFeLightningProtection', |
| | | method: 'post', |
| | | data: query, |
| | | }) |
| | | } |
| | | |
| | | // 设施和环境条件要求-照度记录表-检测区域 删除 |
| | | export function deleteFeLightningProtection(query) { |
| | | return request({ |
| | | url: '/feIllumination/deleteFeLightningProtection', |
| | | method: 'delete', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // 照度记录表-检测区域 根据照度记录查询 |
| | | export function getFeIlluminationDetectionArea(query) { |
| | | return request({ |
| | | url: '/feIllumination/getFeIlluminationDetectionArea', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // 照度记录表-检测区域 删除 |
| | | export function deleteFeIlluminationDetectionArea(query) { |
| | | return request({ |
| | | url: '/feIllumination/deleteFeIlluminationDetectionArea', |
| | | method: 'delete', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // 照度记录表-检测区域 导出 |
| | | export function exportFeIllumination(query) { |
| | | return request({ |
| | | url: "/feIllumination/exportFeIllumination", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getFeLightningProtection, |
| | | deviceScopeSearch, |
| | | selectUserCondition, |
| | | treeDevice, |
| | | addFeLightningProtection, |
| | | deleteFeLightningProtection, |
| | | getFeIlluminationDetectionArea, |
| | | deleteFeIlluminationDetectionArea, |
| | | exportFeIllumination |
| | | } from '@/api/cnas/resourceDemand/facilitiesEnvironment/facilitiesAndEnvironment' |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | search: { |
| | | size: 20, |
| | | size: 10, |
| | | current: 1, |
| | | total: 0 |
| | | }, |
| | |
| | | } |
| | | }, |
| | | edit(row) { |
| | | this.$axios.get(this.$api.facilitiesAndEnvironment.getFeIlluminationDetectionArea + "?intensityIlluminationId=" + row.intensityIlluminationId).then(res => { |
| | | getFeIlluminationDetectionArea({intensityIlluminationId:row.intensityIlluminationId}).then(res => { |
| | | this.form = {...row} |
| | | this.form.illuminationDetectionAreaList = res.data; |
| | | this.dialogVisible = true |
| | | }); |
| | | }, |
| | | initData() { |
| | | this.$axios.get(this.$api.facilitiesAndEnvironment.getFeLightningProtection + '?size=' + this.search.size + '¤t=' + this.search.current).then(res => { |
| | | if (res.code === 201) return; |
| | | this.tableData = res.data.records; |
| | | this.search.total = res.data.total; |
| | | getFeLightningProtection({...this.search}).then(res => { |
| | | if (res.code === 200){ |
| | | this.tableData = res.data.records; |
| | | this.search.total = res.data.total; |
| | | } |
| | | }); |
| | | }, |
| | | handleSizeChange(val) { |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.$axios.delete(this.$api.facilitiesAndEnvironment.deleteFeLightningProtection + '?intensityIlluminationId=' + row.intensityIlluminationId).then(res => { |
| | | deleteFeLightningProtection({intensityIlluminationId: row.intensityIlluminationId}).then(res => { |
| | | this.$message.success('删除成功!') |
| | | this.initData() |
| | | }) |
| | |
| | | }, |
| | | feMeasuredQuantityListDelete(row, index) { |
| | | if (row.detectionAreaId) { |
| | | this.$axios.delete(this.$api.facilitiesAndEnvironment.deleteFeIlluminationDetectionArea + '?detectionAreaId=' + row.detectionAreaId).then(res => { |
| | | if (res.code === 201) return |
| | | this.form.illuminationDetectionAreaList.splice(index, 1) |
| | | this.$message.success('删除成功!') |
| | | deleteFeIlluminationDetectionArea({detectionAreaId:row.detectionAreaId}).then(res => { |
| | | if (res.code === 200){ |
| | | this.form.illuminationDetectionAreaList.splice(index, 1) |
| | | this.$message.success('删除成功!') |
| | | } |
| | | }) |
| | | } else { |
| | | this.form.illuminationDetectionAreaList.splice(index, 1) |
| | |
| | | } |
| | | }, |
| | | openDialog() { |
| | | this.$axios.get(this.$api.deviceScope.treeDevice).then(res => { |
| | | treeDevice().then(res => { |
| | | this.cascaderList = res.data; |
| | | }); |
| | | this.$nextTick(() => { |
| | |
| | | // 获取所有设备 |
| | | getEquipOptions() { |
| | | this.equipOptions = [] |
| | | this.$axios.get(this.$api.deviceScope.deviceScopeSearch+'?status=0').then(res => { |
| | | deviceScopeSearch({status:'0'}).then(res => { |
| | | if (res.code === 200 && res.data) { |
| | | this.equipOptions = res.data |
| | | } |
| | |
| | | this.submitLoading = true |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.$axios.post(this.$api.facilitiesAndEnvironment.addFeLightningProtection, this.form, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).then(res => { |
| | | addFeLightningProtection(this.form).then(res => { |
| | | this.submitLoading = false |
| | | if (res.code === 200) { |
| | | this.initData() |
| | |
| | | }, |
| | | // 获取负责人信息接口 |
| | | getUserList() { |
| | | this.$axios.get(this.$api.deviceScope.selectUserList).then(res => { |
| | | selectUserCondition().then(res => { |
| | | if (res.code == 200) { |
| | | this.responsibleOptions = res.data |
| | | } |
| | |
| | | }, |
| | | // 导出 |
| | | downLoadPost(row) { |
| | | this.$axios.get(this.$api.facilitiesAndEnvironment.exportFeIllumination + '?intensityIlluminationId=' + row.intensityIlluminationId,{responseType: "blob"}).then(res => { |
| | | exportFeIllumination({intensityIlluminationId: row.intensityIlluminationId}).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res],{ type: 'application/msword' }); |
| | | //将Blob 对象转换成字符串 |
| | | let reader = new FileReader(); |
| | | reader.readAsText(blob, 'utf-8'); |
| | | reader.onload = () => { |
| | | try { |
| | | let result = JSON.parse(reader.result); |
| | | if (result.message) { |
| | | this.$message.error(result.message); |
| | | } else { |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = '照度记录' + '.docx'; |
| | | link.click(); |
| | | this.$message.success('导出成功') |
| | | } |
| | | } catch (err) { |
| | | console.log(err); |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = '照度记录' + '.docx'; |
| | | link.click(); |
| | | this.$message.success('导出成功') |
| | | } |
| | | } |
| | | this.$download.saveAs(blob, '照度记录.docx') |
| | | this.$message.success('导出成功') |
| | | }) |
| | | }, |
| | | } |
| | |
| | | |
| | | <script> |
| | | |
| | | import { |
| | | getLightningProtectionDetection, |
| | | addLightningProtectionDetection, |
| | | deleteLightningProtectionDetection, |
| | | exportOfLightningProtectionDetection |
| | | } from '@/api/cnas/resourceDemand/facilitiesEnvironment/facilitiesAndEnvironment' |
| | | |
| | | import axios from 'axios'; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | search: { |
| | | size: 20, |
| | | size: 10, |
| | | current: 1, |
| | | total: 0 |
| | | }, |
| | |
| | | methods: { |
| | | // 导出 |
| | | downLoadPost() { |
| | | this.$axios.get(this.$api.facilitiesAndEnvironment.exportOfLightningProtectionDetection,{responseType: "blob"}).then(res => { |
| | | exportOfLightningProtectionDetection().then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res],{ type: 'application/msword' }); |
| | | //将Blob 对象转换成字符串 |
| | | let reader = new FileReader(); |
| | | reader.readAsText(blob, 'utf-8'); |
| | | reader.onload = () => { |
| | | try { |
| | | let result = JSON.parse(reader.result); |
| | | if (result.message) { |
| | | this.$message.error(result.message); |
| | | } else { |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = '防雷检测导出' + '.xlsx'; |
| | | link.click(); |
| | | this.$message.success('导出成功') |
| | | } |
| | | } catch (err) { |
| | | console.log(err); |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = '防雷检测导出' + '.xlsx'; |
| | | link.click(); |
| | | this.$message.success('导出成功') |
| | | } |
| | | } |
| | | this.$download.saveAs(blob,'防雷检测导出.xlsx') |
| | | }) |
| | | }, |
| | | initData() { |
| | | this.$axios.get(this.$api.facilitiesAndEnvironment.getLightningProtectionDetection + '?size=' + this.search.size + '¤t=' + this.search.current).then(res => { |
| | | if (res.code === 201) return; |
| | | this.tableData = res.data.records; |
| | | this.search.total = res.data.total; |
| | | getLightningProtectionDetection({...this.search}).then(res => { |
| | | if (res.code === 200){ |
| | | this.tableData = res.data.records; |
| | | this.search.total = res.data.total; |
| | | } |
| | | |
| | | }); |
| | | }, |
| | | handleSizeChange(val) { |
| | |
| | | if (this.form.fileData.length > 0) { |
| | | params.append("file", this.form.fileData[0].file) |
| | | } |
| | | this.$axios.post(this.$api.facilitiesAndEnvironment.addLightningProtectionDetection, params, { |
| | | headers: {'Content-Type': 'multipart/form-data;'}, |
| | | noQs: true |
| | | }).then(res => { |
| | | if (res.code === 201) return; |
| | | this.dialogVisible = false |
| | | this.initData() |
| | | addLightningProtectionDetection(params).then(res => { |
| | | if (res.code === 200){ |
| | | this.dialogVisible = false |
| | | this.initData() |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.$axios.delete(this.$api.facilitiesAndEnvironment.deleteLightningProtectionDetection + '?lightningProtectionId=' + row.lightningProtectionId).then(res => { |
| | | deleteLightningProtectionDetection({lightningProtectionId:row.lightningProtectionId}).then(res => { |
| | | this.$message.success('删除成功!') |
| | | this.initData() |
| | | }) |
| | |
| | | }, |
| | | download(row) { |
| | | let url = ''; |
| | | |
| | | // fileDownload.downloadIamge(url, row.fileName) |
| | | url = this.javaApi + 'img/' + row.systemFileName |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = row.fileName; |
| | | link.click(); |
| | | url = this.javaApi + '/img/' + row.systemFileName |
| | | this.$download.saveAs(url, row.fileName) |
| | | } |
| | | } |
| | | } |
| | |
| | | treeDevice, |
| | | selectUserCondition, |
| | | addLaboratoryFacilityPowerStable, |
| | | deleteFeMeasuredQuantity |
| | | deleteFeMeasuredQuantity, |
| | | getFeMeasuredQuantityService, |
| | | deleteLaboratoryFacilityPowerStable, |
| | | exportFePowerStable |
| | | } from '@/api/cnas/resourceDemand/facilitiesEnvironment/facilitiesAndEnvironment' |
| | | |
| | | export default { |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.$axios.delete(this.$api.facilitiesAndEnvironment.deleteLaboratoryFacilityPowerStable + '?powerStableId=' + row.powerStableId).then(res => { |
| | | deleteLaboratoryFacilityPowerStable({powerStableId:row.powerStableId}).then(res => { |
| | | this.$message.success('删除成功!') |
| | | this.initData() |
| | | }) |
| | |
| | | // 电源稳定性-测定量弹框中表格的删除行 |
| | | feMeasuredQuantityListDelete(row, index) { |
| | | if (row.measuredQuantityId) { |
| | | this.$axios.delete(this.$api.facilitiesAndEnvironment.deleteFeMeasuredQuantity + '?measuredQuantityId=' + row.measuredQuantityId).then(res => { |
| | | deleteFeMeasuredQuantity({measuredQuantityId:row.measuredQuantityId}).then(res => { |
| | | if (res.code === 201) return |
| | | this.form.feMeasuredQuantityList.splice(index, 1) |
| | | this.$message.success('删除成功!') |
| | |
| | | }, |
| | | // 导出 |
| | | downLoadPost(row) { |
| | | this.$axios.get(this.$api.facilitiesAndEnvironment.exportFePowerStable + '?powerStableId=' + row.powerStableId,{responseType: "blob"}).then(res => { |
| | | exportFePowerStable({powerStableId: row.powerStableId}).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res],{ type: 'application/msword' }); |
| | | //将Blob 对象转换成字符串 |
| | | let reader = new FileReader(); |
| | | reader.readAsText(blob, 'utf-8'); |
| | | reader.onload = () => { |
| | | try { |
| | | let result = JSON.parse(reader.result); |
| | | if (result.message) { |
| | | this.$message.error(result.message); |
| | | } else { |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = '电源稳定性' + '.docx'; |
| | | link.click(); |
| | | this.$message.success('导出成功') |
| | | } |
| | | } catch (err) { |
| | | console.log(err); |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = '电源稳定性' + '.docx'; |
| | | link.click(); |
| | | this.$message.success('导出成功') |
| | | } |
| | | } |
| | | this.$download.saveAs(blob, '电源稳定性.docx') |
| | | this.$message.success('导出成功') |
| | | }) |
| | | }, |
| | | // 电源稳定性 点击行编辑触发 |
| | | edit(row) { |
| | | this.$axios.get(this.$api.facilitiesAndEnvironment.getFeMeasuredQuantityService + "?powerStableId=" + row.powerStableId).then(res => { |
| | | getFeMeasuredQuantityService({powerStableId: row.powerStableId}).then((res => { |
| | | this.form = {...row} |
| | | this.form.feMeasuredQuantityList = res.data; |
| | | this.dialogVisible = true |
| | | }); |
| | | })) |
| | | }, |
| | | // 获取负责人信息接口 |
| | | getUserList() { |