|
@@ -50,9 +50,9 @@
|
|
|
<span v-else class="cell-empty">暂无</span>
|
|
<span v-else class="cell-empty">暂无</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="关联道具" align="center" min-width="100" show-overflow-tooltip>
|
|
|
|
|
|
|
+ <el-table-column label="关联道具" align="center" min-width="140" show-overflow-tooltip>
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- {{ itemNameById(scope.row.itemId) }}
|
|
|
|
|
|
|
+ {{ itemNamesByIds(scope.row) }}
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="房型与时段" align="center" min-width="180">
|
|
<el-table-column label="房型与时段" align="center" min-width="180">
|
|
@@ -147,10 +147,10 @@
|
|
|
<el-input v-model="form.hotelName" placeholder="请输入酒店名称" />
|
|
<el-input v-model="form.hotelName" placeholder="请输入酒店名称" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="道具关联">
|
|
<el-form-item label="道具关联">
|
|
|
- <el-select v-model="form.itemId" placeholder="请选择关联的服务券-酒店道具" clearable filterable style="width: 300px">
|
|
|
|
|
|
|
+ <el-select v-model="form.itemIds" multiple clearable filterable placeholder="请选择关联的服务券-酒店道具(可多选)" style="width: 420px">
|
|
|
<el-option v-for="item in itemOptions" :key="item.id" :label="item.name" :value="item.id" />
|
|
<el-option v-for="item in itemOptions" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
- <span class="form-inline-tip">用于APP判定订单是否需补差价</span>
|
|
|
|
|
|
|
+ <span class="form-inline-tip">一家酒店可关联多张卡;APP只有持有其中任一张才能订房,下单时选哪张按哪张算补差</span>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="酒店时效">
|
|
<el-form-item label="酒店时效">
|
|
|
<el-date-picker
|
|
<el-date-picker
|
|
@@ -382,6 +382,12 @@ function itemNameById(itemId) {
|
|
|
const hit = itemOptions.value.find((i) => String(i.id) === String(itemId));
|
|
const hit = itemOptions.value.find((i) => String(i.id) === String(itemId));
|
|
|
return hit ? hit.name : 'ID:' + itemId;
|
|
return hit ? hit.name : 'ID:' + itemId;
|
|
|
}
|
|
}
|
|
|
|
|
+// 根据多卡集合 itemIds(兼容老数据仅有单张 itemId)取道具名称,用「、」拼接展示
|
|
|
|
|
+function itemNamesByIds(row) {
|
|
|
|
|
+ const ids = row && row.itemIds && row.itemIds.length ? row.itemIds : row && row.itemId != null ? [row.itemId] : [];
|
|
|
|
|
+ if (!ids.length) return '-';
|
|
|
|
|
+ return ids.map((id) => itemNameById(id)).join('、');
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
// ========== 弹窗表单 ==========
|
|
// ========== 弹窗表单 ==========
|
|
|
const dialogVisible = ref(false);
|
|
const dialogVisible = ref(false);
|
|
@@ -421,8 +427,8 @@ const initForm = {
|
|
|
hotelName: '',
|
|
hotelName: '',
|
|
|
introduction: '',
|
|
introduction: '',
|
|
|
location: '',
|
|
location: '',
|
|
|
- // 关联道具(服务券-酒店类型 items.id),用于APP判定是否补差价
|
|
|
|
|
- itemId: null,
|
|
|
|
|
|
|
+ // 关联道具(服务券-酒店类型 items.id),一家酒店可关联多张卡;APP订房门槛与选卡以此为准
|
|
|
|
|
+ itemIds: [],
|
|
|
// 酒店时效(天到天),为空表示不限制;APP列表仅今天处于时效区间内才展示
|
|
// 酒店时效(天到天),为空表示不限制;APP列表仅今天处于时效区间内才展示
|
|
|
effectStartDate: null,
|
|
effectStartDate: null,
|
|
|
effectEndDate: null,
|
|
effectEndDate: null,
|
|
@@ -546,6 +552,8 @@ async function handleUpdate(row) {
|
|
|
introduction: data.introduction || '',
|
|
introduction: data.introduction || '',
|
|
|
location: data.location || '',
|
|
location: data.location || '',
|
|
|
itemId: data.itemId ?? null,
|
|
itemId: data.itemId ?? null,
|
|
|
|
|
+ // 优先用多卡集合 itemIds;老数据只有单张 itemId 时回填为一张
|
|
|
|
|
+ itemIds: (data.itemIds && data.itemIds.length ? data.itemIds : (data.itemId != null ? [data.itemId] : [])),
|
|
|
effectStartDate: data.effectStartDate || null,
|
|
effectStartDate: data.effectStartDate || null,
|
|
|
effectEndDate: data.effectEndDate || null,
|
|
effectEndDate: data.effectEndDate || null,
|
|
|
isShow: data.isShow || '0',
|
|
isShow: data.isShow || '0',
|