| | |
| | | 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() { |