Compare commits
1 Commits
dev
..
d883b51b0d
| Author | SHA1 | Date | |
|---|---|---|---|
| d883b51b0d |
+1
-1
@@ -2,7 +2,7 @@
|
||||
ENV = 'development'
|
||||
|
||||
# 定义变量
|
||||
VUE_APP_CITY_TYPE = ''
|
||||
VUE_APP_CITY_TYPE = 'ah'
|
||||
|
||||
# 开发环境接口调用前缀
|
||||
# VUE_APP_BASE_API = '/dev-api'
|
||||
|
||||
+1
-1
@@ -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 = ''
|
||||
|
||||
+7
-12
@@ -1,6 +1,5 @@
|
||||
import myAxios from './axios'
|
||||
const sx = ''
|
||||
// const sx = process.env.VUE_APP_CITY_TYPE == 'sx' ? '/ferry_service/ferryController/conveyor' : ''
|
||||
const sx = process.env.VUE_APP_CITY_TYPE == 'sx' ? '/ferry_service/ferryController/conveyor' : ''
|
||||
|
||||
// 查询客户基本信息分页列表
|
||||
export function getUserInfo(params) {
|
||||
@@ -151,31 +150,27 @@ export function getStatisticAPI(params) {
|
||||
// 签名上传
|
||||
export function uploadNoting(params) {
|
||||
return myAxios({
|
||||
url: `${sx}/energy-effcicency-net-service/nxzdUserFileNet/upload`,
|
||||
url: '/portal/file/minio/upload',
|
||||
method: 'POST',
|
||||
params: params,
|
||||
unEncrypted: true
|
||||
params: params
|
||||
})
|
||||
}
|
||||
//图片上传
|
||||
// 注意:不能手动设置 Content-Type,否则浏览器不会自动生成 multipart boundary;
|
||||
// 需 unEncrypted 跳过请求拦截器加密,FormData 不能被 JSON.stringify+SM4 替换
|
||||
export function uploadFile(params) {
|
||||
// console.log(params);
|
||||
// console.log(decrypt(params));
|
||||
return myAxios({
|
||||
url: `${sx}/energy-effcicency-net-service/nxzdUserFileNet/upload`,
|
||||
url: '/file/minio/upload',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
unEncrypted: true
|
||||
data: params
|
||||
})
|
||||
}
|
||||
//图片读取
|
||||
export function downloadFile(attach_id) {
|
||||
return myAxios({
|
||||
url: `${sx}/energy-effcicency-net-service/nxzdUserFileNet/download/${attach_id}`,
|
||||
url: '/file/minio/download',
|
||||
method: 'POST',
|
||||
responseType: 'blob',
|
||||
params: attach_id
|
||||
})
|
||||
}
|
||||
// 生成诊断报告
|
||||
|
||||
+3
-3
@@ -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; // 在正确域名下
|
||||
|
||||
+3
-3
@@ -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' //重庆 打包以后的路径
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-1
@@ -10,7 +10,8 @@ module.exports = {
|
||||
*/
|
||||
sidebarLogo: true,
|
||||
menuExclude: [],
|
||||
downloadUrl: `${process.env.VUE_APP_BASE_API}/energy-effcicency-net-service/nxzdUserFileNet/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
|
||||
},
|
||||
|
||||
@@ -183,47 +183,4 @@ export function fileDown (downLoadUrl, fileName, id,data) {
|
||||
// console.log("fileDownloadCallback 下载文件 回调 " + JSON.stringify(obj));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 通过 POST 接口下载图片并返回 blob URL
|
||||
* @param {string} attach_id 文件ID
|
||||
* @returns {Promise<string>} blob URL
|
||||
*/
|
||||
export async function getImageBlobUrl(attach_id) {
|
||||
try {
|
||||
const { downloadFile } = await import('@/api/api')
|
||||
const blob = await downloadFile(attach_id)
|
||||
if (blob instanceof Blob && blob.size > 0) {
|
||||
const type = blob.type && blob.type.startsWith('image/') ? blob.type : 'image/jpeg'
|
||||
const imgBlob = new Blob([blob], { type })
|
||||
const url = URL.createObjectURL(imgBlob)
|
||||
console.log('getImageBlobUrl ok: id=', attach_id, 'type=', blob.type, 'size=', blob.size, 'url=', url)
|
||||
return url
|
||||
}
|
||||
console.error('getImageBlobUrl 无效响应: id=', attach_id, 'isBlob=', blob instanceof Blob, 'size=', blob && blob.size, 'type=', blob && blob.type)
|
||||
return ''
|
||||
} catch (e) {
|
||||
console.error('getImageBlobUrl 请求失败: id=', attach_id, e)
|
||||
return ''
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 通过 POST 接口下载文件并触发浏览器保存
|
||||
* 注意:后端返回的是文件流(Blob),浏览器不会自动下载,需手动触发
|
||||
* @param {string} attachId 文件ID
|
||||
* @param {string} [fileName] 保存的文件名(带后缀),缺省为 'download'
|
||||
*/
|
||||
export async function downloadFileById(attachId, fileName) {
|
||||
const { downloadFile } = await import('@/api/api')
|
||||
const blob = await downloadFile(attachId)
|
||||
if (!(blob instanceof Blob)) return
|
||||
const url = URL.createObjectURL(blob)
|
||||
const a = document.createElement('a')
|
||||
a.href = url
|
||||
a.download = fileName || 'download'
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
a.remove()
|
||||
URL.revokeObjectURL(url)
|
||||
}
|
||||
|
||||
export default service
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="manage-start-text">
|
||||
在建筑用能管理方面,贵单位{{ EnergyReportInfo.energyPlatform }}能源管控平台<span v-if="!(EnergyReportInfo.platformFeatures.split('')[0] == '未'||EnergyReportInfo.platformFeatures == '无')">,平台的功能包括具备{{ EnergyReportInfo.platformFeatures }}功能</span>。
|
||||
在建筑用能管理方面,贵单位{{ EnergyReportInfo.energyPlatform }}能源管控平台<span v-if="!(EnergyReportInfo.platformFeatures&&(EnergyReportInfo.platformFeatures.split('')[0] == '未'||EnergyReportInfo.platformFeatures == '无'))">,平台的功能包括具备{{ EnergyReportInfo.platformFeatures }}功能</span>。
|
||||
<span v-if="!(EnergyReportInfo.useEnergy == '无')">
|
||||
使用能源({{ EnergyReportInfo.useEnergy }})已经具备分项计量功能,用能单位能源计量器具配备{{ EnergyReportInfo.meterComplete }}。
|
||||
</span>
|
||||
@@ -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) {
|
||||
|
||||
@@ -26,9 +26,12 @@
|
||||
<!-- <van-dropdown-menu class="timeSelect" v-if="timeSelectShow" >
|
||||
<van-dropdown-item v-model="yearVal" :options="yearList" @change="handelChangeTime" />
|
||||
</van-dropdown-menu> -->
|
||||
<div class="detail2-right-top-reset" @click="generateReport" v-if="timeSelectShow">
|
||||
<div class="detail2-right-top-reset" @click="generateReport(false)" v-if="timeSelectShow">
|
||||
重新生成
|
||||
</div>
|
||||
<div class="detail2-right-top-reset" @click="generateReport(true)" v-if="timeSelectShow&&isCq">
|
||||
刷新
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail2-right-bottom">
|
||||
{{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
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
<script>
|
||||
// import reportHeader from './report-header.vue'
|
||||
import { getImageBlobUrl } from '@/utils/index'
|
||||
import { downloadUrl } from '@/settings'
|
||||
import { mapState,mapMutations } from 'vuex'
|
||||
import { setTitle } from '@/utils/dsbridge.js'
|
||||
import { Notify } from 'vant'
|
||||
@@ -150,7 +150,6 @@ export default {
|
||||
return {
|
||||
signed: '',
|
||||
signFile: '',
|
||||
imageUrlData: null,
|
||||
flagModule:false,
|
||||
isState: false
|
||||
// EnergyReportInfo: {}
|
||||
@@ -158,15 +157,6 @@ export default {
|
||||
}
|
||||
},
|
||||
// components: { reportHeader },
|
||||
watch: {
|
||||
async '$store.getters.imageUrl'(val) {
|
||||
if (val) {
|
||||
this.imageUrlData = await getImageBlobUrl(val)
|
||||
} else {
|
||||
this.imageUrlData = null
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
setTitle('节能改造措施')
|
||||
this.getEnergyReportInfo()
|
||||
@@ -174,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
|
||||
}
|
||||
|
||||
@@ -191,13 +181,17 @@ export default {
|
||||
computed: {
|
||||
...mapState('report', ['EnergyReportInfo']),
|
||||
levelShow() {
|
||||
// 客户经理 2
|
||||
if(this.$store.getters.userLevel != 2) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
imageUrl() {
|
||||
return this.imageUrlData
|
||||
if(this.$store.getters.imageUrl) {
|
||||
return `${downloadUrl}${this.$store.getters.imageUrl}`
|
||||
}
|
||||
return null
|
||||
},
|
||||
show() {
|
||||
return localStorage.getItem('show') === 'true'
|
||||
@@ -275,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) {
|
||||
|
||||
@@ -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: '主要用能设备空调至少填一个、照明系统与配电系统必填',
|
||||
|
||||
@@ -104,7 +104,7 @@ import {
|
||||
// chooseAlbumAndTakePhoto,
|
||||
} from '@/utils/dsbridge'
|
||||
import { insertPositionData, getPositionData } from '@/api/api.js'
|
||||
import { getImageBlobUrl } from '@/utils/index'
|
||||
import { downloadUrl } from '@/settings'
|
||||
import {debounce} from '@/utils/common.js'
|
||||
export default {
|
||||
components: {
|
||||
@@ -143,28 +143,33 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
// 查询打卡记录
|
||||
async getHistory(){
|
||||
getHistory(){
|
||||
this.text1 = []
|
||||
const res = await getPositionData({taskId: this.taskId})
|
||||
console.log(res.code , res.data);
|
||||
if(res.code == 0&&res.data){
|
||||
this.formData = res.data
|
||||
if (res.data.fileId) {
|
||||
const blobUrl = await getImageBlobUrl(res.data.fileId)
|
||||
this.$set(this.text1,0, {
|
||||
fileName: res.data.fileName,
|
||||
fileId: res.data.fileId,
|
||||
url: blobUrl
|
||||
})
|
||||
console.log(this.text1);
|
||||
getPositionData({taskId: this.taskId}).then(res => {
|
||||
console.log(res.code , res.data);
|
||||
if(res.code == 0&&res.data){
|
||||
// for (const key in this.formData) {
|
||||
// if (Object.hasOwnProperty.call(this.formData, key)) {
|
||||
// this.formData[key] = res.data[key]
|
||||
// }
|
||||
// }
|
||||
this.formData = res.data
|
||||
if (res.data.fileId) {
|
||||
this.$set(this.text1,0, {
|
||||
fileName: res.data.fileName,
|
||||
fileId: res.data.fileId,
|
||||
url: `${downloadUrl}${res.data.fileId}`
|
||||
})
|
||||
console.log(this.text1);
|
||||
}
|
||||
this.$forceUpdate()
|
||||
this.showSubmit = true
|
||||
}else{
|
||||
this.showSubmit = true
|
||||
this.getLocation()
|
||||
this.getAddress()
|
||||
}
|
||||
this.$forceUpdate()
|
||||
this.showSubmit = true
|
||||
}else{
|
||||
this.showSubmit = true
|
||||
this.getLocation()
|
||||
this.getAddress()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取当前位置
|
||||
getLocation() {
|
||||
|
||||
@@ -301,7 +301,7 @@ import mixin from '@/mixins/mixin'
|
||||
// import { Toast } from 'vant'
|
||||
import { getCode } from '@/api/common.js'
|
||||
import { addEnergyEquip } from '@/api/energyConsumption'
|
||||
import { getImageBlobUrl } from '@/utils/index'
|
||||
import { downloadUrl } from '@/settings'
|
||||
import { Notify } from 'vant';
|
||||
import { getLocationMessage, getPosition, chooseAlbumAndTakePhoto } from '@/utils/dsbridge'
|
||||
import Loading from '@/components/loading'
|
||||
@@ -313,6 +313,7 @@ import {
|
||||
getInfo,
|
||||
uploadFile,
|
||||
changeSaveStateAPI,
|
||||
// downloadFile,
|
||||
duplicateCheck,
|
||||
} from '@/api/api.js'
|
||||
// import { debuglog } from 'util'
|
||||
@@ -840,18 +841,16 @@ export default {
|
||||
return formData
|
||||
},
|
||||
// 上传图片调用原生的方法 获取到绝对路径调用getImageFileFromUrl
|
||||
async onUpload () {
|
||||
chooseAlbumAndTakePhoto(async (data) => {
|
||||
onUpload () {
|
||||
chooseAlbumAndTakePhoto((data) => {
|
||||
// this.saveGreenComeData(data)
|
||||
let d = 'data:image/jpeg;base64,' + data
|
||||
this.fileIamge = d
|
||||
let params = this.base64ToFile(d,new Date().getTime().toString())
|
||||
uploadFile(params).then(async (res) => {
|
||||
uploadFile(params).then((res) => {
|
||||
if (res.code === 0) {
|
||||
const blobUrl = await getImageBlobUrl(res.data.attach_id)
|
||||
this.fileList.push({
|
||||
url: blobUrl,
|
||||
isImage: true,
|
||||
url:`${downloadUrl}${res.data.attach_id}`
|
||||
})
|
||||
this.fileIds.push(res.data.attach_id)
|
||||
}
|
||||
@@ -1229,26 +1228,23 @@ export default {
|
||||
// })
|
||||
// this.form.files.map(path => ({ url: `${downloadUrl}${path}` }))
|
||||
if (res.data.text1) {
|
||||
const url1 = await getImageBlobUrl(res.data.text1)
|
||||
const url1 = `${downloadUrl}${res.data.text1}`
|
||||
this.fileList.push({
|
||||
url: url1,
|
||||
isImage: true,
|
||||
})
|
||||
this.fileIds.push(res.data.text1)
|
||||
}
|
||||
if (res.data.text2) {
|
||||
const url2 = await getImageBlobUrl(res.data.text2)
|
||||
const url2 = `${downloadUrl}${res.data.text2}`
|
||||
this.fileList.push({
|
||||
url: url2,
|
||||
isImage: true,
|
||||
})
|
||||
this.fileIds.push(res.data.text2)
|
||||
}
|
||||
if (res.data.text3) {
|
||||
const url3 = await getImageBlobUrl(res.data.text3)
|
||||
const url3 = `${downloadUrl}${res.data.text3}`
|
||||
this.fileList.push({
|
||||
url: url3,
|
||||
isImage: true,
|
||||
})
|
||||
this.fileIds.push(res.data.text3)
|
||||
}
|
||||
@@ -1793,11 +1789,14 @@ export default {
|
||||
return true
|
||||
},
|
||||
delImg(detail) {
|
||||
const index = this.fileList.findIndex((ele)=> ele == detail)
|
||||
if (index > -1) {
|
||||
this.fileList.splice(index, 1)
|
||||
this.fileIds.splice(index, 1)
|
||||
let url = ''
|
||||
if(!detail.file) {
|
||||
url = detail.url.split('download/')[1]
|
||||
}
|
||||
const index = this.fileList.findIndex((ele)=> ele == detail)
|
||||
const index2 = this.fileIds.findIndex((ele)=> ele == url)
|
||||
this.fileList.splice(index, 1)
|
||||
this.fileIds.splice(index2, 1)
|
||||
// console.log(this.fileList)
|
||||
// console.log(this.fileIds)
|
||||
// return new Promise((resolve, reject) => {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
import { getCurrentUserEvaluate, getCurrentUserEvaluateAdd } from '@/api/evaluateAndReply'
|
||||
import { Notify } from 'vant'
|
||||
import Loading from '@/components/loading'
|
||||
import { getImageBlobUrl } from '@/utils/index'
|
||||
import { downloadUrl } from '@/settings'
|
||||
import {debounce} from '@/utils/common.js'
|
||||
export default {
|
||||
name: 'userEvaluate',
|
||||
@@ -142,7 +142,7 @@ export default {
|
||||
try {
|
||||
if (res.code == 0) {
|
||||
if (res.data.list.length > 0) {
|
||||
for (const v of res.data.list) {
|
||||
res.data.list.forEach((v) => {
|
||||
if(v.nxzdEvaluateReplyDTOS && v.nxzdEvaluateReplyDTOS.length > 0) {
|
||||
v.show = true
|
||||
v.showTextArea = false
|
||||
@@ -152,9 +152,9 @@ export default {
|
||||
v.message = ''
|
||||
}
|
||||
if(v.image) {
|
||||
v.image = await getImageBlobUrl(v.image)
|
||||
v.image = `${downloadUrl}${v.image}`
|
||||
}
|
||||
}
|
||||
})
|
||||
this.list = res.data.list
|
||||
this.reportLevel = res.data.list[0]
|
||||
this.levelName(this.reportLevel.reportValue)
|
||||
|
||||
@@ -125,7 +125,7 @@ import { pumpList, pumpRemove, enterprisGetInfo, enterprisEdit, enterprisAdd } f
|
||||
import { Notify } from "vant";
|
||||
|
||||
import Uploader from '@/views/facilityManage/common-vue/uploader.vue'
|
||||
import { getImageBlobUrl } from '@/utils/index'
|
||||
import { downloadUrl } from '@/settings'
|
||||
|
||||
// import Header from "@/components/headerNew";
|
||||
import {debounce} from '@/utils/common.js'
|
||||
@@ -200,7 +200,7 @@ export default {
|
||||
},
|
||||
//安卓会调用的方法
|
||||
onUpload(data, type) {
|
||||
this[type] = [data[0].fileId]
|
||||
this[type] = [data[0].url]
|
||||
},
|
||||
|
||||
delImg(file, detail, type) {
|
||||
@@ -242,15 +242,21 @@ export default {
|
||||
}
|
||||
|
||||
if(this.text1.length > 0 && this.text1[0] instanceof Object) {
|
||||
this.text1 = [this.text1[0].fileId]
|
||||
this.text1 = [this.text1[0].url.split('download/')[1]]
|
||||
} else if(this.text1.length > 0 && this.text1[0].split('download/').length > 1) {
|
||||
this.text1 = [this.text1[0].split('download/')[1]]
|
||||
}
|
||||
|
||||
if(this.text2.length > 0 && this.text2[0] instanceof Object) {
|
||||
this.text2 = [this.text2[0].fileId]
|
||||
this.text2 = [this.text2[0].url.split('download/')[1]]
|
||||
} else if(this.text2.length > 0 && this.text2[0].split('download/').length > 1) {
|
||||
this.text2 = [this.text2[0].split('download/')[1]]
|
||||
}
|
||||
|
||||
if(this.text3.length > 0 && this.text3[0] instanceof Object) {
|
||||
this.text3 = [this.text3[0].fileId]
|
||||
this.text3 = [this.text3[0].url.split('download/')[1]]
|
||||
} else if(this.text3.length > 0 && this.text3[0].split('download/').length > 1) {
|
||||
this.text3 = [this.text3[0].split('download/')[1]]
|
||||
}
|
||||
|
||||
const text = this.text1.concat(this.text2, this.text3)
|
||||
@@ -260,9 +266,14 @@ export default {
|
||||
//判断是否为对象格式
|
||||
ifObj(imgList) {
|
||||
console.log(imgList,'imgList');
|
||||
imgList.forEach((v) => {
|
||||
if(v instanceof Object && v.url.split('download/').length > 1) {
|
||||
v.url = v.url.split('download/')[1]
|
||||
}
|
||||
})
|
||||
const list = imgList.map((ele)=>{
|
||||
if(ele instanceof Object) {
|
||||
return ele.fileId
|
||||
return ele.url
|
||||
}
|
||||
return ele
|
||||
})
|
||||
@@ -320,22 +331,19 @@ export default {
|
||||
if(res.data.text2) {
|
||||
if(res.data.text2.split(',')[0] != 0) {
|
||||
this.text1.push({
|
||||
fileId: res.data.text2.split(',')[0],
|
||||
url: await getImageBlobUrl(res.data.text2.split(',')[0])
|
||||
url:`${downloadUrl}${res.data.text2.split(',')[0]}`
|
||||
})
|
||||
}
|
||||
|
||||
if(res.data.text2.split(',')[1] != 0) {
|
||||
this.text2.push({
|
||||
fileId: res.data.text2.split(',')[1],
|
||||
url: await getImageBlobUrl(res.data.text2.split(',')[1])
|
||||
url:`${downloadUrl}${res.data.text2.split(',')[1]}`
|
||||
})
|
||||
}
|
||||
|
||||
if(res.data.text2.split(',')[2] != 0) {
|
||||
this.text3.push({
|
||||
fileId: res.data.text2.split(',')[2],
|
||||
url: await getImageBlobUrl(res.data.text2.split(',')[2])
|
||||
url:`${downloadUrl}${res.data.text2.split(',')[2]}`
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -313,7 +313,7 @@ import { reformList, reformRemove } from '@/api/universalEnergy.js'
|
||||
import { Notify } from 'vant'
|
||||
import { formatymd } from '@/utils/timeUtil.js'
|
||||
import { getLocationMessage, chooseAlbumAndTakePhoto } from '@/utils/dsbridge'
|
||||
import { getImageBlobUrl } from '@/utils/index'
|
||||
import { downloadUrl } from '@/settings'
|
||||
import {debounce} from '@/utils/common.js'
|
||||
export default {
|
||||
components: {
|
||||
@@ -387,6 +387,7 @@ export default {
|
||||
newVal.forEach(v => {
|
||||
if (v) {
|
||||
this.listValue.push(v.value)
|
||||
this.listValue = [...new Set(this.listValue)]
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -488,20 +489,18 @@ export default {
|
||||
return true
|
||||
},
|
||||
// 上传图片调用原生的方法 获取到绝对路径调用getImageFileFromUrl
|
||||
async onUpload () {
|
||||
onUpload () {
|
||||
console.log('进入chooseAlbumAndTakePhoto方法')
|
||||
chooseAlbumAndTakePhoto(async (data) => {
|
||||
chooseAlbumAndTakePhoto((data) => {
|
||||
// this.saveGreenComeData(data)
|
||||
let d = 'data:image/jpeg;base64,' + data
|
||||
console.log('data', d);
|
||||
this.fileIamge = d
|
||||
let params = this.base64ToFile(d,new Date().getTime().toString())
|
||||
uploadFile(params).then(async (res) => {
|
||||
uploadFile(params).then((res) => {
|
||||
if (res.code === 0) {
|
||||
const blobUrl = await getImageBlobUrl(res.data.attach_id)
|
||||
this.fileList.push({
|
||||
url: blobUrl,
|
||||
isImage: true,
|
||||
url:`${downloadUrl}${res.data.attach_id}`
|
||||
})
|
||||
this.fileIds.push(res.data.attach_id)
|
||||
}
|
||||
@@ -510,11 +509,14 @@ export default {
|
||||
})
|
||||
},
|
||||
delImg(detail) {
|
||||
const index = this.fileList.findIndex((ele)=> ele == detail)
|
||||
if (index > -1) {
|
||||
this.fileList.splice(index, 1)
|
||||
this.fileIds.splice(index, 1)
|
||||
let url = ''
|
||||
if(!detail.file) {
|
||||
url = detail.url.split('download/')[1]
|
||||
}
|
||||
const index = this.fileList.findIndex((ele)=> ele == detail)
|
||||
const index2 = this.fileIds.findIndex((ele)=> ele == url)
|
||||
this.fileList.splice(index, 1)
|
||||
this.fileIds.splice(index2, 1)
|
||||
},
|
||||
updateUserStatus() {
|
||||
const params = {
|
||||
@@ -660,26 +662,23 @@ export default {
|
||||
}
|
||||
this.address = res.data.address
|
||||
if (res.data.text1) {
|
||||
const url1 = await getImageBlobUrl(res.data.text1)
|
||||
const url1 = `${downloadUrl}${res.data.text1}`
|
||||
this.fileList.push({
|
||||
url: url1,
|
||||
isImage: true,
|
||||
})
|
||||
this.fileIds.push(res.data.text1)
|
||||
}
|
||||
if (res.data.text2) {
|
||||
const url2 = await getImageBlobUrl(res.data.text2)
|
||||
const url2 = `${downloadUrl}${res.data.text2}`
|
||||
this.fileList.push({
|
||||
url: url2,
|
||||
isImage: true,
|
||||
})
|
||||
this.fileIds.push(res.data.text2)
|
||||
}
|
||||
if (res.data.text3) {
|
||||
const url3 = await getImageBlobUrl(res.data.text3)
|
||||
const url3 = `${downloadUrl}${res.data.text3}`
|
||||
this.fileList.push({
|
||||
url: url3,
|
||||
isImage: true,
|
||||
})
|
||||
this.fileIds.push(res.data.text3)
|
||||
}
|
||||
@@ -693,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){
|
||||
@@ -790,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])
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
@@ -805,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
|
||||
|
||||
@@ -119,7 +119,7 @@ import { fanList, fanRemove, enterprisGetInfo, enterprisEdit, enterprisAdd } fro
|
||||
import { Notify } from "vant";
|
||||
|
||||
import Uploader from '@/views/facilityManage/common-vue/uploader.vue'
|
||||
import { getImageBlobUrl } from '@/utils/index'
|
||||
import { downloadUrl } from '@/settings'
|
||||
import {debounce} from '@/utils/common.js'
|
||||
|
||||
// import Header from "@/components/headerNew";
|
||||
@@ -201,7 +201,7 @@ export default {
|
||||
},
|
||||
//安卓会调用的方法
|
||||
onUpload(data, type) {
|
||||
this[type] = [data[0].fileId]
|
||||
this[type] = [data[0].url]
|
||||
},
|
||||
|
||||
delImg(file, detail, type) {
|
||||
@@ -243,15 +243,21 @@ export default {
|
||||
}
|
||||
|
||||
if(this.text1.length > 0 && this.text1[0] instanceof Object) {
|
||||
this.text1 = [this.text1[0].fileId]
|
||||
this.text1 = [this.text1[0].url.split('download/')[1]]
|
||||
} else if(this.text1.length > 0 && this.text1[0].split('download/').length > 1) {
|
||||
this.text1 = [this.text1[0].split('download/')[1]]
|
||||
}
|
||||
|
||||
if(this.text2.length > 0 && this.text2[0] instanceof Object) {
|
||||
this.text2 = [this.text2[0].fileId]
|
||||
this.text2 = [this.text2[0].url.split('download/')[1]]
|
||||
} else if(this.text2.length > 0 && this.text2[0].split('download/').length > 1) {
|
||||
this.text2 = [this.text2[0].split('download/')[1]]
|
||||
}
|
||||
|
||||
if(this.text3.length > 0 && this.text3[0] instanceof Object) {
|
||||
this.text3 = [this.text3[0].fileId]
|
||||
this.text3 = [this.text3[0].url.split('download/')[1]]
|
||||
} else if(this.text3.length > 0 && this.text3[0].split('download/').length > 1) {
|
||||
this.text3 = [this.text3[0].split('download/')[1]]
|
||||
}
|
||||
|
||||
const text = this.text1.concat(this.text2, this.text3)
|
||||
@@ -260,9 +266,14 @@ export default {
|
||||
|
||||
//判断是否为对象格式
|
||||
ifObj(imgList) {
|
||||
imgList.forEach((v) => {
|
||||
if(v instanceof Object && v.url.split('download/').length > 1) {
|
||||
v.url = v.url.split('download/')[1]
|
||||
}
|
||||
})
|
||||
const list = imgList.map((ele)=>{
|
||||
if(ele instanceof Object) {
|
||||
return ele.fileId
|
||||
return ele.url
|
||||
}
|
||||
return ele
|
||||
})
|
||||
@@ -323,22 +334,19 @@ export default {
|
||||
if(res.data.text3) {
|
||||
if(res.data.text3.split(',')[0] != 0) {
|
||||
this.text1.push({
|
||||
fileId: res.data.text3.split(',')[0],
|
||||
url: await getImageBlobUrl(res.data.text3.split(',')[0])
|
||||
url:`${downloadUrl}${res.data.text3.split(',')[0]}`
|
||||
})
|
||||
}
|
||||
|
||||
if(res.data.text3.split(',')[1] != 0) {
|
||||
this.text2.push({
|
||||
fileId: res.data.text3.split(',')[1],
|
||||
url: await getImageBlobUrl(res.data.text3.split(',')[1])
|
||||
url:`${downloadUrl}${res.data.text3.split(',')[1]}`
|
||||
})
|
||||
}
|
||||
|
||||
if(res.data.text3.split(',')[2] != 0) {
|
||||
this.text3.push({
|
||||
fileId: res.data.text3.split(',')[2],
|
||||
url: await getImageBlobUrl(res.data.text3.split(',')[2])
|
||||
url:`${downloadUrl}${res.data.text3.split(',')[2]}`
|
||||
})
|
||||
}
|
||||
if(res.data.text1) {
|
||||
|
||||
@@ -125,7 +125,7 @@ import {
|
||||
import { distributeList, distributeRemove, enterprisGetInfo, enterprisEdit, enterprisAdd } from "@/api/universalEnergy.js";
|
||||
import { Notify } from "vant";
|
||||
import Uploader from '@/views/facilityManage/common-vue/uploader.vue'
|
||||
import { getImageBlobUrl } from '@/utils/index'
|
||||
import { downloadUrl } from '@/settings'
|
||||
|
||||
// import Header from "@/components/headerNew";
|
||||
import {debounce} from '@/utils/common.js'
|
||||
@@ -242,7 +242,7 @@ export default {
|
||||
},
|
||||
//安卓会调用的方法
|
||||
onUpload(data, type) {
|
||||
this[type] = [data[0].fileId]
|
||||
this[type] = [data[0].url]
|
||||
},
|
||||
|
||||
delImg(file, detail, type) {
|
||||
@@ -285,15 +285,21 @@ export default {
|
||||
|
||||
|
||||
if(this.text1.length > 0 && this.text1[0] instanceof Object) {
|
||||
this.text1 = [this.text1[0].fileId]
|
||||
this.text1 = [this.text1[0].url.split('download/')[1]]
|
||||
} else if(this.text1.length > 0 && this.text1[0].split('download/').length > 1) {
|
||||
this.text1 = [this.text1[0].split('download/')[1]]
|
||||
}
|
||||
|
||||
if(this.text2.length > 0 && this.text2[0] instanceof Object) {
|
||||
this.text2 = [this.text2[0].fileId]
|
||||
this.text2 = [this.text2[0].url.split('download/')[1]]
|
||||
} else if(this.text2.length > 0 && this.text2[0].split('download/').length > 1) {
|
||||
this.text2 = [this.text2[0].split('download/')[1]]
|
||||
}
|
||||
|
||||
if(this.text3.length > 0 && this.text3[0] instanceof Object) {
|
||||
this.text3 = [this.text3[0].fileId]
|
||||
this.text3 = [this.text3[0].url.split('download/')[1]]
|
||||
} else if(this.text3.length > 0 && this.text3[0].split('download/').length > 1) {
|
||||
this.text3 = [this.text3[0].split('download/')[1]]
|
||||
}
|
||||
|
||||
|
||||
@@ -302,9 +308,14 @@ export default {
|
||||
},
|
||||
//判断是否为对象格式
|
||||
ifObj(imgList) {
|
||||
imgList.forEach((v) => {
|
||||
if(v instanceof Object && v.url.split('download/').length > 1) {
|
||||
v.url = v.url.split('download/')[1]
|
||||
}
|
||||
})
|
||||
const list = imgList.map((ele)=>{
|
||||
if(ele instanceof Object) {
|
||||
return ele.fileId
|
||||
return ele.url
|
||||
}
|
||||
return ele
|
||||
})
|
||||
@@ -360,22 +371,19 @@ export default {
|
||||
if(res.data.text1) {
|
||||
if(res.data.text1.split(',')[0] != 0) {
|
||||
this.text1.push({
|
||||
fileId: res.data.text1.split(',')[0],
|
||||
url: await getImageBlobUrl(res.data.text1.split(',')[0])
|
||||
url:`${downloadUrl}${res.data.text1.split(',')[0]}`
|
||||
})
|
||||
}
|
||||
|
||||
if(res.data.text1.split(',')[1] != 0) {
|
||||
this.text2.push({
|
||||
fileId: res.data.text1.split(',')[1],
|
||||
url: await getImageBlobUrl(res.data.text1.split(',')[1])
|
||||
url:`${downloadUrl}${res.data.text1.split(',')[1]}`
|
||||
})
|
||||
}
|
||||
|
||||
if(res.data.text1.split(',')[2] != 0) {
|
||||
this.text3.push({
|
||||
fileId: res.data.text1.split(',')[2],
|
||||
url: await getImageBlobUrl(res.data.text1.split(',')[2])
|
||||
url:`${downloadUrl}${res.data.text1.split(',')[2]}`
|
||||
})
|
||||
}
|
||||
if(res.data.text2) {
|
||||
|
||||
@@ -122,7 +122,7 @@ import { airList, airRemove, enterprisGetInfo, enterprisEdit, enterprisAdd } fro
|
||||
import { Notify } from "vant";
|
||||
|
||||
import Uploader from '@/views/facilityManage/common-vue/uploader.vue'
|
||||
import { getImageBlobUrl } from '@/utils/index'
|
||||
import { downloadUrl } from '@/settings'
|
||||
// import Header from "@/components/headerNew"
|
||||
import {debounce} from '@/utils/common.js'
|
||||
export default {
|
||||
@@ -203,7 +203,8 @@ export default {
|
||||
},
|
||||
//安卓会调用的方法
|
||||
onUpload(data, type) {
|
||||
this[type] = [data[0].fileId]
|
||||
this[type] = [data[0].url]
|
||||
|
||||
},
|
||||
|
||||
delImg(file, detail, type) {
|
||||
@@ -245,15 +246,21 @@ export default {
|
||||
}
|
||||
|
||||
if(this.text1.length > 0 && this.text1[0] instanceof Object) {
|
||||
this.text1 = [this.text1[0].fileId]
|
||||
this.text1 = [this.text1[0].url.split('download/')[1]]
|
||||
} else if(this.text1.length > 0 && this.text1[0].split('download/').length > 1) {
|
||||
this.text1 = [this.text1[0].split('download/')[1]]
|
||||
}
|
||||
|
||||
if(this.text2.length > 0 && this.text2[0] instanceof Object) {
|
||||
this.text2 = [this.text2[0].fileId]
|
||||
this.text2 = [this.text2[0].url.split('download/')[1]]
|
||||
} else if(this.text2.length > 0 && this.text2[0].split('download/').length > 1) {
|
||||
this.text2 = [this.text2[0].split('download/')[1]]
|
||||
}
|
||||
|
||||
if(this.text3.length > 0 && this.text3[0] instanceof Object) {
|
||||
this.text3 = [this.text3[0].fileId]
|
||||
this.text3 = [this.text3[0].url.split('download/')[1]]
|
||||
} else if(this.text3.length > 0 && this.text3[0].split('download/').length > 1) {
|
||||
this.text3 = [this.text3[0].split('download/')[1]]
|
||||
}
|
||||
|
||||
const text = this.text1.concat(this.text2, this.text3)
|
||||
@@ -262,9 +269,14 @@ export default {
|
||||
|
||||
//判断是否为对象格式
|
||||
ifObj(imgList) {
|
||||
imgList.forEach((v) => {
|
||||
if(v instanceof Object && v.url.split('download/').length > 1) {
|
||||
v.url = v.url.split('download/')[1]
|
||||
}
|
||||
})
|
||||
const list = imgList.map((ele)=>{
|
||||
if(ele instanceof Object) {
|
||||
return ele.fileId
|
||||
return ele.url
|
||||
}
|
||||
return ele
|
||||
})
|
||||
@@ -322,22 +334,19 @@ export default {
|
||||
if(res.data.text4) {
|
||||
if(res.data.text4.split(',')[0] != 0) {
|
||||
this.text1.push({
|
||||
fileId: res.data.text4.split(',')[0],
|
||||
url: await getImageBlobUrl(res.data.text4.split(',')[0])
|
||||
url:`${downloadUrl}${res.data.text4.split(',')[0]}`
|
||||
})
|
||||
}
|
||||
|
||||
if(res.data.text4.split(',')[1] != 0) {
|
||||
this.text2.push({
|
||||
fileId: res.data.text4.split(',')[1],
|
||||
url: await getImageBlobUrl(res.data.text4.split(',')[1])
|
||||
url:`${downloadUrl}${res.data.text4.split(',')[1]}`
|
||||
})
|
||||
}
|
||||
|
||||
if(res.data.text4.split(',')[2] != 0) {
|
||||
this.text3.push({
|
||||
fileId: res.data.text4.split(',')[2],
|
||||
url: await getImageBlobUrl(res.data.text4.split(',')[2])
|
||||
url:`${downloadUrl}${res.data.text4.split(',')[2]}`
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div class="list">
|
||||
<van-form ref="detailForm" @submit="handelClickSave">
|
||||
<!-- <div class="list-upload" v-if="(type == 1||type == 2) && $store.getters.imageRecognition">
|
||||
<div class="list-upload" v-if="(type == 1||type == 2) && $store.getters.imageRecognition">
|
||||
<btn-uploader type="filePic" :value="filePic" @afterRead="afterRead" @delImg="delImg" @onUpload="onUpload" />
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="container" v-if="type == 1">
|
||||
<div class="inputStyle">
|
||||
<van-cell-group>
|
||||
@@ -144,7 +144,7 @@ import { pureDigital } from '../pattern'
|
||||
import VanPickerNew from "@/components/vanPickerNew";
|
||||
import Year from "../common-vue/year.vue";
|
||||
import mixin from "@/mixins/mixin";
|
||||
import { getImageBlobUrl } from "@/utils/index";
|
||||
import { downloadUrl } from "@/settings";
|
||||
import Uploader from "../common-vue/uploader.vue";
|
||||
import btnUploader from "../common-vue/btnUploader.vue";
|
||||
|
||||
@@ -642,19 +642,19 @@ export default {
|
||||
}
|
||||
},
|
||||
//图片回显展示
|
||||
async picShow(formList, name) {
|
||||
picShow(formList, name) {
|
||||
console.log(formList,name);
|
||||
const picList = await Promise.all(formList.map(async (ele) => {
|
||||
if (ele.startsWith('blob:')) {
|
||||
const picList = formList.map((ele) => {
|
||||
if (ele.split(`${downloadUrl}`).length > 1) {
|
||||
return {
|
||||
url: ele,
|
||||
};
|
||||
}
|
||||
const blobUrl = await getImageBlobUrl(ele);
|
||||
ele = `${downloadUrl}${ele}`;
|
||||
return {
|
||||
url: blobUrl,
|
||||
url: ele,
|
||||
};
|
||||
}));
|
||||
});
|
||||
|
||||
switch (name) {
|
||||
case "ktExter":
|
||||
@@ -826,7 +826,7 @@ export default {
|
||||
if (this.exteriorImage1.length > 0) {
|
||||
this.form1.exteriorImage = this.exteriorImage1.map((ele) => {
|
||||
if (ele.url) {
|
||||
return ele.fileId || ele
|
||||
return ele = ele.url.split('download/')[1]
|
||||
} else {
|
||||
return ele
|
||||
}
|
||||
@@ -835,7 +835,7 @@ export default {
|
||||
if (this.tagImage1.length > 0) {
|
||||
this.form1.tagImage = this.tagImage1.map((ele) => {
|
||||
if (ele.url) {
|
||||
return ele.fileId || ele
|
||||
return ele = ele.url.split('download/')[1]
|
||||
} else {
|
||||
return ele
|
||||
}
|
||||
@@ -844,7 +844,7 @@ export default {
|
||||
if (this.markImage1.length > 0) {
|
||||
this.form1.markImage = this.markImage1.map((ele) => {
|
||||
if (ele.url) {
|
||||
return ele.fileId || ele
|
||||
return ele = ele.url.split('download/')[1]
|
||||
} else {
|
||||
return ele
|
||||
}
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
<template>
|
||||
<!-- :after-read="afterRead" -->
|
||||
<!-- :after-read="afterRead" -->
|
||||
<van-uploader
|
||||
v-model="fileList"
|
||||
:disabled="disableImg"
|
||||
multiple
|
||||
:deletable="deletable"
|
||||
:max-count="1"
|
||||
:before-read="beforeRead"
|
||||
:afterRead="afterRead"
|
||||
:before-delete="delImg"
|
||||
@click-upload="onUpload"
|
||||
accept="image/*"
|
||||
>
|
||||
<div class="uploader" >
|
||||
<van-icon name="plus" class="uploader-icon" />
|
||||
</div>
|
||||
</van-uploader>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { uploadFile } from '@/api/api.js'
|
||||
import { chooseAlbumAndTakePhoto } from '@/utils/dsbridge'
|
||||
import { downloadUrl } from '@/settings'
|
||||
import { addWaterMarker } from '@/utils/marker'
|
||||
import { Base64ToFile } from '@/utils/base64'
|
||||
export default {
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
value: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
deletable: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
disableImg: false,
|
||||
fileList: this.value,
|
||||
activTimer: null,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.activTimer = setTimeout(() => {
|
||||
this.fileList = this.value
|
||||
}, 200)
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearTimeout(this.activTimer)
|
||||
this.fileList = []
|
||||
},
|
||||
methods: {
|
||||
base64ToFile(data, fileName) {
|
||||
const dataArr = data.split(',')
|
||||
const byteString = window.atob(dataArr[1])
|
||||
const options = {
|
||||
type: 'image/jpeg',
|
||||
endings: 'native',
|
||||
}
|
||||
const u8Arr = new Uint8Array(byteString.length)
|
||||
for (let i = 0; i < byteString.length; i++) {
|
||||
u8Arr[i] = byteString.charCodeAt(i)
|
||||
}
|
||||
let formData = new FormData()
|
||||
let fileOfBlob = new File([u8Arr], fileName + '.jpg', options) //返回文件流
|
||||
formData.append('file', fileOfBlob)
|
||||
return formData
|
||||
},
|
||||
// 上传图片调用原生的方法 获取到绝对路径调用getImageFileFromUrl
|
||||
onUpload() {
|
||||
this.fileList= []
|
||||
console.log('--------chooseAlbumAndTakePhoto---', 'onUpload')
|
||||
chooseAlbumAndTakePhoto(async (data) => {
|
||||
console.log('--------onUpload---', data)
|
||||
let d = 'data:image/jpeg;base64,' + data
|
||||
this.fileIamge = d
|
||||
// let params = this.base64ToFile(d, new Date().getTime().toString())
|
||||
// console.log('--------params---', params)
|
||||
let img = Base64ToFile(d,'image/jpeg',new Date().getTime().toString() + ".jpg")
|
||||
console.log('-------------------------onUpload---', img);
|
||||
let blob = await addWaterMarker(img, 'image')
|
||||
console.log('-------------------------blob---', blob);
|
||||
let params = new FormData()
|
||||
let file = new File([blob], img.name)
|
||||
params.append('file', file)
|
||||
console.log('-------------------------file---', file);
|
||||
const res = await uploadFile(params)
|
||||
console.log('--------res---', res)
|
||||
if (res.code == 0) {
|
||||
this.fileList.push({
|
||||
fileName: res.data.original_name,
|
||||
fileId: res.data.attach_id,
|
||||
url: `${downloadUrl}${res.data.attach_id}`,
|
||||
})
|
||||
this.$emit('onUpload', this.fileList, this.type)
|
||||
}
|
||||
})
|
||||
},
|
||||
async afterRead(file) {
|
||||
this.fileList= []
|
||||
this.disableImg = true
|
||||
let params = new FormData()
|
||||
params.append('file', file.file)
|
||||
console.log(file.file)
|
||||
console.log(params)
|
||||
// console.log(decryptParseToJSON(a),77777777);
|
||||
const res = await uploadFile(params)
|
||||
if (res.code == 0) {
|
||||
this.disableImg = false
|
||||
this.fileList.push({
|
||||
fileName: res.data.original_name,
|
||||
fileId: res.data.attach_id,
|
||||
url: `${downloadUrl}${res.data.attach_id}`,
|
||||
})
|
||||
this.$emit('onUpload', this.fileList, this.type)
|
||||
// this.$emit('afterRead', res.data, this.type)
|
||||
}else{
|
||||
this.disableImg = false
|
||||
}
|
||||
return true
|
||||
},
|
||||
beforeRead(img) {
|
||||
if(!img){
|
||||
return
|
||||
}
|
||||
return new Promise(async(resolve, reject) => {
|
||||
let blob = await addWaterMarker(img, 'blob')
|
||||
blob.name = img.name
|
||||
let file = new File([blob], img.name)
|
||||
resolve(file)
|
||||
})
|
||||
}, //压缩图片
|
||||
compressFiles(fileObj) {
|
||||
let type = fileObj.type
|
||||
return new Promise((resolve, reject) => {
|
||||
let reader = new FileReader()
|
||||
reader.readAsDataURL(fileObj)
|
||||
reader.onload = function (e) {
|
||||
let image = new Image() //新建一个img标签(不嵌入DOM节点,仅做canvas操作)
|
||||
image.src = e.target.result //让该标签加载base64格式的原图
|
||||
image.onload = function () {
|
||||
//图片加载完毕后再通过canvas压缩图片,否则图片还没加载完就压缩,结果图片是全黑的
|
||||
let canvas = document.createElement('canvas'), //创建一个canvas元素
|
||||
context = canvas.getContext('2d'), //context相当于画笔,里面有各种可以进行绘图的API
|
||||
imageWidth = image.width / 2, //压缩后图片的宽度,这里设置为缩小一半
|
||||
imageHeight = image.height / 2, //压缩后图片的高度,这里设置为缩小一半
|
||||
data = '' //存储压缩后的图片
|
||||
canvas.width = imageWidth //设置绘图的宽度
|
||||
canvas.height = imageHeight //设置绘图的高度
|
||||
|
||||
//使用drawImage重新设置img标签中的图片大小,实现压缩。drawImage方法的参数可以自行查阅W3C
|
||||
context.drawImage(image, 0, 0, imageWidth, imageHeight)
|
||||
//使用toDataURL将canvas上的图片转换为base64格式
|
||||
data = canvas.toDataURL(type)
|
||||
canvas.toBlob(function (blob) {
|
||||
const f = new File([blob], fileObj.name, { type })
|
||||
resolve(f)
|
||||
}, type)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
delImg(file, detail) {
|
||||
this.fileList.splice(detail.index, 1)
|
||||
this.$emit('delImg', file, detail, this.type)
|
||||
},
|
||||
|
||||
checkImgisUpload(list) {
|
||||
if (this.fileList && list && this.fileList.length == list.length) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang='less' scoped>
|
||||
/deep/ .van-uploader__preview-image {
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
border-radius: 10px;
|
||||
margin-left: 20px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/deep/ .van-uploader__preview-delete {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.uploader {
|
||||
width: 2.133333rem;
|
||||
height: 2.133333rem;
|
||||
background: #f7f7f7;
|
||||
border-radius: 5px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 10px 0 10px 20px;
|
||||
.uploader-icon {
|
||||
font-size: 30px;
|
||||
color: #ababab;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -21,7 +21,7 @@
|
||||
<script>
|
||||
import { uploadFile } from '@/api/api.js'
|
||||
import { chooseAlbumAndTakePhoto } from '@/utils/dsbridge'
|
||||
import { getImageBlobUrl } from '@/utils/index'
|
||||
import { downloadUrl } from '@/settings'
|
||||
export default {
|
||||
props: {
|
||||
type: {
|
||||
@@ -41,23 +41,17 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
disableImg: false,
|
||||
fileList: [],
|
||||
fileList: this.value,
|
||||
activTimer: null,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 父组件异步回填(如历史记录 getHistory 晚于 mounted)时同步列表;
|
||||
// 上传后父组件把 value 改写为 [url字符串] 时不覆盖本地回显
|
||||
value: {
|
||||
handler(val) {
|
||||
if (val && val.length && val.every(item => typeof item === 'object')) {
|
||||
this.fileList = val.map(item => ({ ...item, isImage: true }))
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
deep: true,
|
||||
},
|
||||
mounted() {
|
||||
this.activTimer = setTimeout(() => {
|
||||
this.fileList = this.value
|
||||
}, 200)
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearTimeout(this.activTimer)
|
||||
this.fileList = []
|
||||
},
|
||||
methods: {
|
||||
@@ -89,14 +83,10 @@ export default {
|
||||
const res = await uploadFile(params)
|
||||
console.log('--------res---', res)
|
||||
if (res.code == 0) {
|
||||
const blobUrl = await getImageBlobUrl(res.data.attach_id)
|
||||
console.log('--------回显 blobUrl---', blobUrl)
|
||||
if (!blobUrl) return
|
||||
this.fileList.push({
|
||||
fileName: res.data.original_name,
|
||||
fileId: res.data.attach_id,
|
||||
url: blobUrl,
|
||||
isImage: true,
|
||||
url: `${downloadUrl}${res.data.attach_id}`,
|
||||
})
|
||||
this.$emit('onUpload', this.fileList, this.type)
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<div class="multipleAir">
|
||||
<!-- <div class="list-upload" v-if="$store.getters.imageRecognition">
|
||||
<div class="list-upload" v-if="$store.getters.imageRecognition">
|
||||
<btnUploader type="filePic" :value="filePic"
|
||||
@afterRead="afterRead1"
|
||||
@delImg="delImg1"
|
||||
@onUpload="onUpload1" />
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="focusItem">
|
||||
<div class="inputStyle">
|
||||
<van-cell-group>
|
||||
@@ -130,7 +130,7 @@ import mixin from '@/mixins/mixin'
|
||||
import Uploader from '../common-vue/uploader.vue'
|
||||
import Radio from '../common-vue/radio.vue'
|
||||
import { dataMode } from '../common'
|
||||
import { getImageBlobUrl } from '@/utils/index'
|
||||
import { downloadUrl } from '@/settings'
|
||||
import { pureDigital } from '../pattern'
|
||||
import btnUploader from "../common-vue/btnUploader.vue";
|
||||
|
||||
@@ -330,29 +330,29 @@ export default {
|
||||
console.log(this.edgl, this.hyl);
|
||||
if (this.form.exteriorImage) {
|
||||
const list = this.form.exteriorImage.split(',')
|
||||
this.exteriorImage = await Promise.all(list.map(async (ele) => {
|
||||
this.exteriorImage = list.map((ele) => {
|
||||
return {
|
||||
url: await getImageBlobUrl(ele),
|
||||
url: `${downloadUrl}${ele}`,
|
||||
}
|
||||
}))
|
||||
})
|
||||
console.log(this.exteriorImage,'123')
|
||||
}
|
||||
if (this.form.tagImage) {
|
||||
const list = this.form.tagImage.split(',')
|
||||
this.tagImage = await Promise.all(list.map(async (ele) => {
|
||||
this.tagImage = list.map((ele) => {
|
||||
return {
|
||||
url: await getImageBlobUrl(ele),
|
||||
url: `${downloadUrl}${ele}`,
|
||||
}
|
||||
}))
|
||||
})
|
||||
console.log(this.tagImage)
|
||||
}
|
||||
if (this.form.markImage) {
|
||||
const list = this.form.markImage.split(',')
|
||||
this.markImage = await Promise.all(list.map(async (ele) => {
|
||||
this.markImage = list.map((ele) => {
|
||||
return {
|
||||
url: await getImageBlobUrl(ele),
|
||||
url: `${downloadUrl}${ele}`,
|
||||
}
|
||||
}))
|
||||
})
|
||||
console.log(this.markImage)
|
||||
}
|
||||
} else {
|
||||
@@ -537,9 +537,14 @@ export default {
|
||||
},
|
||||
//判断是否为对象格式
|
||||
ifObj(imgList) {
|
||||
imgList.forEach((v) => {
|
||||
if(v instanceof Object && v.url.split('download/').length > 1) {
|
||||
v.url = v.url.split('download/')[1]
|
||||
}
|
||||
})
|
||||
const list = imgList.map((ele)=>{
|
||||
if(ele instanceof Object) {
|
||||
return ele.fileId || ele.url
|
||||
return ele.url
|
||||
}
|
||||
return ele
|
||||
})
|
||||
|
||||
@@ -592,19 +592,28 @@ export default {
|
||||
if(this.commonForm.nxzdRefrigeSystemDTO.length > 0) {
|
||||
this.commonForm.nxzdRefrigeSystemDTO.forEach((v) => {
|
||||
if (v.exteriorImage && v.exteriorImage instanceof Array) {
|
||||
v.exteriorImage.forEach((ev) => {
|
||||
if (ev.url && ev.url.split('download/').length > 1) {
|
||||
ev.url = ev.url.split('download/')[1]
|
||||
}
|
||||
})
|
||||
const list = v.exteriorImage.map((ele) => {
|
||||
if (ele instanceof Object) {
|
||||
return ele.fileId || ele.url
|
||||
return ele.url
|
||||
}
|
||||
return ele
|
||||
})
|
||||
v.exteriorImage = list.join(',')
|
||||
}
|
||||
if (v.tagImage && v.tagImage instanceof Array) {
|
||||
|
||||
v.tagImage.forEach((ev) => {
|
||||
if (ev.url && ev.url.split('download/').length > 1) {
|
||||
ev.url = ev.url.split('download/')[1]
|
||||
}
|
||||
})
|
||||
const list1 = v.tagImage.map((ele) => {
|
||||
if (ele instanceof Object) {
|
||||
return ele.fileId || ele.url
|
||||
return ele.url
|
||||
}
|
||||
return ele
|
||||
})
|
||||
@@ -612,9 +621,14 @@ export default {
|
||||
|
||||
}
|
||||
if (v.markImage && v.markImage instanceof Array) {
|
||||
v.markImage.forEach((ev) => {
|
||||
if (ev.url && ev.url.split('download/').length > 1) {
|
||||
ev.url = ev.url.split('download/')[1]
|
||||
}
|
||||
})
|
||||
const list2 = v.markImage.map((ele) => {
|
||||
if (ele instanceof Object) {
|
||||
return ele.fileId || ele.url
|
||||
return ele.url
|
||||
}
|
||||
return ele
|
||||
})
|
||||
@@ -627,19 +641,28 @@ export default {
|
||||
if(this.commonForm.nxzdHeatSystemDTO.length > 0) {
|
||||
this.commonForm.nxzdHeatSystemDTO.forEach((v)=> {
|
||||
if (v.exteriorImage && v.exteriorImage instanceof Array) {
|
||||
v.exteriorImage.forEach((ev) => {
|
||||
if (ev.url && ev.url.split('download/').length > 1) {
|
||||
ev.url = ev.url.split('download/')[1]
|
||||
}
|
||||
})
|
||||
const list = v.exteriorImage.map((ele) => {
|
||||
if (ele instanceof Object) {
|
||||
return ele.fileId || ele.url
|
||||
return ele.url
|
||||
}
|
||||
return ele
|
||||
})
|
||||
v.exteriorImage = list.join(',')
|
||||
}
|
||||
if (v.tagImage && v.tagImage instanceof Array) {
|
||||
|
||||
v.tagImage.forEach((ev) => {
|
||||
if (ev.url && ev.url.split('download/').length > 1) {
|
||||
ev.url = ev.url.split('download/')[1]
|
||||
}
|
||||
})
|
||||
const list1 = v.tagImage.map((ele) => {
|
||||
if (ele instanceof Object) {
|
||||
return ele.fileId || ele.url
|
||||
return ele.url
|
||||
}
|
||||
return ele
|
||||
})
|
||||
@@ -647,9 +670,14 @@ export default {
|
||||
|
||||
}
|
||||
if (v.markImage && v.markImage instanceof Array) {
|
||||
v.markImage.forEach((ev) => {
|
||||
if (ev.url && ev.url.split('download/').length > 1) {
|
||||
ev.url = ev.url.split('download/')[1]
|
||||
}
|
||||
})
|
||||
const list2 = v.markImage.map((ele) => {
|
||||
if (ele instanceof Object) {
|
||||
return ele.fileId || ele.url
|
||||
return ele.url
|
||||
}
|
||||
return ele
|
||||
})
|
||||
|
||||
@@ -150,6 +150,10 @@ export default {
|
||||
async getLoginCustomer() {
|
||||
this.loading2 = true
|
||||
try {
|
||||
let reportCustomerId = localStorage.getItem('reportCustomerId')
|
||||
if(reportCustomerId&&this.$route.name=='fullreport'){
|
||||
return
|
||||
}
|
||||
const res = await getLoginCustomerAPI()
|
||||
if (res.code == 0) {
|
||||
localStorage.setItem('reportCustomerId', res.data.customerId)
|
||||
|
||||
@@ -146,6 +146,10 @@ export default {
|
||||
async getLoginCustomer() {
|
||||
this.loading2 = true
|
||||
try {
|
||||
let reportCustomerId = localStorage.getItem('reportCustomerId')
|
||||
if(reportCustomerId&&this.$route.name=='fullreport'){
|
||||
return
|
||||
}
|
||||
const res = await getLoginCustomerAPI()
|
||||
if (res.code == 0) {
|
||||
localStorage.setItem('reportCustomerId', res.data.customerId)
|
||||
|
||||
@@ -74,6 +74,10 @@ export default {
|
||||
async getLoginCustomer() {
|
||||
this.loading2 = true
|
||||
try {
|
||||
let reportCustomerId = localStorage.getItem('reportCustomerId')
|
||||
if(reportCustomerId&&this.$route.name=='fullreport'){
|
||||
return
|
||||
}
|
||||
const res = await getLoginCustomerAPI()
|
||||
if (res.code == 0) {
|
||||
localStorage.setItem('reportCustomerId', res.data.customerId)
|
||||
|
||||
@@ -165,6 +165,10 @@ export default {
|
||||
async getLoginCustomer() {
|
||||
this.loading2 = true
|
||||
try {
|
||||
let reportCustomerId = localStorage.getItem('reportCustomerId')
|
||||
if(reportCustomerId&&this.$route.name=='fullreport'){
|
||||
return
|
||||
}
|
||||
const res = await getLoginCustomerAPI()
|
||||
if (res.code == 0) {
|
||||
localStorage.setItem('reportCustomerId', res.data.customerId)
|
||||
|
||||
@@ -184,6 +184,10 @@ export default {
|
||||
async getLoginCustomer() {
|
||||
this.loading2 = true
|
||||
try {
|
||||
let reportCustomerId = localStorage.getItem('reportCustomerId')
|
||||
if(reportCustomerId&&this.$route.name=='fullreport'){
|
||||
return
|
||||
}
|
||||
const res = await getLoginCustomerAPI()
|
||||
if (res.code == 0) {
|
||||
localStorage.setItem('reportCustomerId', res.data.customerId)
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getImageBlobUrl } from '@/utils/index'
|
||||
import { downloadUrl } from '@/settings'
|
||||
import commonTitle from './components/commonTitle.vue'
|
||||
import electro from './components/electro.vue'
|
||||
import refrom from './components/refrom.vue'
|
||||
@@ -197,7 +197,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
signFile: '',
|
||||
imageUrlData: null,
|
||||
signedtwo: '',
|
||||
value1: '',
|
||||
loading2: false,
|
||||
@@ -229,15 +228,6 @@ export default {
|
||||
Loading
|
||||
|
||||
},
|
||||
watch: {
|
||||
async signFile(val) {
|
||||
if (val) {
|
||||
this.imageUrlData = await getImageBlobUrl(val)
|
||||
} else {
|
||||
this.imageUrlData = null
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.outputPdf = this.outputPdf
|
||||
this.userLevel()
|
||||
@@ -257,7 +247,11 @@ export default {
|
||||
return true
|
||||
},
|
||||
imageUrl() {
|
||||
return this.imageUrlData
|
||||
console.log(this.signFile);
|
||||
if(this.signFile) {
|
||||
return `${downloadUrl}${this.signFile}`
|
||||
}
|
||||
return null
|
||||
},
|
||||
reportYear() {
|
||||
if (this.EnergyReportInfo.reportYear) {
|
||||
@@ -306,6 +300,7 @@ export default {
|
||||
const res = await getLoginCustomerAPI()
|
||||
// console.log(res.data.customerId);
|
||||
if (res.code == 0) {
|
||||
localStorage.setItem('reportCustomerId', res.data.customerId)
|
||||
const data = {
|
||||
customerId: res.data.customerId,
|
||||
ai: sessionStorage.getItem('saikey')
|
||||
@@ -330,20 +325,6 @@ export default {
|
||||
sessionStorage.setItem('signIdtwo', res.data.id)
|
||||
this.EnergyReportInfo = res.data
|
||||
this.setEnergyReportInfo(res.data)
|
||||
if (res.data.energySituationRadar) {
|
||||
this.radarOption.radar.indicator = JSON.parse(
|
||||
res.data.energySituationRadar
|
||||
)['indicator']
|
||||
this.radarOption.series[0].data = []
|
||||
this.radarOption.series[0].data.push(
|
||||
JSON.parse(res.data.energySituationRadar)['seriesData'][0].dataList
|
||||
)
|
||||
this.createRadarChart()
|
||||
} else {
|
||||
this.radarOption.radar.indicator = []
|
||||
this.radarOption.series[0].data = []
|
||||
this.createRadarChart()
|
||||
}
|
||||
} else {
|
||||
Notify({ type: 'danger', message: res.msg })
|
||||
}
|
||||
|
||||
@@ -31,8 +31,11 @@
|
||||
<van-dropdown-item v-model="value1" :options="option1" />
|
||||
</van-dropdown-menu> -->
|
||||
|
||||
<div class="detail2-right-top-reset" @click="generateReport" v-if="isLevel">
|
||||
<div class="detail2-right-top-reset" @click="generateReport(false)" v-if="isLevel">
|
||||
重新生成
|
||||
</div>
|
||||
<div class="detail2-right-top-reset" @click="generateReport(true)" v-if="isLevel&&isCq">
|
||||
刷新
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail2-right-bottom">
|
||||
@@ -237,6 +240,9 @@ export default {
|
||||
|
||||
taskType() {
|
||||
return this.$route.params.item? this.$route.params.item.taskType: 0
|
||||
},
|
||||
isCq(){
|
||||
return process.env.VUE_APP_CITY_TYPE=='cq'
|
||||
}
|
||||
},
|
||||
beforeRouteEnter(to, from, next) {
|
||||
@@ -252,8 +258,8 @@ export default {
|
||||
// },
|
||||
created() {
|
||||
this.userLevel()
|
||||
this.doDebounce = debounce(function () {
|
||||
this.getGenerateReport()
|
||||
this.doDebounce = debounce(function (flag) {
|
||||
this.getGenerateReport(flag)
|
||||
}, 5000, true)
|
||||
},
|
||||
mounted() {
|
||||
@@ -436,14 +442,15 @@ export default {
|
||||
this.option1 = arr
|
||||
},
|
||||
// 重新生成
|
||||
generateReport(){
|
||||
this.doDebounce()
|
||||
generateReport(flag){
|
||||
this.doDebounce(flag)
|
||||
},
|
||||
async getGenerateReport() {
|
||||
async getGenerateReport(flag) {
|
||||
let data = {
|
||||
customerId:
|
||||
this.$route.params.customerId || JSON.parse(sessionStorage.getItem('tidCid')).customerId,
|
||||
taskId: this.$route.params.taskId|| JSON.parse(sessionStorage.getItem('tidCid')).taskId
|
||||
taskId: this.$route.params.taskId|| JSON.parse(sessionStorage.getItem('tidCid')).taskId,
|
||||
refresh: flag
|
||||
}
|
||||
// this.$toast('正在重新生成,请稍后...')
|
||||
this.$toast.loading({
|
||||
|
||||
+2
-2
@@ -133,14 +133,14 @@ module.exports = {
|
||||
|
||||
"/admin": {
|
||||
// target: "http://121.28.84.19:9004",
|
||||
target: "http://172.29.69.38:19012",
|
||||
target: "http://172.29.106.250:19012",
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
"^/admin": "",
|
||||
},
|
||||
}, "/energy-effcicency-net-service": {
|
||||
// target: "http://121.28.84.19:9004",
|
||||
target: "http://172.29.69.38:19012",
|
||||
target: "http://172.29.106.250:19012",
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
"^/energy-effcicency-net-service": "",
|
||||
|
||||
Reference in New Issue
Block a user