zouyu
2025-03-12 077a9af4717bed36efcf1a6fc420de2b679cf467
Merge branch 'dev' of http://114.132.189.42:9002/r/center-lims-before-ruoyi into dev
已添加2个文件
已修改12个文件
3158 ■■■■ 文件已修改
src/api/business/reportPreparation.js 156 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/personnel/personnelInfo.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/resourceDemand/device.js 641 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Table/lims-table.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelInformation/index.vue 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelList/index.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/calibration.vue 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/check-and-accept.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/check.vue 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/files.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/reportPreparation/index.vue 1919 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/reportPreparation/onlyoffice.vue 207 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/business/reportPreparation.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,156 @@
import resquest from '@/utils/request'
export function pageInsReport(params) {
    return resquest({
        url: '/insReport/pageInsReport',
        method: 'get',
        params: params
    })
}
export function inReport(data) {
    return resquest({
        url: '/insReport/inReport',
        method: 'post',
        data: data
    })
}
export function upAll(data) {
    return resquest({
        url: '/insReport/upAll',
        method: 'post',
        data: data
    })
}
export function getLaboratoryByReportId(params) {
    return resquest({
        url: '/insReport/getLaboratoryByReportId',
        method: 'get',
        params: params
    })
}
export function withdraw(data) {
    return resquest({
        url: '/insReport/withdraw',
        method: 'post',
        data: data
    })
}
export function updateApproveConfig(data) {
    return resquest({
        url: '/approveConfig/updateApproveConfig',
        method: 'post',
        data: data
    })
}
export function getUserList(params) {
    return resquest({
        url: '/approveConfig/getUserList',
        method: 'get',
        params: params
    })
}
export function getApproveConfigList(params) {
    return resquest({
        url: '/approveConfig/getApproveConfigList',
        method: 'get',
        params: params
    })
}
export function batchApprovalReport(data) {
    return resquest({
        url: '/insReport/batchApprovalReport',
        method: 'post',
        data: data
    })
}
export function downAll(params) {
    return resquest({
        url: '/insReport/downAll',
        method: 'get',
        params: params
    })
}
export function getBatchApprovalProgress(params) {
    return resquest({
        url: '/insReport/getBatchApprovalProgress',
        method: 'get',
        params: params
    })
}
export function getReportCountInfo(params) {
    return resquest({
        url: '/insReport/getReportCountInfo',
        method: 'get',
        params: params
    })
}
export function downReport(params) {
    return resquest({
        url: '/insReport/downReport',
        method: 'get',
        params: params
    })
}
export function upReportUrl(data) {
    return resquest({
        url: '/insReport/upReportUrl',
        method: 'post',
        params: data
    })
}
export function examineReport(data) {
    return resquest({
        url: '/insReport/examineReport',
        method: 'post',
        data: data
    })
}
export function ratifyReport(data) {
    return resquest({
        url: '/insReport/ratifyReport',
        method: 'post',
        data: data
    })
}
export function writeReport(data) {
    return resquest({
        url: '/insReport/writeReport',
        method: 'post',
        params: data
    })
}
export function downLoad(params) {
    return resquest({
        url: '/file/attachmentType/downLoad',
        method: 'get',
        params: params,
        responseType: 'blob'
    })
}
export function getReportInfo(params) {
    return resquest({
        url: '/file/attachmentType/getMIME',
        method: 'get',
        params: params
    })
}
src/api/cnas/personnel/personnelInfo.js
@@ -57,7 +57,7 @@
// ä¿®æ”¹äººå‘˜æ˜Žç»†æ‰€åœ¨ç»„织架构
export function upUserDepardLimsId(data) {
  return request({
    url: "/user/upUserDepardLimsId",
    url: "/system/newUser/upUserDepardLimsId",
    method: "post",
    data: data,
  });
src/api/cnas/resourceDemand/device.js
@@ -119,499 +119,6 @@
  });
}
//设备校准计划列表查询
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({
@@ -660,7 +167,7 @@
//新增设备档案
export function addDocument(data) {
  return request({
    url: "/deviceDocuments/addDocument",
    url: "/documents/add",
    method: "post",
    data: data,
  });
@@ -669,7 +176,7 @@
// èŽ·å–ç›¸å…³æ–‡æ¡£æ•°æ®çš„api-更新
export function updateDocument(data) {
  return request({
    url: "/deviceDocuments/updateDocument",
    url: "/documents/updateDocument",
    method: "post",
    data: data,
  });
@@ -678,7 +185,7 @@
//删除设备档案
export function deleteDocumentById(query) {
  return request({
    url: "/deviceDocuments/deleteDocumentById",
    url: "/documents/delete",
    method: "delete",
    params: query,
  });
@@ -766,8 +273,15 @@
    params: query,
  });
}
//设备校准 æ–°å¢ž æ›´æ–°
// è®¾å¤‡æ ¡å‡† æ–°å¢ž æ›´æ–°-校准记录
export function addOrUpdateDeviceMetricRecord(data) {
  return request({
    url: "/deviceMetricRecord/addOrUpdateDeviceMetricRecord",
    method: "post",
    data: data,
  });
}
//设备校准 æ–°å¢ž æ›´æ–°-提交项目校准维护
export function saveOrUpdateDeviceMetric(data) {
  return request({
    url: "/deviceMetrics/saveOrUpdateDeviceMetric",
@@ -793,39 +307,10 @@
    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,
@@ -846,6 +331,59 @@
  return request({
    url: "/deviceMetrics/deleteDeviceMetrics",
    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,
  });
}
//设备校准导出-附件
export function downLoadDeviceCalibrationFile(query) {
  return request({
    url: "/personBasicInfo/downLoadDeviceCalibrationFile",
    method: "get",
    params: query,
    responseType: "blob"
  });
}
//删除文件
export function deleteCNASFile(query) {
  return request({
    url: "/personBasicInfo/deleteCNASFile",
    method: "delete",
    params: query,
  });
}
//查询设备档案列表
export function getListByDId(query) {
  return request({
    url: '/documents/getListByDId',
    method: "get",
    params: query,
  });
}
//设备档案导出
export function exportDeviceFile(query) {
  return request({
    url: "/deviceScope/exportDeviceFile",
    method: "get",
    responseType: "blob",
    params: query,
  });
}
@@ -1283,10 +821,10 @@
    params: query,
  });
}
//设备预约接口
// è®¾å¤‡è¿è¡Œæ€»è§ˆ-根据id获取设备故障数据
export function device(query) {
  return request({
    url: "/api/device-faults/device",
    url: "/deviceFaults/device",
    method: "get",
    params: query,
  });
@@ -1294,7 +832,15 @@
//设备验收中四个table表格的删除功能
export function deleteIncidentReportAll(query) {
  return request({
    url: "/incident-report/deleteIncidentReportAll",
    url: "/incidentReport/deleteIncidentReportAll",
    method: "delete",
    params: query,
  });
}
//设备验收中四个table表格的删除功能
export function deleteIncidentReport(query) {
  return request({
    url: "/incidentReport/deleteIncidentReport",
    method: "delete",
    params: query,
  });
@@ -1303,7 +849,7 @@
//设备验收 ä¿å­˜ï¼Œæäº¤ï¼Œé©³å›žï¼Œé€šè¿‡æŽ¥å£
export function saveIncidentReportData(query) {
  return request({
    url: "/incident-report/saveIncidentReportData",
    url: "/incidentReport/saveIncidentReportData",
    method: "post",
    data: query,
  });
@@ -1311,7 +857,7 @@
//设备验收 ä¿å­˜ï¼Œæäº¤ï¼Œé©³å›žï¼Œé€šè¿‡æŽ¥å£
export function incidentReportPage(query) {
  return request({
    url: "/incident-report/incidentReportPage",
    url: "/incidentReport/incidentReportPage",
    method: "get",
    params: query,
  });
@@ -1319,7 +865,7 @@
//设备验收 ä¿å­˜ï¼Œæäº¤ï¼Œé©³å›žï¼Œé€šè¿‡æŽ¥å£
export function getShowIncidentReport(query) {
  return request({
    url: "/incident-report/getShowIncidentReport",
    url: "/incidentReport/getShowIncidentReport",
    method: "get",
    params: query,
  });
@@ -1327,7 +873,7 @@
//设备验收导出
export function incidentReportExport(query) {
  return request({
    url: "/incident-report/incidentReportExport",
    url: "/incidentReport/incidentReportExport",
    method: "get",
    params: query,
    responseType: "blob"
@@ -1358,15 +904,7 @@
    responseType: "blob"
  });
}
//设备校准导出
export function downLoadDeviceCalibrationFile(query) {
  return request({
    url: "/personBasicInfo/downLoadDeviceCalibrationFile",
    method: "get",
    params: query,
    responseType: "blob"
  });
}
//删除 è®¾å¤‡æ•…éšœ
export function deleteDeviceFaultOne(query) {
  return request({
@@ -1375,19 +913,4 @@
    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,
  });
}
src/components/Table/lims-table.vue
@@ -192,16 +192,10 @@
              >{{ o.name }}
            </el-button>
            <el-upload
              :action="
                javaApi +
                o.url +
                '?id=' +
                (o.uploadIdFun ? o.uploadIdFun(scope.row) : scope.row.id)
              "
              :action="javaApi + o.url"
              size="mini"
              ref="upload"
              :multiple="o.multiple ? o.multiple : false"
              :limit="1"
              :disabled="o.disabled ? o.disabled(scope.row) : false"
              :accept="
                o.accept
@@ -211,6 +205,10 @@
              v-if="o.type == 'upload' && o.url"
              style="display: inline-block; width: 50px"
              v-show="o.showHide ? o.showHide(scope.row) : true"
              :data="o.data ? o.data(scope.row) : {}"
              :before-upload="
                o.beforeUpload ? o.beforeUpload(scope.row) : () => true
              "
              :headers="uploadHeader"
              :on-error="onError"
              :on-exceed="onExceed"
@@ -508,6 +506,7 @@
          this.$message.success("上传成功");
        }
      }
      this.$refs.upload.clearFiles();
    },
    onError(err, file, fileList) {
      this.$message.error("上传失败");
src/main.js
@@ -67,7 +67,7 @@
};
Vue.prototype.javaApi = process.env.VUE_APP_BASE_API
  ? process.env.VUE_APP_BASE_API
  : "http://192.168.0.104:8002";
  : "http://127.0.0.1:8002";
Vue.prototype.checkPermi = checkPermi;
Vue.prototype.uploadHeader = {
  Authorization: "Bearer " + getToken(),
src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelInformation/index.vue
@@ -787,17 +787,15 @@
      })
    },
    beforeAvatarUpload(file) {
      const isJPGorPNG = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif';
      const isLt2MB = file.size / 1024 / 1024 < 2;
      if (!isJPGorPNG) {
        this.$message.error('上传图片只能是 JPG/PNG æ ¼å¼!');
        return false;
      let flag = true
      if (file.size > 1024 * 1024 * 10) {
        this.$message.error('上传文件不超过10M');
        this.$refs.upload.clearFiles()
        flag = false
      }
      // if (!isLt2MB) {
      //   this.$message.error('上传图片大小不能超过 2MB!');
      // }
      // æ ¡éªŒé€šè¿‡æ‰è¿”回 true,允许文件上传
      return isJPGorPNG && isLt2MB;
      if (!flag) {
        return Promise.reject(flag); //正确的终止
      }
    },
    downloadFile(fileName) {
      this.$download.saveAs(fileName, fileName)
@@ -849,8 +847,11 @@
    },
    // å–人员分类的字典
    getComparisonList() {
      tthis.personnelClassification = this.dict.type.personnl_type;
      this.checkList = this.form.personnelClassification.split(',')
      // æ–‡ä»¶çŠ¶æ€
      this.getDicts("personnl_type").then((response) => {
        this.personnelClassification = this.dictToValue(response.data);
        this.checkList = this.form.personnelClassification ? this.form.personnelClassification.split(',') : []
      });
    },
    clickPersonnelClassificationSure() {
      this.dialogVisible = false
src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelList/index.vue
@@ -58,17 +58,17 @@
    </div>
    <el-dialog :visible.sync="selectUserDia" title="选择用户" width="70%">
      <div class="search" style="margin-bottom: 9px;">
        <div class="search_thing">
        <div class="search_thing" style="display: flex;">
          <div class="search_label">用户名:</div>
          <div class="search_input">
            <el-input v-model="queryParams.name" clearable placeholder="请输入" size="small"
              @keyup.enter.native="getList()" style="width: 200px;"></el-input>
              @keyup.enter.native="getList()" style="width: 150px;"></el-input>
          </div>
        </div>
      </div>
      <div v-if="selectUserDia" class="body" style="height: 60vh;">
        <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 290px)'"
          :page="personPage" @pagination="pagination" :isSelection="true"
        <lims-table :tableData="personTableData" :column="column" :tableLoading="tableLoading"
          :height="'calc(100vh - 290px)'" :page="personPage" :isSelection="true"
          :handleSelectionChange="handleSelectionChange"></lims-table>
      </div>
      <span slot="footer" class="dialog-footer">
@@ -139,7 +139,7 @@
      queryParams: {
        name: ''
      },
      tableData: [],
      personTableData: [],
      column: [
        { label: "姓名", prop: "name" },
        { label: "账号", prop: "account" },
@@ -210,8 +210,10 @@
    refreshTable(entity, type) {
      try {
        this.tableLoading = true;
        this.entity.departLimsId = this.departId;
        basicInformationOfPersonnelSelectPage({ ...this.page, ...this.entit }).then(res => {
        this.entity.departmentId = this.departId;
        let params = { ...this.page, ...this.entity }
        delete params.total
        basicInformationOfPersonnelSelectPage(params).then(res => {
          this.tableLoading = false;
          if (res.code === 201) {
            return;
@@ -297,8 +299,7 @@
        .then((res) => {
          this.tableLoading = false;
          if (res.code === 200) {
            this.tableData = res.data.records;
            this.personPage.total = res.data.total;
            this.personTableData = res.data;
          }
        })
        .catch((err) => {
@@ -313,7 +314,6 @@
    handleDown() {
      this.outLoading = true;
      let entity = this.HaveJson(this.entity)
      delete entity.orderBy;
      exportPersonBasicInfo(entity).then(res => {
        this.outLoading = false;
        if (res.code === 201) {
src/views/CNAS/resourceDemand/device/component/calibration.vue
@@ -233,23 +233,6 @@
                </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%"
@@ -299,20 +282,6 @@
            </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>
@@ -423,7 +392,7 @@
  computed: {
    ...mapGetters(["nickName"]),
    action() {
      return this.javaApi + '/personBasicInfo/saveCNASFile'
      return this.javaApi + '/personBasicInfo/saveDeviceCalibrationFile'
    }
  },
  mounted() {
@@ -530,7 +499,7 @@
      this.dialogVisible1 = true
      this.getXmsg()
    },
    // æŸ¥çœ‹è¯¦æƒ…
    // æŸ¥çœ‹ç¼–辑详情
    handleViewClick(type, row) {
      showDeviceMetricsCopy({ id: row.id, type: 'calibrate' }).then(res => {
        this.calibrateParams = res.data
@@ -569,27 +538,6 @@
        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
@@ -627,6 +575,7 @@
        this.$message.info('已取消删除');
      })
    },
    // æäº¤é¡¹ç›®æ ¡å‡†ç»´æŠ¤
    addCalibrate() {
      this.$refs['form0'].validate((valid) => {
        if (valid) {
@@ -644,6 +593,8 @@
            }
            this.calibrateParamsLoading = false
            this.addCalibrateLoading = false
          }).catch(() => {
            this.addCalibrateLoading = false
          })
        } else {
          this.addCalibrateLoading = false
@@ -651,6 +602,7 @@
        }
      })
    },
    // æäº¤æ ¡å‡†è®°å½•
    addRecord() {
      this.$refs['calibrationRecord'].validate((valid) => {
        if (valid) {
@@ -668,6 +620,10 @@
            this.calibrationRecord.createUser = this.nickName
            this.calibrationRecord.type = 'calibrate'
            this.calibrationRecord.deviceMetricsCopyList = this.calibrateParams
            this.calibrationRecord.deviceMetricsCopyList.forEach(m => {
              delete m.creationTime
            })
            delete this.calibrationRecord.createTime
            addOrUpdateDeviceMetricRecord(this.calibrationRecord).then(res => {
              if (res.code == 200) {
                this.$message.success('添加成功')
@@ -675,6 +631,8 @@
                this.getTableList(this.clickNodeVal.value)
              }
              this.addRecordLoading = false
            }).catch((err) => {
              this.addRecordLoading = false
            })
          } catch (e) {
            console.log('addRecord---', e)
src/views/CNAS/resourceDemand/device/component/check-and-accept.vue
@@ -17,7 +17,7 @@
      </div>
    </div>
    <div class="tables" style="margin-top: 10px;">
      <el-table ref="table" :data="tableDataAlist" height="100%">
      <el-table ref="table" :data="tableDataAlist" height="100%" v-loading="tableLoading">
        <el-table-column label="序号" type="index" width="60">
          <template v-slot="scope">
            <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
@@ -468,12 +468,13 @@
import { dateFormat } from '@/utils/date'
import file from "@/utils/file";
import {
  deleteCNASFile,
  deleteCNASFile, deleteIncidentReport,
  deleteIncidentReportAll, getShowIncidentReport, incidentReportExport, incidentReportPage,
  saveIncidentReportData,
  selectDeviceByCode
} from "@/api/cnas/resourceDemand/device";
import {selectUserCondition} from "@/api/system/user";
import {mapGetters} from "vuex";
export default {
  props: {
@@ -488,6 +489,7 @@
    return {
      //事故设备信息
      tableDataAlist: [], // æ›´æ”¹å˜é‡åç§°
      tableLoading: false,
      dialogVisible: false,
      rules: {
        quantity: [{ required: true, message: '请输入数量', trigger: 'blur' }],
@@ -517,7 +519,8 @@
  computed: {
    action() {
      return this.javaApi + '/personBasicInfo/saveCNASFile'
    }
    },
    ...mapGetters(["nickName"]),
  },
  mounted() {
    // èŽ·å–è®¾å¤‡äº‹æ•…ä¿¡æ¯
@@ -661,32 +664,31 @@
      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.submitOperatingPersonnel = this.nickName
              this.form.submitDate = dateTime
              break
            case 1:
              this.form.unpackingOperatingPersonnel = user.name
              this.form.unpackingOperatingPersonnel = this.nickName
              this.form.unpackingDate = dateTime
              break
            case 2:
              this.form.installOperatingPersonnel = user.name
              this.form.installOperatingPersonnel = this.nickName
              this.form.installDate = dateTime
              break
            case 3:
              this.form.installationAcceptanceOperatingPersonnel = user.name
              this.form.installationAcceptanceOperatingPersonnel = this.nickName
              this.form.installationAcceptanceDate = dateTime
              break
            case 4:
              this.form.acceptanceCheckOperatingPersonnel = user.name
              this.form.acceptanceCheckOperatingPersonnel = this.nickName
              this.form.acceptanceCheckDate = dateTime
              break
            case 5:
              this.form.acceptanceAuditOperatingPersonnel = user.name
              this.form.acceptanceAuditOperatingPersonnel = this.nickName
              this.form.acceptanceAuditDate = dateTime
              break
            default:
@@ -765,19 +767,21 @@
    },
    // èŽ·å–è®¾å¤‡äº‹æ•…ä¿¡æ¯(根据从vuex中获取到的设备名称id进行数据查询)
    getDeviceAList(deviceId) {
      this.tableLoading = true
      incidentReportPage({deviceId: deviceId, size:this.search.size, current:this.search.current, processNumber: this.search.processNumber}).then(res => {
        this.tableLoading = false
        if (res.code == 200) {
          this.tableDataAlist = res.data.records
          this.search.total = res.data.total
        }
      }).catch(err => {
        this.tableLoading = false
      })
    },
    //table äº‹ä»¶å¤„理开始处
    // ä¸‹è½½é™„ä»¶
    handleAttachmentClick(row) {
      // æ¨¡æ‹Ÿä¸‹è½½é™„ä»¶
      const imageUrl = this.javaApi+'/img/'+row.systemFileName; // å›¾ç‰‡ URL
      // downloadImage(imageUrl);
      file.downloadIamge(imageUrl,row.fileName)
      this.$download.saveAs(row.systemFileName, row.fileName)
    },
    handleViewClick(row) {
      getShowIncidentReport({id: row.id}).then(res => {
@@ -797,7 +801,7 @@
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        deleteIncidentReportAll({id: row.id}).then(res => {
        deleteIncidentReport({id: row.id}).then(res => {
          if (res.code == 200) {
            this.$message.success('删除成功')
            this.getDeviceAList(this.clickNodeVal.value);
@@ -870,6 +874,7 @@
}
.search {
  margin-top: 10px;
  background-color: #fff;
  height: 40px;
  display: flex;
src/views/CNAS/resourceDemand/device/component/check.vue
@@ -181,7 +181,7 @@
                  <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"
                <el-upload v-if="operationType === 'add'" ref="upload" :action="action" :before-upload="beforeUpload" :headers="uploadHeader"
                           :limit="1" :on-error="onError" :on-success="handleSuccessUp"
                           :show-file-list="false"
                           style="float: right;">
@@ -252,7 +252,13 @@
<script>
import file from '@/utils/file';
import { mapGetters } from "vuex";
import {deviceMetricRecordExport} from "@/api/cnas/resourceDemand/device";
import {
  addOrUpdateDeviceMetricRecord, deleteCNASFile, deleteDeviceMetricRecord, deleteDeviceMetrics,
  deviceMetricRecordExport,
  deviceMetricRecordPage,
  saveOrUpdateDeviceMetric,
  selectDeviceMetric, showDeviceMetricsCopy
} from "@/api/cnas/resourceDemand/device";
export default {
  components: {},
  props: {
@@ -336,7 +342,7 @@
  computed: {
    ...mapGetters(["nickName"]),
    action() {
      return this.javaApi + this.$api.personnel.saveCNASFile
      return this.javaApi + '/personBasicInfo/saveCNASFile'
    }
  },
  mounted() {
@@ -375,7 +381,7 @@
    async getXmsg() {
      this.calibrateParamsLoading = true
      try {
        await this.$axios.get(this.$api.deviceCheck.selectDeviceMetric + "?deviceId=" + this.clickNodeVal.value + "&type=examine").then(res => {
        await selectDeviceMetric({deviceId: this.clickNodeVal.value, type: 'examine'}).then(res => {
          if (res.code == 200) {
            this.calibrateParams = res.data
          }
@@ -399,11 +405,7 @@
          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 => {
          saveOrUpdateDeviceMetric(this.form0).then(res => {
            if (res.code == 200) {
              this.$message.success('保存成功')
              this.$refs['form0'].resetFields()
@@ -420,7 +422,7 @@
    },
    // æŸ¥è¯¢è®¾å¤‡æ ¸æŸ¥åˆ—表
    getTableList(deviceId) {
      this.$axios.get(this.$api.deviceCheck.deviceMetricRecordPage + '?deviceId=' + deviceId + "&size=" + this.search.size + "&current=" + this.search.current + "&type=examine").then(res => {
      deviceMetricRecordPage({deviceId: deviceId, size: this.search.size, current: this.search.current, type: 'examine'}).then(res => {
        this.tableData = res.data.records
        this.search.total = res.data.total
      })
@@ -442,12 +444,11 @@
            this.calibrationRecord.deviceId = this.clickNodeVal.value;
            this.calibrationRecord.createUser = this.nickName
            this.calibrationRecord.deviceMetricsCopyList = this.calibrateParams
            this.calibrationRecord.deviceMetricsCopyList.forEach(ele => {
              delete ele.creationTime
            })
            this.calibrationRecord.type = 'examine'
            this.$axios.post(this.$api.deviceCheck.addOrUpdateDeviceMetricRecord, this.calibrationRecord, {
              headers: {
                'Content-Type': 'application/json'
              }
            }).then(res => {
            addOrUpdateDeviceMetricRecord(this.calibrationRecord).then(res => {
              if (res.code == 200) {
                this.$message.success('添加成功')
                this.dialogVisible1 = false
@@ -463,6 +464,22 @@
          this.$message.warning('有必填项未填');
        }
      })
    },
    handleClose(done) {
      this. calibrationRecord = {
        unitOfMeasure: '', // æ ¸æŸ¥äºº
        calibrationDate: '', // æ ¸æŸ¥æ—¥æœŸ
        nextCalibrationDate: '', // ä¸‹æ¬¡æ ¸æŸ¥æ—¥æœŸ
        calculatingApparatus: '', // æ ¸æŸ¥å™¨å…·
        standardRange: '', // æ ¸æŸ¥æ ‡å‡†é‡ç¨‹
        calibrationStandardUncertainty: '', // æ ¸æŸ¥æ ‡å‡†ä¸ç¡®å®šåº¦
        byDocument: '', // æ ¸æŸ¥æŒ‡å¯¼ä¹¦
        certificateSerialNumber: '', // æ£€æŸ¥æŠ¥å‘ŠæŒ‡å¯¼ä¹¦
        fileName: '', // é™„ä»¶
        status: '', // æ ¸æŸ¥æ€»ç»“论
        remark: '', // å¤‡æ³¨
      }
      this.dialogVisible1 = false
    },
    resetcalibrationRecord() {
      this.$refs.calibrationRecord.resetFields()
@@ -498,7 +515,7 @@
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$axios.delete(this.$api.personnel.deleteCNASFile + "?fileName=" + this.form.systemFileName).then(res => {
        deleteCNASFile({fileName: this.form.systemFileName}).then(res => {
          if (res.code == 200) {
            this.$message.success('删除成功!')
          }
@@ -512,10 +529,7 @@
    },
    // end
    handleAttachmentClick(row) {
      // æ¨¡æ‹Ÿä¸‹è½½é™„ä»¶
      const imageUrl = this.javaApi + '/img/' + row.systemFileName; // å›¾ç‰‡ URL
      file.downloadIamge(imageUrl, row.fileName)
      // downloadImage(imageUrl, row.fileName);
      this.$download.saveAs(row.systemFileName, row.fileName)
    },
    // æ·»åŠ æ ¸æŸ¥è®°å½•
    add(type) {
@@ -525,7 +539,7 @@
    },
    // æŸ¥çœ‹è¯¦æƒ…
    handleViewClick(type, row) {
      this.$axios.get(this.$api.deviceCheck.showDeviceMetricsCopy + "?id=" + row.id + "&type=examine").then(res => {
      showDeviceMetricsCopy({id: row.id, type: 'examine'}).then(res => {
        this.calibrateParams = res.data
      })
      this.calibrationRecord = { ...row }
@@ -540,7 +554,7 @@
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$axios.delete(this.$api.deviceCheck.deleteDeviceMetricRecord + "?id=" + row.id).then(res => {
        deleteDeviceMetricRecord({id: row.id}).then(res => {
          this.getTableList(this.clickNodeVal.value) // èŽ·å–è®¾å¤‡æ ¡å‡†åˆ—è¡¨æ•°æ®
          this.$message.success('删除成功!')
        })
@@ -557,7 +571,7 @@
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$axios.delete(this.$api.deviceCheck.deleteDeviceMetrics + "?id=" + row.id).then(res => {
        deleteDeviceMetrics({id: row.id}).then(res => {
          this.getXmsg();
          this.$message.success('删除成功!')
        })
@@ -636,6 +650,7 @@
.btns {
  text-align: right;
  margin-top: 10px;
}
h4 {
src/views/CNAS/resourceDemand/device/component/files.vue
@@ -470,11 +470,10 @@
  updateDocument,
  addDocument,
  deleteDocumentById,
  getAllDocuments,
  selectDeviceByCode,
  upDeviceParameter,
  exportDeviceFile,
  getInsProduction,
  getInsProduction, getListByDId,
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/system/user";
import {
@@ -719,7 +718,7 @@
    },
    // èŽ·å–ç›¸å…³æ–‡æ¡£æ•°æ®çš„api
    getPage() {
      getAllDocuments({ deviceId: this.clickNodeVal.value }).then(res => {
      getListByDId({ id: this.clickNodeVal.value }).then(res => {
        if (res.code == 200)
          this.tableDataA = res.data
      })
src/views/CNAS/resourceDemand/device/index.vue
@@ -47,7 +47,7 @@
      <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"/>
            <operationOverview view v-if="tabListActiveName == '设备运行总览'" :clickNodeVal="clickNodeVal"/>
          </el-tab-pane>
          <el-tab-pane label="设备档案" name="设备档案">
            <files v-if="tabListActiveName == '设备档案'" :clickNodeVal="clickNodeVal" />
@@ -123,7 +123,7 @@
      isShowAll: true,
      deviceName: "", // ä¾§è¾¹æ æœç´¢
      loading: false,
      tabListActiveName: '设备档案',
      tabListActiveName: '设备运行总览',
      menuListActiveName: '设备总览',
      list: [],
      clickNodeVal: {}
@@ -200,7 +200,7 @@
.device-right {
  background: #fff;
  width: calc(100% - 250px);
  height: calc(100vh - 100px);
  height: calc(100vh - 40px);
  border-radius: 16px;
  box-sizing: border-box;
  padding: 10px;
src/views/business/reportPreparation/index.vue
@@ -1,9 +1,1920 @@
<style scoped>
.title {
  height: 60px;
  line-height: 60px;
}
.search {
  background-color: #fff;
  height: 80px;
  display: flex;
  align-items: center;
}
.search_thing {
  display: flex;
  align-items: center;
  height: 50px;
  width: 230px;
}
.search_label {
  width: 90px;
  font-size: 14px;
  text-align: right;
}
.search_input {
  width: calc(100% - 90px);
}
.table {
  margin-top: 10px;
  background-color: #fff;
  width: calc(100% - 40px);
  height: calc(100% - 60px - 80px - 10px - 40px);
  padding: 20px;
}
.el-form-item {
  margin-bottom: 16px;
}
.full-screen {
  position: absolute;
  right: 52px;
  top: 22px;
}
.btns {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translate(0, -50%);
  display: flex;
  align-items: center;
}
.fullscreen {
  height: 82vh;
}
.custom-upload >>> .el-upload-list--text {
  max-height: 20vh;
  overflow-y: scroll;
}
</style>
<template>
  <div>报告编制</div>
  <div class="inspection_order">
    <div style="width: 100%; height: 100%">
      <div>
        <el-row class="title">
          <el-col :span="12" style="padding-left: 20px; text-align: left"
            >报告编制</el-col
          >
        </el-row>
      </div>
      <div class="search" :style="`height: ${more ? 130 : 80}px;`">
        <el-row :gutter="10" style="width: 100%">
          <el-col :span="16" style="display: flex; flex-wrap: wrap">
            <div class="search_thing" v-if="maxNum >= 1">
              <div class="search_label">报告编号:</div>
              <div class="search_input">
                <el-input
                  size="small"
                  placeholder="请输入"
                  clearable
                  v-model="entity.code"
                  @keyup.enter.native="refreshTable()"
                ></el-input>
              </div>
            </div>
            <div class="search_thing" v-if="maxNum >= 2">
              <div class="search_label">上传状态:</div>
              <div class="search_input">
                <el-select
                  size="small"
                  clearable
                  @clear="refreshTable()"
                  @change="refreshTable()"
                  v-model="entity.isUpload"
                >
                  <el-option
                    v-for="(item, index) in tagField.isUpload.select"
                    :value="item.value"
                    :label="item.label"
                    :key="index"
                  ></el-option>
                </el-select>
              </div>
            </div>
            <div class="search_thing" v-if="maxNum >= 3">
              <div class="search_label">提交状态:</div>
              <div class="search_input">
                <el-select
                  size="small"
                  clearable
                  @clear="refreshTable()"
                  @change="refreshTable()"
                  v-model="entity.state"
                >
                  <el-option
                    v-for="(item, index) in tagField.state.select"
                    :value="item.value"
                    :label="item.label"
                    :key="index"
                  ></el-option>
                </el-select>
              </div>
            </div>
            <div
              class="search_thing"
              v-if="maxNum >= 4 || (maxNum < 4 && more)"
            >
              <div class="search_label">审核状态:</div>
              <div class="search_input">
                <el-select
                  size="small"
                  clearable
                  @clear="refreshTable()"
                  @change="refreshTable()"
                  v-model="entity.isExamine"
                >
                  <el-option
                    v-for="(item, index) in tagField.isExamine.select"
                    :value="item.value"
                    :label="item.label"
                    :key="index"
                  ></el-option>
                </el-select>
              </div>
            </div>
            <div class="search_thing" v-if="maxNum >= 5 || more">
              <div class="search_label">批准状态:</div>
              <div class="search_input">
                <el-select
                  size="small"
                  clearable
                  @clear="refreshTable()"
                  @change="refreshTable()"
                  v-model="entity.isRatify"
                >
                  <el-option
                    v-for="(item, index) in tagField.isRatify.select"
                    :value="item.value"
                    :label="item.label"
                    :key="index"
                  ></el-option>
                </el-select>
              </div>
            </div>
            <div class="search_thing" v-if="maxNum >= 6 || more">
              <div class="search_label">创建时间:</div>
              <div class="search_input">
                <el-date-picker
                  size="small"
                  clearable
                  @clear="refreshTable()"
                  @change="refreshTable()"
                  v-model="entity.createTimeRange"
                  type="daterange"
                  value-format="yyyy-MM-dd[T]HH:mm:ss"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                  :default-time="['00:00:00', '23:59:59']"
                >
                </el-date-picker>
              </div>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="search_thing">
              <el-button
                v-if="maxNum < 5"
                type="text"
                :icon="!more ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
                style="color: #3a7bfa"
                @click="more = !more"
                >{{ !more ? "更多" : "收起" }}</el-button
              >
              <div class="search_thing" style="padding-left: 20px">
                <el-button
                  size="small"
                  @click="refresh()"
                  style="margin-right: 6px"
                  >重 ç½®</el-button
                >
                <el-button
                  size="small"
                  type="primary"
                  @click="refreshTable()"
                  style="margin-right: 6px"
                  >查 è¯¢</el-button
                >
                <template>
                  <el-dropdown
                    @command="handleCommand"
                    style="margin-left: 10px"
                  >
                    <el-button type="primary" size="small">
                      æ›´å¤šæ“ä½œ<i class="el-icon-arrow-down el-icon--right"></i>
                    </el-button>
                    <el-dropdown-menu slot="dropdown">
                      <el-dropdown-item
                        icon="el-icon-download"
                        command="batchDownload"
                        >批量下载</el-dropdown-item
                      >
                      <el-dropdown-item
                        icon="el-icon-upload"
                        command="batchUpload"
                        >批量上传</el-dropdown-item
                      >
                      <el-dropdown-item
                        icon="el-icon-s-check"
                        command="oneClickApproval"
                        >一键审批</el-dropdown-item
                      >
                      <el-dropdown-item
                        icon="el-icon-setting"
                        command="approvalConfig"
                        >审批签名配置</el-dropdown-item
                      >
                    </el-dropdown-menu>
                  </el-dropdown>
                </template>
                <template>
                  <el-button
                    size="small"
                    type="primary"
                    @click="handleDowns"
                    :loading="outLoading"
                    style="margin-right: 6px"
                    >批量下载</el-button
                  >
                  <el-button
                    size="small"
                    type="primary"
                    @click="openBatchUploadDia()"
                    :loading="inLoading"
                    >批量上传</el-button
                  >
                  <el-button
                    size="small"
                    type="primary"
                    @click="oneClickApproval()"
                    :loading="approvalLoading"
                    >一键审批</el-button
                  >
                  <el-button
                    size="small"
                    type="primary"
                    @click="openApprovalConfig()"
                    :loading="approvalConfigLoading"
                    >审批签名配置</el-button
                  >
                </template>
              </div>
              <!-- <div class="btns">
              <el-button size="small" type="primary" @click="handleDowns" :loading="outLoading" style="margin-right: 16px;">批量下载</el-button>
              <el-button size="small" type="primary" @click="openBatchUploadDia()" :loading="inLoading">批量上传</el-button>
            </div> -->
            </div>
          </el-col>
        </el-row>
      </div>
      <div class="table">
        <div
          style="
            width: 100%;
            display: flex;
            flex-wrap: nowrap;
            font-size: 13px;
            flex-direction: row;
            justify-content: flex-end;
            align-items: center;
          "
        >
          <p style="margin-left: 15px">
            å¾…提交数量:&nbsp;<span
              style="font-size: 16px; color: rgb(58, 123, 250)"
              >{{ unSubmitCount }}</span
            >
          </p>
          <p style="margin-left: 15px">
            å¾…审核数量:&nbsp;<span
              style="font-size: 16px; color: rgb(58, 123, 250)"
              >{{ unExamineCount }}</span
            >
          </p>
          <p style="margin-left: 15px">
            å¾…批准数量:&nbsp;<span
              style="font-size: 16px; color: rgb(58, 123, 250)"
              >{{ unRatifyCount }}</span
            >
          </p>
        </div>
        <lims-table
          :tableData="tableData"
          :column="column"
          :tableLoading="tableLoading"
          :height="'calc(100vh - 270px)'"
          :page="page"
          @pagination="pagination"
        ></lims-table>
      </div>
    </div>
    <!--报告查看-->
    <el-dialog
      :fullscreen="fullscreen"
      top="5vh"
      :modal-append-to-body="false"
      :visible.sync="viewIssuedVisible"
      title="报告查看"
      width="80vw"
    >
      <div class="full-screen">
        <i
          v-if="!fullscreen"
          class="el-icon-full-screen"
          style="cursor: pointer; font-size: 18px"
          @click="fullscreen = true"
        ></i>
        <!-- <img
          v-else
          alt=""
          src="../../../static/img/no-full.svg"
          style="cursor: pointer"
          @click="fullscreen = false"
        /> -->
      </div>
      <div v-if="viewIssuedVisible" style="height: 80vh">
        <onlyoffice
          ref="onlyoffice"
          :options="option"
          style="width: 100%; height: 100%"
        />
      </div>
    </el-dialog>
    <el-dialog
      title="在线编制"
      :visible.sync="claimVisible"
      width="22cm"
      :modal-append-to-body="false"
      :fullscreen="fullscreen"
    >
      <div class="full-screen">
        <i
          class="el-icon-full-screen"
          style="cursor: pointer; font-size: 18px"
          @click="fullscreen = true"
          v-if="!fullscreen"
        ></i>
        <!-- <img
          src="../../../static/img/no-full.svg"
          alt=""
          v-else
          style="cursor: pointer"
          @click="fullscreen = false"
        /> -->
      </div>
      <Word
        style="height: 70vh"
        :class="{ fullscreen: fullscreen }"
        v-if="claimVisible"
        ref="Word"
        :value="value"
      />
      <span slot="footer" class="dialog-footer">
        <el-button @click="claimVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="confirmClaim">ç¡® å®š</el-button>
      </span>
    </el-dialog>
    <el-dialog
      title="报告审核"
      top="5vh"
      :visible.sync="issuedVisible"
      width="80vw"
      :modal-append-to-body="false"
      :fullscreen="fullscreen"
    >
      <div class="full-screen">
        <i
          class="el-icon-full-screen"
          style="cursor: pointer; font-size: 18px"
          @click="fullscreen = true"
          v-if="!fullscreen"
        ></i>
        <!-- <img
          src="../../../static/img/no-full.svg"
          alt=""
          v-else
          style="cursor: pointer"
          @click="fullscreen = false"
        /> -->
      </div>
      <div style="height: 75vh" v-if="issuedVisible">
        <onlyoffice
          ref="onlyoffice"
          :options="option"
          style="width: 100%; height: 100%"
        />
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="issuedReasonVisible = true" :disabled="loadingIssued"
          >不通过</el-button
        >
        <el-button type="primary" @click="subIssued" :loading="loadingIssued"
          >通 è¿‡</el-button
        >
      </span>
    </el-dialog>
    <el-dialog
      title="不通过原因"
      top="5vh"
      :visible.sync="issuedReasonVisible"
      width="400px"
      :modal-append-to-body="false"
    >
      <div class="search_thing">
        <div class="search_label">不通过原因:</div>
        <div class="search_input">
          <el-input
            size="small"
            placeholder="请输入"
            clearable
            v-model="reason"
          ></el-input>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button
          @click="issuedReasonVisible = false"
          :disabled="loadingIssuedReason"
          >取消</el-button
        >
        <el-button
          type="primary"
          @click="handleIssuedReason"
          :loading="loadingIssuedReason"
          >确定</el-button
        >
      </span>
    </el-dialog>
    <el-dialog
      title="报告批准"
      top="5vh"
      :visible.sync="approveVisible"
      width="80vw"
      :modal-append-to-body="false"
      :fullscreen="fullscreen"
    >
      <div class="full-screen">
        <i
          class="el-icon-full-screen"
          style="cursor: pointer; font-size: 18px"
          @click="fullscreen = true"
          v-if="!fullscreen"
        ></i>
        <!-- <img
          src="../../../static/img/no-full.svg"
          alt=""
          v-else
          style="cursor: pointer"
          @click="fullscreen = false"
        /> -->
      </div>
      <div style="height: 75vh" v-if="approveVisible">
        <onlyoffice
          ref="onlyoffice"
          :options="option"
          style="width: 100%; height: 100%"
        />
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button
          @click="approveReasonVisible = true"
          :disabled="loadingApprove"
          >不批准</el-button
        >
        <el-button type="primary" @click="subApprove" :loading="loadingApprove"
          >批 å‡†</el-button
        >
      </span>
    </el-dialog>
    <el-dialog
      title="不批准原因"
      :visible.sync="approveReasonVisible"
      width="400px"
      :modal-append-to-body="false"
    >
      <div class="search_thing">
        <div class="search_label">不批准原因:</div>
        <div class="search_input">
          <el-input
            size="small"
            placeholder="请输入"
            clearable
            v-model="reason"
          ></el-input>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button
          @click="approveReasonVisible = false"
          :disabled="loadingApproveReason"
          >取消</el-button
        >
        <el-button
          type="primary"
          @click="handleApproveReason"
          :loading="loadingApproveReason"
          >确定</el-button
        >
      </span>
    </el-dialog>
    <el-dialog
      :visible.sync="batchUploadDia"
      title="报告批量上传"
      width="30%"
      :close-on-click-modal="false"
      top="5vh"
    >
      <div>
        <!-- <el-upload
            class="upload-demo"
            :action="action"
            :headers="headers"
            :show-file-list="false"
            accept=".doc,.docx"
            :limit="1"
            :before-upload="beforeUpload"
            :on-success="handleSuccess"
            ref="upload"
            :on-error="onError">
          </el-upload> -->
        <el-upload
          ref="upload"
          class="upload-demo custom-upload"
          drag
          show-file-list
          accept=".doc,.docx"
          :action="action"
          :headers="headers"
          :on-error="onError"
          :before-upload="beforeUpload"
          :file-list="fileList"
          :auto-upload="false"
          :limit="100"
          :on-exceed="uploadExceed"
          :on-success="handleSuccess"
          multiple
        >
          <i class="el-icon-upload"></i>
          <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
          <div class="el-upload__tip" slot="tip">
            åªèƒ½ä¸Šä¼ .doc/.docx文件,且单个文件不超过10MB
          </div>
        </el-upload>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button size="small" type="primary" @click="submitUpload"
          >确认上传</el-button
        >
      </span>
    </el-dialog>
    <!-- æŠ¥å‘Šæ‰¹é‡å®¡æ‰¹å¼¹æ¡† -->
    <el-dialog
      :visible.sync="oneClickApprovalDialog"
      title="报告批量审批"
      width="40%"
      :close-on-click-modal="false"
      top="5vh"
    >
      <div>
        <el-result
          icon="error"
          v-show="progressData.hasException != null"
          title="错误信息"
          :subTitle="progressData.hasException"
        ></el-result>
        <el-result
          icon="success"
          v-show="isSuccess && progressData.hasException == null"
          title="成功信息"
          subTitle="报告审批完成"
        ></el-result>
        <el-progress
          :percentage="progressData.hasNum"
          :color="customColors"
        ></el-progress>
        <el-statistic title="剩余报告数量">
          <template slot="formatter">
            {{ progressData.surplus }}/{{ progressData.hasCount }}
          </template>
        </el-statistic>
      </div>
      <span slot="footer" class="dialog-footer">
        <!-- <el-button size="small" type="primary" @click="confirmApproval"
          >确认</el-button
        > -->
      </span>
    </el-dialog>
    <!-- æ’¤å›žå¼¹æ¡† -->
    <el-dialog
      title="请选择需要撤回的试验室"
      :visible.sync="withdrawDialogVisible"
      width="30%"
      :before-close="handleClose"
    >
      <el-select
        v-model="laboratory"
        multiple
        clearable
        style="width: 100%; margin-bottom: 20px"
        placeholder="请选择试验室"
      >
        <el-option
          v-for="(item, i) in laboratorys"
          :key="i"
          :label="item.label"
          :value="item.value"
        ></el-option>
      </el-select>
      <span slot="footer" class="dialog-footer">
        <el-button @click="handleClose">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="withdrawOperation">ç¡® å®š</el-button>
      </span>
    </el-dialog>
    <!-- å®¡æ‰¹ç­¾åé…ç½®å¼¹æ¡† -->
    <el-dialog
      :visible.sync="approvalConfigDialog"
      title="审批签名配置"
      width="55%"
      :close-on-click-modal="false"
      top="5vh"
    >
      <div v-if="approvalConfigListTX.editor != null">
        <el-divider content-position="left">通信产品实验室</el-divider>
        <el-form
          size="mini"
          :model="approvalConfigListTX"
          inline
          label-position="right"
        >
          <el-row>
            <el-col :span="8">
              <el-form-item label="编制人:" prop="editor">
                <el-select
                  v-model="approvalConfigListTX.editor"
                  placeholder="请选择"
                  style="width: 100%"
                  filterable
                >
                  <el-option-group
                    v-for="(item, index) in Object.keys(personList)"
                    :key="index"
                    :label="item"
                  >
                    <el-option
                      v-for="op in personList[item]"
                      :key="op.id"
                      :label="op.name"
                      :value="op.id"
                    >
                    </el-option>
                  </el-option-group>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="审核人:" prop="examiner">
                <el-select
                  v-model="approvalConfigListTX.examiner"
                  placeholder="请选择"
                  style="width: 100%"
                  filterable
                >
                  <el-option-group
                    v-for="(item, index) in Object.keys(personList)"
                    :key="index"
                    :label="item"
                  >
                    <el-option
                      v-for="op in personList[item]"
                      :key="op.id"
                      :label="op.name"
                      :value="op.id"
                    >
                    </el-option>
                  </el-option-group>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="批准人:" prop="approver">
                <el-select
                  v-model="approvalConfigListTX.approver"
                  placeholder="请选择"
                  style="width: 100%"
                  filterable
                >
                  <el-option-group
                    v-for="(item, index) in Object.keys(personList)"
                    :key="index"
                    :label="item"
                  >
                    <el-option
                      v-for="op in personList[item]"
                      :key="op.id"
                      :label="op.name"
                      :value="op.id"
                    >
                    </el-option>
                  </el-option-group>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <br />
      <div v-if="approvalConfigListDL.editor != null">
        <el-divider content-position="left">电力产品实验室</el-divider>
        <el-form
          size="mini"
          :model="approvalConfigListDL"
          inline
          label-position="right"
        >
          <el-row>
            <el-col :span="8">
              <el-form-item label="编制人:" prop="editor">
                <el-select
                  v-model="approvalConfigListDL.editor"
                  placeholder="请选择"
                  style="width: 100%"
                  filterable
                >
                  <el-option-group
                    v-for="(item, index) in Object.keys(personList)"
                    :key="index"
                    :label="item"
                  >
                    <el-option
                      v-for="op in personList[item]"
                      :key="op.id"
                      :label="op.name"
                      :value="op.id"
                    >
                    </el-option>
                  </el-option-group>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="审核人:" prop="examiner">
                <el-select
                  v-model="approvalConfigListDL.examiner"
                  placeholder="请选择"
                  style="width: 100%"
                  filterable
                >
                  <el-option-group
                    v-for="(item, index) in Object.keys(personList)"
                    :key="index"
                    :label="item"
                  >
                    <el-option
                      v-for="op in personList[item]"
                      :key="op.id"
                      :label="op.name"
                      :value="op.id"
                    >
                    </el-option>
                  </el-option-group>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="批准人:" prop="approver">
                <el-select
                  v-model="approvalConfigListDL.approver"
                  placeholder="请选择"
                  style="width: 100%"
                  filterable
                >
                  <el-option-group
                    v-for="(item, index) in Object.keys(personList)"
                    :key="index"
                    :label="item"
                  >
                    <el-option
                      v-for="op in personList[item]"
                      :key="op.id"
                      :label="op.name"
                      :value="op.id"
                    >
                    </el-option>
                  </el-option-group>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button size="small" type="primary" @click="confirmApprovalConfig"
          >确认</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {};
</script>
import limsTable from "@/components/Table/lims-table.vue";
import onlyoffice from "../reportPreparation/onlyoffice.vue";
import {
  pageInsReport,
  inReport,
  upAll,
  getLaboratoryByReportId,
  withdraw,
  updateApproveConfig,
  getUserList,
  getApproveConfigList,
  downAll,
  getBatchApprovalProgress,
  getReportCountInfo,
  downReport,
  upReportUrl,
  ratifyReport,
  writeReport,
  examineReport,
  downLoad,
  getReportInfo,
} from "../../../api/business/reportPreparation";
<style></style>
export default {
  components: {
    limsTable,
    onlyoffice,
  },
  data() {
    return {
      tagField: {
        isUpload: {
          select: [
            {
              value: 0,
              type: "danger",
              label: "未上传",
            },
            {
              value: 1,
              type: "success",
              label: "已上传",
            },
          ],
        },
        isRatify: {
          select: [
            {
              value: -9,
              type: "info",
              label: "未批准",
            },
            {
              value: 0,
              type: "danger",
              label: "不批准",
            },
            {
              value: 1,
              type: "success",
              label: "批准",
            },
          ],
        },
        isExamine: {
          select: [
            {
              value: -9,
              type: "info",
              label: "未审核",
            },
            {
              value: 0,
              type: "danger",
              label: "不通过",
            },
            {
              value: 1,
              type: "success",
              label: "通过",
            },
          ],
        },
        state: {
          select: [
            {
              value: 0,
              type: "danger",
              label: "待提交",
            },
            {
              value: 1,
              type: "success",
              label: "已提交",
            },
          ],
        },
      },
      entity: {
        isUpload: null,
        entrustCode: null,
        state: null,
        isExamine: null,
        isRatify: null,
        code: null,
        createTimeRange: [],
      },
      withdrawDialogVisible: false,
      laboratory: [],
      laboratorys: [],
      isSuccess: false,
      time: null,
      //审批进度对象
      progressData: {
        hasProgress: false,
        hasNum: 0,
        hasCount: 0,
        hasException: null,
        surplus: 0,
      },
      personList: [],
      approvalConfigListTX: {
        editor: null,
        examiner: null,
        approver: null,
      }, //审批签名配置列表
      approvalConfigListDL: {
        editor: null,
        examiner: null,
        approver: null,
      }, //审批签名配置列表
      approvalConfigDialog: false,
      approvalConfigLoading: false,
      surplusReportNum: 0,
      percentage: 0,
      customColors: [
        { color: "#f56c6c", percentage: 20 },
        { color: "#e6a23c", percentage: 40 },
        { color: "#5cb87a", percentage: 60 },
        { color: "#1989fa", percentage: 80 },
        { color: "#6f7ad3", percentage: 100 },
      ],
      oneClickApprovalDialog: false,
      approvalLoading: false,
      isShowMore: false,
      more: false,
      fileList: [],
      batchUploadDia: false,
      viewIssuedVisible: false,
      tableData: [],
      column: [
        {
          label: "报告编号",
          prop: "code",
        },
        {
          label: "上传状态",
          prop: "isUpload",
          dataType: "tag",
          formatData: (params) => {
            return params == 1 ? "已上传" : "未上传";
          },
          formatType: (params) => {
            return params == 1 ? "success" : "danger";
          },
        },
        {
          label: "创建时间",
          prop: "createTime",
        },
        {
          label: "提交人",
          prop: "writeUserName",
        },
        {
          label: "提交状态",
          prop: "state",
          dataType: "tag",
          formatData: (params) => {
            return params == 1 ? "已提交" : "待提交";
          },
          formatType: (params) => {
            return params == 1 ? "success" : "danger";
          },
        },
        {
          label: "提交时间",
          prop: "writeTime",
        },
        {
          label: "审核人",
          prop: "examineUser",
        },
        {
          label: "审核状态",
          prop: "isExamine",
          dataType: "tag",
          formatData: (params) => {
            let farmat = "";
            if (params == 0) {
              farmat = "不通过";
            } else if (params == 1) {
              farmat = "通过";
            } else {
              farmat = "未审核";
            }
            return farmat;
          },
          formatType: (params) => {
            let farmat = "";
            if (params == 0) {
              farmat = "danger";
            } else if (params == 1) {
              farmat = "success";
            } else {
              farmat = "info";
            }
            return farmat;
          },
        },
        {
          label: "审核备注",
          prop: "examineTell",
        },
        {
          label: "审核时间",
          prop: "examineTime",
        },
        {
          label: "批准人",
          prop: "ratifyUser",
        },
        {
          label: "批准状态",
          prop: "isRatify",
          dataType: "tag",
          formatData: (params) => {
            let farmat = "";
            if (params == 0) {
              farmat = "不批准";
            } else if (params == 1) {
              farmat = "批准";
            } else {
              farmat = "未批准";
            }
            return farmat;
          },
          formatType: (params) => {
            let farmat = "";
            if (params == 0) {
              farmat = "danger";
            } else if (params == 1) {
              farmat = "sucess";
            } else {
              farmat = "info";
            }
            return farmat;
          },
        },
        {
          label: "批准备注",
          prop: "ratifyTell",
        },
        {
          label: "批准时间",
          prop: "ratifyTime",
        },
        {
          dataType: "action",
          fixed: "right",
          label: "操作",
          operation: [
            {
              name: "编制",
              type: "text",
              clickFun: (row) => {
                this.handleWeave(row);
              },
              disabled: (row) => {
                return row.isExamine != -9;
              },
            },
            {
              name: "下载",
              type: "text",
              clickFun: (row) => {
                this.download(row);
              },
            },
            {
              name: "上传",
              type: "upload",
              url: "/file/attachmentType/upload",
              data: (row) => {
                return {
                  id: row.id,
                  type: 1,
                };
              },
              uploadIdFun: (row) => {
                return row.id;
              },
              disabled: (row) => {
                return row.isExamine != -9;
              },
            },
            {
              name: "还原",
              type: "text",
              clickFun: (row) => {
                this.handleRestore(row);
              },
              disabled: (row) => {
                return row.isExamine != -9;
              },
            },
            {
              name: "提交",
              type: "text",
              clickFun: (row) => {
                this.handleSubmit(row);
              },
              disabled: (row) => {
                return row.state != 0;
              },
            },
            {
              name: "审核",
              type: "text",
              clickFun: (row) => {
                this.handleIssued(row);
              },
              disabled: (row) => {
                return (
                  row.state == null || row.state == 0 || row.isExamine == 1
                );
              },
            },
            {
              name: "批准",
              type: "text",
              clickFun: (row) => {
                this.handleApprove(row);
              },
              disabled: (row) => {
                return (
                  row.state == null ||
                  row.state == 0 ||
                  row.isExamine == 0 ||
                  row.isExamine == -9 ||
                  row.isRatify == 1
                );
              },
            },
            {
              name: "撤回",
              type: "text",
              clickFun: (row) => {
                this.withdraw(row);
              },
              disabled: (row) => {
                return row.state == 1;
              },
            },
          ],
        },
      ],
      page: {
        total: 0,
        size: 10,
        current: 1,
      },
      tableLoading: false,
      entityCopy: {},
      upIndex: 0,
      statusList: [],
      claimVisible: false,
      issuedVisible: false,
      issuedReasonVisible: false,
      approveVisible: false,
      approveReasonVisible: false,
      fullscreen: false,
      loadingApproveReason: false,
      loadingApprove: false,
      loadingIssuedReason: false,
      loadingIssued: false,
      value: ``,
      reason: "",
      currentInfo: null,
      option: null,
      mutiList: [],
      outLoading: false,
      inLoading: false,
      maxNum: 1,
      unSubmitCount: 0,
      unRatifyCount: 0,
      unExamineCount: 0,
    };
  },
  computed: {
    headers() {
      return {
        token: sessionStorage.getItem("token"),
      };
    },
    action() {
      return "";
    },
  },
  created() {
    this.getAuthorizedPerson();
    this.handleResize();
    // ç›‘听窗口大小改变事件
    window.addEventListener("resize", this.handleResize);
  },
  beforeDestroy() {
    if (this.time != null) {
      clearInterval(this.time);
      this.time = null;
    }
    this.progressData = {
      hasProgress: false,
      hasNum: 0,
      hasCount: 0,
      hasException: null,
      surplus: 0,
    };
    window.removeEventListener("resize", this.handleResize);
  },
  mounted() {
    this.entityCopy = this.HaveJson(this.entity);
    this.getList();
    this.getReportCountInfo();
  },
  watch: {
    batchUploadDia(newVal) {
      if (!newVal) {
        this.$refs.upload.clearFiles();
        this.fileList = [];
      }
    },
    progressData(newVal) {
      if (newVal && newVal.hasNum == 100) {
        clearInterval(this.time);
        this.$message.success("报告审批完成");
        this.isSuccess = true;
        this.mutiList = [];
        this.refresh();
      } else if (
        newVal &&
        newVal.hasException != null &&
        newVal.hasException != ""
      ) {
        clearInterval(this.time);
      }
    },
    oneClickApprovalDialog(newVal) {
      if (!newVal) {
        this.isSuccess = false;
        this.progressData = {
          hasProgress: false,
          hasNum: 0,
          hasCount: 0,
          hasException: null,
          surplus: 0,
        };
      }
    },
  },
  methods: {
    // è¿”回分页值
    pagination({ page, limit }) {
      this.page.current = page;
      this.page.size = limit;
      this.getList();
    },
    getList() {
      this.tableLoading = true;
      if (!this.entity.createTimeRange) {
        this.entity.createTimeRange = [];
      }
      const data = { ...this.page, ...this.entity };
      pageInsReport(data)
        .then((res) => {
          this.tableData = res.data.records;
          this.page.total = res.data.total;
          this.tableLoading = false;
        })
        .catch((error) => {
          console.error(error);
          this.tableLoading = false;
        });
    },
    // æ’¤å›ž å¼¹æ¡†
    withdraw(row) {
      getLaboratoryByReportId(row.id).then((res) => {
        this.laboratorys = res.data;
        this.reportId = row.id;
        this.withdrawDialogVisible = true;
      });
    },
    withdrawOperation() {
      if (this.laboratory.length == 0) {
        this.$message.error("请选择需要撤回的试验室");
        return;
      }
      let data = {
        laboratory: JSON.stringify(this.laboratory),
        id: this.reportId,
      };
      withdraw(data).then((res) => {
        if (res.code == 200) {
          this.$message.success("撤回成功");
          this.withdrawDialogVisible = false;
          this.refresh();
        }
      });
    },
    handleCommand(command) {
      switch (command) {
        case "batchDownload":
          //批量下载
          this.handleDowns();
          break;
        case "batchUpload":
          //批量上传
          this.openBatchUploadDia();
          break;
        case "oneClickApproval":
          //一键审批
          this.oneClickApproval();
          break;
        case "approvalConfig":
          //审批签名配置
          this.openApprovalConfig();
          break;
      }
    },
    //确认更新审批签名配置
    confirmApprovalConfig() {
      let data = [];
      if (this.approvalConfigListTX.id) {
        data.push(this.approvalConfigListTX);
      }
      if (this.approvalConfigListDL.id) {
        data.push(this.approvalConfigListDL);
      }
      updateApproveConfig({ configList: data })
        .then((res) => {
          if (res.code == 200) {
            this.$message.success("更新成功");
            this.approvalConfigDialog = false;
          }
        })
        .catch((error) => {
          console.error(error);
        });
    },
    //获取人员信息
    getAuthorizedPerson() {
      getUserList()
        .then((res) => {
          this.personList = res.data;
        })
        .catch((error) => {
          console.error(error);
        });
    },
    //打开审批签名配置弹框
    openApprovalConfig() {
      getApproveConfigList()
        .then((res) => {
          if (res.code !== 201) {
            res.data.forEach((ele) => {
              if (ele.laboratory == "通信产品实验室") {
                this.approvalConfigListTX = { ...ele };
              }
              if (ele.laboratory == "电力产品实验室") {
                this.approvalConfigListDL = { ...ele };
              }
            });
          }
        })
        .catch((error) => {
          console.error(error);
        });
      this.$nextTick(() => {
        this.approvalConfigDialog = true;
      });
    },
    //确认审批
    confirmApproval() {},
    //一键审批按钮
    oneClickApproval() {
      if (this.mutiList.length == 0) {
        this.$message.error("请选择要审批的报告");
        return;
      }
      //执行审批
      if (!this.progressData.hasProgress) {
        //未审批的报告
        let unApprovalList = this.mutiList.filter(
          (ele) => ele.isExamine == -9 || ele.isRatify == -9
        );
        let entity = this.entity;
        //根据查询条件过滤已选择的数据
        let ids = unApprovalList
          .filter((f) =>
            entity.isExamine != null && entity.isExamine !== ""
              ? f.isExamine === entity.isExamine
              : true
          )
          .filter((f) =>
            entity.isRatify != null && entity.isRatify !== ""
              ? f.isRatify === entity.isRatify
              : true
          )
          .filter((f) =>
            entity.isUpload != null && entity.isUpload !== ""
              ? f.isUpload === entity.isUpload
              : true
          )
          .filter((f) =>
            entity.code != null && entity.code !== ""
              ? f.code.indexOf(entity.code) >= 0
              : true
          )
          .filter((f) =>
            entity.state != null && entity.state !== ""
              ? f.state === entity.state
              : true
          )
          .map((ele) => ele.id);
        batchApprovalReport({ ids: ids })
          .then((res) => {
            if (res.code != 201) {
              //查询审批进度
              this.time = setInterval(() => {
                this.getProgress();
              }, 500);
            }
          })
          .catch((error) => {
            console.error(error);
            clearInterval(this.time);
          });
      }
      // this.getProgress();
      this.$nextTick(() => {
        this.oneClickApprovalDialog = true;
      });
    },
    getProgress() {
      getBatchApprovalProgress().then((res) => {
        this.progressData = res.data;
      });
    },
    // å®šä¹‰ä¸€ä¸ªå‡½æ•°æ¥å¤„理视口宽度变化
    handleResize() {
      //视口宽度
      let windowWidth = window.innerWidth;
      //减去左边菜单栏宽度92,页边距40,右边的操作按钮宽度viewportWidth*33.33333%
      let viewportWidth = windowWidth - 92 - 40;
      //搜索表单最大宽度
      let formMaxWidth = viewportWidth - viewportWidth * 0.3333333;
      //单个搜索框宽度为230
      this.maxNum = formMaxWidth / 230;
    },
    //批量上传报告
    openBatchUploadDia() {
      this.batchUploadDia = true;
    },
    // æŸ¥çœ‹æŠ¥å‘Š
    viewIssued(row) {
      this.currentInfo = row;
      console.log(`output->row`, row);
      let fileName = row.urlS === null || row.urlS === "" ? row.url : row.urlS;
      let fileType = "docx";
      if (row.tempUrlPdf != null || row.tempUrlPdf === "") {
        fileName = row.tempUrlPdf;
        fileType = "pdf";
      }
      fileName = fileName.replace("/word/", "");
      const userName = JSON.parse(localStorage.getItem("user")).name;
      this.option = {
        url: this.javaApi + "/word/" + fileName,
        isEdit: false,
        fileType: fileType,
        title: fileName,
        lang: "zh-CN",
        isPrint: false,
        user_id: 1,
        user_name: userName,
        editUrl:
          this.javaApi + "/insReport/onlyOffice/save?fileName=" + fileName,
      };
      console.log(this.javaApi + "/word/" + fileName);
      this.viewIssuedVisible = true;
    },
    handleChange(arr) {
      this.mutiList = arr;
    },
    handleDowns() {
      if (this.mutiList.length == 0) {
        this.$message.error("请选择报告");
        return;
      }
      let entity = this.entity;
      //根据查询条件过滤已选择的数据
      let str = this.mutiList
        .filter((f) =>
          entity.isExamine != null && entity.isExamine !== ""
            ? f.isExamine === entity.isExamine
            : true
        )
        .filter((f) =>
          entity.isRatify != null && entity.isRatify !== ""
            ? f.isRatify === entity.isRatify
            : true
        )
        .filter((f) =>
          entity.isUpload != null && entity.isUpload !== ""
            ? f.isUpload === entity.isUpload
            : true
        )
        .filter((f) =>
          entity.code != null && entity.code !== ""
            ? f.code.indexOf(entity.code) >= 0
            : true
        )
        .filter((f) =>
          entity.state != null && entity.state !== ""
            ? f.state === entity.state
            : true
        )
        .map((m) => m.id)
        .join(",");
      if (str === "" || str == null) {
        this.$message.error("没有符合条件的数据!");
        return;
      }
      this.outLoading = true;
      downAll({ ids: str }).then((res) => {
        this.outLoading = false;
        this.$message.success("导出成功");
        // const blob = new Blob([res],{ type: 'application/octet-stream' });
        // const url = URL.createObjectURL(blob);
        // const link = document.createElement('a');
        // link.href = url;
        // link.download = '报告.zip';
        // link.click();
        const link = document.createElement("a");
        link.href = this.javaApi + res.message;
        link.target = "_blank";
        document.body.appendChild(link);
        link.click();
        //下载完成,重置表格
        this.$nextTick(() => {
          this.refresh();
        });
      });
    },
    uploadExceed(file, fileList) {
      this.$message.error("同时上传文件数目最大为100,请重试");
    },
    submitUpload() {
      this.$refs.upload.submit();
    },
    beforeUpload(file) {
      const docxType = [
        "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
        "application/msword",
      ];
      if (!docxType.includes(file.type)) {
        this.$message.error("只能上传类型为.doc/.docx的文件");
        return false;
      }
      const maxSize = 10 * 1024 * 1024; //单个文件最大上传大小10MB
      if (file.size > maxSize) {
        this.$message.error("文件" + file.name + "大小超过10MB");
        return false;
      }
      return true;
      // const isZip = file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' || file.name.endsWith('.zip');
      // if (!isZip) {
      //   this.$message.error('上传文件只能是 ZIP æ ¼å¼!');
      // }
      // if(isZip){
      //   this.inLoading = true;
      // }
      // return isZip;
    },
    handleSuccess(response) {
      this.inLoading = false;
      if (response.code == 200) {
        this.$message.success("导入成功");
        this.refreshTable();
        this.$refs.upload.clearFiles();
        this.fileList = [];
      } else {
        this.$message.error(response.message);
      }
    },
    onError(err, file, fileList, type) {
      this.$message.error("上传失败");
      this.$refs.upload.clearFiles();
      this.fileList = [];
    },
    refreshTable(e) {
      if (!this.entity.createTimeRange) {
        this.entity.createTimeRange = [];
      }
      this.getList();
      this.getReportCountInfo();
    },
    getReportCountInfo() {
      if (!this.entity.createTimeRange) {
        this.entity.createTimeRange = [];
      }
      console.log("entity", this.entity);
      getReportCountInfo(this.entity)
        .then((res) => {
          this.unSubmitCount = res.data.unSubmitCount;
          this.unRatifyCount = res.data.unRatifyCount;
          this.unExamineCount = res.data.unExamineCount;
        })
        .catch((error) => {
          console.error(error);
        });
    },
    refresh() {
      this.entity = this.HaveJson(this.entityCopy);
      this.upIndex++;
      this.mutiList = [];
      this.getReportCountInfo();
    },
    async handleWeave(row) {
      let fileName = row.urlS === null || row.urlS === "" ? row.url : row.urlS;
      fileName = fileName.replace("/word/", "");
      const userName = this.$store.state.user.name;
      //参考vabOnlyOffice组件参数配置
      const { href } = this.$router.resolve({
        path: `/wordEdit`,
        query: {
          url: this.javaApi + "/word/" + fileName,
          isEdit: true,
          fileType: "docx",
          title: fileName,
          lang: "zh-CN",
          isPrint: true,
          user_id: 1,
          user_name: userName,
          editUrl:
            this.javaApi + "/insReport/onlyOffice/save?fileName=" + fileName,
        },
      });
      window.open(href, "_blank");
    },
    confirmClaim() {
      // console.log(this.$refs.Word.getValue())
    },
    async selectAllByOne(row) {
      const userName = JSON.parse(localStorage.getItem("user")).name;
      //参考vabOnlyOffice组件参数配置
      const { href } = this.$router.resolve({
        path: `/wordEdit`,
        query: {
          url: this.javaApi + "/word/" + row.entrustCode + ".docx",
          isEdit: "false",
          fileType: "docx",
          title: row.entrustCode + ".docx",
          lang: "zh-CN",
          isPrint: true,
          user_id: 1,
          user_name: userName,
        },
      });
      window.open(href, "_blank");
      console.log(`output->row`, row);
    },
    download(row) {
      getReportInfo({ id: row.id, type: 1,suffix:'.docx' }).then((response) => {
        if (response.data && response.data.contentType) {
          downLoad({ id: row.id, type: 1, code: row.code,suffix: '.docx' })
            .then((res) => {
              // èŽ·å–æ–‡ä»¶å
              const blob = new Blob([res], { type: response.data.contentType });
              const url = URL.createObjectURL(blob);
              let link = document.createElement("a");
              link.href = url;
              link.download = row.code;
              document.body.appendChild(link);
              link.click();
              document.body.removeChild(link);
              URL.revokeObjectURL(url);
            })
            .catch((error) => {
              this.$message.error(error);
            });
        } else {
          this.$message.error("未找到文件");
        }
      });
    },
    // è¿˜åŽŸæ“ä½œ
    handleRestore(row) {
      this.$confirm("是否还原当前报告?", "还原", {
        confirmButtonText: "还原",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          upReportUrl({ id: row.id,type:1 }).then((res) => {
            if (res.code === 200) {
              this.$message.success("操作成功");
              this.refreshTable("page");
            }
          });
        })
        .catch({}());
    },
    handleIssued(row) {
      this.currentInfo = row;
      let fileName = row.urlS === null || row.urlS === "" ? row.url : row.urlS;
      fileName = fileName.replace("/word/", "");
      const userName = JSON.parse(localStorage.getItem("user")).name;
      this.option = {
        url: this.javaApi + "/word/" + fileName,
        isEdit: false,
        fileType: "docx",
        title: fileName,
        lang: "zh-CN",
        isPrint: false,
        user_id: 1,
        user_name: userName,
        editUrl:
          this.javaApi + "/insReport/onlyOffice/save?fileName=" + fileName,
      };
      this.issuedVisible = true;
    },
    // å®¡æ ¸é€šè¿‡
    subIssued() {
      this.loadingIssued = true;
      examineReport({ id: this.currentInfo.id, isExamine: 1 })
        .then((res) => {
          this.loadingIssued = false;
          if (res.code === 201) {
            return;
          }
          this.$message.success("提交成功");
          this.refreshTable("page");
          this.currentInfo = null;
          this.issuedVisible = false;
        })
        .catch((e) => {
          this.$message.error("提交失败");
          this.loadingIssued = false;
        });
    },
    handleApprove(row) {
      this.currentInfo = row;
      let fileName = row.urlS === null || row.urlS === "" ? row.url : row.urlS;
      fileName = fileName.replace("/word/", "");
      const userName = JSON.parse(localStorage.getItem("user")).name;
      this.option = {
        url: this.javaApi + "/word/" + fileName,
        isEdit: false,
        fileType: "docx",
        title: fileName,
        lang: "zh-CN",
        isPrint: false,
        user_id: 1,
        user_name: userName,
        editUrl:
          this.javaApi + "/insReport/onlyOffice/save?fileName=" + fileName,
      };
      this.approveVisible = true;
    },
    // æ‰¹å‡†é€šè¿‡
    subApprove() {
      this.loadingApprove = true;
      ratifyReport({ id: this.currentInfo.id, isRatify: 1 }).then((res) => {
        this.loadingApprove = false;
        if (res.code == 201) {
          this.$message.error("批准失败");
          return;
        }
        this.$message.success("已批准");
        this.refreshTable("page");
        this.currentInfo = null;
        this.approveVisible = false;
      });
    },
    // æäº¤æ“ä½œ
    handleSubmit(row) {
      this.$confirm("是否提交当前报告?", "提交", {
        confirmButtonText: "提交",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          writeReport({ id: row.id })
            .then((res) => {
              if (res.code === 201) {
                return;
              }
              this.$message.success("提交成功");
              this.refreshTable("page");
            })
            .catch((e) => {
              this.$message.error("提交失败");
            });
        })
        .catch(() => {});
    },
    // å®¡æ ¸ä¸é€šè¿‡åŽŸå› æäº¤
    handleIssuedReason() {
      if (!this.reason) {
        return this.$message.error("请输入原因");
      }
      this.loadingIssuedReason = true;
      examineReport({
        id: this.currentInfo.id,
        isExamine: 0,
        examineTell: this.reason,
      })
        .then((res) => {
          this.loadingIssuedReason = false;
          if (res.code === 201) {
            return;
          }
          this.$message.success("操作成功");
          this.refreshTable("page");
          this.currentInfo = null;
          this.reason = "";
          this.issuedVisible = false;
          this.issuedReasonVisible = false;
        })
        .catch((e) => {
          this.$message.error("操作失败");
          this.loadingIssuedReason = false;
        });
    },
    // ä¸æ‰¹å‡†åŽŸå› æäº¤
    handleApproveReason() {
      if (!this.reason) {
        return this.$message.error("请输入原因");
      }
      this.loadingApproveReason = true;
      examineReport({
        id: this.currentInfo.id,
        isRatify: 0,
        ratifyTell: this.reason,
      })
        .then((res) => {
          this.loadingApproveReason = false;
          if (res.code === 201) {
            return;
          }
          this.$message.success("操作成功");
          this.refreshTable("page");
          this.currentInfo = null;
          this.reason = "";
          this.issuedVisible = false;
          this.issuedReasonVisible = false;
        })
        .catch((e) => {
          this.$message.error("操作失败");
          this.loadingIssuedReason = false;
        });
    },
    handleClose() {
      this.withdrawDialogVisible = false;
      this.laboratory = [];
    },
    getStyle() {
      return "height: calc(100% - " + (this.more ? "94" : "44") + "px)";
    },
  },
};
</script>
src/views/business/reportPreparation/onlyoffice.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,207 @@
<!--onlyoffice ç¼–辑器-->
<template>
    <div id="vabOnlyOffice"></div>
  </template>
  <script>
  export default {
    name: "VabOnlyOffice",
    props: ['options'],
    data() {
      return {
        doctype: "",
        docEditor: null,
        //参考vabOnlyOffice组件参数配置
        option: {
          url: "",
          isEdit: false,
          fileType: "",
          title: "",
          lang: "zh-CN",
          isPrint: true,
          user: {},
          editUrl: ""
        }
      };
    },
    created() {
      if(this.options){
        const option = this.options
        this.option.url = option.url
        this.option.isEdit = option.isEdit === "true" ? true : false
        this.option.fileType = option.fileType
        this.option.title = option.title
        this.option.lang = option.lang
        this.option.isPrint = option.isPrint
        this.option.user.id = option.user_id
        this.option.user.name = option.user_name
        this.option.editUrl = option.editUrl
      }else{
        const option = this.$route.query
        this.option.url = option.url
        this.option.isEdit = option.isEdit === "true" ? true : false
        this.option.fileType = option.fileType
        this.option.title = option.title
        this.option.lang = option.lang
        this.option.isPrint = option.isPrint
        this.option.user.id = option.user_id
        this.option.user.name = option.user_name
        this.option.editUrl = option.editUrl
      }
    },
    beforeDestroy() {
      if (this.docEditor !== null) {
        this.docEditor.destroyEditor();
        this.docEditor = null;
      }
    },
    watch: {
      option: {
        handler: function(n) {
          this.setEditor(n);
          this.doctype = this.getFileType(n.fileType);
        },
        deep: true
      }
    },
    mounted() {
      if (this.option.url) {
        this.setEditor(this.option);
      }
    },
    methods: {
      async setEditor(option) {
        if (this.docEditor !== null) {
          this.docEditor.destroyEditor();
          this.docEditor = null;
        }
        this.doctype = this.getFileType(option.fileType);
        let config = {
          document: {
            //后缀
            fileType: option.fileType,
            key: option.key || "",
            title: option.title,
            permissions: {
              edit: option.isEdit, //是否可以编辑: åªèƒ½æŸ¥çœ‹ï¼Œä¼ false
              print: option.isPrint,
              download: false
              // "fillForms": true,//是否可以填写表格,如果将mode参数设置为edit,则填写表单仅对文档编辑器可用。 é»˜è®¤å€¼ä¸Žedit或review参数的值一致。
              // "review": true //跟踪变化
            },
            url: option.url
          },
          documentType: this.doctype,
          editorConfig: {
            callbackUrl: option.editUrl, //"编辑word后保存时回调的地址,这个api需要自己写了,将编辑后的文件通过这个api保存到自己想要的位置
            lang: option.lang, //语言设置
            //定制
            customization: {
              autosave: true, //是否自动保存
              chat: true,
              comments: false,
              help: false,
              "hideRightMenu": false,//定义在第一次加载时是显示还是隐藏右侧菜单。 é»˜è®¤å€¼ä¸ºfalse
              //是否显示插件
              plugins: false
            },
            user: {
              id: option.user.id,
              name: option.user.name
            },
            mode: option.model ? option.model : "edit"
          },
          width: "100%",
          height: "100%",
          token: option.token || ""
        };
        // eslint-disable-next-line no-undef,no-unused-vars
        this.docEditor = new DocsAPI.DocEditor("vabOnlyOffice", config);
      },
      getFileType(fileType) {
        let docType = "";
        let fileTypesDoc = [
          "doc",
          "docm",
          "docx",
          "dot",
          "dotm",
          "dotx",
          "epub",
          "fodt",
          "htm",
          "html",
          "mht",
          "odt",
          "ott",
          "pdf",
          "rtf",
          "txt",
          "djvu",
          "xps"
        ];
        let fileTypesCsv = [
          "csv",
          "fods",
          "ods",
          "ots",
          "xls",
          "xlsm",
          "xlsx",
          "xlt",
          "xltm",
          "xltx"
        ];
        let fileTypesPPt = [
          "fodp",
          "odp",
          "otp",
          "pot",
          "potm",
          "potx",
          "pps",
          "ppsm",
          "ppsx",
          "ppt",
          "pptm",
          "pptx"
        ];
        if (fileTypesDoc.includes(fileType)) {
          docType = "text";
        }
        if (fileTypesCsv.includes(fileType)) {
          docType = "spreadsheet";
        }
        if (fileTypesPPt.includes(fileType)) {
          docType = "presentation";
        }
        return docType;
      }
    }
  };
  </script>
  <style>
  html,
  body {
    height: 100%;
  }
  #app {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
    height: 100%;
  }
  .qualityManual-container {
    padding: 0 !important;
    height: 100%;
  }
  .qualityManual-container-office {
    width: 100%;
    height: calc(100% - 55px);
  }
  </style>