| | |
| | | }; |
| | | |
| | | const getFileStatus = record => { |
| | | let _beforeProduction = |
| | | record.beforeProduction && record.beforeProduction.length; |
| | | let _afterProduction = |
| | | record.afterProduction && record.afterProduction.length; |
| | | let _productionIssues = |
| | | record.productionIssues && record.productionIssues.length; |
| | | if (_beforeProduction && _afterProduction && _productionIssues) { |
| | | return 2; |
| | | } else if (_beforeProduction || _afterProduction || _productionIssues) { |
| | | return 1; |
| | | // 检查是否有巡检照片 (commonFileListBeforeVO) |
| | | const hasFiles = |
| | | (record.commonFileListBeforeVO && |
| | | record.commonFileListBeforeVO.length > 0) || |
| | | (record.commonFileListAfterVO && record.commonFileListAfterVO.length > 0) || |
| | | (record.commonFileListVO && record.commonFileListVO.length > 0); |
| | | |
| | | if (hasFiles) { |
| | | return 2; // 已完成 |
| | | } else if ( |
| | | record.inspectionResult !== undefined && |
| | | record.inspectionResult !== null |
| | | ) { |
| | | return 1; // 巡检中 (已有结果但没照片,或者根据业务逻辑定义) |
| | | } else { |
| | | return 0; |
| | | return 0; // 未巡检 |
| | | } |
| | | }; |
| | | |
| | |
| | | |
| | | // 查看附件 - 跳转到附件页面 |
| | | const viewAttachments = async task => { |
| | | const taskData = encodeURIComponent(JSON.stringify(task)); |
| | | // 仅传递必要的任务信息和 commonFileListBeforeVO 附件列表 |
| | | const taskInfoToPass = { |
| | | taskName: task.taskName, |
| | | commonFileListBeforeVO: task.commonFileListBeforeVO || [], |
| | | }; |
| | | const taskData = encodeURIComponent(JSON.stringify(taskInfoToPass)); |
| | | uni.navigateTo({ |
| | | url: `/pages/inspectionUpload/attachment?taskInfo=${taskData}`, |
| | | }); |