From dcef075410e936fe3e5283d40619afe8f831cf06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=81=92=E6=88=90?= <962704835@qq.com> Date: Mon, 17 Nov 2025 17:45:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E5=BE=81=E5=85=A5=E4=BC=8D=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E5=AD=A6=E7=B1=8D=E7=94=B3=E8=AF=B7=E8=A1=A8-?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enlistmentReserveAttach.js | 9 + src/components/affix/index.vue | 29 ++- .../enlistmentReserve/applicationForm.vue | 203 +++++++++++++----- .../enlistmentReserveAttach/index.vue | 33 ++- src/views/routine/enlistmentReserve/index.vue | 39 +++- 5 files changed, 243 insertions(+), 70 deletions(-) diff --git a/src/api/routine/enlistmentReserve/enlistmentReserveAttach.js b/src/api/routine/enlistmentReserve/enlistmentReserveAttach.js index 024957e..c85cfbb 100644 --- a/src/api/routine/enlistmentReserve/enlistmentReserveAttach.js +++ b/src/api/routine/enlistmentReserve/enlistmentReserveAttach.js @@ -26,6 +26,15 @@ export function addEnlistmentReserveAttach(data) { }) } +// 批量新增保留学籍申请附件(入伍通知书等) +export function batchAddEnlistmentReserveAttach(data) { + return request({ + url: '/routine/enlistmentReserveAttach/batchAdd', + method: 'post', + data: data + }) +} + // 修改保留学籍申请附件(入伍通知书等) export function updateEnlistmentReserveAttach(data) { return request({ diff --git a/src/components/affix/index.vue b/src/components/affix/index.vue index ce3daee..266316b 100644 --- a/src/components/affix/index.vue +++ b/src/components/affix/index.vue @@ -132,14 +132,23 @@ export default { console.log(res.savePath) if(item.name == res.trueName && item.status == 1){ - this.fileList[i].id = res.id - this.fileList[i].status = 2 - this.fileList[i].savePath = this.baseurl + res.savePath - if(this.isImageURL(res.savePath)){ - this.previewList.push( this.fileList[i].savePath) - } + this.fileList[i].id = res.id + this.fileList[i].status = 2 + this.fileList[i].savePath = this.baseurl + res.savePath + if(this.isImageURL(res.savePath)){ + this.previewList.push( this.fileList[i].savePath) + } // this.fileList[i].savePaths =[this.baseurl + res.savePath]; - + + // 上传成功后,向外传递当前文件的完整信息(包含后端返回的res数据) + this.$emit('fileUploaded', { + fileId: res.id, // 文件ID + fileName: res.trueName, // 文件名 + filePath: res.savePath, // 文件相对路径(不含baseurl) + fullPath: this.fileList[i].savePath, // 完整路径(含baseurl) + fileType: this.getFileType(res.trueName), // 文件类型 + originalFile: file.file // 原始文件对象(可选) + }); } @@ -153,6 +162,12 @@ export default { this.uploadCnt-- }) }, + // 获取文件类型的方法(Affix组件中新增) + getFileType(fileName) { + if (!fileName) return ''; + const lastDotIndex = fileName.lastIndexOf('.'); + return lastDotIndex > -1 ? fileName.substring(lastDotIndex + 1).toLowerCase() : ''; + }, handleBeforeUpload(file) { if (this.affixId == null || this.affixId === '') { diff --git a/src/views/routine/enlistmentReserve/applicationForm.vue b/src/views/routine/enlistmentReserve/applicationForm.vue index cd1338d..c9680c1 100644 --- a/src/views/routine/enlistmentReserve/applicationForm.vue +++ b/src/views/routine/enlistmentReserve/applicationForm.vue @@ -1,5 +1,5 @@