Kaynağa Gözat

团队改成散客模式

gqx 2 yıl önce
ebeveyn
işleme
deecf975c0

+ 118 - 78
src/views/room/fangtailive.vue

@@ -16,7 +16,7 @@
     >
       <div style="width: 80%" class="course-week">
         <div style="display: flex; flex-direction: column">
-          <div style="display: flex; gap: 5px">
+          <div style="display: flex; gap: 5px; flex-flow: wrap">
             <a-dropdown>
               <a-menu slot="overlay" @click="scheduleClick">
                 <a-menu-item key="1"> 散客预定 </a-menu-item>
@@ -75,8 +75,8 @@
           </div>
           <div class="week-top">
             <div class="w-choose-status">
-              <div v-for="sta in cardStatus">
-                <span class="square" :style="{ background: sta.color }"></span>
+              <div v-for="sta in roomStatusColorList">
+                <span class="square" :style="{ background: sta.extend }"></span>
                 <span class="title">{{ sta.title }}</span>
               </div>
             </div>
@@ -91,7 +91,6 @@
         <div class="week-table" style="overflow: hidden auto">
           <div id="components-grid-demo-playground" class="w-time-period-list">
             <template v-for="(i, iIndex) in planList2">
-              <!--循环时段,看时段有多少个-->
               <div
                 v-for="(period, cIndex) in i.child"
                 :key="`i${iIndex}-period${cIndex}`"
@@ -132,7 +131,10 @@
                     <div
                       class="room-item"
                       :style="{
-                        background: cardStatus[roomLive.detail.status].color,
+                        background:
+                          roomStatusColorList && roomStatusColorList.length > 0
+                            ? roomStatusColorList[roomLive.detail.status].extend
+                            : '',
                       }"
                     >
                       <div
@@ -293,12 +295,17 @@
           按楼层
         </p>
         <a-tree-select
-          v-model="value"
           style="width: 100%"
-          :tree-data="treeData"
+          v-model="value"
+          :tree-data="roomBuildingFloorTree"
           tree-checkable
           :show-checked-strategy="SHOW_PARENT"
-          search-placeholder="Please select"
+          :replaceFields="{
+            children: 'children',
+            title: 'name',
+            key: 'id',
+            value: 'id',
+          }"
         />
         <p
           style="
@@ -310,24 +317,11 @@
         >
           按房态
         </p>
-        <a-checkbox-group @change="onChange">
-          <a-row>
-            <a-col :span="8">
-              <a-checkbox value="A"> 空净 </a-checkbox>
-            </a-col>
-            <a-col :span="8">
-              <a-checkbox value="B"> 空脏 </a-checkbox>
-            </a-col>
-            <a-col :span="8">
-              <a-checkbox value="C"> 住净 </a-checkbox>
-            </a-col>
-            <a-col :span="8">
-              <a-checkbox value="D"> 住脏 </a-checkbox>
-            </a-col>
-            <a-col :span="8">
-              <a-checkbox value="E"> 维修 </a-checkbox>
-            </a-col>
-          </a-row>
+        <a-checkbox-group
+          v-model="checkedRoomStatusList"
+          :options="roomStatusList"
+          @change="onChange"
+        >
         </a-checkbox-group>
         <p
           style="
@@ -339,24 +333,11 @@
         >
           按来源
         </p>
-        <a-checkbox-group @change="onChange">
-          <a-row>
-            <a-col :span="8">
-              <a-checkbox value="A"> 空净 </a-checkbox>
-            </a-col>
-            <a-col :span="8">
-              <a-checkbox value="B"> 空脏 </a-checkbox>
-            </a-col>
-            <a-col :span="8">
-              <a-checkbox value="C"> 住净 </a-checkbox>
-            </a-col>
-            <a-col :span="8">
-              <a-checkbox value="D"> 住脏 </a-checkbox>
-            </a-col>
-            <a-col :span="8">
-              <a-checkbox value="E"> 维修 </a-checkbox>
-            </a-col>
-          </a-row>
+        <a-checkbox-group
+          v-model="checkedCustomerSourceList"
+          :options="customerSourceList"
+          @change="onChange"
+        >
         </a-checkbox-group>
         <p
           style="
@@ -368,24 +349,11 @@
         >
           按房型
         </p>
