Browse Source

换房 叫醒 团队文字

DESKTOP-B78GIPM\admin 2 years ago
parent
commit
b74091ec01

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

@@ -170,6 +170,9 @@
                         style="font-size: 40px"
                       />
                     </div>
+                    <div style="position:absolute;top:-8px;padding:6px;border-radius:50%;border:2px solid #ccc;color:#ccc;left:60%;" v-if="roomLive.livingData &&  roomLive.livingData.livingOrder && roomLive.livingData.livingOrder.isTeam">
+                      {{roomLive.livingData.livingOrder.teamTag}}
+                    </div>
                     <a-popover
                       placement="rightTop"
                       :mouseLeaveDelay="0"
@@ -1775,6 +1778,9 @@ export default {
       } else if (e.key == 16) {
         this.handleBillInfo(row);
         return;
+      }else if(e.key == 17){
+        console.log(row);
+        // getAction('/business/busRoomBookingOrders/reverse-living?livingOrderId='+row)
       }
     },
     modalBillRoomFormOk(e) {
@@ -2111,6 +2117,7 @@ export default {
   border-radius: 5px;
   cursor: pointer;
   position: relative;
+  overflow: hidden;
 }
 #components-grid-demo-playground pre {
   background: #f9f9f9;

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

@@ -2440,6 +2440,7 @@ export default {
         roomIds: JSON.parse(JSON.stringify(roomLiveList)),
       });
       this.modelDefault.orderInfo.bookingOrdersType = key;
