|
@@ -517,12 +517,11 @@ export default {
|
|
|
if (row && row.id) {
|
|
if (row && row.id) {
|
|
|
this.form = this.emptyForm()
|
|
this.form = this.emptyForm()
|
|
|
this.form.id = row.id
|
|
this.form.id = row.id
|
|
|
- getSelfTicketTypeDetail(row.id).then(res => {
|
|
|
|
|
- const d = res.data || {}
|
|
|
|
|
- // 详情返回 scenicList[].selfScenicId(接口文档 §3.2),表单景点多选绑定 scenicIds,需映射
|
|
|
|
|
|
|
+ const applyDetail = d => {
|
|
|
|
|
+ // 详情/列表行均返回 scenicList[].selfScenicId(接口文档 §3.2),表单景点多选绑定 scenicIds,需映射
|
|
|
const scenicIds = (d.scenicList || []).map(s => s.selfScenicId)
|
|
const scenicIds = (d.scenicList || []).map(s => s.selfScenicId)
|
|
|
this.form = { ...this.form, ...d, scenicIds }
|
|
this.form = { ...this.form, ...d, scenicIds }
|
|
|
- // 详情里的展示用数组不进提交 payload,删掉避免 update 带脏字段
|
|
|
|
|
|
|
+ // 展示用数组不进提交 payload,删掉避免 update 带脏字段
|
|
|
delete this.form.scenicList
|
|
delete this.form.scenicList
|
|
|
delete this.form.batchConfigList
|
|
delete this.form.batchConfigList
|
|
|
this.saleDateRange = d.saleDateStart && d.saleDateEnd ? [d.saleDateStart, d.saleDateEnd] : []
|
|
this.saleDateRange = d.saleDateStart && d.saleDateEnd ? [d.saleDateStart, d.saleDateEnd] : []
|
|
@@ -531,7 +530,13 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
this.$refs.form && this.$refs.form.clearValidate()
|
|
this.$refs.form && this.$refs.form.clearValidate()
|
|
|
})
|
|
})
|
|
|
- }).catch(() => {})
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ // 详情为准;失败(如详情端点未实现)回退列表行数据兜底,避免打开空表单后对 scenicIds/channels 做盲写全量覆盖
|
|
|
|
|
+ getSelfTicketTypeDetail(row.id).then(res => {
|
|
|
|
|
+ applyDetail(res.data || {})
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ applyDetail(row)
|
|
|
|
|
+ })
|
|
|
} else {
|
|
} else {
|
|
|
this.form = this.emptyForm()
|
|
this.form = this.emptyForm()
|
|
|
this.saleDateRange = []
|
|
this.saleDateRange = []
|