| | |
| | | </el-select> |
| | | </div> |
| | | <div> |
| | | <el-button size="small" type="primary" @click="handleAddRecord">新增核查记录</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> |
| | |
| | | </template> |
| | | </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"> |
| | | <el-table-column label="附件" min-width="140"> |
| | | <template #default="scope"> |
| | | <el-button size="small" link type="primary" :disabled="planInfo.ratifyStatus === 1" |
| | | <el-link v-if="scope.row.fileUrl" type="primary" @click="openAttachment(scope.row)"> |
| | | {{ scope.row.fileName || '查看附件' }} |
| | | </el-link> |
| | | <span v-else>—</span> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- 操作按钮 --> |
| | | <el-table-column align="center" fixed="right" label="操作" min-width="320"> |
| | | <template #default="scope"> |
| | | <el-button size="small" link type="primary" |
| | | @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 v-if="scope.row.recordStatus === 1" size="small" link type="primary" |
| | | @click="handleRecord(scope.row)">审核</el-button> |
| | | <el-upload class="row-upload" :action="javaApi + '/deviceScope/uploadFile'" |
| | | :headers="uploadHeader" :show-file-list="false" :before-upload="beforeAttachmentUpload" |
| | | :on-success="(res) => handleAttachmentSuccess(res, scope.row)" |
| | | :on-error="handleAttachmentError"> |
| | | <el-button size="small" link type="primary">上传附件</el-button> |
| | | </el-upload> |
| | | <el-button size="small" link type="primary" @click="handleDown(scope.row)">导出</el-button> |
| | | <el-button size="small" link type="danger" :disabled="planInfo.ratifyStatus === 1" |
| | | @click="deleteFun1(scope.row.planDetailsId)">删除</el-button> |
| | | <el-button v-if="scope.row.recordStatus === 0 && scope.row.recordContrastStatus === 0" |
| | | size="small" link type="danger" @click="deleteFun1(scope.row.planDetailsId)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </el-pagination> |
| | | </div> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="dialogVisible" title="设备核查计划" |
| | | width="80%" @close="resetForm"> |
| | | width="50%" @close="resetForm"> |
| | | <el-form ref="modelForm" :model="form" :rules="rules" label-width="110px"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设备编号:" prop="deviceNumber"> |
| | | <el-input v-model="form.deviceNumber" :disabled="operationType === 'view'" clearable |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设备名称:" prop="deviceName"> |
| | | <el-input v-model="form.deviceName" :disabled="operationType === 'view'" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="核查时间:" prop="checkTime"> |
| | | <el-date-picker v-model="form.checkTime" :disabled="operationType === 'view'" clearable format="YYYY-MM" |
| | | placeholder="选择日期" size="small" style="width:100%" type="month" value-format="YYYY-MM"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="核查指标:" prop="checkIndex"> |
| | | <el-input v-model="form.checkIndex" :disabled="operationType === 'view'" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="核查方法:" prop="checkMethod"> |
| | | <el-input v-model="form.checkMethod" :disabled="operationType === 'view'" clearable size="small" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="结果如何判定:" prop="howResults"> |
| | | <el-input v-model="form.howResults" :disabled="operationType === 'view'" clearable size="small" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <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 chargerOptions" :key="item.id" :label="item.name" :value="item.id"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="备注:" prop="remark"> |
| | | <el-input v-model="form.remark" :disabled="operationType === 'view'" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-form-item label="设备编号:" prop="deviceNumber"> |
| | | <el-input v-model="form.deviceNumber" :disabled="operationType === 'view'" clearable |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="设备名称:" prop="deviceName"> |
| | | <el-input v-model="form.deviceName" :disabled="operationType === 'view'" clearable |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="核查时间:" prop="checkTime"> |
| | | <el-date-picker v-model="form.checkTime" :disabled="operationType === 'view'" clearable format="YYYY-MM" |
| | | placeholder="选择日期" size="small" style="width:100%" type="month" value-format="YYYY-MM"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="核查指标:" prop="checkIndex"> |
| | | <el-input v-model="form.checkIndex" :disabled="operationType === 'view'" clearable |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="核查方法:" prop="checkMethod"> |
| | | <el-input v-model="form.checkMethod" :disabled="operationType === 'view'" clearable size="small" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="结果如何判定:" prop="howResults"> |
| | | <el-input v-model="form.howResults" :disabled="operationType === 'view'" clearable size="small" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | <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 chargerOptions" :key="item.id" :label="item.name" |
| | | :value="item.id"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="备注:" prop="remark"> |
| | | <el-input v-model="form.remark" :disabled="operationType === 'view'" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | </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> |
| | | </span></template> |
| | | </el-dialog> |
| | | <el-dialog v-model="approvalDialog" title="批准" width="30%" @close="approvalDialog = false"> |
| | | <span> |
| | | 批准备注: |
| | | <el-input v-model="ratifyRemark" type="textarea"></el-input> |
| | | </span> |
| | | <template #footer><span class="dialog-footer"> |
| | | <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="downloadDialog" title="导出" width="600px"> |
| | |
| | | <el-button @click="downloadDialog = false">取 消</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="ratifyUserId" clearable filterable size="small" style="width: 90%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </span> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button :loading="notificationLoading" @click="closeNotificationDia">取 消</el-button> |
| | | <el-button :loading="notificationLoading" type="primary" @click="notification">提 交</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | | <equipment-check v-if="equipmentCheck" ref="equipmentCheck" @closeDialog="closeDialog"></equipment-check> |
| | | <check-record v-if="checkRecord" ref="checkRecord" @closeDialog1="closeDialog1"></check-record> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import EquipmentCheck from "./equipmentCheck.vue"; |
| | | import CheckRecord from "./checkRecord.vue"; |
| | | import { |
| | | pageDeviceExaminePlan, |
| | | getExaminePlanByYear, |
| | | submitRatifyDeviceExaminePlan, |
| | | exportDeviceExaminePlanDetail, |
| | | delDeviceExaminePlanDetail, |
| | | pageDeviceExaminePlanDetail, |
| | | updateDeviceExaminePlanDetail, |
| | | ratifyDeviceExaminePlan, |
| | | exportReviewExamineRecordDetail, |
| | | exportReviewExamineRecordContrast, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | 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: { CheckRecord, EquipmentCheck }, |
| | | components: { CheckRecord }, |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | |
| | | checkMethod: [{ required: true, message: '请填写核查方法', trigger: 'blur' }], |
| | | }, |
| | | yearTableDetailDataLoading: false, |
| | | approvalDialog: false, |
| | | approvalLoading: false, |
| | | submitFormLoading: false, |
| | | ratifyRemark: '', |
| | | currentRowId: '', |
| | | userList: [], |
| | | equipmentCheck: false, |
| | | checkRecord: false, |
| | | downloadDialog: false, |
| | | outLoading: false, |
| | | downRow: {}, |
| | | responsibleOptions: [], |
| | | notificationDia: false, |
| | | notificationLoading: false, |
| | | ratifyUserId: '', |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | // 打开提交批准弹框 |
| | | tellApprove() { |
| | | this.getUserList1() |
| | | this.notificationDia = true |
| | | }, |
| | | // 关闭提交批准弹框 |
| | | closeNotificationDia() { |
| | | this.notificationDia = false |
| | | this.ratifyUserId = '' |
| | | }, |
| | | // 提交批准通知 |
| | | notification() { |
| | | if (!this.ratifyUserId) { |
| | | this.$message.warning('请选择批准人') |
| | | return |
| | | } |
| | | this.notificationLoading = true |
| | | submitRatifyDeviceExaminePlan({ |
| | | ratifyUserId: this.ratifyUserId, |
| | | planId: this.planInfo.planId, |
| | | }).then(res => { |
| | | this.notificationLoading = false |
| | | if (res.code == 200) { |
| | | this.closeNotificationDia() |
| | | this.loadPlan() |
| | | } |
| | | }).catch(err => { |
| | | this.notificationLoading = false |
| | | }) |
| | | }, |
| | | // 批准 |
| | | handleApprove() { |
| | | this.currentRowId = this.planInfo.planId |
| | | this.approvalDialog = true |
| | | }, |
| | | // 提交批准结果 |
| | | handleApproval(status) { |
| | | const personTrainingUpdateDto = { |
| | | planId: this.currentRowId, |
| | | ratifyRemark: this.ratifyRemark, |
| | | ratifyStatus: status |
| | | } |
| | | this.approvalLoading = true |
| | | ratifyDeviceExaminePlan(personTrainingUpdateDto).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('提交成功!'); |
| | | this.approvalDialog = false |
| | | this.loadPlan() |
| | | } |
| | | this.approvalLoading = false |
| | | }).catch(() => { |
| | | this.approvalLoading = false |
| | | }) |
| | | }, |
| | | // 导出年度计划表 |
| | | downLoadPost() { |
| | | exportDeviceExaminePlanDetail({ planId: this.planInfo.planId }).then(res => { |
| | |
| | | this.$refs.modelForm.resetFields(); |
| | | this.dialogVisible = false |
| | | }, |
| | | // 打开对比流程弹框 |
| | | handleCheck(row) { |
| | | this.equipmentCheck = true |
| | | this.$nextTick(() => { |
| | | this.$refs.equipmentCheck.openDialog(row) |
| | | }) |
| | | }, |
| | | // 关闭对比弹框 |
| | | closeDialog() { |
| | | this.equipmentCheck = false |
| | | this.getYearTableDetailData() |
| | | }, |
| | | // 打开记录弹框 |
| | | // 打开核查记录(待批准时用于审核) |
| | | handleRecord(row) { |
| | | this.checkRecord = true |
| | | this.$nextTick(() => { |
| | | this.$refs.checkRecord.openDialog(row) |
| | | }) |
| | | }, |
| | | // 新增核查记录(可自选设备) |
| | | handleAddRecord() { |
| | | this.checkRecord = true |
| | | this.$nextTick(() => { |
| | | this.$refs.checkRecord.openAddDialog() |
| | | }) |
| | | }, |
| | | // 打开附件 |
| | | openAttachment(row) { |
| | | const isImage = /\.(jpg|jpeg|png|gif)$/i.test(row.fileUrl) |
| | | window.open(this.javaApi + (isImage ? '/img/' : '/word/') + row.fileUrl, '_blank') |
| | | }, |
| | | beforeAttachmentUpload(file) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('上传文件不超过10M') |
| | | return false |
| | | } |
| | | return true |
| | | }, |
| | | // 附件上传成功后保存到计划明细 |
| | | handleAttachmentSuccess(response, row) { |
| | | if (response.code == 200) { |
| | | updateDeviceExaminePlanDetail({ |
| | | planDetailsId: row.planDetailsId, |
| | | fileName: response.data.name, |
| | | fileUrl: response.data.url |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('附件上传成功') |
| | | this.getYearTableDetailData() |
| | | } else { |
| | | this.$message.error(res.msg || '附件保存失败') |
| | | } |
| | | }) |
| | | } else { |
| | | this.$message.error(response.msg || '附件上传失败') |
| | | } |
| | | }, |
| | | handleAttachmentError() { |
| | | this.$message.error('附件上传失败') |
| | | }, |
| | | // 关闭记录弹框 |
| | | closeDialog1() { |
| | |
| | | }) |
| | | }, |
| | | getUserList() { |
| | | selectUserCondition().then(res => { |
| | | selectUserCondition({ type: 4 }).then(res => { |
| | | this.userList = res.data |
| | | }) |
| | | }, |
| | |
| | | if (index > -1) { |
| | | this.form.checkChargerUser = this.userList[index].name |
| | | } |
| | | }, |
| | | // 获取负责人信息接口 |
| | | getUserList1() { |
| | | selectUserCondition().then(res => { |
| | | if (res.code == 200) { |
| | | this.responsibleOptions = res.data |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userId"]), |
| | | // 是否已完成审批(批准/不批准) |
| | | isRatified() { |
| | | return this.planInfo.ratifyStatus === 0 || this.planInfo.ratifyStatus === 1; |
| | |
| | | :deep(.red-row td) { |
| | | background: #ffcccc !important; |
| | | } |
| | | |
| | | .row-upload { |
| | | display: inline-block; |
| | | margin-left: 10px; |
| | | vertical-align: middle; |
| | | } |
| | | </style> |