学生资助-问题修复
This commit is contained in:
@@ -327,15 +327,14 @@
|
||||
<view class="approval-section">
|
||||
<view class="section-title">学校意见</view>
|
||||
<view class="approval-content">
|
||||
<text v-if="formData.zzdj || formData.xxyj || formData.xxmc || formData.xxyjrq" class="approval-text">已审核</text>
|
||||
<text v-else class="no-content">暂无审核意见</text>
|
||||
</view>
|
||||
<text v-if="formData.zzdj || formData.xxmc || formData.xxyjrq" class="approval-text">已审核</text>
|
||||
<text v-else class="no-content">暂无审核意见</text>
|
||||
</view>
|
||||
<view class="approval-info">
|
||||
<text v-if="formData.zzdj">确认助学金等级:<text class="difficulty-level">{{ getLevelText(formData.zzdj) }}</text></text>
|
||||
<text v-if="formData.xxyj">学校意见:{{ formData.xxyj }}</text>
|
||||
<text v-if="formData.xxmc">审核人:{{ formData.xxmc }}</text>
|
||||
<text v-if="formData.xxyjrq">审核时间:{{ formData.xxyjrq }}</text>
|
||||
</view>
|
||||
<text v-if="formData.zzdj">确认助学金等级:<text class="difficulty-level">{{ getLevelText(formData.zzdj) }}</text></text>
|
||||
<text v-if="formData.xxmc">审核人:{{ formData.xxmc }}</text>
|
||||
<text v-if="formData.xxyjrq">审核时间:{{ formData.xxyjrq }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -377,7 +376,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addApply, updateApply, getApply, getStuInfo, getExtraInfo, getFamilyInfo, getCurrentYear, getAidLevels, getZxjStudentInfo, getOwnStudentInfo, findByXhAndApplyYear } from '@/api/finance/financialaid'
|
||||
import { addApply, updateApply, saveApply, getApply, getStuInfo, getExtraInfo, getFamilyInfo, getCurrentYear, getAidLevels, getZxjStudentInfo, getOwnStudentInfo, findByXhAndApplyYear } from '@/api/finance/financialaid'
|
||||
import uploadFile from "@/plugins/upload.js"
|
||||
import { queryAffixs, getAffixItems, uploadFiles, deleteAffix } from '@/api/affix'
|
||||
import { getUserProfile } from '@/api/system/user'
|
||||
@@ -626,13 +625,17 @@
|
||||
this.formData.sfzhm = stuInfoRes.data.idCard || this.formData.sfzhm || ''
|
||||
}
|
||||
// 处理学生扩展信息
|
||||
if (extraRes.code === 200 && extraRes.data) {
|
||||
// 补充学生扩展信息
|
||||
this.formData.mz = extraRes.data.mz || this.formData.mz || ''
|
||||
this.formData.zzmm = extraRes.data.zzmm || this.formData.zzmm || ''
|
||||
this.formData.dz = extraRes.data.xxlxdz || this.formData.dz || ''
|
||||
this.formData.yb = extraRes.data.jtyzbm || this.formData.yb || ''
|
||||
}
|
||||
if (extraRes.code === 200 && extraRes.data) {
|
||||
// 补充学生扩展信息
|
||||
this.formData.mz = extraRes.data.mz || this.formData.mz || ''
|
||||
this.formData.zzmm = extraRes.data.zzmm || this.formData.zzmm || ''
|
||||
this.formData.dz = extraRes.data.xxlxdz || this.formData.dz || ''
|
||||
this.formData.yb = extraRes.data.jtyzbm || this.formData.yb || ''
|
||||
// 从 extraInfo 接口回显证件照
|
||||
if (extraRes.data.whitePhoto) {
|
||||
this.formData.zp = extraRes.data.whitePhoto
|
||||
}
|
||||
}
|
||||
// 查询贫困申请信息
|
||||
if (this.formData.xh && this.formData.stuYearId) {
|
||||
findByXhAndApplyYear({
|
||||
@@ -924,9 +927,19 @@
|
||||
// 删除文件
|
||||
deleteFile(index) {
|
||||
const deletedFile = this.affixFiles[index];
|
||||
// 从文件列表中移除
|
||||
this.affixFiles.splice(index, 1);
|
||||
if (this.affixFiles.length === 0) {
|
||||
this.formData.affixId = null;
|
||||
// 重新生成 affixId,确保后端知道文件列表已经发生变化
|
||||
this.formData.affixId = this.affixFiles.length > 0 ? this.generateUUID() : null;
|
||||
// 调用后端接口删除文件
|
||||
if (deletedFile.fileId) {
|
||||
deleteAffix(deletedFile.fileId).then(res => {
|
||||
if (res.code === 200) {
|
||||
console.log('文件删除成功');
|
||||
}
|
||||
}).catch(err => {
|
||||
console.error('文件删除失败:', err);
|
||||
});
|
||||
}
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
@@ -954,26 +967,26 @@
|
||||
})
|
||||
},
|
||||
// 保存表单
|
||||
saveForm() {
|
||||
if (!this.validateForm()) {
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
const submitData = { ...this.formData }
|
||||
// 如果有申请ID,则更新申请,否则新增申请
|
||||
const request = this.applyId ? updateApply(submitData) : addApply(submitData)
|
||||
request.then(res => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({ title: '保存成功', icon: 'success' })
|
||||
// 如果是新增申请,保存成功后获取申请ID
|
||||
if (!this.applyId) {
|
||||
this.applyId = res.data.id
|
||||
}
|
||||
saveForm() {
|
||||
if (!this.validateForm()) {
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
const submitData = { ...this.formData }
|
||||
// 如果有申请ID,则更新申请,否则第一次保存调用save接口
|
||||
const request = this.applyId ? updateApply(submitData) : saveApply(submitData)
|
||||
request.then(res => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({ title: '保存成功', icon: 'success' })
|
||||
// 如果是第一次保存,保存成功后获取申请ID
|
||||
if (!this.applyId) {
|
||||
this.applyId = res.data.id
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 提交申请
|
||||
submitForm() {
|
||||
if (!this.validateForm()) {
|
||||
@@ -1186,6 +1199,7 @@
|
||||
title: submit ? '申请提交成功' : '表单保存成功',
|
||||
icon: 'success'
|
||||
})
|
||||
this.goBack()
|
||||
// 如果是提交申请,跳转到列表页面
|
||||
if (submit) {
|
||||
uni.redirectTo({
|
||||
@@ -1208,13 +1222,15 @@
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
// 新增申请
|
||||
addApply(data).then(res => {
|
||||
// 第一次保存调用save接口,提交申请调用add接口
|
||||
const request = submit ? addApply(data) : saveApply(data)
|
||||
request.then(res => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: submit ? '申请提交成功' : '表单保存成功',
|
||||
icon: 'success'
|
||||
})
|
||||
this.goBack()
|
||||
// 如果是提交申请,跳转到列表页面
|
||||
if (submit) {
|
||||
uni.redirectTo({
|
||||
@@ -1231,13 +1247,6 @@
|
||||
})
|
||||
}
|
||||
this.loading = false
|
||||
}).catch(err => {
|
||||
console.error('新增申请失败:', err)
|
||||
uni.showToast({
|
||||
title: submit ? '申请提交失败' : '表单保存失败',
|
||||
icon: 'none'
|
||||
})
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user