write-report.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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 :key1="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. geDocxUrl()
  70. }, 1000)
  71. })
  72. const state = ref(1)
  73. const docxUrl = ref('')
  74. const saveUrl = ref('http://192.168.0.128:8090/blade-archive/archivesauto/callbackSave' + '?Blade-Auth=bearer ' + token.value + '&' + 'projectId=' + projectId.value)
  75. const dataKey = ref('')
  76. const datafile = 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. console.log(dataKey.value, 'dataKey')
  87. datafile.value = data
  88. } else {
  89. docxUrl.value = ''
  90. }
  91. }
  92. //确认提交
  93. const submissionClick = () => {
  94. SMSAuthShow.value = true
  95. }
  96. //短信验证
  97. const SMSAuthLoading = ref(false)
  98. const SMSAuthShow = ref(false)
  99. const SMSAuthConfirm = () => {
  100. SMSAuthShow.value = false
  101. state.value = 2
  102. }
  103. const SMSAuthCancel = () => {
  104. SMSAuthShow.value = false
  105. }
  106. //上一步
  107. const previousStep = () => {
  108. router.back()
  109. }
  110. //返回主页
  111. const toBackClick = () => {
  112. router.push({
  113. name: 'transfer-initial-expert',
  114. })
  115. }
  116. //历史报告
  117. const isSubmitReportDrawer = ref(false)
  118. const onSubmitReportClick = () => {
  119. isSubmitReportDrawer.value = true
  120. }
  121. const pdfDate = ref(null)
  122. //历史报告
  123. const onSubmitReportDrawerClose = () => {
  124. isSubmitReportDrawer.value = false
  125. }
  126. </script>
  127. <style lang="scss" scoped>
  128. @import '~style/transfer/scoped/submit-report.scss';
  129. .hc-conclusion-header-box {
  130. position: relative;
  131. display: flex;
  132. align-items: flex-start;
  133. .hc-conclusion-icon-box {
  134. font-size: 28px;
  135. color: var(--el-color-primary);
  136. }
  137. .conclusion-name-box {
  138. flex: auto;
  139. position: relative;
  140. overflow: hidden;
  141. .conclusion-alias {
  142. color: var(--el-color-primary);
  143. }
  144. .conclusion-name {
  145. margin-top: 4px;
  146. color: #838791;
  147. }
  148. }
  149. }
  150. </style>
  151. <style lang="scss">
  152. @import '~style/transfer/submit-report.scss';
  153. </style>