Merge branch 'dev' of http://114.132.189.42:9002/r/center-lims-before-ruoyi into dev
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // ä¸ç¡®å®åº¦è¯å®ç¸å
³æ¥å£ |
| | | import request from "@/utils/request"; |
| | | |
| | | //è®¾å¤æ å½¢ |
| | | export function treeDevice(query) { |
| | | return request({ |
| | | url: "/deviceScope/treeDevice", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æ¥è¯¢è®¾å¤è¯¦æ
å表 |
| | | export function selectDeviceParameter(query) { |
| | | return request({ |
| | | url: "/deviceScope/selectDeviceParameter", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //è·åå®éªå®¤åç§° |
| | | export function obtainItemParameterList(query) { |
| | | return request({ |
| | | url: "/laboratoryScope/obtainItemParameterList", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //设å¤å·¥å
·æç»å¯¼åº |
| | | export function exportEquipmentDetails(query) { |
| | | return request({ |
| | | url: "/deviceScope/exportEquipmentDetails", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //设å¤éé¢éæ©æ£éªé¡¹ç®(æ å½¢ç»æ) |
| | | export function getInsProduction(query) { |
| | | return request({ |
| | | url: "/capacityScope/getInsProduction", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹è®¾å¤è¯¦æ
åæ° |
| | | export function upDeviceParameter(data) { |
| | | return request({ |
| | | url: "/deviceScope/upDeviceParameter", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // æ·»å 设å¤è¯¦æ
åæ° |
| | | export function addDeviceParameter(data) { |
| | | return request({ |
| | | url: "/deviceScope/addDeviceParameter", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ç»´æ¤æ°éé
ç½® |
| | | export function numberCollect(data) { |
| | | return request({ |
| | | url: "/deviceScope/numberCollect", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //设å¤é¢çº¦æ¥å£-å表 |
| | | export function getDeviceParameter(query) { |
| | | return request({ |
| | | url: "/deviceScope/selectDeviceParameter", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //å é¤è®¾å¤è¯¦æ
åæ° |
| | | export function delDeviceParameter(query) { |
| | | return request({ |
| | | url: "/deviceScope/delDeviceParameter", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æ¥è¯¢æ°éé
ç½® |
| | | export function queryDataAcquisitionConfiguration(query) { |
| | | return request({ |
| | | url: "/deviceScope/queryDataAcquisitionConfiguration", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // ç»´æ¤æ°éé
ç½® |
| | | export function saveDataAcquisitionConfiguration(data) { |
| | | return request({ |
| | | url: "/deviceScope/saveDataAcquisitionConfiguration", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //å 餿°éé
ç½® |
| | | export function deleteDataAcquisitionConfiguration(data) { |
| | | return request({ |
| | | url: "/deviceScope/deleteDataAcquisitionConfiguration", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ ¡å计åå表æ¥è¯¢ |
| | | export function pageDeviceCalibrationPlan(query) { |
| | | return request({ |
| | | url: "/deviceCalibrationPlan/pageDeviceCalibrationPlan", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æäº¤æ¹åéç¥ |
| | | export function submiatRatifyDeviceCalibrationPlan(data) { |
| | | return request({ |
| | | url: "/deviceCalibrationPlan/submiatRatifyDeviceCalibrationPlan", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ ¡å计åå¯¼åº |
| | | export function exportDeviceCalibrationPlanDetail(query) { |
| | | return request({ |
| | | url: "/deviceCalibrationPlan/exportDeviceCalibrationPlanDetail", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // è®¾å¤æ ¡å æ°å¢ æ´æ° |
| | | export function addOrUpdateDeviceMetricRecord(data) { |
| | | return request({ |
| | | url: "/deviceMetricRecord/addOrUpdateDeviceMetricRecord", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ ¡å计åå é¤ |
| | | export function delDeviceCalibrationPlan(query) { |
| | | return request({ |
| | | url: "/deviceCalibrationPlan/delDeviceCalibrationPlan", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ ¡å计å详æ
å é¤ |
| | | export function delDeviceCalibrationPlanDetail(query) { |
| | | return request({ |
| | | url: "/deviceCalibrationPlan/delDeviceCalibrationPlanDetail", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ ¡å计å详æ
å表 |
| | | export function pageDeviceCalibrationPlanDetail(query) { |
| | | return request({ |
| | | url: "/deviceCalibrationPlan/pageDeviceCalibrationPlanDetail", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢è®¾å¤æ ¡å计å详æ
|
| | | export function addDeviceCalibrationPlanDetail(data) { |
| | | return request({ |
| | | url: "/deviceCalibrationPlan/addDeviceCalibrationPlanDetail", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹è®¾å¤æ ¡å计å详æ
|
| | | export function updateDeviceCalibrationPlanDetail(data) { |
| | | return request({ |
| | | url: "/deviceCalibrationPlan/updateDeviceCalibrationPlanDetail", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // è®¾å¤æ ¡åè®¡åæ¹å |
| | | export function ratifyDeviceCalibrationPlan(data) { |
| | | return request({ |
| | | url: "/deviceCalibrationPlan/ratifyDeviceCalibrationPlan", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //æ¥è¯¢è®¾å¤æ ¡å计å详æ
|
| | | export function getDeviceCalibrationPlan(query) { |
| | | return request({ |
| | | url: "/deviceCalibrationPlan/getDeviceCalibrationPlan", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢è®¾å¤æ ¡å计å |
| | | export function addDeviceCalibrationPlan(data) { |
| | | return request({ |
| | | url: "/deviceCalibrationPlan/addDeviceCalibrationPlan", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹è®¾å¤æ ¡å计å |
| | | export function updateDeviceCalibrationPlan(data) { |
| | | return request({ |
| | | url: "/deviceCalibrationPlan/updateDeviceCalibrationPlan", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //éè¿è®¾å¤åç±»è·å设å¤å表 |
| | | export function deviceScopeSearch(query) { |
| | | return request({ |
| | | url: "/deviceScope/search", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æ¥è¯¢è®¾å¤æ ¸æ¥è®¡å详æ
|
| | | export function getDeviceExaminePlan(query) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/getDeviceExaminePlan", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ·»å è®¾å¤æ ¸æ¥è®¡å |
| | | export function addDeviceExaminePlan(data) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/addDeviceExaminePlan", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // è®¾å¤æ ¸æ¥è®¡åæ¹éç¼è¾ |
| | | export function updateDeviceExaminePlan(data) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/updateDeviceExaminePlan", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ ¸æ¥è®¡åå é¤ |
| | | export function delDeviceExaminePlan(query) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/delDeviceExaminePlan", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ ¸æ¥è®¡åå表 |
| | | export function pageDeviceExaminePlan(query) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/pageDeviceExaminePlan", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // è®¾å¤æ ¸æ¥è®¡åæäº¤æ¹åéç¥ |
| | | export function submitRatifyDeviceExaminePlan(data) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/submitRatifyDeviceExaminePlan", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //导åºè®¾å¤æ ¸æ¥è®¡å |
| | | export function exportDeviceExaminePlanDetail(query) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/exportDeviceExaminePlanDetail", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //å é¤è®¾å¤æ ¸æ¥è®¡å详æ
|
| | | export function delDeviceExaminePlanDetail(query) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/delDeviceExaminePlanDetail", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ ¸æ¥è®¡å详æ
å表 |
| | | export function pageDeviceExaminePlanDetail(query) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/pageDeviceExaminePlanDetail", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢è®¾å¤æ ¸æ¥è®¡å详æ
|
| | | export function addDeviceExaminePlanDetail(data) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/addDeviceExaminePlanDetail", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹è®¾å¤æ ¸æ¥è®¡å详æ
|
| | | export function updateDeviceExaminePlanDetail(data) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/updateDeviceExaminePlanDetail", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // è®¾å¤æ ¸æ¥è®¡åæ¹å |
| | | export function ratifyDeviceExaminePlan(data) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/ratifyDeviceExaminePlan", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //æ ¸æ¥è®°å½å¯¼åº |
| | | export function exportReviewExamineRecordDetail(query) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/exportReviewExamineRecordDetail", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æ ¸æ¥å¯¹æ¯å¯¼åº |
| | | export function exportReviewExamineRecordContrast(query) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/exportReviewExamineRecordContrast", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æ¥è¯¢æ ¸æ¥å¯¹æ¯è®°å½ |
| | | export function getExamineRecordContrast(query) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/getExamineRecordContrast", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // å®¡æ ¸æ ¸æ¥å¯¹æ¯è®°å½ |
| | | export function reviewExamineRecordContrast(data) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/reviewExamineRecordContrast", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢æ ¸æ¥å¯¹æ¯è®°å½ |
| | | export function addExamineRecordContrast(data) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/addExamineRecordContrast", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //æ¥è¯¢æ ¸æ¥è®°å½ |
| | | export function getExamineRecord(query) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/getExamineRecord", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢æ ¸æ¥è®°å½ |
| | | export function addExamineRecord(data) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/addExamineRecord", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // 夿 ¸æ ¸æ¥è®°å½ |
| | | export function reviewExamineRecord(data) { |
| | | return request({ |
| | | url: "/deviceExaminePlan/reviewExamineRecord", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //å页æ¥è¯¢è®¾å¤ä¿å
»è®¡å |
| | | export function selectDeviceMaintenancePlanByPage(query) { |
| | | return request({ |
| | | url: "/deviceMaintenancePlan/selectDeviceMaintenancePlanByPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 设å¤ä¿å
»è®¡åæäº¤å®¡æ ¸ |
| | | export function submitReviewMaintenancePlanStatus(data) { |
| | | return request({ |
| | | url: "/deviceMaintenancePlan/submitReviewMaintenancePlanStatus", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //æ¥è¯¢è®¾å¤ä¿å
»è®¡å详æ
|
| | | export function getMaintenancePlanDetail(query) { |
| | | return request({ |
| | | url: "/deviceMaintenancePlan/getMaintenancePlanDetail", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢è®¾å¤ä¿å
»è®¡å |
| | | export function addMaintenancePlan(data) { |
| | | return request({ |
| | | url: "/deviceMaintenancePlan/addMaintenancePlan", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹è®¾å¤ä¿å
»è®¡å |
| | | export function updateMaintenancePlan(data) { |
| | | return request({ |
| | | url: "/deviceMaintenancePlan/updateMaintenancePlan", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //导åºè®¾å¤ä¿å
»è®¡å |
| | | export function exportDeviceMaintenancePlan(query) { |
| | | return request({ |
| | | url: "/deviceMaintenancePlan/exportDeviceMaintenancePlan", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //å é¤è®¾å¤ä¿å
»è®¡å |
| | | export function deleteMaintenancePlan(query) { |
| | | return request({ |
| | | url: "/deviceMaintenancePlan/deleteMaintenancePlan", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //å页æ¥è¯¢é弿º¯æºè®¡å |
| | | export function selectDeviceTraceabilityManagementByPage(query) { |
| | | return request({ |
| | | url: "/deviceTraceabilityManagement/selectDeviceTraceabilityManagementByPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // é弿º¯æºè®¡åæäº¤æ¹å |
| | | export function submitReviewTraceabilityManagementStatus(data) { |
| | | return request({ |
| | | url: "/deviceTraceabilityManagement/submitReviewTraceabilityManagementStatus", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //æ¥è¯¢é弿º¯æºè®¡å详æ
|
| | | export function getTraceabilityManagementDetail(query) { |
| | | return request({ |
| | | url: "/deviceTraceabilityManagement/getTraceabilityManagementDetail", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢é弿º¯æºè®¡å |
| | | export function addTraceabilityManagement(data) { |
| | | return request({ |
| | | url: "/deviceTraceabilityManagement/addTraceabilityManagement", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹é弿º¯æºè®¡å |
| | | export function updateTraceabilityManagement(data) { |
| | | return request({ |
| | | url: "/deviceTraceabilityManagement/updateTraceabilityManagement", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // é弿º¯æºè®¡åå®¡æ ¸ç¶æä¿®æ¹ |
| | | export function reviewTraceabilityManagementStatus(data) { |
| | | return request({ |
| | | url: "/deviceTraceabilityManagement/reviewTraceabilityManagementStatus", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //导åºé弿º¯æºè®¡å |
| | | export function exportDeviceTraceabilityManagement(query) { |
| | | return request({ |
| | | url: "/deviceTraceabilityManagement/exportDeviceTraceabilityManagement", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //å é¤é弿º¯æºè®¡å |
| | | export function deleteTraceabilityManagement(query) { |
| | | return request({ |
| | | url: "/deviceTraceabilityManagement/deleteTraceabilityManagement", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //å©ç¨å¤é¨è®¾å¤ç³è¯·å表 |
| | | export function pageDeviceExternalApply(query) { |
| | | return request({ |
| | | url: "/deviceExternalApply/pageDeviceExternalApply", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //åç¨å¤é¨ä»ªå¨-å¯¼åº |
| | | export function exportDeviceExternalApply(query) { |
| | | return request({ |
| | | url: "/deviceExternalApply/exportDeviceExternalApply", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //å é¤å©ç¨å¤é¨è®¾å¤ç³è¯· |
| | | export function delDeviceExternalApply(query) { |
| | | return request({ |
| | | url: "/deviceExternalApply/delDeviceExternalApply", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æ¥è¯¢å©ç¨å¤é¨è®¾å¤ç³è¯· |
| | | export function getDeviceExternalApply(query) { |
| | | return request({ |
| | | url: "/deviceExternalApply/getDeviceExternalApply", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢å©ç¨å¤é¨è®¾å¤ç³è¯· |
| | | export function addDeviceExternalApply(data) { |
| | | return request({ |
| | | url: "/deviceExternalApply/addDeviceExternalApply", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //cnas设å¤ä½¿ç¨è®°å½å页æ¥è¯¢ |
| | | export function deviceRecordPage(query) { |
| | | return request({ |
| | | url: "/deviceRecord/deviceRecordPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 设å¤ä½¿ç¨è®°å½ä¿å |
| | | export function saveDeviceRecord(data) { |
| | | return request({ |
| | | url: "/deviceRecord/saveDeviceRecord", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // 设å¤ä½¿ç¨è®°å½ç¼è¾ |
| | | export function updateDeviceRecord(data) { |
| | | return request({ |
| | | url: "/deviceRecord/updateDeviceRecord", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //å é¤è®¾å¤ä½¿ç¨è®°å½ |
| | | export function deleteDeviceRecord(query) { |
| | | return request({ |
| | | url: "/deviceRecord/deleteDeviceRecord", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | //使ç¨è®°å½ å¯¼åº |
| | | export function exportUseRecord(query) { |
| | | return request({ |
| | | url: "/deviceRecord/exportUseRecord", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æ°å¢è®¾å¤æ¡£æ¡ |
| | | export function addDocument(data) { |
| | | return request({ |
| | | url: "/deviceDocuments/addDocument", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // è·åç¸å
³ææ¡£æ°æ®çapi-æ´æ° |
| | | export function updateDocument(data) { |
| | | return request({ |
| | | url: "/deviceDocuments/updateDocument", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //å é¤è®¾å¤æ¡£æ¡ |
| | | export function deleteDocumentById(query) { |
| | | return request({ |
| | | url: "/deviceDocuments/deleteDocumentById", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | // |
| | | |
| | | //设å¤éªæ¶å表 |
| | | export function pageDeviceAcceptance(query) { |
| | | return request({ |
| | | url: "/deviceAcceptance/pageDeviceAcceptance", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //设å¤éªæ¶éä»¶å表 |
| | | export function getDeviceAcceptanceFileList(query) { |
| | | return request({ |
| | | url: "/deviceAcceptance/getDeviceAcceptanceFileList", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //设å¤éªæ¶éä»¶å é¤ |
| | | export function delDeviceAcceptanceFileList(query) { |
| | | return request({ |
| | | url: "/deviceAcceptance/delDeviceAcceptanceFileList", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //设å¤éªæ¶ï¼è£
å¤ï¼å¯¼åº |
| | | export function exportDeviceAcceptance(query) { |
| | | return request({ |
| | | url: "/deviceAcceptance/exportDeviceAcceptance", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //å é¤è®¾å¤éªæ¶ |
| | | export function delDeviceAcceptance(query) { |
| | | return request({ |
| | | url: "/deviceAcceptance/delDeviceAcceptance", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æ¥è¯¢è®¾å¤éªæ¶ |
| | | export function getDeviceAcceptance(query) { |
| | | return request({ |
| | | url: "/deviceAcceptance/getDeviceAcceptance", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢è®¾å¤éªæ¶ |
| | | export function addDeviceAcceptance(data) { |
| | | return request({ |
| | | url: "/deviceAcceptance/addDeviceAcceptance", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ç¼è¾è®¾å¤éªæ¶ |
| | | export function updateDeviceAcceptance(data) { |
| | | return request({ |
| | | url: "/deviceAcceptance/updateDeviceAcceptance", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ ¡å å页æ¥è¯¢ |
| | | export function deviceMetricRecordPage(query) { |
| | | return request({ |
| | | url: "/deviceMetricRecord/deviceMetricRecordPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ ¡å æ°å¢ æ´æ° |
| | | export function saveOrUpdateDeviceMetric(data) { |
| | | return request({ |
| | | url: "/deviceMetrics/saveOrUpdateDeviceMetric", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ ¡å æ¥è¯¢æ ¡åæ¡ç® |
| | | export function showDeviceMetricsCopy(query) { |
| | | return request({ |
| | | url: "/deviceMetricRecord/showDeviceMetricsCopy", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ ¡å å é¤ |
| | | export function deleteDeviceMetricRecord(query) { |
| | | return request({ |
| | | url: "/deviceMetricRecord/deleteDeviceMetricRecord", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ ¡å å¯¼åº |
| | | export function deviceMetricRecordExport(query) { |
| | | return request({ |
| | | url: "/deviceMetricRecord/deviceMetricRecordExport", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //å 餿件 |
| | | export function deleteCNASFile(query) { |
| | | return request({ |
| | | url: "/personBasicInfo/deleteCNASFile", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æ¥è¯¢è®¾å¤æ¡£æ¡å表 |
| | | export function getAllDocuments(query) { |
| | | return request({ |
| | | url: `/deviceDocuments/getAllDocuments`, |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ¡£æ¡å¯¼åº |
| | | export function exportDeviceFile(query) { |
| | | return request({ |
| | | url: "/deviceScope/exportDeviceFile", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ ¡å 设å¤ç»´æ¤è¡¨ æ¥è¯¢ |
| | | export function selectDeviceMetric(query) { |
| | | return request({ |
| | | url: "/deviceMetrics/selectDeviceMetric", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ ¡å å é¤ |
| | | export function deleteDeviceMetrics(query) { |
| | | return request({ |
| | | url: "/deviceMetrics/deleteDeviceMetrics", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //设å¤ä¿å
»åæ¡å¯¼åº |
| | | export function exportMaintenanceRecord(query) { |
| | | return request({ |
| | | url: "/deviceMaintain/exportMaintenanceRecord", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //设å¤ç»´æ¤å é¤ |
| | | export function deleteDeviceMaintenance(query) { |
| | | return request({ |
| | | url: "/deviceMaintain/deleteDeviceMaintenance", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | //设å¤ç»´æ¤å é¤ |
| | | export function deviceMaintenanceExport(query) { |
| | | return request({ |
| | | url: "/deviceMaintain/deviceMaintenanceExport", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢è®¾å¤ç»´æ¤ä¿å
» |
| | | export function addDeviceMaintenance(data) { |
| | | return request({ |
| | | url: "/deviceMaintain/addDeviceMaintenance", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | //设å¤ç»´æ¤è¡¨ æ¥è¯¢ |
| | | export function getDeviceMaintenancePage(query) { |
| | | return request({ |
| | | url: "/deviceMaintain/getDeviceMaintenancePage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // åç¨-ä¿å |
| | | export function saveDeviceBorrow(data) { |
| | | return request({ |
| | | url: "/deviceBorrow/saveDeviceBorrow", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //åç¨-æ¥ç |
| | | export function getDeviceBorrow(query) { |
| | | return request({ |
| | | url: "/deviceBorrow/getDeviceBorrow", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //åç¨-å¯¼åº |
| | | export function deviceBorrowExport(query) { |
| | | return request({ |
| | | url: "/deviceBorrow/deviceBorrowExport", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //åç¨-å é¤ |
| | | export function deleteDeviceBorrow(query) { |
| | | return request({ |
| | | url: "/deviceBorrow/deleteDeviceBorrow", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //åç¨-å表 |
| | | export function deviceBorrowPage(query) { |
| | | return request({ |
| | | url: "/deviceBorrow/deviceBorrowPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 设å¤å¯ç¨/åç¨ ä¿åï¼æäº¤ï¼é©³åï¼éè¿æ¥å£ |
| | | export function saveDeviceState(data) { |
| | | return request({ |
| | | url: "/deviceState/saveDeviceState", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //éè¿è®¾å¤ç¼å·è·å设å¤å表 |
| | | export function selectDeviceByCode(query) { |
| | | return request({ |
| | | url: "/deviceScope/selectDeviceByCode", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //设å¤åå¯ç¨åæ¡å¯¼åº |
| | | export function exportDeviceStatus(query) { |
| | | return request({ |
| | | url: "/deviceState/exportDeviceStatus", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //设å¤å¯ç¨/åç¨ å é¤ |
| | | export function deleteDeviceState(query) { |
| | | return request({ |
| | | url: "/deviceState/deleteDeviceState", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //设å¤ç¶æå¯¼åº |
| | | export function deviceStateExport(query) { |
| | | return request({ |
| | | url: "/deviceState/deviceStateExport", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //设å¤å¯ç¨/åç¨ å页 |
| | | export function getDeviceStatePage(query) { |
| | | return request({ |
| | | url: "/deviceState/getDeviceStatePage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ¥åºç³è¯·å表 |
| | | export function pageDeviceScrapped(query) { |
| | | return request({ |
| | | url: "/deviceScrapped/pageDeviceScrapped", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // å¯¼åº |
| | | export function exportDeviceScrapped(query) { |
| | | return request({ |
| | | url: "/deviceScrapped/exportDeviceScrapped", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //å é¤è®¾å¤æ¥åºç³è¯· |
| | | export function delDeviceScrapped(query) { |
| | | return request({ |
| | | url: "/deviceScrapped/delDeviceScrapped", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æ¥è¯¢è®¾å¤æ¥åºç³è¯· |
| | | export function getDeviceScrapped(query) { |
| | | return request({ |
| | | url: "/deviceScrapped/getDeviceScrapped", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢è®¾å¤æ¥åºç³è¯· |
| | | export function addDeviceScrapped(data) { |
| | | return request({ |
| | | url: "/deviceScrapped/addDeviceScrapped", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ
éç»´ä¿®å表 |
| | | export function pageDeviceBreakdownMaintenance(query) { |
| | | return request({ |
| | | url: "/deviceBreakdownMaintenance/pageDeviceBreakdownMaintenance", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // è®¾å¤æ
éä¸ç»´ä¿®-å¯¼åº |
| | | export function exportDeviceBreakdownMaintenance(query) { |
| | | return request({ |
| | | url: "/deviceBreakdownMaintenance/exportDeviceBreakdownMaintenance", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //å é¤è®¾å¤æ
éç»´ä¿® |
| | | export function delDeviceBreakdownMaintenance(query) { |
| | | return request({ |
| | | url: "/deviceBreakdownMaintenance/delDeviceBreakdownMaintenance", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æ¥è¯¢è®¾å¤æ
éç»´ä¿® |
| | | export function getDeviceBreakdownMaintenance(query) { |
| | | return request({ |
| | | url: "/deviceBreakdownMaintenance/getDeviceBreakdownMaintenance", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢è®¾å¤æ
éç»´ä¿® |
| | | export function addDeviceBreakdownMaintenance(data) { |
| | | return request({ |
| | | url: "/deviceBreakdownMaintenance/addDeviceBreakdownMaintenance", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //å页æ¥è¯¢è®¾å¤ç¹æ£è®°å½ |
| | | export function getDeviceInspectionRecordByPage(query) { |
| | | return request({ |
| | | url: "/deviceInspectionRecord/getDeviceInspectionRecordByPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 导åºè®¾å¤ç¹æ£è®°å½ |
| | | export function exportDeviceInspectionRecord(query) { |
| | | return request({ |
| | | url: "/deviceInspectionRecord/exportDeviceInspectionRecord", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //å é¤è®¾å¤ç¹æ£è®°å½ |
| | | export function deleteDeviceInspectionRecord(query) { |
| | | return request({ |
| | | url: "/deviceInspectionRecord/deleteDeviceInspectionRecord", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //设å¤ç¹æ£è®°å½è¯¦æ
|
| | | export function getDeviceInspectionRecord(query) { |
| | | return request({ |
| | | url: "/deviceInspectionRecord/getDeviceInspectionRecord", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢è®¾å¤ç¹æ£è®°å½ |
| | | export function addDeviceInspectionRecord(data) { |
| | | return request({ |
| | | url: "/deviceInspectionRecord/addDeviceInspectionRecord", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹è®¾å¤ç¹æ£è®°å½ |
| | | export function updateDeviceInspectionRecord(data) { |
| | | return request({ |
| | | url: "/deviceInspectionRecord/updateDeviceInspectionRecord", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // 夿 ¸è®¾å¤ç¹æ£è®°å½ |
| | | export function reviewDeviceInspectionRecord(data) { |
| | | return request({ |
| | | url: "/deviceInspectionRecord/reviewDeviceInspectionRecord", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //设å¤äºæ
æ¥åå表 |
| | | export function pageDeviceAccidentReport(query) { |
| | | return request({ |
| | | url: "/deviceAccidentReport/pageDeviceAccidentReport", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 导åºè®¾å¤äºæ
|
| | | export function exportDeviceAccidentReport(query) { |
| | | return request({ |
| | | url: "/deviceAccidentReport/exportDeviceAccidentReport", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //å é¤è®¾å¤äºæ
æ¥å |
| | | export function delDeviceAccidentReport(query) { |
| | | return request({ |
| | | url: "/deviceAccidentReport/delDeviceAccidentReport", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æ¥è¯¢è®¾å¤äºæ
æ¥å |
| | | export function getDeviceAccidentReport(query) { |
| | | return request({ |
| | | url: "/deviceAccidentReport/getDeviceAccidentReport", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢è®¾å¤äºæ
æ¥å |
| | | export function addDeviceAccidentReport(data) { |
| | | return request({ |
| | | url: "/deviceAccidentReport/addDeviceAccidentReport", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //ä½ä¸æå¯¼ä¹¦ å®¡æ¹ |
| | | export function approvalOfHomeworkInstructionManual(data) { |
| | | return request({ |
| | | url: "/deviceInstruction/approvalOfHomeworkInstructionManual", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //ä½ä¸æå¯¼ä¹¦ å é¤ |
| | | export function homeworkGuidebook(query) { |
| | | return request({ |
| | | url: "/deviceInstruction/homeworkGuidebook", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //ä½ä¸æå¯¼ä¹¦ ç¼è¾æ¥è¯¢ |
| | | export function homeworkGuidebookEditor(query) { |
| | | return request({ |
| | | url: "/deviceInstruction/homeworkGuidebookEditor", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //ä½ä¸æå¯¼ä¹¦æ°å¢ |
| | | export function newHomeworkGuidebookAdded(data) { |
| | | return request({ |
| | | url: "/deviceInstruction/newHomeworkGuidebookAdded", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //ä½ä¸æå¯¼ä¹¦åæ§æä»¶å é¤ |
| | | export function deleteHomeworkGuidebook(query) { |
| | | return request({ |
| | | url: "/deviceInstruction/deleteHomeworkGuidebook", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //ä½ä¸æå¯¼ä¹¦ æ¥è¯¢ |
| | | export function pageByPageQueryOfHomeworkInstructions(query) { |
| | | return request({ |
| | | url: "/deviceInstruction/pageByPageQueryOfHomeworkInstructions", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | //设å¤é¢çº¦æ¥å£ |
| | | export function reservationSelectDevice(query) { |
| | | return request({ |
| | | url: "/reservation/selectDeviceParameter", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | //设å¤é¢çº¦æ¥å£ |
| | | export function reservationDelete(query) { |
| | | return request({ |
| | | url: "/reservation/delete", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | //设å¤é¢çº¦æ¥å£ |
| | | export function reservationSave(query) { |
| | | return request({ |
| | | url: "/reservation/save", |
| | | method: "post", |
| | | data: query, |
| | | }); |
| | | } |
| | | //设å¤é¢çº¦æ¥å£ |
| | | export function selectReservationParameterPage(query) { |
| | | return request({ |
| | | url: "/reservation/selectReservationParameterPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | //设å¤é¢çº¦æ¥å£ |
| | | export function device(query) { |
| | | return request({ |
| | | url: "/api/device-faults/device", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | //设å¤éªæ¶ä¸å个tableè¡¨æ ¼çå é¤åè½ |
| | | export function deleteIncidentReportAll(query) { |
| | | return request({ |
| | | url: "/incident-report/deleteIncidentReportAll", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //设å¤éªæ¶ ä¿åï¼æäº¤ï¼é©³åï¼éè¿æ¥å£ |
| | | export function saveIncidentReportData(query) { |
| | | return request({ |
| | | url: "/incident-report/saveIncidentReportData", |
| | | method: "post", |
| | | data: query, |
| | | }); |
| | | } |
| | | //设å¤éªæ¶ ä¿åï¼æäº¤ï¼é©³åï¼éè¿æ¥å£ |
| | | export function incidentReportPage(query) { |
| | | return request({ |
| | | url: "/incident-report/incidentReportPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | //设å¤éªæ¶ ä¿åï¼æäº¤ï¼é©³åï¼éè¿æ¥å£ |
| | | export function getShowIncidentReport(query) { |
| | | return request({ |
| | | url: "/incident-report/getShowIncidentReport", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | //设å¤éªæ¶å¯¼åº |
| | | export function incidentReportExport(query) { |
| | | return request({ |
| | | url: "/incident-report/incidentReportExport", |
| | | method: "get", |
| | | params: query, |
| | | responseType: "blob" |
| | | }); |
| | | } |
| | | //æ·»å è®¾å¤æ
é |
| | | export function addOrUpdateDeviceFaultOne(query) { |
| | | return request({ |
| | | url: "/deviceFaultOne/addOrUpdateDeviceFaultOne", |
| | | method: "post", |
| | | data: query, |
| | | }); |
| | | } |
| | | //è®¾å¤æ
é表 å页æ¥è¯¢ |
| | | export function deviceFaultOnePage(query) { |
| | | return request({ |
| | | url: "/deviceFaultOne/deviceFaultOnePage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | //è®¾å¤æ
éå¯¼åº |
| | | export function exportRewardAndPunishmentRecords(query) { |
| | | return request({ |
| | | url: "/deviceFaultOne/exportRewardAndPunishmentRecords", |
| | | method: "get", |
| | | params: query, |
| | | responseType: "blob" |
| | | }); |
| | | } |
| | | //è®¾å¤æ ¡åå¯¼åº |
| | | export function downLoadDeviceCalibrationFile(query) { |
| | | return request({ |
| | | url: "/personBasicInfo/downLoadDeviceCalibrationFile", |
| | | method: "get", |
| | | params: query, |
| | | responseType: "blob" |
| | | }); |
| | | } |
| | | //å é¤ è®¾å¤æ
é |
| | | export function deleteDeviceFaultOne(query) { |
| | | return request({ |
| | | url: "/deviceFaultOne/deleteDeviceFaultOne", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | //å é¤ è®¾å¤æ ¡å |
| | | export function delDeviceCalibrationFile(query) { |
| | | return request({ |
| | | url: "/personBasicInfo/delDeviceCalibrationFile", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | //è®¾å¤æ ¡åæ¥è¯¢ |
| | | export function getDeviceCalibrationFile(query) { |
| | | return request({ |
| | | url: "/personBasicInfo/getDeviceCalibrationFile", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <div class="echart_size" :id="id" :style="`height:${config.height};width:${config.width}`"></div> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import * as echarts from 'echarts' |
| | | import ResizeListener from 'element-resize-detector'; |
| | | import { iuCharts } from '@/utils/echarts' |
| | | export default { |
| | | props: { |
| | | id: { |
| | | type: String, |
| | | default: '' |
| | | }, |
| | | config: { |
| | | type: Object, |
| | | default: () => { } |
| | | }, |
| | | datas: { |
| | | type: Object, |
| | | default: () => { } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | chart: null, |
| | | } |
| | | }, |
| | | watch: { |
| | | /* 妿å¾è¡¨æ°æ®æ¯åå°è·åçï¼çå¬ç¶ç»ä»¶ä¸çæ°æ®ååï¼éæ°è§¦åEcharts */ |
| | | datas: { |
| | | deep: true, |
| | | // immediate: true, |
| | | handler(val) { |
| | | this.$nextTick(() => { |
| | | this.init(); |
| | | }) |
| | | }, |
| | | }, |
| | | }, |
| | | created() { |
| | | this.$nextTick(() => { |
| | | this.init() |
| | | }) |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.windowResizeListener); |
| | | this.chartEleResizeListener(); |
| | | }, |
| | | beforeDestroy() { |
| | | if (!this.chart) { |
| | | return; |
| | | } |
| | | this.chart.dispose(); |
| | | this.chart = null; |
| | | }, |
| | | methods: { |
| | | init() { |
| | | // å®ä¾å对象 |
| | | this.chart = echarts.init(document.getElementById(this.id)) |
| | | this.chart.showLoading({ |
| | | text: 'loading', |
| | | color: '#3A7BFA', |
| | | textColor: '#000', |
| | | maskColor: 'rgba(255, 255, 255, 0.2)', |
| | | zlevel: 0, |
| | | }); |
| | | if (this.config.isLoading) { |
| | | this.chart.hideLoading(); |
| | | switch (this.config.type) { |
| | | case 'bar': |
| | | iuCharts.drawBar(this.chart, this.datas) |
| | | break; |
| | | case 'line': |
| | | iuCharts.drawLine(this.chart, this.datas) |
| | | break; |
| | | case 'pie': |
| | | iuCharts.drawPie(this.chart, this.datas) |
| | | break; |
| | | case 'gauge': |
| | | iuCharts.drawGauge(this.chart, this.datas) |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | setTimeout(() => { |
| | | this.chart.resize() |
| | | }, 200) |
| | | } |
| | | }, |
| | | /* 对chartå
ç´ å°ºå¯¸è¿è¡çå¬ï¼å½åçååæ¶åæ¥æ´æ°echartè§å¾ */ |
| | | chartEleResizeListener() { |
| | | const chartInstance = ResizeListener({ |
| | | strategy: 'scroll', |
| | | callOnAdd: true |
| | | }); |
| | | chartInstance.listenTo(this.$el, () => { |
| | | if (!this.chart) return; |
| | | this.chart.resize(); |
| | | }); |
| | | }, |
| | | /* å½çªå£ç¼©æ¾æ¶ï¼echartå¨æè°æ´èªèº«å¤§å° */ |
| | | windowResizeListener() { |
| | | if (!this.chart) return; |
| | | this.chart.resize(); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .echart_size { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import * as echarts from "echarts"; |
| | | |
| | | const iuCharts = { |
| | | drawBar: function (chart, params) { |
| | | var color = ["#4379EE", "#FEC53D", "#65789B", "#F6BD16"]; |
| | | let series = params.yData.map((m, i) => { |
| | | let obj = { |
| | | name: m.title, |
| | | type: "bar", |
| | | barWidth: "16%", |
| | | barGap: "30%", |
| | | itemStyle: { |
| | | normal: { |
| | | color: color[i], |
| | | barBorderRadius: [50, 50, 0, 0], |
| | | }, |
| | | }, |
| | | data: m.data, |
| | | }; |
| | | return obj; |
| | | }); |
| | | var option = { |
| | | backgroundColor: "#fff", |
| | | tooltip: { |
| | | trigger: "axis", |
| | | axisPointer: { |
| | | lineStyle: { |
| | | color: "#4379EE", |
| | | }, |
| | | }, |
| | | }, |
| | | grid: { |
| | | top: "25px", |
| | | left: "40px", |
| | | right: "3%", |
| | | bottom: "40px", |
| | | // containLabel: true |
| | | }, |
| | | legend: { |
| | | show: true, |
| | | orient: "horizontal", |
| | | y: -2, |
| | | right: 15, |
| | | itemWidth: 12, |
| | | itemHeight: 12, |
| | | itemGap: 24, |
| | | textStyle: { |
| | | color: "rgba(43,48,52)", |
| | | fontSize: "14px", |
| | | }, |
| | | }, |
| | | xAxis: [ |
| | | { |
| | | type: "category", |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: "rgba(43,48,52, 0.4)", |
| | | margin: 20, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | show: false, |
| | | }, |
| | | boundaryGap: false, |
| | | data: params.xData, |
| | | }, |
| | | ], |
| | | yAxis: [ |
| | | { |
| | | minInterval: 1, |
| | | type: "value", |
| | | min: 0, |
| | | splitNumber: 4, |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: "rgba(43,48,52, 0.1)", |
| | | }, |
| | | }, |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: "rgba(43,48,52, 0.4)", |
| | | margin: 20, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | }, |
| | | ], |
| | | series: series, |
| | | }; |
| | | chart.setOption(option); |
| | | }, |
| | | drawLine: function (chart, params) { |
| | | let series = []; |
| | | params.yData.forEach((m) => { |
| | | series.push({ |
| | | name: m.title, |
| | | type: "line", |
| | | showAllSymbol: true, |
| | | symbol: "circle", |
| | | symbolSize: 10, |
| | | lineStyle: { |
| | | normal: { |
| | | color: "#4379EE", |
| | | width: 3, |
| | | }, |
| | | }, |
| | | areaStyle: { |
| | | normal: { |
| | | color: new echarts.graphic.LinearGradient( |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | [ |
| | | { |
| | | offset: 0, |
| | | color: "rgba(67,121,238,0.3)", |
| | | }, |
| | | { |
| | | offset: 1, |
| | | color: "rgba(67,121,238,0)", |
| | | }, |
| | | ], |
| | | false |
| | | ), |
| | | }, |
| | | }, |
| | | data: m.data, |
| | | }); |
| | | }); |
| | | let option = { |
| | | backgroundColor: "#fff", |
| | | tooltip: { |
| | | trigger: "axis", |
| | | axisPointer: { |
| | | lineStyle: { |
| | | color: "#4379EE", |
| | | }, |
| | | }, |
| | | }, |
| | | grid: { |
| | | top: "25px", |
| | | left: "40px", |
| | | right: "3%", |
| | | bottom: "40px", |
| | | // containLabel: true |
| | | }, |
| | | xAxis: [ |
| | | { |
| | | type: "category", |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: "rgba(43,48,52, 0.4)", |
| | | margin: 20, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | show: false, |
| | | }, |
| | | boundaryGap: false, |
| | | data: params.xData, |
| | | }, |
| | | ], |
| | | yAxis: [ |
| | | { |
| | | minInterval: 1, |
| | | type: "value", |
| | | min: 0, |
| | | splitNumber: 4, |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: "rgba(43,48,52, 0.1)", |
| | | }, |
| | | }, |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: "rgba(43,48,52, 0.4)", |
| | | margin: 20, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | }, |
| | | ], |
| | | series: series, |
| | | }; |
| | | chart.setOption(option); |
| | | }, |
| | | drawPie: function (chart, params) { |
| | | let option = { |
| | | color: params.color, |
| | | backgroundColor: "#fff", |
| | | tooltip: { |
| | | trigger: "item", |
| | | formatter: "{a} <br/>{b} : {c}", |
| | | }, |
| | | title: { |
| | | text: params.percentage, |
| | | textStyle: { |
| | | color: "#4379EE", |
| | | fontSize: 14, |
| | | align: "center", |
| | | fontWeight: "normal", |
| | | }, |
| | | x: "center", |
| | | y: "center", |
| | | }, |
| | | grid: { |
| | | top: 20, |
| | | bottom: 20, |
| | | left: 0, |
| | | right: 0, |
| | | }, |
| | | legend: { |
| | | show: false, |
| | | }, |
| | | series: [ |
| | | // 主è¦å±ç¤ºå±ç |
| | | { |
| | | radius: ["55%", "90%"], |
| | | center: ["50%", "50%"], |
| | | type: "pie", |
| | | label: { |
| | | show: false, |
| | | }, |
| | | name: params.title, |
| | | data: params.data, |
| | | }, |
| | | // è¾¹æ¡ç设置 |
| | | { |
| | | radius: ["55%", "65%"], |
| | | center: ["50%", "50%"], |
| | | type: "pie", |
| | | label: { |
| | | normal: { |
| | | show: false, |
| | | }, |
| | | emphasis: { |
| | | show: false, |
| | | }, |
| | | }, |
| | | labelLine: { |
| | | normal: { |
| | | show: false, |
| | | }, |
| | | emphasis: { |
| | | show: false, |
| | | }, |
| | | }, |
| | | animation: false, |
| | | tooltip: { |
| | | show: false, |
| | | }, |
| | | data: [ |
| | | { |
| | | value: 1, |
| | | itemStyle: { |
| | | color: "rgba(250,250,250,0.3)", |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }; |
| | | chart.setOption(option); |
| | | }, |
| | | drawGauge: function (chart, params) { |
| | | let option = { |
| | | tooltip: { |
| | | formatter: "{a} <br/>{b} : {c}%", |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | restore: {}, |
| | | saveAsImage: {}, |
| | | }, |
| | | }, |
| | | series: [ |
| | | { |
| | | type: "gauge", |
| | | axisLine: { |
| | | lineStyle: { |
| | | width: 28, |
| | | color: [ |
| | | [0.3, "#67e0e3"], |
| | | [0.7, "#37a2da"], |
| | | [1, "#fd666d"], |
| | | ], |
| | | }, |
| | | }, |
| | | pointer: { |
| | | itemStyle: { |
| | | color: "auto", |
| | | }, |
| | | }, |
| | | axisTick: { |
| | | distance: -28, |
| | | length: 8, |
| | | lineStyle: { |
| | | color: "#fff", |
| | | width: 2, |
| | | }, |
| | | }, |
| | | splitLine: { |
| | | distance: -28, |
| | | length: 28, |
| | | lineStyle: { |
| | | color: "#fff", |
| | | width: 4, |
| | | }, |
| | | }, |
| | | axisLabel: { |
| | | color: "inherit", |
| | | distance: 40, |
| | | fontSize: 14, |
| | | }, |
| | | detail: { |
| | | valueAnimation: true, |
| | | formatter: "{value} %", |
| | | color: "inherit", |
| | | textStyle: { |
| | | fontSize: 30, |
| | | align: "center", |
| | | }, |
| | | }, |
| | | data: [ |
| | | { |
| | | value: 70, |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }; |
| | | chart.setOption(option, true); |
| | | }, |
| | | }; |
| | | |
| | | export { iuCharts }; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible" |
| | | title="仪å¨è®¾å¤éªæ¶å" width="80%" @close="resetForm"> |
| | | <el-form ref="modelForm" :model="form" :rules="rules" label-width="180px"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å°è´§æ¥æï¼" prop="arrivalDate"> |
| | | <el-date-picker v-model="form.arrivalDate" type="date" placeholder="éæ©æ¥æ" size="small" format="yyyy-MM-dd" |
| | | style="width: 100%" value-format="yyyy-MM-dd" :disabled="operationType === 'view'"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="éé¢ï¼" prop="goldAmount"> |
| | | <el-input v-model="form.goldAmount" :disabled="operationType === 'view'" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç»´ä¿®åä½ï¼" prop="maintenanceunit"> |
| | | <el-input v-model="form.maintenanceunit" :disabled="operationType === 'view'" clearable |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¶è®¾å¤ä¸»æºåå¤ä»¶æ
åµï¼" prop="spareParts"> |
| | | <el-input v-model="form.spareParts" :disabled="operationType === 'view'" clearable size="small" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å®è£
ãè°è¯æ
åµï¼" prop="installationDebugging"> |
| | | <el-input v-model="form.installationDebugging" :disabled="operationType === 'view'" clearable size="small" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="éªæ¶æ
åµï¼" prop="checkSituation"> |
| | | <el-input v-model="form.checkSituation" :disabled="operationType === 'view'" clearable size="small" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¥æ¶ç¾åï¼" prop="receivingSignature"> |
| | | <el-input v-model="form.receivingSignature" :disabled="operationType === 'view'" clearable |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å家代表ï¼" prop="producer"> |
| | | <el-input v-model="form.producer" :disabled="operationType === 'view'" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¥æ¶äººï¼" prop="recipient"> |
| | | <el-input v-model="form.recipient" :disabled="operationType === 'view'" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¥æ¶æ¥æï¼" prop="recipientDate"> |
| | | <el-date-picker v-model="form.recipientDate" type="date" placeholder="éæ©æ¥æ" size="small" format="yyyy-MM-dd" |
| | | style="width: 100%" value-format="yyyy-MM-dd" :disabled="operationType === 'view'"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="resetForm">å æ¶</el-button> |
| | | <el-button v-if="operationType !== 'view'" :loading="submitFormLoading" type="primary" @click="submitForm">ç¡® |
| | | 认</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getDeviceAcceptance, |
| | | addDeviceAcceptance, |
| | | updateDeviceAcceptance, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/system/user"; |
| | | export default { |
| | | name: "acceptance-form", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | dialogVisible: false, |
| | | submitFormLoading: false, |
| | | form: { |
| | | arrivalDate: '', |
| | | goldAmount: '', |
| | | maintenanceunit: '', |
| | | spareParts: '', |
| | | installationDebugging: '', |
| | | checkSituation: '', |
| | | receivingSignature: '', |
| | | producer: '', |
| | | recipient: '', |
| | | recipientDate: '', |
| | | deviceId: '', |
| | | }, |
| | | operationType: '', |
| | | rules: { |
| | | arrivalDate: [{ required: true, message: 'è¯·éæ©å°è´§æ¥æ', trigger: 'change' }], |
| | | }, |
| | | userList: [], |
| | | } |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | // æå¼å¼¹æ¡ |
| | | openDialog(type, id, deviceId) { |
| | | this.dialogVisible = true |
| | | this.operationType = type |
| | | this.form.acceptanceId = id |
| | | this.form.deviceId = deviceId |
| | | this.getUserList() |
| | | if (this.form.acceptanceId) { |
| | | this.searchInfo() |
| | | } |
| | | }, |
| | | // æ¥è¯¢è¯¦æ
|
| | | searchInfo() { |
| | | getDeviceAcceptance({ acceptanceId: this.form.acceptanceId }).then(res => { |
| | | if (res.code === 200) { |
| | | this.form = { ...res.data } |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | | }) |
| | | }, |
| | | // æäº¤è¡¨å |
| | | submitForm() { |
| | | this.$refs.modelForm.validate((valid) => { |
| | | if (valid) { |
| | | if (this.operationType === 'add') { |
| | | addDeviceAcceptance(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | | }).catch(err => { |
| | | this.submitFormLoading = false |
| | | }) |
| | | } else { |
| | | updateDeviceAcceptance(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | | }).catch(err => { |
| | | this.submitFormLoading = false |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // å
³éå¼¹æ¡ |
| | | resetForm() { |
| | | this.dialogVisible = false |
| | | this.$emit('closeDialog') |
| | | }, |
| | | getUserList() { |
| | | selectUserCondition().then(res => { |
| | | let data = []; |
| | | res.data.forEach((a) => { |
| | | data.push({ |
| | | label: a.name, |
| | | value: a.id, |
| | | }); |
| | | }); |
| | | this.userList = data |
| | | }) |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .form-item { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-right: 20px; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="data-acquisition-config"> |
| | | <div> |
| | | <el-row class="title"> |
| | | <el-col :span="6" style="padding-left: 20px;text-align: left;">æ°éé
ç½®</el-col> |
| | | <el-col :span="18" style="text-align: right;"> |
| | | <el-button size="small" type="primary" @click="fileConfiguration">æä»¶é
ç½®</el-button> |
| | | <el-button size="small" @click="$parent.closeDataVue()"> |
| | | <span style="color: #3A7BFA;">è¿å</span> |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div class="table"> |
| | | <el-table :data="tableList.slice( |
| | | (page.current - 1) * page.size, |
| | | page.current * page.size |
| | | ) |
| | | " border tooltip-effect="dark" style="width: 74%;" height="100%" :span-method="spanMethod"> |
| | | <el-table-column type="index" label="åºå·" align="center" width="65"></el-table-column> |
| | | <el-table-column prop="deviceName" align="center" min-width="100" label="设å¤åç§°"></el-table-column> |
| | | <el-table-column prop="fileType" align="center" label="æä»¶åç¼"></el-table-column> |
| | | <el-table-column prop="collectUrl" align="center" min-width="100" show-overflow-tooltip |
| | | label="ééå°å"></el-table-column> |
| | | <el-table-column prop="storageUrl" align="center" min-width="100" show-overflow-tooltip |
| | | label="åå¨å°å"></el-table-column> |
| | | <el-table-column prop="ip" align="center" label="IPå°å" min-width="100"></el-table-column> |
| | | <el-table-column prop="sample" align="center" label="æ£éªå¯¹è±¡" show-overflow-tooltip |
| | | min-width="150"></el-table-column> |
| | | <el-table-column prop="inspectionItemClass" align="center" label="æ£éªé¡¹åç±»" min-width="120"></el-table-column> |
| | | <el-table-column prop="inspectionItem" align="center" label="æ£éªé¡¹" min-width="100"></el-table-column> |
| | | <el-table-column prop="inspectionItemSubclass" align="center" label="æ£éªå项" min-width="100"></el-table-column> |
| | | <el-table-column prop="referx" align="center" label="åç
§X" min-width="100"></el-table-column> |
| | | <el-table-column prop="x" align="center" label="X"></el-table-column> |
| | | <el-table-column prop="refery" align="center" label="åç
§Y" min-width="100"></el-table-column> |
| | | <el-table-column prop="y" align="center" label="Y"></el-table-column> |
| | | <el-table-column prop="anotherName" align="center" label="å«å" min-width="100"></el-table-column> |
| | | <el-table-column prop="matchingName" align="center" label="å¹é
åç§°" min-width="100"></el-table-column> |
| | | <el-table-column prop="formula" align="center" label="å
¬å¼"></el-table-column> |
| | | <el-table-column prop="section" fixed="right" label="æä½" width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="dataConfig(scope.row)">æ°éé
ç½®</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div class="page" v-if="tableList.length > 0"> |
| | | <el-pagination @size-change="sizeChange" @current-change="currentChange" :current-page="page.current" |
| | | :page-sizes="[10, 20, 30, 50, 100]" :page-size="page.size" layout="total, sizes, prev, pager, next, jumper" |
| | | :total="tableList.length"> |
| | | </el-pagination> |
| | | </div> |
| | | <el-dialog title="æ°éé
ç½®" :visible.sync="dialogVisible3" width="920px" :before-close="closeForm"> |
| | | <el-form :model="configForm" label-position="top" size="small" ref="configForm" label-width="100px" |
| | | class="demo-ruleForm"> |
| | | <el-table :data="domains" style="width: 100%" height="300"> |
| | | <el-table-column label="åºå·" type="index" width="80"> |
| | | <template v-slot="scope"> |
| | | {{ getIndexWithAlphabet(scope.$index) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="referx" label="åç
§X" min-width="140"> |
| | | <template v-slot="scope"> |
| | | <el-input style="width: 100%" v-model="scope.row.referx"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="x" label="X" min-width="100"> |
| | | <template v-slot="scope"> |
| | | <el-input style="width: 100%" v-model="scope.row.x"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="refery" label="åç
§Y" min-width="140"> |
| | | <template v-slot="scope"> |
| | | <el-input style="width: 100%" v-model="scope.row.refery"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="y" label="Y" min-width="100"> |
| | | <template v-slot="scope"> |
| | | <el-input style="width: 100%" v-model="scope.row.y"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="anotherName" label="å«å" min-width="140"> |
| | | <template v-slot="scope"> |
| | | <el-input style="width: 100%" v-model="scope.row.anotherName"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="matchingName" label="å¹é
åç§°" min-width="140"> |
| | | <template v-slot="scope"> |
| | | <el-input style="width: 100%" v-model="scope.row.matchingName"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="150"> |
| | | <template v-slot="scope"> |
| | | <el-button @click.prevent="removeDomain(scope.row)" size="small" type="text">å é¤</el-button> |
| | | <el-button @click="addDomain" size="small" type="text">æ°å¢</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="fomItem2"> |
| | | <el-form-item class="fomItemInput1"> |
| | | <template v-slot="label"> |
| | | å
¬å¼ï¼ |
| | | <el-tooltip v-for="(formula, key) in formulas" class="itemFomItem" effect="dark" |
| | | :content="formula.content" :key="key" placement="top"> |
| | | <label>{{ formula.label }}()</label> |
| | | </el-tooltip> |
| | | <el-input type="textarea" autosi:autosize="{ minRows: 2, maxRows: 4}" ze placeholder="请è¾å
¥å
容" |
| | | v-model="configForm.formula" @change="evalResult"> |
| | | </el-input> |
| | | </template> |
| | | </el-form-item> |
| | | </div> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-row> |
| | | <el-button @click="closeForm">å æ¶</el-button> |
| | | <el-button type="primary" @click="submitForm3" :loading="upLoad3">ç¡® å®</el-button> |
| | | </el-row> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="æ°éé
ç½®" :visible.sync="dialogVisible4" width="400px"> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"> |
| | | <span style="color:red;margin-right: 4px;">*</span>IPï¼ |
| | | </div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.ip"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"> |
| | | <span style="color:red;margin-right: 4px;">*</span>ééå°åï¼ |
| | | </div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.collectUrl"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label">å¨åå°åï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.storageUrl"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"> |
| | | <span style="color:red;margin-right: 4px;">*</span>æä»¶åç¼ï¼ |
| | | </div> |
| | | <el-select v-model="configForm.fileType" size="small" placeholder="è¯·éæ©" style="width: 100%;"> |
| | | <el-option v-for="item in fileTypeOptions" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label">å§æåæ®µï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.entrustCode"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label">æ ·ååæ®µï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.sampleCode"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label">æä»¶åç§°ï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.dbFileName"></el-input> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-row> |
| | | <el-button @click="dialogVisible4 = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="submitForm4" :loading="upLoad4">ç¡® å®</el-button> |
| | | </el-row> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | queryDataAcquisitionConfiguration, |
| | | saveDataAcquisitionConfiguration, |
| | | deleteDataAcquisitionConfiguration, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | export default { |
| | | name: "dataAcquisitionConfig", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | props: { |
| | | deviceId: { |
| | | type: Number, |
| | | default: () => [] |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.init(); |
| | | }, |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | formulas: [ |
| | | { |
| | | label: "MAX", |
| | | content: "æ±åæ°æå¤§å¼ï¼åæ°ä¸ªæ°æå°ä¸¤ä¸ªï¼å¦ï¼MAX(A1,B2)" |
| | | }, |
| | | { |
| | | label: "MIN", |
| | | content: "æ±åæ°æå°å¼ï¼åæ°ä¸ªæ°æå°ä¸¤ä¸ªï¼å¦ï¼MIN(A1,B2)" |
| | | }, |
| | | { |
| | | label: "SUM", |
| | | content: "æ±åï¼åæ°ä¸ªæ°æå°ä¸¤ä¸ªï¼å¦ï¼SUM(A1,B2)" |
| | | }, |
| | | { |
| | | label: "ABS", |
| | | content: "æ±ç»å¯¹å¼ï¼åæ°ä¸ªæ°æå°ä¸ä¸ªï¼å¦ï¼ABS(A1)" |
| | | }, |
| | | { |
| | | label: "AVERAGE", |
| | | content: "æ±å¹³åå¼ï¼åæ°ä¸ªæ°æå°ä¸¤ä¸ªä¸ªï¼å¦ï¼AVERAGE(A1,B2)" |
| | | }, |
| | | { |
| | | label: "MEDIAN", |
| | | content: "æ±ä¸å¼ï¼åæ°ä¸ªæ°æå°ä¸¤ä¸ªä¸ªï¼å¦ï¼MEDIAN(A1,B2)" |
| | | }, |
| | | ], |
| | | dialogVisible4: false, |
| | | tableList: [], |
| | | page: { |
| | | current: 1, |
| | | size: 20 |
| | | }, |
| | | dialogVisible3: false, |
| | | configForm: { |
| | | formula: "", |
| | | collectUrl: "", |
| | | storageUrl: "", |
| | | entrustCode: "", |
| | | sampleCode: "", |
| | | dbFileName: "", |
| | | fiberOpticRibbon: "" |
| | | }, |
| | | domains: [ |
| | | { |
| | | referx: "", |
| | | refery: "", |
| | | x: "", |
| | | y: "", |
| | | anotherName: "", |
| | | matchingName: "" |
| | | } |
| | | ], |
| | | upLoad3: false, |
| | | upLoad4: false, |
| | | fileTypeOptions: [ |
| | | { label: "csv", value: ".csv" }, |
| | | { label: "db", value: ".db" }, |
| | | { label: "mdb", value: ".mdb" }, |
| | | { label: "word", value: ".docx" }, |
| | | { label: "excel", value: ".xlsx" }, |
| | | { label: "txt", value: ".txt" }, |
| | | { label: "png", value: ".png" } |
| | | ], |
| | | spanList: [], |
| | | specialSpanList: [], |
| | | spanConfig: { |
| | | special: { |
| | | main: "inspectionItemSubclass", |
| | | rows: [ |
| | | { |
| | | name: "deviceName", |
| | | index: 1 |
| | | }, |
| | | { |
| | | name: "fileType", |
| | | index: 2 |
| | | }, |
| | | { |
| | | name: "collectUrl", |
| | | index: 3 |
| | | }, |
| | | { |
| | | name: "storageUrl", |
| | | index: 4 |
| | | }, |
| | | { |
| | | name: "ip", |
| | | index: 5 |
| | | }, |
| | | { |
| | | name: "inspectionItem", |
| | | index: 6 |
| | | }, |
| | | { |
| | | name: "inspectionItemSubclass", |
| | | index: 7 |
| | | }, |
| | | { |
| | | name: "formula", |
| | | index: 13 |
| | | }, |
| | | { |
| | | name: "section", |
| | | index: 14 |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | deleteList: [] |
| | | }; |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | getIndexWithAlphabet(index) { |
| | | const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
| | | const letterIndex = index % 26; |
| | | return alphabet.charAt(letterIndex) + (index + 1); |
| | | }, |
| | | rowspan(spanArr, position, spanName) { |
| | | this.tableList.forEach((item, index) => { |
| | | if (index === 0) { |
| | | spanArr.push(1); |
| | | position = 0; |
| | | } else { |
| | | if ( |
| | | this.tableList[index][spanName] === |
| | | this.tableList[index - 1][spanName] |
| | | ) { |
| | | spanArr[position] += 1; |
| | | spanArr.push(0); |
| | | } else { |
| | | spanArr.push(1); |
| | | position = index; |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | spanMethod({ row, column, rowIndex, columnIndex }) { |
| | | // ä¸è¬çåå¹¶è¡ |
| | | if ( |
| | | this.spanConfig != undefined && |
| | | this.spanConfig.rows && |
| | | this.spanConfig.rows.length > 0 |
| | | ) { |
| | | let i = null; |
| | | let obj = this.spanConfig.rows.find((item, index) => { |
| | | i = index; |
| | | return item.index == columnIndex; |
| | | }); |
| | | if (obj) { |
| | | const _row = this.spanList[i].arr[rowIndex]; |
| | | const _col = _row > 0 ? 1 : 0; |
| | | return { |
| | | rowspan: _row, |
| | | colspan: _col |
| | | }; |
| | | } |
| | | } |
| | | // ç¹æ®çåå¹¶è¡ |
| | | if ( |
| | | this.spanConfig != undefined && |
| | | this.spanConfig.special && |
| | | this.spanConfig.special.main && |
| | | this.spanConfig.special.rows && |
| | | this.spanConfig.special.rows.length > 0 |
| | | ) { |
| | | let i = null; |
| | | let obj = this.spanConfig.special.rows.find((item, index) => { |
| | | i = index; |
| | | return item.index == columnIndex; |
| | | }); |
| | | if (obj) { |
| | | const _row = this.specialSpanList[i].arr[rowIndex]; |
| | | const _col = _row > 0 ? 1 : 0; |
| | | return { |
| | | rowspan: _row, |
| | | colspan: _col |
| | | }; |
| | | } |
| | | } |
| | | }, |
| | | fileConfiguration() { |
| | | this.dialogVisible4 = true; |
| | | if (this.tableList[0]) { |
| | | this.$set(this.configForm, "fileType", this.tableList[0].fileType); |
| | | this.$set(this.configForm, "collectUrl", this.tableList[0].collectUrl); |
| | | this.$set(this.configForm, "storageUrl", this.tableList[0].storageUrl); |
| | | this.$set(this.configForm, "ip", this.tableList[0].ip); |
| | | this.$set( |
| | | this.configForm, |
| | | "entrustCode", |
| | | this.tableList[0].entrustCode |
| | | ); |
| | | this.$set( |
| | | this.configForm, |
| | | "sampleCode", |
| | | this.tableList[0].sampleCode |
| | | ); |
| | | this.$set( |
| | | this.configForm, |
| | | "dbFileName", |
| | | this.tableList[0].dbFileName |
| | | ); |
| | | this.$set( |
| | | this.configForm, |
| | | "fiberOpticRibbon", |
| | | this.tableList[0].fiberOpticRibbon |
| | | ) |
| | | } |
| | | }, |
| | | init() { |
| | | queryDataAcquisitionConfiguration({ deviceId: this.deviceId, isDevice: false }).then(res => { |
| | | this.tableList = res.data; |
| | | this.tableList.forEach(i => { |
| | | let isIncludes = false |
| | | if (i.formula && i.formula != "") { |
| | | this.formulas.forEach(j => { |
| | | if (i.formula.includes(j.label)) { |
| | | isIncludes = true |
| | | } |
| | | }) |
| | | } |
| | | if (!isIncludes && i.formula) { |
| | | i.formula = i.formula.slice(1, -1) |
| | | } |
| | | i.sample = i.sample |
| | | .replace(/"/g, "") |
| | | .replace(/],/g, "ï¼") |
| | | .replace(/\[/g, "") |
| | | .replace(/]/g, ""); |
| | | }); |
| | | if (this.tableList[0]) { |
| | | this.$set(this.configForm, "fileType", this.tableList[0].fileType); |
| | | this.$set( |
| | | this.configForm, |
| | | "collectUrl", |
| | | this.tableList[0].collectUrl |
| | | ); |
| | | this.$set( |
| | | this.configForm, |
| | | "storageUrl", |
| | | this.tableList[0].storageUrl |
| | | ); |
| | | this.$set(this.configForm, "ip", this.tableList[0].ip); |
| | | this.$set( |
| | | this.configForm, |
| | | "entrustCode", |
| | | this.tableList[0].entrustCode |
| | | ); |
| | | this.$set( |
| | | this.configForm, |
| | | "sampleCode", |
| | | this.tableList[0].sampleCode |
| | | ); |
| | | this.$set( |
| | | this.configForm, |
| | | "dbFileName", |
| | | this.tableList[0].dbFileName |
| | | ); |
| | | this.$set( |
| | | this.configForm, |
| | | "fiberOpticRibbon", |
| | | this.tableList[0].fiberOpticRibbon |
| | | ) |
| | | } |
| | | // ä¸è¬çåå¹¶è¡ |
| | | if ( |
| | | this.spanConfig != undefined && |
| | | this.spanConfig.rows && |
| | | this.spanConfig.rows.length > 0 |
| | | ) { |
| | | this.spanList = []; |
| | | this.spanConfig.rows.forEach((item, index) => { |
| | | this.spanList.push({ |
| | | arr: [], |
| | | position: 0 |
| | | }); |
| | | this.rowspan( |
| | | this.spanList[index].arr, |
| | | this.spanList[index].position, |
| | | item.name |
| | | ); |
| | | }); |
| | | } |
| | | // ç¹æ®çåå¹¶è¡ |
| | | if ( |
| | | this.spanConfig != undefined && |
| | | this.spanConfig.special && |
| | | this.spanConfig.special.main && |
| | | this.spanConfig.special.rows && |
| | | this.spanConfig.special.rows.length > 0 |
| | | ) { |
| | | this.specialSpanList = []; |
| | | this.spanConfig.special.rows.forEach((item, index) => { |
| | | this.specialSpanList.push({ |
| | | arr: [], |
| | | position: 0 |
| | | }); |
| | | this.rowspan( |
| | | this.specialSpanList[index].arr, |
| | | this.specialSpanList[index].position, |
| | | this.spanConfig.special.main |
| | | ); |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | submitForm4() { |
| | | const obj = Object.assign({ |
| | | deviceId: this.deviceId, |
| | | fileType: this.configForm.fileType, |
| | | collectUrl: this.configForm.collectUrl, |
| | | storageUrl: this.configForm.storageUrl, |
| | | ip: this.configForm.ip, |
| | | isDevice: true, |
| | | entrustCode: this.configForm.entrustCode, |
| | | sampleCode: this.configForm.sampleCode, |
| | | dbFileName: this.configForm.dbFileName, |
| | | fiberOpticRibbon: this.configForm.fiberOpticRibbon |
| | | }); |
| | | this.upLoad4 = true; |
| | | saveDataAcquisitionConfiguration({ deviceId: this.deviceId, ...obj }).then(res => { |
| | | if (res.code == 200) { |
| | | // this.tableList = res.data; |
| | | this.dialogVisible4 = false; |
| | | this.init(); |
| | | this.$message.success("æä½æå"); |
| | | } |
| | | this.upLoad4 = false; |
| | | }) |
| | | .catch(err => { |
| | | this.upLoad4 = false; |
| | | }); |
| | | }, |
| | | dataConfig(row) { |
| | | this.configForm = { |
| | | deviceId: row.deviceId, |
| | | inspectionItem: row.inspectionItem.trim(), |
| | | inspectionItemSubclass: row.inspectionItemSubclass, |
| | | structureItemParameterId: row.structureItemParameterId, |
| | | inspectionItemClass: row.inspectionItemClass, |
| | | }; |
| | | this.dialogVisible3 = true; |
| | | queryDataAcquisitionConfiguration({ |
| | | deviceId: this.deviceId, |
| | | inspectionItem: row.inspectionItem.trim(), |
| | | isDevice: true, |
| | | inspectionItemSubclass: row.inspectionItemSubclass.trim(), |
| | | inspectionItemClass: row.inspectionItemClass.trim(), |
| | | structureItemParameterId: row.structureItemParameterId |
| | | }).then(res => { |
| | | const data = res.data; |
| | | if (data[0]) { |
| | | this.domains.splice(0, 1); |
| | | let formula = data[0].formula |
| | | let isIncludes = false |
| | | if (formula && formula != "") { |
| | | for (let key in this.formulas) { |
| | | if (formula.includes(this.formulas[key].label)) { |
| | | isIncludes = true |
| | | } |
| | | } |
| | | } |
| | | if (!isIncludes && formula) { |
| | | let formulaValue = formula.slice(1, -1) |
| | | this.$set(this.configForm, "formula", formulaValue); |
| | | } else { |
| | | this.$set(this.configForm, "formula", data[0].formula); |
| | | } |
| | | data.forEach(i => { |
| | | this.domains.push({ |
| | | referx: i.referx, |
| | | refery: i.refery, |
| | | x: i.x, |
| | | y: i.y, |
| | | anotherName: i.anotherName, |
| | | matchingName: i.matchingName, |
| | | id: i.id |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | submitForm3() { |
| | | this.$refs.configForm.validate(valid => { |
| | | // è¡¨åæ ¡éª |
| | | if (valid) { |
| | | this.domains.forEach(item => { |
| | | const isEmpty = Object.values(item).every(val => val === ""); |
| | | if (isEmpty) { |
| | | this.$message.error("请填ååç
§æ°æ®"); |
| | | } |
| | | }); |
| | | this.domains.forEach((i, index) => { |
| | | let isIncludes = false |
| | | if (this.configForm.formula && this.configForm.formula !== "") { |
| | | for (let formula in this.formulas) { |
| | | if (this.configForm.formula.includes(this.formulas[formula].label)) { |
| | | isIncludes = true |
| | | } |
| | | } |
| | | } |
| | | if (isIncludes === false && this.configForm.formula !== "" && this.configForm.formula !== undefined) { |
| | | i.formula = "(" + this.configForm.formula + ")"; |
| | | } else { |
| | | i.formula = this.configForm.formula; |
| | | } |
| | | i.deviceId = this.deviceId; |
| | | i.inspectionItem = this.configForm.inspectionItem; |
| | | i.inspectionItemSubclass = this.configForm.inspectionItemSubclass; |
| | | i.structureItemParameterId = this.configForm.structureItemParameterId; |
| | | i.inspectionItemClass = this.configForm.inspectionItemClass; |
| | | i.serialNumber = this.getIndexWithAlphabet(index) |
| | | }); |
| | | saveDataAcquisitionConfiguration({ |
| | | deviceId: this.deviceId, |
| | | dataConfigList: this.domains, |
| | | isDevice: false |
| | | }).then(res => { |
| | | this.dialogVisible3 = false; |
| | | this.domains = [ |
| | | { |
| | | referx: "", |
| | | refery: "", |
| | | x: "", |
| | | y: "", |
| | | id: "" |
| | | } |
| | | ]; |
| | | if (this.deleteList.length > 0) { |
| | | deleteDataAcquisitionConfiguration({ ids: this.deleteList.join() }).then(res => { |
| | | if (res.code == 200) { |
| | | this.init(); |
| | | } |
| | | }); |
| | | } |
| | | this.init(); |
| | | this.$message.success("æ·»å æå"); |
| | | }); |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | removeDomain(item) { |
| | | // å é¤å
¬å¼formItem |
| | | const index = this.domains.indexOf(item); |
| | | if (index !== -1 && this.domains.length > 1) { |
| | | if (item.id) { |
| | | this.deleteList.push(item.id); |
| | | this.domains.splice(index, 1); |
| | | } else { |
| | | this.domains.splice(index, 1); |
| | | } |
| | | } else { |
| | | this.$message.error("ä¸å
许å 餿å䏿¡æ°æ®ï¼"); |
| | | } |
| | | }, |
| | | addDomain() { |
| | | // æ·»å å
¬å¼formItem |
| | | this.domains.push({ |
| | | referx: "", |
| | | refery: "", |
| | | x: "", |
| | | y: "", |
| | | id: "" |
| | | }); |
| | | }, |
| | | evalResult(val) { |
| | | this.configForm.formula = val; |
| | | // æ ¹æ®å
¬å¼è®¡ç®åºç»æ |
| | | }, |
| | | sizeChange(val) { |
| | | this.page.size = val; |
| | | }, |
| | | currentChange(val) { |
| | | this.page.current = val; |
| | | }, |
| | | closeForm() { |
| | | this.deleteList = []; |
| | | this.domains = [ |
| | | { |
| | | referx: "", |
| | | refery: "", |
| | | x: "", |
| | | y: "", |
| | | id: "" |
| | | } |
| | | ]; |
| | | this.dialogVisible3 = false; |
| | | this.$refs.configForm.resetFields(); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .itemFomItem { |
| | | margin-left: 20px; |
| | | } |
| | | |
| | | .search_thing { |
| | | width: 350px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search_label { |
| | | width: 110px; |
| | | |
| | | font-size: 14px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .data-acquisition-config { |
| | | width: 100%; |
| | | height: 100%; |
| | | overflow-y: hidden; |
| | | overflow-x: hidden; |
| | | |
| | | .title { |
| | | height: 60px; |
| | | line-height: 60px; |
| | | } |
| | | } |
| | | |
| | | .page { |
| | | width: 100%; |
| | | height: 30px; |
| | | text-align: right; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .table { |
| | | margin-top: 10px; |
| | | background-color: #fff; |
| | | width: calc(100vw - 1em); |
| | | height: calc(100vh - 18em); |
| | | } |
| | | |
| | | .fomItem1 { |
| | | display: flex; |
| | | height: 74px; |
| | | } |
| | | |
| | | .fomItem2 { |
| | | display: flex; |
| | | width: 100%; |
| | | } |
| | | |
| | | .fomItemInput { |
| | | width: 180px; |
| | | margin-right: 6px; |
| | | } |
| | | |
| | | .fomItemInput1 { |
| | | width: 100%; |
| | | margin-right: 6px; |
| | | } |
| | | |
| | | >>>.el-form-item__label { |
| | | padding-bottom: 0 !important; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- 设å¤åç¨ --> |
| | | <template> |
| | | <div> |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æµç¨ç¼å·ï¼</div> |
| | | <div><el-input size="small" placeholder="请è¾å
¥" clearable v-model="queryParams.processNumber" |
| | | @keyup.enter.native="refreshTable()"></el-input></div> |
| | | </div> |
| | | <div class="search_thing" style="padding-left: 30px;"> |
| | | <el-button size="small" @click="refresh()">é ç½®</el-button> |
| | | <el-button size="small" type="primary" @click="refreshTable()">æ¥ è¯¢</el-button> |
| | | </div> |
| | | <div class="btns"> |
| | | <el-button size="small" type="primary" @click="add">æ°å¢</el-button> |
| | | <el-button size="small" type="primary" @click="handleDown" :loading="outLoading">导åº</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="tables" style="margin-top: 10px;"> |
| | | <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 290px)'" |
| | | :page="page" @pagination="pagination"></lims-table> |
| | | <!-- <ValueTable ref="ValueTable" :url="$api.deviceBorrow.deviceBorrowPage" |
| | | :delUrl="$api.deviceBorrow.deleteDeviceBorrow" :componentData="componentData" :key="upIndex" /> --> |
| | | </div> |
| | | <el-dialog title="仪å¨è®¾å¤é¢(å)ç¨ç»è®°" top="5vh" :visible.sync="dialogVisible" width="60%"> |
| | | <el-steps :active="currentStep" finish-status="success" align-center> |
| | | <el-step style="cursor:pointer" v-for="(v, i) in steps" :title="v" :key="i" |
| | | @click.native="choiceStep(i)"></el-step> |
| | | </el-steps> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="130px"> |
| | | <div v-show="currentStepClick === 0"> |
| | | <el-card style="margin-top: 1em; height: 51vh; overflow-y: scroll;"> |
| | | <!-- æ°å¢è®¾å¤äºè®°å½å¡ç --> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç¼å·ï¼" prop="processNumber"> |
| | | <el-input v-model="form.processNumber" size="small" :disabled="currentStep > 0"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设å¤åç§°ï¼"> |
| | | <el-input v-model="form.deviceName" size="small" disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="管çç¼å·ï¼" prop="unifyNumber"> |
| | | <el-input v-model="form.unifyNumber" size="small" :disabled="currentStep > 0"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åç¨äººï¼" prop="recipientUser"> |
| | | <el-select v-model="form.recipientUser" filterable placeholder="è¯·éæ©" clearable size="small" |
| | | style="width: 100%;" :disabled="currentStep > 0"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </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-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åç¨æ¥æï¼" prop="recipientTime"> |
| | | <el-date-picker v-model="form.recipientTime" type="date" placeholder="éæ©æ¥æ" size="small" |
| | | format="yyyy-MM-dd" style="width: 100%" value-format="yyyy-MM-dd" :disabled="currentStep > 0"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åç¨æ¶ç¶æï¼"> |
| | | <el-radio-group v-model="form.recipientState" :disabled="currentStep !== 0"> |
| | | <el-radio :label="0">åæ ¼</el-radio> |
| | | <el-radio :label="1">ç»´ä¿®</el-radio> |
| | | <el-radio :label="2">åç¨</el-radio> |
| | | <el-radio :label="3">æ¥åº</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ç¸å
³éä»¶ï¼" prop="fileName"> |
| | | <el-input v-model="form.fileName" disabled size="small" |
| | | :style="`width: ${currentStep == 0 ? '88%' : '100%'};`"> |
| | | <el-button slot="append" v-if="currentStep === 0" icon="el-icon-delete-solid" |
| | | @click="deleteFile"></el-button> |
| | | </el-input> |
| | | <el-upload ref="upload" style="float: right;" :action="action" :show-file-list="false" |
| | | :on-success="onSuccess" :disabled="currentStep !== 0" :headers="uploadHeader"> |
| | | <el-button style="position: relative;top: -4px" class="uploadFile" slot="trigger" size="small" |
| | | type="primary" v-if="currentStep === 0">éä»¶ä¸ä¼ </el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸ç¯è责任人ï¼" prop="nextUser"> |
| | | <el-select v-model="form.nextUser" filterable placeholder="è¯·éæ©" clearable size="small" |
| | | style="width: 100%;" :disabled="currentStep !== 0"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.submitOperationUser }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.submitOperationTime }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div v-show="currentStepClick === 1"> |
| | | <el-card style="margin-top: 1em; height: 51vh; overflow-y: scroll;"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å½è¿äººï¼" prop="rebackUser" |
| | | :rules="[{ required: currentStep === 1, message: '请è¾å
¥å½è¿äºº', trigger: 'change' }]"> |
| | | <!-- <el-input v-model="form.rebackUser" size="small" :disabled="currentStep !== 1"></el-input> --> |
| | | <el-select v-model="form.rebackUser" filterable placeholder="è¯·éæ©" clearable size="small" |
| | | style="width: 50%;" :disabled="currentStep !== 1"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å½è¿æ¥æï¼" prop="rebackTime" |
| | | :rules="[{ required: currentStep === 1, message: 'è¯·éæ©å½è¿æ¥æ', trigger: 'change' }]"> |
| | | <el-date-picker v-model="form.rebackTime" :disabled="currentStep !== 1" type="date" placeholder="éæ©æ¥æ" |
| | | size="small" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¥æ¶ç¶åµï¼"> |
| | | <el-radio-group v-model="form.receiveState" :disabled="currentStep !== 1"> |
| | | <el-radio :label="0">åæ ¼</el-radio> |
| | | <el-radio :label="1">ç»´ä¿®</el-radio> |
| | | <el-radio :label="2">åç¨</el-radio> |
| | | <el-radio :label="3">æ¥åº</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设å¤è´è´£äººï¼" prop="deviceUser" |
| | | :rules="[{ required: currentStep === 1, message: 'è¯·éæ©è®¾å¤è´è´£äºº', trigger: 'change' }]"> |
| | | <!-- <el-input v-model="form.deviceUser" size="small" :disabled="currentStep !== 1"></el-input> --> |
| | | <el-select v-model="form.deviceUser" filterable placeholder="è¯·éæ©" clearable size="small" |
| | | style="width: 50%;" :disabled="currentStep !== 1"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿³¨ï¼"> |
| | | <el-input type="textarea" v-model="form.note" :disabled="currentStep !== 1" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.receiveOperationUser }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.receiveOperationTime }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <span slot="footer" 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> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="æµç¨è·è¸ª" top="5vh" :visible.sync="dialogVisible0" width="60%"> |
| | | <el-table :data="deviceLogs" style="width: 100%"> |
| | | <el-table-column type="index" width="50"> |
| | | </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> |
| | | <el-table-column prop="operationType" label="æäº¤ç±»å"> |
| | | </el-table-column> |
| | | <el-table-column prop="operationContent" label="æä½å
容"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { dateFormat } from '@/utils/date' |
| | | import { |
| | | saveDeviceBorrow, |
| | | deleteCNASFile, |
| | | getDeviceBorrow, |
| | | deviceBorrowExport, |
| | | deleteDeviceBorrow, |
| | | deviceBorrowPage, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/system/user"; |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | } |
| | | }, |
| | | components: { |
| | | limsTable |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | dialogVisible0: false, |
| | | currentStep: 0, // æ¥éª¤æ¡æ¾ç¤ºç¬¬å æ¥ |
| | | currentStepClick: 0, // ç¹å»æ¥éª¤æ¡åå |
| | | steps: ['ååº', 'åç¨'], |
| | | responsibleOptions: [], // ä¸ç¯èè´è´£äººlist |
| | | form: { |
| | | processNumber: null, |
| | | deviceName: null, |
| | | unifyNumber: null, |
| | | recipientUser: null, |
| | | recipientTime: null, |
| | | nextUser: null, |
| | | rebackUser: null, |
| | | rebackTime: null, |
| | | receiveState: null, |
| | | deviceUser: null, |
| | | fileName: null, |
| | | }, |
| | | rules: { |
| | | processNumber: [{ required: true, message: '请è¾å
¥ç¼å·', trigger: 'blur' }], |
| | | deviceName: [{ required: true, message: '请è¾å
¥è®¾å¤åç§°', trigger: 'blur' }], |
| | | unifyNumber: [{ required: true, message: '请è¾å
¥ç®¡çç¼å·', trigger: 'blur' }], |
| | | recipientUser: [{ required: true, message: '请è¾å
¥åç¨äºº', trigger: 'blur' }], |
| | | borrowerContactInformation: [{ required: true, message: '请è¾å
¥åç¨äººèç³»æ¹å¼', trigger: 'blur' }], |
| | | recipientTime: [{ required: true, message: 'è¯·éæ©åç¨æ¥æ', trigger: 'change' }], |
| | | nextUser: [{ required: true, message: 'è¯·éæ©ä¸ç¯èè´è´£äºº', trigger: 'change' }], |
| | | }, |
| | | deviceLogs: [], |
| | | outLoading: false, |
| | | recipientStateList: [{ |
| | | value: 0, |
| | | type: 'success', |
| | | label: 'åæ ¼' |
| | | }, { |
| | | value: 1, |
| | | type: 'warning', |
| | | label: 'ç»´ä¿®' |
| | | }, { |
| | | value: 2, |
| | | type: 'info', |
| | | label: 'åç¨' |
| | | }, { |
| | | value: 3, |
| | | type: 'danger', |
| | | label: 'æ¥åº' |
| | | }], |
| | | queryParams: {}, |
| | | tableData: [], |
| | | column: [ |
| | | { label: "æµç¨ç¼å·", prop: "processNumber" }, |
| | | { label: "设å¤åç§°", prop: "deviceName" }, |
| | | { |
| | | label: "管çç¼å·", |
| | | prop: "unifyNumber" |
| | | }, |
| | | { label: "åç¨äºº", prop: "recipientUser" }, |
| | | { label: "åç¨äººèç³»æ¹å¼", prop: "borrowerContactInformation", width: '140px' }, |
| | | { label: "åç¨æ¥æ", prop: "recipientTime" }, |
| | | { |
| | | label: "åç¨æ¶ç¶æ", prop: "recipientState", dataType: "tag", |
| | | formatData: (params) => { |
| | | return this.recipientStateList.find((m) => m.value == params).label; |
| | | }, |
| | | formatType: (params) => { |
| | | return this.recipientStateList.find((m) => m.value == params).type; |
| | | }, |
| | | }, |
| | | { label: "ååºäºº", prop: "submitUser" }, |
| | | { label: "ååºæ¥æ", prop: "createTime" }, |
| | | { |
| | | label: "å½åç¶æ", prop: "nowState" |
| | | }, |
| | | { label: "å½å责任人", prop: "nowUser" }, |
| | | { label: "éä»¶", prop: "fileName" }, |
| | | { |
| | | dataType: "action", |
| | | fixed: "right", |
| | | label: "æä½", |
| | | operation: [ |
| | | { |
| | | name: "æ¥ç", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.lookDetail(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "å é¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDelete(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "æµç¨è·è¸ª", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleLookList(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 0, |
| | | }, |
| | | tableLoading: false, |
| | | } |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | if (newVal.value) { |
| | | thisqueryParams.deviceId = this.clickNodeVal.value |
| | | this.refreshTable() |
| | | } |
| | | }, |
| | | dialogVisible(newVal) { |
| | | if (!newVal) { |
| | | this.form = {} |
| | | this.currentStep = 0 // æ¥éª¤æ¡æ¾ç¤ºç¬¬å æ¥ |
| | | this.currentStepClick = 0 // ç¹å»æ¥éª¤æ¡åå |
| | | this.$refs['form'].clearValidate() |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["nickName"]), |
| | | action() { |
| | | return this.javaApi + '/personBasicInfo/saveCNASFile' |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.queryParams.deviceId = this.clickNodeVal.value |
| | | this.getUserList() |
| | | this.refreshTable() |
| | | }, |
| | | methods: { |
| | | getList() { |
| | | this.tableLoading = true; |
| | | let param = { ...this.queryParams, ...this.page }; |
| | | delete param.total; |
| | | deviceBorrowPage({ ...param }) |
| | | .then((res) => { |
| | | this.tableLoading = false; |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records; |
| | | this.page.total = res.data.total; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.tableLoading = false; |
| | | }); |
| | | }, |
| | | pagination({ page, limit }) { |
| | | this.page.current = page; |
| | | this.page.size = limit; |
| | | this.getList(); |
| | | }, |
| | | refresh() { |
| | | this.queryParams = {}; |
| | | this.page.current = 1; |
| | | this.getList(); |
| | | }, |
| | | refreshTable() { |
| | | this.page.current = 1; |
| | | this.getList(); |
| | | }, |
| | | choiceStep(index) { |
| | | this.currentStepClick = index |
| | | }, |
| | | //æäº¤è¡¨å |
| | | async submitForm(saveState) { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid === true || saveState !== '1submit') { |
| | | // ç»å½åç¯è设置åå»ºäººä¸æ¶é´ |
| | | let user = JSON.parse(localStorage.getItem('user')) |
| | | const dateTime = dateFormat(new Date()) |
| | | // è·åå½åç¯èæä½äººä¸æ¥æ |
| | | switch (this.currentStep) { |
| | | case 0: |
| | | this.form.submitOperationUser = this.nickName |
| | | this.form.submitOperationTime = dateTime |
| | | break |
| | | case 1: |
| | | this.form.receiveOperationUser = this.nickName |
| | | this.form.receiveOperationTime = dateTime |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | // è·åå½åç¯èè´è´£äºº |
| | | switch (saveState === '3reject' ? this.currentStep - 1 : this.currentStep) { |
| | | case 0: |
| | | this.form.nowUser = this.form.nextUser |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | let currentStepAction; |
| | | // 设置该æä½å¤ææ¯å¦ä¸ºæäº¤ï¼ä¿åï¼é©³åï¼éè¿ |
| | | switch (saveState) { |
| | | // æäº¤ï¼éè¿ |
| | | case '1submit': |
| | | currentStepAction = this.currentStep + 1 |
| | | break |
| | | // ä¿å |
| | | case '2save': |
| | | currentStepAction = this.currentStep |
| | | break |
| | | // 驳å |
| | | case '3reject': |
| | | currentStepAction = this.currentStep - 1 |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | // è·åå½åç¶æ |
| | | this.form.nowState = currentStepAction === 2 ? 'å
³é' : this.steps[currentStepAction] |
| | | this.form.deviceId = this.clickNodeVal.value |
| | | delete this.form.deviceLogs |
| | | saveDeviceBorrow(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æäº¤æå') |
| | | this.dialogVisible = false |
| | | this.refreshTable() |
| | | } |
| | | }) |
| | | } else { |
| | | let step = this.steps[this.currentStep] |
| | | this.$message.warning(step + ' æµç¨ä¸æå¿
填项æªå¡«ï¼'); |
| | | } |
| | | }); |
| | | }, |
| | | deleteFile() { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteCNASFile({ fileName: this.form.fileName }).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿åï¼') |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | onSuccess(response, file, fileList) { |
| | | if (response.code == 200) { |
| | | // å¨ä¿åèµå¼æ°æä»¶ |
| | | this.form.fileName = file.name |
| | | this.form.url = response.data |
| | | } else { |
| | | this.$message.error(response.message) |
| | | } |
| | | }, |
| | | // è·åè´è´£äººä¿¡æ¯æ¥å£ |
| | | getUserList() { |
| | | selectUserCondition().then(res => { |
| | | if (res.code == 200) { |
| | | this.responsibleOptions = res.data |
| | | } |
| | | }) |
| | | }, |
| | | // æ¥ç详æ
|
| | | lookDetail(row) { |
| | | getDeviceBorrow({ id: row.id }).then(res => { |
| | | if (res.code == 200) { |
| | | this.form = res.data |
| | | this.form.deviceName = this.clickNodeVal.label |
| | | this.form.deviceId = this.clickNodeVal.value |
| | | this.deviceLogs = res.data.deviceLogs |
| | | let i = this.steps.findIndex(item => item == row.nowState) |
| | | if (i == -1) { |
| | | this.currentStep = 2 |
| | | this.currentStepClick = 0 |
| | | } else { |
| | | this.currentStep = i |
| | | this.currentStepClick = i |
| | | } |
| | | console.log(this.currentStepClick) |
| | | this.dialogVisible = true |
| | | } |
| | | }) |
| | | }, |
| | | // æ°å¢ |
| | | add() { |
| | | this.dialogVisible = true |
| | | this.form = { |
| | | processNumber: null, |
| | | deviceName: null, |
| | | unifyNumber: null, |
| | | recipientUser: null, |
| | | recipientTime: null, |
| | | nextUser: null, |
| | | rebackUser: null, |
| | | rebackTime: null, |
| | | receiveState: null, |
| | | deviceUser: null, |
| | | fileName: null, |
| | | } |
| | | this.form.deviceName = this.clickNodeVal.label |
| | | this.form.deviceId = this.clickNodeVal.value |
| | | }, |
| | | //å¯¼åº |
| | | handleDown() { |
| | | 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) |
| | | }) |
| | | }, |
| | | handleLookList(row) { |
| | | getDeviceBorrow({ id: row.id }).then(res => { |
| | | if (res.code == 200) { |
| | | this.deviceLogs = res.data.deviceLogs |
| | | this.dialogVisible0 = true |
| | | } |
| | | }) |
| | | }, |
| | | handleDelete(row) { |
| | | this.$confirm("æ¯å¦å é¤è¯¥æ¡æ°æ®?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | deleteDeviceBorrow({ id: row.id }).then((res) => { |
| | | this.$message.success("å 餿å"); |
| | | this.refresh(); |
| | | }); |
| | | }) |
| | | .catch(() => { }); |
| | | }, |
| | | }, |
| | | } |
| | | </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: #3A7BFA; |
| | | margin-right: 4px; |
| | | } |
| | | |
| | | .tables { |
| | | width: 100%; |
| | | height: calc(100vh - 15em); |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | display: flex; |
| | | align-items: center; |
| | | position: relative; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .search_thing { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 40px; |
| | | } |
| | | |
| | | .search_label { |
| | | width: 70px; |
| | | font-size: 14px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .search_input { |
| | | width: calc(100% - 120px); |
| | | } |
| | | |
| | | .btns { |
| | | position: absolute; |
| | | right: 0px; |
| | | top: 50%; |
| | | transform: translate(0, -50%); |
| | | } |
| | | |
| | | .btns_thing { |
| | | position: absolute; |
| | | right: 230px; |
| | | top: 50%; |
| | | transform: translate(0, -50%); |
| | | } |
| | | |
| | | .form .search_label { |
| | | width: 120px; |
| | | } |
| | | |
| | | .el-radio { |
| | | margin-right: 10px; |
| | | } |
| | | |
| | | .el-radio-group { |
| | | width: 100%; |
| | | display: flex; |
| | | margin-top: 12px; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- è®¾å¤æ ¡å --> |
| | | <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> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- 设å¤éªæ¶ --> |
| | | <template> |
| | | <div> |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æµç¨ç¼å·ï¼</div> |
| | | <div class="search_input"><el-input v-model="search.processNumber" clearable placeholder="请è¾å
¥" size="small" |
| | | @keyup.enter.native="getDeviceAList(clickNodeVal.value)"></el-input></div> |
| | | </div> |
| | | <div class="search_thing" style="padding-left: 30px;"> |
| | | <el-button size="small" @click="resetSearch">é ç½®</el-button> |
| | | <el-button size="small" type="primary" @click="getDeviceAList(clickNodeVal.value)">æ¥ è¯¢</el-button> |
| | | </div> |
| | | <div class="btns"> |
| | | <el-button size="small" type="primary" @click="dialogVisible = true">æ·»å éªæ¶</el-button> |
| | | <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">导åº</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="tables" style="margin-top: 10px;"> |
| | | <el-table ref="table" :data="tableDataAlist" height="100%"> |
| | | <el-table-column label="åºå·" type="index" width="60"> |
| | | <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" show-overflow-tooltip/> |
| | | <el-table-column label="设å¤åç§°" min-width="140" prop="deviceName" show-overflow-tooltip/> |
| | | <el-table-column label="管çç¼å·" min-width="140" prop="managementNumber" show-overflow-tooltip/> |
| | | <el-table-column label="åºåå·" min-width="80" prop="serialNumber" /> |
| | | <el-table-column label="æäº¤è
" min-width="100" prop="submitUser" /> |
| | | <el-table-column label="æäº¤æ¥æ" min-width="150" prop="createTime" /> |
| | | <el-table-column label="å½åç¶æ" min-width="140" prop="currentState" /> |
| | | <el-table-column label="å½åè´è´£äºº" min-width="120" prop="currentResponsible" /> |
| | | <el-table-column fixed="right" label="æä½" min-width="140"> |
| | | <template #default="{ row }"> |
| | | <el-button size="small" type="text" @click="handleAttachmentClick(row)">éä»¶</el-button> |
| | | <el-button size="small" type="text" @click="handleViewClick(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" @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange"> |
| | | </el-pagination> |
| | | </div> |
| | | <!-- æ·»å è®¾å¤æ
éè®°å½ --> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible" title="仪å¨è®¾å¤éªæ¶è®°å½" |
| | | width="60%" @open="openRecordAcceptance"> |
| | | <el-steps :active="currentStep" finish-status="success"> |
| | | <el-step v-for="(v, i) in steps" :key="i" :title="v" style="cursor:pointer" |
| | | @click.native="choiceStep(i)"></el-step> |
| | | </el-steps> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="130px"> |
| | | <div v-show="currentStepClick === 0"> |
| | | <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;"> |
| | | <!-- æ°å¢è®¾å¤äºè®°å½å¡ç --> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æµç¨ç¼å·ï¼" prop="processNumber"> |
| | | <el-input v-model="form.processNumber" disabled size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <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.manufacturer" disabled size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设å¤åå·ï¼"> |
| | | <el-input v-model="form.specificationModel" disabled size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="管çç¼å·ï¼"> |
| | | <el-input v-model="form.managementNumber" disabled size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: currentStep === 0, message: '请è¾å
¥åºåå·', trigger: 'blur' }]" label="åºåå·ï¼" |
| | | prop="serialNumber"> |
| | | <el-input v-model="form.serialNumber" :disabled="currentStep !== 0" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: currentStep === 0, message: '请è¾å
¥è®¾å¤ç±»å«', trigger: 'change' }]" label="设å¤ç±»å«ï¼" |
| | | prop="deviceClass"> |
| | | <el-radio-group v-model="form.deviceClass" :disabled="currentStep !== 0"> |
| | | <el-radio label="0precision">ç²¾å¯å设å¤</el-radio> |
| | | <el-radio label="1conventional">常è§è®¾å¤</el-radio><br /> |
| | | <el-radio label="2auxiliary_class">è¾
å©ç±»è®¾å¤</el-radio> |
| | | <el-radio label="4environmental">ç¯å¢ç±»è®¾å¤</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item :rules="[{ required: currentStep === 0, message: '请è¾å
¥å¼ç®±åæ£æ¥å¤å
è£
ææ ç ´æ', trigger: 'blur' }]" label="å¼ç®±åæ£æ¥å¤å
è£
ææ ç ´æï¼" label-width="220px" |
| | | prop="checkOuterPackaging"> |
| | | <el-input v-model="form.checkOuterPackaging" :disabled="currentStep !== 0" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ç¸å
³éä»¶ï¼" prop="fileName"> |
| | | <el-input v-model="form.fileName" :style="`width: ${currentStep == 0 ? '88%' : '100%'};`" disabled |
| | | size="small"> |
| | | <el-button v-if="currentStep === 0" slot="append" icon="el-icon-delete-solid" |
| | | @click="deleteFile"></el-button> |
| | | </el-input> |
| | | <el-upload ref="upload" :action="action" :on-success="onSuccess" :show-file-list="false" |
| | | style="float: right;"> |
| | | <el-button v-if="currentStep === 0" slot="trigger" class="uploadFile" 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 :rules="[{ required: currentStep === 0, message: 'è¯·éæ©ä¸ç¯è责任人', trigger: 'change' }]" label="ä¸ç¯è责任人ï¼" |
| | | prop="submitNextPesponsible"> |
| | | <el-select v-model="form.submitNextPesponsible" :disabled="currentStep !== 0" clearable filterable |
| | | placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" style="width: 50%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: currentStep === 0, message: '请è¾å
¥è®¾å¤å¼ç®±éªæ¶ç»è®º', trigger: 'change' }]" label="设å¤å¼ç®±éªæ¶ç»è®ºï¼" label-width="150px" |
| | | prop="unpackingAcceptanceConclusion"> |
| | | <el-radio-group v-model="form.unpackingAcceptanceConclusion" :disabled="currentStep !== 0"> |
| | | <el-radio :label="'0qualified'">åæ ¼</el-radio> |
| | | <el-radio :label="'1unqualified'">ä¸åæ ¼ï¼ç¼ºå°å¤ä»¶ä¾åºåè¡¥å</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <div style="margin-bottom: 20px; width: 100%;"> |
| | | <label>å¤ä»¶ç¡®è®¤ï¼</label> |
| | | <el-button v-if="currentStep === 0" size="small" style="float: right;" |
| | | type="primary" @click="addTableRow('sparePartsConfirmationList')">å¢å è¡</el-button> |
| | | </div> |
| | | <el-table :data="form.sparePartsConfirmationList" border stripe style="width: 100%; min-height: 30vh"> |
| | | <el-table-column label="åºå·" prop="åºå·" type="index" width="80" /> |
| | | <el-table-column label="åç§°" min-width="120" prop="name"> |
| | | <template v-slot="scope"> |
| | | <el-input v-if="currentStep === 0" v-model="scope.row.name" size="small"></el-input> |
| | | <label v-else>{{ scope.row.name }}</label> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æ°é" min-width="120" prop="number"> |
| | | <template v-slot="scope"> |
| | | <el-input v-if="currentStep === 0" v-model="scope.row.number" size="small"></el-input> |
| | | <label v-else>{{ scope.row.number }}</label> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="夿³¨" min-width="120" prop="note"> |
| | | <template v-slot="scope"> |
| | | <el-input v-if="currentStep === 0" v-model="scope.row.note" size="small"></el-input> |
| | | <label v-else>{{ scope.row.note }}</label> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-if="currentStep === 0" fixed="right" label="æä½" width="90"> |
| | | <template slot-scope="scope"> |
| | | <el-button icon="el-icon-delete" type="text" |
| | | @click="deleteRow(scope.$index, scope.row, 'sparePartsConfirmationList')">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <div style="margin: 20px 0; width: 100%;"> |
| | | <label>æä»¶ç±»ç¡®è®¤ï¼</label> |
| | | <el-button v-if="currentStep === 0" size="small" style="float: right;" |
| | | type="primary" @click="addTableRow('fileClassConfirmationList')">å¢å è¡</el-button> |
| | | </div> |
| | | <el-table :data="form.fileClassConfirmationList" border stripe style="width: 100%; min-height: 30vh"> |
| | | <el-table-column label="åºå·" prop="åºå·" type="index" width="80" /> |
| | | <el-table-column label="åºæåæ°" min-width="120" prop="expectedCopies"> |
| | | <template v-slot="scope"> |
| | | <el-input v-if="currentStep === 0" v-model="scope.row.expectedCopies" size="small"></el-input> |
| | | <label v-else>{{ scope.row.expectedCopies }}</label> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å®é
æ¶å°åæ°" min-width="120" prop="actualCopies"> |
| | | <template v-slot="scope"> |
| | | <el-input v-if="currentStep === 0" v-model="scope.row.actualCopies" size="small"></el-input> |
| | | <label v-else>{{ scope.row.actualCopies }}</label> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-if="currentStep === 0" fixed="right" label="æä½" width="90"> |
| | | <template v-slot="scope"> |
| | | <el-button icon="el-icon-delete" type="text" |
| | | @click="deleteRow(scope.$index, scope.row, 'fileClassConfirmationList')">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-col> |
| | | <el-col :span="24" style="margin-top: 10px;"> |
| | | <el-form-item label="夿³¨ï¼" label-width="90px"> |
| | | <el-input v-model="form.submitRemarks" :disabled="currentStep !== 0" size="small" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.submitOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.submitDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div v-show="currentStepClick === 1"> |
| | | <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿 ¸æè§ï¼" prop="accidentDescription"> |
| | | <el-input v-model="form.unpackingReviewOpinion" :disabled="currentStep !== 1" size="small" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item :rules="[{ required: currentStep === 1, message: '请è¾å
¥ä¸ç¯è责任人', trigger: 'change' }]" label="ä¸ç¯è责任人ï¼" |
| | | prop="unpackingNextPesponsible"> |
| | | <el-select v-model="form.unpackingNextPesponsible" :disabled="currentStep !== 1" clearable filterable |
| | | placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" style="width: 50%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.unpackingOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.unpackingDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div v-show="currentStepClick === 2"> |
| | | <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item :rules="[{ required: currentStep === 2, message: '请è¾å
¥å®è£
ä½ç½®', trigger: 'blur' }]" label="å®è£
ä½ç½®ï¼" |
| | | prop="installLocation"> |
| | | <el-input v-model="form.installLocation" :disabled="currentStep !== 2" clearable placeholder="请è¾å
¥å®è£
ä½ç½®" |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿³¨ï¼"> |
| | | <el-input v-model="form.installRemarks" :disabled="currentStep !== 2" size="small" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item :rules="[{ required: currentStep === 2, message: '请è¾å
¥ä¸ç¯è责任人', trigger: 'blur' }]" label="ä¸ç¯è责任人ï¼" |
| | | prop="installNextPesponsible"> |
| | | <el-select v-model="form.installNextPesponsible" :disabled="currentStep !== 2" clearable filterable |
| | | placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" style="width: 50%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <div style="margin-bottom: 20px; width: 100%;"> |
| | | <label>å®è£
éªæ¶è®°å½</label> |
| | | <el-button v-if="currentStep === 2" size="small" style="float: right;" |
| | | type="primary" @click="addTableRow('installationAcceptanceRecordList')">å¢å è¡</el-button> |
| | | </div> |
| | | <el-table :data="form.installationAcceptanceRecordList" border stripe |
| | | style="width: 100%; min-height: 30vh"> |
| | | <el-table-column label="åºå·" prop="åºå·" type="index" width="80" /> |
| | | <el-table-column label="项ç®" min-width="120" prop="installationProject"> |
| | | <template v-slot="scope"> |
| | | <el-input v-if="currentStep === 2" v-model="scope.row.installationProject" |
| | | size="small"></el-input> |
| | | <label v-else>{{ scope.row.installationProject }}</label> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å®è£
æ
åµ" min-width="120" prop="installationSituation"> |
| | | <template v-slot="scope"> |
| | | <el-input v-if="currentStep === 2" v-model="scope.row.installationSituation" |
| | | size="small"></el-input> |
| | | <label v-else>{{ scope.row.installationSituation }}</label> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å®è£
宿" min-width="120" prop="installationCompleted"> |
| | | <template v-slot="scope"> |
| | | <el-select v-if="currentStep === 2" v-model="scope.row.installationCompleted" placeholder="è¯·éæ©"> |
| | | <el-option label="æ¯" value="0yes"></el-option> |
| | | <el-option label="å¦" value="1no"></el-option> |
| | | </el-select> |
| | | <label v-else>{{ scope.row.installationCompleted === '0yes' ? 'æ¯' : |
| | | scope.row.installationCompleted === '1no' ? 'å¦' : '' }}</label> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-if="currentStep === 2" fixed="right" label="æä½" width="90"> |
| | | <template slot-scope="scope"> |
| | | <el-button icon="el-icon-delete" type="text" |
| | | @click="deleteRow(scope.$index, scope.row, 'installationAcceptanceRecordList')">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.installOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.installDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div v-show="currentStepClick === 3"> |
| | | <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item :rules="[{ required: currentStep === 3, message: '请è¾å
¥å¤åæè§', trigger: 'blur' }]" label="å¤åæè§ï¼" |
| | | prop="installationAcceptanceCompoundOpinion"> |
| | | <el-input v-model="form.installationAcceptanceCompoundOpinion" :disabled="currentStep !== 3" |
| | | size="small" type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item :rules="[{ required: currentStep === 3, message: '请è¾å
¥ä¸ç¯èè´è´£äºº', trigger: 'change' }]" label="ä¸ç¯è责任人ï¼" |
| | | prop="installationAcceptanceNextPesponsible"> |
| | | <el-select v-model="form.installationAcceptanceNextPesponsible" :disabled="currentStep !== 3" clearable |
| | | filterable placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" style="width: 50%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.installationAcceptanceOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.installationAcceptanceDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div v-show="currentStepClick === 4"> |
| | | <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;"> |
| | | <div style="margin-bottom: 20px; width: 100%;"> |
| | | <label>éªæ¶æ ¸æ¥è®°å½ï¼</label> |
| | | <el-button v-if="currentStep === 4" size="small" style="float: right;" |
| | | type="primary" @click="addTableRow('acceptanceCheckRecordList')">å¢å è¡</el-button> |
| | | </div> |
| | | <el-table :data="form.acceptanceCheckRecordList" border style="width: 100%; min-height: 30vh"> |
| | | <el-table-column label="åºå·" prop="sequence" width="80"> |
| | | </el-table-column> |
| | | <el-table-column label="ä»ªå¨æ¨¡å" min-width="120" prop="instrumentModule"> |
| | | <template v-slot="scope"> |
| | | <el-input v-if="currentStep === 4" v-model="scope.row.instrumentModule" size="small"></el-input> |
| | | <label v-else>{{ scope.row.instrumentModule }}</label> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æ ¸æ¥åæ°" min-width="120" prop="verificationParameter"> |
| | | <template v-slot="scope"> |
| | | <el-input v-if="currentStep === 4" v-model="scope.row.verificationParameter" size="small"></el-input> |
| | | <label v-else>{{ scope.row.verificationParameter }}</label> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="坿¥æ¶é" min-width="120" prop="acceptableLimit"> |
| | | <template v-slot="scope"> |
| | | <el-input v-if="currentStep === 4" v-model="scope.row.acceptableLimit" size="small"></el-input> |
| | | <label v-else>{{ scope.row.acceptableLimit }}</label> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æ ¸æ¥ç»æ" min-width="120" prop="verificationResult"> |
| | | <template v-slot="scope"> |
| | | <el-input v-if="currentStep === 4" v-model="scope.row.verificationResult" size="small"></el-input> |
| | | <label v-else>{{ scope.row.verificationResult }}</label> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æ ¸æ¥ç»è®º" min-width="120" prop="verificationConclusion"> |
| | | <template v-slot="scope"> |
| | | <el-select v-if="currentStep === 4" v-model="scope.row.verificationConclusion" placeholder="è¯·éæ©"> |
| | | <el-option label="符å" value="0accordWith"></el-option> |
| | | <el-option label="ä¸ç¬¦å" value="1inconformity"></el-option> |
| | | </el-select> |
| | | <label v-else>{{ scope.row.verificationConclusion }}</label> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-if="currentStep === 4" fixed="right" label="æä½" width="90"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="small" type="text" |
| | | @click="deleteRow(scope.$index, scope.row, 'acceptanceCheckRecordList')">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-form-item :rules="[{ required: currentStep === 4, message: '请è¾å
¥è®¾å¤å¼ç®±éªæ¶ç»è®º', trigger: 'change' }]" label="设å¤å¼ç®±éªæ¶ç»è®ºï¼" |
| | | label-width="150px" prop="acceptanceCheckUnpackingConclusion"> |
| | | <el-radio-group v-model="form.acceptanceCheckUnpackingConclusion" :disabled="currentStep !== 4"> |
| | | <el-radio :label="'0qualified'">åæ ¼</el-radio> |
| | | <el-radio :label="'1unqualified'">ä¸åæ ¼ï¼ç¼ºå°å¤ä»¶ä¾åºåè¡¥å</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item :rules="[{ required: currentStep === 4, message: '请è¾å
¥ä¸ç¯è责任人', trigger: 'change' }]" label="ä¸ç¯è责任人ï¼" |
| | | prop="acceptanceCheckNextPesponsible"> |
| | | <el-select v-model="form.acceptanceCheckNextPesponsible" :disabled="currentStep !== 4" clearable |
| | | filterable placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" style="width: 50%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.value" :label="item.label" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.acceptanceCheckOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.acceptanceCheckDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div v-show="currentStepClick === 5"> |
| | | <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item :rules="[{ required: currentStep === 5, message: '请è¾å
¥å®¡æ ¸æè§', trigger: 'blur' }]" label="å®¡æ ¸æè§ï¼" |
| | | prop="acceptanceAuditAuditOpinion"> |
| | | <el-input v-model="form.acceptanceAuditAuditOpinion" :disabled="currentStep !== 5" size="small" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.acceptanceAuditOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.acceptanceAuditDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button v-if="currentStep !== 0 && currentStep !== 6" @click="submitForm('3reject')">驳å</el-button> |
| | | <el-button v-if="currentStep === 0" @click="submitForm('2save')">ä¿å</el-button> |
| | | <el-button v-if="currentStep !== 6" type="primary" @click="submitForm('1submit')">{{ currentStep === 0 ? 'æäº¤' : |
| | | 'éè¿' |
| | | }}</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | <!-- æ¥åç¼è¾æ¡ --> |
| | | </template> |
| | | |
| | | <script> |
| | | import { dateFormat } from '@/utils/date' |
| | | import file from "@/utils/file"; |
| | | import { |
| | | deleteCNASFile, |
| | | deleteIncidentReportAll, getShowIncidentReport, incidentReportExport, incidentReportPage, |
| | | saveIncidentReportData, |
| | | selectDeviceByCode |
| | | } from "@/api/cnas/resourceDemand/device"; |
| | | import {selectUserCondition} from "@/api/system/user"; |
| | | |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | //äºæ
设å¤ä¿¡æ¯ |
| | | tableDataAlist: [], // æ´æ¹åéåç§° |
| | | dialogVisible: false, |
| | | rules: { |
| | | quantity: [{ required: true, message: '请è¾å
¥æ°é', trigger: 'blur' }], |
| | | }, |
| | | currentStep: 0, // æ¥éª¤æ¡æ¾ç¤ºç¬¬å æ¥ |
| | | currentStepClick: 0, // ç¹å»æ¥éª¤æ¡åå |
| | | steps: ['æäº¤', 'å¼ç®±éªæ¶å¤æ ¸', 'å®è£
éªæ¶æ£æ¥', 'å®è£
éªæ¶å¤æ ¸', 'éªæ¶æ ¸æ¥', 'éªæ¶æ ¸æ¥å®¡æ ¸'], |
| | | form: { |
| | | sparePartsConfirmationList: [], // å¤ä»¶ç¡®è®¤List |
| | | fileClassConfirmationList: [], // æä»¶ç¡®è®¤List |
| | | installationAcceptanceRecordList: [], // å®è£
éªæ¶è®°å½ |
| | | acceptanceCheckRecordList: [], // éªæ¶æ ¸æ¥è®°å½ |
| | | fileName: '', // æä»¶åç§° |
| | | systemFileName: '', // ç³»ç»æä»¶åç§° |
| | | }, |
| | | outLoading: false, |
| | | responsibleOptions: [], // ä¸ç¯èè´è´£äººlist |
| | | isUpdate: false, |
| | | search: { |
| | | size: 20, |
| | | current: 1, |
| | | total: 0, |
| | | processNumber: '', |
| | | }, |
| | | } |
| | | }, |
| | | computed: { |
| | | action() { |
| | | return this.javaApi + '/personBasicInfo/saveCNASFile' |
| | | } |
| | | }, |
| | | mounted() { |
| | | // è·å设å¤äºæ
ä¿¡æ¯ |
| | | this.getDeviceAList(this.clickNodeVal.value); |
| | | window.excelClosed = this.closed |
| | | }, |
| | | methods: { |
| | | handleSizeChange(val) { |
| | | this.search.size = val |
| | | this.getDeviceAList(this.clickNodeVal.value); |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.search.current = val |
| | | this.getDeviceAList(this.clickNodeVal.value); |
| | | }, |
| | | deleteFile() { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteCNASFile({fileName: this.form.systemFileName}).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿åï¼') |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | onSuccess(response, file, fileList) { |
| | | if (response.code == 200) { |
| | | // å¨ä¿åèµå¼æ°æä»¶ |
| | | this.form.fileName = file.name |
| | | this.form.systemFileName = response.data |
| | | } else { |
| | | this.$message.error(response.message) |
| | | } |
| | | }, |
| | | addTableRow(value) { |
| | | switch (value) { |
| | | // å¤ä»¶ç¡®è®¤ |
| | | case 'sparePartsConfirmationList': |
| | | const obj = Object.assign({ |
| | | name: '', |
| | | number: null, |
| | | note: '' |
| | | }) |
| | | this.form.sparePartsConfirmationList.push(obj) |
| | | break |
| | | // æä»¶ç¡®è®¤List |
| | | case 'fileClassConfirmationList': |
| | | const obj1 = Object.assign({ |
| | | expectedCopies: '', |
| | | actualCopies: '', |
| | | }) |
| | | this.form.fileClassConfirmationList.push(obj1) |
| | | break |
| | | // å®è£
éªæ¶è®°å½ |
| | | case 'installationAcceptanceRecordList': |
| | | const obj2 = Object.assign({ |
| | | installationProject: '', |
| | | installationSituation: '', |
| | | installationCompleted: '' |
| | | }) |
| | | this.form.installationAcceptanceRecordList.push(obj2) |
| | | break |
| | | // éªæ¶æ ¸æ¥è®°å½ |
| | | case 'acceptanceCheckRecordList': |
| | | const obj3 = Object.assign({ |
| | | instrumentModule: '', |
| | | verificationParameter: '', |
| | | acceptableLimit: '', |
| | | verificationResult: '', |
| | | verificationConclusion: '' |
| | | }) |
| | | this.form.acceptanceCheckRecordList.push(obj3) |
| | | default: |
| | | break |
| | | } |
| | | }, |
| | | deleteRow(index, row, type) { |
| | | switch (type) { |
| | | // å¤ä»¶ç¡®è®¤ |
| | | case 'sparePartsConfirmationList': |
| | | if (row.sparePartsId) { |
| | | deleteIncidentReportAll({sparePartsId: row.sparePartsId}).then(res => { }); |
| | | } |
| | | this.form.sparePartsConfirmationList.splice(index, 1) |
| | | this.$message.success('å 餿åï¼') |
| | | break |
| | | // æä»¶ç¡®è®¤List |
| | | case 'fileClassConfirmationList': |
| | | if (row.fileId) { |
| | | deleteIncidentReportAll({fileId: row.fileId}).then(res => { }); |
| | | } |
| | | this.form.fileClassConfirmationList.splice(index, 1) |
| | | this.$message.success('å 餿åï¼') |
| | | break |
| | | // å®è£
éªæ¶è®°å½ |
| | | case 'installationAcceptanceRecordList': |
| | | if (row.installId) { |
| | | deleteIncidentReportAll({installId: row.installId}).then(res => { }); |
| | | } |
| | | this.form.installationAcceptanceRecordList.splice(index, 1) |
| | | this.$message.success('å 餿åï¼') |
| | | break |
| | | // éªæ¶æ ¸æ¥è®°å½ |
| | | case 'acceptanceCheckRecordList': |
| | | if (row.acceptanceCheckId) { |
| | | deleteIncidentReportAll({acceptanceCheckId: row.acceptanceCheckId}).then(res => { }); |
| | | } |
| | | this.form.acceptanceCheckRecordList.splice(index, 1) |
| | | this.$message.success('å 餿åï¼') |
| | | default: |
| | | break |
| | | } |
| | | }, |
| | | choiceStep(index) { |
| | | this.currentStepClick = index |
| | | }, |
| | | openRecordAcceptance() { |
| | | // è·å设å¤åºç¡ä¿¡æ¯ |
| | | selectDeviceByCode({id: this.clickNodeVal.value}).then(res => { |
| | | this.form.deviceName = res.data.deviceName |
| | | this.form.manufacturer = res.data.manufacturer |
| | | this.form.specificationModel = res.data.specificationModel |
| | | this.form.managementNumber = res.data.managementNumber |
| | | this.$nextTick(() => { |
| | | this.$refs['form'].clearValidate() |
| | | }) |
| | | }); |
| | | // è·åè´è´£äººä¿¡æ¯ |
| | | this.getUserList() |
| | | }, |
| | | //æäº¤è¡¨å |
| | | async submitForm(saveState) { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid === true || saveState !== '1submit') { |
| | | // ç»å½åç¯è设置åå»ºäººä¸æ¶é´ |
| | | let user = JSON.parse(localStorage.getItem('user')) |
| | | const dateTime = dateFormat(new Date()) |
| | | // è·åå½åç¯èæä½äººä¸æ¥æ |
| | | switch (this.currentStep) { |
| | | case 0: |
| | | this.form.submitOperatingPersonnel = user.name |
| | | this.form.submitDate = dateTime |
| | | break |
| | | case 1: |
| | | this.form.unpackingOperatingPersonnel = user.name |
| | | this.form.unpackingDate = dateTime |
| | | break |
| | | case 2: |
| | | this.form.installOperatingPersonnel = user.name |
| | | this.form.installDate = dateTime |
| | | break |
| | | case 3: |
| | | this.form.installationAcceptanceOperatingPersonnel = user.name |
| | | this.form.installationAcceptanceDate = dateTime |
| | | break |
| | | case 4: |
| | | this.form.acceptanceCheckOperatingPersonnel = user.name |
| | | this.form.acceptanceCheckDate = dateTime |
| | | break |
| | | case 5: |
| | | this.form.acceptanceAuditOperatingPersonnel = user.name |
| | | this.form.acceptanceAuditDate = dateTime |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | // è·åå½åç¯èè´è´£äºº |
| | | switch (saveState === '3reject' ? this.currentStep - 1 : this.currentStep) { |
| | | case 0: |
| | | this.form.currentResponsible = this.form.submitNextPesponsible |
| | | break |
| | | case 1: |
| | | this.form.currentResponsible = this.form.unpackingNextPesponsible |
| | | break |
| | | case 2: |
| | | this.form.currentResponsible = this.form.installNextPesponsible |
| | | break |
| | | case 3: |
| | | this.form.currentResponsible = this.form.installationAcceptanceNextPesponsible |
| | | break |
| | | case 4: |
| | | this.form.currentResponsible = this.form.acceptanceCheckNextPesponsible |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | let currentStepAction; |
| | | // 设置该æä½å¤ææ¯å¦ä¸ºæäº¤ï¼ä¿åï¼é©³åï¼éè¿ |
| | | switch (saveState) { |
| | | // æäº¤ï¼éè¿ |
| | | case '1submit': |
| | | currentStepAction = this.currentStep + 1 |
| | | break |
| | | // ä¿å |
| | | case '2save': |
| | | currentStepAction = this.currentStep |
| | | break |
| | | // 驳å |
| | | case '3reject': |
| | | currentStepAction = this.currentStep - 1 |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | // è·åå½åç¶æ |
| | | this.form.currentState = currentStepAction === 6 ? 'å
³é' : this.steps[currentStepAction] |
| | | this.form.deviceId = this.clickNodeVal.value |
| | | saveIncidentReportData(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æäº¤æå') |
| | | this.getDeviceAList(this.clickNodeVal.value); |
| | | this.dialogVisible = false |
| | | } |
| | | }) |
| | | } else { |
| | | let step = this.steps[this.currentStep] |
| | | this.$message.warning(step + ' æµç¨ä¸æå¿
填项æªå¡«ï¼'); |
| | | } |
| | | }); |
| | | }, |
| | | // è·åè´è´£äººä¿¡æ¯æ¥å£ |
| | | getUserList() { |
| | | selectUserCondition().then(res => { |
| | | if (res.code == 200) { |
| | | this.responsibleOptions = res.data |
| | | } |
| | | }) |
| | | }, |
| | | resetSearch() { |
| | | this.search = { |
| | | size: 20, |
| | | current: 1, |
| | | total: 0, |
| | | processNumber: '', |
| | | } |
| | | this.getDeviceAList(this.clickNodeVal.value); |
| | | }, |
| | | // è·å设å¤äºæ
ä¿¡æ¯(æ ¹æ®ä»vuexä¸è·åå°ç设å¤åç§°idè¿è¡æ°æ®æ¥è¯¢) |
| | | getDeviceAList(deviceId) { |
| | | incidentReportPage({deviceId: deviceId, size:this.search.size, current:this.search.current, processNumber: this.search.processNumber}).then(res => { |
| | | if (res.code == 200) { |
| | | this.tableDataAlist = res.data.records |
| | | this.search.total = res.data.total |
| | | } |
| | | }) |
| | | }, |
| | | //table äºä»¶å¤çå¼å§å¤ |
| | | handleAttachmentClick(row) { |
| | | // 模æä¸è½½éä»¶ |
| | | const imageUrl = this.javaApi+'/img/'+row.systemFileName; // å¾ç URL |
| | | // downloadImage(imageUrl); |
| | | file.downloadIamge(imageUrl,row.fileName) |
| | | }, |
| | | handleViewClick(row) { |
| | | getShowIncidentReport({id: row.id}).then(res => { |
| | | this.form = { ...res.data } |
| | | // å¦æç´¢å¼ä¸º6表示å
¨é¨éè¿ |
| | | this.currentStep = this.steps.indexOf(this.form.currentState) === -1 ? 6 : this.steps.indexOf(this.form.currentState) |
| | | this.currentStepClick = this.currentStep === 6 ? 0 : this.currentStep |
| | | this.$nextTick(() => { |
| | | this.$refs['form'].clearValidate() |
| | | }) |
| | | }) |
| | | this.dialogVisible = true |
| | | }, |
| | | handleDeleteClick(row) { |
| | | this.$confirm('æ¤æä½å°å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteIncidentReportAll({id: row.id}).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿å') |
| | | this.getDeviceAList(this.clickNodeVal.value); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | |
| | | }, |
| | | //å¯¼åº |
| | | handleDown() { |
| | | this.outLoading = true |
| | | incidentReportExport({deviceId: this.clickNodeVal.value}).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设å¤éªæ¶.xlsx') |
| | | }) |
| | | }, |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | if (newVal.value) { |
| | | this.getDeviceAList(newVal.value); |
| | | } |
| | | }, |
| | | dialogVisible(newVal) { |
| | | if (!newVal) { |
| | | this.form = { |
| | | sparePartsConfirmationList: [], // å¤ä»¶ç¡®è®¤List |
| | | fileClassConfirmationList: [], // æä»¶ç¡®è®¤List |
| | | installationAcceptanceRecordList: [], // å®è£
éªæ¶è®°å½ |
| | | acceptanceCheckRecordList: [], // éªæ¶æ ¸æ¥è®°å½ |
| | | fileName: '', // æä»¶åç§° |
| | | systemFileName: '', // ç³»ç»æä»¶åç§° |
| | | } |
| | | this.currentStep = 0 // æ¥éª¤æ¡æ¾ç¤ºç¬¬å æ¥ |
| | | this.currentStepClick = 0 // ç¹å»æ¥éª¤æ¡åå |
| | | this.$refs['form'].clearValidate() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | function downloadImage(url) { |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'attachment.jpg'; // æä»¶å |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | >>>.el-radio { |
| | | color: #606266; |
| | | font-weight: 500; |
| | | cursor: pointer; |
| | | margin-right: 0px; |
| | | width: 10em; |
| | | } |
| | | |
| | | .tables { |
| | | width: 100%; |
| | | height: calc(100vh - 17em); |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | height: 40px; |
| | | display: flex; |
| | | align-items: center; |
| | | position: relative; |
| | | } |
| | | |
| | | .search_thing { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 40px; |
| | | } |
| | | |
| | | .search_label { |
| | | font-size: 14px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .search_input { |
| | | width: calc(100% - 120px); |
| | | } |
| | | |
| | | .btns { |
| | | position: absolute; |
| | | right: 0px; |
| | | top: 40%; |
| | | transform: translate(0, -50%); |
| | | /* text-align: right; */ |
| | | } |
| | | |
| | | .search_thing { |
| | | display: flex; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .search_label { |
| | | /* width: 150px; */ |
| | | text-align: right; |
| | | padding-right: 10px; |
| | | } |
| | | |
| | | .search_input { |
| | | flex-grow: 1; |
| | | } |
| | | |
| | | .line { |
| | | width: 20px; |
| | | height: 1px; |
| | | background-color: #ccc; |
| | | display: inline-block; |
| | | margin-right: 10px; |
| | | } |
| | | |
| | | .form .search_label { |
| | | width: 120px; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- è®¾å¤æ ¸æ¥ --> |
| | | <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="downLoadPost">导åº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="calibrationInstitution" |
| | | 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="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="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 :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="æ ¸æ¥è®°å½" :before-close="handleClose" |
| | | top="5vh" |
| | | width="80%" @close="resetcalibrationRecord"> |
| | | <div class="dialog-content"> |
| | | <h4> |
| | | <span style="display: flex;align-items: center;"> |
| | | <span class="line"></span> |
| | | <span>æ·»å è®¾å¤æ ¸æ¥è®°å½</span> |
| | | </span> |
| | | </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"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="䏿¬¡æ ¸æ¥æ¥æ:" label-width="140px" prop="nextCalibrationDate"> |
| | | <el-date-picker v-model="calibrationRecord.nextCalibrationDate" :disabled="operationType === 'view'" :picker-options="{ disabledDate: this.disabledDate }" |
| | | 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="8"> |
| | | <el-form-item label="æ ¸æ¥æ»ç»è®º:" label-width="140px" prop="status"> |
| | | <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="23"> |
| | | <el-form-item label="éä»¶ï¼" prop="fileName"> |
| | | <el-input v-model="calibrationRecord.fileName" :style="`width: ${operationType === 'add' ? '90%' : '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" stripe style="width: 100%;"> |
| | | <el-table-column label="ç¼å·" type="index" width="80"></el-table-column> |
| | | <el-table-column label="æ ¸æ¥åæ°" prop="measurementParameter" width="150"></el-table-column> |
| | | <el-table-column label="æ ¸æ¥èå´" prop="rangeOfMeasurement" width="150"></el-table-column> |
| | | <el-table-column label="æå¤§å
许误差" prop="maxPermissibleError" width="150"></el-table-column> |
| | | <el-table-column label="å¤å®æ å" prop="judgmentCriteria" width="150"></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="å¤å®ç»æ" 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> |
| | | <span slot="footer" class="dialog-footer" style="float: right;margin-top: 10px"> |
| | | <el-button v-if="operationType === 'add'" @click="handleClose">å æ¶</el-button> |
| | | <el-button v-if="operationType === 'add'" type="primary" @click="addRecord">ç¡® å®</el-button> |
| | | </span> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import file from '@/utils/file'; |
| | | import { mapGetters } from "vuex"; |
| | | import {deviceMetricRecordExport} from "@/api/cnas/resourceDemand/device"; |
| | | export default { |
| | | components: {}, |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | search: { |
| | | size: 20, |
| | | current: 1, |
| | | total: 0 |
| | | }, |
| | | calibrateParamsLoading: false, |
| | | addCalibrateLoading: 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' } |
| | | ], |
| | | }, |
| | | dialogVisible0: false, |
| | | calibrationRecord: { |
| | | unitOfMeasure: '', // æ ¸æ¥äºº |
| | | calibrationDate: '', // æ ¸æ¥æ¥æ |
| | | nextCalibrationDate: '', // 䏿¬¡æ ¸æ¥æ¥æ |
| | | calculatingApparatus: '', // æ ¸æ¥å¨å
· |
| | | standardRange: '', // æ ¸æ¥æ åéç¨ |
| | | calibrationStandardUncertainty: '', // æ ¸æ¥æ åä¸ç¡®å®åº¦ |
| | | byDocument: '', // æ ¸æ¥æå¯¼ä¹¦ |
| | | certificateSerialNumber: '', // æ£æ¥æ¥åæå¯¼ä¹¦ |
| | | fileName: '', // éä»¶ |
| | | status: '', // æ ¸æ¥æ»ç»è®º |
| | | remark: '', // 夿³¨ |
| | | }, |
| | | formRules: { |
| | | unitOfMeasure: [{ required: true, message: '请è¾å
¥æ ¸æ¥äºº', trigger: 'blur' }], |
| | | calibrationDate: [{ required: true, message: 'è¯·éæ©æ ¸æ¥æ¥æ', trigger: 'change' }], |
| | | nextCalibrationDate: [{ 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' }], |
| | | certificateSerialNumber: [{ required: true, message: '请è¾å
¥æ£æ¥æ¥åæå¯¼ä¹¦', trigger: 'blur' }], |
| | | status: [{ required: true, message: 'è¯·éæ©æ ¸æ¥æ»ç»è®º', trigger: 'change' }] |
| | | }, |
| | | calibrateParams: [], |
| | | tableData: [], |
| | | operationType: '', |
| | | dialogVisible1: false, |
| | | formData: { |
| | | person: '', |
| | | data1: '', |
| | | name: '', |
| | | }, |
| | | upLoading: false |
| | | } |
| | | }, |
| | | // ç¨äºä¸ä¼ æä»¶çä¿¡æ¯ |
| | | computed: { |
| | | ...mapGetters(["nickName"]), |
| | | action() { |
| | | return this.javaApi + this.$api.personnel.saveCNASFile |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getTableList(this.clickNodeVal.value) // è·åè®¾å¤æ ¸æ¥åè¡¨æ°æ® |
| | | }, |
| | | methods: { |
| | | //ç¶æå¤å® |
| | | 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' |
| | | } |
| | | }, |
| | | //䏿¬¡æ ¸æ¥æ¥æ:ç¦ç¨å¨æ ¸æ¥æ¥æåçæ¥æ |
| | | disabledDate(time) { |
| | | let selectDate = this.calibrationRecord.calibrationDate |
| | | if (selectDate) { |
| | | let oldDate = new Date(selectDate) |
| | | return time <= oldDate.getTime() |
| | | } |
| | | return false |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.search.size = val |
| | | this.getTableList(this.clickNodeVal.value); |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.search.current = val |
| | | this.getTableList(this.clickNodeVal.value); |
| | | }, |
| | | // è·åè®¾å¤æ ¡ååæ°tableä¿¡æ¯ |
| | | async getXmsg() { |
| | | this.calibrateParamsLoading = true |
| | | try { |
| | | await this.$axios.get(this.$api.deviceCheck.selectDeviceMetric + "?deviceId=" + this.clickNodeVal.value + "&type=examine").then(res => { |
| | | if (res.code == 200) { |
| | | this.calibrateParams = res.data |
| | | } |
| | | this.calibrateParamsLoading = false |
| | | }) |
| | | } catch (e) { |
| | | this.calibrateParamsLoading = false |
| | | } |
| | | }, |
| | | // æ ¡å项ç®ç»´æ¤ |
| | | calibrationMaintenance() { |
| | | this.dialogVisible0 = true |
| | | this.getXmsg(); |
| | | }, |
| | | 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 = 'examine' |
| | | this.$axios.post(this.$api.deviceCheck.saveOrUpdateDeviceMetric, this.form0, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).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('æå¿
填项æªå¡«'); |
| | | } |
| | | }) |
| | | }, |
| | | // æ¥è¯¢è®¾å¤æ ¸æ¥å表 |
| | | getTableList(deviceId) { |
| | | this.$axios.get(this.$api.deviceCheck.deviceMetricRecordPage + '?deviceId=' + deviceId + "&size=" + this.search.size + "¤t=" + this.search.current + "&type=examine").then(res => { |
| | | this.tableData = res.data.records |
| | | this.search.total = res.data.total |
| | | }) |
| | | }, |
| | | // æäº¤è¦æ·»å çè®°å½ |
| | | 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.deviceMetricsCopyList = this.calibrateParams |
| | | this.calibrationRecord.type = 'examine' |
| | | this.$axios.post(this.$api.deviceCheck.addOrUpdateDeviceMetricRecord, this.calibrationRecord, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).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.$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() |
| | | }, |
| | | deleteFile() { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.$axios.delete(this.$api.personnel.deleteCNASFile + "?fileName=" + this.form.systemFileName).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿åï¼') |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | // end |
| | | handleAttachmentClick(row) { |
| | | // 模æä¸è½½éä»¶ |
| | | const imageUrl = this.javaApi + '/img/' + row.systemFileName; // å¾ç URL |
| | | file.downloadIamge(imageUrl, row.fileName) |
| | | // downloadImage(imageUrl, row.fileName); |
| | | }, |
| | | // æ·»å æ ¸æ¥è®°å½ |
| | | add(type) { |
| | | this.operationType = type |
| | | this.dialogVisible1 = true |
| | | this.getXmsg() |
| | | }, |
| | | // æ¥ç详æ
|
| | | handleViewClick(type, row) { |
| | | this.$axios.get(this.$api.deviceCheck.showDeviceMetricsCopy + "?id=" + row.id + "&type=examine").then(res => { |
| | | this.calibrateParams = res.data |
| | | }) |
| | | this.calibrationRecord = { ...row } |
| | | this.operationType = type |
| | | this.dialogVisible1 = true |
| | | }, |
| | | |
| | | // è¡¨æ ¼å é¤æä½ |
| | | handleDeleteClick(row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.$axios.delete(this.$api.deviceCheck.deleteDeviceMetricRecord + "?id=" + row.id).then(res => { |
| | | this.getTableList(this.clickNodeVal.value) // è·åè®¾å¤æ ¡ååè¡¨æ°æ® |
| | | this.$message.success('å 餿åï¼') |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }) |
| | | }, |
| | | handleDelete(row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.$axios.delete(this.$api.deviceCheck.deleteDeviceMetrics + "?id=" + row.id).then(res => { |
| | | this.getXmsg(); |
| | | this.$message.success('å 餿åï¼') |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }) |
| | | }, |
| | | downLoadPost() { |
| | | this.outLoading = true |
| | | deviceMetricRecordExport({deviceId: this.clickNodeVal.value}).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res],{ type: 'application/msword' }); |
| | | this.$download.saveAs(blob, 'è®¾å¤æ ¸æ¥.xlsx') |
| | | }) |
| | | }, |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | if (newVal.value) { |
| | | this.getTableList(newVal.value); |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | |
| | | function downloadImage(url, name) { |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = name; // æä»¶å |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .dialog-content { |
| | | max-height: 70vh; |
| | | /* 设置æå¤§é«åº¦ */ |
| | | overflow-y: auto; |
| | | /* å¯ç¨åç´æ»å¨ */ |
| | | } |
| | | |
| | | .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; |
| | | } |
| | | |
| | | 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> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- è®¾å¤æ»è§ --> |
| | | <style scoped> |
| | | .title { |
| | | height: 60px; |
| | | line-height: 60px; |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | height: 50px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search_thing { |
| | | width: 350px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search_label { |
| | | width: 110px; |
| | | font-size: 14px; |
| | | text-align: left; |
| | | } |
| | | |
| | | .search_input { |
| | | width: calc(100% - 110px); |
| | | } |
| | | |
| | | .table { |
| | | background-color: #fff; |
| | | width: calc(100% - 40px); |
| | | height: calc(100vh - 17em); |
| | | /* padding: 10px; */ |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | .card { |
| | | list-style-type: none; |
| | | display: grid; |
| | | grid-template-columns: repeat(auto-fit, 380px); |
| | | justify-content: start; |
| | | grid-gap: 16px; |
| | | min-height: 300px; |
| | | } |
| | | |
| | | .card li { |
| | | width: 380px; |
| | | height: 165px; |
| | | border-radius: 8px 8px 8px 8px; |
| | | border: 1px solid #EEEEEE; |
| | | margin: 0 !important; |
| | | display: flex; |
| | | align-items: center; |
| | | box-sizing: border-box; |
| | | padding: 16px; |
| | | font-size: 14px; |
| | | color: #666666; |
| | | position: relative; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .card li .img { |
| | | width: 114px; |
| | | height: 114px; |
| | | border-radius: 16px; |
| | | margin-right: 24px; |
| | | } |
| | | |
| | | .list-left .list-left-info { |
| | | line-height: 36px; |
| | | display: flex; |
| | | } |
| | | |
| | | .text-truncate { |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap |
| | | } |
| | | |
| | | .circles { |
| | | position: absolute; |
| | | width: 70px; |
| | | height: 70px; |
| | | right: 0; |
| | | top: 0; |
| | | z-index: 0; |
| | | } |
| | | |
| | | .circles .circle { |
| | | border-radius: 50%; |
| | | opacity: 0.2; |
| | | } |
| | | |
| | | .circle0, |
| | | .circle1, |
| | | .circle2 { |
| | | width: 60px; |
| | | height: 60px; |
| | | position: absolute; |
| | | } |
| | | |
| | | .circle3 { |
| | | width: 16px; |
| | | height: 16px; |
| | | position: absolute; |
| | | } |
| | | |
| | | .circle0 { |
| | | bottom: 6px; |
| | | left: 0; |
| | | } |
| | | |
| | | .circle1 { |
| | | bottom: 0; |
| | | right: -30px; |
| | | } |
| | | |
| | | .circle2 { |
| | | left: 0; |
| | | top: -30px; |
| | | } |
| | | |
| | | .circle3 { |
| | | top: 0; |
| | | right: 0; |
| | | } |
| | | |
| | | .success .circle { |
| | | background: #34BD66; |
| | | } |
| | | |
| | | .danger .circle { |
| | | background: #FF3838; |
| | | } |
| | | |
| | | .warning .circle { |
| | | background: #FBB247; |
| | | } |
| | | .info .circle { |
| | | background: #909399; |
| | | } |
| | | </style> |
| | | |
| | | <template> |
| | | <div class="role_manage"> |
| | | <div> |
| | | <el-form :model="entity" inline label-position="right" label-width="80px"> |
| | | <el-form-item label="ç¶æ:"> |
| | | <el-select v-model="entity.deviceStatus" placeholder="å
¨é¨" size="small" clearable> |
| | | <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤åç§°:"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="entity.deviceName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button size="small" @click="refresh()">é ç½®</el-button> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button size="small" type="primary" |
| | | @click="currentPage = 1, keyMap = {}, list = [], finishLoding = false, refreshTable()">æ¥ è¯¢</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <!-- <div class="search_thing"> |
| | | <div class="search_label">ç¶æï¼</div> |
| | | <el-select v-model="entity.deviceStatus" placeholder="å
¨é¨" size="small" clearable> |
| | | <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label">设å¤åç§°ï¼</div> |
| | | <div class="search_input"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable |
| | | v-model="entity.deviceName"></el-input> |
| | | </div> |
| | | </div> --> |
| | | |
| | | |
| | | <!-- <div class="search_thing" style="padding-left: 30px;"> |
| | | </div> --> |
| | | </div> |
| | | <div class="table" v-loading="loading"> |
| | | <scroll-pagination @load="refreshTable()" :finishLoding="finishLoding" :list="list" |
| | | 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"> |
| | | <div slot="error" class="image-error" style="width: 112px; |
| | | height: 112px; |
| | | border-radius: 16px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | border: 1px solid #EEEEEE;"> |
| | | <i class="el-icon-picture-outline" style="font-size:30px;color:#666666;"></i> |
| | | </div> |
| | | </el-image> |
| | | <div class="list-left"> |
| | | <div class="list-left-info"> |
| | | <span class="label">设å¤åç§°ï¼</span> |
| | | <span style="color:#3A7BFA; |
| | | font-size: 16px; |
| | | display: inline-block; |
| | | width: 129px; |
| | | word-break: break-all;" class="text-truncate" :title="m.deviceName">{{ m.deviceName ? m.deviceName : 'æ ' }}</span> |
| | | </div> |
| | | <div class="list-left-info"> |
| | | <span class="label">è§æ ¼åå·ï¼</span> |
| | | <span style="color:#333333;font-size: 16px;">{{ m.specificationModel ? m.specificationModel : 'æ ' |
| | | }}</span> |
| | | </div> |
| | | <div class="list-left-info"> |
| | | <span class="label">ç¶æï¼</span> |
| | | <el-tag :type="m.type" v-if="m.deviceStatusName">{{ m.deviceStatusName }}</el-tag> |
| | | <span v-else style="color:#333333;font-size: 16px;">æ </span> |
| | | </div> |
| | | </div> |
| | | <div class="circles" :class="m.type"> |
| | | <div class="circle0 circle"></div> |
| | | <div class="circle1 circle"></div> |
| | | <div class="circle2 circle"></div> |
| | | <div class="circle3 circle"></div> |
| | | </div> |
| | | </li> |
| | | </ul> |
| | | </scroll-pagination> |
| | | <div v-if="list.length < 1 && !loading" style="color:#909399;font-size:14px;text-align: center;margin-top:200px"> |
| | | ææ æ°æ® |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import ScrollPagination from '@/components/index/scroll-paging.vue' |
| | | import {selectDeviceParameter} from "@/api/cnas/resourceDemand/device"; |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | } |
| | | }, |
| | | components: { |
| | | ScrollPagination |
| | | }, |
| | | data() { |
| | | return { |
| | | entity: { |
| | | deviceStatus: null, |
| | | deviceName: null, |
| | | orderBy: { field: "id", order: "asc" } |
| | | }, |
| | | options: [], |
| | | list: [], |
| | | currentPage: 1, // å½å页 |
| | | pageSize: 16, // ä¸é¡µ16æ¡ |
| | | total: '', |
| | | loading: true, // ç»ä»¶loadingçå±ç¤º,é»è®¤ä¸ºtrue |
| | | finishLoding: false, // å è½½å®æï¼æ¾ç¤ºå·²ç»æ²¡ææ´å¤äº |
| | | keyMap: {}, |
| | | laboratoryNameIsNull: false, |
| | | } |
| | | }, |
| | | created() { |
| | | this.selectEnumByCategory() |
| | | this.keyMap = {}; |
| | | this.currentPage = 1; |
| | | this.list = []; |
| | | this.clickSidebar(this.clickNodeVal) |
| | | }, |
| | | methods: { |
| | | refreshTable() { |
| | | const key = `_${this.currentPage}` |
| | | const value = this.keyMap[key] |
| | | // 妿valueåå¨ï¼è¡¨ç¤ºç¼åæå¼ï¼é£ä¹é»æ¢è¯·æ± |
| | | if (value) { |
| | | return |
| | | } |
| | | // valueä¸åå¨ï¼è¡¨ç¤ºç¬¬ä¸æ¬¡è¯·æ±,设置å ä½ |
| | | this.keyMap[key] = 'temp' |
| | | if (this.currentPage == 1) { |
| | | this.loading = true |
| | | } |
| | | if(this.list.length==0){ |
| | | this.finishLoding = false; |
| | | } |
| | | selectDeviceParameter({ |
| | | laboratoryNameIsNull: this.laboratoryNameIsNull, |
| | | current: this.currentPage, |
| | | size: this.pageSize, |
| | | ...this.entity |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | this.total = res.data.body.total |
| | | let list = res.data.body.records.map(m => { |
| | | switch (m.deviceStatus) { |
| | | case 0: |
| | | // æ£å¸¸ |
| | | m.type = 'success' |
| | | break; |
| | | case 1: |
| | | // ç»´ä¿® |
| | | m.type = 'warning' |
| | | break; |
| | | case 2: |
| | | // åç¨ |
| | | m.type = 'danger' |
| | | break; |
| | | case 3: |
| | | // æ¥åº |
| | | m.type = 'info' |
| | | break; |
| | | } |
| | | this.options.forEach(j => { |
| | | if (m.deviceStatus == j.value) { |
| | | m.deviceStatusName = j.label |
| | | } |
| | | }) |
| | | return m; |
| | | }) |
| | | if (list.length == 0) { |
| | | this.finishLoding = true; |
| | | } else { |
| | | if (list.length < this.pageSize) { |
| | | this.finishLoding = true; |
| | | } |
| | | this.list = this.list.concat(list) |
| | | if (this.total == this.list.length) { |
| | | this.finishLoding = true; |
| | | } |
| | | this.currentPage++; |
| | | } |
| | | } |
| | | this.loading = false |
| | | }).catch(err => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | refresh() { |
| | | this.keyMap = {}; |
| | | this.currentPage = 1; |
| | | this.list = []; |
| | | this.finishLoding = false; |
| | | this.entity = { |
| | | deviceStatus: null, |
| | | deviceName: null, |
| | | orderBy: { field: "id", order: "asc" } |
| | | }; |
| | | this.refreshTable() |
| | | }, |
| | | // è·ååå
¸ |
| | | selectEnumByCategory() { |
| | | // 设å¤ç¶æ |
| | | this.getDicts("device_status").then((response) => { |
| | | this.options = this.dictToValue(response.data); |
| | | }); |
| | | }, |
| | | // ç¹å»ä¾§è¾¹æ å·æ° |
| | | clickSidebar(clickNodeVal) { |
| | | this.laboratoryNameIsNull = false |
| | | // æ¯å¦åå¨valueï¼åå¨value代表为ä¸çº§ |
| | | if (!clickNodeVal.value) { |
| | | this.finishLoding = false; |
| | | this.keyMap = {}; |
| | | this.currentPage = 1; |
| | | this.list = []; |
| | | this.entity.laboratoryName = null |
| | | this.entity.storagePoint = null |
| | | // çäº1代表为æ çä¸çº§ï¼label为é¨é¨ |
| | | if (clickNodeVal.label == 'å
¶ä»') { |
| | | this.laboratoryNameIsNull = true |
| | | this.refreshTable(); |
| | | return |
| | | } |
| | | if (clickNodeVal.level == 1) { |
| | | this.entity.laboratoryName = clickNodeVal.label |
| | | // çäºäºçº§ãlabel为åå¨å°ç¹ |
| | | } else if (clickNodeVal.level == 2) { |
| | | // å
¶ä»è¡¨ç¤ºæ²¡æé
ç½®å®éªå®¤ï¼åªé
ç½®äºå°ç¹ |
| | | if (clickNodeVal.parent.label == 'å
¶ä»') { |
| | | this.laboratoryNameIsNull = true |
| | | } else { |
| | | this.entity.laboratoryName = clickNodeVal.parent.label |
| | | } |
| | | this.entity.storagePoint = clickNodeVal.label |
| | | } |
| | | this.refreshTable(); |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | this.clickSidebar(newVal) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <div> |
| | | <div style="margin: 10px 0;text-align: right"> |
| | | <el-button size="small" type="primary" @click="handleForm('add')">æ°å¢</el-button> |
| | | </div> |
| | | <div> |
| | | <el-table ref="yearTable" v-loading="yearTableDetailDataLoading" :data="yearTableDetailData" |
| | | height="calc(100vh - 18em)" 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="150" prop="arrivalDate"></el-table-column> |
| | | <el-table-column label="éé¢" min-width="100" prop="goldAmount"></el-table-column> |
| | | <el-table-column label="ç»´ä¿®åä½" min-width="150" prop="maintenanceunit"></el-table-column> |
| | | <!-- æä½æé® --> |
| | | <el-table-column align="center" label="æä½" min-width="180"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="small" type="text" @click="handleForm('edit', scope.row.acceptanceId)">ç¼è¾</el-button> |
| | | <el-button size="small" type="text" @click="handleForm('view', scope.row.acceptanceId)">æ¥ç</el-button> |
| | | <el-button size="small" type="text" @click="record(scope.row)">éä»¶</el-button> |
| | | <el-button size="small" type="text" @click="handleDownOne(scope.row.acceptanceId)">导åº</el-button> |
| | | <el-button size="small" style="color: #f56c6c" type="text" |
| | | @click="deleteFun(scope.row.acceptanceId)">å é¤</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" |
| | | @size-change="handleSizeChange1" @current-change="handleCurrentChange1"> |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | <acceptance-form v-if="applicationForm" ref="applicationForm" @closeDialog="closeDialog"></acceptance-form> |
| | | <!--ä¸ä¼ æ¥å--> |
| | | <el-dialog :visible.sync="filesDialogVisible" title="éä»¶" width="80%" @closed="closeFilesLook"> |
| | | <div style="display: flex;justify-content: space-between;"> |
| | | <el-upload ref='upload' :action="fileAction" :auto-upload="true" :before-upload="fileBeforeUpload" |
| | | :data="{ acceptanceId: acceptanceId }" :headers="uploadHeader" :on-error="onError" |
| | | :on-success="handleSuccessUp" :show-file-list="false" |
| | | accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' style="width: 80px !important;"> |
| | | <el-button size="small" style="height: 38px" type="primary">éä»¶ä¸ä¼ </el-button> |
| | | </el-upload> |
| | | </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"> |
| | | </limsTable> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="lookDialogVisible" fullscreen title="æ¥çéä»¶" top="5vh" width="800px"> |
| | | <filePreview v-if="lookDialogVisible" :currentFile="{}" :fileUrl="fileUrl" |
| | | style="height: 90vh;overflow-y: auto;" /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import AcceptanceForm from "./acceptanceForm.vue"; |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import filePreview from "@/components/Preview/filePreview.vue"; |
| | | import { |
| | | pageDeviceAcceptance, |
| | | getDeviceAcceptanceFileList, |
| | | delDeviceAcceptanceFileList, |
| | | exportDeviceAcceptance, |
| | | delDeviceAcceptance, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | export default { |
| | | name: "equipment-acceptance", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: { filePreview, limsTable, AcceptanceForm }, |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | pagination1: { |
| | | size: 10, |
| | | current: 1, |
| | | total: 0, |
| | | }, |
| | | yearTableDetailDataLoading: false, |
| | | yearTableDetailData: [], |
| | | applicationForm: false, |
| | | filesDialogVisible: false, |
| | | columnData: [ |
| | | { |
| | | label: 'æä»¶åç§°', |
| | | prop: 'fileName', |
| | | minWidth: '150px' |
| | | }, |
| | | { |
| | | dataType: 'action', |
| | | minWidth: '100', |
| | | label: 'æä½', |
| | | fixed: 'right', |
| | | operation: [ |
| | | { |
| | | name: 'é¢è§', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.handleLook(row) |
| | | } |
| | | }, |
| | | { |
| | | name: 'ä¸è½½', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.upload(row) |
| | | } |
| | | }, |
| | | { |
| | | name: 'å é¤', |
| | | type: 'text', |
| | | color: '#f56c6c', |
| | | clickFun: (row) => { |
| | | this.delete(row) |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | ], |
| | | tableData: [], |
| | | tableLoading: false, |
| | | acceptanceId: '', // ä¸ä¼ éä»¶å½åè¡çid |
| | | currentInfo: {}, |
| | | lookDialogVisible: false, |
| | | fileUrl: '' |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getYearTableDetailData(this.clickNodeVal.value) |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | // æ¥è¯¢ |
| | | getYearTableDetailData(deviceId) { |
| | | this.yearTableDetailDataLoading = true |
| | | pageDeviceAcceptance({ |
| | | current: this.pagination1.current, |
| | | size: this.pagination1.size, |
| | | deviceId: deviceId, |
| | | }).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 |
| | | }) |
| | | }, |
| | | handleForm(type, id) { |
| | | this.applicationForm = true |
| | | this.$nextTick(() => { |
| | | this.$refs.applicationForm.openDialog(type, id, this.clickNodeVal.value) |
| | | }) |
| | | }, |
| | | closeDialog() { |
| | | this.applicationForm = false |
| | | this.getYearTableDetailData(this.clickNodeVal.value) |
| | | }, |
| | | // æå¼æ¥åå¼¹æ¡ |
| | | record(row) { |
| | | this.filesDialogVisible = true |
| | | this.acceptanceId = row.acceptanceId |
| | | this.searchTableList() |
| | | }, |
| | | // æ¥è¯¢éä»¶å表 |
| | | searchTableList() { |
| | | this.tableLoading = true |
| | | getDeviceAcceptanceFileList({ acceptanceId: this.acceptanceId }).then(res => { |
| | | this.tableLoading = false |
| | | this.tableData = res.data |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | console.log('err---', err); |
| | | }) |
| | | }, |
| | | // æ¥çæä»¶ |
| | | handleLook(row) { |
| | | this.currentInfo = row |
| | | this.lookDialogVisible = true |
| | | const state = /\.(jpg|jpeg|png|gif)$/i.test(this.currentInfo.fileUrl) |
| | | if (state) { |
| | | this.fileUrl = this.javaApi + '/img/' + this.currentInfo.fileUrl |
| | | } else { |
| | | this.fileUrl = this.javaApi + '/word/' + this.currentInfo.fileUrl |
| | | } |
| | | }, |
| | | // ä¸è½½ |
| | | upload(row) { |
| | | this.$download.saveAs(row.fileUrl, row.fileName) |
| | | }, |
| | | // å é¤ |
| | | delete(row) { |
| | | this.$confirm('æ¤æä½å°å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.tableLoading = true |
| | | delDeviceAcceptanceFileList({ acceptanceFileId: row.acceptanceFileId }).then(res => { |
| | | this.tableLoading = false |
| | | this.$message.success('å 餿å') |
| | | this.searchTableList() |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | console.log('err---', err); |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | // ä¸ä¼ éä»¶ |
| | | fileBeforeUpload(file) { |
| | | let flag = true |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M'); |
| | | this.$refs.upload.clearFiles() |
| | | flag = false |
| | | } |
| | | if (!flag) { |
| | | return Promise.reject(flag); //æ£ç¡®çç»æ¢ |
| | | } |
| | | }, |
| | | onError(err, file, fileList, type) { |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | | handleSuccessUp(response,) { |
| | | this.upLoading = false; |
| | | if (response.code == 200) { |
| | | this.$message.success('ä¸ä¼ æå'); |
| | | this.searchTableList() |
| | | } |
| | | }, |
| | | closeFilesLook() { |
| | | this.filesDialogVisible = false |
| | | }, |
| | | // å页 |
| | | handleSizeChange1(val) { |
| | | this.pagination1.size = val |
| | | this.getYearTableDetailData(this.clickNodeVal.value) |
| | | }, |
| | | // å页 |
| | | handleCurrentChange1(val) { |
| | | this.pagination1.current = val |
| | | this.getYearTableDetailData(this.clickNodeVal.value) |
| | | }, |
| | | // å¯¼åº |
| | | handleDownOne(id) { |
| | | 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') |
| | | }) |
| | | }, |
| | | // å é¤ |
| | | deleteFun(id) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delDeviceAcceptance({ acceptanceId: id }).then(res => { |
| | | this.$message.success('å 餿åï¼'); |
| | | this.getYearTableDetailData(this.clickNodeVal.value); |
| | | }); |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | if (newVal.value) { |
| | | this.getYearTableDetailData(newVal.value); |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | fileAction() { |
| | | return this.javaApi + '/deviceAcceptance/uploadDeviceAcceptanceFile' |
| | | |
| | | } |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .title { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | .title-search { |
| | | display: flex; |
| | | align-items: center; |
| | | margin: 10px 0; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- è®¾å¤æ
é --> |
| | | <template> |
| | | <div> |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æµç¨ç¼å·ï¼</div> |
| | | <div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="search.processNumber" style="width: 100%;" |
| | | @keyup.enter.native="getTableList(clickNodeVal.value)"> |
| | | </el-input> |
| | | </div> |
| | | </div> |
| | | <div class="search_thing" style="padding-left: 30px;"> |
| | | <el-button size="small" @click="resetSearch">é ç½®</el-button> |
| | | <el-button size="small" type="primary" @click="getTableList(clickNodeVal.value)">æ¥ è¯¢</el-button> |
| | | </div> |
| | | <div class="btns"> |
| | | <el-button size="small" type="primary" @click="dialogVisible = true, addRecode()">æ°å»º</el-button> |
| | | <el-button size="small" type="primary" @click="handleDown" :loading="outLoading">导åº</el-button> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <div class="tables" style="margin-top: 16px;"> |
| | | <el-table :data="faultParam" style="width: 100%" height="calc(100vh - 20em)"> |
| | | <!-- è¡¨æ ¼å --> |
| | | <el-table-column header-align="center" align="center" width="70" prop="prop" label="åºå·" |
| | | type="index"></el-table-column> |
| | | <el-table-column prop="processNumber" label="æµç¨ç¼å·" min-width="180"></el-table-column> |
| | | <el-table-column prop="deviceName" label="设å¤åç§°" min-width="150"></el-table-column> |
| | | <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="currentState" label="å½åç¶æ" min-width="130"></el-table-column> |
| | | <el-table-column prop="currentResponsible" label="å½å责任人" width="180"></el-table-column> |
| | | <!-- æä½æé® --> |
| | | <el-table-column label="æä½" fixed="right" min-width="150"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="small" type="text" @click="showDetailsDialog(scope.row)">æ¥ç详æ
</el-button> |
| | | <el-button type="text" size="small" @click="handleDeleteClick(scope.$index, scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="1" |
| | | style="margin-right: 5%;" :page-sizes="[10, 20, 30, 50, 100]" :page-size="search.size" |
| | | layout="->,total, sizes, prev, pager, next, jumper" :total="search.total"> |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | <el-dialog title="æ°å¢ç»´ä¿®è®°å½" top="5vh" :visible.sync="dialogVisible" width="60%" @open="openRecordAcceptance" |
| | | :close-on-click-modal="false" :close-on-press-escape="false"> |
| | | <el-steps :active="currentStep" finish-status="success" align-center> |
| | | <el-step v-for="(v, i) in steps" style="cursor:pointer" :title="v" :key="i" |
| | | @click.native="choiceStep(i)"></el-step> |
| | | </el-steps> |
| | | <el-form ref="form" :model="form" label-position="right" label-width="120px"> |
| | | <!-- æäº¤ --> |
| | | <div v-show="currentStepClick == 0"> |
| | | <el-card style="margin-top: 1em;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æµç¨ç¼å·:"> |
| | | <el-input v-model="form.processNumber" size="small" disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设å¤åç§°:"> |
| | | <el-input v-model="form.deviceName" size="small" disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è§æ ¼åå·:"> |
| | | <el-input v-model="form.specificationModel" size="small" disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设å¤ç¼å·:"> |
| | | <el-input v-model="form.managementNumber" size="small" disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å确度éå¼:" prop="measureOfAccuracy" |
| | | :rules="[{ required: currentStep === 0, message: '请è¾å
¥å确度éå¼', trigger: 'blur' }]"> |
| | | <el-input v-model="form.measureOfAccuracy" size="small" :disabled="currentStep !== 0"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ
鿥æ:" prop="faultDate"> |
| | | <el-date-picker v-model="form.faultDate" type="date" placeholder="éæ©æ¥æ" size="small" |
| | | format="yyyy-MM-dd" style="width: 100%" value-format="yyyy-MM-dd" :disabled="currentStep !== 0"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è¦æ±ä¿®å¤æ¥æ:" prop="requestRepairDate"> |
| | | <el-date-picker v-model="form.requestRepairDate" :picker-options="{ disabledDate: this.disabledDate }" |
| | | type="date" placeholder="éæ©æ¥æ" size="small" format="yyyy-MM-dd" style="width: 100%" |
| | | value-format="yyyy-MM-dd" :disabled="currentStep !== 0"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æ
éæ
åµ:" prop="faultSituation" |
| | | :rules="[{ required: currentStep === 0, message: '请è¾å
¥æ
éæ
åµ', trigger: 'blur' }]"> |
| | | <el-input v-model="form.faultSituation" type="textarea" size="small" |
| | | :disabled="currentStep !== 0"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ç¸å
³éä»¶:"> |
| | | <el-input v-model="form.fileName" :disabled="true" size="small" style="width: 80%;"> |
| | | <el-button slot="append" icon="el-icon-delete-solid" @click="deleteFile" |
| | | :disabled="currentStep !== 0"></el-button> |
| | | </el-input> |
| | | <el-upload ref="upload" style="float: right;" :action="action" :show-file-list="false" |
| | | :on-success="handleSuccess"> |
| | | <el-button style="position: relative;top: -4px;" class="uploadFile" slot="trigger" size="small" |
| | | type="primary" :disabled="currentStep !== 0">éä»¶ä¸ä¼ |
| | | </el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸ç¯èè´è´£äºº:" prop="submitNextPesponsible" |
| | | :rules="[{ required: currentStep === 0, message: '请è¾å
¥ä¸ç¯èè´è´£äºº', trigger: 'change' }]"> |
| | | <el-select v-model="form.submitNextPesponsible" placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" |
| | | style="width: 100%" :disabled="currentStep !== 0"> |
| | | <el-option v-for="(v, i) in users" :label="v.name" :value="v.name" :key="i"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.submitOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.submitDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <!-- 设å¤ç®¡çåæè§ --> |
| | | <div v-show="currentStepClick == 1"> |
| | | <el-card style="margin-top: 1em; height: 45vh; overflow-y: scroll;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ç»´ä¿®æ¹å¼åè´¹ç¨:" prop="methodCost" |
| | | :rules="[{ required: currentStep === 1, message: '请è¾å
¥ç»´ä¿®æ¹å¼åè´¹ç¨', trigger: 'blur' }]"> |
| | | <el-input v-model="form.methodCost" type="textarea" size="small" |
| | | :disabled="currentStep !== 1"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="å®¡æ ¸æè§:" prop="adminAuditOption" |
| | | :rules="[{ required: currentStep === 1, message: '请è¾å
¥å®¡æ ¸æè§', trigger: 'blur' }]"> |
| | | <el-input v-model="form.adminAuditOption" type="textarea" size="small" |
| | | :disabled="currentStep !== 1"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸ç¯èè´è´£äºº:" prop="adminNextPesponsible" |
| | | :rules="[{ required: currentStep === 1, message: '请è¾å
¥ä¸ç¯èè´è´£äºº', trigger: 'change' }]"> |
| | | <el-select v-model="form.adminNextPesponsible" placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" |
| | | style="width: 100%" :disabled="currentStep !== 1"> |
| | | <el-option v-for="(v, i) in users" :label="v.name" :value="v.name" :key="i"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.adminOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.adminDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <!-- ææ¯è´è´£äººæè§ --> |
| | | <div v-show="currentStepClick == 2"> |
| | | <el-card style="margin-top: 1em; height: 45vh; overflow-y: scroll;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="å®¡æ ¸æè§:" prop="technicalAuditOption" |
| | | :rules="[{ required: currentStep === 2, message: '请è¾å
¥å®¡æ ¸æè§', trigger: 'blur' }]"> |
| | | <el-input v-model="form.technicalAuditOption" type="textarea" size="small" |
| | | :disabled="currentStep !== 2"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸ç¯èè´è´£äºº:" prop="technicalNextPesponsible" |
| | | :rules="[{ required: currentStep === 2, message: '请è¾å
¥ä¸ç¯èè´è´£äºº', trigger: 'change' }]"> |
| | | <el-select v-model="form.technicalNextPesponsible" placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" |
| | | style="width: 100%" :disabled="currentStep !== 2"> |
| | | <el-option v-for="(v, i) in users" :label="v.name" :value="v.name" :key="i"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.technicalOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.technicalDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <!-- ç»´ä¿®æ
åµè®°å½ --> |
| | | <div v-show="currentStepClick == 3"> |
| | | <el-card style="margin-top: 1em; height: 45vh; overflow-y: scroll;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ç»´ä¿®æ
åµ:" prop="maintainSituation" |
| | | :rules="[{ required: currentStep === 3, message: '请è¾å
¥ç»´ä¿®æ
åµ', trigger: 'blur' }]"> |
| | | <el-input v-model="form.maintainSituation" type="textarea" size="small" |
| | | :disabled="currentStep !== 3"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸ç¯èè´è´£äºº:" prop="maintainNextPesponsible" |
| | | :rules="[{ required: currentStep === 3, message: '请è¾å
¥ä¸ç¯èè´è´£äºº', trigger: 'change' }]"> |
| | | <el-select v-model="form.maintainNextPesponsible" placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" |
| | | style="width: 100%" :disabled="currentStep !== 3"> |
| | | <el-option v-for="(v, i) in users" :label="v.name" :value="v.name" :key="i"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.maintainOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.maintainDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <!-- ç»´ä¿®åç确认 --> |
| | | <div v-show="currentStepClick == 4"> |
| | | <el-card style="margin-top: 1em; height: 45vh; overflow-y: scroll;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="éªæ¶ãç¡®è®¤ãæ ¡åæ
åµ:" prop="checkCalSituation" label-width="200" |
| | | :rules="[{ required: currentStep === 4, message: '请è¾å
¥éªæ¶ãç¡®è®¤ãæ ¡åæ
åµ', trigger: 'blur' }]"> |
| | | <el-input v-model="form.checkCalSituation" type="textarea" size="small" style="width: 100%" |
| | | :disabled="currentStep !== 4"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.afterMaintenanceOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.afterMaintenanceDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="submitForm('3reject')" v-if="currentStep !== 0 && currentStep !== 5" |
| | | :loading="sumbitLoading1">驳å</el-button> |
| | | <el-button @click="submitForm('2save')" v-if="currentStep === 0" :loading="sumbitLoading2">ä¿å</el-button> |
| | | <el-button type="primary" v-if="currentStep !== 5" @click="submitForm('1submit')" :loading="sumbitLoading3"> |
| | | {{ currentStep === 0 ? 'æäº¤' : 'éè¿' }} |
| | | </el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { dateFormat } from '@/utils/date' |
| | | import { mapGetters } from "vuex"; |
| | | import { |
| | | addOrUpdateDeviceFaultOne, |
| | | deleteCNASFile, deleteDeviceFaultOne, |
| | | deviceFaultOnePage, exportRewardAndPunishmentRecords, |
| | | selectDeviceByCode |
| | | } from "@/api/cnas/resourceDemand/device"; |
| | | import {selectUserCondition} from "@/api/system/user"; |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | search: { |
| | | size: 20, |
| | | current: 1, |
| | | total: 0, |
| | | processNumber: '' |
| | | }, |
| | | users: [], |
| | | currentStep: 0, |
| | | currentStepClick: 0, |
| | | steps: ['æäº¤', '设å¤ç®¡çåæè§', 'ææ¯è´è´£äººæè§', 'ç»´ä¿®æ
åµè®°å½', 'ç»´ä¿®åç确认'], |
| | | outLoading: false, |
| | | form: {}, |
| | | faultParam: [], |
| | | dialogVisible: false, |
| | | sumbitLoading1: false, |
| | | sumbitLoading2: false, |
| | | sumbitLoading3: false, |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["nickName"]), |
| | | action() { |
| | | return this.javaApi + '/personBasicInfo/saveCNASFile' |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getTableList(this.clickNodeVal.value) |
| | | }, |
| | | methods: { |
| | | //è¦æ±ä¿®å¤æ¥æ:ç¦ç¨å¨æ
鿥æåçæ¥æ |
| | | disabledDate(time) { |
| | | let selectDate = this.form.faultDate |
| | | if (selectDate) { |
| | | let selectTime = new Date(selectDate).getTime() - 28800000 |
| | | return time < selectTime |
| | | } |
| | | return false |
| | | }, |
| | | //æäº¤è¡¨å |
| | | async submitForm(saveState) { |
| | | let currentStepAction; |
| | | // 设置该æä½å¤ææ¯å¦ä¸ºæäº¤ï¼ä¿åï¼é©³åï¼éè¿ å¼å¯loding |
| | | switch (saveState) { |
| | | // æäº¤ï¼éè¿ |
| | | case '1submit': |
| | | currentStepAction = this.currentStep + 1 |
| | | this.sumbitLoading1 = true |
| | | break |
| | | // ä¿å |
| | | case '2save': |
| | | currentStepAction = this.currentStep |
| | | this.sumbitLoading2 = true |
| | | break |
| | | // 驳å |
| | | case '3reject': |
| | | currentStepAction = this.currentStep - 1 |
| | | this.sumbitLoading3 = true |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid === true || saveState !== '1submit') { |
| | | // ç»å½åç¯è设置åå»ºäººä¸æ¶é´ |
| | | const dateTime = dateFormat(new Date()) |
| | | // è·åå½åç¯èæä½äººä¸æ¥æ |
| | | switch (this.currentStep) { |
| | | case 0: |
| | | this.form.submitUser = this.nickName |
| | | this.form.submitOperatingPersonnel = this.nickName |
| | | this.form.submitDate = dateTime |
| | | break |
| | | case 1: |
| | | this.form.adminOperatingPersonnel = this.nickName |
| | | this.form.adminDate = dateTime |
| | | break |
| | | case 2: |
| | | this.form.technicalOperatingPersonnel = this.nickName |
| | | this.form.technicalDate = dateTime |
| | | break |
| | | case 3: |
| | | this.form.maintainOperatingPersonnel = this.nickName |
| | | this.form.maintainDate = dateTime |
| | | break |
| | | case 4: |
| | | this.form.afterMaintenanceOperatingPersonnel = this.nickName |
| | | this.form.afterMaintenanceDate = dateTime |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | // è·åå½åç¯èè´è´£äºº |
| | | switch (saveState === '3reject' ? this.currentStep - 1 : this.currentStep) { |
| | | case 0: |
| | | this.form.currentResponsible = this.form.submitOperatingPersonnel |
| | | break |
| | | case 1: |
| | | this.form.currentResponsible = this.form.departmentOperatingPersonnel |
| | | break |
| | | case 2: |
| | | this.form.currentResponsible = this.form.measuringRoomOperatingPersonnel |
| | | break |
| | | case 3: |
| | | this.form.currentResponsible = this.form.approvalOperatingPersonnel |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | // è·åå½åç¶æ |
| | | this.form.currentState = currentStepAction === 5 ? 'å
³é' : this.steps[currentStepAction] |
| | | this.form.deviceId = this.clickNodeVal.value |
| | | addOrUpdateDeviceFaultOne(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æäº¤æå') |
| | | this.getTableList(this.clickNodeVal.value) |
| | | this.dialogVisible = false |
| | | } |
| | | this.closeLoading() |
| | | }) |
| | | } else { |
| | | let step = this.steps[this.currentStep] |
| | | this.$message.warning(step + ' æµç¨ä¸æå¿
填项æªå¡«ï¼'); |
| | | this.closeLoading() |
| | | } |
| | | }); |
| | | }, |
| | | closeLoading() { |
| | | this.sumbitLoading1 = false |
| | | this.sumbitLoading2 = false |
| | | this.sumbitLoading3 = false |
| | | }, |
| | | openRecordAcceptance() { |
| | | // è·å设å¤åºç¡ä¿¡æ¯ |
| | | selectDeviceByCode({id: this.clickNodeVal.value}).then(res => { |
| | | this.form.deviceName = res.data.deviceName |
| | | this.form.manufacturer = res.data.manufacturer |
| | | this.form.specificationModel = res.data.specificationModel |
| | | this.form.managementNumber = res.data.managementNumber |
| | | }); |
| | | // è·åè´è´£äººä¿¡æ¯ |
| | | this.getUserList() |
| | | }, |
| | | // è·åè´è´£äººä¿¡æ¯æ¥å£ |
| | | getUserList() { |
| | | selectUserCondition().then((res) => { |
| | | this.users = res.data; |
| | | }); |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.search.size = val |
| | | this.getTableList(this.clickNodeVal.value); |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.search.current = val |
| | | this.getTableList(this.clickNodeVal.value); |
| | | }, |
| | | deleteFile() { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteCNASFile({fileName: this.form.systemFileName}).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿åï¼') |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | choiceStep(index) { |
| | | this.currentStepClick = index |
| | | }, |
| | | //ææ¡£ |
| | | handleSuccess(response, file, fileList) { |
| | | if (response.code == 200) { |
| | | this.form.fileName = response.data |
| | | this.$message.success('ä¸ä¼ æå') |
| | | } else { |
| | | this.$message.error(response.msg) |
| | | } |
| | | }, |
| | | onError(error, file, fileList) { |
| | | // æä»¶ä¸ä¼ 失败æ¶çå¤çé»è¾ |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | | beforeUpload(file) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M'); |
| | | this.$refs.upload.clearFiles() |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | }, |
| | | resetSearch() { |
| | | this.search = { |
| | | size: 20, |
| | | current: 1, |
| | | total: 0, |
| | | processNumber: '', |
| | | } |
| | | this.getTableList(this.clickNodeVal.value); |
| | | }, |
| | | //è·åææä¿¡æ¯ |
| | | getTableList(deviceId) { |
| | | const params = { |
| | | deviceId: deviceId, |
| | | size: this.search.size, |
| | | current: this.search.current, |
| | | processNumber: this.search.processNumber, |
| | | } |
| | | deviceFaultOnePage(params).then(res => { |
| | | if (res.code == 200) { |
| | | this.faultParam = res.data.records |
| | | this.search.total = res.data.total |
| | | } |
| | | }) |
| | | }, |
| | | //å¯¼åº |
| | | handleDown() { |
| | | this.outLoading = true |
| | | exportRewardAndPunishmentRecords({deviceId: this.clickNodeVal.value}).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$dowmload.saveAs(blob, 'è®¾å¤æ
é表.xlsx') |
| | | }) |
| | | }, |
| | | selectAllByOne(row) { |
| | | this.dialogVisible = true; |
| | | this.formData = this.HaveJson(row); |
| | | }, |
| | | //æ·»å è®°å½æé® |
| | | addRecode() { |
| | | this.currentStep = 0; |
| | | this.currentStepClick = 0; |
| | | }, |
| | | //æ¥ç详æ
|
| | | showDetailsDialog(row) { |
| | | this.form = { ...row } |
| | | this.currentStep = this.steps.indexOf(this.form.currentState) === -1 ? 5 : this.steps.indexOf(this.form.currentState) |
| | | this.currentStepClick = this.currentStep === 5 ? 0 : this.currentStep |
| | | this.$nextTick(() => { |
| | | this.$refs['form'].clearValidate() |
| | | }) |
| | | this.dialogVisible = true |
| | | }, |
| | | //å é¤æä½ |
| | | handleDeleteClick(index, row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteDeviceFaultOne({id: row.id}).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿å') |
| | | this.getTableList(this.clickNodeVal.value) |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | if (newVal.value) { |
| | | this.getTableList(newVal.value); |
| | | } |
| | | }, |
| | | dialogVisible(newVal) { |
| | | if (!newVal) { |
| | | this.form = {} |
| | | this.closeLoading() |
| | | this.currentStep = 0 // æ¥éª¤æ¡æ¾ç¤ºç¬¬å æ¥ |
| | | this.currentStepClick = 0 // ç¹å»æ¥éª¤æ¡åå |
| | | this.$refs['form'].clearValidate() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | h4 { |
| | | font-weight: 400; |
| | | font-size: 16px; |
| | | /* display: flex; |
| | | justify-content: space-between; */ |
| | | margin: 10px 0; |
| | | } |
| | | |
| | | /* |
| | | ä¿åæäº¤æé®æ ·å¼ |
| | | */ |
| | | h4 .title { |
| | | width: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | h4 .title .line { |
| | | display: inline-block; |
| | | width: 3px; |
| | | height: 16px; |
| | | background: #3A7BFA; |
| | | margin-right: 4px; |
| | | } |
| | | |
| | | .tables { |
| | | width: 100%; |
| | | height: calc(100vh - 230px); |
| | | } |
| | | |
| | | .el-from { |
| | | max-width: 400px; |
| | | margin: 0 auto; |
| | | } |
| | | |
| | | .form-row { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .dialogBottom { |
| | | margin-top: 14px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .form-operation { |
| | | display: flex; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .form-item { |
| | | display: flex; |
| | | margin-right: 100px; |
| | | } |
| | | |
| | | .label { |
| | | margin-right: 20px; |
| | | line-height: 40px; |
| | | } |
| | | |
| | | .value { |
| | | font-weight: normal; |
| | | line-height: 40px; |
| | | } |
| | | |
| | | .form-row .el-form-item { |
| | | flex: 1; |
| | | /* æ¯ä¸ªè¡¨åé¡¹å æ®ç¸åæ¯ä¾çç©ºé´ */ |
| | | margin-right: 100px; |
| | | /* å¯éï¼ä¸ºå³ä¾§å
ç´ æ·»å é´è· */ |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | height: 40px; |
| | | display: flex; |
| | | align-items: center; |
| | | position: relative; |
| | | } |
| | | |
| | | .search_thing { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | height: 40px; |
| | | } |
| | | |
| | | .search_label { |
| | | width: 70px; |
| | | font-size: 14px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .search_input { |
| | | width: calc(100% - 120px); |
| | | } |
| | | |
| | | .btns { |
| | | position: absolute; |
| | | right: 0px; |
| | | top: 50%; |
| | | transform: translate(0, -50%); |
| | | } |
| | | |
| | | .form .search_label { |
| | | width: 120px; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- è®¾å¤æ¡£æ¡ --> |
| | | <template> |
| | | <div class="page"> |
| | | <div class="page-header"> |
| | | <h4><span class="line"></span><span>è®¾å¤æ¡£æ¡</span></h4> |
| | | <div class="btns"> |
| | | <el-button type="primary" size="small" @click="openEditForm" style="">修订档æ¡</el-button> |
| | | <el-button type="primary" size="small" @click="dialogVisible1 = true" style="">æ·»å éä»¶</el-button> |
| | | <el-button type="primary" size="small" @click="deviceDialog = true" style="">æ¥ç设å¤äºç»´ç </el-button> |
| | | <!-- <el-button type="primary" size="small" @click="handleDownOne" style="">导åº</el-button>--> |
| | | </div> |
| | | </div> |
| | | <el-divider></el-divider> |
| | | <div class="main_div"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="6"> |
| | | <!-- å æ¶é´æ³é¿å
æµè§å¨ç¼åé®é¢ --> |
| | | <el-image :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;"> |
| | | <div slot="error" class="image-slot"> |
| | | <i class="el-icon-picture-outline" style="font-size: 40px;"></i> |
| | | </div> |
| | | </el-image> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <div class="form-item"> |
| | | <label>设å¤åç§°</label> |
| | | <!-- <p>{{ Mdata.deviceName }}</p> --> |
| | | <el-tooltip |
| | | class="item" |
| | | :content="Mdata.deviceName" |
| | | > |
| | | <span class="text-ellipsis" >{{ Mdata.deviceName }}</span> |
| | | </el-tooltip> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>设å¤ç±»å</label> |
| | | <p>{{ Mdata.largeCategory }}</p> |
| | | </div> |
| | | |
| | | <div class="form-item"> |
| | | <label>管çç¼å·</label> |
| | | <p>{{ Mdata.managementNumber }}</p> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æå±é¨é¨</label> |
| | | <p>{{ Mdata.laboratoryName }}</p> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>ç产åå®¶</label> |
| | | <!-- <p>{{ Mdata.manufacturer }}</p> --> |
| | | <el-tooltip |
| | | class="item" |
| | | :content="Mdata.manufacturer" |
| | | > |
| | | <span class="text-ellipsis" >{{ Mdata.manufacturer }}</span> |
| | | </el-tooltip> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>èµäº§ç¼ç </label> |
| | | <p class="text-ellipsis">{{ Mdata.assetCode }}</p> |
| | | </div> |
| | | |
| | | <div class="form-item"> |
| | | <label>åºåæ¥æ</label> |
| | | <p>{{ Mdata.acquisitionDate | formaterDateTime }}</p> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>å¯ç¨æ¥æ</label> |
| | | <p>{{ Mdata.activationDate | formaterDateTime }}</p> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æ ¸å卿(æ)</label> |
| | | <p>{{ Mdata.calibrationDate }}</p> |
| | | </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> |
| | | <p>{{ Mdata.authorizedPersonName }}</p> |
| | | </div> |
| | | |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <div class="form-item"> |
| | | <label>è§æ ¼åå·</label> |
| | | <p>{{ Mdata.specificationModel }}</p> |
| | | </div> |
| | | <!-- <div class="form-item"> |
| | | <label>ç»ç±»</label> |
| | | <p>{{ handleData() }}</p> |
| | | </div> --> |
| | | <div class="form-item"> |
| | | <label>åºåç¼å·</label> |
| | | <p>{{ Mdata.factoryNo }}</p> |
| | | </div> |
| | | <div class="form-items"> |
| | | <label>设å¤ç¶æ</label> |
| | | <el-radio-group v-model="Mdata.deviceStatus" style="margin-left: 10px;"> |
| | | <el-radio :label="0" :disabled="Mdata.deviceStatus != 0">æ£å¸¸</el-radio> |
| | | <el-radio :label="1" :disabled="Mdata.deviceStatus != 1">ç»´ä¿®</el-radio> |
| | | <el-radio :label="2" :disabled="Mdata.deviceStatus != 2">åç¨</el-radio> |
| | | <el-radio :label="3" :disabled="Mdata.deviceStatus != 3">æ¥åº</el-radio> |
| | | </el-radio-group> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>åæ¾ç¹</label> |
| | | <p>{{ Mdata.storagePoint }}</p> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>产å°</label> |
| | | <p>{{ Mdata.origin }}</p> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æ£éªé¡¹</label> |
| | | <el-tooltip |
| | | class="item" |
| | | effect="dark" |
| | | :content="Mdata.insProductItem" |
| | | placement="top" |
| | | > |
| | | <span class="text-ellipsis" >{{ Mdata.insProductItem }}</span> |
| | | </el-tooltip> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>è´ç½®æ¥æ</label> |
| | | <p>{{ Mdata.acquisitionDate | formaterDateTime }}</p> |
| | | </div> |
| | | |
| | | <div class="form-item"> |
| | | <label>æè¿æº¯æºæ¥æ</label> |
| | | <p>{{ Mdata.lastCalibrationDate | formaterDateTime }}</p> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>éè´è´¹ç¨(å
)</label> |
| | | <p>{{ Mdata.unitPrice }}</p> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>åç¨æ¶é´</label> |
| | | <p>{{ Mdata.nextCalibrationDate | formaterDateTime }}</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> |
| | | <p>{{ Mdata.calibrateNo }}</p> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <h4 style="margin-bottom: 10px;margin-top: 10px;"><span class="line"></span><span>éä»¶åç¸å
³ææ¡£</span></h4> |
| | | <el-table height="200px" :data="tableDataA"> |
| | | <el-table-column header-align="center" align="center" prop="prop" label="åºå·" type="index" width="60" /> |
| | | <el-table-column prop="documentType" label="ç±»å" min-width="100"> |
| | | <template v-slot="scope"> |
| | | {{ scope.row.documentType === '0' ? 'éä»¶' : scope.row.documentType === '1' ? 'ææ¡£' : '' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="åç§°" min-width="150" /> |
| | | <el-table-column prop="number" label="ç¼å·" min-width="150" /> |
| | | <el-table-column prop="version" label="çæ¬" min-width="80" /> |
| | | <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="150" /> |
| | | <el-table-column prop="comments" label="夿³¨" min-width="150" /> |
| | | <el-table-column fixed="right" label="æä½" min-width="180"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="small" @click="handleAttachmentClick(scope.row)">ä¸è½½éä»¶</el-button> |
| | | <el-button type="text" size="small" @click="handleViewClick(scope.row)">æ¥ç</el-button> |
| | | <el-button type="text" size="small" @click="handleDeleteClick(scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!-- 修订 --> |
| | | <el-dialog title="修订档æ¡" top="5vh" :visible.sync="dialogVisible" width="70%" @open="openFileRevisionDialog" |
| | | :before-close="handleClose"> |
| | | <el-row style="display:flex;justify-content: space-around;"> |
| | | <!-- 左边å¸å± --> |
| | | <el-col :span="7"> |
| | | <el-col> |
| | | <!-- å¾ç --> |
| | | <el-image class="img" style="width:100%;height: 320px;margin-bottom:16px" |
| | | :src="javaApi + '/img/' + editData.imageUpload"> |
| | | <div slot="error" class="image-error" style="width: calc(100% - 2px); |
| | | height: 318px; |
| | | border-radius: 16px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | border: 1px solid #EEEEEE;"> |
| | | <i class="el-icon-picture-outline" style="font-size:60px;color:#666666;"></i> |
| | | </div> |
| | | </el-image> |
| | | <!-- 表å --> |
| | | <el-form :model="editData" label-width="120px" ref="rules1" :rules="rules1"> |
| | | <el-form-item label="仪å¨åç§°:" prop="deviceName"> |
| | | <el-input v-model="editData.deviceName" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="仪å¨åç§°EN:" prop="enDeviceName"> |
| | | <el-input v-model="editData.enDeviceName" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="è§æ ¼åå·:" prop="specificationModel"> |
| | | <el-input v-model="editData.specificationModel" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç产åå®¶:"> |
| | | <el-input v-model="editData.manufacturer" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-col> |
| | | </el-col> |
| | | <!-- ä¸é´å¸å± --> |
| | | <el-col :span="7"> |
| | | <el-form :model="editData" label-width="116px" ref="rules2" :rules="rules1"> |
| | | <el-form-item label="æ ¡åæå¡æºæ:"> |
| | | <el-input v-model="editData.calibrationServices" disabled size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="èµäº§ç¼ç :"> |
| | | <el-input v-model="editData.assetCode" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="产å°:"> |
| | | <el-input v-model="editData.origin" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="åºåç¼å·:"> |
| | | <el-input v-model="editData.factoryNo" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="管çç¼å·:" prop="managementNumber"> |
| | | <el-input v-model="editData.managementNumber" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="è´ç½®æ¥æ:"> |
| | | <el-date-picker style="width:100%" v-model="editData.acquisitionDate" type="date" format="yyyy-MM-dd" |
| | | value-format="yyyy-MM-dd HH:mm:ss" size="small" placeholder="éæ©æ¥æ"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="å¯ç¨æ¥æ:" prop="activationDate"> |
| | | <el-date-picker style="width:100%" v-model="editData.activationDate" type="date" format="yyyy-MM-dd" |
| | | value-format="yyyy-MM-dd HH:mm:ss" size="small" placeholder="éæ©æ¥æ"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="è´è´£äºº:"> |
| | | <el-select v-model="editData.equipmentManager" placeholder="è¯·éæ©" size="small" style="width:100%"> |
| | | <el-option v-for="item in responsiblePersonList" :key="item.name" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="åæ¾ç¹:"> |
| | | <el-input v-model="editData.storagePoint" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ææ¯ææ :"> |
| | | <el-input v-model="editData.technicalIndicators" :rows="7" type="textarea" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-col> |
| | | <!-- å³è¾¹å¸å± --> |
| | | <el-col :span="7"> |
| | | <el-form :model="editData" label-width="140px" ref="ruleForm" :rules="rules1"> |
| | | <!-- å®éªå®¤å表 --> |
| | | <el-form-item label="æå±é¨é¨:"> |
| | | <el-select v-model="editData.subordinateDepartmentsId" placeholder="è¯·éæ©" size="small" style="width:100%"> |
| | | <el-option v-for="item in subordinateDepartmentsList" :key="item.value" :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ£æµé¡¹ç®:"> |
| | | <el-cascader v-model="editData.insProductIds" :options="options" :show-all-levels="false" :props="props" |
| | | placeholder="è¯·éæ©" size="small" style="width:100%;" :collapse-tags="true" separator="," filterable |
| | | clearable></el-cascader> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="æè¿æ ¡åæ¥æ:"> |
| | | <el-date-picker style="width:100%" v-model="Mdata.latestTraceability" format="yyyy-MM-dd" |
| | | value-format="yyyy-MM-dd" type="date" size="small" placeholder="éæ©æ¥æ"> |
| | | </el-date-picker> |
| | | </el-form-item> --> |
| | | <!-- <el-form-item label="䏿¬¡æ ¡åæ¥æ:"> |
| | | <el-date-picker style="width:100%" v-model="Mdata.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="设å¤ç±»å:"> |
| | | <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> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="åä»·(ä¸å
):"> |
| | | <el-input v-model="editData.unitPrice" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å½åç¶æ:" prop="deviceStatus"> |
| | | <el-select v-model="editData.deviceStatus" placeholder="è¯·éæ©" size="small" style="width:100%"> |
| | | <el-option v-for="item in deviceStatusList" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ ¡åå¨æï¼æï¼:" prop="calibrationDate"> |
| | | <el-input v-model="editData.calibrationDate" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="被ææäºº:"> |
| | | <el-select v-model="editData.authorizedPerson" multiple placeholder="è¯·éæ©" size="small" style="width:100%"> |
| | | <el-option v-for="item in responsiblePersonList" :key="item.name" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å¾ç:"> |
| | | <!-- <div |
| | | style="border: 1px solid #DCDFE6;border-radius:4px;height:32px;lineHeight:32px;display:flex;justify-content: space-around;font-size: 13px;"> |
| | | <div v-show="Mdata.imageName" class="picName">{{ Mdata.imageName }}</div> |
| | | <el-upload :action="action" :on-success="handleSuccessUpImg2" :show-file-list="false" |
| | | accept='image/jpg,image/jpeg,image/png' :headers="headers" :on-change="beforeUpload" |
| | | :on-error="onError" ref='upload'> |
| | | <el-button type="text" style="height:30px;padding-top:8px"><span v-if="Mdata.imageName"></span></el-button> |
| | | </el-upload> |
| | | </div> --> |
| | | |
| | | <div> |
| | | <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" |
| | | :on-error="onError" ref='upload' class="avatar-uploader" |
| | | > |
| | | <img v-if="editData.imageUpload" :src="javaApi + '/img/' + editData.imageUpload" class="avatar"> |
| | | <i v-else class="el-icon-plus avatar-uploader-icon"></i> |
| | | </el-upload> |
| | | </div> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-col> |
| | | </el-row> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-row> |
| | | <el-button @click="handleClose">å æ¶</el-button> |
| | | <el-button type="primary" @click="submitForm" :loading="upLoad">ç¡® å®</el-button> |
| | | </el-row> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="æ·»å 设å¤éä»¶" top="5vh" v-if="dialogVisible1" :visible.sync="dialogVisible1" width="40%"> |
| | | <el-form ref="form" :model="addFile" label-width="120px"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç»´æ¤ç±»åï¼"> |
| | | <el-radio-group v-model="addFile.documentType"> |
| | | <el-radio :label="0">éä»¶</el-radio> |
| | | <el-radio :label="1">ææ¡£</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¡£æ¡åç§°ï¼"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="addFile.name"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åºå·/èµäº§ç¼å·:"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="addFile.number"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="çæ¬ï¼"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="addFile.version"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="份æ°ï¼"> |
| | | <el-input-number v-model="addFile.quantity" controls-position="right" style="width: 100%;" size="small" |
| | | :min="0" :max="10"></el-input-number> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="页ç ï¼"> |
| | | <el-input-number v-model="addFile.pageCount" controls-position="right" style="width: 100%;" size="small" |
| | | :min="0" :max="10"></el-input-number> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æä¾è
ï¼"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="addFile.provider"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="彿¡£æ¥æï¼"> |
| | | <el-date-picker type="date" style="width:100%" placeholder="è¯·éæ©æ¥æ" size="small" v-model="addFile.archiveDate" |
| | | format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿³¨ï¼"> |
| | | <el-input type="textarea" :rows="2" size="small" v-model="addFile.comments"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="éä»¶ï¼" style="float: left;"> |
| | | <el-upload class="upload-demo" :action="action" :headers="uploadHeader" ref="uploadFile" :on-error="onError" |
| | | :on-remove="handleRemove" :on-success="onSuccess" :before-remove="beforeRemove" multiple :limit="1" |
| | | :on-exceed="handleExceed" :file-list="fileList"> |
| | | <el-button size="small" type="primary">ç¹å»ä¸ä¼ </el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-row> |
| | | <el-button @click="dialogVisible1 = false" size="small">å æ¶</el-button> |
| | | <el-button type="primary" @click="saveRecord" size="small" :loading="isLoading">{{ isAddFileUpdate == true ? |
| | | 'æ´æ°' : |
| | | 'ç¡® å®' }}</el-button> |
| | | </el-row> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="设å¤äºç»´ç " :visible.sync="deviceDialog" top="5vh" width="30%"> |
| | | <div style="width:90%;text-align: right;"> |
| | | <el-button type="primary" size="mini" @click="clickGeneratePicture">ä¸è½½å¾ç</el-button> |
| | | <el-button type="primary" size="mini" @click="labelPrint">æ ç¾æå°</el-button> |
| | | </div> |
| | | <div class="device-main" ref="deviceQrCode" id="deviceCode"> |
| | | <div class="device-center"> |
| | | <p class="device-title">{{ Mdata.deviceName }}</p> |
| | | <div class="device-footer"> |
| | | <div> |
| | | <vueQr class="qr-code" |
| | | :text="'https://zttx-lims.ztt.cn:8021/lims/qr/qrScan?code=' + Mdata.managementNumber + '&type=device'" |
| | | :size="200" :margin="10"></vueQr> |
| | | </div> |
| | | <div class="device-number"> |
| | | <span class="device-text">设å¤ç¼ç :</span> |
| | | <span class="device-text">{{ Mdata.managementNumber }}</span> |
| | | </div> |
| | | <div class="device-name"> |
| | | <span class="device-text">设å¤åå·:</span> |
| | | <span class="device-text">{{ Mdata.specificationModel }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { MessageBox } from 'element-ui' |
| | | import fileDownload from '@/utils/file' |
| | | import vueQr from 'vue-qr' |
| | | import PrintJS from 'print-js' |
| | | import domtoimage from 'dom-to-image'; |
| | | import { |
| | | deleteCNASFile, |
| | | updateDocument, |
| | | addDocument, |
| | | deleteDocumentById, |
| | | getAllDocuments, |
| | | selectDeviceByCode, |
| | | upDeviceParameter, |
| | | exportDeviceFile, |
| | | getInsProduction, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/system/user"; |
| | | import { |
| | | obtainItemParameterList, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | export default { |
| | | filters: { |
| | | formaterDateTime(dateTime) { |
| | | if (dateTime === undefined || dateTime === null || dateTime === '') { |
| | | return dateTime |
| | | } |
| | | return dateTime.split(" ")[0] |
| | | } |
| | | }, |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | } |
| | | }, |
| | | components: { |
| | | vueQr |
| | | }, |
| | | data() { |
| | | return { |
| | | deviceDialog: false,//æ¥ç设å¤äºç»´ç å¼¹æ¡ |
| | | rules1: { |
| | | deviceName: [ |
| | | { required: true, message: '请è¾å
¥ä»ªå¨åç§°', trigger: 'blur' }, |
| | | ], |
| | | enDeviceName: [ |
| | | { required: true, message: '请è¾å
¥ä»ªå¨åç§°EN', trigger: 'blur' }, |
| | | ], |
| | | specificationModel: [ |
| | | { required: true, message: '请è¾å
¥è§æ ¼åå·', trigger: 'blur' }, |
| | | ], |
| | | managementNumber: [ |
| | | { required: true, message: '请è¾å
¥ç®¡çç¼å·', trigger: 'blur' }, |
| | | ], |
| | | activationDate: [ |
| | | { required: true, message: '请è¾å
¥æ ¡åæææ', trigger: 'blur' }, |
| | | ], |
| | | deviceStatus: [ |
| | | { required: true, message: '请è¾å
¥å½åç¶æ', trigger: 'blur' }, |
| | | ], |
| | | calibrationDate: [ |
| | | { required: true, message: '请è¾å
¥æ ¡å卿(æ)', trigger: 'blur' }, |
| | | ], |
| | | subordinateDepartmentsId: [ |
| | | { required: true, message: 'è¯·éæ©æå±é¨é¨', trigger: 'change' }, |
| | | ] |
| | | }, |
| | | // dateForm: { |
| | | |
| | | // }, |
| | | fileList: [], // æ·»å éä»¶ä¸ä¼ æä»¶å表 |
| | | timeStamp: '', // ç»å¾çæ·»å keyï¼å¨æ¯æ¬¡å 载页é¢çæ¶åæ°å»ºæ¶é´æ³ |
| | | equipmentManager: [], |
| | | formLabelWidth: '100px', |
| | | dialogVisible1: false, |
| | | recordNumber: '', |
| | | inLoading: false, // æ§å¶ä¸ä¼ æé®å è½½ç¶æ |
| | | isLoading: false, // æ§å¶ç¡®å®æé®å è½½ç¶æ |
| | | formData: {}, |
| | | tableDataA: [], |
| | | num: 1, |
| | | //æ·»å éä»¶æ°æ®æ¶é |
| | | addFile: { |
| | | documentType: '', // ç»´æ¤ç±»å |
| | | provideDate: null, // 彿¡£æ¥æ |
| | | name: '', // æ¡£æ¡åç§° |
| | | number: '', // åºå·/èµäº§ç¼å· |
| | | version: '', // çæ¬ |
| | | quantity: 1, // ä»½æ° |
| | | pageCount: 1, // 页ç |
| | | provider: '', // æä¾è
|
| | | comments: "", // 夿³¨ |
| | | fileName: "", // æä»¶ååç§° |
| | | systemFileName: "", // ç³»ç»çæåç§° |
| | | }, |
| | | componentData: { |
| | | entity: { name: "", orderBy: { field: "id", order: "asc" } }, |
| | | page: { current: "1", size: "80" } |
| | | }, |
| | | upIndex: 0, |
| | | dialogVisible: false, |
| | | upLoad: false, |
| | | responsiblePersonList: [], |
| | | subordinateDepartmentsList: [], |
| | | options: [], |
| | | equipmentList: [], |
| | | deviceStatusList: [], |
| | | props: { multiple: true, emitPath: false, value: 'id', label: 'name' }, |
| | | // æ¶éè®¾å¤æ¡£æ¡æ°æ® |
| | | Mdata: { |
| | | deviceName: null |
| | | }, |
| | | isAddFileUpdate: false, |
| | | editData: { |
| | | authorizedPerson: [], |
| | | }, |
| | | } |
| | | }, |
| | | computed: { |
| | | action() { |
| | | return this.javaApi + '/deviceScope/uploadFile' |
| | | } |
| | | }, |
| | | mounted() { |
| | | // æ¶éæ°æ® |
| | | this.getList(this.clickNodeVal.value) |
| | | // è·åç¸å
³ææ¡£çæ°æ® |
| | | this.getPage() |
| | | this.timeStamp = Date.now() |
| | | }, |
| | | methods: { |
| | | /** |
| | | * å°é¡µé¢æå®èç¹å
容转为å¾ç |
| | | * 1.æ¿å°æ³è¦è½¬æ¢ä¸ºå¾ççå
容èç¹DOMï¼ |
| | | * 2.转æ¢ï¼æ¿å°è½¬æ¢åçcanvas |
| | | * 3.转æ¢ä¸ºå¾ç |
| | | */ |
| | | clickGeneratePicture() { |
| | | const _than = this |
| | | domtoimage.toPng(_than.$refs.deviceQrCode, { quality: 1, width: 440, }).then(function (dataUrl) { |
| | | // å°è½¬æ¢åçå¾åæ°æ®åå¨ä¸º data URL |
| | | fileDownload.downloadIamge(dataUrl, _than.Mdata.deviceName) |
| | | }); |
| | | }, |
| | | //æå°è®¾å¤äºç»´ç |
| | | labelPrint() { |
| | | PrintJS({ |
| | | printable: 'deviceCode',//é¡µé¢ |
| | | type: "html",//ææ¡£ç±»å |
| | | maxWidth: 360, |
| | | css: ['/static/css/device-print.css'], |
| | | style: '@page { size: auto; margin: 0mm;}', |
| | | targetStyles: ["*"], // 使ç¨domçæææ ·å¼ï¼å¾éè¦ |
| | | }); |
| | | }, |
| | | openFileRevisionDialog() { |
| | | // è·åæ¡£æ¡ä¿®è®¢è´è´£äººä¸ææ¡æ°æ® |
| | | this.selectDevicePrincipal() |
| | | // è·åæ¡£æ¡ä¿®è®¢æå±é¨é¨ä¸ææ¡æ°æ® |
| | | this.obtainItemParameterList() |
| | | // è·åæ¡£æ¡ä¿®è®¢è®¾å¤ç¶æä¸ææ¡æ°æ® |
| | | this.selectEnumByCategory() |
| | | // è·åæ¡£æ¡ä¿®è®¢æ£éªé¡¹ç®çº§èå¼¹æ¡æ°æ® |
| | | this.getInsProductIds() |
| | | }, |
| | | //éä»¶åç¸å
³ææ¡£äºä»¶ |
| | | handleAttachmentClick(row) { |
| | | console.log(row) |
| | | if (row.fileName) { |
| | | this.$download.saveAs(row.fileName) |
| | | } else { |
| | | this.$message.warning('æªä¸ä¼ æä»¶ï¼') |
| | | } |
| | | }, |
| | | handleViewClick(row) { |
| | | this.isAddFileUpdate = true |
| | | this.addFile = { ...row } |
| | | this.dialogVisible1 = true |
| | | if (row.fileName) { |
| | | const obj = Object.assign({ |
| | | name: row.fileName, |
| | | url: row.fileName, |
| | | status: 'success', |
| | | uid: Date.now(), |
| | | }) |
| | | this.fileList.push(obj) |
| | | } |
| | | }, |
| | | handleDeleteClick(row) { |
| | | // å é¤é»è¾ |
| | | MessageBox.confirm('ç¡®å®è¦å é¤è¯¥è®°å½åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | }).then(() => { |
| | | deleteDocumentById({ id: row.id }).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿å') |
| | | this.getPage() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message.info('已忶å é¤') |
| | | }) |
| | | }, |
| | | saveRecord() { |
| | | //è½¬æ¢æ°æ® |
| | | this.addFile.deviceId = this.clickNodeVal.value |
| | | let obj = this.addFile.systemFileName |
| | | this.addFile.systemFileName = obj.name |
| | | this.addFile.fileName = obj.url |
| | | |
| | | // æ´æ° |
| | | if (this.isAddFileUpdate) { |
| | | updateDocument(this.addFile).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ´æ°æå') |
| | | this.dialogVisible1 = false; |
| | | this.getPage() |
| | | } |
| | | }) |
| | | } else { |
| | | // æ°å¢ |
| | | addDocument(this.addFile).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿åæå') |
| | | this.dialogVisible1 = false; |
| | | this.getPage() |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | onSuccess(response, file, fileList) { |
| | | if (response.code == 200) { |
| | | this.addFile.systemFileName = response.data |
| | | this.addFile.fileName = file.name |
| | | } else { |
| | | this.$refs.uploadFile.clearFiles() |
| | | this.$message.error('ä¸ä¼ 失败ï¼' + response.message) |
| | | } |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | this.deleteFile(this.addFile.systemFileName) |
| | | }, |
| | | deleteFile(fileName) { |
| | | deleteCNASFile({ fileName }).then(res => { |
| | | this.$message.success('å 餿åï¼') |
| | | }) |
| | | }, |
| | | handleExceed(files, fileList) { |
| | | this.$message.warning(`å½åéå¶éæ© 1 个æä»¶ï¼æ¬æ¬¡éæ©äº ${files.length} 个æä»¶ï¼å
±éæ©äº ${files.length + fileList.length} 个æä»¶`); |
| | | }, |
| | | beforeRemove(file, fileList) { |
| | | return this.$confirm(`ç¡®å®ç§»é¤ ${file.name}ï¼`); |
| | | }, |
| | | // è·åç¸å
³ææ¡£æ°æ®çapi |
| | | getPage() { |
| | | getAllDocuments({ deviceId: this.clickNodeVal.value }).then(res => { |
| | | if (res.code == 200) |
| | | this.tableDataA = res.data |
| | | }) |
| | | }, |
| | | // æ¶éæ°æ® |
| | | getList(id) { |
| | | selectDeviceByCode({ id }).then(res => { |
| | | // å°åç±»å表çä¿¡æ¯åèµ·æ¥ |
| | | if (res.code == 200) { |
| | | this.Mdata = res.data; |
| | | this.Mdata.insProductIds = this.Mdata.insProductIds.split(',') |
| | | if (this.Mdata.authorizedPerson) { |
| | | this.Mdata.authorizedPerson = JSON.parse(this.Mdata.authorizedPerson) |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | handleData(m) { |
| | | if (m) { |
| | | return m |
| | | } else { |
| | | return '-' |
| | | } |
| | | }, |
| | | handleClose() { |
| | | this.dialogVisible = false |
| | | }, |
| | | //æå¼ä¿®è®¢æ¡£æ¡å¼¹æ¡ |
| | | openEditForm() { |
| | | this.editData = JSON.parse(JSON.stringify(this.Mdata)) |
| | | 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; |
| | | } |
| | | }); |
| | | if (!flag) { |
| | | return; |
| | | } |
| | | delete this.editData.createTime |
| | | delete this.editData.updateTime |
| | | delete this.editData.createUser |
| | | 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(',') : ''; |
| | | if (formData.authorizedPerson.length === 0) { |
| | | formData.authorizedPerson = '' |
| | | } else { |
| | | formData.authorizedPerson = JSON.stringify(formData.authorizedPerson) |
| | | } |
| | | this.upLoad = true; |
| | | upDeviceParameter(formData).then(res => { |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.upLoad = false |
| | | this.getList(this.clickNodeVal.value) |
| | | this.dialogVisible = false |
| | | }).catch(e => { |
| | | this.$message.error('ä¿®æ¹å¤±è´¥') |
| | | this.dialogVisible = false |
| | | this.upLoad = false |
| | | }) |
| | | }, |
| | | // å¯¼åº |
| | | handleDownOne(row) { |
| | | 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') |
| | | }) |
| | | }, |
| | | handleSuccessUpImg2(response) { |
| | | if (response.code == 200) { |
| | | this.$nextTick(() => { |
| | | this.editData.imageUpload = response.data.url; |
| | | this.editData.imageName = response.data.name; |
| | | console.log(this.javaApi + 'img/' + this.editData.imageUpload); |
| | | |
| | | }) |
| | | } |
| | | }, |
| | | 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() |
| | | }, |
| | | // è·åè´è´£äººå表 |
| | | selectDevicePrincipal() { |
| | | selectUserCondition().then(res => { |
| | | this.responsiblePersonList = res.data; |
| | | }) |
| | | }, |
| | | obtainItemParameterList() { |
| | | obtainItemParameterList().then(res => { |
| | | let data = [] |
| | | res.data.forEach(a => { |
| | | data.push({ |
| | | label: a.laboratoryName, |
| | | value: a.id |
| | | }) |
| | | }) |
| | | this.subordinateDepartmentsList = data |
| | | }) |
| | | }, |
| | | getInsProductIds() { |
| | | getInsProduction().then(res => { |
| | | this.options = res.data.map((m, i) => { |
| | | m.id = m.name; |
| | | return m |
| | | }) |
| | | this.options.forEach(item => { |
| | | if (item.children.length == 0) { |
| | | item.children = null; |
| | | } else { |
| | | item.children.forEach(m => { |
| | | if (m.children.length == 0) { |
| | | m.children = null; |
| | | } else { |
| | | m.children.forEach(n => { |
| | | if (n.children && n.children.length == 0) { |
| | | n.children = null; |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | // è·ååå
¸ |
| | | selectEnumByCategory() { |
| | | // 设å¤ç¶æ |
| | | this.getDicts("device_status").then((response) => { |
| | | this.deviceStatusList = this.dictToValue(response.data) |
| | | this.deviceStatusList.forEach(a => { |
| | | if (!isNaN(a.value)) { |
| | | a.value = parseInt(a.value) |
| | | } |
| | | }) |
| | | }); |
| | | // 设å¤åç±» |
| | | this.getDicts("device_type").then((response) => { |
| | | this.equipmentList = this.dictToValue(response.data); |
| | | }); |
| | | }, |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | if (newVal.value) { |
| | | this.getList(newVal.value) |
| | | this.getPage() |
| | | } |
| | | }, |
| | | dialogVisible1(newVal) { |
| | | if (newVal == false) { |
| | | this.isAddFileUpdate = false |
| | | this.addFile = {} |
| | | this.fileList = [] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .main_div { |
| | | height: calc(100vh - 15em); |
| | | overflow-y: auto; |
| | | overflow-x: hidden; |
| | | } |
| | | |
| | | .page { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | .page-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | h4 { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | h4 .line { |
| | | display: inline-block; |
| | | width: 3px; |
| | | height: 16px; |
| | | background: #3A7BFA; |
| | | margin-right: 4px; |
| | | } |
| | | |
| | | .tables { |
| | | width: 100%; |
| | | } |
| | | |
| | | .el-image { |
| | | position: relative; |
| | | } |
| | | |
| | | .el-icon-picture-outline { |
| | | position: absolute; |
| | | left: 50%; |
| | | top: 50%; |
| | | transform: translate(-50%, -50%); |
| | | } |
| | | |
| | | .form-item { |
| | | line-height: 34px; |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .text-ellipsis { |
| | | display: inline-block; |
| | | width: 200px; |
| | | /* æè
æ¨å¯ä»¥è®¾ç½®ä¸ä¸ªå
·ä½çå®½åº¦å¼ */ |
| | | box-sizing: border-box; |
| | | /* ç¡®ä¿paddingåborderä¸å½±åå
ç´ çæ»å®½åº¦ */ |
| | | white-space: nowrap; |
| | | /* ç¦æ¢ææ¬æ¢è¡ */ |
| | | text-overflow: ellipsis; |
| | | /* 使ç¨çç¥å·è¡¨ç¤ºè¢«æªæçææ¬ */ |
| | | overflow: hidden; |
| | | /* éèè¶
åºå®¹å¨çå
容 */ |
| | | } |
| | | |
| | | .form-items { |
| | | line-height: 34px; |
| | | /* display: flex; */ |
| | | /* align-items: center; */ |
| | | margin-left: 15%; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | |
| | | .form-item label { |
| | | min-width: 130px; |
| | | display: inline-block; |
| | | text-align: right; |
| | | margin-right: 20px; |
| | | color: #999; |
| | | } |
| | | |
| | | .form-item p { |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | display: -webkit-box; |
| | | -webkit-line-clamp: 3; |
| | | /* è¿éè®¾ç½®ä½ æ³è¦çè¡æ° */ |
| | | -webkit-box-orient: vertical; |
| | | } |
| | | |
| | | .btns { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search_thing, |
| | | .check_thing { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | gap: 1rem; |
| | | } |
| | | |
| | | .search_label, |
| | | .check_label { |
| | | width: 120px; |
| | | } |
| | | |
| | | .search_input, |
| | | .check_data, |
| | | .check_input { |
| | | flex-grow: 1; |
| | | } |
| | | |
| | | .avatar-uploader .el-upload { |
| | | border: 1px dashed #190505; |
| | | border-radius: 6px; |
| | | cursor: pointer; |
| | | position: relative; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .avatar-uploader .el-upload:hover { |
| | | border-color: #409EFF; |
| | | } |
| | | |
| | | .avatar-uploader-icon { |
| | | font-size: 28px; |
| | | color: #8c939d; |
| | | width: 178px; |
| | | height: 178px; |
| | | line-height: 178px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .avatar { |
| | | width: 178px; |
| | | height: 178px; |
| | | display: block; |
| | | } |
| | | |
| | | .device-main { |
| | | width: 90%; |
| | | margin: 0px 5%; |
| | | height: 500px; |
| | | padding: 25px 0px; |
| | | background-color: #fff; |
| | | } |
| | | |
| | | .device-center { |
| | | width: 90%; |
| | | height: 490px; |
| | | margin: 0px 5%; |
| | | border-radius: 15px; |
| | | background-color: #fff; |
| | | overflow: hidden; |
| | | /* box-shadow: 3px 3px 8px 0 rgba(0, 0, 0, 0.3); */ |
| | | filter: drop-shadow(0px 5px 5px rgba(0, 0, 0, 0.3)) |
| | | } |
| | | |
| | | .device-title { |
| | | position: relative; |
| | | top: 20px; |
| | | z-index: 2; |
| | | font-size: clamp(1rem, 0.582rem + 1.59vw, 1.475rem); |
| | | font-weight: bold; |
| | | color: #4f6ab2; |
| | | width: 100%; |
| | | height: 90px; |
| | | line-height: 100px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .device-footer { |
| | | width: 100%; |
| | | height: 420px; |
| | | background-color: #3361d0; |
| | | position: relative |
| | | } |
| | | |
| | | .device-footer::after { |
| | | content: ""; |
| | | width: 100%; |
| | | height: 70px; |
| | | position: absolute; |
| | | top: -30px; |
| | | border-radius: 0 0 50% 50%; |
| | | background-color: #fff; |
| | | } |
| | | |
| | | .device-footer .qr-code { |
| | | width: 55%; |
| | | height: 200px; |
| | | position: relative; |
| | | top: 60px; |
| | | left: 22.5%; |
| | | background-color: #fff; |
| | | border-radius: 15px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .device-number { |
| | | width: 80%; |
| | | height: 20px; |
| | | margin-left: 20%; |
| | | position: relative; |
| | | top: 80px; |
| | | } |
| | | |
| | | .device-text { |
| | | color: #fff; |
| | | font-weight: bold; |
| | | font-size: 100%; |
| | | } |
| | | |
| | | .device-name { |
| | | width: 80%; |
| | | margin-left: 20%; |
| | | height: 20px; |
| | | position: relative; |
| | | top: 90px; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- 设å¤ç»´æ¤ --> |
| | | <template> |
| | | <div> |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æµç¨ç¼å·ï¼</div> |
| | | <div class="search_input"><el-input v-model="search.deviceNumber" clearable placeholder="请è¾å
¥" size="small" |
| | | @keyup.enter.native="getAllMessage(clickNodeVal.value)"></el-input></div> |
| | | </div> |
| | | <div class="search_thing" style="padding-left: 20px;"> |
| | | <el-button size="small" @click="resetSearch">é ç½®</el-button> |
| | | <el-button size="small" type="primary" @click="getAllMessage(clickNodeVal.value)">æ¥ è¯¢</el-button> |
| | | </div> |
| | | <div class="btns"> |
| | | <el-button size="small" type="primary" @click="dialogVisible = true; add()">æ·»å ç»´æ¤è®°å½</el-button> |
| | | <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">导åº</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="tables" style="margin-top: 16px;"> |
| | | <el-table ref="table" :data="MaintainParam" 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="180" prop="deviceNumber" /> |
| | | <el-table-column label="设å¤åç§°" min-width="150" prop="deviceName" /> |
| | | <el-table-column label="管çç¼å·" min-width="150" prop="managementNumber" /> |
| | | <el-table-column label="ç»´æ¤å
容" min-width="150" prop="content" /> |
| | | <el-table-column label="ç»´æ¤æ¶é´" min-width="150" prop="date" /> |
| | | <el-table-column label="æäº¤äºº" min-width="150" prop="name" /> |
| | | <el-table-column label="æäº¤æ¥æ" min-width="150" prop="date"> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="æä½" width="150"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="small" type="text" @click="handleViewClick(scope.row)">æ¥ç</el-button> |
| | | <el-button size="small" type="text" @click="handleDeleteClick(scope.$index, scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange"> |
| | | </el-pagination> |
| | | </div> |
| | | <!-- æ°å»ºç»´æ¤ --> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible" |
| | | title="æ·»å ç»´æ¤è®°å½" |
| | | top="5vh" width="60%"> |
| | | <el-form ref="form" :model="formData" label-width="130px"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æµç¨ç¼å·:" prop="deviceNumber"> |
| | | <el-input v-model="formData.deviceNumber" clearable disabled size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设å¤åç§°:" prop="deviceName"> |
| | | <el-input v-model="formData.deviceName" clearable disabled placeholder="请è¾å
¥" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="管çç¼å·:" prop="managementNumber"> |
| | | <el-input v-model="formData.managementNumber" clearable disabled placeholder="请è¾å
¥" |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item :rules="[{ required: true, message: '请è¾å
¥ç»´æ¤å
容', trigger: 'blur' }]" label="ç»´æ¤å
容:" |
| | | prop="content"> |
| | | <el-input v-model="formData.content" placeholder="请è¾å
¥" size="small" type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: true, message: 'è¯·éæ©ç»´æ¤æ¶é´', trigger: 'blur' }]" label="ç»´æ¤æ¶é´:" prop="date"> |
| | | <el-date-picker v-model="formData.date" 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-col :span="12"> |
| | | <el-form-item :rules="[{ required: true, message: 'è¯·éæ©ç»´æ¤ç±»å', trigger: 'blur' }]" label="ç»´æ¤ç±»å:" |
| | | prop="maintenanceType"> |
| | | <el-radio-group v-model="formData.maintenanceType" :disabled="!this.editMode"> |
| | | <el-radio :label="0">使ç¨ååç»´æ¤</el-radio> |
| | | <el-radio :label="1">计åä¸ç»´æ¤</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: true, message: 'è¯·éæ©ä¸æ¬¡ç»´æ¤æ¶é´', trigger: 'blur' }]" label="䏿¬¡ç»´æ¤æ¶é´:" |
| | | prop="nextDate"> |
| | | <el-date-picker |
| | | v-model="formData.nextDate" |
| | | :picker-options="{ disabledDate: this.disabledDate }" |
| | | 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="12"> |
| | | <el-form-item :rules="[{ required: true, message: '请è¾å
¥ç»´æ¤äºº', trigger: 'blur' }]" label="ç»´æ¤äºº:" prop="name"> |
| | | <el-input v-model="formData.name" clearable placeholder="请è¾å
¥" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿³¨:"> |
| | | <el-input v-model="formData.comments" placeholder="请è¾å
¥" size="small" type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button v-if="editMode" @click="dialogVisible = false">å æ¶</el-button> |
| | | <el-button v-if="editMode" type="primary" @click="addRecord">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | exportMaintenanceRecord, |
| | | deleteDeviceMaintenance, |
| | | selectDeviceByCode, |
| | | addDeviceMaintenance, |
| | | getDeviceMaintenancePage, deviceMaintenanceExport, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | search: { |
| | | size: 20, |
| | | current: 1, |
| | | total: 0, |
| | | deviceNumber: '' |
| | | }, |
| | | editMode: false, |
| | | dialogVisible: false, |
| | | //表åç»´æ¤å
容 |
| | | formData: {}, |
| | | //表头æ¾ç¤º |
| | | MaintainParam: [], |
| | | outLoading: false |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getAllMessage(this.clickNodeVal.value) |
| | | }, |
| | | methods: { |
| | | //䏿¬¡ç»´æ¤æ¥æ:ç¦ç¨å¨ç»´æ¤æ¥æåçæ¥æ |
| | | disabledDate(time) { |
| | | let selectDate = this.formData.date |
| | | if (selectDate) { |
| | | let oldDate = new Date(selectDate) |
| | | return time <= oldDate.getTime() |
| | | } |
| | | return false |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.search.size = val |
| | | this.getAllMessage(this.clickNodeVal.value) |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.search.current = val |
| | | this.getAllMessage(this.clickNodeVal.value) |
| | | }, |
| | | //æä½è¯¦æ
æ¥ç |
| | | handleViewClick(row) { |
| | | this.editMode = false; |
| | | this.dialogVisible = true; |
| | | this.formData = row; |
| | | }, |
| | | // å¯¼åº |
| | | handleDownOne() { |
| | | this.outLoading = true |
| | | deviceMaintenanceExport({ deviceId: this.clickNodeVal.value }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设å¤ç»´æ¤.xlsx') |
| | | }) |
| | | }, |
| | | //æä½è¯¦æ
å é¤ |
| | | handleDeleteClick(index, row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteDeviceMaintenance({ id: row.id }).then(res => { |
| | | this.getAllMessage(this.clickNodeVal.value) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'å 餿å!' |
| | | }); |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | //ç¹å»åå¯ç¼è¾ |
| | | add() { |
| | | selectDeviceByCode({ id: this.clickNodeVal.value }).then(res => { |
| | | this.formData.deviceName = res.data.deviceName |
| | | this.formData.managementNumber = res.data.managementNumber |
| | | this.$nextTick(() => { |
| | | this.$refs['form'].clearValidate() |
| | | }) |
| | | }); |
| | | this.editMode = true; |
| | | }, |
| | | //æ·»å ç»´æ¤è®°å½ |
| | | addRecord() { |
| | | this.$refs['form'].validate((valid) => { |
| | | if (valid) { |
| | | this.formData.deviceId = this.clickNodeVal.value; |
| | | addDeviceMaintenance(this.formData).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ·»å æå'); |
| | | this.getAllMessage(this.clickNodeVal.value) |
| | | this.dialogVisible = false; |
| | | this.formData = {}; //æ¸
空表å |
| | | } |
| | | }) |
| | | // this.MaintainParam.push(this.formData) |
| | | } |
| | | }) |
| | | }, |
| | | resetSearch() { |
| | | this.search = { |
| | | size: 20, |
| | | current: 1, |
| | | total: 0, |
| | | deviceNumber: '', |
| | | } |
| | | this.getAllMessage(this.clickNodeVal.value); |
| | | }, |
| | | //è·å表å设å¤ç»´æ¤ä¿¡æ¯ |
| | | getAllMessage(deviceId) { |
| | | getDeviceMaintenancePage({ |
| | | deviceId, |
| | | ...this.search |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | this.MaintainParam = res.data.records |
| | | this.search.total = res.data.total |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | if (newVal.value) { |
| | | this.getAllMessage(newVal.value) |
| | | } |
| | | }, |
| | | dialogVisible(newVal) { |
| | | if (newVal === false) { |
| | | this.formData = {} |
| | | this.$refs['form'].clearValidate() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </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: #3A7BFA; |
| | | margin-right: 4px; |
| | | } |
| | | |
| | | .tables { |
| | | width: 100%; |
| | | height: calc(100vh - 17em); |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | display: flex; |
| | | align-items: center; |
| | | position: relative; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .search_thing { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 40px; |
| | | } |
| | | |
| | | .search_label { |
| | | width: 80px; |
| | | font-size: 14px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .search_input { |
| | | width: 73%; |
| | | } |
| | | |
| | | .btns { |
| | | position: absolute; |
| | | right: 0px; |
| | | top: 50%; |
| | | transform: translate(0, -50%); |
| | | } |
| | | |
| | | .btns_thing { |
| | | position: absolute; |
| | | right: 230px; |
| | | top: 50%; |
| | | transform: translate(0, -50%); |
| | | } |
| | | |
| | | .form .search_label { |
| | | width: 120px; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- 设å¤å·¥å
·æç» --> |
| | | <template> |
| | | <div class="role_manage"> |
| | | <div class="search" v-show="!showData"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">ç¶æï¼</div> |
| | | <el-select v-model="queryParams.deviceStatus" placeholder="å
¨é¨" size="small"> |
| | | <el-option v-for="item in deviceStatusList" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label">设å¤åç§°ï¼</div> |
| | | <div class="search_input"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="queryParams.deviceName" |
| | | @keyup.enter.native="refreshTable()"> |
| | | </el-input> |
| | | </div> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label">è§æ ¼åå·ï¼</div> |
| | | <div class="search_input"><el-input size="small" placeholder="请è¾å
¥" clearable |
| | | v-model="queryParams.specificationModel" @keyup.enter.native="refreshTable()"></el-input> |
| | | </div> |
| | | </div> |
| | | <div style="padding-left: 30px;"> |
| | | <el-button size="small" @click="refresh()">é ç½®</el-button> |
| | | <el-button size="small" type="primary" @click="refreshTable()">æ¥ è¯¢</el-button> |
| | | <el-button size="small" type="primary" @click="dialogVisible2 = true">æ° å¢</el-button> |
| | | <el-button size="small" type="primary" @click="handleDownOne">导 åº</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table" v-show="!showData"> |
| | | <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 320px)'" |
| | | :page="page" @pagination="pagination"></lims-table> |
| | | </div> |
| | | <el-dialog :title="isUp ? '设å¤è¯¦æ
' : 'æ¡£æ¡ä¿®è®¢'" :visible.sync="dialogVisible" width="70%" |
| | | top="5vh" |
| | | :before-close="handleClose"> |
| | | <el-row style="display:flex;justify-content: space-around;"> |
| | | <!-- 左边å¸å± --> |
| | | <el-col :span="7"> |
| | | <el-col> |
| | | <!-- å¾ç --> |
| | | <el-image class="img" style="width:100%;height: 320px;marginBottom:16px" |
| | | :src="javaApi + '/img/' + formData.imageUpload"> |
| | | <div slot="error" class="image-error" style="width: calc(100% -2px); |
| | | height: 318px; |
| | | border-radius: 16px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | border: 1px solid #EEEEEE;"> |
| | | <i class="el-icon-picture-outline" style="font-size:60px;color:#666666;"></i> |
| | | </div> |
| | | </el-image> |
| | | <!-- 表å --> |
| | | <el-form :label-position="labelPosition" :model="formData" label-width="120px"> |
| | | <el-form-item label="仪å¨åç§°:" required> |
| | | <el-input :disabled="isUp" v-model="formData.deviceName" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="仪å¨åç§°EN:" required> |
| | | <el-input :disabled="isUp" v-model="formData.enDeviceName" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="è§æ ¼åå·:" required> |
| | | <el-input :disabled="isUp" v-model="formData.specificationModel" |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç产åå®¶:"> |
| | | <el-input :disabled="isUp" v-model="formData.manufacturer" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-col> |
| | | </el-col> |
| | | <!-- ä¸é´å¸å± --> |
| | | <el-col :span="7"> |
| | | <el-form :label-position="labelPosition" :model="formData" label-width="116px"> |
| | | <el-form-item label="æ ¡åæå¡æºæ:"> |
| | | <el-input disabled v-model="formData.calibrationServices" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="åºåç¼å·:"> |
| | | <el-input :disabled="isUp" v-model="formData.factoryNo" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="管çç¼å·:" required> |
| | | <el-input :disabled="isUp" v-model="formData.managementNumber" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="è´ç½®æ¥æ:"> |
| | | <el-date-picker :disabled="isUp" style="width:100%" v-model="formData.acquisitionDate" |
| | | type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss" size="small" |
| | | placeholder="éæ©æ¥æ"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="å¯ç¨æ¥æ:" required> |
| | | <el-date-picker :disabled="isUp" style="width:100%" v-model="formData.activationDate" |
| | | type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss" size="small" |
| | | placeholder="éæ©æ¥æ"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="管ç人:"> |
| | | <el-select v-model="formData.equipmentManager" placeholder="è¯·éæ©" size="small" |
| | | style="width:100%"> |
| | | <el-option :disabled="isUp" v-for="item in responsiblePersonList" :key="item.value" |
| | | :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="åæ¾ç¹:"> |
| | | <el-input :disabled="isUp" v-model="formData.storagePoint" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ææ¯ææ :"> |
| | | <el-input :disabled="isUp" v-model="formData.technicalIndicators" :rows="7" type="textarea" |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-col> |
| | | <!-- å³è¾¹å¸å± --> |
| | | <el-col :span="7"> |
| | | <el-form :label-position="labelPosition" :model="formData" label-width="140px" ref="ruleForm"> |
| | | <!-- å®éªå®¤å表 --> |
| | | <el-form-item label="æå±é¨é¨:"> |
| | | <el-select :disabled="isUp" v-model="formData.subordinateDepartmentsId" placeholder="è¯·éæ©" |
| | | size="small" style="width:100%"> |
| | | <el-option v-for="item in subordinateDepartmentsList" :key="item.value" |
| | | :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ£æµé¡¹ç®:"> |
| | | <el-cascader :disabled="isUp" v-model="formData.insProductIds" :options="options" |
| | | :show-all-levels="false" :props="props" placeholder="è¯·éæ©" size="small" |
| | | style="width:100%;" :collapse-tags="!isUp" separator="," filterable |
| | | clearable></el-cascader> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿æ ¡åæ¥æ:" v-if="isUp"> |
| | | <el-date-picker :disabled="isUp" style="width:100%" v-model="formData.latestTraceability" |
| | | format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" size="small" |
| | | placeholder="éæ©æ¥æ"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="䏿¬¡æ ¡åæ¥æ:" v-if="isUp"> |
| | | <el-date-picker :disabled="isUp" style="width:100%" v-model="formData.latestTraceability" |
| | | format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" size="small" |
| | | placeholder="éæ©æ¥æ"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <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"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="åä»·(ä¸å
):"> |
| | | <el-input :disabled="isUp" v-model="formData.unitPrice" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å½åç¶æ:" required> |
| | | <el-select :disabled="isUp" v-model="formData.deviceStatus" placeholder="è¯·éæ©" size="small" |
| | | style="width:100%"> |
| | | <el-option v-for="item in deviceStatusList" :key="item.value" :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ ¡åå¨æï¼æï¼:" required> |
| | | <el-input :disabled="isUp" v-model="formData.calibrationDate" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å¾ç:"> |
| | | <div |
| | | style="border: 1px solid #DCDFE6;border-radius:4px;height:32px;lineHeight:32px;display:flex;justify-content: space-around;font-size: 13px;"> |
| | | <div v-show="formData.imageName" class="picName">{{ formData.imageName }}</div> |
| | | <el-upload :disabled="isUp" :action="action" :on-success="handleSuccessUpImg2" |
| | | :show-file-list="false" accept='image/jpg,image/jpeg,image/png' :headers="uploadHeader" |
| | | :on-change="beforeUpload" :on-error="onError" ref='upload'> |
| | | <el-button type="text" style="height:30px;padding-top:8px">ä¸ä¼ </el-button> |
| | | </el-upload> |
| | | </div> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-col> |
| | | </el-row> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-row v-if="!isUp"> |
| | | <el-button @click="handleClose">å æ¶</el-button> |
| | | <el-button type="primary" @click="submitForm" :loading="upLoad">ç¡® å®</el-button> |
| | | </el-row> |
| | | </span> |
| | | </el-dialog> |
| | | <!-- æ°å¢--> |
| | | <el-dialog title="æ°å¢è®¾å¤" top="5vh" :visible.sync="dialogVisible2" width="70%" :before-close="handleClose2"> |
| | | <el-row style="display:flex;justify-content: space-around;"> |
| | | <!-- 左边å¸å± --> |
| | | <el-col :span="7"> |
| | | <el-col> |
| | | <!-- å¾ç --> |
| | | <el-image class="img" style="width:100%;height: 320px;margin-bottom:16px" |
| | | :src="javaApi + '/img/' + formData2.imageUpload"> |
| | | <div slot="error" class="image-error" style="width: calc(100% -2px); |
| | | height: 318px; |
| | | border-radius: 16px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | border: 1px solid #EEEEEE;"> |
| | | <i class="el-icon-picture-outline" style="font-size:60px;color:#666666;"></i> |
| | | </div> |
| | | </el-image> |
| | | <!-- 表å --> |
| | | <el-form :label-position="labelPosition" :model="formData2" label-width="120px"> |
| | | <el-form-item label="仪å¨åç§°:" required> |
| | | <el-input v-model="formData2.deviceName" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="仪å¨åç§°EN:" required> |
| | | <el-input v-model="formData2.enDeviceName" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="è§æ ¼åå·:" required> |
| | | <el-input v-model="formData2.specificationModel" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç产åå®¶:"> |
| | | <el-input v-model="formData2.manufacturer" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-col> |
| | | </el-col> |
| | | <!-- ä¸é´å¸å± --> |
| | | <el-col :span="7"> |
| | | <el-form :label-position="labelPosition" :model="formData2" label-width="110px"> |
| | | <!-- <el-form-item label="ç产åå®¶EN:"> |
| | | <el-input v-model="formData2.factoryNo" size="small"></el-input> |
| | | </el-form-item> --> |
| | | <el-form-item label="æ ¡åæå¡æºæ:"> |
| | | <el-input v-model="formData2.calibrationServices" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="åºåç¼å·:"> |
| | | <el-input v-model="formData2.factoryNo" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="管çç¼å·:" required> |
| | | <el-input v-model="formData2.managementNumber" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="è´ç½®æ¥æ:"> |
| | | <el-date-picker style="width:100%" v-model="formData2.acquisitionDate" type="date" |
| | | format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss" size="small" placeholder="éæ©æ¥æ"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="å¯ç¨æ¥æ:" required> |
| | | <el-date-picker style="width:100%" v-model="formData2.activationDate" type="date" |
| | | format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss" size="small" placeholder="éæ©æ¥æ"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="管ç人:"> |
| | | <el-select v-model="formData2.equipmentManager" placeholder="è¯·éæ©" size="small" |
| | | style="width:100%"> |
| | | <el-option v-for="item in responsiblePersonList" :key="item.value" :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="åæ¾ç¹:"> |
| | | <el-input v-model="formData2.storagePoint" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ææ¯ææ :"> |
| | | <el-input v-model="formData2.technicalIndicators" :rows="7" type="textarea" |
| | | size="small"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-col> |
| | | <!-- å³è¾¹å¸å± --> |
| | | <el-col :span="7"> |
| | | <el-form :label-position="labelPosition" :model="formData2" label-width="120px" ref="ruleForm"> |
| | | <!-- å®éªå®¤å表 --> |
| | | <el-form-item label="æå±é¨é¨:"> |
| | | <el-select v-model="formData2.subordinateDepartmentsId" placeholder="è¯·éæ©" size="small" |
| | | style="width:100%"> |
| | | <el-option v-for="item in subordinateDepartmentsList" :key="item.value" |
| | | :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ£æµé¡¹ç®:"> |
| | | <el-cascader v-model="formData2.insProductIds" :options="options" :show-all-levels="false" |
| | | :props="props" placeholder="è¯·éæ©" size="small" style="width:100%" collapse-tags |
| | | separator="," filterable clearable></el-cascader> |
| | | </el-form-item> |
| | | <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> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="åä»·(ä¸å
):"> |
| | | <el-input v-model="formData2.unitPrice" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å½åç¶æ:" required> |
| | | <el-select v-model="formData2.deviceStatus" placeholder="è¯·éæ©" size="small" |
| | | style="width:100%"> |
| | | <el-option v-for="item in deviceStatusList" :key="item.id" :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ ¡åå¨æï¼æï¼:" required> |
| | | <el-input v-model="formData2.calibrationDate" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å¾ç:"> |
| | | <div |
| | | style="border: 1px solid #DCDFE6;border-radius:4px;height:32px;line-height:32px;display:flex;justify-content: space-around;font-size: 13px;"> |
| | | <div v-show="formData2.imageName" class="picName">{{ formData2.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" |
| | | :on-error="onError" ref='upload'> |
| | | <el-button type="text" style="height:30px;padding-top:8px">ä¸ä¼ </el-button> |
| | | </el-upload> |
| | | </div> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-col> |
| | | </el-row> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-row> |
| | | <el-button @click="handleClose2">å æ¶</el-button> |
| | | <el-button type="primary" @click="submitForm2" :loading="upLoad2">ç¡® å®</el-button> |
| | | </el-row> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="æ°éé
ç½®" :visible.sync="dialogVisible3" width="400px"> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>IPï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.ip"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>ééå°åï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.collectUrl"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>å¨åå°åï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.storageUrl"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>åç
§ï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.refer"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>Xï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.x"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>Yï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.y"></el-input> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label">å
¬å¼ï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.formula"></el-input> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-row> |
| | | <el-button @click="dialogVisible3 = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="submitForm3" :loading="upLoad3">ç¡® å®</el-button> |
| | | </el-row> |
| | | </span> |
| | | </el-dialog> |
| | | <dataAcquisitionConfig v-if="showData" :deviceId="deviceId" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import dataAcquisitionConfig from './acquisitionConfig.vue' |
| | | import { |
| | | obtainItemParameterList, |
| | | exportEquipmentDetails, |
| | | getInsProduction, |
| | | upDeviceParameter, |
| | | addDeviceParameter, |
| | | numberCollect, |
| | | getDeviceParameter, |
| | | delDeviceParameter, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/system/user"; |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | } |
| | | }, |
| | | components: { |
| | | limsTable, |
| | | dataAcquisitionConfig, |
| | | }, |
| | | data() { |
| | | return { |
| | | dateFormat: 'yyyy-MM-dd', |
| | | deviceId: '', |
| | | fileTypeOptions: [ |
| | | { label: 'csv', value: '.csv' }, |
| | | { label: 'db', value: '.db' }, |
| | | { label: 'mdb', value: '.mdb' }, |
| | | { label: 'word', value: '.docx' }, |
| | | { label: 'excel', value: '.xlsx' }, |
| | | { label: 'txt', value: '.txt' }, |
| | | { label: 'png', value: '.png' }, |
| | | ], |
| | | //æ¯å¦æ¯æ¡£æ¡ä¿®è®¢ true䏿¯ falseæ¯ |
| | | isUp: true, |
| | | formData: { |
| | | authorizedPerson: [] |
| | | }, |
| | | formData2: { |
| | | imageUpload: '', |
| | | imageName: '', |
| | | deviceStatus: '', |
| | | authorizedPerson: [] |
| | | }, |
| | | value: '', |
| | | props: { multiple: true, emitPath: false, value: 'id', label: 'name' }, |
| | | options: [], |
| | | labelPosition: 'right', |
| | | dialogVisible: false, |
| | | dialogVisible2: false, |
| | | addPower: false, |
| | | showData: false, // æ°éé
ç½®é¡µé¢ |
| | | tableList: [], |
| | | addDia: true, |
| | | addPower: true, |
| | | //设å¤ç±»åå表 |
| | | equipmentList: [], |
| | | // è´è´£äººå表 |
| | | responsiblePersonList: [], |
| | | // ææäººå表 |
| | | authorizerList: [], |
| | | // å½åç¶æå表 |
| | | deviceStatusList: [], |
| | | // æå±é¨é¨ |
| | | subordinateDepartmentsList: [], |
| | | upLoad: false, |
| | | upLoad2: false, |
| | | dialogVisible3: false, |
| | | upLoad3: false, |
| | | configForm: {}, |
| | | laboratoryNameIsNull: false, |
| | | queryParams: {}, |
| | | tableData: [], |
| | | column: [ |
| | | { label: "设å¤åç§°", prop: "deviceName", dataType: 'link', linkMethod: 'selectAllByOne' }, |
| | | { label: "设å¤åç§°EN", prop: "enDeviceName" }, |
| | | { |
| | | label: "è§æ ¼åå·", |
| | | prop: "specificationModel", |
| | | }, |
| | | { label: "ç产åå®¶", prop: "manufacturer" }, |
| | | { label: "åºåç¼å·", prop: "factoryNo" }, |
| | | { label: "管çç¼å·", prop: "managementNumber" }, |
| | | { label: "ææ¯ææ ", prop: "technicalIndicators" }, |
| | | { label: "è´ç½®æ¥æ", prop: "acquisitionDate" }, |
| | | { label: "å¯ç¨æ¥æ", prop: "activationDate" }, |
| | | { label: "管ç人", prop: "equipmentManagerUser" }, |
| | | { label: "åæ¾ç¹", prop: "storagePoint" }, |
| | | { label: "æå±é¨é¨", prop: "laboratoryName" }, |
| | | { label: "æ£éªé¡¹ç®", prop: "insProductItem" }, |
| | | { label: "æ ¡åæå¡æºæ", prop: "calibrationServices" }, |
| | | { label: "æè¿æ ¡åæ¥æ", prop: "lastCalibrationDateTwo" }, |
| | | { label: "æè¿æ ¸æ¥æ¥æ", prop: "lastCalibrationDate" }, |
| | | { label: "䏿¬¡æ ¡åæ¥æ", prop: "nextCalibrationDateTwo" }, |
| | | { label: "䏿¬¡æ ¸æ¥æ¥æ", prop: "nextCalibrationDate" }, |
| | | { |
| | | label: "设å¤åç±»", prop: "largeCategory", dataType: "tag", |
| | | formatData: (params) => { |
| | | return this.equipmentList.find(m => m.value == params).label |
| | | }, |
| | | formatType: (params) => { |
| | | return this.equipmentList.find(m => m.value == params).type |
| | | } |
| | | }, |
| | | { label: "åä»·", prop: "unitPrice" }, |
| | | { |
| | | label: "设å¤ç¶æ", prop: "deviceStatus", dataType: "tag", |
| | | formatData: (params) => { |
| | | return this.deviceStatusList.find(m => m.value == params).label |
| | | }, |
| | | formatType: (params) => { |
| | | return this.deviceStatusList.find(m => m.value == params).type |
| | | } |
| | | }, |
| | | { label: "æ ¡å卿(æ)", prop: "calibrationDate" }, |
| | | { |
| | | dataType: "action", |
| | | fixed: "right", |
| | | label: "æä½", |
| | | operation: [ |
| | | { |
| | | name: "æ¡£æ¡ä¿®è®¢", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.isUpdate(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "æ°éé
ç½®", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleConfig(row); |
| | | }, |
| | | disabled: (row) => { |
| | | return row.insProductItem == null || row.insProductItem === '' |
| | | } |
| | | }, |
| | | { |
| | | name: "å é¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDelete(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 0, |
| | | }, |
| | | tableLoading: false, |
| | | } |
| | | }, |
| | | computed: { |
| | | action() { |
| | | return this.javaApi + '/deviceScope/uploadFile' |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.selectEnumByCategory() |
| | | this.selectDevicePrincipal() |
| | | this.obtainItemParameterList() |
| | | this.getInsProductIds() |
| | | // åå§å |
| | | this.clickSidebar(this.clickNodeVal) |
| | | }, |
| | | methods: { |
| | | //åç±» |
| | | handleNotification(cate) { |
| | | this.queryParams.largeCategory = cate |
| | | }, |
| | | obtainItemParameterList() { |
| | | obtainItemParameterList().then(res => { |
| | | let data = [] |
| | | res.data.forEach(a => { |
| | | data.push({ |
| | | label: a.laboratoryName, |
| | | value: a.id |
| | | }) |
| | | }) |
| | | this.subordinateDepartmentsList = data |
| | | }) |
| | | }, |
| | | getList() { |
| | | this.tableLoading = true; |
| | | let param = { laboratoryNameIsNull: this.laboratoryNameIsNull, ...this.queryParams, ...this.page }; |
| | | delete param.total; |
| | | getDeviceParameter({ ...param }) |
| | | .then((res) => { |
| | | this.tableLoading = false; |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records; |
| | | this.page.total = res.data.total; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.tableLoading = false; |
| | | }); |
| | | }, |
| | | pagination({ page, limit }) { |
| | | this.page.current = page; |
| | | this.page.size = limit; |
| | | this.getList(); |
| | | }, |
| | | refresh() { |
| | | this.queryParams = {}; |
| | | this.page.current = 1; |
| | | this.getList(); |
| | | }, |
| | | refreshTable() { |
| | | this.page.current = 1; |
| | | this.getList(); |
| | | }, |
| | | // å¯¼åº |
| | | handleDownOne() { |
| | | this.outLoading = true |
| | | exportEquipmentDetails().then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设å¤ä»ªå¨ä¸è§è¡¨.doc') |
| | | }) |
| | | }, |
| | | // è·ååå
¸ |
| | | selectEnumByCategory() { |
| | | // 设å¤ç¶æ |
| | | this.getDicts("device_status").then((response) => { |
| | | this.deviceStatusList = this.dictToValue(response.data); |
| | | }); |
| | | // 设å¤åç±» |
| | | this.getDicts("device_type").then((response) => { |
| | | this.equipmentList = this.dictToValue(response.data); |
| | | }); |
| | | }, |
| | | // è·åè´è´£äººå表 |
| | | selectDevicePrincipal() { |
| | | selectUserCondition().then(res => { |
| | | let data = []; |
| | | res.data.forEach((a) => { |
| | | data.push({ |
| | | label: a.name, |
| | | value: a.id, |
| | | }); |
| | | }); |
| | | this.responsiblePersonList = data |
| | | this.authorizerList = data |
| | | }) |
| | | }, |
| | | getInsProductIds() { |
| | | getInsProduction().then(res => { |
| | | this.options = res.data.map((m, i) => { |
| | | m.id = m.name; |
| | | let children = m.children.map(n => { |
| | | n.label = n.name; |
| | | n.value = n.id; |
| | | return n |
| | | }) |
| | | return m |
| | | }) |
| | | this.options.forEach(item => { |
| | | if (item.children.length == 0) { |
| | | item.children = null; |
| | | } else { |
| | | item.children.forEach(m => { |
| | | if (m.children.length == 0) { |
| | | m.children = null; |
| | | } else { |
| | | m.children.forEach(n => { |
| | | if (n.children && n.children.length == 0) { |
| | | n.children = null; |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | handleClose() { |
| | | this.formData = { |
| | | authorizedPerson: [] |
| | | } |
| | | this.formData2 = { |
| | | imageUpload: '', |
| | | imageName: '', |
| | | authorizedPerson: [] |
| | | } |
| | | this.dialogVisible = false; |
| | | this.upLoad = false; |
| | | }, |
| | | handleClose2() { |
| | | this.formData = { |
| | | authorizedPerson: [] |
| | | } |
| | | this.formData2 = { |
| | | imageUpload: '', |
| | | imageName: '', |
| | | authorizedPerson: [] |
| | | } |
| | | this.dialogVisible2 = false; |
| | | this.upLoad = false; |
| | | }, |
| | | selectAllByOne(row) { |
| | | this.isUp = true |
| | | //æå¼å¼¹æ¡ |
| | | this.dialogVisible = true; |
| | | //row = ç¹å»å¯¹åºè¡å¼ |
| | | //å¤å¶ç»formData |
| | | this.formData = this.HaveJson(row); |
| | | console.log(row.insProductIds + 'valll'); |
| | | this.formData.insProductIds = row.insProductIds ? row.insProductIds.split(',') : []; |
| | | }, |
| | | isUpdate(row) { |
| | | //ä¿®æ¹ isUp 为档æ¡ä¿®æ¹ |
| | | this.isUp = false |
| | | //æå¼å¼¹æ¡ |
| | | this.dialogVisible = true; |
| | | //row = ç¹å»å¯¹åºè¡å¼ä¸è¡å¼ |
| | | //å¤å¶ç»formData |
| | | this.formData = this.HaveJson(row); |
| | | if (typeof (row.insProductIds) === 'number') { |
| | | row.insProductIds = row.insProductIds + '' |
| | | } |
| | | this.formData.deviceStatus = this.formData.deviceStatus + '' |
| | | this.formData.insProductIds = row.insProductIds ? row.insProductIds.split(',') : []; |
| | | // å°æ¶é´æ ¼å¼ä¸ºyyyy-MM-dd è¿è¡è½¬æ¢ |
| | | const dateRegex = /^\d{4}-\d{2}-\d{2}$/ |
| | | Object.keys(this.formData).forEach(key => { |
| | | if (dateRegex.test(this.formData[key])) { |
| | | this.formData[key] = `${this.formData[key]} 00:00:00` |
| | | } |
| | | }) |
| | | }, |
| | | 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() |
| | | }, |
| | | // ä¸ä¼ å¾çæå |
| | | handleSuccessUpImg(response,) { |
| | | if (response.code == 200) { |
| | | this.formData.imageUpload = response.data.url; |
| | | this.formData.imageName = response.data.name; |
| | | } |
| | | }, |
| | | handleSuccessUpImg2(response) { |
| | | if (response.code == 200) { |
| | | this.$nextTick(() => { |
| | | this.formData.imageUpload = response.data.url; |
| | | this.formData.imageName = response.data.name; |
| | | this.formData2.imageUpload = response.data.url; |
| | | this.formData2.imageName = response.data.name; |
| | | }) |
| | | } |
| | | }, |
| | | submitForm() { |
| | | if (!this.formData.deviceName) { |
| | | this.$message.error('æªè¾å
¥ä»ªå¨åç§°') |
| | | return |
| | | } |
| | | if (!this.formData.enDeviceName) { |
| | | this.$message.error('æªè¾å
¥ä»ªå¨åç§°EN') |
| | | return |
| | | } |
| | | if (!this.formData.specificationModel) { |
| | | this.$message.error('æªè¾å
¥è§æ ¼åå·') |
| | | return |
| | | } |
| | | if (!this.formData.managementNumber) { |
| | | this.$message.error('æªè¾å
¥ç®¡çç¼å·') |
| | | return |
| | | } |
| | | if (!this.formData.activationDate) { |
| | | this.$message.error('æªè¾å
¥æ ¡åæææ') |
| | | return |
| | | } |
| | | if (!this.formData.subordinateDepartmentsId) { |
| | | this.$message.error('æªéæ©æå±é¨é¨') |
| | | return |
| | | } |
| | | if (this.formData.deviceStatus === '' || this.formData.deviceStatus === null) { |
| | | this.$message.error('æªéæ©å½åç¶æ') |
| | | return |
| | | } |
| | | if (!this.formData.calibrationDate) { |
| | | this.$message.error('æªè¾å
¥æ ¡åå¨æï¼æï¼') |
| | | return |
| | | } |
| | | delete this.formData.createTime |
| | | delete this.formData.updateTime |
| | | delete this.formData.createUser |
| | | delete this.formData.updateUser |
| | | const formData = this.HaveJson(this.formData) |
| | | formData.insProductIds = formData.insProductIds ? formData.insProductIds.join() : '' |
| | | if (formData.authorizedPerson.length === 0) { |
| | | formData.authorizedPerson = '' |
| | | } else { |
| | | formData.authorizedPerson = JSON.stringify(formData.authorizedPerson) |
| | | } |
| | | this.upLoad = true; |
| | | upDeviceParameter(formData).then(res => { |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.upLoad = false |
| | | this.refreshTable('page') |
| | | this.dialogVisible = false |
| | | }).catch(e => { |
| | | this.$message.error('ä¿®æ¹å¤±è´¥') |
| | | this.dialogVisible = false |
| | | this.upLoad = false |
| | | }) |
| | | }, |
| | | // æäº¤æ¡£æ¡ä¿®è®¢--æ°å¢ |
| | | submitForm2() { |
| | | if (!this.formData2.deviceName) { |
| | | this.$message.error('æªè¾å
¥ä»ªå¨åç§°') |
| | | return |
| | | } |
| | | if (!this.formData2.enDeviceName) { |
| | | this.$message.error('æªè¾å
¥ä»ªå¨åç§°EN') |
| | | return |
| | | } |
| | | if (!this.formData2.specificationModel) { |
| | | this.$message.error('æªè¾å
¥è§æ ¼åå·') |
| | | return |
| | | } |
| | | if (!this.formData2.managementNumber) { |
| | | this.$message.error('æªè¾å
¥ç®¡çç¼å·') |
| | | return |
| | | } |
| | | if (!this.formData2.activationDate) { |
| | | this.$message.error('æªè¾å
¥æ ¡åæææ') |
| | | return |
| | | } |
| | | if (!this.formData2.deviceStatus) { |
| | | this.$message.error('æªéæ©å½åç¶æ') |
| | | return |
| | | } |
| | | if (!this.formData2.calibrationDate) { |
| | | this.$message.error('è¾å
¥æ ¡åå¨æï¼æï¼') |
| | | return |
| | | } |
| | | const formData = this.HaveJson(this.formData2) |
| | | formData.insProductIds = formData.insProductIds ? formData.insProductIds.join() : '' |
| | | if (formData.authorizedPerson.length === 0) { |
| | | formData.authorizedPerson = '' |
| | | } else { |
| | | formData.authorizedPerson = JSON.stringify(formData.authorizedPerson) |
| | | } |
| | | this.upLoad2 = true; |
| | | addDeviceParameter(formData).then(res => { |
| | | this.$message.success('æäº¤æå') |
| | | this.upLoad2 = false |
| | | this.refreshTable('page') |
| | | this.dialogVisible2 = false |
| | | this.formData2 = { |
| | | imageUpload: '', |
| | | imageName: '', |
| | | authorizedPerson: [] |
| | | } |
| | | }).catch(e => { |
| | | this.$message.error('æäº¤å¤±è´¥') |
| | | this.dialogVisible2 = false |
| | | this.upLoad2 = false |
| | | }) |
| | | }, |
| | | handleConfig(row) { |
| | | let list = [] |
| | | if (row.insProductItem) { |
| | | list = row.insProductItem.split(';') |
| | | } |
| | | let list2 = [] |
| | | list.map((item) => { |
| | | const obj = Object.assign({ |
| | | deviceId: row.id, |
| | | insProductItem: item, |
| | | }) |
| | | list2.push(obj) |
| | | }) |
| | | this.tableList = list2 |
| | | this.deviceId = row.id |
| | | this.$nextTick(() => { |
| | | this.showData = true |
| | | }) |
| | | }, |
| | | closeDataVue() { |
| | | this.clickSidebar(this.clickNodeVal) |
| | | this.showData = false |
| | | }, |
| | | submitForm3() { |
| | | if (!this.configForm.ip) { |
| | | this.$message.error('请填åIP'); |
| | | return |
| | | } |
| | | if (!this.configForm.collectUrl) { |
| | | this.$message.error('请填åééå°å'); |
| | | return |
| | | } |
| | | if (!this.configForm.storageUrl) { |
| | | this.$message.error('请填åå¨åå°å'); |
| | | return |
| | | } |
| | | if (!this.configForm.refer) { |
| | | this.$message.error('请填ååç
§'); |
| | | return |
| | | } |
| | | if (!this.configForm.x) { |
| | | this.$message.error('请填åX'); |
| | | return |
| | | } |
| | | if (!this.configForm.y) { |
| | | this.$message.error('请填åY'); |
| | | return |
| | | } |
| | | |
| | | this.upLoad3 = true |
| | | numberCollect(this.configForm).then(res => { |
| | | this.upLoad3 = false |
| | | this.$message.success('æä½æå') |
| | | this.refreshTable('page') |
| | | this.dialogVisible3 = false |
| | | }).catch(e => { |
| | | this.$message.error('æä½å¤±è´¥') |
| | | this.dialogVisible3 = false |
| | | this.upLoad3 = false |
| | | }) |
| | | }, |
| | | // ç¹å»ä¾§è¾¹æ å·æ° |
| | | clickSidebar(clickNodeVal) { |
| | | this.laboratoryNameIsNull = false |
| | | // æ¯å¦åå¨valueï¼åå¨value代表为ä¸çº§ |
| | | if (!clickNodeVal.value) { |
| | | this.list = []; |
| | | this.queryParams.laboratoryName = null |
| | | this.queryParams.storagePoint = null |
| | | // çäº1代表为æ çä¸çº§ï¼label为é¨é¨ |
| | | if (clickNodeVal.label == 'å
¶ä»') { |
| | | this.laboratoryNameIsNull = true |
| | | this.refreshTable('page') |
| | | return |
| | | } |
| | | if (clickNodeVal.level == 1) { |
| | | this.queryParams.laboratoryName = clickNodeVal.label |
| | | // çäºäºçº§ãlabel为åå¨å°ç¹ |
| | | } else if (clickNodeVal.level == 2) { |
| | | // å
¶ä»è¡¨ç¤ºæ²¡æé
ç½®å®éªå®¤ï¼åªé
ç½®äºå°ç¹ |
| | | if (clickNodeVal.parent.label == 'å
¶ä»') { |
| | | this.laboratoryNameIsNull = true |
| | | } else { |
| | | this.queryParams.laboratoryName = clickNodeVal.parent.label |
| | | } |
| | | this.queryParams.storagePoint = clickNodeVal.label |
| | | } |
| | | this.refreshTable('page') |
| | | } |
| | | }, |
| | | handleDelete(row) { |
| | | this.$confirm("æ¯å¦å é¤è¯¥æ¡æ°æ®?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delDeviceParameter({ id: row.id }).then((res) => { |
| | | this.$message.success("å 餿å"); |
| | | this.refresh(); |
| | | }); |
| | | }) |
| | | .catch(() => { }); |
| | | }, |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | this.clickSidebar(newVal) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .role_manage { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | .title { |
| | | line-height: 15px; |
| | | } |
| | | |
| | | .search { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .search_thing { |
| | | width: 14em; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search_label { |
| | | width: 80px; |
| | | font-size: 14px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .search_input { |
| | | width: calc(100% - 80px); |
| | | } |
| | | |
| | | .table { |
| | | margin-top: 12px; |
| | | background-color: #fff; |
| | | height: calc(100vh - 17em); |
| | | } |
| | | |
| | | .el-form-item { |
| | | margin-bottom: 16px; |
| | | } |
| | | |
| | | .picName { |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | word-break: break-all; |
| | | width: 120px; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- ä½ä¸æå¯¼ä¹¦ --> |
| | | <template> |
| | | <div> |
| | | <div style="margin: 10px 0;text-align: right"> |
| | | <!-- <el-button size="small" type="primary" @click="getList">å·æ°</el-button>--> |
| | | <el-button size="small" type="primary" @click="dialogVisible = true">åæ§ç³è¯·</el-button> |
| | | </div> |
| | | <el-table :data="tableData" border height="calc(100vh - 18em)"> |
| | | <el-table-column type="index" label="åºå·" 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="applicationNumber"></el-table-column> |
| | | <el-table-column label="设å¤åç§°" min-width="150" prop="deviceName"></el-table-column> |
| | | <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="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="approverName"></el-table-column> |
| | | <el-table-column label="审æ¹ç¶æ" min-width="150" prop="status"> |
| | | <template v-slot="scope"> |
| | | {{ scope.row.status === true ? 'éè¿' : scope.row.status === false ? 'ä¸éè¿' : 'æªå®¡æ ¸' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" min-width="180" fixed="right" prop="name"> |
| | | <template v-slot="scope"> |
| | | <el-button type="text" size="small" @click="downloadFile(scope.row.fileSystemName)">ä¸è½½</el-button> |
| | | <el-button type="text" size="small" style="color: red;" |
| | | @click="deleteHomeworkGuidebook(scope.row)">å é¤</el-button> |
| | | <el-button type="text" size="small" @click="instructionEditFun(scope.row)">ç¼è¾</el-button> |
| | | <el-button type="text" size="small" @click="approval(scope.row)">审æ¹</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="1" |
| | | :page-sizes="[10, 20, 30, 50, 100]" :page-size="search.size" layout="->,total, sizes, prev, pager, next, jumper" |
| | | :total="search.total"> |
| | | </el-pagination> |
| | | <el-dialog :visible.sync="dialogVisible" title="åæ§ç³è¯·" width="60%"> |
| | | <div style="height: 60vh; overflow-y: auto; overflow-x: hidden;"> |
| | | <el-form ref="form1" label-width="110px" :model="instructionForm"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç³è¯·ç¼å·:"> |
| | | <el-input v-model="instructionForm.applicationNumber" disabled size="small" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="éä»¶ï¼" style="float: left;"> |
| | | <el-upload ref="uploadFile" :action="action" :before-remove="beforeRemove" :file-list="fileList1" |
| | | :headers="uploadHeader" :limit="1" :on-error="onError" :on-exceed="handleExceed" |
| | | :on-remove="handleRemove1" :on-success="onSuccess1" class="upload-demo" multiple> |
| | | <el-button size="small" type="primary">ç¹å»ä¸ä¼ </el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç³è¯·é¨é¨:"> |
| | | <el-input v-model="instructionForm.applicationDepartment" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="责任人:"> |
| | | <el-input v-model="instructionForm.personLiable" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="åæ§ç³è¯·è¯´æ:" prop="controlledApplicationDescription" |
| | | :rules="[{ required: true, message: '请è¾å
¥åæ§ç³è¯·è¯´æ', trigger: 'blur' }]"> |
| | | <el-input v-model="instructionForm.controlledApplicationDescription" type="textarea" |
| | | clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div style="text-align: right; margin-bottom: 10px"> |
| | | <el-button size="small" type="primary" @click="openAddDia">æ·»å åæ§æä»¶</el-button> |
| | | <el-button size="small" @click="delFile">å é¤</el-button> |
| | | </div> |
| | | <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> |
| | | <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="deviceNumber" show-overflow-tooltip min-width="125"></el-table-column> |
| | | <el-table-column label="设å¤åå·" prop="deviceModel" 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 min-width="100" label="æä½" fixed="right"> |
| | | <template v-slot="scope"> |
| | | <el-button type="text" size="small" @click="downloadFile(scope.row.fileSystemName)">ä¸è½½</el-button> |
| | | <el-button type="text" @click="editFun(scope.row, scope.$index)">ç¼è¾</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <span slot="footer"> |
| | | <el-button @click="dialogVisible = false" size="small">å æ¶</el-button> |
| | | <el-button size="small" type="primary" @click="submitFun">æäº¤</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="dialogVisible1" title="æ·»å 设å¤ä½ä¸æå¯¼ä¹¦" width="40%"> |
| | | <div style="height: 50vh;"> |
| | | <el-form ref="form" :model="form" label-width="90px"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æä»¶ç±»å:" prop="documentType" |
| | | :rules="[{ required: true, message: '请è¾å
¥æä»¶ç±»å', trigger: 'blur' }]"> |
| | | <el-input v-model="form.documentType" clearable size="small" placeholder="请è¾å
¥æä»¶ç±»å"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤åç§°:" prop="deviceName" |
| | | :rules="[{ required: true, message: 'è¯·éæ©è®¾å¤', trigger: 'change' }]"> |
| | | <el-select v-model="form.deviceName" size="small" clearable style="width: 100%" placeholder="è¯·éæ©è®¾å¤åç§°" |
| | | @change="onDeviceNameChange" filterable> |
| | | <el-option v-for="item in deviceNameOption" :key="item.id" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ææ¡£ç¼å·:" prop="documentNumber" |
| | | :rules="[{ required: true, message: '请è¾å
¥ææ¡£ç¼å·', trigger: 'blur' }]"> |
| | | <el-input v-model="form.documentNumber" size="small" clearable placeholder="请è¾å
¥ææ¡£ç¼å·"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="管çç¼å·:"> |
| | | <el-input v-model="form.deviceNumber" size="small" clearable disabled placeholder="请è¾å
¥ç®¡çç¼å·"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æä»¶çæ¬:" prop="documentVersion" |
| | | :rules="[{ required: true, message: '请è¾å
¥æä»¶çæ¬', trigger: 'blur' }]"> |
| | | <el-input v-model="form.documentVersion" size="small" placeholder="请è¾å
¥æä»¶çæ¬" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä½è
:" prop="author" :rules="[{ required: true, message: '请è¾å
¥ä½è
', trigger: 'blur' }]"> |
| | | <el-input v-model="form.author" size="small" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æäº¤æ¥æ:" prop="submitDate" |
| | | :rules="[{ required: true, message: 'è¯·éæ©æäº¤æ¥æ', trigger: 'change' }]"> |
| | | <el-date-picker v-model="form.submitDate" format="yyyy-MM-dd" style="width: 100%" size="small" clearable |
| | | placeholder="éæ©æ¥æ" type="date" value-format="yyyy-MM-dd"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ææ¡£è¯´æ:" prop="documentNote" |
| | | :rules="[{ required: true, message: '请è¾å
¥ææ¡£è¯´æ', trigger: 'blur' }]"> |
| | | <el-input v-model="form.documentNote" placeholder="请è¾å
¥ææ¡£è¯´æ" type="textarea" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="éä»¶ï¼" style="float: left;"> |
| | | <el-upload ref="uploadFile" :action="action" :before-remove="beforeRemove" :file-list="fileList" |
| | | :headers="uploadHeader" :limit="1" :on-error="onError" :on-exceed="handleExceed" |
| | | :on-remove="handleRemove" :on-success="onSuccess" class="upload-demo" multiple> |
| | | <el-button size="small" type="primary">ç¹å»ä¸ä¼ </el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | | <span slot="footer"> |
| | | <el-button @click="closeDia" size="small">å æ¶</el-button> |
| | | <el-button type="primary" @click="addFile" size="small">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import fileDownload from "@/utils/file"; |
| | | import { |
| | | approvalOfHomeworkInstructionManual, |
| | | homeworkGuidebook, |
| | | homeworkGuidebookEditor, |
| | | newHomeworkGuidebookAdded, |
| | | deleteHomeworkGuidebook, |
| | | pageByPageQueryOfHomeworkInstructions, |
| | | selectDeviceParameter, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | } |
| | | }, |
| | | name: '', |
| | | components: {}, |
| | | data() { |
| | | return { |
| | | search: { |
| | | size: 20, |
| | | current: 1, |
| | | total: 0 |
| | | }, |
| | | dialogVisible: false, |
| | | dialogVisible1: false, |
| | | value: '', |
| | | selectRow: null, |
| | | device: null, |
| | | tableDataIndex: '', |
| | | form: { |
| | | documentType: '', |
| | | documentNumber: '', |
| | | deviceName: '', |
| | | deviceModel: '', |
| | | deviceNumber: '', |
| | | fileName: '', |
| | | fileSystemName: '', |
| | | submitDate: '', |
| | | documentNote: '', |
| | | }, |
| | | tableData: [], |
| | | documentTableData: [], |
| | | formData: {}, |
| | | fileList: [], |
| | | fileList1: [], |
| | | laboratoryNameIsNull: false, |
| | | devices: [], //设å¤åè¡¨æ°æ® |
| | | deviceNameOption: [], //设å¤åç§°ä¸ææ¡æ°æ® |
| | | entity: { |
| | | deviceName: null, |
| | | laboratoryName: '', |
| | | storagePoint: '' |
| | | }, |
| | | selectedRow: [], |
| | | instructionForm: { |
| | | applicationNumber: '', // ç³è¯·ç¼å· |
| | | applicationDepartment: '', // ç³è¯·é¨é¨ |
| | | personLiable: '', // 责任人 |
| | | controlledApplicationDescription: '', // åæ§ç³è¯·è¯´æ |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getAllDevice(); |
| | | this.getList() |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | if (newVal) { |
| | | this.getList() |
| | | this.clickSidebar(newVal) |
| | | } |
| | | }, |
| | | dialogVisible(newVal) { |
| | | if (newVal === false) { |
| | | this.instructionForm = {} |
| | | this.documentTableData = [] |
| | | this.fileList1 = [] |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | approval(row) { |
| | | this.$confirm('æ¯å¦å®¡æ¹éè¿ï¼', 'æç¤º', { |
| | | confirmButtonText: 'éè¿', |
| | | cancelButtonText: 'ä¸éè¿', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.approvalFun(row.id, true) |
| | | }).catch(() => { |
| | | this.approvalFun(row.id, false) |
| | | }); |
| | | }, |
| | | approvalFun(id, status) { |
| | | approvalOfHomeworkInstructionManual({ id, status }).then(res => { |
| | | this.getList() |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'æä½æå!' |
| | | }); |
| | | }) |
| | | |
| | | }, |
| | | getRowKey(row) { |
| | | return row.index |
| | | }, |
| | | deleteHomeworkGuidebook(row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | homeworkGuidebook({ |
| | | id: row.id, |
| | | instructionId: row.instructionId |
| | | }).then(res => { |
| | | this.$message.success('å 餿åï¼') |
| | | this.getList() |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | downloadFile(fileName) { |
| | | let state = /\.(jpg|jpeg|png|gif)$/i.test(fileName) |
| | | if (state) { |
| | | let url = this.javaApi + '/img/' + fileName; |
| | | fileDownload.downloadIamge(url, fileName) |
| | | } else { |
| | | const url = this.javaApi + '/word/' + fileName |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = fileName; |
| | | link.click(); |
| | | this.$message.success('ä¸è½½æå') |
| | | } |
| | | }, |
| | | instructionEditFun(row) { |
| | | this.dialogVisible = true |
| | | 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.documentTableData = res.data.list; |
| | | // å é¤ç¨ |
| | | this.documentTableData.forEach((v, k) => { |
| | | v.index = k |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.search.size = val |
| | | this.getList() |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.search.current = val |
| | | this.getList() |
| | | }, |
| | | submitFun() { |
| | | this.$refs.form1.validate((valid) => { |
| | | if (valid) { |
| | | this.instructionForm.feTempHumRecordList = this.documentTableData |
| | | newHomeworkGuidebookAdded(this.instructionForm).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æä½æåï¼') |
| | | this.dialogVisible = false |
| | | this.getList() |
| | | } |
| | | }) |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | clickSidebar(clickNodeVal) { |
| | | this.laboratoryNameIsNull = false |
| | | // æ¯å¦åå¨valueï¼åå¨value代表为ä¸çº§ |
| | | if (!clickNodeVal.value) { |
| | | this.list = []; |
| | | this.entity.laboratoryName = null |
| | | this.entity.storagePoint = null |
| | | // çäº1代表为æ çä¸çº§ï¼label为é¨é¨ |
| | | if (clickNodeVal.label === 'å
¶ä»') { |
| | | this.laboratoryNameIsNull = true |
| | | this.getAllDevice() |
| | | return |
| | | } |
| | | if (clickNodeVal.level === 1) { |
| | | this.entity.laboratoryName = clickNodeVal.label |
| | | // çäºäºçº§ãlabel为åå¨å°ç¹ |
| | | } else if (clickNodeVal.level === 2) { |
| | | // å
¶ä»è¡¨ç¤ºæ²¡æé
ç½®å®éªå®¤ï¼åªé
ç½®äºå°ç¹ |
| | | if (clickNodeVal.parent.label === 'å
¶ä»') { |
| | | this.laboratoryNameIsNull = true |
| | | } else { |
| | | this.entity.laboratoryName = clickNodeVal.parent.label |
| | | } |
| | | this.entity.storagePoint = clickNodeVal.label |
| | | } |
| | | this.getAllDevice() |
| | | } |
| | | }, |
| | | // æ°å¢ |
| | | addFile() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | if (this.tableDataIndex !== undefined) { |
| | | this.$set(this.documentTableData, this.tableDataIndex, this.form) |
| | | this.dialogVisible1 = false; |
| | | this.$message.success('ä¿®æ¹æå'); |
| | | console.log('this.documentTableData---edit', this.documentTableData[this.tableDataIndex]) |
| | | } else { |
| | | this.documentTableData.push(this.form); |
| | | this.dialogVisible1 = false; |
| | | this.$message.success('æ·»å æå'); |
| | | } |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | openAddDia() { |
| | | this.dialogVisible1 = true |
| | | this.tableDataIndex = undefined; |
| | | this.form = {} |
| | | this.form.deviceName = this.clickNodeVal.label |
| | | this.onDeviceNameChange() |
| | | this.fileList = [] |
| | | |
| | | }, |
| | | editFun(row, index) { |
| | | this.form = { ...row } |
| | | this.tableDataIndex = index; |
| | | console.log('this.tableDataIndex', this.tableDataIndex) |
| | | // åæ¾å表 |
| | | if (this.form.fileSystemName) { |
| | | this.fileList.push({ name: this.form.fileName }) |
| | | } |
| | | this.dialogVisible1 = true |
| | | }, |
| | | closeDia() { |
| | | this.dialogVisible1 = false |
| | | this.$refs['form'].resetFields() |
| | | this.fileList = [] |
| | | }, |
| | | handleSelectionChange(selected) { |
| | | this.selectedRow = selected |
| | | }, |
| | | async delFile() { |
| | | if (this.selectedRow.length === 0) { |
| | | this.$message.error('è¯·éæ©è¦å é¤çé项'); |
| | | return; |
| | | } |
| | | // å é¤ä¿åå¥½çæ°æ® |
| | | let ids = this.selectedRow |
| | | .filter(item => item.id !== undefined) |
| | | .map(item => item.id).join(','); |
| | | //æé误 |
| | | 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) |
| | | } |
| | | this.$message.success({ |
| | | message: 'å 餿å', |
| | | type: 'success' |
| | | }); |
| | | } |
| | | }, |
| | | onSuccess(response, file, fileList) { |
| | | this.form.fileName = file.name; |
| | | this.form.fileSystemName = response.data; |
| | | }, |
| | | onSuccess1(response, file, fileList) { |
| | | this.instructionForm.fileName = file.name; |
| | | this.instructionForm.fileSystemName = response.data; |
| | | }, |
| | | onError(error, file, fileList) { |
| | | this.$message.error('ä¸ä¼ 失败:', error, file, fileList); |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | this.form.fileName = '' |
| | | this.form.fileSystemName = '' |
| | | }, |
| | | handleRemove1(file, fileList) { |
| | | this.form.fileName = '' |
| | | this.form.fileSystemName = '' |
| | | }, |
| | | beforeRemove(file) { |
| | | return this.$confirm(`ç¡®å®ç§»é¤ ${file.name}ï¼`) |
| | | }, |
| | | handleExceed(files, fileList) { |
| | | this.$message.warning(`å½åéå¶éæ© 1 个æä»¶ï¼æ¬æ¬¡éæ©äº ${files.length} 个æä»¶ã`); |
| | | }, |
| | | getList() { |
| | | pageByPageQueryOfHomeworkInstructions({ ...this.search }).then(res => { |
| | | if (res.code == 200) { |
| | | this.tableData = res.data.records; |
| | | this.search.total = res.data.total |
| | | } |
| | | }) |
| | | }, |
| | | getAllDevice() { |
| | | selectDeviceParameter({ laboratoryNameIsNull: this.laboratoryNameIsNull }).then(res => { |
| | | if (res.code == 200) { |
| | | this.devices = res.data.records; |
| | | this.updateDeviceNameOptions(); |
| | | } |
| | | }) |
| | | }, |
| | | // æ´æ°è®¾å¤åç§°ä¸ææ¡çé项 |
| | | updateDeviceNameOptions() { |
| | | this.deviceNameOption = this.devices.map(device => ({ |
| | | value: device.deviceName, |
| | | label: device.deviceName |
| | | })); |
| | | }, |
| | | // 设å¤åç§°æ¹åæ¶è§¦å |
| | | onDeviceNameChange() { |
| | | // æ ¹æ®éä¸ç设å¤åç§°ï¼æ´æ°ç®¡çç¼å·ä¸ææ¡çé项 |
| | | const selectedDevice = this.devices.find(device => device.deviceName === this.form.deviceName); |
| | | if (selectedDevice) { |
| | | this.form.deviceNumber = selectedDevice.managementNumber; |
| | | this.form.deviceModel = selectedDevice.specificationModel; |
| | | this.form.deviceId = selectedDevice.id |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | action() { |
| | | return this.javaApi + '/personBasicInfo/saveCNASFile' |
| | | } |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | h4 { |
| | | font-weight: 400; |
| | | font-size: 16px; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | margin: 10px 0; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- 设å¤è¿è¡æ»è§ --> |
| | | <template> |
| | | <div> |
| | | <div class="page"> |
| | | <echart-module id="'page-left'" :config="chartConfig" :datas="chartData" class="page-left"></echart-module> |
| | | <div class="page-right"> |
| | | <div class="form-item"> |
| | | <label>å¯ç¨æ¶é¿(å¹´)</label> |
| | | <span>{{deviceData.usedYears}}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æ
鿬¡æ°</label> |
| | | <span>{{deviceData.faultCount}}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æè¿æ
鿥æ</label> |
| | | <span>{{ deviceData.faultDate }}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æè¿æ ¡åæ¥æ</label> |
| | | <span>{{deviceData.lastCalibrationDate }}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>䏿¬¡æ ¡åæ¥æ</label> |
| | | <span>{{deviceData.nextCalibrationDate}}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æ ¡åæ»ç»è®º</label> |
| | | <span :class="formatColorStyle(deviceData.calibrateStatus)">{{ deviceData.calibrateStatus }}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æè¿æ ¸æ¥æ¥æ</label> |
| | | <span>{{deviceData.lastExamineDate}}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>䏿¬¡æ ¸æ¥æ¥æ</label> |
| | | <span>{{deviceData.nextExamineDate}}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æ ¸æ¥æ»ç»è®º</label> |
| | | <span :class="formatColorStyle(deviceData.examineStatus)">{{deviceData.examineStatus}}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>设å¤è¿è¡ç¶æ</label> |
| | | <span :class="formatColorStyle(deviceData.deviceStatus)">{{deviceData.deviceStatus}}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æè¿ç»´æ¤æ¥æ</label> |
| | | <span>{{ deviceData.maintenanceDate }}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>䏿¬¡ç»´æ¤æ¥æ</label> |
| | | <span>{{ deviceData.nextMaintenanceDate }}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>ç»´æ¤ç±»å</label> |
| | | <span>{{ deviceData.maintenanceType }}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æµé项ç®</label> |
| | | <span>{{ deviceData.insProduct }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import EchartModule from '@/components/Echart/echart.vue' |
| | | import {device} from "@/api/cnas/resourceDemand/device"; |
| | | |
| | | export default { |
| | | components: { EchartModule }, |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | chartConfig: { |
| | | height: '', |
| | | isLoading: true, |
| | | type: 'gauge' |
| | | }, |
| | | chartData: { |
| | | formatter: "å·²è¿æ ¡åæ¥æç¾åæ¯: {c}%", |
| | | color: [ |
| | | [0.3, '#21a700'], |
| | | [0.7, '#0066ff'], |
| | | [1, '#d80000'] |
| | | ], |
| | | value: 0, |
| | | }, |
| | | form: { |
| | | value1: '' |
| | | }, |
| | | formData: { |
| | | usedAge: 12 |
| | | }, |
| | | //è®¾å¤æ°æ®æ¶é |
| | | deviceData: { |
| | | |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | //è·åè®¾å¤æ
éçä¿¡æ¯ |
| | | this.getDeviceInfo(this.clickNodeVal.value); |
| | | }, |
| | | methods: { |
| | | formatColorStyle(status) { |
| | | if (status == null || status == "" || status == undefined) { |
| | | return "" |
| | | } |
| | | let styleStr = '' |
| | | switch (status) { |
| | | case "åæ ¼": |
| | | styleStr = 'success' |
| | | break; |
| | | case "ä¸åæ ¼": |
| | | styleStr = 'failed' |
| | | break; |
| | | case "å
¶ä»": |
| | | styleStr = 'other' |
| | | break; |
| | | case "æ£å¸¸": |
| | | styleStr = 'success' |
| | | break; |
| | | case "ç»´ä¿®": |
| | | styleStr = 'other' |
| | | break; |
| | | case "åç¨": |
| | | styleStr = 'stop' |
| | | break; |
| | | case "æ¥åº": |
| | | styleStr = 'failed' |
| | | break; |
| | | } |
| | | return styleStr; |
| | | }, |
| | | //è·å设å¤è¿è¡æ»è§ä¿¡æ¯ |
| | | getDeviceInfo(deviceId) { |
| | | device({deviceId: deviceId}).then(res => { |
| | | if (res.code == 200) { |
| | | this.deviceData = res.data |
| | | this.chartData.value = res.data.progress |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | // æ¯å¦åå¨valueï¼åå¨value代表为ä¸çº§ |
| | | if (this.clickNodeVal.value) { |
| | | this.getDeviceInfo(newVal.value) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .page { |
| | | width: 100%; |
| | | height: 100vh; |
| | | display: flex; |
| | | } |
| | | |
| | | .page-left { |
| | | width: 420px; |
| | | height: 420px; |
| | | margin-top: 40px; |
| | | margin-right: 40px; |
| | | } |
| | | |
| | | .page-right { |
| | | flex: 1; |
| | | height: calc(100% - 200px); |
| | | overflow: scroll; |
| | | /* background: red; */ |
| | | } |
| | | |
| | | .form-item { |
| | | line-height: 42px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .page-right label { |
| | | color: #999; |
| | | width: 110px; |
| | | display: inline-block; |
| | | text-align: right; |
| | | margin-right: 20px; |
| | | } |
| | | |
| | | .el-radio__input.is-disabled+span.el-radio__label { |
| | | color: #606266 !important; |
| | | } |
| | | |
| | | .success { |
| | | color: #21a700 |
| | | } |
| | | |
| | | .failed { |
| | | color: #d80000 |
| | | } |
| | | |
| | | .other { |
| | | color: #e8a849; |
| | | } |
| | | |
| | | .stop { |
| | | color: #909399; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- 使ç¨è®°å½ --> |
| | | <template> |
| | | <div> |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æµç¨ç¼å·ï¼</div> |
| | | <el-input v-model="search.deviceNumber" clearable placeholder="请è¾å
¥" size="small" style="width: 70%;" |
| | | @keyup.enter.native="getTableList(clickNodeVal.value)"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="padding-left: 30px;"> |
| | | <el-button size="small" @click="resetSearch">é ç½®</el-button> |
| | | <el-button size="small" type="primary" @click="getTableList(clickNodeVal.value)">æ¥ è¯¢</el-button> |
| | | </div> |
| | | <div class="btns"> |
| | | <el-button size="small" type="primary" @click="dialogVisible = true, openAdd()">æ° å»º</el-button> |
| | | <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">导 åº</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="tables" style="margin-top: 16px;"> |
| | | <el-table ref="Recordtable" :data="formParamList" 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="180" prop="deviceNumber" /> |
| | | <el-table-column label="设å¤åç§°" min-width="150" prop="deviceName" /> |
| | | <el-table-column label="管çç¼å·" min-width="150" prop="managementNumber" /> |
| | | <el-table-column label="温度(°C)" min-width="120" prop="temperature" /> |
| | | <el-table-column label="湿度(%RH)" min-width="120" prop="humidity" /> |
| | | <el-table-column label="使ç¨å" min-width="120" prop="useBefore"> |
| | | <template v-slot="scope"> |
| | | {{ scope.row.useBefore === 1 ? 'æ£å¸¸' : '䏿£å¸¸' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="使ç¨å" min-width="120" prop="useAfter"> |
| | | <template v-slot="scope"> |
| | | {{ scope.row.useAfter === 1 ? 'æ£å¸¸' : '䏿£å¸¸' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å¼å¸¸æ
åµ" min-width="120" prop="abnormal" /> |
| | | <el-table-column label="使ç¨å¼å§æ¥æ" min-width="150" prop="useStartDate" /> |
| | | <el-table-column label="使ç¨ç»ææ¥æ" min-width="150" prop="useEndDate" /> |
| | | <el-table-column label="使ç¨äºº" min-width="120" prop="usePerson" /> |
| | | <el-table-column label="夿³¨" min-width="120" prop="remark" /> |
| | | <!-- æä½æé® --> |
| | | <el-table-column fixed="right" label="æä½" width="130"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="small" type="text" @click="showDetailsDialog(scope.row)">æ¥ç详æ
</el-button> |
| | | <el-button size="small" type="text" @click="handleDeleteClick(scope.$index, scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange"> |
| | | </el-pagination> |
| | | </div> |
| | | <el-dialog :visible.sync="dialogVisible" title="仪å¨è®¾å¤ä½¿ç¨è®°å½è¡¨" top="5vh" width="55%"> |
| | | <el-form ref="form" :model="form" label-width="130px"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æ ·åç¼å·:"> |
| | | <el-input v-model="form.deviceNumber" disabled size="small" style="width: 100%;"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设å¤åç§°:" required> |
| | | <el-input v-model="form.deviceName" :disabled="true" size="small" style="width: 100%;"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="管çç¼å·:" required> |
| | | <el-input v-model="form.managementNumber" :disabled="true" size="small" style="width: 100%;"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: true, message: '请è¾å
¥æ¸©åº¦(°C)', trigger: 'blur' }]" label="温度(°C):" |
| | | prop="temperature"> |
| | | <el-input v-model="form.temperature" :disabled="isShow" size="small" style="width: 100%;"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: true, message: '请è¾å
¥æ¹¿åº¦(%RH)', trigger: 'blur' }]" label="湿度(%RH):" |
| | | prop="humidity"> |
| | | <el-input v-model="form.humidity" :disabled="isShow" size="small" style="width: 100%;"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: true, message: 'è¯·éæ©ä½¿ç¨å', trigger: 'change' }]" label="使ç¨å:" |
| | | prop="useBefore"> |
| | | <el-radio-group v-model="form.useBefore" :disabled="isShow"> |
| | | <el-radio :label="1">æ£å¸¸</el-radio> |
| | | <el-radio :label="0">䏿£å¸¸</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: true, message: 'è¯·éæ©ä½¿ç¨å', trigger: 'change' }]" label="使ç¨å:" |
| | | prop="useAfter"> |
| | | <el-radio-group v-model="form.useAfter" :disabled="isShow"> |
| | | <el-radio :label="1">æ£å¸¸</el-radio> |
| | | <el-radio :label="0">䏿£å¸¸</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col v-if="form.useAfter === 0" :span="24"> |
| | | <el-form-item :rules="[{ required: form.useAfter === 0, message: '请è¾å
¥å¼å¸¸æ
åµ', trigger: 'blur' }]" label="å¼å¸¸æ
åµ:" |
| | | prop="abnormal"> |
| | | <el-input v-model="form.abnormal" :disabled="isShow" size="small" style="width: 100%;" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: true, message: '请è¾å
¥ä½¿ç¨æ¥æ', trigger: 'blur' }]" label="ä½¿ç¨æ¥æ:" |
| | | prop="useDateList"> |
| | | |
| | | <el-date-picker |
| | | v-model="form.useDateList" |
| | | :disabled="isShow" |
| | | value-format="yyyy-MM-dd" |
| | | type="daterange" |
| | | range-separator="è³" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ"> |
| | | </el-date-picker> |
| | | <!-- <el-date-picker |
| | | v-model="form.useDateList" :disabled="isShow" end-placeholder="ç»ææ¥æ" format="yyyy-MM-dd HH:mm:ss" |
| | | size="small" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | style="width:100%" |
| | | type="datetimerange" |
| | | value-format="yyyy-MM-dd HH:mm:ss"> |
| | | </el-date-picker> --> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: true, message: '请è¾å
¥ä½¿ç¨äºº', trigger: 'change' }]" label="使ç¨äºº:" |
| | | prop="usePerson"> |
| | | <el-input v-model="form.usePerson" :disabled="isShow" size="small" style="width:100%"></el-input> |
| | | <!-- <el-select v-model="form.usePerson" placeholder="è¯·éæ©" :disabled="isShow" size="small" style="width:100%"> |
| | | <el-option v-for="item in responsiblePersonList" :key="item.name" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> --> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿³¨:"> |
| | | <el-input v-model="form.remark" :disabled="isShow" type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button v-if="!isShow" @click="dialogVisible = false">å æ¶</el-button> |
| | | <el-button v-if="!isShow" type="primary" @click="saveRecord">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { |
| | | deviceRecordPage, |
| | | exportUseRecord, |
| | | selectDeviceByCode, |
| | | saveDeviceRecord, |
| | | updateDeviceRecord, |
| | | deleteDeviceRecord, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/system/user"; |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | }, |
| | | // 夿æ¯å¦æ¯å¤é¨å离 |
| | | isMenuList: { |
| | | type: Number, |
| | | default: 0 |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | search: { |
| | | size: 20, |
| | | current: 1, |
| | | total: 0, |
| | | sampleCode: '', |
| | | managementNumber: '' |
| | | }, |
| | | responsiblePersonList: {}, |
| | | isShow: false, |
| | | outLoading: false, |
| | | ratifyDialog: false, |
| | | exportDate: '', |
| | | userList: [], |
| | | form: { |
| | | // deviceId:'', |
| | | processNumber: '', |
| | | deviceName: '', |
| | | managementNumber: '', |
| | | //温度 |
| | | temperature: '', |
| | | //湿度 |
| | | humidity: '', |
| | | //使ç¨å |
| | | useBefore: 1, |
| | | //使ç¨å |
| | | useAfter: 1, |
| | | //å¼å¸¸æ
åµ |
| | | abnormal: '', |
| | | useDateList: [], |
| | | //ä½¿ç¨æ¥æ |
| | | useStartDate: null, |
| | | useEndDate: null, |
| | | //使ç¨äºº |
| | | usePerson: '', |
| | | usePersonId: '', |
| | | //夿³¨ |
| | | remark: '', |
| | | }, |
| | | dialogVisible: false, |
| | | operationType: '', |
| | | formParamList: [], |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getTableList(this.clickNodeVal.value); |
| | | }, |
| | | methods: { |
| | | handleSizeChange(val) { |
| | | this.search.size = val |
| | | this.getTableList(this.clickNodeVal.value); |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.search.current = val |
| | | this.getTableList(this.clickNodeVal.value); |
| | | }, |
| | | resetSearch() { |
| | | this.search = { |
| | | size: 20, |
| | | current: 1, |
| | | total: 0, |
| | | sampleCode: '', |
| | | managementNumber: '' |
| | | } |
| | | this.getTableList(this.clickNodeVal.value); |
| | | }, |
| | | async getTableList(deviceId) { |
| | | if (deviceId === undefined) { |
| | | deviceId = '' |
| | | } |
| | | await deviceRecordPage({ |
| | | deviceId: deviceId, |
| | | ...this.search |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | this.formParamList = res.data.records |
| | | this.search.total = res.data.total |
| | | } |
| | | }) |
| | | }, |
| | | // æå¼å¯¼åºå¼¹æ¡éæ©ç¼å¶äººãæ¹å人 |
| | | openHandleOut() { |
| | | this.ratifyDialog = true |
| | | }, |
| | | //å¯¼åº |
| | | handleDown() { |
| | | this.outLoading = true |
| | | exportUseRecord({ |
| | | deviceId: this.clickNodeVal.value, |
| | | exportDate: this.exportDate |
| | | }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设å¤ä½¿ç¨è®°å½.doc') |
| | | }) |
| | | }, |
| | | //æ°å»º |
| | | openAdd() { |
| | | this.operationType = 'add' |
| | | this.getUserList() |
| | | selectDeviceByCode({ id: this.clickNodeVal.value }).then(res => { |
| | | this.form.deviceName = res.data.deviceName |
| | | this.form.managementNumber = res.data.managementNumber |
| | | this.$nextTick(() => { |
| | | this.$refs['form'].clearValidate() |
| | | }) |
| | | }); |
| | | }, |
| | | usePersonName(value) { |
| | | const index = this.userList.findIndex(item => item.id === value) |
| | | if (index > -1) { |
| | | this.form.usePerson = this.userList[index].name |
| | | } |
| | | }, |
| | | //确认添å è®°å½ |
| | | saveRecord() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.form.useStartDate = this.form.useDateList[0] |
| | | this.form.useEndDate = this.form.useDateList[1] |
| | | this.form.deviceId = this.clickNodeVal.value |
| | | if (this.operationType === 'add') { |
| | | saveDeviceRecord(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.getTableList(this.clickNodeVal.value) |
| | | this.dialogVisible = false |
| | | } |
| | | }) |
| | | this.dialogVisible = false; |
| | | } else { |
| | | updateDeviceRecord(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.getTableList(this.clickNodeVal.value) |
| | | 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 = '' |
| | | } |
| | | if (row.useEndDate === null) { |
| | | row.useEndDate = '' |
| | | } |
| | | list.push(row.useStartDate) |
| | | list.push(row.useEndDate) |
| | | this.$set(this.form, 'useDateList', list) |
| | | }, |
| | | handleDeleteClick(index, row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteDeviceRecord({ id: row.id }).then(res => { |
| | | this.formParamList.splice(index, 1); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'å 餿å!' |
| | | }); |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | getUserList() { |
| | | selectUserCondition().then(res => { |
| | | this.userList = res.data |
| | | }) |
| | | }, |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | if (newVal.value) { |
| | | this.getTableList(newVal.value); |
| | | } |
| | | }, |
| | | dialogVisible(newVal) { |
| | | if (newVal === false) { |
| | | this.form = { |
| | | // deviceId:'', |
| | | sampleCode: '', |
| | | deviceName: '', |
| | | managementNumber: '', |
| | | //温度 |
| | | temperature: '', |
| | | //湿度 |
| | | humidity: '', |
| | | //使ç¨å |
| | | useBefore: 1, |
| | | //使ç¨å |
| | | useAfter: 1, |
| | | //å¼å¸¸æ
åµ |
| | | abnormal: '', |
| | | //ä½¿ç¨æ¥æ |
| | | useDateList: [], |
| | | //使ç¨äºº |
| | | usePersonId: '', |
| | | //夿³¨ |
| | | remark: '', |
| | | } |
| | | this.$refs.form.clearValidate() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .tables { |
| | | width: 100%; |
| | | height: calc(100vh - 15em); |
| | | } |
| | | |
| | | .el-from { |
| | | max-width: 400px; |
| | | margin: 0 auto; |
| | | } |
| | | |
| | | .form-row { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .el-input { |
| | | width: calc(100% - 120px); |
| | | /* ç¡®ä¿è¾å
¥æ¡å®½åº¦ä¸è´ */ |
| | | } |
| | | |
| | | .form-row .el-form-item { |
| | | flex: 1; |
| | | /* æ¯ä¸ªè¡¨åé¡¹å æ®ç¸åæ¯ä¾çç©ºé´ */ |
| | | margin-right: 100px; |
| | | /* å¯éï¼ä¸ºå³ä¾§å
ç´ æ·»å é´è· */ |
| | | } |
| | | |
| | | /* ç§»é¤æåä¸ä¸ªå
ç´ çå³è¾¹è· */ |
| | | .form-row .el-form-item:last-child { |
| | | margin-right: 0; |
| | | |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | margin-top: 10px; |
| | | display: flex; |
| | | align-items: center; |
| | | position: relative; |
| | | } |
| | | |
| | | .search_thing { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 40px; |
| | | |
| | | } |
| | | |
| | | .search_label { |
| | | width: 140px; |
| | | font-size: 14px; |
| | | text-align: right; |
| | | margin-right: 10px; |
| | | } |
| | | |
| | | .btns { |
| | | position: absolute; |
| | | right: 0px; |
| | | top: 50%; |
| | | transform: translate(0, -50%); |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- èµæºé¢å® --> |
| | | <template> |
| | | <div class="role_manage"> |
| | | <el-row class="title"> |
| | | <el-col :span="8" style="text-align: left;">é¢å®æ»è§</el-col> |
| | | <el-col :span="16" style="text-align: right;padding-bottom:10px"> |
| | | <el-date-picker |
| | | v-model="startTime" |
| | | format="yyyy-MM-dd" |
| | | placeholder="éæ©èµ·å§æ¥æ" |
| | | size="mini" |
| | | type="date" |
| | | value-format="yyyy-MM-dd"/> |
| | | è³ |
| | | <el-date-picker |
| | | v-model="endTime" |
| | | format="yyyy-MM-dd" |
| | | placeholder="éæ©ç»ææ¥æ" |
| | | size="mini" |
| | | type="date" |
| | | value-format="yyyy-MM-dd"/> |
| | | <el-button size="mini" type="primary" @click="ValidateAndQuery">æ¥ è¯¢</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="table-container"> |
| | | <el-table v-loading="tableLoading" :data="tableData" border class="scrollable-table" style="width: 100%"> |
| | | <el-table-column label="åºå·" |
| | | type="index" |
| | | width="60"> |
| | | </el-table-column> |
| | | <el-table-column label="设å¤" min-width="60" prop="deviceName"/> |
| | | <el-table-column label="æ¶é´" min-width="60" prop="time"/> |
| | | <el-table-column v-for="date in dates" :key="date" :label="date"> |
| | | <template #default="{ row }"> |
| | | <el-button v-if="!row[date]" size="mini" type="primary" @click="openModal(date, row)"> |
| | | {{ getDisplayText(row, date) }} |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="showModal" title="é¢å®ä¿¡æ¯" |
| | | top="5vh" width="70%"> |
| | | <h4> |
| | | <el-button v-if="isBeforeDate()" size="small" @click="cancelReservation(selectedRow)">åæ¶é¢å®</el-button> |
| | | <el-button v-if="isBeforeDate()" size="small" type="primary" @click="openAdd()">æ°å»ºé¢å®</el-button> |
| | | </h4> |
| | | <el-table ref="table" :data="tableData2" style="width: 100%" tooltip-effect="dark" |
| | | @close="ValidateAndQuery" |
| | | @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55%"> |
| | | </el-table-column> |
| | | <el-table-column label="åºå·" width="120"> |
| | | <template #default="{ row, $index }"> |
| | | <!-- ä½¿ç¨ $index æ¥è·åè¡ç´¢å¼ï¼é常ä»0å¼å§ï¼æä»¥+1以符å常è§åºå·ä¹ æ¯ --> |
| | | {{ $index + 1 }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="é¢å®ç¼å·" prop="deviceNumber" width="120"> |
| | | </el-table-column> |
| | | <el-table-column label="客æ·åç§°" prop="customerName" show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column label="è系人" prop="linkPerson" show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column label="èç³»çµè¯" prop="phone" show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column label="é¢å®è¯´æ" prop="reservationSpecification" show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column label="å建人" prop="name" show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column label="å建æ¶é´" prop="createDate" show-overflow-tooltip> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="addVisiable" title="æ°å»ºé¢å®" top="5vh" width="40%"> |
| | | <el-form ref="addReservationForm" :model="addReservation" :rules="rules" label-width="90px"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="é¢å®è®¾å¤:"> |
| | | <el-input v-model="addReservation.deviceName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="客æ·åç§°:"> |
| | | <el-input v-model="addReservation.customerName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="é¢å®æ¶é´:"> |
| | | <el-input v-model="addReservation.reservationTime"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æµç¨ç¼å·:"> |
| | | <el-input v-model="addReservation.deviceNumber"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è系人:"> |
| | | <el-input v-model="addReservation.linkPerson"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="èç³»çµè¯:" prop="phone"> |
| | | <el-input v-model="addReservation.phone"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="é¢å®è¯´æ:" required> |
| | | <el-input v-model="addReservation.reservationSpecification" type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="addVisiable = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="addRecord">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | reservationDelete, |
| | | reservationSave, |
| | | reservationSelectDevice, |
| | | selectReservationParameterPage |
| | | } from "@/api/cnas/resourceDemand/device"; |
| | | |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | |
| | | return { |
| | | timeSlots: ['09:00-12:00', '13:00-18:00', '18:00-22:00'], |
| | | dates: [], |
| | | showModal: false, |
| | | selectedDate: '', |
| | | selectedTime: '', |
| | | selectedDevice: '', |
| | | tableData: [], |
| | | tableLoading: false, |
| | | tableData2: [], |
| | | selectedReservationId: null, // ç¨äºåå¨éä¸çID |
| | | selectedRow: null, |
| | | addVisiable: false, |
| | | laboratoryNameIsNull: false, |
| | | currentPage: 1, // å½å页 |
| | | pageSize: -1, // ä¸é¡µ16æ¡ |
| | | startTime: '', |
| | | endTime: '', |
| | | entity: { |
| | | deviceName: null, |
| | | laboratoryName: '', |
| | | storagePoint: '', |
| | | }, |
| | | addReservation: { |
| | | deviceName: '', |
| | | reservationTime: '', |
| | | specificTime: '', |
| | | customerName: '', |
| | | deviceNumber: '', |
| | | linkPerson: '', |
| | | phone: '', |
| | | reservationSpecification: '' |
| | | }, |
| | | total: '', |
| | | componentData: { |
| | | entity: { |
| | | largeCategory: null, |
| | | orderBy: { |
| | | field: 'id', |
| | | order: 'asc' |
| | | } |
| | | }, |
| | | }, |
| | | yuyue: null, |
| | | yuyuetime: '', |
| | | rules: { |
| | | phone: [ |
| | | { |
| | | required: true, message: '请è¾å
¥èç³»çµè¯', |
| | | trigger: 'blur' |
| | | }, |
| | | { |
| | | pattern: /^1[3456789]\d{9}$/, |
| | | message: '请è¾å
¥æ£ç¡®çææºå·ç ', |
| | | trigger: ['blur', 'change'] |
| | | } |
| | | ] |
| | | }, |
| | | appointment: '' |
| | | } |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | this.clickSidebar(newVal) |
| | | } |
| | | }, |
| | | |
| | | created() { |
| | | this.clickSidebar(this.clickNodeVal) |
| | | this.initDate(); |
| | | }, |
| | | mounted() { |
| | | this.getStartTimeAndEndTime(); |
| | | |
| | | }, |
| | | methods: { |
| | | isBeforeDate() { |
| | | let currentDate = this.$moment().format('YYYY-MM-DD') |
| | | let currentTime = this.$moment().format('HH') |
| | | const appointment = this.appointment && this.appointment.split('-') |
| | | let appointment0 = '' |
| | | let appointment1 = '' |
| | | if (appointment !== '') { |
| | | appointment0 = appointment[0].slice(0, 2) |
| | | appointment1 = appointment[1].slice(0, 2) |
| | | } |
| | | if (currentDate < this.yuyuetime) { |
| | | // æªæ¥çæ¥æï¼ä¸å®è½æ°å¢é¢çº¦ |
| | | return true |
| | | } else if (currentDate === this.yuyuetime) { |
| | | // å½å¤©çæ¥æï¼å·²ç»è¿äºçæ¶é´ä¸å¯åæ¶åæ°å¢ |
| | | if (currentTime < appointment1) { |
| | | return true |
| | | } else if (currentTime > appointment1) { |
| | | return false |
| | | } |
| | | } |
| | | }, |
| | | getDisplayText(row, date) { |
| | | if (!row || row.dateList === null || row.dateList === undefined || row.dateList === "") { |
| | | return 'é¢çº¦'; |
| | | } |
| | | var dateLst = row.dateList |
| | | for (const dateLstElement of dateLst) { |
| | | if (dateLstElement.date === date) { |
| | | if (dateLstElement.value === 0) { |
| | | return 'é¢çº¦'; |
| | | } else { |
| | | return dateLstElement.value; |
| | | } |
| | | } |
| | | } |
| | | return 'é¢çº¦'; |
| | | }, |
| | | |
| | | ValidateAndQuery() { |
| | | if (!this.startTime || !this.endTime) { |
| | | this.$message.error('è¯·éæ©æ¥æèå´'); |
| | | return; |
| | | } |
| | | if ((new Date(this.endTime) - new Date(this.startTime)) / (1000 * 60 * 60 * 24) >= 10) { |
| | | this.$message.error('åªè½é¢çº¦10天以å
'); |
| | | return; |
| | | } |
| | | if (new Date(this.startTime) > new Date(this.endTime)) { |
| | | this.$message.error('å¼å§æ¥æä¸è½å¤§äºç»ææ¥æ'); |
| | | return; |
| | | } |
| | | this.query(); |
| | | }, |
| | | initDate() { |
| | | if (this.startTime == '' || this.endTime == '' || this.startTime == null || this.endTime == null) { |
| | | const daysAdd = 3; |
| | | const now = new Date(); |
| | | this.startTime = now.getFullYear() + "-" + |
| | | String(now.getMonth() + 1).padStart(2, '0') + "-" + |
| | | String(now.getDate()).padStart(2, '0'); |
| | | let endTime = new Date(now); |
| | | endTime.setDate(now.getDate() + daysAdd); |
| | | this.endTime = endTime.getFullYear() + "-" + |
| | | String(endTime.getMonth() + 1).padStart(2, '0') + "-" + |
| | | String(endTime.getDate()).padStart(2, '0'); |
| | | const start = new Date(this.startTime); |
| | | const end = new Date(this.endTime); |
| | | const tempDates = []; |
| | | while (start <= end) { |
| | | const year = start.getFullYear(); |
| | | const month = String(start.getMonth() + 1).padStart(2, '0'); // æä»½ä»0å¼å§ï¼æä»¥å 1ï¼å¹¶ä½¿ç¨padStartè¡¥0 |
| | | const day = String(start.getDate()).padStart(2, '0'); // 使ç¨padStartè¡¥0 |
| | | tempDates.push(`${year}-${month}-${day}`); |
| | | start.setDate(start.getDate() + 1); |
| | | } |
| | | this.dates = tempDates; |
| | | this.getStartTimeAndEndTime(); |
| | | } |
| | | }, |
| | | query() { |
| | | if (this.startTime && this.endTime) { |
| | | const start = new Date(this.startTime); |
| | | const end = new Date(this.endTime); |
| | | const tempDates = []; |
| | | while (start <= end) { |
| | | const year = start.getFullYear(); |
| | | const month = String(start.getMonth() + 1).padStart(2, '0'); // æä»½ä»0å¼å§ï¼æä»¥å 1ï¼å¹¶ä½¿ç¨padStartè¡¥0 |
| | | const day = String(start.getDate()).padStart(2, '0'); // 使ç¨padStartè¡¥0 |
| | | tempDates.push(`${year}-${month}-${day}`); |
| | | start.setDate(start.getDate() + 1); |
| | | } |
| | | this.dates = tempDates; |
| | | this.getStartTimeAndEndTime(); |
| | | } |
| | | }, |
| | | //æ¥è¯¢æ¶é´ |
| | | getStartTimeAndEndTime() { |
| | | //æ¥è¯¢é»è¾ |
| | | this.tableLoading = true; |
| | | reservationSelectDevice({ |
| | | current: this.currentPage, |
| | | size: this.pageSize, |
| | | ...this.entity, |
| | | laboratoryNameIsNull: this.laboratoryNameIsNull |
| | | }).then(res => { |
| | | this.tableLoading = false; |
| | | if (res.code === 200) { |
| | | this.tableData = res.data; |
| | | } |
| | | }).catch(err => { |
| | | this.tableLoading = false; |
| | | }) |
| | | }, |
| | | openModal(date, row) { |
| | | this.yuyue = row; |
| | | this.yuyuetime = date; |
| | | this.appointment = row.time |
| | | this.showModal = true; |
| | | this.getList(); |
| | | }, |
| | | openAdd() { |
| | | this.addVisiable = true; |
| | | this.addReservation.deviceId = this.yuyue.id; |
| | | // this.addReservation.deviceNumber = this.yuyue.deviceNumber; |
| | | this.addReservation.deviceName = this.yuyue.deviceName; |
| | | this.addReservation.reservationTime = this.yuyuetime + " " + this.yuyue.time; |
| | | this.addReservation.specificTime = this.yuyue.time; |
| | | this.addReservation.deviceNumber = 'TX-ABC-01' + Math.floor(Math.random() * 10 + 1); |
| | | }, |
| | | handleSelectionChange(selected) { |
| | | this.selectedRow = selected.length > 0 ? selected : null; |
| | | }, |
| | | async cancelReservation(selectedRow) { |
| | | if (!selectedRow || selectedRow.length == 0) { |
| | | this.$message.error('è¯·éæ©è¦å é¤çé¢çº¦'); |
| | | return; |
| | | } |
| | | let ids = selectedRow.map(item => item.id).join(','); |
| | | try { |
| | | const res = await reservationDelete({ids: ids}); |
| | | if (res.code === 200) { |
| | | this.$message.success({ |
| | | message: 'å 餿å', |
| | | type: 'success' |
| | | }); |
| | | this.getList(); |
| | | this.query(); |
| | | this.showModal = false; |
| | | } else { |
| | | this.$message.error({ |
| | | message: 'å é¤å¤±è´¥', |
| | | type: 'error' |
| | | }); |
| | | } |
| | | } catch (error) { |
| | | this.$message.error({ |
| | | message: 'å é¤è¿ç¨ä¸åçé误ï¼è¯·ç¨åéè¯', |
| | | type: 'error' |
| | | }); |
| | | } |
| | | }, |
| | | addRecord() { |
| | | this.$refs.addReservationForm.validate((valid) => { |
| | | if (valid) { |
| | | this.addReservation.reservationTime = this.yuyuetime; |
| | | reservationSave(this.addReservation).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿åæå') |
| | | this.addVisiable = false |
| | | this.getList(); |
| | | this.query(); |
| | | this.addReservation = {}; |
| | | } |
| | | }) |
| | | } else { |
| | | this.$message.error({message: 'è¯·æ£æ¥è¡¨å填忝妿£ç¡®', type: 'error'}); |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | getList() { |
| | | const params = { |
| | | selectReservationParameterPage: this.yuyue.id, |
| | | reservationTime: this.yuyuetime, |
| | | specificTime: this.yuyue.time, |
| | | } |
| | | selectReservationParameterPage(params).then(res => { |
| | | if (res.code == 200) { |
| | | this.tableData2 = res.data; |
| | | } |
| | | }) |
| | | }, |
| | | // ç¹å»ä¾§è¾¹æ å·æ° |
| | | clickSidebar(clickNodeVal) { |
| | | this.laboratoryNameIsNull = false |
| | | // æ¯å¦åå¨valueï¼åå¨value代表为ä¸çº§ |
| | | if (!clickNodeVal.value) { |
| | | this.finishLoding = false; |
| | | this.keyMap = {}; |
| | | this.currentPage = 1; |
| | | this.list = []; |
| | | this.entity.laboratoryName = null |
| | | this.entity.storagePoint = null |
| | | // çäº1代表为æ çä¸çº§ï¼label为é¨é¨ |
| | | if (clickNodeVal.label == 'å
¶ä»') { |
| | | this.laboratoryNameIsNull = true |
| | | this.getStartTimeAndEndTime(); |
| | | return |
| | | } |
| | | if (clickNodeVal.level == 1) { |
| | | this.entity.laboratoryName = clickNodeVal.label |
| | | // çäºäºçº§ãlabel为åå¨å°ç¹ |
| | | } else if (clickNodeVal.level == 2) { |
| | | // å
¶ä»è¡¨ç¤ºæ²¡æé
ç½®å®éªå®¤ï¼åªé
ç½®äºå°ç¹ |
| | | if (clickNodeVal.parent.label == 'å
¶ä»') { |
| | | this.laboratoryNameIsNull = true |
| | | } else { |
| | | this.entity.laboratoryName = clickNodeVal.parent.label |
| | | } |
| | | this.entity.storagePoint = clickNodeVal.label |
| | | } |
| | | this.getStartTimeAndEndTime(); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .table-container { |
| | | overflow: auto; |
| | | height: calc(100vh - 15em); |
| | | /* å¯ä»¥æ ¹æ®éè¦è°æ´é«åº¦ */ |
| | | } |
| | | |
| | | .scrollable-table { |
| | | max-height: 100%; |
| | | overflow-y: auto; |
| | | /* overflow-x: auto; */ |
| | | } |
| | | |
| | | h4 { |
| | | font-weight: 400; |
| | | font-size: 16px; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | margin: 10px 0; |
| | | } |
| | | |
| | | .form-row { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- 设å¤åç¨å¯ç¨ --> |
| | | <template> |
| | | <div> |
| | | <div class="search"> |
| | | <el-row :gutter="10" style="width: 100%;"> |
| | | <el-col :span="20" style="display: flex;flex-wrap: wrap;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æµç¨ç¼å·ï¼</div> |
| | | <div class="search_input"> |
| | | <el-input v-model="search.processNumber" clearable placeholder="请è¾å
¥" size="small" style="width: 100%" |
| | | @keyup.enter.native="getDeviceStatePage(clickNodeVal.value)"></el-input> |
| | | </div> |
| | | </div> |
| | | <div class="search_thing" style="padding-left: 20px;"> |
| | | <el-button size="small" @click="resetSearch">é ç½®</el-button> |
| | | <el-button size="small" type="primary" @click="getDeviceStatePage(clickNodeVal.value)">æ¥ è¯¢</el-button> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <div class="btns"> |
| | | <el-button size="small" type="primary" @click="dialogVisible = true">æ°å»º</el-button> |
| | | <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">导åºExcel</el-button> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div> |
| | | <el-table :data="tableDatalist" height="calc(100vh - 20em)" 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="processNumber"></el-table-column> |
| | | <el-table-column label="设å¤åç§°" min-width="180" prop="deviceName"></el-table-column> |
| | | <el-table-column label="管çç¼å·" min-width="150" prop="managementNumber"></el-table-column> |
| | | <el-table-column label="设å¤ç¶æ" min-width="130" prop="deviceStatus"> |
| | | <template #default="{ row }"> |
| | | {{ row.deviceStatus === '0scrap' ? 'æ¥åº' : row.deviceStatus === '1startUsing' ? 'å¯ç¨' : 'åç¨' }} |
| | | </template> |
| | | </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="130" prop="currentState"></el-table-column> |
| | | <el-table-column label="å½å责任人" min-width="180" prop="currentResponsible"></el-table-column> |
| | | <!-- æä½æé® --> |
| | | <el-table-column fixed="right" label="æä½" min-width="150"> |
| | | <template #default="{ row }"> |
| | | <el-button size="small" type="text" @click="handleViewClick(row)">æ¥ç</el-button> |
| | | <el-button size="small" type="text" @click="handleDownOne(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" @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange"> |
| | | </el-pagination> |
| | | </div> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible" title="è®¾å¤æ
åµ" |
| | | top="5vh" width="60%" @open="openRecordAcceptance"> |
| | | <el-steps :active="currentStep" align-center finish-status="success"> |
| | | <el-step v-for="(v, i) in steps" :key="i" :title="v" style="cursor:pointer" |
| | | @click.native="choiceStep(i)"></el-step> |
| | | </el-steps> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="130px"> |
| | | <div v-show="currentStepClick === 0"> |
| | | <el-card style="margin-top: 1em; height: 42vh; overflow-y: scroll;"> |
| | | <!-- å¡ç --> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æµç¨ç¼å·ï¼"> |
| | | <el-input v-model="form.processNumber" disabled size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="管çç¼å·ï¼"> |
| | | <el-input v-model="form.managementNumber" disabled size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <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.specificationModel" disabled size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: currentStep === 0, message: '请è¾å
¥é
ä»¶', trigger: 'blur' }]" label="é
ä»¶ï¼" |
| | | prop="accessoryPart"> |
| | | <el-input v-model="form.accessoryPart" :disabled="currentStep !== 0" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: currentStep === 0, message: 'è¯·éæ©è®¾å¤ç¶æ', trigger: 'change' }]" |
| | | label="è®¾å¤æ
åµï¼" prop="deviceStatus"> |
| | | <el-select v-model="form.deviceStatus" :disabled="currentStep !== 0" placeholder="è¯·éæ©" size="small" |
| | | style="width:100%"> |
| | | <el-option label="æ¥åº" value="0scrap"></el-option> |
| | | <el-option label="å¯ç¨" value="1startUsing"></el-option> |
| | | <el-option label="åç¨" value="2stopUsing"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: currentStep === 0, message: '请è¾å
¥åç¨å¯ç¨çç±', trigger: 'blur' }]" |
| | | label="åç¨å¯ç¨çç±ï¼" prop="reason"> |
| | | <el-input v-model="form.reason" :disabled="currentStep !== 0" :rows="3" size="small" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: currentStep === 0, message: 'è¯·éæ©ä¸ç¯è责任人', trigger: 'change' }]" |
| | | label="ä¸ç¯è责任人ï¼" prop="submitNextPesponsible"> |
| | | <el-select v-model="form.submitNextPesponsible" :disabled="currentStep !== 0" clearable filterable |
| | | placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" style="width: 100%"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.submitOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.submitDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div v-show="currentStepClick === 1"> |
| | | <el-card style="margin-top: 1em; height: 42vh; overflow-y: scroll;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="é¨é¨è´è´£äººæè§ï¼" prop="departmentReviewOpinion"> |
| | | <el-input v-model="form.departmentReviewOpinion" :disabled="currentStep !== 1" size="small" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: currentStep === 1, message: '请è¾å
¥ä¸ç¯è责任人', trigger: 'change' }]" |
| | | label="ä¸ç¯è责任人ï¼" prop="departmentNextPesponsible"> |
| | | <el-select v-model="form.departmentNextPesponsible" :disabled="currentStep !== 1" clearable filterable |
| | | placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" style="width: 100%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.departmentOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.departmentDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div v-show="currentStepClick === 2"> |
| | | <el-card style="margin-top: 1em; height: 42vh; overflow-y: scroll;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item :rules="[{ required: currentStep === 2, message: '请è¾å
¥è®¡é室æè§', trigger: 'blur' }]" |
| | | label="计é室æè§ï¼" prop="measuringRoomReviewOpinion"> |
| | | <el-input v-model="form.measuringRoomReviewOpinion" :disabled="currentStep !== 2" size="small" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: currentStep === 2, message: '请è¾å
¥ä¸ç¯è责任人', trigger: 'blur' }]" |
| | | label="ä¸ç¯è责任人ï¼" prop="measuringRoomNextPesponsible"> |
| | | <el-select v-model="form.measuringRoomNextPesponsible" :disabled="currentStep !== 2" clearable |
| | | filterable placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" style="width: 100%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.measuringRoomOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.measuringRoomDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div v-show="currentStepClick === 3"> |
| | | <el-card style="margin-top: 1em; height: 42vh; overflow-y: scroll;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item :rules="[{ required: currentStep === 3, message: '请è¾å
¥æ¹åæè§', trigger: 'blur' }]" |
| | | label="æ¹åæè§ï¼" prop="approvalOpinion"> |
| | | <el-input v-model="form.approvalOpinion" :disabled="currentStep !== 3" size="small" |
| | | type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :rules="[{ required: currentStep === 3, message: '请è¾å
¥ä¸ç¯èè´è´£äºº', trigger: 'change' }]" |
| | | label="ä¸ç¯è责任人ï¼" prop="approvalNextPesponsible"> |
| | | <el-select v-model="form.approvalNextPesponsible" :disabled="currentStep !== 3" clearable filterable |
| | | placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" style="width: 100%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.approvalOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.approvalDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button v-if="currentStep !== 0 && currentStep !== 4" :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')"> |
| | | {{ currentStep === 0 ? 'æäº¤' : 'éè¿' }} |
| | | </el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { |
| | | saveDeviceState, |
| | | selectDeviceByCode, |
| | | exportDeviceStatus, |
| | | deleteDeviceState, |
| | | deviceStateExport, |
| | | getDeviceStatePage, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/system/user"; |
| | | import { dateFormat } from '@/utils/date' |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["nickName"]), |
| | | }, |
| | | data() { |
| | | return { |
| | | outLoading: false, // 导åºloading |
| | | dialogVisible: false, |
| | | form: {}, |
| | | currentStep: 0, // æ¥éª¤æ¡æ¾ç¤ºç¬¬å æ¥ |
| | | currentStepClick: 0, // ç¹å»æ¥éª¤æ¡åå |
| | | steps: ['æäº¤', 'é¨é¨è´è´£äºº', '计é室', 'æ¹å人'], |
| | | responsibleOptions: [], // ä¸ç¯èè´è´£äºº |
| | | tableDatalist: [], // tableè¡¨æ ¼ |
| | | rules: { |
| | | quantity: [{ required: true, message: '请è¾å
¥æ°é', trigger: 'blur' }], |
| | | }, |
| | | search: { |
| | | size: 20, |
| | | current: 1, |
| | | total: 0, |
| | | processNumber: '' |
| | | }, |
| | | sumbitLoading1: false, |
| | | sumbitLoading2: false, |
| | | sumbitLoading3: false, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getDeviceStatePage(this.clickNodeVal.value) |
| | | }, |
| | | methods: { |
| | | // å页 |
| | | handleSizeChange(val) { |
| | | this.search.size = val |
| | | this.getDeviceStatePage(this.clickNodeVal.value) |
| | | }, |
| | | // å页 |
| | | handleCurrentChange(val) { |
| | | this.search.current = val |
| | | this.getDeviceStatePage(this.clickNodeVal.value) |
| | | }, |
| | | //æäº¤è¡¨å |
| | | async submitForm(saveState) { |
| | | let currentStepAction; |
| | | // 设置该æä½å¤ææ¯å¦ä¸ºæäº¤ï¼ä¿åï¼é©³åï¼éè¿ å¼å¯loding |
| | | switch (saveState) { |
| | | // æäº¤ï¼éè¿ |
| | | case '1submit': |
| | | currentStepAction = this.currentStep + 1 |
| | | this.sumbitLoading1 = true |
| | | break |
| | | // ä¿å |
| | | case '2save': |
| | | currentStepAction = this.currentStep |
| | | this.sumbitLoading2 = true |
| | | break |
| | | // 驳å |
| | | case '3reject': |
| | | currentStepAction = this.currentStep - 1 |
| | | this.sumbitLoading3 = true |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid === true || saveState !== '1submit') { |
| | | // ç»å½åç¯è设置åå»ºäººä¸æ¶é´ |
| | | const dateTime = dateFormat(new Date()) |
| | | // è·åå½åç¯èæä½äººä¸æ¥æ |
| | | switch (this.currentStep) { |
| | | case 0: |
| | | this.form.createUser = this.nickName |
| | | this.form.submitOperatingPersonnel = this.nickName |
| | | this.form.submitDate = dateTime |
| | | break |
| | | case 1: |
| | | this.form.departmentOperatingPersonnel = this.nickName |
| | | this.form.departmentDate = dateTime |
| | | break |
| | | case 2: |
| | | this.form.measuringRoomOperatingPersonnel = this.nickName |
| | | this.form.measuringRoomDate = dateTime |
| | | break |
| | | case 3: |
| | | this.form.approvalOperatingPersonnel = this.nickName |
| | | this.form.approvalDate = dateTime |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | // è·åå½åç¯èè´è´£äºº |
| | | switch (saveState === '3reject' ? this.currentStep - 1 : this.currentStep) { |
| | | case 0: |
| | | this.form.currentResponsible = this.form.submitOperatingPersonnel |
| | | break |
| | | case 1: |
| | | this.form.currentResponsible = this.form.departmentOperatingPersonnel |
| | | break |
| | | case 2: |
| | | this.form.currentResponsible = this.form.measuringRoomOperatingPersonnel |
| | | break |
| | | case 3: |
| | | this.form.currentResponsible = this.form.approvalOperatingPersonnel |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | // è·åå½åç¶æ |
| | | this.form.currentState = currentStepAction === 4 ? 'å
³é' : this.steps[currentStepAction] |
| | | this.form.deviceId = this.clickNodeVal.value |
| | | saveDeviceState(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æäº¤æå') |
| | | this.getDeviceStatePage(this.clickNodeVal.value) |
| | | this.dialogVisible = false |
| | | this.closeLoading() |
| | | } |
| | | this.closeLoading() |
| | | }) |
| | | } else { |
| | | let step = this.steps[this.currentStep] |
| | | this.$message.warning(step + ' æµç¨ä¸æå¿
填项æªå¡«ï¼'); |
| | | this.closeLoading() |
| | | } |
| | | }); |
| | | }, |
| | | closeLoading() { |
| | | this.sumbitLoading1 = false |
| | | this.sumbitLoading2 = false |
| | | this.sumbitLoading3 = false |
| | | }, |
| | | choiceStep(index) { |
| | | this.currentStepClick = index |
| | | }, |
| | | openRecordAcceptance() { |
| | | // è·å设å¤åºç¡ä¿¡æ¯ |
| | | selectDeviceByCode({ id: this.clickNodeVal.value }).then(res => { |
| | | this.form.deviceName = res.data.deviceName |
| | | this.form.specificationModel = res.data.specificationModel |
| | | this.form.managementNumber = res.data.managementNumber |
| | | this.$nextTick(() => { |
| | | this.$refs['form'].clearValidate() |
| | | }) |
| | | }); |
| | | // è·åè´è´£äººä¿¡æ¯ |
| | | this.getUserList() |
| | | }, |
| | | // è·åè´è´£äººä¿¡æ¯æ¥å£ |
| | | getUserList() { |
| | | selectUserCondition().then(res => { |
| | | if (res.code == 200) { |
| | | this.responsibleOptions = res.data |
| | | } |
| | | }) |
| | | }, |
| | | // æ¥ç |
| | | 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.dialogVisible = true |
| | | }, |
| | | // å¯¼åº |
| | | 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') |
| | | }) |
| | | }, |
| | | // å é¤ |
| | | handleDeleteClick(row) { |
| | | this.$confirm('æ¤æä½å°å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteDeviceState({ stateId: row.stateId }).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿å') |
| | | this.getDeviceStatePage(this.clickNodeVal.value) |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | //å¯¼åº |
| | | handleDown() { |
| | | this.outLoading = true |
| | | deviceStateExport({ |
| | | deviceId: this.clickNodeVal.value, |
| | | processNumber: this.search.processNumber |
| | | }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设å¤åç¨/å¯ç¨.xlsx') |
| | | }).finally(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | resetSearch() { |
| | | this.search = { |
| | | size: 20, |
| | | current: 1, |
| | | total: 0, |
| | | processNumber: '', |
| | | } |
| | | this.getDeviceStatePage(this.clickNodeVal.value); |
| | | }, |
| | | getDeviceStatePage(deviceId) { |
| | | getDeviceStatePage({ deviceId, ...this.search }).then(res => { |
| | | if (res.code == 200) { |
| | | this.tableDatalist = res.data.records |
| | | this.search.total = res.data.total |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»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) |
| | | } |
| | | }, |
| | | dialogVisible(newVal) { |
| | | if (!newVal) { |
| | | this.form = { |
| | | } |
| | | this.closeLoading() |
| | | this.currentStep = 0 // æ¥éª¤æ¡æ¾ç¤ºç¬¬å æ¥ |
| | | this.currentStepClick = 0 // ç¹å»æ¥éª¤æ¡åå |
| | | this.$refs['form'].clearValidate() |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .dialog-content { |
| | | max-height: 70vh; |
| | | /* 设置æå¤§é«åº¦ */ |
| | | overflow-y: auto; |
| | | /* å¯ç¨åç´æ»å¨ */ |
| | | } |
| | | |
| | | h4 { |
| | | font-weight: 400; |
| | | font-size: 16px; |
| | | margin: 10px 0; |
| | | } |
| | | |
| | | /* |
| | | ä¿åæäº¤æé®æ ·å¼ |
| | | */ |
| | | h4 .title { |
| | | width: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | h4 .title .line { |
| | | display: inline-block; |
| | | width: 3px; |
| | | height: 16px; |
| | | background: #3A7BFA; |
| | | margin-right: 4px; |
| | | } |
| | | |
| | | .tables { |
| | | width: 100%; |
| | | height: calc(100vh - 15em); |
| | | } |
| | | |
| | | .el-from { |
| | | max-width: 400px; |
| | | margin: 0 auto; |
| | | } |
| | | |
| | | .form-row { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | |
| | | .form-row .el-form-item { |
| | | flex: 1; |
| | | /* æ¯ä¸ªè¡¨åé¡¹å æ®ç¸åæ¯ä¾çç©ºé´ */ |
| | | margin-right: 100px; |
| | | /* å¯éï¼ä¸ºå³ä¾§å
ç´ æ·»å é´è· */ |
| | | } |
| | | |
| | | /* ç§»é¤æåä¸ä¸ªå
ç´ çå³è¾¹è· */ |
| | | .form-row .el-form-item:last-child { |
| | | margin-right: 0; |
| | | |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | margin: 10px 0; |
| | | 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; |
| | | } |
| | | |
| | | .search_input { |
| | | width: 70%; |
| | | } |
| | | |
| | | .btns { |
| | | position: absolute; |
| | | right: 0; |
| | | top: 50%; |
| | | transform: translate(0, -50%); |
| | | } |
| | | |
| | | .form .search_label { |
| | | width: 120px; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="device-page"> |
| | | <div class="device-left"> |
| | | <el-input v-model="deviceName" class="div_left_input" clearable placeholder="è¾å
¥è®¾å¤åç§°" size="small" |
| | | suffix-icon="el-icon-search" @blur="searchFilter" @clear="searchFilter" |
| | | @keyup.enter.native="searchFilter"></el-input> |
| | | <el-tree :data="list" ref="tree" :props="{ children: 'children', label: 'label' }" node-key="id" |
| | | @node-click="handleNodeClick" :filter-node-method="filterNode" highlight-current @node-expand="nodeOpen" |
| | | @node-collapse="nodeClose" v-loading="loading" :expand-on-click-node="false" style="height:calc(100% - 46px); |
| | | overflow-y: scroll; |
| | | scrollbar-width: none;"> |
| | | <div class="custom-tree-node" slot-scope="{ node, data }"> |
| | | <el-row style="width: 100%;"> |
| | | <el-col :span="21" :title="data.label"> |
| | | <span class="single-line-ellipsis" style="width: 100%;display: inline-block;"> |
| | | <i :class="`node_i ${data.children != undefined |
| | | ? data.code === '[1]' |
| | | ? 'el-icon-folder-opened' |
| | | : 'el-icon-folder' |
| | | : 'el-icon-tickets' |
| | | }` |
| | | "></i> |
| | | {{ data.label }} |
| | | </span> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-tree> |
| | | </div> |
| | | <div class="device-right"> |
| | | <div v-if="isShowAll" style="height: 100%;"> |
| | | <el-tabs v-model="menuListActiveName" class="main_right" type="border-card"> |
| | | <el-tab-pane label="è®¾å¤æ»è§" name="è®¾å¤æ»è§"> |
| | | <overview v-if="menuListActiveName == 'è®¾å¤æ»è§'" :clickNodeVal="clickNodeVal" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="设å¤å·¥å
·æç»" name="设å¤å·¥å
·æç»"> |
| | | <management v-if="menuListActiveName == '设å¤å·¥å
·æç»'" :clickNodeVal="clickNodeVal" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="èµæºé¢å®" name="èµæºé¢å®"> |
| | | <resourceReservation v-if="menuListActiveName == 'èµæºé¢å®'" :clickNodeVal="clickNodeVal"/> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="ä½ä¸æå¯¼ä¹¦" name="ä½ä¸æå¯¼ä¹¦"> |
| | | <operationInstruction v-if="menuListActiveName == 'ä½ä¸æå¯¼ä¹¦'" :clickNodeVal="clickNodeVal" /> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | <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="设å¤è¿è¡æ»è§"> |
| | | <operationOverview v-if="tabListActiveName == '设å¤è¿è¡æ»è§'" :clickNodeVal="clickNodeVal"/> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="è®¾å¤æ¡£æ¡" name="è®¾å¤æ¡£æ¡"> |
| | | <files v-if="tabListActiveName == 'è®¾å¤æ¡£æ¡'" :clickNodeVal="clickNodeVal" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="设å¤éªæ¶" name="设å¤éªæ¶"> |
| | | <checkAndAccept v-if="tabListActiveName == '设å¤éªæ¶'" :clickNodeVal="clickNodeVal"/> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="è®¾å¤æ ¡å" name="è®¾å¤æ ¡å"> |
| | | <calibration v-if="tabListActiveName == 'è®¾å¤æ ¡å'" :clickNodeVal="clickNodeVal" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="è®¾å¤æ ¸æ¥" name="è®¾å¤æ ¸æ¥"> |
| | | <check v-if="tabListActiveName == 'è®¾å¤æ ¸æ¥'" :clickNodeVal="clickNodeVal"/> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="设å¤ç»´æ¤" name="设å¤ç»´æ¤"> |
| | | <maintenance v-if="tabListActiveName == '设å¤ç»´æ¤'" :clickNodeVal="clickNodeVal" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="设å¤åç¨" name="设å¤åç¨"> |
| | | <borrow v-if="tabListActiveName == '设å¤åç¨'" :clickNodeVal="clickNodeVal" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="è®¾å¤æ
é" name="è®¾å¤æ
é"> |
| | | <fault v-if="tabListActiveName == 'è®¾å¤æ
é'" :clickNodeVal="clickNodeVal" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="使ç¨è®°å½" name="使ç¨è®°å½"> |
| | | <record v-if="tabListActiveName == '使ç¨è®°å½'" :clickNodeVal="clickNodeVal" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="设å¤åç¨/å¯ç¨" name="设å¤åç¨/å¯ç¨"> |
| | | <state v-if="tabListActiveName == '设å¤åç¨/å¯ç¨'" :clickNodeVal="clickNodeVal" /> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import management from "./component/management.vue"; |
| | | import overview from "./component/device-overview.vue"; |
| | | import resourceReservation from "./component/resource-reservation.vue"; |
| | | import operationInstruction from "./component/operationInstruction.vue"; |
| | | import operationOverview from "./component/operationOverview.vue"; |
| | | import files from "./component/files.vue"; |
| | | import checkAndAccept from "./component/check-and-accept.vue"; |
| | | import calibration from "./component/calibration.vue"; |
| | | import check from "./component/check.vue"; |
| | | import maintenance from "./component/maintenance.vue"; |
| | | import borrow from "./component/borrow.vue"; |
| | | import fault from "./component/fault.vue"; |
| | | import record from "./component/record.vue"; |
| | | import state from "./component/state.vue"; |
| | | |
| | | import { |
| | | treeDevice, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | export default { |
| | | components: { |
| | | checkAndAccept, |
| | | operationOverview, |
| | | files, |
| | | calibration, |
| | | check, |
| | | maintenance, |
| | | borrow, |
| | | fault, |
| | | record, |
| | | state, |
| | | management, |
| | | overview, |
| | | resourceReservation, |
| | | operationInstruction |
| | | }, |
| | | data() { |
| | | return { |
| | | isShowAll: true, |
| | | deviceName: "", // ä¾§è¾¹æ æç´¢ |
| | | loading: false, |
| | | tabListActiveName: 'è®¾å¤æ¡£æ¡', |
| | | menuListActiveName: 'è®¾å¤æ»è§', |
| | | list: [], |
| | | clickNodeVal: {} |
| | | }; |
| | | }, |
| | | mounted() { |
| | | // åå§åè°ç¨ |
| | | this.geList(); |
| | | }, |
| | | methods: { |
| | | handleClick(tab, event) { |
| | | }, |
| | | searchFilter() { |
| | | this.$refs.tree.filter(this.deviceName) |
| | | }, |
| | | filterNode(value, data) { |
| | | if (!value) return true; |
| | | return data.label.indexOf(value) !== -1; |
| | | }, |
| | | // ç¶çº§ |
| | | geList() { |
| | | this.loading = true; |
| | | treeDevice().then(res => { |
| | | let data = res.data; |
| | | this.list = data; |
| | | this.loading = false |
| | | }); |
| | | }, |
| | | handleNodeClick(val, node, el) { |
| | | // ç¹å»ä¸´æ¶ç¼å |
| | | this.clickNodeVal = val; |
| | | // åå¨ç¶çº§èç¹çº§æ° |
| | | this.clickNodeVal.level = node.level |
| | | this.clickNodeVal.parent = node.parent.data |
| | | // æ¯å¦æ¾ç¤ºè®¾å¤è¯¦æ
|
| | | if (!val.value) { |
| | | this.isShowAll = true |
| | | } else { |
| | | this.isShowAll = false |
| | | } |
| | | }, |
| | | nodeOpen(data, node, el) { |
| | | // $($(el.$el).find(".node_i")[0]).attr( |
| | | // "class", |
| | | // "node_i el-icon-folder-opened" |
| | | // ); |
| | | }, |
| | | nodeClose(data, node, el) { |
| | | // $($(el.$el).find(".node_i")[0]).attr("class", "node_i el-icon-folder"); |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .device-page { |
| | | display: flex; |
| | | padding-top: 10px; |
| | | box-sizing: border-box; |
| | | width: 100%; |
| | | } |
| | | |
| | | .device-left { |
| | | width: 250px; |
| | | height: 100%; |
| | | background: #fff; |
| | | border-radius: 16px; |
| | | box-sizing: border-box; |
| | | padding: 10px 16px; |
| | | flex-shrink: 0; |
| | | padding-right: 0; |
| | | } |
| | | |
| | | .device-right { |
| | | background: #fff; |
| | | width: calc(100% - 250px); |
| | | height: calc(100vh - 100px); |
| | | border-radius: 16px; |
| | | box-sizing: border-box; |
| | | padding: 10px; |
| | | } |
| | | |
| | | .showLargeCategory { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | .device-right-content { |
| | | /* margin-top: 10px; */ |
| | | height: calc(100% - 42px); |
| | | width: 100%; |
| | | } |
| | | |
| | | .custom-tree-node { |
| | | width: 100%; |
| | | line-height: 32px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .node_i { |
| | | color: orange; |
| | | font-size: 18px; |
| | | } |
| | | |
| | | .main_right { |
| | | height: calc(100% - 5px); |
| | | overflow: hidden; |
| | | } |
| | | |
| | | >>>.el-tabs__content { |
| | | padding-top: 0; |
| | | } |
| | | |
| | | >>>.single-line-ellipsis { |
| | | margin: 0 !important; |
| | | } |
| | | |
| | | >>>.el-tree-node__content { |
| | | text-align: left; |
| | | align-items: start; |
| | | margin: 4px; |
| | | height: 100%; |
| | | } |
| | | </style> |