diff --git a/src/views/dormitory/outsideAccommodation/outsideAccommodationApply/applicationForm.vue b/src/views/dormitory/outsideAccommodation/outsideAccommodationApply/applicationForm.vue index b09c97f..9c341ac 100644 --- a/src/views/dormitory/outsideAccommodation/outsideAccommodationApply/applicationForm.vue +++ b/src/views/dormitory/outsideAccommodation/outsideAccommodationApply/applicationForm.vue @@ -111,7 +111,7 @@ - +
@@ -407,13 +407,7 @@ export default { promiseDate: [{ required: true, message: '请选择签署日期', trigger: 'change' }], studentSignature: [{ required: true, message: '请完成电子签名', trigger: 'change' }], studentPromiseSign: [{ required: true, message: '请完成承诺签名', trigger: 'change' }], - reasonFileList: [ - { - required: true, - validator: (r, v, c) => - this.reasonFileList.length ? c() : c(new Error('请上传佐证附件')) - } - ], + affixId: [{ required: true, message: '请上传佐证材料', trigger: 'blur' }], parentSignAttachment: [ { required: true, @@ -462,32 +456,15 @@ export default { // 回显家长签字附件 this.fileList = [{ name: fileName, url: this.baseUrl + this.form.parentSignAttachment }] // 处理审批意见列表,添加意见类型 - // if (this.form?.enlistmentReserveApprovalList) { - // // 定义意见类型数组(与索引对应:0=辅导员,1=学务,2=二级学院,3=学籍管理科,4=教务处主管领导) - // const opinionTypes = [ - // "辅导员意见", - // "学务意见", - // "二级学院意见", - // "学籍管理科意见", - // "教务处主管领导意见" - // ]; - // // 遍历审批列表,为每条数据添加 opinionType 字段 - // this.formData.enlistmentReserveApprovalList.forEach((item, index) => { - // // 只处理前5条数据(超出部分不添加,或可根据实际需求调整) - // if (index < opinionTypes.length) { - // item.opinionType = opinionTypes[index]; - // } else { - // // 若超过5条,可设置默认值或不设置 - // item.opinionType = "其他意见"; - // } - // }); - // } this.loading = false }) } else { // 若 id 为空,可做清空处理 this.currentId = null; - this.resetForm() + // 延迟执行重置,确保 formRef 已挂载 + this.$nextTick(() => { + this.resetForm() + }) this.getUser() } } @@ -792,7 +769,10 @@ export default { // 重置表单 resetForm() { - this.$refs.formRef.resetFields() + // 先判断 formRef 是否存在,再调用 resetFields + if (this.$refs.formRef) { + this.$refs.formRef.resetFields() + } this.reasonFileList = [] this.fileList = [] this.form.affixId = "" @@ -997,8 +977,8 @@ export default { const currentYear = now.getFullYear(); // 计算次年(当前年+1) const nextYear = currentYear + 1; - // 生成次年8月31日(月份从0开始,8月对应9) - const endDate = new Date(nextYear, 8, 31); + // 8月对应的索引是7(0=1月,1=2月...7=8月) + const endDate = new Date(nextYear, 7, 31); // 次年8月31日 // 格式化为 yyyy-MM-dd(适配 el-date-picker 的 value-format) return this.formatDate(endDate); }, diff --git a/src/views/dormitory/outsideAccommodation/outsideAccommodationApply/components/detailApply.vue b/src/views/dormitory/outsideAccommodation/outsideAccommodationApply/components/detailApply.vue index f89c3ae..d7768d4 100644 --- a/src/views/dormitory/outsideAccommodation/outsideAccommodationApply/components/detailApply.vue +++ b/src/views/dormitory/outsideAccommodation/outsideAccommodationApply/components/detailApply.vue @@ -1,8 +1,8 @@