|
@@ -1,9 +1,23 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="page_body">
|
|
<view class="page_body">
|
|
|
<!-- 头部 -->
|
|
<!-- 头部 -->
|
|
|
- <nav-bar height="216" :title="state.pageTitle" :onlyTitle="false" :showHeadSearchInput="false" :showFilterPicker="false" :showTabs="false" :showTabBtns="true" :tabBtns="state.tabBtns" rightWidth="0rpx" @GoBack="GoBack"></nav-bar>
|
|
|
|
|
|
|
+ <nav-bar height="216" :title="state.pageTitle" :onlyTitle="false" :showHeadSearchInput="false" :showFilterPicker="false" :showTabs="false" :showTabBtns="true" :tabBtns="state.tabBtns" rightWidth="0rpx" @CommonFilterData="CommonFilterData" @GoBack="GoBack"></nav-bar>
|
|
|
<view class="page_content">
|
|
<view class="page_content">
|
|
|
-
|
|
|
|
|
|
|
+ <template v-if="state.fileContent">
|
|
|
|
|
+ <!-- 图片 -->
|
|
|
|
|
+ <image v-if="state.fileContent.docType=='image'" class="img_width" :src="state.fileContent.filePath" mode="aspectFit"></image>
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ <!-- #ifdef H5 -->
|
|
|
|
|
+ <wg-h5-preview-file ref="webPreviewFile" :showCloseBtn="false" />
|
|
|
|
|
+ <!-- #endif -->
|
|
|
|
|
+ <!-- #ifdef APP-PLUS -->
|
|
|
|
|
+ <template v-if="['word','excel','pdf'].includes(state.fileContent.docType)">
|
|
|
|
|
+ <cjx-previewOffice ref="appPreviewOfficeRef" :value="state.fileContent.filePath" :type="state.fileContent.docType" :showCloseBtn="false" :showHeader="false" :closeOnClickModal="false"></cjx-previewOffice>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <view v-else class="other_file"><text>不支持预览,请点击下载: </text><text style="color: #2e64fa;font-size: 28rpx;" @click="ToDownloadFile">{{state.fileContent.fileName}}</text></view>
|
|
|
|
|
+ <!-- #endif -->
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </template>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="page_foot">
|
|
<view class="page_foot">
|
|
|
<button :class="['btn','btn_reject',{'disabled':state.taskStatus==2 || (state.taskStatus==1 && state.reviewStatus == 2)}]" type="primary" plain="true" :loading="state.loading" @click="HandleRejectHonor">驳回</button>
|
|
<button :class="['btn','btn_reject',{'disabled':state.taskStatus==2 || (state.taskStatus==1 && state.reviewStatus == 2)}]" type="primary" plain="true" :loading="state.loading" @click="HandleRejectHonor">驳回</button>
|
|
@@ -15,6 +29,8 @@
|
|
|
<uni-easyinput type="textarea" v-model="state.rejectReason" :maxlength="200" :style="state.easyinputStyle" placeholderStyle="font-weight: 400;font-size: 28rpx;color: #999999;" placeholder="请输入驳回原因…"></uni-easyinput>
|
|
<uni-easyinput type="textarea" v-model="state.rejectReason" :maxlength="200" :style="state.easyinputStyle" placeholderStyle="font-weight: 400;font-size: 28rpx;color: #999999;" placeholder="请输入驳回原因…"></uni-easyinput>
|
|
|
</view>
|
|
</view>
|
|
|
</customPopupDialog>
|
|
</customPopupDialog>
|
|
|
|
|
+ <!-- 文件、图片下载 -->
|
|
|
|
|
+ <ss-download ref="ssdownload"></ss-download>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -23,7 +39,15 @@
|
|
|
import uvUpload from '@/uni_modules/uv-upload/components/uv-upload/uv-upload.vue';
|
|
import uvUpload from '@/uni_modules/uv-upload/components/uv-upload/uv-upload.vue';
|
|
|
import customPopupDialog from '@/components/customPopupDialog.vue';
|
|
import customPopupDialog from '@/components/customPopupDialog.vue';
|
|
|
import uniEasyinput from '@/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue';
|
|
import uniEasyinput from '@/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue';
|
|
|
|
|
+ // #ifdef H5
|
|
|
|
|
+ import wgH5PreviewFile from '@/components/wg-h5-preview-file/wg-h5-preview-file.vue';//web端文件预览 'word','excel','pptx','pdf','txt'
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ // #ifdef APP-PLUS
|
|
|
|
|
+ import cjxPreviewOffice from '@/uni_modules/cjx-previewOffice/components/cjx-previewOffice/cjx-previewOffice.vue';//APP端文件预览 'word','excel','pdf','txt'
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ import ssDownload from '@/uni_modules/ss-download/components/ss-download/ss-download.vue';
|
|
|
import {updateReviewStatus,ChangeReviewStatus} from '@/reqApi/notification.js';
|
|
import {updateReviewStatus,ChangeReviewStatus} from '@/reqApi/notification.js';
|
|
|
|
|
+ import { getFileTypeBySuffix } from '@/common/common.js';
|
|
|
import {
|
|
import {
|
|
|
reactive,
|
|
reactive,
|
|
|
ref,
|
|
ref,
|
|
@@ -38,6 +62,7 @@
|
|
|
loading:false,
|
|
loading:false,
|
|
|
pageTitle:'',
|
|
pageTitle:'',
|
|
|
tabBtns:[],
|
|
tabBtns:[],
|
|
|
|
|
+ fileContent:null,//文件内容
|
|
|
rejectReason:'',//驳回原因
|
|
rejectReason:'',//驳回原因
|
|
|
easyinputStyle:{
|
|
easyinputStyle:{
|
|
|
color: '#303133',
|
|
color: '#303133',
|
|
@@ -45,6 +70,9 @@
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
const popupDelDialogRef = ref(null);
|
|
const popupDelDialogRef = ref(null);
|
|
|
|
|
+ const webPreviewFile = ref(null);//web端文件预览
|
|
|
|
|
+ const appPreviewOfficeRef = ref(null);//APP端文件预览
|
|
|
|
|
+ const ssdownload = ref(null);//下载
|
|
|
onLoad((option) => {
|
|
onLoad((option) => {
|
|
|
state.taskStatus = Number(option.taskStatus);//任务状态
|
|
state.taskStatus = Number(option.taskStatus);//任务状态
|
|
|
uni.removeStorageSync('isLoadReviewMaterialDetailList');//是否更新列表
|
|
uni.removeStorageSync('isLoadReviewMaterialDetailList');//是否更新列表
|
|
@@ -53,17 +81,54 @@
|
|
|
state.reviewStatus = detailData?.reviewStatus || '';//审核状态
|
|
state.reviewStatus = detailData?.reviewStatus || '';//审核状态
|
|
|
state.taskTargetId = detailData?.taskTargetId || '';
|
|
state.taskTargetId = detailData?.taskTargetId || '';
|
|
|
const fileList = detailData?.taskTargetFileVos || [];
|
|
const fileList = detailData?.taskTargetFileVos || [];
|
|
|
- state.tabBtns = fileList.map(item=>({
|
|
|
|
|
|
|
+ state.tabBtns = fileList.map(item => ({
|
|
|
...item,
|
|
...item,
|
|
|
- label:item.fileName,
|
|
|
|
|
- value:item.id,
|
|
|
|
|
- }))
|
|
|
|
|
- console.log(detailData,32323)
|
|
|
|
|
|
|
+ docType: getFileTypeBySuffix(item.fileType),
|
|
|
|
|
+ label: item.fileName,
|
|
|
|
|
+ value: item.id,
|
|
|
|
|
+ }));
|
|
|
|
|
+
|
|
|
|
|
+ state.fileContent = state.tabBtns.length ? state.tabBtns[0] : null;
|
|
|
|
|
+ GetFileContent();
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
onUnmounted(()=>{
|
|
onUnmounted(()=>{
|
|
|
uni.removeStorageSync('reviewMaterialDetailData');//删除缓存数据
|
|
uni.removeStorageSync('reviewMaterialDetailData');//删除缓存数据
|
|
|
})
|
|
})
|
|
|
|
|
+ //切换条件选择器
|
|
|
|
|
+ const CommonFilterData = (filterOptions,type) => {
|
|
|
|
|
+ const tabBtnSelected = filterOptions.tabBtnSelected;
|
|
|
|
|
+ if(type == 'tabBtns'){
|
|
|
|
|
+ state.fileContent = state.tabBtns.find(item=>item.id == tabBtnSelected);
|
|
|
|
|
+ GetFileContent();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ const GetFileContent = () => {
|
|
|
|
|
+ const docType = state?.fileContent?.docType || '';
|
|
|
|
|
+ if(['word','excel','pptx','pdf','txt'].includes(docType)){
|
|
|
|
|
+ // #ifdef H5
|
|
|
|
|
+ nextTick(()=>{//h5文件预览
|
|
|
|
|
+ webPreviewFile.value && webPreviewFile.value.preview({
|
|
|
|
|
+ url: state.fileContent.filePath,
|
|
|
|
|
+ type: state.fileContent.docType
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ // #ifdef APP-PLUS
|
|
|
|
|
+ if(docType == 'pptx'){
|
|
|
|
|
+ ssdownload?.value?.toDownload({
|
|
|
|
|
+ type:'2',
|
|
|
|
|
+ src:state.fileContent.filePath,
|
|
|
|
|
+ fileName:state.fileContent.fileName
|
|
|
|
|
+ });
|
|
|
|
|
+ }else{
|
|
|
|
|
+ nextTick(()=>{
|
|
|
|
|
+ appPreviewOfficeRef.value && appPreviewOfficeRef.value.open();
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
//通过
|
|
//通过
|
|
|
const HandlePassHonor = () => {
|
|
const HandlePassHonor = () => {
|
|
|
if(state.taskStatus==2 || (state.taskStatus==1 && state.reviewStatus == 1)){
|
|
if(state.taskStatus==2 || (state.taskStatus==1 && state.reviewStatus == 1)){
|
|
@@ -118,19 +183,42 @@
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.page_body{
|
|
.page_body{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
min-height: auto;
|
|
min-height: auto;
|
|
|
}
|
|
}
|
|
|
.page_content{
|
|
.page_content{
|
|
|
- height: calc(100% - 390rpx);
|
|
|
|
|
|
|
+ flex:1;
|
|
|
|
|
+ //height: calc(100% - 390rpx);
|
|
|
overflow: auto;
|
|
overflow: auto;
|
|
|
|
|
+ .img_width{
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: auto;
|
|
|
|
|
+ max-height: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+ .other_file{
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ word-break: break-all;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
.page_foot{
|
|
.page_foot{
|
|
|
- position: fixed;
|
|
|
|
|
- left:0;
|
|
|
|
|
- right: 0;
|
|
|
|
|
- bottom: 0;
|
|
|
|
|
|
|
+ // position: fixed;
|
|
|
|
|
+ // left:0;
|
|
|
|
|
+ // right: 0;
|
|
|
|
|
+ // bottom: 0;
|
|
|
|
|
+ width: 100%;
|
|
|
padding: 40rpx 24rpx 38rpx 24rpx;
|
|
padding: 40rpx 24rpx 38rpx 24rpx;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
box-shadow: inset 0px 2rpx 0px 0px #F3F3F3;
|
|
box-shadow: inset 0px 2rpx 0px 0px #F3F3F3;
|
|
|
background-color:#FFFFFF;
|
|
background-color:#FFFFFF;
|
|
|
gap: 30rpx;
|
|
gap: 30rpx;
|