gqx 2 years ago
parent
commit
09d2e2e4ea
1 changed files with 49 additions and 30 deletions
  1. 49 30
      src/views/room/fangtailive.vue

+ 49 - 30
src/views/room/fangtailive.vue

@@ -821,11 +821,11 @@ export default {
     CustomerModal,
     exchangeHousesModalVue,
     posOrderModal,
-    batchCardModal
+    batchCardModal,
   },
   data() {
     return {
-      YDorder:null,
+      YDorder: null,
       currentDate: moment(new Date()).format("YYYY-MM-DD"),
       activeKey: "1",
       timeId: null,
@@ -896,6 +896,7 @@ export default {
       scheduleBtnDis: false,
       checkInBtnDis: false,
       kzfLiving: false,
+      roomCard: false,
     };
   },
   watch: {
@@ -1120,7 +1121,10 @@ export default {
         if (roomLive.roomInfo.state !== 88) {
           roomLive.roomInfo.state = 88;
 
-          if (roomLive.livingData && roomLive.livingData.livingOrder) {
+          if (
+            (roomLive.livingData && roomLive.livingData.livingOrder) ||
+            roomLive.roomInfo.roomStatus === 6
+          ) {
             this.checkInBtnDis = true;
           } else {
             this.checkInBtnDis = false;
@@ -1128,7 +1132,8 @@ export default {
 
           if (
             (roomLive.livingData && roomLive.livingData.livingOrder) ||
-            (roomLive.bookingData && roomLive.bookingData.bookingOrder)
+            (roomLive.bookingData && roomLive.bookingData.bookingOrder) ||
+            roomLive.roomInfo.roomStatus === 6
           ) {
             this.scheduleBtnDis = true;
           } else {
@@ -1140,29 +1145,38 @@ export default {
         if (this.multipleRoom) {
           this.checkInBtnDis = false;
           this.scheduleBtnDis = false;
-          this.roomList.forEach((item) => {
-            item.rooms.forEach((c) => {
-              if (c.roomInfo.state === 88) {
-                if (!this.checkInBtnDis) {
-                  if (c.livingData && c.livingData.livingOrder) {
-                    this.checkInBtnDis = true;
-                  } else {
-                    this.checkInBtnDis = 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)
-                  ) {
-                    this.scheduleBtnDis = true;
-                  } else {
-                    this.scheduleBtnDis = 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);
+          }
         }
         // 清除定时器
         clearTimeout(this.timeId);
@@ -1609,17 +1623,17 @@ export default {
     modalBillRoomFormOk(e) {
       this.loadData();
       console.log("e", e);
-      this.YDorder = e.order
-      if (this.kzfLiving) {
+      this.YDorder = e.order;
+      if (this.roomCard) {
         this.$refs.batchCheckInModal.visible = true;
-            this.$refs.batchCheckInModal.edit(e.model)
-      }else{
+        this.$refs.batchCheckInModal.edit(e.model);
+      } else {
         this.$refs.ModalBillRoomInfo.add(e.order);
-            this.$refs.ModalBillRoomInfo.title = "账单";
-            this.$refs.ModalBillRoomInfo.disableSubmit = true;
+        this.$refs.ModalBillRoomInfo.title = "账单";
+        this.$refs.ModalBillRoomInfo.disableSubmit = true;
       }
     },
-    modalBatchhFormOk(){
+    modalBatchhFormOk() {
       this.$refs.ModalBillRoomInfo.add(this.YDorder);
       this.$refs.ModalBillRoomInfo.title = "账单";
       this.$refs.ModalBillRoomInfo.disableSubmit = true;
@@ -1664,6 +1678,11 @@ export default {
           }
         }
       );
+      getAction("/business/busOtherRoomCard/queryByHotelId", {}).then((res) => {
+        if (res.success) {
+          this.roomCard = res.result.status === 1;
+        }
+      });
     },
   },
 };