From 9c1673c3cd9a73855ecfa40f5e717f7c4bbb2e1a Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: 星期五, 08 四月 2022 10:59:12 +0800
Subject: [PATCH] 'lct'

---
 src/views/safetyproduction/review.vue |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/views/safetyproduction/review.vue b/src/views/safetyproduction/review.vue
index 0af1751..4a471fb 100644
--- a/src/views/safetyproduction/review.vue
+++ b/src/views/safetyproduction/review.vue
@@ -237,6 +237,8 @@
       id: "",
       form: {},
       list: {},
+      point:"",
+      pointDel:""
     };
   },
   created() {
@@ -247,13 +249,20 @@
     itemInfo(id) {
       safetySelfInspectionItemInfo({id:id}).then((res) => {
         this.list = res.data.result;
+        this.point=res.data.result.point
+        this.pointDel=res.data.result.point
       });
     },
     modItem() {
       if(this.list.safetyInspectionItemResult!=null){
         console.log(this.list)
+        for(var i=0;i<this.list.selfDeductionList.length;i++){
+          this.pointDel=this.pointDel-this.list.selfDeductionList[i].point
+        }
+      
       safetySelfInspectionModItemInfo(this.list).then((res) => {
         if (res.data.code == 200) {
+          if(this.pointDel>=0){
           this.$notify({
             type: "success",
             duration: 2000,
@@ -266,6 +275,9 @@
           id:this.id
         }
           });
+             }else{
+        alert(`扣分不得超过总分${this.point}`)
+      }
         }
       });
       }else{
@@ -290,15 +302,15 @@
         this.form=JSON.parse(JSON.stringify(data));
     },
     addC(){
-       if(this.form.point<=50){
+       if(this.form.point<=this.point){
         for(let i = 0;i<this.list.selfDeductionList.length;i++){
-            if (this.form.id=this.list.selfDeductionList[i].id){
+            if (this.form.id==this.list.selfDeductionList[i].id){
                 this.list.selfDeductionList[i].point = this.form.point
                 this.list.selfDeductionList[i].remark = this.form.remark
             }
         }
         }else{
-                alert("扣分不得超过总分50")
+                alert(`扣分不得超过总分${this.point}`)
               }
       this.dialogVisible = false;
     },
@@ -332,6 +344,8 @@
   width: 100%;
   background-color: white;
   border-radius: 5px;
+   height: 850px;
+  overflow-y:overlay;
 }
 .box-right-content {
   padding: 15px 0;

--
Gitblit v1.9.2