-        <a-checkbox-group @change="onChange">
-          <a-row>
-            <a-col :span="8">
-              <a-checkbox value="A"> 空净 </a-checkbox>
-            </a-col>
-            <a-col :span="8">
-              <a-checkbox value="B"> 空脏 </a-checkbox>
-            </a-col>
-            <a-col :span="8">
-              <a-checkbox value="C"> 住净 </a-checkbox>
-            </a-col>
-            <a-col :span="8">
-              <a-checkbox value="D"> 住脏 </a-checkbox>
-            </a-col>
-            <a-col :span="8">
-              <a-checkbox value="E"> 维修 </a-checkbox>
-            </a-col>
-          </a-row>
+        <a-checkbox-group
+          v-model="checkedCesRoomLayoutList"
+          :options="cesRoomLayoutList"
+          @change="onChange"
+        >
         </a-checkbox-group>
       </div>
     </div>
@@ -642,6 +610,7 @@ for (let i = 2; i < 25; i++) {
     },
   });
 }
+
 export default {
   name: "BusMeetingRoomList",
   // mixins: [JeecgListMixin, mixinDevice],
@@ -663,7 +632,7 @@ export default {
       timeId: null,
       multipleRoom: false,
       keyWord: "",
-      value: ["0-0-0"],
+      value: [],
       treeData,
       SHOW_PARENT,
       cardStatus: {
@@ -722,6 +691,15 @@ export default {
       ],
       startDate: "",
       endDate: "",
+      customerSourceList: [],
+      checkedCustomerSourceList: [],
+      cesRoomLayoutList: [],
+      checkedCesRoomLayoutList: [],
+      roomBuildingFloorTree: [],
+      roomStatusColorList: [],
+      roomList: [],
+      roomStatusList: [],
+      checkedRoomStatusList:[],
     };
   },
   watch: {
@@ -732,6 +710,54 @@ export default {
   created() {
     // 禁用右键
     // document.oncontextmenu = new Function("event.returnValue=false");
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    // if (_info) {
+    //   this.model.hotelId = _info.id;
+    // }
+    getAction("/business/busDictItem/list", {
+      hotelId: _info.id,
+      dictId: "1639538915239743490",
+    }).then((res) => {
+      if (res.success) {
+        var list = [];
+        res.result.records.forEach((item) => {
+          list.push({ label: item.itemText, value: item.id });
+        });
+        this.customerSourceList = list;
+      }
+    });
+    getAction("/rooms/cesRoomLayout/list", {
+      pageSize: 99999,
+      pageNo: 1,
+    }).then((res) => {
+      if (res.success) {
+        var list = [];
+        res.result.records.forEach((item) => {
+          list.push({ label: item.name, value: item.id });
+        });
+        this.cesRoomLayoutList = list;
+      }
+    });
+    getAction("/rooms/cesRoomBuildingFloor/tree", {}).then((res) => {
+      if (res.success) {
+        this.roomBuildingFloorTree = res.result;
+      }
+    });
+    getAction("/rooms/cesRooms/room-status-color", {}).then((res) => {
+      if (res.success) {
+        this.roomStatusColorList = res.result;
+        var list = [];
+        res.result.forEach((item) => {
+          list.push({ label: item.title, value: item.value });
+        });
+        this.roomStatusList = list;
+      }
+    });
+    getAction("/rooms/cesRooms/realtime-rooms", {}).then((res) => {
+      if (res.success) {
+        this.roomList = res.result;
+      }
+    });
   },
   mounted() {
     // this.handleBillInfo();
@@ -779,17 +805,21 @@ export default {
           });
         });
       });
