Browse Source

验收报告修改

duy 1 year ago
parent
commit
97b52c54d6

+ 1 - 1
src/views/transfer/components/table-classify.vue

@@ -60,7 +60,7 @@
                         <el-option v-for="item in timeData " :label="item" :value="item" />
                     </el-select>
                 </div>
-            <!-- <div class="hc-title-view">试验资料(含工地试验室资质证书、仪器标定证书等)</div> -->
+                <div class="hc-title-view">试验资料(含工地试验室资质证书、仪器标定证书等)</div>
             </template>
             <template #extra>
                 <div class="hc-icon-view text-hover" @click="onSubmitReportDrawerClose">

+ 2 - 2
src/views/transfer/components/table-collect.vue

@@ -1,5 +1,5 @@
 <template>
-    <div id="submit-report-layout-target1" class="hc-page-box">
+    <div class="hc-page-box">
         <hc-new-card scrollbar>
             <template #header>
                 <HcTooltip keys="file_collection_btn_upload_scanned_files"> <el-checkbox v-if="!showBtn" v-model="checkedval" label="全选" size="large" @change="clickAll" /> </HcTooltip>
@@ -64,7 +64,7 @@
 
         <!-- 历史报告 -->
         <HcDrawer
-            :show="isSubmitReportDrawer" to-id="submit-report-layout-target1" uis="hc-submit-report-target1"
+            :show="isSubmitReportDrawer" to-id="submit-report-layout-target2" uis="hc-submit-report-target2"
             @close="onSubmitReportDrawerClose"
         >
             <template #header>

+ 50 - 23
src/views/transfer/initial-expert.vue

@@ -26,7 +26,7 @@
                     </el-button>
                 </HcTooltip>
                 <HcTooltip keys="transfer_initial_expert_btn_history_report">
-                    <el-button color="#38b54a" hc-btn style="color: white" @click="getReportClick">
+                    <el-button color="#38b54a" hc-btn style="color: white" @click="onSubmitReportClick">
                         <HcIcon name="history" />
                         <span>查看验收报告</span>
                     </el-button>
@@ -67,20 +67,19 @@
         >
             <template #header>
                 <div class="hc-select-view w-52">
-                    <el-select v-model="pdfDate" placeholder="选择日期">
-                        <el-option label="2022年12月24日" value="2022年12月24日" />
-                        <el-option label="2022年12月25日" value="2022年12月25日" />
-                        <el-option label="2022年12月26日" value="2022年12月26日" />
-                        <el-option label="2022年12月27日" value="2022年12月27日" />
+                    <el-select v-model="pdfDate" placeholder="选择日期" @change="changePdfDate">
+                        <el-option v-for="item in timeData " :label="item" :value="item" />
                     </el-select>
                 </div>
                 <div class="hc-title-view">试验资料(含工地试验室资质证书、仪器标定证书等)</div>
+            </template>
+            <template #extra>
                 <div class="hc-icon-view text-hover" @click="onSubmitReportDrawerClose">
                     <HcIcon name="close" />
                 </div>
             </template>
             <HcPdf
-                src="https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20221212/ce9799c7d18efc03efefd6f242439f2e.pdf"
+                :src="curPdf"
             />
         </HcDrawer>
     </div>
@@ -91,7 +90,7 @@ import { onMounted, ref } from 'vue'
 import { useRouter } from 'vue-router'
 import { useAppStore } from '~src/store'
 import initialgApi from '~api/initial/initial'
-import { getArrValue, getObjValue, isObjNull } from 'js-fast-way'
+import { arrToKey, getArrValue, isObjNull } from 'js-fast-way'
 import visualTable from './components/visual-table.vue'
 //变量
 const router = useRouter()
@@ -292,16 +291,44 @@ const submitReportClick = async () => {
     // })
 }
 
+//历史报告
 //历史报告
 const isSubmitReportDrawer = ref(false)
-const onSubmitReportClick = () => {
-    isSubmitReportDrawer.value = true
+const reportData = ref([])
+const timeData = ref([])
+const onSubmitReportClick = async () => {
+    const { error, code, 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
+        isSubmitReportDrawer.value = true
+      }
+       
+    } else {
+        reportData.value = []
+     
+    }
+   
 }
 const pdfDate = ref(null)
-
+const curPdf = ref('')
 //历史报告
 const onSubmitReportDrawerClose = () => {
     isSubmitReportDrawer.value = false
+    curPdf.value = ''
+}
+const changePdfDate = (val)=>{
+    reportData.value.forEach((ele)=>{
+        if (ele.approveDate === val) {
+            curPdf.value = ele.tableUrl
+        }
+    })
 }
 
 //预览
@@ -320,19 +347,19 @@ const previewClick = async ()=>{
 }
 //查看验收报告
 
-const getReportClick = async ()=>{
-    const { error, code, data, msg } = await initialgApi.getTable({
-        projectId: projectId.value,
-    })
-    if (!error && code === 200) {
-        if (data) {
-            window.open(data, '_blank')
-        } else {
-            window.$message?.warning('文件不存在')
-        }
+// const getReportClick = async ()=>{
+//     const { error, code, data, msg } = await initialgApi.getTable({
+//         projectId: projectId.value,
+//     })
+//     if (!error && code === 200) {
+//         if (data) {
+//             window.open(data, '_blank')
+//         } else {
+//             window.$message?.warning('文件不存在')
+//         }
 
-    }
-}
+//     }
+// }
 </script>
 
 <style lang="scss" scoped>