设备模块业务完善及前序页面优化
- 设备故障与维修/事故/报废/利用外部仪器设备:增加当前环节责任人只读控制,审批完成后锁定单据
- 设备停用/启用:按当前责任人只读;配合审批完成回写设备档案状态;设备借用按借出/归还责任人只读,附件上传删除同步控制
- 设备校准/核查/保养计划:按年份自动创建并补全计划明细、日期格式化、查询重置页码、审批后锁定、加载失败容错;设备核查计划相关弹窗保留编辑草稿自动恢复
- 设备导出统一失败拦截:后端返回错误 JSON 时提示错误,不再保存损坏文件;设备工具明细、使用记录导出支持当前筛选条件
- 设备模块日期统一格式化,新增 dateFormat.js、saveBlob.js、calibrationRecordDia.vue;清理无引用死代码、死接口及旧弹窗
- 标准物质台账:新增余量列,按验收日期倒序,余量为 0 时领用按钮置灰
- 设施和环境条件:移除电源稳定性、防雷检测、照度记录
- 方法验证-标准查新:新增弹框排版优化
- 不符合工作-不符合项分发:创建/修改时间格式化
| | |
| | | }); |
| | | } |
| | | |
| | | // æå¹´ä»½æ¥è¯¢è®¾å¤æ ¡å计åï¼ä¸åå¨åèªå¨å建ï¼å¹¶èªå¨è¡¥å
¨å°ç¹æç»ï¼ |
| | | export function getCalibrationPlanByYear(query) { |
| | | return request({ |
| | | url: "/deviceCalibrationPlan/getPlanByYear", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æäº¤æ¹åéç¥ |
| | | export function submiatRatifyDeviceCalibrationPlan(data) { |
| | | return request({ |
| | |
| | | export function pageDeviceExaminePlan(query) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/pageDeviceExaminePlan", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æå¹´ä»½æ¥è¯¢è®¾å¤æ ¸æ¥è®¡åï¼ä¸åå¨åèªå¨å建ï¼å¹¶èªå¨è¡¥å
¨å°ç¹æç»ï¼ |
| | | export function getExaminePlanByYear(query) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/getPlanByYear", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | |
| | | }); |
| | | } |
| | | |
| | | // æå¹´ä»½æ¥è¯¢è®¾å¤ä¿å
»è®¡åï¼ä¸åå¨åèªå¨å建ï¼å¹¶èªå¨è¡¥å
¨å°ç¹æç»ï¼ |
| | | export function getMaintenancePlanByYear(query) { |
| | | return request({ |
| | | url: "/deviceMaintenancePlan/getPlanByYear", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // å页æ¥è¯¢è®¾å¤ä¿å
»è®¡å详æ
|
| | | export function pageMaintenancePlanDetail(query) { |
| | | return request({ |
| | | url: "/deviceMaintenancePlan/pageMaintenancePlanDetail", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹è®¾å¤ä¿å
»è®¡å详æ
|
| | | export function updateMaintenancePlanDetail(data) { |
| | | return request({ |
| | | url: "/deviceMaintenancePlan/updateMaintenancePlanDetail", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // å é¤è®¾å¤ä¿å
»è®¡å详æ
|
| | | export function deleteMaintenancePlanDetail(query) { |
| | | return request({ |
| | | url: "/deviceMaintenancePlan/delMaintenancePlanDetail", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // å®¡æ ¸è®¾å¤ä¿å
»è®¡å |
| | | export function reviewMaintenancePlanStatus(data) { |
| | | return request({ |
| | | url: "/deviceMaintenancePlan/reviewMaintenancePlanStatus", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //å页æ¥è¯¢é弿º¯æºè®¡å |
| | | export function selectDeviceTraceabilityManagementByPage(query) { |
| | | return request({ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import { ElMessage } from 'element-plus' |
| | | import { saveAs } from 'file-saver' |
| | | |
| | | /** |
| | | * ä¿åæ¥å£è¿åçäºè¿å¶æä»¶ï¼è¥å端å®é
è¿åçæ¯é误 JSONï¼åæç¤ºé误è䏿¯åæåæä»¶ã |
| | | * @param {Blob} data 请æ±è¿åç blob |
| | | * @param {string} filename ä¸è½½æä»¶å |
| | | * @param {string} mime æä»¶ç±»å |
| | | */ |
| | | export function saveBlobOrShowError(data, filename, mime = 'application/octet-stream') { |
| | | const reader = new FileReader() |
| | | reader.readAsText(data, 'utf-8') |
| | | reader.onload = () => { |
| | | const text = (reader.result || '').trim() |
| | | if (text.startsWith('{') || text.startsWith('[')) { |
| | | let msg = '导åºå¤±è´¥' |
| | | try { |
| | | msg = JSON.parse(text).msg || msg |
| | | } catch (e) { |
| | | // éæ åéè¯¯ç»æï¼ä¿çé»è®¤æç¤º |
| | | } |
| | | ElMessage.error(msg) |
| | | } else { |
| | | saveAs(new Blob([data], { type: mime }), filename) |
| | | } |
| | | } |
| | | reader.onerror = () => { |
| | | saveAs(new Blob([data], { type: mime }), filename) |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog v-model="formDia" title="æ°å¢" width="80%" @close="closeDia"> |
| | | <el-form ref="form" :model="form" :rules="formRules" label-width="auto"> |
| | | <el-button size="small" type="primary" @click="addBtn">æ·»å 䏿¡</el-button> |
| | | <el-dialog v-model="formDia" title="æ°å¢" width="800px" @close="closeDia"> |
| | | <el-form ref="form" :model="form" :rules="formRules" label-width="120px"> |
| | | <div class="form-info"> |
| | | <div v-for="(items,index) in form.taskRel" :key="index"> |
| | | <div v-for="(items,index) in form.taskRel" :key="index" class="record-block"> |
| | | <div class="record-head"> |
| | | <span class="record-title"> |
| | | <span class="record-index">{{ index + 1 }}</span> |
| | | æ¥æ°è®°å½ |
| | | </span> |
| | | <el-button v-if="index !== 0" link type="danger" :icon="$icon('el-icon-delete')" |
| | | @click="deleteHeaderRow(index)">å 餿¬æ¡</el-button> |
| | | </div> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item :prop="`taskRel.${index}.newMethodName`" :rules="{required: true, message: 'è¯·å¡«åæ ååç§°',trigger: 'blur',}" label="æ°æ ååç§°ï¼"> |
| | | <el-input v-model="items.newMethodName" size="small"></el-input> |
| | |
| | | <el-input v-model="items.newStandardNo" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="24"> |
| | | <el-form-item :prop="`taskRel.${index}.searchNewSource`" :rules="{required: true,message: 'è¯·éæ©æ¥æ°è®°å½æ¥æº',trigger: 'change',}" label="æ¥æ°è®°å½æ¥æºï¼"> |
| | | <el-radio-group v-model="items.searchNewSource"> |
| | | <el-radio :value="0">æ åç½</el-radio> |
| | |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-col :span="12"> |
| | | <el-form-item :prop="`taskRel.${index}.remark`" :rules="{required: false,message: 'è¯·éæ©å¤æ³¨',trigger: 'change',}" label="夿³¨ï¼"> |
| | | <el-select v-model="items.remark" :prop="`taskRel.${index}.remark`" |
| | | :rules="{required: false,message: 'è¯·éæ©å¤æ³¨',trigger: 'change',}" |
| | | clearable size="small"> |
| | | <el-select v-model="items.remark" clearable size="small" style="width: 100%;"> |
| | | <el-option :value="0" label="ä½åº"></el-option> |
| | | <el-option :value="1" label="æ¿æ¢"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-button v-if="index !== 0" circle :icon="$icon('el-icon-delete')" size="small" type="danger" @click="deleteHeaderRow(index)"></el-button> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-divider></el-divider> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </div> |
| | | <div class="add-btn-wrap"> |
| | | <el-button class="add-btn" @click="addBtn">æ·»å 䏿¡</el-button> |
| | | </div> |
| | | </el-form> |
| | | <template #footer><span class="dialog-footer"> |
| | |
| | | |
| | | <style scoped> |
| | | .form-info { |
| | | display: inline-block; |
| | | max-height: 42em; |
| | | max-height: 52vh; |
| | | overflow-y: auto; |
| | | padding-right: 4px; |
| | | } |
| | | |
| | | .record-block { |
| | | background: #fafafa; |
| | | border: 1px solid #ebeef5; |
| | | border-radius: 6px; |
| | | padding: 14px 16px 0; |
| | | margin-bottom: 14px; |
| | | } |
| | | |
| | | .record-head { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | padding-bottom: 10px; |
| | | margin-bottom: 14px; |
| | | border-bottom: 1px dashed #e4e7ed; |
| | | } |
| | | |
| | | .record-title { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 8px; |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | color: var(--el-text-color-primary); |
| | | } |
| | | |
| | | .record-index { |
| | | display: inline-flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | width: 20px; |
| | | height: 20px; |
| | | border-radius: 50%; |
| | | background: var(--el-color-primary); |
| | | color: #fff; |
| | | font-size: 12px; |
| | | } |
| | | |
| | | .add-btn-wrap { |
| | | margin-top: 4px; |
| | | } |
| | | |
| | | .add-btn { |
| | | width: 100%; |
| | | color: var(--el-color-primary); |
| | | border: 1px dashed var(--el-color-primary); |
| | | background: transparent; |
| | | } |
| | | |
| | | .add-btn:hover { |
| | | color: var(--el-color-primary); |
| | | border-color: var(--el-color-primary); |
| | | background: var(--el-color-primary-light-9); |
| | | } |
| | | |
| | | :deep(.record-block .el-form-item) { |
| | | margin-bottom: 16px; |
| | | } |
| | | |
| | | :deep(.el-dialog) { |
| | | margin: 6vh auto 50px !important; |
| | | } |
| | |
| | | delInconsistentDistribution, |
| | | exportInconsistentDistribution, |
| | | } from '@/api/cnas/process/nonconformingWork.js' |
| | | import { formatListDate } from '@/views/CNAS/resourceDemand/device/component/dateFormat' |
| | | |
| | | export default { |
| | | name: 'NonconformingDistribution', |
| | |
| | | { |
| | | label: 'å建æ¶é´', |
| | | prop: 'createTime', |
| | | minWidth: '100' |
| | | minWidth: '150', |
| | | formatData: val => formatListDate(val) |
| | | }, |
| | | { |
| | | label: 'ä¿®æ¹äºº', |
| | |
| | | { |
| | | label: 'ä¿®æ¹æ¶é´', |
| | | prop: 'updateTime', |
| | | minWidth: '100' |
| | | minWidth: '150', |
| | | formatData: val => formatListDate(val) |
| | | }, |
| | | { |
| | | dataType: 'action', |
| | |
| | | submitForm() { |
| | | this.$refs.modelForm.validate((valid) => { |
| | | if (valid) { |
| | | this.submitFormLoading = true |
| | | if (this.operationType === 'add') { |
| | | addDeviceAcceptance(this.form).then(res => { |
| | | if (res.code == 200) { |
| | |
| | | <el-step title="ææ¯è´è´£äººæè§" @click="setStep(3)"></el-step> |
| | | <el-step title="主任æè§" @click="setStep(4)"></el-step> |
| | | </el-steps> |
| | | <el-form ref="modelForm" :model="form" :rules="rules" label-width="160px"> |
| | | <el-form ref="modelForm" :model="form" :rules="rules" label-width="160px" :disabled="!canOperate"> |
| | | <el-col v-if="showStep === 0" :span="12"> |
| | | <el-form-item label="å°ç¹ï¼" prop="address"> |
| | | <el-input v-model="form.address" :disabled="currentStep !== 0" clearable size="small"></el-input> |
| | |
| | | </el-form> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button @click="resetForm">å æ¶</el-button> |
| | | <el-button v-if="currentStep !== 5" :loading="submitFormLoading" type="primary" @click="submitForm">ç¡® |
| | | <el-button v-if="currentStep !== 5 && canOperate" :loading="submitFormLoading" type="primary" @click="submitForm">ç¡® |
| | | 认</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | |
| | | |
| | | <script> |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import { |
| | | getDeviceAccidentReport, |
| | | addDeviceAccidentReport, |
| | |
| | | return { |
| | | dialogVisible: false, |
| | | submitFormLoading: false, |
| | | canOperate: true, |
| | | form: { |
| | | accidentReportId: '', |
| | | address: '', |
| | |
| | | // æå¼å¼¹æ¡ |
| | | openDialog(id, deviceId) { |
| | | this.dialogVisible = true |
| | | this.canOperate = true |
| | | this.form.accidentReportId = id |
| | | this.form.deviceId = deviceId |
| | | this.getUserList() |
| | |
| | | this.currentStep = 5 |
| | | this.showStep = 4 |
| | | } |
| | | this.applyPermission() |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | | }) |
| | | }, |
| | | // éå½åç¯è责任人åªå
许æ¥ç |
| | | applyPermission() { |
| | | if (this.form.isFinish === 1 || this.currentStep >= 5) { |
| | | this.canOperate = false |
| | | return |
| | | } |
| | | const responsibleList = [ |
| | | this.form.reportUser, |
| | | this.form.assessorUser, |
| | | this.form.departmentHeadUser, |
| | | this.form.technicalDirectorUser, |
| | | this.form.directorHeadUser, |
| | | ] |
| | | const responsible = responsibleList[this.currentStep] |
| | | this.canOperate = !responsible || responsible === this.nickName |
| | | if (!this.canOperate) { |
| | | this.$message.warning('å½åç¯è责任人为ï¼' + responsible + 'ï¼æ¨åªè½æ¥ç') |
| | | } |
| | | }, |
| | | setStep(step) { |
| | | this.showStep = step |
| | |
| | | this.form.flowType = this.currentStep |
| | | this.$refs.modelForm.validate((valid) => { |
| | | if (valid) { |
| | | this.submitFormLoading = true |
| | | addDeviceAccidentReport(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | |
| | | }) |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["nickName"]), |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | |
| | | this.selectionRows = selection |
| | | }, |
| | | changeMachineName() { |
| | | this.selectionRows.map(val => { |
| | | const existingIds = new Set(this.calibrationPlanDetailList.map(item => item.deviceId)) |
| | | let skipped = 0 |
| | | this.selectionRows.forEach(val => { |
| | | if (existingIds.has(val.id)) { |
| | | skipped++ |
| | | return |
| | | } |
| | | // å° val.nextCalibrationDate 转æ¢ä¸º Date 对象并åå» 5 天 |
| | | let nextCalibrationDate = val.nextCalibrationDate ? new Date(val.nextCalibrationDate) : null; |
| | | if (nextCalibrationDate) { |
| | |
| | | verificationUnit: val.calibrationServices, |
| | | deviceAmount: 1 |
| | | }) |
| | | existingIds.add(val.id) |
| | | }) |
| | | if (skipped > 0) { |
| | | this.$message.warning(`å·²è·³è¿ ${skipped} å°å·²å¨è®¡åä¸ç设å¤`) |
| | | } |
| | | this.addEquipDia = false |
| | | this.rowDrop() |
| | | }, |
| | |
| | | }, |
| | | // æäº¤æ°å¢ |
| | | submitForm() { |
| | | if (!this.form.planName) { |
| | | this.$message.warning('请è¾å
¥è®¡ååç§°') |
| | | return |
| | | } |
| | | if (!this.form.planYear) { |
| | | this.$message.warning('è¯·éæ©å¹´ä»½') |
| | | return |
| | | } |
| | | if (!this.calibrationPlanDetailList.length) { |
| | | this.$message.warning('请添å 设å¤') |
| | | return |
| | | } |
| | | this.form.calibrationPlanDetailList = this.HaveJson(this.calibrationPlanDetailList) |
| | | this.submitFormLoading = true |
| | | if (this.operationType === 'add') { |
| | |
| | | } else { |
| | | updateDeviceCalibrationPlan(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.closeDialog() |
| | | this.$emit('closeDia') |
| | | } |
| | |
| | | <el-step title="计é室æè§" @click="setStep(2)"></el-step> |
| | | <el-step title="æ¹å人" @click="setStep(3)"></el-step> |
| | | </el-steps> |
| | | <el-form ref="modelForm" :model="form" :rules="rules" label-width="160px"> |
| | | <el-form ref="modelForm" :model="form" :rules="rules" label-width="160px" :disabled="!canOperate"> |
| | | <el-col v-if="showStep === 0" :span="12"> |
| | | <el-form-item label="åä½åç§°ï¼" prop="unitName"> |
| | | <el-input v-model="form.unitName" :disabled="currentStep !== 0" clearable size="small"></el-input> |
| | |
| | | </el-form> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button @click="resetForm">å æ¶</el-button> |
| | | <el-button v-if="currentStep !== 4" :loading="submitFormLoading" type="primary" @click="submitForm">ç¡® |
| | | <el-button v-if="currentStep !== 4 && canOperate" :loading="submitFormLoading" type="primary" @click="submitForm">ç¡® |
| | | 认</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | |
| | | addDeviceExternalApply, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | export default { |
| | | name: "applicationForm", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | |
| | | return { |
| | | dialogVisible: false, |
| | | submitFormLoading: false, |
| | | canOperate: true, |
| | | form: { |
| | | externalApplyId: '', |
| | | unitName: '', |
| | |
| | | // æå¼å¼¹æ¡ |
| | | openDialog(id) { |
| | | this.dialogVisible = true |
| | | this.canOperate = true |
| | | this.form.externalApplyId = id |
| | | this.getUserList() |
| | | if (this.form.externalApplyId) { |
| | |
| | | this.currentStep = 4 |
| | | this.showStep = 3 |
| | | } |
| | | this.applyPermission() |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | | }) |
| | | }, |
| | | // éå½åç¯è责任人åªå
许æ¥ç |
| | | applyPermission() { |
| | | if (this.form.isFinish === 1 || this.currentStep >= 4) { |
| | | this.canOperate = false |
| | | return |
| | | } |
| | | const responsibleList = [ |
| | | this.form.applicantUser, |
| | | this.form.departmentHeadUser, |
| | | this.form.meteringRoomUser, |
| | | this.form.approverUser, |
| | | ] |
| | | const responsible = responsibleList[this.currentStep] |
| | | this.canOperate = !responsible || responsible === this.nickName |
| | | if (!this.canOperate) { |
| | | this.$message.warning('å½åç¯è责任人为ï¼' + responsible + 'ï¼æ¨åªè½æ¥ç') |
| | | } |
| | | }, |
| | | setStep(step) { |
| | | this.showStep = step |
| | |
| | | this.form.flowType = this.currentStep |
| | | this.$refs.modelForm.validate((valid) => { |
| | | if (valid) { |
| | | this.submitFormLoading = true |
| | | addDeviceExternalApply(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | |
| | | }) |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["nickName"]), |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | |
| | | <el-step style="cursor:pointer" v-for="(v, i) in steps" :title="v" :key="i" |
| | | @click="choiceStep(i)"></el-step> |
| | | </el-steps> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="130px"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="130px" :disabled="!canOperate"> |
| | | <div v-show="currentStepClick === 0"> |
| | | <el-card style="margin-top: 1em; height: 51vh; overflow-y: scroll;"> |
| | | <!-- æ°å¢è®¾å¤äºè®°å½å¡ç --> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åç¨äººèç³»æ¹å¼ï¼" prop="borrowerContactInformation" label-width="150px"> |
| | | <el-input v-model="form.borrowerContactInformation" size="small"></el-input> |
| | | <el-input v-model="form.borrowerContactInformation" size="small" :disabled="currentStep > 0"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | <el-form-item label="ç¸å
³éä»¶ï¼" prop="fileName"> |
| | | <el-input v-model="form.fileName" disabled size="small" |
| | | :style="`width: ${currentStep == 0 ? '88%' : '100%'};`"> |
| | | <template #append><el-button v-if="currentStep === 0" :icon="$icon('el-icon-delete-solid')" |
| | | <template #append><el-button v-if="currentStep === 0 && canOperate" :icon="$icon('el-icon-delete-solid')" |
| | | @click="deleteFile"></el-button></template> |
| | | </el-input> |
| | | <el-upload ref="upload" style="float: right;" :action="action" :show-file-list="false" |
| | | :on-success="onSuccess" :disabled="currentStep !== 0" :headers="uploadHeader"> |
| | | :on-success="onSuccess" :disabled="currentStep !== 0 || !canOperate" :headers="uploadHeader"> |
| | | <template #trigger><el-button style="position: relative;top: -4px" class="uploadFile" size="small" |
| | | type="primary" v-if="currentStep === 0">éä»¶ä¸ä¼ </el-button></template> |
| | | type="primary" v-if="currentStep === 0 && canOperate">éä»¶ä¸ä¼ </el-button></template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </div> |
| | | </el-form> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button @click="submitForm('3reject')" v-if="currentStep !== 0 && currentStep !== 2">驳å</el-button> |
| | | <el-button @click="submitForm('2save')" v-if="currentStep === 0">ä¿å</el-button> |
| | | <el-button type="primary" v-if="currentStep !== 2" @click="submitForm('1submit')">{{ currentStep === 0 ? 'æäº¤' : |
| | | <el-button :loading="submitLoading" @click="submitForm('3reject')" v-if="currentStep !== 0 && currentStep !== 2 && canOperate">驳å</el-button> |
| | | <el-button :loading="submitLoading" @click="submitForm('2save')" v-if="currentStep === 0 && canOperate">ä¿å</el-button> |
| | | <el-button :loading="submitLoading" type="primary" v-if="currentStep !== 2 && canOperate" @click="submitForm('1submit')">{{ currentStep === 0 ? 'æäº¤' : |
| | | 'éè¿' |
| | | }}</el-button> |
| | | </span></template> |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="operator" label="æä½äºº" width="180"> |
| | | </el-table-column> |
| | | <el-table-column prop="operationTime" label="æä½æ¥æ" width="180"> |
| | | <el-table-column prop="operationTime" label="æä½æ¥æ" width="180" :formatter="formatDateCell"> |
| | | </el-table-column> |
| | | <el-table-column prop="operationType" label="æäº¤ç±»å"> |
| | | </el-table-column> |
| | |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import { formatListDate } from './dateFormat' |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | |
| | | return { |
| | | dialogVisible: false, |
| | | dialogVisible0: false, |
| | | canOperate: true, |
| | | currentStep: 0, // æ¥éª¤æ¡æ¾ç¤ºç¬¬å æ¥ |
| | | currentStepClick: 0, // ç¹å»æ¥éª¤æ¡åå |
| | | steps: ['ååº', 'åç¨'], |
| | | steps: ['ååº', 'å½è¿'], |
| | | responsibleOptions: [], // ä¸ç¯èè´è´£äººlist |
| | | form: { |
| | | processNumber: null, |
| | |
| | | }, |
| | | deviceLogs: [], |
| | | outLoading: false, |
| | | submitLoading: false, |
| | | recipientStateList: [{ |
| | | value: 0, |
| | | type: 'success', |
| | |
| | | }, |
| | | { label: "åç¨äºº", prop: "recipientUser" }, |
| | | { label: "åç¨äººèç³»æ¹å¼", prop: "borrowerContactInformation", width: '140px' }, |
| | | { label: "åç¨æ¥æ", prop: "recipientTime" }, |
| | | { label: "åç¨æ¥æ", prop: "recipientTime", formatData: (params) => formatListDate(params) }, |
| | | { |
| | | label: "åç¨æ¶ç¶æ", prop: "recipientState", dataType: "tag", |
| | | formatData: (params) => { |
| | | return this.recipientStateList.find((m) => m.value == params).label; |
| | | const item = this.recipientStateList.find((m) => m.value == params) |
| | | return item ? item.label : '-' |
| | | }, |
| | | formatType: (params) => { |
| | | return this.recipientStateList.find((m) => m.value == params).type; |
| | | const item = this.recipientStateList.find((m) => m.value == params) |
| | | return item ? item.type : 'info' |
| | | }, |
| | | }, |
| | | { label: "ååºäºº", prop: "submitUser" }, |
| | | { label: "ååºæ¥æ", prop: "createTime" }, |
| | | { label: "ååºæ¥æ", prop: "createTime", formatData: (params) => formatListDate(params) }, |
| | | { |
| | | label: "å½åç¶æ", prop: "nowState" |
| | | }, |
| | |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | if (newVal.value) { |
| | | thisqueryParams.deviceId = this.clickNodeVal.value |
| | | this.queryParams.deviceId = this.clickNodeVal.value |
| | | this.refreshTable() |
| | | } |
| | | }, |
| | |
| | | this.refreshTable() |
| | | }, |
| | | methods: { |
| | | formatDateCell(row, column, cellValue) { |
| | | return formatListDate(cellValue) |
| | | }, |
| | | getList() { |
| | | this.tableLoading = true; |
| | | let param = { ...this.queryParams, ...this.page }; |
| | |
| | | this.getList(); |
| | | }, |
| | | refresh() { |
| | | this.queryParams = {}; |
| | | this.queryParams = { deviceId: this.clickNodeVal.value }; |
| | | this.page.current = 1; |
| | | this.getList(); |
| | | }, |
| | |
| | | this.form.nowState = currentStepAction === 2 ? 'å
³é' : this.steps[currentStepAction] |
| | | this.form.deviceId = this.clickNodeVal.value |
| | | delete this.form.deviceLogs |
| | | this.submitLoading = true |
| | | saveDeviceBorrow(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æäº¤æå') |
| | | this.dialogVisible = false |
| | | this.refreshTable() |
| | | } |
| | | this.submitLoading = false |
| | | }).catch(err => { |
| | | this.submitLoading = false |
| | | }) |
| | | } else { |
| | | let step = this.steps[this.currentStep] |
| | |
| | | deleteCNASFile({ fileName: this.form.fileName }).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿åï¼') |
| | | this.form.fileName = null |
| | | this.form.url = null |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | |
| | | this.currentStepClick = i |
| | | } |
| | | console.log(this.currentStepClick) |
| | | this.applyPermission() |
| | | this.dialogVisible = true |
| | | } |
| | | }) |
| | | }, |
| | | // éå½åç¯è责任人åªå
许æ¥ç |
| | | applyPermission() { |
| | | if (this.form.nowState === 'å
³é') { |
| | | this.canOperate = false |
| | | return |
| | | } |
| | | let responsible = null |
| | | if (this.form.nowState === 'å½è¿') { |
| | | responsible = this.form.nowUser |
| | | } else if (this.form.nowState === 'ååº') { |
| | | responsible = this.form.submitOperationUser |
| | | } |
| | | this.canOperate = !responsible || responsible === this.nickName |
| | | if (!this.canOperate) { |
| | | this.$message.warning('å½åç¯è责任人为ï¼' + responsible + 'ï¼æ¨åªè½æ¥ç') |
| | | } |
| | | }, |
| | | // æ°å¢ |
| | | add() { |
| | | this.canOperate = true |
| | | this.dialogVisible = true |
| | | this.form = { |
| | | processNumber: null, |
| | |
| | | unifyNumber: null, |
| | | recipientUser: null, |
| | | recipientTime: null, |
| | | recipientState: 0, |
| | | nextUser: null, |
| | | rebackUser: null, |
| | | rebackTime: null, |
| | | receiveState: null, |
| | | receiveState: 0, |
| | | deviceUser: null, |
| | | fileName: null, |
| | | } |
| | |
| | | this.outLoading = true |
| | | deviceBorrowExport({ deviceId: this.clickNodeVal.value }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { |
| | | type: 'application/force-download' |
| | | }) |
| | | const filename = decodeURI(this.clickNodeVal.label + '设å¤ååºç»è®¡' + '.xlsx') |
| | | this.$download.saveAs(blob, filename) |
| | | saveBlobOrShowError(res, filename, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | handleLookList(row) { |
| | |
| | | <div> |
| | | <div class="btnS"> |
| | | <el-button size="small" type="primary" @click="calibrationMaintenance()">æ ¡å项ç®ç»´æ¤</el-button> |
| | | <el-button size="small" type="primary" @click="add('add')">æ·»å æ ¡åè®°å½</el-button> |
| | | <el-button size="small" type="primary" @click="add()">æ·»å æ ¡åè®°å½</el-button> |
| | | </div> |
| | | <div class="tables" style="margin-top: 10px;"> |
| | | <el-table :data="tableData" height="calc(100vh - 20em)" border> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="æ ¡åè¯ä¹¦ç¼å·" min-width="150" prop="certificateSerialNumber"></el-table-column> |
| | | <el-table-column label="说æ" min-width="150" prop="remark" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="æ ¡åæ¥æ" min-width="150" prop="calibrationDate"></el-table-column> |
| | | <el-table-column label="䏿¬¡æ ¡åæ¥æ" min-width="150" prop="nextCalibrationDate"></el-table-column> |
| | | <el-table-column label="ç¡®è®¤æ¥æ" min-width="150" prop="confirmDate"></el-table-column> |
| | | <el-table-column label="æ ¡åæ¥æ" min-width="150" prop="calibrationDate" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column label="䏿¬¡æ ¡åæ¥æ" min-width="150" prop="nextCalibrationDate" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column label="ç¡®è®¤æ¥æ" min-width="150" prop="confirmDate" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column label="ç»è®°äºº" min-width="150" prop="createUser"></el-table-column> |
| | | <el-table-column label="ç»è®°æ¥æ" min-width="150" prop="createTime"></el-table-column> |
| | | <el-table-column label="ç»è®°æ¥æ" min-width="150" prop="createTime" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column fixed="right" label="æä½" min-width="180" align="center"> |
| | | <template #default="{ row }"> |
| | | <el-button size="small" link type="primary" @click="handleAttachmentClick(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]" |
| | | <el-pagination :current-page="search.current" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" |
| | | @size-change="handleSizeChange" @current-change="handleCurrentChange" background> |
| | | </el-pagination> |
| | |
| | | <el-table-column label="æå¤§å
许误差" prop="maxPermissibleError"></el-table-column> |
| | | <el-table-column label="å¤å®æ å" prop="judgmentCriteria"></el-table-column> |
| | | <el-table-column label="å建人" prop="createdBy"></el-table-column> |
| | | <el-table-column label="å建æ¶é´" prop="creationTime"></el-table-column> |
| | | <el-table-column label="å建æ¶é´" prop="creationTime" :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column fixed="right" label="æä½"> |
| | | <template #default="scope"> |
| | | <el-button size="small" link type="primary" @click="handleDelete(scope.row)">å é¤</el-button> |
| | |
| | | </el-table> |
| | | </el-dialog> |
| | | |
| | | <!-- æ·»å æ ¡åè®°å½ --> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="dialogVisible1" |
| | | title="æ·»å æ ¡åè®°å½" top="5vh" width="80%" @close="resetCalibrationRecord"> |
| | | <div style="height: 70vh;overflow-y: auto;overflow-x: hidden;"> |
| | | <h4> |
| | | <div style="display: flex;align-items: center;"> |
| | | <span class="line"></span> |
| | | <span>æ·»å è®¾å¤æ ¡åè®°å½</span> |
| | | </div> |
| | | </h4> |
| | | <el-form ref="calibrationRecord" :model="calibrationRecord" :rules="formRules" label-position="right" |
| | | label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="æ ¡åæå¡æºæ:" prop="unitOfMeasure"> |
| | | <el-select v-model="calibrationRecord.unitOfMeasure" :disabled="operationType === 'view'" clearable filterable |
| | | size="small" style="width: 100%"> |
| | | <el-option v-for="name in calibrationServiceOptions" :key="name" :label="name" :value="name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="æ ¡åæ¥æ:" prop="calibrationDate"> |
| | | <el-date-picker v-model="calibrationRecord.calibrationDate" :disabled="operationType === 'view'" |
| | | format="YYYY-MM-DD" placeholder="éæ©æ¥æ" size="small" style="width: 90%" type="date" |
| | | value-format="YYYY-MM-DD" @change="getNextCalibrationDate"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="䏿¬¡æ ¡åæ¥æ:" label-width="140px"> |
| | | <el-date-picker v-model="calibrationRecord.nextCalibrationDate" disabled format="YYYY-MM-DD" |
| | | placeholder="éæ©æ¥æ" size="small" style="width: 90%" type="date" value-format="YYYY-MM-DD"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="计ç®å¨å
·:" prop="calculatingApparatus"> |
| | | <el-input v-model="calibrationRecord.calculatingApparatus" :disabled="operationType === 'view'" |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="è®¡ç®æ åéç¨:" prop="standardRange"> |
| | | <el-input v-model="calibrationRecord.standardRange" :disabled="operationType === 'view'" size="small" |
| | | style="width: 90%"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="è®¡éæ åä¸ç¡®å®åº¦:" label-width="140px" prop="calibrationStandardUncertainty"> |
| | | <el-input v-model="calibrationRecord.calibrationStandardUncertainty" |
| | | :disabled="operationType === 'view'" size="small" style="width: 90%"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="æä¾æ®æä»¶:" prop="byDocument"> |
| | | <el-input v-model="calibrationRecord.byDocument" :disabled="operationType === 'view'" |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="è¯ä¹¦ç¼å·:" prop="certificateSerialNumber"> |
| | | <el-input v-model="calibrationRecord.certificateSerialNumber" :disabled="operationType === 'view'" |
| | | size="small" style="width: 90%"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="ç¶æ:" label-width="140px" prop="status" required> |
| | | <el-radio-group v-model="calibrationRecord.status" :disabled="operationType === 'view'"> |
| | | <el-radio value="0yes">åæ ¼</el-radio> |
| | | <el-radio value="1no">ä¸åæ ¼</el-radio> |
| | | <el-radio value="2other">å
¶ä»</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="ç¡®è®¤æ¥æ:"> |
| | | <el-date-picker v-model="calibrationRecord.confirmDate" :disabled="operationType === 'view'" |
| | | format="YYYY-MM-DD HH:mm:ss" placeholder="éæ©æ¥æ" size="small" style="width: 100%" type="datetime" |
| | | value-format="YYYY-MM-DD HH:mm:ss"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="17"> |
| | | <el-form-item label="éä»¶ï¼" prop="fileName"> |
| | | <el-input v-model="calibrationRecord.fileName" |
| | | :style="`width: ${operationType === 'add' ? '85%' : '100%'};}`" disabled size="small"> |
| | | <template #append><el-button v-if="operationType === 'add'" :icon="$icon('el-icon-delete-solid')" |
| | | @click="deleteFile"></el-button></template> |
| | | </el-input> |
| | | <el-upload v-if="operationType === 'add'" ref="upload" :action="action" :before-upload="beforeUpload" |
| | | :headers="uploadHeader" :limit="1" :on-error="onError" :on-success="handleSuccessUp" |
| | | :show-file-list="false" style="float: right;"> |
| | | <el-button :loading="upLoading" size="small" style="position: relative; top: -4px;" |
| | | type="primary">éä»¶ä¸ä¼ |
| | | </el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿³¨:"> |
| | | <el-input v-model="calibrationRecord.remark" :disabled="operationType === 'view'" :rows="3" size="small" |
| | | style="width: 96%" type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <h4> |
| | | <span style="display: flex;align-items: center;"> |
| | | <span class="line"></span><span>æ ¡åæ¡ç®ç¡®è®¤ç»æ</span> |
| | | </span> |
| | | </h4> |
| | | <el-table ref="calibrateTable" :data="calibrateParams" border> |
| | | <el-table-column label="ç¼å·" type="index" width="60"></el-table-column> |
| | | <el-table-column label="计éåæ°" prop="measurementParameter"></el-table-column> |
| | | <el-table-column label="éç¨èå´" prop="rangeOfMeasurement"></el-table-column> |
| | | <el-table-column label="æå¤§å
许误差" prop="maxPermissibleError"></el-table-column> |
| | | <el-table-column label="å¤å®æ å" prop="judgmentCriteria"></el-table-column> |
| | | <el-table-column label="æ¯å¦æ ¡å" prop="isCalibration"> |
| | | <template #header="scope"> |
| | | <span class="required-span">* </span>æ¯å¦æ ¡å |
| | | </template> |
| | | <template #default="scope"> |
| | | <el-radio-group v-model="scope.row.isCalibration" :disabled="operationType === 'view'"> |
| | | <el-radio value="0yes">æ¯</el-radio> |
| | | <el-radio value="1no">å¦</el-radio> |
| | | </el-radio-group> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å¤å®ç»æ" min-width="140" prop="result"> |
| | | <template #header="scope"> |
| | | <span class="required-span">* </span>å¤å®ç»æ |
| | | </template> |
| | | <template #default="scope"> |
| | | <el-radio-group v-model="scope.row.result" :disabled="operationType === 'view'" @change="checkRadio()"> |
| | | <el-radio value="0yes">åæ ¼</el-radio> |
| | | <el-radio value="1no">ä¸åæ ¼</el-radio> |
| | | <el-radio value="2other">å
¶ä»</el-radio> |
| | | </el-radio-group> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="åé¡¹ç»æè¯´æ" prop="singleResultStatement"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.singleResultStatement" :disabled="operationType === 'view'" |
| | | size="small"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button v-if="operationType === 'add'" @click="dialogVisible1 = false">å æ¶</el-button> |
| | | <el-button v-if="operationType === 'add'" :loading="addRecordLoading" type="primary" @click="addRecord">ç¡® |
| | | å®</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | | <!-- æ·»å /æ¥çæ ¡åè®°å½å¼¹çª --> |
| | | <calibration-record-dia ref="calibrationRecordDia" |
| | | @success="getTableList(clickNodeVal.value)"></calibration-record-dia> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | deviceMetricRecordPage, |
| | | showDeviceMetricsCopy, |
| | | deleteDeviceMetricRecord, |
| | | deleteCNASFile, |
| | | selectDeviceMetric, |
| | | deleteDeviceMetrics, |
| | | addOrUpdateDeviceMetricRecord, |
| | | saveOrUpdateDeviceMetric |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectQualifiedSupplierManagementPage } from '@/api/cnas/externalService/supplierManage/supplierManage' |
| | | import CalibrationRecordDia from './calibrationRecordDia.vue' |
| | | import { formatListDate } from './dateFormat' |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | export default { |
| | | components: { CalibrationRecordDia }, |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | calibrateParams: [], |
| | | calibrateParamsLoading: false, |
| | | addCalibrateLoading: false, |
| | | calibrationRecord: { |
| | | unitOfMeasure: '', // 计éåä½ |
| | | calibrationDate: null, // æ ¡åæ¥æ |
| | | nextCalibrationDate: null, // 䏿¬¡æ ¡åæ¥æ |
| | | calculatingApparatus: '', // 计ç®å¨å
· |
| | | confirmDate: null, // ç¡®è®¤æ¥æ |
| | | standardRange: '', // è®¡ç®æ åéç¨ |
| | | calibrationStandardUncertainty: '', // è®¡éæ åä¸ç¡®å®åº¦ |
| | | byDocument: '', // 便®æä»¶ |
| | | certificateSerialNumber: '', // è¯ä¹¦ç¼å· |
| | | status: '', // ç¶æ |
| | | remark: '', // 夿³¨ |
| | | systemFileName: '', // |
| | | fileName: '', // |
| | | }, |
| | | formRules: { |
| | | unitOfMeasure: [{ required: true, message: 'è¯·éæ©æ ¡åæå¡æºæ', trigger: 'change' }], |
| | | calibrationDate: [{ required: true, message: 'è¯·éæ©æ ¡åæ¥æ', trigger: 'change' }], |
| | | calculatingApparatus: [{ required: true, message: '请è¾å
¥è®¡ç®å¨å
·', trigger: 'blur' }], |
| | | standardRange: [{ required: true, message: '请è¾å
¥è®¡ç®æ åéç¨', trigger: 'blur' }], |
| | | calibrationStandardUncertainty: [{ required: true, message: '请è¾å
¥è®¡éæ åä¸ç¡®å®åº¦', trigger: 'blur' }], |
| | | byDocument: [{ required: true, message: '请è¾å
¥æä¾æ®æä»¶', trigger: 'blur' }], |
| | | status: [{ required: true, message: 'è¯·éæ©ç¶æ', trigger: 'change' }], |
| | | }, |
| | | tableData: [], |
| | | dialogVisible0: false, |
| | | dialogVisible1: false, |
| | | form0: { |
| | | measurementParameter: '', // 计éåæ° |
| | | rangeOfMeasurement: '', |
| | |
| | | { required: true, message: '请è¾å
¥å¤å®æ å', trigger: 'blur' } |
| | | ], |
| | | }, |
| | | addRecordLoading: false, |
| | | upLoading: false, |
| | | operationType: '', |
| | | qualifiedSupplierNames: [], |
| | | search: { |
| | | size: 20, |
| | | current: 1, |
| | |
| | | }, |
| | | // ç¨äºä¸ä¼ æä»¶çä¿¡æ¯ |
| | | computed: { |
| | | // æ ¡åæå¡æºæä¸æé项ï¼åæ ¼ä¾åºå + å½åå¼å
åºï¼ |
| | | calibrationServiceOptions() { |
| | | const list = this.qualifiedSupplierNames.slice(); |
| | | const value = this.calibrationRecord.unitOfMeasure; |
| | | if (value && list.indexOf(value) === -1) list.push(value); |
| | | return list; |
| | | }, |
| | | ...mapGetters(["nickName"]), |
| | | action() { |
| | | return this.javaApi + '/personBasicInfo/saveCNASFile' |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.obtainQualifiedSupplierList() |
| | | //è·åæä½è®°å½ä¿¡æ¯ |
| | | this.getTableList(this.clickNodeVal.value) // è·åè®¾å¤æ ¡ååè¡¨æ°æ® |
| | | }, |
| | | methods: { |
| | | // æååæ ¼ä¾åºååè¡¨ï¼æ ¡åæå¡æºæä¸æéé¡¹ï¼ |
| | | obtainQualifiedSupplierList() { |
| | | selectQualifiedSupplierManagementPage({ current: 1, size: 999 }).then(res => { |
| | | if (res.code === 200) { |
| | | const rows = (res.data && res.data.records) || []; |
| | | this.qualifiedSupplierNames = [...new Set(rows.map(r => r.supplierName).filter(Boolean))]; |
| | | } |
| | | }); |
| | | }, |
| | | //ç¶æå¤å® |
| | | checkRadio() { |
| | | let resultList = this.calibrateParams.map(ele => ele.result) |
| | | if (resultList && resultList.filter(ele => ele == '1no').length > 0) { |
| | | this.calibrationRecord.status = '1no' |
| | | } else if (resultList && resultList.filter(ele => ele == '2other').length == resultList.length) { |
| | | this.calibrationRecord.status = '2other' |
| | | } else if (resultList && resultList.filter(ele => ele == '0yes').length == resultList.length) { |
| | | this.calibrationRecord.status = '0yes' |
| | | } |
| | | }, |
| | | getNextCalibrationDate(val) { |
| | | let oneYearLaterDate = new Date(val) |
| | | oneYearLaterDate.setFullYear(oneYearLaterDate.getFullYear() + 1); |
| | | oneYearLaterDate.setDate(oneYearLaterDate.getDate() - 1); |
| | | // let obj = oneYearLaterDate.toISOString().split('T')[0]; |
| | | this.calibrationRecord.nextCalibrationDate = oneYearLaterDate |
| | | formatDateCell(row, column, cellValue) { |
| | | return formatListDate(cellValue) |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.search.size = val |
| | |
| | | this.search.total = res.data.total |
| | | }) |
| | | }, |
| | | // æ·»å æ ¸æ¥è®°å½ |
| | | add(type) { |
| | | this.operationType = type |
| | | this.dialogVisible1 = true |
| | | this.getXmsg() |
| | | // æ·»å æ ¡åè®°å½ |
| | | add() { |
| | | this.$refs.calibrationRecordDia.open(this.clickNodeVal.value, 'add') |
| | | }, |
| | | // æ¥ç详æ
|
| | | handleViewClick(type, row) { |
| | | showDeviceMetricsCopy({ id: row.id, type: 'calibrate' }).then(res => { |
| | | this.calibrateParams = res.data |
| | | }) |
| | | this.calibrationRecord = { ...row } |
| | | this.operationType = type |
| | | this.dialogVisible1 = true |
| | | this.$refs.calibrationRecordDia.open(this.clickNodeVal.value, type, row) |
| | | }, |
| | | // è¡¨æ ¼å é¤æä½ |
| | | handleDeleteClick(row) { |
| | |
| | | }) |
| | | }, |
| | | handleAttachmentClick(row) { |
| | | this.$download.saveAs(row.systemFileName, row.systemFileName) |
| | | }, |
| | | deleteFile() { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å 餿件, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteCNASFile({ fileName: this.calibrationRecord.systemFileName }).then(res => { |
| | | this.calibrationRecord.fileName = '' |
| | | this.$refs.upload.clearFiles() |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿åï¼') |
| | | if (!row.systemFileName) { |
| | | this.$message.warning('æªä¸ä¼ æä»¶ï¼') |
| | | return |
| | | } |
| | | }) |
| | | }).catch((err) => { |
| | | console.log('err----', err) |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | // å¾çå /img/ï¼å
¶ä»ææ¡£å /word/ |
| | | const isImage = /\.(jpg|jpeg|png|gif|bmp|webp)$/i.test(row.systemFileName) |
| | | const url = this.javaApi + (isImage ? '/img/' : '/word/') + row.systemFileName |
| | | this.$download.saveAs(url, row.fileName || row.systemFileName) |
| | | }, |
| | | // æ ¡å项ç®ç»´æ¤ |
| | | calibrationMaintenance() { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | addRecord() { |
| | | this.$refs['calibrationRecord'].validate((valid) => { |
| | | if (valid) { |
| | | try { |
| | | if (this.calibrateParams.some(m => m.isCalibration === undefined)) { |
| | | this.$message.error('è¯·éæ©æ¯å¦æ ¡å') |
| | | return |
| | | } |
| | | if (!this.calibrateParams.every(m => m.result !== undefined)) { |
| | | this.$message.error('è¯·éæ©å¤å®ç»æ') |
| | | return |
| | | } |
| | | this.addRecordLoading = true |
| | | this.calibrationRecord.deviceId = this.clickNodeVal.value; |
| | | this.calibrationRecord.createUser = this.nickName |
| | | this.calibrationRecord.type = 'calibrate' |
| | | this.calibrationRecord.deviceMetricsCopyList = this.calibrateParams |
| | | addOrUpdateDeviceMetricRecord(this.calibrationRecord).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ·»å æå') |
| | | this.dialogVisible1 = false |
| | | this.getTableList(this.clickNodeVal.value) |
| | | } |
| | | this.addRecordLoading = false |
| | | }) |
| | | } catch (e) { |
| | | console.log('addRecord---', e) |
| | | this.addRecordLoading = false |
| | | } |
| | | } else { |
| | | this.$message.warning('æå¿
填项æªå¡«'); |
| | | } |
| | | }) |
| | | }, |
| | | resetCalibrationRecord() { |
| | | this.$refs.calibrationRecord.resetFields() |
| | | }, |
| | | // ä¸ä¼ éä»¶ |
| | | handleSuccessUp(response, file) { |
| | | if (response.code == 200) { |
| | | // å¨ä¿åèµå¼æ°æä»¶ |
| | | this.calibrationRecord.fileName = file.name |
| | | this.calibrationRecord.systemFileName = response.data |
| | | this.upLoading = false; |
| | | } else { |
| | | this.upLoading = false; |
| | | this.$message.error(response.message) |
| | | } |
| | | }, |
| | | beforeUpload(file) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M'); |
| | | this.$refs.upload.clearFiles() |
| | | return false; |
| | | } else { |
| | | this.upLoading = true; |
| | | return true; |
| | | } |
| | | }, |
| | | onError(err, file, fileList) { |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | | // end |
| | | }, |
| | | watch: { |
| | |
| | | clickNodeVal(newVal) { |
| | | if (newVal.value) { |
| | | this.getTableList(newVal.value); |
| | | } |
| | | }, |
| | | dialogVisible1(newVal) { |
| | | if (newVal === false) { |
| | | this.calibrateParams = [] |
| | | this.calibrationRecord = { |
| | | unitOfMeasure: '', // 计éåä½ |
| | | calibrationDate: null, // æ ¡åæ¥æ |
| | | nextCalibrationDate: null, // 䏿¬¡æ ¡åæ¥æ |
| | | calculatingApparatus: '', // 计ç®å¨å
· |
| | | standardRange: '', // è®¡ç®æ åéç¨ |
| | | calibrationStandardUncertainty: '', // è®¡éæ åä¸ç¡®å®åº¦ |
| | | byDocument: '', // 便®æä»¶ |
| | | certificateSerialNumber: '', // è¯ä¹¦ç¼å· |
| | | status: '', // ç¶æ |
| | | remark: '', // 夿³¨ |
| | | } |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- è®¾å¤æ ¡åè®°å½å¼¹çªï¼æ·»å /æ¥çï¼ï¼è®¾å¤æ ¡å页ä¸è®¾å¤æ ¡å计å页å
±ç¨ --> |
| | | <template> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="visible" title="æ·»å æ ¡åè®°å½" top="5vh" |
| | | width="80%" @close="resetCalibrationRecord"> |
| | | <div style="height: 70vh;overflow-y: auto;overflow-x: hidden;"> |
| | | <h4> |
| | | <div style="display: flex;align-items: center;"> |
| | | <span class="line"></span> |
| | | <span>æ·»å è®¾å¤æ ¡åè®°å½</span> |
| | | </div> |
| | | </h4> |
| | | <el-form ref="calibrationRecord" :model="calibrationRecord" :rules="formRules" label-position="right" |
| | | label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="æ ¡åæå¡æºæ:" prop="unitOfMeasure"> |
| | | <el-select v-model="calibrationRecord.unitOfMeasure" :disabled="operationType === 'view'" clearable filterable |
| | | size="small" style="width: 100%"> |
| | | <el-option v-for="name in calibrationServiceOptions" :key="name" :label="name" :value="name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="æ ¡åæ¥æ:" prop="calibrationDate"> |
| | | <el-date-picker v-model="calibrationRecord.calibrationDate" :disabled="operationType === 'view'" |
| | | format="YYYY-MM-DD" placeholder="éæ©æ¥æ" size="small" style="width: 90%" type="date" |
| | | value-format="YYYY-MM-DD" @change="getNextCalibrationDate"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="䏿¬¡æ ¡åæ¥æ:" label-width="140px"> |
| | | <el-date-picker v-model="calibrationRecord.nextCalibrationDate" disabled format="YYYY-MM-DD" |
| | | placeholder="éæ©æ¥æ" size="small" style="width: 90%" type="date" value-format="YYYY-MM-DD"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="计éå¨å
·:" prop="calculatingApparatus"> |
| | | <el-input v-model="calibrationRecord.calculatingApparatus" :disabled="operationType === 'view'" |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="è®¡éæ åéç¨:" prop="standardRange"> |
| | | <el-input v-model="calibrationRecord.standardRange" :disabled="operationType === 'view'" size="small" |
| | | style="width: 90%"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="è®¡éæ åä¸ç¡®å®åº¦:" label-width="140px" prop="calibrationStandardUncertainty"> |
| | | <el-input v-model="calibrationRecord.calibrationStandardUncertainty" |
| | | :disabled="operationType === 'view'" size="small" style="width: 90%"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="æä¾æ®æä»¶:" prop="byDocument"> |
| | | <el-input v-model="calibrationRecord.byDocument" :disabled="operationType === 'view'" |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="è¯ä¹¦ç¼å·:" prop="certificateSerialNumber"> |
| | | <el-input v-model="calibrationRecord.certificateSerialNumber" :disabled="operationType === 'view'" |
| | | size="small" style="width: 90%"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="ç¶æ:" label-width="140px" prop="status" required> |
| | | <el-radio-group v-model="calibrationRecord.status" :disabled="operationType === 'view'"> |
| | | <el-radio value="0yes">åæ ¼</el-radio> |
| | | <el-radio value="1no">ä¸åæ ¼</el-radio> |
| | | <el-radio value="2other">å
¶ä»</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="ç¡®è®¤æ¥æ:"> |
| | | <el-date-picker v-model="calibrationRecord.confirmDate" :disabled="operationType === 'view'" |
| | | format="YYYY-MM-DD HH:mm:ss" placeholder="éæ©æ¥æ" size="small" style="width: 100%" type="datetime" |
| | | value-format="YYYY-MM-DD HH:mm:ss"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="17"> |
| | | <el-form-item label="éä»¶ï¼" prop="fileName"> |
| | | <el-input v-model="calibrationRecord.fileName" |
| | | :style="`width: ${operationType === 'add' ? '85%' : '100%'}`" disabled size="small"> |
| | | <template #append><el-button v-if="operationType === 'add'" :icon="$icon('el-icon-delete-solid')" |
| | | @click="deleteFile"></el-button></template> |
| | | </el-input> |
| | | <el-upload v-if="operationType === 'add'" ref="upload" :action="action" :before-upload="beforeUpload" |
| | | :headers="uploadHeader" :limit="1" :on-error="onError" :on-success="handleSuccessUp" |
| | | :show-file-list="false" style="float: right;"> |
| | | <el-button :loading="upLoading" size="small" style="position: relative; top: -4px;" |
| | | type="primary">éä»¶ä¸ä¼ |
| | | </el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿³¨:"> |
| | | <el-input v-model="calibrationRecord.remark" :disabled="operationType === 'view'" :rows="3" size="small" |
| | | style="width: 96%" type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <h4> |
| | | <span style="display: flex;align-items: center;"> |
| | | <span class="line"></span><span>æ ¡åæ¡ç®ç¡®è®¤ç»æ</span> |
| | | </span> |
| | | </h4> |
| | | <el-table ref="calibrateTable" :data="calibrateParams" border> |
| | | <el-table-column label="ç¼å·" type="index" width="60"></el-table-column> |
| | | <el-table-column label="计éåæ°" prop="measurementParameter"></el-table-column> |
| | | <el-table-column label="éç¨èå´" prop="rangeOfMeasurement"></el-table-column> |
| | | <el-table-column label="æå¤§å
许误差" prop="maxPermissibleError"></el-table-column> |
| | | <el-table-column label="å¤å®æ å" prop="judgmentCriteria"></el-table-column> |
| | | <el-table-column label="æ¯å¦æ ¡å" prop="isCalibration"> |
| | | <template #header="scope"> |
| | | <span class="required-span">* </span>æ¯å¦æ ¡å |
| | | </template> |
| | | <template #default="scope"> |
| | | <el-radio-group v-model="scope.row.isCalibration" :disabled="operationType === 'view'"> |
| | | <el-radio value="0yes">æ¯</el-radio> |
| | | <el-radio value="1no">å¦</el-radio> |
| | | </el-radio-group> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å¤å®ç»æ" min-width="140" prop="result"> |
| | | <template #header="scope"> |
| | | <span class="required-span">* </span>å¤å®ç»æ |
| | | </template> |
| | | <template #default="scope"> |
| | | <el-radio-group v-model="scope.row.result" :disabled="operationType === 'view'" @change="checkRadio()"> |
| | | <el-radio value="0yes">åæ ¼</el-radio> |
| | | <el-radio value="1no">ä¸åæ ¼</el-radio> |
| | | <el-radio value="2other">å
¶ä»</el-radio> |
| | | </el-radio-group> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="åé¡¹ç»æè¯´æ" prop="singleResultStatement"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.singleResultStatement" :disabled="operationType === 'view'" |
| | | size="small"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button v-if="operationType === 'add'" @click="visible = false">å æ¶</el-button> |
| | | <el-button v-if="operationType === 'view'" @click="visible = false">å
³ é</el-button> |
| | | <el-button v-if="operationType === 'add'" :loading="addRecordLoading" type="primary" @click="addRecord">ç¡® |
| | | å®</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | showDeviceMetricsCopy, |
| | | deleteCNASFile, |
| | | selectDeviceMetric, |
| | | addOrUpdateDeviceMetricRecord, |
| | | getDeviceById |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import dayjs from 'dayjs' |
| | | import { selectQualifiedSupplierManagementPage } from '@/api/cnas/externalService/supplierManage/supplierManage' |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | export default { |
| | | name: "calibration-record-dia", |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | deviceId: null, |
| | | operationType: '', |
| | | calibrationCycle: 12, |
| | | calibrateParams: [], |
| | | calibrateParamsLoading: false, |
| | | addRecordLoading: false, |
| | | upLoading: false, |
| | | qualifiedSupplierNames: [], |
| | | calibrationRecord: { |
| | | unitOfMeasure: '', // 计éåä½ |
| | | calibrationDate: null, // æ ¡åæ¥æ |
| | | nextCalibrationDate: null, // 䏿¬¡æ ¡åæ¥æ |
| | | calculatingApparatus: '', // 计éå¨å
· |
| | | confirmDate: null, // ç¡®è®¤æ¥æ |
| | | standardRange: '', // è®¡éæ åéç¨ |
| | | calibrationStandardUncertainty: '', // è®¡éæ åä¸ç¡®å®åº¦ |
| | | byDocument: '', // 便®æä»¶ |
| | | certificateSerialNumber: '', // è¯ä¹¦ç¼å· |
| | | status: '', // ç¶æ |
| | | remark: '', // 夿³¨ |
| | | systemFileName: '', // |
| | | fileName: '', // |
| | | }, |
| | | formRules: { |
| | | unitOfMeasure: [{ required: true, message: 'è¯·éæ©æ ¡åæå¡æºæ', trigger: 'change' }], |
| | | calibrationDate: [{ required: true, message: 'è¯·éæ©æ ¡åæ¥æ', trigger: 'change' }], |
| | | calculatingApparatus: [{ required: true, message: '请è¾å
¥è®¡éå¨å
·', trigger: 'blur' }], |
| | | standardRange: [{ required: true, message: '请è¾å
¥è®¡éæ åéç¨', trigger: 'blur' }], |
| | | calibrationStandardUncertainty: [{ required: true, message: '请è¾å
¥è®¡éæ åä¸ç¡®å®åº¦', trigger: 'blur' }], |
| | | byDocument: [{ required: true, message: '请è¾å
¥æä¾æ®æä»¶', trigger: 'blur' }], |
| | | status: [{ required: true, message: 'è¯·éæ©ç¶æ', trigger: 'change' }], |
| | | }, |
| | | } |
| | | }, |
| | | computed: { |
| | | // æ ¡åæå¡æºæä¸æé项ï¼åæ ¼ä¾åºå + å½åå¼å
åºï¼ |
| | | calibrationServiceOptions() { |
| | | const list = this.qualifiedSupplierNames.slice(); |
| | | const value = this.calibrationRecord.unitOfMeasure; |
| | | if (value && list.indexOf(value) === -1) list.push(value); |
| | | return list; |
| | | }, |
| | | ...mapGetters(["nickName"]), |
| | | action() { |
| | | return this.javaApi + '/personBasicInfo/saveCNASFile' |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.obtainQualifiedSupplierList() |
| | | }, |
| | | methods: { |
| | | // æå¼å¼¹çªï¼deviceId 设å¤idï¼type addæ°å¢/viewæ¥çï¼row æ¥çæ¶çè®°å½è¡ |
| | | open(deviceId, type, row) { |
| | | this.deviceId = deviceId |
| | | this.operationType = type |
| | | if (type === 'view' && row) { |
| | | showDeviceMetricsCopy({ id: row.id, type: 'calibrate' }).then(res => { |
| | | this.calibrateParams = res.data |
| | | }) |
| | | this.calibrationRecord = { ...row } |
| | | } else { |
| | | this.getDeviceCycle() |
| | | this.getXmsg() |
| | | } |
| | | this.visible = true |
| | | }, |
| | | // æååæ ¼ä¾åºååè¡¨ï¼æ ¡åæå¡æºæä¸æéé¡¹ï¼ |
| | | obtainQualifiedSupplierList() { |
| | | selectQualifiedSupplierManagementPage({ current: 1, size: 999 }).then(res => { |
| | | if (res.code === 200) { |
| | | const rows = (res.data && res.data.records) || []; |
| | | this.qualifiedSupplierNames = [...new Set(rows.map(r => r.supplierName).filter(Boolean))]; |
| | | } |
| | | }); |
| | | }, |
| | | //ç¶æå¤å® |
| | | checkRadio() { |
| | | let resultList = this.calibrateParams.map(ele => ele.result) |
| | | if (resultList && resultList.filter(ele => ele == '1no').length > 0) { |
| | | this.calibrationRecord.status = '1no' |
| | | } else if (resultList && resultList.filter(ele => ele == '2other').length == resultList.length) { |
| | | this.calibrationRecord.status = '2other' |
| | | } else if (resultList && resultList.filter(ele => ele == '0yes').length == resultList.length) { |
| | | this.calibrationRecord.status = '0yes' |
| | | } |
| | | }, |
| | | // æ¥è¯¢è®¾å¤æ ¡åå¨æï¼æï¼ï¼ä¸å端æ»å¨è®¾å¤æ¡£æ¡æ¥æçè§åä¿æä¸è´ |
| | | getDeviceCycle() { |
| | | if (!this.deviceId) { |
| | | return |
| | | } |
| | | getDeviceById({ deviceId: this.deviceId }).then(res => { |
| | | const cycle = parseInt(res.data && res.data.calibrationDate) |
| | | this.calibrationCycle = cycle > 0 ? cycle : 12 |
| | | }).catch(() => { |
| | | this.calibrationCycle = 12 |
| | | }) |
| | | }, |
| | | // 䏿¬¡æ ¡åæ¥æ = æ ¡åæ¥æ + æ ¡åå¨æï¼æï¼ |
| | | getNextCalibrationDate(val) { |
| | | if (!val) { |
| | | this.calibrationRecord.nextCalibrationDate = null |
| | | return |
| | | } |
| | | const cycle = parseInt(this.calibrationCycle) |
| | | const months = cycle > 0 ? cycle : 12 |
| | | this.calibrationRecord.nextCalibrationDate = dayjs(val).add(months, 'month').format('YYYY-MM-DD') |
| | | }, |
| | | // è·åè®¾å¤æ ¡ååæ°ï¼æ ¡åæ¡ç®ï¼ |
| | | async getXmsg() { |
| | | this.calibrateParamsLoading = true |
| | | try { |
| | | await selectDeviceMetric({ deviceId: this.deviceId, type: 'calibrate' }).then(res => { |
| | | if (res.code == 200) { |
| | | this.calibrateParams = res.data |
| | | } |
| | | this.calibrateParamsLoading = false |
| | | }) |
| | | } catch (e) { |
| | | console.log('getXmsg---', e) |
| | | this.calibrateParamsLoading = false |
| | | } |
| | | }, |
| | | addRecord() { |
| | | this.$refs['calibrationRecord'].validate((valid) => { |
| | | if (valid) { |
| | | try { |
| | | if (this.calibrateParams.some(m => !m.isCalibration)) { |
| | | this.$message.error('è¯·éæ©æ¯å¦æ ¡å') |
| | | return |
| | | } |
| | | if (!this.calibrateParams.every(m => m.result)) { |
| | | this.$message.error('è¯·éæ©å¤å®ç»æ') |
| | | return |
| | | } |
| | | this.addRecordLoading = true |
| | | // åªåä¼ æç»éè¦çåæ®µï¼æºè¡å¸¦ä¸»é® id/deviceId ä¼è¦çå岿¡ç®ï¼creationTime æ ¼å¼ä¹ä¸æç»è¡¨ä¸å
¼å®¹ |
| | | const deviceMetricsCopyList = this.calibrateParams.map(item => ({ |
| | | measurementParameter: item.measurementParameter, |
| | | rangeOfMeasurement: item.rangeOfMeasurement, |
| | | maxPermissibleError: item.maxPermissibleError, |
| | | judgmentCriteria: item.judgmentCriteria, |
| | | createdBy: item.createdBy, |
| | | isCalibration: item.isCalibration, |
| | | result: item.result, |
| | | singleResultStatement: item.singleResultStatement, |
| | | type: item.type |
| | | })) |
| | | // åç«¯æ¥æåæ®µè¦æ± yyyy-MM-dd HH:mm:ssï¼æ¥ææ§ä»¶åªç»å° yyyy-MM-dd |
| | | const payload = { |
| | | ...this.calibrationRecord, |
| | | deviceId: this.deviceId, |
| | | createUser: this.nickName, |
| | | type: 'calibrate', |
| | | deviceMetricsCopyList |
| | | } |
| | | if (payload.calibrationDate && payload.calibrationDate.length === 10) { |
| | | payload.calibrationDate += ' 00:00:00' |
| | | } |
| | | if (payload.nextCalibrationDate && payload.nextCalibrationDate.length === 10) { |
| | | payload.nextCalibrationDate += ' 00:00:00' |
| | | } |
| | | addOrUpdateDeviceMetricRecord(payload).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ·»å æå') |
| | | this.visible = false |
| | | this.$emit('success') |
| | | } |
| | | this.addRecordLoading = false |
| | | }).catch(() => { |
| | | this.addRecordLoading = false |
| | | }) |
| | | } catch (e) { |
| | | console.log('addRecord---', e) |
| | | this.addRecordLoading = false |
| | | } |
| | | } else { |
| | | this.$message.warning('æå¿
填项æªå¡«'); |
| | | } |
| | | }) |
| | | }, |
| | | resetCalibrationRecord() { |
| | | this.$refs.calibrationRecord.resetFields() |
| | | }, |
| | | // ä¸ä¼ éä»¶ |
| | | handleSuccessUp(response, file) { |
| | | if (response.code == 200) { |
| | | // å¨ä¿åèµå¼æ°æä»¶ |
| | | this.calibrationRecord.fileName = file.name |
| | | this.calibrationRecord.systemFileName = response.data |
| | | this.upLoading = false; |
| | | } else { |
| | | this.upLoading = false; |
| | | this.$message.error(response.message) |
| | | } |
| | | }, |
| | | beforeUpload(file) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M'); |
| | | this.$refs.upload.clearFiles() |
| | | return false; |
| | | } else { |
| | | this.upLoading = true; |
| | | return true; |
| | | } |
| | | }, |
| | | onError(err, file, fileList) { |
| | | this.upLoading = false |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | | deleteFile() { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å 餿件, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteCNASFile({ fileName: this.calibrationRecord.systemFileName }).then(res => { |
| | | if (res.code == 200) { |
| | | this.calibrationRecord.fileName = '' |
| | | this.calibrationRecord.systemFileName = '' |
| | | this.$refs.upload.clearFiles() |
| | | this.$message.success('å 餿åï¼') |
| | | } |
| | | }) |
| | | }).catch((err) => { |
| | | console.log('err----', err) |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | }, |
| | | watch: { |
| | | visible(newVal) { |
| | | if (newVal === false) { |
| | | this.calibrateParams = [] |
| | | this.calibrationRecord = { |
| | | unitOfMeasure: '', // 计éåä½ |
| | | calibrationDate: null, // æ ¡åæ¥æ |
| | | nextCalibrationDate: null, // 䏿¬¡æ ¡åæ¥æ |
| | | calculatingApparatus: '', // 计éå¨å
· |
| | | standardRange: '', // è®¡éæ åéç¨ |
| | | calibrationStandardUncertainty: '', // è®¡éæ åä¸ç¡®å®åº¦ |
| | | byDocument: '', // 便®æä»¶ |
| | | certificateSerialNumber: '', // è¯ä¹¦ç¼å· |
| | | status: '', // ç¶æ |
| | | remark: '', // 夿³¨ |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | h4 { |
| | | font-weight: 400; |
| | | font-size: 16px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin: 10px 0; |
| | | } |
| | | |
| | | h4 .line { |
| | | display: inline-block; |
| | | width: 3px; |
| | | height: 16px; |
| | | background: var(--el-color-primary); |
| | | margin-right: 4px; |
| | | } |
| | | </style> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="æ ¸æ¥è¯ä¹¦ç¼å·" min-width="150" prop="certificateSerialNumber"></el-table-column> |
| | | <el-table-column label="说æ" min-width="150" prop="remark" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="æ ¸æ¥æ¥æ" min-width="150" prop="calibrationDate"></el-table-column> |
| | | <el-table-column label="䏿¬¡æ ¸æ¥æ¥æ" min-width="150" prop="nextCalibrationDate"></el-table-column> |
| | | <el-table-column label="æ ¸æ¥æ¥æ" min-width="150" prop="calibrationDate" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column label="䏿¬¡æ ¸æ¥æ¥æ" min-width="150" prop="nextCalibrationDate" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column label="ç»è®°äºº" min-width="150" prop="createUser"></el-table-column> |
| | | <el-table-column label="ç»è®°æ¥æ" min-width="150" prop="createTime"></el-table-column> |
| | | <el-table-column label="ç»è®°æ¥æ" min-width="150" prop="createTime" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column fixed="right" label="æä½" min-width="150"> |
| | | <template #default="{ row }"> |
| | | <el-button size="small" link type="primary" @click="handleAttachmentClick(row)">éä»¶</el-button> |
| | |
| | | <el-table-column label="æå¤§å
许误差" prop="maxPermissibleError"></el-table-column> |
| | | <el-table-column label="å¤å®æ å" prop="judgmentCriteria"></el-table-column> |
| | | <el-table-column label="å建人" prop="createdBy"></el-table-column> |
| | | <el-table-column label="å建æ¶é´" prop="creationTime"></el-table-column> |
| | | <el-table-column label="å建æ¶é´" prop="creationTime" :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column fixed="right" label="æä½"> |
| | | <template #default="scope"> |
| | | <el-button size="small" link type="primary" @click="handleDelete(scope.row)">å é¤</el-button> |
| | |
| | | <script> |
| | | import file from '@/utils/file'; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import { formatListDate } from './dateFormat'; |
| | | export default { |
| | | components: {}, |
| | | props: { |
| | |
| | | this.getTableList(this.clickNodeVal.value) // è·åè®¾å¤æ ¸æ¥åè¡¨æ°æ® |
| | | }, |
| | | methods: { |
| | | formatDateCell(row, column, cellValue) { |
| | | return formatListDate(cellValue) |
| | | }, |
| | | //ç¶æå¤å® |
| | | checkRadio() { |
| | | let resultList = this.calibrateParams.map(ele => ele.result) |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="dialogVisible" |
| | | title="仪å¨è®¾å¤æé´æ ¸æ¥æ¯å¯¹è®°å½è¡¨" width="80%" @close="resetForm"> |
| | | title="仪å¨è®¾å¤æé´æ ¸æ¥è®°å½è¡¨" width="80%" @close="resetForm"> |
| | | <el-steps :active="currentStep" align-center finish-status="success"> |
| | | <el-step title="å¡«åè®¾å¤æ ¸æ¥å¯¹æ¯è®°å½"></el-step> |
| | | <el-step title="å®¡æ ¸"></el-step> |
| | |
| | | <el-col :span="8"> |
| | | <div class="form-item"> |
| | | <span style="width: 110px">仪å¨åç§°ï¼</span> |
| | | <el-select v-model="form.deviceName" :disabled="currentStep !== 0" class="table_input" clearable filterable |
| | | placeholder="设å¤åç§°" size="small" style="width:200px" @change="(val) => changeMachineName(val)"> |
| | | <el-option v-for="item in equipOptions" :key="item.value" :label="item.label" :value="item.label"> |
| | | <el-select v-model="selectedDeviceId" :disabled="currentStep !== 0" class="table_input" clearable filterable |
| | | placeholder="设å¤åç§°" size="small" style="width:200px" @change="changeMachineName"> |
| | | <el-option v-for="item in equipOptions" :key="item.id" :label="item.label" :value="item.id"> |
| | | {{ item.label + '-' + item.value }} |
| | | </el-option> |
| | | </el-select> |
| | |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-button size="small" style="margin: 10px 0" type="primary" @click="addRow">æ·»å </el-button> |
| | | <el-button v-if="currentStep === 0" size="small" style="margin: 10px 0" type="primary" @click="addRow">æ·»å </el-button> |
| | | <el-table :data="recordDetailList" height="300" style="width: 100%" border> |
| | | <el-table-column label="æµè¯ç¹" min-width="130" prop="testPoint"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.testPoint" clearable size="small"></el-input> |
| | | <el-input v-model="scope.row.testPoint" :disabled="currentStep !== 0" clearable size="small"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column min-width="180"> |
| | |
| | | { label: 'ç¸å¯¹åå·®', value: 2 }, |
| | | ], |
| | | equipOptions: [], |
| | | selectedDeviceId: '', |
| | | submitFormLoading: false, |
| | | userList: [], |
| | | reviewUserId: '', |
| | |
| | | methods: { |
| | | openDialog(row) { |
| | | this.dialogVisible = true |
| | | this.selectedDeviceId = '' |
| | | this.form.planDetailsId = row.planDetailsId |
| | | this.checkChargerUserId = row.checkChargerUserId |
| | | this.getEquipOptions() |
| | |
| | | this.currentStep = 2 |
| | | } |
| | | this.reviewUserId = this.form.reviewUserId |
| | | this.matchDeviceOption() |
| | | this.$nextTick(() => { |
| | | this.draftRestore('checkRecordForm', 'form', this.form.planDetailsId, 'dialogVisible') |
| | | this.draftRestore('checkRecordRows', 'recordDetailList', this.form.planDetailsId, 'dialogVisible') |
| | | // è稿éå¯è½æ¹è¿è®¾å¤ï¼æ¢å¤åéæ°å¹é
䏿éä¸é¡¹ |
| | | this.matchDeviceOption() |
| | | }) |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | | }) |
| | | }, |
| | | // èµå¼ä»ªå¨ç¼å· |
| | | // æè®¾å¤ id åå¡«åç§°åç¼å·ï¼é¿å
åå设å¤éé |
| | | changeMachineName(value) { |
| | | const index = this.equipOptions.findIndex(item => item.deviceName === value) |
| | | this.form.deviceNumber = this.equipOptions[index].managementNumber |
| | | const item = this.equipOptions.find(device => device.id === value) |
| | | if (item) { |
| | | this.form.deviceName = item.deviceName |
| | | this.form.deviceNumber = item.managementNumber |
| | | } else { |
| | | this.form.deviceName = '' |
| | | this.form.deviceNumber = '' |
| | | } |
| | | }, |
| | | // åå²è®°å½æ²¡æ deviceIdï¼æåç§°+ç¼å·åæ¥ä¸æé项 |
| | | matchDeviceOption() { |
| | | if (!this.equipOptions.length || !this.form.deviceName) { |
| | | return |
| | | } |
| | | const match = this.form.deviceNumber |
| | | ? this.equipOptions.find(item => item.deviceName === this.form.deviceName && item.managementNumber === this.form.deviceNumber) |
| | | : this.equipOptions.find(item => item.deviceName === this.form.deviceName) |
| | | this.selectedDeviceId = match ? match.id : '' |
| | | }, |
| | | addRow() { |
| | | this.recordDetailList.push({ testPoint: '' }) |
| | |
| | | m.id = m.id |
| | | return m |
| | | }) |
| | | this.matchDeviceOption() |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import dayjs from 'dayjs' |
| | | |
| | | // åè¡¨æ¥æç»ä¸æ¾ç¤ºï¼çº¯æ¥æåªæ¾ç¤ºå¹´ææ¥ï¼æ¶é´å»æ ISO ç Tï¼åªä¿çå°åé |
| | | export function formatListDate(value) { |
| | | if (value === null || value === undefined || value === '') { |
| | | return value |
| | | } |
| | | const str = String(value) |
| | | if (/^\d{4}-\d{2}-\d{2}$/.test(str)) { |
| | | return str |
| | | } |
| | | if (/T00:00:00(\.\d+)?$/.test(str) || / 00:00:00$/.test(str)) { |
| | | return str.slice(0, 10) |
| | | } |
| | | const date = dayjs(str) |
| | | return date.isValid() ? date.format('YYYY-MM-DD HH:mm') : str |
| | | } |
| | | |
| | | // çº¯æ¥æç»ä¸æ¾ç¤º yyyy-MM-ddï¼å¿½ç¥å¯è½å¸¦åºçæ¶é´é¨å |
| | | export function formatDateOnly(value) { |
| | | if (value === null || value === undefined || value === '') { |
| | | return value |
| | | } |
| | | const date = dayjs(String(value).replace(/\//g, '-')) |
| | | return date.isValid() ? date.format('YYYY-MM-DD') : formatListDate(value) |
| | | } |
| | |
| | | v-if="list.length > 0 || loading"> |
| | | <ul class="card"> |
| | | <li v-for="(m, i) in list" :key="i"> |
| | | <el-image class="img" :src="javaApi + '/img/' + m.imageUpload"> |
| | | <el-image v-if="m.imageUpload" class="img" :src="javaApi + '/img/' + m.imageUpload"> |
| | | <template #error><div class="image-error" style="width: 88px; |
| | | height: 88px; |
| | | border-radius: 16px; |
| | |
| | | <lims-icon name="el-icon-picture-outline" style="font-size:20px;color:var(--lims-text-2);"></lims-icon> |
| | | </div></template> |
| | | </el-image> |
| | | <div v-else class="image-error" style="width: 88px; |
| | | height: 88px; |
| | | border-radius: 16px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | border: 1px solid var(--lims-divider);margin-right: 10px;"> |
| | | <lims-icon name="el-icon-picture-outline" style="font-size:20px;color:var(--lims-text-2);"></lims-icon> |
| | | </div> |
| | | <div class="list-left"> |
| | | <div class="list-left-info"> |
| | | <span class="label" style="white-space: nowrap;">设å¤åç§°ï¼</span> |
| | |
| | | selectDeviceParameter, |
| | | downloadDeviceImportTemplate, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | |
| | | methods: { |
| | | downloadTemplate() { |
| | | downloadDeviceImportTemplate().then(res => { |
| | | this.$download.saveAs(new Blob([res]), '设å¤å¯¼å
¥æ¨¡æ¿.xlsx') |
| | | }) |
| | | saveBlobOrShowError(res, '设å¤å¯¼å
¥æ¨¡æ¿.xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') |
| | | }).catch(() => { }) |
| | | }, |
| | | submitImport() { |
| | | if (!this.$refs.deviceUpload.uploadFiles.length) { |
| | |
| | | } |
| | | } |
| | | this.loading = false |
| | | }).catch(() => { |
| | | // æ¸
ææ¬é¡µå ä½ï¼å¤±è´¥åå¯ç¨æ¥è¯¢/éç½®éæ°å è½½ |
| | | delete this.keyMap[key] |
| | | this.loading = false |
| | | this.finishLoding = true |
| | | }) |
| | | }, |
| | | refresh() { |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | <el-pagination :current-page="pagination1.current" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="pagination1.total" layout="->,total, sizes, prev, pager, next, jumper" background |
| | | @size-change="handleSizeChange1" @current-change="handleCurrentChange1"> |
| | | </el-pagination> |
| | |
| | | </div> |
| | | <div> |
| | | <limsTable ref="yearTable" :column="columnData" :height="'calc(100vh - 30em)'" :highlightCurrentRow="true" |
| | | :table-data="tableData" :table-loading="tableLoading" style="margin-top: 0.5em;" :page="pagination1"> |
| | | :table-data="tableData" :table-loading="tableLoading" style="margin-top: 0.5em;" :page="filePage"> |
| | | </limsTable> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | exportDeviceAcceptance, |
| | | delDeviceAcceptance, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | | export default { |
| | | name: "equipment-acceptance", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | pagination1: { |
| | | size: 10, |
| | | current: 1, |
| | | total: 0, |
| | | }, |
| | | filePage: { |
| | | size: 10, |
| | | current: 1, |
| | | total: 0, |
| | |
| | | record(row) { |
| | | this.filesDialogVisible = true |
| | | this.acceptanceId = row.acceptanceId |
| | | this.filePage.current = 1 |
| | | this.searchTableList() |
| | | }, |
| | | // æ¥è¯¢éä»¶å表 |
| | |
| | | this.tableLoading = true |
| | | getDeviceAcceptanceFileList({ acceptanceId: this.acceptanceId }).then(res => { |
| | | this.tableLoading = false |
| | | this.tableData = res.data |
| | | this.tableData = res.data || [] |
| | | this.filePage.total = this.tableData.length |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | console.log('err---', err); |
| | |
| | | }, |
| | | // ä¸è½½ |
| | | upload(row) { |
| | | this.$download.saveAs(row.fileUrl, row.fileName) |
| | | if (!row.fileUrl) { |
| | | this.$message.warning('æªä¸ä¼ æä»¶ï¼') |
| | | return |
| | | } |
| | | // å¾çå /img/ï¼å
¶ä»ææ¡£å /word/ |
| | | const isImage = /\.(jpg|jpeg|png|gif|bmp|webp)$/i.test(row.fileUrl) |
| | | const url = this.javaApi + (isImage ? '/img/' : '/word/') + row.fileUrl |
| | | this.$download.saveAs(url, row.fileName || row.fileUrl) |
| | | }, |
| | | // å é¤ |
| | | delete(row) { |
| | |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | | handleSuccessUp(response,) { |
| | | this.upLoading = false; |
| | | if (response.code == 200) { |
| | | this.$message.success('ä¸ä¼ æå'); |
| | | this.searchTableList() |
| | | } else { |
| | | this.$message.error(response.message || response.msg || 'ä¸ä¼ 失败') |
| | | } |
| | | }, |
| | | closeFilesLook() { |
| | |
| | | this.outLoading = true |
| | | exportDeviceAcceptance({ acceptanceId: id }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设å¤éªæ¶.doc') |
| | | saveBlobOrShowError(res, '设å¤éªæ¶.doc', 'application/msword') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | // å é¤ |
| | |
| | | <!-- <el-table-column label="仪å¨åç§°" min-width="150" prop="unitName"></el-table-column>--> |
| | | <!-- <el-table-column label="åå·" min-width="100" prop="model"></el-table-column>--> |
| | | <el-table-column label="å°ç¹" min-width="150" prop="address"></el-table-column> |
| | | <el-table-column label="æ¥æ" min-width="180" prop="accidentDate"></el-table-column> |
| | | <el-table-column label="æ¥æ" min-width="180" prop="accidentDate" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column label="äºæ
æ
åµ" min-width="180" prop="descriptionOfAccident" |
| | | show-overflow-tooltip></el-table-column> |
| | | <!-- æä½æé® --> |
| | | <el-table-column align="center" fixed="right" label="æä½" min-width="120"> |
| | | <template #default="scope"> |
| | | <el-button :disabled="scope.row.ratifyStatus === 1" size="small" link type="primary" |
| | | <el-button :disabled="scope.row.isFinish === 1" size="small" link type="primary" |
| | | @click="handleForm(scope.row.accidentReportId)">æä½</el-button> |
| | | <el-button size="small" link type="primary" @click="handleDownOne(scope.row.accidentReportId)">导åº</el-button> |
| | | <el-button :disabled="scope.row.isFinish === 1" size="small" link type="danger" |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | <el-pagination :current-page="pagination1.current" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="pagination1.total" layout="->,total, sizes, prev, pager, next, jumper" background |
| | | @size-change="handleSizeChange1" @current-change="handleCurrentChange1"> |
| | | </el-pagination> |
| | |
| | | exportDeviceAccidentReport, |
| | | delDeviceAccidentReport, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { formatListDate } from './dateFormat' |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | | export default { |
| | | name: "equipment-accident", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | formatDateCell(row, column, cellValue) { |
| | | return formatListDate(cellValue) |
| | | }, |
| | | // æ¥è¯¢ |
| | | getYearTableDetailData(deviceId) { |
| | | this.yearTableDetailDataLoading = true |
| | |
| | | this.outLoading = true |
| | | exportDeviceAccidentReport({ accidentReportId: id }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '仪å¨è®¾å¤äºæ
æ¥åå.doc') |
| | | saveBlobOrShowError(res, '仪å¨è®¾å¤äºæ
æ¥åå.doc', 'application/msword') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | // å é¤ |
| | |
| | | <template> |
| | | <!-- è®¾å¤æ ¡å计å--> |
| | | <div> |
| | | <div> |
| | | <div style="margin: 10px 0;display: flex;align-items: center;justify-content: space-between;"> |
| | | <div class="title"> |
| | | <span style="font-weight: bold">年度计å表</span> |
| | | <div style="margin: 10px 0 14px;"> |
| | | <div class="plan-top"> |
| | | <div class="plan-top-left"> |
| | | <span class="title" style="margin-bottom: 0;">{{ planInfo.planName || (planYear + 'å¹´åº¦è®¾å¤æ ¡å计å') }}</span> |
| | | <el-select v-model="planYear" size="small" style="width: 110px; margin-left: 16px;" @change="handleYearChange"> |
| | | <el-option v-for="y in yearOptions" :key="y" :label="y" :value="y"></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div> |
| | | <el-button size="small" type="primary" @click="getYearTableData">å·æ°</el-button> |
| | | <el-button size="small" type="primary" @click="addYearPlan('add')">æ°å¢</el-button> |
| | | <!-- <el-button size="small" type="primary" @click="record">导å
¥</el-button>--> |
| | | <el-button size="small" type="primary" @click="loadPlan">å·æ°</el-button> |
| | | <el-button size="small" type="primary" :disabled="planInfo.ratifyStatus === 1" |
| | | @click="tellApprove">æ¹åéç¥</el-button> |
| | | <el-button size="small" type="primary" |
| | | :disabled="planInfo.ratifyStatus === 1 || userId != planInfo.ratifyUserId" @click="handleApprove">æ¹å</el-button> |
| | | <el-button size="small" type="primary" @click="downLoadPost">导åº</el-button> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <el-table ref="yearTable" v-loading="yearTableDataLoading" |
| | | :data="yearTableData" height="calc(60vh - 16em)" |
| | | border |
| | | highlight-current-row @current-change="currentChange"> |
| | | <!-- è¡¨æ ¼å --> |
| | | <el-table-column align="center" header-align="center" label="åºå·" prop="prop" type="index" |
| | | width="70"></el-table-column> |
| | | <el-table-column label="年份" min-width="80" prop="planYear"></el-table-column> |
| | | <el-table-column label="计ååç§°" min-width="180" prop="planName" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="ç¼å¶äºº" min-width="100" prop="writeName"></el-table-column> |
| | | <el-table-column label="ç¼å¶æ¥æ" min-width="160" prop="writeTime"></el-table-column> |
| | | <el-table-column label="æ¹åç¶æ" min-width="100" prop="ratifyStatus"> |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.ratifyStatus === 1" type="success">æ¹å</el-tag> |
| | | <el-tag v-if="scope.row.ratifyStatus === 0" type="danger">䏿¹å</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æ¹åå
容" min-width="150" prop="ratifyRemark"></el-table-column> |
| | | <el-table-column label="æ¹å人" min-width="100" prop="ratifyName"></el-table-column> |
| | | <el-table-column label="æ¹åæ¶é´" min-width="150" prop="ratifyTime"></el-table-column> |
| | | <!-- æä½æé® --> |
| | | <el-table-column align="center" fixed="right" label="æä½" min-width="240"> |
| | | <template #default="scope"> |
| | | <el-button :disabled="scope.row.ratifyStatus === 1" size="small" link type="primary" |
| | | @click="addYearPlan('edit', scope.row)">ç¼è¾</el-button> |
| | | <el-button :disabled="scope.row.ratifyStatus === 1" size="small" link type="primary" |
| | | @click="tellApprove(scope.row.planId)">æ¹åéç¥</el-button> |
| | | <el-button :disabled="scope.row.ratifyStatus === 1 || userId != scope.row.ratifyUserId" size="small" |
| | | link type="primary" @click="handleApprove(scope.row.planId)">æ¹å</el-button> |
| | | <el-button size="small" link type="primary" @click="downLoadPost(scope.row.planId)">导åº</el-button> |
| | | <el-button :disabled="scope.row.ratifyStatus === 1" size="small" link type="danger" |
| | | @click="deleteFun(scope.row.planId)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="pagination.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | background :total="pagination.total" layout="->,total, sizes, prev, pager, next, jumper" |
| | | @size-change="handleSizeChange" @current-change="handleCurrentChange"> |
| | | </el-pagination> |
| | | <div class="plan-info-bar"> |
| | | <span>ç¼å¶äººï¼{{ planInfo.writeName || 'â' }}</span> |
| | | <span>ç¼å¶æ¥æï¼{{ planInfo.writeTimeStr || 'â' }}</span> |
| | | <span v-if="planInfo.ratifyStatus === 1">æ¹åç¶æï¼<el-tag type="success">æ¹å</el-tag></span> |
| | | <span v-else-if="planInfo.ratifyStatus === 0">æ¹åç¶æï¼<el-tag type="danger">䏿¹å</el-tag></span> |
| | | <span v-if="planInfo.ratifyRemark">æ¹åå
容ï¼{{ planInfo.ratifyRemark }}</span> |
| | | <span v-if="isRatified && planInfo.ratifyName">æ¹å人ï¼{{ planInfo.ratifyName }}</span> |
| | | <span v-if="isRatified && planInfo.ratifyTimeStr">æ¹åæ¶é´ï¼{{ planInfo.ratifyTimeStr }}</span> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <div class="title"> |
| | | <span style="font-weight: bold">年度计åæç»è¡¨</span> |
| | | </div> |
| | | <div class="search"> |
| | | <div> |
| | | <el-form :model="searchForm" ref="searchForm" size="small" :inline="true"> |
| | | <el-form-item label="设å¤åç§°ååå·" prop="deviceName"> |
| | | <el-input v-model="searchForm.deviceName" clearable |
| | | @keyup.enter="getYearTableDetailData(currentRow)" size="small"></el-input> |
| | | <el-input v-model="searchForm.deviceName" clearable @keyup.enter="handleQuery" |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="仪å¨ç¼å·" prop="deviceNumber"> |
| | | <el-input v-model="searchForm.deviceNumber" |
| | | @keyup.enter="getYearTableDetailData(currentRow)" clearable size="small"></el-input> |
| | | <el-input v-model="searchForm.deviceNumber" @keyup.enter="handleQuery" clearable |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" size="small" @click="getYearTableDetailData(currentRow)">æ¥è¯¢</el-button> |
| | | <el-button type="primary" size="small" @click="handleQuery">æ¥è¯¢</el-button> |
| | | <el-button size="small" @click="reset">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div> |
| | | <el-button size="small" type="primary" @click="handleForm('add')">æ°å¢</el-button> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <el-table ref="yearTableDetailData" v-loading="yearTableDetailDataLoading" :data="yearTableDetailData" |
| | | border |
| | | :height="'calc(100vh - 34em)'" style="width: 100% ;"> |
| | | <el-table ref="yearTableDetailData" v-loading="yearTableDetailDataLoading" :data="yearTableDetailData" border |
| | | :row-class-name="tableRowClassName" :height="'calc(100vh - 29em)'" style="width: 100% ;"> |
| | | <!-- è¡¨æ ¼å --> |
| | | <el-table-column align="center" header-align="center" label="åºå·" prop="prop" type="index" |
| | | width="70"></el-table-column> |
| | | <el-table-column label="设å¤åç§°ååå·" min-width="180" prop="deviceName" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="è®¾å¤æ°é" min-width="180" prop="deviceAmount"></el-table-column> |
| | | <el-table-column label="è®¾å¤æ°é" min-width="90" prop="deviceAmount"></el-table-column> |
| | | <el-table-column label="仪å¨ç¼å·" min-width="150" prop="deviceNumber"></el-table-column> |
| | | <el-table-column label="æ£å®åä½" min-width="150" prop="verificationUnit"> </el-table-column> |
| | | <el-table-column label="æ£å®å¨æ" min-width="150" prop="verificationCycles"></el-table-column> |
| | | <el-table-column label="æè¿æ£å®æ¶é´" min-width="150" prop="lastDate"></el-table-column> |
| | | <el-table-column label="æ¬å¹´è®¡åæ ¡åæ¶é´" min-width="150" prop="planDate"></el-table-column> |
| | | <el-table-column label="夿³¨" min-width="150" prop="remark"></el-table-column> |
| | | <el-table-column label="æ£å®å¨æ" min-width="100" prop="verificationCycles"></el-table-column> |
| | | <el-table-column label="æè¿æ£å®æ¶é´" min-width="130" prop="lastDate" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column label="æ¬å¹´è®¡åæ ¡åæ¶é´" min-width="130" prop="planDate" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column label="夿³¨" min-width="130" prop="remark"></el-table-column> |
| | | <!-- æä½æé® --> |
| | | <el-table-column align="center" fixed="right" label="æä½" min-width="140"> |
| | | <el-table-column align="center" fixed="right" label="æä½" min-width="210"> |
| | | <template #default="scope"> |
| | | <el-button size="small" link type="primary" @click="handleForm('edit', scope.row)">ç¼è¾</el-button> |
| | | <el-button size="small" link type="primary" :disabled="!scope.row.deviceId" |
| | | @click="handleExecute(scope.row)">æ§è¡</el-button> |
| | | <el-button size="small" link type="primary" :disabled="planInfo.ratifyStatus === 1" |
| | | @click="handleForm('edit', scope.row)">ç¼è¾</el-button> |
| | | <el-button size="small" link type="primary" @click="handleForm('view', scope.row)">æ¥ç</el-button> |
| | | <el-button size="small" link type="danger" |
| | | <el-button size="small" link type="danger" :disabled="planInfo.ratifyStatus === 1" |
| | | @click="deleteFun1(scope.row.planDetailId)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | <el-pagination :current-page="pagination1.current" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | background :total="pagination1.total" layout="->,total, sizes, prev, pager, next, jumper" |
| | | @size-change="handleSizeChange1" @current-change="handleCurrentChange1"> |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="dialogVisible" title="è®¾å¤æ ¡å计å" |
| | | width="80%" @close="resetForm"> |
| | |
| | | <el-button :loading="notificationLoading" type="primary" @click="notification">æ 交</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | | <!--ä¸ä¼ æ¥å--> |
| | | <el-dialog v-model="uploadDia" title="æ°æ®å¯¼å
¥" width="500px"> |
| | | å¹´ä»½ï¼ |
| | | <el-date-picker v-model="planYear" type="year" value-format="YYYY" clearable format="YYYY" placeholder="鿩年"> |
| | | </el-date-picker> |
| | | <div style="margin: 0 auto;"> |
| | | <el-upload ref="upload1" :action="action" :auto-upload="false" :file-list="fileList" :headers="uploadHeader" |
| | | :limit="1" accept='.doc,.docx' :on-change="beforeUpload" :on-error="onError" :on-success="handleSuccessUp" |
| | | drag name="file"> |
| | | <lims-icon name="el-icon-upload"></lims-icon> |
| | | <div class="el-upload__text">å°æä»¶æå°æ¤å¤ï¼æ<em>ç¹å»ä¸ä¼ </em></div> |
| | | </el-upload> |
| | | </div> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button @click="uploadDia = false">å æ¶</el-button> |
| | | <el-button :loading="uploading" type="primary" @click="submitUpload()">ä¸ ä¼ </el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | | <add-year-plan-dia v-if="addYearPlanDia" ref="addYearPlanDia" @closeDia="closeDia"></add-year-plan-dia> |
| | | <!-- æ·»å /æ¥çæ ¡åè®°å½å¼¹çª --> |
| | | <calibration-record-dia ref="calibrationRecordDia" @success="getYearTableDetailData"></calibration-record-dia> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import AddYearPlanDia from "./addYearPlanDia.vue"; |
| | | import AddVerificationYearPlanDia from "./addVerificationYearPlanDia.vue"; |
| | | import CalibrationRecordDia from "./calibrationRecordDia.vue"; |
| | | import { |
| | | pageDeviceCalibrationPlan, |
| | | getCalibrationPlanByYear, |
| | | submiatRatifyDeviceCalibrationPlan, |
| | | exportDeviceCalibrationPlanDetail, |
| | | delDeviceCalibrationPlan, |
| | | delDeviceCalibrationPlanDetail, |
| | | pageDeviceCalibrationPlanDetail, |
| | | addDeviceCalibrationPlanDetail, |
| | | updateDeviceCalibrationPlanDetail, |
| | | ratifyDeviceCalibrationPlan, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/performance/class"; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import { formatDateOnly } from './dateFormat' |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | | export default { |
| | | name: "equipment-calibration-plan", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: { AddVerificationYearPlanDia, AddYearPlanDia }, |
| | | components: { CalibrationRecordDia }, |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | planYear: '', |
| | | yearOptions: [], |
| | | planInfo: {}, |
| | | dialogVisible: false, |
| | | searchForm: { |
| | | deviceName: '', |
| | | deviceNumber: '', |
| | | }, |
| | | yearTableData: [], |
| | | yearTableDetailData: [], |
| | | pagination: { |
| | | size: 10, |
| | | current: 1, |
| | | total: 0, |
| | | }, |
| | | pagination1: { |
| | | size: 10, |
| | | current: 1, |
| | |
| | | deviceNumber: [{ required: true, message: '请填å仪å¨ç¼å·', trigger: 'blur' }], |
| | | planDate: [{ required: true, message: 'è¯·éæ©æ¥æ', trigger: 'change' }], |
| | | }, |
| | | yearTableDataLoading: false, |
| | | yearTableDetailDataLoading: false, |
| | | currentRow: {}, |
| | | approvalDialog: false, |
| | | approvalLoading: false, |
| | | submitFormLoading: false, |
| | | ratifyRemark: '', |
| | | currentRowId: '', |
| | | uploadDia: false, |
| | | uploading: false, |
| | | addYearPlanDia: false, |
| | | fileList: [], |
| | | planYear: '', |
| | | responsibleOptions: [], |
| | | notificationDia: false, |
| | | notificationLoading: false, |
| | | ratifyUserId: '', |
| | | planId: '' |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getYearTableData() |
| | | this.loadYearOptions() |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | // æ¥è¯¢å¹´åº¦è®¡å表 |
| | | getYearTableData() { |
| | | this.yearTableDataLoading = true |
| | | // 年份䏿é项ï¼å·²æè®¡å年份 + å½å年份 |
| | | loadYearOptions() { |
| | | pageDeviceCalibrationPlan({ |
| | | current: 1, |
| | | size: 99, |
| | | }).then(res => { |
| | | let years = [] |
| | | if (res.code == 200) { |
| | | this.yearTableData = res.data.records |
| | | this.pagination.total = res.data.total |
| | | if (this.yearTableData.length > 0) { |
| | | this.currentRow = this.yearTableData[0] |
| | | this.$refs.yearTable.setCurrentRow(this.currentRow) |
| | | years = (res.data.records || []).map(r => r.planYear).filter(Boolean) |
| | | } |
| | | const currentYear = String(new Date().getFullYear()) |
| | | if (years.indexOf(currentYear) === -1) { |
| | | years.push(currentYear) |
| | | } |
| | | this.yearTableDataLoading = false |
| | | }).catch(err => { |
| | | this.yearTableDataLoading = false |
| | | this.yearOptions = [...new Set(years)].sort((a, b) => b.localeCompare(a)) |
| | | this.planYear = currentYear |
| | | this.loadPlan() |
| | | }) |
| | | }, |
| | | // å页 |
| | | handleSizeChange(val) { |
| | | this.pagination.size = val |
| | | this.getYearTableData() |
| | | // 忢年份 |
| | | handleYearChange() { |
| | | this.pagination1.current = 1 |
| | | this.loadPlan() |
| | | }, |
| | | // æ¥è¯¢å¹´ä»½è®¡åï¼ä¸åå¨èªå¨å建并补å
¨å°ç¹æç»ï¼ï¼éåå·æ°æç» |
| | | loadPlan() { |
| | | getCalibrationPlanByYear({ planYear: this.planYear }).then(res => { |
| | | if (res.code == 200) { |
| | | this.planInfo = res.data || {} |
| | | } |
| | | this.getYearTableDetailData() |
| | | }).catch(() => { |
| | | this.planInfo = {} |
| | | this.yearTableDetailData = [] |
| | | this.pagination1.total = 0 |
| | | this.yearTableDetailDataLoading = false |
| | | }) |
| | | }, |
| | | // æ¥è¯¢æ¡ä»¶åååä»ç¬¬ä¸é¡µå¼å§æ¥ |
| | | handleQuery() { |
| | | this.pagination1.current = 1 |
| | | this.getYearTableDetailData() |
| | | }, |
| | | // æç»-æ¥è¯¢ |
| | | getYearTableDetailData() { |
| | | if (!this.planInfo.planId) { |
| | | return |
| | | } |
| | | this.yearTableDetailDataLoading = true |
| | | pageDeviceCalibrationPlanDetail({ |
| | | current: this.pagination1.current, |
| | | size: this.pagination1.size, |
| | | planId: this.planInfo.planId, |
| | | deviceName: this.searchForm.deviceName, |
| | | deviceNumber: this.searchForm.deviceNumber, |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | this.yearTableDetailData = res.data.records |
| | | this.pagination1.total = res.data.total |
| | | } |
| | | this.yearTableDetailDataLoading = false |
| | | }).catch(err => { |
| | | this.yearTableDetailDataLoading = false |
| | | }) |
| | | }, |
| | | formatDateCell(row, column, cellValue) { |
| | | return formatDateOnly(cellValue) |
| | | }, |
| | | // å°ç¹éæ ¡åçè¡æ 红 |
| | | tableRowClassName({ row }) { |
| | | return row.redFlag === 1 ? 'red-row' : '' |
| | | }, |
| | | reset() { |
| | | this.searchForm = { |
| | | deviceName: '', |
| | | deviceNumber: '', |
| | | } |
| | | this.pagination1.current = 1 |
| | | this.getYearTableDetailData() |
| | | }, |
| | | // å页 |
| | | handleCurrentChange(val) { |
| | | this.pagination.current = val |
| | | this.getYearTableData() |
| | | handleSizeChange1(val) { |
| | | this.pagination1.size = val |
| | | this.getYearTableDetailData() |
| | | }, |
| | | // å页 |
| | | handleCurrentChange1(val) { |
| | | this.pagination1.current = val |
| | | this.getYearTableDetailData() |
| | | }, |
| | | // æ§è¡ï¼æå¼æ ¡åè®°å½å¼¹çªå½å
¥ |
| | | handleExecute(row) { |
| | | this.$refs.calibrationRecordDia.open(row.deviceId, 'add') |
| | | }, |
| | | // æå¼æç»å¼¹æ¡ |
| | | handleForm(type, row) { |
| | | this.operationType = type |
| | | this.dialogVisible = true |
| | | this.$nextTick(() => { |
| | | this.form = this.HaveJson(row) |
| | | }) |
| | | }, |
| | | // æäº¤è¡¨å |
| | | submitForm() { |
| | | this.$refs.modelForm.validate(valid => { |
| | | if (valid) { |
| | | this.submitFormLoading = true |
| | | updateDeviceCalibrationPlanDetail(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.dialogVisible = false |
| | | this.getYearTableDetailData() |
| | | } |
| | | this.submitFormLoading = false |
| | | }).catch(err => { |
| | | this.submitFormLoading = false |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // æç»-å é¤ |
| | | deleteFun1(id) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delDeviceCalibrationPlanDetail({ planDetailsId: id }).then(res => { |
| | | this.$message.success('å 餿åï¼'); |
| | | this.getYearTableDetailData() |
| | | }); |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | // æå¼æäº¤æ¹åå¼¹æ¡ |
| | | tellApprove(planId) { |
| | | tellApprove() { |
| | | this.getUserList() |
| | | this.notificationDia = true |
| | | this.planId = planId |
| | | }, |
| | | // å
³éæäº¤æ¹åå¼¹æ¡ |
| | | closeNotificationDia() { |
| | |
| | | this.notificationLoading = true |
| | | submiatRatifyDeviceCalibrationPlan({ |
| | | ratifyUserId: this.ratifyUserId, |
| | | planId: this.planId, |
| | | planId: this.planInfo.planId, |
| | | }).then(res => { |
| | | this.notificationLoading = false |
| | | if (res.code == 200) { |
| | | this.closeNotificationDia() |
| | | this.getYearTableData() |
| | | this.loadPlan() |
| | | } |
| | | }).catch(err => { |
| | | this.notificationLoading = false |
| | | }) |
| | | }, |
| | | // 年度计å表-æ¹å |
| | | handleApprove(id) { |
| | | this.currentRowId = id |
| | | // æ¹å |
| | | handleApprove() { |
| | | this.currentRowId = this.planInfo.planId |
| | | this.approvalDialog = true |
| | | }, |
| | | // 年度计å表-å¯¼åº |
| | | downLoadPost(planId) { |
| | | exportDeviceCalibrationPlanDetail({ planId }).then(res => { |
| | | const blob = new Blob([res], { type: 'application/msword' }); |
| | | this.$download.saveAs(blob, 'è®¾å¤æ ¡å计å.docx') |
| | | }) |
| | | }, |
| | | // 年度计å表-å é¤ |
| | | deleteFun(id) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delDeviceCalibrationPlan({ planId: id }).then(res => { |
| | | this.$message.success('å 餿åï¼'); |
| | | this.getYearTableData(); |
| | | }); |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | // 年度计å详æ
表-å é¤ |
| | | deleteFun1(id) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delDeviceCalibrationPlanDetail({ planDetailsId: id }).then(res => { |
| | | this.$message.success('å 餿åï¼'); |
| | | this.getYearTableDetailData(this.currentRow) |
| | | }); |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | currentChange(row) { |
| | | this.currentRow = row |
| | | this.getYearTableDetailData(this.currentRow) |
| | | }, |
| | | getYearTableDetailData(row) { |
| | | this.yearTableDetailDataLoading = true |
| | | pageDeviceCalibrationPlanDetail({ |
| | | current: this.pagination1.current, |
| | | size: this.pagination1.size, |
| | | planId: row.planId, |
| | | deviceName: this.searchForm.deviceName, |
| | | deviceNumber: this.searchForm.deviceNumber, |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | this.yearTableDetailData = res.data.records |
| | | this.pagination1.total = res.data.total |
| | | } |
| | | this.yearTableDetailDataLoading = false |
| | | }).catch(err => { |
| | | this.yearTableDetailDataLoading = false |
| | | }) |
| | | }, |
| | | reset() { |
| | | this.searchForm = { |
| | | deviceName: '', |
| | | deviceNumber: '', |
| | | } |
| | | this.getYearTableDetailData(this.currentRow) |
| | | }, |
| | | // å页 |
| | | handleSizeChange1(val) { |
| | | this.pagination1.size = val |
| | | this.getYearTableDetailData(this.currentRow) |
| | | }, |
| | | // å页 |
| | | handleCurrentChange1(val) { |
| | | this.pagination1.current = val |
| | | this.getYearTableDetailData(this.currentRow) |
| | | }, |
| | | // æå¼å¼¹æ¡ |
| | | handleForm(type, row) { |
| | | this.operationType = type |
| | | this.dialogVisible = true |
| | | this.form.planId = this.currentRow.planId |
| | | if (this.operationType !== 'add') { |
| | | this.$nextTick(() => { |
| | | this.form = this.HaveJson(row) |
| | | }) |
| | | } else { |
| | | this.form = { |
| | | deviceName: '', |
| | | deviceAmount: '', |
| | | deviceNumber: '', |
| | | verificationUnit: '', |
| | | verificationCycles: '', |
| | | lastDate: '', |
| | | planDate: '', |
| | | remark: '', |
| | | planId: this.currentRow.planId, |
| | | planDetailId: '', |
| | | } |
| | | } |
| | | }, |
| | | // æäº¤è¡¨å |
| | | submitForm() { |
| | | this.$refs.modelForm.validate(valid => { |
| | | if (valid) { |
| | | if (this.operationType === 'add') { |
| | | this.submitFormLoading = true |
| | | addDeviceCalibrationPlanDetail(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.dialogVisible = false |
| | | this.getYearTableData() |
| | | } |
| | | this.submitFormLoading = false |
| | | }).catch(err => { |
| | | this.submitFormLoading = false |
| | | }) |
| | | } else { |
| | | this.submitFormLoading = true |
| | | updateDeviceCalibrationPlanDetail(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.dialogVisible = false |
| | | this.getYearTableData() |
| | | } |
| | | this.submitFormLoading = false |
| | | }).catch(err => { |
| | | this.submitFormLoading = false |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // æå¼æ°å¢å¼¹æ¡ |
| | | addYearPlan(type, row) { |
| | | this.addYearPlanDia = true |
| | | this.$nextTick(() => { |
| | | this.$refs.addYearPlanDia.openDialog(type, row) |
| | | }) |
| | | }, |
| | | closeDia() { |
| | | this.addYearPlanDia = false |
| | | this.getYearTableData() |
| | | }, |
| | | submitUpload() { |
| | | if (!this.planYear) { |
| | | this.$message.warning('è¯·éæ©å¹´ä»½') |
| | | return; |
| | | } |
| | | if (this.$refs.upload1.uploadFiles.length === 0) { |
| | | this.$message.error('æªéæ©æä»¶') |
| | | return |
| | | } |
| | | this.uploading = true |
| | | this.$refs.upload1.submit(); |
| | | }, |
| | | // æäº¤æ¹å |
| | | // æäº¤æ¹åç»æ |
| | | handleApproval(status) { |
| | | const personTrainingUpdateDto = { |
| | | planId: this.currentRowId, |
| | |
| | | if (res.code === 200) { |
| | | this.$message.success('æäº¤æåï¼'); |
| | | this.approvalDialog = false |
| | | this.getYearTableData(); |
| | | this.loadPlan() |
| | | } |
| | | this.approvalLoading = false |
| | | }).catch(() => { |
| | | this.approvalLoading = false |
| | | }) |
| | | }, |
| | | // å¯¼åº |
| | | downLoadPost() { |
| | | exportDeviceCalibrationPlanDetail({ planId: this.planInfo.planId }).then(res => { |
| | | saveBlobOrShowError(res, 'è®¾å¤æ ¡å计å.docx', 'application/msword') |
| | | }).catch(() => { }) |
| | | }, |
| | | resetForm() { |
| | | this.$refs.modelForm.resetFields(); |
| | | this.dialogVisible = false |
| | | }, |
| | | // æå¼æ¥åå¼¹æ¡ |
| | | record(row) { |
| | | this.uploadDia = true |
| | | }, |
| | | // 导å
¥æµç¨ |
| | | beforeUpload(file) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M'); |
| | | this.$refs.upload.clearFiles() |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | }, |
| | | onError(err, file, fileList) { |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | | handleSuccessUp(response) { |
| | | this.uploading = false; |
| | | if (response.code == 200) { |
| | | this.$message.success('ä¸ä¼ æå'); |
| | | this.getYearTableData() |
| | | } else { |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | } |
| | | }, |
| | | // è·åè´è´£äººä¿¡æ¯æ¥å£ |
| | | getUserList() { |
| | |
| | | }); |
| | | } |
| | | }, |
| | | // ç¨äºä¸ä¼ æä»¶çä¿¡æ¯ |
| | | computed: { |
| | | action() { |
| | | return this.javaApi + '/deviceCalibrationPlan/importDeviceCalibrationPlan' + '?planYear=' + this.planYear |
| | | }, |
| | | ...mapGetters(["userId"]), |
| | | // æ¯å¦å·²å®æå®¡æ¹ï¼æ¹å/䏿¹åï¼ |
| | | isRatified() { |
| | | return this.planInfo.ratifyStatus === 0 || this.planInfo.ratifyStatus === 1; |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | |
| | | background-color: var(--el-color-primary); |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | .plan-top { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | flex-wrap: wrap; |
| | | } |
| | | |
| | | .plan-top-left { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .plan-info-bar { |
| | | display: flex; |
| | | align-items: center; |
| | | flex-wrap: wrap; |
| | | gap: 32px; |
| | | background: #f5f7fa; |
| | | border-radius: 4px; |
| | | padding: 10px 16px; |
| | | margin-top: 14px; |
| | | font-size: 14px; |
| | | color: #606266; |
| | | } |
| | | |
| | | .search { |
| | | height: 46px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | :deep(.red-row td) { |
| | | background: #ffcccc !important; |
| | | } |
| | | </style> |
| | |
| | | <span style="width: 80px">A仪å¨åç§°ï¼</span> |
| | | <el-select v-model="form.adeviceId" :disabled="currentStep !== 0" class="table_input" clearable filterable |
| | | placeholder="设å¤åç§°" size="small" style="width:200px" @change="(val) => changeMachineName(val, 'A')"> |
| | | <el-option v-for="item in equipOptions" :key="item.value" :label="item.label" :value="item.id"> |
| | | <el-option v-for="item in equipOptions" :key="item.id" :label="item.label" :value="item.id"> |
| | | {{ item.label + '-' + item.value }} |
| | | </el-option> |
| | | </el-select> |
| | |
| | | <span style="width: 80px">B仪å¨åç§°ï¼</span> |
| | | <el-select v-model="form.bdeviceId" :disabled="currentStep !== 0" class="table_input" clearable filterable |
| | | placeholder="设å¤åç§°" size="small" style="width:200px" @change="(val) => changeMachineName(val, 'B')"> |
| | | <el-option v-for="item in equipOptions" :key="item.value" :label="item.label" :value="item.id"> |
| | | <el-option v-for="item in equipOptions" :key="item.id" :label="item.label" :value="item.id"> |
| | | {{ item.label + '-' + item.value }} |
| | | </el-option> |
| | | </el-select> |
| | |
| | | <span style="width: 80px">C仪å¨åç§°ï¼</span> |
| | | <el-select v-model="form.cdeviceId" :disabled="currentStep !== 0" class="table_input" clearable filterable |
| | | placeholder="设å¤åç§°" size="small" style="width:200px" @change="(val) => changeMachineName(val, 'C')"> |
| | | <el-option v-for="item in equipOptions" :key="item.value" :label="item.label" :value="item.id"> |
| | | <el-option v-for="item in equipOptions" :key="item.id" :label="item.label" :value="item.id"> |
| | | {{ item.label + '-' + item.value }} |
| | | </el-option> |
| | | </el-select> |
| | |
| | | <el-button v-if="currentStep === 0" size="small" type="primary" @click="addTableRow">æ·»å </el-button> |
| | | </div> |
| | | <div style="margin: 10px 0"> |
| | | <el-table ref="yearTable" :data="recordContrastDetailsList" height="300px" style="width: 100% ;" |
| | | <el-table ref="yearTable" :data="form.recordContrastDetailsList" height="300px" style="width: 100% ;" |
| | | border> |
| | | <el-table-column align="center" header-align="center" label="åºå·" type="index" width="60"></el-table-column> |
| | | <el-table-column label="æ ¸æ¥é¡¹ç®" min-width="170" prop="checkItems"> |
| | |
| | | </div> |
| | | </div> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button @click="resetForm">å æ¶</el-button> |
| | | <el-button @click="handleCancel">å æ¶</el-button> |
| | | <el-button v-if="currentStep === 0 && userId == checkChargerUserId" :loading="submitFormLoading" type="primary" @click="submitCheck">ç¡® |
| | | å®</el-button> |
| | | <el-button v-if="currentStep === 1 && userId == reviewUserId" :loading="submitFormLoading" @click="examine(0)">ä¸éè¿</el-button> |
| | |
| | | planDetailsId: '', |
| | | }, |
| | | equipOptions: [], |
| | | recordContrastDetailsList: [], |
| | | userList: [], |
| | | checkChargerUserId: '', |
| | | reviewUserId: '' |
| | |
| | | this.searchInfo() |
| | | }, |
| | | searchInfo() { |
| | | getExamineRecordContrast({ planDetailsId: this.form.planDetailsId }).then(res => { |
| | | const planDetailsId = this.form.planDetailsId |
| | | getExamineRecordContrast({ planDetailsId }).then(res => { |
| | | if (res.code === 200) { |
| | | this.form = { ...res.data } |
| | | this.recordContrastDetailsList = this.form.recordContrastDetailsList || [] |
| | | // æ åå²è®°å½æ¶æ¥å£å¯è½è¿å空ï¼planDetailsId å¿
é¡»ä¿çï¼å¦åæ æ³æäº¤ |
| | | this.form = { ...(res.data || {}), planDetailsId } |
| | | this.form.recordContrastDetailsList = this.form.recordContrastDetailsList || [] |
| | | if (!this.form.reviewUserId) { |
| | | this.currentStep = 0 |
| | | } else { |
| | |
| | | this.reviewUserId = this.form.reviewUserId |
| | | if (this.currentStep === 0) { |
| | | this.draftRestore('equipmentCheck', 'form', this.form.planDetailsId, 'dialogVisible') |
| | | this.recordContrastDetailsList = this.form.recordContrastDetailsList || [] |
| | | } |
| | | } |
| | | }).catch(error => { |
| | |
| | | }, |
| | | // èµå¼ä»ªå¨ç¼å· |
| | | changeMachineName(value, type) { |
| | | const index = this.equipOptions.findIndex(item => item.id === value) |
| | | if (index > -1) { |
| | | const item = this.equipOptions.find(device => device.id === value) |
| | | if (type === 'A') { |
| | | this.form['adeviceNumber'] = this.equipOptions[index].value |
| | | this.form['adeviceNumber'] = item ? item.value : '' |
| | | } |
| | | if (type === 'B') { |
| | | this.form['bdeviceNumber'] = this.equipOptions[index].value |
| | | this.form['bdeviceNumber'] = item ? item.value : '' |
| | | } |
| | | if (type === 'C') { |
| | | this.form['cdeviceNumber'] = this.equipOptions[index].value |
| | | } |
| | | this.form['cdeviceNumber'] = item ? item.value : '' |
| | | } |
| | | }, |
| | | // æ·»å è¡¨æ ¼æ°æ® |
| | | addTableRow() { |
| | | this.recordContrastDetailsList.push({ checkItems: '' }) |
| | | if (!this.form.recordContrastDetailsList) { |
| | | this.form.recordContrastDetailsList = [] |
| | | } |
| | | this.form.recordContrastDetailsList.push({ checkItems: '' }) |
| | | }, |
| | | submitCheck() { |
| | | this.form.recordContrastDetailsList = this.HaveJson(this.recordContrastDetailsList) |
| | | const deviceIds = [this.form.adeviceId, this.form.bdeviceId, this.form.cdeviceId].filter(Boolean) |
| | | if (new Set(deviceIds).size !== deviceIds.length) { |
| | | this.$message.error('A/B/C 仪å¨ä¸è½éæ©åä¸å°è®¾å¤') |
| | | return |
| | | } |
| | | this.form.recordContrastDetailsList = this.HaveJson(this.form.recordContrastDetailsList || []) |
| | | this.submitFormLoading = true |
| | | addExamineRecordContrast(this.form).then(res => { |
| | | if (res.code == 200) { |
| | |
| | | this.submitFormLoading = false |
| | | }) |
| | | }, |
| | | // åæ¶æé®ï¼ç¡®è®¤åæ´ä½æ¸
ç©ºæ¬æ¬¡è稿ï¼å³ä¸è§å
³é/æå¤éåºåä¿çè稿 |
| | | handleCancel() { |
| | | if (this.currentStep !== 0) { |
| | | this.resetForm() |
| | | return |
| | | } |
| | | this.$confirm('åæ¶åæ¬æ¬¡å¡«åçæ°æ®å°è¢«æ¸
空ï¼ä¸æ æ³æ¢å¤ï¼æ¯å¦ç»§ç»ï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'ç»§ç»å¡«å', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.draftClear('equipmentCheck') |
| | | this.resetForm() |
| | | }).catch(() => {}) |
| | | }, |
| | | resetForm() { |
| | | this.draftStop('equipmentCheck') |
| | | this.dialogVisible = false |
| | |
| | | <!-- æä½æé® --> |
| | | <el-table-column align="center" fixed="right" label="æä½" min-width="140"> |
| | | <template #default="scope"> |
| | | <el-button :disabled="scope.row.ratifyStatus === 1" size="small" link type="primary" |
| | | <el-button :disabled="scope.row.isFinish === 1" size="small" link type="primary" |
| | | @click="handleForm(scope.row.maintenanceId)">æä½</el-button> |
| | | <el-button size="small" link type="primary" @click="handleDownOne(scope.row.maintenanceId)">导åº</el-button> |
| | | <el-button size="small" link type="danger" |
| | | <el-button :disabled="scope.row.isFinish === 1" size="small" link type="danger" |
| | | @click="deleteFun(scope.row.maintenanceId)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | <el-pagination :current-page="pagination1.current" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="pagination1.total" layout="->,total, sizes, prev, pager, next, jumper" background |
| | | @size-change="handleSizeChange1" @current-change="handleCurrentChange1"> |
| | | </el-pagination> |
| | |
| | | exportDeviceBreakdownMaintenance, |
| | | delDeviceBreakdownMaintenance, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | | export default { |
| | | name: "equipment-failure", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | |
| | | maintenanceId: id |
| | | }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '仪å¨è®¾å¤ä¿®çç³è¯·è¡¨.doc') |
| | | saveBlobOrShowError(res, '仪å¨è®¾å¤ä¿®çç³è¯·è¡¨.doc', 'application/msword') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | // å é¤ |
| | |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ç»´æ¤å
容:" prop="maintenanceContentArr"> |
| | | <el-checkbox-group v-model="form.maintenanceContentArr" :disabled="operationType === 'view'"> |
| | | <el-checkbox-group v-if="qualificationList.length" v-model="form.maintenanceContentArr" |
| | | :disabled="operationType === 'view'"> |
| | | <el-checkbox v-for="city in qualificationList" :key="city.label" :label="city.label" |
| | | :value="city.label"></el-checkbox> |
| | | </el-checkbox-group> |
| | | <el-input v-else v-model="form.maintenanceContentText" :disabled="operationType === 'view'" |
| | | size="small" placeholder="请è¾å
¥ç»´æ¤å
容" style="width: 100%"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | } from "@/api/cnas/resourceDemand/device"; |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import {selectUserCondition} from "@/api/system/user"; |
| | | import {saveBlobOrShowError} from '@/utils/saveBlob' |
| | | |
| | | export default { |
| | | name: '', |
| | |
| | | maintenanceDate: '', |
| | | maintenanceContentArr: [], |
| | | maintenanceContent: '', |
| | | maintenanceContentText: '', |
| | | maintenanceUserId: '', |
| | | remark: '', |
| | | }, |
| | |
| | | qualificationList: [], |
| | | rules: { |
| | | maintenanceDate: [{ required: true, message: 'è¯·éæ©ç»´æ¤æ¥æ', trigger: 'change' }], |
| | | maintenanceContentArr: [{ required: true, message: 'è¯·éæ©ç»´æ¤å
容', trigger: 'change' }], |
| | | maintenanceContentArr: [{ |
| | | validator: (rule, value, callback) => { |
| | | if (this.qualificationList.length) { |
| | | if (!value || value.length === 0) { |
| | | return callback(new Error('è¯·éæ©ç»´æ¤å
容')) |
| | | } |
| | | } else if (!this.form.maintenanceContentText || !this.form.maintenanceContentText.trim()) { |
| | | return callback(new Error('请è¾å
¥ç»´æ¤å
容')) |
| | | } |
| | | callback() |
| | | }, |
| | | trigger: 'change' |
| | | }], |
| | | maintenanceUserId: [{ required: true, message: 'è¯·éæ©ç»´æ¤äºº', trigger: 'change' }], |
| | | }, |
| | | responsibleOptions: [], |
| | |
| | | }, |
| | | // å页忢 |
| | | pagination(page) { |
| | | this.page.current = page.page |
| | | this.page.size = page.limit |
| | | this.getTableList() |
| | | }, |
| | |
| | | this.form.id = '' |
| | | if (this.operationType === 'edit') { |
| | | this.form = {...row} |
| | | this.form['maintenanceContentArr'] = this.form.maintenanceContent.split(',') |
| | | this.form['maintenanceContentArr'] = this.form.maintenanceContent ? this.form.maintenanceContent.split(',') : [] |
| | | this.form['maintenanceContentText'] = this.form.maintenanceContent || '' |
| | | } |
| | | }) |
| | | this.getDictS() |
| | |
| | | deviceId: this.clickNodeVal.value |
| | | }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设å¤ç»´æ¤ä¿å
».doc') |
| | | saveBlobOrShowError(res, '设å¤ç»´æ¤ä¿å
».doc', 'application/msword') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | |
| | | }, |
| | | handleDeleteClick(row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ¡ä¿å
»è®°å½, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.buttonLoading = true; |
| | | this.form.maintenanceContent = this.form.maintenanceContentArr.join(',') |
| | | this.form.maintenanceContent = this.qualificationList.length |
| | | ? this.form.maintenanceContentArr.join(',') |
| | | : (this.form.maintenanceContentText || '').trim() |
| | | this.form.deviceId = this.clickNodeVal.value |
| | | addDeviceMaintenance(this.form).then(res => { |
| | | this.buttonLoading = false; |
| | |
| | | <template> |
| | | <!-- 设å¤ä¿å
»è®¡å--> |
| | | <div> |
| | | <div> |
| | | <div style="margin: 10px 0;text-align: right"> |
| | | <el-button size="small" type="primary" @click="getYearTableDetailData">å·æ°</el-button> |
| | | <el-button size="small" type="primary" @click="handleForm('add')">æ°å¢</el-button> |
| | | <div style="margin: 10px 0 14px;"> |
| | | <div class="plan-top"> |
| | | <div class="plan-top-left"> |
| | | <span class="title" style="margin-bottom: 0;">{{ planInfo.planName || (planYear + '年度设å¤ä¿å
»è®¡å') }}</span> |
| | | <el-select v-model="planYear" size="small" style="width: 110px; margin-left: 16px;" @change="handleYearChange"> |
| | | <el-option v-for="y in yearOptions" :key="y" :label="y" :value="y"></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div> |
| | | <el-table ref="yearTable" v-loading="yearTableDetailDataLoading" :data="yearTableDetailData" |
| | | border |
| | | height="calc(100vh - 18em)" style="width: 100% ;"> |
| | | <!-- è¡¨æ ¼å --> |
| | | <el-button size="small" type="primary" @click="loadPlan">å·æ°</el-button> |
| | | <el-button size="small" type="primary" :disabled="planInfo.status === 1" |
| | | @click="tellApprove">å®¡æ ¸éç¥</el-button> |
| | | <el-button size="small" type="primary" |
| | | :disabled="planInfo.status === 1 || userId != planInfo.auditId" @click="handleApprove">å®¡æ ¸</el-button> |
| | | <el-button size="small" type="primary" :loading="outLoading" @click="handleDownOne">导åº</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="plan-info-bar"> |
| | | <span>ç¼å¶äººï¼{{ planInfo.compiler || 'â' }}</span> |
| | | <span>ç¼å¶æ¥æï¼{{ planInfo.datePreparationStr || 'â' }}</span> |
| | | <span v-if="planInfo.status === 1">å®¡æ ¸ç¶æï¼<el-tag type="success">é è¿</el-tag></span> |
| | | <span v-else-if="planInfo.status === 0">å®¡æ ¸ç¶æï¼<el-tag type="danger">ä¸éè¿</el-tag></span> |
| | | <span v-else>å®¡æ ¸ç¶æï¼<el-tag type="info">æªå®¡æ ¸</el-tag></span> |
| | | <span v-if="planInfo.auditRemark">å®¡æ ¸ä¿¡æ¯ï¼{{ planInfo.auditRemark }}</span> |
| | | <span v-if="isAudited && planInfo.audit">å®¡æ ¸äººï¼{{ planInfo.audit }}</span> |
| | | <span v-if="isAudited && planInfo.auditDateStr">å®¡æ ¸æ¶é´ï¼{{ planInfo.auditDateStr }}</span> |
| | | </div> |
| | | </div> |
| | | <div class="search"> |
| | | <div> |
| | | <el-form :model="searchForm" ref="searchForm" size="small" :inline="true"> |
| | | <el-form-item label="设å¤åç§°" prop="deviceName"> |
| | | <el-input v-model="searchForm.deviceName" clearable @keyup.enter="handleQuery" |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤ç¼å·" prop="deviceNumber"> |
| | | <el-input v-model="searchForm.deviceNumber" @keyup.enter="handleQuery" clearable |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" size="small" @click="handleQuery">æ¥è¯¢</el-button> |
| | | <el-button size="small" @click="reset">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <el-table ref="yearTable" v-loading="tableLoading" :data="tableData" border |
| | | :row-class-name="tableRowClassName" :height="'calc(100vh - 29em)'" style="width: 100%;"> |
| | | <el-table-column align="center" header-align="center" label="åºå·" prop="prop" type="index" |
| | | width="70"></el-table-column> |
| | | <el-table-column label="年份" min-width="80" prop="planYear"></el-table-column> |
| | | <el-table-column label="ç¼å¶äºº" min-width="120" prop="compiler"></el-table-column> |
| | | <el-table-column label="ç¼å¶æ¶é´" min-width="160" prop="datePreparation"></el-table-column> |
| | | <el-table-column label="å®¡æ ¸äºº" min-width="150" prop="audit"></el-table-column> |
| | | <el-table-column label="å®¡æ ¸æ¶é´" min-width="180" prop="auditDate"></el-table-column> |
| | | <el-table-column label="å®¡æ ¸ç¶æ" min-width="180" prop="status"> |
| | | <el-table-column label="设å¤åç§°ååå·" min-width="180" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.status === 1" type="success">é è¿</el-tag> |
| | | <el-tag v-if="scope.row.status === 0" type="danger">ä¸éè¿</el-tag> |
| | | {{ scope.row.deviceName }}{{ scope.row.specificationModel ? ' ' + scope.row.specificationModel : '' }} |
| | | </template> |
| | | </el-table-column> |
| | | <!-- æä½æé® --> |
| | | <el-table-column align="center" fixed="right" label="æä½" min-width="260"> |
| | | <el-table-column label="设å¤ç¼å·" min-width="140" prop="deviceNumber"></el-table-column> |
| | | <el-table-column label="å½å±å®éªå®¤" min-width="120" prop="storagePoint"></el-table-column> |
| | | <el-table-column label="ä¿å
Ȍ
³é®é¨ä½" min-width="150" prop="maintenanceSite" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="ä¿å
Ȍ
容" min-width="180" prop="maintenanceContent" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="ä¿å
»å¨æ" min-width="100" prop="maintenanceIntervals"></el-table-column> |
| | | <el-table-column label="计åä¿å
»æ¶é´" min-width="130" prop="maintenanceDate" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column align="center" fixed="right" label="æä½" min-width="160"> |
| | | <template #default="scope"> |
| | | <el-button :disabled="scope.row.status === 1" size="small" link type="primary" |
| | | <el-button size="small" link type="primary" :disabled="planInfo.status === 1" |
| | | @click="handleForm('edit', scope.row)">ç¼è¾</el-button> |
| | | <el-button size="small" link type="primary" @click="handleForm('view', scope.row)">æ¥ç</el-button> |
| | | <el-button :disabled="scope.row.status === 1" size="small" link type="primary" |
| | | @click="tellApprove(scope.row.maintenancePlanId)">å®¡æ ¸éç¥</el-button> |
| | | <el-button :disabled="scope.row.status === 1 || userId != scope.row.auditId" size="small" link type="primary" |
| | | @click="handleForm('check', scope.row)">å®¡æ ¸</el-button> |
| | | <el-button size="small" link type="primary" @click="handleDownOne(scope.row.maintenancePlanId)">导åº</el-button> |
| | | <el-button :disabled="scope.row.status === 1" size="small" link type="danger" |
| | | @click="deleteFun(scope.row.maintenancePlanId)">å é¤</el-button> |
| | | <el-button size="small" link type="danger" :disabled="planInfo.status === 1" |
| | | @click="deleteRow(scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="pagination1.total" layout="->,total, sizes, prev, pager, next, jumper" background |
| | | @size-change="handleSizeChange1" @current-change="handleCurrentChange1"> |
| | | <el-pagination :current-page="pagination1.current" :page-size="pagination1.size" |
| | | :page-sizes="[10, 20, 30, 50, 100]" background :total="pagination1.total" |
| | | layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange1" |
| | | @current-change="handleCurrentChange1"> |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="applicationForm" |
| | | title="设å¤ä¿å
»è®¡å表" width="80%" @close="closeDialog"> |
| | | <div style="display: flex;align-items: center;"> |
| | | <el-button v-if="operationType === 'edit' || operationType === 'add'" size="small" type="primary" @click="addTableRow">æ·»å </el-button> |
| | | <span style="width: 60px;margin-left: 10px">年份ï¼</span> |
| | | <el-date-picker v-model="form.planYear" type="year" value-format="YYYY" clearable size="small" format="YYYY" |
| | | placeholder="鿩年" :disabled="operationType !== 'edit' && operationType !== 'add'"> |
| | | </el-date-picker> |
| | | </div> |
| | | <div style="margin: 10px 0"> |
| | | <el-table ref="yearTable" :data="deviceMaintenancePlanDetails" id="templateParamTable" row-key="deviceId" |
| | | border |
| | | height="560px" style="width: 100% ;"> |
| | | <el-table-column align="center" header-align="center" label="åºå·" type="index" width="60"></el-table-column> |
| | | <el-table-column label="设å¤åç§°" min-width="170" prop="deviceName"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.deviceName" :disabled="operationType !== 'edit' && operationType !== 'add'" clearable |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="dialogVisible" |
| | | title="设å¤ä¿å
»è®¡åæç»" width="60%" @close="resetForm"> |
| | | <el-form ref="modelForm" :model="form" :rules="rules" label-width="130px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设å¤åç§°ï¼"> |
| | | <el-input v-model="form.deviceName" disabled size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设å¤ç¼å·ï¼"> |
| | | <el-input v-model="form.deviceNumber" disabled size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å½å±å®éªå®¤ï¼"> |
| | | <el-input v-model="form.storagePoint" disabled size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¿å
»å¨æï¼"> |
| | | <el-input v-model="form.maintenanceIntervals" :disabled="operationType === 'view'" clearable |
| | | size="small"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="设å¤ç¼å·" min-width="140" prop="deviceNumber"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.deviceNumber" :disabled="operationType !== 'edit' && operationType !== 'add'" clearable |
| | | size="small"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å½å±å®éªå®¤" min-width="120" prop="storagePoint"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.storagePoint" :disabled="operationType !== 'edit' && operationType !== 'add'" clearable |
| | | size="small"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ä¿å
Ȍ
³é®é¨ä½" min-width="120" prop="maintenanceSite"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.maintenanceSite" :disabled="operationType !== 'edit' && operationType !== 'add'" clearable size="small" |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ä¿å
Ȍ
³é®é¨ä½ï¼"> |
| | | <el-input v-model="form.maintenanceSite" :disabled="operationType === 'view'" clearable size="small" |
| | | type="textarea"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ä¿å
Ȍ
容" min-width="120" prop="maintenanceContent"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.maintenanceContent" :disabled="operationType !== 'edit' && operationType !== 'add'" clearable |
| | | size="small" type="textarea"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ä¿å
»å¨æ" min-width="90" prop="maintenanceIntervals"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.maintenanceIntervals" :disabled="operationType !== 'edit' && operationType !== 'add'" clearable |
| | | size="small"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="计åä¿å
»æ¶é´" min-width="140" prop="maintenanceDate"> |
| | | <template #default="scope"> |
| | | <el-date-picker v-model="scope.row.maintenanceDate" :disabled="operationType !== 'edit' && operationType !== 'add'" clearable |
| | | size="small" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" style="width:100%"></el-date-picker> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="80" align="center" v-if="operationType === 'edit' || operationType === 'add'"> |
| | | <template #default="scope"> |
| | | <el-button link type="danger" @click="deleteRow(scope.$index)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ä¿å
Ȍ
容ï¼"> |
| | | <el-input v-model="form.maintenanceContent" :disabled="operationType === 'view'" clearable size="small" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="计åä¿å
»æ¶é´ï¼" prop="maintenanceDate"> |
| | | <el-date-picker v-model="form.maintenanceDate" :disabled="operationType === 'view'" clearable |
| | | format="YYYY-MM-DD" placeholder="éæ©æ¥æ" size="small" style="width:100%" type="date" |
| | | value-format="YYYY-MM-DD"></el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button @click="closeDialog">å æ¶</el-button> |
| | | <el-button v-if="operationType === 'edit' || operationType === 'add'" :loading="submitFormLoading" type="primary" @click="submitForm">ç¡® |
| | | 认</el-button> |
| | | <el-button v-if="operationType === 'check'" :loading="submitFormLoading" type="primary" |
| | | @click="checkStatus(0)">ä¸éè¿</el-button> |
| | | <el-button v-if="operationType === 'check'" :loading="submitFormLoading" type="primary" |
| | | @click="checkStatus(1)">é |
| | | è¿</el-button> |
| | | <el-button @click="resetForm">å æ¶</el-button> |
| | | <el-button :loading="submitFormLoading" type="primary" @click="submitForm" |
| | | v-if="operationType !== 'view'">确 认</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="addEquipDia" title="æ·»å 设å¤" |
| | | width="50%"> |
| | | <el-table ref="multipleTable" :data="equipOptions" tooltip-effect="dark" height="500" style="width: 100%" |
| | | border |
| | | @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column label="设å¤åç§°" prop="label" width="190"></el-table-column> |
| | | <el-table-column prop="value" label="设å¤ç¼å·" width="130"></el-table-column> |
| | | <el-table-column prop="managementNumber" label="å½å±å®éªå®¤"></el-table-column> |
| | | </el-table> |
| | | <el-dialog v-model="approvalDialog" title="å®¡æ ¸" width="30%" @close="approvalDialog = false"> |
| | | <span> |
| | | å®¡æ ¸ä¿¡æ¯ï¼ |
| | | <el-input v-model="approvalRemark" type="textarea"></el-input> |
| | | </span> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button @click="addEquipDia = false">å æ¶</el-button> |
| | | <el-button v-if="operationType === 'edit' || operationType === 'add'" :loading="submitFormLoading" type="primary" |
| | | @click="changeMachineName">ç¡® |
| | | 认</el-button> |
| | | <el-button :loading="approvalLoading" @click="handleApproval(0)">ä¸éè¿</el-button> |
| | | <el-button :loading="approvalLoading" type="primary" @click="handleApproval(1)">é è¿</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | | <el-dialog v-model="notificationDia" title="æäº¤å®¡æ ¸" width="30%" @close="closeNotificationDia"> |
| | | <span style="margin-top: 10px;display: inline-block"> |
| | | è¯·éæ©å®¡æ ¸äººï¼ |
| | | <el-select v-model="auditId" clearable filterable size="small" style="width: 90%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | <el-select v-model="auditUserId" clearable filterable size="small" style="width: 90%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </span> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import Sortable from "sortablejs"; |
| | | import { |
| | | selectDeviceMaintenancePlanByPage, |
| | | submitReviewMaintenancePlanStatus, |
| | | getMaintenancePlanDetail, |
| | | addMaintenancePlan, |
| | | updateMaintenancePlan, |
| | | getMaintenancePlanByYear, |
| | | pageMaintenancePlanDetail, |
| | | updateMaintenancePlanDetail, |
| | | deleteMaintenancePlanDetail, |
| | | exportDeviceMaintenancePlan, |
| | | deleteMaintenancePlan, |
| | | deviceScopeSearch, |
| | | reviewMaintenancePlanStatus, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import { formatDateOnly } from './dateFormat' |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | | export default { |
| | | name: "equipment-maintenance-plan", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | planYear: '', |
| | | yearOptions: [], |
| | | planInfo: {}, |
| | | searchForm: { |
| | | deviceName: '', |
| | | deviceNumber: '', |
| | | }, |
| | | tableData: [], |
| | | tableLoading: false, |
| | | pagination1: { |
| | | size: 10, |
| | | current: 1, |
| | | total: 0, |
| | | }, |
| | | yearTableDetailDataLoading: false, |
| | | yearTableDetailData: [], |
| | | deviceMaintenancePlanDetails: [], |
| | | selectionRows: [], |
| | | deviceIds: [], |
| | | applicationForm: false, |
| | | submitFormLoading: false, |
| | | dialogVisible: false, |
| | | operationType: '', |
| | | equipOptions: [], |
| | | form: { |
| | | planYear: '', |
| | | deviceMaintenancePlanDetails: [] |
| | | form: {}, |
| | | rules: { |
| | | maintenanceDate: [{ required: true, message: 'è¯·éæ©è®¡åä¿å
»æ¶é´', trigger: 'change' }], |
| | | }, |
| | | addEquipDia: false, |
| | | submitFormLoading: false, |
| | | outLoading: false, |
| | | responsibleOptions: [], |
| | | notificationDia: false, |
| | | notificationLoading: false, |
| | | auditId: '', |
| | | maintenancePlanId: '' |
| | | auditUserId: '', |
| | | approvalDialog: false, |
| | | approvalLoading: false, |
| | | approvalRemark: '', |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getYearTableDetailData() |
| | | this.loadYearOptions() |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | // æ¥è¯¢ |
| | | getYearTableDetailData() { |
| | | this.yearTableDetailDataLoading = true |
| | | selectDeviceMaintenancePlanByPage({ |
| | | current: this.pagination1.current, |
| | | size: this.pagination1.size, |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | this.yearTableDetailData = res.data.records |
| | | this.pagination1.total = res.data.total |
| | | // 年份䏿é项ï¼å·²æè®¡å年份 + å½å年份 |
| | | loadYearOptions() { |
| | | const currentYear = String(new Date().getFullYear()) |
| | | const finish = (years) => { |
| | | if (years.indexOf(currentYear) === -1) { |
| | | years.push(currentYear) |
| | | } |
| | | this.yearTableDetailDataLoading = false |
| | | }).catch(err => { |
| | | this.yearTableDetailDataLoading = false |
| | | this.yearOptions = [...new Set(years)].sort((a, b) => b.localeCompare(a)) |
| | | this.planYear = currentYear |
| | | this.loadPlan() |
| | | } |
| | | selectDeviceMaintenancePlanByPage({ |
| | | current: 1, |
| | | size: 99, |
| | | }).then(res => { |
| | | let years = [] |
| | | if (res.code == 200) { |
| | | years = (res.data.records || []).map(r => r.planYear).filter(Boolean) |
| | | } |
| | | finish(years) |
| | | }).catch(() => { |
| | | finish([]) |
| | | }) |
| | | }, |
| | | // æå¼æäº¤æ¹åå¼¹æ¡ |
| | | tellApprove(maintenancePlanId) { |
| | | this.getUserList() |
| | | this.notificationDia = true |
| | | this.maintenancePlanId = maintenancePlanId |
| | | // 忢年份 |
| | | handleYearChange() { |
| | | this.pagination1.current = 1 |
| | | this.loadPlan() |
| | | }, |
| | | // å
³éæäº¤æ¹åå¼¹æ¡ |
| | | closeNotificationDia() { |
| | | this.notificationDia = false |
| | | this.auditId = '' |
| | | // æ¥è¯¢å¹´ä»½è®¡åï¼ä¸åå¨èªå¨å建并补å
¨å°ç¹æç»ï¼ï¼éåå·æ°æç» |
| | | loadPlan() { |
| | | getMaintenancePlanByYear({ planYear: this.planYear }).then(res => { |
| | | if (res.code == 200) { |
| | | this.planInfo = res.data || {} |
| | | } |
| | | this.getTableList() |
| | | }).catch(() => { |
| | | this.planInfo = {} |
| | | this.tableData = [] |
| | | this.pagination1.total = 0 |
| | | this.tableLoading = false |
| | | }) |
| | | }, |
| | | // æäº¤æ¹åéç¥ |
| | | notification() { |
| | | if (!this.auditId) { |
| | | this.$message.warning('è¯·éæ©å®¡æ ¸äºº') |
| | | // æ¥è¯¢æ¡ä»¶åååä»ç¬¬ä¸é¡µå¼å§æ¥ |
| | | handleQuery() { |
| | | this.pagination1.current = 1 |
| | | this.getTableList() |
| | | }, |
| | | // æç»-æ¥è¯¢ |
| | | getTableList() { |
| | | if (!this.planInfo.maintenancePlanId) { |
| | | return |
| | | } |
| | | this.notificationLoading = true |
| | | submitReviewMaintenancePlanStatus({ |
| | | auditId: this.auditId, |
| | | maintenancePlanId: this.maintenancePlanId, |
| | | this.tableLoading = true |
| | | pageMaintenancePlanDetail({ |
| | | current: this.pagination1.current, |
| | | size: this.pagination1.size, |
| | | planId: this.planInfo.maintenancePlanId, |
| | | deviceName: this.searchForm.deviceName, |
| | | deviceNumber: this.searchForm.deviceNumber, |
| | | }).then(res => { |
| | | this.notificationLoading = false |
| | | if (res.code == 200) { |
| | | this.closeNotificationDia() |
| | | this.getYearTableDetailData() |
| | | this.tableData = res.data.records |
| | | this.pagination1.total = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | this.notificationLoading = false |
| | | this.tableLoading = false |
| | | }).catch(() => { |
| | | this.tableLoading = false |
| | | }) |
| | | }, |
| | | // æå¼æ°å¢åç¼è¾å¼¹æ¡ |
| | | handleForm(type, row) { |
| | | this.operationType = type |
| | | this.applicationForm = true |
| | | this.form = { |
| | | planYear: '', |
| | | deviceMaintenancePlanDetails: [], |
| | | } |
| | | this.deviceMaintenancePlanDetails = [] |
| | | if (row) { |
| | | this.maintenancePlanId = row.maintenancePlanId |
| | | getMaintenancePlanDetail({ maintenancePlanId: this.maintenancePlanId }).then(res => { |
| | | if (res.code === 200) { |
| | | this.form = res.data |
| | | this.deviceMaintenancePlanDetails = this.form.deviceMaintenancePlanDetails |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | | }) |
| | | } |
| | | this.getEquipOptions() |
| | | // å°ç¹éä¿å
»çè¡æ 红 |
| | | formatDateCell(row, column, cellValue) { |
| | | return formatDateOnly(cellValue) |
| | | }, |
| | | // æ·»å è®¾å¤ |
| | | addTableRow() { |
| | | this.addEquipDia = true |
| | | this.getEquipOptions() |
| | | tableRowClassName({ row }) { |
| | | return row.redFlag === 1 ? 'red-row' : '' |
| | | }, |
| | | handleSelectionChange(selection) { |
| | | this.selectionRows = selection |
| | | }, |
| | | // èµå¼ä»ªå¨ç¼å· |
| | | changeMachineName() { |
| | | this.deviceMaintenancePlanDetails = [] |
| | | this.selectionRows.map(val => { |
| | | this.deviceMaintenancePlanDetails.push({ deviceId: val.id, deviceName: val.label, deviceNumber: val.value, storagePoint: val.storagePoint }) |
| | | }) |
| | | this.addEquipDia = false |
| | | this.rowDrop() |
| | | }, |
| | | rowDrop() { |
| | | const that = this |
| | | const tbody = document.querySelector( |
| | | '#templateParamTable .el-table__body-wrapper tbody' |
| | | ) |
| | | if (!this.sortTable) { |
| | | this.sortTable = Sortable.create(tbody, { |
| | | animation: 200, //å¨ç»æ¶é¿ |
| | | handle: ".el-table__row", //坿æ½åºåclass |
| | | //ææ½ä¸äºä»¶ |
| | | onMove: ({ dragged, related }) => { |
| | | const oldRow = that.deviceMaintenancePlanDetails[dragged.rowIndex] //æ§ä½ç½®æ°æ® |
| | | const newRow = that.deviceMaintenancePlanDetails[related.rowIndex] //è¢«ææ½çæ°æ°æ® |
| | | }, |
| | | //ææ½ç»æäºä»¶ |
| | | onEnd: evt => { |
| | | const curRow = that.deviceMaintenancePlanDetails.splice(evt.oldIndex, 1)[0]; |
| | | that.deviceMaintenancePlanDetails.splice(evt.newIndex, 0, curRow); |
| | | reset() { |
| | | this.searchForm = { |
| | | deviceName: '', |
| | | deviceNumber: '', |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // å é¤è¡¨æ ¼è¡ |
| | | deleteRow(index) { |
| | | this.deviceMaintenancePlanDetails.splice(index, 1) |
| | | }, |
| | | // æäº¤æ°å¢åä¿®æ¹ |
| | | submitForm() { |
| | | this.form.deviceMaintenancePlanDetails = this.HaveJson(this.deviceMaintenancePlanDetails) |
| | | this.submitFormLoading = true |
| | | if (this.operationType === 'add') { |
| | | addMaintenancePlan(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.applicationForm = false |
| | | this.getYearTableDetailData() |
| | | } |
| | | this.submitFormLoading = false |
| | | }).catch(err => { |
| | | this.submitFormLoading = false |
| | | }) |
| | | } else { |
| | | updateMaintenancePlan(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.applicationForm = false |
| | | this.getYearTableDetailData() |
| | | } |
| | | this.submitFormLoading = false |
| | | }).catch(err => { |
| | | this.submitFormLoading = false |
| | | }) |
| | | } |
| | | }, |
| | | // æäº¤å®¡æ ¸ |
| | | checkStatus(status) { |
| | | const params = { |
| | | status: status, |
| | | maintenancePlanId: this.maintenancePlanId |
| | | } |
| | | addMaintenancePlan(params).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å®¡æ ¸æå') |
| | | this.applicationForm = false |
| | | this.getYearTableDetailData() |
| | | } |
| | | this.submitFormLoading = false |
| | | }).catch(err => { |
| | | this.submitFormLoading = false |
| | | }) |
| | | }, |
| | | closeDialog() { |
| | | this.applicationForm = false |
| | | this.getYearTableDetailData() |
| | | this.pagination1.current = 1 |
| | | this.getTableList() |
| | | }, |
| | | // å页 |
| | | handleSizeChange1(val) { |
| | | this.pagination1.size = val |
| | | this.getYearTableDetailData() |
| | | this.getTableList() |
| | | }, |
| | | // å页 |
| | | handleCurrentChange1(val) { |
| | | this.pagination1.current = val |
| | | this.getYearTableDetailData() |
| | | this.getTableList() |
| | | }, |
| | | handleDownOne(id) { |
| | | this.outLoading = true |
| | | exportDeviceMaintenancePlan({ maintenancePlanId: id }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设å¤ç»´æ¤ä¿å
»è®°å½.doc') |
| | | // æå¼æç»å¼¹æ¡ |
| | | handleForm(type, row) { |
| | | this.operationType = type |
| | | this.form = this.HaveJson(row) |
| | | this.dialogVisible = true |
| | | this.$nextTick(() => { |
| | | if (this.$refs.modelForm) { |
| | | this.$refs.modelForm.clearValidate() |
| | | } |
| | | }) |
| | | }, |
| | | // å é¤ |
| | | deleteFun(id) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | // æäº¤è¡¨åï¼åªåä¼ æç»è¡¨åæ®µï¼ |
| | | submitForm() { |
| | | this.$refs.modelForm.validate(valid => { |
| | | if (valid) { |
| | | this.submitFormLoading = true |
| | | const payload = { |
| | | maintenancePlanDetailId: this.form.maintenancePlanDetailId, |
| | | maintenancePlanId: this.form.maintenancePlanId, |
| | | deviceId: this.form.deviceId, |
| | | maintenanceSite: this.form.maintenanceSite, |
| | | maintenanceContent: this.form.maintenanceContent, |
| | | maintenanceIntervals: this.form.maintenanceIntervals, |
| | | maintenanceDate: this.form.maintenanceDate, |
| | | } |
| | | updateMaintenancePlanDetail(payload).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.dialogVisible = false |
| | | this.getTableList() |
| | | } |
| | | this.submitFormLoading = false |
| | | }).catch(() => { |
| | | this.submitFormLoading = false |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | resetForm() { |
| | | this.dialogVisible = false |
| | | }, |
| | | // æç»-å é¤ |
| | | deleteRow(row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ¡æç», æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteMaintenancePlan({ maintenancePlanId: id }).then(res => { |
| | | deleteMaintenancePlanDetail({ maintenancePlanDetailId: row.maintenancePlanDetailId }).then(() => { |
| | | this.$message.success('å 餿åï¼'); |
| | | this.getYearTableDetailData(); |
| | | this.getTableList() |
| | | }); |
| | | }).catch(() => { |
| | | this.$message({ |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | // è·åææè®¾å¤ |
| | | getEquipOptions() { |
| | | this.equipOptions = [] |
| | | deviceScopeSearch({ status: 0 }).then(res => { |
| | | if (res.code === 200 && res.data) { |
| | | this.equipOptions = res.data.map(m => { |
| | | m.value = m.managementNumber |
| | | m.label = m.deviceName |
| | | return m |
| | | }) |
| | | // æå¼æäº¤å®¡æ ¸å¼¹æ¡ |
| | | tellApprove() { |
| | | this.getUserList() |
| | | this.notificationDia = true |
| | | }, |
| | | // å
³éæäº¤å®¡æ ¸å¼¹æ¡ |
| | | closeNotificationDia() { |
| | | this.notificationDia = false |
| | | this.auditUserId = '' |
| | | }, |
| | | // æäº¤å®¡æ ¸éç¥ |
| | | notification() { |
| | | if (!this.auditUserId) { |
| | | this.$message.warning('è¯·éæ©å®¡æ ¸äºº') |
| | | return |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | | this.notificationLoading = true |
| | | submitReviewMaintenancePlanStatus({ |
| | | auditId: this.auditUserId, |
| | | maintenancePlanId: this.planInfo.maintenancePlanId, |
| | | }).then(res => { |
| | | this.notificationLoading = false |
| | | if (res.code == 200) { |
| | | this.closeNotificationDia() |
| | | this.loadPlan() |
| | | } |
| | | }).catch(() => { |
| | | this.notificationLoading = false |
| | | }) |
| | | }, |
| | | // æå¼å®¡æ ¸å¼¹æ¡ |
| | | handleApprove() { |
| | | this.approvalRemark = '' |
| | | this.approvalDialog = true |
| | | }, |
| | | // æäº¤å®¡æ ¸ç»æ |
| | | handleApproval(status) { |
| | | this.approvalLoading = true |
| | | reviewMaintenancePlanStatus({ |
| | | maintenancePlanId: this.planInfo.maintenancePlanId, |
| | | status: status, |
| | | auditRemark: this.approvalRemark, |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å®¡æ ¸æåï¼'); |
| | | this.approvalDialog = false |
| | | this.loadPlan() |
| | | } |
| | | this.approvalLoading = false |
| | | }).catch(() => { |
| | | this.approvalLoading = false |
| | | }) |
| | | }, |
| | | // å¯¼åº |
| | | handleDownOne() { |
| | | this.outLoading = true |
| | | exportDeviceMaintenancePlan({ maintenancePlanId: this.planInfo.maintenancePlanId }).then(res => { |
| | | this.outLoading = false |
| | | saveBlobOrShowError(res, '设å¤ä¿å
»è®¡å表.docx', 'application/msword') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | // è·åè´è´£äººä¿¡æ¯æ¥å£ |
| | | getUserList() { |
| | | selectUserCondition().then(res => { |
| | | if (res.code == 200) { |
| | | this.responsibleOptions = res.data |
| | | this.responsibleOptions = (res.data || []).map(item => ({ |
| | | label: item.name, |
| | | value: item.id, |
| | | })) |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | if (newVal.value) { |
| | | this.getYearTableDetailData(); |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userId"]), |
| | | // æ¯å¦å·²å®æå®¡æ ¸ï¼éè¿/ä¸éè¿ï¼ |
| | | isAudited() { |
| | | return this.planInfo.status === 0 || this.planInfo.status === 1; |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .title { |
| | | position: relative; |
| | | font-size: 16px; |
| | | color: var(--lims-text); |
| | | font-weight: 400; |
| | | padding-left: 10px; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .title::before { |
| | | position: absolute; |
| | | left: 0; |
| | | top: 4px; |
| | | content: ''; |
| | | width: 4px; |
| | | height: 16px; |
| | | background-color: var(--el-color-primary); |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | .plan-top { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | flex-wrap: wrap; |
| | | } |
| | | |
| | | .plan-top-left { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .title-search { |
| | | .plan-info-bar { |
| | | display: flex; |
| | | align-items: center; |
| | | margin: 10px 0; |
| | | flex-wrap: wrap; |
| | | gap: 32px; |
| | | background: #f5f7fa; |
| | | border-radius: 4px; |
| | | padding: 10px 16px; |
| | | margin-top: 14px; |
| | | font-size: 14px; |
| | | color: #606266; |
| | | } |
| | | |
| | | .search { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | :deep(.red-row td) { |
| | | background: #ffcccc !important; |
| | | } |
| | | </style> |
| | |
| | | <!-- <el-table-column label="仪å¨åç§°" min-width="150" prop="unitName"></el-table-column>--> |
| | | <!-- <el-table-column label="åå·" min-width="100" prop="address"></el-table-column>--> |
| | | <el-table-column label="é
ä»¶" min-width="150" prop="parts"></el-table-column> |
| | | <el-table-column label="ç¼å·" min-width="100" prop="number"></el-table-column> |
| | | <el-table-column label="ç¼å·" min-width="100"> |
| | | <template v-slot="scope">{{ scope.row.number || clickNodeVal.managementNumber || '-' }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="æ¥åºçç±" min-width="150" prop="reasonsForScrap"></el-table-column> |
| | | <!-- æä½æé® --> |
| | | <el-table-column align="center" fixed="right" label="æä½" min-width="120"> |
| | | <template #default="scope"> |
| | | <el-button :disabled="scope.row.ratifyStatus === 1" size="small" link type="primary" |
| | | <el-button :disabled="scope.row.isFinish === 1" size="small" link type="primary" |
| | | @click="handleForm(scope.row.scrappedId)">æä½</el-button> |
| | | <el-button size="small" link type="primary" @click="handleDownOne(scope.row.scrappedId)">导åº</el-button> |
| | | <el-button size="small" link type="danger" |
| | | <el-button :disabled="scope.row.isFinish === 1" size="small" link type="danger" |
| | | @click="deleteFun(scope.row.scrappedId)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | <el-pagination :current-page="pagination1.current" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="pagination1.total" layout="->,total, sizes, prev, pager, next, jumper" |
| | | @size-change="handleSizeChange1" @current-change="handleCurrentChange1" background> |
| | | </el-pagination> |
| | |
| | | exportDeviceScrapped, |
| | | delDeviceScrapped, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | | export default { |
| | | name: "equipment-scrap", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | |
| | | this.outLoading = true |
| | | exportDeviceScrapped({ scrappedId: id }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '仪å¨è®¾å¤æ¥åºç³è¯·è¡¨.doc') |
| | | saveBlobOrShowError(res, '仪å¨è®¾å¤æ¥åºç³è¯·è¡¨.doc', 'application/msword') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | // å é¤ |
| | |
| | | <template> |
| | | <!-- è®¾å¤æ ¸æ¥è®¡å--> |
| | | <div> |
| | | <div> |
| | | <div style="margin: 10px 0;display: flex;align-items: center;justify-content: space-between;"> |
| | | <div class="title"> |
| | | <span style="font-weight: bold">年度计å表</span> |
| | | </div> |
| | | <div style="display: flex;align-items: center;"> |
| | | <el-button size="small" type="primary" @click="getYearTableData">å·æ°</el-button> |
| | | <el-button size="small" type="primary" @click="addYearPlan('add')">æ°å¢</el-button> |
| | | <!-- <el-upload ref="upload" :action="action"--> |
| | | <!-- :before-upload="beforeUpload" :headers="uploadHeader" :on-error="onError"--> |
| | | <!-- :on-success="handleSuccessUp" :show-file-list="false" accept='.xls,.xlsx'>--> |
| | | <!-- <el-button :loading="upLoading" size="small" type="primary">导å
¥</el-button>--> |
| | | <!-- </el-upload>--> |
| | | </div> |
| | | <div style="margin: 10px 0 14px;"> |
| | | <div class="plan-top"> |
| | | <div class="plan-top-left"> |
| | | <span class="title" style="margin-bottom: 0;">{{ planInfo.planName || (planYear + 'å¹´åº¦è®¾å¤æ ¸æ¥è®¡å') }}</span> |
| | | <el-select v-model="planYear" size="small" style="width: 110px; margin-left: 16px;" @change="handleYearChange"> |
| | | <el-option v-for="y in yearOptions" :key="y" :label="y" :value="y"></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div> |
| | | <el-table ref="yearTable" v-loading="yearTableDataLoading" :data="yearTableData" |
| | | height="calc(60vh - 16em)" |
| | | border |
| | | highlight-current-row @current-change="currentChange"> |
| | | <!-- è¡¨æ ¼å --> |
| | | <el-table-column align="center" header-align="center" label="åºå·" prop="prop" type="index" |
| | | width="70"></el-table-column> |
| | | <el-table-column label="年份" min-width="80" prop="planYear"></el-table-column> |
| | | <el-table-column label="计ååç§°" min-width="180" prop="planName" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="ç¼å¶äºº" min-width="100" prop="writeName"></el-table-column> |
| | | <el-table-column label="ç¼å¶æ¥æ" min-width="160" prop="writeTime"></el-table-column> |
| | | <el-table-column label="æ¹åç¶æ" min-width="100" prop="ratifyStatus"> |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.ratifyStatus === 1" type="success">æ¹å</el-tag> |
| | | <el-tag v-if="scope.row.ratifyStatus === 0" type="danger">䏿¹å</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æ¹åå
容" min-width="150" prop="ratifyRemark"></el-table-column> |
| | | <el-table-column label="æ¹å人" min-width="100" prop="ratifyName"></el-table-column> |
| | | <el-table-column label="æ¹åæ¶é´" min-width="150" prop="ratifyTime"></el-table-column> |
| | | <!-- æä½æé® --> |
| | | <el-table-column align="center" fixed="right" label="æä½" min-width="240"> |
| | | <template #default="scope"> |
| | | <el-button :disabled="scope.row.ratifyStatus === 1" size="small" link type="primary" |
| | | @click="addYearPlan('edit', scope.row)">ç¼è¾</el-button> |
| | | <el-button :disabled="scope.row.ratifyStatus === 1" size="small" link type="primary" |
| | | @click="tellApprove(scope.row.planId)">æ¹åéç¥</el-button> |
| | | <el-button :disabled="scope.row.ratifyStatus === 1 || userId != scope.row.ratifyUserId" size="small" |
| | | link type="primary" @click="handleApprove(scope.row.planId)">æ¹å</el-button> |
| | | <el-button size="small" link type="primary" @click="downLoadPost(scope.row.planId)">导åº</el-button> |
| | | <el-button :disabled="scope.row.ratifyStatus === 1" size="small" link type="danger" |
| | | @click="deleteFun(scope.row.planId)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="pagination.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | background :total="pagination.total" layout="->,total, sizes, prev, pager, next, jumper" |
| | | @size-change="handleSizeChange" @current-change="handleCurrentChange"> |
| | | </el-pagination> |
| | | <el-button size="small" type="primary" @click="loadPlan">å·æ°</el-button> |
| | | <el-button size="small" type="primary" :disabled="planInfo.ratifyStatus === 1" |
| | | @click="tellApprove">æ¹åéç¥</el-button> |
| | | <el-button size="small" type="primary" |
| | | :disabled="planInfo.ratifyStatus === 1 || userId != planInfo.ratifyUserId" @click="handleApprove">æ¹å</el-button> |
| | | <el-button size="small" type="primary" @click="downLoadPost">导åº</el-button> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <div class="title"> |
| | | <span style="font-weight: bold">年度计åæç»è¡¨</span> |
| | | <div class="plan-info-bar"> |
| | | <span>ç¼å¶äººï¼{{ planInfo.writeName || 'â' }}</span> |
| | | <span>ç¼å¶æ¥æï¼{{ planInfo.writeTimeStr || 'â' }}</span> |
| | | <span v-if="planInfo.ratifyStatus === 1">æ¹åç¶æï¼<el-tag type="success">æ¹å</el-tag></span> |
| | | <span v-else-if="planInfo.ratifyStatus === 0">æ¹åç¶æï¼<el-tag type="danger">䏿¹å</el-tag></span> |
| | | <span v-if="planInfo.ratifyRemark">æ¹åå
容ï¼{{ planInfo.ratifyRemark }}</span> |
| | | <span v-if="isRatified && planInfo.ratifyName">æ¹å人ï¼{{ planInfo.ratifyName }}</span> |
| | | <span v-if="isRatified && planInfo.ratifyTimeStr">æ¹åæ¶é´ï¼{{ planInfo.ratifyTimeStr }}</span> |
| | | </div> |
| | | </div> |
| | | <div class="search"> |
| | | <div> |
| | | <el-form :model="searchForm" ref="searchForm" size="small" :inline="true"> |
| | | <el-form-item label="设å¤ç¼å·" prop="deviceNumber"> |
| | | <el-input v-model="searchForm.deviceNumber" clearable size="small" |
| | | @keyup.enter="getYearTableDetailData(currentRow)"></el-input> |
| | | @keyup.enter="handleQuery"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤åç§°" prop="deviceName"> |
| | | <el-input v-model="searchForm.deviceName" clearable size="small" |
| | | @keyup.enter="getYearTableDetailData(currentRow)"></el-input> |
| | | @keyup.enter="handleQuery"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" size="small" @click="getYearTableDetailData(currentRow)">æ¥è¯¢</el-button> |
| | | <el-button type="primary" size="small" @click="handleQuery">æ¥è¯¢</el-button> |
| | | <el-button size="small" @click="reset">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div> |
| | | <el-button size="small" type="primary" @click="handleForm('add')">æ°å¢</el-button> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <el-table ref="yearTableDetailData" v-loading="yearTableDetailDataLoading" :data="yearTableDetailData" |
| | | border |
| | | :height="'calc(100vh - 34em)'" style="width: 100% ;"> |
| | | <el-table ref="yearTableDetailData" v-loading="yearTableDetailDataLoading" :data="yearTableDetailData" border |
| | | :row-class-name="tableRowClassName" :height="'calc(100vh - 29em)'" style="width: 100%;"> |
| | | <!-- è¡¨æ ¼å --> |
| | | <el-table-column align="center" header-align="center" label="åºå·" prop="prop" type="index" |
| | | width="70"></el-table-column> |
| | | <el-table-column label="设å¤ç¼å·" min-width="180" prop="deviceNumber"></el-table-column> |
| | | <el-table-column label="设å¤ç¼å·" min-width="170" prop="deviceNumber"></el-table-column> |
| | | <el-table-column label="设å¤åç§°" min-width="180" prop="deviceName" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="æ ¸æ¥æ¶é´" min-width="150" prop="checkTime"></el-table-column> |
| | | <el-table-column label="æ ¸æ¥ææ " min-width="150" prop="checkIndex"> </el-table-column> |
| | | <el-table-column label="æ ¸æ¥æ¹æ³" min-width="150" prop="checkMethod"></el-table-column> |
| | | <el-table-column label="ç»æå¦ä½å¤å®" min-width="150" prop="howResults"></el-table-column> |
| | | <el-table-column label="æ ¸æ¥è´è´£äºº" min-width="150" prop="checkChargerUser"></el-table-column> |
| | | <el-table-column label="æ ¸æ¥æ¶é´" min-width="120" prop="checkTime" |
| | | :formatter="formatCheckMonth"></el-table-column> |
| | | <el-table-column label="æ ¸æ¥ææ " min-width="140" prop="checkIndex"> </el-table-column> |
| | | <el-table-column label="æ ¸æ¥æ¹æ³" min-width="140" prop="checkMethod" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="ç»æå¦ä½å¤å®" min-width="140" prop="howResults" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="æ ¸æ¥è´è´£äºº" min-width="120" prop="checkChargerUser"></el-table-column> |
| | | <el-table-column label="è®°å½ç¶æ" min-width="100" prop="recordStatus"> |
| | | <template #default="scope"> |
| | | <el-tag type="" v-if="scope.row.recordStatus === 0" disable-transitions>æªå¼å§</el-tag> |
| | |
| | | <el-tag type="danger" v-if="scope.row.recordContrastStatus === 3" disable-transitions>ä¸éè¿</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="夿³¨" min-width="150" prop="remark"></el-table-column> |
| | | <el-table-column label="夿³¨" min-width="130" prop="remark"></el-table-column> |
| | | <!-- æä½æé® --> |
| | | <el-table-column align="center" fixed="right" label="æä½" min-width="260"> |
| | | <template #default="scope"> |
| | | <el-button size="small" link type="primary" @click="handleForm('edit', scope.row)">ç¼è¾</el-button> |
| | | <el-button size="small" link type="primary" :disabled="planInfo.ratifyStatus === 1" |
| | | @click="handleForm('edit', scope.row)">ç¼è¾</el-button> |
| | | <el-button size="small" link type="primary" @click="handleForm('view', scope.row)">æ¥ç</el-button> |
| | | <el-button size="small" link type="primary" @click="handleRecord(scope.row)">è®°å½</el-button> |
| | | <el-button size="small" link type="primary" @click="handleCheck(scope.row)">对æ¯</el-button> |
| | | <el-button size="small" link type="primary" @click="handleDown(scope.row)">导åº</el-button> |
| | | <el-button size="small" link type="danger" |
| | | <el-button size="small" link type="danger" :disabled="planInfo.ratifyStatus === 1" |
| | | @click="deleteFun1(scope.row.planDetailsId)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="pagination1.total" layout="->,total, sizes, prev, pager, next, jumper" background |
| | | <el-pagination :current-page="pagination1.current" :page-size="pagination1.size" |
| | | :page-sizes="[10, 20, 30, 50, 100]" :total="pagination1.total" |
| | | layout="->,total, sizes, prev, pager, next, jumper" background |
| | | @size-change="handleSizeChange1" @current-change="handleCurrentChange1"> |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="dialogVisible" title="è®¾å¤æ ¸æ¥è®¡å" |
| | | width="80%" @close="resetForm"> |
| | |
| | | <el-form-item label="æ ¸æ¥è´£ä»»äººï¼" prop="checkChargerUserId"> |
| | | <el-select v-model="form.checkChargerUserId" @change="setCheckChargerUser" |
| | | :disabled="operationType === 'view'" placeholder="è¯·éæ©" size="small" style="width: 100%"> |
| | | <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option> |
| | | <el-option v-for="item in chargerOptions" :key="item.id" :label="item.name" :value="item.id"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-form> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button @click="resetForm">å æ¶</el-button> |
| | | <el-button :loading="submitFormLoading" type="primary" @click="submitForm" v-if="operationType !== 'view'">ç¡® |
| | | 认</el-button> |
| | | <el-button :loading="submitFormLoading" type="primary" @click="submitForm" |
| | | v-if="operationType !== 'view'">确 认</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | | <el-dialog v-model="approvalDialog" title="æ¹å" width="30%" @close="approvalDialog = false"> |
| | |
| | | </el-dialog> |
| | | <el-dialog v-model="downloadDialog" title="导åº" width="600px"> |
| | | <span> |
| | | <el-button :loading="outLoading" type="primary" :disabled="!downRow.recordStatus" @click="controlDown">æ ¸æ¥è®°å½</el-button> |
| | | <el-button :loading="outLoading" type="primary" :disabled="!downRow.recordContrastStatus" @click="processingDown">æ ¸æ¥æ¯å¯¹è®°å½</el-button> |
| | | <el-button :loading="outLoading" type="primary" :disabled="!downRow.recordStatus" |
| | | @click="controlDown">æ ¸æ¥è®°å½</el-button> |
| | | <el-button :loading="outLoading" type="primary" :disabled="!downRow.recordContrastStatus" |
| | | @click="processingDown">æ ¸æ¥æ¯å¯¹è®°å½</el-button> |
| | | </span> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button @click="downloadDialog = false">å æ¶</el-button> |
| | |
| | | </el-dialog> |
| | | <equipment-check v-if="equipmentCheck" ref="equipmentCheck" @closeDialog="closeDialog"></equipment-check> |
| | | <check-record v-if="checkRecord" ref="checkRecord" @closeDialog1="closeDialog1"></check-record> |
| | | <add-verification-year-plan-dia v-if="addYearPlanDia" ref="addYearPlanDia" |
| | | @closeDia="closeDia"></add-verification-year-plan-dia> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import EquipmentCheck from "./equipmentCheck.vue"; |
| | | import CheckRecord from "./checkRecord.vue"; |
| | | import AddVerificationYearPlanDia from "./addVerificationYearPlanDia.vue"; |
| | | import { |
| | | pageDeviceExaminePlan, |
| | | getExaminePlanByYear, |
| | | submitRatifyDeviceExaminePlan, |
| | | exportDeviceExaminePlanDetail, |
| | | delDeviceExaminePlan, |
| | | delDeviceExaminePlanDetail, |
| | | pageDeviceExaminePlanDetail, |
| | | addDeviceExaminePlanDetail, |
| | | updateDeviceExaminePlanDetail, |
| | | ratifyDeviceExaminePlan, |
| | | exportReviewExamineRecordDetail, |
| | |
| | | import { selectUserCondition } from "@/api/performance/class"; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | import { formatListDate } from './dateFormat' |
| | | export default { |
| | | name: "equipment-verification-plan", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: { AddVerificationYearPlanDia, CheckRecord, EquipmentCheck }, |
| | | components: { CheckRecord, EquipmentCheck }, |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | upLoading: false, |
| | | planYear: '', |
| | | yearOptions: [], |
| | | planInfo: {}, |
| | | dialogVisible: false, |
| | | searchForm: { |
| | | deviceName: '', |
| | | deviceNumber: '', |
| | | }, |
| | | yearTableData: [], |
| | | yearTableDetailData: [], |
| | | pagination: { |
| | | size: 10, |
| | | current: 1, |
| | | total: 0, |
| | | }, |
| | | pagination1: { |
| | | size: 10, |
| | | current: 1, |
| | |
| | | deviceNumber: [{ required: true, message: '请填å设å¤ç¼å·', trigger: 'blur' }], |
| | | checkMethod: [{ required: true, message: 'è¯·å¡«åæ ¸æ¥æ¹æ³', trigger: 'blur' }], |
| | | }, |
| | | yearTableDataLoading: false, |
| | | yearTableDetailDataLoading: false, |
| | | currentRow: {}, |
| | | approvalDialog: false, |
| | | approvalLoading: false, |
| | | submitFormLoading: false, |
| | |
| | | userList: [], |
| | | equipmentCheck: false, |
| | | checkRecord: false, |
| | | addYearPlanDia: false, |
| | | downloadDialog: false, |
| | | outLoading: false, |
| | | downRow: {}, |
| | |
| | | notificationDia: false, |
| | | notificationLoading: false, |
| | | ratifyUserId: '', |
| | | planId: '' |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getYearTableData() |
| | | this.loadYearOptions() |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | // æ¥è¯¢å¹´åº¦è®¡å表 |
| | | getYearTableData() { |
| | | this.yearTableDataLoading = true |
| | | // 年份䏿é项ï¼å·²æè®¡å年份 + å½å年份 |
| | | loadYearOptions() { |
| | | pageDeviceExaminePlan({ |
| | | current: 1, |
| | | size: 99, |
| | | }).then(res => { |
| | | let years = [] |
| | | if (res.code == 200) { |
| | | this.yearTableData = res.data.records |
| | | this.pagination.total = res.data.total |
| | | if (this.yearTableData.length > 0) { |
| | | this.currentRow = this.yearTableData[0] |
| | | this.$refs.yearTable.setCurrentRow(this.currentRow) |
| | | years = (res.data.records || []).map(r => r.planYear).filter(Boolean) |
| | | } |
| | | const currentYear = String(new Date().getFullYear()) |
| | | if (years.indexOf(currentYear) === -1) { |
| | | years.push(currentYear) |
| | | } |
| | | this.yearTableDataLoading = false |
| | | this.yearOptions = [...new Set(years)].sort((a, b) => b.localeCompare(a)) |
| | | this.planYear = currentYear |
| | | this.loadPlan() |
| | | }) |
| | | }, |
| | | // 忢年份 |
| | | handleYearChange() { |
| | | this.pagination1.current = 1 |
| | | this.loadPlan() |
| | | }, |
| | | // æ¥è¯¢å¹´ä»½è®¡åï¼ä¸åå¨èªå¨å建并补å
¨å°ç¹æç»ï¼ï¼éåå·æ°æç» |
| | | loadPlan() { |
| | | getExaminePlanByYear({ planYear: this.planYear }).then(res => { |
| | | if (res.code == 200) { |
| | | this.planInfo = res.data || {} |
| | | } |
| | | this.getYearTableDetailData() |
| | | }).catch(() => { |
| | | this.planInfo = {} |
| | | this.yearTableDetailData = [] |
| | | this.pagination1.total = 0 |
| | | this.yearTableDetailDataLoading = false |
| | | }) |
| | | }, |
| | | // æ¥è¯¢æ¡ä»¶åååä»ç¬¬ä¸é¡µå¼å§æ¥ |
| | | handleQuery() { |
| | | this.pagination1.current = 1 |
| | | this.getYearTableDetailData() |
| | | }, |
| | | // æç»-æ¥è¯¢ |
| | | getYearTableDetailData() { |
| | | if (!this.planInfo.planId) { |
| | | return |
| | | } |
| | | this.yearTableDetailDataLoading = true |
| | | pageDeviceExaminePlanDetail({ |
| | | current: this.pagination1.current, |
| | | size: this.pagination1.size, |
| | | planId: this.planInfo.planId, |
| | | deviceName: this.searchForm.deviceName, |
| | | deviceNumber: this.searchForm.deviceNumber, |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | this.yearTableDetailData = res.data.records |
| | | this.pagination1.total = res.data.total |
| | | } |
| | | this.yearTableDetailDataLoading = false |
| | | }).catch(err => { |
| | | this.yearTableDataLoading = false |
| | | this.yearTableDetailDataLoading = false |
| | | }) |
| | | }, |
| | | // å页 |
| | | handleSizeChange(val) { |
| | | this.pagination.size = val |
| | | this.getYearTableData() |
| | | // å°ç¹éæ ¸æ¥çè¡æ 红 |
| | | // æ ¸æ¥æ¶é´ææä»½æ¾ç¤ºï¼å
¼å®¹å岿°æ®ä¸ç宿´æ¥æï¼ |
| | | formatCheckMonth(row, column, cellValue) { |
| | | if (cellValue === null || cellValue === undefined || cellValue === '') { |
| | | return cellValue |
| | | } |
| | | const str = String(cellValue).trim().replace(/[./]/g, '-') |
| | | const matched = str.match(/^(\d{4})-(\d{1,2})/) |
| | | if (matched) { |
| | | return `${matched[1]}-${matched[2].padStart(2, '0')}` |
| | | } |
| | | const formatted = formatListDate(str) |
| | | const fallback = String(formatted).match(/^(\d{4})-(\d{1,2})/) |
| | | return fallback ? `${fallback[1]}-${fallback[2].padStart(2, '0')}` : cellValue |
| | | }, |
| | | tableRowClassName({ row }) { |
| | | return row.redFlag === 1 ? 'red-row' : '' |
| | | }, |
| | | reset() { |
| | | this.searchForm = { |
| | | deviceName: '', |
| | | deviceNumber: '', |
| | | } |
| | | this.pagination1.current = 1 |
| | | this.getYearTableDetailData() |
| | | }, |
| | | // å页 |
| | | handleCurrentChange(val) { |
| | | this.pagination.current = val |
| | | this.getYearTableData() |
| | | handleSizeChange1(val) { |
| | | this.pagination1.size = val |
| | | this.getYearTableDetailData() |
| | | }, |
| | | // æå¼æ°å¢å¼¹æ¡ |
| | | addYearPlan(type, row) { |
| | | this.addYearPlanDia = true |
| | | // å页 |
| | | handleCurrentChange1(val) { |
| | | this.pagination1.current = val |
| | | this.getYearTableDetailData() |
| | | }, |
| | | // æå¼æç»å¼¹æ¡ |
| | | handleForm(type, row) { |
| | | this.getUserList() |
| | | this.operationType = type |
| | | this.dialogVisible = true |
| | | this.form.planId = this.planInfo.planId |
| | | this.$nextTick(() => { |
| | | this.$refs.addYearPlanDia.openDialog(type, row) |
| | | this.form = this.HaveJson(row) |
| | | if (this.operationType !== 'view') { |
| | | this.draftRestore('equipmentVerificationPlan', 'form', this.form.planDetailsId, 'dialogVisible') |
| | | } |
| | | }) |
| | | }, |
| | | closeDia() { |
| | | this.addYearPlanDia = false |
| | | this.getYearTableData() |
| | | // æäº¤è¡¨å |
| | | submitForm() { |
| | | this.$refs.modelForm.validate(valid => { |
| | | if (valid) { |
| | | this.submitFormLoading = true |
| | | updateDeviceExaminePlanDetail(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.draftClear('equipmentVerificationPlan') |
| | | this.dialogVisible = false |
| | | this.getYearTableDetailData() |
| | | } |
| | | this.submitFormLoading = false |
| | | }).catch(err => { |
| | | this.submitFormLoading = false |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // æç»-å é¤ |
| | | deleteFun1(id) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ¡æç», æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delDeviceExaminePlanDetail({ planDetailsId: id }).then(res => { |
| | | this.$message.success('å 餿åï¼'); |
| | | this.getYearTableDetailData() |
| | | }); |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | // æå¼æäº¤æ¹åå¼¹æ¡ |
| | | tellApprove(planId) { |
| | | tellApprove() { |
| | | this.getUserList1() |
| | | this.notificationDia = true |
| | | this.planId = planId |
| | | }, |
| | | // å
³éæäº¤æ¹åå¼¹æ¡ |
| | | closeNotificationDia() { |
| | |
| | | this.notificationLoading = true |
| | | submitRatifyDeviceExaminePlan({ |
| | | ratifyUserId: this.ratifyUserId, |
| | | planId: this.planId, |
| | | planId: this.planInfo.planId, |
| | | }).then(res => { |
| | | this.notificationLoading = false |
| | | if (res.code == 200) { |
| | | this.closeNotificationDia() |
| | | this.getYearTableData() |
| | | this.loadPlan() |
| | | } |
| | | }).catch(err => { |
| | | this.notificationLoading = false |
| | | }) |
| | | }, |
| | | // 年度计å表-æ¹å |
| | | handleApprove(id) { |
| | | this.currentRowId = id |
| | | // æ¹å |
| | | handleApprove() { |
| | | this.currentRowId = this.planInfo.planId |
| | | this.approvalDialog = true |
| | | }, |
| | | // 年度计å表-å¯¼åº |
| | | downLoadPost(planId) { |
| | | exportDeviceExaminePlanDetail({ planId }).then(res => { |
| | | const blob = new Blob([res], { type: 'application/msword' }); |
| | | this.$download.saveAs(blob, '仪å¨è®¾å¤æé´æ ¸æ¥è®¡å表.docx') |
| | | }) |
| | | }, |
| | | // 年度计å表-å é¤ |
| | | deleteFun(id) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delDeviceExaminePlan({ planId: id }).then(res => { |
| | | this.$message.success('å 餿åï¼'); |
| | | this.getYearTableData(); |
| | | }); |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | // 年度计å详æ
表-å é¤ |
| | | deleteFun1(id) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delDeviceExaminePlanDetail({ planDetailsId: id }).then(res => { |
| | | this.$message.success('å 餿åï¼'); |
| | | this.getYearTableDetailData(this.currentRow) |
| | | }); |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | currentChange(row) { |
| | | this.currentRow = row |
| | | this.getYearTableDetailData(this.currentRow) |
| | | }, |
| | | getYearTableDetailData(row) { |
| | | this.yearTableDetailDataLoading = true |
| | | pageDeviceExaminePlanDetail({ |
| | | current: this.pagination1.current, |
| | | size: this.pagination1.size, |
| | | planId: row.planId, |
| | | deviceName: this.searchForm.deviceName, |
| | | deviceNumber: this.searchForm.deviceNumber, |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | this.yearTableDetailData = res.data.records |
| | | this.pagination1.total = res.data.total |
| | | } |
| | | this.yearTableDetailDataLoading = false |
| | | }).catch(err => { |
| | | this.yearTableDetailDataLoading = false |
| | | }) |
| | | }, |
| | | reset() { |
| | | this.searchForm = { |
| | | deviceName: '', |
| | | deviceNumber: '', |
| | | } |
| | | this.getYearTableDetailData(this.currentRow) |
| | | }, |
| | | // å页 |
| | | handleSizeChange1(val) { |
| | | this.pagination1.size = val |
| | | this.getYearTableDetailData(this.currentRow) |
| | | }, |
| | | // å页 |
| | | handleCurrentChange1(val) { |
| | | this.pagination1.current = val |
| | | this.getYearTableDetailData(this.currentRow) |
| | | }, |
| | | // æå¼å¼¹æ¡ |
| | | handleForm(type, row) { |
| | | this.getUserList() |
| | | this.operationType = type |
| | | this.dialogVisible = true |
| | | this.form.planId = this.currentRow.planId |
| | | if (this.operationType !== 'add') { |
| | | this.$nextTick(() => { |
| | | this.form = this.HaveJson(row) |
| | | if (this.operationType !== 'view') { |
| | | this.draftRestore('equipmentVerificationPlan', 'form', this.form.planDetailsId, 'dialogVisible') |
| | | } |
| | | }) |
| | | } else { |
| | | this.form = { |
| | | deviceNumber: '', |
| | | deviceName: '', |
| | | checkTime: '', |
| | | checkIndex: '', |
| | | checkMethod: '', |
| | | howResults: '', |
| | | checkChargerUserId: '', |
| | | checkChargerUser: '', |
| | | remark: '', |
| | | planId: this.currentRow.planId, |
| | | planDetailsId: '', |
| | | } |
| | | this.draftRestore('equipmentVerificationPlan', 'form', this.form.planId, 'dialogVisible') |
| | | } |
| | | }, |
| | | // æäº¤è¡¨å |
| | | submitForm() { |
| | | this.$refs.modelForm.validate(valid => { |
| | | if (valid) { |
| | | if (this.operationType === 'add') { |
| | | this.submitFormLoading = true |
| | | addDeviceExaminePlanDetail(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('equipmentVerificationPlan') |
| | | this.dialogVisible = false |
| | | this.getYearTableData() |
| | | } |
| | | this.submitFormLoading = false |
| | | }).catch(err => { |
| | | this.submitFormLoading = false |
| | | }) |
| | | } else { |
| | | this.submitFormLoading = true |
| | | updateDeviceExaminePlanDetail(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('equipmentVerificationPlan') |
| | | this.dialogVisible = false |
| | | this.getYearTableData() |
| | | } |
| | | this.submitFormLoading = false |
| | | }).catch(err => { |
| | | this.submitFormLoading = false |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // æäº¤æ¹å |
| | | // æäº¤æ¹åç»æ |
| | | handleApproval(status) { |
| | | const personTrainingUpdateDto = { |
| | | planId: this.currentRowId, |
| | |
| | | if (res.code === 200) { |
| | | this.$message.success('æäº¤æåï¼'); |
| | | this.approvalDialog = false |
| | | this.getYearTableData(); |
| | | this.loadPlan() |
| | | } |
| | | this.approvalLoading = false |
| | | }).catch(() => { |
| | | this.approvalLoading = false |
| | | }) |
| | | }, |
| | | // 导åºå¹´åº¦è®¡å表 |
| | | downLoadPost() { |
| | | exportDeviceExaminePlanDetail({ planId: this.planInfo.planId }).then(res => { |
| | | this.saveDocx(res, '仪å¨è®¾å¤æé´æ ¸æ¥è®¡å表.docx') |
| | | }).catch(() => { }) |
| | | }, |
| | | resetForm() { |
| | | this.draftStop('equipmentVerificationPlan') |
| | |
| | | // å
³é对æ¯å¼¹æ¡ |
| | | closeDialog() { |
| | | this.equipmentCheck = false |
| | | this.getYearTableDetailData(this.currentRow) |
| | | this.getYearTableDetailData() |
| | | }, |
| | | // æå¼è®°å½å¼¹æ¡ |
| | | handleRecord(row) { |
| | |
| | | // å
³éè®°å½å¼¹æ¡ |
| | | closeDialog1() { |
| | | this.checkRecord = false |
| | | this.getYearTableDetailData(this.currentRow) |
| | | this.getYearTableDetailData() |
| | | }, |
| | | // æå¼å¯¼åºå¼¹æ¡ |
| | | handleDown(row) { |
| | |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | // 导å
¥æµç¨ |
| | | beforeUpload(file) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M'); |
| | | this.$refs.upload.clearFiles() |
| | | return false; |
| | | } else { |
| | | this.upLoading = true; |
| | | return true; |
| | | } |
| | | }, |
| | | onError(err, file, fileList) { |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | | handleSuccessUp(response) { |
| | | this.upLoading = false; |
| | | if (response.code == 200) { |
| | | this.$message.success('ä¸ä¼ æå'); |
| | | this.getYearTableData() |
| | | } else { |
| | | this.$message.error(response.message) |
| | | } |
| | | }, |
| | | getUserList() { |
| | | selectUserCondition().then(res => { |
| | | this.userList = res.data |
| | |
| | | }); |
| | | } |
| | | }, |
| | | // ç¨äºä¸ä¼ æä»¶çä¿¡æ¯ |
| | | computed: { |
| | | action() { |
| | | return this.javaApi + '/deviceExaminePlan/importDeviceExaminePlan' |
| | | }, |
| | | ...mapGetters(["userId"]), |
| | | // æ¯å¦å·²å®æå®¡æ¹ï¼æ¹å/䏿¹åï¼ |
| | | isRatified() { |
| | | return this.planInfo.ratifyStatus === 0 || this.planInfo.ratifyStatus === 1; |
| | | }, |
| | | // è´£ä»»äººä¸æï¼å·²ä¿åç责任人ä¸å¨åéå表æ¶è¡¥ä¸æ¡ï¼é¿å
åæ¾æç¨æ·ID |
| | | chargerOptions() { |
| | | const list = this.userList || [] |
| | | const id = this.form.checkChargerUserId |
| | | if (id && !list.some(item => String(item.id) === String(id))) { |
| | | return [...list, { id, name: this.form.checkChargerUser || String(id) }] |
| | | } |
| | | return list |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .search { |
| | | height: 46px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .title { |
| | | position: relative; |
| | | font-size: 16px; |
| | |
| | | background-color: var(--el-color-primary); |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | .plan-top { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | flex-wrap: wrap; |
| | | } |
| | | |
| | | .plan-top-left { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .plan-info-bar { |
| | | display: flex; |
| | | align-items: center; |
| | | flex-wrap: wrap; |
| | | gap: 32px; |
| | | background: #f5f7fa; |
| | | border-radius: 4px; |
| | | padding: 10px 16px; |
| | | margin-top: 14px; |
| | | font-size: 14px; |
| | | color: #606266; |
| | | } |
| | | |
| | | :deep(.red-row td) { |
| | | background: #ffcccc !important; |
| | | } |
| | | </style> |
| | |
| | | <el-step title="ç³è¯·é¨é¨è´è´£äººæè§" @click="setStep(1)"></el-step> |
| | | <el-step title="维修记å½" @click="setStep(2)"></el-step> |
| | | </el-steps> |
| | | <el-form ref="modelForm" :model="form" :rules="rules" label-width="160px"> |
| | | <el-form ref="modelForm" :model="form" :rules="rules" label-width="160px" :disabled="!canOperate"> |
| | | <el-col v-if="showStep === 0" :span="12"> |
| | | <el-form-item label="å®è£
å°ç¹ï¼" prop="location"> |
| | | <el-input v-model="form.location" :disabled="currentStep !== 0" clearable size="small"></el-input> |
| | |
| | | </el-form> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button @click="resetForm">å æ¶</el-button> |
| | | <el-button v-if="currentStep !== 3" :loading="submitFormLoading" type="primary" @click="submitForm">ç¡® |
| | | <el-button v-if="currentStep !== 3 && canOperate" :loading="submitFormLoading" type="primary" @click="submitForm">ç¡® |
| | | 认</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | |
| | | addDeviceBreakdownMaintenance, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | export default { |
| | | name: "failure-form", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | |
| | | return { |
| | | dialogVisible: false, |
| | | submitFormLoading: false, |
| | | canOperate: true, |
| | | form: { |
| | | location: '', |
| | | damageOrMalfunction: '', |
| | |
| | | // æå¼å¼¹æ¡ |
| | | openDialog(id, deviceId) { |
| | | this.dialogVisible = true |
| | | this.canOperate = true |
| | | this.form.maintenanceId = id |
| | | this.form.deviceId = deviceId |
| | | this.getUserList() |
| | |
| | | this.currentStep = 3 |
| | | this.showStep = 2 |
| | | } |
| | | this.applyPermission() |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | | }) |
| | | }, |
| | | // éå½åç¯è责任人åªå
许æ¥ç |
| | | applyPermission() { |
| | | if (this.form.isFinish === 1) { |
| | | this.canOperate = false |
| | | return |
| | | } |
| | | const responsible = this.currentStep === 1 ? this.form.departmentHeadUser : this.form.applicantUser |
| | | this.canOperate = !responsible || responsible === this.nickName |
| | | if (!this.canOperate) { |
| | | this.$message.warning('å½åç¯è责任人为ï¼' + responsible + 'ï¼æ¨åªè½æ¥ç') |
| | | } |
| | | }, |
| | | setStep(step) { |
| | | this.showStep = step |
| | |
| | | this.form.flowType = this.currentStep |
| | | this.$refs.modelForm.validate((valid) => { |
| | | if (valid) { |
| | | this.submitFormLoading = true |
| | | addDeviceBreakdownMaintenance(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | |
| | | }) |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["nickName"]), |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | |
| | | <el-table-column prop="managementNumber" label="ç»ä¸ç¼å·" min-width="150"></el-table-column> |
| | | <el-table-column prop="faultSituation" label="æ
éæ
åµ" min-width="130"></el-table-column> |
| | | <el-table-column prop="submitPerson" label="æäº¤äºº" min-width="130"></el-table-column> |
| | | <el-table-column prop="createTime" label="æäº¤æ¥æ" min-width="150"></el-table-column> |
| | | <el-table-column prop="createTime" label="æäº¤æ¥æ" min-width="150" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column prop="currentState" label="å½åç¶æ" min-width="130"></el-table-column> |
| | | <el-table-column prop="currentResponsible" label="å½å责任人" width="180"></el-table-column> |
| | | <!-- æä½æé® --> |
| | |
| | | <script> |
| | | import { dateFormat } from '@/utils/date' |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import { formatListDate } from './dateFormat' |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | |
| | | this.getTableList(this.clickNodeVal.value) |
| | | }, |
| | | methods: { |
| | | formatDateCell(row, column, cellValue) { |
| | | return formatListDate(cellValue) |
| | | }, |
| | | //è¦æ±ä¿®å¤æ¥æ:ç¦ç¨å¨æ
鿥æåçæ¥æ |
| | | disabledDate(time) { |
| | | let selectDate = this.form.faultDate |
| | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="6"> |
| | | <!-- å æ¶é´æ³é¿å
æµè§å¨ç¼åé®é¢ --> |
| | | <el-image :src="`${javaApi}/img/${Mdata.imageUpload}`" fit="fill" :key="'personalPicture' + timeStamp" |
| | | <el-image v-if="Mdata.imageUpload" :src="`${javaApi}/img/${Mdata.imageUpload}`" fit="fill" :key="'personalPicture' + timeStamp" |
| | | style="width: 200px;height: 300px;border: 1px solid #000;border-radius: 10px;margin-left: 30px;margin-top: 20px;"> |
| | | <template #error><div class="image-slot"> |
| | | <lims-icon name="el-icon-picture-outline" style="font-size: 40px;"></lims-icon> |
| | | </div></template> |
| | | </el-image> |
| | | <div v-else class="image-slot" |
| | | style="width: 198px;height: 298px;border: 1px solid #000;border-radius: 10px;margin-left: 30px;margin-top: 20px;display: flex;align-items: center;justify-content: center;"> |
| | | <lims-icon name="el-icon-picture-outline" style="font-size: 40px;"></lims-icon> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <div class="form-item"> |
| | |
| | | </div> |
| | | |
| | | <div class="form-item"> |
| | | <label>åºåæ¥æ</label> |
| | | <p>{{ formaterDateTime(Mdata.acquisitionDate) }}</p> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æ ¡åæææ</label> |
| | | <p>{{ formaterDateTime(Mdata.activationDate) }}</p> |
| | | </div> |
| | |
| | | </div> |
| | | |
| | | <div class="form-item"> |
| | | <label>æ¥åºæ¶é´</label> |
| | | <p>{{ handleData() }}</p> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>å确度éå¼</label> |
| | | <el-tooltip class="item" :content="Mdata.technicalIndicators"> |
| | | <span class="text-ellipsis">{{ Mdata.technicalIndicators }}</span> |
| | | </el-tooltip> |
| | | <!-- <p>{{ Mdata.technicalIndicators }}</p> --> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>维修记å½</label> |
| | | <p>{{ handleData() }}</p> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>被ææäºº</label> |
| | |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>éè´è´¹ç¨(å
)</label> |
| | | <p>{{ Mdata.unitPrice }}</p> |
| | | <p>{{ formatPurchasePrice(Mdata.unitPrice) }}</p> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>设å¤è´è´£äºº</label> |
| | | <p>{{ Mdata.equipmentManagerName }}</p> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>éªæ¶è®°å½</label> |
| | | <p>{{ handleData() }}</p> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æ ¸åè¯ä¹¦</label> |
| | |
| | | <el-table-column prop="quantity" label="份æ°" min-width="80" /> |
| | | <el-table-column prop="pageCount" label="页ç " min-width="80" /> |
| | | <el-table-column prop="provider" label="æä¾è
" min-width="150" /> |
| | | <el-table-column prop="provideDate" label="彿¡£æ¥æ" min-width="170" /> |
| | | <el-table-column prop="provideDate" label="彿¡£æ¥æ" min-width="170" :formatter="formatDateCell" /> |
| | | <el-table-column prop="comments" label="夿³¨" min-width="150" /> |
| | | <el-table-column fixed="right" label="æä½" min-width="180" align="center"> |
| | | <template #default="scope"> |
| | |
| | | <el-row> |
| | | <el-col :span="7" style="padding-right: 20px;"> |
| | | <!-- å¾ç --> |
| | | <el-image class="img" style="width:100%;height: 320px;" |
| | | <el-image v-if="editData.imageUpload" class="img" style="width:100%;height: 320px;" |
| | | :src="javaApi + '/img/' + editData.imageUpload"> |
| | | <template #error><div class="image-error" style="width: calc(100% - 2px); |
| | | height: 318px; |
| | |
| | | <lims-icon name="el-icon-picture-outline" style="font-size:60px;color:var(--lims-text-2);"></lims-icon> |
| | | </div></template> |
| | | </el-image> |
| | | <div v-else class="image-error" |
| | | style="width: calc(100% - 2px);height: 320px;border-radius: 16px;display: flex;align-items: center;justify-content: center;border: 1px solid var(--lims-divider);"> |
| | | <lims-icon name="el-icon-picture-outline" style="font-size:60px;color:var(--lims-text-2);"></lims-icon> |
| | | </div> |
| | | <!-- å¾çä¸ä¼ --> |
| | | <div style="margin-top: 12px;text-align: center;"> |
| | | <div v-show="editData.imageName" class="picName">{{ editData.imageName }}</div> |
| | | <el-upload :action="action" :on-success="handleSuccessUpImg2" :show-file-list="false" |
| | | accept='image/jpg,image/jpeg,image/png' :headers="uploadHeader" :on-change="beforeUpload" |
| | | accept='image/jpg,image/jpeg,image/png' :headers="uploadHeader" :before-upload="beforeUpload" |
| | | :on-error="onError" ref='upload' class="avatar-uploader"> |
| | | <img v-if="editData.imageUpload" :src="javaApi + '/img/' + editData.imageUpload" class="avatar"> |
| | | <lims-icon name="el-icon-plus" v-else class="avatar-uploader-icon"></lims-icon> |
| | |
| | | placeholder="è¯·éæ©" size="small" style="width:100%;" :collapse-tags="true" separator="," filterable |
| | | clearable></el-cascader> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤ç±»å:"> |
| | | <el-form-item label="设å¤/计éå¨å
·:"> |
| | | <el-select v-model="editData.largeCategory" placeholder="è¯·éæ©" size="small" style="width:100%"> |
| | | <el-option v-for="item in equipmentList" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | |
| | | <div class="cycle-row"> |
| | | <span class="cycle-title">æ ¡åä¿¡æ¯</span> |
| | | <el-form-item label="æè¿æ ¡åæ¥æ:" class="cycle-item"> |
| | | <el-date-picker style="width:100%" v-model="editData.lastCalibrationDate" format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD HH:mm:ss" type="date" size="small" placeholder="éæ©æ¥æ"> |
| | | <el-date-picker style="width:100%" v-model="editData.lastCalibrationDate" @change="calcNextDate(editData)" |
| | | format="YYYY-MM-DD" value-format="YYYY-MM-DD HH:mm:ss" type="date" size="small" placeholder="éæ©æ¥æ"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="䏿¬¡æ ¡åæ¥æ:" class="cycle-item"> |
| | | <el-date-picker style="width:100%" v-model="editData.nextCalibrationDate" format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD HH:mm:ss" type="date" size="small" placeholder="éæ©æ¥æ"> |
| | | <el-date-picker :disabled="true" style="width:100%" v-model="editData.nextCalibrationDate" |
| | | format="YYYY-MM-DD" value-format="YYYY-MM-DD HH:mm:ss" type="date" size="small" placeholder="éæ©æ¥æ"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="æ ¡åå¨æï¼æï¼:" prop="calibrationDate" class="cycle-item"> |
| | | <el-input v-model="editData.calibrationDate" size="small"></el-input> |
| | | <el-input v-model="editData.calibrationDate" size="small" @change="calcNextDate(editData)"></el-input> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="cycle-row"> |
| | |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { selectQualifiedSupplierManagementPage } from '@/api/cnas/externalService/supplierManage/supplierManage' |
| | | import { formatListDate } from './dateFormat' |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | |
| | | // }, |
| | | fileList: [], // æ·»å éä»¶ä¸ä¼ æä»¶å表 |
| | | timeStamp: '', // ç»å¾çæ·»å keyï¼å¨æ¯æ¬¡å 载页é¢çæ¶åæ°å»ºæ¶é´æ³ |
| | | equipmentManager: [], |
| | | formLabelWidth: '100px', |
| | | dialogVisible1: false, |
| | | recordNumber: '', |
| | |
| | | num: 1, |
| | | //æ·»å éä»¶æ°æ®æ¶é |
| | | addFile: { |
| | | documentType: '', // ç»´æ¤ç±»å |
| | | documentType: 0, // ç»´æ¤ç±»å |
| | | provideDate: null, // 彿¡£æ¥æ |
| | | name: '', // æ¡£æ¡åç§° |
| | | number: '', // åºå·/èµäº§ç¼å· |
| | |
| | | responsiblePersonList: [], |
| | | inspectorList: [], |
| | | options: [], |
| | | equipmentList: [], |
| | | // 设å¤ç±»åï¼ä¸å·¦ä¾§æ â设å¤/计éå¨å
·âåç±»ä¿æä¸è´ |
| | | equipmentList: [ |
| | | { label: '设å¤', value: '设å¤' }, |
| | | { label: '计éå¨å
·', value: '计éå¨å
·' } |
| | | ], |
| | | deviceStatusList: [], |
| | | props: { multiple: true, emitPath: false, value: 'id', label: 'name' }, |
| | | // æ¶éè®¾å¤æ¡£æ¡æ°æ® |
| | |
| | | this.obtainQualifiedSupplierList() |
| | | }, |
| | | methods: { |
| | | formatDateCell(row, column, cellValue) { |
| | | return formatListDate(cellValue) |
| | | }, |
| | | // æååæ ¼ä¾åºååè¡¨ï¼æ ¡åæå¡æºæä¸æéé¡¹ï¼ |
| | | obtainQualifiedSupplierList() { |
| | | selectQualifiedSupplierManagementPage({ current: 1, size: 999 }).then(res => { |
| | |
| | | }, |
| | | //éä»¶åç¸å
³ææ¡£äºä»¶ |
| | | handleAttachmentClick(row) { |
| | | console.log(row) |
| | | if (row.fileName) { |
| | | this.$download.saveAs(row.fileName) |
| | | } else { |
| | | if (!row.systemFileName) { |
| | | this.$message.warning('æªä¸ä¼ æä»¶ï¼') |
| | | return |
| | | } |
| | | // å¾çå /img/ï¼å
¶ä»ææ¡£å /word/ |
| | | const isImage = /\.(jpg|jpeg|png|gif|bmp|webp)$/i.test(row.systemFileName) |
| | | const url = this.javaApi + (isImage ? '/img/' : '/word/') + row.systemFileName |
| | | this.$download.saveAs(url, row.fileName || row.systemFileName) |
| | | }, |
| | | handleViewClick(row) { |
| | | this.isAddFileUpdate = true |
| | |
| | | }) |
| | | }, |
| | | saveRecord() { |
| | | if (!this.addFile.name) { |
| | | this.$message.warning('请è¾å
¥æ¡£æ¡åç§°') |
| | | return |
| | | } |
| | | if (this.addFile.documentType !== 0 && this.addFile.documentType !== '0' && |
| | | this.addFile.documentType !== 1 && this.addFile.documentType !== '1') { |
| | | this.$message.warning('è¯·éæ©ç»´æ¤ç±»å') |
| | | return |
| | | } |
| | | //è½¬æ¢æ°æ® |
| | | this.addFile.deviceId = this.clickNodeVal.value |
| | | // æ°ä¸ä¼ æ¶ systemFileName æ¯ {name: åå§æä»¶å, url: å卿件å}ï¼ç¼è¾æ§è®°å½æ¶å·²æ¯å符串 |
| | | let obj = this.addFile.systemFileName |
| | | this.addFile.systemFileName = obj.name |
| | | this.addFile.fileName = obj.url |
| | | if (obj && typeof obj === 'object') { |
| | | this.addFile.systemFileName = obj.url |
| | | this.addFile.fileName = obj.name |
| | | } |
| | | |
| | | // æ´æ° |
| | | if (this.isAddFileUpdate) { |
| | |
| | | } |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | this.deleteFile(this.addFile.systemFileName) |
| | | const obj = this.addFile.systemFileName |
| | | const fileName = obj && typeof obj === 'object' ? obj.url : obj |
| | | if (fileName) this.deleteFile(fileName) |
| | | this.addFile.systemFileName = '' |
| | | this.addFile.fileName = '' |
| | | }, |
| | | deleteFile(fileName) { |
| | | deleteCNASFile({ fileName }).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿åï¼') |
| | | } |
| | | }) |
| | | }, |
| | | handleExceed(files, fileList) { |
| | |
| | | // å°åç±»å表çä¿¡æ¯åèµ·æ¥ |
| | | if (res.code == 200) { |
| | | this.Mdata = res.data; |
| | | this.Mdata.insProductIds = this.Mdata.insProductIds.split(',') |
| | | this.Mdata.insProductIds = this.Mdata.insProductIds |
| | | ? String(this.Mdata.insProductIds).split(',') |
| | | : [] |
| | | this.Mdata.authorizedPerson = this.normalizeAuthorizedPerson(this.Mdata.authorizedPerson) |
| | | } |
| | | }); |
| | |
| | | //æå¼ä¿®è®¢æ¡£æ¡å¼¹æ¡ |
| | | openEditForm() { |
| | | this.editData = JSON.parse(JSON.stringify(this.Mdata)) |
| | | // 设å¤ç±»å为空æ¶ï¼é»è®¤å左侧æ å½åæå¨åç±» |
| | | const treeCategory = this.clickNodeVal && this.clickNodeVal.parent ? this.clickNodeVal.parent.label : '' |
| | | if (!this.editData.largeCategory && (treeCategory === '设å¤' || treeCategory === '计éå¨å
·')) { |
| | | this.editData.largeCategory = treeCategory |
| | | } |
| | | this.$nextTick(() => { |
| | | this.dialogVisible = true |
| | | }) |
| | |
| | | }, |
| | | //ä¿®è®¢æ¡£æ¡ |
| | | submitForm() { |
| | | let flag = true |
| | | this.$refs['rules1'].validate((valid) => { |
| | | if (!valid) { |
| | | flag = false; |
| | | return false; |
| | | } |
| | | }); |
| | | this.$refs['rules2'].validate((valid) => { |
| | | if (!valid) { |
| | | flag = false; |
| | | return false; |
| | | } |
| | | }); |
| | | this.$refs['ruleForm'].validate((valid) => { |
| | | if (!valid) { |
| | | flag = false; |
| | | return false; |
| | | } |
| | | }); |
| | | this.$refs['cycleForm'].validate((valid) => { |
| | | if (!valid) { |
| | | flag = false; |
| | | return false; |
| | | } |
| | | }); |
| | | if (!flag) { |
| | | return; |
| | | // validate() è¿å Promiseï¼ç»ä¸çå个表åå
¨é¨æ ¡éªå®å夿 |
| | | const formRefs = ['rules1', 'rules2', 'ruleForm', 'cycleForm'] |
| | | Promise.all(formRefs.map(ref => this.$refs[ref].validate().catch(() => false))).then(results => { |
| | | if (results.some(valid => !valid)) { |
| | | return |
| | | } |
| | | delete this.editData.createTime |
| | | delete this.editData.updateTime |
| | |
| | | delete this.editData.updateUser |
| | | delete this.editData.orderBy |
| | | const formData = this.HaveJson(this.editData) |
| | | formData.userAllow = this.equipmentManager.toString(); |
| | | formData.insProductIds = Array.isArray(formData.insProductIds) ? formData.insProductIds.join(',') : ''; |
| | | formData.authorizedPerson = Array.isArray(formData.authorizedPerson) && formData.authorizedPerson.length |
| | | ? JSON.stringify(formData.authorizedPerson) |
| | | : '' |
| | | this.upLoad = true; |
| | | upDeviceParameter(formData).then(res => { |
| | | this.upLoad = false |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.upLoad = false |
| | | this.getList(this.clickNodeVal.value) |
| | | // ç±»åå¯è½åæ´ï¼å·æ°å·¦ä¾§æ 让设å¤å½å°æ°çåç±»ä¸ |
| | | this.$emit('refresh-tree') |
| | | this.dialogVisible = false |
| | | } else { |
| | | this.$message.error(res.message || res.msg || 'ä¿®æ¹å¤±è´¥') |
| | | } |
| | | }).catch(e => { |
| | | // 失败ä¿çå¼¹çªï¼é¿å
å·²ç¼è¾å
容丢失 |
| | | this.$message.error('ä¿®æ¹å¤±è´¥') |
| | | this.dialogVisible = false |
| | | this.upLoad = false |
| | | }) |
| | | }) |
| | | }, |
| | | // å¯¼åº |
| | |
| | | this.outLoading = true |
| | | exportDeviceFile({ deviceId: this.clickNodeVal.value }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, 'è®¾å¤æ¡£æ¡å¡.doc') |
| | | saveBlobOrShowError(res, 'è®¾å¤æ¡£æ¡å¡.doc', 'application/msword') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | // ä¿®è®¢å¼¹çªæä¸å
å½å
¥ï¼æ¡£æ¡è¯¦æ
æå
å±ç¤º |
| | | formatPurchasePrice(val) { |
| | | if (val === null || val === undefined || val === '') { |
| | | return '-' |
| | | } |
| | | const num = Number(val) |
| | | return isNaN(num) ? val : num * 10000 |
| | | }, |
| | | handleSuccessUpImg2(response) { |
| | | if (response.code == 200) { |
| | |
| | | a.value = parseInt(a.value) |
| | | } |
| | | }) |
| | | }); |
| | | // 设å¤åç±» |
| | | this.getDicts("device_type").then((response) => { |
| | | this.equipmentList = this.dictToValue(response.data); |
| | | }); |
| | | }, |
| | | }, |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <div> |
| | | <el-button v-if="operationType === 'add'" size="small" type="primary" @click="addTableRow">æ·»å </el-button> |
| | | <el-button v-if="operationType !== 'check'" size="small" type="primary" @click="addTableRow">æ·»å </el-button> |
| | | </div> |
| | | <div style="text-align: center">æµè¯æ°æ®è®°å½</div> |
| | | <div style="margin: 10px 0"> |
| | |
| | | } else { |
| | | updateDeviceInspectionRecord(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | |
| | | inspectionRecordId: this.form.inspectionRecordId, |
| | | status: status, |
| | | } |
| | | this.submitFormLoading = true |
| | | reviewDeviceInspectionRecord(params).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å®¡æ ¸æå') |
| | |
| | | <el-table-column label="夿 ¸ç¶æ" min-width="180" prop="status"> |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.status === 1" type="success">é è¿</el-tag> |
| | | <el-tag v-if="scope.row.status === 0" type="danger">ä¸éè¿</el-tag> |
| | | <el-tag v-else-if="scope.row.status === 0" type="danger">ä¸éè¿</el-tag> |
| | | <el-tag v-else type="info">å¾
å®¡æ ¸</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- æä½æé® --> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | <el-pagination :current-page="pagination1.current" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="pagination1.total" layout="->,total, sizes, prev, pager, next, jumper" background |
| | | @size-change="handleSizeChange1" @current-change="handleCurrentChange1"> |
| | | </el-pagination> |
| | |
| | | exportDeviceInspectionRecord, |
| | | deleteDeviceInspectionRecord, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | | export default { |
| | | name: "inspection-of-equipment", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | |
| | | inspectionRecordId: id |
| | | }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设å¤ç¹æ£è®°å½è¡¨.doc') |
| | | saveBlobOrShowError(res, '设å¤ç¹æ£è®°å½è¡¨.doc', 'application/msword') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | // å é¤ |
| | |
| | | </el-form> |
| | | </div> |
| | | <div> |
| | | <el-button size="small" type="primary" @click="dialogVisible2 = true">æ°å¢</el-button> |
| | | <el-button size="small" type="primary" @click="openAddDialog">æ°å¢</el-button> |
| | | <el-button size="small" type="primary" @click="handleDownOne">导åº</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | :props="props" placeholder="è¯·éæ©" size="small" style="width:100%;" :collapse-tags="!isUp" separator="," |
| | | filterable clearable></el-cascader> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤ç±»å:"> |
| | | <el-form-item label="设å¤/计éå¨å
·:"> |
| | | <el-select :disabled="isUp" v-model="formData.largeCategory" placeholder="è¯·éæ©" size="small" |
| | | style="width:100%"> |
| | | <el-option v-for="item in equipmentList" :key="item.value" :label="item.label" :value="item.value"> |
| | |
| | | placeholder="è¯·éæ©" size="small" style="width:100%" collapse-tags separator="," filterable |
| | | clearable></el-cascader> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤ç±»å:"> |
| | | <el-form-item label="设å¤/计éå¨å
·:"> |
| | | <el-select v-model="formData2.largeCategory" placeholder="è¯·éæ©" size="small" style="width:100%"> |
| | | <el-option v-for="item in equipmentList" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import dayjs from 'dayjs' |
| | | import { formatListDate } from './dateFormat' |
| | | import { selectQualifiedSupplierManagementPage } from '@/api/cnas/externalService/supplierManage/supplierManage' |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | |
| | | showData: false, // æ°éé
ç½®é¡µé¢ |
| | | tableList: [], |
| | | addDia: true, |
| | | //设å¤ç±»åå表 |
| | | equipmentList: [], |
| | | //设å¤ç±»åå表ï¼ä¸å·¦ä¾§æ â设å¤/计éå¨å
·âåç±»ä¿æä¸è´ |
| | | equipmentList: [ |
| | | { label: '设å¤', value: '设å¤' }, |
| | | { label: '计éå¨å
·', value: '计éå¨å
·' } |
| | | ], |
| | | // è´è´£äººå表 |
| | | responsiblePersonList: [], |
| | | // ææäººå表 |
| | |
| | | { label: "åºåç¼å·", prop: "factoryNo" }, |
| | | { label: "管çç¼å·", prop: "managementNumber" }, |
| | | { label: "ææ¯ææ ", prop: "technicalIndicators" }, |
| | | { label: "è´ç½®æ¥æ", prop: "acquisitionDate" }, |
| | | { label: "æ ¡åæææ", prop: "activationDate" }, |
| | | { label: "è´ç½®æ¥æ", prop: "acquisitionDate", formatData: (params) => formatListDate(params) }, |
| | | { label: "æ ¡åæææ", prop: "activationDate", formatData: (params) => formatListDate(params) }, |
| | | { label: "管ç人", prop: "equipmentManagerUser" }, |
| | | { label: "åæ¾ç¹", prop: "storagePoint" }, |
| | | { label: "æ£éªé¡¹ç®", prop: "insProductItem" }, |
| | | { label: "æ ¡åæå¡æºæ", prop: "calibrationServices" }, |
| | | { label: "æè¿æ ¡åæ¥æ", prop: "lastCalibrationDateTwo" }, |
| | | { label: "æè¿æ ¸æ¥æ¥æ", prop: "lastExamineDate" }, |
| | | { label: "䏿¬¡æ ¡åæ¥æ", prop: "nextCalibrationDateTwo" }, |
| | | { label: "䏿¬¡æ ¸æ¥æ¥æ", prop: "nextExamineDate" }, |
| | | { label: "æè¿ä¿å
»æ¥æ", prop: "lastMaintenanceDate" }, |
| | | { label: "䏿¬¡ä¿å
»æ¥æ", prop: "nextMaintenanceDate" }, |
| | | { label: "æè¿æ ¡åæ¥æ", prop: "lastCalibrationDateTwo", formatData: (params) => formatListDate(params) }, |
| | | { label: "æè¿æ ¸æ¥æ¥æ", prop: "lastExamineDate", formatData: (params) => formatListDate(params) }, |
| | | { label: "䏿¬¡æ ¡åæ¥æ", prop: "nextCalibrationDateTwo", formatData: (params) => formatListDate(params) }, |
| | | { label: "䏿¬¡æ ¸æ¥æ¥æ", prop: "nextExamineDate", formatData: (params) => formatListDate(params) }, |
| | | { label: "æè¿ä¿å
»æ¥æ", prop: "lastMaintenanceDate", formatData: (params) => formatListDate(params) }, |
| | | { label: "䏿¬¡ä¿å
»æ¥æ", prop: "nextMaintenanceDate", formatData: (params) => formatListDate(params) }, |
| | | { |
| | | label: "设å¤åç±»", prop: "largeCategory", dataType: "tag", |
| | | formatData: (params) => { |
| | |
| | | this.outLoading = true |
| | | exportEquipmentDetails({ ...this.queryParams }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设å¤ä»ªå¨ä¸è§è¡¨.doc') |
| | | saveBlobOrShowError(res, '设å¤ä»ªå¨ä¸è§è¡¨.doc', 'application/msword') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | // è·ååå
¸ |
| | |
| | | // 设å¤ç¶æ |
| | | this.getDicts("device_status").then((response) => { |
| | | this.deviceStatusList = this.dictToValue(response.data); |
| | | }); |
| | | // 设å¤åç±» |
| | | this.getDicts("device_type").then((response) => { |
| | | this.equipmentList = this.dictToValue(response.data); |
| | | }); |
| | | }, |
| | | // è·åè´è´£äººå表 |
| | |
| | | //å¤å¶ç»formData |
| | | this.formData = this.HaveJson(row); |
| | | this.formData.authorizedPerson = this.normalizeAuthorizedPerson(row.authorizedPerson); |
| | | // 设å¤ç±»å为空æ¶ï¼é»è®¤å左侧æ å½åæå¨åç±» |
| | | const treeCategory = this.clickNodeVal && this.clickNodeVal.label |
| | | if (!this.formData.largeCategory && (treeCategory === '设å¤' || treeCategory === '计éå¨å
·')) { |
| | | this.formData.largeCategory = treeCategory |
| | | } |
| | | if (typeof (row.insProductIds) === 'number') { |
| | | row.insProductIds = row.insProductIds + '' |
| | | } |
| | |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.upLoad = false |
| | | this.refreshTable('page') |
| | | // ç±»åå¯è½åæ´ï¼å·æ°å·¦ä¾§æ 让设å¤å½å°æ°çåç±»ä¸ |
| | | this.$emit('refresh-tree') |
| | | this.dialogVisible = false |
| | | }).catch(e => { |
| | | this.$message.error('ä¿®æ¹å¤±è´¥') |
| | |
| | | } |
| | | if (!this.formData2.managementNumber) { |
| | | this.$message.error('æªè¾å
¥ç®¡çç¼å·') |
| | | return |
| | | } |
| | | if (!this.formData2.largeCategory) { |
| | | this.$message.error('è¯·éæ©è®¾å¤/计éå¨å
·') |
| | | return |
| | | } |
| | | if (!this.formData2.activationDate) { |
| | |
| | | this.$message.success('æäº¤æå') |
| | | this.upLoad2 = false |
| | | this.refreshTable('page') |
| | | this.$emit('refresh-tree') |
| | | this.dialogVisible2 = false |
| | | this.formData2 = { |
| | | imageUpload: '', |
| | |
| | | this.refreshTable('page') |
| | | } |
| | | }, |
| | | // æ°å¢è®¾å¤ï¼é»è®¤å左侧æ å½åæå¨åç±» |
| | | openAddDialog() { |
| | | const treeCategory = this.clickNodeVal && this.clickNodeVal.label |
| | | if (!this.formData2.largeCategory && (treeCategory === '设å¤' || treeCategory === '计éå¨å
·')) { |
| | | this.formData2.largeCategory = treeCategory |
| | | } |
| | | this.dialogVisible2 = true |
| | | }, |
| | | handleDelete(row) { |
| | | this.$confirm("æ¯å¦å é¤è¯¥æ¡æ°æ®?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | |
| | | .then(() => { |
| | | delDeviceParameter({ id: row.id }).then((res) => { |
| | | this.$message.success("å 餿å"); |
| | | this.refresh(); |
| | | this.refreshTable() |
| | | // å·²å é¤ç设å¤è¦ä»å·¦ä¾§æ åæ¥ç§»é¤ |
| | | this.$emit('refresh-tree') |
| | | }); |
| | | }) |
| | | .catch(() => { }); |
| | |
| | | <el-table-column label="设å¤ç¼å·" min-width="150" prop="deviceNumber"></el-table-column> |
| | | <el-table-column label="设å¤åå·" min-width="150" prop="deviceModel"></el-table-column> |
| | | <el-table-column label="æä»¶ç¼å·" min-width="150" prop="documentNumber"></el-table-column> |
| | | <el-table-column label="æä»¶åå" min-width="150" prop="fileName"></el-table-column> |
| | | <el-table-column label="æä»¶åç§°" min-width="150" prop="fileName"></el-table-column> |
| | | <el-table-column label="ææ¡£è¯´æ" min-width="150" prop="documentNote"></el-table-column> |
| | | <el-table-column label="ä¸ä¼ 人" min-width="150" prop="uploaderName"></el-table-column> |
| | | <el-table-column label="ä¸ä¼ æ¶é´" min-width="150" prop="updateTime"></el-table-column> |
| | | <el-table-column label="çææ¶é´" min-width="150" prop="entryIntoForceTime"></el-table-column> |
| | | <el-table-column label="ä¸ä¼ æ¶é´" min-width="150" prop="updateTime" :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column label="çææ¶é´" min-width="150" prop="entryIntoForceTime" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column label="审æ¹äºº" min-width="150" prop="approverName"></el-table-column> |
| | | <el-table-column label="审æ¹ç¶æ" min-width="150" prop="status"> |
| | | <template v-slot="scope"> |
| | |
| | | <el-table-column label="æä½" min-width="180" fixed="right" prop="name"> |
| | | <template v-slot="scope"> |
| | | <el-button link type="primary" size="small" @click="downloadFile(scope.row.fileSystemName)">ä¸è½½</el-button> |
| | | <el-button link type="primary" size="small" style="color: red;" |
| | | <el-button link type="primary" size="small" style="color: red;" :disabled="scope.row.status === true" |
| | | @click="deleteHomeworkGuidebook(scope.row)">å é¤</el-button> |
| | | <el-button link type="primary" size="small" @click="instructionEditFun(scope.row)">ç¼è¾</el-button> |
| | | <el-button link type="primary" size="small" @click="approval(scope.row)">审æ¹</el-button> |
| | | <el-button link type="primary" size="small" :disabled="scope.row.status === true" |
| | | @click="instructionEditFun(scope.row)">ç¼è¾</el-button> |
| | | <el-button link type="primary" size="small" :disabled="scope.row.status === true" |
| | | @click="approval(scope.row)">审æ¹</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="1" |
| | | <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="search.current" |
| | | :page-sizes="[10, 20, 30, 50, 100]" :page-size="search.size" layout="->,total, sizes, prev, pager, next, jumper" |
| | | :total="search.total" background> |
| | | </el-pagination> |
| | |
| | | <el-table :data="documentTableData" border style="width: 100%;" tooltip-effect="dark" :row-key="getRowKey" |
| | | |
| | | @selection-change="handleSelectionChange" height="29em"> |
| | | <el-table-column type="selection" width="55%"> |
| | | <el-table-column type="selection" width="55"> |
| | | </el-table-column> |
| | | <el-table-column label="åºå·" prop="id" type="index" width="60"></el-table-column> |
| | | <el-table-column label="设å¤åç§°" prop="deviceName" show-overflow-tooltip min-width="125"></el-table-column> |
| | |
| | | <el-table-column label="ææ¡£ç¼å·" prop="documentNumber" show-overflow-tooltip min-width="125"></el-table-column> |
| | | <el-table-column label="æä»¶åç§°" prop="fileName" show-overflow-tooltip min-width="125"></el-table-column> |
| | | <el-table-column label="ä¸ä¼ 人" prop="author" show-overflow-tooltip min-width="125"></el-table-column> |
| | | <el-table-column label="ä¸ä¼ æ¶é´" prop="updateTime" show-overflow-tooltip min-width="125"></el-table-column> |
| | | <el-table-column label="ä¸ä¼ æ¶é´" prop="updateTime" show-overflow-tooltip min-width="125" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column min-width="100" label="æä½" fixed="right"> |
| | | <template v-slot="scope"> |
| | | <el-button link type="primary" size="small" @click="downloadFile(scope.row.fileSystemName)">ä¸è½½</el-button> |
| | |
| | | pageByPageQueryOfHomeworkInstructions, |
| | | selectDeviceParameter, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { formatListDate } from './dateFormat' |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | formatDateCell(row, column, cellValue) { |
| | | return formatListDate(cellValue) |
| | | }, |
| | | approval(row) { |
| | | this.$confirm('æ¯å¦å®¡æ¹éè¿ï¼', 'æç¤º', { |
| | | confirmButtonText: 'éè¿', |
| | |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.approvalFun(row.id, true) |
| | | }).catch(() => { |
| | | }).catch((action) => { |
| | | // åªæç¹å»âä¸éè¿âææäº¤é©³åï¼ç¹å³ä¸è§å
³é/Esc è§ä¸ºæ¾å¼æä½ |
| | | if (action === 'cancel') { |
| | | this.approvalFun(row.id, false) |
| | | } |
| | | }); |
| | | }, |
| | | approvalFun(id, status) { |
| | |
| | | homeworkGuidebookEditor({ instructionId: row.instructionId }).then(res => { |
| | | if (res.code == 200) { |
| | | this.instructionForm = res.data.instruction; |
| | | if (this.instructionForm.fileSystemName) { |
| | | this.fileList1.push({ name: this.instructionForm.fileName }) |
| | | } |
| | | this.fileList1 = this.instructionForm.fileSystemName |
| | | ? [{ name: this.instructionForm.fileName }] |
| | | : [] |
| | | this.documentTableData = res.data.list; |
| | | // å é¤ç¨ |
| | | this.documentTableData.forEach((v, k) => { |
| | |
| | | this.$message.success('ä¿®æ¹æå'); |
| | | console.log('this.documentTableData---edit', this.documentTableData[this.tableDataIndex]) |
| | | } else { |
| | | this.form.index = this.getNextRowIndex(); |
| | | this.documentTableData.push(this.form); |
| | | this.dialogVisible1 = false; |
| | | this.$message.success('æ·»å æå'); |
| | |
| | | editFun(row, index) { |
| | | this.form = { ...row } |
| | | this.tableDataIndex = index; |
| | | console.log('this.tableDataIndex', this.tableDataIndex) |
| | | // åæ¾å表 |
| | | // åæ¾å表åå
æ¸
空ï¼é¿å
é夿¾ç¤ºä¸ä¸æ¬¡çéä»¶ |
| | | this.fileList = [] |
| | | if (this.form.fileSystemName) { |
| | | this.fileList.push({ name: this.form.fileName }) |
| | | } |
| | | this.dialogVisible1 = true |
| | | }, |
| | | getNextRowIndex() { |
| | | return this.documentTableData.reduce((max, item) => { |
| | | return typeof item.index === 'number' && item.index > max ? item.index : max |
| | | }, -1) + 1 |
| | | }, |
| | | closeDia() { |
| | | this.dialogVisible1 = false |
| | |
| | | this.$message.error('è¯·éæ©è¦å é¤çé项'); |
| | | return; |
| | | } |
| | | // å é¤ä¿åå¥½çæ°æ® |
| | | let ids = this.selectedRow |
| | | const selectedIndexes = this.selectedRow.map(item => item.index); |
| | | // å é¤å·²ä¿åçæ°æ®ï¼æ¬æ¬¡æ°å ãå°æªè½åºçè¡æ²¡æ idï¼ä¸è°æ¥å£ |
| | | const ids = this.selectedRow |
| | | .filter(item => item.id !== undefined) |
| | | .map(item => item.id).join(','); |
| | | //æé误 |
| | | if (ids) { |
| | | const res = await deleteHomeworkGuidebook({ ids }); |
| | | if (res.code === 200) { |
| | | // å é¤è§å¾çæ°æ® |
| | | for (const resKey in this.selectedRow) { |
| | | this.documentTableData = this.documentTableData.filter(item => item.index === this.selectedRow[resKey].index) |
| | | if (res.code !== 200) { |
| | | return; |
| | | } |
| | | } |
| | | // 䏿¬¡æ§è¿æ»¤æææéä¸è¡ï¼ä¿çå
¶ä½æ°æ® |
| | | this.documentTableData = this.documentTableData.filter(item => !selectedIndexes.includes(item.index)) |
| | | this.selectedRow = [] |
| | | this.$message.success({ |
| | | message: 'å 餿å', |
| | | type: 'success' |
| | | }); |
| | | } |
| | | }, |
| | | onSuccess(response, file, fileList) { |
| | | this.form.fileName = file.name; |
| | |
| | | this.form.fileSystemName = '' |
| | | }, |
| | | handleRemove1(file, fileList) { |
| | | this.form.fileName = '' |
| | | this.form.fileSystemName = '' |
| | | this.instructionForm.fileName = '' |
| | | this.instructionForm.fileSystemName = '' |
| | | }, |
| | | beforeRemove(file) { |
| | | return this.$confirm(`ç¡®å®ç§»é¤ ${file.name}ï¼`) |
| | |
| | | this.$message.warning(`å½åéå¶éæ© 1 个æä»¶ï¼æ¬æ¬¡éæ©äº ${files.length} 个æä»¶ã`); |
| | | }, |
| | | getList() { |
| | | pageByPageQueryOfHomeworkInstructions({ ...this.search }).then(res => { |
| | | const params = { ...this.search } |
| | | // éä¸å
·ä½è®¾å¤æ¶åªæ¥è¯¥è®¾å¤çä½ä¸æå¯¼ä¹¦ |
| | | if (this.clickNodeVal && this.clickNodeVal.value) { |
| | | params.deviceId = this.clickNodeVal.value |
| | | } |
| | | pageByPageQueryOfHomeworkInstructions(params).then(res => { |
| | | if (res.code == 200) { |
| | | this.tableData = res.data.records; |
| | | this.search.total = res.data.total |
| | |
| | | <el-table-column label="年份" min-width="80" prop="planYear"></el-table-column> |
| | | <el-table-column label="æä»¶åç§°" min-width="120" prop="compiler"></el-table-column> |
| | | <el-table-column label="ç¼å¶äºº" min-width="150" prop="compiler"></el-table-column> |
| | | <el-table-column label="ç¼å¶æ¶é´" min-width="160" prop="datePreparation"></el-table-column> |
| | | <el-table-column label="ç¼å¶æ¶é´" min-width="160" prop="datePreparation" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column label="æ¹å人" min-width="180" prop="audit"></el-table-column> |
| | | <el-table-column label="æ¹åç¶æ" min-width="180" prop="status"> |
| | | <template #default="scope"> |
| | |
| | | <el-tag v-if="scope.row.status === 0" type="danger">䏿¹å</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æ¹åæ¶é´" min-width="180" prop="auditDate"></el-table-column> |
| | | <el-table-column label="æ¹åæ¶é´" min-width="180" prop="auditDate" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <!-- æä½æé® --> |
| | | <el-table-column align="center" fixed="right" label="æä½" min-width="270"> |
| | | <template #default="scope"> |
| | |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import { formatListDate } from './dateFormat' |
| | | export default { |
| | | name: "quantity-value-traceability-plan", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | formatDateCell(row, column, cellValue) { |
| | | return formatListDate(cellValue) |
| | | }, |
| | | // æ¥è¯¢ |
| | | getYearTableDetailData() { |
| | | this.yearTableDetailDataLoading = true |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <div> |
| | | <el-button size="small" type="primary" @click="dialogVisible = true, openAdd()">æ° å»º</el-button> |
| | | <el-button v-if="isMenuList !== 1" size="small" type="primary" @click="dialogVisible = true, openAdd()">æ° å»º</el-button> |
| | | <el-button :loading="outLoading" size="small" type="primary" @click="openHandleOut">导 åº</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="å¼å¸¸æ
åµ" min-width="120" prop="abnormal" />--> |
| | | <el-table-column label="使ç¨å¼å§æ¥æ" min-width="170" prop="useStartDate" /> |
| | | <el-table-column label="使ç¨ç»ææ¥æ" min-width="170" prop="useEndDate" /> |
| | | <el-table-column label="使ç¨å¼å§æ¥æ" min-width="170" prop="useStartDate" :formatter="formatDateCell" /> |
| | | <el-table-column label="使ç¨ç»ææ¥æ" min-width="170" prop="useEndDate" :formatter="formatDateCell" /> |
| | | <el-table-column label="使ç¨äºº" min-width="120" prop="usePerson" /> |
| | | <el-table-column label="夿³¨" min-width="120" prop="remark" /> |
| | | <!-- æä½æé® --> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | <el-pagination :current-page="search.current" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" background> |
| | | </el-pagination> |
| | |
| | | deleteDeviceRecord, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { formatListDate } from './dateFormat'; |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | |
| | | this.getTableList(this.clickNodeVal.value); |
| | | }, |
| | | methods: { |
| | | formatDateCell(row, column, cellValue) { |
| | | return formatListDate(cellValue) |
| | | }, |
| | | // element-plus ç el-date-picker 没æ picker-optionsï¼æ¹æ :disabled-date |
| | | disabledDate(time) { |
| | | return time.getTime() > Date.now(); |
| | |
| | | exportDate: this.exportDate |
| | | }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设å¤ä½¿ç¨è®°å½.doc') |
| | | saveBlobOrShowError(res, '设å¤ä½¿ç¨è®°å½.doc', 'application/msword') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | //æ°å»º |
| | |
| | | this.dialogVisible = false |
| | | } |
| | | }) |
| | | this.dialogVisible = false; |
| | | } else { |
| | | updateDeviceRecord(this.form).then(res => { |
| | | if (res.code == 200) { |
| | |
| | | this.dialogVisible = false |
| | | } |
| | | }) |
| | | this.dialogVisible = false; |
| | | } |
| | | } |
| | | }); |
| | |
| | | //æ¥ç详æ
|
| | | showDetailsDialog(type, row) { |
| | | this.operationType = type; |
| | | console.log(row) |
| | | this.dialogVisible = true; |
| | | this.getUserList() |
| | | this.form = row; |
| | | let list = [] |
| | | if (row.useStartDate === null) { |
| | | row.useStartDate = '' |
| | | // å¤å¶ä¸ä»½åç¼è¾ï¼é¿å
ç´æ¥æ¹å¨è¡¨æ ¼éçæ°æ® |
| | | const useStartDate = row.useStartDate || '' |
| | | const useEndDate = row.useEndDate || '' |
| | | this.form = { |
| | | ...row, |
| | | useStartDate, |
| | | useEndDate, |
| | | useDateList: useStartDate && useEndDate ? [useStartDate, useEndDate] : [] |
| | | } |
| | | if (row.useEndDate === null) { |
| | | row.useEndDate = '' |
| | | } |
| | | list.push(row.useStartDate) |
| | | list.push(row.useEndDate) |
| | | this.form['useDateList'] = list |
| | | }, |
| | | handleDeleteClick(index, row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | |
| | | <el-step title="计é室æè§" @click="setStep(2)"></el-step> |
| | | <el-step title="æ¹å人" @click="setStep(3)"></el-step> |
| | | </el-steps> |
| | | <el-form ref="modelForm" :model="form" :rules="rules" label-width="160px"> |
| | | <el-form ref="modelForm" :model="form" :rules="rules" label-width="160px" :disabled="!canOperate"> |
| | | <el-col v-if="showStep === 0" :span="24"> |
| | | <el-form-item label="é
ä»¶ï¼" prop="parts"> |
| | | <el-input v-model="form.parts" :disabled="currentStep !== 0" clearable size="small"></el-input> |
| | |
| | | </el-form> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button @click="resetForm">å æ¶</el-button> |
| | | <el-button v-if="currentStep !== 4" :loading="submitFormLoading" type="primary" @click="submitForm">ç¡® |
| | | <el-button v-if="currentStep !== 4 && canOperate" :loading="submitFormLoading" type="primary" @click="submitForm">ç¡® |
| | | 认</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | |
| | | addDeviceScrapped, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | export default { |
| | | name: "scrapApplicationForm", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | |
| | | return { |
| | | dialogVisible: false, |
| | | submitFormLoading: false, |
| | | canOperate: true, |
| | | form: { |
| | | parts: '', |
| | | reasonsForScrap: '', |
| | |
| | | // æå¼å¼¹æ¡ |
| | | openDialog(id, deviceId) { |
| | | this.dialogVisible = true |
| | | this.canOperate = true |
| | | this.form.scrappedId = id |
| | | this.form.deviceId = deviceId |
| | | this.getUserList() |
| | |
| | | this.currentStep = 4 |
| | | this.showStep = 3 |
| | | } |
| | | this.applyPermission() |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | | }) |
| | | }, |
| | | // éå½åç¯è责任人åªå
许æ¥ç |
| | | applyPermission() { |
| | | if (this.form.isFinish === 1 || this.currentStep >= 4) { |
| | | this.canOperate = false |
| | | return |
| | | } |
| | | const responsibleList = [ |
| | | this.form.applicantUser, |
| | | this.form.departmentHeadUser, |
| | | this.form.meteringRoomUser, |
| | | this.form.approverUser, |
| | | ] |
| | | const responsible = responsibleList[this.currentStep] |
| | | this.canOperate = !responsible || responsible === this.nickName |
| | | if (!this.canOperate) { |
| | | this.$message.warning('å½åç¯è责任人为ï¼' + responsible + 'ï¼æ¨åªè½æ¥ç') |
| | | } |
| | | }, |
| | | setStep(step) { |
| | | this.showStep = step |
| | |
| | | this.form.flowType = this.currentStep |
| | | this.$refs.modelForm.validate((valid) => { |
| | | if (valid) { |
| | | this.submitFormLoading = true |
| | | addDeviceScrapped(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | |
| | | }) |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["nickName"]), |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <div> |
| | | <el-button size="small" type="primary" @click="dialogVisible = true">æ°å»º</el-button> |
| | | <el-button size="small" type="primary" @click="handleAddClick">æ°å»º</el-button> |
| | | <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">导åºExcel</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="åç¨/å¯ç¨çç±" min-width="180" prop="reason"></el-table-column> |
| | | <el-table-column label="æäº¤äºº" min-width="130" prop="createUser"></el-table-column> |
| | | <el-table-column label="æäº¤æ¥æ" min-width="150" prop="createTime"></el-table-column> |
| | | <el-table-column label="æäº¤æ¥æ" min-width="150" prop="createTime" |
| | | :formatter="formatDateCell"></el-table-column> |
| | | <el-table-column label="å½åç¶æ" min-width="130" prop="currentState"></el-table-column> |
| | | <el-table-column label="å½å责任人" min-width="180" prop="currentResponsible"></el-table-column> |
| | | <!-- æä½æé® --> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | <el-pagination :current-page="search.current" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" background> |
| | | </el-pagination> |
| | |
| | | <el-step v-for="(v, i) in steps" :key="i" :title="v" style="cursor:pointer" |
| | | @click="choiceStep(i)"></el-step> |
| | | </el-steps> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="130px"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="130px" :disabled="!canOperate"> |
| | | <div v-show="currentStepClick === 0"> |
| | | <el-card style="margin-top: 1em; height: 42vh; overflow-y: scroll;"> |
| | | <!-- å¡ç --> |
| | |
| | | </div> |
| | | </el-form> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button v-if="currentStep !== 0 && currentStep !== 4" :loading="sumbitLoading1" |
| | | <el-button v-if="currentStep !== 0 && currentStep !== 4 && canOperate" :loading="sumbitLoading1" |
| | | @click="submitForm('3reject')">驳å</el-button> |
| | | <el-button v-if="currentStep === 0" :loading="sumbitLoading2" @click="submitForm('2save')">ä¿å</el-button> |
| | | <el-button v-if="currentStep !== 4" :loading="sumbitLoading3" type="primary" @click="submitForm('1submit')"> |
| | | <el-button v-if="currentStep === 0 && canOperate" :loading="sumbitLoading2" @click="submitForm('2save')">ä¿å</el-button> |
| | | <el-button v-if="currentStep !== 4 && canOperate" :loading="sumbitLoading3" type="primary" @click="submitForm('1submit')"> |
| | | {{ currentStep === 0 ? 'æäº¤' : 'éè¿' }} |
| | | </el-button> |
| | | </span></template> |
| | |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { dateFormat } from '@/utils/date' |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import { formatListDate } from './dateFormat' |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | |
| | | return { |
| | | outLoading: false, // 导åºloading |
| | | dialogVisible: false, |
| | | canOperate: true, |
| | | form: {}, |
| | | currentStep: 0, // æ¥éª¤æ¡æ¾ç¤ºç¬¬å æ¥ |
| | | currentStepClick: 0, // ç¹å»æ¥éª¤æ¡åå |
| | |
| | | this.getDeviceStatePage(this.clickNodeVal.value) |
| | | }, |
| | | methods: { |
| | | formatDateCell(row, column, cellValue) { |
| | | return formatListDate(cellValue) |
| | | }, |
| | | // å页 |
| | | handleSizeChange(val) { |
| | | this.search.size = val |
| | |
| | | default: |
| | | break |
| | | } |
| | | // è·åå½åç¯èè´è´£äºº |
| | | switch (saveState === '3reject' ? this.currentStep - 1 : this.currentStep) { |
| | | // è·åå½åç¯èè´è´£äººï¼é©³ååå°ä¸ä¸ç¯èæä½äººï¼ä¿åçç»èªå·±ï¼æäº¤/éè¿è¿å
¥ä¸ä¸ç¯è责任人 |
| | | if (saveState === '3reject') { |
| | | switch (this.currentStep - 1) { |
| | | case 0: |
| | | this.form.currentResponsible = this.form.submitOperatingPersonnel |
| | | break |
| | |
| | | case 2: |
| | | this.form.currentResponsible = this.form.measuringRoomOperatingPersonnel |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | } else if (saveState === '2save') { |
| | | this.form.currentResponsible = this.form.submitOperatingPersonnel |
| | | } else { |
| | | switch (this.currentStep) { |
| | | case 0: |
| | | this.form.currentResponsible = this.form.submitNextPesponsible |
| | | break |
| | | case 1: |
| | | this.form.currentResponsible = this.form.departmentNextPesponsible |
| | | break |
| | | case 2: |
| | | this.form.currentResponsible = this.form.measuringRoomNextPesponsible |
| | | break |
| | | case 3: |
| | | this.form.currentResponsible = this.form.approvalOperatingPersonnel |
| | | this.form.currentResponsible = this.form.approvalNextPesponsible |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | } |
| | | // è·åå½åç¶æ |
| | | this.form.currentState = currentStepAction === 4 ? 'å
³é' : this.steps[currentStepAction] |
| | |
| | | } |
| | | }) |
| | | }, |
| | | // æ°å»º |
| | | handleAddClick() { |
| | | this.canOperate = true |
| | | this.dialogVisible = true |
| | | }, |
| | | // æ¥ç |
| | | handleViewClick(row) { |
| | | this.form = { ...row } |
| | | // å¦æç´¢å¼ä¸º6表示å
¨é¨éè¿ |
| | | this.currentStep = this.steps.indexOf(this.form.currentState) === -1 ? 4 : this.steps.indexOf(this.form.currentState) |
| | | this.currentStepClick = this.currentStep === 4 ? 0 : this.currentStep |
| | | this.$nextTick(() => { |
| | | this.$refs['form'].clearValidate() |
| | | }) |
| | | this.applyPermission() |
| | | this.dialogVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs['form'] && this.$refs['form'].clearValidate() |
| | | }) |
| | | }, |
| | | // éå½åç¯è责任人åªå
许æ¥ç |
| | | applyPermission() { |
| | | if (this.currentStep === 4) { |
| | | this.canOperate = false |
| | | return |
| | | } |
| | | const responsible = this.form.currentResponsible |
| | | this.canOperate = !responsible || responsible === this.nickName |
| | | if (!this.canOperate) { |
| | | this.$message.warning('å½åç¯è责任人为ï¼' + responsible + 'ï¼æ¨åªè½æ¥ç') |
| | | } |
| | | }, |
| | | // å¯¼åº |
| | | handleDownOne(row) { |
| | | this.outLoading = true |
| | | exportDeviceStatus({ deviceId: row.deviceId, processNumber: row.processNumber }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设å¤å/å¯ç¨.doc') |
| | | saveBlobOrShowError(res, '设å¤å/å¯ç¨.doc', 'application/msword') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | // å é¤ |
| | |
| | | processNumber: this.search.processNumber |
| | | }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设å¤åç¨/å¯ç¨.xlsx') |
| | | }).finally(() => { |
| | | saveBlobOrShowError(res, '设å¤åç¨/å¯ç¨.xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | if (newVal.value) { |
| | | this.componentData.entity.deviceId = this.clickNodeVal.value |
| | | this.entityCopy = this.HaveJson(this.componentData.entity) |
| | | this.getDeviceStatePage(newVal.value) |
| | | } |
| | | }, |
| | |
| | | this.closeLoading() |
| | | this.currentStep = 0 // æ¥éª¤æ¡æ¾ç¤ºç¬¬å æ¥ |
| | | this.currentStepClick = 0 // ç¹å»æ¥éª¤æ¡åå |
| | | this.$refs['form'].clearValidate() |
| | | this.$refs['form'] && this.$refs['form'].clearValidate() |
| | | } |
| | | } |
| | | }, |
| | |
| | | :page="page" :tableLoading="tableLoading"></lims-table> |
| | | </div> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="usageTableDia" |
| | | title="设å¤ä¿å
»è®¡å表" width="80%" @close="closeDialog"> |
| | | title="设å¤ä½¿ç¨ææè¡¨" width="80%" @close="closeDialog"> |
| | | <div style="display: flex;align-items: center;"> |
| | | <el-button size="small" type="primary" @click="addTableRow" v-if="operationType !== 'check'">æ·»å </el-button> |
| | | <span style="width: 60px;margin-left: 10px">年份ï¼</span> |
| | |
| | | clearable filterable multiple |
| | | :disabled="operationType === 'check'" |
| | | placeholder="è¯·éæ©" 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 responsibleOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | |
| | | } from "@/api/cnas/resourceDemand/device"; |
| | | import {selectUserCondition} from "@/api/system/user"; |
| | | import {mapGetters} from "@/utils/store-compat"; |
| | | import {formatListDate} from './dateFormat' |
| | | import {saveBlobOrShowError} from '@/utils/saveBlob' |
| | | |
| | | export default { |
| | | name: '', |
| | |
| | | column: [ |
| | | { label: '计å年份', prop: 'impowerYear' }, |
| | | { label: 'ç¼å¶äºº', prop: 'compiler' }, |
| | | { label: 'ç¼å¶æ¶é´', prop: 'datePreparation' }, |
| | | { label: 'ç¼å¶æ¶é´', prop: 'datePreparation', formatData: val => formatListDate(val) }, |
| | | { label: 'ææäºº', prop: 'audit' }, |
| | | { label: 'æææ¥æ', prop: 'auditDate' }, |
| | | { label: 'æææ¥æ', prop: 'auditDate', formatData: val => formatListDate(val) }, |
| | | { |
| | | dataType: 'tag', |
| | | label: 'ææç¶æ', |
| | |
| | | this.openDia('check', row); |
| | | }, |
| | | disabled: (row) => { |
| | | return row.status === 1 || this.userId !== row.auditId; |
| | | return row.status === 1 || this.userId != row.auditId; |
| | | }, |
| | | }, |
| | | { |
| | |
| | | }, |
| | | // å页忢 |
| | | pagination(page) { |
| | | this.page.current = page.page |
| | | this.page.size = page.limit |
| | | this.getTableList() |
| | | }, |
| | |
| | | getImpowerDetail({ impowerId: this.impowerId }).then(res => { |
| | | if (res.code === 200) { |
| | | this.form = res.data |
| | | this.deviceImpowerDetails = this.form.deviceImpowerDetails |
| | | this.deviceImpowerDetails = this.form.deviceImpowerDetails || [] |
| | | this.deviceImpowerDetails.forEach(item => { |
| | | item['delegatedUserArr'] = item.delegatedUser.split(',') |
| | | item['delegatedUserArr'] = item.delegatedUser ? String(item.delegatedUser).split(',') : [] |
| | | }) |
| | | } |
| | | }).catch(error => { |
| | |
| | | }, |
| | | // æäº¤æ°å¢åä¿®æ¹ |
| | | submitForm() { |
| | | if (!this.form.impowerYear) { |
| | | this.$message.warning('è¯·éæ©å¹´ä»½') |
| | | return |
| | | } |
| | | if (!this.deviceImpowerDetails.length) { |
| | | this.$message.warning('请添å 设å¤') |
| | | return |
| | | } |
| | | const noDelegatee = this.deviceImpowerDetails.find(item => { |
| | | return !Array.isArray(item.delegatedUserArr) || item.delegatedUserArr.length === 0 |
| | | }) |
| | | if (noDelegatee) { |
| | | this.$message.warning(`请为设å¤â${noDelegatee.deviceName || ''}âéæ©è¢«ææäºº`) |
| | | return |
| | | } |
| | | this.form.deviceImpowerDetails = this.HaveJson(this.deviceImpowerDetails) |
| | | this.form.deviceImpowerDetails.forEach((item) => { |
| | | item.delegatedUser = item.delegatedUserArr.join(',') |
| | | item.delegatedUser = Array.isArray(item.delegatedUserArr) ? item.delegatedUserArr.join(',') : '' |
| | | }) |
| | | this.submitFormLoading = true |
| | | if (this.operationType === 'add') { |
| | |
| | | }) |
| | | }, |
| | | openHandleOut (row) { |
| | | this.outLoading = true |
| | | exportDeviceImpower({ impowerId: row.impowerId }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/msword' }); |
| | | this.$download.saveAs(blob, '设å¤ä½¿ç¨ææè¡¨' + '.docx') |
| | | saveBlobOrShowError(res, '设å¤ä½¿ç¨ææè¡¨.docx', 'application/msword') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | handleDeleteClick(row) { |
| | |
| | | <!-- æä½æé® --> |
| | | <el-table-column align="center" fixed="right" label="æä½" min-width="150"> |
| | | <template #default="scope"> |
| | | <el-button :disabled="scope.row.ratifyStatus === 1" size="small" link type="primary" |
| | | <el-button :disabled="scope.row.isFinish === 1" size="small" link type="primary" |
| | | @click="handleForm(scope.row.externalApplyId)">æä½</el-button> |
| | | <el-button size="small" link type="primary" @click="handleDownOne(scope.row.externalApplyId)">导åº</el-button> |
| | | <el-button size="small" link type="danger" |
| | | <el-button :disabled="scope.row.isFinish === 1" size="small" link type="danger" |
| | | @click="deleteFun(scope.row.externalApplyId)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | <el-pagination :current-page="pagination1.current" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="pagination1.total" layout="->,total, sizes, prev, pager, next, jumper" background |
| | | @size-change="handleSizeChange1" @current-change="handleCurrentChange1"> |
| | | </el-pagination> |
| | |
| | | exportDeviceExternalApply, |
| | | delDeviceExternalApply, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | | export default { |
| | | name: "using-external-instruments", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | |
| | | this.outLoading = true |
| | | exportDeviceExternalApply({ externalApplyId: id }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, 'å©ç¨å¤é¨ä»ªå¨è®¾å¤ç³è¯·è¡¨.doc') |
| | | saveBlobOrShowError(res, 'å©ç¨å¤é¨ä»ªå¨è®¾å¤ç³è¯·è¡¨.doc', 'application/msword') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | // å é¤ |
| | |
| | | <overview v-if="menuListActiveName == 'è®¾å¤æ»è§'" :clickNodeVal="clickNodeVal" @refresh-tree="geList" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="设å¤å·¥å
·æç»" name="设å¤å·¥å
·æç»"> |
| | | <management v-if="menuListActiveName == '设å¤å·¥å
·æç»'" :clickNodeVal="clickNodeVal" /> |
| | | <management v-if="menuListActiveName == '设å¤å·¥å
·æç»'" :clickNodeVal="clickNodeVal" |
| | | @refresh-tree="geList" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="è®¾å¤æ ¡å计å" name="è®¾å¤æ ¡å计å"> |
| | | <equipment-calibration-plan v-if="menuListActiveName == 'è®¾å¤æ ¡å计å'" |
| | |
| | | <div v-if="!isShowAll" style="height: 100%;"> |
| | | <el-tabs v-model="tabListActiveName" class="main_right" type="border-card" @tab-click="handleClick"> |
| | | <el-tab-pane label="è®¾å¤æ¡£æ¡" name="è®¾å¤æ¡£æ¡"> |
| | | <files v-if="tabListActiveName == 'è®¾å¤æ¡£æ¡'" :clickNodeVal="clickNodeVal" /> |
| | | <files v-if="tabListActiveName == 'è®¾å¤æ¡£æ¡'" :clickNodeVal="clickNodeVal" |
| | | @refresh-tree="geList" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="设å¤éªæ¶" name="设å¤éªæ¶"> |
| | | <equipment-acceptance v-if="tabListActiveName == '设å¤éªæ¶'" :clickNodeVal="clickNodeVal"></equipment-acceptance> |
| | |
| | | import { |
| | | treeDevice, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import dayjs from 'dayjs' |
| | | export default { |
| | | name: 'Device', |
| | | components: { |
| | |
| | | // 夿æ¯å¦éè¦æ 红 |
| | | shouldHighlight(data) { |
| | | if (!data.activationDate) return false; |
| | | const today = new Date(); |
| | | const targetDate = new Date(data.activationDate); |
| | | const fiveDaysBeforeTarget = new Date(targetDate); |
| | | // 计ç®åäºå¤©çæ¥æ |
| | | fiveDaysBeforeTarget.setDate(targetDate.getDate() - 5); |
| | | |
| | | return today > fiveDaysBeforeTarget; |
| | | const targetDate = dayjs(data.activationDate); |
| | | if (!targetDate.isValid()) return false; |
| | | // æ ¡åæææå 1 个æå¼å§æ 红 |
| | | return dayjs().isAfter(targetDate.subtract(1, 'month')); |
| | | }, |
| | | handleNodeClick(val, node, el) { |
| | | // ç¹å»ä¸´æ¶ç¼å |
| | |
| | | <el-row> |
| | | <el-col :span="2"> |
| | | <el-menu @select="clickSelect" :default-active="activeName"> |
| | | <el-menu-item index="çµæºç¨³å®æ§"> |
| | | <span>çµæºç¨³å®æ§</span> |
| | | </el-menu-item> |
| | | <el-menu-item index="é²é·æ£æµ"> |
| | | <span>é²é·æ£æµ</span> |
| | | </el-menu-item> |
| | | <el-menu-item index="ç
§åº¦è®°å½"> |
| | | <span>ç
§åº¦è®°å½</span> |
| | | </el-menu-item> |
| | | <el-menu-item index="温湿度记å½"> |
| | | <span>温湿度记å½</span> |
| | | </el-menu-item> |
| | | </el-menu> |
| | | </el-col> |
| | | <el-col :span="22" style="padding: 10px"> |
| | | <power-supply-stability v-if="activeName === 'çµæºç¨³å®æ§'"/> |
| | | <lightning-protection-detection v-if="activeName === 'é²é·æ£æµ'" /> |
| | | <illuminance-recording v-if="activeName === 'ç
§åº¦è®°å½'"/> |
| | | <temperature-humidity-record v-if="activeName === '温湿度记å½'"/> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <script> |
| | | // çµæºç¨³å®æ§ |
| | | import PowerSupplyStability from "./facilities-environmental-conditions/power-supply-stability.vue"; |
| | | // é²é·æ£æµ |
| | | import LightningProtectionDetection from "./facilities-environmental-conditions/lightning-protection-detection.vue"; |
| | | // ç
§åº¦è®°å½ |
| | | import IlluminanceRecording from "./facilities-environmental-conditions/illuminance-recording.vue"; |
| | | // æ¸©æ¹¿åº¦è®°å½ |
| | | import TemperatureHumidityRecord from "./facilities-environmental-conditions/temperature-humidity-record.vue"; |
| | | |
| | | export default { |
| | | components: {TemperatureHumidityRecord, IlluminanceRecording, LightningProtectionDetection, PowerSupplyStability}, |
| | | components: {TemperatureHumidityRecord}, |
| | | data() { |
| | | return { |
| | | activeName: "çµæºç¨³å®æ§" |
| | | activeName: "温湿度记å½" |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: 'æ°é', |
| | | label: 'åå§æ°é', |
| | | prop: 'quantity', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: 'ä½é', |
| | | prop: 'remainingQuantity', |
| | | minWidth: '80' |
| | | }, |
| | | { |
| | | label: 'åä½', |
| | |
| | | clickFun: (row) => { |
| | | this.borrow(row); |
| | | }, |
| | | disabled: (row) => { |
| | | return Number(row.remainingQuantity) <= 0; |
| | | }, |
| | | }, |
| | | { |
| | | name: 'å é¤', |