Explorar el Código

远期房态调整

DESKTOP-B78GIPM\admin hace 2 años
padre
commit
ae0faf34f2
Se han modificado 1 ficheros con 60 adiciones y 6 borrados
  1. 60 6
      src/views/room/forWardFangTaiModal.vue

+ 60 - 6
src/views/room/forWardFangTaiModal.vue

@@ -18,17 +18,25 @@
         </a-form>
     </div>
     <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="tableData" class="j-table-force-nowrap">
+        <template slot="orderNo" slot-scope="text, record">
+            <a href="#" @click="orderDetail(text)">{{text.orderNo}}</a>
+        </template>
         <template slot="status" slot-scope="text, record">
             {{record.isLiving==0?'预定房':'在住房'}}
             <!-- {{text}} -->
         </template>
     </a-table>
+    <BillRoomInfoModal ref="ModalBillRoomInfo" />
 </a-modal>
 </template>
 
 <script>
+import BillRoomInfoModal from '../room/modules/checkIn/BillRoomInfoModal.vue'
 export default {
     name: 'forWardFangTaiModal',
+    components: {
+        BillRoomInfoModal
+    },
     props: {
         // modalTitle: {
         //     type: String,
@@ -47,9 +55,9 @@ export default {
         return {
             tableData: [],
             tableDataCopy: [],
-            modalVisible:false,
-            modalTitle:'今日预离',
-            search:'',
+            modalVisible: false,
+            modalTitle: '今日预离',
+            search: '',
             columns: [{
                     title: "房号",
                     align: "center",
@@ -58,7 +66,10 @@ export default {
                 {
                     title: "单号",
                     align: "center",
-                    dataIndex: "orderNo",
+                    // dataIndex: "orderNo",
+                    scopedSlots: {
+                        customRender: "orderNo"
+                    }
                 },
                 {
                     title: "客人姓名",
@@ -92,10 +103,53 @@ export default {
         }
     },
     methods: {
-        searchQuery(){
+        searchQuery() {
             // this.tableDataCopy = JSON.parse(JSON.stringify(this.tableData))
             this.tableData = this.tableDataCopy.filter(item => item.roomName.includes(this.search))
-        }
+        },
+        orderDetail(text) {
+            console.log(text);
+            // this.$router.push({
+            //     path: '/order/orderDetail/'+text.id,
+            // })
+            if (text.isLiving == 0) {
+                this.modalVisible = false
+                this.$router.push({
+                    name: "room-scheduledetail",
+                    params: {
+                        id: text.orderNo
+                    },
+                });
+            }else{
+                this.handleBillInfo(text)
+            }
+        },
+        handleBillInfo(roomLive) {
+            console.log("handleBillInfo", roomLive);
+            // if (this.timeId) {
+            //     clearTimeout(this.timeId);
+            // }
+            // if (!roomLive.livingData || !roomLive.livingData.livingOrder) {
+            //     if (!roomLive.bookingData || !roomLive.bookingData.bookingOrder) {
+            //         this.handleCheckInAdd(roomLive);
+            //     } else {
+            //         this.$router.push({
+            //             name: "room-scheduledetail",
+            //             params: {
+            //                 id: roomLive.bookingData.bookingOrder.bookingOrdersNo
+            //             },
+            //         });
+            //     }
+            // } else {
+            this.$refs.ModalBillRoomInfo.add(
+                roomLive.bookingOrderId,
+                1
+            );
+            this.$refs.ModalBillRoomInfo.title = "账单";
+            this.$refs.ModalBillRoomInfo.disableSubmit = true;
+            // }
+            // roomLive.roomInfo.state = 0;
+        },
     },
     mounted() {