From 373929a32aa4a3197260a106be3fdc21eb109afc Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期二, 04 三月 2025 08:38:11 +0800 Subject: [PATCH] feat:门卫页面修改状态传参 --- pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue | 74 +++++++++++++++++++++++++++++++++--- 1 files changed, 67 insertions(+), 7 deletions(-) diff --git a/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue b/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue index 8577da2..9a58dd9 100644 --- a/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue +++ b/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue @@ -38,7 +38,8 @@ <view class="">{{ faYunDetailobj.clean || '' }}</view> </view> </view> - <view class="body-container"> + <view class="body-container" + v-if="!isSpecial"> <view class="container-block"> <view class="">璁㈠崟鍓╀綑閲�</view> <view class="">{{ faYunDetailobj.allowance || '' }}</view> @@ -50,7 +51,8 @@ <view class="">{{ faYunDetailobj.code || '' }}</view> </view> </view> - <view class="body-container last"> + <view class="body-container last" + v-if="!isSpecial"> <view class="container-block"> <view class="">璁㈠崟缂栧彿</view> <view class="">{{ faYunDetailobj.orderCode || '' }}</view> @@ -79,11 +81,18 @@ </view> </view> </view> + <!-- 澧炲姞鐢靛瓙纾呭崟涓嬭浇 --> + <!-- v-if="roleType === 3" --> + <view class="weigh-button"> <u-button text="涓嬭浇鐢靛瓙纾呭崟" + @click="downloadTmFile" + type="primary" + shape="circle"></u-button></view> </view> </view> </template> <script> + import { BaseUrl } from '@/api/publicInterface.js'; import combinedTitle from '@/components/combined-title/combined-title.vue'; export default { components: { @@ -94,11 +103,54 @@ id: '', faYunDetailobj: {}, coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅浠�', '鍑虹叅浠�', '鏀剧┖', '浣滃簾', '鍏ュ満鐢宠', - '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�' - ] + '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�', '鎵撳嵃涓�', '鎵撳嵃涓�', '濉啓' + ], + isSpecial: null //1 鏄壒娈� 0涓嶆槸鐗规畩 }; }, - methods: {}, + methods: { + //涓嬭浇鐢靛瓙纾呭崟 + downloadTmFile(){ + uni.showLoading({ + title: '鍔犺浇涓�' + }); + this.$reqGetId('downLoadTm',this.id).then(res=>{ + console.log(res,'result') + this.$u.toast('涓嬭浇鎴愬姛锛�') + uni.hideLoading(); + const result = res.data.url; + let that = this; + const fileExtName = ".pdf"; + const randfile = new Date().getTime() +res.data.fileName; + const newPath = `${wx.env.USER_DATA_PATH}/${randfile}`; + if(result){ + wx.downloadFile({ + url: `${BaseUrl}${result}`, + filePath:wx.env.USER_DATA_PATH+`/${randfile}`, + header: { + Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'), + CLIENT_TOC: 'Y' + }, + success(res){ + const filePath = res.tempFilePath; + wx.openDocument({ + filePath: res.filePath, + showMenu: true, + fileType: 'pdf', + success: function (res) {} + }) + uni.hideLoading(); + + }, + fail(err){ + console.log(err,'涓嬭浇鏂囦欢澶辫触') + } + }) + } + + }) + }, + }, onLoad(params) { this.id = params.id; }, @@ -106,11 +158,17 @@ this.$reqGet('getTakeCoal', { takeCoalId: this.id }).then(res => { if (res.code == 0) { this.faYunDetailobj = res.data; + this.isSpecial = res.data.isSpecial } else { this.$u.toast('鑾峰彇鏁版嵁澶辫触'); } }); - } + }, + computed:{ + roleType() { + return uni.getStorageSync('roleType'); + }, + } }; </script> @@ -121,7 +179,9 @@ justify-content: space-between; align-items: center; } - + .weigh-button{ + margin-top: 30rpx; + } .main { width: 100%; margin-top: vww(10); -- Gitblit v1.9.1