From 840de9662167b1d7758208b9c88adda806ed8fec Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期一, 03 三月 2025 16:47:25 +0800 Subject: [PATCH] 删除导出成功提示,统一提示了 --- src/views/CNAS/personnel/personnelInfo/tabs/personnelTraining.vue | 155 +++++++++++++++++++++++---------------------------- 1 files changed, 70 insertions(+), 85 deletions(-) diff --git a/src/views/CNAS/personnel/personnelInfo/tabs/personnelTraining.vue b/src/views/CNAS/personnel/personnelInfo/tabs/personnelTraining.vue index 46c637d..cb850e2 100644 --- a/src/views/CNAS/personnel/personnelInfo/tabs/personnelTraining.vue +++ b/src/views/CNAS/personnel/personnelInfo/tabs/personnelTraining.vue @@ -18,10 +18,8 @@ <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> @@ -31,37 +29,32 @@ <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-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-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> + <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 +62,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> @@ -93,29 +85,22 @@ <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" + <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%;"> + <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 +109,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 +119,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 +169,7 @@ label: '鍒涘缓鏃堕棿', width: '160px', prop: 'createTime' - },{ + }, { label: '缂栧埗浜�', prop: 'compilerName' }, { @@ -251,7 +236,7 @@ formatType: (params) => { if (params == 1) { return 'success'; - } else if (params == 2) { + } else if (params == 2) { return 'danger'; } else { return null @@ -271,7 +256,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 +270,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 +284,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 +302,7 @@ this.deleteFun(row.id); }, disabled: (row) => { - if(row.reviewerStatus === 1) { + if (row.reviewerStatus === 1) { return true; } else { return false; @@ -328,7 +313,7 @@ }], inDetailPlanTableData: [], // 骞村害璁″垝鏄庣粏琛ㄨ〃鏁版嵁 inDetailPlanColumn: [ - { + { label: '鍩硅鐩爣', prop: 'trainingObjectives', width: '100px', @@ -442,15 +427,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 +464,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 +494,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 +512,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 +535,7 @@ this.yearDetailLoading = false }) }, - pagination1 (page) { + pagination1(page) { this.inDetailPagination.size = page.limit this.getInDetailPlan(this.currentRowId) }, @@ -569,7 +554,7 @@ cancelButtonText: '鍙栨秷', type: 'warning' }).then(() => { - personTrainingDelete({id: id}).then(res => { + personTrainingDelete({ id: id }).then(res => { this.$message.success('鍒犻櫎鎴愬姛锛�'); this.getYearPlanList(this.departId); }); @@ -587,7 +572,7 @@ this.getUserList() }, // 鎻愪氦瀹℃牳 - handleReview (status) { + handleReview(status) { const personTrainingUpdateDto = { id: this.currentRowId, auditRemarks: this.auditRemarks, @@ -612,7 +597,7 @@ this.approvalDialog = true }, // 鎻愪氦鎵瑰噯 - handleApproval (status) { + handleApproval(status) { const personTrainingUpdateDto = { id: this.currentRowId, approvalRemarks: this.approvalRemarks, @@ -632,11 +617,10 @@ }, // 骞村害璁″垝琛�-涓嬭浇 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('瀵煎嚭鎴愬姛') }) }, // 骞村害璁″垝-瀵煎叆 @@ -684,7 +668,7 @@ this.editPlanShow = false; this.getInDetailPlan(this.currentRowId) }, - viewRecord (row) { + viewRecord(row) { this.ViewRecord = true this.$nextTick(() => { this.$refs.ViewRecord.openDia(row) @@ -692,11 +676,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 +687,7 @@ this.multipleSelection = list }, // 骞村害鏄庣粏琛�-鍒犻櫎 - batchDelete () { + batchDelete() { if (this.multipleSelection.length > 0) { let ids = [] this.multipleSelection.forEach(item => { @@ -715,7 +698,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 +759,12 @@ overflow: auto; justify-content: space-between; } + .search { width: 150px; margin: 0 16px; } + .title { position: relative; font-size: 16px; -- Gitblit v1.9.3