|
|
@@ -1,19 +1,143 @@
|
|
|
<template>
|
|
|
- <div>manageHotel</div>
|
|
|
+ <div class="manageHotel-wrapper">
|
|
|
+ <a-tabs>
|
|
|
+ <a-tab-pane tab="录入客房" key="1">
|
|
|
+ <a-form :form="form" style="margin-top: 30px">
|
|
|
+
|
|
|
+ </a-form>
|
|
|
+ </a-tab-pane>
|
|
|
+ <a-tab-pane tab="订单管理" key="2">
|
|
|
+ <a-table
|
|
|
+ :columns="columns"
|
|
|
+ :dataSource="data"
|
|
|
+ bordered
|
|
|
+ >
|
|
|
+ <span slot="price" slot-scope="text">
|
|
|
+ <span>¥{{ text }}</span>
|
|
|
+ </span>
|
|
|
+ <span slot="action" slot-scope="text, record">
|
|
|
+ <a-button type="primary" @click="order(record)">订单详情</a-button>
|
|
|
+ <a-divider type="vertical"></a-divider>
|
|
|
+ <a-button type="danger" @click="order(record)">删除订单</a-button>
|
|
|
+ </span>
|
|
|
+ </a-table>
|
|
|
+ </a-tab-pane>
|
|
|
+ </a-tabs>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import { mapGetters, mapMutations, mapActions } from 'vuex'
|
|
|
+const columns = [
|
|
|
+ {
|
|
|
+ title: '酒店名',
|
|
|
+ dataIndex: 'hotelName',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '入住时间',
|
|
|
+ dataIndex: 'InDate',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '离店时间',
|
|
|
+ dataIndex: 'outDate',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '入住人数',
|
|
|
+ dataIndex: 'peopleNum',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '房价',
|
|
|
+ dataIndex: 'price',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '状态',
|
|
|
+ dataIndex: 'status'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ key: 'action',
|
|
|
+ scopedSlots: { customRender: 'action' },
|
|
|
+ },
|
|
|
+ ];
|
|
|
export default {
|
|
|
name: 'manageHotel',
|
|
|
- data() {
|
|
|
+ data(){
|
|
|
return {
|
|
|
-
|
|
|
+ formLayout: 'horizontal',
|
|
|
+ pagination: {},
|
|
|
+ columns,
|
|
|
+ data: [],
|
|
|
+ form: this.$form.createForm(this, { name: 'manageHotel' }),
|
|
|
}
|
|
|
},
|
|
|
- mounted(){
|
|
|
+ components: {
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters([
|
|
|
+
|
|
|
+ ])
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapActions([
|
|
|
+ 'updateUserInfoById',
|
|
|
+ ]),
|
|
|
+ saveModify() {
|
|
|
+ this.form.validateFields((err, values) => {
|
|
|
+ if (!err) {
|
|
|
+ const data = {
|
|
|
+ username: this.form.getFieldValue('username'),
|
|
|
+ nickname: this.form.getFieldValue('nickname'),
|
|
|
+ email: this.form.getFieldValue('email'),
|
|
|
+ phoneNumber: this.form.getFieldValue('phoneNumber'),
|
|
|
+ gender: this.form.getFieldValue('gender'),
|
|
|
+ address: this.form.getFieldValue('address')
|
|
|
+ }
|
|
|
+ this.updateUserInfoById(data).then(()=>{
|
|
|
+ this.modify = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ modifyInfo() {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.form.setFieldsValue({
|
|
|
+ 'username': this.userInfo.username,
|
|
|
+ 'nickname': this.userInfo.nickname,
|
|
|
+ 'email': this.userInfo.email,
|
|
|
+ 'phoneNumber': this.userInfo.phoneNumber,
|
|
|
+ 'gender': this.userInfo.gender,
|
|
|
+ 'address': this.userInfo.address
|
|
|
+ })
|
|
|
+ }, 0)
|
|
|
+ this.modify = true
|
|
|
+ },
|
|
|
+ cancelModify() {
|
|
|
+ this.modify = false
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-<style scoped>
|
|
|
-
|
|
|
+<style scoped lang="less">
|
|
|
+ .manageHotel-wrapper {
|
|
|
+ padding: 50px;
|
|
|
+ .chart {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-top: 20px
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|
|
|
+<style lang="less">
|
|
|
+ .info-wrapper {
|
|
|
+ .ant-tabs-bar {
|
|
|
+ padding-left: 30px
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|
|
|
+<style lang="less">
|
|
|
+
|
|
|
</style>
|