-      if (selectRoom.length === 0) {
-        this.$message.warning("请先选择房间");
-        return;
-      }
-      if (e.key == "1") {
-        this.$refs.ModalScheduleRoom.addList(selectRoom);
-        this.$refs.ModalScheduleRoom.title = "预定登记";
-        this.$refs.ModalScheduleRoom.disableSubmit = false;
-      } else {
-        this.addScheduleTeam();
-      }
+      // if (selectRoom.length === 0) {
+      //   this.$message.warning("请先选择房间");
+      //   return;
+      // }
+      // if (e.key == "1") {
+      //   this.$refs.ModalScheduleRoom.addList(selectRoom);
+      //   this.$refs.ModalScheduleRoom.title = "预定登记";
+      //   this.$refs.ModalScheduleRoom.disableSubmit = false;
+      // } else {
+      //   this.addScheduleTeam();
+      // }
+      this.$refs.ModalScheduleRoom.addList(selectRoom, e.key);
+      this.$refs.ModalScheduleRoom.title =
+        e.key == "1" ? "散客预定登记" : "团队预定登记";
+      this.$refs.ModalScheduleRoom.disableSubmit = false;
     },
     handleMenuClick(e) {
       console.log("click", e);
@@ -807,8 +837,9 @@ export default {
       //   this.$message.warning("请先选择房间");
       //   return;
       // }
-      this.$refs.ModalBillRoomForm.addList(selectRoom);
-      this.$refs.ModalBillRoomForm.title = "入住登记";
+      this.$refs.ModalBillRoomForm.addList(selectRoom, e.key);
+      this.$refs.ModalBillRoomForm.title =
+        e.key == "1" ? "散客入住登记" : "团队入住登记";
       this.$refs.ModalBillRoomForm.disableSubmit = false;
     },
     roomItemClick(roomLive) {
@@ -838,7 +869,7 @@ export default {
       }, 100);
     },
     handleBillInfo(roomLive) {
-      console.log("handleBillInfo",roomLive.detail.status);
+      console.log("handleBillInfo", roomLive.detail.status);
       if (this.timeId) {
         clearTimeout(this.timeId);
       }
@@ -846,7 +877,7 @@ export default {
         this.handleCheckInAdd(roomLive);
       } else {
         var e = "YD20230406181756590";
-        console.log(e)
+        console.log(e);
         this.$refs.ModalBillRoomInfo.add(e);
         this.$refs.ModalBillRoomInfo.title = "账单";
         this.$refs.ModalBillRoomInfo.disableSubmit = true;
@@ -888,6 +919,15 @@ export default {
     },
     onMenuClick(e) {
       console.log(e);
+      if (e.key == "1") {
+        this.$refs.ModalBillRoomForm.addList([], e.key);
+        this.$refs.ModalBillRoomForm.title = "散客入住登记";
+        this.$refs.ModalBillRoomForm.disableSubmit = false;
+      } else if (e.key == "2") {
+        this.$refs.ModalScheduleRoom.addList([], e.key);
+        this.$refs.ModalScheduleRoom.title = "散客预定登记";
+        this.$refs.ModalScheduleRoom.disableSubmit = false;
+      }
       this.$refs.modalForm.add();
       this.$refs.modalForm.title = "维修";
       this.$refs.modalForm.disableSubmit = false;

+ 4 - 3
src/views/room/modules/checkIn/BillRoomForm.vue

@@ -931,7 +931,7 @@ export default {
           rooms: panes,
           data: data,
           data2: data2,
-          bookingOrdersType: this.bookingOrdersId ? 2 : 1,
+          bookingOrdersType: 1,
           arrivalTime2: moment(new Date()).format("YYYY-MM-DD"),
           dueOutTime2: moment(endDate).format("YYYY-MM-DD"),
           arrivalTimeSpan: moment("18:00", "HH:mm"),
@@ -941,7 +941,7 @@ export default {
           warrantType: 1,
           hourRoomId: "",
           breakfastNum: 0,
-          vipCustomerId:''
+          vipCustomerId: "",
         },
         roomIds: [],
         livingRoomDayPrices: [],
@@ -1354,10 +1354,11 @@ export default {
       });
       this.edit(this.modelDefault);
     },
-    addList(roomLiveList) {
+    addList(roomLiveList, key) {
       // this.modelDefault = Object.assign({}, this.modelDefault, {
       //   rooms: roomLiveList,
       // });
+      this.modelDefault.orderInfo.bookingOrdersType = key;
       this.edit(this.modelDefault);
     },
     editTabs(e) {

+ 2 - 2
src/views/room/modules/checkIn/BillRoomFormModal.vue

@@ -36,10 +36,10 @@ export default {
         this.$refs.realForm.add2(record);
       });
     },
-    addList(record) {
+    addList(record,key) {
       this.visible = true;
       this.$nextTick(() => {
-        this.$refs.realForm.addList(record);
+        this.$refs.realForm.addList(record,key);
       });
     },
     edit(record) {

+ 5 - 4
src/views/room/modules/schedule/ScheduleRoomForm.vue

@@ -863,10 +863,11 @@ export default {
     add() {
       this.edit(this.modelDefault);
     },
-    addList(roomLiveList) {
-      this.modelDefault = Object.assign({}, this.modelDefault, {
-        rooms: roomLiveList,
-      });
+    addList(roomLiveList, key) {
+      // this.modelDefault = Object.assign({}, this.modelDefault, {
+      //   rooms: roomLiveList,
+      // });
+      this.modelDefault.orderInfo.bookingOrdersType = key;
       this.edit(this.modelDefault);
     },
     edit(record) {

+ 2 - 2
src/views/room/modules/schedule/ScheduleRoomModal.vue

@@ -46,10 +46,10 @@ export default {
         this.$refs.realForm.add();
       });
     },
-    addList(record) {
+    addList(record,key) {
       this.visible = true;
       this.$nextTick(() => {
-        this.$refs.realForm.addList(record);
+        this.$refs.realForm.addList(record,key);
       });
     },
     edit(record) {