修复人员管理模块各标签页问题并完善设备、文件受控页面
- 人员管理:修复人员基本信息、培训计划、岗位职责、培训记录、任职授权记录、人员能力的查询、分页、联动、编辑权限、上传校验与错误提示
- 任职授权记录导出改用 JL04《检测人员上岗证》模板
- 设备保养计划、文件受控申请与记录页面功能完善
- PDF 盖章预览改用本地打包 pdf.js,去除公网 CDN 依赖
| | |
| | | <!-- Luckysheet å¿
é¡»å
äºèªå¨æ³¨å
¥ç Vue åºç¨èæ¬å è½½ï¼classic script å
äº type=module æ§è¡ï¼ --> |
| | | <script src="/luckysheet/plugins/js/plugin.js"></script> |
| | | <script src="/luckysheet/luckysheet.umd.js"></script> |
| | | <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.16.105/pdf.min.js"></script> |
| | | <script type="module" src="/src/main.js"></script> |
| | | </body> |
| | | |
| | |
| | | export function personJobResponsibilitiesDelete(query) { |
| | | return request({ |
| | | url: "/personJobResponsibilities/personJobResponsibilitiesDelete", |
| | | method: "delete ", |
| | | method: "delete", |
| | | params: query |
| | | }); |
| | | } |
| | |
| | | |
| | | <script> |
| | | import jsPDF from 'jspdf' |
| | | import workerUrl from 'pdfjs-dist/build/pdf.worker.min.mjs?worker&url' |
| | | |
| | | // åå®ç°ç¨ require("@/assets/stamps/" + name + ".png")ï¼Vite éæ²¡æ requireï¼ |
| | | // ç¨ import.meta.glob æå°ç« 徿æä¸å¼ ååâURL çè¡¨ï¼ææçä»·ã |
| | |
| | | this.$message.error('è¯·éæ© PDF æä»¶') |
| | | } |
| | | }, |
| | | loadPDF(typedArray) { |
| | | pdfjsLib.getDocument(typedArray).promise.then(pdfDoc_ => { |
| | | this.pdfDoc = pdfDoc_ |
| | | this.canvasNumPages = this.pdfDoc._pdfInfo.numPages |
| | | async loadPDF(typedArray) { |
| | | try { |
| | | // ç¨æ¬å°æå
ç pdf.jsï¼ä¸åä¾èµå
¬ç½ CDNï¼å
ç½å è½½ä¸å°ä¼é æé¢è§åºåªå©ç©ºç½ç»å¸ |
| | | const pdfjsLib = await import('pdfjs-dist/build/pdf.mjs') |
| | | pdfjsLib.GlobalWorkerOptions.workerSrc = workerUrl |
| | | const loadingTask = pdfjsLib.getDocument({ |
| | | data: typedArray, |
| | | useWasm: false, |
| | | useSystemFonts: true, |
| | | isEvalSupported: false |
| | | }) |
| | | const pdfDoc_ = await loadingTask.promise |
| | | // pdf.js 5 çç±»å
é¨ç¨äº # ç§æåæ®µï¼è¢« Vue3 ååºå¼å
æ Proxy å getPage 伿 |
| | | // "Cannot read private member ... from an object whose class did not declare it"ï¼å¿
é¡» markRaw |
| | | this.pdfDoc = markRaw(pdfDoc_) |
| | | this.canvasNumPages = pdfDoc_.numPages |
| | | this.stamps = [] |
| | | this.contextList = [] |
| | | for (let i = 1; i <= this.canvasNumPages; i++) { |
| | |
| | | }) |
| | | this.stamps.push([]) |
| | | } |
| | | }) |
| | | } catch (e) { |
| | | console.error('[UpPdfStamp] PDF å 载失败', e) |
| | | this.pdfDoc = null |
| | | this.canvasNumPages = 0 |
| | | this.stamps = [] |
| | | this.contextList = [] |
| | | this.$message.error('æä»¶é¢è§å¤±è´¥ï¼è¯·æ£æ¥æä»¶æ¯å¦æåæç¨åéè¯') |
| | | this.$emit('uploadPDFErr') |
| | | } |
| | | }, |
| | | // 渲ææå®é¡µé¢ |
| | | renderPage(pageNum) { |
| | | this.pdfDoc.getPage(pageNum).then(page => { |
| | | async renderPage(pageNum) { |
| | | try { |
| | | const page = await this.pdfDoc.getPage(pageNum) |
| | | const canvas = this.canvasEls[pageNum - 1] |
| | | if (!canvas) return |
| | | // åå®ç°æ¯ pushï¼ä½ç½®åå³äºå页 getPage ç Promise å®æé¡ºåºï¼ |
| | |
| | | canvas.width = viewport.width |
| | | canvas.height = viewport.height |
| | | |
| | | page |
| | | .render({ |
| | | canvasContext: this.contextList[pageNum - 1], |
| | | viewport: viewport |
| | | }) |
| | | .promise.then(() => { |
| | | this.stamps[pageNum - 1].forEach(m => { |
| | | this.drawStamps(m.x, m.y, pageNum - 1) |
| | | }) |
| | | }) |
| | | }) |
| | | await page.render({ |
| | | canvasContext: this.contextList[pageNum - 1], |
| | | viewport: viewport |
| | | }).promise |
| | | this.stamps[pageNum - 1].forEach(m => { |
| | | this.drawStamps(m.x, m.y, pageNum - 1) |
| | | }) |
| | | } catch (e) { |
| | | console.error('[UpPdfStamp] PDF 页颿¸²æå¤±è´¥', e) |
| | | this.$message.error('æä»¶é¢è§æ¸²æå¤±è´¥ï¼è¯·ç¨åéè¯') |
| | | this.$emit('uploadPDFErr') |
| | | } |
| | | }, |
| | | // åå»--æ·»å ç« |
| | | handleCanvasClick(event, i) { |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog v-model="addTrainingPlanDia" title="æ°å¢å¹è®è®¡å" width="50%" @close="closeAdd"> |
| | | <el-dialog v-model="addTrainingPlanDia" :title="operationType === 'edit' ? 'ç¼è¾å¹è®è®¡å' : 'æ°å¢å¹è®è®¡å'" width="50%" @close="closeAdd"> |
| | | <div class="body"> |
| | | <el-form ref="trainingPlanForm" :model="trainingPlan" label-position="right" label-width="90px" :rules="trainingPlanRules"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å¹è®æ¥æ:" prop="trainingDate"> |
| | | <el-date-picker v-model="trainingPlan.trainingDate" format="YYYY-MM" |
| | | placeholder="éæ©æ¥æ" size="small" value-format="YYYY-MM" |
| | | type="month" style="width: 100%"></el-date-picker> |
| | | <el-date-picker v-model="trainingPlan.trainingDate" format="YYYY-MM-DD" |
| | | placeholder="éæ©æ¥æ" size="small" value-format="YYYY-MM-DD" |
| | | type="date" style="width: 100%"></el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="课æ¶:" prop="classHour"> |
| | | <el-input type="number" v-model="trainingPlan.classHour" label="æè¿°æå" size="small"></el-input> |
| | | <el-input-number v-model="trainingPlan.classHour" :min="0" :max="9999" :precision="0" |
| | | controls-position="right" size="small" style="width: 100%"></el-input-number> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | planId: '', |
| | | id: '', |
| | | trainingDate: '', |
| | | classHour: '', |
| | | classHour: null, |
| | | trainingObjectives: '', |
| | | participants: '', |
| | | trainingContent: '', |
| | | trainingLecturerId: '', |
| | | trainingLecturerId: null, |
| | | trainingLecturerName: '', |
| | | trainingMode: '', |
| | | holdingDepartment: '', |
| | |
| | | this.operationType = type |
| | | if (this.operationType === 'edit') { |
| | | this.trainingPlan = this.HaveJson(row) |
| | | // å岿°æ®å¯è½åªåäºå¹´æï¼è¡¥é½å°å½æ1æ¥ï¼é¿å
æ¥ææ§ä»¶æ æ³åæ¾ |
| | | if (this.trainingPlan.trainingDate && /^\d{4}-\d{2}$/.test(this.trainingPlan.trainingDate)) { |
| | | this.trainingPlan.trainingDate += '-01' |
| | | } |
| | | this.lecturerType = row.trainingLecturerId ? 'internal' : (row.trainingLecturerName ? 'external' : 'internal') |
| | | } else { |
| | | this.lecturerType = 'internal' |
| | | this.trainingPlan = { |
| | | id: '', |
| | | trainingDate: '', |
| | | classHour: '', |
| | | classHour: null, |
| | | trainingObjectives: '', |
| | | participants: '', |
| | | trainingContent: '', |
| | | trainingLecturerId: '', |
| | | trainingLecturerId: null, |
| | | trainingLecturerName: '', |
| | | trainingMode: '', |
| | | holdingDepartment: '', |
| | | remarks: '', |
| | |
| | | } |
| | | this.trainingPlan.planId = id |
| | | this.getUserList() |
| | | this.$nextTick(() => { |
| | | this.$refs.trainingPlanForm && this.$refs.trainingPlanForm.clearValidate() |
| | | }) |
| | | }, |
| | | handleLecturerTypeChange(type) { |
| | | if (type === 'internal') { |
| | |
| | | this.trainingPlan.trainingLecturerName = null |
| | | } |
| | | this.submitAddLoading = true |
| | | this.trainingPlan.planId = this.currentChangeRow.id |
| | | if (!this.trainingPlan.planId) { |
| | | this.trainingPlan.planId = this.currentChangeRow.id |
| | | } |
| | | const personTrainingDetailed = this.trainingPlan |
| | | addOrUpdatePersonTrainingDetailed(personTrainingDetailed).then(res => { |
| | | this.submitAddLoading = false |
| | | if (res.code == 200) { |
| | | this.$message.success('æäº¤æå'); |
| | | this.closeAdd(); |
| | | } else { |
| | | this.$message.error(res.msg || 'æäº¤å¤±è´¥') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('æäº¤å¤±è´¥') |
| | | }).finally(() => { |
| | | this.submitAddLoading = false |
| | | }) |
| | | } |
| | |
| | | }, |
| | | // å
³éå¼¹æ¡ |
| | | closeAdd() { |
| | | this.$refs['trainingPlanForm'].resetFields(); |
| | | if (this.$refs['trainingPlanForm']) { |
| | | this.$refs['trainingPlanForm'].resetFields(); |
| | | } |
| | | this.$emit('search') |
| | | this.addTrainingPlanDia = false; |
| | | }, |
| | | // è·åè´è´£äººä¿¡æ¯æ¥å£ |
| | | // è·å讲å¸åé人ï¼å
¨ç³»ç»äººåï¼ä¸éæ¬é¨é¨ï¼ |
| | | getUserList() { |
| | | selectUserCondition({type: 2}).then(res => { |
| | | selectUserCondition({ isCustom: 0 }).then(res => { |
| | | if (res.code == 200) { |
| | | this.responsibleOptions = res.data |
| | | this.responsibleOptions = Array.isArray(res.data) ? res.data : [] |
| | | } else { |
| | | this.responsibleOptions = [] |
| | | } |
| | | }).catch(() => { |
| | | this.responsibleOptions = [] |
| | | }) |
| | | }, |
| | | }, |
| | |
| | | <div class="page-header"> |
| | | <h4><span class="line"></span><span>å¹è®ä¸èæ ¸è®°å½</span></h4> |
| | | <div class="btns"> |
| | | <el-button size="small" type="primary" @click="submitForm(3)" v-if="currentRow.state !== 1">æ¤é</el-button> |
| | | <el-button size="small" type="primary" @click="submitForm(3)" v-if="currentRow.state === 2">æ¤é</el-button> |
| | | <el-button size="small" type="primary" @click="submitForm(0)" v-if="currentRow.state !== 1">æäº¤</el-button> |
| | | <el-button size="small" @click="$emit('goBack')">è¿å</el-button> |
| | | </div> |
| | |
| | | current:1 |
| | | }, |
| | | addUserTableInfo: { |
| | | name: null, |
| | | type: 2 |
| | | name: null |
| | | }, |
| | | multipleSelection: [], |
| | | userList: [], |
| | |
| | | this.trainingForm = this.currentRow |
| | | this.getInfo() |
| | | this.getUserList() |
| | | this.isDisabled = this.trainingForm.assessmentUserId !== this.userId |
| | | this.isDisabled = this.trainingForm.assessmentUserId != this.userId |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | // è·åå½åæ°æ® |
| | | async getInfo() { |
| | | getInfo() { |
| | | this.trainingLoading = true |
| | | await trainingAndAssessmentRecordsPage({ |
| | | trainingAndAssessmentRecordsPage({ |
| | | trainingDetailedId: this.currentRow.id, |
| | | userName: this.userName |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.trainingTableData = res.data |
| | | this.trainingTableData = res.data || [] |
| | | } else { |
| | | this.trainingTableData = [] |
| | | this.$message.error(res.msg || 'èæ ¸äººåå 载失败') |
| | | } |
| | | }).catch(() => { |
| | | this.trainingTableData = [] |
| | | }).finally(() => { |
| | | this.trainingLoading = false |
| | | }) |
| | | }, |
| | | updatePersonResult(row) { |
| | | outOfFocusPreservation(row).then(res => { |
| | | this.$message.success("æä½æåï¼") |
| | | if (res.code == 200) { |
| | | this.$message.success("æä½æåï¼") |
| | | } else { |
| | | this.$message.error(res.msg || 'èæ ¸ç»æä¿å失败') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('èæ ¸ç»æä¿å失败') |
| | | }) |
| | | }, |
| | | addPerson() { |
| | | this.isSelectedList = this.trainingTableData.map(item => item.userId) |
| | | if (this.currentRow.state === 1) { |
| | | this.$message.warning('å¹è®å·²å®æï¼ä¸è½æ°å¢äººå') |
| | | return |
| | | } |
| | | this.selectUserDia = true; |
| | | this.multipleSelection = [] |
| | | this.selectUserList() |
| | | }, |
| | | selectUserList () { |
| | | selectUserList() { |
| | | this.tableLoading1 = true |
| | | selectUserCondition({...this.addUserTableInfo}).then(res => { |
| | | this.tableLoading1 = false |
| | | this.tableData1 = res.data |
| | | }).catch(err => { |
| | | selectUserCondition({ name: this.addUserTableInfo.name || '', isCustom: 0 }).then(res => { |
| | | // å·²å¨ååä¸ç人åä¸åéå¤å±ç¤ºï¼é¿å
é夿·»å |
| | | const existed = new Set(this.trainingTableData.map(item => String(item.userId))) |
| | | this.tableData1 = (res.data || []).filter(item => !existed.has(String(item.id))) |
| | | }).catch(() => {}).finally(() => { |
| | | this.tableLoading1 = false |
| | | }) |
| | | }, |
| | |
| | | this.multipleSelection = val |
| | | }, |
| | | selectUser() { |
| | | let selects = this.multipleSelection; |
| | | let selects = this.multipleSelection || []; |
| | | if (selects.length == 0) { |
| | | this.$message.error('æªéæ©æ°æ®'); |
| | | return; |
| | |
| | | list.push(obj) |
| | | }); |
| | | newPersonnelAddedToTrainingRecords(list).then(res => { |
| | | this.isSelectedList = [] |
| | | this.selectUserDia = false; |
| | | this.getInfo() |
| | | if (res.code == 200) { |
| | | this.$message.success('æ·»å æå') |
| | | this.multipleSelection = [] |
| | | this.selectUserDia = false; |
| | | this.getInfo() |
| | | } else { |
| | | this.$message.error(res.msg || 'æ·»å 失败') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('æ·»å 失败') |
| | | }) |
| | | }, |
| | | // æ¹éå é¤ |
| | |
| | | }, |
| | | batchDelete() { |
| | | if (this.multipleSelection.length > 0) { |
| | | let ids = this.multipleSelection.map(item => item.trainingRecordId).join(',') |
| | | let ids = this.multipleSelection.map(item => item.trainingRecordId).filter(id => id != null).join(',') |
| | | if (!ids) { |
| | | this.$message.warning('æé人å缺å°å¹è®è®°å½idï¼æ æ³å é¤') |
| | | return |
| | | } |
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤æéæ©çæ°æ®?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | |
| | | deleteTrainingAndAssessmentRecords({ids: ids}).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿å'); |
| | | this.multipleSelection = [] |
| | | this.getInfo() |
| | | } else { |
| | | this.$message.error(res.msg || 'å é¤å¤±è´¥') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('å é¤å¤±è´¥') |
| | | }); |
| | | }).catch(() => { |
| | | this.$message.warning('åæ¶å é¤'); |
| | | }); |
| | | }).catch(() => {}); |
| | | } else { |
| | | this.$message.warning('è¯·éæ©éè¦å é¤çæ°æ®') |
| | | } |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.search.size = val; |
| | | this.getInfo(); |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.search.current = val; |
| | | this.getInfo(); |
| | | }, |
| | | /** |
| | | * @desc æäº¤è¡¨å |
| | | * @desc æäº¤è¡¨å status=3 为æ¤éï¼å
¶ä»ä¸ºæäº¤ |
| | | */ |
| | | async submitForm(status) { |
| | | if (!this.trainingForm.id) { |
| | | this.$message.warning('å¹è®è®°å½ä¸åå¨ï¼è¯·è¿ååéæ°æå¼') |
| | | return |
| | | } |
| | | let state = this.currentRow.state |
| | | if (this.trainingForm.assessmentUserId) { |
| | | state = 2 |
| | | } |
| | | if (this.trainingForm.comprehensiveAssessment) { |
| | | state = 1 |
| | | } |
| | | if (status === 3) { |
| | | if (this.trainingForm.assessmentUserId != this.userId) { |
| | | this.$message.warning('æ¨ä¸æ¯æ¬æ¬¡å¹è®çè¯ä»·äººï¼æ æ³æ¤é') |
| | | return |
| | | } |
| | | state = 3 |
| | | } else if (state === 3) { |
| | | if (!this.trainingForm.assessmentUserId) { |
| | | this.$message.warning('请å
éæ©è¯ä»·äºº') |
| | | return |
| | | } |
| | | state = 2 |
| | | } else if (state === 2) { |
| | | if (this.trainingForm.assessmentUserId != this.userId) { |
| | | this.$message.warning('æ¨ä¸æ¯æ¬æ¬¡å¹è®çè¯ä»·äººï¼æ æ³æäº¤è¯ä»·') |
| | | return |
| | | } |
| | | if (!this.trainingForm.comprehensiveAssessment) { |
| | | this.$message.warning('è¯·å¡«åæ¬æ¬¡å¹è®ç»¼åè¯ä»·') |
| | | return |
| | | } |
| | | if (!this.trainingForm.assessmentDate) { |
| | | this.$message.warning('è¯·éæ©è¯ä»·æ¶é´') |
| | | return |
| | | } |
| | | state = 1 |
| | | } |
| | | let data = { |
| | | assessmentMethod: this.trainingForm.assessmentMethod, |
| | |
| | | assessmentDate: this.trainingForm.assessmentDate, |
| | | state: state |
| | | } |
| | | let code = {} |
| | | if (state === 2) { |
| | | code = await trainingAndAssessmentRecordsAdded(data) |
| | | } else { |
| | | code = await trainingAndAssessmentRecordsEvaluate(data) |
| | | } |
| | | this.isDisabled = this.trainingForm.assessmentUserId !== this.userId |
| | | if(code.code === 200) { |
| | | this.currentRow.state = state |
| | | this.$message.success("æä½æå") |
| | | try { |
| | | const res = state === 2 |
| | | ? await trainingAndAssessmentRecordsAdded(data) |
| | | : await trainingAndAssessmentRecordsEvaluate(data) |
| | | if (res.code === 200) { |
| | | this.trainingForm.state = state |
| | | this.currentRow.state = state |
| | | this.isDisabled = this.trainingForm.assessmentUserId != this.userId |
| | | this.$message.success("æä½æå") |
| | | } else { |
| | | this.$message.error(res.msg || 'æä½å¤±è´¥') |
| | | } |
| | | } catch (e) { |
| | | // é误æç¤ºç±è¯·æ±æ¦æªå¨ç»ä¸å¤ç |
| | | } |
| | | }, |
| | | getUserList(){ |
| | | selectUserCondition({ type: 2 }).then((res) => { |
| | | this.userList = res.data; |
| | | }) |
| | | selectUserCondition({ isCustom: 0 }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.userList = res.data || [] |
| | | } |
| | | }).catch(() => {}) |
| | | }, |
| | | } |
| | | }; |
| | |
| | | }, |
| | | // æ¥è¯¢éä»¶å表 |
| | | searchTableList () { |
| | | if (!this.info || !this.info.id) { |
| | | this.tableData = [] |
| | | return |
| | | } |
| | | this.tableLoading = true |
| | | getTrainingDetailedFileList({trainingDetailedId: this.info.id}).then(res => { |
| | | this.tableData = res.data || [] |
| | | }).catch(() => { |
| | | this.tableData = [] |
| | | }).finally(() => { |
| | | this.tableLoading = false |
| | | this.tableData = res.data |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | console.log('err---', err); |
| | | }) |
| | | }, |
| | | closeFilesLook () { |
| | |
| | | }).then(() => { |
| | | this.tableLoading = true |
| | | delTrainingDetailedFileList({detailedFileId: row.detailedFileId}).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿å') |
| | | this.searchTableList() |
| | | } else { |
| | | this.$message.error(res.msg || 'å é¤å¤±è´¥') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('å é¤å¤±è´¥') |
| | | }).finally(() => { |
| | | this.tableLoading = false |
| | | this.$message.success('å 餿å') |
| | | this.searchTableList() |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | console.log('err---', err); |
| | | }) |
| | | }).catch(() => {}) |
| | | }, |
| | | // ä¸ä¼ éªè¯ |
| | | fileBeforeUpload(file) { |
| | | let flag = true |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M'); |
| | | this.$refs.upload.clearFiles() |
| | | flag = false |
| | | return Promise.reject() |
| | | } |
| | | if (!flag) { |
| | | return Promise.reject(flag); //æ£ç¡®çç»æ¢ |
| | | if (!/\.(jpg|jpeg|png|gif|doc|docx|xls|xlsx|ppt|pptx|pdf|zip|rar)$/i.test(file.name || '')) { |
| | | this.$message.error('䏿¯æçæä»¶æ ¼å¼') |
| | | this.$refs.upload.clearFiles() |
| | | return Promise.reject() |
| | | } |
| | | }, |
| | | onError(err, file, fileList,type) { |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | this.$refs.upload.clearFiles() |
| | | this.$refs.upload && this.$refs.upload.clearFiles() |
| | | }, |
| | | handleSuccessUp(response, ) { |
| | | this.upLoading = false; |
| | | if (response.code == 200) { |
| | | this.$message.success('ä¸ä¼ æå'); |
| | | this.searchTableList() |
| | | handleSuccessUp(response) { |
| | | if (!response || response.code != 200) { |
| | | this.$message.error((response && (response.msg || response.message)) || 'ä¸ä¼ 失败') |
| | | return |
| | | } |
| | | this.$message.success('ä¸ä¼ æå'); |
| | | this.searchTableList() |
| | | }, |
| | | // æ¥çæä»¶ |
| | | handleLook(row){ |
| | |
| | | <template> |
| | | <div class="add"> |
| | | <el-dialog |
| | | :title="isEdit ?'ç¼è¾éä»¶èµæ':'æ°å¢éä»¶èµæ'" |
| | | :title="isEdit ? 'ç¼è¾ä»»èææè®°å½' : 'æ°å¢ä»»èææè®°å½'" |
| | | v-model="dialogVisible" |
| | | width="50%" |
| | | > |
| | |
| | | <el-upload ref="upload" style="float: left; margin: 0 12px 0 20px;" :action="action" |
| | | :headers="uploadHeader" |
| | | :show-file-list="false" |
| | | accept=".doc,.docx,.pdf,.jpg,.jpeg,.png" |
| | | :before-upload="beforeUpload" |
| | | :on-success="onSuccess"> |
| | | <template #trigger><el-button class="uploadFile" size="small" type="primary">ä¸ä¼ </el-button></template> |
| | | </el-upload> |
| | |
| | | rules: { |
| | | certificateNumber: [{ required: true, message: '请è¾å
¥è¯ä¹¦ç¼å·', trigger: 'blur' }], |
| | | userId: [{ required: true, message: 'è¯·éæ©è¢«ä»»è人å', trigger: 'change' }], |
| | | post: [{ required: true, message: 'ä»»èå²ä½', trigger: 'blur' }], |
| | | operationType: [{ required: true, message: 'æä½ç±»å', trigger: 'blur' }], |
| | | post: [{ required: true, message: '请è¾å
¥ä»»èå²ä½', trigger: 'blur' }], |
| | | operationType: [{ required: true, message: '请è¾å
¥æä½ç±»å', trigger: 'blur' }], |
| | | }, |
| | | loading: false, |
| | | userList: [] |
| | |
| | | }, |
| | | methods: { |
| | | onSuccess(response, file, fileList) { |
| | | this.form["systemFileName"] = response.data |
| | | if (response && response.code === 200 && response.data) { |
| | | this.form.systemFileName = response.data |
| | | this.form.fileName = file.name |
| | | this.$message.success('ä¸ä¼ æå') |
| | | } else { |
| | | this.$refs.upload && this.$refs.upload.clearFiles() |
| | | this.$message.error((response && response.msg) || 'ä¸ä¼ 失败') |
| | | } |
| | | }, |
| | | deleteFile(fileName) { |
| | | deleteCNASFile({fileName: fileName}).then(res => { |
| | | this.$message.success('å 餿åï¼') |
| | | this.form["systemFileName"] = null |
| | | if (!fileName) { |
| | | this.form.systemFileName = '' |
| | | return |
| | | } |
| | | this.$confirm('æ¯å¦å é¤å·²ä¸ä¼ çä¸å²è¯ä¹¦æä»¶?', 'è¦å', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteCNASFile({fileName: fileName}).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('å 餿åï¼') |
| | | this.form.systemFileName = '' |
| | | } else { |
| | | this.$message.error(res.msg || 'å é¤å¤±è´¥') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('å é¤å¤±è´¥') |
| | | }) |
| | | }).catch(() => {}) |
| | | }, |
| | | resetData() { |
| | | this.form = { |
| | | id: undefined, |
| | | certificateNumber: undefined, |
| | | userId: undefined, |
| | | post: undefined, |
| | | operationType: undefined, |
| | | fileList: [], |
| | | fileName: undefined, |
| | | systemFileName: undefined, |
| | | remarks: undefined, |
| | | num2: undefined, |
| | | num1: undefined |
| | | } |
| | | this.$nextTick(() => { |
| | | if (this.$refs.ruleForm) this.$refs.ruleForm.clearValidate() |
| | | if (this.$refs.upload) this.$refs.upload.clearFiles() |
| | | }) |
| | | }, |
| | | async openDialog(row, type) { |
| | | await this.getUserList() |
| | | this.dialogVisible = true |
| | | if(type) { |
| | | this.isEdit = true |
| | | this.isEdit = !!type |
| | | this.resetData() |
| | | if (type) { |
| | | this.form.id = row.id |
| | | this.form.certificateNumber = row.certificateNumber |
| | | this.form.userId = Number(row.userId) |
| | |
| | | this.form.remarks = row.remarks |
| | | this.form.num1 = row.num1 |
| | | this.form.num2 = row.num2 |
| | | } else { |
| | | this.resetForm('ruleForm') |
| | | } |
| | | this.dialogVisible = true |
| | | }, |
| | | closeDialog() { |
| | | this.resetForm('ruleForm') |
| | | this.dialogVisible = false |
| | | }, |
| | | /** |
| | |
| | | */ |
| | | async getUserList() { |
| | | try { |
| | | const res = await selectUserCondition() |
| | | const res = await selectUserCondition({ isCustom: 0 }) |
| | | if (res.code !== 200) throw new Error('人åå表æ¥å£è¿å失败') |
| | | this.userList = Array.isArray(res.data) ? res.data : [] |
| | | } catch (error) { |
| | |
| | | } |
| | | this.loading = true |
| | | addOrUpdatePersonPostAuthorizationRecord(params).then(res => { |
| | | this.loading = false |
| | | this.closeDialog() |
| | | this.$emit('refresh') |
| | | }).catch(err => { |
| | | if (res.code === 200) { |
| | | this.$message.success(this.isEdit ? 'ä¿®æ¹æå' : 'æ°å¢æå') |
| | | this.closeDialog() |
| | | this.$emit('refresh') |
| | | } else { |
| | | this.$message.error(res.msg || 'ä¿å失败') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('ä¿å失败') |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | } |
| | |
| | | beforeUpload(file) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M'); |
| | | this.$refs.upload.clearFiles() |
| | | return false; |
| | | } else { |
| | | this.form.fileList = [file] |
| | | this.form.fileName = file.name |
| | | return true; |
| | | } |
| | | const ext = (file.name.split('.').pop() || '').toLowerCase() |
| | | if (!['doc', 'docx', 'pdf', 'jpg', 'jpeg', 'png'].includes(ext)) { |
| | | this.$message.error('ä»
æ¯æä¸ä¼ docãdocxãpdfãjpgãpng æ ¼å¼çæä»¶'); |
| | | return false; |
| | | } |
| | | this.form.fileList = [file] |
| | | this.form.fileName = file.name |
| | | return true; |
| | | }, |
| | | } |
| | | } |
| | |
| | | <el-tree |
| | | ref="tree" |
| | | :data="list" |
| | | :default-expanded-keys="[22]" |
| | | :default-expanded-keys="expandedKeys" |
| | | :expand-on-click-node="false" |
| | | :filter-node-method="filterNode" |
| | | :props="{ children: 'children', label: 'name' }" |
| | |
| | | class="node_i" :name="data.children != undefined&&data.children.length>0 ? 'el-icon-folder-opened' : 'el-icon-tickets'"></lims-icon> |
| | | {{ data.name }}</span> |
| | | </el-col> |
| | | <el-col v-if="node.level>1 && data.id !== null" :span="2" style="text-align: right;"> |
| | | <el-col v-if="node.level>1 && data.id != null" :span="2" style="text-align: right;"> |
| | | <el-button size="small" link type="primary" @click.stop="remove(node, data)"> |
| | | <lims-icon name="el-icon-delete"></lims-icon> |
| | | </el-button> |
| | |
| | | <PersonnelList v-if="activeName === '人ååºæ¬ä¿¡æ¯' && isShowAll" ref="personnelList" :currentCompaniesList="currentCompaniesList" |
| | | :departId="departId" @refreshTree="refreshTree" |
| | | @updatePerson="updatePerson"></PersonnelList> |
| | | <personnelInformation v-if="activeName === '人ååºæ¬ä¿¡æ¯' && !isShowAll" :clickNodeVal="clickNodeVal"></personnelInformation> |
| | | <personnelInformation v-if="activeName === '人ååºæ¬ä¿¡æ¯' && !isShowAll" :clickNodeVal="clickNodeVal" |
| | | @refreshTree="refreshTree"></personnelInformation> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="å¹è®è®¡å" name="å¹è®è®¡å"> |
| | | <PersonnelTraining v-if="activeName === 'å¹è®è®¡å'" ref="personnelTraining" |
| | |
| | | <el-tab-pane label="人åè½å" name="人åè½å"> |
| | | <personnel-capacity v-if="activeName === '人åè½å'" ref="personnelCapacity" |
| | | :departId="departId" |
| | | :personName="isDepartment ? '' : (clickNodeVal.name || '')" |
| | | :isDepartment="isDepartment"></personnel-capacity> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | |
| | | activeName: '人ååºæ¬ä¿¡æ¯', |
| | | departId: 1, |
| | | list: [], |
| | | expandedKeys: [], |
| | | addDia: false, |
| | | addOb: { |
| | | name: '', |
| | |
| | | }, |
| | | methods: { |
| | | remove(node, data) { |
| | | this.$confirm("æ¯å¦å é¤è¯¥å±çº§", "æç¤º", { |
| | | type: "error" |
| | | this.$confirm(`ç¡®å®å 餿¶æâ${data.name}âåï¼<br/>è¯¥æ¶æä¸ä¸è½åå¨ä¸çº§æ¶ææäººåï¼å¦åæ æ³å é¤ã`, "æç¤º", { |
| | | type: "warning", |
| | | dangerouslyUseHTMLString: true |
| | | }).then(() => { |
| | | delDepartmentLims({ |
| | | id: data.id |
| | | }).then(res => { |
| | | this.$message.success('å·²å é¤') |
| | | this.geList(); |
| | | if (res.code == 200) { |
| | | this.$message.success('å·²å é¤') |
| | | if (this.addOb.fatherId === data.id) { |
| | | this.addOb.fatherId = '' |
| | | } |
| | | this.geList(); |
| | | } |
| | | }) |
| | | }).catch(e => {}) |
| | | }, |
| | | addStandardTree() { |
| | | if (this.addOb.name == null || this.addOb.factory == '') { |
| | | this.$message.error('ææ¶åç§°æ¯å¿
填项') |
| | | if (!this.addOb.name || String(this.addOb.name).trim() === '') { |
| | | this.$message.error('æ¶æåç§°æ¯å¿
填项') |
| | | return |
| | | } |
| | | addDepartmentLims(this.addOb).then(res => { |
| | | this.$message.success('æ·»å æå') |
| | | this.addDia = false |
| | | this.geList(); |
| | | this.addOb.name = '' |
| | | this.addOb.fatherId = '' |
| | | addDepartmentLims({ |
| | | name: String(this.addOb.name).trim(), |
| | | fatherId: this.addOb.fatherId |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ·»å æå') |
| | | this.addDia = false |
| | | this.addOb.name = '' |
| | | this.geList(); |
| | | } |
| | | }) |
| | | }, |
| | | handleAdd() { |
| | |
| | | }, |
| | | // 人åå表ç¼è¾ |
| | | updatePerson(row) { |
| | | const node = this.findNodeById(this.list, row.name); |
| | | const node = this.findNodeByUserId(this.list, row.userId); |
| | | if (node) { |
| | | this.handleNodeClick(node); |
| | | } else { |
| | | this.$message.warning('æªæ¾å°è¯¥äººå'); |
| | | this.$message.warning('æªæ¾å°è¯¥äººåï¼è¯·å·æ°å·¦ä¾§äººåæ åéè¯'); |
| | | } |
| | | }, |
| | | // æ°å»ºäººååå·æ°æ |
| | | // æ°å»º/ç¼è¾äººååå·æ°æ |
| | | refreshTree () { |
| | | this.geList() |
| | | }, |
| | | findNodeById(treeData, name) { |
| | | findNodeByUserId(treeData, userId) { |
| | | for (let i = 0; i < treeData.length; i++) { |
| | | if (treeData[i].name === name) { |
| | | if (treeData[i].userId !== undefined && treeData[i].userId !== null && treeData[i].userId == userId) { |
| | | return treeData[i]; // æ¾å°èç¹ï¼è¿å该èç¹ |
| | | } |
| | | if (treeData[i].children && treeData[i].children.length > 0) { |
| | | const foundNode = this.findNodeById(treeData[i].children, name); |
| | | const foundNode = this.findNodeByUserId(treeData[i].children, userId); |
| | | if (foundNode) { |
| | | return foundNode; // å¨åèç¹ä¸æ¾å°ï¼è¿å该èç¹ |
| | | } |
| | |
| | | // è·åæ |
| | | geList() { |
| | | selectCNSAPersonTree().then(res => { |
| | | this.list = res.data; |
| | | if(this.list.length > 0) { |
| | | this.list = res.data || []; |
| | | // å·æ°æ æ¶ä¸è¦æäººè§è§å¼ºè¡ååé¨é¨è§è§ï¼å¦åå
¶ä»æ ç¾é¡µä¼æ¿äººåidå½é¨é¨idæ¥è¯¢ |
| | | if (this.list.length > 0 && !(this.clickNodeVal && this.clickNodeVal.userId != null)) { |
| | | this.isDepartment = true; |
| | | } |
| | | this.expandedKeys = this.list.filter(item => item.id != null).map(item => item.id); |
| | | }).catch(() => { |
| | | this.list = [] |
| | | }); |
| | | }, |
| | | filterNode(value, data) { |
| | |
| | | this.clickNodeVal.level = node.level; |
| | | this.clickNodeVal.parent = node.parent.data; |
| | | } |
| | | this.entity.departLimsId = val.id; |
| | | this.addOb.fatherId = val.id; |
| | | // æ¯å¦æ¾ç¤ºè®¾å¤è¯¦æ
|
| | | this.isShowAll = val.id !== null; |
| | | if (val.id) { // 妿æ¯å®éªå®¤ |
| | | this.departId = val.id; |
| | | this.isDepartment = true; |
| | | } |
| | | if (val.userId) { // æ¯äººå |
| | | if (val.userId !== undefined && val.userId !== null) { |
| | | // æ¯äººåï¼å±ç¤ºäººå详æ
|
| | | this.isShowAll = false; |
| | | this.departId = val.userId; |
| | | this.isDepartment = false |
| | | this.isDepartment = false; |
| | | this.addOb.fatherId = ''; |
| | | } else { |
| | | // æ¯å®éªå®¤/é¨é¨ |
| | | this.isShowAll = true; |
| | | this.addOb.fatherId = val.id; |
| | | if (val.id) { |
| | | this.departId = val.id; |
| | | this.isDepartment = true; |
| | | } |
| | | } |
| | | }, |
| | | getNodeParent(val) { |
| | | if (val.parent != null) { |
| | | this.currentCompaniesList = []; |
| | | this.buildNodeParent(val); |
| | | }, |
| | | buildNodeParent(val) { |
| | | if (val.parent != null && val.data && val.data.id != null) { |
| | | this.currentCompaniesList[val.level - 1] = val.data.id; |
| | | this.selectTree += ' - ' + val.label; |
| | | this.getNodeParent(val.parent); |
| | | } |
| | | if (val.parent != null) { |
| | | this.buildNodeParent(val.parent); |
| | | } |
| | | } |
| | | } |
| | |
| | | <el-table-column label="æå±é¨é¨" min-width="180" prop="departLimsName"></el-table-column> |
| | | <el-table-column label="å·¥ä½ç®æ " min-width="180" prop="jobObjective"></el-table-column> |
| | | <el-table-column label="å²ä½èè´£" min-width="180" prop="jobResponsibilities"></el-table-column> |
| | | <el-table-column label="å½åç¶æ" min-width="120" prop="currentState"> |
| | | <template v-slot="scope"> |
| | | <el-tag v-if="scope.row.currentState" :type="stateTagType(scope.row.currentState)">{{ scope.row.currentState }}</el-tag> |
| | | <span v-else>-</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ä»»è人" min-width="180" prop="incumbentName"></el-table-column> |
| | | <el-table-column label="ä»»èäººå®¡æ ¸æ¥æ" min-width="180" prop="incumbentDate"></el-table-column> |
| | | <el-table-column label="主管" min-width="180" prop="supervisorName"></el-table-column> |
| | |
| | | <el-button v-if="!isDepartment || scope.row.currentState === 'å
³é'" size="small" link type="primary" |
| | | @click="handleViewClick(scope.row, 'view')">æ¥ç |
| | | </el-button> |
| | | <el-button v-if="isDepartment && scope.row.currentState !== 'å
³é'" size="small" link type="primary" |
| | | <el-button v-if="scope.row.currentState !== 'å
³é' && (isDepartment || scope.row.incumbentId == departId)" |
| | | size="small" link type="primary" |
| | | @click="handleViewClick(scope.row, 'edit')">ç¼è¾ |
| | | </el-button> |
| | | <el-button size="small" link type="primary" @click="downLoadPost(scope.row)">导åº</el-button> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" background style="margin-top: 10px" |
| | | <el-pagination v-model:current-page="search.current" v-model:page-size="search.size" |
| | | :page-sizes="[10, 20, 30, 50, 100]" :total="search.total" |
| | | layout="->,total, sizes, prev, pager, next, jumper" background style="margin-top: 10px" |
| | | @size-change="handleSizeChange" @current-change="handleCurrentChange"> |
| | | </el-pagination> |
| | | </div> |
| | | <!-- æ°å¢å²ä½èè´£ --> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="dialogVisible" title="æ°å¢å²ä½èè´£" |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="dialogVisible" |
| | | :title="operationType === 'view' ? 'æ¥çå²ä½èè´£' : (operationType === 'edit' ? 'ç¼è¾å²ä½èè´£' : 'æ°å¢å²ä½èè´£')" |
| | | width="50%" @close="resetForm"> |
| | | <el-steps :active="currentStep" align-center finish-status="success"> |
| | | <el-step v-for="(v, i) in steps" :key="i" :title="v" style="cursor:pointer" |
| | |
| | | <el-col v-if="currentStep === 0 || operationType === 'view'" :span="12"> |
| | | <el-form-item :rules="[{ required: currentStep === 0, message: 'è¯·éæ©ä»»è人', trigger: 'change' }]" |
| | | label="ä»»è人ï¼" prop="incumbentId"> |
| | | <el-select v-model="form.incumbentId" :disabled="operationType === 'view'" clearable filterable |
| | | <el-select v-model="form.incumbentId" :disabled="operationType === 'view' || !isDepartment" clearable filterable |
| | | placeholder="è¯·éæ©ä»»è人" size="small" style="width: 100%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | |
| | | </div> |
| | | </el-form> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button v-if="currentStep !== 0 && currentStep !== 3" @click="submitForm('3reject')">驳å</el-button> |
| | | <el-button v-if="currentStep === 0" @click="submitForm('2save')">ä¿å</el-button> |
| | | <el-button v-if="currentStep !== 3" type="primary" @click="submitForm('1submit')">{{ currentStep === 0 ? 'æäº¤' : |
| | | 'éè¿' |
| | | }}</el-button> |
| | | <el-button v-if="operationType !== 'view' && currentStep !== 0 && currentStep !== 3" |
| | | :loading="submitLoading" @click="submitForm('3reject')">驳å</el-button> |
| | | <el-button v-if="operationType !== 'view' && currentStep === 0" :loading="submitLoading" |
| | | @click="submitForm('2save')">ä¿å</el-button> |
| | | <el-button v-if="operationType !== 'view' && currentStep !== 3" type="primary" :loading="submitLoading" |
| | | @click="submitForm('1submit')">{{ currentStep === 0 ? 'æäº¤' : 'éè¿' }}</el-button> |
| | | <el-button @click="dialogVisible = false">å
³ é</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | } from "@/api/cnas/personal/personJobResponsibilities"; |
| | | import { selectUserCondition } from "@/api/cnas/resourceDemand/facilitiesEnvironment/facilitiesAndEnvironment"; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import { blobValidate } from "@/utils/ruoyi"; |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | total: 0 |
| | | }, |
| | | dialogVisible: false, |
| | | submitLoading: false, |
| | | downLoading: false, |
| | | currentStep: 0, // æ¥éª¤æ¡æ¾ç¤ºç¬¬å æ¥ |
| | | currentStepClick: 0, // ç¹å»æ¥éª¤æ¡åå |
| | | operationType: '', |
| | |
| | | }, |
| | | methods: { |
| | | addPost() { |
| | | this.dialogVisible = true; |
| | | if (!this.isDepartment && !this.departId) { |
| | | this.$message.warning('请å
å¨å·¦ä¾§éæ©äººåæé¨é¨') |
| | | return |
| | | } |
| | | this.operationType = ''; |
| | | this.form = { |
| | | postName: '', // å²ä½åç§° |
| | | jobObjective: '', // å·¥ä½ç®æ |
| | | jobResponsibilities: '', // å²ä½èè´£ |
| | | incumbentId: '', // ä»»è人 |
| | | incumbentId: this.isDepartment ? '' : this.departId, // 人åè§è§é»è®¤å°±æ¯å½å人å |
| | | supervisorId: '', // æä½äºº |
| | | submitPerson: '', // 主管 |
| | | submitDate: '', // æ¥æ |
| | |
| | | }; |
| | | this.currentStep = 0; |
| | | this.getUserList(); |
| | | this.dialogVisible = true; |
| | | }, |
| | | // æ¥è¯¢åè¡¨ä¿¡æ¯ |
| | | getPostList(userId) { |
| | |
| | | } |
| | | this.tableLoading = true |
| | | personJobResponsibilitiesSelect(params).then(res => { |
| | | this.tableLoading = false |
| | | this.tableData = res.data.records; |
| | | this.search.total = res.data.total; |
| | | }).catch(err => { |
| | | this.tableData = (res.data && res.data.records) || []; |
| | | this.search.total = (res.data && res.data.total) || 0; |
| | | }).catch(() => { |
| | | this.tableData = [] |
| | | this.search.total = 0 |
| | | }).finally(() => { |
| | | this.tableLoading = false |
| | | }) |
| | | }, |
| | | stateTagType(state) { |
| | | if (state === 'å
³é') return 'success' |
| | | if (state === 'æäº¤') return 'info' |
| | | return 'warning' |
| | | }, |
| | | userNameById(id) { |
| | | const item = this.responsibleOptions.find(opt => String(opt.id) === String(id)) |
| | | return item ? item.name : '' |
| | | }, |
| | | //æäº¤è¡¨å |
| | | async submitForm(saveState) { |
| | | if (this.submitLoading) { |
| | | return |
| | | } |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid === true || saveState !== '1submit') { |
| | | // ç»å½åç¯è设置åå»ºäººä¸æ¶é´ |
| | | let user = this.nickName; |
| | | const dateTime = dateFormat(new Date()); |
| | | // ç»å½åç¯è设置æä½äººä¸æ¶é´ï¼ä»»è人/主管ç¯èè®°å½å¯¹åºäººåå§åï¼ |
| | | const operatorName = this.nickName; |
| | | // 注æï¼dateFormat å·¥å
·åªè¯å«å°å hhï¼getHours() æ¬èº«å³ 24 å°æ¶å¶ |
| | | const dateTime = dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'); |
| | | // è·åå½åç¯èæä½äººä¸æ¥æ |
| | | switch (this.currentStep) { |
| | | case 0: |
| | | this.form.submittingOperator = user.name; |
| | | this.form.submittingOperator = operatorName; |
| | | this.form.submittingDate = dateTime; |
| | | break; |
| | | case 1: |
| | | this.form.incumbentOperator = user.name; |
| | | this.form.incumbentOperator = this.userNameById(this.form.incumbentId) || operatorName; |
| | | this.form.incumbentDate = dateTime; |
| | | break; |
| | | case 2: |
| | | this.form.supervisorOperator = user.name; |
| | | this.form.supervisorOperator = this.userNameById(this.form.supervisorId) || operatorName; |
| | | this.form.supervisorDate = dateTime; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | // è·åå½åç¯èè´è´£äºº |
| | | switch (saveState === '3reject' ? this.currentStep - 1 : this.currentStep) { |
| | | case 1: |
| | | this.form.currentResponsible = this.form.submittingOperator; |
| | | break; |
| | | case 2: |
| | | this.form.currentResponsible = this.form.incumbentOperator; |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | default: |
| | | break; |
| | | } |
| | | // å½åç¯èè´è´£äººï¼0-æäº¤äºº 1-ä»»è人 2-主管 3-æµç¨ç»æ |
| | | switch (currentStepAction) { |
| | | case 0: |
| | | this.form.currentResponsible = this.form.submittingOperator; |
| | | break; |
| | | case 1: |
| | | this.form.currentResponsible = this.userNameById(this.form.incumbentId); |
| | | break; |
| | | case 2: |
| | | this.form.currentResponsible = this.userNameById(this.form.supervisorId); |
| | | break; |
| | | default: |
| | | this.form.currentResponsible = ''; |
| | | break; |
| | | } |
| | | // è·åå½åç¶æ |
| | | this.form.currentState = currentStepAction === 3 ? 'å
³é' : this.steps[currentStepAction]; |
| | | personJobResponsibilitiesSave(this.form).then(res => { |
| | | // 空å¼è½¬ nullï¼é¿å
å端 Integer åæ®µæ¥æ¶å°ç©ºåç¬¦ä¸²å¯¼è´æäº¤å¤±è´¥ |
| | | const payload = { ...this.form }; |
| | | if (payload.supervisorId === '' || payload.supervisorId === undefined) payload.supervisorId = null; |
| | | if (payload.incumbentId === '' || payload.incumbentId === undefined) payload.incumbentId = null; |
| | | delete payload.submitPerson; |
| | | delete payload.submitDate; |
| | | this.submitLoading = true |
| | | personJobResponsibilitiesSave(payload).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æäº¤æå'); |
| | | this.getPostList(this.departId); |
| | | this.dialogVisible = false; |
| | | } else { |
| | | this.$message.error(res.msg || 'æäº¤å¤±è´¥') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('æäº¤å¤±è´¥') |
| | | }).finally(() => { |
| | | this.submitLoading = false |
| | | }); |
| | | } else { |
| | | let step = this.steps[this.currentStep]; |
| | |
| | | handleViewClick(row, type) { |
| | | this.operationType = type; |
| | | this.getUserList(); |
| | | row.incumbentId = Number(row.incumbentId); |
| | | this.form = { ...row }; |
| | | this.form.incumbentId = row.incumbentId != null ? Number(row.incumbentId) : null; |
| | | this.form.supervisorId = row.supervisorId != null ? Number(row.supervisorId) : null; |
| | | switch (row.currentState) { |
| | | case 'æäº¤': |
| | | this.currentStep = 0; |
| | |
| | | default: |
| | | break; |
| | | } |
| | | this.form.currentState = this.currentStep; |
| | | this.currentStepClick = this.currentStep === 3 ? 0 : this.currentStep |
| | | console.log('this.form---', this.form); |
| | | this.dialogVisible = true; |
| | | }, |
| | | // ä¸è½½å²ä½èè´£ |
| | | downLoadPost(row) { |
| | | exportPersonJobResponsibilities({ id: row.id }).then(res => { |
| | | if (this.downLoading) { |
| | | return |
| | | } |
| | | this.downLoading = true |
| | | exportPersonJobResponsibilities({ id: row.id }).then(async res => { |
| | | if (!blobValidate(res)) { |
| | | const rspObj = JSON.parse(await res.text()) |
| | | this.$message.error(rspObj.msg || rspObj.message || '导åºå¤±è´¥') |
| | | return |
| | | } |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, row.incumbentName + '-å²ä½èè´£' + '.docx'); |
| | | this.$download.saveAs(blob, (row.incumbentName || row.postName || 'å²ä½èè´£') + '-å²ä½èè´£' + '.docx'); |
| | | }).catch(() => {}).finally(() => { |
| | | this.downLoading = false |
| | | }) |
| | | }, |
| | | // å é¤å²ä½èè´£ |
| | | deletePost(row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å 餿¤æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | this.$confirm(`ç¡®å®å é¤â${row.postName || '该å²ä½èè´£'}âåï¼`, 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿å'); |
| | | this.getPostList(this.departId); |
| | | } else { |
| | | this.$message.error(res.msg || 'å é¤å¤±è´¥') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('å é¤å¤±è´¥') |
| | | }); |
| | | }).catch(() => { |
| | | this.$message.error('å é¤å¤±è´¥'); |
| | | }); |
| | | }).catch(() => {}); |
| | | }, |
| | | resetForm() { |
| | | this.$refs.form.resetFields(); |
| | | if (this.$refs.form) { |
| | | this.$refs.form.resetFields(); |
| | | } |
| | | this.submitLoading = false |
| | | }, |
| | | refreshTable() { |
| | | this.search.current = 1; |
| | | this.getPostList(this.departId); |
| | | }, |
| | | // è·åè´è´£äººä¿¡æ¯æ¥å£ |
| | | // è·åè´è´£äººä¿¡æ¯æ¥å£ï¼ä»»è人ã主管ä»å
¨å
¬å¸äººåä¸éæ©ï¼ |
| | | getUserList() { |
| | | selectUserCondition({type: 2}).then(res => { |
| | | selectUserCondition({ isCustom: 0 }).then(res => { |
| | | if (res.code == 200) { |
| | | this.responsibleOptions = res.data |
| | | this.responsibleOptions = Array.isArray(res.data) ? res.data : [] |
| | | } else { |
| | | this.responsibleOptions = [] |
| | | } |
| | | }).catch(() => { |
| | | this.responsibleOptions = [] |
| | | }) |
| | | }, |
| | | choiceStep(index) { |
| | | this.currentStepClick = index; |
| | | // æ¥çæ¶å¯åæ¢æ¥éª¤æ¥çåç¯èä¿¡æ¯ï¼ç¼è¾æ¶ä¸å
许跳æ¥éª¤ |
| | | if (this.operationType === 'view') { |
| | | this.currentStep = index |
| | | this.currentStepClick = index; |
| | | } |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.search.size = val; |
| | | this.search.current = 1; |
| | | this.getPostList(this.departId); |
| | | }, |
| | | handleCurrentChange(val) { |
| | |
| | | watch: { |
| | | departId: { |
| | | handler(newId, oldId) { |
| | | this.search.current = 1; |
| | | this.getPostList(newId); |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <div class="flex_column"> |
| | | <div> |
| | | <div v-if="isDepartment" style="display: flex;justify-content: space-between;margin-bottom: 10px"> |
| | | <el-button size="small" type="primary" @click="getTableData">å·æ°</el-button> |
| | | <el-button size="small" type="primary" :icon="$icon('el-icon-plus')" @click="openDialog">æ°å¢</el-button> |
| | | <div style="display: flex;justify-content: space-between;margin-bottom: 10px"> |
| | | <el-button size="small" type="primary" @click="refreshTable">å·æ°</el-button> |
| | | <el-button v-if="isDepartment" size="small" type="primary" :icon="$icon('el-icon-plus')" @click="openDialog">æ°å¢</el-button> |
| | | </div> |
| | | <lims-table :tableData="tableData" :column="columnData" |
| | | @pagination="page" :height="'calc(100vh - 18em)'" |
| | |
| | | deletePersonPostAuthorizationRecord, exportPersonPostAuthorizationRecord, |
| | | PersonPostAuthorizationRecordPage |
| | | } from "@/api/cnas/personal/personPostAuthorizationRecord"; |
| | | import {delCustomById} from "@/api/system/customer"; |
| | | import { blobValidate } from "@/utils/ruoyi"; |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | return { |
| | | columnData: [ |
| | | { |
| | | label: 'åºå·', |
| | | prop: 'id' |
| | | }, { |
| | | label: 'è¯ä¹¦ç¼å·', |
| | | prop: 'certificateNumber' |
| | | }, { |
| | |
| | | size: 20, |
| | | total: 0 |
| | | }, |
| | | loading: false |
| | | loading: false, |
| | | downLoading: false |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | openDialog(row, type=false) { |
| | | this.$refs.mandateModal.openDialog(row, type) |
| | | }, |
| | | refreshTable() { |
| | | this.pagination.current = 1 |
| | | this.getTableData() |
| | | }, |
| | | /** |
| | | * @desc æ¥è¯¢è¡¨æ ¼æ°æ® |
| | | */ |
| | | async getTableData() { |
| | | const params = this.isDepartment ? { |
| | | departLimsId: this.departId, |
| | | const params = { |
| | | current: this.pagination.current, |
| | | size: this.pagination.pageSize |
| | | } : { |
| | | userId: this.departId, |
| | | current: this.pagination.current, |
| | | size: this.pagination.pageSize |
| | | size: this.pagination.size |
| | | } |
| | | if (this.isDepartment) { |
| | | params.departLimsId = this.departId |
| | | } else { |
| | | params.userId = this.departId |
| | | } |
| | | this.loading = true |
| | | PersonPostAuthorizationRecordPage(params).then(res => { |
| | | try { |
| | | const res = await PersonPostAuthorizationRecordPage(params) |
| | | this.tableData = (res.data && res.data.records) || [] |
| | | this.pagination.total = (res.data && res.data.total) || 0 |
| | | } catch (e) { |
| | | this.tableData = [] |
| | | this.pagination.total = 0 |
| | | } finally { |
| | | this.loading = false |
| | | this.tableData = res.data.records |
| | | this.pagination.total = res.data.total |
| | | }).catch(err => { |
| | | this.loading = false |
| | | }) |
| | | } |
| | | }, |
| | | page (page) { |
| | | this.pagination.size = page.limit |
| | | this.pagination.current = page.page |
| | | this.getTableData() |
| | | }, |
| | | /** |
| | | * @desc å é¤ä»»èè®°å½ |
| | | */ |
| | | deleteNotify(id) { |
| | | this.$confirm('æ¯å¦å é¤å½åæ°æ®?', "è¦å", { |
| | | this.$confirm('å é¤åè¯¥ä»»èææè®°å½åå
¶ä¸ä¼ çä¸å²è¯ä¹¦æä»¶å°ä¸å¹¶å é¤ï¼æ¯å¦ç»§ç»?', "è¦å", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }).then(() => { |
| | | deletePersonPostAuthorizationRecord({id: id}).then(res => { |
| | | this.$message.success('å 餿å') |
| | | this.getTableData() |
| | | if (res.code === 200) { |
| | | this.$message.success('å 餿å') |
| | | this.getTableData() |
| | | } else { |
| | | this.$message.error(res.msg || 'å é¤å¤±è´¥') |
| | | } |
| | | }).catch(e => { |
| | | this.$message.error('å é¤å¤±è´¥') |
| | | }) |
| | | }).catch(() => {}) |
| | | }, |
| | | handleDown(row){ |
| | | exportPersonPostAuthorizationRecord({id:row.id}).then(res => { |
| | | const blob = new Blob([res],{ type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, 'ä»»èææ-'+row.certificateNumber+'-'+row.post + '.docx') |
| | | }) |
| | | async handleDown(row) { |
| | | if (this.downLoading) return |
| | | if (!row.id) { |
| | | this.$message.warning('缺å°ä»»èææè®°å½idï¼æ æ³ä¸è½½') |
| | | return |
| | | } |
| | | this.downLoading = true |
| | | try { |
| | | const res = await exportPersonPostAuthorizationRecord({id: row.id}) |
| | | if (blobValidate(res)) { |
| | | const blob = new Blob([res], {type: 'application/octet-stream'}) |
| | | this.$download.saveAs(blob, (row.userName || 'ä»»èææ') + 'çæ£æµäººåä¸å²è¯.docx') |
| | | } else { |
| | | const text = await res.text() |
| | | let message = 'ä¸è½½å¤±è´¥' |
| | | try { |
| | | message = JSON.parse(text).msg || message |
| | | } catch (e) {} |
| | | this.$message.error(message) |
| | | } |
| | | } catch (e) { |
| | | this.$message.error('ä¸è½½å¤±è´¥') |
| | | } finally { |
| | | this.downLoading = false |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | departId: { |
| | | handler(newId, oldId) { |
| | | if (newId) { |
| | | this.pagination.current = 1 |
| | | this.getTableData(); |
| | | } else { |
| | | this.tableData = [] |
| | | this.pagination.total = 0 |
| | | } |
| | | } |
| | | } |
| | |
| | | </div> |
| | | </div> |
| | | <div style="line-height: 30px;"> |
| | | <el-button v-if="!isDepartment" size="small" type="primary" @click="addAppointPost('add')">æ°å¢</el-button> |
| | | <el-button size="small" type="primary" @click="addAppointPost('add')">æ°å¢</el-button> |
| | | </div> |
| | | </div> |
| | | <lims-table :tableData="tableData" :column="yearColumnData" |
| | |
| | | <el-form v-if="dialogVisible" ref="infoForm" :model="form" :rules="rules"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="人åï¼" label-width="110px" prop="userId"> |
| | | <el-select v-model="form.userId" disabled clearable |
| | | <el-select v-model="form.userId" :disabled="operationType !== 'add' || !isDepartment" clearable |
| | | filterable size="small" style="width: 100%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="relatedYearsRemarks "> |
| | | <el-input v-model="form.relatedYearsRemarks " :disabled="operationType === 'view' || operationType === 'confirm'" size="small"></el-input> |
| | | <el-form-item prop="relatedYearsRemarks"> |
| | | <el-input v-model="form.relatedYearsRemarks" :disabled="operationType === 'view' || operationType === 'confirm'" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item prop="confirmDate" label="确认æ¶é´ï¼"> |
| | | <el-date-picker v-model="form.confirmDate" |
| | | format="YYYY-MM-DD" |
| | | :disabled="operationType === 'view' || operationType === 'confirm'" |
| | | placeholder="éæ©æ¥æ" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | disabled |
| | | placeholder="确认åç±ç³»ç»èªå¨è®°å½" |
| | | size="small" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | type="date"></el-date-picker> |
| | | type="datetime"></el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-form> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button v-if="operationType !== 'view'" @click="resetForm">åæ¶</el-button> |
| | | <el-button @click="resetForm">{{ operationType === 'view' ? 'å
³é' : 'åæ¶' }}</el-button> |
| | | <el-button v-if="operationType !== 'view' && operationType !== 'confirm'" type="primary" @click="submitForm">ä¿å</el-button> |
| | | <el-button v-if="operationType !== 'view' && operationType !== 'confirm'" type="primary" @click="submitForm1">æäº¤å¹¶éç¥</el-button> |
| | | <el-button v-if="operationType === 'confirm'" type="primary" @click="verifyGet">确认</el-button> |
| | |
| | | submitConfirmPersonnelCapability |
| | | } from "@/api/cnas/personal/personPersonnelCapacity"; |
| | | import {selectUserCondition} from "@/api/cnas/resourceDemand/facilitiesEnvironment/facilitiesAndEnvironment"; |
| | | import {basicInformationOfPersonnelSelectPage} from "@/api/cnas/personal/personalList"; |
| | | import {blobValidate} from "@/utils/ruoyi"; |
| | | import {mapGetters} from "@/utils/store-compat"; |
| | | |
| | | export default { |
| | |
| | | isDepartment: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | personName: { |
| | | type: String, |
| | | default: '' |
| | | } |
| | | }, |
| | | components: { |
| | |
| | | return 'å¯è任该å²ä½'; |
| | | } else if (params == 'You can work while training') { |
| | | return 'å¯è¾¹å¹è®è¾¹ä¸å²'; |
| | | } else { |
| | | } else if (params == 'Iconpetent for the position') { |
| | | return 'ä¸è任该å²ä½'; |
| | | } else { |
| | | return '-'; |
| | | } |
| | | }, |
| | | formatType: (params) => { |
| | |
| | | return 'success'; |
| | | } else if (params == 'You can work while training') { |
| | | return 'warning'; |
| | | } else { |
| | | } else if (params == 'Iconpetent for the position') { |
| | | return 'danger'; |
| | | } else { |
| | | return 'info'; |
| | | } |
| | | } |
| | | }, { |
| | |
| | | }, { |
| | | label: 'ç¡®è®¤æ¥æ', |
| | | prop: 'confirmDate', |
| | | width: '160' |
| | | width: '170' |
| | | }, { |
| | | dataType: 'action', |
| | | label: 'æä½', |
| | |
| | | verifyGetId: '', |
| | | form: {}, |
| | | responsibleOptions: [], |
| | | personOptions: [], |
| | | saving: false, |
| | | downLoading: false, |
| | | rules: { |
| | | confirmOperatingPersonnelId: [{ required: true, message: 'è¯·éæ©ç¡®è®¤äºº', trigger: 'change' }], |
| | | confirmDate: [{ required: true, message: 'è¯·éæ©ç¡®è®¤æ¶é´', trigger: 'change' }], |
| | | userId: [{ required: true, message: 'è¯·éæ©äººå', trigger: 'change' }], |
| | | academicDegree: [{ required: true, message: '请è¾å
¥å¦åæ¥æ ¸ç»æ', trigger: 'blur' }], |
| | | academicConformNot: [{ required: true, message: 'è¯·éæ©å¦å符åä¸å¦', trigger: 'change' }], |
| | | relatedYears: [{ required: true, message: '请è¾å
¥ç¸å
³å¹´éæ¥æ ¸ç»æ', trigger: 'blur' }], |
| | | relatedYearsConformNot: [{ required: true, message: 'è¯·éæ©ç¸å
³å¹´é符åä¸å¦', trigger: 'change' }], |
| | | relatedTraining: [{ required: true, message: '请è¾å
¥ç¸å¹è®éæ¥æ ¸ç»æ', trigger: 'blur' }], |
| | | relatedTraining: [{ required: true, message: '请è¾å
¥ç¸å
³å¹è®æ¥æ ¸ç»æ', trigger: 'blur' }], |
| | | relatedTrainingConformNot: [{ required: true, message: 'è¯·éæ©ç¸å
³å¹è®ç¬¦åä¸å¦', trigger: 'change' }], |
| | | relevantExperience: [{ required: true, message: '请è¾å
¥ç¸å
³ç»éªæ¥æ ¸ç»æ', trigger: 'blur' }], |
| | | relevantExperienceConformNot: [{ required: true, message: 'è¯·éæ©ç¸å
³ç»éªç¬¦åä¸å¦', trigger: 'change' }], |
| | |
| | | }, |
| | | methods: { |
| | | // ä¸è½½ |
| | | downLoadPost(row) { |
| | | exportPersonnelCapacity({id: row.id}).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res],{ type: 'application/msword' }); |
| | | this.$download.saveAs(blob, '人åè½å导åº.docx') |
| | | }) |
| | | async downLoadPost(row) { |
| | | if (this.downLoading) return |
| | | if (!row.id) { |
| | | this.$message.warning('缺å°äººåè½åè®°å½idï¼æ æ³å¯¼åº') |
| | | return |
| | | } |
| | | this.downLoading = true |
| | | try { |
| | | const res = await exportPersonnelCapacity({id: row.id}) |
| | | if (blobValidate(res)) { |
| | | const blob = new Blob([res], {type: 'application/msword'}) |
| | | this.$download.saveAs(blob, (row.userName || '人åè½å') + '人åè½å认å®.docx') |
| | | } else { |
| | | const text = await res.text() |
| | | let message = '导åºå¤±è´¥' |
| | | try { |
| | | message = JSON.parse(text).msg || message |
| | | } catch (e) {} |
| | | this.$message.error(message) |
| | | } |
| | | } catch (e) { |
| | | this.$message.error('导åºå¤±è´¥') |
| | | } finally { |
| | | this.downLoading = false |
| | | } |
| | | }, |
| | | // æ¥è¯¢ |
| | | refreshTable() { |
| | | this.search.current = 1 |
| | | this.getList(this.departId); |
| | | }, |
| | | // è·å人åè½ååè¡¨ä¿¡æ¯ |
| | |
| | | } |
| | | this.yearLoading = true |
| | | personPersonnelCapacityPage(params).then(res => { |
| | | this.yearLoading = false |
| | | this.tableData = res.data.records; |
| | | this.search.total = res.data.total; |
| | | this.tableData = (res.data && res.data.records) || []; |
| | | this.search.total = (res.data && res.data.total) || 0; |
| | | }).catch(err => { |
| | | console.log(err); |
| | | this.tableData = [] |
| | | this.search.total = 0 |
| | | }).finally(() => { |
| | | this.yearLoading = false |
| | | }) |
| | | }, |
| | | pagination (page) { |
| | | this.search.size = page.limit |
| | | this.refreshTable() |
| | | this.search.current = page.page |
| | | this.getList(this.departId) |
| | | }, |
| | | changeLine (val) { |
| | | if(val) { |
| | |
| | | }, |
| | | // æ°å¢ |
| | | addAppointPost(type) { |
| | | if (this.departId == null) { |
| | | this.$message.warning('请å
å¨å·¦ä¾§éæ©äººåæé¨é¨') |
| | | return |
| | | } |
| | | this.operationType = type; |
| | | this.title = 'æ°å¢è½å认å®' |
| | | this.dialogVisible = true; |
| | | this.form = {} |
| | | this.form.userId = this.departId |
| | | this.verifyGetId = '' |
| | | if (!this.isDepartment) { |
| | | this.form.userId = this.departId |
| | | this.personOptions = [{id: this.departId, name: this.personName || 'å½å人å'}] |
| | | } else { |
| | | this.personOptions = [] |
| | | this.getPersonList() |
| | | } |
| | | this.dialogVisible = true; |
| | | this.getUserList(); |
| | | |
| | | }, |
| | | // ç¼è¾/æ¥ç |
| | | // ç¼è¾/æ¥ç/确认 |
| | | handleViewClick(type, row) { |
| | | this.operationType = type; |
| | | this.verifyGetId = row.id |
| | | this.title = this.operationType === 'edit' ? 'ä¿®æ¹è½å认å®' : 'æ¥çè½å认å®' |
| | | this.title = type === 'edit' ? 'ä¿®æ¹è½å认å®' : (type === 'confirm' ? '确认è½å认å®' : 'æ¥çè½å认å®') |
| | | this.dialogVisible = true; |
| | | this.form = {...row} |
| | | this.personOptions = [{id: row.userId, name: row.userName}] |
| | | this.getUserList(); |
| | | }, |
| | | // ä¿å |
| | | submitForm() { |
| | | if (this.saving) return |
| | | this.$refs.infoForm.validate((valid) => { |
| | | if (valid) { |
| | | this.saving = true |
| | | addOrUpdatePersonPersonnelCapacity(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æäº¤æå'); |
| | | this.$message.success('ä¿åæå'); |
| | | this.getList(this.departId); |
| | | this.dialogVisible = false; |
| | | } else { |
| | | this.$message.error(res.msg || 'ä¿å失败') |
| | | } |
| | | }); |
| | | }).catch(() => { |
| | | this.$message.error('ä¿å失败') |
| | | }).finally(() => { |
| | | this.saving = false |
| | | }) |
| | | } |
| | | }); |
| | | }, |
| | | // æäº¤å¹¶éç¥ |
| | | submitForm1() { |
| | | if (this.saving) return |
| | | this.$refs.infoForm.validate((valid) => { |
| | | if (valid) { |
| | | submitConfirmPersonnelCapability(this.form).then(res => { |
| | | this.saving = true |
| | | const params = {...this.form} |
| | | // ç¡®è®¤æ¥æç±ç¡®è®¤äººå¨ç¡®è®¤æ¶ç±ç³»ç»è®°å½ï¼æäº¤æ¶ä¸ä¸ä¼ |
| | | delete params.confirmDate |
| | | submitConfirmPersonnelCapability(params).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æäº¤æå'); |
| | | this.$message.success('æäº¤æåï¼å·²éç¥ç¡®è®¤äºº'); |
| | | this.getList(this.departId); |
| | | this.dialogVisible = false; |
| | | } else { |
| | | this.$message.error(res.msg || 'æäº¤å¤±è´¥') |
| | | } |
| | | }); |
| | | }).catch(() => { |
| | | this.$message.error('æäº¤å¤±è´¥') |
| | | }).finally(() => { |
| | | this.saving = false |
| | | }) |
| | | } |
| | | }); |
| | | }, |
| | | verifyGet () { |
| | | if (this.saving) return |
| | | this.saving = true |
| | | confirmPersonnelCapability({id: this.verifyGetId}).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('确认æå'); |
| | | this.resetForm() |
| | | this.getList(this.departId); |
| | | } else { |
| | | this.$message.error(res.msg || '确认失败') |
| | | } |
| | | }); |
| | | }).catch(() => { |
| | | this.$message.error('确认失败') |
| | | }).finally(() => { |
| | | this.saving = false |
| | | }) |
| | | }, |
| | | // å é¤å²ä½èè´£ |
| | | // å é¤äººåè½åè®°å½ |
| | | deletePost(id) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å 餿¤æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿å'); |
| | | this.getList(this.departId); |
| | | } else { |
| | | this.$message.error(res.msg || 'å é¤å¤±è´¥') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('å é¤å¤±è´¥'); |
| | | }); |
| | | }).catch(() => { |
| | | this.$message.error('å é¤å¤±è´¥'); |
| | | }); |
| | | }).catch(() => {}); |
| | | }, |
| | | resetForm() { |
| | | this.$refs.infoForm.resetFields(); |
| | | this.dialogVisible = false; |
| | | this.$nextTick(() => { |
| | | if (this.$refs.infoForm) { |
| | | this.$refs.infoForm.resetFields(); |
| | | } |
| | | }) |
| | | }, |
| | | getUserList(){ |
| | | selectUserCondition({type: 2}).then(res => { |
| | | if (res.code == 200) { |
| | | this.responsibleOptions = res.data |
| | | this.responsibleOptions = res.data || [] |
| | | } |
| | | }).catch(() => { |
| | | this.responsibleOptions = [] |
| | | }) |
| | | }, |
| | | // é¨é¨è§è§æ°å¢æ¶ï¼å¯éæ¬é¨é¨ä¸ç人å |
| | | getPersonList() { |
| | | basicInformationOfPersonnelSelectPage({departmentId: this.departId, size: 1000, current: 1}).then(res => { |
| | | const records = (res.data && res.data.records) || [] |
| | | this.personOptions = records.map(item => ({id: item.userId, name: item.name})) |
| | | }).catch(() => { |
| | | this.personOptions = [] |
| | | }) |
| | | }, |
| | | }, |
| | |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | departId: { |
| | | handler(newId, oldId) { |
| | | this.getList(newId); |
| | | this.search.current = 1 |
| | | if (newId) { |
| | | this.getList(newId); |
| | | } else { |
| | | this.tableData = [] |
| | | this.search.total = 0 |
| | | } |
| | | } |
| | | }, |
| | | } |
| | |
| | | <div> |
| | | <div style="text-align: right;margin-bottom: 10px"> |
| | | <!-- <el-button size="small" @click="$emit('goBackList')">è¿å</el-button>--> |
| | | <el-button size="small" type="primary" @click="downPerson">ä¸è½½æ¡£æ¡</el-button> |
| | | <el-button :loading="downLoading" size="small" type="primary" @click="downPerson">ä¸è½½æ¡£æ¡</el-button> |
| | | <el-button size="small" type="primary" @click="dialogVisible = true">人ååç±»</el-button> |
| | | <el-button :loading="saveLoading" size="small" type="primary" @click="save">ä¿å</el-button> |
| | | </div> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-upload ref="upload" :action="action" :headers="uploadHeader" |
| | | <el-upload ref="pictureUpload" :action="action" :headers="uploadHeader" |
| | | accept=".jpg,.jpeg,.png" :before-upload="imageBeforeUpload" |
| | | :on-success="(response, file, fileList) => onSuccess(response, file, fileList, 'pictureUrl')" |
| | | :show-file-list="false" style="float: left; margin: 0 10px 0 10px;"> |
| | | <template #trigger><el-button class="uploadFile" size="small" type="primary">ä¸ä¼ </el-button></template> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-upload ref="upload" :action="action" :headers="uploadHeader" |
| | | <el-upload ref="signatureUpload" :action="action" :headers="uploadHeader" |
| | | accept=".jpg,.jpeg,.png" :before-upload="imageBeforeUpload" |
| | | :on-success="(response, file, fileList) => onSuccess(response, file, fileList, 'signatureUrl')" |
| | | :show-file-list="false" style="float: left; margin: 0 10px 0 10px;"> |
| | | <template #trigger><el-button class="uploadFile" size="small" type="primary">ä¸ä¼ </el-button></template> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-upload ref='upload' :action="fileAction" :auto-upload="true" :data="{ userId: clickNodeVal.userId }" |
| | | <el-upload ref='fileUpload' :action="fileAction" :auto-upload="true" :data="{ userId: clickNodeVal.userId }" |
| | | :before-upload="fileBeforeUpload" :headers="uploadHeader" :on-error="onError" |
| | | :on-success="handleSuccessUp" :show-file-list="false" |
| | | accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' |
| | |
| | | </el-dialog> |
| | | |
| | | <!-- æ°å¢éä»¶èµæ --> |
| | | <el-dialog :before-close="handleClose" :title="title" v-model="dialogVisible1" width="40%" |
| | | @open="getComparisonList"> |
| | | <el-dialog :before-close="handleClose" :title="title" v-model="dialogVisible1" width="40%"> |
| | | <el-form ref="annex" :model="annex" :rules="rules" label-width="100px"> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | |
| | | updateBasicInfoWorkList |
| | | } from "@/api/cnas/personal/personalList"; |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { blobValidate } from "@/utils/ruoyi"; |
| | | |
| | | export default { |
| | | props: { |
| | |
| | | return { |
| | | operationType: '', |
| | | basicInfoWorkId: '', |
| | | downLoading: false, |
| | | dialogVisible2: false, |
| | | annex2: { |
| | | workExperience: '' |
| | |
| | | dialogVisible: false, |
| | | checkList: [], |
| | | successFileList: [], // 鲿¢å端åºç°èæ°æ® |
| | | pendingDeleteFiles: [], // ä¿åæåååå é¤çæ§æä»¶ |
| | | isSave: false, |
| | | } |
| | | }, |
| | |
| | | methods: { |
| | | // ä¸è½½æ¡£æ¡ |
| | | downPerson() { |
| | | console.log('this.clickNodeVal.userId',this.clickNodeVal.userId) |
| | | exportPersonBasicInfoById({ id: this.clickNodeVal.userId }).then(res => { |
| | | const userId = this.clickNodeVal.userId |
| | | if (!userId) { |
| | | this.$message.warning('请å
éæ©äººå') |
| | | return |
| | | } |
| | | this.downLoading = true |
| | | exportPersonBasicInfoById({ id: userId }).then(async res => { |
| | | if (!blobValidate(res)) { |
| | | const rspObj = JSON.parse(await res.text()) |
| | | this.$message.error(rspObj.msg || 'ä¸è½½å¤±è´¥') |
| | | return |
| | | } |
| | | const blob = new Blob([res], { type: 'application/msword' }); |
| | | this.$download.saveAs(blob, 'äººåæ¡£æ¡.docx'); |
| | | this.$download.saveAs(blob, (this.form.name ? this.form.name + 'äººåæ¡£æ¡' : 'äººåæ¡£æ¡') + '.docx'); |
| | | }).catch(() => {}).finally(() => { |
| | | this.downLoading = false |
| | | }) |
| | | }, |
| | | // ä¸ä¼ éªè¯ |
| | |
| | | let flag = true |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M'); |
| | | this.$refs.upload.clearFiles() |
| | | this.$refs.fileUpload && this.$refs.fileUpload.clearFiles() |
| | | flag = false |
| | | } |
| | | if (!flag) { |
| | | return Promise.reject(flag); //æ£ç¡®çç»æ¢ |
| | | } |
| | | }, |
| | | // 个人ç
§ç/çµåç¾ååªå
许å¾ç |
| | | imageBeforeUpload(file) { |
| | | if (!/\.(jpg|jpeg|png)$/i.test(file.name || '')) { |
| | | this.$message.error('ä»
æ¯æä¸ä¼ jpgãjpegãpng æ ¼å¼çå¾ç') |
| | | return false |
| | | } |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M') |
| | | return false |
| | | } |
| | | return true |
| | | }, |
| | | onError(err, file, fileList, type) { |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | this.$refs.upload.clearFiles() |
| | | this.$refs.fileUpload && this.$refs.fileUpload.clearFiles() |
| | | }, |
| | | handleSuccessUp(response,) { |
| | | this.upLoading = false; |
| | | if (response.code == 200) { |
| | | if (response && response.code == 200) { |
| | | this.$message.success('ä¸ä¼ æå'); |
| | | this.searchTableList() |
| | | } else { |
| | | this.$message.error(response.message); |
| | | this.$message.error((response && (response.msg || response.message)) || 'ä¸ä¼ 失败'); |
| | | } |
| | | }, |
| | | // æ¥è¯¢éä»¶å表 |
| | | searchTableList() { |
| | | const userId = this.clickNodeVal && this.clickNodeVal.userId |
| | | if (!userId) { |
| | | this.tableData = [] |
| | | return |
| | | } |
| | | this.tableLoading = true |
| | | getBasicInfoFileList({ userId: this.clickNodeVal.userId }).then(res => { |
| | | this.tableLoading = false |
| | | this.tableData = res.data |
| | | getBasicInfoFileList({ userId: userId }).then(res => { |
| | | this.tableData = res.data || [] |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | this.tableData = [] |
| | | console.log('err---', err); |
| | | }).finally(() => { |
| | | this.tableLoading = false |
| | | }) |
| | | }, |
| | | // ä¸è½½ |
| | |
| | | }).then(() => { |
| | | this.tableLoading = true |
| | | delBasicInfoFileList({ basicInfoFileId: row.basicInfoFileId }).then(res => { |
| | | this.tableLoading = false |
| | | this.$message.success('å 餿å') |
| | | this.searchTableList(); |
| | | }).catch(err => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿å') |
| | | this.searchTableList(); |
| | | } else { |
| | | this.$message.error(res.msg || 'å é¤å¤±è´¥') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('å é¤å¤±è´¥') |
| | | }).finally(() => { |
| | | this.tableLoading = false |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }) |
| | | }).catch(() => {}) |
| | | }, |
| | | // æå¼å·¥ä½ç»åæ¢åµ |
| | | annexAdd1(type, row) { |
| | |
| | | }, |
| | | // æäº¤å·¥ä½ç»å |
| | | submitForm2() { |
| | | if (!this.annex2.workExperience || !String(this.annex2.workExperience).trim()) { |
| | | this.$message.warning('请è¾å
¥å·¥ä½ç»å') |
| | | return |
| | | } |
| | | const params = { |
| | | workExperience: this.annex2.workExperience, |
| | | userId: this.clickNodeVal.userId, |
| | |
| | | this.tableLoading1 = true |
| | | if (this.operationType === 'add') { |
| | | addBasicInfoWork(params).then(res => { |
| | | this.tableLoading1 = false |
| | | if (res.code == 200) { |
| | | this.dialogVisible2 = false |
| | | this.$message.success('æ°å¢æå') |
| | | this.searchTableList2(); |
| | | } else { |
| | | this.$message.error(res.msg || 'æ°å¢å¤±è´¥') |
| | | } |
| | | }).catch(err => { |
| | | }).catch(() => { |
| | | this.$message.error('æ°å¢å¤±è´¥') |
| | | }).finally(() => { |
| | | this.tableLoading1 = false |
| | | }) |
| | | } else { |
| | | updateBasicInfoWorkList(params).then(res => { |
| | | this.tableLoading1 = false |
| | | this.dialogVisible2 = false |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.searchTableList2(); |
| | | }).catch(err => { |
| | | if (res.code == 200) { |
| | | this.dialogVisible2 = false |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.searchTableList2(); |
| | | } else { |
| | | this.$message.error(res.msg || 'ä¿®æ¹å¤±è´¥') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('ä¿®æ¹å¤±è´¥') |
| | | }).finally(() => { |
| | | this.tableLoading1 = false |
| | | }) |
| | | } |
| | |
| | | }).then(() => { |
| | | this.tableLoading1 = true |
| | | delBasicInfoWorkList({ basicInfoWorkId: row.basicInfoWorkId }).then(res => { |
| | | this.tableLoading1 = false |
| | | this.$message.success('å 餿å') |
| | | this.searchTableList2(); |
| | | }).catch(err => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿å') |
| | | this.searchTableList2(); |
| | | } else { |
| | | this.$message.error(res.msg || 'å é¤å¤±è´¥') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('å é¤å¤±è´¥') |
| | | }).finally(() => { |
| | | this.tableLoading1 = false |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }).catch(() => {}) |
| | | }, |
| | | // æ¥è¯¢å·¥ä½ç»åå表 |
| | | searchTableList2() { |
| | | const userId = this.clickNodeVal && this.clickNodeVal.userId |
| | | if (!userId) { |
| | | this.tableData1 = [] |
| | | return |
| | | } |
| | | this.tableLoading1 = true |
| | | getBasicInfoWorkList({ userId: this.clickNodeVal.userId }).then(res => { |
| | | this.tableLoading1 = false |
| | | this.tableData1 = res.data |
| | | getBasicInfoWorkList({ userId: userId }).then(res => { |
| | | this.tableData1 = res.data || [] |
| | | }).catch(err => { |
| | | this.tableLoading1 = false |
| | | this.tableData1 = [] |
| | | console.log('err---', err); |
| | | }).finally(() => { |
| | | this.tableLoading1 = false |
| | | }) |
| | | }, |
| | | annexAdd(type, row) { |
| | |
| | | this.title = 'ç¼è¾éä»¶èµæ' |
| | | this.addOrupdate = 1 |
| | | getAnnex({ id: row.id }).then(res => { |
| | | if (res.code != 200 || !res.data) { |
| | | this.$message.error(res.msg || 'éä»¶èµæå 载失败') |
| | | return |
| | | } |
| | | this.annex = res.data |
| | | this.imageUrl = this.javaApi + '/img/' + res.data.fileName |
| | | this.dialogVisible1 = true |
| | | }).catch(() => { |
| | | this.$message.error('éä»¶èµæå 载失败') |
| | | }) |
| | | return |
| | | } else { |
| | | this.title = 'æ°å¢éä»¶èµæ' |
| | | this.addOrupdate = 2 |
| | | this.imageUrl = '' |
| | | this.annex = { |
| | | userId: '', |
| | | idNumber: '', |
| | | issueUnit: '', |
| | | level: '', |
| | | periodValidity: '', |
| | | copy: '', |
| | | original: '', |
| | | fileName: '' |
| | | } |
| | | if (this.$refs.fileName) { |
| | | this.$refs.fileName.clearFiles() |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs.annex && this.$refs.annex.clearValidate() |
| | | }) |
| | | } |
| | | this.dialogVisible1 = true |
| | | }, |
| | |
| | | if (this.addOrupdate === 1) { |
| | | updateAnnex(this.annex).then(res => { |
| | | if (res.code == 200) { |
| | | getAnnexByUserId({ userId: this.clickNodeVal.userId }).then(res => { |
| | | this.imageUrl = '' |
| | | this.$refs.fileName.clearFiles() |
| | | this.annex.fileName = '' |
| | | this.resetForm('annex') |
| | | this.annexList = res.data |
| | | this.dialogVisible1 = false |
| | | this.$message.success('æ´æ°æåï¼') |
| | | }) |
| | | this.refreshAnnexList('æ´æ°æåï¼') |
| | | } else { |
| | | this.$message.error(res.msg || 'æ´æ°å¤±è´¥') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('æ´æ°å¤±è´¥') |
| | | }) |
| | | } else { |
| | | this.annex.id = null |
| | | addAnnex(this.annex).then(res => { |
| | | if (res.code == 200) { |
| | | getAnnexByUserId({ userId: this.clickNodeVal.userId }).then(res => { |
| | | this.imageUrl = '' |
| | | this.$refs.fileName.clearFiles() |
| | | this.annex.fileName = '' |
| | | this.resetForm('annex') |
| | | this.annexList = res.data |
| | | this.dialogVisible1 = false |
| | | this.$message.success('ä¿åæå') |
| | | }) |
| | | this.refreshAnnexList('ä¿åæå') |
| | | } else { |
| | | this.$message.error(res.msg || 'ä¿å失败') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('ä¿å失败') |
| | | }) |
| | | } |
| | | }, |
| | | refreshAnnexList(tip) { |
| | | getAnnexByUserId({ userId: this.clickNodeVal.userId }).then(res => { |
| | | this.imageUrl = '' |
| | | if (this.$refs.fileName) { |
| | | this.$refs.fileName.clearFiles() |
| | | } |
| | | this.annex.fileName = '' |
| | | this.resetForm('annex') |
| | | this.annexList = res.data || [] |
| | | this.dialogVisible1 = false |
| | | this.$message.success(tip) |
| | | }).catch(() => { |
| | | this.annexList = [] |
| | | this.$message.error('éä»¶èµæå·æ°å¤±è´¥ï¼è¯·éæ°æå¼é¡µé¢æ¥ç') |
| | | }) |
| | | }, |
| | | deleteAnnex(row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteAnnex({ id: row.id }).then(res => { |
| | | this.$message.success('å 餿åï¼') |
| | | this.annexList = this.annexList.filter(item => item.id != row.id) |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿åï¼') |
| | | this.annexList = this.annexList.filter(item => item.id != row.id) |
| | | } else { |
| | | this.$message.error(res.msg || 'å é¤å¤±è´¥') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('å é¤å¤±è´¥') |
| | | }) |
| | | }) |
| | | }).catch(() => {}) |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | let flag = true |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M'); |
| | | this.$refs.upload.clearFiles() |
| | | this.$refs.fileName && this.$refs.fileName.clearFiles() |
| | | flag = false |
| | | } |
| | | if (!flag) { |
| | |
| | | return this.$download.saveAs(fileName, fileName) |
| | | }, |
| | | async onSuccess(response, file, fileList, entityVal) { |
| | | if (!response || response.code != 200) { |
| | | this.$message.error((response && (response.msg || response.message)) || 'ä¸ä¼ 失败') |
| | | return |
| | | } |
| | | if (entityVal == 'fileName') { |
| | | this.annex.fileName = response.data |
| | | } |
| | |
| | | }, |
| | | // åå§åè°ç¨ |
| | | init() { |
| | | if (!this.clickNodeVal.userId) { |
| | | let user = JSON.parse(localStorage.getItem('user')) |
| | | this.getUserBasisInfo(user.userId) |
| | | this.clickNodeVal.userId = user.userId |
| | | } else { |
| | | this.getUserBasisInfo(this.clickNodeVal.userId) |
| | | let userId = this.clickNodeVal && this.clickNodeVal.userId |
| | | if (!userId) { |
| | | let user = JSON.parse(localStorage.getItem('user') || '{}') |
| | | userId = user.userId |
| | | this.clickNodeVal.userId = userId |
| | | } |
| | | if (userId) { |
| | | this.getUserBasisInfo(userId) |
| | | } |
| | | }, |
| | | getUserBasisInfo(userId) { |
| | | getCNASPersonnelInfo({ userId: userId }).then(res => { |
| | | this.form = res.data.PersonBasicInfoDto |
| | | this.department = res.data.department |
| | | this.annexList = res.data.annexList |
| | | this.form.departLimsId = res.data.PersonBasicInfoDto.departLimsId.split(',').filter(a => a != "").map(Number) |
| | | const dto = (res.data && res.data.PersonBasicInfoDto) || {} |
| | | this.form = { ...dto } |
| | | this.department = (res.data && res.data.department) || [] |
| | | this.annexList = (res.data && res.data.annexList) || [] |
| | | this.form.departLimsId = dto.departLimsId |
| | | ? String(dto.departLimsId).split(',').filter(a => a != "").map(Number) |
| | | : [] |
| | | }).catch(() => { |
| | | this.form = {} |
| | | this.annexList = [] |
| | | this.tableData = [] |
| | | this.tableData1 = [] |
| | | }) |
| | | }, |
| | | async save() { |
| | | const userId = this.clickNodeVal && this.clickNodeVal.userId |
| | | if (!userId) { |
| | | this.$message.warning('请å
å¨å·¦ä¾§éæ©äººå') |
| | | return |
| | | } |
| | | this.saveLoading = true |
| | | this.form.userId = this.clickNodeVal.userId |
| | | if (Array.isArray(this.form.departLimsId)) { |
| | | if (this.form.departLimsId.length > 0) { |
| | | this.form.departLimsId = this.form.departLimsId.join(',').trim() + ',' |
| | | const payload = { ...this.form } |
| | | payload.userId = userId |
| | | if (Array.isArray(payload.departLimsId)) { |
| | | if (payload.departLimsId.length > 0) { |
| | | payload.departLimsId = payload.departLimsId.join(',').trim() + ',' |
| | | } else { |
| | | this.form.departLimsId = '' |
| | | payload.departLimsId = '' |
| | | } |
| | | } |
| | | saveCNASPersonnelInfo(this.form).then(res => { |
| | | saveCNASPersonnelInfo(payload).then(res => { |
| | | if (res.code == 200) { |
| | | this.isSave = true |
| | | this.deletePendingFiles() |
| | | this.getUserBasisInfo(userId) |
| | | this.$emit('refreshTree') |
| | | this.$message.success('ä¿åæåï¼') |
| | | } else { |
| | | this.$message.error(res.msg || 'ä¿å失败') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('ä¿å失败') |
| | | }).finally(() => { |
| | | this.saveLoading = false |
| | | this.isSave = true |
| | | this.getUserBasisInfo(this.clickNodeVal.userId) |
| | | this.$message.success('ä¿åæåï¼') |
| | | }) |
| | | }, |
| | | // å人ååç±»çåå
¸ |
| | | // æå¼äººååç±»å¼¹æ¡æ¶åæ¾å·²ä¿åçåç±» |
| | | getComparisonList() { |
| | | if (this.checkList.length > 0) { |
| | | this.form.personnelClassification = this.checkList.split('ï¼') |
| | | } |
| | | this.checkList = this.form.personnelClassification |
| | | ? String(this.form.personnelClassification).split(/[ï¼,]/).filter(m => m) |
| | | : [] |
| | | }, |
| | | clickPersonnelClassificationSure() { |
| | | this.dialogVisible = false |
| | | this.form.personnelClassification = this.checkList.filter(m => m).join('ï¼') |
| | | }, |
| | | async deleteFile(fileName, entityVal) { |
| | | await deleteCNASFile({ fileName: fileName }).then(res => { |
| | | this.$message.success('å 餿åï¼') |
| | | this.form[entityVal] = null |
| | | this.$confirm('ç¡®å®å é¤è¯¥æä»¶åï¼ä¿ååçæã', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | // ä¿åæåååå é¤ç©çæä»¶ï¼é¿å
åæ¶ç¼è¾åæ°æ®åºä»æåå·²å é¤çæä»¶ |
| | | if (fileName) { |
| | | this.pendingDeleteFiles.push(fileName) |
| | | } |
| | | this.form[entityVal] = '' |
| | | let index = this.successFileList.indexOf(fileName) |
| | | if (index != -1) { |
| | | this.successFileList.splice(index, 1) |
| | | } |
| | | }) |
| | | }).catch(() => {}) |
| | | }, |
| | | cancellation() { |
| | | this.resetForm('annex') |
| | |
| | | original: '', |
| | | fileName: '' |
| | | } |
| | | if (this.$refs.fileName) { |
| | | this.$refs.fileName.clearFiles() |
| | | } |
| | | done(); |
| | | }, |
| | | // ä¿åæå忏
çç©çæä»¶ |
| | | deletePendingFiles() { |
| | | if (!this.pendingDeleteFiles.length) { |
| | | return |
| | | } |
| | | this.pendingDeleteFiles.forEach(fileName => { |
| | | deleteCNASFile({ fileName }).catch(() => {}) |
| | | }) |
| | | this.pendingDeleteFiles = [] |
| | | }, |
| | | resetForm(formName) { |
| | | this.$refs[formName].resetFields(); |
| | |
| | | this.form.age = this.calculateAge(val) |
| | | }, |
| | | calculateAge(birthDateString) { |
| | | if (!birthDateString) { |
| | | return undefined |
| | | } |
| | | // è§£æåºçæ¥æåç¬¦ä¸²ä¸ºæ¥æå¯¹è±¡ |
| | | const birthDate = new Date(birthDateString); |
| | | |
| | |
| | | <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: var(--lims-text-2);">人ååç§°</span> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="entity.name" |
| | | @keyup.enter="refreshTable"></el-input> |
| | | @keyup.enter="handleSearch"></el-input> |
| | | </div> |
| | | <div style="line-height: 30px;"> |
| | | <el-button type="primary" size="small" @click="refreshTable">æ¥è¯¢</el-button> |
| | | <el-button type="primary" size="small" @click="handleSearch">æ¥è¯¢</el-button> |
| | | <el-button size="small" @click="refresh">éç½®</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" v-model:current-page="page.current" :page-size="page.size" |
| | | <el-pagination v-model:current-page="page.current" v-model:page-size="page.size" |
| | | :page-sizes="[10, 20, 30, 50, 100]" :total="page.total" background |
| | | layout="->,total, sizes, prev, pager, next, jumper" style="margin-top: 10px" @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange"> |
| | |
| | | upUserDepardLimsId |
| | | } from "@/api/cnas/personal/personalList"; |
| | | import store from "@/store"; |
| | | import { blobValidate } from "@/utils/ruoyi"; |
| | | |
| | | export default { |
| | | name: 'PersonnelList', |
| | |
| | | this.entity.name = '' |
| | | this.refreshTable(); |
| | | }, |
| | | // æ¥è¯¢ |
| | | handleSearch() { |
| | | this.page.current = 1 |
| | | this.refreshTable() |
| | | }, |
| | | // æ¥è¯¢äººååè¡¨æ°æ® |
| | | refreshTable() { |
| | | this.tableLoading = true; |
| | |
| | | name: this.entity.name, |
| | | } |
| | | basicInformationOfPersonnelSelectPage(params).then(res => { |
| | | this.tableLoading = false; |
| | | this.page.total = res.data.total; |
| | | this.tableData = res.data.records; |
| | | this.page.total = (res.data && res.data.total) || 0; |
| | | this.tableData = (res.data && res.data.records) || []; |
| | | }).catch(err => { |
| | | this.page.total = 0; |
| | | this.tableData = []; |
| | | }).finally(() => { |
| | | this.tableLoading = false; |
| | | }) |
| | | }, |
| | | // å é¤äººå |
| | | // ä»äººåæ¶æä¸ç§»é¤ |
| | | deletePerson(row) { |
| | | this.$confirm('æ¯å¦å é¤å½åæ°æ®?', 'è¦å', { |
| | | this.$confirm(`ç¡®å®å°â${row.name}âä»äººåæ¶æä¸ç§»é¤åï¼ç§»é¤å该人åä¸ä¼åºç°å¨å·¦ä¾§äººåæ ä¸ï¼ä¸ä¼å é¤ç¨æ·è´¦å·ï¼ã`, 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delUserDepardLimsId({ id: row.userId }).then(res => { |
| | | this.$message.success('å 餿å'); |
| | | this.refreshTable(); |
| | | this.$emit('refreshTree') |
| | | }).catch(e => { |
| | | this.$message.error('å é¤å¤±è´¥'); |
| | | }); |
| | | if (res.code == 200) { |
| | | this.$message.success('å·²ä»äººåæ¶æä¸ç§»é¤'); |
| | | this.refreshTable(); |
| | | this.$emit('refreshTree') |
| | | } |
| | | }).catch(() => {}); |
| | | }).catch(() => { |
| | | }); |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.page.size = val; |
| | | this.page.current = 1; |
| | | this.refreshTable(); |
| | | }, |
| | | handleCurrentChange(val) { |
| | |
| | | // æ¥è¯¢æ°å¢å¼¹æ¡ç人åå表 |
| | | selectUserList() { |
| | | this.tableLoading1 = true |
| | | selectUserCondition().then(res => { |
| | | this.tableLoading1 = false |
| | | this.tableData1 = res.data |
| | | }).catch(err => { |
| | | selectUserCondition({ name: this.addUserTableInfo.name || '', isCustom: 0 }).then(res => { |
| | | this.tableData1 = res.data || [] |
| | | }).catch(() => { |
| | | this.tableData1 = [] |
| | | }).finally(() => { |
| | | this.tableLoading1 = false |
| | | }) |
| | | }, |
| | |
| | | }, |
| | | // æäº¤éè¦æ·»å ç人å |
| | | selectUser() { |
| | | if (!this.currentCompaniesList.length > 0) { |
| | | if (!this.currentCompaniesList || this.currentCompaniesList.length === 0) { |
| | | this.$message.warning("è¯·éæ©é¨é¨ï¼") |
| | | return; |
| | | } |
| | |
| | | ids: JSON.stringify(ids), |
| | | id: str |
| | | }).then(res => { |
| | | this.selectUserDia = false; |
| | | this.$message.success('æ·»å æå'); |
| | | this.refreshTable(); |
| | | this.$emit('refreshTree') |
| | | if (res.code == 200) { |
| | | this.selectUserDia = false; |
| | | this.multipleSelection = []; |
| | | this.$message.success('æ·»å æå'); |
| | | this.refreshTable(); |
| | | this.$emit('refreshTree') |
| | | } else { |
| | | this.$message.error(res.msg || 'æ·»å 失败') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('æ·»å 失败') |
| | | }); |
| | | }, |
| | | // 导åºäººåä¿¡æ¯ |
| | | handleDown() { |
| | | this.outLoading = true; |
| | | let entity = this.HaveJson(this.entity) |
| | | delete entity.orderBy; |
| | | exportPersonBasicInfo({ ...entity }).then(res => { |
| | | this.outLoading = false; |
| | | exportPersonBasicInfo({ |
| | | name: this.entity.name, |
| | | departmentId: this.departId |
| | | }).then(async res => { |
| | | if (!blobValidate(res)) { |
| | | const rspObj = JSON.parse(await res.text()) |
| | | this.$message.error(rspObj.msg || '导åºå¤±è´¥') |
| | | return |
| | | } |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '人åä¿¡æ¯.xlsx') |
| | | }).catch(() => {}).finally(() => { |
| | | this.outLoading = false; |
| | | }) |
| | | }, |
| | | }, |
| | |
| | | if (newId) { |
| | | this.page.current = 1 |
| | | this.refreshTable(); |
| | | } else { |
| | | this.tableData = [] |
| | | this.page.total = 0 |
| | | } |
| | | } |
| | | } |
| | |
| | | <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: var(--lims-text-2);">ç¼å¶äºº</span> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="page.compilerName" |
| | | @keyup.enter="getYearPlanList(departId)"></el-input> |
| | | @keyup.enter="searchYearPlan"></el-input> |
| | | </div> |
| | | <div style="line-height: 30px;"> |
| | | <el-button type="primary" size="small" @click="getYearPlanList(departId)">æ¥è¯¢</el-button> |
| | | <el-button type="primary" size="small" @click="searchYearPlan">æ¥è¯¢</el-button> |
| | | </div> |
| | | </div> |
| | | <div style="line-height: 30px;"> |
| | |
| | | </div> |
| | | </div> |
| | | <lims-table :tableData="yearPlanTableData" :column="yearPlanColumn" :currentChange="currentChange" |
| | | @pagination="pagination" height="40vh" :page="page" :tableLoading="yearLoading"></lims-table> |
| | | :highlightCurrentRow="true" @pagination="pagination" height="40vh" :page="page" |
| | | :tableLoading="yearLoading"></lims-table> |
| | | </div> |
| | | <div v-if="!editPlanShow" class="table"> |
| | | <div> |
| | |
| | | </span> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button :loading="approvalLoading" @click="handleApproval(2)">䏿¹å</el-button> |
| | | <el-button :loading="reviewLoading" type="primary" @click="handleApproval(1)">æ¹ å</el-button> |
| | | <el-button :loading="approvalLoading" type="primary" @click="handleApproval(1)">æ¹ å</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | | <el-dialog v-model="uploadDia" title="æ°æ®å¯¼å
¥" width="500px"> |
| | |
| | | queryTheAnnualPlanDetailsTable, reviewAnnualPersonnelTraining |
| | | } from "@/api/cnas/personal/personalTraining"; |
| | | import { selectUserCondition } from "@/api/system/user"; |
| | | import { blobValidate } from "@/utils/ruoyi"; |
| | | |
| | | export default { |
| | | name: 'PersonnelTraining', |
| | |
| | | { |
| | | name: 'ç¼è¾', |
| | | type: 'text', |
| | | disabled: () => !this.isOperation, |
| | | clickFun: (row) => { |
| | | this.addTrainingPlan('edit', row); |
| | | }, |
| | |
| | | { |
| | | name: 'ç»ææç»', |
| | | type: 'text', |
| | | disabled: () => !this.isOperation, |
| | | clickFun: (row) => { |
| | | this.editInDetail(row); |
| | | }, |
| | |
| | | multipleSelection: [], // 年度æç»è¡¨éä¸çæ°æ® |
| | | uploadDia: false, |
| | | uploading: false, |
| | | downLoading: false, |
| | | isOperation: false, |
| | | ViewRecord: false, |
| | | fileList: [], |
| | |
| | | }, |
| | | methods: { |
| | | searchTable() { |
| | | this.inDetailPagination.current = 1 |
| | | this.getInDetailPlan(this.currentRowId) |
| | | }, |
| | | // æ¥è¯¢-年度计å表 |
| | | searchYearPlan() { |
| | | this.page.current = 1 |
| | | this.getYearPlanList(this.departId) |
| | | }, |
| | | clearPlanSelection() { |
| | | this.currentRowId = null |
| | | this.currentChangeRow = {} |
| | | this.isOperation = false |
| | | this.inDetailPlanTableData = [] |
| | | this.inDetailPagination.total = 0 |
| | | this.inDetailPagination.current = 1 |
| | | }, |
| | | getYearPlanList(userId) { |
| | | this.yearLoading = true |
| | | const params = this.isDepartment ? |
| | |
| | | compilerName: this.page.compilerName, |
| | | } |
| | | personTraining(params).then(res => { |
| | | this.yearLoading = false |
| | | this.yearPlanTableData = res.data.records; |
| | | this.pagination.total = res.data.total; |
| | | this.yearPlanTableData = (res.data && res.data.records) || []; |
| | | this.page.total = (res.data && res.data.total) || 0; |
| | | if (this.yearPlanTableData.length > 0) { |
| | | this.currentRowId = this.yearPlanTableData[0].id |
| | | this.currentChange(this.yearPlanTableData[0]) |
| | | } else { |
| | | this.clearPlanSelection() |
| | | } |
| | | }).catch(err => { |
| | | }).catch(() => { |
| | | this.yearPlanTableData = [] |
| | | this.page.total = 0 |
| | | this.clearPlanSelection() |
| | | }).finally(() => { |
| | | this.yearLoading = false |
| | | }) |
| | | }, |
| | | pagination(page) { |
| | | this.page.size = page.limit |
| | | this.getYearPlanList() |
| | | this.page.current = page.page |
| | | this.getYearPlanList(this.departId) |
| | | }, |
| | | 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) |
| | | if (!row) { |
| | | return |
| | | } |
| | | const currentYear = new Date().getFullYear(); |
| | | this.currentChangeRow = row |
| | | this.currentRowId = row.id |
| | | const planYear = row.planYear ? String(row.planYear) : (row.createTime ? String(row.createTime).slice(0, 4) : '') |
| | | this.isOperation = planYear === String(currentYear) |
| | | }, |
| | | getInDetailPlan(id) { |
| | | // é¨é¨è§è§ä¸å¿
é¡»å
éä¸ä¸ä»½å¹´åº¦è®¡åï¼å¦å伿ææé¨é¨çæç»é½æ¥åºæ¥ |
| | | if (this.isDepartment && !id) { |
| | | this.inDetailPlanTableData = [] |
| | | this.inDetailPagination.total = 0 |
| | | return |
| | | } |
| | | if (this.inDetailForm.trainingDate === null) { |
| | | this.inDetailForm.trainingDate = '' |
| | | } |
| | |
| | | const params = |
| | | { |
| | | userId: userId, |
| | | size: this.inDetailPagination.pageSize, |
| | | size: this.inDetailPagination.size, |
| | | current: this.inDetailPagination.current, |
| | | id: id, |
| | | trainingLecturerName: this.inDetailForm.trainingLecturerName, |
| | |
| | | } |
| | | this.yearDetailLoading = true |
| | | queryTheAnnualPlanDetailsTable(params).then(res => { |
| | | this.yearDetailLoading = false |
| | | this.inDetailPlanTableData = res.data.records; |
| | | this.inDetailPagination.total = res.data.total; |
| | | }).catch(err => { |
| | | this.inDetailPlanTableData = (res.data && res.data.records) || []; |
| | | this.inDetailPagination.total = (res.data && res.data.total) || 0; |
| | | }).catch(() => { |
| | | this.inDetailPlanTableData = [] |
| | | this.inDetailPagination.total = 0 |
| | | }).finally(() => { |
| | | this.yearDetailLoading = false |
| | | }) |
| | | }, |
| | | pagination1(page) { |
| | | this.inDetailPagination.size = page.limit |
| | | this.inDetailPagination.current = page.page |
| | | this.getInDetailPlan(this.currentRowId) |
| | | }, |
| | | // æ°å¢å¹´åº¦è®¡åæç»è¡¨ |
| | |
| | | this.$message.warning('è¯·éæ©ä¸æ¡è®¡åè¿è¡æ°å¢') |
| | | return |
| | | } |
| | | if (!this.isOperation) { |
| | | this.$message.warning('ä»
å¯ç¼è¾å½å年度çå¹è®è®¡å') |
| | | return |
| | | } |
| | | this.$refs.addPlan.showDialog(this.currentRowId, type, row); |
| | | }, |
| | | // 年度计å表-å é¤ |
| | | deleteFun(id) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | this.$confirm('å é¤å该计åçæç»åå¹è®è®°å½å°ä¸å¹¶å é¤ï¼æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | personTrainingDelete({ id: id }).then(res => { |
| | | this.$message.success('å 餿åï¼'); |
| | | this.getYearPlanList(this.departId); |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿åï¼'); |
| | | if (this.currentRowId === id) { |
| | | this.clearPlanSelection() |
| | | } |
| | | this.getYearPlanList(this.departId); |
| | | } else { |
| | | this.$message.error(res.msg || 'å é¤å¤±è´¥') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('å é¤å¤±è´¥') |
| | | }); |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | // 年度计å表-å®¡æ ¸ |
| | | handleCheck(id) { |
| | | this.currentRowId = id |
| | | this.approverId = '' |
| | | this.auditRemarks = '' |
| | | this.reviewDialog = true |
| | | this.getUserList() |
| | | }, |
| | | // æäº¤å®¡æ ¸ |
| | | handleReview(status) { |
| | | if (status === 1 && !this.approverId) { |
| | | this.$message.warning('è¯·éæ©æ¹å人') |
| | | return |
| | | } |
| | | const personTrainingUpdateDto = { |
| | | id: this.currentRowId, |
| | | auditRemarks: this.auditRemarks, |
| | | reviewerStatus: status, |
| | | approverId: this.approverId |
| | | approverId: status === 1 ? this.approverId : null |
| | | } |
| | | this.reviewLoading = true |
| | | reviewAnnualPersonnelTraining(personTrainingUpdateDto).then(res => { |
| | |
| | | this.$message.success('æäº¤æåï¼'); |
| | | this.reviewDialog = false |
| | | this.getYearPlanList(this.departId); |
| | | } else { |
| | | this.$message.error(res.msg || 'æäº¤å¤±è´¥') |
| | | } |
| | | this.reviewLoading = false |
| | | }).catch(() => { |
| | | this.$message.error('æäº¤å¤±è´¥') |
| | | }).finally(() => { |
| | | this.reviewLoading = false |
| | | }) |
| | | }, |
| | |
| | | this.$message.success('æäº¤æåï¼'); |
| | | this.approvalDialog = false |
| | | this.getYearPlanList(this.departId); |
| | | } else { |
| | | this.$message.error(res.msg || 'æäº¤å¤±è´¥') |
| | | } |
| | | this.approvalLoading = false |
| | | }).catch(() => { |
| | | this.$message.error('æäº¤å¤±è´¥') |
| | | }).finally(() => { |
| | | this.approvalLoading = false |
| | | }) |
| | | }, |
| | | // 年度计å表-ä¸è½½ |
| | | downLoadPost(row) { |
| | | exportPersonTraining({ id: row.id }).then(res => { |
| | | this.outLoading = false |
| | | if (this.downLoading) { |
| | | return |
| | | } |
| | | this.downLoading = true |
| | | exportPersonTraining({ id: row.id }).then(async res => { |
| | | if (!blobValidate(res)) { |
| | | const rspObj = JSON.parse(await res.text()) |
| | | this.$message.error(rspObj.msg || rspObj.message || '导åºå¤±è´¥') |
| | | return |
| | | } |
| | | const blob = new Blob([res], { type: 'application/msword' }); |
| | | this.$download.saveAs(blob, row.fileName + '.docx') |
| | | this.$download.saveAs(blob, (row.fileName || '人åå¹è®è®¡å') + '.docx') |
| | | }).catch(() => {}).finally(() => { |
| | | this.downLoading = false |
| | | }) |
| | | }, |
| | | // æå¼å¯¼å
¥å¼¹æ¡ |
| | |
| | | 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) |
| | | const file = this.fileList[0].raw || this.fileList[0] |
| | | if (!/\.(xls|xlsx)$/i.test(file.name || '')) { |
| | | this.$message.error('è¯·éæ© .xls æ .xlsx æ ¼å¼çæä»¶') |
| | | return |
| | | } |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M') |
| | | return |
| | | } |
| | | this.uploading = true |
| | | this.$refs.upload.submit(); |
| | | }, |
| | | onSuccess(response, file, fileList) { |
| | | this.uploading = false |
| | | if (!response || response.code != 200) { |
| | | this.$message.error((response && (response.msg || response.message)) || 'ä¸ä¼ 失败') |
| | | return |
| | | } |
| | | this.$refs.upload && this.$refs.upload.clearFiles() |
| | | this.uploadDia = false |
| | | this.$message.success('ä¸ä¼ æå') |
| | | this.standardList = [] |
| | | this.productList = [] |
| | | this.getYearPlanList(this.departId) |
| | | }, |
| | | onError(err, file, fileList) { |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | this.$refs.upload.clearFiles() |
| | | this.$refs.upload && this.$refs.upload.clearFiles() |
| | | this.uploading = false |
| | | }, |
| | | beforeUpload(file, fileList) { |
| | |
| | | }, |
| | | // 年度计åæç»è¡¨-ç¼è¾ |
| | | editInDetail(row) { |
| | | if (!this.isOperation) { |
| | | this.$message.warning('ä»
å¯ç¼è¾å½å年度çå¹è®è®¡å') |
| | | return |
| | | } |
| | | this.editPlanShow = true; |
| | | this.currentRow = row |
| | | }, |
| | |
| | | }, |
| | | // 年度计åæç»è¡¨-ä¸è½½ |
| | | downLoadInDetail(row) { |
| | | exportPersonTrainingRecord({ id: row.id }).then(res => { |
| | | this.outLoading = false |
| | | if (this.downLoading) { |
| | | return |
| | | } |
| | | this.downLoading = true |
| | | exportPersonTrainingRecord({ id: row.id }).then(async res => { |
| | | if (!blobValidate(res)) { |
| | | const rspObj = JSON.parse(await res.text()) |
| | | this.$message.error(rspObj.msg || rspObj.message || '导åºå¤±è´¥') |
| | | return |
| | | } |
| | | const blob = new Blob([res], { type: 'application/msword' }); |
| | | this.$download.saveAs(blob, '人åå¹è®ä¸èæ ¸è®°å½.docx') |
| | | }).catch(() => {}).finally(() => { |
| | | this.downLoading = false |
| | | }) |
| | | }, |
| | | // 年度计åæç»è¡¨-å¤é |
| | |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿å'); |
| | | this.getInDetailPlan(this.currentRowId); |
| | | } else { |
| | | this.$message.error(res.msg || 'å é¤å¤±è´¥') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.error('å é¤å¤±è´¥') |
| | | }); |
| | | }).catch(() => { |
| | | this.$message.warning('åæ¶å é¤'); |
| | | }); |
| | | } else { |
| | | this.$message.warning('è¯·éæ©éè¦å é¤çæ°æ®') |
| | |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.inDetailPagination.size = val; |
| | | this.getInDetailPlan(this.currentChangeRow.id) |
| | | this.getInDetailPlan(this.currentRowId) |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.inDetailPagination.current = val; |
| | | this.getInDetailPlan(this.currentChangeRow.id) |
| | | this.getInDetailPlan(this.currentRowId) |
| | | }, |
| | | // è·åè´è´£äººä¿¡æ¯æ¥å£ |
| | | getUserList() { |
| | | selectUserCondition().then(res => { |
| | | selectUserCondition({ isCustom: 0 }).then(res => { |
| | | if (res.code == 200) { |
| | | this.responsibleOptions = res.data |
| | | this.responsibleOptions = Array.isArray(res.data) ? res.data : [] |
| | | } else { |
| | | this.responsibleOptions = [] |
| | | } |
| | | }).catch(() => { |
| | | this.responsibleOptions = [] |
| | | }); |
| | | } |
| | | }, |
| | |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | departId: { |
| | | handler(newId, oldId) { |
| | | this.page.current = 1 |
| | | this.inDetailPagination.current = 1 |
| | | if (this.isDepartment) { |
| | | this.getYearPlanList(newId); |
| | | } else { |
| | | this.clearPlanSelection() |
| | | this.getInDetailPlan('') |
| | | } |
| | | } |
| | | }, |
| | | currentRowId: { |
| | | handler(newId, oldId) { |
| | | if (newId) { |
| | | console.log('newId', newId); |
| | | if (newId && newId !== oldId) { |
| | | this.inDetailPagination.current = 1 |
| | | this.getInDetailPlan(this.currentChangeRow.id) |
| | | this.getInDetailPlan(newId) |
| | | } |
| | | } |
| | | } |
| | |
| | | <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;"> |
| | | <span style="width: 48px;font-size: 14px;font-weight: 700;color: var(--lims-text-2);">å§å</span> |
| | | <el-input v-model="trainingPagination.userName" class="search" |
| | | @keyup.enter="getPersonnelTraining(departId)" |
| | | @keyup.enter="refreshTable" |
| | | clearable placeholder="请è¾å
¥" size="small"></el-input> |
| | | </div> |
| | | <div style="line-height: 30px;"> |
| | | <el-button size="small" type="primary" @click="getPersonnelTraining(departId)">æ¥è¯¢</el-button> |
| | | <el-button size="small" type="primary" @click="refreshTable">æ¥è¯¢</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | <div :style="`width: ${isDepartment ? '49%' : '100%'};`"> |
| | | <div class="title"> |
| | | <span style="font-weight: bold">年度计åæç»</span> |
| | | <span style="font-weight: bold">{{ isDepartment ? '年度计åæç»' : 'å¹è®è®°å½æç»' }}</span> |
| | | </div> |
| | | <div style="display: flex;justify-content: space-between;"> |
| | | <el-form :model="searchForm" ref="searchForm" size="small" :inline="true"> |
| | |
| | | clearable |
| | | format="YYYY" |
| | | placeholder="鿩年" |
| | | @change="queryPersonnelDetailsPage(currentChangeRow.userId)" |
| | | @change="searchDetails" |
| | | size="small" |
| | | type="year" |
| | | value-format="YYYY"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button size="small" type="primary" @click="queryPersonnelDetailsPage(currentChangeRow.userId)">æ¥è¯¢</el-button> |
| | | <el-button size="small" type="primary" @click="searchDetails">æ¥è¯¢</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div> |
| | |
| | | <script> |
| | | |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { blobValidate } from "@/utils/ruoyi"; |
| | | import { |
| | | exportTrainingRecord, |
| | | queryPersonnelDetails, |
| | |
| | | width: '100' |
| | | }, { |
| | | label: 'å
¥å使¶é´', |
| | | prop: 'unitTime', |
| | | prop: 'unitTimeSting', |
| | | width: '150' |
| | | }, |
| | | // { |
| | |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.getPersonnelTraining(this.departId); |
| | | if (this.isDepartment) { |
| | | this.getPersonnelTraining(this.departId); |
| | | } else { |
| | | this.queryPersonnelDetailsPage(this.departId); |
| | | } |
| | | }, |
| | | methods: { |
| | | // æ¥è¯¢ |
| | | refreshTable() { |
| | | this.trainingPagination.current = 1; |
| | | this.getPersonnelTraining(this.departId); |
| | | }, |
| | | // æç»æ¥è¯¢ï¼å¹´ä»½/人åååæ¶åå°ç¬¬ä¸é¡µï¼ |
| | | searchDetails() { |
| | | this.trainingPersonPagination.current = 1; |
| | | const userId = this.isDepartment |
| | | ? (this.currentChangeRow && this.currentChangeRow.userId) |
| | | : this.departId; |
| | | this.queryPersonnelDetailsPage(userId); |
| | | }, |
| | | // å¹è®è®°å½å¯¼åº |
| | | openDownloadDia (row) { |
| | | let date = this.searchForm.trainingDate |
| | | if (!date) { |
| | | date = this.$moment().format('YYYY') |
| | | openDownloadDia(row) { |
| | | const userId = this.isDepartment ? (row && row.userId) : this.departId; |
| | | if (!userId) { |
| | | this.$message.warning('请å
éæ©éè¦å¯¼åºç人å'); |
| | | return; |
| | | } |
| | | exportTrainingRecord({userId: row.userId, trainingDate: date}).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res],{ type: 'application/msword' }); |
| | | this.$download.saveAs(blob, 'å¹è®è®°å½å¯¼åº.docx'); |
| | | }) |
| | | if (this.outLoading) { |
| | | return; |
| | | } |
| | | let date = this.searchForm.trainingDate; |
| | | if (!date) { |
| | | date = this.$moment().format('YYYY'); |
| | | } |
| | | this.outLoading = true; |
| | | exportTrainingRecord({userId: userId, trainingDate: date}).then(async res => { |
| | | if (!blobValidate(res)) { |
| | | const rspObj = JSON.parse(await res.text()); |
| | | this.$message.error(rspObj.msg || rspObj.message || '导åºå¤±è´¥'); |
| | | return; |
| | | } |
| | | const blob = new Blob([res], {type: 'application/msword'}); |
| | | const personName = this.isDepartment && row && row.name ? row.name + '-' : ''; |
| | | this.$download.saveAs(blob, personName + date + 'å¹è®è®°å½.docx'); |
| | | }).catch(() => {}).finally(() => { |
| | | this.outLoading = false; |
| | | }); |
| | | }, |
| | | // è·åå®éªå®¤-å¹è®è®¡ååè¡¨ä¿¡æ¯ |
| | | getPersonnelTraining(departId) { |
| | |
| | | } |
| | | this.trainingLoading = true |
| | | trainingSelectTrainingRecord(params).then(res => { |
| | | this.trainingLoading = false |
| | | this.trainingTableData = res.data.records; |
| | | this.trainingPagination.total = res.data.total; |
| | | this.trainingTableData = (res.data && res.data.records) || []; |
| | | this.trainingPagination.total = (res.data && res.data.total) || 0; |
| | | if (this.trainingTableData.length > 0) { |
| | | this.$refs.trainingTableData.setCurrentRow(this.trainingTableData[0]) |
| | | this.currentChangeRow = this.trainingTableData[0]; |
| | | this.$refs.trainingTableData && this.$refs.trainingTableData.setCurrent(this.trainingTableData[0]); |
| | | } else { |
| | | this.currentChangeRow = ''; |
| | | this.trainingPersonTableData = []; |
| | | this.trainingPersonPagination.current = 1; |
| | | this.trainingPersonPagination.total = 0; |
| | | } |
| | | }).catch(err => { |
| | | }).catch(() => {}).finally(() => { |
| | | this.trainingLoading = false |
| | | }) |
| | | }, |
| | | // è·å个人-å¹è®è®¡ååè¡¨ä¿¡æ¯ |
| | | // åæ¢äººå |
| | | currentChange(row) { |
| | | this.currentChangeRow = row |
| | | if (row === null) { |
| | | row = this.trainingTableData[0] |
| | | this.currentChangeRow = row || ''; |
| | | this.trainingPersonPagination.current = 1; |
| | | if (!row) { |
| | | this.trainingPersonTableData = []; |
| | | this.trainingPersonPagination.total = 0; |
| | | return; |
| | | } |
| | | this.queryPersonnelDetailsPage(row.userId) |
| | | }, |
| | | queryPersonnelDetailsPage(userId) { |
| | | if (!userId) { |
| | | this.trainingPersonTableData = []; |
| | | this.trainingPersonPagination.total = 0; |
| | | return; |
| | | } |
| | | if (this.searchForm.trainingDate === null) { |
| | | this.searchForm.trainingDate = '' |
| | | } |
| | |
| | | } |
| | | this.trainingPersonLoading = true |
| | | queryPersonnelDetails(params).then(res => { |
| | | this.trainingPersonLoading = false |
| | | this.trainingPersonTableData = res.data.records; |
| | | this.trainingPersonPagination.total = res.data.total; |
| | | }).catch(err => { |
| | | this.trainingPersonTableData = (res.data && res.data.records) || []; |
| | | this.trainingPersonPagination.total = (res.data && res.data.total) || 0; |
| | | }).catch(() => {}).finally(() => { |
| | | this.trainingPersonLoading = false |
| | | }) |
| | | }, |
| | | // å页 |
| | | pagination(page) { |
| | | this.trainingPagination.size = page.limit; |
| | | this.trainingPagination.current = page.page; |
| | | this.getPersonnelTraining(this.departId); |
| | | }, |
| | | // å页 |
| | | pagination1(page) { |
| | | this.trainingPersonPagination.size = page.limit; |
| | | this.queryPersonnelDetailsPage(this.currentChangeRow.userId); |
| | | this.trainingPersonPagination.current = page.page; |
| | | const userId = this.isDepartment |
| | | ? (this.currentChangeRow && this.currentChangeRow.userId) |
| | | : this.departId; |
| | | this.queryPersonnelDetailsPage(userId); |
| | | }, |
| | | }, |
| | | watch: { |
| | | departId: { |
| | | handler(newId, oldId) { |
| | | if (this.isDepartment) { |
| | | this.trainingPagination.current = 1; |
| | | this.getPersonnelTraining(newId); |
| | | } else { |
| | | this.currentChangeRow = ''; |
| | | this.trainingPersonPagination.current = 1; |
| | | this.queryPersonnelDetailsPage(newId) |
| | | } |
| | | } |
| | |
| | | <el-table-column label="夿³¨" min-width="140" show-overflow-tooltip> |
| | | <template #default="scope">{{ scope.row.recordRemark || 'â' }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="éä»¶" min-width="130"> |
| | | <template #default="scope"> |
| | | <el-link v-if="scope.row.attachmentCount > 0" type="primary" @click="handleAttachment(scope.row)"> |
| | | æ¥çéä»¶ï¼{{ scope.row.attachmentCount }}ï¼ |
| | | </el-link> |
| | | <el-link v-else-if="canUploadAttachment(scope.row)" type="primary" @click="handleAttachment(scope.row)"> |
| | | ä¸ä¼ éä»¶ |
| | | </el-link> |
| | | <span v-else>â</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" fixed="right" label="æä½" min-width="300"> |
| | | <template #default="scope"> |
| | | <el-button size="small" link type="primary" |
| | |
| | | @current-change="handleCurrentChange1"> |
| | | </el-pagination> |
| | | </div> |
| | | <lims-attachment ref="rowAttachment" upload-url="/deviceMaintenancePlan/uploadAttachment" |
| | | select-url="/deviceMaintenancePlan/selectAttachments" delete-url="/deviceMaintenancePlan/deleteAttachment" |
| | | id-param="maintenancePlanDetailId" name-field="deviceName" title="ä¿å
»è®°å½éä»¶" |
| | | :readonly="attachmentReadonly" @closed="getTableList"></lims-attachment> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="dialogVisible" |
| | | :title="dialogTitle" width="880px" @close="resetForm"> |
| | | <el-form ref="modelForm" :model="form" :rules="rules" label-width="150px" size="small"> |
| | |
| | | <el-input v-model="form.reviewRemark" :rows="2" placeholder="å¯å¡«åå®¡æ ¸æè§" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | <div class="form-section-title">éä»¶èµæ</div> |
| | | <el-form-item label-width="0"> |
| | | <lims-attachment inline upload-url="/deviceMaintenancePlan/uploadAttachment" |
| | | select-url="/deviceMaintenancePlan/selectAttachments" delete-url="/deviceMaintenancePlan/deleteAttachment" |
| | | id-param="maintenancePlanDetailId" name-field="deviceName" title="ä¿å
»è®°å½éä»¶" |
| | | :main-id="form.maintenancePlanDetailId" :readonly="!isEdit"></lims-attachment> |
| | | </el-form-item> |
| | | <div class="check-note">夿³¨ï¼æ£å¸¸ãè¯å¥½æâââï¼ä¸æ£å¸¸å妿âÃâã</div> |
| | | <div v-if="cycleNote" class="check-note">{{ cycleNote }}</div> |
| | | </el-form> |
| | |
| | | reviewDeviceMaintenance, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from '@/api/system/user' |
| | | import LimsAttachment from '@/components/Attachment/lims-attachment.vue' |
| | | import dayjs from 'dayjs' |
| | | import { formatDateOnly } from './dateFormat' |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | |
| | | |
| | | export default { |
| | | name: "equipment-maintenance-plan", |
| | | components: { LimsAttachment }, |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | outLoading: false, |
| | | reviewLoading: false, |
| | | userOptions: [], |
| | | attachmentReadonly: false, |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | // å¯¼åº |
| | | // å¯¼åºæ´ä»½ä¿å
»è®¡å |
| | | handleDownOne() { |
| | | this.outLoading = true |
| | | exportDeviceMaintenancePlan({ maintenancePlanId: this.planInfo.maintenancePlanId }).then(res => { |
| | | const params = { maintenancePlanId: this.planInfo.maintenancePlanId } |
| | | exportDeviceMaintenancePlan(params).then(res => { |
| | | this.outLoading = false |
| | | saveBlobOrShowError(res, '设å¤ä¿å
»è®¡å表.docx', 'application/msword') |
| | | }).catch(() => { |
| | |
| | | handleReview(row) { |
| | | this.handleForm('review', row) |
| | | }, |
| | | // å·²å®¡æ ¸éè¿/ä¸éè¿çè¡åªè¯»ï¼å
¶ä½å¯ä¸ä¼ éä»¶ |
| | | canUploadAttachment(row) { |
| | | return !row || (row.recordStatus !== 2 && row.recordStatus !== 3) |
| | | }, |
| | | // æå¼è¡éä»¶å¼¹çªï¼å¯ç¼è¾çè¡å
è®¸ç´æ¥ä¸ä¼ /å é¤ï¼å·²å®¡æ ¸çè¡åªè¯» |
| | | handleAttachment(row) { |
| | | this.attachmentReadonly = !this.canUploadAttachment(row) |
| | | this.$refs.rowAttachment.open(row) |
| | | }, |
| | | // æäº¤å®¡æ ¸ç»æï¼1 éè¿ï¼0 ä¸éè¿ |
| | | submitReview(status) { |
| | | this.reviewLoading = true |
| | |
| | | <div> |
| | | <div class="search"> |
| | | <el-form :model="search" ref="search" size="small" :inline="true"> |
| | | <el-form-item label="æ ·åç¼å·"> |
| | | <el-input v-model="search.sampleCode" clearable placeholder="请è¾å
¥" size="small" |
| | | <el-form-item label="设å¤åç§°"> |
| | | <el-input v-model="search.deviceName" clearable placeholder="请è¾å
¥" size="small" |
| | | @keyup.enter="getTableList()"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤åå·"> |
| | | <el-input v-model="search.specificationModel" clearable placeholder="请è¾å
¥" size="small" |
| | | @keyup.enter="getTableList()"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤ç¼å·"> |
| | | <el-input v-model="search.managementNumber" clearable placeholder="请è¾å
¥" size="small" |
| | | @keyup.enter="getTableList()"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ ·åç¼å·"> |
| | | <el-input v-model="search.sampleCode" clearable placeholder="请è¾å
¥" size="small" |
| | | @keyup.enter="getTableList()"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <div> |
| | | <el-button :loading="outLoading" size="small" type="primary" @click="openHandleOut">导 åº</el-button> |
| | | <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">导 åº</el-button> |
| | | </div> |
| | | </div> |
| | | <div> |
| | |
| | | <el-button v-if="operationType !== 'view'" type="primary" @click="saveRecord">ç¡® å®</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | | <el-dialog v-model="ratifyDialog" title="导åº" width="30%" @close="ratifyDialog = false, exportDate = ''"> |
| | | <span>æ¶é´ï¼ |
| | | <el-date-picker v-model="exportDate" format="YYYY-MM" placeholder="éæ©æä»½" size="small" style="width:100%" |
| | | type="month" value-format="YYYY-MM"> |
| | | </el-date-picker> |
| | | </span> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button @click="ratifyDialog = false, exportDate = ''">å æ¶</el-button> |
| | | <el-button :loading="outLoading" type="primary" @click="handleDown">导 åº</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <script> |
| | |
| | | orderCode: '', |
| | | sampleCode: '', |
| | | useDate: today(), |
| | | useStartTime: '', |
| | | useEndTime: '', |
| | | useStartTime: '10:00:00', |
| | | useEndTime: '19:30:00', |
| | | temperature: '', |
| | | humidity: '', |
| | | useBefore: 1, |
| | |
| | | size: 20, |
| | | current: 1, |
| | | total: 0, |
| | | sampleCode: '', |
| | | managementNumber: '' |
| | | deviceName: '', |
| | | specificationModel: '', |
| | | managementNumber: '', |
| | | sampleCode: '' |
| | | }, |
| | | outLoading: false, |
| | | ratifyDialog: false, |
| | | exportDate: '', |
| | | userList: [], |
| | | form: defaultForm(), |
| | | dialogVisible: false, |
| | |
| | | size: 20, |
| | | current: 1, |
| | | total: 0, |
| | | sampleCode: '', |
| | | managementNumber: '' |
| | | deviceName: '', |
| | | specificationModel: '', |
| | | managementNumber: '', |
| | | sampleCode: '' |
| | | } |
| | | this.getTableList(); |
| | | }, |
| | |
| | | this.tableLoading = false |
| | | }) |
| | | }, |
| | | // æå¼å¯¼åºå¼¹æ¡éæ©ç¼å¶äººãæ¹å人 |
| | | openHandleOut() { |
| | | this.ratifyDialog = true |
| | | }, |
| | | //å¯¼åº |
| | | //导åºï¼æä¸»è¡¨åçéåºå½åæ¡ä»¶å¯¼åº |
| | | handleDown() { |
| | | this.outLoading = true |
| | | exportUseRecord({ |
| | | sampleCode: this.search.sampleCode, |
| | | deviceName: this.search.deviceName, |
| | | specificationModel: this.search.specificationModel, |
| | | managementNumber: this.search.managementNumber, |
| | | exportDate: this.exportDate |
| | | sampleCode: this.search.sampleCode |
| | | }).then(res => { |
| | | this.outLoading = false |
| | | saveBlobOrShowError(res, '仪å¨è®¾å¤è¿è¡è®°å½.docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') |
| | |
| | | managementNumber: row.managementNumber || '', |
| | | orderCode: row.orderCode || '', |
| | | useDate: start ? start.slice(0, 10) : '', |
| | | useStartTime: start.length >= 19 ? start.slice(11, 19) : '', |
| | | useEndTime: end.length >= 19 ? end.slice(11, 19) : '', |
| | | useStartTime: start.length >= 19 ? start.slice(11, 19) : '10:00:00', |
| | | useEndTime: end.length >= 19 ? end.slice(11, 19) : '19:30:00', |
| | | temperature: row.temperature || '', |
| | | humidity: row.humidity || '', |
| | | usePersonId: row.usePersonId || '', |
| | |
| | | |
| | | <style scoped> |
| | | .search { |
| | | height: 46px; |
| | | min-height: 46px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-top: 4px; |
| | |
| | | </div> |
| | | </div> |
| | | <div style="line-height: 30px;"> |
| | | <el-button size="small" @click="$refs.importDialog.open()">导 å
¥</el-button> |
| | | <el-button size="small" type="primary" :icon="$icon('el-icon-plus')" |
| | | @click="addDialogVisible = true, addInfo = {}, file = null">æä»¶åæ§ç³è¯·</el-button> |
| | | @click="addDialogVisible = true, addInfo = {}, file = null, fileList = []">æä»¶åæ§ç³è¯·</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | |
| | | <div class="search_thing"> |
| | | <div class="search_label">ä¸ä¼ éä»¶ï¼</div> |
| | | <div class="search_input"><el-upload style="margin: 8px 0 0px 50px;" action="#" :auto-upload="false" |
| | | :multiple="false" accept='.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.wps,.et,.dps,.txt,.jpg,.jpeg,.png' :on-change="handleChangeUpload" v-if="addDialogVisible"> |
| | | :multiple="false" accept='.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.wps,.et,.dps,.txt,.jpg,.jpeg,.png' |
| | | :file-list="fileList" :on-change="handleChangeUpload" :on-remove="handleRemoveUpload" |
| | | :before-remove="beforeRemoveUpload" :on-preview="handlePreviewUpload" v-if="addDialogVisible"> |
| | | <el-button size="small" type="primary">ä¸ä¼ éä»¶</el-button> |
| | | </el-upload></div> |
| | | </div> |
| | |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æäº¤æ¥æï¼</div> |
| | | <div class="search_label">å叿¥æï¼</div> |
| | | <div class="search_input"> |
| | | <el-date-picker v-model="addInfo.submitDate" type="date" size="small" placeholder="éæ©æ¥æ" |
| | | <el-date-picker v-model="addInfo.publishDate" type="date" size="small" placeholder="éæ©æ¥æ" |
| | | format="YYYY-MM-DD" value-format="YYYY-MM-DD" style="width: 100%;"> |
| | | </el-date-picker> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">宿½æ¥æï¼</div> |
| | | <div class="search_input"> |
| | | <el-date-picker v-model="addInfo.implementDate" type="date" size="small" placeholder="éæ©æ¥æ" |
| | | format="YYYY-MM-DD" value-format="YYYY-MM-DD" style="width: 100%;"> |
| | | </el-date-picker> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="24" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">说æï¼</div> |
| | | <div class="search_input"><el-input size="small" placeholder="请è¾å
¥" clearable v-model="addInfo.instructions" |
| | |
| | | style="height: 90vh;overflow-y: auto;" /> |
| | | </el-dialog> |
| | | <el-dialog title="å®¡æ ¸" v-model="checkDialogVisible" width="1000px" top="5vh"> |
| | | <UpPdfStamp ref="UpPdfStamp" v-if="checkDialogVisible" @uploadPDF="uploadPDF" :isUpFile="false"></UpPdfStamp> |
| | | <UpPdfStamp ref="UpPdfStamp" v-if="checkDialogVisible" @uploadPDF="uploadPDF" @uploadPDFErr="handlePdfError" :isUpFile="false"></UpPdfStamp> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button @click="handleCheckSub('ä¸éè¿')" :loading="noCheckLoading">ä¸éè¿</el-button> |
| | | <el-button type="primary" @click="handleCheckSub('éè¿')" :loading="checkLoading">é è¿</el-button> |
| | |
| | | <el-button type="primary" @click="handleCheck0(currentInfo)">ç¡® å®</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | | <import-dialog |
| | | ref="importDialog" |
| | | title="导å
¥æä»¶åæ§ç³è¯·" |
| | | :action="importAction" |
| | | accept=".xls,.xlsx" |
| | | template-url="/import-templates/æä»¶åæ§ç³è¯·å¯¼å
¥æ¨¡æ¿.xlsx?v=1" |
| | | template-name="æä»¶åæ§ç³è¯·å¯¼å
¥æ¨¡æ¿.xlsx" |
| | | :tips="['表头å¿
须䏿¨¡æ¿å®å
¨ä¸è´ï¼ä¸è½å¢å åæä¿®æ¹åå', 'å叿¥æã宿½æ¥ææ ¼å¼ï¼YYYY-MM-DD', '导å
¥åç¶æä¸ºè稿ï¼ç³è¯·äººä¸ºç©ºï¼å¯å¨é¡µé¢ä¸ç¼è¾']" |
| | | @success="refreshTable" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import UpPdfStamp from '@/components/UpPdfStamp/index.vue' |
| | | import filePreview from '@/components/Preview/filePreview.vue' |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import ImportDialog from '@/components/ImportDialog/index.vue' |
| | | import { |
| | | selectUserCondition, |
| | | } from "@/api/business/inspectionTask.js"; |
| | |
| | | components: { |
| | | filePreview, |
| | | UpPdfStamp, |
| | | limsTable |
| | | limsTable, |
| | | ImportDialog |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["nickName"]), |
| | | importAction() { |
| | | return this.javaApi + '/manageDocumentControlled/importManageDocumentControlled' |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | personList: [], |
| | | fileType: [], |
| | | file: null, |
| | | fileList: [], |
| | | currentInfo: {}, |
| | | checkLoading: false, |
| | | noCheckLoading: false, |
| | |
| | | } |
| | | }, |
| | | }, |
| | | { label: "æä»¶åç§°", prop: "name", minWidth: "160" }, |
| | | { label: "æä»¶çæ¬", prop: "version", width: "100px" }, |
| | | { label: "å叿¥æ", prop: "publishDate", width: "110px" }, |
| | | { label: "宿½æ¥æ", prop: "implementDate", width: "110px" }, |
| | | { |
| | | label: "ç³è¯·äºº", |
| | | prop: "createUserName", |
| | | }, |
| | | { label: "ç³è¯·æ¶é´", prop: "createTime" }, |
| | | { label: "说æ", prop: "instructions" }, |
| | | { label: "æäº¤æ¥æ", prop: "submitDate" }, |
| | | { label: "责任人", prop: "dutyUserName" }, |
| | | { |
| | | label: "ç³è¯·ç¶æ", prop: "state", dataType: "tag", |
| | |
| | | this.handleCheck(row); |
| | | }, |
| | | disabled: (row) => { |
| | | if (row.state == 'éè¿') { |
| | | return true |
| | | } |
| | | if(row.dutyUserName != null && row.dutyUserName != "") { |
| | | return !row.dutyUserName.includes(this.nickName) || row.state == 'éè¿' |
| | | return !row.dutyUserName.includes(this.nickName) |
| | | }else { |
| | | return false |
| | | } |
| | |
| | | }); |
| | | }, |
| | | // æäº¤ |
| | | buildFormData() { |
| | | const fd = new FormData() |
| | | // æä»¶ä¿¡æ¯ä¸ raw ææ¯ççæä»¶ |
| | | if (this.file) { |
| | | fd.append("file", this.file.raw) |
| | | } |
| | | const fields = ['id', 'documentCode', 'dutyUser', 'type', 'name', 'version', 'writer', |
| | | 'publishDate', 'implementDate', 'instructions'] |
| | | fields.forEach((key) => { |
| | | const value = this.addInfo[key] |
| | | // ç©ºæ¥æ/ç©ºä¸æä¸ä¼ ï¼é¿å
åç«¯æ¥æææ°ååæ®µè§£æå¤±è´¥ |
| | | if (value !== undefined && value !== null && value !== '') { |
| | | fd.append(key, value) |
| | | } |
| | | }) |
| | | return fd |
| | | }, |
| | | handleAdd() { |
| | | if (!this.addInfo.documentCode) return this.$message({ type: 'error', message: "请è¾å
¥ç¼å·" }) |
| | | if (!this.addInfo.id) { |
| | | // æ°å¢ |
| | | let fd = new FormData(); |
| | | //æä»¶ä¿¡æ¯ä¸rawææ¯ççæä»¶ |
| | | if (this.file) { |
| | | fd.append("file", this.file.raw); |
| | | const isEdit = !!this.addInfo.id |
| | | const request = isEdit ? doManageDocumentControlled : addManageDocumentControlled |
| | | this.addLoading = true |
| | | request(this.buildFormData()).then(res => { |
| | | this.addLoading = false |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: isEdit ? 'ä¿®æ¹æå' : 'æ·»å æå' |
| | | }) |
| | | this.refreshTable() |
| | | this.addDialogVisible = false |
| | | } else { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: isEdit ? 'ä¿®æ¹å¤±è´¥' : 'æ·»å 失败' |
| | | }) |
| | | } |
| | | for (let m in this.addInfo) { |
| | | fd.append(m, this.addInfo[m]) |
| | | } |
| | | this.addLoading = true |
| | | addManageDocumentControlled(fd).then(res => { |
| | | this.addLoading = false |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'æ·»å æå' |
| | | }) |
| | | this.refreshTable() |
| | | this.addDialogVisible = false |
| | | } else { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: 'æ·»å 失败' |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | // ä¿®æ¹ |
| | | let { id, documentCode, dutyUser, type, name, version, writer, submitDate, instructions } = this.addInfo |
| | | let fd = new FormData(); |
| | | //æä»¶ä¿¡æ¯ä¸rawææ¯ççæä»¶ |
| | | if (this.file) { |
| | | fd.append("file", this.file.raw); |
| | | } |
| | | fd.append("id", id); |
| | | fd.append("documentCode", documentCode); |
| | | fd.append("dutyUser", dutyUser); |
| | | fd.append("type", type); |
| | | fd.append("name", name); |
| | | fd.append("version", version); |
| | | fd.append("writer", writer); |
| | | fd.append("submitDate", submitDate); |
| | | fd.append("instructions", instructions); |
| | | this.addLoading = true |
| | | doManageDocumentControlled(fd).then(res => { |
| | | this.addLoading = false |
| | | if (res.code == 200) { |
| | | this.refreshTable() |
| | | this.addDialogVisible = false |
| | | } else { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: 'æ·»å 失败' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }).catch(() => { |
| | | this.addLoading = false |
| | | }) |
| | | }, |
| | | handleChangeUpload(file, fileLists) { |
| | | this.file = file |
| | | this.addInfo['name'] = file.name |
| | | }, |
| | | // ç§»é¤æ°éçéä»¶åä¸åä¸ä¼ ï¼åæéä»¶ä¸å
许å¨è¿éå é¤ï¼åªè½éæ©æ°éä»¶æ¿æ¢ |
| | | handleRemoveUpload() { |
| | | this.file = null |
| | | }, |
| | | beforeRemoveUpload(file) { |
| | | if (file && !file.raw) { |
| | | this.$message.warning('éæ©æ°éä»¶ä¿ååä¼èªå¨æ¿æ¢åéä»¶') |
| | | return false |
| | | } |
| | | return true |
| | | }, |
| | | handlePreviewUpload(file) { |
| | | if (file && file.url) { |
| | | this.$download.saveAs(file.url, file.name) |
| | | } |
| | | }, |
| | | fileNameFromUrl(url) { |
| | | return (url || '').replace(/^[0-9a-fA-F-]{36}_/, '') |
| | | }, |
| | | // ç¼è¾ |
| | | handleUpdate(row) { |
| | | this.title = 'æä»¶åæ´ç³è¯·' |
| | | this.addInfo = this.HaveJson(row) |
| | | this.file = null |
| | | // 忾已ä¸ä¼ çéä»¶ï¼ä¿åæ¶æªéæ°éæ©åä¿çåéä»¶ |
| | | this.fileList = row.url |
| | | ? [{ name: this.fileNameFromUrl(row.url), url: this.javaApi + '/word/' + row.url }] |
| | | : [] |
| | | this.addDialogVisible = true |
| | | }, |
| | | // æ¥çéä»¶ |
| | |
| | | } else { |
| | | this.noCheckLoading = true |
| | | } |
| | | this.addLoading = true |
| | | this.$refs['UpPdfStamp'].generatePDF() |
| | | }, |
| | | // é¢è§å¤±è´¥ææ²¡éæä»¶æ¶å¤ä½æé®ï¼é¿å
âéè¿âä¸ç´è½¬å |
| | | handlePdfError() { |
| | | this.checkLoading = false |
| | | this.noCheckLoading = false |
| | | }, |
| | | handleDelete(row) { |
| | | this.$confirm("æ¯å¦å é¤è¯¥æ¡æ°æ®?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | |
| | | <template> |
| | | <!-- åæ¾åæ¶è®°å½ --> |
| | | <div> |
| | | <div style="font-size: 12px; line-height: 20px; color: var(--el-text-color-secondary); margin-bottom: 8px;"> |
| | | æç¤ºï¼æ¬é¡µæäº¤çåæ¾ãåæ¶è®°å½ä¼èªå¨åæ¥å°èåãåæ¾ä¸åæ¶è®°å½ãï¼æ éåå°è¯¥é¡µé¢éå¤å½å
¥ã |
| | | </div> |
| | | <div class="search"> |
| | | <div> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"> |
| | |
| | | <template> |
| | | <!-- æä»¶åæ´ç³è¯· --> |
| | | <div> |
| | | <div style="font-size: 12px; line-height: 20px; color: var(--el-text-color-secondary); margin-bottom: 8px;"> |
| | | æç¤ºï¼æ¬é¡µæäº¤çåæ´ç³è¯·ä¼èªå¨åæ¥å°èåãæä»¶ä¿®è®¢ç³è¯·å®¡æ¹è®°å½ãï¼å®¡æ ¸éè¿å忥æ¹å人ã |
| | | </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;"> |
| | |
| | | <template> |
| | | <!-- æä»¶ä½åºç³è¯· --> |
| | | <div> |
| | | <div style="font-size: 12px; line-height: 20px; color: var(--el-text-color-secondary); margin-bottom: 8px;"> |
| | | æç¤ºï¼å®¡æ ¸éè¿åä¼èªå¨ä»æä»¶æ¸
åç§»é¤ï¼å¹¶å¨èåãä½åºæä»¶éæ¯è®°å½ãçæä¸æ¡å¾
ç»è®°è®°å½ã |
| | | </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;"> |
| | |
| | | <template> |
| | | <!-- ä½åºæä»¶éæ¯è®°å½ --> |
| | | <div class="capacity-scope"> |
| | | <div style="font-size: 12px; line-height: 20px; color: var(--el-text-color-secondary); margin-bottom: 8px;"> |
| | | æç¤ºï¼æä»¶ä½åºç³è¯·å®¡æ ¸éè¿åä¼èªå¨å¨æ¬é¡µçæå¾
ç»è®°è®°å½ï¼è¯·è¡¥å
鿝æ°éã鿝åå åæ¹åã |
| | | </div> |
| | | <div class="search"> |
| | | <div> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"> |
| | |
| | | <template> |
| | | <!-- æææä»¶ï¼å
ãå¤é¨æä»¶ï¼çåæ¾ä¸åæ¶è®°å½ --> |
| | | <div class="capacity-scope"> |
| | | <div style="font-size: 12px; line-height: 20px; color: var(--el-text-color-secondary); margin-bottom: 8px;"> |
| | | æç¤ºï¼æ¬é¡µè®°å½ç±ãæä»¶åæ§ç³è¯· â åæ¾åæ¶è®°å½ãèªå¨çæï¼è¡¥å½å岿°æ®å¯ä½¿ç¨â导å
¥âæâæ°å¢âã |
| | | </div> |
| | | <div class="search"> |
| | | <div> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"> |
| | |
| | | <template> |
| | | <!-- æä»¶ä¿®è®¢ç³è¯·å®¡æ¹è®°å½ --> |
| | | <div class="capacity-scope"> |
| | | <div style="font-size: 12px; line-height: 20px; color: var(--el-text-color-secondary); margin-bottom: 8px;"> |
| | | æç¤ºï¼æ¬é¡µè®°å½ç±ãæä»¶åæ§ç³è¯· â æä»¶åæ´ç³è¯· / æä»¶ä½åºç³è¯·ãèªå¨çæï¼å¯å¨æ¬é¡µè¡¥å
ç« èå·ãå®¡æ¹æè§å¹¶æå°å½æ¡£ã |
| | | </div> |
| | | <div class="search"> |
| | | <div> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"> |