Merge branch 'guadan0905'
This commit is contained in:
@@ -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) => {
|
||||
|
||||
198
web/admin/guadan/guest/index.aspx
Normal file
198
web/admin/guadan/guest/index.aspx
Normal file
@@ -0,0 +1,198 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/admin/Templates/TBS5ADM001/MasterPage.master" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="admin_guadan_guest_index" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="page_header" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="page_nav" Runat="Server">
|
||||
<nav class="search-bar">
|
||||
<div class="form-item">
|
||||
<label>姓名:</label>
|
||||
<input v-model="search.searchName" type="text" placeholder="请输入姓名">
|
||||
</div>
|
||||
|
||||
<div class="form-item">
|
||||
<label>入住日期:</label>
|
||||
<input v-model="search.date" type="date">
|
||||
</div>
|
||||
|
||||
<div class="form-item">
|
||||
<button @click="handleSearch" type="button">查询</button>
|
||||
<button type="button" @click="clearSearch">清除查询条件</button>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
|
||||
<div>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="guests"
|
||||
:options.sync="options"
|
||||
:server-items-length="total"
|
||||
:loading="loading"
|
||||
hide-default-footer
|
||||
class="elevation-1"
|
||||
>
|
||||
<template v-slot:top>
|
||||
<v-toolbar flat>
|
||||
<v-toolbar-title>入住人列表</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
</v-toolbar>
|
||||
</template>
|
||||
<template #item.checkindate ="{item}">
|
||||
{{item.checkindate|timeString('YYYY-MM-DD')}}
|
||||
</template>
|
||||
<template #item.checkoutdate ="{item}">
|
||||
{{item.checkoutdate|timeString('YYYY-MM-DD')}}
|
||||
</template>
|
||||
</v-data-table>
|
||||
<v-container>
|
||||
<v-row class="align-baseline" wrap>
|
||||
<v-col cols="12" md="9">
|
||||
<v-pagination
|
||||
v-model="options.page"
|
||||
:length="pageCount">
|
||||
</v-pagination>
|
||||
</v-col>
|
||||
<v-col class="text-truncate text-right" cols="12" md="2">
|
||||
共 {{ }} 筆, 頁數:
|
||||
</v-col>
|
||||
<v-col cols="6" md="1">
|
||||
<v-text-field
|
||||
v-model="options.page"
|
||||
type="number"
|
||||
hide-details
|
||||
dense
|
||||
min="1"
|
||||
:max="pageCount"
|
||||
@input="options.page = parseInt($event, 10)"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="offCanvasRight" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="footer_script" Runat="Server">
|
||||
<style>
|
||||
.search-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 10px;
|
||||
background: #f9f9f9;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
input {
|
||||
padding: 4px 8px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 6px 14px;
|
||||
background: #409eff;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background: #66b1ff;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
Vue.filter('timeString', function (value, myFormat) {
|
||||
return value == null || value == "" ? "" : moment(value).format(myFormat || 'YYYY-MM-DD, HH:mm:ss');
|
||||
});
|
||||
new Vue({
|
||||
el: '#app',
|
||||
vuetify: new Vuetify(vuetify_options),
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
search: {
|
||||
searchName: null,
|
||||
|
||||
},
|
||||
options: {
|
||||
page: 1, // 当前页
|
||||
itemsPerPage: 1, // 每页条数
|
||||
sortBy: [],
|
||||
sortDesc: []
|
||||
},
|
||||
headers: [
|
||||
{ text: '姓名', value: 'name' },
|
||||
{ text: '挂单单号', value: 'guadanorderno'},
|
||||
{ text: '入住日期', value: 'checkindate' },
|
||||
{ text: '退房日期', value: 'checkoutdate'},
|
||||
{ text: '房间号', value: 'roomName' },
|
||||
|
||||
],
|
||||
guests: [], // 表格数据
|
||||
total: 0,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
resetTableOptions() {
|
||||
this.options = {
|
||||
page: 1,
|
||||
itemsPerPage: 10,
|
||||
sortBy: [],
|
||||
sortDesc: []
|
||||
};
|
||||
},
|
||||
handleSearch() {
|
||||
this.resetTableOptions();
|
||||
},
|
||||
clearSearch() {
|
||||
this.search.searchName = null;
|
||||
this.resetTableOptions();
|
||||
},
|
||||
fetchGuests() {
|
||||
if (this.loading) return;
|
||||
this.loading = true;
|
||||
axios.post('/api/guadan/guest/query/list',
|
||||
{
|
||||
page: this.options.page,
|
||||
pageSize: this.options.itemsPerPage,
|
||||
searchName: this.search.searchName,
|
||||
date: this.search.date
|
||||
}).then(res => {
|
||||
this.guests = res.data.items; // 数据
|
||||
this.total = res.data.total; // 总数
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
options: {
|
||||
handler() {
|
||||
this.fetchGuests(); // 监听分页、排序变化,自动加载数据
|
||||
},
|
||||
deep: true,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
computed: {
|
||||
pageCount() {
|
||||
return Math.ceil(this.total / this.options.itemsPerPage)
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
14
web/admin/guadan/guest/index.aspx.cs
Normal file
14
web/admin/guadan/guest/index.aspx.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class admin_guadan_guest_index : MyWeb.config
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@
|
||||
})
|
||||
}).catch((error) => {
|
||||
this.$refs.messageModal.open({
|
||||
message: '取消失敗'
|
||||
message: error.response?.data || '取消失敗'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user