Browse Source

阿斯顿发生发生

gqx 2 years ago
parent
commit
bdf2d182b5
1 changed files with 60 additions and 20 deletions
  1. 60 20
      src/views/room/fangtailive.vue

+ 60 - 20
src/views/room/fangtailive.vue

@@ -88,9 +88,7 @@
               type="danger"
               >批量制卡</a-button
             >
-            <a-button
-              style="margin-bottom: 10px"
-              @click="posOrderClick"
+            <a-button style="margin-bottom: 10px" @click="posOrderClick"
               ><a-icon type="exception" />非在住消费pos</a-button
             >
             <!-- <a-button style="margin-bottom: 10px" @click="toPage" type="danger"
@@ -519,8 +517,9 @@
                           <a-menu-item
                             key="1"
                             v-if="
-                              !roomLive.livingData ||
-                              !roomLive.livingData.livingOrder
+                              (!roomLive.livingData ||
+                                !roomLive.livingData.livingOrder) &&
+                              roomLive.roomInfo.roomStatus !== 6
                             "
                           >
                             入住
@@ -528,8 +527,9 @@
                           <a-menu-item
                             key="2"
                             v-if="
-                              !roomLive.livingData ||
-                              !roomLive.livingData.livingOrder
+                              (!roomLive.livingData ||
+                                !roomLive.livingData.livingOrder) &&
+                              roomLive.roomInfo.roomStatus !== 6
                             "
                           >
                             预定</a-menu-item
@@ -540,7 +540,12 @@
                           >
                             置干净
                           </a-menu-item>
-                          <a-menu-item key="3" v-else> 置脏 </a-menu-item>
+                          <a-menu-item
+                            key="3"
+                            v-else-if="roomLive.roomInfo.roomStatus !== 6"
+                          >
+                            置脏
+                          </a-menu-item>
                           <template
                             v-if="
                               roomLive.roomInfo.roomStatus !== 3 &&
@@ -553,7 +558,12 @@
                             >
                               完成维修
                             </a-menu-item>
-                            <a-menu-item key="4" v-else> 置维修 </a-menu-item>
+                            <a-menu-item
+                              key="4"
+                              v-else-if="roomLive.roomInfo.roomStatus !== 6"
+                            >
+                              置维修
+                            </a-menu-item>
                             <a-menu-item
                               key="51"
                               v-if="roomLive.roomInfo.roomStatus === 6"
@@ -771,7 +781,7 @@ import leasegoods from "./leasegoods";
 import membermessage from "./membermessage";
 import membergoodsmanage from "./membergoodsmanage";
 import fangwuLookRoom from "./fangwuLookRoom.vue";
-import posOrderModal from './posOrderModal.vue';
+import posOrderModal from "./posOrderModal.vue";
 
 import lookRoomModalVue from "./modules/fangtaiModal/lookRoomModal/lookRoomModal.vue";
 import continuedModalVue from "./modules/fangtaiModal/continuedModal/continuedModal.vue";
@@ -807,7 +817,7 @@ export default {
     SelectCheckInRoomOrderModal,
     CustomerModal,
     exchangeHousesModalVue,
-    posOrderModal
+    posOrderModal,
   },
   data() {
     return {
@@ -880,6 +890,7 @@ export default {
       checkedRoomStatusList: [],
       scheduleBtnDis: false,
       checkInBtnDis: false,
+      kzfLiving: false,
     };
   },
   watch: {
@@ -890,7 +901,12 @@ export default {
   computed: {
     lockDisabled() {
       return !this.roomList.some((t) =>
-        t.rooms.some((c) => c.roomInfo.state === 88)
+        t.rooms.some(
+          (c) =>
+            c.roomInfo.state === 88 &&
+            c.roomInfo.roomStatus !== 6 &&
+            c.roomInfo.roomStatus !== 5
+        )
       );
     },
     offLockBtn() {
@@ -989,7 +1005,7 @@ export default {
   },
   methods: {
     moment,
-    posOrderClick(){
+    posOrderClick() {
       this.$refs.posOrderModal.visible = true;
     },
     getCustomerSourceList(customerSource, first) {
@@ -1059,14 +1075,22 @@ export default {
     handleMenuClick(e) {
       console.log("click", e);
       var selectRoom = [];
-      this.roomList.forEach((t) => {
-        t.rooms.forEach((c) => {
-          if (c.roomInfo.state === 88) {
-            c.roomInfo.marketPrice = c.layout.marketPrice;
-            selectRoom.push(c.roomInfo);
-          }
+      try {
+        this.roomList.forEach((t) => {
+          t.rooms.forEach((c) => {
+            if (c.roomInfo.state === 88) {
+              if (!this.kzfLiving && c.roomInfo.roomStatus === 2) {
+                throw new Error("空脏房不允许入住");
+              }
+              c.roomInfo.marketPrice = c.layout.marketPrice;
+              selectRoom.push(c.roomInfo);
+            }
+          });
         });
-      });
+      } catch (e) {
+        this.$message.warning(e.message);
+        return;
+      }
       this.$refs.ModalBillRoomForm.addList(selectRoom, e.key);
       this.$refs.ModalBillRoomForm.title =
         e.key == "1" ? "散客入住登记" : "团队入住登记";
@@ -1168,6 +1192,10 @@ export default {
       if (this.timeId) {
         clearTimeout(this.timeId);
       }
+      if (!this.kzfLiving && roomLive.roomInfo.roomStatus === 2) {
+        this.$message.warning("空脏房不允许入住");
+        return;
+      }
       roomLive.roomInfo.marketPrice = roomLive.layout.marketPrice;
       this.$refs.ModalBillRoomForm.addList([roomLive.roomInfo], 1);
       this.$refs.ModalBillRoomForm.title = "散客入住登记";
@@ -1434,6 +1462,10 @@ export default {
             },
           });
         } else {
+          if (!this.kzfLiving && row.roomInfo.roomStatus === 2) {
+            this.$message.warning("空脏房不允许入住");
+            return;
+          }
           row.roomInfo.marketPrice = row.layout.marketPrice;
           this.$refs.ModalBillRoomForm.addList([row.roomInfo], 1);
           this.$refs.ModalBillRoomForm.title = "散客入住登记";
@@ -1608,6 +1640,14 @@ export default {
           this.oldRoomList = JSON.parse(JSON.stringify(res.result));
         }
       });
+
+      getAction("/business/busOtherEmptyDirtyRoom/queryByHotelId", {}).then(
+        (res) => {
+          if (res.success) {
+            this.kzfLiving = res.result.status === 1;
+          }
+        }
+      );
     },
   },
 };