write-report.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <div id="submit-report-layout-target" class="hc-page-box write-report">
  3. <hc-new-card>
  4. <template #header>
  5. <div class="hc-conclusion-header-box">
  6. <div class="hc-conclusion-icon-box">
  7. <HcIcon name="file-ppt-2" fill />
  8. </div>
  9. <div class="ml-2 conclusion-name-box">
  10. <span class="text-xl text-cut conclusion-alias">编写结论、提交报告</span>
  11. <div class="text-xs text-cut conclusion-name">{{ projectInfo.name }}</div>
  12. </div>
  13. </div>
  14. </template>
  15. <template #extra>
  16. <el-button v-if="state === 2" hc-btn type="primary" @click="onSubmitReportClick">查看验收意见</el-button>
  17. <el-button v-if="state === 2" hc-btn type="primary">撤回提交</el-button>
  18. <el-button v-if="state === 1" hc-btn type="primary" @click="submissionClick">确认提交</el-button>
  19. <el-button hc-btn type="primary">暂存草稿</el-button>
  20. <el-button hc-btn @click="previousStep">上一步</el-button>
  21. <el-button hc-btn @click="toBackClick">返回主页</el-button>
  22. </template>
  23. <HcOnlineOffice :key="dataKey" :src="docxUrl" title="测试的文档.docx" :url="saveUrl" :project-id="projectId" :token="token" :user-info="userInfo" />
  24. </hc-new-card>
  25. <!-- 短信认证 -->
  26. <HcSmsAuth :loading="SMSAuthLoading" :show="SMSAuthShow" @cancel="SMSAuthCancel" @confirm="SMSAuthConfirm" />
  27. <!-- 历史报告 -->
  28. <HcDrawer
  29. :show="isSubmitReportDrawer" to-id="submit-report-layout-target" uis="hc-submit-report-target"
  30. @close="onSubmitReportDrawerClose"
  31. >
  32. <template #header>
  33. <div class="hc-select-view w-52">
  34. <el-select v-model="pdfDate" placeholder="选择日期">
  35. <el-option label="2022年12月24日" value="2022年12月24日" />
  36. <el-option label="2022年12月25日" value="2022年12月25日" />
  37. <el-option label="2022年12月26日" value="2022年12月26日" />
  38. <el-option label="2022年12月27日" value="2022年12月27日" />
  39. </el-select>
  40. </div>
  41. <div class="hc-title-view">试验资料(含工地试验室资质证书、仪器标定证书等)</div>
  42. <div class="hc-icon-view text-hover" @click="onSubmitReportDrawerClose">
  43. <HcIcon name="close" />
  44. </div>
  45. </template>
  46. <HcPdf
  47. src="https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20221212/ce9799c7d18efc03efefd6f242439f2e.pdf"
  48. />
  49. </HcDrawer>
  50. </div>
  51. </template>
  52. <script setup>
  53. import { onMounted, ref } from 'vue'
  54. import { useAppStore } from '~src/store'
  55. import { useRouter } from 'vue-router'
  56. import initialgApi from '~api/initial/initial'
  57. import { getToken } from '~src/api/util/auth'
  58. //变量
  59. const router = useRouter()
  60. const useAppState = useAppStore()
  61. const projectId = ref(useAppState.getProjectId)
  62. const contractId = ref(useAppState.getContractId)
  63. const projectInfo = ref(useAppState.getProjectInfo)
  64. const userInfo = ref(useAppState.getUserInfo)
  65. const token = ref( getToken())
  66. //渲染完成
  67. onMounted(() => {
  68. // setTimeout(() => {
  69. // docxUrl.value = 'http://bladex-chongqing-info.oss-cn-hangzhou.aliyuncs.com/upload/20230317/e2bdc6581e397b810b46ac7cd71b111b.docx'
  70. // }, 1000)
  71. geDocxUrl()
  72. })
  73. const state = ref(1)
  74. const docxUrl = ref('')
  75. const saveUrl = ref('http://192.168.0.128:8090/blade-archive/archivesauto/callbackSave' + '&Blade-Auth=' + token.value + '&' + 'projectId=' + projectId.value)
  76. const dataKey = ref('')
  77. //const docxUrl = ref('https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20230317/e2bdc6581e397b810b46ac7cd71b111b.docx')
  78. //获取文档地址
  79. const geDocxUrl = async ()=>{
  80. const { error, code, data } = await initialgApi.getArchiveConclusion({
  81. projectId: projectId.value,
  82. })
  83. if (!error && code === 200) {
  84. docxUrl.value = data['worldUrl']
  85. dataKey.value = data['id'] + '_' + Math.random() + ''
  86. } else {
  87. docxUrl.value = ''
  88. }
  89. }
  90. //确认提交
  91. const submissionClick = () => {
  92. SMSAuthShow.value = true
  93. }
  94. //短信验证
  95. const SMSAuthLoading = ref(false)
  96. const SMSAuthShow = ref(false)
  97. const SMSAuthConfirm = () => {
  98. SMSAuthShow.value = false
  99. state.value = 2
  100. }
  101. const SMSAuthCancel = () => {
  102. SMSAuthShow.value = false
  103. }
  104. //上一步
  105. const previousStep = () => {
  106. router.back()
  107. }
  108. //返回主页
  109. const toBackClick = () => {
  110. router.push({
  111. name: 'transfer-initial-expert',
  112. })
  113. }
  114. //历史报告
  115. const isSubmitReportDrawer = ref(false)
  116. const onSubmitReportClick = () => {
  117. isSubmitReportDrawer.value = true
  118. }
  119. const pdfDate = ref(null)
  120. //历史报告
  121. const onSubmitReportDrawerClose = () => {
  122. isSubmitReportDrawer.value = false
  123. }
  124. </script>
  125. <style lang="scss" scoped>
  126. @import '~style/transfer/scoped/submit-report.scss';
  127. .hc-conclusion-header-box {
  128. position: relative;
  129. display: flex;
  130. align-items: flex-start;
  131. .hc-conclusion-icon-box {
  132. font-size: 28px;
  133. color: var(--el-color-primary);
  134. }
  135. .conclusion-name-box {
  136. flex: auto;
  137. position: relative;
  138. overflow: hidden;
  139. .conclusion-alias {
  140. color: var(--el-color-primary);
  141. }
  142. .conclusion-name {
  143. margin-top: 4px;
  144. color: #838791;
  145. }
  146. }
  147. }
  148. </style>
  149. <style lang="scss">
  150. @import '~style/transfer/submit-report.scss';
  151. </style>