| | |
| | | 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', |
| | |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | <trainPlan-dialog ref="trainPlanDialog" @getList="getList" :typeList="typeList"></trainPlan-dialog> |
| | | <trainPlan-dialog ref="trainPlanDialog" @getList="getList" :typeList="typeList" @addRecord="addNew"></trainPlan-dialog> |
| | | <el-dialog |
| | | title="培训记录" |
| | | :visible.sync="recordDialog" |
| | |
| | | openRecord(){ |
| | | this.recordDialog = true |
| | | }, |
| | | addNew(data){ |
| | | this.dataList.unshift(data) |
| | | }, |
| | | handleDelete(index){ |
| | | this.$confirm('此操作将永久删除该条数据, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |