| | |
| | | <div class="title"> |
| | | <span style="font-weight: bold">年度计划</span> |
| | | </div> |
| | | <div style="display: flex;justify-content: space-between;"> |
| | | <el-form :model="page" ref="page" size="small" :inline="true"> |
| | | <el-form-item label="编制人"> |
| | | <el-input v-model="page.compilerName" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button size="small" type="primary" @click="getYearPlanList(departId)">查 询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div> |
| | | <div style="display: flex;justify-content: space-between"> |
| | | <div style="display: flex;"> |
| | | <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;"> |
| | | <span style="width: 88px;font-size: 14px;font-weight: 700;color: #606266;">编制人</span> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="page.compilerName" |
| | | @keyup.enter.native="getYearPlanList(departId)"></el-input> |
| | | </div> |
| | | <div style="line-height: 30px;"> |
| | | <el-button type="primary" size="mini" @click="getYearPlanList(departId)">查询</el-button> |
| | | </div> |
| | | </div> |
| | | <div style="line-height: 30px;"> |
| | | <el-button size="small" type="primary" @click="uploadDia = true, getUserList()">导入</el-button> |
| | | </div> |
| | | </div> |
| | | <lims-table :tableData="yearPlanTableData" :column="yearPlanColumn" |
| | | :currentChange="currentChange" |
| | | @pagination="pagination" height="40vh" |
| | | :page="page" :tableLoading="yearLoading"></lims-table> |
| | | <lims-table :tableData="yearPlanTableData" :column="yearPlanColumn" :currentChange="currentChange" |
| | | @pagination="pagination" height="40vh" :page="page" :tableLoading="yearLoading"></lims-table> |
| | | </div> |
| | | <div v-if="!editPlanShow" class="table"> |
| | | <div> |
| | | <div class="title"> |
| | | <span style="font-weight: bold">年度计划明细</span> |
| | | </div> |
| | | <div style="display: flex;justify-content: space-between;"> |
| | | <el-form :model="inDetailForm" ref="inDetailForm" size="small" :inline="true"> |
| | | <el-form-item label="培训讲师"> |
| | | <el-input v-model="inDetailForm.trainingLecturerName" class="search" clearable placeholder="请输入" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="培训日期"> |
| | | <el-date-picker v-model="inDetailForm.trainingDate" clearable |
| | | format="yyyy-MM-dd" placeholder="选择日期" size="small" |
| | | type="date" value-format="yyyy-MM-dd"></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button size="small" type="primary" @click="searchTable">查 询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div> |
| | | <el-button v-if="isDepartment && currentChangeRow && isOperation" size="small" @click="batchDelete">批量删除</el-button> |
| | | <el-button v-if="isDepartment && currentChangeRow && isOperation" size="small" type="primary" @click="addTrainingPlan('add')">新增</el-button> |
| | | <div style="display: flex;justify-content: space-between"> |
| | | <div style="display: flex;"> |
| | | <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;"> |
| | | <span style="width: 88px;font-size: 14px;font-weight: 700;color: #606266;">培训讲师</span> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="inDetailForm.trainingLecturerName" |
| | | @keyup.enter.native="searchTable"></el-input> |
| | | </div> |
| | | <div style="line-height: 30px;"> |
| | | <el-button size="mini" type="primary" @click="searchTable">查询</el-button> |
| | | </div> |
| | | </div> |
| | | <div style="line-height: 30px;"> |
| | | <el-button v-if="isDepartment && currentChangeRow && isOperation" size="small" |
| | | @click="batchDelete">批量删除</el-button> |
| | | <el-button v-if="isDepartment && currentChangeRow && isOperation" size="small" type="primary" |
| | | @click="addTrainingPlan('add')">新增</el-button> |
| | | </div> |
| | | </div> |
| | | <lims-table :tableData="inDetailPlanTableData" :column="inDetailPlanColumn" |
| | | :height="isDepartment ? '40vh' : '62vh' " |
| | | :isSelection="true" :handleSelectionChange="handleSelectionChange" |
| | | @pagination="pagination1" |
| | | :page="inDetailPagination" :tableLoading="yearDetailLoading"></lims-table> |
| | | :height="isDepartment ? '40vh' : '62vh'" :isSelection="true" :handleSelectionChange="handleSelectionChange" |
| | | @pagination="pagination1" :page="inDetailPagination" :tableLoading="yearDetailLoading"></lims-table> |
| | | </div> |
| | | </div> |
| | | <Add ref="addPlan" :currentChangeRow="currentChangeRow" @search="getInDetailPlan(currentRowId, departId)"></Add> |
| | | <Edit |
| | | v-if="editPlanShow" |
| | | ref="editPlan" |
| | | :currentRow="currentRow" |
| | | @del="getInDetailPlan(currentRowId, departId)" |
| | | @goBack="goBack" |
| | | ></Edit> |
| | | <Edit v-if="editPlanShow" ref="editPlan" :currentRow="currentRow" @del="getInDetailPlan(currentRowId, departId)" |
| | | @goBack="goBack"></Edit> |
| | | <el-dialog :visible.sync="reviewDialog" title="审核" width="30%" @close="auditRemarks = ''"> |
| | | <span> |
| | | 审核备注: |
| | |
| | | </span> |
| | | <span style="margin-top: 10px;display: inline-block"> |
| | | 批准人: |
| | | <el-select v-model="approverId" clearable |
| | | filterable size="small" style="width: 70%;"> |
| | | <el-select v-model="approverId" clearable filterable size="small" style="width: 70%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="uploadDia" title="数据导入" width="500px"> |
| | | <div style="display: flex;align-items: center;"> |
| | | <div style="width: 70px">年份:</div> |
| | | <el-date-picker |
| | | v-model="planYear" |
| | | type="year" |
| | | value-format="yyyy" |
| | | clearable |
| | | size="small" |
| | | format="yyyy" |
| | | <div style="width: 70px"><span class="required-span">* </span>年份:</div> |
| | | <el-date-picker v-model="planYear" type="year" value-format="yyyy" clearable size="small" format="yyyy" |
| | | placeholder="选择年"> |
| | | </el-date-picker> |
| | | </div> |
| | | <div style="display: flex;align-items: center;margin: 10px 0"> |
| | | <div style="width: 70px">审核人:</div> |
| | | <el-select v-model="reviewerId" clearable |
| | | filterable size="small" style="width: 50%;"> |
| | | <div style="width: 70px"><span class="required-span">* </span>审核人:</div> |
| | | <el-select v-model="reviewerId" clearable filterable size="small" style="width: 50%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <div style="margin: 0 auto;"> |
| | | <el-upload ref="upload" :action="javaApi + '/personTraining/personTrainingImport' + '?planYear=' + planYear + '&reviewerId=' + reviewerId" |
| | | :auto-upload="false" :before-upload="beforeUpload" :file-list="fileList" :headers="uploadHeader" |
| | | :limit="1" :on-error="onError" :on-success="onSuccess" accept=".xlsx" drag |
| | | name="file"> |
| | | <el-upload ref="upload" |
| | | :action="javaApi + '/personTraining/personTrainingImport' + '?planYear=' + planYear + '&reviewerId=' + reviewerId" |
| | | :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> |
| | |
| | | <el-button @click="uploadDia = false">取 消</el-button> |
| | | <el-button :loading="uploading" type="primary" @click="submitUpload()">上 传</el-button> |
| | | </span> |
| | | </el-dialog > |
| | | </el-dialog> |
| | | <view-record v-if="ViewRecord" ref="ViewRecord"></view-record> |
| | | </div> |
| | | </template> |
| | |
| | | import Edit from '../components/Edit.vue'; |
| | | import ViewRecord from "../components/ViewRecord.vue"; |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import {mapGetters} from "vuex"; |
| | | import { mapGetters } from "vuex"; |
| | | import { |
| | | approveAnnualPersonnelTraining, deleteAnnualPlanDetailTable, exportPersonTraining, exportPersonTrainingRecord, |
| | | personTraining, |
| | | personTrainingDelete, |
| | | queryTheAnnualPlanDetailsTable, reviewAnnualPersonnelTraining |
| | | } from "@/api/cnas/personal/personalTraining"; |
| | | import {selectUserCondition} from "@/api/system/user"; |
| | | import { selectUserCondition } from "@/api/system/user"; |
| | | |
| | | export default { |
| | | name: 'PersonnelTraining', |
| | | components: {limsTable, ViewRecord, Add, Edit }, |
| | | components: { limsTable, ViewRecord, Add, Edit }, |
| | | props: { |
| | | departId: { |
| | | type: Number, |
| | |
| | | label: '创建时间', |
| | | width: '160px', |
| | | prop: 'createTime' |
| | | },{ |
| | | }, { |
| | | label: '编制人', |
| | | prop: 'compilerName' |
| | | }, { |
| | |
| | | formatType: (params) => { |
| | | if (params == 1) { |
| | | return 'success'; |
| | | } else if (params == 2) { |
| | | } else if (params == 2) { |
| | | return 'danger'; |
| | | } else { |
| | | return null |
| | |
| | | name: '导出', |
| | | type: 'text', |
| | | disabled: (row) => { |
| | | if(row.approvalStatus === 1 && row.reviewerStatus === 1) { |
| | | if (row.approvalStatus === 1 && row.reviewerStatus === 1) { |
| | | return false; |
| | | } else { |
| | | return true; |
| | |
| | | name: '审核', |
| | | type: 'text', |
| | | disabled: (row) => { |
| | | if(row.reviewerStatus === 1 || this.userId != row.reviewerId) { |
| | | if (row.reviewerStatus === 1 || this.userId != row.reviewerId) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | |
| | | name: '批准', |
| | | type: 'text', |
| | | disabled: (row) => { |
| | | if(row.approvalStatus === 1 || this.userId != row.approverId || row.reviewerStatus != 1) { |
| | | if (row.approvalStatus === 1 || this.userId != row.approverId || row.reviewerStatus != 1) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | |
| | | this.deleteFun(row.id); |
| | | }, |
| | | disabled: (row) => { |
| | | if(row.reviewerStatus === 1) { |
| | | if (row.reviewerStatus === 1) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | |
| | | }], |
| | | inDetailPlanTableData: [], // 年度计划明细表表数据 |
| | | inDetailPlanColumn: [ |
| | | { |
| | | { |
| | | label: '培训目标', |
| | | prop: 'trainingObjectives', |
| | | width: '100px', |
| | |
| | | ] |
| | | }], |
| | | page: { |
| | | total:0, |
| | | size:10, |
| | | current:1, |
| | | total: 0, |
| | | size: 10, |
| | | current: 1, |
| | | compilerName: "" |
| | | }, |
| | | inDetailPagination: { |
| | | total:0, |
| | | size:10, |
| | | current:1, |
| | | total: 0, |
| | | size: 10, |
| | | current: 1, |
| | | }, |
| | | editPlanShow: false, |
| | | currentRow: {}, |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | searchTable () { |
| | | searchTable() { |
| | | this.getInDetailPlan(this.currentRowId) |
| | | }, |
| | | // 查询-年度计划表 |
| | | getYearPlanList(userId) { |
| | | this.yearLoading = true |
| | | const params = this.isDepartment ? |
| | | { |
| | | departmentId: userId, |
| | | size: this.page.size, |
| | | current: this.page.current, |
| | | compilerName: this.page.compilerName, |
| | | }: { |
| | | { |
| | | departmentId: userId, |
| | | size: this.page.size, |
| | | current: this.page.current, |
| | | compilerName: this.page.compilerName, |
| | | } : { |
| | | userId: userId, |
| | | size: this.page.size, |
| | | current: this.page.current, |
| | |
| | | this.yearLoading = false |
| | | }) |
| | | }, |
| | | pagination (page) { |
| | | pagination(page) { |
| | | this.page.size = page.limit |
| | | this.getYearPlanList() |
| | | }, |
| | | currentChange (row) { |
| | | currentChange(row) { |
| | | const now = new Date(); |
| | | const currentYear = now.getFullYear(); |
| | | if (row) { |
| | | this.currentChangeRow = row |
| | | this.currentRowId = row.id |
| | | if (row.createTime.slice(0,4) == currentYear) { |
| | | if (row.createTime.slice(0, 4) == currentYear) { |
| | | this.isOperation = true; |
| | | } else { |
| | | this.isOperation = false; |
| | |
| | | this.getInDetailPlan(row.id) |
| | | } |
| | | }, |
| | | getInDetailPlan (id) { |
| | | getInDetailPlan(id) { |
| | | if (this.inDetailForm.trainingDate === null) { |
| | | this.inDetailForm.trainingDate = '' |
| | | } |
| | | const userId = this.isDepartment ? '' : this.departId |
| | | const params = |
| | | { |
| | | userId: userId, |
| | | size: this.inDetailPagination.pageSize, |
| | | current: this.inDetailPagination.current, |
| | | id: id, |
| | | trainingLecturerName: this.inDetailForm.trainingLecturerName, |
| | | trainingDate: this.inDetailForm.trainingDate, |
| | | } |
| | | { |
| | | userId: userId, |
| | | size: this.inDetailPagination.pageSize, |
| | | current: this.inDetailPagination.current, |
| | | id: id, |
| | | trainingLecturerName: this.inDetailForm.trainingLecturerName, |
| | | trainingDate: this.inDetailForm.trainingDate, |
| | | } |
| | | this.yearDetailLoading = true |
| | | queryTheAnnualPlanDetailsTable(params).then(res => { |
| | | this.yearDetailLoading = false |
| | |
| | | this.yearDetailLoading = false |
| | | }) |
| | | }, |
| | | pagination1 (page) { |
| | | pagination1(page) { |
| | | this.inDetailPagination.size = page.limit |
| | | this.getInDetailPlan(this.currentRowId) |
| | | }, |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | personTrainingDelete({id: id}).then(res => { |
| | | personTrainingDelete({ id: id }).then(res => { |
| | | this.$message.success('删除成功!'); |
| | | this.getYearPlanList(this.departId); |
| | | }); |
| | |
| | | this.getUserList() |
| | | }, |
| | | // 提交审核 |
| | | handleReview (status) { |
| | | handleReview(status) { |
| | | const personTrainingUpdateDto = { |
| | | id: this.currentRowId, |
| | | auditRemarks: this.auditRemarks, |
| | |
| | | this.approvalDialog = true |
| | | }, |
| | | // 提交批准 |
| | | handleApproval (status) { |
| | | handleApproval(status) { |
| | | const personTrainingUpdateDto = { |
| | | id: this.currentRowId, |
| | | approvalRemarks: this.approvalRemarks, |
| | |
| | | }, |
| | | // 年度计划表-下载 |
| | | downLoadPost(row) { |
| | | exportPersonTraining({id: row.id}).then(res => { |
| | | exportPersonTraining({ id: row.id }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res],{ type: 'application/msword' }); |
| | | const blob = new Blob([res], { type: 'application/msword' }); |
| | | this.$download.saveAs(blob, row.fileName + '.docx') |
| | | this.$message.success('导出成功') |
| | | }) |
| | | }, |
| | | // 年度计划-导入 |
| | | submitUpload() { |
| | | if (!this.planYear) { |
| | | this.$message.error('请选择年份') |
| | | return |
| | | } |
| | | if (!this.reviewerId) { |
| | | this.$message.error('请选择审核人') |
| | | return |
| | | } |
| | | if (this.$refs.upload.uploadFiles.length == 0) { |
| | | this.$message.error('未选择文件') |
| | | return |
| | |
| | | this.editPlanShow = false; |
| | | this.getInDetailPlan(this.currentRowId) |
| | | }, |
| | | viewRecord (row) { |
| | | viewRecord(row) { |
| | | this.ViewRecord = true |
| | | this.$nextTick(() => { |
| | | this.$refs.ViewRecord.openDia(row) |
| | |
| | | }, |
| | | // 年度计划明细表-下载 |
| | | downLoadInDetail(row) { |
| | | exportPersonTrainingRecord({id: row.id}).then(res => { |
| | | exportPersonTrainingRecord({ id: row.id }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res],{ type: 'application/msword' }); |
| | | const blob = new Blob([res], { type: 'application/msword' }); |
| | | this.$download.saveAs(blob, '人员培训与考核记录.docx') |
| | | this.$message.success('导出成功') |
| | | }) |
| | | }, |
| | | // 年度计划明细表-多选 |
| | |
| | | this.multipleSelection = list |
| | | }, |
| | | // 年度明细表-删除 |
| | | batchDelete () { |
| | | batchDelete() { |
| | | if (this.multipleSelection.length > 0) { |
| | | let ids = [] |
| | | this.multipleSelection.forEach(item => { |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteAnnualPlanDetailTable({ids: ids.join(',')}).then(res => { |
| | | deleteAnnualPlanDetailTable({ ids: ids.join(',') }).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('删除成功'); |
| | | this.getInDetailPlan(this.currentRowId); |
| | |
| | | overflow: auto; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .search { |
| | | width: 150px; |
| | | margin: 0 16px; |
| | | } |
| | | |
| | | .title { |
| | | position: relative; |
| | | font-size: 16px; |