Prechádzať zdrojové kódy

更改房态页面侧边筛选 更改房态页面房间详情

覃浩 2 rokov pred
rodič
commit
634ee0e362

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

@@ -791,6 +791,9 @@
           :options="roomStatusList"
           @change="checkChange"
         >
+        <!-- <template slot-scope="scope">
+          111
+        </template> -->
         </a-checkbox-group>
         <p
           style="
@@ -828,8 +831,8 @@
           房间信息
         </p>
         <a-checkbox-group
-          v-model="checkedCesRoomLayoutList"
-          :options="['欠费', '无押金', '续住', '换房', '租借', '不足']"
+          v-model="checkedCestList"
+          :options="roomInformationScreening"
           @change="checkChange"
         >
         </a-checkbox-group>
@@ -838,7 +841,7 @@
         </p>
         <a-checkbox-group
           v-model="checkedStateList"
-          :options="['生日', '叫醒', '免打扰', '免查询']"
+          :options="customerServiceScreening"
           @change="checkChange"
         >
         </a-checkbox-group>
@@ -1072,6 +1075,58 @@ export default {
           color: 'rgba(128, 128, 128, 1)'
         }
       },
+      // 叫醒房间
+      rouseRoomList: [],
+      // 房间信息筛选暂时
+      roomInformationScreening:[
+        {
+          label: '欠费',
+          value: '1'
+        },
+        {
+          label: '无押金',
+          value: '2'
+        },
+        {
+          label: '续住',
+          value: '3'
+        },
+        {
+          label: '换房',
+          value: '4'
+        },
+        {
+          label: '租借',
+          value: '5'
+        },
+        {
+          label: '不足',
+          value: '6'
+        },
+      ],
+      // 对客服务筛选
+      customerServiceScreening:[
+        {
+          label: '生日',
+          value: '1'
+        },
+        {
+          label: '叫醒',
+          value: '2'
+        },
+        {
+          label: '免打扰',
+          value: '3'
+        },
+        {
+          label: '免查询',
+          value: '4'
+        },
+        {
+          label: '保密房',
+          value: '5'
+        },
+      ],
       startDate: '',
       endDate: '',
       customerSourceList: [],
