merge limo to daylight

This commit is contained in:
Mauve
2026-09-22 16:37:00 +08:00
parent 0c92868836
commit a7359d443b
73 changed files with 11614 additions and 1040 deletions
+108 -168
View File
@@ -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>