| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- è®¾å¤æ ¡å --> |
| | | <template> |
| | | <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="handleDown">导åºExcel</el-button> |
| | | </div> |
| | | <div class="tables" style="margin-top: 16px;"> |
| | | <el-table :data="tableData" height="calc(100vh - 20em)"> |
| | | <el-table-column label="åºå·" type="index" width="120"> |
| | | <template v-slot="scope"> |
| | | <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="è®°å½ç¼å·" min-width="150" prop="processNumber"></el-table-column> |
| | | <el-table-column label="æ ¡åæºæ" min-width="150" prop="unitOfMeasure" |
| | | show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="æ ¡åç»è®º" min-width="150" prop="status"> |
| | | <template v-slot="scope"> |
| | | {{ scope.row.status === '0yes' ? 'åæ ¼' : scope.row.status === '1no' ? 'ä¸åæ ¼' : 'å
¶ä»' }} |
| | | </template> |
| | | </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="createUser"></el-table-column> |
| | | <el-table-column label="ç»è®°æ¥æ" min-width="150" prop="createTime"></el-table-column> |
| | | <el-table-column fixed="right" label="æä½" min-width="150"> |
| | | <template #default="{ row }"> |
| | | <el-button size="small" type="text" @click="handleAttachmentClick(row)">éä»¶</el-button> |
| | | <!-- <el-button size="small" type="text" @click="handleViewClick('view', row)">æ¥ç</el-button> --> |
| | | <el-button size="small" type="text" @click="handleViewClick('add', row)">ç¼è¾</el-button> |
| | | <el-button size="small" type="text" @click="handleDeleteClick(row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" style="margin-right: 5%;" |
| | | @size-change="handleSizeChange" @current-change="handleCurrentChange"> |
| | | </el-pagination> |
| | | </div> |
| | | <!-- æä»¶é¢è§ --> |
| | | <el-dialog |
| | | :visible.sync="lookDialogVisible" |
| | | fullscreen |
| | | title="æ¥çéä»¶" width="800px"> |
| | | <filePreview v-if="lookDialogVisible" :currentFile="{}" |
| | | :fileUrl="previewFile" style="height: 90vh;overflow-y: auto;top: 0"/> |
| | | </el-dialog> |
| | | <!-- éä»¶å¼¹æ¡ --> |
| | | <el-dialog |
| | | title="éä»¶" |
| | | :visible.sync="dialogVisibleFile" |
| | | width="60%" |
| | | > |
| | | <el-upload |
| | | ref="upload" |
| | | style="margin-top: 5px;margin-bottom: 10px;" |
| | | :action="action" |
| | | :data="uploadData" |
| | | :headers="uploadHeader" |
| | | :before-upload="beforeUpload" |
| | | :on-success="onSuccess" |
| | | > |
| | | <el-button type="primary" size="small" :loading="upLoading">ä¸ä¼ éä»¶</el-button> |
| | | </el-upload> |
| | | <el-table |
| | | :data="fileData" |
| | | border |
| | | height="400px" |
| | | style="width: 100%"> |
| | | <el-table-column label="åºå·" type="index" width="240px"> |
| | | </el-table-column> |
| | | <el-table-column label="æä»¶åç§°" prop="fileName"> |
| | | </el-table-column> |
| | | <el-table-column label="æä½"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="preview(scope.row)">é¢è§</el-button> |
| | | <el-button type="text" @click="download(scope.row)">ä¸è½½</el-button> |
| | | <el-button type="text" @click="delFile(scope.row)" style="color: red;">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="dialogVisibleFile = false">å
³ é</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | |
| | | |
| | | <!-- æ ¡å项ç®ç»´æ¤ --> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible0" title="æ ¡å项ç®ç»´æ¤" |
| | | top="5vh" width="70%"> |
| | | <h4> |
| | | <span style="display: flex;align-items: center;"><span class="line"></span><span>è®¾å¤æ ¡ååæ°ç»´æ¤</span></span> |
| | | <el-button :loading="addCalibrateLoading" size="small" type="primary" @click="addCalibrate">æ·» å </el-button> |
| | | </h4> |
| | | <div> |
| | | <el-form ref="form0" :model="form0" :rules="form0Rules" |
| | | label-position="right" label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="计éåæ°:" prop="measurementParameter"> |
| | | <el-input v-model="form0.measurementParameter" clearable placeholder="请è¾å
¥" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="éç¨èå´:" prop="rangeOfMeasurement"> |
| | | <el-input v-model="form0.rangeOfMeasurement" clearable placeholder="请è¾å
¥" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æå¤§å
许误差:" prop="maxPermissibleError"> |
| | | <el-input v-model="form0.maxPermissibleError" clearable placeholder="请è¾å
¥" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å¤å®æ å:" prop="judgmentCriteria"> |
| | | <el-input v-model="form0.judgmentCriteria" clearable placeholder="请è¾å
¥" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | | <h4> |
| | | <span style="display: flex;align-items: center;"><span class="line"></span><span>è®¾å¤æ ¡ååæ°</span></span> |
| | | </h4> |
| | | <!-- è®¾å¤æ ¡ååæ°è¡¨æ ¼ --> |
| | | <el-table ref="calibrateTable" v-loading="calibrateParamsLoading" :data="calibrateParams" |
| | | max-height="450" |
| | | stripe style="width: 100%"> |
| | | <el-table-column label="ç¼å·" type="index" width="80"></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="createdBy"></el-table-column> |
| | | <el-table-column label="å建æ¶é´" prop="creationTime"></el-table-column> |
| | | <el-table-column fixed="right" label="æä½"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="small" type="text" @click="handleDelete(scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | |
| | | <!-- æ·»å æ ¡åè®°å½ --> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="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-input v-model="calibrationRecord.unitOfMeasure" :disabled="operationType === 'view'" |
| | | size="small"></el-input> |
| | | </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 label="0yes">åæ ¼</el-radio> |
| | | <el-radio label="1no">ä¸åæ ¼</el-radio> |
| | | <el-radio label="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"> |
| | | <el-button v-if="operationType === 'add'" slot="append" icon="el-icon-delete-solid" |
| | | @click="deleteFile"></el-button> |
| | | </el-input> |
| | | <el-upload v-if="operationType === 'add'" ref="upload" :action="action" :before-upload="beforeUpload" :headers="headers" |
| | | :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 slot="header" slot-scope="scope"> |
| | | <span class="required-span">* </span>æ¯å¦æ ¡å |
| | | </template> |
| | | <template slot-scope="scope"> |
| | | <el-radio-group v-model="scope.row.isCalibration" :disabled="operationType === 'view'"> |
| | | <el-radio label="0yes">æ¯</el-radio> |
| | | <el-radio label="1no">å¦</el-radio> |
| | | </el-radio-group> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å¤å®ç»æ" min-width="140" prop="result"> |
| | | <template slot="header" slot-scope="scope"> |
| | | <span class="required-span">* </span>å¤å®ç»æ |
| | | </template> |
| | | <template slot-scope="scope"> |
| | | <el-radio-group v-model="scope.row.result" :disabled="operationType === 'view'" @input="checkRadio()"> |
| | | <el-radio label="0yes">åæ ¼</el-radio> |
| | | <el-radio label="1no">ä¸åæ ¼</el-radio> |
| | | <el-radio label="2other">å
¶ä»</el-radio> |
| | | </el-radio-group> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="åé¡¹ç»æè¯´æ" prop="singleResultStatement"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-model="scope.row.singleResultStatement" :disabled="operationType === 'view'" |
| | | size="small"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- æä½æ¥å¿ --> |
| | | <!-- <h4>--> |
| | | <!-- <div style="display: flex;--> |
| | | <!-- align-items: center;">--> |
| | | <!-- <span class="line"></span><span>æ¬è®°å½ç¶æåæä½æ¥å¿</span>--> |
| | | <!-- </div>--> |
| | | <!-- </h4>--> |
| | | <!-- <el-table :data="tableDataOperate" style="width: 100%">--> |
| | | <!-- <el-table-column type="index" label="åºå·" width="100"></el-table-column>--> |
| | | <!-- <el-table-column prop="operator" label="æä½äºº" width="120"></el-table-column>--> |
| | | <!-- <el-table-column prop="operationTime" label="æä½æ¶é´" width="180"></el-table-column>--> |
| | | <!-- <el-table-column prop="operationType" label="æä½ç±»å" width="120"></el-table-column>--> |
| | | <!-- <el-table-column prop="operationContent" label="æä½å
容"></el-table-column>--> |
| | | <!-- </el-table>--> |
| | | </div> |
| | | <span slot="footer" 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> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | deviceMetricRecordPage, |
| | | showDeviceMetricsCopy, |
| | | deleteDeviceMetricRecord, |
| | | deviceMetricRecordExport, |
| | | deleteCNASFile, |
| | | selectDeviceMetric, |
| | | deleteDeviceMetrics, |
| | | addOrUpdateDeviceMetricRecord, |
| | | saveOrUpdateDeviceMetric, downLoadDeviceCalibrationFile, getDeviceCalibrationFile, delDeviceCalibrationFile |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { mapGetters } from "vuex"; |
| | | import filePreview from "@/components/Preview/filePreview.vue"; |
| | | export default { |
| | | components: {filePreview}, |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | value: "", |
| | | calibrateParams: [], |
| | | calibrateParamsLoading: false, |
| | | addCalibrateLoading: false, |
| | | previewFile: '', |
| | | lookDialogVisible: false, |
| | | recordId: null, |
| | | uploadData: {}, |
| | | fileData: [], |
| | | dialogVisibleFile: false, |
| | | calibrationRecord: { |
| | | unitOfMeasure: '', // 计éåä½ |
| | | calibrationDate: null, // æ ¡åæ¥æ |
| | | nextCalibrationDate: null, // 䏿¬¡æ ¡åæ¥æ |
| | | calculatingApparatus: '', // 计ç®å¨å
· |
| | | confirmDate: null, // ç¡®è®¤æ¥æ |
| | | standardRange: '', // è®¡ç®æ åéç¨ |
| | | calibrationStandardUncertainty: '', // è®¡éæ åä¸ç¡®å®åº¦ |
| | | byDocument: '', // 便®æä»¶ |
| | | certificateSerialNumber: '', // è¯ä¹¦ç¼å· |
| | | status: '', // ç¶æ |
| | | remark: '', // 夿³¨ |
| | | systemFileName: '', // |
| | | fileName: '', // |
| | | }, |
| | | formRules: { |
| | | unitOfMeasure: [{ required: true, message: '请è¾å
¥æ ¡åæå¡æºæ', trigger: 'blur' }], |
| | | 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: '', |
| | | maxPermissibleError: '', |
| | | judgmentCriteria: '', |
| | | createdBy: '', |
| | | action: '', |
| | | deviceId: null |
| | | }, |
| | | form0Rules: { |
| | | measurementParameter: [ |
| | | { required: true, message: '请è¾å
¥è®¡éåæ°', trigger: 'blur' } |
| | | ], |
| | | rangeOfMeasurement: [ |
| | | { required: true, message: '请è¾å
¥éç¨èå´', trigger: 'blur' } |
| | | ], |
| | | maxPermissibleError: [ |
| | | { required: true, message: '请è¾å
¥æå¤§å
许误差', trigger: 'blur' } |
| | | ], |
| | | judgmentCriteria: [ |
| | | { required: true, message: '请è¾å
¥å¤å®æ å', trigger: 'blur' } |
| | | ], |
| | | }, |
| | | addRecordLoading: false, |
| | | upLoading: false, |
| | | operationType: '', |
| | | search: { |
| | | size: 20, |
| | | current: 1, |
| | | total: 0 |
| | | }, |
| | | } |
| | | }, |
| | | // ç¨äºä¸ä¼ æä»¶çä¿¡æ¯ |
| | | computed: { |
| | | ...mapGetters(["nickName"]), |
| | | action() { |
| | | return this.javaApi + '/personBasicInfo/saveCNASFile' |
| | | } |
| | | }, |
| | | mounted() { |
| | | //è·åæä½è®°å½ä¿¡æ¯ |
| | | this.getTableList(this.clickNodeVal.value) // è·åè®¾å¤æ ¡ååè¡¨æ°æ® |
| | | }, |
| | | methods: { |
| | | preview(row) { |
| | | let list = row.fileUrl.split('.') |
| | | let suffix = list[list.length - 1] |
| | | if(suffix.toLowerCase().includes("pdf")) { |
| | | let link = document.createElement('a') |
| | | let url = this.javaApi + 'word' + row.fileUrl |
| | | console.log(url); |
| | | link.href = url |
| | | link.target= '_blank' |
| | | document.body.appendChild(link) |
| | | link.click() |
| | | document.body.removeChild(link) |
| | | }else{ |
| | | let url = '' |
| | | if(suffix.toLowerCase().includes('docx')) { |
| | | url = this.javaApi + 'word' + row.fileUrl |
| | | }else if(suffix.toLowerCase().includes('xls')) { |
| | | url = this.javaApi + 'excel' + row.fileUrl |
| | | }else{ |
| | | url = this.javaApi + 'img' + row.fileUrl |
| | | } |
| | | this.previewFile = url |
| | | this.$nextTick(() => { |
| | | this.lookDialogVisible = true |
| | | }) |
| | | } |
| | | }, |
| | | download(row) { |
| | | downLoadDeviceCalibrationFile({id: row.id}).then(res => { |
| | | const blob = new Blob([res],{type: row.mime}) |
| | | this.$download.saveAs(blob, row.fileName) |
| | | }) |
| | | }, |
| | | delFile(row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delDeviceCalibrationFile({id: row.id}).then(res => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'å 餿å!' |
| | | }); |
| | | this.getFileData(this.recordId); |
| | | }) |
| | | }) |
| | | }, |
| | | handleAttachmentClick(row) { |
| | | // 模æä¸è½½éä»¶ |
| | | // const imageUrl = this.javaApi + '/img/' + row.systemFileName; // å¾ç URL |
| | | // file.downloadIamge(imageUrl,row.fileName) |
| | | this.recordId = row.id |
| | | this.dialogVisibleFile = true |
| | | this.getFileData(row.id) |
| | | }, |
| | | getFileData(id) { |
| | | getDeviceCalibrationFile({id: id}).then(res =>{ |
| | | this.fileData = res.data |
| | | }) |
| | | }, |
| | | //ç¶æå¤å® |
| | | 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 |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.search.size = val |
| | | this.getTableList(this.clickNodeVal.value); |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.search.current = val |
| | | this.getTableList(this.clickNodeVal.value); |
| | | }, |
| | | getTableList(deviceId) { |
| | | deviceMetricRecordPage({ deviceId, type: 'calibrate', ...this.search }).then(res => { |
| | | this.tableData = res.data.records |
| | | this.search.total = res.data.total |
| | | }) |
| | | }, |
| | | // æ·»å æ ¸æ¥è®°å½ |
| | | add(type) { |
| | | this.operationType = type |
| | | this.dialogVisible1 = true |
| | | this.getXmsg() |
| | | }, |
| | | // æ¥ç详æ
|
| | | handleViewClick(type, row) { |
| | | showDeviceMetricsCopy({ id: row.id, type: 'calibrate' }).then(res => { |
| | | this.calibrateParams = res.data |
| | | }) |
| | | this.calibrationRecord = { ...row } |
| | | this.operationType = type |
| | | this.dialogVisible1 = true |
| | | }, |
| | | // è¡¨æ ¼å é¤æä½ |
| | | handleDeleteClick(row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteDeviceMetricRecord({ id: row.id }).then(res => { |
| | | this.getTableList(this.clickNodeVal.value) // è·åè®¾å¤æ ¡ååè¡¨æ°æ® |
| | | this.$message.success('å 餿åï¼') |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }) |
| | | }, |
| | | //å¯¼åº |
| | | handleDown() { |
| | | this.outLoading = true |
| | | deviceMetricRecordExport({ |
| | | deviceId: this.clickNodeVal.value, |
| | | type: 'calibrate' |
| | | }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, 'è®¾å¤æ ¡å.xlsx') |
| | | }) |
| | | }, |
| | | 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('å 餿åï¼') |
| | | } |
| | | }) |
| | | }).catch((err) => { |
| | | console.log('err----', err) |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | // æ ¡å项ç®ç»´æ¤ |
| | | calibrationMaintenance() { |
| | | this.dialogVisible0 = true |
| | | this.getXmsg(); |
| | | }, |
| | | // è·åè®¾å¤æ ¡ååæ°tableä¿¡æ¯ |
| | | async getXmsg() { |
| | | this.calibrateParamsLoading = true |
| | | try { |
| | | await selectDeviceMetric({ deviceId: this.clickNodeVal.value, type: 'calibrate' }).then(res => { |
| | | if (res.code == 200) { |
| | | this.calibrateParams = res.data |
| | | } |
| | | this.calibrateParamsLoading = false |
| | | }) |
| | | } catch (e) { |
| | | console.log('getXmsg---', e) |
| | | this.calibrateParamsLoading = false |
| | | } |
| | | }, |
| | | // æ ¡å项ç®ç»´æ¤-å é¤è®¾å¤æ ¡ååæ° |
| | | handleDelete(row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteDeviceMetrics({ id: row.id }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('å 餿å!'); |
| | | this.getXmsg(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message.info('已忶å é¤'); |
| | | }) |
| | | }, |
| | | addCalibrate() { |
| | | this.$refs['form0'].validate((valid) => { |
| | | if (valid) { |
| | | // ä¿å |
| | | this.calibrateParamsLoading = true |
| | | this.addCalibrateLoading = true |
| | | this.form0.deviceId = this.clickNodeVal.value; |
| | | this.form0.createdBy = this.nickName; |
| | | this.form0.type = 'calibrate' |
| | | saveOrUpdateDeviceMetric(this.form0).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿åæå') |
| | | this.$refs['form0'].resetFields() |
| | | this.getXmsg() // å·æ°è®¾å¤æ ¡ååæ°è¡¨æ ¼ |
| | | } |
| | | this.calibrateParamsLoading = false |
| | | this.addCalibrateLoading = false |
| | | }) |
| | | } else { |
| | | this.addCalibrateLoading = false |
| | | this.$message.warning('æå¿
填项æªå¡«'); |
| | | } |
| | | }) |
| | | }, |
| | | 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) { |
| | | let list = file.name.split('.') |
| | | let suffix = list[list.length - 1] |
| | | |
| | | console.log(suffix); |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M'); |
| | | this.$refs.upload.clearFiles() |
| | | return false; |
| | | } else { |
| | | this.upLoading = true; |
| | | this.$set(this.uploadData,'id',this.recordId) |
| | | this.$set(this.uploadData,'suffix',suffix) |
| | | return true; |
| | | } |
| | | }, |
| | | onSuccess(response,file,fileList) { |
| | | if(response.code == 200) { |
| | | this.$message.success("ä¸ä¼ æå") |
| | | this.upLoading = false |
| | | this.$refs.upload.clearFiles() |
| | | this.getFileData(this.recordId) |
| | | } else { |
| | | this.$message.error(response.msg) |
| | | } |
| | | }, |
| | | onError(err, file, fileList) { |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | | // end |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | 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: '', // 夿³¨ |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | </script> |
| | | <style scoped> |
| | | .tables { |
| | | width: 100%; |
| | | height: calc(100vh - 230px); |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | height: 40px; |
| | | display: flex; |
| | | align-items: center; |
| | | position: relative; |
| | | } |
| | | |
| | | .search_thing { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 40px; |
| | | } |
| | | |
| | | .search_label { |
| | | width: 70px; |
| | | font-size: 14px; |
| | | text-align: right; |
| | | margin-right: 10px; |
| | | } |
| | | |
| | | .search_input { |
| | | width: calc(100% - 110px); |
| | | } |
| | | |
| | | .btnS { |
| | | text-align: right; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | 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: #3A7BFA; |
| | | margin-right: 4px; |
| | | } |
| | | |
| | | .check { |
| | | background-color: #fff; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .check_thing { |
| | | flex: 0 0 calc(20% - 10px); |
| | | margin-bottom: 20px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: flex-start; |
| | | } |
| | | |
| | | .check_label { |
| | | font-size: 14px; |
| | | margin-bottom: 5px; |
| | | } |
| | | |
| | | .check_data .check_input { |
| | | width: 100%; |
| | | } |
| | | |
| | | .el-table { |
| | | font-size: 14px; |
| | | color: #333; |
| | | } |
| | | |
| | | .el-table thead { |
| | | background-color: #f5f5f5; |
| | | } |
| | | </style> |