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

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

@ -15,38 +15,80 @@
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
@sort-change="sortChange"
>
<template #menu-left>
<el-button type="primary" @click="handleIssue('all')">批量下发</el-button>
<el-button type="primary" @click="handleUpload('all')">资料批量上传</el-button>
<el-button type="primary" @click="handleFinish('all')">培训完成</el-button>
<el-button
type="primary"
@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 #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
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)"
>培训详情</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
type="text"
v-if="scope.row.caStatus == 3"
v-if="scope.row.caStatus == 3 && permissionList.batchUploadOfMaterialsBtn"
@click="handleUpload('one', scope.row)"
>资料上传</el-button
>
资料上传
</el-button>
<el-button
type="text"
v-if="scope.row.caStatus == 5"
v-if="scope.row.caStatus == 5 && permissionList.trainingCompletedBtn"
@click="handleFinish('one', scope.row)"
>完成</el-button
>
完成
</el-button>
</template>
<template #distributeTime="scope">
{{ scope.row.distributeTime ? scope.row.distributeTime.substring(0, 10) : '' }}
@ -65,7 +107,7 @@
</avue-form>
<template #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>
</span>
</template>
@ -78,7 +120,12 @@
<el-table-column align="center" label="资料">
<template #default="scope">
<!-- 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>
</el-table-column>
</el-table>
@ -141,6 +188,7 @@ import {
} from '@/api/workLicense/trainingRecordManagement';
import { getPlanList } from '@/api/workLicense/jobTransferManagement';
import { getUserList } from '@/api/workLicense/workLicense';
import { mapGetters } from 'vuex';
export default {
data() {
@ -163,6 +211,7 @@ export default {
currentPage: 1,
total: 0,
},
query: {},
fileDialog: false,
fileForm: {},
fileOption: {
@ -238,6 +287,7 @@ export default {
labelWidth: 140,
overflow: true,
search: true,
sortable: 'custom',
},
{
label: '工号',
@ -246,6 +296,7 @@ export default {
labelWidth: 140,
overflow: true,
search: true,
sortable: 'custom',
},
{
label: '用工类型',
@ -254,6 +305,7 @@ export default {
span: 8,
labelWidth: 150,
search: false,
sortable: 'custom',
width: 200,
editDisplay: false,
rules: [
@ -276,6 +328,7 @@ export default {
labelWidth: 140,
overflow: true,
search: true,
// sortable: 'custom',
},
{
label: '培训周期(天)',
@ -284,6 +337,7 @@ export default {
labelWidth: 140,
overflow: true,
search: false,
sortable: 'custom',
},
{
label: '预警周期(天)',
@ -292,6 +346,7 @@ export default {
labelWidth: 140,
overflow: true,
search: false,
sortable: 'custom',
},
{
label: '培训计划',
@ -300,6 +355,7 @@ export default {
labelWidth: 140,
overflow: true,
search: false,
sortable: 'custom',
},
{
label: '培训师',
@ -308,6 +364,7 @@ export default {
labelWidth: 140,
overflow: true,
search: false,
// sortable: 'custom',
},
{
label: '培训时间',
@ -322,6 +379,7 @@ export default {
labelWidth: 140,
overflow: true,
search: false,
sortable: 'custom',
},
{
label: '状态',
@ -331,6 +389,7 @@ export default {
labelWidth: 140,
overflow: true,
search: true,
// sortable: 'custom',
dicUrl: '/blade-system/dict/dictionary?code=training_ecord_tatus',
props: {
label: 'dictValue',
@ -341,15 +400,39 @@ export default {
},
uploadInfo: {},
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() {
this.getPlanList();
this.getUserList();
},
methods: {
downloadFile(link) {
downloadFile(link) {
window.open(link);
},
//
@ -393,6 +476,15 @@ export default {
refreshChange() {
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() {
this.query = {};
this.onLoad(this.page, this.query);
@ -460,7 +552,7 @@ export default {
},
uploadAfter(res, done, loading, column) {
console.log('uploadAfter', res, done, loading, column);
this.attachLink = res.link;
this.attachLink = res.link;
// this.fileForm.excelFile = [res.link];
// done();
},
@ -492,10 +584,10 @@ export default {
},
//
submitUpload() {
console.log(this.fileForm,this.attachLink , 'fileForm');
console.log(this.fileForm, this.attachLink, 'fileForm');
if (this.selectionList.length > 0) {
this.selectionList.forEach(item => {
item.attachLink = this.attachLink ;
item.attachLink = this.attachLink;
});
uploadMaterials(this.selectionList).then(res => {
this.$message.success('上传成功');
@ -505,7 +597,7 @@ export default {
});
} else {
this.uploadInfo.forEach(item => {
this.fileForm.attachLink = this.attachLink ;
this.fileForm.attachLink = this.attachLink;
});
uploadMaterials(this.uploadInfo).then(res => {
this.$message.success('上传成功');

Loading…
Cancel
Save