Newer
Older
xc-business-system / src / views / resource / software / approvedDetail.vue
tanyue on 1 Nov 2023 1 KB 20231101 软件评审报告
<!-- 软件评审表/申请单 -->
<script name="SoftwareDetailApproved" lang="ts" setup>
import { ElMessage } from 'element-plus'

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

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

const title = ref('')

// 逻辑
// 关闭
const resetForm = () => {
  router.go(-1)
}

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

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

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

}

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

  switch (type.value) {
    case 'review':
      title.value = '软件评审报告'
      break

    case 'apply' :
      title.value = '软件修订申请单'
      break
  }
}

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

<template>
  <app-container>
    <detail-page :title="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>