浏览代码

房务查房 优化调整

DESKTOP-B78GIPM\admin 2 年之前
父节点
当前提交
1f3d5c6ddb

+ 9 - 0
src/views/room/fangtailive.vue

@@ -8,6 +8,7 @@
       <a-tab-pane key="5" tab="物品租借"> </a-tab-pane>
       <a-tab-pane key="6" tab="客人留言"> </a-tab-pane>
       <a-tab-pane key="7" tab="客人物品管理"> </a-tab-pane>
+      <a-tab-pane key="8" tab="房务查房"> </a-tab-pane>
     </a-tabs>
 
     <div
@@ -690,6 +691,11 @@
     <template v-else-if="activeKey === '7'">
       <membergoodsmanage></membergoodsmanage>
     </template>
+
+    <template v-else-if="activeKey === '8'">
+      <fangwuLookRoom />
+    </template>
+
     <upkeep-room-modal ref="modalForm" @ok="modalWxFormOk"></upkeep-room-modal>
     <bill-room-info-modal
       ref="ModalBillRoomInfo"
@@ -753,6 +759,8 @@ import guestorders from "./guestorders";
 import leasegoods from "./leasegoods";
 import membermessage from "./membermessage";
 import membergoodsmanage from "./membergoodsmanage";
+import fangwuLookRoom from './fangwuLookRoom.vue'
+
 import lookRoomModalVue from './modules/fangtaiModal/lookRoomModal/lookRoomModal.vue';
 import continuedModalVue from './modules/fangtaiModal/continuedModal/continuedModal.vue';
 import SelectCheckInRoomOrderModal from "./modules/checkIn/SelectCheckInRoomOrderModal.vue";
