|
@@ -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>
|