<!-- 人员培训 -->
|
<template>
|
<div class="flex_column">
|
<div v-if="!editPlanShow && isDepartment && flag">
|
<TableCard title="年度计划表">
|
<template v-slot:form>
|
<div class="items_center">
|
<span>创建人</span>
|
<el-input v-model="pagination.compilerName" class="search" placeholder="请输入" size="mini"></el-input>
|
<el-button size="mini" type="primary" @click="getYearPlanList(departId)">查询</el-button>
|
</div>
|
<div>
|
<el-button size="mini" type="primary" @click="uploadDia = true">导入</el-button>
|
</div>
|
</template>
|
<template v-slot:table>
|
<limsTable :column="yearPlanColumn" :currentChange="currentChange" :height="'28vh'"
|
:table-data="yearPlanTableData" :table-loading="yearLoading" highlightCurrentRow style="padding: 0 15px"
|
:page="pagination" @pagination="paginationMetod">
|
</limsTable>
|
</template>
|
</TableCard>
|
</div>
|
<div v-if="!editPlanShow" class="table">
|
<TableCard title="年度计划明细表">
|
<template v-slot:form>
|
<div class="items_center">
|
<span>培训讲师</span>
|
<el-input v-model="inDetailForm.trainingLecturerName" class="search" clearable placeholder="请输入"
|
size="mini"></el-input>
|
<!-- <span>课程编号</span>
|
<el-input v-model="inDetailForm.courseCode" class="search" clearable placeholder="请输入" size="small"></el-input> -->
|
<span style="margin-right: 4px">培训日期</span>
|
<el-date-picker v-model="inDetailForm.trainingDate" clearable format="yyyy-MM-dd" placeholder="选择日期"
|
size="mini" type="date" value-format="yyyy-MM-dd"></el-date-picker>
|
<el-button size="mini" style="margin-left: 10px" type="primary" @click="searchTable">查询</el-button>
|
</div>
|
<div style="display: flex; align-items: center">
|
<el-button v-if="isDepartment && currentChangeRow && isOperation && flag" size="mini"
|
@click="batchDelete">批量删除</el-button>
|
<el-button v-if="isDepartment && currentChangeRow && isOperation && flag" size="mini" type="primary"
|
@click="addTrainingPlan">新增</el-button>
|
</div>
|
</template>
|
<template v-slot:table>
|
<el-tabs v-model="activeName" style="margin-left: 15px">
|
<el-tab-pane label="未培训" name="first">
|
<limsTable :column="inDetailPlanColumn" :handleSelectionChange="handleSelectionChange" :height="'28vh'"
|
:isSelection="true" :table-data="inDetailPlanTableData" :table-loading="yearLoading"
|
style="padding: 0 15px" :page="inDetailPagination" @pagination="paginationmethod0">
|
</limsTable>
|
</el-tab-pane>
|
<el-tab-pane label="已结束" name="second">
|
<limsTable :column="inDetailPlanColumn" :handleSelectionChange="handleSelectionChange" :height="'28vh'"
|
:isSelection="true" :table-data="inDetailPlanTableData" :table-loading="yearLoading"
|
style="padding: 0 15px" :page="inDetailPagination" @pagination="paginationmethod0">
|
</limsTable>
|
</el-tab-pane>
|
</el-tabs>
|
</template>
|
</TableCard>
|
</div>
|
<Add ref="addPlan" :currshowlist.sync="addInDetail" :currentChangeRow="currentChangeRow"
|
@search="getInDetailPlan(currentRowId, departId)" @searchPlan="refreshYearPlanList(departId2)"></Add>
|
<Edit v-if="editPlanShow" ref="editPlan" :currentRow="currentRow" :key="editKey" @refresh="refresh"
|
@del="getInDetailPlan(currentRowId, departId)" @goBack="goBack"></Edit>
|
<el-dialog :visible.sync="reviewDialog" title="审核" width="30%" @close="reviewRemarks = ''">
|
<span>
|
审核备注:
|
<el-input v-model="reviewRemarks" type="textarea"></el-input>
|
</span>
|
<span slot="footer" class="dialog-footer">
|
<el-button :loading="reviewLoading" @click="handleReview(2)">不通过</el-button>
|
<el-button :loading="reviewLoading" type="primary" @click="handleReview(1)">通 过</el-button>
|
</span>
|
</el-dialog>
|
<el-dialog :visible.sync="approvalDialog" title="批准" width="30%" @close="approvalRemarks = ''">
|
<span>
|
批准备注:
|
<el-input v-model="approvalRemarks" type="textarea"></el-input>
|
</span>
|
<span slot="footer" class="dialog-footer">
|
<el-button :loading="approvalLoading" @click="handleApproval(2)">不批准</el-button>
|
<el-button :loading="reviewLoading" type="primary" @click="handleApproval(1)">批 准</el-button>
|
</span>
|
</el-dialog>
|
<el-dialog :visible.sync="uploadDia" title="数据导入" width="500px">
|
<div style="margin: 0 auto">
|
<el-upload ref="upload" :action="javaApi + '/personTraining/personTrainingImport'" :auto-upload="false"
|
:before-upload="beforeUpload" :file-list="fileList" :headers="uploadHeader" :limit="1" :on-error="onError"
|
:on-success="onSuccess" accept=".xlsx" drag name="file">
|
<i class="el-icon-upload"></i>
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
</el-upload>
|
</div>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="uploadDia = false">取 消</el-button>
|
<el-button :loading="uploading" type="primary" @click="submitUpload()">上 传</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import TableCard from '@/components/TableCard/index.vue';
|
import limsTable from "@/components/Table/lims-table.vue";
|
import Add from "./AddInDetail.vue";
|
import Edit from "./Edit.vue";
|
import {
|
deleteDetail,
|
personTrainingSelect,
|
queryTheAnnualPlanDetailsTable,
|
personTrainingDelete,
|
reviewAnnualPersonnelTraining,
|
approveAnnualPersonnelTraining,
|
exportPersonTrainingRecord,
|
claimOfTrainingAndAssessmentRecords,
|
exportPersonTraining,
|
deleteAnnualPlanDetailTable,
|
} from '@/api/cnas/personnel/personnelInfo.js'
|
|
export default {
|
name: "PersonnelTraining",
|
components: { Add, limsTable, TableCard, Edit },
|
props: {
|
flag: {
|
type: Boolean,
|
default: false,
|
},
|
departId: {
|
type: Number,
|
default: () => {
|
return null;
|
},
|
},
|
isDepartment: {
|
type: Boolean,
|
default: false,
|
},
|
},
|
data() {
|
return {
|
currentPlanId: null,
|
activeName: "first",
|
addInDetail: false,
|
departId2: null,
|
editKey: 1,
|
search: {},
|
superviseForm: {},
|
inDetailForm: {
|
trainingLecturerName: "",
|
courseCode: "",
|
trainingDate: "",
|
},
|
yearLoading: false,
|
yearPlanTableData: [], // 年度计划表数据
|
yearPlanColumn: [
|
{
|
label: "文件名称",
|
width: "160px",
|
minWidth: "160px",
|
prop: "fileName",
|
showOverflowTooltip: true,
|
},
|
{
|
label: "创建时间",
|
width: "160px",
|
prop: "createTime",
|
},
|
{
|
label: "创建人",
|
prop: "createUserName",
|
},
|
{
|
label: "编制人",
|
prop: "compilerName",
|
},
|
{
|
label: "编制日期",
|
width: "160px",
|
prop: "compilationDate",
|
},
|
{
|
label: "审核人",
|
prop: "reviewerName",
|
minWidth: "100px",
|
},
|
{
|
dataType: "tag",
|
label: "审核状态",
|
prop: "reviewerStatus",
|
width: "100px",
|
formatData: (params) => {
|
if (params == 1) {
|
return "通过";
|
} else if (params == 2) {
|
return "不通过";
|
} else {
|
return null;
|
}
|
},
|
formatType: (params) => {
|
if (params == 1) {
|
return "success";
|
} else if (params == 2) {
|
return "danger";
|
} else {
|
return null;
|
}
|
},
|
},
|
{
|
label: "审核备注",
|
prop: "auditRemarks",
|
minWidth: "100px",
|
},
|
{
|
label: "审核日期",
|
width: "160px",
|
prop: "auditDate",
|
},
|
{
|
label: "批准人",
|
prop: "approverName",
|
minWidth: "100px",
|
},
|
{
|
label: "批准备注",
|
prop: "approvalRemarks",
|
minWidth: "100px",
|
},
|
{
|
dataType: "tag",
|
label: "批准状态",
|
minWidth: "100px",
|
prop: "approvalStatus",
|
formatData: (params) => {
|
if (params == 1) {
|
return "批准";
|
} else if (params == 2) {
|
return "不批准";
|
} else {
|
return null;
|
}
|
},
|
formatType: (params) => {
|
if (params == 1) {
|
return "success";
|
} else if (params == 2) {
|
return "danger";
|
} else {
|
return null;
|
}
|
},
|
},
|
{
|
label: "批准日期",
|
width: "160px",
|
prop: "approvalDate",
|
},
|
{
|
dataType: "action",
|
width: "180px",
|
label: "操作",
|
fixed: "right",
|
operation: [
|
{
|
name: "导出",
|
type: "text",
|
disabled: (row) => {
|
if (row.approvalStatus === 1 && row.reviewerStatus === 1) {
|
return false;
|
} else {
|
return true;
|
}
|
},
|
clickFun: (row) => {
|
this.downLoadPost(row);
|
},
|
},
|
{
|
name: "审核",
|
type: "text",
|
disabled: (row) => {
|
if (row.reviewerStatus === 1 || (row.departId == 18 && row.currentId != 10 && row.currentId != 16) || (row.departId == 19 && row.currentId != 35 && row.currentId != 16)) {
|
return true;
|
} else {
|
return false;
|
}
|
},
|
clickFun: (row) => {
|
this.handleCheck(row.id);
|
},
|
},
|
{
|
name: "批准",
|
type: "text",
|
disabled: (row) => {
|
if (row.approvalStatus === 1 || (row.currentId != 11 && row.currentId != 16)) {
|
return true;
|
} else {
|
return false;
|
}
|
},
|
clickFun: (row) => {
|
this.handleApprove(row.id);
|
},
|
},
|
{
|
name: "删除",
|
type: "text",
|
color: "#f56c6c",
|
clickFun: (row) => {
|
this.deleteFun(row.id);
|
},
|
},
|
],
|
},
|
],
|
inDetailPlanTableData: [], // 年度计划明细表表数据
|
inDetailPlanColumn: [
|
// {
|
// label: '课程编号',
|
// prop: 'courseCode',
|
// width: '130px',
|
// },
|
{
|
dataType: "tag",
|
label: "报名状态",
|
width: "100px",
|
prop: "whetherClaim",
|
isShow: this.flag,
|
formatData: (params) => {
|
if (params === true) {
|
return "已报名";
|
} else {
|
return "未报名";
|
}
|
},
|
formatType: (params) => {
|
if (params === true) {
|
return "success";
|
} else {
|
return "info";
|
}
|
},
|
},
|
{
|
label: "报名人数",
|
prop: "enrollment",
|
width: "100px",
|
isShow: !this.flag,
|
},
|
{
|
label: "培训目标",
|
prop: "trainingObjectives",
|
width: "160px",
|
minWidth: "160px",
|
showOverflowTooltip: true,
|
},
|
{
|
label: "培训内容",
|
prop: "trainingContent",
|
width: "160px",
|
minWidth: "160px",
|
showOverflowTooltip: true,
|
},
|
{
|
label: "培训方式",
|
prop: "trainingMode",
|
width: "140px",
|
minWidth: "140px",
|
showOverflowTooltip: true,
|
},
|
{
|
dataType: "tag",
|
label: "课程状态",
|
width: "100px",
|
prop: "state",
|
formatData: (params) => {
|
if (params == 1) {
|
return "已完成";
|
} else if (params == 2) {
|
return "进行中";
|
} else if (params == 3) {
|
return "未开始";
|
} else if (params == 4) {
|
return "已结束";
|
} else {
|
return null;
|
}
|
},
|
formatType: (params) => {
|
if (params == 1) {
|
return "success";
|
} else if (params == 2) {
|
return "warning";
|
} else if (params == 3) {
|
return "primary";
|
} else if (params == 4) {
|
return "info";
|
} else {
|
return null;
|
}
|
},
|
},
|
{
|
label: "参加对象",
|
prop: "participants",
|
width: "140px",
|
minWidth: "140px",
|
showOverflowTooltip: true,
|
},
|
{
|
label: "举办部门",
|
prop: "holdingDepartmentName",
|
width: "140px",
|
minWidth: "140px",
|
showOverflowTooltip: true,
|
},
|
{
|
label: "培训地点",
|
prop: "placeTraining",
|
width: "160px",
|
minWidth: "160px",
|
showOverflowTooltip: true,
|
},
|
{
|
label: "培训讲师",
|
prop: "trainingLecturerId",
|
width: "120px",
|
minWidth: "120px",
|
showOverflowTooltip: true,
|
},
|
{
|
label: "培训日期",
|
prop: "trainingDateTwo",
|
width: "140px",
|
},
|
{
|
label: "开始时间",
|
prop: "openingTime",
|
width: "120px",
|
},
|
{
|
label: "课时",
|
prop: "classHour",
|
width: "100px",
|
},
|
{
|
label: "备注",
|
prop: "remarks",
|
width: "120px",
|
minWidth: "120px",
|
showOverflowTooltip: true,
|
},
|
{
|
dataType: "action",
|
width: "240",
|
label: "操作",
|
fixed: "right",
|
operation: [
|
// 超过会议开始时间就不能认领了
|
{
|
name: "报名",
|
type: "text",
|
clickFun: (row) => {
|
this.handleClaim(row);
|
},
|
disabled: (row) => {
|
if (
|
row.whetherClaim === true ||
|
row.trainingDateTwo < this.$moment().format("YYYY-MM-DD")
|
) {
|
return true;
|
} else {
|
return false;
|
}
|
},
|
},
|
{
|
name: "结果明细",
|
type: "text",
|
clickFun: (row) => {
|
this.editInDetail(row);
|
},
|
showHide: (row) => {
|
if (row.isDisabled == 1) {
|
return true;
|
} else {
|
return false;
|
}
|
},
|
},
|
{
|
name: "导出",
|
type: "text",
|
clickFun: (row) => {
|
this.downLoadInDetail(row);
|
},
|
},
|
{
|
name: "删除",
|
type: "text",
|
color: "#f56c6c",
|
clickFun: (row) => {
|
this.deleteDetail(row);
|
},
|
showHide: (row) => {
|
if (row.isDisabled == 1) {
|
return true;
|
} else {
|
return false;
|
}
|
},
|
},
|
{
|
name: "编辑",
|
type: "text",
|
clickFun: (row) => {
|
this.editDetail(row);
|
},
|
showHide: (row) => {
|
if (row.isDisabled == 1) {
|
return true;
|
} else {
|
return false;
|
}
|
},
|
},
|
],
|
},
|
],
|
pagination: {
|
size: 20,
|
current: 1,
|
total: 0,
|
compilerName: "",
|
},
|
inDetailPagination: {
|
size: 20,
|
current: 1,
|
total: 0,
|
},
|
editPlanShow: false,
|
currentRow: {},
|
currentRowId: null, // 当前选中数据的id
|
reviewRemarks: "", // 审核备注
|
reviewDialog: false, // 审核弹框
|
reviewLoading: false, // 审核提交按钮
|
approvalRemarks: "", // 审核备注
|
approvalDialog: false, // 审核弹框
|
approvalLoading: false, // 审核提交按钮
|
multipleSelection: [], // 年度明细表选中的数据
|
uploadDia: false,
|
uploading: false,
|
isOperation: false,
|
token: null,
|
fileList: [],
|
currentChangeRow: {},
|
tableHeight: 0,
|
};
|
},
|
beforeDestroy() {
|
window.removeEventListener("resize", this.getTableHeight);
|
},
|
created() {
|
this.getTableHeight();
|
},
|
mounted() {
|
window.addEventListener("resize", this.getTableHeight);
|
this.token = {
|
token: sessionStorage.getItem("token"),
|
};
|
if (this.isDepartment) {
|
this.getYearPlanList(this.departId);
|
} else {
|
this.getInDetailPlan("", this.departId);
|
}
|
console.log("this.flag", this.flag);
|
},
|
methods: {
|
//动态获取表格高度
|
getTableHeight() {
|
const otherHeight = 548; // 其余高度
|
const tableH = 50; // 距离页面下方的高度
|
const tableHeightDetil = window.innerHeight - tableH;
|
if (tableHeightDetil <= 300) {
|
this.tableHeight = 200;
|
} else {
|
this.tableHeight = window.innerHeight - tableH - otherHeight;
|
}
|
},
|
// 编辑明细
|
editDetail(row) {
|
this.addInDetail = true;
|
this.$nextTick(() => {
|
this.$refs.addPlan.showEditDialog(row);
|
});
|
},
|
// 删除明细
|
deleteDetail(row) {
|
this.$confirm("是否删除?", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
}).then(() => {
|
deleteDetail({ id: row.id }).then((res) => {
|
this.$message.success("删除成功");
|
this.searchTable();
|
});
|
});
|
},
|
searchTable() {
|
// 将页码设为
|
this.inDetailPagination.current = 1
|
this.getInDetailPlan(this.currentRowId);
|
},
|
// 查询-年度计划表
|
getYearPlanList(userId) {
|
const name = this.isDepartment ? "departmentId" : "userId";
|
personTrainingSelect({
|
[name]: userId,
|
size: this.pagination.size,
|
current: this.pagination.current,
|
compilerName: this.pagination.compilerName
|
}).then((res) => {
|
if (res.code === 201) return;
|
let data = {};
|
this.yearPlanTableData = res.data.records;
|
this.pagination.total = res.data.total;
|
if (this.yearPlanTableData.length > 0) {
|
this.currentRowId = this.yearPlanTableData[0].id;
|
if (this.currentPlanId) {
|
let filterData = this.yearPlanTableData.filter(
|
(item) => item.id == this.currentPlanId
|
);
|
if (filterData.length > 0) {
|
data = filterData[0];
|
}
|
} else {
|
data = this.yearPlanTableData[0];
|
}
|
this.currentChange(data);
|
} else {
|
this.inDetailPlanTableData = [];
|
}
|
});
|
},
|
refreshYearPlanList(departmentId) {
|
console.log("刷新主表", departmentId);
|
personTrainingSelect({
|
departmentId: departmentId,
|
size: this.pagination.size,
|
current: this.pagination.current,
|
compilerName: this.pagination.compilerName
|
}).then((res) => {
|
if (res.code === 201) return;
|
this.yearPlanTableData = res.data.records;
|
this.pagination.total = res.data.total;
|
});
|
},
|
currentChange(row) {
|
const now = new Date();
|
const currentYear = now.getFullYear();
|
this.currentChangeRow = row;
|
this.currentRowId = row.id;
|
if (row.createTime.slice(0, 4) == currentYear) {
|
this.isOperation = true;
|
} else {
|
this.isOperation = false;
|
}
|
this.currentPlanId = row.id;
|
this.getInDetailPlan(row.id);
|
},
|
getInDetailPlan(id) {
|
if (this.inDetailForm.trainingDate === null) {
|
this.inDetailForm.trainingDate = "";
|
}
|
let state = 3;
|
if (this.activeName != "first") {
|
state = -1;
|
}
|
const userId = this.isDepartment ? "" : this.departId;
|
if (this.currentPlanId) {
|
id = this.currentPlanId;
|
}
|
queryTheAnnualPlanDetailsTable({
|
userId,
|
size: this.inDetailPagination.size,
|
current: this.inDetailPagination.current,
|
trainingLecturerName: this.inDetailForm.trainingLecturerName,
|
trainingDate: this.inDetailForm.trainingDate,
|
courseCode: this.inDetailForm.courseCode,
|
departId: this.departId,
|
state
|
}).then((res) => {
|
if (res.code === 201) return;
|
this.inDetailPlanTableData = res.data.records;
|
this.inDetailPagination.total = res.data.total;
|
this.departId2 = res.data.records[0].departId;
|
});
|
},
|
// 新增年度计划明细表
|
addTrainingPlan() {
|
if (!this.currentRowId) {
|
this.$message.warning("请选择一条计划进行新增");
|
return;
|
}
|
this.addInDetail = true;
|
this.$nextTick(() => {
|
this.$refs.addPlan.showDialog(this.currentRowId);
|
});
|
},
|
// 年度计划表-删除
|
deleteFun(id) {
|
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
})
|
.then(() => {
|
personTrainingDelete({ id }).then((res) => {
|
this.$message.success("删除成功!");
|
this.getYearPlanList(this.departId);
|
});
|
})
|
.catch(() => {
|
this.$message({
|
type: "info",
|
message: "已取消删除",
|
});
|
});
|
},
|
// 年度计划表-审核
|
handleCheck(id) {
|
this.currentRowId = id;
|
this.reviewDialog = true;
|
},
|
handleReview(status) {
|
const personTrainingUpdateDto = {
|
id: this.currentRowId,
|
remarks: this.reviewRemarks,
|
status: status,
|
};
|
this.reviewLoading = true;
|
reviewAnnualPersonnelTraining(personTrainingUpdateDto).then((res) => {
|
if (res.code === 200) {
|
this.$message.success("提交成功!");
|
this.reviewDialog = false;
|
this.getYearPlanList(this.departId);
|
}
|
this.reviewLoading = false;
|
})
|
.catch(() => {
|
this.reviewLoading = false;
|
});
|
},
|
// 年度计划表-批准
|
handleApprove(id) {
|
this.currentRowId = id;
|
this.approvalDialog = true;
|
},
|
handleApproval(status) {
|
const personTrainingUpdateDto = {
|
id: this.currentRowId,
|
remarks: this.approvalRemarks,
|
status: status,
|
};
|
this.approvalLoading = true;
|
approveAnnualPersonnelTraining(personTrainingUpdateDto).then((res) => {
|
if (res.code === 200) {
|
this.$message.success("提交成功!");
|
this.approvalDialog = false;
|
this.getYearPlanList(this.departId);
|
}
|
this.approvalLoading = false;
|
})
|
.catch(() => {
|
this.approvalLoading = false;
|
});
|
},
|
// 年度计划表-下载
|
downLoadPost(row) {
|
exportPersonTraining({ id: row.id }).then((res) => {
|
this.outLoading = false;
|
const blob = new Blob([res], { type: "application/msword" });
|
this.$download.saveAs(blob, row.fileName + ".docx")
|
});
|
},
|
// 年度计划-导入
|
submitUpload() {
|
if (this.$refs.upload.uploadFiles.length == 0) {
|
this.$message.error("未选择文件");
|
return;
|
}
|
this.uploading = true;
|
this.$refs.upload.submit();
|
this.uploading = false;
|
},
|
onSuccess(response, file, fileList) {
|
this.$refs.upload.clearFiles();
|
this.uploadDia = false;
|
this.uploading = false;
|
if (response.code == 201) {
|
this.$message.error(response.message);
|
return;
|
}
|
this.$message.success("上传成功");
|
this.standardList = [];
|
this.productList = [];
|
this.getYearPlanList(this.departId);
|
},
|
onError(err, file, fileList) {
|
this.$message.error("上传失败");
|
this.$refs.upload.clearFiles();
|
this.uploading = false;
|
},
|
beforeUpload(file, fileList) {
|
if (
|
file.type !=
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
) {
|
this.$message.error("上传文件格式不正确");
|
this.$refs.upload.clearFiles();
|
return false;
|
}
|
},
|
// 年度计划分页
|
paginationMetod({ page, limit }) {
|
this.pagination.current = page;
|
this.pagination.size = limit;
|
this.getYearPlanList();
|
},
|
// 年度计划明细表-认领、取消认领
|
handleClaim(row) {
|
this.$confirm("是否确认报名该课程?", "提示", {
|
confirmButtonText: "报名",
|
cancelButtonText: "取消报名",
|
type: "warning",
|
})
|
.then(() => {
|
this.handleClaimFun(true, row.id);
|
})
|
.catch(() => {
|
this.handleClaimFun(false, row.id);
|
});
|
},
|
handleClaimFun(claimAndClaim, rowId) {
|
claimOfTrainingAndAssessmentRecords({
|
claimAndClaim,
|
courseId: rowId
|
}).then((res) => {
|
this.getInDetailPlan(this.currentChangeRow.id);
|
});
|
},
|
// 年度计划明细表-编辑
|
editInDetail(row) {
|
this.editPlanShow = true;
|
this.currentRow = row;
|
},
|
//
|
goBack() {
|
this.editPlanShow = false;
|
this.getInDetailPlan(this.currentRowId);
|
},
|
refresh(id) {
|
if (this.inDetailForm.trainingDate === null) {
|
this.inDetailForm.trainingDate = "";
|
}
|
const userId = this.isDepartment ? "" : this.departId;
|
queryTheAnnualPlanDetailsTable({
|
userId,
|
size: this.inDetailPagination.size,
|
current: this.inDetailPagination.current,
|
trainingLecturerName: this.inDetailForm.trainingLecturerName,
|
id,
|
trainingDate: this.inDetailForm.trainingDate,
|
courseCode: this.inDetailForm.courseCode,
|
departId: this.departId
|
}).then((res) => {
|
if (res.code === 201) return;
|
this.inDetailPlanTableData = res.data.records;
|
this.inDetailPagination.total = res.data.total;
|
this.currentRow = this.inDetailPlanTableData.find(
|
(item) => item.id == id
|
);
|
this.editKey += 1;
|
});
|
console.log("刷新", this.currentRow);
|
},
|
refresh(id) {
|
if (this.inDetailForm.trainingDate === null) {
|
this.inDetailForm.trainingDate = "";
|
}
|
const userId = this.isDepartment ? "" : this.departId;
|
queryTheAnnualPlanDetailsTable({
|
userId,
|
size: this.inDetailPagination.size,
|
current: this.inDetailPagination.current,
|
id,
|
trainingLecturerName: this.inDetailForm.trainingLecturerName,
|
trainingDate: this.inDetailForm.trainingDate,
|
courseCode: this.inDetailForm.courseCode,
|
departId: this.departId
|
}).then((res) => {
|
if (res.code === 201) return;
|
this.inDetailPlanTableData = res.data.records;
|
this.inDetailPagination.total = res.data.total;
|
this.currentRow = this.inDetailPlanTableData.find(
|
(item) => item.id == id
|
);
|
this.editKey += 1;
|
});
|
console.log("刷新", this.currentRow);
|
},
|
// 年度计划明细表-下载
|
downLoadInDetail(row) {
|
exportPersonTrainingRecord({ id: row.id }).then((res) => {
|
this.outLoading = false;
|
const blob = new Blob([res], { type: "application/msword" });
|
this.$download.saveAs(blob, row.courseCode + "人员培训与考核记录" + ".docx")
|
});
|
},
|
// 年度计划明细表-多选
|
handleSelectionChange(list) {
|
this.multipleSelection = list;
|
},
|
// 年度明细表-删除
|
batchDelete() {
|
if (this.multipleSelection.length > 0) {
|
let ids = [];
|
this.multipleSelection.forEach((item) => {
|
ids.push(item.id);
|
});
|
this.$confirm("是否确认删除所选择的数据?", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
})
|
.then(() => {
|
deleteAnnualPlanDetailTable({ ids: ids.join(",") }).then((res) => {
|
if (res.code == 200) {
|
this.$message.success("删除成功");
|
this.getInDetailPlan(this.currentRowId);
|
}
|
});
|
})
|
.catch(() => {
|
this.$message.warning("取消删除");
|
});
|
} else {
|
this.$message.warning("请选择需要删除的数据");
|
}
|
},
|
paginationmethod0({ page, limit }) {
|
this.inDetailPagination.current = page;
|
this.inDetailPagination.size = limit;
|
this.getYearPlanList(this.departId);
|
},
|
},
|
watch: {
|
// 监听点击el-tree的数据,进行数据刷新
|
departId: {
|
handler(newId, oldId) {
|
this.currentPlanId = null;
|
if (this.isDepartment) {
|
console.log("主");
|
this.getYearPlanList(newId);
|
} else {
|
this.getInDetailPlan("");
|
}
|
},
|
},
|
activeName: {
|
handler(newValue, oldValue) {
|
this.getInDetailPlan(this.currentRowId);
|
},
|
},
|
},
|
};
|
</script>
|
<style scoped>
|
.flex_column {
|
display: flex;
|
height: 80vh;
|
flex-direction: column;
|
overflow: auto;
|
justify-content: space-between;
|
}
|
|
.pagination {
|
display: flex;
|
justify-content: space-between;
|
}
|
|
.items_center {
|
display: flex;
|
align-items: center;
|
}
|
|
.date_box {
|
margin: 0 5px;
|
}
|
|
.search {
|
width: 150px;
|
margin: 0 16px;
|
}
|
</style>
|