| | |
| | | <template> |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="open" |
| | | append-to-body |
| | | width="50%" |
| | | :before-close="handleClose" |
| | | > |
| | | <el-form ref="ruleForm" :model="form" :rules="rules" label-position="right" label-width="150px" style="padding-right: 50px" element-loading-text="保存中..."> |
| | | <el-dialog :title="title" :visible.sync="open" append-to-body width="50%" :before-close="handleClose">
|
| | | <el-form ref="ruleForm" :model="form" :rules="rules" label-position="right" label-width="150px"
|
| | | style="padding-right: 50px" element-loading-text="保存中...">
|
| | | <el-form-item label="计划名称:" prop="name"> |
| | | <el-input v-model.trim="form.name" :readonly="disable" type="textarea"/> |
| | | </el-form-item> |
| | |
| | | <el-table-column label="上课教师" align="center" prop="teacher" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="!disable"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | style="color: red" |
| | | @click="delClass(scope.$index)" |
| | | >删除</el-button> |
| | | <el-button size="mini" type="text" style="color: red" @click="delClass(scope.$index)">删除</el-button>
|
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-button type="primary" size="mini" @click="addClass" style="margin-top: 20px" v-if="!disable">添加课程</el-button> |
| | | <el-button type="primary" size="mini" @click="addClass" style="margin-top: 20px"
|
| | | v-if="!disable">添加课程</el-button>
|
| | | </el-form-item> |
| | | <el-form-item label="学员管理:" prop="students"> |
| | | <el-table :data="form.students" border> |
| | |
| | | <el-table-column label="实际总学时" align="center" prop="time"/> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | @click="openStudyRecord(scope.row,'view')" |
| | | >查看学时档案</el-button> |
| | | <el-button size="mini" type="text" @click="openStudyRecord(scope.row,'view')">查看学时档案</el-button>
|
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-button type="primary" size="mini" @click="addStudent" style="margin-top: 20px" v-if="!disable">导入报名人员</el-button> |
| | | <el-button type="primary" size="mini" @click="addStudent" style="margin-top: 20px"
|
| | | v-if="!disable">导入报名人员</el-button>
|
| | | </el-form-item> |
| | | <el-form-item label="历史记录(过程追溯):" prop="history"> |
| | | <el-table :data="form.history" border> |
| | |
| | | <el-button v-if="disable == false" type="primary" @click="submit">提交</el-button> |
| | | <el-button v-else type="primary" @click="handleClose">确定</el-button> |
| | | </span> |
| | | <el-dialog |
| | | :title="classTitle" |
| | | :visible.sync="classDialog" |
| | | append-to-body |
| | | width="50%" |
| | | > |
| | | <el-form ref="ruleAddForm" :model="addForm" :rules="addRules" label-position="right" label-width="150px" style="padding-right: 50px" element-loading-text="保存中..."> |
| | | <el-dialog :title="classTitle" :visible.sync="classDialog" append-to-body width="50%">
|
| | | <el-form ref="ruleAddForm" :model="addForm" :rules="addRules" label-position="right" label-width="150px"
|
| | | style="padding-right: 50px" element-loading-text="保存中...">
|
| | | <el-form-item label="课程名称:" prop="name"> |
| | | <el-input v-model.trim="addForm.name"/> |
| | | </el-form-item> |
| | |
| | | <el-button type="primary" @click="confirmAdd">确定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="学时档案" |
| | | :visible.sync="recordDialog" |
| | | append-to-body |
| | | width="50%" |
| | | > |
| | | <el-dialog title="学时档案" :visible.sync="recordDialog" append-to-body width="50%">
|
| | | <el-table :data="record" border> |
| | | <el-table-column label="课程名称" align="center" prop="name" /> |
| | | <el-table-column label="标准学时" align="center" prop="time" /> |
| | |
| | | </template> |
| | | |
| | | <script > |
| | | import {addViolation, editViolation, uploadFile} from "@/api/coalMine/violation"; |
| | | import {verifyIdCard} from "@/utils/validate"; |
| | | import {MessageBox} from "element-ui"; |
| | | import {
|
| | | addViolation,
|
| | | editViolation,
|
| | | uploadFile
|
| | | } from "@/api/coalMine/violation";
|
| | | import {
|
| | | verifyIdCard
|
| | | } from "@/utils/validate";
|
| | | import {
|
| | | MessageBox
|
| | | } from "element-ui";
|
| | | |
| | | export default { |
| | | name: 'trainPlanDialog', |
| | | components: { |
| | | }, |
| | | components: {},
|
| | | props: ['typeList'], |
| | | data() { |
| | | return { |
| | |
| | | cardDep: '', |
| | | classes: [], |
| | | students: [], |
| | | history: [] |
| | | history: [],
|
| | | }, |
| | | rules:{ |
| | | name:[{ required: true, message: '请填写计划名称', trigger: 'blur' }], |
| | | dep: [{ required: true, message: '请填写培训单位', trigger: 'blur' }], |
| | | trainWay: [{ required: true, message: '请选择培训方式', trigger: 'blur' }], |
| | | cardDep: [{ required: true, message: '请填写发证单位', trigger: 'blur' }] |
| | | name: [{
|
| | | required: true,
|
| | | message: '请填写计划名称',
|
| | | trigger: 'blur'
|
| | | }],
|
| | | dep: [{
|
| | | required: true,
|
| | | message: '请填写培训单位',
|
| | | trigger: 'blur'
|
| | | }],
|
| | | trainWay: [{
|
| | | required: true,
|
| | | message: '请选择培训方式',
|
| | | trigger: 'blur'
|
| | | }],
|
| | | cardDep: [{
|
| | | required: true,
|
| | | message: '请填写发证单位',
|
| | | trigger: 'blur'
|
| | | }]
|
| | | }, |
| | | addForm: { |
| | | name: '', |
| | |
| | | teacher: '' |
| | | }, |
| | | addRules: { |
| | | name:[{ required: true, message: '请填写课程名称', trigger: 'blur' }], |
| | | time: [{ required: true, message: '请填写标准学时', trigger: 'blur' }], |
| | | teacher: [{ required: true, message: '请填写上课教师', trigger: 'blur' }], |
| | | name: [{
|
| | | required: true,
|
| | | message: '请填写课程名称',
|
| | | trigger: 'blur'
|
| | | }],
|
| | | time: [{
|
| | | required: true,
|
| | | message: '请填写标准学时',
|
| | | trigger: 'blur'
|
| | | }],
|
| | | teacher: [{
|
| | | required: true,
|
| | | message: '请填写上课教师',
|
| | | trigger: 'blur'
|
| | | }],
|
| | | }, |
| | | record:[ |
| | | { |
| | | name:'--', |
| | |
|
| | | record: [{
|
| | | name: '高处安装、维护、拆除作业',
|
| | | time: '5', |
| | | actualTime:'5' |
| | | }, |
| | | { |
| | | name:'--', |
| | | name: '基础理论',
|
| | | time: '4', |
| | | actualTime:'4' |
| | | } |
| | |
| | | cardDep: '', |
| | | classes: [], |
| | | students: [], |
| | | history: [] |
| | | history: [],
|
| | | } |
| | | }else{ |
| | | if(type == 'view'){ |
| | |
| | | }, |
| | | |
| | | delClass(index){ |
| | | MessageBox.confirm('删除该条信息,是否继续?', '系统提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning' }).then(() => { |
| | | MessageBox.confirm('删除该条信息,是否继续?', '系统提示', {
|
| | | confirmButtonText: '确认',
|
| | | cancelButtonText: '取消',
|
| | | type: 'warning'
|
| | | }).then(() => {
|
| | | this.form.classes.splice(index,1); |
| | | this.$message.success('删除成功') |
| | | }).catch(() => { |
| | |
| | | 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') |
| | | // }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) |
| | | 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{ |
| | | // 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.$message({
|
| | | type: 'warning',
|
| | | message: res.msg
|
| | | })
|
| | | } |
| | | this.handleClose() |
| | | } 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
|
| | | })
|
| | | }
|
| | | }
|
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | |
| | | }, |
| | | } |
| | | } |
| | | |
| | | </script> |
| | | <style scoped> |
| | | |