|
|
@@ -246,20 +246,22 @@
|
|
|
<span>{{ record.createUser.nickname }}</span>
|
|
|
<el-button
|
|
|
:type="
|
|
|
- record.result === 100
|
|
|
- ? 'success'
|
|
|
- : record.result === 200
|
|
|
- ? 'danger'
|
|
|
- : 'default'
|
|
|
+ OAApprovalResultType[record.result] ||
|
|
|
+ (record.result === 100
|
|
|
+ ? 'success'
|
|
|
+ : record.result === 200
|
|
|
+ ? 'danger'
|
|
|
+ : 'default')
|
|
|
"
|
|
|
round
|
|
|
size="small"
|
|
|
>{{
|
|
|
- record.result === 100
|
|
|
- ? '通过'
|
|
|
- : record.result === 200
|
|
|
- ? '拒绝'
|
|
|
- : record.result || '-'
|
|
|
+ OAApprovalResultMap[record.result] ||
|
|
|
+ (record.result === 100
|
|
|
+ ? '通过'
|
|
|
+ : record.result === 200
|
|
|
+ ? '拒绝'
|
|
|
+ : record.result || '-')
|
|
|
}}</el-button
|
|
|
>
|
|
|
<span class="time">{{
|
|
|
@@ -683,6 +685,13 @@
|
|
|
@click="handleCancelFlow"
|
|
|
size="small"
|
|
|
>撤销流程</el-button>
|
|
|
+ <!-- OA审核:报告审核或审批阶段,有OA流程ID时显示 -->
|
|
|
+ <el-button
|
|
|
+ v-if="isCanOAAudit"
|
|
|
+ type="success"
|
|
|
+ @click="handleOpenOAAudit"
|
|
|
+ size="small"
|
|
|
+ >OA审核</el-button>
|
|
|
<!-- <el-button v-if="isCanSyncReportData" type="primary" @click="handleSyncReportData" :disabled="checkerIsLoginUser" size="small"-->
|
|
|
<!-- >同步报表</el-button>-->
|
|
|
</template>
|
|
|
@@ -704,7 +713,7 @@
|
|
|
|
|
|
<script setup lang="tsx">
|
|
|
import SmartTable from '@/components/SmartTable/SmartTable'
|
|
|
-import {computed, defineAsyncComponent, ref, watch} from 'vue'
|
|
|
+import {computed, defineAsyncComponent, nextTick, ref, watch} from 'vue'
|
|
|
import {useRoute} from 'vue-router'
|
|
|
import { InfoFilled, View, Back, Right, WarningFilled } from '@element-plus/icons-vue'
|
|
|
import {dayjs, ElMessage, ElMessageBox} from 'element-plus'
|
|
|
@@ -715,6 +724,7 @@ import {
|
|
|
PressureReportType,
|
|
|
PressureTaskOrderTaskStatus,
|
|
|
} from '@/utils/constants'
|
|
|
+import { OAApprovalResultMap, OAApprovalResultType } from '@/utils/pressure2/oaConstants'
|
|
|
import type {
|
|
|
PipeTaskOrderDetailVO,
|
|
|
PipeTaskOrderOrderItemVO,
|
|
|
@@ -751,6 +761,7 @@ interface Props {
|
|
|
reportList?: ReportItemVO[]
|
|
|
taskId: string
|
|
|
teleportBtnRef: Ref<HTMLDivElement | null>
|
|
|
+ isFullscreen?: boolean
|
|
|
}
|
|
|
|
|
|
interface Emits {
|
|
|
@@ -1255,6 +1266,52 @@ const handleCancelFlow = async () => {
|
|
|
}).catch(() => {})
|
|
|
}
|
|
|
|
|
|
+// 判断"OA审核"按钮是否显示:报告审核或审批阶段,且有OA流程ID
|
|
|
+const isCanOAAudit = computed(() => {
|
|
|
+ if (!props.selectedItem) return false
|
|
|
+ const isAuditOrApprove = [
|
|
|
+ PressureCheckerMyTaskStatus['REPORT_AUDIT'],
|
|
|
+ PressureCheckerMyTaskStatus['REPORT_APPROVE']
|
|
|
+ ].includes(props.selectedItem.taskStatus)
|
|
|
+ return isAuditOrApprove && !!props.selectedItem.summaryId && !checkerIsLoginUser.value
|
|
|
+})
|
|
|
+
|
|
|
+// OA审核:弹出独立窗口
|
|
|
+const oaAuditTimer = ref<ReturnType<typeof setInterval> | null>(null)
|
|
|
+
|
|
|
+const handleOpenOAAudit = async () => {
|
|
|
+ // 清除之前的定时器
|
|
|
+ if (oaAuditTimer.value) {
|
|
|
+ clearInterval(oaAuditTimer.value)
|
|
|
+ oaAuditTimer.value = null
|
|
|
+ }
|
|
|
+ // 先打开空白弹窗
|
|
|
+ const win = window.open('', 'OAAudit', 'width=1200,height=800,left=100,top=50,menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes')
|
|
|
+ try {
|
|
|
+ const link = await PipeTaskOrderApi.getAffairLink(props.selectedItem.summaryId)
|
|
|
+ if (link && win) {
|
|
|
+ win.location.href = link
|
|
|
+ // 轮询监听窗口关闭,关闭后触发报告状态更新
|
|
|
+ oaAuditTimer.value = setInterval(() => {
|
|
|
+ if (win.closed) {
|
|
|
+ clearInterval(oaAuditTimer.value!)
|
|
|
+ oaAuditTimer.value = null
|
|
|
+ PipeTaskOrderApi.updateReportBySummaryId(props.selectedItem.summaryId).finally(() => handleRefresh())
|
|
|
+ }
|
|
|
+ }, 500)
|
|
|
+ } else if (!win) {
|
|
|
+ ElMessage.warning('浏览器拦截了弹窗,请允许弹窗后重试')
|
|
|
+ } else {
|
|
|
+ win.close()
|
|
|
+ ElMessage.warning('未找到对应的OA审批链接')
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取OA审批链接失败:', error)
|
|
|
+ win?.close()
|
|
|
+ ElMessage.error('获取OA审批链接失败,请稍后重试')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// 判断"填写结果"按钮是否显示
|
|
|
const isCanEditRecordResult = computed(() => {
|
|
|
// 非我的任务详情页面,不显示
|
|
|
@@ -2051,7 +2108,7 @@ const pdfPanelRef = ref<HTMLDivElement>()
|
|
|
const handleWindowResize = debounce(async () => {
|
|
|
if(!pdfPanelRef.value) return
|
|
|
const width = pdfPanelRef.value?.clientWidth - 20
|
|
|
- pdfContentWidth.value = width > 1030 ? 1030 : width
|
|
|
+ pdfContentWidth.value = props.isFullscreen ? width : (width > 1030 ? 1030 : width)
|
|
|
|
|
|
if (initData.value.opType == 1){
|
|
|
spreadRef.value?.reloadView();
|
|
|
@@ -2069,6 +2126,13 @@ onUnmounted(() => {
|
|
|
window.removeEventListener('resize', handleWindowResize)
|
|
|
})
|
|
|
|
|
|
+// 全屏切换时重新计算PDF区域宽度
|
|
|
+watch(() => props.isFullscreen, () => {
|
|
|
+ nextTick(() => {
|
|
|
+ handleWindowResize()
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|