| | |
| | | id: "", |
| | | form: {}, |
| | | list: {}, |
| | | point:"", |
| | | pointDel:"" |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | 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, |
| | |
| | | id:this.id |
| | | } |
| | | }); |
| | | }else{ |
| | | alert(`扣分不得超过总分${this.point}`) |
| | | } |
| | | } |
| | | }); |
| | | }else{ |
| | |
| | | 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){ |
| | | this.list.selfDeductionList[i].point = this.form.point |
| | |
| | | } |
| | | } |
| | | }else{ |
| | | alert("扣分不得超过总分50") |
| | | alert(`扣分不得超过总分${this.point}`) |
| | | } |
| | | this.dialogVisible = false; |
| | | }, |