From 408f17bb308b708d9c3f4057107dfedddf8cd078 Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 3 Jun 2026 15:49:18 +0800 Subject: [PATCH] commit --- .../baseManage/baseManagement.html | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/main/resources/views/platform/theRapyRecuperation/baseManage/baseManagement.html b/src/main/resources/views/platform/theRapyRecuperation/baseManage/baseManagement.html index 21c591e..151671c 100644 --- a/src/main/resources/views/platform/theRapyRecuperation/baseManage/baseManagement.html +++ b/src/main/resources/views/platform/theRapyRecuperation/baseManage/baseManagement.html @@ -654,6 +654,21 @@ layout("/layouts/platform.html"){ } return [] }, + normalizeAllowDay(allowDay) { + // 兼容后端返回数组或 JSON 字符串,保持多选天数字段始终使用数组回显。 + if (Array.isArray(allowDay)) { + return allowDay + } + if (typeof allowDay === 'string' && allowDay) { + try { + const parsed = JSON.parse(allowDay) + return Array.isArray(parsed) ? parsed : [] + } catch (e) { + return [] + } + } + return [] + }, async doSearch() { this.formData.year = this.pageForm.year; await this.yearChange(); @@ -723,6 +738,7 @@ layout("/layouts/platform.html"){ const data = resp.data data.year = data.year.toString() data.weekCheckIn = this.normalizeWeekCheckIn(data.weekCheckIn) + data.allowDay = this.normalizeAllowDay(data.allowDay) this.$set(this, 'formData', {...data}) await this.selectTravelAgencyList() await this.getModifyBd(data.year) @@ -766,9 +782,10 @@ layout("/layouts/platform.html"){ spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' }); - this.formData.weekCheckIn = JSON.stringify(this.formData.weekCheckIn) - this.formData.allowDay = JSON.stringify(this.formData.allowDay) - const resp = await $.post(loc() + '/doSubmit', this.formData) + const postData = {...this.formData} + postData.weekCheckIn = JSON.stringify(this.normalizeWeekCheckIn(this.formData.weekCheckIn)) + postData.allowDay = JSON.stringify(this.normalizeAllowDay(this.formData.allowDay)) + const resp = await $.post(loc() + '/doSubmit', postData) loading.close() if (resp.code === 0) { this.$refs.guava.index()