|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
- <Header ref="header" @change="headerChange" :isSwitch="true">
|
|
|
+ <Header @change="headerChange" :isSwitch="true">
|
|
|
<template #search>
|
|
|
<!-- <u--input placeholder="房间号/姓名/手机号/身份证号" border="surround" shape="circle" prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399" fontSize="12px" :customStyle="{border:'1px solid #e2e2e2',padding:'0 10px',margin:'0 10px',borderRadius:'20px'}" @change="searchChange"></u--input> -->
|
|
|
</template>
|
|
|
@@ -30,27 +30,46 @@
|
|
|
<div style="margin-top:10px">
|
|
|
<div class="room-state-detail" v-for="item in dataList" :key="item.id">
|
|
|
<div class="room-state-detail-title">{{item.name.includes('栋')? item.name : item.buildingName + item.name}}:{{item.rooms.length}}间</div>
|
|
|
- <div class="ctner">
|
|
|
- <div class="room-state-detail-grid">
|
|
|
- <div class="room-state-detail-card" v-for="sItem in item.rooms" :key="sItem.id" :style="{background: roomStatusColorList && roomStatusColorList.length > 0 ? getRoomStatusColor(sItem.roomInfo.roomStatus) : '',}">
|
|
|
- <div style="display:flex;justify-content: space-between;">
|
|
|
- <div><b>{{sItem.roomInfo.name}}</b></div>
|
|
|
- <div v-if="sItem.livingData.livingOrder" style="background:rgb(255, 141, 26);color:#fff;padding:1px 2px;border-radius:5px;">{{getCustomerSourceList(sItem.livingData.livingOrder.customerSource)}}</div>
|
|
|
- </div>
|
|
|
- <div v-if="sItem.livingData.livingOrder">
|
|
|
- <div style="width:100%;overflow: hidden;"><b>{{sItem.livingData.livingCustomers.customerName}}</b><span v-if="sItem.livingData.livingOrder.vipCustomerId" style="color:red; font-size: 12px;transform: scale(0.6);display:inline-block;">VIP</span></div>
|
|
|
- <div>{{sItem.livingData.livingOrder.dayCount}}天/{{ sItem.livingData.livingOrder.arrivalTime }}</div>
|
|
|
- <div style="width:100%;overflow: hidden;">¥{{sItem.livingData.price && sItem.livingData.price.length > 0 ? sItem.livingData.price[0].price : 0 }}/剩0</div>
|
|
|
- </div>
|
|
|
- <b v-else>
|
|
|
- {{sItem.layout.name}}
|
|
|
- </b>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div class="room-state-detail-grid">
|
|
|
+ <div class="room-state-detail-card" @click="roomClick(sItem)" v-for="sItem in item.rooms" :key="sItem.id" :style="{background: roomStatusColorList && roomStatusColorList.length > 0 ? getRoomStatusColor(sItem.roomInfo.roomStatus) : '',}">
|
|
|
+ <div style="display:flex;justify-content: space-between;">
|
|
|
+ <div><b>{{sItem.roomInfo.name}}</b></div>
|
|
|
+ <div v-if="sItem.livingData.livingOrder" style="background:rgb(255, 141, 26);color:#fff;padding:1px 2px;border-radius:5px;">{{getCustomerSourceList(sItem.livingData.livingOrder.customerSource)}}</div>
|
|
|
+ </div>
|
|
|
+ <div v-if="sItem.livingData.livingOrder">
|
|
|
+ <div style="width:100%;overflow: hidden;"><b>{{sItem.livingData.livingCustomers.customerName}}</b><span v-if="sItem.livingData.livingOrder.vipCustomerId" style="color:red; font-size: 12px;transform: scale(0.6);display:inline-block;">VIP</span></div>
|
|
|
+ <div>{{sItem.livingData.livingOrder.dayCount}}天/{{ sItem.livingData.livingOrder.arrivalTime }}</div>
|
|
|
+ <div style="width:100%;overflow: hidden;">¥{{sItem.livingData.price && sItem.livingData.price.length > 0 ? sItem.livingData.price[0].price : 0 }}/ {{sItem.livingData.livingOrder.shouKuan - sItem.livingData.livingOrder.xiaoFei<0? `欠${sItem.livingData.livingOrder.shouKuan - sItem.livingData.livingOrder.xiaoFei}` : `剩${sItem.livingData.livingOrder.shouKuan - sItem.livingData.livingOrder.xiaoFei}` }}</div>
|
|
|
+ </div>
|
|
|
+ <b v-else>
|
|
|
+ {{sItem.layout.name}}
|
|
|
+ </b>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <u-action-sheet safeAreaInsetBottom :cancelText="'取消'" @close="show = false" :actions="listSheet" @select="selectClick" :title="'设置'" :show="show" v-if="selectData">
|
|
|
+ <div style="line-height:40px;" v-if="selectData.roomInfo.roomStatus === 2" @click="handleClean">置净</div>
|
|
|
+ <div style="line-height:40px;" v-else @click="handleDirty">置脏</div>
|
|
|
+ <div style="line-height:40px;" v-if="selectData.roomInfo.roomStatus === 6" @click="handleOffLock">解锁</div>
|
|
|
+ <div style="line-height:40px;" v-else @click="handleLock">锁定</div>
|
|
|
+ <div style="line-height:40px;" v-if="selectData.roomInfo.roomStatus === 5" @click="handleCompleteRepair">完成维修</div>
|
|
|
+ <div style="line-height:40px;" v-else @click="handleWx">维修</div>
|
|
|
+ </u-action-sheet>
|
|
|
+ <u-modal :show="showModal" closeOnClickOverlay @confirm="confirmWx" @close="showModal = false" :cancelText="'取消'" :title="'维修'">
|
|
|
+ <div>
|
|
|
+ <div style="display:flex;justify-content:center;align-items:center;">
|
|
|
+ 维修时间 <div style="margin-left:10px" @click="showTime = true" class="calendar">{{`${startTime} ~ ${endTime}`}}</div>
|
|
|
+ </div>
|
|
|
+ <div style="display:flex;justify-content:center;align-items:center;">
|
|
|
+ 维修原因 <u-input v-model="wxReason" placeholder="请输入维修原因"></u-input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </u-modal>
|
|
|
+ <u-calendar closeOnClickOverlay :show="showTime" mode="range" @close="showTime=false" @confirm="confirmTime"></u-calendar>
|
|
|
+
|
|
|
+ <u-toast style="z-index:999999;position: relative;" ref="uToast"></u-toast>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -60,7 +79,13 @@ import {
|
|
|
getHotelRoomList,
|
|
|
getRoomStatus,
|
|
|
getCustomerSource,
|
|
|
- getRoomType
|
|
|
+ getRoomType,
|
|
|
+ setDirty,
|
|
|
+ lockRoom,
|
|
|
+ unlockRoom,
|
|
|
+ setClean,
|
|
|
+ repairRoom,
|
|
|
+ finishRepair
|
|
|
} from '../../utils/customerOrder'
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -90,23 +115,41 @@ export default {
|
|
|
* 房型列表
|
|
|
*/
|
|
|
cesRoomLayoutList: [],
|
|
|
+ //弹出框
|
|
|
+ show:false,
|
|
|
+ showModal:false,
|
|
|
+ showTime:false,
|
|
|
+ startTime: new Date().toISOString().slice(0, 10),
|
|
|
+ endTime: new Date(new Date().getTime()+ 24 * 60 * 60 * 1000 ).toISOString().slice(0, 10),
|
|
|
+ wxReason:'',
|
|
|
+ listSheet: [
|
|
|
+ {
|
|
|
+ name:'置脏'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '置净'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '锁定'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '解锁'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '维修'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ selectData:null,
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
-
|
|
|
-
|
|
|
+ this.getData()
|
|
|
},
|
|
|
- onShow() {
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.$refs.header.getHotels(()=>{
|
|
|
-
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
methods: {
|
|
|
sectionChange(i) {
|
|
|
console.log(i)
|
|
|
this.current = i
|
|
|
+ this.filter()
|
|
|
},
|
|
|
searchChange(e) {
|
|
|
console.log(e)
|
|
|
@@ -201,27 +244,67 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
+ //在住
|
|
|
+ if (this.current == 1) {
|
|
|
+
|
|
|
+ }
|
|
|
+ //预离
|
|
|
+ if (this.current == 2) {
|
|
|
+ arr.forEach(ele => {
|
|
|
+ ele.rooms = ele.rooms.filter(item => {
|
|
|
+ return item.livingData && item.livingData.livingOrder && item.livingData.livingOrder.dueOutTime == new Date().toISOString().slice(0, 10);
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //欠费
|
|
|
+ if (this.current == 3) {
|
|
|
+ arr.forEach(ele => {
|
|
|
+ ele.rooms = ele.rooms.filter(item => {
|
|
|
+ return item.livingData && item.livingData.livingOrder && item.livingData.livingOrder.shouKuan - item.livingData.livingOrder.xiaoFei<0
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //钟点
|
|
|
+ if (this.current == 4) {
|
|
|
+ arr.forEach(ele => {
|
|
|
+ ele.rooms = ele.rooms.filter(item=>{
|
|
|
+ return item.livingData && item.livingData.livingOrder && item.livingData.livingOrder.livingType == 2
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //团队
|
|
|
+ if (this.current == 5) {
|
|
|
+ arr.forEach(ele => {
|
|
|
+ ele.rooms = ele.rooms.filter(item=>{
|
|
|
+ return item.livingData && item.livingData.livingOrder && item.livingData.livingOrder.isTeam
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //散客
|
|
|
+ if (this.current == 6) {
|
|
|
+ // arr.forEach(ele => {
|
|
|
+ // ele.rooms = ele.rooms.filter(item=>{
|
|
|
+
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ //联房
|
|
|
+ if (this.current == 7) {
|
|
|
+
|
|
|
+ }
|
|
|
+ //脏房
|
|
|
+ if (this.current == 8) {
|
|
|
+
|
|
|
+ }
|
|
|
console.log('arrarrarrarr', arr);
|
|
|
this.dataList = JSON.parse(JSON.stringify(arr))
|
|
|
- // console.log(this.roomList);
|
|
|
- // if (this.roomList.length == 0) {
|
|
|
- // return
|
|
|
- // }
|
|
|
- // let nameList = []
|
|
|
- // this.roomList.forEach(ele => {
|
|
|
- // ele.rooms.forEach(item => {
|
|
|
- // nameList.push(item.layout.name)
|
|
|
- // })
|
|
|
- // })
|
|
|
- // this.roomTypeCount = this.count(nameList)
|
|
|
- // console.log(this.roomTypeCount);
|
|
|
return arr
|
|
|
},
|
|
|
getCustomerSourceList(customerSource, first) {
|
|
|
console.log(customerSource);
|
|
|
var find = this.customerSourceList.find((t) => t.id == customerSource);
|
|
|
- console.log(find);
|
|
|
- console.log(this.customerSourceList);
|
|
|
+ // console.log(find);
|
|
|
+ // console.log(this.customerSourceList);
|
|
|
if (find) {
|
|
|
// return first ? find.label.substr(0, 1) : find.label;
|
|
|
return find.itemText.substr(0, 1);
|
|
|
@@ -250,6 +333,123 @@ export default {
|
|
|
})
|
|
|
return count
|
|
|
},
|
|
|
+ selectClick(e){
|
|
|
+ console.log(e);
|
|
|
+ },
|
|
|
+ roomClick(data){
|
|
|
+ console.log(data);
|
|
|
+ this.selectData = data
|
|
|
+ this.show = true
|
|
|
+ },
|
|
|
+ //置脏
|
|
|
+ handleDirty(){
|
|
|
+ if (this.selectData!=null) {
|
|
|
+ setDirty(this.selectData.roomInfo.id).then(res=>{
|
|
|
+ console.log(res);
|
|
|
+ if (res.success) {
|
|
|
+ this.getData(uni.getStorageSync('hotelId'))
|
|
|
+ }
|
|
|
+ this.show = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //置净
|
|
|
+ handleClean(){
|
|
|
+ let selectRoom = [];
|
|
|
+ selectRoom.push({ roomId: this.selectData.roomInfo.id, roomNo: this.selectData.roomInfo.name })
|
|
|
+ if (this.selectData!=null) {
|
|
|
+ setClean({roomCleanList:selectRoom,waiterId:' ',hotelId:uni.getStorageSync('hotelId')}).then(res=>{
|
|
|
+ console.log(res);
|
|
|
+ if (res.success) {
|
|
|
+ this.getData(uni.getStorageSync('hotelId'))
|
|
|
+ }
|
|
|
+ this.show = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //锁房
|
|
|
+ handleLock(){
|
|
|
+ let selectRoom = [];
|
|
|
+ selectRoom.push({ roomId: this.selectData.roomInfo.id, roomNo: this.selectData.roomInfo.name })
|
|
|
+ if (this.selectData!=null) {
|
|
|
+ lockRoom({roomLockList:selectRoom,remark:'',hotelId:uni.getStorageSync('hotelId')}).then(res=>{
|
|
|
+ console.log(res);
|
|
|
+ if (res.success) {
|
|
|
+ this.getData(uni.getStorageSync('hotelId'))
|
|
|
+ }
|
|
|
+ this.show = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //解锁
|
|
|
+ handleOffLock(){
|
|
|
+ if (this.selectData!=null) {
|
|
|
+ unlockRoom(this.selectData.roomInfo.id).then(res=>{
|
|
|
+ console.log(res);
|
|
|
+ if (res.success) {
|
|
|
+ this.getData(uni.getStorageSync('hotelId'))
|
|
|
+ }
|
|
|
+ this.show = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //维修
|
|
|
+ handleWx(){
|
|
|
+ this.show = false
|
|
|
+ this.showModal = true
|
|
|
+ },
|
|
|
+ //完成维修
|
|
|
+ handleCompleteRepair(){
|
|
|
+ if (this.selectData!=null) {
|
|
|
+ finishRepair(this.selectData.roomInfo.id).then(res=>{
|
|
|
+ console.log(res);
|
|
|
+ if (res.success) {
|
|
|
+ this.getData(uni.getStorageSync('hotelId'))
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type:"success",
|
|
|
+ message:'成功'
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type:"error",
|
|
|
+ message:'出错了'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.show = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ confirmWx(){
|
|
|
+ if (this.wxReason == '') {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type:"error",
|
|
|
+ message:'维修原因不能为空'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let selectRoom = [];
|
|
|
+ selectRoom.push({ roomId: this.selectData.roomInfo.id, roomNo: this.selectData.roomInfo.name })
|
|
|
+ if (this.selectData!=null) {
|
|
|
+ repairRoom({roomRepairList:selectRoom,remark:this.wxReason,hotelId:uni.getStorageSync('hotelId'),startDate:this.startTime,endDate:this.endTime,dateRange:[this.startDate,this.endTime]}).then(res=>{
|
|
|
+ console.log(res);
|
|
|
+ if (res.success) {
|
|
|
+ this.getData(uni.getStorageSync('hotelId'))
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type:"success",
|
|
|
+ message:'成功'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.show = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.showModal = false
|
|
|
+ },
|
|
|
+ confirmTime(e){
|
|
|
+ console.log(e);
|
|
|
+ this.startTime = e[0]
|
|
|
+ this.endTime = e[e.length - 1]
|
|
|
+ this.showTime = false
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
@@ -295,9 +495,6 @@ page {
|
|
|
justify-content: start;
|
|
|
width: 96vw;
|
|
|
margin: 0 auto;
|
|
|
- // grid-template-columns: repeat(4, 1fr);
|
|
|
- // grid-gap: 10px;
|
|
|
- // padding: 10px;
|
|
|
}
|
|
|
|
|
|
.room-state-detail-card {
|
|
|
@@ -305,7 +502,7 @@ page {
|
|
|
height: calc(30vw );
|
|
|
font-size: 12px;
|
|
|
border-radius: 8px;
|
|
|
- margin: 1vw;
|
|
|
+ margin: 1vw;
|
|
|
// background: red;
|
|
|
color: #fff;
|
|
|
padding: 1vw 1vw;
|
|
|
@@ -335,4 +532,9 @@ page {
|
|
|
border-right: 1px solid rgb(60, 156, 255);
|
|
|
}
|
|
|
}
|
|
|
+.calendar {
|
|
|
+ border: 1px solid;
|
|
|
+ padding: 5px 10px;
|
|
|
+ border-radius: 5px;
|
|
|
+}
|
|
|
</style>
|