转岗管理-培训记录模板-新增排序/权限

dev-scheduling
ysn 4 weeks ago
parent 2d7d941c61
commit 397cb1813b
  1. 132
      src/views/changeJobManagement/trainingRecordManagement.vue

@ -15,38 +15,80 @@
@size-change="sizeChange" @size-change="sizeChange"
@refresh-change="refreshChange" @refresh-change="refreshChange"
@on-load="onLoad" @on-load="onLoad"
@sort-change="sortChange"
> >
<template #menu-left> <template #menu-left>
<el-button type="primary" @click="handleIssue('all')">批量下发</el-button> <el-button
<el-button type="primary" @click="handleUpload('all')">资料批量上传</el-button> type="primary"
<el-button type="primary" @click="handleFinish('all')">培训完成</el-button> @click="handleIssue('all')"
v-if="permissionList.batchDistributionBtn"
>
批量下发
</el-button>
<el-button
type="primary"
@click="handleUpload('all')"
v-if="permissionList.batchUploadOfMaterialsBtn"
>
资料批量上传
</el-button>
<el-button
type="primary"
@click="handleFinish('all')"
v-if="permissionList.trainingCompletedBtn"
>
培训完成
</el-button>
<el-button
type="primary"
@click="handleDetail('all')"
v-if="permissionList.trainingDetailsBtn"
>
培训详情
</el-button>
</template> </template>
<template #menu="scope"> <template #menu="scope">
<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 == 1 && permissionList.editBtn"
@click="handleUpdate(scope.row)"
> >
修改
</el-button>
<el-button <el-button
type="text" type="text"
v-if="scope.row.caStatus == 3 || scope.row.caStatus == 4 || scope.row.caStatus == 5|| scope.row.caStatus == 6" v-if="
(scope.row.caStatus == 3 ||
scope.row.caStatus == 4 ||
scope.row.caStatus == 5 ||
scope.row.caStatus == 6) &&
permissionList.trainingDetailsBtn
"
@click="handleDetail(scope.row)" @click="handleDetail(scope.row)"
>培训详情</el-button
> >
<el-button type="text" v-if="scope.row.caStatus == 2" @click="handleIssue('one', scope.row)" 培训详情
>下发</el-button </el-button>
<el-button
type="text"
v-if="scope.row.caStatus == 2 && permissionList.batchDistributionBtn"
@click="handleIssue('one', scope.row)"
> >
下发
</el-button>
<el-button <el-button
type="text" type="text"
v-if="scope.row.caStatus == 3" v-if="scope.row.caStatus == 3 && permissionList.batchUploadOfMaterialsBtn"
@click="handleUpload('one', scope.row)" @click="handleUpload('one', scope.row)"
>资料上传</el-button
> >
资料上传
</el-button>
<el-button <el-button
type="text" type="text"
v-if="scope.row.caStatus == 5" v-if="scope.row.caStatus == 5 && permissionList.trainingCompletedBtn"
@click="handleFinish('one', scope.row)" @click="handleFinish('one', scope.row)"
>完成</el-button
> >
完成
</el-button>
</template> </template>
<template #distributeTime="scope"> <template #distributeTime="scope">
{{ scope.row.distributeTime ? scope.row.distributeTime.substring(0, 10) : '' }} {{ scope.row.distributeTime ? scope.row.distributeTime.substring(0, 10) : '' }}
@ -65,7 +107,7 @@
</avue-form> </avue-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="fileDialog=false"> </el-button> <el-button @click="fileDialog = false"> </el-button>
<el-button type="primary" @click="submitUpload()"> </el-button> <el-button type="primary" @click="submitUpload()"> </el-button>
</span> </span>
</template> </template>
@ -78,7 +120,12 @@
<el-table-column align="center" label="资料"> <el-table-column align="center" label="资料">
<template #default="scope"> <template #default="scope">
<!-- attachLink --> <!-- attachLink -->
<el-button v-if="scope.row.attachLink!=''||scope.row.attachLink!=null" type="text" @click="downloadFile(scope.row)">资料下载</el-button> <el-button
v-if="scope.row.attachLink != '' || scope.row.attachLink != null"
type="text"
@click="downloadFile(scope.row)"
>资料下载</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -141,6 +188,7 @@ import {
} from '@/api/workLicense/trainingRecordManagement'; } from '@/api/workLicense/trainingRecordManagement';
import { getPlanList } from '@/api/workLicense/jobTransferManagement'; import { getPlanList } from '@/api/workLicense/jobTransferManagement';
import { getUserList } from '@/api/workLicense/workLicense'; import { getUserList } from '@/api/workLicense/workLicense';
import { mapGetters } from 'vuex';
export default { export default {
data() { data() {
@ -163,6 +211,7 @@ export default {
currentPage: 1, currentPage: 1,
total: 0, total: 0,
}, },
query: {},
fileDialog: false, fileDialog: false,
fileForm: {}, fileForm: {},
fileOption: { fileOption: {
@ -238,6 +287,7 @@ export default {
labelWidth: 140, labelWidth: 140,
overflow: true, overflow: true,
search: true, search: true,
sortable: 'custom',
}, },
{ {
label: '工号', label: '工号',
@ -246,6 +296,7 @@ export default {
labelWidth: 140, labelWidth: 140,
overflow: true, overflow: true,
search: true, search: true,
sortable: 'custom',
}, },
{ {
label: '用工类型', label: '用工类型',
@ -254,6 +305,7 @@ export default {
span: 8, span: 8,
labelWidth: 150, labelWidth: 150,
search: false, search: false,
sortable: 'custom',
width: 200, width: 200,
editDisplay: false, editDisplay: false,
rules: [ rules: [
@ -276,6 +328,7 @@ export default {
labelWidth: 140, labelWidth: 140,
overflow: true, overflow: true,
search: true, search: true,
// sortable: 'custom',
}, },
{ {
label: '培训周期(天)', label: '培训周期(天)',
@ -284,6 +337,7 @@ export default {
labelWidth: 140, labelWidth: 140,
overflow: true, overflow: true,
search: false, search: false,
sortable: 'custom',
}, },
{ {
label: '预警周期(天)', label: '预警周期(天)',
@ -292,6 +346,7 @@ export default {
labelWidth: 140, labelWidth: 140,
overflow: true, overflow: true,
search: false, search: false,
sortable: 'custom',
}, },
{ {
label: '培训计划', label: '培训计划',
@ -300,6 +355,7 @@ export default {
labelWidth: 140, labelWidth: 140,
overflow: true, overflow: true,
search: false, search: false,
sortable: 'custom',
}, },
{ {
label: '培训师', label: '培训师',
@ -308,6 +364,7 @@ export default {
labelWidth: 140, labelWidth: 140,
overflow: true, overflow: true,
search: false, search: false,
// sortable: 'custom',
}, },
{ {
label: '培训时间', label: '培训时间',
@ -322,6 +379,7 @@ export default {
labelWidth: 140, labelWidth: 140,
overflow: true, overflow: true,
search: false, search: false,
sortable: 'custom',
}, },
{ {
label: '状态', label: '状态',
@ -331,6 +389,7 @@ export default {
labelWidth: 140, labelWidth: 140,
overflow: true, overflow: true,
search: true, search: true,
// sortable: 'custom',
dicUrl: '/blade-system/dict/dictionary?code=training_ecord_tatus', dicUrl: '/blade-system/dict/dictionary?code=training_ecord_tatus',
props: { props: {
label: 'dictValue', label: 'dictValue',
@ -341,9 +400,33 @@ export default {
}, },
uploadInfo: {}, uploadInfo: {},
rowData: {}, rowData: {},
attachLink:'' attachLink: '',
}; };
}, },
computed: {
...mapGetters(['permission']),
permissionList() {
return {
batchDistributionBtn: this.validData(
this.permission.trainingRecordManagement_batchDistribution,
false
),
editBtn: this.validData(this.permission.trainingRecordManagement_edit, false),
batchUploadOfMaterialsBtn: this.validData(
this.permission.trainingRecordManagement_batchUploadOfMaterials,
false
),
trainingCompletedBtn: this.validData(
this.permission.trainingRecordManagement_trainingCompleted,
false
),
trainingDetailsBtn: this.validData(
this.permission.trainingRecordManagement_trainingDetails,
false
),
};
},
},
mounted() { mounted() {
this.getPlanList(); this.getPlanList();
this.getUserList(); this.getUserList();
@ -393,6 +476,15 @@ export default {
refreshChange() { refreshChange() {
this.onLoad(this.page, this.query); this.onLoad(this.page, this.query);
}, },
//
sortChange({ prop, order }) {
this.query.descs = undefined;
this.query.ascs = undefined;
let orderByFieldKey = order === 'descending' ? 'descs' : 'ascs';
this.query[orderByFieldKey] = prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase();
//
this.onLoad(this.page, this.query);
},
searchReset() { searchReset() {
this.query = {}; this.query = {};
this.onLoad(this.page, this.query); this.onLoad(this.page, this.query);
@ -492,10 +584,10 @@ export default {
}, },
// //
submitUpload() { submitUpload() {
console.log(this.fileForm,this.attachLink , 'fileForm'); console.log(this.fileForm, this.attachLink, 'fileForm');
if (this.selectionList.length > 0) { if (this.selectionList.length > 0) {
this.selectionList.forEach(item => { this.selectionList.forEach(item => {
item.attachLink = this.attachLink ; item.attachLink = this.attachLink;
}); });
uploadMaterials(this.selectionList).then(res => { uploadMaterials(this.selectionList).then(res => {
this.$message.success('上传成功'); this.$message.success('上传成功');
@ -505,7 +597,7 @@ export default {
}); });
} else { } else {
this.uploadInfo.forEach(item => { this.uploadInfo.forEach(item => {
this.fileForm.attachLink = this.attachLink ; this.fileForm.attachLink = this.attachLink;
}); });
uploadMaterials(this.uploadInfo).then(res => { uploadMaterials(this.uploadInfo).then(res => {
this.$message.success('上传成功'); this.$message.success('上传成功');

Loading…
Cancel
Save