|
@@ -61,14 +61,11 @@
|
|
</hc-new-card>
|
|
</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>
|
|
<template #header>
|
|
<div class="hc-select-view w-52">
|
|
<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>
|
|
</el-select>
|
|
</div>
|
|
</div>
|
|
<div class="hc-title-view">{{ tableTitle }}</div>
|
|
<div class="hc-title-view">{{ tableTitle }}</div>
|
|
@@ -76,9 +73,7 @@
|
|
<template #extra>
|
|
<template #extra>
|
|
<el-button type="danger" round plain @click="onSubmitReportDrawerClose">返回主页</el-button>
|
|
<el-button type="danger" round plain @click="onSubmitReportDrawerClose">返回主页</el-button>
|
|
</template>
|
|
</template>
|
|
- <HcPdf
|
|
|
|
- :src="curPdf"
|
|
|
|
- />
|
|
|
|
|
|
+ <HcPdf :src="curPdf" />
|
|
</HcDrawer>
|
|
</HcDrawer>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -88,7 +83,7 @@ import { onMounted, ref } from 'vue'
|
|
import { useRouter } from 'vue-router'
|
|
import { useRouter } from 'vue-router'
|
|
import { useAppStore } from '~src/store'
|
|
import { useAppStore } from '~src/store'
|
|
import initialgApi from '~api/initial/initial'
|
|
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 visualTable from './components/visual-table.vue'
|
|
import { toPdfPage } from '~uti/btn-auth'
|
|
import { toPdfPage } from '~uti/btn-auth'
|
|
//变量
|
|
//变量
|
|
@@ -307,29 +302,22 @@ const submitReportClick = async () => {
|
|
//历史报告
|
|
//历史报告
|
|
const isSubmitReportDrawer = ref(false)
|
|
const isSubmitReportDrawer = ref(false)
|
|
const reportData = ref([])
|
|
const reportData = ref([])
|
|
-const timeData = ref([])
|
|
|
|
const onSubmitReportClick = async () => {
|
|
const onSubmitReportClick = async () => {
|
|
- const { error, code, data } = await initialgApi.getHistoryTable({
|
|
|
|
|
|
+ const { data } = await initialgApi.getHistoryTable({
|
|
projectId: projectId.value,
|
|
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
|
|
isSubmitReportDrawer.value = true
|
|
- }
|
|
|
|
-
|
|
|
|
} else {
|
|
} else {
|
|
- reportData.value = []
|
|
|
|
-
|
|
|
|
|
|
+ window.$message?.warning('暂无历史报告')
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
-const pdfDate = ref(null)
|
|
|
|
|
|
+const pdfDateId = ref(null)
|
|
const curPdf = ref('')
|
|
const curPdf = ref('')
|
|
const tableTitle = ref('')
|
|
const tableTitle = ref('')
|
|
//历史报告
|
|
//历史报告
|
|
@@ -337,9 +325,9 @@ const onSubmitReportDrawerClose = () => {
|
|
isSubmitReportDrawer.value = false
|
|
isSubmitReportDrawer.value = false
|
|
curPdf.value = ''
|
|
curPdf.value = ''
|
|
}
|
|
}
|
|
-const changePdfDate = (val)=>{
|
|
|
|
|
|
+const changePdfDate = (val) => {
|
|
reportData.value.forEach((ele)=>{
|
|
reportData.value.forEach((ele)=>{
|
|
- if (ele.approveDate === val) {
|
|
|
|
|
|
+ if (ele.id === val) {
|
|
curPdf.value = ele.tableUrl
|
|
curPdf.value = ele.tableUrl
|
|
tableTitle.value = ele.tableTitle
|
|
tableTitle.value = ele.tableTitle
|
|
}
|
|
}
|