¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- 人åå¹è® --> |
| | | <template> |
| | | <div class="flex_column"> |
| | | <div v-if="!editPlanShow && isDepartment"> |
| | | <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> |
| | | <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> |
| | | </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> |
| | | </div> |
| | | <lims-table :tableData="inDetailPlanTableData" :column="inDetailPlanColumn" |
| | | :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> |
| | | <el-dialog :visible.sync="reviewDialog" title="å®¡æ ¸" width="30%" @close="auditRemarks = ''"> |
| | | <span> |
| | | å®¡æ ¸å¤æ³¨ï¼ |
| | | <el-input v-model="auditRemarks" type="textarea"></el-input> |
| | | </span> |
| | | <span style="margin-top: 10px;display: inline-block"> |
| | | æ¹åäººï¼ |
| | | <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> |
| | | </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="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" |
| | | 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-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"> |
| | | <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 > |
| | | <view-record v-if="ViewRecord" ref="ViewRecord"></view-record> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Add from '../components/AddInDetail.vue'; |
| | | 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 { |
| | | approveAnnualPersonnelTraining, deleteAnnualPlanDetailTable, exportPersonTraining, exportPersonTrainingRecord, |
| | | personTraining, |
| | | personTrainingDelete, |
| | | queryTheAnnualPlanDetailsTable, reviewAnnualPersonnelTraining |
| | | } from "@/api/cnas/personal/personalTraining"; |
| | | import {selectUserCondition} from "@/api/system/user"; |
| | | |
| | | export default { |
| | | name: 'PersonnelTraining', |
| | | components: {limsTable, ViewRecord, Add, Edit }, |
| | | props: { |
| | | departId: { |
| | | type: Number, |
| | | default: () => { |
| | | return null; |
| | | } |
| | | }, |
| | | isDepartment: { |
| | | type: Boolean, |
| | | default: false |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userId"]), |
| | | }, |
| | | data() { |
| | | return { |
| | | planYear: '', |
| | | reviewerId: '', |
| | | responsibleOptions: [], |
| | | search: {}, |
| | | superviseForm: {}, |
| | | inDetailForm: { |
| | | trainingLecturerName: '', |
| | | trainingDate: '', |
| | | }, |
| | | yearLoading: false, |
| | | yearDetailLoading: false, |
| | | yearPlanTableData: [], // 年度计åè¡¨æ°æ® |
| | | yearPlanColumn: [ |
| | | { |
| | | label: 'æä»¶åç§°', |
| | | width: '160px', |
| | | prop: 'fileName' |
| | | }, { |
| | | label: 'å建æ¶é´', |
| | | width: '160px', |
| | | prop: 'createTime' |
| | | },{ |
| | | 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 || this.userId != row.reviewerId) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | }, |
| | | clickFun: (row) => { |
| | | this.handleCheck(row.id); |
| | | } |
| | | }, |
| | | { |
| | | name: 'æ¹å', |
| | | type: 'text', |
| | | disabled: (row) => { |
| | | if(row.approvalStatus === 1 || this.userId != row.approverId || row.reviewerStatus != 1) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | }, |
| | | clickFun: (row) => { |
| | | this.handleApprove(row.id); |
| | | } |
| | | }, |
| | | { |
| | | name: 'å é¤', |
| | | type: 'text', |
| | | color: '#f56c6c', |
| | | clickFun: (row) => { |
| | | this.deleteFun(row.id); |
| | | }, |
| | | disabled: (row) => { |
| | | if(row.reviewerStatus === 1) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | }, |
| | | } |
| | | ] |
| | | }], |
| | | inDetailPlanTableData: [], // 年度计åæç»è¡¨è¡¨æ°æ® |
| | | inDetailPlanColumn: [ |
| | | { |
| | | label: 'å¹è®ç®æ ', |
| | | prop: 'trainingObjectives', |
| | | width: '100px', |
| | | }, { |
| | | label: 'å¹è®å
容', |
| | | prop: 'trainingContent', |
| | | width: '100px', |
| | | }, { |
| | | label: 'å¹è®æ¹å¼', |
| | | prop: 'trainingMode', |
| | | width: '100px', |
| | | }, { |
| | | dataType: 'tag', |
| | | label: '课ç¨ç¶æ', |
| | | width: '100px', |
| | | prop: 'state', |
| | | formatData: (params) => { |
| | | if (params == 1) { |
| | | return '已宿'; |
| | | } else if (params == 2) { |
| | | return 'å¾
è¯ä»·'; |
| | | } else if (params == 3) { |
| | | 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: '100px', |
| | | }, { |
| | | label: '举åé¨é¨', |
| | | prop: 'holdingDepartment', |
| | | width: '100px', |
| | | }, { |
| | | label: 'å¹è®è®²å¸', |
| | | prop: 'trainingLecturerName', |
| | | width: '100px', |
| | | }, { |
| | | label: 'å¹è®æ¥æ', |
| | | prop: 'trainingDate', |
| | | width: '100px', |
| | | }, { |
| | | label: 'å¼å§æ¶é´', |
| | | prop: 'openingTime', |
| | | width: '100px', |
| | | }, { |
| | | label: '课æ¶', |
| | | prop: 'classHour', |
| | | width: '100px', |
| | | }, { |
| | | label: '夿³¨', |
| | | prop: 'remarks', |
| | | width: '100px', |
| | | }, { |
| | | dataType: 'action', |
| | | width: '200', |
| | | label: 'æä½', |
| | | fixed: 'right', |
| | | operation: [ |
| | | { |
| | | name: 'ç¼è¾', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.addTrainingPlan('edit', row); |
| | | }, |
| | | }, |
| | | { |
| | | name: 'ç»ææç»', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.editInDetail(row); |
| | | }, |
| | | showHide: () => { |
| | | if (this.isDepartment) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | name: 'éä»¶', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.viewRecord(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: '导åº', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.downLoadInDetail(row); |
| | | } |
| | | }, |
| | | |
| | | ] |
| | | }], |
| | | page: { |
| | | total:0, |
| | | size:10, |
| | | current:1, |
| | | compilerName: "" |
| | | }, |
| | | inDetailPagination: { |
| | | total:0, |
| | | size:10, |
| | | current:1, |
| | | }, |
| | | editPlanShow: false, |
| | | currentRow: {}, |
| | | currentRowId: null, // å½åé䏿°æ®çid |
| | | auditRemarks: '', // å®¡æ ¸å¤æ³¨ |
| | | reviewDialog: false, // å®¡æ ¸å¼¹æ¡ |
| | | reviewLoading: false, // å®¡æ ¸æäº¤æé® |
| | | approvalRemarks: '', // å®¡æ ¸å¤æ³¨ |
| | | approvalDialog: false, // å®¡æ ¸å¼¹æ¡ |
| | | approvalLoading: false, // å®¡æ ¸æäº¤æé® |
| | | multipleSelection: [], // 年度æç»è¡¨éä¸çæ°æ® |
| | | uploadDia: false, |
| | | uploading: false, |
| | | isOperation: false, |
| | | ViewRecord: false, |
| | | fileList: [], |
| | | currentChangeRow: {}, |
| | | approverId: '' |
| | | }; |
| | | }, |
| | | mounted() { |
| | | if (this.isDepartment) { |
| | | this.getYearPlanList(this.departId) |
| | | } else { |
| | | this.getInDetailPlan('', this.departId) |
| | | } |
| | | }, |
| | | methods: { |
| | | 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, |
| | | }: { |
| | | userId: userId, |
| | | size: this.page.size, |
| | | current: this.page.current, |
| | | compilerName: this.page.compilerName, |
| | | } |
| | | personTraining(params).then(res => { |
| | | this.yearLoading = false |
| | | this.yearPlanTableData = res.data.records; |
| | | this.pagination.total = res.data.total; |
| | | if (this.yearPlanTableData.length > 0) { |
| | | this.currentRowId = this.yearPlanTableData[0].id |
| | | this.currentChange(this.yearPlanTableData[0]) |
| | | } |
| | | }).catch(err => { |
| | | this.yearLoading = false |
| | | }) |
| | | }, |
| | | pagination (page) { |
| | | this.page.size = page.limit |
| | | this.getYearPlanList() |
| | | }, |
| | | 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) { |
| | | this.isOperation = true; |
| | | } else { |
| | | this.isOperation = false; |
| | | } |
| | | this.getInDetailPlan(row.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, |
| | | } |
| | | this.yearDetailLoading = true |
| | | queryTheAnnualPlanDetailsTable(params).then(res => { |
| | | this.yearDetailLoading = false |
| | | this.inDetailPlanTableData = res.data.records; |
| | | this.inDetailPagination.total = res.data.total; |
| | | }).catch(err => { |
| | | this.yearDetailLoading = false |
| | | }) |
| | | }, |
| | | pagination1 (page) { |
| | | this.inDetailPagination.size = page.limit |
| | | this.getInDetailPlan(this.currentRowId) |
| | | }, |
| | | // æ°å¢å¹´åº¦è®¡åæç»è¡¨ |
| | | addTrainingPlan(type, row) { |
| | | if (!this.currentRowId) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡è®¡åè¿è¡æ°å¢') |
| | | return |
| | | } |
| | | this.$refs.addPlan.showDialog(this.currentRowId, type, row); |
| | | }, |
| | | // 年度计å表-å é¤ |
| | | deleteFun(id) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | personTrainingDelete({id: id}).then(res => { |
| | | this.$message.success('å 餿åï¼'); |
| | | this.getYearPlanList(this.departId); |
| | | }); |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | // 年度计å表-å®¡æ ¸ |
| | | handleCheck(id) { |
| | | this.currentRowId = id |
| | | this.reviewDialog = true |
| | | this.getUserList() |
| | | }, |
| | | // æäº¤å®¡æ ¸ |
| | | handleReview (status) { |
| | | const personTrainingUpdateDto = { |
| | | id: this.currentRowId, |
| | | auditRemarks: this.auditRemarks, |
| | | reviewerStatus: status, |
| | | approverId: this.approverId |
| | | } |
| | | 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, |
| | | approvalRemarks: this.approvalRemarks, |
| | | approvalStatus: 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') |
| | | this.$message.success('å¯¼åºæå') |
| | | }) |
| | | }, |
| | | // 年度计å-导å
¥ |
| | | 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 != 200) { |
| | | this.$message.error(response.msg) |
| | | 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; |
| | | } |
| | | }, |
| | | // 年度计åæç»è¡¨-ç¼è¾ |
| | | editInDetail(row) { |
| | | this.editPlanShow = true; |
| | | this.currentRow = row |
| | | }, |
| | | // |
| | | goBack() { |
| | | this.editPlanShow = false; |
| | | this.getInDetailPlan(this.currentRowId) |
| | | }, |
| | | viewRecord (row) { |
| | | this.ViewRecord = true |
| | | this.$nextTick(() => { |
| | | this.$refs.ViewRecord.openDia(row) |
| | | }) |
| | | }, |
| | | // 年度计åæç»è¡¨-ä¸è½½ |
| | | downLoadInDetail(row) { |
| | | exportPersonTrainingRecord({id: row.id}).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res],{ type: 'application/msword' }); |
| | | this.$download.saveAs(blob, '人åå¹è®ä¸èæ ¸è®°å½.docx') |
| | | this.$message.success('å¯¼åºæå') |
| | | }) |
| | | }, |
| | | // 年度计åæç»è¡¨-å¤é |
| | | 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('è¯·éæ©éè¦å é¤çæ°æ®') |
| | | } |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.inDetailPagination.size = val; |
| | | this.getInDetailPlan(this.currentChangeRow.id) |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.inDetailPagination.current = val; |
| | | this.getInDetailPlan(this.currentChangeRow.id) |
| | | }, |
| | | // è·åè´è´£äººä¿¡æ¯æ¥å£ |
| | | getUserList() { |
| | | selectUserCondition().then(res => { |
| | | if (res.code == 200) { |
| | | this.responsibleOptions = res.data |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | departId: { |
| | | handler(newId, oldId) { |
| | | if (this.isDepartment) { |
| | | this.getYearPlanList(newId); |
| | | } else { |
| | | this.getInDetailPlan('') |
| | | } |
| | | } |
| | | }, |
| | | currentRowId: { |
| | | handler(newId, oldId) { |
| | | if (newId) { |
| | | console.log('newId', newId); |
| | | this.inDetailPagination.current = 1 |
| | | this.getInDetailPlan(this.currentChangeRow.id) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .flex_column { |
| | | display: flex; |
| | | height: 80vh; |
| | | flex-direction: column; |
| | | overflow: auto; |
| | | justify-content: space-between; |
| | | } |
| | | .search { |
| | | width: 150px; |
| | | margin: 0 16px; |
| | | } |
| | | .title { |
| | | position: relative; |
| | | font-size: 16px; |
| | | color: #333; |
| | | font-weight: 400; |
| | | padding-left: 10px; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .title::before { |
| | | position: absolute; |
| | | left: 0; |
| | | top: 4px; |
| | | content: ''; |
| | | width: 4px; |
| | | height: 16px; |
| | | background-color: #3A7BFA; |
| | | border-radius: 2px; |
| | | } |
| | | </style> |