Browse Source

历史验收报告接口调用

duy 1 year ago
parent
commit
38cc32b44f

+ 8 - 0
src/api/modules/initial/initial.js

@@ -146,4 +146,12 @@ export default {
             params: form,
         }, msg)
     },
+    //验收申请-历史验收报告
+    async getHistoryTable(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-archive/archiveExpertConclusion/getHistoryTable',
+            method: 'get',
+            params: form,
+        }, msg)
+    },
 }

+ 109 - 46
src/views/transfer/components/table-classify.vue

@@ -1,58 +1,82 @@
 <template>
-    <hc-new-card>
-        <template #header>
+    <div id="submit-report-layout-target2" class="hc-page-box">
+        <hc-new-card>
+            <template #header>
             <!-- <HcNewSwitch :datas="tabData" :keys="tabKey" :round="false" @change="tabChange" /> -->
-        </template>
-        <template #extra>
-            <el-button hc-btn color="#626aef">
-                <HcIcon name="eye" />
-                <span>历史验收报告</span>
-            </el-button>
-            <el-button hc-btn class=" m-1" type="warning">
-                <HcIcon name="eye" />
-                <span>历史整改报告</span>
-            </el-button>
-            <HcTooltip keys="file_collection_btn_upload_scanned_files">
-                <el-button v-if="!showBtn" type="primary" hc-btn @click="reportModalClick">
-                    <HcIcon name="git-pull-request" />
-                    <span>申请验收</span>
+            </template>
+            <template #extra>
+                <el-button hc-btn color="#626aef" @click="onSubmitReportClick">
+                    <HcIcon name="eye" />
+                    <span>历史验收报告</span>
                 </el-button>
-                <el-button v-else type="primary" hc-btn @click="cancelClick">
-                    <HcIcon name="git-pull-request" />
-                    <span>撤回验收申请</span>
+                <el-button hc-btn class=" m-1" type="warning">
+                    <HcIcon name="eye" />
+                    <span>历史整改报告</span>
                 </el-button>
-            </HcTooltip>
-        </template>
-        <HcTable
-            ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading"
-            is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
-            @selection-change="tableSelection"
+                <HcTooltip keys="file_collection_btn_upload_scanned_files">
+                    <el-button v-if="!showBtn" type="primary" hc-btn @click="reportModalClick">
+                        <HcIcon name="git-pull-request" />
+                        <span>申请验收</span>
+                    </el-button>
+                    <el-button v-else type="primary" hc-btn @click="cancelClick">
+                        <HcIcon name="git-pull-request" />
+                        <span>撤回验收申请</span>
+                    </el-button>
+                </HcTooltip>
+            </template>
+            <HcTable
+                ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading"
+                is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
+                @selection-change="tableSelection"
+            />
+            <template #action>
+                <HcPages :pages="searchForm" @change="pageChange" />
+            </template>
+        </hc-new-card>
+        <!-- 批量上报审批 -->
+        <HcReportModal
+            title="申请验收"
+            widths="1080px"
+            url="archivesauto/saveApply"
+            :show="showReportModal"
+            :project-id="projectId"
+            :contract-id="contractId"
+            :task-name="reportTaskName"
+            :ids="reportIds"
+            is-datas
+            :datas="reportDatas"
+            @hide="showReportModal = false"
+            @finish="showReportFinish"
+            @tag-close="reportTaskTagClose"
         />
-        <template #action>
-            <HcPages :pages="searchForm" @change="pageChange" />
-        </template>
-    </hc-new-card>
-    <!-- 批量上报审批 -->
-    <HcReportModal
-        title="申请验收"
-        widths="1080px"
-        url="archivesauto/saveApply"
-        :show="showReportModal"
-        :project-id="projectId"
-        :contract-id="contractId"
-        :task-name="reportTaskName"
-        :ids="reportIds"
-        is-datas
-        :datas="reportDatas"
-        @hide="showReportModal = false"
-        @finish="showReportFinish"
-        @tagClose="reportTaskTagClose"
-    />
+        <!-- 历史报告 -->
+        <HcDrawer
+            :show="isSubmitReportDrawer" to-id="submit-report-layout-target2" uis="hc-submit-report-target2"
+            @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>
+                </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="curPdf"
+            />
+        </HcDrawer>
+    </div>
 </template>
 
 <script setup>
 import { nextTick, onMounted, ref, watch } from 'vue'
-import { getArrValue, getObjValue } from 'js-fast-way'
+import { arrToKey, getArrValue, getObjValue } from 'js-fast-way'
 import { rowsToId } from '~uti/tools'
 import tuningApi from '~api/archiveConfig/tuning.js'
 import initialgApi from '~api/initial/initial'
@@ -222,6 +246,45 @@ const cancelClick = ()=>{
         },
     })
 }
+
+//历史报告
+const isSubmitReportDrawer = ref(false)
+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
+        }
+    })
+}
 </script>
 
 <style lang="scss" scoped>

+ 120 - 66
src/views/transfer/components/table-collect.vue

@@ -1,70 +1,95 @@
 <template>
-    <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>
-        </template>
-        <template #extra>
-            <!-- <HcNewSwitch :datas="tabData" :keys="tabKey" :round="false" @change="tabChange" /> -->
-            <el-button hc-btn color="#626aef">
-                <HcIcon name="eye" />
-                <span>历史验收报告</span>
-            </el-button>
-            <el-button hc-btn class=" m-1" type="warning">
-                <HcIcon name="eye" />
-                <span>历史整改报告</span>
-            </el-button>
-            <HcTooltip keys="file_collection_btn_upload_scanned_files">
-                <el-button v-if="!showBtn" type="primary" hc-btn @click="reportModalClick">
-                    <HcIcon name="git-pull-request" />
-                    <span>申请验收</span>
+    <div id="submit-report-layout-target1" 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>
+            </template>
+            <template #extra>
+                <!-- <HcNewSwitch :datas="tabData" :keys="tabKey" :round="false" @change="tabChange" /> -->
+                <el-button hc-btn color="#626aef" @click="onSubmitReportClick">
+                    <HcIcon name="eye" />
+                    <span>历史验收报告</span>
                 </el-button>
