merge limo to daylight
This commit is contained in:
@@ -1883,3 +1883,4 @@
|
||||
border-radius: 22px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -502,7 +502,7 @@
|
||||
this.getBooking(this.opt);
|
||||
}else{
|
||||
this.iconPath = '../../static/images/ico_err.png';
|
||||
this.popMsgStr = this.$t("bookingDetail.changeMiscChargeFail");
|
||||
this.popMsgStr = this.$t("bookingDetail.changeMisChargeFail");
|
||||
this.showMsgBox = true;
|
||||
this.showETAMsg = false;
|
||||
|
||||
|
||||
@@ -18,88 +18,138 @@
|
||||
<view style="border:1rpx solid #ccc;border-radius: 14px;padding:4px 12px;" class="hz-flex-row hz-flex-vertical-mid">
|
||||
<image @click="navTo('/pages/findPlayer/findPlayer',1,false)" src="../../static/images/ico_find_player.png" class="hz-nav-btn"></image>
|
||||
<view style="height:20px;border-left:1px solid #ccc;margin-left:8px;margin-right:8px;"></view>
|
||||
<image v-if="userData && userData.canViewCalendar === true" @click="navToPlayerRoomCalendar" src="../../static/images/calendar-line.png" class="hz-nav-btn"></image>
|
||||
<image v-else @click="getDataByPage" src="../../static/images/ico_list.png" class="hz-nav-btn"></image>
|
||||
<image @click="navToPlayerRoomCalendar" src="../../static/images/calendar-line.png" class="hz-nav-btn"></image>
|
||||
</view>
|
||||
</view>
|
||||
</u-navbar>
|
||||
<view class="hz-spacing hz-bg-white" style="margin-top:8px;">
|
||||
<view class="hz-card-profile hz-mr-b-30">
|
||||
|
||||
<!-- booking record page -->
|
||||
<view class="hz-spacing hz-bg-white mt-[20]">
|
||||
<view class="hz-card-profile mb-[40]">
|
||||
<view class="hz-flex-row">
|
||||
<view style="width:60%">
|
||||
<view class="hz-w-60">
|
||||
<view class="hz-font-color-light hz-font-sm">{{$t("common.playerId")}}</view>
|
||||
<view class="hz-font-bolder hz-font-lg" >{{ playerData.playerId }}</view>
|
||||
</view>
|
||||
<view style="width:40%">
|
||||
<view class="hz-w-40">
|
||||
<view class="hz-font-color-light hz-font-sm">{{$t("common.tier")}}</view>
|
||||
<view class="hz-font-bolder hz-font-lg" >{{ playerData.tierName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hz-flex-row hz-mr-t-30">
|
||||
<view style="width:100%">
|
||||
<view class="hz-w-100">
|
||||
<view class="hz-font-color-light hz-font-sm">{{$t("common.name")}}</view>
|
||||
<view class="hz-font-bolder hz-font-lg" >{{playerData.salutation + " " + playerData.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!showEmpty">
|
||||
<!-- 'hz-card-extend' disable extend -->
|
||||
<view @click="navToDetail(booking)" v-for="(booking,index) in bookingList" :key="index"
|
||||
:class="getRecordColor(booking)" class="hz-pd-30 hz-font-bold hz-font-sm" style="margin-top:20rpx;align-items: center;">
|
||||
<view class="hz-flex-row">
|
||||
<view>
|
||||
<view class="hz-font-md">{{$t("common.confirmationNo")}}: {{ getConfirmationNo(booking)}}</view>
|
||||
|
||||
<view>
|
||||
<view v-for="(record,index) in displayRecordList" :key="`${record.recordType}-${record.id || record.confirmationNo || index}`">
|
||||
<view @click="openRecordDetail(record)" :class="getRecordCardClass(record)" class="hz-card-booking hz-record-card hz-pd-30 hz-font-bold hz-font-sm">
|
||||
<view class="hz-flex-row hz-booking-type-row">
|
||||
<view class="hz-booking-type-wrap">
|
||||
<image :src="getBookingTypeIcon(record)" class="hz-booking-type-icon"></image>
|
||||
<view class="hz-font-md">{{ getBookingTypeLabel(record) }}</view>
|
||||
</view>
|
||||
<view class="hz-font-md hz-text-right" :class="getRecordStatusClass(record)">{{getRecordStatusText(record)}}</view>
|
||||
</view>
|
||||
<view style="margin-left:auto">
|
||||
<view class="hz-font-md" :class="getStatusTextColor(booking)">{{getStatusText(booking)}}</view>
|
||||
<view v-if="isHotelRecord(record)">
|
||||
<view class="hz-flex-row hz-row-gap">
|
||||
<view class="hz-w-50">
|
||||
<view class="hz-font-md">{{$t("common.confirmationNo")}}: {{ getConfirmationNo(record)}}</view>
|
||||
</view>
|
||||
<view class="hz-w-50">
|
||||
<view class="hz-font-md hz-text-right">{{ record.propertyName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hz-flex-row hz-row-gap">
|
||||
<view class="hz-w-55">
|
||||
<view class="hz-font-md">{{$t("common.checkInDate")}}: {{ record.checkinDate }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hz-flex-row hz-row-gap">
|
||||
<view class="hz-w-55">
|
||||
<view class="hz-font-md">{{$t("common.checkOutDate")}}: {{ record.checkoutDate }}</view>
|
||||
</view>
|
||||
<view class="hz-flex-row hz-sharer-wrap" v-if="canShowSharer(record)">
|
||||
<view v-if="hasSharer(record)" class="hz-btn-sharer hz-font-min hz-sharer-tag">{{$t("bookingRecord.sharer").toUpperCase()}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="hz-flex-row hz-row-gap">
|
||||
<view class="hz-w-55 hz-font-md" v-show="record.eta!==null && record.eta!=='00:00:00'">{{$t("common.etaTime")}}: {{formatEtaToHHmm(record.eta)}}</view>
|
||||
<view v-if="record.miscCharge != null" class="hz-flex-row hz-sharer-wrap">
|
||||
<view>
|
||||
<view class="hz-font-md">{{$t("common.misCharge")}}: {{ formatWithThousands(record.miscCharge) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="hz-flex-row" style="margin-top:6px;">
|
||||
<view v-show="record.eta!==null && record.eta!=='00:00:00'" class="hz-font-md">{{$t("common.etaTime")}}: {{formatEtaToHHmm(record.eta)}}</view>
|
||||
<span v-show="record.eta!==null && record.eta!=='00:00:00' && record.miscCharge!==null" class="hz-font-md" style="padding:0 6px;">|</span>
|
||||
<view v-show="record.miscCharge!==null" class="hz-font-md">{{$t("common.misCharge")}}: {{formatWithThousands(record.miscCharge)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hz-flex-row" style="margin-top:6px;">
|
||||
<view style="width:55%;">
|
||||
<view class="hz-font-md">{{$t("common.checkInDate")}}: {{ booking.checkinDate }}</view>
|
||||
<!-- 不然就是 limo 的 booking -->
|
||||
<view v-else>
|
||||
<view class="hz-flex-row hz-row-gap">
|
||||
<view class="hz-w-100">
|
||||
<view class="hz-font-md">Conf # : {{ getConfirmationNo(record) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hz-flex-row hz-row-gap">
|
||||
<view class="hz-w-100">
|
||||
<view class="hz-font-md">{{$t("limoBookingRecord.pickupDatetime")}}: {{ record.pickupDatetime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hz-flex-row hz-row-gap">
|
||||
<view class="hz-w-100">
|
||||
<view class="hz-font-md">{{$t("limoBookingRecord.pickup")}}: {{ record.pickup }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="record.extraDropoff && record.extraDropoff.length" class="hz-flex-row hz-row-gap">
|
||||
<view class="hz-w-100">
|
||||
<view class="hz-font-md">{{$t("limoBookingRecord.extraDropoff")}}:</view>
|
||||
<view class="hz-font-md" v-for="(dropoffPoint,index) in record.extraDropoff" :key="index">
|
||||
#{{index + 1}}:{{dropoffPoint}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hz-flex-row hz-row-gap hz-flex-vertical-mid">
|
||||
<view class="hz-w-100 hz-limo-dropoff-wrap">
|
||||
<view class="hz-font-md">
|
||||
{{$t("limoBookingRecord.dropoff")}}: {{record.dropoff}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width:50%;">
|
||||
<view style="text-align: right;" class="hz-font-md">{{ booking.propertyName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hz-flex-row" style="margin-top:6px;">
|
||||
<view style="width:55%;">
|
||||
<view class="hz-font-md">{{$t("common.checkOutDate")}}: {{ booking.checkoutDate }}</view>
|
||||
</view>
|
||||
<!-- enable sharer and extend 2024-09-27 -->
|
||||
<view class="hz-flex-row" style="width:50%;text-align: right;justify-content: flex-end;" v-if="userData.canNewBooking&&booking.propertyCategory!='OTHER'">
|
||||
<view v-if="(booking.sharer!==null && booking.sharer!=='[]')||booking.isShare" class="hz-btn-sharer hz-font-min" style="width:40%;height:14px;line-height:14px;margin-right: 3px;">{{$t("bookingRecord.sharer").toUpperCase()}}</view>
|
||||
<!-- <view @click="navToDetail(booking)" v-if="((booking.lastOperaStatus==='DUE_OUT' || booking.lastOperaStatus==='CHECKED_IN') && booking.confirmationNo!=null && (booking.approveStatus!='W'&&booking.approveStatus!='PN'))" class="hz-btn-extend hz-font-min" style="width:40%;height:14px;line-height:14px;">{{$t("bookingRecord.extend").toUpperCase()}}</view> -->
|
||||
<!-- <view @click="navTo('/booking/bookingGroup/bookingGroup?groupId='+booking.groupId,0,false)" v-if="booking.groupId!==undefined && booking.groupId!==null && booking.groupId!==''" class="hz-btn-group" style="margin-left:8px;">{{$t("bookingRecord.group")}}</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="hz-flex-row" style="margin-top:6px;">
|
||||
<view v-show="booking.eta!==null && booking.eta!=='00:00:00'" class="hz-font-md">{{$t("common.etaTime")}}: {{formatEtaToHHmm(booking.eta)}}</view>
|
||||
<span v-show="booking.eta!==null && booking.eta!=='00:00:00' && booking.miscCharge!==null" class="hz-font-md" style="padding:0 6px;">|</span>
|
||||
<view v-show="booking.miscCharge!==null" class="hz-font-md">{{$t("common.misCharge")}}: {{formatWithThousands(booking.miscCharge)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <u-loadmore :status="showLoadMore" :loadmoreText="loadMoreStr" :nomoreText="nomoreStr" :fontSize="14" color="#ccc" :line="true" /> -->
|
||||
</view>
|
||||
<u-empty
|
||||
v-if="showEmpty"
|
||||
|
||||
<!-- <u-empty
|
||||
v-if="isDisplayEmpty"
|
||||
mode="search"
|
||||
:text="dataNotFoundStr"
|
||||
>
|
||||
</u-empty>
|
||||
</u-empty> -->
|
||||
</view>
|
||||
<u-tabbar
|
||||
:fixed="true"
|
||||
:placeholder="true"
|
||||
:safeAreaInsetBottom="true"
|
||||
customStyle="z-index:100;height:58px;"
|
||||
v-if="userData.canNewBooking"
|
||||
>
|
||||
<view class="book hz-flex-row hz-spacing">
|
||||
<view class="hz-btn hz-font-color-white hz-font-lg hz-font-bold hz-text-center" @click="navToNewBooking()">
|
||||
<view v-if="userData.canNewBooking" class="book hz-flex-row hz-spacing hz-book-btn-wrap" :class="{'hz-book-btn-wrap--single': hasSingleBookingPermission}">
|
||||
<view class="hz-btn hz-font-color-white hz-font-sm hz-font-bold hz-text-center" @click="navToNewBooking()">
|
||||
{{$t("bookingRecord.newsBooking")}}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="userData.canViewLimo" class="book hz-flex-row hz-spacing hz-book-btn-wrap" :class="{'hz-book-btn-wrap--single': hasSingleBookingPermission}">
|
||||
<view class="hz-btn hz-font-color-white hz-font-sm hz-font-bold hz-text-center" @click="navToNewLimo()">
|
||||
{{$t("bookingRecord.newLimo")}}
|
||||
</view>
|
||||
</view>
|
||||
</u-tabbar>
|
||||
<u-modal :content="msgStr" :show="showMsg" :confirmText="yesText" :showCancelButton="false" closeOnClickOverlay @confirm="showMsg=false" confirmColor="#C39A4B" @close="showMsg=false"></u-modal>
|
||||
</view>
|
||||
@@ -109,7 +159,7 @@
|
||||
<script>
|
||||
import {playerLookup} from '../../api/mgmApi.js'
|
||||
import {mapOperaStatus,mapApproveStatus} from '../../common/mapping.js'
|
||||
import {getBookingsMock,getBookings} from '../../api/bookingApi.js';
|
||||
import {getBookings, getLimoBookings} from '../../api/bookingApi.js';
|
||||
import dayjs from '../../uni_modules/uview-ui/libs/util/dayjs.js';
|
||||
export default {
|
||||
data() {
|
||||
@@ -121,15 +171,14 @@
|
||||
dataNotFoundStr:this.$t("common.dataNotFound"),
|
||||
// 界面变量
|
||||
from:'',
|
||||
showEmpty:false,
|
||||
title:'',
|
||||
footFuncHei:100,
|
||||
currentIndex:0,
|
||||
showMsg:false,
|
||||
msgStr:this.$t("bookingRecord.operaProfile"),
|
||||
yesText:this.$t("common.ok"),
|
||||
currentTask:null,
|
||||
getDataByPageRequestId:0,
|
||||
limoBookingList:[
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
@@ -145,6 +194,8 @@
|
||||
// 检查是否登录
|
||||
this.isLogin();
|
||||
// 拿localstorage中的playerData
|
||||
//修改MiscCharge后 返回页面自动刷新
|
||||
// this.refreshHotelBooking();
|
||||
|
||||
this.getDataByPage();
|
||||
},
|
||||
@@ -153,49 +204,109 @@
|
||||
this.pullDownRefresh();
|
||||
},
|
||||
methods: {
|
||||
navToPlayerRoomCalendar(){
|
||||
const userData = uni.getStorageSync("userData");
|
||||
if (!userData || userData.canViewCalendar !== true) return;
|
||||
this.navTo('/booking/playerRoomCalendar/playerRoomCalendar',0,false);
|
||||
updateHotelBookingList(res){
|
||||
if(Array.isArray(res) && res.length > 0){
|
||||
this.bookingList = res;
|
||||
}else{
|
||||
this.bookingList = [];
|
||||
}
|
||||
},
|
||||
updateLimoBookingList(res) {
|
||||
if(this.userData.canViewLimo==false) return;
|
||||
if (Array.isArray(res) && res.length > 0) {
|
||||
let temp = res.map(item => {
|
||||
const pickUpDatetime = item.pickUpDatetime || item.pickUpDateTime || item.pickupDatetime || '';
|
||||
return {
|
||||
id: item.id,
|
||||
recordType: 'limo',
|
||||
confirmationNo: item.confirmationNo,
|
||||
status: item.bookingStatus,
|
||||
pickUpDatetime,
|
||||
pickupDatetime: this.formatDate(pickUpDatetime, 'YYYY-MM-DD HH:mm'),
|
||||
pickup: item.pickUpPoint,
|
||||
dropoff: item.dropOffPoint,
|
||||
extraDropoff:this.getExtraDropOff(item.extraDropOffPoint)
|
||||
// extraDropoff:item.extraDropOffPoint.split(";")
|
||||
}
|
||||
});
|
||||
|
||||
this.limoBookingList = temp;
|
||||
} else {
|
||||
this.limoBookingList = [];
|
||||
}
|
||||
},
|
||||
openBookingPage(path){
|
||||
uni.showLoading({
|
||||
title: this.$t("common.loading")
|
||||
});
|
||||
this.navTo(path,0,false);
|
||||
uni.hideLoading();
|
||||
},
|
||||
|
||||
// 數據方法
|
||||
async getDataByPage(){
|
||||
if(this.userData.canViewBooking==false) return;
|
||||
if(this.currentTask){
|
||||
const previousTask = this.currentTask;
|
||||
const requestId = ++this.getDataByPageRequestId;
|
||||
if(previousTask){
|
||||
try{
|
||||
this.currentTask.abort();
|
||||
previousTask.abort();
|
||||
}catch(err){
|
||||
}
|
||||
}
|
||||
const requestId = ++this.getDataByPageRequestId;
|
||||
|
||||
// 一次页面加载会同时发起 Hotel 和 Limo 请求,统一保存并取消它们。
|
||||
const requestTasks = [];
|
||||
const requestController = {
|
||||
abort: () => {
|
||||
requestTasks.forEach(task => {
|
||||
if(task && typeof task.abort === 'function'){
|
||||
try{
|
||||
task.abort();
|
||||
}catch(err){
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const requestConfig = {
|
||||
getTask: task => {
|
||||
if(requestId === this.getDataByPageRequestId){
|
||||
requestTasks.push(task);
|
||||
}else if(task && typeof task.abort === 'function'){
|
||||
task.abort();
|
||||
}
|
||||
}
|
||||
};
|
||||
this.currentTask = requestController;
|
||||
let params = {};
|
||||
uni.showLoading({
|
||||
title: this.$t("common.loading")
|
||||
});
|
||||
try{
|
||||
if(this.playerData.nameIds.length==0){
|
||||
await this.getProfileByPlayerId(requestId)
|
||||
await this.getProfileByPlayerId(requestId, requestConfig)
|
||||
}else{
|
||||
params.member = this.playerData
|
||||
params.member = this.playerData;
|
||||
params.userId = this.userData.userId;
|
||||
const res = await getBookings(params, {
|
||||
getTask: (task, options) => {
|
||||
this.currentTask = task;
|
||||
}
|
||||
params.profileId = this.playerData.profileId;
|
||||
const limoPromise = getLimoBookings(params, requestConfig).catch((e) => {
|
||||
return null;
|
||||
});
|
||||
const hotelPromise = getBookings(params, requestConfig).catch((e) => {
|
||||
return null;
|
||||
});
|
||||
const [resLimo, resHotel] = await Promise.all([limoPromise, hotelPromise]);
|
||||
if(requestId !== this.getDataByPageRequestId) return;
|
||||
this.currentTask = null;
|
||||
this.bookingList = [];
|
||||
if(res.length>0){
|
||||
if(res!==undefined && res!==null){
|
||||
this.bookingList = res;
|
||||
}
|
||||
}else{
|
||||
|
||||
if (resLimo) {
|
||||
this.updateLimoBookingList(resLimo);
|
||||
}
|
||||
if (resHotel) {
|
||||
this.updateHotelBookingList(resHotel);
|
||||
}
|
||||
}
|
||||
}catch(e){
|
||||
if(e.errMsg!==undefined && e.errMsg.includes("abort")){
|
||||
if(requestId !== this.getDataByPageRequestId || (e && e.errMsg!==undefined && e.errMsg.includes("abort"))){
|
||||
return;
|
||||
}
|
||||
// console.log(e);
|
||||
@@ -204,11 +315,38 @@
|
||||
await this.writeLog(this.userData.userId,"save_booking","","[APP][bookingDetail.vue][getDataByPage][Catch Exception]"+e.errMsg,"[RequestData]" +JSON.stringify(params),"",1,false);
|
||||
}finally{
|
||||
if(requestId === this.getDataByPageRequestId){
|
||||
this.currentTask = null;
|
||||
if(this.currentTask === requestController){
|
||||
this.currentTask = null;
|
||||
}
|
||||
uni.hideLoading();
|
||||
}
|
||||
}
|
||||
},
|
||||
async refreshHotelBooking(){
|
||||
if(this.userData.canViewBooking==false) return;
|
||||
let params = {};
|
||||
uni.showLoading({
|
||||
title: this.$t("common.loading")
|
||||
});
|
||||
try{
|
||||
if(this.playerData.nameIds.length==0){
|
||||
await this.getProfileByPlayerId()
|
||||
}else{
|
||||
params.member = this.playerData;
|
||||
params.userId = this.userData.userId;
|
||||
params.profileId = this.playerData.profileId;
|
||||
const resHotel = await getBookings(params);
|
||||
this.updateHotelBookingList(resHotel);
|
||||
}
|
||||
}catch(e){
|
||||
console.log(e);
|
||||
// write log
|
||||
uni.$u.toast(e.errMsg,5000);
|
||||
await this.writeLog(this.userData.userId,"save_booking","","[APP][bookingDetail.vue][getDataByPage][Catch Exception]"+e.errMsg,"[RequestData]" +JSON.stringify(params),"",1,false);
|
||||
}finally{
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
pullDownRefresh(){
|
||||
try{
|
||||
this.getDataByPage('refresh');
|
||||
@@ -217,6 +355,60 @@
|
||||
}
|
||||
},
|
||||
// 界面方法
|
||||
isHotelRecord(record){
|
||||
return record.recordType === 'hotel';
|
||||
},
|
||||
getRecordCardClass(record){
|
||||
return this.getRecordColor(record);
|
||||
},
|
||||
openRecordDetail(record){
|
||||
if(this.isHotelRecord(record)){
|
||||
this.navToDetail(record);
|
||||
}else{
|
||||
this.navToLimoDetail(record);
|
||||
}
|
||||
},
|
||||
getBookingTypeIcon(record){
|
||||
if(this.isHotelRecord(record)){
|
||||
return '../../static/images/ico_hotel_active.png';
|
||||
}
|
||||
return '../../static/icon/tabbar/taxi-fill.png';
|
||||
},
|
||||
getBookingTypeLabel(record){
|
||||
let bookingType = this.$t("limoBookingRecord.bookingType");
|
||||
if(this.isHotelRecord(record)){
|
||||
return bookingType+': Hotel';
|
||||
}
|
||||
return bookingType+': Limo';
|
||||
},
|
||||
getRecordStatusText(record){
|
||||
if(this.isHotelRecord(record)){
|
||||
return this.getStatusText(record);
|
||||
}else{
|
||||
return record.status.replace("_"," ");
|
||||
}
|
||||
},
|
||||
getRecordStatusClass(record){
|
||||
return this.getStatusTextColor(record);
|
||||
},
|
||||
canShowSharer(record){
|
||||
return this.userData && this.userData.canNewBooking && record.propertyCategory!='OTHER';
|
||||
},
|
||||
hasSharer(record){
|
||||
return (record.sharer!==null && record.sharer!=='[]')||record.isShare;
|
||||
},
|
||||
hasEta(record){
|
||||
return record.eta!==undefined && record.eta!==null && record.eta!=='';
|
||||
},
|
||||
getDropOffPointLines(dropOffPoint){
|
||||
if(dropOffPoint === null || dropOffPoint === undefined || dropOffPoint === '') return [''];
|
||||
return String(dropOffPoint).split(/[;;]/).map(item => item.trim()).filter(item => item !== '');
|
||||
},
|
||||
getExtraDropOffPoint(dropOffPoint){
|
||||
if(dropOffPoint === null || dropOffPoint === undefined || dropOffPoint === '') return [''];
|
||||
|
||||
return String(dropOffPoint).split(/[;;]/).map(item => item.trim()).filter(item => item !== '');
|
||||
},
|
||||
back(){
|
||||
if(this.from==='booking'){
|
||||
this.navTo("/pages/findPlayer/findPlayer",1,false);
|
||||
@@ -227,6 +419,12 @@
|
||||
navToDetail(booking){
|
||||
this.navTo('/booking/bookingDetail/bookingDetail?id='+booking.id+"&conf="+booking.confirmationNo+"&from=list",0,false)
|
||||
},
|
||||
navToLimoDetail(limoBooking){
|
||||
this.navTo('/limo/bookingDetail/bookingDetail?id=' + limoBooking.id +'&conf='+limoBooking.confirmationNo+"&from=list",0,false)
|
||||
},
|
||||
navToPlayerRoomCalendar(){
|
||||
this.navTo('/booking/playerRoomCalendar/playerRoomCalendar',0,false)
|
||||
},
|
||||
// ETA 统一显示 HH:mm(兼容 HH:mm:ss / HH:mm)
|
||||
formatEtaToHHmm(eta) {
|
||||
if (eta === null || eta === undefined || eta === '') return '';
|
||||
@@ -259,81 +457,170 @@
|
||||
this.title = this.$t("bookingRecord.title");
|
||||
},
|
||||
navToNewBooking(){
|
||||
this.getDataByPage();
|
||||
uni.showLoading({
|
||||
title: this.$t("common.loading")
|
||||
});
|
||||
// remove no opera restrict
|
||||
// if(this.playerData.nameIds.length==0){
|
||||
// this.showMsg = true;
|
||||
// }else{
|
||||
// this.navTo('/booking/newBooking/newBooking',0,false)
|
||||
// }
|
||||
this.navTo('/booking/newBooking/newBooking',0,false)
|
||||
uni.hideLoading();
|
||||
this.openBookingPage('/booking/newBooking/newBooking');
|
||||
},
|
||||
async getProfileByPlayerId(requestId){
|
||||
navToNewLimo(){
|
||||
this.openBookingPage('/limo/newLimo/newLimo?from=bookingRecord');
|
||||
},
|
||||
async getProfileByPlayerId(requestId = this.getDataByPageRequestId, requestConfig = {}){
|
||||
try{
|
||||
let params = {playerId:this.playerData.playerId,userId:this.userData.userId};
|
||||
const res = await playerLookup(params, {
|
||||
getTask: (task, options) => {
|
||||
this.currentTask = task;
|
||||
}
|
||||
});
|
||||
const params = {playerId:this.playerData.playerId,userId:this.userData.userId};
|
||||
const res = await playerLookup(params, requestConfig);
|
||||
if(requestId !== this.getDataByPageRequestId) return;
|
||||
if(res.success == true){
|
||||
var player = res.data;
|
||||
const player = res.data;
|
||||
if(player !== null){
|
||||
if(player.codedFlag==1){
|
||||
uni.setStorageSync("playerData",player);
|
||||
this.playerData = uni.getStorageSync("playerData");
|
||||
let params = {};
|
||||
params.member = player
|
||||
params.userId = this.userData.userId;
|
||||
const res = await getBookings(params, {
|
||||
getTask: (task, options) => {
|
||||
this.currentTask = task;
|
||||
}
|
||||
});
|
||||
const bookingParams = {
|
||||
member: player,
|
||||
userId: this.userData.userId
|
||||
};
|
||||
const [resHotel, resLimo] = await Promise.all([
|
||||
getBookings(bookingParams, requestConfig),
|
||||
getLimoBookings(bookingParams, requestConfig)
|
||||
]);
|
||||
if(requestId !== this.getDataByPageRequestId) return;
|
||||
this.currentTask = null;
|
||||
this.bookingList = [];
|
||||
if(res.length>0){
|
||||
if(res!==undefined && res!==null){
|
||||
this.bookingList = res;
|
||||
}
|
||||
}else{
|
||||
}
|
||||
this.updateHotelBookingList(resHotel);
|
||||
this.updateLimoBookingList(resLimo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch(e){
|
||||
if(e.errMsg!==undefined && e.errMsg.includes("abort")){
|
||||
if(requestId !== this.getDataByPageRequestId || (e && e.errMsg!==undefined && e.errMsg.includes("abort"))){
|
||||
return;
|
||||
}
|
||||
console.error(e);
|
||||
var request = e.config!=undefined?JSON.stringify(e.config):"";
|
||||
var response = e.data!=undefined?JSON.stringify(e.data):"";
|
||||
await this.writeLog(this.userData.userId,"find_player","","[APP][findPlayer.vue][getProfileByPlayerId][Catch Exception]"+e.errMsg,request,response,1,false);
|
||||
}finally{
|
||||
}
|
||||
},
|
||||
formatDate(date, format = 'YYYY-MM-DD HH:mm:ss') {
|
||||
const d = new Date(date);
|
||||
if (Number.isNaN(d.getTime())) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const map = {
|
||||
YYYY: d.getFullYear(),
|
||||
MM: String(d.getMonth() + 1).padStart(2, '0'),
|
||||
DD: String(d.getDate()).padStart(2, '0'),
|
||||
HH: String(d.getHours()).padStart(2, '0'),
|
||||
mm: String(d.getMinutes()).padStart(2, '0'),
|
||||
ss: String(d.getSeconds()).padStart(2, '0')
|
||||
};
|
||||
return format.replace(/YYYY|MM|DD|HH|mm|ss/g, matched => map[matched]);
|
||||
},
|
||||
getExtraDropOff(extraDropOffPoint) {
|
||||
let returnExtraDropOffPoint = null;
|
||||
if(extraDropOffPoint!=undefined && extraDropOffPoint!=null && extraDropOffPoint!=''){
|
||||
returnExtraDropOffPoint = extraDropOffPoint.split(";");
|
||||
}
|
||||
console.log(returnExtraDropOffPoint);
|
||||
return returnExtraDropOffPoint;
|
||||
},
|
||||
/** 用于酒店 / limo 混合列表排序:越大表示时间越晚 */
|
||||
getRecordSortTimeMs(record) {
|
||||
if (!record) {
|
||||
return Number.POSITIVE_INFINITY;
|
||||
}
|
||||
if (record.recordType === 'limo') {
|
||||
const raw = record.pickUpDatetime || record.pickUpDateTime || record.pickupDatetime;
|
||||
if (raw != null && raw !== '') {
|
||||
const n = Number(raw);
|
||||
if (!Number.isNaN(n)) {
|
||||
return n;
|
||||
}
|
||||
const parsedRaw = dayjs(String(raw).trim());
|
||||
if (parsedRaw.isValid()) {
|
||||
return parsedRaw.valueOf();
|
||||
}
|
||||
}
|
||||
if (record.pickupDatetime) {
|
||||
const s = String(record.pickupDatetime).trim();
|
||||
const m = s.match(/^(\d{1,2})\/(\d{1,2})\/(\d{2,4})\s+(\d{1,2}):(\d{2})$/);
|
||||
if (m) {
|
||||
const year = m[3].length === 2 ? 2000 + parseInt(m[3], 10) : parseInt(m[3], 10);
|
||||
const d = new Date(
|
||||
year,
|
||||
parseInt(m[2], 10) - 1,
|
||||
parseInt(m[1], 10),
|
||||
parseInt(m[4], 10),
|
||||
parseInt(m[5], 10)
|
||||
);
|
||||
if (!Number.isNaN(d.getTime())) {
|
||||
return d.getTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Number.POSITIVE_INFINITY;
|
||||
}
|
||||
const checkInDate = record.checkinDate || record.checkInDate || record.CheckInDate;
|
||||
if (checkInDate != null && String(checkInDate).trim() !== '') {
|
||||
const parsed = dayjs(String(checkInDate).trim());
|
||||
if (parsed.isValid()) {
|
||||
return parsed.valueOf();
|
||||
}
|
||||
}
|
||||
return Number.POSITIVE_INFINITY;
|
||||
},
|
||||
getRecordSortDateMs(record) {
|
||||
const timeMs = this.getRecordSortTimeMs(record);
|
||||
if (!Number.isFinite(timeMs) || Number.isNaN(timeMs)) {
|
||||
return Number.POSITIVE_INFINITY;
|
||||
}
|
||||
const d = new Date(timeMs);
|
||||
d.setHours(0, 0, 0, 0);
|
||||
return d.getTime();
|
||||
},
|
||||
getRecordTypeSortIndex(record) {
|
||||
return record && record.recordType === 'limo' ? 1 : 0;
|
||||
},
|
||||
compareRecordForDisplay(a, b) {
|
||||
const dateA = this.getRecordSortDateMs(a);
|
||||
const dateB = this.getRecordSortDateMs(b);
|
||||
if (dateA !== dateB) {
|
||||
return dateA - dateB;
|
||||
}
|
||||
const typeDiff = this.getRecordTypeSortIndex(a) - this.getRecordTypeSortIndex(b);
|
||||
if (typeDiff !== 0) {
|
||||
return typeDiff;
|
||||
}
|
||||
if (a && b && a.recordType === 'limo' && b.recordType === 'limo') {
|
||||
const timeA = this.getRecordSortTimeMs(a);
|
||||
const timeB = this.getRecordSortTimeMs(b);
|
||||
if (timeA !== timeB) {
|
||||
return timeA - timeB;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
hasSingleBookingPermission(){
|
||||
if (!this.userData) return false;
|
||||
return Boolean(this.userData.canNewBooking) !== Boolean(this.userData.canViewLimo);
|
||||
},
|
||||
displayRecordList(){
|
||||
const hotelRecords = this.bookingList.map(item => ({...item, recordType: 'hotel'}));
|
||||
const limoRecords = this.limoBookingList.map(item => ({...item, recordType: 'limo'}));
|
||||
console.log(limoRecords);
|
||||
return hotelRecords.concat(limoRecords).sort((a, b) => this.compareRecordForDisplay(a, b));
|
||||
},
|
||||
isDisplayEmpty(){
|
||||
return this.displayRecordList.length === 0;
|
||||
},
|
||||
getConfirmationNo(){
|
||||
return function (booking) {
|
||||
if(booking!==undefined && booking!==null){
|
||||
if(booking.confirmationNo!==undefined && booking.confirmationNo!==null &&
|
||||
booking.confirmationNo!=='null' && booking.confirmationNo!=='' && booking.approveStatus!='W'){
|
||||
booking.confirmationNo!=='null' && booking.confirmationNo!=='' && booking.approveStatus!='W' && booking.approveStatus!='AP'){
|
||||
return booking.confirmationNo;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 'N/A';
|
||||
}
|
||||
}else{
|
||||
return 'N/A';
|
||||
}
|
||||
return 'N/A';
|
||||
}
|
||||
},
|
||||
dateFormat() {
|
||||
@@ -439,7 +726,41 @@
|
||||
if(booking.approveStatus!=null){
|
||||
approveStatus = booking.approveStatus;
|
||||
}
|
||||
// Opera和Approve Status都不为空的情况
|
||||
if(booking.recordType === 'limo'){
|
||||
const noOpera = operaStatus==null || operaStatus==undefined || operaStatus==='' || operaStatus==='null';
|
||||
const noApprove = approveStatus==null || approveStatus==undefined || approveStatus==='' || approveStatus==='null';
|
||||
if(noOpera && noApprove && booking.status!=null && booking.status!==undefined && String(booking.status).trim()!==''){
|
||||
const s = String(booking.status).toUpperCase().replace(/\s+/g,' ');
|
||||
if(s.includes('CANCEL')){
|
||||
return 'hz-status-font-cancel';
|
||||
}
|
||||
if(s.includes('WAITLIST') || s.includes('WAIT LIST')){
|
||||
return 'hz-status-font-waitlist';
|
||||
}
|
||||
if(s.includes('NOT YET')){
|
||||
return 'hz-status-font-waitlist';
|
||||
}
|
||||
if(s.includes('PENDING')){
|
||||
return 'hz-status-font-pending';
|
||||
}
|
||||
if(s.includes('CONFIRM')){
|
||||
return 'hz-status-font-duein';
|
||||
}
|
||||
if(s.includes('DRIVER_DEPARTED')){
|
||||
return 'hz-status-font-duein';
|
||||
}
|
||||
if(s.includes('DRIVER_ASSIGNED')){
|
||||
return 'hz-status-font-duein';
|
||||
}
|
||||
if(s.includes('DRIVER_ARRIVED')){
|
||||
return 'hz-status-font-duein';
|
||||
}
|
||||
if(s.includes('GUEST_PICKED')){
|
||||
return 'hz-status-font-duein';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
if((operaStatus!=null && operaStatus!=undefined) || (approveStatus!=null && approveStatus!=undefined))
|
||||
{
|
||||
if(approveStatus.toUpperCase()==='PN'||approveStatus.toUpperCase()==='F'){
|
||||
@@ -553,12 +874,31 @@
|
||||
},
|
||||
getRecordColor(){
|
||||
return function (booking) {
|
||||
if(booking==null){
|
||||
return 'hz-card-booking';
|
||||
}
|
||||
if(booking.recordType === 'limo'){
|
||||
const noApprove = booking.approveStatus==null || booking.approveStatus===undefined || booking.approveStatus==='' || booking.approveStatus==='null';
|
||||
const noOpera = booking.lastOperaStatus==null || booking.lastOperaStatus===undefined || booking.lastOperaStatus==='' || booking.lastOperaStatus==='null';
|
||||
if(noApprove && noOpera && booking.status!=null && booking.status!==undefined && String(booking.status).trim()!==''){
|
||||
const s = String(booking.status).toUpperCase().replace(/\s+/g,' ');
|
||||
if(s.includes('NOT YET') || s.includes('CONFIRM')){
|
||||
return 'hz-card-booking';
|
||||
}
|
||||
if(s.includes('WAITLIST') || s.includes('WAIT LIST') || s.includes('PENDING')){
|
||||
return 'hz-card-waitlist';
|
||||
}
|
||||
return 'hz-card-booking';
|
||||
}
|
||||
}
|
||||
if(booking.approveStatus==='W'|| booking.approveStatus==='WA'){
|
||||
return 'hz-card-waitlist'
|
||||
}else if(booking.approveStatus==='AP'){
|
||||
return 'hz-card-approval'
|
||||
}else if((booking.lastOperaStatus==='DUE_OUT' || booking.lastOperaStatus==='CHECKED_IN') && booking.confirmationNo!=null && (booking.sharer==null || booking.sharer==='[]' || booking.sharer==='')){
|
||||
return 'hz-card-booking'
|
||||
}else if(booking.approveStatus==='AP'){
|
||||
return 'hz-card-approval'
|
||||
}else{
|
||||
return 'hz-card-booking'
|
||||
}
|
||||
@@ -581,5 +921,7 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.hz-book-btn-wrap--single {
|
||||
width: 95%;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -458,9 +458,8 @@
|
||||
this.userData = uni.getStorageSync("userData");
|
||||
// this.modelBooking.bookingTypeId = this.userData.bookingTypeId;
|
||||
this.modelBooking.propertyId = this.userData.propertyId;
|
||||
|
||||
|
||||
this.modelBooking.teamId = this.userData.teamStructureId;
|
||||
this.modelBooking.sectionName = this.userData.section;
|
||||
this.modelBooking.sectionId = this.userData.sectionId;
|
||||
this.modelBooking.createdBy = this.userData.userId;
|
||||
this.modelBooking.createdByName = this.userData.userName;
|
||||
@@ -701,7 +700,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (this.maxRange == 0) this.getSetting();
|
||||
}
|
||||
} else {
|
||||
@@ -776,8 +775,9 @@
|
||||
this.currentTask = task;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.currentTask = null;
|
||||
|
||||
|
||||
if (res.success) {
|
||||
item.name = res.data.englishName;
|
||||
@@ -807,10 +807,10 @@
|
||||
let item = this.modelBooking.sharerList[index];
|
||||
let book = uni.getStorageSync("bookingData")
|
||||
let oldItem = book.sharerList[index];
|
||||
// 姓名被手动修改后,清除不再匹配的玩家 ID。
|
||||
if (item.name != oldItem.name && item.playerId.length > 4) {
|
||||
item.playerId = "";
|
||||
}
|
||||
//清空plaerId
|
||||
// if (item.name != oldItem.name && item.playerId.length == 8) {
|
||||
// item.playerId = "";
|
||||
// }
|
||||
},
|
||||
async buildCalendar() {
|
||||
uni.showLoading({
|
||||
@@ -949,9 +949,9 @@
|
||||
'available': 0,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
var isWaitlist = false;
|
||||
var waitlistCount = 0;
|
||||
var criteriaCount = e.length - 1;
|
||||
@@ -984,7 +984,7 @@
|
||||
let checkDate = JSON.parse(JSON.stringify(e));
|
||||
checkDate.pop();
|
||||
if (!this.checkDate(checkDate)) return false;
|
||||
|
||||
|
||||
//rebuild special code
|
||||
let specialCode = this.modelBooking.specialCode;
|
||||
let specialName = this.modelBooking.specialName;
|
||||
@@ -1525,7 +1525,7 @@
|
||||
} else {
|
||||
this.showMsgNoExtend = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
},
|
||||
checkConsecutiveNight(checkInDate, night) {
|
||||
|
||||
@@ -18,19 +18,19 @@
|
||||
<!-- <view class="player-summary"> -->
|
||||
<view class="hz-card-profile mb-[40]" style="margin:9px 9px 6px;">
|
||||
<view class="hz-flex-row">
|
||||
<view style="width:60%">
|
||||
<view class="hz-w-60">
|
||||
<view class="hz-font-color-light hz-font-sm">{{$t("common.playerId")}}</view>
|
||||
<view class="hz-font-bolder hz-font-lg" >{{ safePlayerData.playerId }}</view>
|
||||
<view class="hz-font-bolder hz-font-lg" >{{ playerData.playerId }}</view>
|
||||
</view>
|
||||
<view style="width:40%">
|
||||
<view class="hz-w-40">
|
||||
<view class="hz-font-color-light hz-font-sm">{{$t("common.tier")}}</view>
|
||||
<view class="hz-font-bolder hz-font-lg" >{{ safePlayerData.tierName }}</view>
|
||||
<view class="hz-font-bolder hz-font-lg" >{{ playerData.tierName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hz-flex-row hz-mr-t-30">
|
||||
<view style="width:100%">
|
||||
<view class="hz-w-100">
|
||||
<view class="hz-font-color-light hz-font-sm">{{$t("common.name")}}</view>
|
||||
<view class="hz-font-bolder hz-font-lg" >{{ playerName }}</view>
|
||||
<view class="hz-font-bolder hz-font-lg" >{{playerData.salutation + " " + playerData.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -197,13 +197,11 @@
|
||||
propertyTabItemStyle() {
|
||||
return {
|
||||
height: '70rpx',
|
||||
padding: '0 24rpx',
|
||||
flexShrink: 0,
|
||||
padding: '0',
|
||||
};
|
||||
},
|
||||
propertyTabActiveStyle() {
|
||||
return {
|
||||
whiteSpace: 'nowrap',
|
||||
color: '#C39A4B',
|
||||
fontFamily: 'Inter-Bold',
|
||||
fontSize: '30rpx',
|
||||
@@ -212,7 +210,6 @@
|
||||
},
|
||||
propertyTabInactiveStyle() {
|
||||
return {
|
||||
whiteSpace: 'nowrap',
|
||||
color: '#111111',
|
||||
fontFamily: 'Inter-Bold',
|
||||
fontSize: '30rpx',
|
||||
@@ -241,7 +238,6 @@
|
||||
this.navBack();
|
||||
},
|
||||
async loadPropertiesRoomTypes() {
|
||||
if (!this.canLoadPlayerCalendar()) return;
|
||||
try {
|
||||
this.calendarReady = false;
|
||||
uni.showLoading({
|
||||
@@ -249,19 +245,14 @@
|
||||
});
|
||||
await this.loadCalendarSetting();
|
||||
const res = await getPropertiesRoomTypes({});
|
||||
if (this.isNoPermissionResponse(res)) {
|
||||
this.showCalendarNoPermission();
|
||||
return;
|
||||
}
|
||||
this.propertyList = Array.isArray(res && res.propertyList) ? res.propertyList : [];
|
||||
if (!this.propertyList.length) throw new Error('No calendar properties configured');
|
||||
this.propertyList = res.propertyList;
|
||||
this.selectedPropertyCode = this.getDefaultPropertyCode();
|
||||
this.selectDefaultOptions();
|
||||
this.buildCalendar();
|
||||
await this.loadQualificationData();
|
||||
this.calendarRenderKey += 1;
|
||||
this.$nextTick(() => {
|
||||
this.calendarReady = !this.calendarNoPermission;
|
||||
this.calendarReady = true;
|
||||
});
|
||||
} catch (e) {
|
||||
uni.$u.toast(e.message || e.errMsg || 'Load property room types failed');
|
||||
@@ -464,12 +455,10 @@
|
||||
}));
|
||||
},
|
||||
refreshCalendar() {
|
||||
if (!this.canLoadPlayerCalendar()) return;
|
||||
this.ensureSelectedOptionsForRefresh(true);
|
||||
this.loadQualificationData();
|
||||
},
|
||||
async loadQualificationData() {
|
||||
if (!this.canLoadPlayerCalendar()) return;
|
||||
const records = [];
|
||||
const dateRange = this.getCalendarDateRange();
|
||||
const requestId = this.startCalendarRequest();
|
||||
@@ -523,20 +512,7 @@
|
||||
});
|
||||
},
|
||||
isNoPermissionResponse(res) {
|
||||
return res && res.success === false && (res.errorCode || res.code) === 'NO_PERMISSION';
|
||||
},
|
||||
canLoadPlayerCalendar() {
|
||||
this.userData = uni.getStorageSync("userData");
|
||||
if (!this.userData || this.userData.canViewCalendar !== true) {
|
||||
this.showCalendarNoPermission();
|
||||
return false;
|
||||
}
|
||||
if (!this.safePlayerData.playerId) {
|
||||
this.calendarReady = false;
|
||||
uni.$u.toast(this.$t("common.dataNotFound"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return res && res.success === false && res.errorCode === 'NO_PERMISSION';
|
||||
},
|
||||
showCalendarNoPermission() {
|
||||
this.qualificationMap = {};
|
||||
|
||||
@@ -139,10 +139,10 @@
|
||||
<!-- <view class="hz-font-bolder hz-font-lg" >{{ handleShowWhenScreenshot(bookingData.eta) }}</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="bookingData.miscCharge!=null" class="hz-flex-row">
|
||||
<view v-if="bookingData.mischarge!=null" class="hz-flex-row">
|
||||
<view style="width:100%">
|
||||
<view class="hz-font-color-black hz-font-sm">{{ $t("common.misCharge") }}</view>
|
||||
<view class="hz-font-bolder hz-font-lg">{{ bookingData.miscCharge || "-" }}</view>
|
||||
<view class="hz-font-bolder hz-font-lg">{{ bookingData.mischarge || "-" }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -254,18 +254,19 @@
|
||||
<!-- Remark -->
|
||||
<view style="margin-bottom: 16px;margin-top: 16px;">
|
||||
<view style="text-align: left;">{{$t("bookingConfirm.approvalRemark")}}</view>
|
||||
<u-checkbox-group placement="row"
|
||||
:value="unqualifiedDateCheckboxStates[currentUnqualifiedIndex] || []"
|
||||
@change="changeOtherRemark"
|
||||
<u-checkbox-group placement="row" @change="changeOtherRemark"
|
||||
v-model="unqualifiedDateCheckboxStates[currentUnqualifiedIndex]"
|
||||
style="flex-direction: unset;display: block;">
|
||||
<view style="width:50%;display: inline-flex;">
|
||||
<u-checkbox activeColor="#C39A4B" labelColor="#333333" shape="circle"
|
||||
customStyle="height:30px;width:100%;" label="Extend" name="Extend"></u-checkbox>
|
||||
customStyle="height:30px;width:100%;" label="Extend" name="Extend"
|
||||
:value="unqualifiedDateCheckboxStates[currentUnqualifiedIndex] && unqualifiedDateCheckboxStates[currentUnqualifiedIndex].includes('Extend')"></u-checkbox>
|
||||
|
||||
</view>
|
||||
<view style="width:50%;display: inline-flex;position: relative;left:10%;">
|
||||
<u-checkbox activeColor="#C39A4B" labelColor="#333333" shape="circle"
|
||||
customStyle="height:30px;width:100%;" label="Remark" name="Remark"></u-checkbox>
|
||||
customStyle="height:30px;width:100%;" label="Remark" name="Remark"
|
||||
:value="unqualifiedDateCheckboxStates[currentUnqualifiedIndex] && unqualifiedDateCheckboxStates[currentUnqualifiedIndex].includes('Remark')"></u-checkbox>
|
||||
</view>
|
||||
</u-checkbox-group>
|
||||
<view style="width:100%;margin-top:16px;" v-show="showRemark">
|
||||
@@ -328,32 +329,41 @@
|
||||
<rich-text v-html="msgStr" style="line-height:26px;"></rich-text>
|
||||
</view>
|
||||
<view style="margin-bottom: 10px;text-align: left;"> {{$t("bookingConfirm.approvalRemark")}}</view>
|
||||
<!-- uView:u-checkbox 必须在 u-checkbox-group 内;房型互斥用 group + 受控 :value -->
|
||||
<u-checkbox-group placement="row"
|
||||
:value="waitlistRoomGroupValue"
|
||||
@change="onWaitlistRoomRemarkGroupChange"
|
||||
<u-radio-group placement="row" @change="changeRoomRemark" v-if="showRadio"
|
||||
style="flex-direction: unset;display: block;">
|
||||
<view style="width:50%;display: inline-flex;">
|
||||
<u-radio activeColor="#C39A4B" labelColor="#333333" shape="circle"
|
||||
customStyle="height:30px;width:100%;" label="2nd Room" name="2nd Room"></u-radio>
|
||||
|
||||
</view>
|
||||
<view style="width:50%;display: inline-flex;position: relative;left:10%;">
|
||||
<u-radio activeColor="#C39A4B" labelColor="#333333" shape="circle"
|
||||
customStyle="height:30px;width:100%;" label="3rd Room" name="3rd Room"></u-radio>
|
||||
</view>
|
||||
</u-radio-group>
|
||||
<u-checkbox-group placement="row" v-else style="flex-direction: unset;display: block;">
|
||||
<view style="width:50%;display: inline-flex;">
|
||||
<u-checkbox activeColor="#C39A4B" labelColor="#333333" shape="circle"
|
||||
customStyle="height:30px;width:100%;" label="2nd Room" name="2nd Room"></u-checkbox>
|
||||
|
||||
</view>
|
||||
<view style="width:50%;display: inline-flex;position: relative;left:10%;">
|
||||
<u-checkbox activeColor="#C39A4B" labelColor="#333333" shape="circle"
|
||||
customStyle="height:30px;width:100%;" label="3rd Room" name="3rd Room"></u-checkbox>
|
||||
</view>
|
||||
</u-checkbox-group>
|
||||
<u-checkbox-group placement="row"
|
||||
:value="waitlistOtherRemarkCheckList"
|
||||
@change="changeWaitlistOtherRemark"
|
||||
<u-checkbox-group placement="row" @change="changeOtherRemark"
|
||||
style="flex-direction: unset;display: block;">
|
||||
<view style="width:50%;display: inline-flex;">
|
||||
<u-checkbox activeColor="#C39A4B" labelColor="#333333" shape="circle"
|
||||
customStyle="height:30px;width:100%;" label="Extend" name="Extend"></u-checkbox>
|
||||
customStyle="height:30px;width:100%;" label="Extend" name="Extend"
|
||||
:value="unqualifiedDateCheckboxStates[currentUnqualifiedIndex] && unqualifiedDateCheckboxStates[currentUnqualifiedIndex].includes('Extend')"></u-checkbox>
|
||||
|
||||
</view>
|
||||
<view style="width:50%;display: inline-flex;position: relative;left:10%;">
|
||||
<u-checkbox activeColor="#C39A4B" labelColor="#333333" shape="circle"
|
||||
customStyle="height:30px;width:100%;" label="Remark" name="Remark"></u-checkbox>
|
||||
customStyle="height:30px;width:100%;" label="Remark" name="Remark"
|
||||
:value="unqualifiedDateCheckboxStates[currentUnqualifiedIndex] && unqualifiedDateCheckboxStates[currentUnqualifiedIndex].includes('Remark')"></u-checkbox>
|
||||
</view>
|
||||
</u-checkbox-group>
|
||||
<view style="width:100%;margin-top:16px;" v-show="showRemark">
|
||||
@@ -427,8 +437,7 @@
|
||||
selectedApprover:'',
|
||||
showRemark: false,
|
||||
showWaitlistModal:false,
|
||||
// Waitlist 弹窗 Extend/Remark(必须与 u-checkbox-group 的 :value 绑定,勿用子项 :value)
|
||||
waitlistOtherRemarkCheckList: [],
|
||||
showRadio:false,
|
||||
unqualifiedDateList: [],
|
||||
currentUnqualifiedIndex: 0,
|
||||
unqualifiedDateRemarks: [],
|
||||
@@ -454,17 +463,6 @@
|
||||
// 數據方法
|
||||
getBooking(){
|
||||
this.bookingData = uni.getStorageSync("bookingData");
|
||||
// 确保 roomRemark 是响应式字段,否则 iOS 上可能出现 u-checkbox 状态未被正确回刷导致“可多选”
|
||||
if (this.bookingData !== null && this.bookingData !== undefined && typeof this.bookingData === 'object') {
|
||||
const hasRoomRemark = Object.prototype.hasOwnProperty.call(this.bookingData, 'roomRemark');
|
||||
if (!hasRoomRemark || this.bookingData.roomRemark === null || this.bookingData.roomRemark === undefined || this.bookingData.roomRemark === 'null') {
|
||||
(this.$set ? this.$set(this.bookingData, 'roomRemark', '') : this.bookingData.roomRemark = '');
|
||||
}
|
||||
const hasOtherRemark = Object.prototype.hasOwnProperty.call(this.bookingData, 'otherRemark');
|
||||
if (!hasOtherRemark || this.bookingData.otherRemark === null || this.bookingData.otherRemark === undefined || this.bookingData.otherRemark === 'null') {
|
||||
(this.$set ? this.$set(this.bookingData, 'otherRemark', '') : this.bookingData.otherRemark = '');
|
||||
}
|
||||
}
|
||||
if(this.bookingData!==null && this.bookingData!==undefined && this.bookingData!==''){
|
||||
this.oldDateList = this.bookingData.dateList;
|
||||
this.checkList = [];
|
||||
@@ -500,7 +498,11 @@
|
||||
this.submitBooking();
|
||||
}
|
||||
},
|
||||
buildUnqualifiedDateLists() {
|
||||
submitApproval() {
|
||||
// 显示审批模态框
|
||||
this.getApprovalReason();
|
||||
this.showApprovalModal = true;
|
||||
this.showModalBtn = true;
|
||||
this.currentUnqualifiedIndex = 0;
|
||||
this.unqualifiedDateList = [];
|
||||
this.unqualifiedDateRemarks = [];
|
||||
@@ -508,27 +510,33 @@
|
||||
this.unqualifiedDateApprovers = [];
|
||||
this.unqualifiedDateOtherRemarks = [];
|
||||
this.unqualifiedDateCheckboxStates = [];
|
||||
if (this.checkList != null && this.checkList.length > 0) {
|
||||
if (this.bookingData.bookType == 1) {
|
||||
for (let i = 0; i < this.bookingData.extendDate.length; i++) {
|
||||
for (let j = 0; j < this.checkList.length; j++) {
|
||||
if (i == this.checkList[j] && this.bookingData.extendDate[i].status == 1) {
|
||||
if(this.checkList!=null && this.checkList.length>0){
|
||||
if(this.bookingData.bookType==1){
|
||||
// 把extendDate中的状态都设置成不够分
|
||||
for(let i=0;i<this.bookingData.extendDate.length;i++){
|
||||
for(let j=0;j<this.checkList.length;j++){
|
||||
if(i == this.checkList[j] && this.bookingData.extendDate[i].status==1){
|
||||
console.log(this.bookingData.extendDate[i]);
|
||||
this.unqualifiedDateList.push(this.bookingData.extendDate[i]);
|
||||
this.unqualifiedDateRemarks.push(this.bookingData.extendDate[i].remark || null);
|
||||
this.unqualifiedDateReasons.push('');
|
||||
// 多选 Approver:为每个 index 初始化为数组
|
||||
this.unqualifiedDateApprovers.push([]);
|
||||
this.unqualifiedDateOtherRemarks.push('');
|
||||
this.unqualifiedDateCheckboxStates.push([]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < this.bookingData.dateList.length; i++) {
|
||||
for (let j = 0; j < this.checkList.length; j++) {
|
||||
if (i == this.checkList[j] && this.bookingData.dateList[i].status == 1) {
|
||||
}else{
|
||||
// 把dateList中的状态都设置成不够分
|
||||
for(let i=0;i<this.bookingData.dateList.length;i++){
|
||||
for(let j=0;j<this.checkList.length;j++){
|
||||
if(i == this.checkList[j] && this.bookingData.dateList[i].status==1){
|
||||
// console.log(this.bookingData.dateList[i]);
|
||||
this.unqualifiedDateList.push(this.bookingData.dateList[i]);
|
||||
this.unqualifiedDateRemarks.push(this.bookingData.dateList[i].remark || '');
|
||||
this.unqualifiedDateReasons.push('');
|
||||
// 多选 Approver:为每个 index 初始化为数组
|
||||
this.unqualifiedDateApprovers.push([]);
|
||||
this.unqualifiedDateOtherRemarks.push('');
|
||||
this.unqualifiedDateCheckboxStates.push([]);
|
||||
@@ -536,16 +544,10 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
submitApproval() {
|
||||
// 与 Waitlist 共用:必须先填充 unqualifiedDateList,否则 getWaitlistRemark 无法匹配 Extend
|
||||
this.buildUnqualifiedDateLists();
|
||||
// 显示审批模态框
|
||||
this.getApprovalReason();
|
||||
this.showApprovalModal = true;
|
||||
this.showModalBtn = true;
|
||||
},
|
||||
onApprovalChange(value){
|
||||
this.selectedApprover = value;
|
||||
// 多选:value 为数组,需要拼接 approverName
|
||||
@@ -1101,7 +1103,7 @@
|
||||
if (this.bookingData.extendDate[i].status == 1) {
|
||||
|
||||
// remarkText只保存remark输入的内容,不加Extend前缀
|
||||
this.bookingData.extendDate[i].remarkText = this.unqualifiedDateRemarks[unqualifiedIndex] || '';
|
||||
this.bookingData.extendData[i].remarkText = this.unqualifiedDateRemarks[unqualifiedIndex] || '';
|
||||
|
||||
// 添加approvalReason字段
|
||||
this.bookingData.extendDate[i].approvalReason = this.unqualifiedDateReasons[unqualifiedIndex] || null;
|
||||
@@ -1432,64 +1434,40 @@
|
||||
},
|
||||
getWaitlistRemark(type,index){
|
||||
let item = (type==2?this.bookingData.extendDate[index]:this.bookingData.dateList[index]);
|
||||
let unqualifiedIndex = this.unqualifiedDateList.findIndex(uItem => uItem === item);
|
||||
if (unqualifiedIndex === -1 && item.date && item.date.length) {
|
||||
unqualifiedIndex = this.unqualifiedDateList.findIndex((uItem) => {
|
||||
const ud = uItem.date;
|
||||
const id = item.date;
|
||||
return ud && id && ud.length && id.length &&
|
||||
ud[0] === id[0] && ud[ud.length - 1] === id[id.length - 1];
|
||||
});
|
||||
}
|
||||
// 仅一条 Waitlist/Unqualified 时,引用不一致也会导致 findIndex 失败,直接对齐下标 0
|
||||
if (unqualifiedIndex === -1 && this.unqualifiedDateList.length === 1) {
|
||||
unqualifiedIndex = 0;
|
||||
}
|
||||
const checkboxState = unqualifiedIndex !== -1
|
||||
? (this.unqualifiedDateCheckboxStates[unqualifiedIndex] || [])
|
||||
: [];
|
||||
const otherSlot = unqualifiedIndex !== -1
|
||||
? (this.unqualifiedDateOtherRemarks[unqualifiedIndex] || '')
|
||||
: '';
|
||||
const wlTags = this.waitlistOtherRemarkCheckList || [];
|
||||
const globalOther = (this.bookingData && this.bookingData.otherRemark) ? String(this.bookingData.otherRemark) : '';
|
||||
const parseTags = (s) => String(s).split(';').map((x) => x.trim()).filter(Boolean);
|
||||
const hasExtend = checkboxState.includes('Extend') ||
|
||||
parseTags(otherSlot).includes('Extend') ||
|
||||
wlTags.includes('Extend') ||
|
||||
parseTags(globalOther).includes('Extend');
|
||||
let remarkArr = [];
|
||||
let roomRemark = this.bookingData.roomRemark;
|
||||
let otherRemark = this.bookingData.otherRemark;
|
||||
if(roomRemark!=''&&roomRemark!=undefined) remarkArr.push(roomRemark);
|
||||
if(otherRemark!=''&&otherRemark!=undefined) remarkArr.push(otherRemark);
|
||||
|
||||
const roomRemark = this.bookingData.roomRemark;
|
||||
const idxRemark = unqualifiedIndex !== -1 ? this.unqualifiedDateRemarks[unqualifiedIndex] : '';
|
||||
const manualRemark = (idxRemark != null && idxRemark !== '') ? idxRemark : this.freeRemark;
|
||||
const remarkChecked = unqualifiedIndex !== -1 &&
|
||||
(this.unqualifiedDateCheckboxStates[unqualifiedIndex] || []).includes('Remark');
|
||||
|
||||
if (unqualifiedIndex !== -1 && this.unqualifiedDateOtherRemarks[unqualifiedIndex] != null) {
|
||||
this.bookingData.otherRemark = this.unqualifiedDateOtherRemarks[unqualifiedIndex];
|
||||
// 找到对应的unqualifiedDate索引
|
||||
const unqualifiedIndex = this.unqualifiedDateList.findIndex(uItem => uItem === item);
|
||||
let extendStr = '';
|
||||
if (unqualifiedIndex !== -1) {
|
||||
const checkboxState = this.unqualifiedDateCheckboxStates[unqualifiedIndex] || [];
|
||||
if (checkboxState.includes('Extend')) {
|
||||
extendStr = 'Extend';
|
||||
}
|
||||
}
|
||||
|
||||
// 对应 BookingDate 的 remark:勾选 Extend 时放在字符串首位
|
||||
const dateParts = [];
|
||||
if (hasExtend) {
|
||||
dateParts.push('Extend');
|
||||
}
|
||||
if (roomRemark != null && roomRemark !== '' && roomRemark !== undefined) {
|
||||
dateParts.push(roomRemark);
|
||||
}
|
||||
if (item.status == 1 &&
|
||||
item.remarkText != null && item.remarkText !== '' && item.remarkText !== undefined) {
|
||||
dateParts.push(item.remarkText);
|
||||
}
|
||||
if ((remarkChecked || this.showRemark) && manualRemark !== '' && manualRemark != null && item.status == 1) {
|
||||
if (manualRemark !== item.remarkText) dateParts.push(manualRemark);
|
||||
item.remarkText != '' &&
|
||||
item.remarkText != undefined) {
|
||||
if (extendStr) {
|
||||
remarkArr.push(extendStr + '; ' + item.remarkText);
|
||||
} else {
|
||||
remarkArr.push(item.remarkText);
|
||||
}
|
||||
} else if (item.status == 1 && extendStr) {
|
||||
remarkArr.push(extendStr);
|
||||
}
|
||||
|
||||
if(this.showRemark&&this.freeRemark!=''&&item.status==1) remarkArr.push(this.freeRemark);
|
||||
|
||||
const dateRemarkJoin = dateParts.join('; ');
|
||||
if (dateRemarkJoin) {
|
||||
this.bookingData.remark = dateRemarkJoin;
|
||||
item.remark = dateRemarkJoin;
|
||||
} else {
|
||||
if(remarkArr.length>0) {
|
||||
this.bookingData.remark = remarkArr.join('; ');
|
||||
item.remark = remarkArr.join('; ');
|
||||
}else{
|
||||
this.bookingData.remark = "";
|
||||
item.remark = "";
|
||||
}
|
||||
@@ -1585,10 +1563,6 @@
|
||||
},
|
||||
|
||||
showWaitlistPop() {
|
||||
// 关键:直接点「放入 Waitlist」不会经过 submitApproval,必须在此处填充 unqualifiedDateList,
|
||||
// 否则 getWaitlistRemark 里 findIndex 恒为 -1,Extend 永远不会写入 remark
|
||||
this.buildUnqualifiedDateLists();
|
||||
this.waitlistOtherRemarkCheckList = (this.unqualifiedDateCheckboxStates[0] || []).slice();
|
||||
this.showWaitlistModal = true;
|
||||
this.showMsgBox = false;
|
||||
},
|
||||
@@ -1632,27 +1606,17 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
onWaitlistRoomRemarkGroupChange(e) {
|
||||
const raw = Array.isArray(e) ? e : (e && Array.isArray(e.detail) ? e.detail : []);
|
||||
const names = raw.map((x) => (x != null ? String(x) : '')).filter(Boolean);
|
||||
if (!this.bookingData) {
|
||||
return;
|
||||
changeRoomRemark(e,item) {
|
||||
if (e) {
|
||||
if(e==item.roomRemark){
|
||||
item.roomRemark=""
|
||||
item.showRadio = true;
|
||||
setTimeout(()=>{item.showRadio = false;this.$forceUpdate()},1)
|
||||
}else{
|
||||
item.roomRemark=e
|
||||
}
|
||||
}
|
||||
if (!Object.prototype.hasOwnProperty.call(this.bookingData, 'roomRemark')) {
|
||||
this.$set(this.bookingData, 'roomRemark', '');
|
||||
}
|
||||
if (names.length === 0) {
|
||||
this.bookingData.roomRemark = '';
|
||||
return;
|
||||
}
|
||||
if (names.length === 1) {
|
||||
this.bookingData.roomRemark = names[0];
|
||||
return;
|
||||
}
|
||||
// 双选时视为互斥:保留本次切换目标(与原先不同的那一项)
|
||||
const prev = this.bookingData.roomRemark;
|
||||
const next = names.find((n) => n !== prev) || names[names.length - 1];
|
||||
this.bookingData.roomRemark = next;
|
||||
this.$forceUpdate()
|
||||
},
|
||||
// changeOtherRemark(e,item) {
|
||||
// if (e) {
|
||||
@@ -1671,41 +1635,27 @@
|
||||
// this.$forceUpdate()
|
||||
// }
|
||||
// },
|
||||
changeWaitlistOtherRemark(e) {
|
||||
const raw = Array.isArray(e) ? e : (e && Array.isArray(e.detail) ? e.detail : []);
|
||||
const names = raw.map((x) => (x != null ? String(x) : '')).filter(Boolean);
|
||||
this.waitlistOtherRemarkCheckList = names.slice();
|
||||
const extras = names.filter((n) => n !== 'Remark');
|
||||
const str = extras.join('; ');
|
||||
this.showRemark = names.includes('Remark');
|
||||
const n = this.unqualifiedDateCheckboxStates.length;
|
||||
for (let i = 0; i < n; i++) {
|
||||
this.$set(this.unqualifiedDateCheckboxStates, i, names.slice());
|
||||
this.$set(this.unqualifiedDateOtherRemarks, i, str);
|
||||
}
|
||||
if (this.bookingData) {
|
||||
this.bookingData.otherRemark = str;
|
||||
}
|
||||
},
|
||||
changeOtherRemark(e) {
|
||||
const raw = Array.isArray(e) ? e : (e && Array.isArray(e.detail) ? e.detail : []);
|
||||
const idx = this.currentUnqualifiedIndex;
|
||||
if (!raw || raw.length === 0) {
|
||||
this.showRemark = false;
|
||||
this.$set(this.unqualifiedDateOtherRemarks, idx, '');
|
||||
this.$set(this.unqualifiedDateCheckboxStates, idx, []);
|
||||
if (this.bookingData) {
|
||||
this.bookingData.otherRemark = '';
|
||||
if (e) {
|
||||
let str = '';
|
||||
let show = false;
|
||||
for (let i = 0; i < e.length; i++) {
|
||||
|
||||
if (e[i] == 'Remark') {
|
||||
show = true;
|
||||
} else {
|
||||
str = e[i];
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
const names = raw.map((x) => (x != null ? String(x) : '')).filter(Boolean);
|
||||
const extras = names.filter((n) => n !== 'Remark');
|
||||
this.showRemark = names.includes('Remark');
|
||||
this.$set(this.unqualifiedDateCheckboxStates, idx, names.slice());
|
||||
this.$set(this.unqualifiedDateOtherRemarks, idx, extras.join('; '));
|
||||
if (this.bookingData) {
|
||||
this.bookingData.otherRemark = extras.join('; ');
|
||||
this.showRemark = show;
|
||||
// 存储到当前索引的otherRemark
|
||||
this.unqualifiedDateOtherRemarks[this.currentUnqualifiedIndex] = str;
|
||||
// 存储checkbox状态
|
||||
this.unqualifiedDateCheckboxStates[this.currentUnqualifiedIndex] = e;
|
||||
} else {
|
||||
this.showRemark = false;
|
||||
this.unqualifiedDateOtherRemarks[this.currentUnqualifiedIndex] = '';
|
||||
this.unqualifiedDateCheckboxStates[this.currentUnqualifiedIndex] = [];
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1721,16 +1671,6 @@
|
||||
},
|
||||
},
|
||||
computed:{
|
||||
waitlistRoomGroupValue() {
|
||||
if (!this.bookingData || !this.bookingData.roomRemark) {
|
||||
return [];
|
||||
}
|
||||
const r = this.bookingData.roomRemark;
|
||||
if (r === '2nd Room' || r === '3rd Room') {
|
||||
return [r];
|
||||
}
|
||||
return [];
|
||||
},
|
||||
getStatusColor(){
|
||||
return function (booking) {
|
||||
let operaStatus = null;
|
||||
@@ -2051,4 +1991,4 @@
|
||||
color: #C39A4B;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user