|
@@ -1,37 +1,33 @@
|
|
|
<template>
|
|
|
- <hc-sys id="app-sys" class="h-full hc-app-task-detail" :isNavBar="false">
|
|
|
- <view id="task-detail-content" class="task-detail-content">
|
|
|
- <view class="task-name-box">
|
|
|
- <view class="name-bar">{{taskInfo.taskName}}</view>
|
|
|
- <view class="arrow-bar">
|
|
|
- <uni-icons type="bottom" size="22" @click="taskPopupClick"/>
|
|
|
+ <hc-sys class="h-full hc-app-task-detail" :isNavBar="false">
|
|
|
+ <uni-section class="mt-0.5" title="当前任务名称" type="line">
|
|
|
+ <template v-slot:right>
|
|
|
+ <view class="hc-flex text-gray-5" @click="taskPopupClick">
|
|
|
+ <text class="mr-1">切换任务</text>
|
|
|
+ <uni-icons type="bottom" size="18" color="#6b7280"/>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </template>
|
|
|
+ <view class="task-name">{{taskInfo.taskName}}</view>
|
|
|
<view class="task-report-info">
|
|
|
<view>上报人:{{taskInfo.reportUserName}}</view>
|
|
|
<view>{{taskInfo.startTime}}</view>
|
|
|
</view>
|
|
|
- <view class="task-pdf-list-bar">
|
|
|
- <view class="task-pdf-info" @click="tablePopupClick">
|
|
|
- <view class="file-name">{{taskFileInfo.fileName}}</view>
|
|
|
- <view class="file-num">共{{taskFileInfo.fileNum}}张表格</view>
|
|
|
+ </uni-section>
|
|
|
+ <uni-section class="mt-2" :title="`当前表格 (共${taskFileInfo?.fileNum ?? 0}张)`" sub-title="点击表格名称查看PDF" type="line">
|
|
|
+ <template v-slot:right>
|
|
|
+ <view class="hc-flex text-gray-5" @click="tablePopupClick">
|
|
|
+ <text class="mr-1">切换表格</text>
|
|
|
+ <uni-icons type="bottom" size="18" color="#6b7280"/>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <!--pdf区域-->
|
|
|
- <hc-pdf :title="false" :ui="webViewStyle" :src="taskFileInfo?.fileUrl" v-if="taskFileInfo?.fileUrl"/>
|
|
|
- <uv-empty icon="/static/image/list.png" marginTop="24" v-else/>
|
|
|
+ </template>
|
|
|
+ <view class="task-file-name" @click="viewPdfClick">{{taskFileInfo.fileName}}</view>
|
|
|
+ </uni-section>
|
|
|
<!--底部操作栏-->
|
|
|
- <template v-if="isTaskAuth">
|
|
|
- <HcTabbarBlock :height="77"/>
|
|
|
- <hc-tabbars id="action-bar">
|
|
|
- <button type="primary" class="action-bar-btn" @click="approveClick">
|
|
|
- <text>审</text>
|
|
|
- <text class="ml-10">批</text>
|
|
|
- </button>
|
|
|
- </hc-tabbars>
|
|
|
- </template>
|
|
|
- <view id="action-bar" v-else></view>
|
|
|
+ <hc-tabbars v-if="isTaskAuth">
|
|
|
+ <button type="primary" class="action-bar-btn" @click="approveClick">
|
|
|
+ <text>审</text> <text class="ml-6">批</text>
|
|
|
+ </button>
|
|
|
+ </hc-tabbars>
|
|
|
<!-- 普通弹窗 -->
|
|
|
<uni-popup ref="popupRef" class="hc-popup" type="bottom">
|
|
|
<view class="task-popup-content">
|
|
@@ -84,7 +80,6 @@
|
|
|
</template>
|
|
|
</view>
|
|
|
</uni-popup>
|
|
|
-
|
|
|
<!-- 任务列表 -->
|
|
|
<uni-popup ref="popupTaskRef" type="bottom">
|
|
|
<view class="relative bg-white h-50vh hc-p br-t">
|
|
@@ -94,7 +89,6 @@
|
|
|
</template>
|
|
|
</view>
|
|
|
</uni-popup>
|
|
|
-
|
|
|
<!-- 表格列表 -->
|
|
|
<uni-popup ref="popupTableRef" type="bottom">
|
|
|
<view class="relative bg-white h-50vh hc-p br-t">
|
|
@@ -111,7 +105,7 @@
|
|
|
import {ref, nextTick, getCurrentInstance} from "vue";
|
|
|
import {onLoad, onReady} from '@dcloudio/uni-app'
|
|
|
import {arrToKey, getArrValue, getObjValue, isString} from "js-fast-way";
|
|
|
-import {errorToast, querySelect, successToast} from "@/utils/tools";
|
|
|
+import {errorToast, successToast, toPdfPreview} from "@/utils/tools";
|
|
|
import {checkFlowUserIsExistPfxFile, saveSmsTimeout, sendNotice} from "~api/other/index";
|
|
|
import mainApi from '~api/tasks/data';
|
|
|
import {useAppStore} from "@/store";
|
|
@@ -145,7 +139,6 @@ onLoad(({node}) => {
|
|
|
|
|
|
//渲染完成
|
|
|
onReady(() => {
|
|
|
- setWebViewStyle()
|
|
|
uni.setNavigationBarTitle({title: '审批任务'})
|
|
|
})
|
|
|
|
|
@@ -158,24 +151,6 @@ const getDataApi = async () => {
|
|
|
uni.hideLoading();
|
|
|
}
|
|
|
|
|
|
-//设置webview样式
|
|
|
-const webViewStyle = ref({})
|
|
|
-const setWebViewStyle = async () => {
|
|
|
- const {height: appHeight} = await querySelect(instance,'app-sys')
|
|
|
- const {height: navHeight} = await querySelect(instance,'task-detail-content')
|
|
|
- const {height: bottomHeight} = await querySelect(instance,'action-bar')
|
|
|
- // #ifdef H5
|
|
|
- webViewStyle.value.top = navHeight + 'px'
|
|
|
- webViewStyle.value.height = (appHeight - navHeight - bottomHeight) + 'px'
|
|
|
- // #endif
|
|
|
- // #ifdef APP-PLUS
|
|
|
- const {screenHeight, safeArea} = uni.getWindowInfo()
|
|
|
- webViewStyle.value.top = navHeight + 'px'
|
|
|
- const content = navHeight + (screenHeight - safeArea.bottom) + bottomHeight
|
|
|
- webViewStyle.value.height = (screenHeight - content) + 'px'
|
|
|
- // #endif
|
|
|
-}
|
|
|
-
|
|
|
//切换任务
|
|
|
const taskClick = (item) => {
|
|
|
taskInfo.value = item
|
|
@@ -441,6 +416,23 @@ const cancelClick = () => {
|
|
|
smsCode.value = ''
|
|
|
argument.value = ''
|
|
|
}
|
|
|
+
|
|
|
+//查看PDF
|
|
|
+const viewPdfClick = () => {
|
|
|
+ const {fileUrl} = taskFileInfo.value
|
|
|
+ if (fileUrl) {
|
|
|
+ // #ifdef H5
|
|
|
+ window.open(url, '_blank')
|
|
|
+ // #endif
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/index/preview?url=' + encodeURIComponent(fileUrl)
|
|
|
+ });
|
|
|
+ // #endif
|
|
|
+ } else {
|
|
|
+ errorToast('PDF文件不存在')
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|