| | |
| | | async submit(){ |
| | | this.$refs["ruleForm"].validate(async(valid) =>{ |
| | | if(valid) { |
| | | await this.submitUpload() |
| | | if(this.title == '新增计划'){ |
| | | const {id,...data} = this.form |
| | | const res= await addViolation(data) |
| | | if(res.code == 200){ |
| | | this.$message({ |
| | | type:'success', |
| | | message: res.msg |
| | | }) |
| | | this.fileList = [] |
| | | this.open = false |
| | | this.$emit('getList') |
| | | // const {id,...data} = this.form |
| | | // const res= await addViolation(data) |
| | | // if(res.code == 200){ |
| | | // this.$message({ |
| | | // type:'success', |
| | | // message: res.msg |
| | | // }) |
| | | // this.fileList = [] |
| | | // this.open = false |
| | | // this.$emit('getList') |
| | | // }else{ |
| | | // this.$message({ |
| | | // type:'warning', |
| | | // message: res.msg |
| | | // }) |
| | | // } |
| | | this.form['info'] = '--' |
| | | this.form['startTime'] = '2024-02-24' |
| | | this.form['endTime'] ='2024-03-05' |
| | | this.form['sheet'] = '19' |
| | | this.form['num'] ='19' |
| | | this.form['passNum'] = '19' |
| | | this.$emit('addRecord',this.form) |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message: res.msg |
| | | }) |
| | | // const res= await editViolation(this.form) |
| | | // if(res.code == 200){ |
| | | // this.$message({ |
| | | // type:'success', |
| | | // message: res.msg |
| | | // }) |
| | | // this.fileList = [] |
| | | // this.open = false |
| | | // this.$emit('getList') |
| | | // }else{ |
| | | // this.$message({ |
| | | // type:'warning', |
| | | // message: res.msg |
| | | // }) |
| | | // } |
| | | } |
| | | }else{ |
| | | const res= await editViolation(this.form) |
| | | if(res.code == 200){ |
| | | this.$message({ |
| | | type:'success', |
| | | message: res.msg |
| | | }) |
| | | this.fileList = [] |
| | | this.open = false |
| | | this.$emit('getList') |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message: res.msg |
| | | }) |
| | | } |
| | | } |
| | | this.handleClose() |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |