Procházet zdrojové kódy

酒店订房与订房记录改动

wengan01 před 4 dny
rodič
revize
b119fa3c8e

+ 6 - 0
src/views/content/bookingRecord/index.vue

@@ -72,6 +72,12 @@
           <el-tag :type="statusTagType[scope.row.status] || 'info'">{{ statusMap[scope.row.status] || '未知' }}</el-tag>
         </template>
       </el-table-column>
+      <el-table-column label="操作人" align="center" prop="operatorName" min-width="100" show-overflow-tooltip>
+        <template #default="scope">{{ scope.row.operatorName || '-' }}</template>
+      </el-table-column>
+      <el-table-column label="操作时间" align="center" prop="operatorTime" min-width="160" show-overflow-tooltip>
+        <template #default="scope">{{ scope.row.operatorTime || '-' }}</template>
+      </el-table-column>
       <el-table-column label="操作" align="center" width="150" fixed="right">
         <template #default="scope">
           <el-button

+ 14 - 6
src/views/content/hotelBooking/index.vue

@@ -50,9 +50,9 @@
           <span v-else class="cell-empty">暂无</span>
         </template>
       </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">
-          {{ itemNameById(scope.row.itemId) }}
+          {{ itemNamesByIds(scope.row) }}
         </template>
       </el-table-column>
       <el-table-column label="房型与时段" align="center" min-width="180">
@@ -147,10 +147,10 @@
           <el-input v-model="form.hotelName" placeholder="请输入酒店名称" />
         </el-form-item>
         <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-select>
-          <span class="form-inline-tip">用于APP判定订单是否需补差价</span>
+          <span class="form-inline-tip">一家酒店可关联多张卡;APP只有持有其中任一张才能订房,下单时选哪张按哪张算补差</span>
         </el-form-item>
         <el-form-item label="酒店时效">
           <el-date-picker
@@ -382,6 +382,12 @@ function itemNameById(itemId) {
   const hit = itemOptions.value.find((i) => String(i.id) === String(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);
@@ -421,8 +427,8 @@ const initForm = {
   hotelName: '',
   introduction: '',
   location: '',
-  // 关联道具(服务券-酒店类型 items.id),用于APP判定是否补差价
-  itemId: null,
+  // 关联道具(服务券-酒店类型 items.id),一家酒店可关联多张卡;APP订房门槛与选卡以此为准
+  itemIds: [],
   // 酒店时效(天到天),为空表示不限制;APP列表仅今天处于时效区间内才展示
   effectStartDate: null,
   effectEndDate: null,
@@ -546,6 +552,8 @@ async function handleUpdate(row) {
       introduction: data.introduction || '',
       location: data.location || '',
       itemId: data.itemId ?? null,
+      // 优先用多卡集合 itemIds;老数据只有单张 itemId 时回填为一张
+      itemIds: (data.itemIds && data.itemIds.length ? data.itemIds : (data.itemId != null ? [data.itemId] : [])),
       effectStartDate: data.effectStartDate || null,
       effectEndDate: data.effectEndDate || null,
       isShow: data.isShow || '0',