@@ -777,6 +785,7 @@ export default {
     calendarfangtai,
     guestorders,
     forwardfangtai,
+    fangwuLookRoom,
     leasegoods,
     membermessage,
     membergoodsmanage,

+ 363 - 0
src/views/room/fangwuLookRoom.vue

@@ -0,0 +1,363 @@
+<template>
+<a-card :bordered="false">
+
+    <a-tabs default-active-key="1">
+        <a-tab-pane key="1" tab="待查房">
+            <!-- 查询区域 -->
+            <div class="table-page-search-wrapper">
+                <a-form layout="inline" @keyup.enter.native="searchQuery">
+                    <a-row :gutter="24">
+
+                        <a-col :span="15">
+                            <a-button @click="cancelRoom" :disabled="setBtnsDisable(4)" type="danger">设置取消查房</a-button>
+                            <a-button @click="setWaitRoom" :disabled="setBtnsDisable(1)" style="margin-left: 8px">设置等待查房</a-button>
+                            <a-button @click="setInRoom" :disabled="setBtnsDisable(2)" style="margin-left: 8px">设置正在查房</a-button>
+                            <a-button @click="setFinishRoom" :disabled="setBtnsDisable(3)" style="margin-left: 8px">设置查房完毕</a-button>
+                            <a-button type="primary" @click="searchQuery" icon="reload" style="margin-left: 8px">刷新</a-button>
+                        </a-col>
+
+                        <a-col :span="3">
+                            <a-form-item label="">
+                                <a-input placeholder="房号" v-model="queryParam.roomName"></a-input>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="3">
+                            <a-form-item label="">
+                                <a-select v-model="queryParam.state" style="width: 100%" placeholder="请选择" allowClear>
+                                    <a-select-option :value="4">取消查房</a-select-option>
+                                    <a-select-option :value="0">待查房</a-select-option>
+                                    <a-select-option :value="1">等待查房</a-select-option>
+                                    <a-select-option :value="2">正在查房</a-select-option>
+                                    <a-select-option :value="3">查房完毕</a-select-option>
+                                </a-select>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="3">
+                            <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
+                                <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+                            </span>
+                        </a-col>
+                    </a-row>
+                </a-form>
+            </div>
+            <!-- 查询区域-END -->
+            <!-- table区域-begin -->
+            <div>
+                <!-- type:'radio' -->
+                <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="ipagination" :loading="loading" :rowSelection="{
+                selectedRowKeys: selectedRowKeys,
+                onChange: onSelectChange,
+                }" class="j-table-force-nowrap" @change="handleTableChange">
+                    <!-- <template slot="name" slot-scope="text, record">
+                        <a @click="handleBillInfo(record)">{{record.contactName}}</a>
+                    </template> -->
+                </a-table>
+            </div>
+        </a-tab-pane>
+        <a-tab-pane key="2" tab="历史查房">
+            <historyLookRoom />
+        </a-tab-pane>
+    </a-tabs>
+
+    <a-modal :title="title" :visible="visibleLook" @cancel="visibleLook = false" @ok="submitOK">
+        <!-- <j-form-container :disabled="false"> -->
+        <a-form-model-item label="服务员" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="status==2">
+            <a-select placeholder="服务员" v-model="waiterId" style="width:40%">
+                <a-select-option :value="item.id" v-for="(item, index) in busWaiterList" :key="item.id">
+                    {{ item.name }}
+                </a-select-option>
+            </a-select>
+        </a-form-model-item>
+        <a-form-model-item label="请输入备注" :labelCol="labelCol" :wrapperCol="wrapperCol" v-else>
+            <a-input v-model="remarks" placeholder="请输入备注"></a-input>
+        </a-form-model-item>
+        <!-- </j-form-container> -->
+    </a-modal>
+</a-card>
+</template>
+
+<script>
+import "@/assets/less/TableExpand.less";
+import {
+    mixinDevice
+} from "@/utils/mixin";
+import {
+    JeecgListMixin
+} from "@/mixins/JeecgListMixin";
+// import BillRoomInfoModal from "./modules/checkIn/BillRoomInfoModal.vue";
+import {
+    httpAction,
+    postAction,
+    getAction
+} from "@/api/manage";
+import historyLookRoom from './historyLookRoom.vue';
+export default {
+    name: "CesOrderMessageList",
+    mixins: [JeecgListMixin, mixinDevice],
+    components: {
+        // BillRoomInfoModal,
+        historyLookRoom
+    },
+    data() {
+        return {
+            title: "",
+            busWaiterList: [],
+            labelCol: {
+                xs: {
+                    span: 24
+                },
+                sm: {
+                    span: 5
+                },
+            },
+            wrapperCol: {
+                xs: {
+                    span: 24
+                },
+                sm: {
+                    span: 16
+                },
+            },
+            waiterId: '',
+            visibleLook: false,
+            status: null,
+            // 表头
+            columns: [{
+                    title: "查房状态",
+                    align: "center",
+                    dataIndex: 'state',
+                    customRender: function (text) {
+                        let txt = "";
+                        switch (text) {
+                            case 0:
+                                txt = "待查房";
+                                break;
+                            case 1:
+                                txt = "等待查房";
+                                break;
+                            case 2:
+                                txt = "正在查房";
+                                break;
+                            case 3:
+                                txt = "查房完毕";
+                                break;
+                            case 4:
+                                txt = "取消查房";
+                                break;
+                            default:
+                                break;
+                        }
+                        return txt;
+                    },
+                },
+                {
+                    title: "房号",
+                    align: "center",
+                    dataIndex: "roomName",
+                },
+                {
+                    title: "客人姓名",
+                    align: "center",
+                    dataIndex: "contactName",
+                    scopedSlots: { customRender: 'name' }
+                },
+                {
+                    title: "查房发起人",
+                    align: "center",
+                    dataIndex: "promoterBy",
+                },
+                {
+                    title: "查房发起时间",
+                    align: "center",
+                    dataIndex: "promoterTime",
+                },
+                {
+                    title: "查房备注",
+                    align: "center",
+                    dataIndex: "remark",
+                },
+                {
+                    title: "查房人",
+                    align: "center",
+                    dataIndex: "cfWaiterName",
+                },
+                {
+                    title: "查房时间",
+                    align: "center",
+                    dataIndex: "cfTime",
+                },
+                {
+                    title: "查房反馈",
+                    align: "center",
+                    dataIndex: "feedback",
+                },
+                {
+                    title: "查房完成人",
+                    align: "center",
+                    dataIndex: "completedBy",
+                },
+                {
+                    title: "查房完成时间",
+                    align: "center",
+                    dataIndex: "completedTime",
+                },
+                {
+                    title: "房间状态",
+                    align: "center",
+                    dataIndex: "roomStatus",
+                }
+            ],
+            url: {
+                list: "/fw/fwRoomExamine/list",
+                delete: "/order/cesOrderMessage/delete",
+                deleteBatch: "/order/cesOrderMessage/deleteBatch",
+                exportXlsUrl: "/order/cesOrderMessage/exportXls",
+                importExcelUrl: "order/cesOrderMessage/importExcel",
+            },
+            dictOptions: {},
+            superFieldList: [],
+            hotelList: [],
+            queryParam: {
+                // type: 1,
+                // livingStatus: -1,
+                // bookingStatus: 1
+            },
+            remarks: "",
+        };
+    },
+    created() {
+        getAction("/business/busWaiter/list", {
+            // hotelId: _info.id,
+            pageNo: 1,
+            pageSize: 99999,
+        }).then((res) => {
+            if (res.success) {
+                this.busWaiterList = res.result.records;
+            }
+        });
+    },
+    computed: {
+        importExcelUrl: function () {
+            return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
+        },
+    },
+    methods: {
+        /**
+         * 根据选中数据设置按钮是否可用
+         */
+        setBtnsDisable(type) {
+            if (this.selectedRowKeys.length === 0) {
+                return true
+            }
+            if (type == 4 && this.selectionRows.some(item => item.state == 1 || item.state == 2)) {
+                return false
+            }
+            if (type == 1 && this.selectionRows.some(item => item.state == 0 || item.state == 4)) {
+                return false
+            }
+            if (type == 2 && this.selectionRows.some(item => item.state == 1)) {
+                return false
+            }
+            if (type == 3 && this.selectionRows.some(item => item.state == 2)) {
+                return false
+            }
+            return true
+        },
+        /**
+         * 设置取消查房
+         */
+        cancelRoom() {
+            // console.log(this.selectionRows);
+            this.status = 4
+            this.selectionRows.forEach(item => {
+                this.editLookRoom(item, 4)
+            })
+            // this.editLookRoom(this.selectionRows.livingOrderId, 4)
+        },
+
+        editLookRoom(data, state, remark = '') {
+
+            // let obj = {
+            //     id: id,
+            //     livingOrderId: livingOrderId,
+            //     state: state,
+            //     remark: remark,
+            //     waiterId: this.waiterId,
+            //     cfTime: this.waiterId?new Date().toLocaleString().replaceAll('/','-'):''
+            // }
+            data.state = state
+            data.remark = remark
+            if (this.status == 2) {
+                data.waiterId = this.waiterId
+                data.cfTime = new Date().toLocaleString().replaceAll('/', '-')
+            }
+            if (this.status == 3) {
+                // data.remark = ''
+                data.feedback = this.remarks
+            }
+            httpAction("/fw/fwRoomExamine/edit", data, 'post').then(res => {
+                    this.confirmLoading = false;
+                    if (res.success) {
+                        this.$message.success("成功");
+                        this.onClearSelected()
+                        this.visibleLook = false
+                        this.loadData()
+                    } else {
+                        this.$message.warning(res.message);
+                    }
+                })
+                .finally(() => {
+                    this.remarks = ''
+                    this.waiterId = ''
+                    this.confirmLoading = false;
+                });
+            console.log('3333333333333333333333333333', this.waiterId, this.remarks);
+        },
+
+        /**
+         * 设置等待查房
+         */
+        setWaitRoom() {
+            this.title = '申请查房'
+            this.status = 1
+            this.visibleLook = true
+        },
+
+        /**
+         * 设置正在查房
+         */
+        setInRoom() {
+            this.title = '设置正在查房'
+            this.waiterId = ''
+            this.status = 2
+            this.visibleLook = true
+        },
+
+        /**
+         * 设置查房完毕
+         */
+        setFinishRoom() {
+            this.title = '查房完毕'
+            this.status = 3
+            this.visibleLook = true
+        },
+
+        /**
+         * 表单提交
+         */
+        submitOK() {
+            this.confirmLoading = true;
+            this.selectionRows.forEach(item => {
+                this.editLookRoom(item, this.status)
+            })
+        },
+        handleBillInfo(data){
+            console.log(data);
+        }
+    },
+};
+</script>
+
+<style scoped>
+@import "~@assets/less/common.less";
+</style>