+      this.model.orderInfo.bookingOrdersType = key;
       this.edit(this.modelDefault);
     },
     async edit(record) {
@@ -2679,6 +2680,9 @@ export default {
             httpurl += this.url.edit;
             method = "put";
           }
+          console.log(this.model);
+          // return
+          // this.model.orderInfo.bookingOrdersType =  this.modelDefault.orderInfo.bookingOrdersType;
           // if (this.model.orderInfo.bookingOrdersId) {
           //   httpurl = "/business/busRoomBookingOrders/add-batch";
           //   method = "post";

+ 123 - 22
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -158,30 +158,26 @@
                   style="color: rgba(255, 141, 26, 1); font-size: 18px"
                 />
               </a-descriptions-item>
-              <a-descriptions-item
+              <template v-if="wakeList.length==0">
+                <a-descriptions-item
+                label="叫醒服务"
+                :span="2"
+              >
+                <a-icon
+                  type="plus-circle"
+                  class="dynamic-delete-button"
+                  @click="puls()"
+                />
+              </a-descriptions-item>
+              </template>
+              <template v-else>
+                <a-descriptions-item
                 label="叫醒服务"
                 :span="2"
                 v-for="(item, index) in wakeList"
                 :key="index"
               >
-                <a-select
-                  style="width: 100px"
-                  placeholder="房间号"
-                  @change="onChange"
-                >
-                  <a-select-option value="jack"> 1001 </a-select-option>
-                  <a-select-option value="lucy"> 1002 </a-select-option>
-                </a-select>
-                <a-date-picker
-                  style="width: 120px; margin-left: 2px"
-                  placeholder="日期"
-                  @change="onChange"
-                />
-                <a-time-picker
-                  style="width: 100px; margin-left: 2px"
-                  :default-value="moment('12:08', 'HH:mm')"
-                  format="HH:mm"
-                />
+              {{item.roomName}}  {{item.jxDate? item.jxDate+' /' :''}} {{item.jxTime}}
                 <a-icon
                   v-if="wakeList.length - 1 == index"
                   type="plus-circle"
@@ -192,10 +188,12 @@
                   type="minus-circle"
                   style="color: #f56c6c"
                   class="dynamic-delete-button"
-                  v-if="wakeList.length > 1"
-                  @click="() => remove(index)"
+                  @click="removeWakeService(item.id)"
                 />
               </a-descriptions-item>
+              </template>
+              
+              
             </a-descriptions>
             <div style="display: flex; justify-content: space-between">
               <h4
@@ -499,6 +497,29 @@
       ref="modalEditBookingTypeModal"
       @ok="modalFormOk"
     ></edit-booking-type-modal>
+
+    <!-- 叫醒服务弹窗 -->
+    <a-modal :title="'叫醒服务'" :visible="wakeService" @cancel="wakeService = false" @ok="wakeServiceOk" destroyOnClose>
+      <a-select
+        style="width: 100px"
+        placeholder="房间号"
+        @change="onChange"
+        v-model="wakeTime.id"
+      >
+        <a-select-option :value="item.livingOrder.id" v-for="(item, index) in (model.livingRoomIds || []).filter(item=> item.roomName!='全部')" :key="index"> {{item.roomName}} </a-select-option>
+        <!-- <a-select-option value="lucy"> 1002 </a-select-option> -->
+      </a-select>
+      <a-date-picker
+        style="width: 120px; margin-left: 2px"
+        placeholder="日期"
+        @change="onChangeWakeService"
+      />
+      <a-time-picker
+        style="width: 100px; margin-left: 2px"
+        format="HH:mm"
+        @change="onChangeWakeServiceTime"
+      />
+    </a-modal>
   </div>
 </template>
 
@@ -647,6 +668,12 @@ export default {
   },
   data() {
     return {
+      wakeService: false,
+      wakeTime:{
+        id: "",
+        date: "",
+        time: "",
+      },
       selectedRowKeys: [],
       data,
       columns,
@@ -775,6 +802,70 @@ export default {
     });
   },
   methods: {
+    // 叫醒服务
+    wakeServiceOk(){
+      console.log(this.wakeTime);
+      if (!this.wakeTime.id) {
+        this.$message.warning("请选择房间号");
+        return;
+      }
+      if (!this.wakeTime.date) {
+        this.$message.warning("请选择日期");
+        return;
+      }
+      if (!this.wakeTime.time) {
+        this.$message.warning("请选择时间");
+        return;
+      }
+      let obj = {
+        livingOrderId: this.wakeTime.id,
+        jxDate: this.wakeTime.date,
+        jxTime: this.wakeTime.time,
+      }
+      postAction('/fw/fwLivingJx/add',obj).then(res=>{
+        if(res.success){
+          this.$message.success("添加成功");
+          this.wakeTime = {};
+          this.getWakeServiceData()
+          this.wakeService = false;
+        }else{
+          this.$message.warning(res.message);
+        }
+      })
+    },
+    //获取叫醒服务数据
+    getWakeServiceData(){
+      let ids = []
+      this.model.livingRoomIds.forEach(item=>{
+        if(item.roomName!='全部'){
+          ids.push(item.livingOrder.id)
+        }
+      })
+      getAction('/fw/fwLivingJx/list?livingOrderId=' + ids.toString()).then(res=>{
+        if(res.success){
+          this.wakeList = res.result.records;
+        }
+      })
+    },
+    //删除叫醒服务
+    removeWakeService(id){
+      deleteAction('/fw/fwLivingJx/delete?id=' + id).then(res=>{
+        if(res.success){
+          this.$message.success("删除成功");
+          this.getWakeServiceData();
+        }else{
+          this.$message.warning(res.message);
+        }
+      })
+    },
+    onChangeWakeService(e, e1){
+      console.log(e, e1);
+      this.wakeTime.date = e1;
+    },
+    onChangeWakeServiceTime(e,e1){
+      console.log(e,e1);
+      this.wakeTime.time = e1
+    },
     editBookingType(item) {
       var obj = {
         orderId: item.livingOrder.id,
@@ -886,12 +977,20 @@ export default {
       var index = this.model.livingRoomIds.findLastIndex(
         (t) => t.roomId == this.selectRoomId
       );
+      console.log(this.model.livingRoomIds);
       var find = this.model.livingRoomIds[index];
+      let arr = []
+      this.model.livingRoomIds.forEach(ele=>{
+        if (ele.roomName!='全部') {
+          arr.push(ele.livingOrder.id)
+        }
+      })
       this.$refs.modalSelectCheckInRoomOrder.add();
       this.$refs.modalSelectCheckInRoomOrder.title = "请选择需要关联的订单";
       this.$refs.modalSelectCheckInRoomOrder.disableSubmit = false;
       this.$refs.modalSelectCheckInRoomOrder.livingOrderId =
         find.livingOrder.id;
+      this.$refs.modalSelectCheckInRoomOrder.filterIds = arr
       this.$refs.modalSelectCheckInRoomOrder.livingRoomId = find.roomId;
     },
     addLeaseGoods() {
@@ -1121,6 +1220,7 @@ export default {
             : res.result.livingRoomIds[1].roomId;
           this.selectRoomId = this.tabSelectRoomId;
           this.model = res.result;
+          this.getWakeServiceData()
           getAction("/business/busRoomBookingOrders/living-fees", {
             bookingOrderId: this.model.orderInfo.id,
           }).then((res) => {
@@ -1207,7 +1307,8 @@ export default {
       }
     },
     puls() {
-      this.wakeList.push({});
+      this.wakeService = true;
+      // this.wakeList.push({});
     },
     remove(index) {
       this.wakeList.splice(index, 1);

+ 6 - 2
src/views/room/modules/checkIn/SelectCheckInRoomOrder.vue

@@ -94,7 +94,11 @@ export default {
   mixins: [JeecgListMixin, mixinDevice],
   props: {
     livingOrderId: {
-      type: String,
+      type: Array,
+      default: null,
+    },
+    filterIds:{
+      type: Array,
       default: null,
     },
     livingRoomId: {
@@ -168,7 +172,7 @@ export default {
       console.log("val", val);
       if (val && val.length > 0) {
         this.dataSource = val.filter(
-          (t) => t.livingOrderId != this.livingOrderId
+          (t) => !this.filterIds.includes(t.livingOrderId)
         );
       }
       this.end = true;

+ 3 - 1
src/views/room/modules/checkIn/SelectCheckInRoomOrderModal.vue

@@ -15,6 +15,7 @@
       :disabled="disableSubmit"
       :livingOrderId="livingOrderId"
       :livingRoomId="livingRoomId"
+      :filterIds="filterIds"
     ></picking-goods-order>
   </j-modal>
 </template>
@@ -32,8 +33,9 @@ export default {
       width: 1200,
       visible: false,
       disableSubmit: false,
-      livingOrderId: "",
+      livingOrderId: [],
       livingRoomId: "",
+      filterIds:[]
     };
   },
   methods: {

+ 42 - 29
src/views/room/modules/fangtaiModal/exchangeHouses/exchangeHousesForm.vue

@@ -33,14 +33,14 @@
                         <a-col :span="24">
                             <a-form-model-item label="新房间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
                                 <template v-if="selectData.length>0">
-                                    {{newRoom && newRoom.roomInfo.name}}
+                                    {{newRoom && newRoom.name}}
                                 </template> <a href="#" @click="selectVisible = true">选择</a>
                             </a-form-model-item>
                         </a-col>
                         <a-col :span="24">
                             <a-form-model-item label="房价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
                                 <!-- <a-input-number :min="0" v-model="dayNum" placeholder="请输入续住天数" style="width: 40%" @change="dayChange" /> -->
-                                <template v-if="newRoom && newRoom.roomInfo">
+                                <template v-if="newRoom">
                                     {{ timeData.reduce((pre,cur)=> pre+cur.price*1,0) }}
                                     <a-popover placement="right">
                                         <template slot="content">
@@ -100,8 +100,8 @@
             </a-col>
             <a-col :span="24" v-if="dataList.length>0">
                 <div style="display:flex;flex-wrap:wrap;height:400px;overflow: auto;">
-                    <div v-for="(item,index) in dataList" :key="index" @click="selectRoom(item, index)" :class="{'active':index==link}" style="border:1px solid #ccc;padding: 5px 20px;margin-right:10px;margin-top:10px;border-radius:5px;">
-                        {{ item.roomInfo && item.roomInfo.name}}
+                    <div v-for="(item,index) in dataList" :key="index" @click="selectRoom(item, index)" :class="{'active':index==link}" style="border:1px solid #ccc;padding: 5px 20px;margin-right:10px;margin-top:10px;border-radius:5px;height:30px">
+                        {{ item && item.name}}
                     </div>
                 </div>
             </a-col>
@@ -265,17 +265,16 @@ export default {
                 this.roomStatusList = list;
             }
         });
-        this.loadData();
     },
     methods: {
         changeSelct() {
-            if (this.selectData[0].roomInfo.id == this.model.roomInfo.id) {
+            if (this.selectData[0].id == this.model.id) {
                 this.$message.warning("不能选择相同的房间");
                 return
             }
             this.newRoom = this.selectData[0]
-            this.timeData.forEach(ele=>{
-                ele.price = this.newRoom.layout.marketPrice
+            this.timeData.forEach(ele => {
+                ele.price = this.newRoom.marketPrice
             })
             this.selectVisible = false;
         },
@@ -361,26 +360,26 @@ export default {
             var list = this.oldRoomList;
             if (this.checkedCesRoomLayoutList.length > 0) {
                 list = this.oldRoomList.reduce((acc, curr) => {
-                    const rooms = curr.rooms.filter((room) =>
-                        this.checkedCesRoomLayoutList.includes(room.layout.id)
+                    const floorRooms = curr.floorRooms.filter((room) =>
+                        this.checkedCesRoomLayoutList.includes(room.layoutId)
                     );
                     acc.push({
                         ...curr,
-                        rooms
+                        floorRooms
                     });
                     return acc;
                 }, []);
             }
             if (this.checkedRoomStatusList.length > 0) {
                 list = list.reduce((acc, curr) => {
-                    const rooms = curr.rooms.filter((room) =>
+                    const floorRooms = curr.floorRooms.filter((room) =>
                         this.checkedRoomStatusList.includes(
-                            room.roomInfo.roomStatus.toString()
+                            room.roomStatus.toString()
                         )
                     );
                     acc.push({
                         ...curr,
-                        rooms
+                        floorRooms
                     });
                     return acc;
                 }, []);
@@ -389,9 +388,9 @@ export default {
             this.roomList = list;
             let arr = [];
             this.roomList.forEach(ele => {
-                ele.rooms.forEach(item => {
+                ele.floorRooms.forEach(item => {
                     if (item) {
-                        if (arr.some(i => i.roomInfo.id == item.roomInfo.id)) {} else {
+                        if (arr.some(i => i.id == item.id)) {} else {
                             arr.push(item)
                         }
                     }
@@ -403,13 +402,26 @@ export default {
         loadData() {
             // this.checkInBtnDis = false;
             // this.scheduleBtnDis = false;
-            getAction("/rooms/cesRooms/realtime-rooms", {}).then((res) => {
+            // getAction("/rooms/cesRooms/realtime-rooms", {}).then((res) => {
+            //     if (res.success) {
+            //         res.result.forEach((row) => {
+            //             this.$set(row, "collapse", 1);
+            //         });
+            //         this.roomList = res.result;
+            //         this.oldRoomList = JSON.parse(JSON.stringify(res.result));
+            //         this.checkChange()
+            //     }
+            // });
+            getAction("/rooms/cesRooms/can-user-rooms", {
+                startOf: this.model.livingData.livingOrder.arrivalTime,
+                endOf: this.model.livingData.livingOrder.dueOutTime,
+                bookingType: 1,
+                hourRoomRuleId: '',
+                cancelLayout: true,
+            }).then((res) => {
                 if (res.success) {
-                    res.result.forEach((row) => {
-                        this.$set(row, "collapse", 1);
-                    });
-                    this.roomList = res.result;
-                    this.oldRoomList = JSON.parse(JSON.stringify(res.result));
+                    this.roomList = res.result[0].buildingRooms;
+                    this.oldRoomList = JSON.parse(JSON.stringify(res.result[0].buildingRooms));
                     this.checkChange()
                 }
             });
@@ -419,6 +431,7 @@ export default {
         },
         edit(record) {
             this.model = Object.assign({}, record);
+            this.loadData();
             // this.model.startValue = record.livingData.livingOrder.dueOutTime
             let arr = []
             arr.length = this.daysBetween(record.livingData.livingOrder.dueOutTime, record.livingData.livingOrder.arrivalTime)
@@ -426,7 +439,7 @@ export default {
                 arr[i] = {
                     day: this.addDate(record.livingData.livingOrder.arrivalTime, i),
                     // price: this.model.layout.marketPrice,
-                    price:0
+                    price: 0
                 };
             }
             console.log(arr);
@@ -438,6 +451,10 @@ export default {
             // 触发表单验证
             this.$refs.form.validate((valid) => {
                 if (valid) {
+                    if (!this.newRoom) {
+                        this.$message.warning("请选择新房间");
+                        return
+                    }
                     that.confirmLoading = true;
                     let httpurl = "";
                     let method = "";
@@ -448,19 +465,15 @@ export default {
                     //     httpurl += this.url.edit;
                     //     method = "put";
                     // }
-                    if (!this.newRoom || !this.newRoom.roomInfo) {
-                        this.$message.warning("请选择新房间");
-                        return
-                    }
                     let prices = this.timeData.map(item => {
                         return {
                             dayTime: item.day,
                             price: item.price,
-                            roomId: this.newRoom.roomInfo.id
+                            roomId: this.newRoom.id
                         }
                     })
                     // return
-                    httpAction(`/business/busRoomBookingOrders/change-living-room?livingOrderId=${this.model.roomInfo.livingOrderId}&changeRoomId=${this.newRoom.roomInfo.id}`, prices, 'post')
+                    httpAction(`/business/busRoomBookingOrders/change-living-room?livingOrderId=${this.model.roomInfo.livingOrderId}&changeRoomId=${this.newRoom.id}`, prices, 'post')
                         .then((res) => {
                             if (res.success) {
                                 that.$message.success(res.message);