From e5454b769d44a34af423bf87ac8a740bf8c20341 Mon Sep 17 00:00:00 2001 From: Crunchy <3114200645@qq.com> Date: 星期二, 29 四月 2025 13:25:29 +0800 Subject: [PATCH] Merge branch 'dev' into dev_tides --- src/views/CNAS/personnel/personnelInfo/tabs/personnelTraining.vue | 208 +++++++++++++++++++++++++--------------------------- 1 files changed, 100 insertions(+), 108 deletions(-) diff --git a/src/views/CNAS/personnel/personnelInfo/tabs/personnelTraining.vue b/src/views/CNAS/personnel/personnelInfo/tabs/personnelTraining.vue index 46c637d..a003633 100644 --- a/src/views/CNAS/personnel/personnelInfo/tabs/personnelTraining.vue +++ b/src/views/CNAS/personnel/personnelInfo/tabs/personnelTraining.vue @@ -5,63 +5,55 @@ <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> 瀹℃牳澶囨敞锛� @@ -69,8 +61,7 @@ </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> @@ -92,30 +83,23 @@ </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> @@ -124,7 +108,7 @@ <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> @@ -134,18 +118,18 @@ 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, @@ -184,7 +168,7 @@ label: '鍒涘缓鏃堕棿', width: '160px', prop: 'createTime' - },{ + }, { label: '缂栧埗浜�', prop: 'compilerName' }, { @@ -251,7 +235,7 @@ formatType: (params) => { if (params == 1) { return 'success'; - } else if (params == 2) { + } else if (params == 2) { return 'danger'; } else { return null @@ -271,7 +255,7 @@ name: '瀵煎嚭', type: 'text', disabled: (row) => { - if(row.approvalStatus === 1 && row.reviewerStatus === 1) { + if (row.approvalStatus === 1 && row.reviewerStatus === 1) { return false; } else { return true; @@ -285,7 +269,7 @@ 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; @@ -299,7 +283,7 @@ 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; @@ -317,7 +301,7 @@ this.deleteFun(row.id); }, disabled: (row) => { - if(row.reviewerStatus === 1) { + if (row.reviewerStatus === 1) { return true; } else { return false; @@ -328,7 +312,7 @@ }], inDetailPlanTableData: [], // 骞村害璁″垝鏄庣粏琛ㄨ〃鏁版嵁 inDetailPlanColumn: [ - { + { label: '鍩硅鐩爣', prop: 'trainingObjectives', width: '100px', @@ -442,15 +426,15 @@ ] }], 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: {}, @@ -479,19 +463,19 @@ } }, 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, @@ -509,17 +493,17 @@ 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; @@ -527,20 +511,20 @@ 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 @@ -550,7 +534,7 @@ this.yearDetailLoading = false }) }, - pagination1 (page) { + pagination1(page) { this.inDetailPagination.size = page.limit this.getInDetailPlan(this.currentRowId) }, @@ -569,7 +553,7 @@ cancelButtonText: '鍙栨秷', type: 'warning' }).then(() => { - personTrainingDelete({id: id}).then(res => { + personTrainingDelete({ id: id }).then(res => { this.$message.success('鍒犻櫎鎴愬姛锛�'); this.getYearPlanList(this.departId); }); @@ -587,7 +571,7 @@ this.getUserList() }, // 鎻愪氦瀹℃牳 - handleReview (status) { + handleReview(status) { const personTrainingUpdateDto = { id: this.currentRowId, auditRemarks: this.auditRemarks, @@ -612,7 +596,7 @@ this.approvalDialog = true }, // 鎻愪氦鎵瑰噯 - handleApproval (status) { + handleApproval(status) { const personTrainingUpdateDto = { id: this.currentRowId, approvalRemarks: this.approvalRemarks, @@ -632,15 +616,22 @@ }, // 骞村害璁″垝琛�-涓嬭浇 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 @@ -684,7 +675,7 @@ this.editPlanShow = false; this.getInDetailPlan(this.currentRowId) }, - viewRecord (row) { + viewRecord(row) { this.ViewRecord = true this.$nextTick(() => { this.$refs.ViewRecord.openDia(row) @@ -692,11 +683,10 @@ }, // 骞村害璁″垝鏄庣粏琛�-涓嬭浇 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('瀵煎嚭鎴愬姛') }) }, // 骞村害璁″垝鏄庣粏琛�-澶氶�� @@ -704,7 +694,7 @@ this.multipleSelection = list }, // 骞村害鏄庣粏琛�-鍒犻櫎 - batchDelete () { + batchDelete() { if (this.multipleSelection.length > 0) { let ids = [] this.multipleSelection.forEach(item => { @@ -715,7 +705,7 @@ 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); @@ -776,10 +766,12 @@ overflow: auto; justify-content: space-between; } + .search { width: 150px; margin: 0 16px; } + .title { position: relative; font-size: 16px; -- Gitblit v1.9.3