gqx 2 年之前
父节点
当前提交
8ccb46b776
共有 1 个文件被更改,包括 16 次插入7 次删除
  1. 16 7
      src/views/room/fangtailive.vue

+ 16 - 7
src/views/room/fangtailive.vue

@@ -101,9 +101,9 @@
                 </span>
                 </span>
                 <a-divider type="vertical" />
                 <a-divider type="vertical" />
                 <span style="padding-right: 5px"
                 <span style="padding-right: 5px"
-                  >{{ period.count }}间:在住{{ period.checkInCount }}间/空置{{
-                    period.vacantCount
-                  }}间</span
+                  >{{ period.rooms.length }}间:在住{{
+                    checkInCount(period.rooms)
+                  }}间/空置{{ vacantCount(period.rooms) }}间</span
                 >
                 >
                 <a-icon
                 <a-icon
                   type="right"
                   type="right"
@@ -256,7 +256,7 @@
                         ><span>¥{{ roomLive.layout.marketPrice }}/晚</span>
                         ><span>¥{{ roomLive.layout.marketPrice }}/晚</span>
                       </template>
                       </template>
                       <a-dropdown :trigger="['contextmenu']">
                       <a-dropdown :trigger="['contextmenu']">
-                        <div>
+                        <div style="height: 100%">
                           <div
                           <div
                             style="
                             style="
                               text-overflow: ellipsis;
                               text-overflow: ellipsis;
@@ -913,6 +913,14 @@ export default {
     // this.$refs.ModalEditScheduleRoom.disableSubmit = false;
     // this.$refs.ModalEditScheduleRoom.disableSubmit = false;
   },
   },
   methods: {
   methods: {
+    checkInCount(rooms) {
+      return rooms.filter((t) => t.livingData && t.livingData.livingOrder)
+        .length;
+    },
+    vacantCount(rooms) {
+      return rooms.filter((t) => !t.livingData || !t.livingData.livingOrder)
+        .length;
+    },
     tabsClick(e) {
     tabsClick(e) {
       if (e == "1") {
       if (e == "1") {
         getAction("/rooms/cesRooms/realtime-rooms", {}).then((res) => {
         getAction("/rooms/cesRooms/realtime-rooms", {}).then((res) => {
@@ -1085,10 +1093,11 @@ export default {
         this.$refs.ModalScheduleRoom.addList([], e.key);
         this.$refs.ModalScheduleRoom.addList([], e.key);
         this.$refs.ModalScheduleRoom.title = "散客预定登记";
         this.$refs.ModalScheduleRoom.title = "散客预定登记";
         this.$refs.ModalScheduleRoom.disableSubmit = false;
         this.$refs.ModalScheduleRoom.disableSubmit = false;
+      } else {
+        this.$refs.modalForm.add();
+        this.$refs.modalForm.title = "维修";
+        this.$refs.modalForm.disableSubmit = false;
       }
       }
-      this.$refs.modalForm.add();
-      this.$refs.modalForm.title = "维修";
-      this.$refs.modalForm.disableSubmit = false;
     },
     },
     modalBillRoomFormOk(e) {
     modalBillRoomFormOk(e) {
       console.log("e", e);
       console.log("e", e);