@@ -5,7 +5,20 @@
|
||||
<el-button type="primary" @click="goBack">返回</el-button>
|
||||
</div>
|
||||
<div v-else v-loading="loading">
|
||||
<el-form :model="form" :rules="rules" ref="formRef" label-position="top" class="sign-fill-form">
|
||||
<!-- 已签署: 再次打开签署链接, 直接展示劳务协议 PDF (复用 publicity 的 OSS 代理预览) -->
|
||||
<div v-if="signed" class="signed-pdf">
|
||||
<div class="sign-header">
|
||||
<div class="sign-header-title">{{ meetingName || '劳务协议' }}</div>
|
||||
<div v-if="periodDisplay" class="sign-header-period">期数:{{ periodDisplay }}</div>
|
||||
</div>
|
||||
<iframe v-if="laborPdfUrl" :src="proxyUrl(laborPdfUrl)" class="signed-pdf-frame"></iframe>
|
||||
<div v-else class="signed-pdf-empty">协议已签署,暂无可展示的 PDF</div>
|
||||
<div class="signed-pdf-actions">
|
||||
<el-button v-if="laborPdfUrl" type="primary" @click="downloadPdf">下载劳务协议</el-button>
|
||||
<el-button @click="goBack">返回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-form v-else :model="form" :rules="rules" ref="formRef" label-position="top" class="sign-fill-form">
|
||||
<!-- 大标题: 会议名称 + 期数 -->
|
||||
<div class="sign-header">
|
||||
<div class="sign-header-title">{{ meetingName || '劳务协议签署' }}</div>
|
||||
@@ -106,6 +119,9 @@ const notInvited = ref(false)
|
||||
const loading = ref(false)
|
||||
const submitting = ref(false)
|
||||
const formRef = ref(null)
|
||||
// 已签署状态: 再次打开签署链接时直接展示 PDF
|
||||
const signed = ref(false)
|
||||
const laborPdfUrl = ref('')
|
||||
|
||||
// 劳务形式 (checkboxOther 多选)
|
||||
const laborFormOptions = ref([])
|
||||
@@ -173,7 +189,7 @@ async function ensureLogin() {
|
||||
userStore.setUser({
|
||||
userId: u.userId,
|
||||
userName: u.userName || u.nickName || '',
|
||||
nickName: u.nickName || u.userName || '',
|
||||
nickName: u.nickName || '',
|
||||
phonenumber: u.phonenumber || '',
|
||||
accountType: u.accountType || 'MAIN',
|
||||
parentUserId: u.parentUserId || null,
|
||||
@@ -231,6 +247,21 @@ async function load() {
|
||||
loading.value = true
|
||||
try {
|
||||
const { data } = await getSignInfo(attendeeId.value)
|
||||
// 已签署: 再次打开签署链接 → 整页跳转到 OSS proxy 的 PDF 地址 (全屏显示, 不用 iframe 内嵌)
|
||||
if (data.signed || (data.laborProtocol && data.laborProtocol.trim())) {
|
||||
const url = data.laborProtocol
|
||||
if (url) {
|
||||
window.location.href = proxyUrl(url)
|
||||
return
|
||||
}
|
||||
// 无 PDF URL 兜底: 仍留在本页显示"已签署但无可展示 PDF"
|
||||
signed.value = true
|
||||
laborPdfUrl.value = ''
|
||||
meetingName.value = data.meetingName || ''
|
||||
periodNo.value = data.periodNo ?? null
|
||||
totalPeriods.value = data.totalPeriods ?? null
|
||||
return
|
||||
}
|
||||
// 预填 (current 优先, 否则用 defaults)
|
||||
const cur = data.current || {}
|
||||
const def = data.defaults || {}
|
||||
@@ -326,6 +357,23 @@ async function onSubmit() {
|
||||
}
|
||||
}
|
||||
|
||||
// OSS 代理预览 (同 publicity / doctor/Meetings.vue): 重写 Content-Disposition 为 inline, 隐藏工具栏撑满宽度
|
||||
function proxyUrl(url) {
|
||||
if (!url) return url
|
||||
if (url.includes('hwtossbamlorgcn.oss-cn-beijing.aliyuncs.com')) {
|
||||
return import.meta.env.VITE_APP_BASE_API + '/common/oss/proxy?url=' + encodeURIComponent(url) + '#toolbar=0&zoom=page-width'
|
||||
}
|
||||
return url
|
||||
}
|
||||
function downloadPdf() {
|
||||
if (!laborPdfUrl.value) return
|
||||
const a = document.createElement('a')
|
||||
a.href = laborPdfUrl.value
|
||||
a.download = `${meetingName.value || '劳务协议'}.pdf`
|
||||
a.target = '_blank'
|
||||
document.body.appendChild(a); a.click(); document.body.removeChild(a)
|
||||
}
|
||||
|
||||
function goBack() {
|
||||
router.push('/doctor/home')
|
||||
}
|
||||
@@ -335,13 +383,20 @@ onMounted(init)
|
||||
|
||||
<style scoped>
|
||||
/* 手机端全屏表单 (无 navbar / 无 page-card) */
|
||||
.sign-fill { padding: 16px; }
|
||||
.sign-fill { padding: 0; }
|
||||
.sign-fill-form { padding: 16px; }
|
||||
|
||||
/* 大标题: 会议名称 + 期数 */
|
||||
.sign-header { margin: 4px 0 20px; padding-bottom: 14px; border-bottom: 1px solid #f0f0f0; }
|
||||
.sign-header-title { font-size: 20px; font-weight: 600; color: #1a1a1a; line-height: 1.4; }
|
||||
.sign-header-period { margin-top: 6px; font-size: 14px; color: #595959; }
|
||||
|
||||
/* 已签署: 直接展示 PDF (宽度 100%, 高度不限制) */
|
||||
.signed-pdf { display: flex; flex-direction: column; }
|
||||
.signed-pdf-frame { width: 100%; height: 424vw; border: 0; }
|
||||
.signed-pdf-empty { padding: 48px 16px; text-align: center; color: #909399; }
|
||||
.signed-pdf-actions { margin-top: 16px; display: flex; gap: 12px; }
|
||||
|
||||
/* 未受邀提示 */
|
||||
.not-invited { padding: 60px 20px; text-align: center; }
|
||||
.not-invited-text { font-size: 16px; color: #606266; margin-bottom: 20px; }
|
||||
|
||||
Reference in New Issue
Block a user