commit
This commit is contained in:
+22
-3
@@ -555,6 +555,7 @@ layout("/layouts/platform.html"){
|
|||||||
baseContactPerson: '',
|
baseContactPerson: '',
|
||||||
baseContactNumber: '',
|
baseContactNumber: '',
|
||||||
weekIn: 1,
|
weekIn: 1,
|
||||||
|
weekCheckIn: [],
|
||||||
allowDay: [],
|
allowDay: [],
|
||||||
maxSignCount: 0,
|
maxSignCount: 0,
|
||||||
travelAgencyPlace: '',
|
travelAgencyPlace: '',
|
||||||
@@ -638,6 +639,21 @@ layout("/layouts/platform.html"){
|
|||||||
this.formData.weekCheckIn = lot ? lot.weekCheckIn : []
|
this.formData.weekCheckIn = lot ? lot.weekCheckIn : []
|
||||||
}*/
|
}*/
|
||||||
},
|
},
|
||||||
|
normalizeWeekCheckIn(weekCheckIn) {
|
||||||
|
// 兼容后端返回数组或 JSON 字符串,避免 "[]" 被当成有值导致“不限”不回显。
|
||||||
|
if (Array.isArray(weekCheckIn)) {
|
||||||
|
return weekCheckIn
|
||||||
|
}
|
||||||
|
if (typeof weekCheckIn === 'string' && weekCheckIn) {
|
||||||
|
try {
|
||||||
|
const parsed = JSON.parse(weekCheckIn)
|
||||||
|
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();
|
||||||
@@ -692,7 +708,9 @@ layout("/layouts/platform.html"){
|
|||||||
if (this.$refs['form']) {
|
if (this.$refs['form']) {
|
||||||
this.$refs['form'].resetFields()
|
this.$refs['form'].resetFields()
|
||||||
}
|
}
|
||||||
this.formData.id = null
|
this.$set(this.formData, 'id', null)
|
||||||
|
this.$set(this.formData, 'weekIn', 1)
|
||||||
|
this.$set(this.formData, 'weekCheckIn', [])
|
||||||
this.initLineContentEditor()
|
this.initLineContentEditor()
|
||||||
})
|
})
|
||||||
await this.getNumber()
|
await this.getNumber()
|
||||||
@@ -704,10 +722,11 @@ layout("/layouts/platform.html"){
|
|||||||
await this.$nextTick()
|
await this.$nextTick()
|
||||||
const data = resp.data
|
const data = resp.data
|
||||||
data.year = data.year.toString()
|
data.year = data.year.toString()
|
||||||
this.formData = {...data}
|
data.weekCheckIn = this.normalizeWeekCheckIn(data.weekCheckIn)
|
||||||
|
this.$set(this, 'formData', {...data})
|
||||||
await this.selectTravelAgencyList()
|
await this.selectTravelAgencyList()
|
||||||
await this.getModifyBd(data.year)
|
await this.getModifyBd(data.year)
|
||||||
this.formData.weekIn = this.formData.weekCheckIn && this.formData.weekCheckIn.length > 0 ? 2 : 1
|
this.$set(this.formData, 'weekIn', this.formData.weekCheckIn.length > 0 ? 2 : 1)
|
||||||
this.initLineContentEditor(data.content)
|
this.initLineContentEditor(data.content)
|
||||||
} else {
|
} else {
|
||||||
this.notifyWarning(resp.msg)
|
this.notifyWarning(resp.msg)
|
||||||
|
|||||||
Reference in New Issue
Block a user