Newer
Older
xc-business-system / src / views / resource / file / approval / approvedDetail.vue
<!-- 意见登记表详情 -->
<script name="FileApprovalFormDetailApproved" lang="ts" setup>
import { ElMessage } from 'element-plus'

// 从路由中传过来的参数
const id = ref<string>('')

const route = useRoute()
const router = useRouter()

// 逻辑
// 关闭
const resetForm = () => {
  sessionStorage.removeItem('fileApprovalForm') // 返回列表时 将缓存中的数据删除
  router.go(-1)
}

// 打印
const printClickedHandler = () => {
  ElMessage.success('打印成功')
}

// 打印Word
const printToWord = () => {
  // exportFile({ id: noticeInfo.value.id, pdf: false })
}

// 打印PDF
const printToPDF = () => {

}

const initDialog = (params: any) => {
  // 从路由中获取参数
  id.value = params.id !== undefined ? params.id : ''
}

onMounted(() => {
  initDialog(route.query)
})
</script>

<template>
  <app-container>
    <detail-page title="文件审批">
      <template #btns>
        <el-button type="primary" @click="printToWord">
          导出Word
        </el-button>
        <el-button type="primary" @click="printToPDF">
          导出PDF
        </el-button>
        <el-button type="primary" @click="printClickedHandler">
          打印
        </el-button>

        <el-button type="info" @click="resetForm()">
          关闭
        </el-button>
      </template>
    </detail-page>
  </app-container>
</template>