学生资助-问题修复

This commit is contained in:
2026-03-11 11:18:05 +08:00
parent b6337714cc
commit 2c2aa68ce1
6 changed files with 243 additions and 194 deletions

View File

@@ -448,8 +448,9 @@
<script>
import { addApply, updateApply, getApply, infoCheck, getStuByXh, getxh, extraInfo, stuInfoView, getOwnFamily, getCurrentYear, queryByStuNo, getKnrdYear } from '@/api/finance/poverty'
import uploadFile from "@/plugins/upload.js"
import { queryAffixs, getAffixItems } from '@/api/affix'
import uploadFile from "@/plugins/upload.js"
import { queryAffixs, getAffixItems, deleteAffix } from '@/api/affix'
import config from '@/config'
export default {
data() {
return {
@@ -547,7 +548,7 @@
affixFiles: [],
loading: false,
signImg: '',
baseUrl: uni.getStorageSync('baseUrl')
baseUrl: config.baseUrl || ''
}
},
onLoad(option) {
@@ -671,12 +672,13 @@
this.formData.sqrcn = this.formData.sqrcn.toString()
}
// 处理手写签字
if (this.formData.sqrqm) {
// 从sqrqm构造完整的图片URL
this.signImg = this.baseUrl + this.formData.sqrqm
// 处理手写签字支持sqrqm和applySign字段
const signPath = this.formData.sqrqm || this.formData.applySign;
if (signPath) {
// 构造完整的图片URL
this.signImg = this.baseUrl + signPath;
} else {
this.signImg = ''
this.signImg = '';
}
// 处理困难佐证材料
@@ -945,11 +947,7 @@
}
console.log('handleUpload方法被调用');
// 测试点击事件是否正常
uni.showToast({
title: '测试点击事件',
icon: 'none'
});
// 1. 定义affixId生成工具函数确保uuid唯一性
const generateUUID = () => {
@@ -1040,16 +1038,35 @@
});
},
// 删除文件
deleteFile(index) {
async deleteFile(index) {
const deletedFile = this.affixFiles[index];
this.affixFiles.splice(index, 1);
if (this.affixFiles.length === 0) {
this.formData.affixId = null;
if (!deletedFile) return;
try {
// 调用后端删除接口
if (deletedFile.fileId) {
await deleteAffix(deletedFile.fileId);
}
// 从数组中删除文件
this.affixFiles.splice(index, 1);
// 如果没有文件了清空affixId
if (this.affixFiles.length === 0) {
this.formData.affixId = null;
}
uni.showToast({
title: '删除成功',
icon: 'success'
});
} catch (error) {
console.error('删除文件失败:', error);
uni.showToast({
title: '删除失败,请重试',
icon: 'none'
});
}
uni.showToast({
title: '删除成功',
icon: 'success'
});
},
// 预览文件
previewImage(url) {