diff --git a/.env.development b/.env.development index a2b6e98..47e54ee 100644 --- a/.env.development +++ b/.env.development @@ -2,7 +2,7 @@ ENV = 'development' # 定义变量 -VUE_APP_CITY_TYPE = '' +VUE_APP_CITY_TYPE = 'ah' # 开发环境接口调用前缀 # VUE_APP_BASE_API = '/dev-api' diff --git a/.env.production b/.env.production index cbd9641..4033a7a 100644 --- a/.env.production +++ b/.env.production @@ -6,7 +6,7 @@ NODE_ENV=production # 测试0 生产1 VUE_APP_ENV = '1' # 定义变量 -VUE_APP_CITY_TYPE = 'cq' +VUE_APP_CITY_TYPE = 'sx' # base api VUE_APP_BASE_API = '' diff --git a/src/api/axios.js b/src/api/axios.js index 029851f..f076918 100644 --- a/src/api/axios.js +++ b/src/api/axios.js @@ -35,7 +35,7 @@ const LoadingInstance = { function myAxios(axiosConfig, customOptions) { const service = axios.create({ baseURL: axiosConfig.type ? '' : baseURLs, // 设置统一的请求前缀 - timeout: 20000, // 设置统一的超时时长 + timeout: 30000, // 设置统一的超时时长 }); // 自定义配置 @@ -143,8 +143,8 @@ function httpErrorStatusHandle(error) { // console.log(router,'114'); // router.push('/login') // eslint-disable-next-line no-case-declarations - let pathName = sessionStorage.getItem('path') - router.push(pathName) + // let pathName = sessionStorage.getItem('path') + // router.push(pathName) break; case 403: message = '您没有权限操作!'; break; case 404: message = `请求地址出错: ${error.response.config.url}`; break; // 在正确域名下 diff --git a/src/api/config.js b/src/api/config.js index e34eb5b..b1887ad 100644 --- a/src/api/config.js +++ b/src/api/config.js @@ -5,7 +5,7 @@ if (process.env.NODE_ENV === 'development') { // 测试环境 // baseURL = 'http://172.29.69.38:28083/' //后端ip和端口 // baseURL = 'http://192.168.1.116:28083/' //测试后端ip和端口 - baseURL = 'http://172.29.69.38:19012/' //测试后端ip和端口 + baseURL = 'http://172.29.106.250:19012/' //测试后端ip和端口 } else { // 生产环境 @@ -13,8 +13,8 @@ if (process.env.NODE_ENV === 'development') { // baseURL = '/proxy-ah' //安徽 打包以后的路径 // baseURL = '/proxy-nx' //宁夏 打包以后的路径 // baseURL = '/proxy-xj' //新疆 打包以后的路径 - // baseURL = '/proxy-sx' //山西 打包以后的路径 - baseURL = '/proxy-cq' //重庆 打包以后的路径 + baseURL = '/proxy-sx' //山西 打包以后的路径 + // baseURL = '/proxy-cq' //重庆 打包以后的路径 } diff --git a/src/settings.js b/src/settings.js index 97bb2fb..fa4b443 100644 --- a/src/settings.js +++ b/src/settings.js @@ -10,7 +10,7 @@ module.exports = { */ sidebarLogo: true, menuExclude: [], - downloadUrl: `${process.env.VUE_APP_BASE_API}/proxy-cq/file/minio/download/`, + downloadUrl: `${process.env.VUE_APP_BASE_API}/proxy-sx/file/minio/download/`, uploadUrl: `${process.env.VUE_APP_BASE_API}/file/minio/upload/`, statusCode: { SUCCESS: 0 diff --git a/src/views/comment/components/cleanEnery.vue b/src/views/comment/components/cleanEnery.vue index 96c3eed..5d84049 100644 --- a/src/views/comment/components/cleanEnery.vue +++ b/src/views/comment/components/cleanEnery.vue @@ -114,6 +114,10 @@ export default { async getLoginCustomer() { this.loading2 = true try { + let reportCustomerId = localStorage.getItem('reportCustomerId') + if(reportCustomerId&&this.$route.name=='energyReport'){ + return + } const res = await getLoginCustomerAPI() // console.log(res.data.customerId); if (res.code == 0) { diff --git a/src/views/comment/components/device.vue b/src/views/comment/components/device.vue index 899e0f5..e80988f 100644 --- a/src/views/comment/components/device.vue +++ b/src/views/comment/components/device.vue @@ -626,6 +626,10 @@ export default { async getLoginCustomer() { this.loading2 = true try { + let reportCustomerId = localStorage.getItem('reportCustomerId') + if(reportCustomerId&&this.$route.name=='energyReport'){ + return + } const res = await getLoginCustomerAPI() // console.log(res.data.customerId); if (res.code == 0) { diff --git a/src/views/comment/components/energyReport-quota.vue b/src/views/comment/components/energyReport-quota.vue index 0700135..ea99b8b 100644 --- a/src/views/comment/components/energyReport-quota.vue +++ b/src/views/comment/components/energyReport-quota.vue @@ -716,6 +716,10 @@ export default { async getLoginCustomer() { this.loading2 = true try { + let reportCustomerId = localStorage.getItem('reportCustomerId') + if(reportCustomerId&&this.$route.name=='energyReport'){ + return + } const res = await getLoginCustomerAPI() // console.log(res.data.customerId); if (res.code == 0) { diff --git a/src/views/comment/components/manage.vue b/src/views/comment/components/manage.vue index e2ddb77..89cf51d 100644 --- a/src/views/comment/components/manage.vue +++ b/src/views/comment/components/manage.vue @@ -156,7 +156,7 @@
- 在建筑用能管理方面,贵单位{{ EnergyReportInfo.energyPlatform }}能源管控平台,平台的功能包括具备{{ EnergyReportInfo.platformFeatures }}功能。 + 在建筑用能管理方面,贵单位{{ EnergyReportInfo.energyPlatform }}能源管控平台,平台的功能包括具备{{ EnergyReportInfo.platformFeatures }}功能。 使用能源({{ EnergyReportInfo.useEnergy }})已经具备分项计量功能,用能单位能源计量器具配备{{ EnergyReportInfo.meterComplete }}。 @@ -264,6 +264,10 @@ export default { async getLoginCustomer() { this.loading2 = true try { + let reportCustomerId = localStorage.getItem('reportCustomerId') + if(reportCustomerId&&this.$route.name=='energyReport'){ + return + } const res = await getLoginCustomerAPI() // console.log(res.data.customerId); if (res.code == 0) { diff --git a/src/views/comment/components/report.vue b/src/views/comment/components/report.vue index 47fcc13..54b7372 100644 --- a/src/views/comment/components/report.vue +++ b/src/views/comment/components/report.vue @@ -26,9 +26,12 @@ -
+
重新生成
+
+ 刷新 +
{{userCode}}: @@ -212,6 +215,9 @@ export default { res ='|' + this.EnergyReportInfo.buildType.split('/')[0] } return '公共机构'+res + }, + isCq(){ + return process.env.VUE_APP_CITY_TYPE=='cq' } }, @@ -224,8 +230,8 @@ export default { created() { this.level = sessionStorage.getItem('level') this.getEnergyReportInfo() - this.doDebounce = debounce(function () { - this.getGenerateReport() + this.doDebounce = debounce(function (flag) { + this.getGenerateReport(flag) }, 5000, true) }, methods: { @@ -423,13 +429,14 @@ export default { this.$router.push({path: '/energyReport'}) }, // 重新生成 - generateReport(){ - this.doDebounce() + generateReport(flag){ + this.doDebounce(flag) }, - async getGenerateReport() { + async getGenerateReport(flag) { let data = { customerId: this.energyData.customerId, - taskId: this.energyData.taskId + taskId: this.energyData.taskId, + refresh: flag } this.$toast.loading({ duration: 0, // 持续展示 toast diff --git a/src/views/comment/components/transform.vue b/src/views/comment/components/transform.vue index cb81e22..2228979 100644 --- a/src/views/comment/components/transform.vue +++ b/src/views/comment/components/transform.vue @@ -164,7 +164,7 @@ export default { this.signed = sessionStorage.getItem('signed') const obj = JSON.parse(sessionStorage.getItem('tidCid')) - if(obj.item && obj.item.isState) { + if(obj&&obj.item && obj.item.isState) { this.isState = obj.item.isState } @@ -181,6 +181,7 @@ export default { computed: { ...mapState('report', ['EnergyReportInfo']), levelShow() { + // 客户经理 2 if(this.$store.getters.userLevel != 2) { return false } @@ -268,6 +269,10 @@ export default { async getLoginCustomer() { this.loading2 = true try { + let reportCustomerId = localStorage.getItem('reportCustomerId') + if(reportCustomerId&&this.$route.name=='energyReport'){ + return + } const res = await getLoginCustomerAPI() // console.log(res.data.customerId); if (res.code == 0) { diff --git a/src/views/energyEfficiency/TaskFilling.vue b/src/views/energyEfficiency/TaskFilling.vue index fedfba3..f1098a6 100644 --- a/src/views/energyEfficiency/TaskFilling.vue +++ b/src/views/energyEfficiency/TaskFilling.vue @@ -114,6 +114,7 @@ import { editEnergyEquip, } from '@/api/energyConsumption' import { dataMode } from '@/views/facilityManage/common.js' +import { getYearList } from "@/api/energyConsumption.js"; export default { name: 'TaskFilling', components: { @@ -623,12 +624,39 @@ export default { clearData() { this.item = {} }, + //获取能耗数据 + async getDataInit() { + const id = JSON.parse(sessionStorage.getItem("tidCid")).customerId; + const data = { + customerId: id, + pageNum: 1, + pageSize: 10, + }; + return new Promise((resolve, reject) => { + getYearList(data).then((res) => { + let {code, data} = res + if (code == 0) { + resolve(data.list) + } + }) + }) + }, //提交页面信息 - saveAllInfo() { + async saveAllInfo() { const city = process.env.VUE_APP_CITY_TYPE=='cq' const must = this.iconList&&this.iconList.some(ele => ele.typeId == '1'||ele.typeId=='8'||ele.typeId=='9')&&this.iconList.some(ele => ele.typeId=='3')&&this.iconList.some(ele => ele.typeId=='4') - // )&&ele.typeId=='3'&&ele.typeId=='4'} console.log(city, must ,this.iconList, 'lllllllllllllllllll') + let yearList = await this.getDataInit() + let noWaterList = yearList.filter(ele => {return !ele.useWater }) + console.log(noWaterList, 'yearList') + if(city&&noWaterList.length>0){ + this.$notify({ + message: '能耗信息数据里的用水量必填', + duration: 1000, + type: 'warning' + }) + return + } if(!must&&city){ this.$notify({ message: '主要用能设备空调至少填一个、照明系统与配电系统必填', diff --git a/src/views/energyEfficiency/taskManage.vue b/src/views/energyEfficiency/taskManage.vue index 22bf338..4700a71 100644 --- a/src/views/energyEfficiency/taskManage.vue +++ b/src/views/energyEfficiency/taskManage.vue @@ -287,6 +287,7 @@ import { getCurrentPersonInfoAPI } from "@/api/customerIformation.js"; import { getCode } from '@/api/common.js' import Year from '@/views/facilityManage/common-vue/year.vue' import {debounce} from '@/utils/common.js' +import { Dialog, Notify } from 'vant'; // import Loading from '@/components/loading' export default { @@ -503,6 +504,32 @@ export default { // 任务信息填报 async filling(item) { this.setCurrentTidCidPersonInfo(item) + const that = this + const res = await getCurrentPersonInfoAPI(item.customerId) + if (res.code == 0) { + this.creditCode = res.data.creditCode + if(!res.data.creditCode||res.data.creditCode=='null'||!res.data.contactName||res.data.contactName=='null'||!res.data.contactPhone||res.data.contactPhone=='null'){ + Dialog.confirm({ + title: '提示', + message: '请前往配置信息页面,填写用户基本信息', + beforeClose: async (action, done) => { + if (action === 'confirm') { + that.archivalInformation(); + done(); + }else { + done(); + } + } + }) + return + + } + } else { + this.$notify({ + type: 'danger', + message: res.msg + }) + } if (item.type == '01') { this.$router.push({ name: 'TaskFilling' @@ -520,19 +547,6 @@ export default { }) } else { sessionStorage.removeItem('enterpriseId') - try { - const res = await getCurrentPersonInfoAPI(item.customerId) - if (res.code == 0) { - this.creditCode = res.data.creditCode - } else { - this.$notify({ - type: 'danger', - message: res.msg - }) - } - } catch (error) { - console.log(error); - } this.$router.push({ name: 'acquisition', params: { @@ -542,6 +556,21 @@ export default { } } }, + + //获取当前页面信息 + getPathInfo() { + let currentPath = {} + currentPath.path = this.$route.path + currentPath.name = '客户信息填报' + this.$store.commit('path/SET_PATH', currentPath) + sessionStorage.setItem('goPage', JSON.stringify(currentPath)) + }, + // 档案信息 + archivalInformation() { + this.getPathInfo() + console.log('/archivalinformation'); + this.$router.push('/archivalinformation') + }, // 能效诊断跳转 nengxiaozd(item) { this.setCurrentTidCidPersonInfo(item) diff --git a/src/views/enterprise/energyManagement.vue b/src/views/enterprise/energyManagement.vue index bf06c58..cdfdd7a 100644 --- a/src/views/enterprise/energyManagement.vue +++ b/src/views/enterprise/energyManagement.vue @@ -387,6 +387,7 @@ export default { newVal.forEach(v => { if (v) { this.listValue.push(v.value) + this.listValue = [...new Set(this.listValue)] } }) } @@ -691,6 +692,7 @@ export default { let aaa = commonEnergySystemArr[i].replace('0', '') - 1; this.result.push(this.list[aaa]) } + this.result = [...new Set(this.result)] } //能源计量见着数据处理 if(res.data.primaryEnergyMeterType.indexOf('0')>-1){ @@ -788,6 +790,11 @@ export default { this.list.push({ name: v.name, value: v.value }) }) + + if(this.ifEnterpriseId === ''){ + this.result=[] + this.result.push(this.list[0]) + } } }, @@ -803,8 +810,7 @@ export default { this.$toast('通用能源系统必须有配电系统') return } - console.log(this.listValue2, 'this.listValue2', this.list); - return + console.log(this.listValue2, 'this.listValue2', this.listValue); if( this.listValue2.indexOf("01") === -1){ this.$toast('一级计量必须有勾选电') return diff --git a/src/views/facilityManage/bursting/burstingDetail.vue b/src/views/facilityManage/bursting/burstingDetail.vue index e9e37c0..bb24e4d 100644 --- a/src/views/facilityManage/bursting/burstingDetail.vue +++ b/src/views/facilityManage/bursting/burstingDetail.vue @@ -1,9 +1,9 @@