diff --git a/mobile/src/pages/xg/xsjcxx/xsqj/cancelLeaveEdit/index.vue b/mobile/src/pages/xg/xsjcxx/xsqj/cancelLeaveEdit/index.vue index a215f862..319f069c 100644 --- a/mobile/src/pages/xg/xsjcxx/xsqj/cancelLeaveEdit/index.vue +++ b/mobile/src/pages/xg/xsjcxx/xsqj/cancelLeaveEdit/index.vue @@ -70,7 +70,7 @@ @@ -113,7 +113,7 @@ @@ -337,7 +337,7 @@ + it.leaveTypeCode === typeCode || + it.leave_type_code === typeCode || + it.code === typeCode, + ); + if (matched) { + const needPhotoRaw = + matched.need_photo_on_cancel ?? matched.needPhotoOnCancel; + const needLocationRaw = + matched.need_location_on_cancel ?? matched.needLocationOnCancel; + const needPhotoOnCancel = + String(needPhotoRaw) === '1' || needPhotoRaw === 1; + const needLocationOnCancel = + String(needLocationRaw) === '1' || needLocationRaw === 1; + + if (needPhotoOnCancel) { + const hasRequiredImage = this.attachmentList.some( + (f) => this.isImageFile(f) && f.status === 'success' && f.ossId, + ); + if (!hasRequiredImage) { + uni.showToast({ + title: '该请假类型要求上传销假图片', + icon: 'none', + }); + return; + } + } + if (needLocationOnCancel) { + if (!this.cancelForm.cancelLocation) { + uni.showToast({ + title: '该请假类型要求提供销假定位', + icon: 'none', + }); + return; + } + } + } + } + } + } catch (e) { + console.warn('提交前限制校验失败(忽略并继续):', e?.message || e); + } + // 汇总附件ossIds const cancelPhotoOssIds = this.attachmentList .filter((f) => f.status === 'success' && f.ossId) @@ -1505,7 +1566,7 @@ export default { try { const blobUrl = await this.getImageBlobUrl(file.url); if (blobUrl) { - file.blobUrl = blobUrl; + this.$set(file, 'blobUrl', blobUrl); } } catch (e) { console.warn('处理图片失败:', file?.name, e);