From 14d29f928b24d203e76f1dcefc1a51182657cd45 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期一, 10 三月 2025 16:29:09 +0800
Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/center-lims-before-ruoyi into dev
---
src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/index.vue | 1012 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 1,012 insertions(+), 0 deletions(-)
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/index.vue
new file mode 100644
index 0000000..9467953
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/index.vue
@@ -0,0 +1,1012 @@
+<!-- 浜哄憳鍩硅 -->
+<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="'130'"
+ :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="tableHeight + ''" :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="tableHeight + ''" :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, // 褰撳墠閫変腑鏁版嵁鐨刬d
+ 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,
+ 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>
--
Gitblit v1.9.3