学生资助-问题修复
This commit is contained in:
@@ -262,6 +262,7 @@
|
||||
<script>
|
||||
import { addApply, updateApply, getApply, getOwnFamily, getOwnKnrd, getOwnExtraInfo, getOwnInfo, reApply } from '@/api/finance/special';
|
||||
import uploadFile from "@/plugins/upload.js"
|
||||
import config from '@/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -333,7 +334,7 @@ export default {
|
||||
],
|
||||
affixFiles: [],
|
||||
signImg: '',
|
||||
baseUrl: uni.getStorageSync('baseUrl')
|
||||
baseUrl: config.baseUrl || ''
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
@@ -393,23 +394,27 @@ export default {
|
||||
} else {
|
||||
this.signImg = '';
|
||||
}
|
||||
// 处理困难佐证材料
|
||||
if (this.listData.hardFile) {
|
||||
// 从文件路径中提取文件名
|
||||
const fileName = this.listData.hardFile.split('/').pop();
|
||||
// 构造文件信息对象
|
||||
this.affixFiles = [{
|
||||
attachmentName: fileName,
|
||||
attachmentUrl: this.listData.hardFile,
|
||||
serverUrl: this.listData.hardFile,
|
||||
fileId: '',
|
||||
fileSize: 0,
|
||||
fileSuffix: fileName.split('.').pop().toLowerCase(),
|
||||
savePath: this.listData.hardFile
|
||||
}];
|
||||
} else {
|
||||
this.affixFiles = [];
|
||||
}
|
||||
// 处理困难佐证材料(支持多个文件)
|
||||
if (this.listData.hardFile) {
|
||||
// 分割文件路径字符串
|
||||
const filePaths = this.listData.hardFile.split(',');
|
||||
// 构造文件信息对象数组
|
||||
this.affixFiles = filePaths.map(filePath => {
|
||||
// 从文件路径中提取文件名
|
||||
const fileName = filePath.split('/').pop();
|
||||
return {
|
||||
attachmentName: fileName,
|
||||
attachmentUrl: filePath,
|
||||
serverUrl: filePath,
|
||||
fileId: '',
|
||||
fileSize: 0,
|
||||
fileSuffix: fileName.split('.').pop().toLowerCase(),
|
||||
savePath: filePath
|
||||
};
|
||||
});
|
||||
} else {
|
||||
this.affixFiles = [];
|
||||
}
|
||||
} else {
|
||||
// 否则,调用接口获取申请详情
|
||||
await this.getApplyDetail();
|
||||
@@ -693,23 +698,27 @@ export default {
|
||||
} else {
|
||||
this.signImg = '';
|
||||
}
|
||||
// 处理困难佐证材料
|
||||
if (data.hardFile) {
|
||||
// 从文件路径中提取文件名
|
||||
const fileName = data.hardFile.split('/').pop();
|
||||
// 构造文件信息对象
|
||||
this.affixFiles = [{
|
||||
attachmentName: fileName,
|
||||
attachmentUrl: data.hardFile,
|
||||
serverUrl: data.hardFile,
|
||||
fileId: '',
|
||||
fileSize: 0,
|
||||
fileSuffix: fileName.split('.').pop().toLowerCase(),
|
||||
savePath: data.hardFile
|
||||
}];
|
||||
} else {
|
||||
this.affixFiles = [];
|
||||
}
|
||||
// 处理困难佐证材料(支持多个文件)
|
||||
if (data.hardFile) {
|
||||
// 分割文件路径字符串
|
||||
const filePaths = data.hardFile.split(',');
|
||||
// 构造文件信息对象数组
|
||||
this.affixFiles = filePaths.map(filePath => {
|
||||
// 从文件路径中提取文件名
|
||||
const fileName = filePath.split('/').pop();
|
||||
return {
|
||||
attachmentName: fileName,
|
||||
attachmentUrl: filePath,
|
||||
serverUrl: filePath,
|
||||
fileId: '',
|
||||
fileSize: 0,
|
||||
fileSuffix: fileName.split('.').pop().toLowerCase(),
|
||||
savePath: filePath
|
||||
};
|
||||
});
|
||||
} else {
|
||||
this.affixFiles = [];
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取申请详情失败:', error);
|
||||
@@ -731,6 +740,14 @@ export default {
|
||||
familyMemberList: JSON.stringify(this.familyList),
|
||||
applyDate: new Date()
|
||||
};
|
||||
|
||||
// 处理困难佐证材料,将 affixFiles 转换为 hardFile(支持多个文件,用逗号分隔)
|
||||
if (this.affixFiles.length > 0) {
|
||||
// 将所有文件的路径用逗号分隔拼接成一个字符串
|
||||
submitData.hardFile = this.affixFiles.map(file => file.savePath).join(',');
|
||||
} else {
|
||||
submitData.hardFile = '';
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user