diff --git a/main.js b/main.js index 1bebada7..50ceb2ec 100644 --- a/main.js +++ b/main.js @@ -37,15 +37,15 @@ if (process.env.NODE_ENV === 'development') { console.log('开发环境') // Vue.prototype.url_config = 'http://47.93.215.234:9809/' // 鞍钢正式地址(弃用) // Vue.prototype.url_config = 'http://42.180.188.17:9809/' // 鞍钢正式地址 - Vue.prototype.url_config = 'http://42.180.188.17:11211/' // 鞍钢测试地址 + // Vue.prototype.url_config = 'http://42.180.188.17:11211/' // 鞍钢测试地址 // Vue.prototype.url_config = 'http://182.90.224.237:51234/' //雄哥内网穿透地址 // Vue.prototype.url_config = 'http://jxj.zhgdyun.com:61212/' //杰哥内网穿透地址 // Vue.prototype.url_config = ' http://192.168.34.221:28888/' //郭圣雄本地 - // Vue.prototype.url_config = 'http://192.168.34.221:9111/' //郭圣雄本地 + Vue.prototype.url_config = 'http://192.168.34.221:9111/' //郭圣雄本地 // Vue.prototype.url_config = 'http://192.168.34.155:19111/' //彭洁本地 // Vue.prototype.work_url = 'http://47.93.215.234:19997' // 工作流线上地址(弃用) // Vue.prototype.work_url = 'http://42.180.188.17:19997' // 工作流线上地址 - Vue.prototype.work_url = 'http://42.180.188.17:19097' // 工作流测试地址 + // Vue.prototype.work_url = 'http://42.180.188.17:19097' // 工作流测试地址 // Vue.prototype.work_url = 'http://192.168.34.138:5173' // 工作流地址 // Vue.prototype.work_url = 'http://139.9.66.234:5173' // 工作流地址 // Vue.prototype.work_url = 'http://192.168.34.126:5173' // 工作流地址 diff --git a/pages/login/login.vue b/pages/login/login.vue index b74f57b8..cad41be7 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -11,7 +11,7 @@ 用户登录 - + 施工人员登录 diff --git a/pages/projectEnd/emergencyDisposal/detail.vue b/pages/projectEnd/emergencyDisposal/detail.vue index 6ce46812..5c58d504 100644 --- a/pages/projectEnd/emergencyDisposal/detail.vue +++ b/pages/projectEnd/emergencyDisposal/detail.vue @@ -93,14 +93,16 @@ 处置资料: - {{ JSON.parse(emergencyInfo.disposalInformation).map(item => item.name).join("、") }} 指导文件: - {{ JSON.parse(emergencyInfo.guidanceDocument).map(item => item.name).join("、") }} @@ -167,7 +169,7 @@ - + 选择文件 @@ -230,8 +232,9 @@ }, methods: { downloadReport(row) { - const url = row && row != "null" && row[0].url; - const fileName = row && row != "null" && row[0].name; + console.log(JSON.parse(row)); + const url = row != "null" && JSON.parse(row).length > 0 && JSON.parse(row)[0].url; + const fileName = row != "null"&& JSON.parse(row).length > 0 && JSON.parse(row)[0].name; if (!url) { uni.showToast({ title: "暂无下载文件!", @@ -246,7 +249,7 @@ url: url, //网络路径,下载下来 success: (res) => { if (res.statusCode === 200) { - uni.saveImageToPhotosAlbum({ + uni.saveFile({ filePath: res.tempFilePath, //下载后的临时路径 success: res => { //下载完成后在相册里压根找不到 uni.hideLoading() @@ -255,22 +258,35 @@ }) } }) + console.log(111111); + // uni.saveImageToPhotosAlbum({ // 然后调用这个方法 + // filePath: res.tempFilePath, + // success: (res) => { + // uni.hideLoading(); //关闭提示 + // uni.showToast({ + // title: '保存成功' + // }) + // } + // }) } - } + }, + fail: () => { + uni.hideLoading(); //关闭提示 + }, }); - // fetch(url) - // .then(response => response.blob()) - // .then(blob => { - // const link = document.createElement('a'); - // link.href = URL.createObjectURL(blob); - // link.download = fileName; - // link.target = "_blank"; // 可选,如果希望在新窗口中下载文件,请取消注释此行 - // link.click(); - // }); + fetch(url) + .then(response => response.blob()) + .then(blob => { + const link = document.createElement('a'); + link.href = URL.createObjectURL(blob); + link.download = fileName; + link.target = "_blank"; // 可选,如果希望在新窗口中下载文件,请取消注释此行 + link.click(); + }); }, addSaveBtn() { - if (this.imgList == null||this.imgList.length == 0) { + if (this.imgList == null || this.imgList.length == 0) { uni.showToast({ title: "请提交处置报告", icon: "none" @@ -303,7 +319,17 @@ }, canversList(e) { const that = this; - console.log(e); + const accept=["doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf","txt"] + const findIndex = accept.findIndex(item => item == e.tempFiles[0].extname); + // console.log(findIndex,e.tempFiles[0].extname); + if(findIndex == -1){ + that.imgList = []; + uni.showToast({ + title: '请上传文件类型!', + icon:"none" + }) + return + } that.imgList = that.imgList == null ? [] : that.imgList; uni.uploadFile({ url: that.url_config + 'upload/image', //仅为示例,非真实的接口地址 @@ -360,7 +386,8 @@ const find = that.emergencyTypeList.find(item => item.id == res.result .emergencyTypeId); that.emergencyInfo = find ? find : {}; - this.imgList = (res.result.disposalReport && res.result.disposalReport != null) ? JSON.parse(res.result.disposalReport) : []; + this.imgList = (res.result.disposalReport && res.result.disposalReport != null) ? JSON + .parse(res.result.disposalReport) : []; } }) }, diff --git a/pages/projectEnd/emergencyDisposal/index.vue b/pages/projectEnd/emergencyDisposal/index.vue index 05b1fd7e..00c34bfd 100644 --- a/pages/projectEnd/emergencyDisposal/index.vue +++ b/pages/projectEnd/emergencyDisposal/index.vue @@ -2,7 +2,7 @@ - {{this.getGoId == 2 ? '救援隐患审批' :'应急处置'}} + {{this.getGoId == 2 ? '救援隐患审批' :'应急处置'}} diff --git a/pages/projectEnd/emergencyDisposal/reliefApprove.vue b/pages/projectEnd/emergencyDisposal/reliefApprove.vue index 56f4ad8c..61089902 100644 --- a/pages/projectEnd/emergencyDisposal/reliefApprove.vue +++ b/pages/projectEnd/emergencyDisposal/reliefApprove.vue @@ -93,14 +93,16 @@ 处置资料: - {{ JSON.parse(emergencyInfo.disposalInformation).map(item => item.name).join("、") }} 指导文件: - {{ JSON.parse(emergencyInfo.guidanceDocument).map(item => item.name).join("、") }} @@ -121,7 +123,7 @@ {{item.disposalPersonName}} - + 现场情况视频: 0 && JSON.parse(row)[0].url; + const fileName = row != "null" && JSON.parse(row).length > 0 && JSON.parse(row)[0].name; if (!url) { uni.showToast({ title: "暂无下载文件!", @@ -227,22 +229,47 @@ uni.showLoading({ title: "保存中..." }) + console.log(url); uni.downloadFile({ url: url, //网络路径,下载下来 success: (res) => { if (res.statusCode === 200) { - uni.saveImageToPhotosAlbum({ - filePath: res.tempFilePath, //下载后的临时路径 - success: res => { //下载完成后在相册里压根找不到 - uni.hideLoading() + // uni.saveFile({ + // filePath: res.tempFilePath, //下载后的临时路径 + // success: res => { //下载完成后在相册里压根找不到 + // uni.hideLoading() + // uni.showToast({ + // title: "保存成功!" + // }) + // } + // }) + uni.saveImageToPhotosAlbum({ // 然后调用这个方法 + filePath: res.tempFilePath, + success: (res) => { + uni.hideLoading(); //关闭提示 uni.showToast({ - title: "保存成功!" + title: '图片已保存' }) } }) + } - } + }, + fail: () => { + uni.hideLoading(); //关闭提示 + }, }); + // #ifdef H5 + fetch(url) + .then(response => response.blob()) + .then(blob => { + const link = document.createElement('a'); + link.href = URL.createObjectURL(blob); + link.download = fileName; + link.target = "_blank"; // 可选,如果希望在新窗口中下载文件,请取消注释此行 + link.click(); + }); + // #endif }, onSubmitAll() { this.sendRequest({ @@ -586,8 +613,10 @@ } } - .imgBox_wrap,.imgBox { + .imgBox_wrap, + .imgBox { margin: 0 !important; + view { margin: 0 !important; }