培训记录管理问题修改

dev-scheduling
zhangdi 3 months ago
parent 291dfd421b
commit 4480524df0
  1. 124
      src/views/changeJobManagement/trainingRecordManagement.vue

@ -24,9 +24,9 @@
</template>
<template #menu="scope">
<!-- <el-button type="text" v-if="scope.row.caStatus == 1" @click="handleDetail(scope.row)"
<el-button type="text" v-if="scope.row.caStatus == 1" @click="handleUpdate(scope.row)"
>修改</el-button
> -->
>
<el-button
type="text"
v-if="scope.row.caStatus == 3 || scope.row.caStatus == 4 || scope.row.caStatus == 5"
@ -51,6 +51,7 @@
</template>
</avue-crud>
<!-- 资料上传 -->
<el-dialog title="资料上传" append-to-body v-model="fileDialog" width="555px" v-if="fileDialog">
<avue-form :option="fileOption" v-model="fileForm" :upload-after="uploadAfter"> </avue-form>
<template #footer>
@ -73,6 +74,48 @@
</el-table-column>
</el-table>
</el-dialog>
<!-- 培训计划 -->
<el-dialog title="培训计划" append-to-body v-model="planOpen" width="450px" v-if="planOpen">
<el-form
ref="form"
:model="formModel"
label-width="80px"
:rules="formRules"
class="vd-form-row"
>
<el-form-item label="培训模板" prop="trainingPlanId">
<el-select v-model="formModel.trainingPlanId" placeholder="请选择培训模板">
<el-option
v-for="item in jttpArr"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="培训师" prop="teacherId">
<!-- multiple -->
<el-select
v-model="formModel.teacherId"
placeholder="请输入培训师"
@change="changeTeacher"
>
<el-option
v-for="item in teacherArr"
:key="item.id"
:label="item.realName"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="planOpen = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</template>
</el-dialog>
</basic-container>
</template>
@ -84,11 +127,23 @@ import {
update,
issued,
trainingCompleted,
uploadMaterials
uploadMaterials,
configured,
} from '@/api/workLicense/trainingRecordManagement';
import { getPlanList } from '@/api/workLicense/jobTransferManagement';
import { getUserList } from '@/api/workLicense/workLicense';
export default {
data() {
return {
jttpArr: [],
teacherArr: [],
formModel: {},
planOpen: false,
formRules: {
trainingPlanId: [{ required: true, message: '请选择培训模板', trigger: 'blur' }],
teacherId: [{ required: true, trigger: 'blur', message: '请输入培训师' }],
},
loading: false,
data: [],
form: {},
@ -153,7 +208,6 @@ export default {
searchShowBtn: false,
showOverflowTooltip: true,
searchLabelPosition: 'left',
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
menuAlign: 'left',
@ -172,6 +226,7 @@ export default {
labelWidth: 140,
overflow: true,
search: true,
searchLabelWidth: 50,
},
{
label: '工号',
@ -180,6 +235,7 @@ export default {
labelWidth: 140,
overflow: true,
search: true,
searchLabelWidth: 50,
},
{
label: '用工类型',
@ -273,11 +329,53 @@ export default {
},
],
},
uploadInfo:{},
uploadInfo: {},
rowData: {},
};
},
mounted() {},
mounted() {
this.getPlanList()
this.getUserList()
},
methods: {
//
handleUpdate(row) {
this.rowData = row;
this.planOpen = true;
},
getPlanList() {
getPlanList().then(res => {
this.jttpArr = res.data.data.records;
});
},
getUserList() {
getUserList({ size: 999999, current: 1 }).then(res => {
this.teacherArr = res.data.data.records;
});
},
//
changeTeacher(val) {
let select = this.teacherArr.find(e => e.id == val);
this.formModel.teacherName = select.realName;
},
// /
submit() {
this.$refs.form.validate(valid => {
if (valid) {
const obj = {
id: this.rowData.id, //
teacherId: this.formModel.teacherId, //id
teacherName: this.formModel.teacherName, //
planId: this.formModel.trainingPlanId, //
};
configured(obj).then(res => {
this.$message.success('操作成功');
this.planOpen = false;
this.onLoad(this.page, this.query);
});
}
});
},
searchReset() {
this.query = {};
this.onLoad(this.page, this.query);
@ -353,12 +451,12 @@ export default {
if (tmp) {
this.$message.error('请选择状态为培训中的数据');
} else {
this.uploadInfo = this.selectionList
this.uploadInfo = this.selectionList;
this.fileDialog = true;
}
}
} else {
this.uploadInfo = [row]
this.uploadInfo = [row];
this.fileDialog = true;
}
},
@ -367,21 +465,21 @@ export default {
console.log(this.fileForm, 'fileForm');
if (this.selectionList.length > 0) {
this.selectionList.forEach(item => {
item.attachLink = ''
item.attachLink = '';
});
uploadMaterials( this.selectionList).then(res => {
uploadMaterials(this.selectionList).then(res => {
this.$message.success('上传成功');
this.fileDialog = false
this.fileDialog = false;
this.onLoad(this.page, this.query);
});
} else {
this.uploadInfo.forEach(item => {
this.fileForm.attachLink='';
this.fileForm.attachLink = '';
});
uploadMaterials(this.uploadInfo).then(res => {
this.$message.success('上传成功');
this.fileDialog = false
this.fileDialog = false;
this.onLoad(this.page, this.query);
});
}

Loading…
Cancel
Save