把资料库产色的几个文件提交,汇出挂单功能的数据,状态数据要有才能运行

This commit is contained in:
2025-09-12 13:48:04 +08:00
parent 0b0ddc82bd
commit 4419dfff64
12 changed files with 667 additions and 231 deletions

View File

@@ -122,7 +122,8 @@
variant="outlined"
size="small"
class="me-2"
:disabled="item.statuscode !== '402'">
:disabled="item.statuscode !== '402'"
@click="showXuzhuGuestModalMethod(item)">
續住
</v-btn>
<!-- 退房 -->
@@ -142,6 +143,52 @@
</v-data-table>
</fieldset>
<!-- 🟢 續住彈出視窗 -->
<div>
<v-dialog v-model="guadanguest.xuzhu.showXuzhuGuestModal" max-width="50%">
<v-card
class="pa-6 d-flex flex-column" style="min-height: 60vh; border-radius: 12px;"
style="min-height: 40vh; border-radius: 12px; box-shadow: 0 8px 20px rgba(0,0,0,0.15);"
>
<!-- 弹窗标题 -->
<v-card-title
class="text-h6 d-flex align-center justify-space-between pb-4"
style="border-bottom: 1px solid #eee;"
>
<div class="d-flex align-center">
<span class="font-weight-bold">续住</span>
</div>
<v-btn icon @click="closeXuzhuGuestModalMethod">
<v-icon>mdi-close</v-icon>
</v-btn>
</v-card-title>
<!-- 弹窗内容 -->
<v-card-text class="flex-grow-1 py-6" style="overflow-y: auto;">
<div class="mb-4">
<span class="font-weight-medium">当前退房时间:</span>
<span class="text-primary">{{ guadanguest.xuzhu.currentCheckoutDate }}</span>
</div>
<div class="d-flex align-center">
<span class="font-weight-medium mr-2">续住后退房时间:</span>
<input
type="date"
id="newCheckoutDate"
v-model="guadanguest.xuzhu.newCheckoutDate"
class="pa-2"
style="border: 1px solid #ccc; border-radius: 6px; padding: 6px 10px;"
/>
</div>
</v-card-text>
<!-- 弹窗操作按钮 -->
<v-card-actions class="justify-end pt-4" style="border-top: 1px solid #eee;">
<v-btn color="primary" class="px-6" @click="xuzhuPost">续住</v-btn>
<v-btn text class="ml-2" @click="closeXuzhuGuestModalMethod">取消</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
<!-- 🟢 掛單蓮友彈出視窗 -->
<div>
@@ -868,6 +915,13 @@
],
items: [],
showCreateGuestModal: false,
xuzhu: {
showXuzhuGuestModal: false,
currentCheckoutDate: null,
newCheckoutDate: null,
guestUuid: null,
guestBedUuid: null,
}
},
checkInGuest: {
showSelectGuadanOrderGuest: false,
@@ -971,6 +1025,89 @@
}
},
methods: {
//续住相關方法--------------------start
showXuzhuGuestModalMethod(guest) {
if (!guest.checkoutat) {
return;
}
this.guadanguest.xuzhu.showXuzhuGuestModal = true;
this.guadanguest.xuzhu.currentCheckoutDate = guest.checkoutat;
this.guadanguest.xuzhu.guestUuid = guest.uuid;
this.guadanguest.xuzhu.guestBedUuid = guest.bedUuid;
this.$nextTick(() => { // 确保弹窗 DOM 已渲染
const input = document.getElementById('newCheckoutDate');
if (input) {
const checkoutDate = new Date(guest.checkoutat); // 用指定日期
checkoutDate.setDate(checkoutDate.getDate() + 1); // 明天
const year = checkoutDate.getFullYear();
const month = String(checkoutDate.getMonth() + 1).padStart(2, '0');
const day = String(checkoutDate.getDate()).padStart(2, '0');
const tomorrow = `${year}-${month}-${day}`;
input.min = tomorrow; // 限制最小值
//input.value = tomorrow; // 默认选中明天
}
});
console.log(guest.checkoutat)
},
closeXuzhuGuestModalMethod() {
console.log(this.guadanguest.xuzhu.newCheckoutDate)
this.guadanguest.xuzhu.showXuzhuGuestModal = false;
this.guadanguest.xuzhu.currentCheckoutDate = null;
this.guadanguest.xuzhu.newCheckoutDate = null;
this.guadanguest.xuzhu.guestUuid = null;
this.guadanguest.xuzhu.guestBedUuid = null;
console.log(this.guadanguest.xuzhu.newCheckoutDate)
console.log(this.guadanguest.xuzhu.currentCheckoutDate)
console.log(this.guadanguest.xuzhu.guestUuid)
console.log(this.guadanguest.xuzhu.guestBedUuid)
},
xuzhuPost() {
// 校验必填
if (!this.guadanguest.xuzhu.guestUuid || !this.guadanguest.xuzhu.guestBedUuid) {
alert("GuestUuid 和 GuestBedUuid 不能为空");
return;
}
if (!this.guadanguest.xuzhu.newCheckoutDate || !this.guadanguest.xuzhu.currentCheckoutDate) {
alert("续住时间不能为空");
return;
}
const payload = {
guestUuid: this.guadanguest.xuzhu.guestUuid,
guestBedUuid: this.guadanguest.xuzhu.guestBedUuid,
currentCheckoutDate: this.guadanguest.xuzhu.currentCheckoutDate,
newCheckoutDate: this.guadanguest.xuzhu.newCheckoutDate
};
axios.post('/api/guadanorderguest/xuzhu', payload)
.then((res) => {
this.$refs.messageModal.open({
title: '续住成功',
message: '客人续住已处理',
status: 'success',
callback: () => {
// 弹窗关闭后的回调
try {
this.getGuadanOrderGuestByOrderNo();
}
catch (error) {
console.error("发生错误:", error.message);
} finally {
this.closeXuzhuGuestModalMethod();
}
}
});
})
.catch((error) => {
this.$refs.messageModal.open({
title: '续住失败',
message: error.response?.data?.message || '系统异常,请稍后重试',
status: 'error'
});
});
},
//续住相關方法--------------------end
getActivityList() {
axios.post('/api/activity/GetList?page=1&pageSize=500', { kind: 0, subject: "" })
.then((res) => {