gqx 2 anni fa
parent
commit
b5804b50d1
1 ha cambiato i file con 47 aggiunte e 39 eliminazioni
  1. 47 39
      src/views/room/fangtailive.vue

+ 47 - 39
src/views/room/fangtailive.vue

@@ -519,7 +519,8 @@
                             v-if="
                               (!roomLive.livingData ||
                                 !roomLive.livingData.livingOrder) &&
-                              roomLive.roomInfo.roomStatus !== 6
+                              roomLive.roomInfo.roomStatus !== 6 &&
+                              roomLive.roomInfo.roomStatus !== 5
                             "
                           >
                             入住
@@ -529,7 +530,8 @@
                             v-if="
                               (!roomLive.livingData ||
                                 !roomLive.livingData.livingOrder) &&
-                              roomLive.roomInfo.roomStatus !== 6
+                              roomLive.roomInfo.roomStatus !== 6 &&
+                              roomLive.roomInfo.roomStatus !== 5
                             "
                           >
                             预定</a-menu-item
@@ -542,7 +544,10 @@
                           </a-menu-item>
                           <a-menu-item
                             key="3"
-                            v-else-if="roomLive.roomInfo.roomStatus !== 6"
+                            v-else-if="
+                              roomLive.roomInfo.roomStatus !== 6 &&
+                              roomLive.roomInfo.roomStatus !== 5
+                            "
                           >
                             置脏
                           </a-menu-item>
@@ -570,7 +575,12 @@
                             >
                               解锁
                             </a-menu-item>
-                            <a-menu-item key="5" v-else> 锁房 </a-menu-item>
+                            <a-menu-item
+                              key="5"
+                              v-else-if="roomLive.roomInfo.roomStatus !== 5"
+                            >
+                              锁房
+                            </a-menu-item>
                           </template>
                           <template
                             v-if="
@@ -911,7 +921,9 @@ export default {
           (c) =>
             c.roomInfo.state === 88 &&
             c.roomInfo.roomStatus !== 6 &&
-            c.roomInfo.roomStatus !== 5
+            c.roomInfo.roomStatus !== 5 &&
+            c.roomInfo.roomStatus !== 3 &&
+            c.roomInfo.roomStatus !== 4
         )
       );
     },
@@ -1123,7 +1135,8 @@ export default {
 
           if (
             (roomLive.livingData && roomLive.livingData.livingOrder) ||
-            roomLive.roomInfo.roomStatus === 6
+            roomLive.roomInfo.roomStatus === 6 ||
+            roomLive.roomInfo.roomStatus === 5
           ) {
             this.checkInBtnDis = true;
           } else {
@@ -1133,7 +1146,8 @@ export default {
           if (
             (roomLive.livingData && roomLive.livingData.livingOrder) ||
             (roomLive.bookingData && roomLive.bookingData.bookingOrder) ||
-            roomLive.roomInfo.roomStatus === 6
+            roomLive.roomInfo.roomStatus === 6 ||
+            roomLive.roomInfo.roomStatus === 5
           ) {
             this.scheduleBtnDis = true;
           } else {
@@ -1145,38 +1159,26 @@ export default {
         if (this.multipleRoom) {
           this.checkInBtnDis = false;
           this.scheduleBtnDis = false;
-          try {
-            this.roomList.forEach((item) => {
-              item.rooms.forEach((c) => {
-                if (c.roomInfo.state === 88) {
-                  if (!this.checkInBtnDis) {
-                    if (
-                      (c.livingData && c.livingData.livingOrder) ||
-                      roomLive.roomInfo.roomStatus === 6
-                    ) {
-                      this.checkInBtnDis = true;
-                    } else {
-                      this.checkInBtnDis = false;
-                    }
-                  }
-                  if (!this.scheduleBtnDis) {
-                    if (
-                      (c.livingData && c.livingData.livingOrder) ||
-                      (c.bookingData && c.bookingData.bookingOrder) ||
-                      roomLive.roomInfo.roomStatus === 6
-                    ) {
-                      this.scheduleBtnDis = true;
-                      throw new Error("已禁用");
-                    } else {
-                      this.scheduleBtnDis = false;
-                    }
-                  }
-                }
-              });
-            });
-          } catch (e) {
-            this.$message.warning(e.message);
-          }
+
+          this.checkInBtnDis = this.roomList.some((t) =>
+            t.rooms.some(
+              (c) =>
+                c.roomInfo.state === 88 &&
+                ((c.livingData && c.livingData.livingOrder) ||
+                  c.roomInfo.roomStatus === 6 ||
+                  c.roomInfo.roomStatus === 5)
+            )
+          );
+          this.scheduleBtnDis = this.roomList.some((t) =>
+            t.rooms.some(
+              (c) =>
+                c.roomInfo.state === 88 &&
+                ((c.livingData && c.livingData.livingOrder) ||
+                  (c.bookingData && c.bookingData.bookingOrder) ||
+                  c.roomInfo.roomStatus === 6 ||
+                  c.roomInfo.roomStatus === 5)
+            )
+          );
         }
         // 清除定时器
         clearTimeout(this.timeId);
@@ -1214,6 +1216,12 @@ export default {
       if (!this.kzfLiving && roomLive.roomInfo.roomStatus === 2) {
         this.$message.warning("空脏房不允许入住");
         return;
+      } else if (roomLive.roomInfo.roomStatus === 5) {
+        this.$message.warning("维修房不允许入住");
+        return;
+      } else if (roomLive.roomInfo.roomStatus === 6) {
+        this.$message.warning("锁房不允许入住");
+        return;
       }
       roomLive.roomInfo.marketPrice = roomLive.layout.marketPrice;
       this.$refs.ModalBillRoomForm.addList([roomLive.roomInfo], 1);