Browse Source

上报按钮条件判断

duy 1 năm trước cách đây
mục cha
commit
f19be8fa5b
1 tập tin đã thay đổi với 27 bổ sung9 xóa
  1. 27 9
      src/views/file/collection.vue

+ 27 - 9
src/views/file/collection.vue

@@ -1550,18 +1550,27 @@ const certificationModalClick = () => {
     CertData.value = rows
     CertIds.value = rowsToId(rows)
     CertPdf.value = rows[0]?.pdfFileUrl || ''
-    showCertificationModal.value = true
     const result = rows.every(({ isCertification })=> {
         return isCertification === 0
     })
-    if (result) {
-        CertData.value = rows
-        CertIds.value = rowsToId(rows)
-        CertPdf.value = rows[0]?.pdfFileUrl || ''
-        showCertificationModal.value = true
+    const result1 = rows.every(({ isApproval })=> {
+        return isApproval === 1
+    })//已上报不能认证
+    if (result1) {
+        window.$message.warning('已上报的文件不能进行认证')
     } else {
-        window.$message?.warning('已认证的文件不能再认证')
+        if (result) {
+            CertData.value = rows
+            CertIds.value = rowsToId(rows)
+            CertPdf.value = rows[0]?.pdfFileUrl || ''
+
+            showCertificationModal.value = true
+        } else {
+            window.$message?.warning('已认证的文件不能再认证')
+        }
     }
+
+ 
 }
 
 //认证行被点击
@@ -1631,10 +1640,19 @@ const reportModalClick = () => {
     const result = rows.every(({ status }) => {
         return status === 0 || status === 3
     })
-    if (!result) {
-        window.$message?.warning('已上报的文件不能进行再次上报')
+    const result1 = rows.every(({ isCertification }) => {
+        return isCertification === 1
+    })
+    if (result1) {
+        window.$message?.warning('已认证的文件不能进行上报')
         return false
+    } else {
+        if (!result) {
+            window.$message?.warning('已上报的文件不能进行再次上报')
+            return false
+        }
     }
+   
     //展示上报弹窗
     reportData.value = rows
     isReport.value = true