| | |
| | | </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" @click="downLoadPost">导出</el-button> |
| | | </div> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="备注" min-width="130" prop="remark"></el-table-column> |
| | | <el-table-column label="附件" min-width="140"> |
| | | <template #default="scope"> |
| | | <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="260"> |
| | | <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" |
| | | @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 @click="downloadDialog = false">取 消</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, |
| | |
| | | export default { |
| | | name: "equipment-verification-plan", |
| | | // import 引入的组件需要注入到对象中才能使用 |
| | | components: { CheckRecord, EquipmentCheck }, |
| | | components: { CheckRecord }, |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | |
| | | yearTableDetailDataLoading: false, |
| | | submitFormLoading: false, |
| | | userList: [], |
| | | equipmentCheck: false, |
| | | checkRecord: false, |
| | | downloadDialog: false, |
| | | outLoading: false, |
| | |
| | | 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 |
| | | }) |
| | | }, |
| | |
| | | :deep(.red-row td) { |
| | | background: #ffcccc !important; |
| | | } |
| | | |
| | | .row-upload { |
| | | display: inline-block; |
| | | margin-left: 10px; |
| | | vertical-align: middle; |
| | | } |
| | | </style> |