+ 184 - 0
src/views/room/historyLookRoom.vue

@@ -0,0 +1,184 @@
+<template>
+<a-card :bordered="false">
+            <!-- 查询区域 -->
+            <div class="table-page-search-wrapper">
+                <a-form layout="inline" @keyup.enter.native="searchQuery">
+                    <a-row :gutter="24">
+                        <a-col :span="3">
+                            <a-form-item label="">
+                                <a-input placeholder="房号" v-model="queryParam.roomName"></a-input>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="3">
+                            <a-form-item label="">
+                                <a-select v-model="queryParam.state" style="width: 100%" placeholder="请选择" allowClear>
+                                    <a-select-option :value="4">取消查房</a-select-option>
+                                    <a-select-option :value="0">待查房</a-select-option>
+                                    <a-select-option :value="1">等待查房</a-select-option>
+                                    <a-select-option :value="2">正在查房</a-select-option>
+                                    <a-select-option :value="3">查房完毕</a-select-option>
+                                </a-select>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="6">
+                                <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+                                <a-button :disabled="selectionRows.length==0" type="danger" style="margin-left:20px;" @click="batchDel" icon="search">批量删除</a-button>
+                        </a-col>
+                    </a-row>
+                </a-form>
+            </div>
+            <!-- 查询区域-END -->
+            <!-- table区域-begin -->
+            <div>
+                <!-- type:'radio' -->
+                <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="ipagination" :loading="loading" :rowSelection="{
+                selectedRowKeys: selectedRowKeys,
+                onChange: onSelectChange,
+                }" class="j-table-force-nowrap" @change="handleTableChange">
+                </a-table>
+            </div>
+</a-card>
+</template>
+
+<script>
+import "@/assets/less/TableExpand.less";
+import {
+    mixinDevice
+} from "@/utils/mixin";
+import {
+    JeecgListMixin
+} from "@/mixins/JeecgListMixin";
+// import BillRoomInfoModal from "./modules/checkIn/BillRoomInfoModal.vue";
+import {
+    httpAction,
+    postAction,
+    getAction
+} from "@/api/manage";
+export default {
+    name: "CesOrderMessageList",
+    mixins: [JeecgListMixin, mixinDevice],
+    components: {
+        // BillRoomInfoModal,
+    },
+    data() {
+        return {
+            // 表头
+            columns: [{
+                    title: "查房状态",
+                    align: "center",
+                    dataIndex: 'state',
+                    customRender: function (text) {
+                        let txt = "";
+                        switch (text) {
+                            case 0:
+                                txt = "待查房";
+                                break;
+                            case 1:
+                                txt = "等待查房";
+                                break;
+                            case 2:
+                                txt = "正在查房";
+                                break;
+                            case 3:
+                                txt = "查房完毕";
+                                break;
+                            case 4:
+                                txt = "取消查房";
+                                break;
+                            default:
+                                break;
+                        }
+                        return txt;
+                    },
+                },
+                {
+                    title: "房号",
+                    align: "center",
+                    dataIndex: "roomName",
+                },
+                {
+                    title: "客人姓名",
+                    align: "center",
+                    dataIndex: "contactName",
+                },
+                {
+                    title: "查房发起人",
+                    align: "center",
+                    dataIndex: "promoterBy",
+                },
+                {
+                    title: "查房发起时间",
+                    align: "center",
+                    dataIndex: "promoterTime",
+                },
+                {
+                    title: "查房备注",
+                    align: "center",
+                    dataIndex: "remark",
+                },
+                {
+                    title: "查房人",
+                    align: "center",
+                    dataIndex: "cfWaiterName",
+                },
+                {
+                    title: "查房时间",
+                    align: "center",
+                    dataIndex: "cfTime",
+                },
+                {
+                    title: "查房反馈",
+                    align: "center",
+                    dataIndex: "feedback",
+                },
+                {
+                    title: "查房完成人",
+                    align: "center",
+                    dataIndex: "completedBy",
+                },
+                {
+                    title: "查房完成时间",
+                    align: "center",
+                    dataIndex: "completedTime",
+                },
+                {
+                    title: "房间状态",
+                    align: "center",
+                    dataIndex: "roomStatus",
+                }
+            ],
+            url: {
+                list: "/fw/fwRoomExamine/list",
+                delete: "/fw/fwRoomExamine/delete",
+                deleteBatch: "/fw/fwRoomExamine/deleteBatch",
+            },
+            queryParam: {
+                // type: 1,
+                // livingStatus: -1,
+                // bookingStatus: 1
+            },
+        };
+    },
+    created() {
+        getAction("/business/busWaiter/list", {
+            // hotelId: _info.id,
+            pageNo: 1,
+            pageSize: 99999,
+        }).then((res) => {
+            if (res.success) {
+                this.busWaiterList = res.result.records;
+            }
+        });
+    },
+    computed: {
+        
+    },
+    methods: {
+
+    },
+};
+</script>
+
+<style scoped>
+@import "~@assets/less/common.less";
+</style>

