From ad09ede70a92af2d1af5977f7b100cf1bb1847ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E7=8E=89=E7=90=A6?= <7507756+jiang_yuqi@user.noreply.gitee.com> Date: Sun, 17 Sep 2023 18:10:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project_checkDetection/info/index.js | 28 +++++- .../pageage/project_insurance/info/index.js | 7 +- .../pageage/project_insurance/info/index.wxml | 2 +- .../project_materialSeal/info/index.js | 98 ++++++++++--------- .../project_materialSeal/info/index.wxml | 2 +- .../pageage/project_special/info/index.js | 2 +- .../pageage/project_train/info/index.js | 2 +- .../approveLeaveTask/index.wxml | 76 +++++++------- .../project_flowable/approveTask/index.js | 22 +++++ .../project_flowable/approveTask/index.wxml | 72 +++++++------- .../pages/project_flowable/await/index.wxml | 6 +- .../detailLeaveTask/index.wxml | 70 ++++++------- .../project_flowable/detailTask/index.js | 22 +++++ .../project_flowable/detailTask/index.wxml | 68 ++++++------- .../project_flowable/editLeaveTask/index.wxml | 2 +- .../pages/project_flowable/editTask/index.js | 4 +- .../project_flowable/editTask/index.wxml | 8 +- .../project_flowable/finished/index.wxml | 2 +- .../project_flowable/initLeaveTask/index.wxml | 2 +- .../project_flowable/initTask/index.wxml | 4 +- .../myFlowDefinition/index.wxml | 2 +- .../project_flowable/myProcessIns/index.wxml | 2 +- 22 files changed, 293 insertions(+), 210 deletions(-) diff --git a/miniprogram/pageage/project_checkDetection/info/index.js b/miniprogram/pageage/project_checkDetection/info/index.js index 2f28621..a37d98e 100644 --- a/miniprogram/pageage/project_checkDetection/info/index.js +++ b/miniprogram/pageage/project_checkDetection/info/index.js @@ -14,6 +14,7 @@ Page({ detectionImageList:[], minDetectionFileImages:[], detectionFiles:[], + fileUrls:[], request:app.globalData.reqUrl }, @@ -55,6 +56,7 @@ Page({ let imageUrls = []; let minImageUrls = []; let fileUrls = []; + let fileNames = []; //判断附件 if(res.data.detectionFile){ res.data.detectionFile.split(',').forEach(element => { @@ -65,6 +67,8 @@ Page({ imageUrls.push(that.data.request+element); minImageUrls.push(that.data.request+element+'.min.jpg'); }else{ + let it = element.split('/'); + fileNames.push(it[it.length-1]); fileUrls.push(element); } }); @@ -73,7 +77,8 @@ Page({ infoData:res.data, detectionImageList:imageUrls, minDetectionFileImages:minImageUrls, - detectionFiles:fileUrls, + detectionFiles:fileNames, + fileUrls, loadShow:false }) //判断当前能否删除 @@ -132,6 +137,27 @@ Page({ }) }, + downFile:function(e){ + let that = this; + wx.downloadFile({ + // 示例 url,并非真实存在 + url: app.globalData.uploadUrl+'/common/download/resource?resource='+that.data.fileUrls[0], + success: function (res) { + const filePath = res.tempFilePath + wx.openDocument({ + filePath: filePath, + success: function (res) { + console.log('打开文档成功') + }, + fail:function(res) { + console.log(res) + } + }) + } + }) + //app.toast("暂不支持下载!如需下载请前往后台管理系统!!") + }, + returnToPage: function () { /*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/ wx.redirectTo({ diff --git a/miniprogram/pageage/project_insurance/info/index.js b/miniprogram/pageage/project_insurance/info/index.js index ac7bf16..ee9b542 100644 --- a/miniprogram/pageage/project_insurance/info/index.js +++ b/miniprogram/pageage/project_insurance/info/index.js @@ -100,13 +100,12 @@ Page({ } }) }, - + downFile:function(e){ - let idx = e.currentTarget.dataset['index']; let that = this; wx.downloadFile({ // 示例 url,并非真实存在 - url: that.data.request+that.imageList[idx], + url: app.globalData.uploadUrl+'/common/download/resource?resource='+that.data.infoData.insuranceFile, success: function (res) { const filePath = res.tempFilePath wx.openDocument({ @@ -122,7 +121,7 @@ Page({ }) //app.toast("暂不支持下载!如需下载请前往后台管理系统!!") }, - + returnToPage: function () { /*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/ wx.redirectTo({ diff --git a/miniprogram/pageage/project_insurance/info/index.wxml b/miniprogram/pageage/project_insurance/info/index.wxml index 75095c5..3e38e0c 100644 --- a/miniprogram/pageage/project_insurance/info/index.wxml +++ b/miniprogram/pageage/project_insurance/info/index.wxml @@ -30,7 +30,7 @@ 保险合同 - + 下载附件 diff --git a/miniprogram/pageage/project_materialSeal/info/index.js b/miniprogram/pageage/project_materialSeal/info/index.js index f062615..8b3d422 100644 --- a/miniprogram/pageage/project_materialSeal/info/index.js +++ b/miniprogram/pageage/project_materialSeal/info/index.js @@ -19,6 +19,8 @@ Page({ alterationFileNames:[], minAlterationFileImages:[], alterationFileImages:[], + fileUrls:[], + fileUrls2:[], request:app.globalData.reqUrl }, @@ -68,6 +70,7 @@ Page({ let fileNames = []; let minFileImages = []; let fileImages = []; + let fileUrls = []; //判断附件 if(res.data.signFiles){ res.data.signFiles.split(',').forEach(element => { @@ -78,13 +81,16 @@ Page({ fileImages.push(that.data.request+element); minFileImages.push(that.data.request+element+'.min.jpg'); }else{ - fileNames.push(element); + let it = element.split('/'); + fileNames.push(it[it.length-1]); + fileUrls.push(element); } }); } let fileNames2 = []; let minFileImages2 = []; let fileImages2 = []; + let fileUrls2 = []; //判断附件 if(res.data.alterationFiles){ res.data.alterationFiles.split(',').forEach(element => { @@ -95,11 +101,15 @@ Page({ fileImages2.push(that.data.request+element); minFileImages2.push(that.data.request+element+'.min.jpg'); }else{ - fileNames2.push(element); + let it = element.split('/'); + fileNames2.push(it[it.length-1]); + fileUrls2.push(element); } }); } that.setData({ + fileUrls, + fileUrls2, signFileNames:fileNames, minSignFileImages:minFileImages, signFileImages:fileImages, @@ -186,49 +196,49 @@ Page({ }) }, - downFile:function(e){ - let idx = e.currentTarget.dataset['index']; - let that = this; - wx.downloadFile({ - // 示例 url,并非真实存在 - url: that.data.request+that.data.signFileNames[idx], - success: function (res) { - const filePath = res.tempFilePath - wx.openDocument({ - filePath: filePath, - success: function (res) { - console.log('打开文档成功') - }, - fail:function(res) { - console.log(res) - } - }) - } - }) - //app.toast("暂不支持下载!如需下载请前往后台管理系统!!") - }, + downFile:function(e){ + let idx = e.currentTarget.dataset['index']; + let that = this; + wx.downloadFile({ + // 示例 url,并非真实存在 + url: app.globalData.uploadUrl+'/common/download/resource?resource='+that.data.fileUrls[idx], + success: function (res) { + const filePath = res.tempFilePath + wx.openDocument({ + filePath: filePath, + success: function (res) { + console.log('打开文档成功') + }, + fail:function(res) { + console.log(res) + } + }) + } + }) + //app.toast("暂不支持下载!如需下载请前往后台管理系统!!") + }, - downFile2:function(e){ - let idx = e.currentTarget.dataset['index']; - let that = this; - wx.downloadFile({ - // 示例 url,并非真实存在 - url: that.data.request+that.alterationFileNames[idx], - success: function (res) { - const filePath = res.tempFilePath - wx.openDocument({ - filePath: filePath, - success: function (res) { - console.log('打开文档成功') - }, - fail:function(res) { - console.log(res) - } - }) - } - }) - //app.toast("暂不支持下载!如需下载请前往后台管理系统!!") - }, + downFile2:function(e){ + let idx = e.currentTarget.dataset['index']; + let that = this; + wx.downloadFile({ + // 示例 url,并非真实存在 + url: app.globalData.uploadUrl+'/common/download/resource?resource='+that.data.fileUrls2[idx], + success: function (res) { + const filePath = res.tempFilePath + wx.openDocument({ + filePath: filePath, + success: function (res) { + console.log('打开文档成功') + }, + fail:function(res) { + console.log(res) + } + }) + } + }) + //app.toast("暂不支持下载!如需下载请前往后台管理系统!!") + }, returnToPage: function () { /*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/ diff --git a/miniprogram/pageage/project_materialSeal/info/index.wxml b/miniprogram/pageage/project_materialSeal/info/index.wxml index 13aa6ca..af71fa1 100644 --- a/miniprogram/pageage/project_materialSeal/info/index.wxml +++ b/miniprogram/pageage/project_materialSeal/info/index.wxml @@ -82,7 +82,7 @@ - 下载附件 + 下载附件 diff --git a/miniprogram/pageage/project_special/info/index.js b/miniprogram/pageage/project_special/info/index.js index 6ac1743..85031bd 100644 --- a/miniprogram/pageage/project_special/info/index.js +++ b/miniprogram/pageage/project_special/info/index.js @@ -127,7 +127,7 @@ Page({ let that = this; wx.downloadFile({ // 示例 url,并非真实存在 - url: that.data.request+that.imageList[idx], + url: app.globalData.uploadUrl+'/common/download/resource?resource='+that.data.imageList[idx], success: function (res) { const filePath = res.tempFilePath wx.openDocument({ diff --git a/miniprogram/pageage/project_train/info/index.js b/miniprogram/pageage/project_train/info/index.js index 3b0208c..b2c291f 100644 --- a/miniprogram/pageage/project_train/info/index.js +++ b/miniprogram/pageage/project_train/info/index.js @@ -185,7 +185,7 @@ Page({ let that = this; wx.downloadFile({ // 示例 url,并非真实存在 - url: app.globalData.uploadUrl+'/common/upload/'+that.fileUrls[idx], + url: app.globalData.uploadUrl+'/common/download/resource?resource='+that.data.fileUrls[idx], success: function (res) { const filePath = res.tempFilePath wx.openDocument({ diff --git a/miniprogram/pages/project_flowable/approveLeaveTask/index.wxml b/miniprogram/pages/project_flowable/approveLeaveTask/index.wxml index f5e0f2f..03c9c85 100644 --- a/miniprogram/pages/project_flowable/approveLeaveTask/index.wxml +++ b/miniprogram/pages/project_flowable/approveLeaveTask/index.wxml @@ -11,8 +11,8 @@ - - + + {{projectName}} @@ -52,55 +52,55 @@ - - 发起单位 - - {{deptName}} - + + + 发起单位 + {{deptName}} + - - 发起用户 - - {{nickName}} - + + + 发起用户 + {{nickName}} + - - 审批事项 - - {{procDefName}} - + + + 审批事项 + {{procDefName}} + - - 申请日期 - - {{infoData.date}} - + + + 申请日期 + {{infoData.date}} + - - 请假时间 - - {{infoData.beginDate}}{{infoData.endDate}} - + + + 请假时间 + {{infoData.beginDate}}{{infoData.endDate}} + - - 请假事由 - - {{infoData.remark}} - + + + 请假事由 + {{infoData.remark}} + 共请假{{' '+infoData.day+' '}}天 - - 审批意见 - + + 审批意见 +