commit
This commit is contained in:
+20
-3
@@ -654,6 +654,21 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
return []
|
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() {
|
async doSearch() {
|
||||||
this.formData.year = this.pageForm.year;
|
this.formData.year = this.pageForm.year;
|
||||||
await this.yearChange();
|
await this.yearChange();
|
||||||
@@ -723,6 +738,7 @@ layout("/layouts/platform.html"){
|
|||||||
const data = resp.data
|
const data = resp.data
|
||||||
data.year = data.year.toString()
|
data.year = data.year.toString()
|
||||||
data.weekCheckIn = this.normalizeWeekCheckIn(data.weekCheckIn)
|
data.weekCheckIn = this.normalizeWeekCheckIn(data.weekCheckIn)
|
||||||
|
data.allowDay = this.normalizeAllowDay(data.allowDay)
|
||||||
this.$set(this, 'formData', {...data})
|
this.$set(this, 'formData', {...data})
|
||||||
await this.selectTravelAgencyList()
|
await this.selectTravelAgencyList()
|
||||||
await this.getModifyBd(data.year)
|
await this.getModifyBd(data.year)
|
||||||
@@ -766,9 +782,10 @@ layout("/layouts/platform.html"){
|
|||||||
spinner: 'el-icon-loading',
|
spinner: 'el-icon-loading',
|
||||||
background: 'rgba(0, 0, 0, 0.7)'
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
});
|
});
|
||||||
this.formData.weekCheckIn = JSON.stringify(this.formData.weekCheckIn)
|
const postData = {...this.formData}
|
||||||
this.formData.allowDay = JSON.stringify(this.formData.allowDay)
|
postData.weekCheckIn = JSON.stringify(this.normalizeWeekCheckIn(this.formData.weekCheckIn))
|
||||||
const resp = await $.post(loc() + '/doSubmit', this.formData)
|
postData.allowDay = JSON.stringify(this.normalizeAllowDay(this.formData.allowDay))
|
||||||
|
const resp = await $.post(loc() + '/doSubmit', postData)
|
||||||
loading.close()
|
loading.close()
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
this.$refs.guava.index()
|
this.$refs.guava.index()
|
||||||
|
|||||||
Reference in New Issue
Block a user