+ 29 - 29
src/views/room/modules/fangtaiModal/continuedModal/continuedForm.vue

@@ -184,7 +184,7 @@ export default {
                 for (let i = 0; i < arr.length; i++) {
                     arr[i] = {
                         day: this.addDate(this.model.livingData.livingOrder.dueOutTime, i),
-                        price: 0,
+                        price: this.model.layout.marketPrice,
                     };
                 }
                 this.PriceData = arr;
@@ -205,7 +205,7 @@ export default {
                 for (let i = 0; i < arr.length; i++) {
                     arr[i] = {
                         day: this.addDate(this.model.livingData.livingOrder.dueOutTime, i),
-                        price: 0,
+                        price: this.model.layout.marketPrice,
                     };
                 }
                 this.PriceData = arr;
@@ -223,33 +223,33 @@ export default {
         }
         //备份model原始值
         this.modelDefault = JSON.parse(JSON.stringify(this.model));
-        getAction("/pos/posType/list", {
-            hotelId: _info.id,
-            pageNo: 1,
-            pageSize: 100,
-        }).then((res) => {
-            if (res.success) {
-                this.posTypeList = res.result.records;
-            }
-        });
-        getAction("/pos/posTableType/list", {
-            hotelId: _info.id,
-            pageNo: 1,
-            pageSize: 100,
-        }).then((res) => {
-            if (res.success) {
-                this.tableTypeList = res.result.records;
-            }
-        });
-        getAction("/pos/posRegion/list", {
-            hotelId: _info.id,
-            pageNo: 1,
-            pageSize: 100,
-        }).then((res) => {
-            if (res.success) {
-                this.regionList = res.result.records;
-            }
-        });
+        // getAction("/pos/posType/list", {
+        //     hotelId: _info.id,
+        //     pageNo: 1,
+        //     pageSize: 100,
+        // }).then((res) => {
+        //     if (res.success) {
+        //         this.posTypeList = res.result.records;
+        //     }
+        // });
+        // getAction("/pos/posTableType/list", {
+        //     hotelId: _info.id,
+        //     pageNo: 1,
+        //     pageSize: 100,
+        // }).then((res) => {
+        //     if (res.success) {
+        //         this.tableTypeList = res.result.records;
+        //     }
+        // });
+        // getAction("/pos/posRegion/list", {
+        //     hotelId: _info.id,
+        //     pageNo: 1,
+        //     pageSize: 100,
+        // }).then((res) => {
+        //     if (res.success) {
+        //         this.regionList = res.result.records;
+        //     }
+        // });
         getAction("/business/busRoomPayType/list", {
             pageSize: 99999,
             pageNo: 1,

+ 73 - 37
src/views/room/modules/fangtaiModal/exchangeHouses/exchangeHousesForm.vue

@@ -5,23 +5,6 @@
             <j-form-container :disabled="formDisabled">
                 <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
                     <a-row>
-                        <!-- <a-col :span="24">
-                            <a-form-model-item label="续住总价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
-                                {{PriceData.reduce((pre,cur)=> pre+cur.price*1,0 ) || 0}}
-                                <a-popover placement="right" v-if="dayNum>0">
-                                    <template slot="content">
-
-                                    </template>
-                                    <template slot="title">
-                                        <a-input-number :min="0" @change="batchPrice" placeholder="批量改价"></a-input-number>
-                                    </template>
-                                    <a-icon type="edit" />
-                                </a-popover>
-                                <template v-else>
-                                    <a-icon type="edit" />
-                                </template>
-                            </a-form-model-item>
-                        </a-col> -->
                         <a-col :span="24">
                             <a-form-model-item label="原房间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
                                 <!-- {{ model.livingData && model.livingData.livingOrder && model.livingData.livingOrder.arrivalTime || ''}} -->
@@ -31,33 +14,52 @@
                         <a-col :span="24">
                             <a-form-model-item label="房价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
                                 <!-- {{ model.livingData && model.livingData.livingOrder && model.livingData.livingOrder.dueOutTime || ''}} -->
-                                {{ model.roomInfo && model.layout.marketPrice}}
+                                {{ model.roomInfo && model.livingData.price.reduce((pre,cur)=> pre+cur.price*1,0) || 0}} / {{ model.roomInfo && model.layout.marketPrice || 0}}
+                                <a-popover placement="right">
+                                    <template slot="content" v-if="model.livingData">
+                                        <div style="max-height:400px;overflow:auto;width:100%;">
+                                            <div v-for="(item, index) in model.livingData.price" :key="index">
+                                                {{item.dayTime}}
+                                                <a-input-number disabled :min="0" v-model="item.price"></a-input-number>
+                                            </div>
+                                        </div>
+                                    </template>
+                                    <template slot="title">
+                                    </template>
+                                    <a-icon type="eye" />
+                                </a-popover>
                             </a-form-model-item>
                         </a-col>
                         <a-col :span="24">
                             <a-form-model-item label="新房间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
                                 <template v-if="selectData.length>0">
-                                    {{newRoom.roomInfo && newRoom.roomInfo.name}}
+                                    {{newRoom && newRoom.roomInfo.name}}
                                 </template> <a href="#" @click="selectVisible = true">选择</a>
                             </a-form-model-item>
                         </a-col>
                         <a-col :span="24">
                             <a-form-model-item label="房价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
                                 <!-- <a-input-number :min="0" v-model="dayNum" placeholder="请输入续住天数" style="width: 40%" @change="dayChange" /> -->
-                                {{ timeData.reduce((pre,cur)=> pre+cur.price*1,0) }}
-                                <a-popover placement="right" v-if="newRoom.roomInfo">
-                                    <template slot="content">
-                                        <div style="max-height:400px;overflow:auto;width:100%;">
-                                            <div v-for="(item, index) in timeData" :key="index">
-                                                {{item.day}}
-                                                <a-input-number :min="0" v-model="item.price"></a-input-number>
+                                <template v-if="newRoom && newRoom.roomInfo">
+                                    {{ timeData.reduce((pre,cur)=> pre+cur.price*1,0) }}
+                                    <a-popover placement="right">
+                                        <template slot="content">
+                                            <div style="max-height:400px;overflow:auto;width:100%;">
+                                                <div v-for="(item, index) in timeData" :key="index">
+                                                    {{item.day}}
+                                                    <a-input-number :disabled="daysBetweenCopy(item.day)" :min="0" v-model="item.price"></a-input-number>
+                                                </div>
                                             </div>
-                                        </div>
-                                    </template>
-                                    <template slot="title">
-                                    </template>
+                                        </template>
+                                        <template slot="title">
+                                        </template>
+                                        <a-icon type="edit" />
+                                    </a-popover>
+                                </template>
+                                <template v-else>
+                                    0
                                     <a-icon type="edit" />
-                                </a-popover>
+                                </template>
                             </a-form-model-item>
                         </a-col>
                         <a-col :span="24">
@@ -73,7 +75,7 @@
         <!-- <a-tab-pane key="2" tab="换房记录"></a-tab-pane> -->
     </a-tabs>
 
-    <a-modal :title="'选择房间'" :visible="selectVisible" @cancel="selectVisible = false" @ok="changeSelct">
+    <a-modal :title="'选择房间'" :width="800" :visible="selectVisible" @cancel="selectVisible = false" @ok="changeSelct">
         <a-row>
             <a-col :span="24">
                 <a-form-model-item label="房型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
@@ -97,7 +99,7 @@
 
             </a-col>
             <a-col :span="24" v-if="dataList.length>0">
-                <div style="display:flex;flex-wrap:wrap;">
+                <div style="display:flex;flex-wrap:wrap;height:400px;overflow: auto;">
                     <div v-for="(item,index) in dataList" :key="index" @click="selectRoom(item, index)" :class="{'active':index==link}" style="border:1px solid #ccc;padding: 5px 20px;margin-right:10px;margin-top:10px;border-radius:5px;">
                         {{ item.roomInfo && item.roomInfo.name}}
                     </div>
@@ -210,7 +212,7 @@ export default {
             oldRoomList: [],
             dataList: [],
             selectData: [],
-            newRoom: {},
+            newRoom: null,
             timeData: [],
         };
     },
@@ -272,6 +274,9 @@ export default {
                 return
             }
             this.newRoom = this.selectData[0]
+            this.timeData.forEach(ele=>{
+                ele.price = this.newRoom.layout.marketPrice
+            })
             this.selectVisible = false;
         },
         /**
@@ -306,11 +311,36 @@ export default {
             //     return
             // }
             const diffDays = Math.round(Math.abs((firstDate - secondDate) / oneDay));
-            if (diffDays<0) {
+            if (diffDays < 0) {
                 diffDays = 1
             }
             return diffDays;
         },
+        //比较两个日期大小
+        daysBetweenCopy(date1) {
+            const oneDay = 24 * 60 * 60 * 1000; // hours*minutes*seconds*milliseconds
+            const firstDate = new Date(date1);
+            const secondDate = new Date();
+            // const diffDays = Math.round(Math.abs((firstDate - secondDate) / oneDay));
+            if (firstDate.getFullYear() >= secondDate.getFullYear()) {
+                return false;
+            } else if (firstDate.getFullYear() < secondDate.getFullYear()) {
+                return true;
+            } else {
+                if (firstDate.getMonth() >= secondDate.getMonth()) {
+                    return false;
+                } else if (firstDate.getMonth() < secondDate.getMonth()) {
+                    return true;
+                } else {
+                    if (firstDate.getDate() >= secondDate.getDate()) {
+                        return false;
+                    } else if (firstDate.getDate() < secondDate.getDate()) {
+                        return true;
+                    }
+                }
+            }
+            // return diffDays < 0 ? true : false;
+        },
         selectRoom(e, idx) {
             console.log(e);
             this.link = idx
@@ -394,10 +424,12 @@ export default {
             arr.length = this.daysBetween(record.livingData.livingOrder.dueOutTime, record.livingData.livingOrder.arrivalTime)
             for (let i = 0; i < arr.length; i++) {
                 arr[i] = {
-                    day: this.addDate(this.model.livingData.livingOrder.dueOutTime, i),
-                    price: 0,
+                    day: this.addDate(record.livingData.livingOrder.arrivalTime, i),
+                    // price: this.model.layout.marketPrice,
+                    price:0
                 };
             }
+            console.log(arr);
             this.timeData = arr
             this.visible = true;
         },
@@ -416,6 +448,10 @@ export default {
                     //     httpurl += this.url.edit;
                     //     method = "put";
                     // }
+                    if (!this.newRoom || !this.newRoom.roomInfo) {
+                        this.$message.warning("请选择新房间");
+                        return
+                    }
                     let prices = this.timeData.map(item => {
                         return {
                             dayTime: item.day,

+ 58 - 33
src/views/room/modules/fangtaiModal/lookRoomModal/lookRoomTable.vue

@@ -3,7 +3,11 @@
     <j-form-container>
         <a-table :dataSource="dataSource" :columns="columns" :pagination="false">
             <template slot="action" slot-scope="text, record">
-                <a @click="handleLookRoom()">申请查房</a>
+                <a v-if="record.state==0 || record.state==4" @click="handleLookRoom(record)">申请查房</a>
+                <a v-if="record.state==1" @click="cancelRoom(record)">取消查房</a>
+            </template>
+            <template slot="livingStatus">
+                正常入住
             </template>
         </a-table>
     </j-form-container>
@@ -65,11 +69,37 @@ export default {
             }, {
                 title: '入住状态',
                 align: "center",
-                dataIndex: 'createBy'
+                dataIndex: '',
+                scopedSlots: {
+                    customRender: 'livingStatus'
+                },
             }, {
                 title: '查房状态',
                 align: "center",
                 dataIndex: 'state',
+                customRender: function (text) {
+                    let txt = "";
+                    switch (text) {
+                        case 0:
+                            txt = "待查房";
+                            break;
+                        case 1:
+                            txt = "等待查房";
+                            break;
+                        case 2:
+                            txt = "正在查房";
+                            break;
+                        case 3:
+                            txt = "查房完毕";
+                            break;
+                        case 4:
+                            txt = "取消查房";
+                            break;
+                        default:
+                            break;
+                    }
+                    return txt;
+                },
                 //   sorter: true
             }, {
                 title: '操作',
@@ -150,7 +180,8 @@ export default {
             },
             posTypeList: [],
             tableTypeList: [],
-            regionList: []
+            regionList: [],
+            selectData:null,
         };
     },
     computed: {
@@ -165,34 +196,6 @@ export default {
         }
         //备份model原始值
         this.modelDefault = JSON.parse(JSON.stringify(this.model));
-        getAction("/pos/posType/list", {
-            hotelId: _info.id,
-            pageNo: 1,
-            pageSize: 100,
-        }).then((res) => {
-            if (res.success) {
-                this.posTypeList = res.result.records;
-                // this.model.posTypeId = this.posTypeList[0].id;
-            }
-        });
-        getAction("/pos/posTableType/list", {
-            hotelId: _info.id,
-            pageNo: 1,
-            pageSize: 100,
-        }).then((res) => {
-            if (res.success) {
-                this.tableTypeList = res.result.records;
-            }
-        });
-        getAction("/pos/posRegion/list", {
-            hotelId: _info.id,
-            pageNo: 1,
-            pageSize: 100,
-        }).then((res) => {
-            if (res.success) {
-                this.regionList = res.result.records;
-            }
-        });
     },
     methods: {
         add() {
@@ -219,12 +222,15 @@ export default {
             this.confirmLoading = true;
             console.log(this.model);
             httpAction("/fw/fwRoomExamine/edit", {
-                livingOrderId: this.model.roomInfo.livingOrderId,
-                remark: this.model.remarks
+                id: this.selectData.id,
+                livingOrderId: this.selectData.livingOrderId,
+                remark: this.model.remarks,
+                state: 1,
             },'post').then(res => {
                 this.confirmLoading = false;
                 if (res.success) {
                     this.$message.success("申请成功");
+                    this.loadData()
                     this.visibleLook = false;
                 } else {
                     this.$message.warning(res.message);
@@ -232,8 +238,27 @@ export default {
             })
         },
         handleLookRoom(record) {
+            console.log(record);
+            this.selectData = record
             this.visibleLook = true;
         },
+        cancelRoom(record){
+            this.confirmLoading = true;
+            httpAction("/fw/fwRoomExamine/edit", {
+                id: record.id,
+                livingOrderId: record.livingOrderId,
+                // remark: record.remarks,
+                state: 4,
+            },'post').then(res => {
+                this.confirmLoading = false;
+                if (res.success) {
+                    this.$message.success("取消成功");
+                    this.loadData()
+                } else {
+                    this.$message.warning(res.message);
+                }
+            })
+        }
     },
 };
 </script>