@@ -1089,7 +1144,12 @@ export default {
       checkInBtnDis: false,
       kzfLiving: false,
       roomCard: false,
-      roomClear: false
+      roomClear: false,
+      CustomerSourceScreening:[],
+      // 房间类型
+      checkedCestList: [],
+      // 房间信息暂存数据
+      rouseinfoRoomList:[]
     }
   },
   watch: {
@@ -1182,6 +1242,7 @@ export default {
       hotelId: _info.id,
       dictId: '1639538915239743490'
     }).then((res) => {
+      console.log(res);
       if (res.success) {
         var list = []
         res.result.records.forEach((item) => {
@@ -1194,6 +1255,7 @@ export default {
       pageSize: 99999,
       pageNo: 1
     }).then((res) => {
+      // console.log(res);
       if (res.success) {
         var list = []
         res.result.records.forEach((item) => {
@@ -1208,6 +1270,7 @@ export default {
       }
     })
     getAction('/rooms/cesRooms/room-status-color', {}).then((res) => {
+      // console.log(res,'1214');
       if (res.success) {
         this.roomStatusColorList = res.result
         var list = []
@@ -1218,6 +1281,9 @@ export default {
       }
     })
     this.loadData()
+    
+    console.log(this.roomCard);
+    console.log(this.roomList);
   },
   mounted() {
     // this.handleBillInfo();
@@ -1233,7 +1299,137 @@ export default {
     // this.$refs.ModalEditScheduleRoom.disableSubmit = false;
   },
   methods: {
-
+    // 处理筛选条件数据-房型
+    roomTypeData(val) {
+      this.cesRoomLayoutList.forEach(item => {
+        if (item.value == val) {
+          let tempindex = this.cesRoomLayoutList.findIndex(index => index == item)
+          if (item.label.substr(-1) == '1') {
+            this.cesRoomLayoutList.splice(tempindex,1,{label: item.label,value: item.value})
+          } else if ('figure' in item){
+            this.cesRoomLayoutList.splice(tempindex,1,{label: item.label, figure:item.figure + 1, value: item.value})
+          } else {
+            this.cesRoomLayoutList.splice(tempindex,1,{label: item.label, figure:1, value: item.value})
+          }
+        }
+      })
+    },
+    // 处理筛选条件数据-对客服务
+    customerServiceProcessing(val,rouse) {
+      this.customerServiceScreening.forEach(ids => {
+        // 处理叫醒
+        if (ids.value == '2' && rouse == true) {
+            let tempindex = this.customerServiceScreening.findIndex(index => index == ids)
+            if (ids.label.substr(-1) == '1') {
+              this.customerServiceScreening.splice(tempindex,1,{label: ids.label,value: ids.value})
+            } else if ('figure' in ids){
+              this.customerServiceScreening.splice(tempindex,1,{label: ids.label, figure:ids.figure + 1, value: ids.value})
+            } else {
+              this.customerServiceScreening.splice(tempindex,1,{label: ids.label, figure:1, value: ids.value})
+            }
+        }
+        // console.log(ids);
+        // 处理免打扰
+        if (ids.value == '3' && val.ddisturb == true) {
+          let tempindex = this.customerServiceScreening.findIndex(index => index == ids)
+          if (ids.label.substr(-1) == '1') {
+            this.customerServiceScreening.splice(tempindex,1,{label: ids.label,value: ids.value})
+          } else if ('figure' in ids){
+            this.customerServiceScreening.splice(tempindex,1,{label: ids.label, figure:ids.figure + 1, value: ids.value})
+          } else {
+            this.customerServiceScreening.splice(tempindex,1,{label: ids.label, figure:1, value: ids.value})
+          }
+        }
+        // 处理免查询
+        if (ids.value == '4' && val.dquery == true) {
+          let tempindex = this.customerServiceScreening.findIndex(index => index == ids)
+          if (ids.label.substr(-1) == '1') {
+            this.customerServiceScreening.splice(tempindex,1,{label: ids.label,value: ids.value})
+          } else if ('figure' in ids){
+            this.customerServiceScreening.splice(tempindex,1,{label: ids.label, figure:ids.figure + 1, value: ids.value})
+          } else {
+            this.customerServiceScreening.splice(tempindex,1,{label: ids.label, figure:1, value: ids.value})
+          }
+        }
+        // 处理保密房
+        if (ids.value == '5' && val.secrecy == true) {
+          let tempindex = this.customerServiceScreening.findIndex(index => index == ids)
+          if (ids.label.substr(-1) == '1') {
+            this.customerServiceScreening.splice(tempindex,1,{label: ids.label,value: ids.value})
+          } else if ('figure' in ids){
+            this.customerServiceScreening.splice(tempindex,1,{label: ids.label, figure:ids.figure + 1, value: ids.value})
+          } else {
+            this.customerServiceScreening.splice(tempindex,1,{label: ids.label, figure:1, value: ids.value})
+          }
+        }
+      })
+    },
+    // 处理筛选条件数据-房间信息
+    roomInformationFiltering(val,rouse) {
+      this.roomInformationScreening.forEach(ids => {
+        // 处理租借
+        if (ids.value == '5' && rouse == true) {
+            let tempindex = this.roomInformationScreening.findIndex(index => index == ids)
+            if (ids.label.substr(-1) == '1') {
+              this.roomInformationScreening.splice(tempindex,1,{label: ids.label,value: ids.value})
+            } else if ('figure' in ids){
+              this.roomInformationScreening.splice(tempindex,1,{label: ids.label, figure:ids.figure + 1, value: ids.value})
+            } else {
+              this.roomInformationScreening.splice(tempindex,1,{label: ids.label, figure:1, value: ids.value})
+            }
+        }
+        // console.log(ids);
+        // 处理续住
+        if (ids.value == '3' && val.isStayOver == true) {
+          let tempindex = this.roomInformationScreening.findIndex(index => index == ids)
+          if (ids.label.substr(-1) == '1') {
+            this.roomInformationScreening.splice(tempindex,1,{label: ids.label,value: ids.value})
+          } else if ('figure' in ids){
+            this.roomInformationScreening.splice(tempindex,1,{label: ids.label, figure:ids.figure + 1, value: ids.value})
+          } else {
+            this.roomInformationScreening.splice(tempindex,1,{label: ids.label, figure:1, value: ids.value})
+          }
+        }
+        // 处理换房
+        if (ids.value == '4' && val.isChangeRoom == true) {
+          let tempindex = this.roomInformationScreening.findIndex(index => index == ids)
+          if (ids.label.substr(-1) == '1') {
+            this.roomInformationScreening.splice(tempindex,1,{label: ids.label,value: ids.value})
+          } else if ('figure' in ids){
+            this.roomInformationScreening.splice(tempindex,1,{label: ids.label, figure:ids.figure + 1, value: ids.value})
+          } else {
+            this.roomInformationScreening.splice(tempindex,1,{label: ids.label, figure:1, value: ids.value})
+          }
+        }
+        // 处理保密房
+        if (ids.value == '1' && val.shouKuan - val.xiaoFei < 0) {
+          let tempindex = this.roomInformationScreening.findIndex(index => index == ids)
+          if (ids.label.substr(-1) == '1') {
+            this.roomInformationScreening.splice(tempindex,1,{label: ids.label,value: ids.value})
+          } else if ('figure' in ids){
+            this.roomInformationScreening.splice(tempindex,1,{label: ids.label, figure:ids.figure + 1, value: ids.value})
+          } else {
+            this.roomInformationScreening.splice(tempindex,1,{label: ids.label, figure:1, value: ids.value})
+          }
+        }
+      })
+    },
+    // 处理筛选条件数据-客源
+    screeningQuantity(val) {
+      this.customerSourceList.forEach(ids => {
+        if (ids.value == val) {
+          let tempindex = this.customerSourceList.findIndex(index => index == ids)
+          // console.log(!('figure' in ids));
+          if (ids.label.substr(-1) == '1') {
+            this.customerSourceList.splice(tempindex,1,{label: ids.label,value: ids.value})
+          } else if ('figure' in ids){
+            this.customerSourceList.splice(tempindex,1,{label: ids.label, figure:ids.figure + 1, value: ids.value})
+          } else {
+            this.customerSourceList.splice(tempindex,1,{label: ids.label, figure:1, value: ids.value})
+          }
+        }
+      },)
+    },
     handleContextMenu(event) {
       event.preventDefault()
       const dropdown = this.$refs.dropdown
@@ -1321,6 +1517,9 @@ export default {
       this.$refs.posOrderModal.visible = true
     },
     getCustomerSourceList(customerSource, first) {
+      // console.log(customerSource);
+      // console.log(this.customerSourceList);
+      // console.log(first);
       var find = this.customerSourceList.find((t) => t.value == customerSource)
       if (find) {
         return first ? find.label.substr(0, 1) : find.label
@@ -1412,7 +1611,7 @@ export default {
         this.$message.warning(e.message)
         return
       }
-      debugger
+      // debugger
       this.$refs.ModalBillRoomForm.addList(selectRoom, e.key)
       this.$refs.ModalBillRoomForm.title =
         e.key == '1' ? '散客入住登记' : '团队入住登记'
@@ -1562,6 +1761,7 @@ export default {
         this.checkedroomBuildingFloorList
       )
       var list = this.oldRoomList
+      // 筛选房型
       if (this.checkedCesRoomLayoutList.length > 0) {
         list = this.oldRoomList.reduce((acc, curr) => {
           const rooms = curr.rooms.filter((room) =>
@@ -1571,6 +1771,7 @@ export default {
           return acc
         }, [])
       }
+      // 筛选房态
       if (this.checkedRoomStatusList.length > 0) {
         list = list.reduce((acc, curr) => {
           const rooms = curr.rooms.filter((room) =>
@@ -1582,7 +1783,7 @@ export default {
           return acc
         }, [])
       }
-      debugger
+      // 筛选来源
       if (this.checkedCustomerSourceList.length > 0) {
         list = list.reduce((acc, curr) => {
           const rooms = curr.rooms.filter((room) =>
@@ -1600,12 +1801,80 @@ export default {
           return acc
         }, [])
       }
-      console.log(this.checkedRoomStatusList)
-
+      // 筛选房间信息
+      if (this.checkedCestList.length > 0) {
+        console.log(this.checkedCestList);
+        // 过滤掉没有客人的房间
+        list = list.reduce((acc, curr) => {
+          const rooms = curr.rooms.filter(room => {
+            return room.livingData.livingOrder !== null
+          })
+          acc.push({ ...curr, rooms })
+          return acc
+        }, [])
+        // 筛选出对应服务的房间信息
+        console.log(list);
+        this.checkedCestList.forEach(item => {
+          console.log(item);
+          console.log(list);
+            list = list.reduce((acc, curr) => {
+              // if(item == '3') {
+                const rooms = curr.rooms.filter(room => {
+                  if (item == '1') {
+                    return room.livingData.livingOrder.shouKuan - room.livingData.livingOrder.xiaoFei < 0
+                  }
+                  if (item == '2') {
+                    return room.livingData.livingOrder.deposit == 0
+                  }
+                  if (item == '3') {
+                    return room.livingData.livingOrder.isStayOver == true
+                  }
+                  if (item == '4') {
+                    return room.livingData.livingOrder.isChangeRoom == true
+                  }
+                  if (item == '5') {
+                    return room.tempinfo == true
+                  }
+                })
+                acc.push({ ...curr, rooms })
+                return acc
+            }, [])
+        })
+      }
+      console.log(list);
+      // 筛选对客服务
       if (this.checkedStateList.length > 0) {
-        if (this.checkedStateList.includes('免打扰')) {
-        }
-
+        // 过滤掉没有客人的房间
+        list = list.reduce((acc, curr) => {
+          const rooms = curr.rooms.filter(room => {
+            return room.livingData.livingOrder !== null
+          })
+          acc.push({ ...curr, rooms })
+          return acc
+        }, [])
+        // 筛选出对应服务的房间
+        this.checkedStateList.forEach(item => {
+            console.log(item);
+            list = list.reduce((acc, curr) => {
+              // if(item == '3') {
+                const rooms = curr.rooms.filter(room => {
+                  if (item == '2') {
+                    return room.temproom == true
+                  }
+                  if (item == '3') {
+                    return room.livingData.livingOrder.ddisturb == true
+                  }
+                  if (item == '4') {
+                    return room.livingData.livingOrder.dquery == true
+                  }
+                  if (item == '5') {
+                    return room.livingData.livingOrder.secrecy == true
+                  }
+                })
+                acc.push({ ...curr, rooms })
+                return acc
+            }, [])
+        })
       }
       if (this.checkedroomBuildingFloorList.length > 0) {
         list = list.filter(
@@ -1638,21 +1907,21 @@ export default {
       console.log('list2', list)
       this.roomList = list
     },
-    // roomStatusChange(e) {
-    //   console.log("e", e);
-    //   var list = this.oldRoomList;
-    //   if (this.checkedRoomStatusList.length > 0) {
-    //     list = this.oldRoomList.reduce((acc, curr) => {
-    //       const rooms = curr.rooms.filter((room) =>
-    //       this.checkedRoomStatusList.includes(room.roomInfo.roomStatus.toString())
-    //       );
-    //       acc.push({ ...curr, rooms });
-    //       return acc;
-    //     }, []);
-    //   }
-    //   console.log("list2", list);
-    //   this.roomList = list;
-    // },
+    roomStatusChange(e) {
+      console.log("e", e);
+      var list = this.oldRoomList;
+      if (this.checkedRoomStatusList.length > 0) {
+        list = this.oldRoomList.reduce((acc, curr) => {
+          const rooms = curr.rooms.filter((room) =>
+          this.checkedRoomStatusList.includes(room.roomInfo.roomStatus.toString())
+          );
+          acc.push({ ...curr, rooms });
+          return acc;
+        }, []);
+      }
+      console.log("list2", list);
+      this.roomList = list;
+    },
     collapseClick(row, value) {
       this.$set(row, 'collapse', value)
     },
@@ -2093,6 +2362,66 @@ export default {
         }
       })
     },
+    // 处理房态数据代码
+    houseStateNumbers() {
+      // 处理房态数据
+      var tempGreen = 0
+      var tempBlack = 0
+      var tempRed = 0
+      var temppurple = 0
+      var tempDarkGreeb = 0
+      var tempGray = 0
+      var tempYellow = 0
+      this.roomList.forEach(item => {
+        item.rooms.forEach(index => {
+          if (index.roomInfo.roomStatus == '1') {
+            tempGreen++
+          }
+          if (index.roomInfo.roomStatus == '2') {
+            tempBlack++
+          }
+          if (index.roomInfo.roomStatus == '3') {
+            tempRed++
+          }
+          if (index.roomInfo.roomStatus == '4') {
+            temppurple++
+          }
+          if (index.roomInfo.roomStatus == '5') {
+            tempDarkGreeb++
+          }
+          if (index.roomInfo.roomStatus == '6') {
+            tempGray++
+          }
+          if (index.roomInfo.roomStatus == '7') {
+            tempYellow++
+          }
+        })
+      })
+      let templist = this.roomStatusList.map(item => {
+        if (item.value == '1') {
+          return {label:item.label + tempGreen,value: item.value}
+        }
+        if (item.value == '2') {
+          return {label:item.label + tempBlack,value: item.value}
+        }
+        if (item.value == '3') {
+          return {label:item.label + tempRed,value: item.value}
+        }
+        if (item.value == '4') {
+          return {label:item.label + temppurple,value: item.value}
+        }
+        if (item.value == '5') {
+          return {label:item.label + tempDarkGreeb,value: item.value}
+        }
+        if (item.value == '6') {
+          return {label:item.label + tempGray,value: item.value}
+        }
+        if (item.value == '7') {
+          return {label:item.label + tempYellow,value: item.value}
+        }
+      })
+      this.roomStatusList = templist
+    },
     modalBillRoomFormOk(e) {
       this.loadData()
       console.log('e', e)
@@ -2143,19 +2472,152 @@ export default {
         params: { id: e }
       })
     },
-    loadData() {
+    async loadData() {
       this.checkInBtnDis = false
       this.scheduleBtnDis = false
-      getAction('/rooms/cesRooms/realtime-rooms', {}).then((res) => {
+      await getAction('/rooms/cesRooms/realtime-rooms', {}).then((res) => {
+        console.log(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.houseStateNumbers()
+          // 处理来源
+          this.roomList.forEach(item => {
+            item.rooms.forEach(cust => {
+              if (cust.livingData.livingOrder !== null) {
+                this.screeningQuantity(cust.livingData.livingOrder.customerSource)
+              }
+              if (cust.bookingData.bookingOrder !== null) {
+                this.screeningQuantity(cust.bookingData.bookingOrder.customerSource)
+              }
+            })
+          })
+          this.customerSourceList.forEach(item => {
+            if ('figure' in item) {
+              let tempindex = this.customerSourceList.findIndex(index => index == item)
+              this.customerSourceList.splice(tempindex,1,{label: item.label + item.figure,value: item.value})
+            } else {
+              let tempindex = this.customerSourceList.findIndex(index => index == item)
+              this.customerSourceList.splice(tempindex,1,{label: item.label + 0,value: item.value})
+            }
+          })
+          console.log(this.customerSourceList);
+          
+          // 处理房型
+          this.roomList.forEach(item => {
+            item.rooms.forEach(cust => {
+              this.roomTypeData(cust.layout.id)
+            })
+          })
+          this.cesRoomLayoutList.forEach(item => {
+            if ('figure' in item) {
+              let tempindex = this.cesRoomLayoutList.findIndex(index => index == item)
+              this.cesRoomLayoutList.splice(tempindex,1,{label: item.label + item.figure,value: item.value})
+            } else {
+              let tempindex = this.cesRoomLayoutList.findIndex(index => index == item)
+              this.cesRoomLayoutList.splice(tempindex,1,{label: item.label + 0,value: item.value})
+            }
+          })
         }
       })
-
+      await getAction("/fw/fwLivingJx/getJxRooms", {}).then((res) => {
+        console.log(res);
+          if (res.success) {
+              res.result.forEach((row) => {
+                  this.$set(row, "collapse", 1);
+              });
+              this.rouseRoomList = res.result;
+          }
+          var temproomlist = this.oldRoomList
+          // 这里处理对客服务中的叫醒数据
+          this.rouseRoomList.forEach(item => {
+            temproomlist.forEach((cust,custindex) => {
+              cust.rooms.forEach(index => {
+                if (index.roomInfo.id == item.id) {
+                  let tempindex = cust.rooms.findIndex(room => room == index)
+                  let temproom = true
+                  cust.rooms.splice(tempindex,1,{...index,temproom:temproom})
+                }
+                
+              })
+            })
+          })
+          this.roomList = temproomlist
+          console.log(this.roomList);
+          // 处理对客服务数字
+          this.roomList.forEach(item => {
+            item.rooms.forEach(cust => {
+              if (cust.livingData.livingOrder !== null) {
+                if ('temproom' in cust) {
+                  this.customerServiceProcessing(cust.livingData.livingOrder, cust.temproom)
+                } else {
+                  this.customerServiceProcessing(cust.livingData.livingOrder)
+                }
+              }
+            })
+          })
+          this.customerServiceScreening.forEach(item => {
+            if ('figure' in item) {
+              let tempindex = this.customerServiceScreening.findIndex(index => index == item)
+              this.customerServiceScreening.splice(tempindex,1,{label: item.label + item.figure,value: item.value})
+            } else {
+              let tempindex = this.customerServiceScreening.findIndex(index => index == item)
+              this.customerServiceScreening.splice(tempindex,1,{label: item.label + 0,value: item.value})
+            }
+          })
+      });
+      await getAction("/order/cesOrderLeaseGoods/getLeaseRoom", {}).then((res) => {
+          console.log(res);
+          if (res.success) {
+              res.result.forEach((row) => {
+                  this.$set(row, "collapse", 1);
+              });
+              this.rouseinfoRoomList = res.result;
+          }
+          let templeaseroomlist = this.oldRoomList
+          // 这里处理对房间信息中的租借
+          this.rouseinfoRoomList.forEach(item => {
+            templeaseroomlist.forEach((cust,custindex) => {
+              cust.rooms.forEach(index => {
+                if (index.roomInfo.id == item.id) {
+                  let tempindex = cust.rooms.findIndex(room => room == index)
+                  let tempinfo = true
+                  cust.rooms.splice(tempindex,1,{...index,tempinfo:tempinfo})
+                }
+                
+              })
+            })
+          })
+          // 可能有问题
+          this.roomList = templeaseroomlist
+          console.log(this.roomList);
+          // 处理房间信息数字
+          this.roomList.forEach(item => {
+            item.rooms.forEach(cust => {
+              if (cust.livingData.livingOrder !== null) {
+                if ('tempinfo' in cust) {
+                  this.roomInformationFiltering(cust.livingData.livingOrder, cust.tempinfo)
+                } else {
+                  this.roomInformationFiltering(cust.livingData.livingOrder)
+                }
+              }
+            })
+          })
+          this.roomInformationScreening.forEach(item => {
+            if ('figure' in item) {
+              let tempindex = this.roomInformationScreening.findIndex(index => index == item)
+              this.roomInformationScreening.splice(tempindex,1,{label: item.label + item.figure,value: item.value})
+            } else {
+              let tempindex = this.roomInformationScreening.findIndex(index => index == item)
+              this.roomInformationScreening.splice(tempindex,1,{label: item.label + 0,value: item.value})
+            }
+          })
+      });
+      
       getAction('/business/busOtherEmptyDirtyRoom/queryByHotelId', {}).then(
         (res) => {
           if (res.success) {

+ 88 - 7
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -424,6 +424,35 @@
         </div>
         <a-divider style="margin-bottom: 0px" />
         <a-tabs :v-model="active" @change="tabFeeChange" style="padding-top: 0px">
+          <a-tab-pane tab="全部账单" key="0" :forceRender="true">
+            <a-table
+              :columns="columns"
+              :data-source="entiretyList"
+              :pagination="false"
+              :scroll="{ y: 160 }"
+              rowKey="id"
+              :rowSelection="{
+                consumSelectedRowKeys: consumSelectedRowKeys,
+                onChange: onSelectChange,
+              }"
+            >
+              <template slot="subjectType" slot-scope="text, record, index">
+                {{ getSubjectTypeText(text,record) }}
+              </template>
+              <template slot="roomId" slot-scope="text, record, index">
+                {{ getRoomName(text) }}
+              </template>
+            </a-table>
+            <div
+              style="
+            color: rgba(255, 87, 51, 1);
+            font-weight: 600;
+            text-align: right;
+          "
+            >
+              合计消费:{{ feesAmount.toFixed(2) }}
+            </div>
+          </a-tab-pane>
           <a-tab-pane tab="未结算" key="1" :forceRender="true">
             <a-table
               :columns="columns"
@@ -965,7 +994,11 @@ export default {
        * 同住人
        */
       addPeopleList: [],
-      customerList: []
+      customerList: [],
+      // 全部账单
+      entiretyList: [],
+      // 全部账单计算总消费金额
+      entiretyAmount: []
     }
   },
   computed: {
@@ -973,7 +1006,7 @@ export default {
       return this.disabled
     },
     feesAmount() {
-      return this.feesList.reduce(function (total, item) {
+      return this.entiretyAmount.reduce(function (total, item) {
         return total + item.money
       }, 0)
     },
@@ -1477,7 +1510,7 @@ export default {
       this.$refs.modalPaymentForm.showYinshou = false
     },
     tabChange(e) {
-      debugger
+      // debugger
       console.log(e)
       this.selectRoomId = e
       if (e == '1') {
@@ -1511,7 +1544,7 @@ export default {
       var msg = ''
       if (text == 1) {
         msg = '押金'
-        debugger
+        // debugger
         if (record.remark != null && record.remark != '') {
           msg = record.remark
         }
@@ -1654,6 +1687,7 @@ export default {
             this.selectRoomId = this.tabSelectRoomId
           }
           this.model = res.result
+          console.log(this.model);
           this.getWakeServiceData()
           this.getMessageData()
           // 查询冲账账单
@@ -1663,6 +1697,7 @@ export default {
             bookingOrderId: this.model.orderInfo.id,
             isAllFee: true
           }).then((res) => {
+            console.log(res);
             if (res.success) {
               if (res.result && res.result.length > 0) {
                 // 未支付的费用账单,oldfeesList用于存放所有费用账单,feesList为当前房间账单
@@ -1671,6 +1706,11 @@ export default {
                 // 已支付的消费
                 this.paidList = res.result.filter((t) => t.feeType === 1 && t.preferentialStatus === 2 && !t.isPreferential)
                 this.oldpaidList = JSON.parse(JSON.stringify(this.paidList))
+                // 全部账单
+                this.entiretyList = this.feesList.concat(this.paidList)
+                this.entiretyAmount = this.feesList.concat(this.paidList)
+                console.log(this.entiretyList,'全部账单');
+                console.log(this.entiretyAmount,'全部账单');
                 // 收费账单
                 this.paymentList = res.result.filter((t) => t.feeType === 2)
                 this.oldpaymentList = JSON.parse(JSON.stringify(this.paymentList))
@@ -1690,12 +1730,50 @@ export default {
       getAction('/business/busOrderFee/strike-balance-page', { bookingOrderId: this.model.orderInfo.id })
           .then(res => {
             if (res.success) {
-              debugger
+              // debugger
               if (res.result && res.result.records.length > 0) {
                 // 未支付的费用账单,oldfeesList用于存放所有费用账单,feesList为当前房间账单
                 this.strikeList = res.result.records
                 this.oldStrikeList = JSON.parse(JSON.stringify(this.strikeList))
-                console.log(this.strikeList, '123')
+                console.log(this.strikeList, '冲帐单')
+                // this.entiretyAmount = this.entiretyList
+                // console.log(this.entiretyAmount, '冲帐单')
+                
+                // let templist = this.strikeList.find()
+
+                // this.strikeList.forEach(item => {
+                //   this.entiretyList.forEach(index => {
+                //     if (item.returnFeeId == index.id) {
+                //       let tempindex = this.entiretyList.indexOf(index)
+                //       this.entiretyList.splice(tempindex,0,item)
+                //     }
+                //   })
+                // }
+                // 处理全部账单加上冲帐单
+                this.strikeList.forEach(item => {
+                  let tempindex = this.entiretyList.findIndex(index => index.id == item.returnFeeId)
+                  console.log(this.tempindex);
+                  this.entiretyList.splice(tempindex+1,0,item)
+                  // this.entiretyList.forEach(index => {
+                    // if (item.returnFeeId == index.id) {
+                    //   let tempindex = this.entiretyList.indexOf(index)
+                    //   console.log(tempindex);
+                    //   this.entiretyList.splice(tempindex,0,item)
+                    // }
+                  // })
+                })
+                //   // if (item == this.entiretyList.find(index => index.id = item.returnFeeId)) {
+                //     templist.push(this.entiretyList.find(index => index.id = item.returnFeeId),item)
+                  // }
+                //   // if ()
+                  
+                //   // this.strikeList.forEach(index => {
+                //   //   if(item.id = index.returnFeeId) {
+                //   //     templist.push(item,index)
+                //   //   }
+                //   // })
+                // });
+                console.log(this.entiretyList);
                 this.tabChange(this.tabSelectRoomId)
               }
             }
@@ -1725,7 +1803,10 @@ export default {
         }
       })
       let fees = JSON.parse(JSON.stringify(this.feesList))
-      this.$refs.modalStrikeBalanceForm.edit(fees, map)
+      let vipId = {
+        vipCustomerId: this.model.vipCustomerId
+      }
+      this.$refs.modalStrikeBalanceForm.edit(fees, map,vipId)
       this.$refs.modalStrikeBalanceForm.title = '冲账'
     },
     enterAccount() {

+ 1 - 0
src/views/room/modules/checkIn/StrikeBalanceModel.vue

@@ -103,6 +103,7 @@ export default {
       this.visible = false
     },
     handleOk() {
+      console.log(111);
       let fees = []
       if (this.feesList.some(e => e.money > e.oldPrice || e.money < 0)) {
         this.$message.warning('冲账金额不能超过原金额,且不能小于0')