浏览代码

档案初验(专家)

ZaiZai 1 年之前
父节点
当前提交
1411d0b0fc
共有 2 个文件被更改,包括 17 次插入29 次删除
  1. 1 1
      public/version.json
  2. 16 28
      src/views/transfer/initial-expert.vue

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240131153311"
+  "value": "20240131164421"
 }

+ 16 - 28
src/views/transfer/initial-expert.vue

@@ -61,14 +61,11 @@
         </hc-new-card>
 
         <!-- 历史报告 -->
-        <HcDrawer
-            :show="isSubmitReportDrawer" to-id="submit-report-layout-target" uis="hc-submit-report-target"
-            @close="onSubmitReportDrawerClose"
-        >
+        <HcDrawer :show="isSubmitReportDrawer" to-id="submit-report-layout-target" uis="hc-submit-report-target" @close="onSubmitReportDrawerClose">
             <template #header>
                 <div class="hc-select-view w-52">
-                    <el-select v-model="pdfDate" placeholder="选择日期" @change="changePdfDate">
-                        <el-option v-for="item in timeData " :label="item" :value="item" />
+                    <el-select v-model="pdfDateId" placeholder="选择日期" @change="changePdfDate">
+                        <el-option v-for="item in reportData" :key="item.id" :label="item.approveDate" :value="item.id" />
                     </el-select>
                 </div>
                 <div class="hc-title-view">{{ tableTitle }}</div>
@@ -76,9 +73,7 @@
             <template #extra>
                 <el-button type="danger" round plain @click="onSubmitReportDrawerClose">返回主页</el-button>
             </template>
-            <HcPdf
-                :src="curPdf"
-            />
+            <HcPdf :src="curPdf" />
         </HcDrawer>
     </div>
 </template>
@@ -88,7 +83,7 @@ import { onMounted, ref } from 'vue'
 import { useRouter } from 'vue-router'
 import { useAppStore } from '~src/store'
 import initialgApi from '~api/initial/initial'
-import { arrToKey, getArrValue, isObjNull } from 'js-fast-way'
+import { getArrValue, isObjNull } from 'js-fast-way'
 import visualTable from './components/visual-table.vue'
 import { toPdfPage } from '~uti/btn-auth'
 //变量
@@ -307,29 +302,22 @@ const submitReportClick = async () => {
 //历史报告
 const isSubmitReportDrawer = ref(false)
 const reportData = ref([])
-const timeData = ref([])
 const onSubmitReportClick = async () => {
-    const { error, code, data } = await initialgApi.getHistoryTable({
+    const { data } = await initialgApi.getHistoryTable({
         projectId: projectId.value,
     })
-    if (!error && code === 200) {
-        reportData.value = getArrValue(data)
-        const dataString = arrToKey( reportData.value, 'approveDate', ',')
-        timeData.value = dataString.split(',')
-      if (timeData.value.length > 0) {
-        pdfDate.value = timeData.value[0]
-        curPdf.value = reportData.value[0].tableUrl
-        tableTitle.value = reportData.value[0].tableTitle
+    const res = getArrValue(data)
+    reportData.value = res
+    if (res.length >= 0) {
+        pdfDateId.value = res[0].id
+        curPdf.value = res[0].tableUrl
+        tableTitle.value = res[0].tableTitle
         isSubmitReportDrawer.value = true
-      }
-
     } else {
-        reportData.value = []
-
+        window.$message?.warning('暂无历史报告')
     }
-
 }
-const pdfDate = ref(null)
+const pdfDateId = ref(null)
 const curPdf = ref('')
 const tableTitle = ref('')
 //历史报告
@@ -337,9 +325,9 @@ const onSubmitReportDrawerClose = () => {
     isSubmitReportDrawer.value = false
     curPdf.value = ''
 }
-const changePdfDate = (val)=>{
+const changePdfDate = (val) => {
     reportData.value.forEach((ele)=>{
-        if (ele.approveDate === val) {
+        if (ele.id === val) {
             curPdf.value = ele.tableUrl
             tableTitle.value = ele.tableTitle
         }