Ver Fonte

Merge branch 'wangtao' of uskycloud/usky-web-mobile into master

gez há 2 semanas atrás
pai
commit
8af4df748f

+ 4 - 3
src/api/business/mhxf/fireReport/index.js

@@ -11,11 +11,12 @@ export function reportInfoList( param) {
   });
 }
 /**
- * @历史报告列表查询接口
+ * @报告状态读取修改接口
  */
 export function putReportStatus( data) {
   return request({
-    url: "/service-fire/demReportInfo/updateReadStatus?id=" + data.id ,
-    method: "POST",
+    url: "/service-fire/demReportInfo/updateReadStatus" ,
+    method: "PUT",
+    data
   });
 }

+ 20 - 4
src/pages/business/mhxf/fireReport/index.vue

@@ -46,7 +46,11 @@ const total = ref(0);
  * @列表点击事件
  */
 function handleSelect(val) {
-  putReportStatus({id:val.id})
+  if(!val.isRead){
+    putReportStatus({id:val.id}).then((res) => {
+      reportInfoListApi()
+    })
+  }
   proxy.$tab.navigateTo("/pages/business/mhxf/fireReport/components/detailedPath?reportPath=" + val.reportPath);
 }
 
@@ -76,7 +80,11 @@ function reportInfoListApi() {
 function handleDownload(val) {
   proxy.$modal.loading("报告下载中,请耐心等待...");
     //  #ifdef H5
-    putReportStatus({id:val.id})
+    if(!val.isRead){
+      putReportStatus({id:val.id}).then(() => {
+        reportInfoListApi()
+      })
+    }
     window.open(val.reportPath);
     // #endif
 
@@ -86,7 +94,11 @@ function handleDownload(val) {
       url: val.reportPath,
       success: (res) => {
         if (res.statusCode === 200) {
-          putReportStatus({id:val.id})
+          if(!val.isRead){
+            putReportStatus({id:val.id}).then(() => {
+              reportInfoListApi()
+            })
+          }
           // 预览pdf文件
           uni.openDocument({
             filePath: res.tempFilePath,
@@ -105,7 +117,11 @@ function handleDownload(val) {
       url: val.reportPath,
       success: (res) => {
         if (res.statusCode === 200) {
-          putReportStatus({id:val.id})
+          if(!val.isRead){
+            putReportStatus({id:val.id}).then(() => {
+              reportInfoListApi()
+            })
+          }
           // 保存pdf文件至手机,一般安卓端存储路径为:手机存储/dcim/camera文件夹下
           uni.saveImageToPhotosAlbum({
             filePath: res.tempFilePath,