Bladeren bron

消防报告已读状态变更后触发分页操作

wangtao 9 uur geleden
bovenliggende
commit
3390651331
2 gewijzigde bestanden met toevoegingen van 9 en 13 verwijderingen
  1. 1 1
      src/api/business/mhxf/fireReport/index.js
  2. 8 12
      src/pages/business/mhxf/fireReport/index.vue

+ 1 - 1
src/api/business/mhxf/fireReport/index.js

@@ -11,7 +11,7 @@ export function reportInfoList( param) {
   });
 }
 /**
- * @历史报告列表查询接口
+ * @报告状态读取修改接口
  */
 export function putReportStatus( data) {
   return request({

+ 8 - 12
src/pages/business/mhxf/fireReport/index.vue

@@ -47,10 +47,9 @@ const total = ref(0);
  */
 function handleSelect(val) {
   if(!val.isRead){
-    putReportStatus({id:val.id})
-    setTimeout(()=>{
+    putReportStatus({id:val.id}).then((res) => {
       reportInfoListApi()
-    },1000)
+    })
   }
   proxy.$tab.navigateTo("/pages/business/mhxf/fireReport/components/detailedPath?reportPath=" + val.reportPath);
 }
@@ -82,10 +81,9 @@ function handleDownload(val) {
   proxy.$modal.loading("报告下载中,请耐心等待...");
     //  #ifdef H5
     if(!val.isRead){
-      putReportStatus({id:val.id})
-      setTimeout(()=>{
+      putReportStatus({id:val.id}).then(() => {
         reportInfoListApi()
-      },1000)
+      })
     }
     window.open(val.reportPath);
     // #endif
@@ -97,10 +95,9 @@ function handleDownload(val) {
       success: (res) => {
         if (res.statusCode === 200) {
           if(!val.isRead){
-            putReportStatus({id:val.id})
-            setTimeout(()=>{
+            putReportStatus({id:val.id}).then(() => {
               reportInfoListApi()
-            },1000)
+            })
           }
           // 预览pdf文件
           uni.openDocument({
@@ -121,10 +118,9 @@ function handleDownload(val) {
       success: (res) => {
         if (res.statusCode === 200) {
           if(!val.isRead){
-            putReportStatus({id:val.id})
-            setTimeout(()=>{
+            putReportStatus({id:val.id}).then(() => {
               reportInfoListApi()
-            },1000)
+            })
           }
           // 保存pdf文件至手机,一般安卓端存储路径为:手机存储/dcim/camera文件夹下
           uni.saveImageToPhotosAlbum({