-                <el-button v-else type="primary" hc-btn @click="cancelClick">
-                    <HcIcon name="git-pull-request" />
-                    <span>撤回验收申请</span>
+                <el-button hc-btn class=" m-1" type="warning">
+                    <HcIcon name="eye" />
+                    <span>历史整改报告</span>
                 </el-button>
-            </HcTooltip>
-        </template>
-        <div v-loading="totalLoaing" class="h-screen">
-            <div v-for="(item, index) in totalData" :key="item.unitInfo">
-                <div class="hc-card-table-title">{{ item.unitInfo }}</div>
-                <template v-for="(item1, index1) in item.nodeLists" :key="item1.nodeInfo">
-                    <HcCardItem v-if="item1.list && item1.list.length > 0" ui="h-half">
-                        <template #header>
-                            <!-- <el-checkbox v-model="item1.checkedval" label="全选" size="large" @change="clickAll($event, index)" />  -->
-                            <span>{{ item1.nodeInfo }}</span>
+                <HcTooltip keys="file_collection_btn_upload_scanned_files">
+                    <el-button v-if="!showBtn" type="primary" hc-btn @click="reportModalClick">
+                        <HcIcon name="git-pull-request" />
+                        <span>申请验收</span>
+                    </el-button>
+                    <el-button v-else type="primary" hc-btn @click="cancelClick">
+                        <HcIcon name="git-pull-request" />
+                        <span>撤回验收申请</span>
+                    </el-button>
+                </HcTooltip>
+            </template>
+            <div v-loading="totalLoaing" class="h-screen">
+                <div v-for="(item, index) in totalData" :key="item.unitInfo">
+                    <div class="hc-card-table-title">{{ item.unitInfo }}</div>
+                    <template v-for="(item1, index1) in item.nodeLists" :key="item1.nodeInfo">
+                        <HcCardItem v-if="item1.list && item1.list.length > 0" ui="h-half">
+                            <template #header>
+                                <!-- <el-checkbox v-model="item1.checkedval" label="全选" size="large" @change="clickAll($event, index)" />  -->
+                                <span>{{ item1.nodeInfo }}</span>
                            
                             <!-- <span class="text-gray">(238卷)</span> -->
-                        </template>
-                        <div :style="`height: ${item1.list !== null && item1.list.length > 9 ? '300px' : 'auto'};`">
-                            <visualTable ref="visuatable" :table-data="item1.list " :index-num="index" @get-table-keys="getTableKeys($event, index1)" />
-                        </div>
-                    </HcCardItem>
-                </template>
+                            </template>
+                            <div :style="`height: ${item1.list !== null && item1.list.length > 9 ? '300px' : 'auto'};`">
+                                <visualTable ref="visuatable" :table-data="item1.list " :index-num="index" @get-table-keys="getTableKeys($event, index1)" />
+                            </div>
+                        </HcCardItem>
+                    </template>
+                </div>
             </div>
-        </div>
-    </hc-new-card>
+        </hc-new-card>
 
-    <!-- 批量上报审批 -->
-    <HcReportModal
-        title="申请验收"
-        widths="1080px"
-        url="archivesauto/saveApply"
-        :show="showReportModal"
-        :project-id="projectId"
-        :contract-id="contractId"
-        :task-name="reportTaskName"
-        :ids="reportIds"
-        is-datas
-        :datas="reportDatas"
-        @hide="hidereport"
-        @finish="showReportFinish"
-        @tag-close="reportTaskTagClose"
-    />
+        <!-- 批量上报审批 -->
+        <HcReportModal
+            title="申请验收"
+            widths="1080px"
+            url="archivesauto/saveApply"
+            :show="showReportModal"
+            :project-id="projectId"
+            :contract-id="contractId"
+            :task-name="reportTaskName"
+            :ids="reportIds"
+            is-datas
+            :datas="reportDatas"
+            @hide="hidereport"
+            @finish="showReportFinish"
+            @tag-close="reportTaskTagClose"
+        />
+
+        <!-- 历史报告 -->
+        <HcDrawer
+            :show="isSubmitReportDrawer" to-id="submit-report-layout-target1" uis="hc-submit-report-target1"
+            @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>
+                </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="curPdf"
+            />
+        </HcDrawer>
+    </div>
 </template>
 
 <script setup>
 import { nextTick, onMounted, ref, watch } from 'vue'
-import { getArrValue, getObjValue } from 'js-fast-way'
+import { arrToKey, getArrValue, getObjValue } from 'js-fast-way'
 import { rowsToId } from '~uti/tools'
 import initialgApi from '~api/initial/initial'
 import visualTable from './visual-table.vue'
@@ -152,16 +177,6 @@ const getTotalTabledata = (data)=>{
 
 //------立项审批
 
-
-
-
-
-
-
-
-
-
-
 //上报
 const tableKeys = ref([])
 const reprotTitle = ref(new Map())
@@ -264,6 +279,45 @@ const cancelClick = ()=>{
         },
     })
 }
+
+//历史报告
+const isSubmitReportDrawer = ref(false)
+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
+        }
+    })
+}
 </script>
 
 <style lang="scss" scoped>