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 @@