Browse Source

查看报表修改

duy 1 year ago
parent
commit
342af5c44b

+ 11 - 2
src/components/view-report/view-report.vue

@@ -12,7 +12,7 @@
             <div :id="`hc_table_card_${uuid}`" class="flex-1">
                 <hc-new-card>
                     <template #header>
-                        <div class="text-18px font-bold">工程进度款审核表</div>
+                        <div class="text-18px font-bold">{{ pdfTitle }}</div>
                     </template>
                     <template #extra>
                         <el-button hc-btn type="warning" @click="backClick">返回</el-button>
@@ -58,6 +58,7 @@ watch(isShow, (val) => {
     if (val) {
         setSplitRef()
         pdfIndex.value = 0
+   
     }
 })
 
@@ -75,27 +76,35 @@ const setSplitRef = () => {
 
 //深度监听数据
 const pdfData = ref(props.datas)
+const pdfTitle = ref('')
 watch(() => props.datas, (data) => {
     pdfData.value = getArrValue(data)
     console.log( pdfData.value, ' pdfData.value')
     pdfUrl.value = pdfData.value[0].url
+    pdfTitle.value = pdfData.value[0].title
 }, { deep: true })
 
 
 //深度监听索引
 const pdfIndex = ref(0)
 
-
+watch(() => pdfIndex.value, (index) => {
+    pdfUrl.value = pdfData.value[index].url
+    pdfTitle.value = pdfData.value[index].title
+}, { deep: true })
 
 //返回
 const backClick = () => {
     isShow.value = false
     pdfIndex.value = 0
+  
 }
 const pdfUrl = ref('')
 const changePdf = (item, index)=>{
     pdfIndex.value = index
     pdfUrl.value = item.url
+    pdfTitle.value = item.title
+
 }
 </script>
 

+ 1 - 0
src/views/debit-pay/admin/certificate.vue

@@ -161,6 +161,7 @@ const rowRecalculateClick = async (row) => {
 //查看报表
 const pdfList = ref([])
 const rowViewPdf = (row)=>{
+    pdfList.value = []
     if (row.urlListData.length > 0) {
         pdfList.value = row.urlListData
         console.log(pdfList.value, 'pdfList.value')