中航光电热表web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

678 lines
18 KiB

6 months ago
<template>
<basic-container>
<!-- 培训记录管理 -->
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
v-model="form"
v-model:page="page"
ref="crud"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
>
6 months ago
<template #menu-left>
<el-button type="primary" icon="el-icon-document-add" @click="handleIssue('all')"
>批量下发</el-button
>
<el-button type="primary" icon="el-icon-upload" @click="handleUpload('all')"
>资料批量上传</el-button
>
<el-button
type="primary"
icon="el-icon-document-checked"
@click="handleFinish('all')"
>培训完成</el-button
>
6 months ago
</template>
<template #menu="scope">
<el-button
type="text"
v-if="
scope.row.jduStatus == 3 ||
scope.row.jduStatus == 4 ||
scope.row.jduStatus == 5
"
@click="handleDetail(scope.row)"
>培训详情</el-button
>
<el-button type="text" v-if="scope.row.jduStatus == 1" @click="handleIssue('one')"
>下发</el-button
>
<el-button
type="text"
v-if="scope.row.jduStatus == 2"
@click="handleUpload('one')"
>资料上传</el-button
>
<el-button
type="text"
v-if="scope.row.jduStatus == 4"
@click="handleFinish('one')"
>完成</el-button
>
6 months ago
<!-- <el-button type="text" v-if="scope.row.jduStatus == 4 || scope.row.jduStatus == 5" @click="handleDownload('one')">附件下载</el-button> -->
</template>
<template #userName="{ row }">{{
row.jtCultivateDetail.jtPostHandle.personnel.userName
}}</template>
<template #userCode="{ row }">{{
row.jtCultivateDetail.jtPostHandle.personnel.userCode
}}</template>
<template #staffTypeTitle="{ row }">{{
row.jtCultivateDetail.jtPostHandle.staffTypeTitle
}}</template>
6 months ago
<template #typeTitle="{ row }">{{ row.jtCultivateDetail.typeTitle }}</template>
<template #cycle="{ row }">{{ row.jtCultivateDetail.plan.cycle }}</template>
<template #earlyWarningDay="{ row }">{{
row.jtCultivateDetail.plan.earlyWarningDay
}}</template>
6 months ago
<template #name="{ row }">{{ row.jtCultivateDetail.plan.name }}</template>
<template #teacherName="{ row }">{{ row.teacher.userName }}</template>
</avue-crud>
<el-dialog title="资料上传" append-to-body v-model="fileDialog" width="555px">
<avue-form :option="fileOption" v-model="fileForm" :upload-after="uploadAfter">
</avue-form>
<!-- <template #footer>
<span class="dialog-footer">
<el-button @click="settingDialog = false"> </el-button>
<el-button type="primary" @click="submitCycle"> </el-button>
</span>
</template> -->
</el-dialog>
6 months ago
<el-dialog title="培训详情" append-to-body v-model="detailDialog">
6 months ago
<el-table :data="detailData">
<el-table-column
align="center"
label="培训师"
prop="teacher.userName"
></el-table-column>
<el-table-column
align="center"
label="完成时间"
prop="updateTime"
></el-table-column>
<el-table-column
align="center"
label="状态"
prop="jduStatusTitle"
></el-table-column>
6 months ago
<el-table-column align="center" label="资料">
6 months ago
<template #default="scope">
<el-button type="primary">资料下载</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
</basic-container>
</template>
<script>
export default {
data() {
return {
loading: false,
data: [],
form: {},
6 months ago
detailDialog: false,
6 months ago
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
fileDialog: false,
fileForm: {},
fileOption: {
submitBtn: false,
emptyBtn: false,
column: [
{
label: "资料上传",
prop: "excelFile",
type: "upload",
6 months ago
drag: true,
loadText: "附件上传中,请稍等",
6 months ago
span: 24,
propsHttp: {
res: "data",
6 months ago
},
tip: "不能上传 附件,且不超过 10M",
action: "/blade-system/user/import-user",
6 months ago
},
],
6 months ago
},
option: {
columnSort: true,
tip: false,
height: "auto",
align: "center",
6 months ago
calcHeight: 32,
simplePage: false,
searchShow: true,
searchMenuSpan: 6,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: false,
selection: true,
viewBtn: false,
delBtn: false,
editBtn: false,
editBtnText: "修改",
editBtnIcon: " ",
delBtnIcon: " ",
6 months ago
addBtn: false,
labelWidth: 120,
searchLabelWidth: 120,
menu: true,
menuWidth: 200,
dialogWidth: 600,
dialogClickModal: false,
searchEnter: true,
excelBtn: true,
gridBtn: false,
searchShowBtn: false,
showOverflowTooltip: true,
searchLabelPosition: "left",
searchLabelPosition: "left",
6 months ago
searchGutter: 24,
searchSpan: 6,
menuAlign: "left",
6 months ago
gridBtn: false,
searchMenuPosition: "right",
addBtnIcon: " ",
viewBtnIcon: " ",
delBtnIcon: " ",
editBtnIcon: " ",
6 months ago
column: [
{
label: "姓名",
prop: "userName",
6 months ago
span: 24,
labelWidth: 140,
overflow: true,
search: true,
rules: [
{
required: true,
message: "请输入姓名",
trigger: "blur",
6 months ago
},
],
},
{
label: "工号",
prop: "userCode",
6 months ago
span: 24,
labelWidth: 140,
overflow: true,
search: true,
rules: [
{
required: true,
message: "请输入工号",
trigger: "blur",
6 months ago
},
],
},
{
label: "用工类型",
prop: "staffTypeTitle",
type: "select",
6 months ago
span: 24,
labelWidth: 140,
overflow: true,
search: true,
dicData: [
{
value: 1,
label: "实习工",
},
{
6 months ago
value: 2,
label: "正式工",
},
6 months ago
],
rules: [
{
required: true,
message: "请输入用工类型",
trigger: "blur",
6 months ago
},
],
},
{
label: "培训类型",
prop: "typeTitle",
type: "select",
6 months ago
span: 24,
labelWidth: 140,
overflow: true,
search: true,
dicData: [
{
value: 1,
label: "实习",
},
{
6 months ago
value: 2,
label: "转岗",
},
{
6 months ago
value: 3,
label: "下岗",
},
6 months ago
],
rules: [
{
required: true,
message: "请输入培训类型",
trigger: "blur",
6 months ago
},
],
},
{
label: "培训周期(天)",
prop: "cycle",
6 months ago
span: 24,
labelWidth: 140,
overflow: true,
search: true,
rules: [
{
required: true,
message: "请输入培训周期(天)",
trigger: "blur",
6 months ago
},
],
},
{
label: "预警周期(天)",
prop: "earlyWarningDay",
6 months ago
span: 24,
labelWidth: 140,
overflow: true,
search: true,
rules: [
{
required: true,
message: "请输入预警周期(天)",
trigger: "blur",
6 months ago
},
],
},
{
label: "培训计划",
prop: "name",
type: "select",
6 months ago
span: 24,
labelWidth: 140,
overflow: true,
search: true,
rules: [
{
required: true,
message: "请输入培训计划",
trigger: "blur",
6 months ago
},
],
dicData: [
{ label: "计划一", value: "1" },
{ label: "计划二", value: "2" },
],
6 months ago
},
{
label: "培训师",
prop: "teacherName",
type: "select",
6 months ago
span: 24,
labelWidth: 140,
overflow: true,
search: true,
rules: [
{
required: true,
message: "请输入培训师",
trigger: "blur",
6 months ago
},
],
props: {
label: "userName",
value: "userCode",
6 months ago
},
dicData: [
{
jobName: "生产调度员",
deptName: "外协业务交付管理室",
ldapName: "00188",
userSex: 0,
deptId: 65,
mobile: null,
userName: "00188",
userId: 441,
userCode: "00188",
},
{
jobName: "表面处理工",
deptName: "复合镍班",
ldapName: "00460",
userSex: 1,
deptId: 69,
mobile: null,
userName: "00460",
userId: 224,
userCode: "00460",
},
{
jobName: "保管员",
deptName: "零件管理班",
ldapName: "00660",
userSex: 0,
deptId: 46,
mobile: null,
userName: "00660",
userId: 322,
userCode: "00660",
6 months ago
},
],
6 months ago
},
{
label: "培训时间",
prop: "createTime",
type: "date",
6 months ago
searchRange: true,
startPlaceholder: "开始时间",
6 months ago
endPlaceholder: "结束时间",
6 months ago
span: 24,
labelWidth: 140,
overflow: true,
search: true,
rules: [
{
required: true,
message: "请输入培训时间",
trigger: "blur",
6 months ago
},
],
},
{
label: "状态",
prop: "jduStatusTitle",
type: "select",
6 months ago
span: 24,
labelWidth: 140,
overflow: true,
search: true,
rules: [
{
required: true,
message: "请输入状态",
trigger: "blur",
6 months ago
},
],
dicData: [
{ label: "待下发", value: "1" },
{ label: "培训中", value: "2" },
{ label: "已超期", value: "3" },
{ label: "待确认", value: "4" },
{ label: "已完成", value: "5" },
],
6 months ago
},
],
},
};
6 months ago
},
mounted() {},
6 months ago
methods: {
selectionChange(val) {
this.selectionList = val;
6 months ago
},
// 培训详情
6 months ago
handleDetail() {
this.detailDialog = true;
6 months ago
},
// 批量下发
handleIssue(type) {
if (type == "all") {
6 months ago
if (this.selectionList.length == 0) {
this.$message.error("请至少选择一条数据");
6 months ago
} else {
let tmp = this.selectionList.find((item) => item.jduStatus != 1);
6 months ago
if (tmp) {
this.$message.error("请选择状态为待下发的数据");
6 months ago
} else {
this.$confirm("确定下发?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {});
6 months ago
}
}
} else {
this.$confirm("确定下发?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {});
6 months ago
}
},
// 批量上传
handleUpload(type) {
if (type == "all") {
6 months ago
if (this.selectionList.length == 0) {
this.$message.error("请至少选择一条数据");
6 months ago
} else {
let tmp = this.selectionList.find((item) => item.jduStatus != 2);
6 months ago
if (tmp) {
this.$message.error("请选择状态为培训中的数据");
6 months ago
} else {
this.fileDialog = true;
6 months ago
}
}
} else {
this.fileDialog = true;
6 months ago
}
},
handleDownload() {},
6 months ago
// 培训完成
handleFinish(type) {
if (type == "all") {
6 months ago
if (this.selectionList.length == 0) {
this.$message.error("请至少选择一条数据");
6 months ago
} else {
let tmp = this.selectionList.find((item) => item.jduStatus != 4);
6 months ago
if (tmp) {
this.$message.error("请选择状态为待确认的数据");
6 months ago
} else {
this.$confirm("确定培训完成?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {});
6 months ago
}
}
} else {
this.$confirm("确定培训完成?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {});
6 months ago
}
},
onLoad() {
this.data = [
{
id: 1,
jtCultivateDetail: {
jtPostHandle: {
personnel: {
userName: "李四",
userCode: "001",
6 months ago
},
staffType: 1,
staffTypeTitle: "实习工",
6 months ago
},
typeTitle: "实习",
6 months ago
type: 1,
plan: {
cycle: 7,
earlyWarningDay: 3,
name: "计划一",
},
6 months ago
},
teacher: {
userName: "王五",
6 months ago
},
createTime: "2025-10-25",
jduStatus: "1",
jduStatusTitle: "待下发",
6 months ago
},
{
id: 2,
jtCultivateDetail: {
jtPostHandle: {
personnel: {
userName: "张三",
userCode: "002",
6 months ago
},
staffType: 1,
staffTypeTitle: "实习工",
6 months ago
},
typeTitle: "实习",
6 months ago
type: 1,
plan: {
cycle: 7,
earlyWarningDay: 3,
name: "计划一",
},
6 months ago
},
teacher: {
userName: "王五",
6 months ago
},
createTime: "2025-10-25",
jduStatus: "1",
jduStatusTitle: "待下发",
6 months ago
},
{
id: 3,
jtCultivateDetail: {
jtPostHandle: {
personnel: {
userName: "李明",
userCode: "002",
6 months ago
},
staffType: 1,
staffTypeTitle: "实习工",
6 months ago
},
typeTitle: "实习",
6 months ago
type: 1,
plan: {
cycle: 7,
earlyWarningDay: 3,
name: "计划一",
},
6 months ago
},
teacher: {
userName: "王五",
6 months ago
},
createTime: "2025-10-21",
jduStatus: "2",
jduStatusTitle: "培训中",
6 months ago
},
{
id: 4,
jtCultivateDetail: {
jtPostHandle: {
personnel: {
userName: "张勇",
userCode: "002",
6 months ago
},
staffType: 1,
staffTypeTitle: "实习工",
6 months ago
},
typeTitle: "实习",
6 months ago
type: 1,
plan: {
cycle: 7,
earlyWarningDay: 3,
name: "计划一",
},
6 months ago
},
teacher: {
userName: "王五",
6 months ago
},
createTime: "2025-10-14",
jduStatus: "3",
jduStatusTitle: "已超期",
6 months ago
},
{
id: 5,
jtCultivateDetail: {
jtPostHandle: {
personnel: {
userName: "王红",
userCode: "002",
6 months ago
},
staffType: 1,
staffTypeTitle: "实习工",
6 months ago
},
typeTitle: "实习",
6 months ago
type: 1,
plan: {
cycle: 7,
earlyWarningDay: 3,
name: "计划一",
},
6 months ago
},
teacher: {
userName: "王五",
6 months ago
},
createTime: "2025-10-21",
jduStatus: "4",
jduStatusTitle: "待确认",
6 months ago
},
{
id: 6,
jtCultivateDetail: {
jtPostHandle: {
personnel: {
userName: "刘丽",
userCode: "002",
6 months ago
},
staffType: 1,
staffTypeTitle: "实习工",
6 months ago
},
typeTitle: "实习",
6 months ago
type: 1,
plan: {
cycle: 7,
earlyWarningDay: 3,
name: "计划一",
},
6 months ago
},
teacher: {
userName: "王五",
6 months ago
},
createTime: "2025-10-15",
jduStatus: "5",
jduStatusTitle: "已完成",
6 months ago
},
];
this.page.total = this.data.length;
6 months ago
},
},
};
6 months ago
</script>
<style></style>