gqx il y a 2 ans
Parent
commit
ca63e4b7b9

+ 18 - 10
src/views/room/fangtailive.vue

@@ -14,7 +14,7 @@
       v-if="activeKey === '1'"
       style="display: flex; height: calc(100vh - 240px)"
     >
-      <div style="width: 80%;" class="course-week">
+      <div style="width: 80%" class="course-week">
         <div style="display: flex; flex-direction: column">
           <div style="display: flex; gap: 5px">
             <a-dropdown>
@@ -408,7 +408,7 @@
     ></bill-room-info-modal>
     <bill-room-form-modal
       ref="ModalBillRoomForm"
-      @ok="modalFormOk"
+      @ok="modalBillRoomFormOk"
     ></bill-room-form-modal>
     <schedule-room-modal
       ref="ModalScheduleRoom"
@@ -438,8 +438,8 @@ import ScheduleTeamRoomModal from "./modules/scheduleTeam/ScheduleRoomModal.vue"
 import EditScheduleRoomModal from "./modules/schedule/EditScheduleRoomModal.vue";
 import calendarfangtai from "./calendarfangtai";
 import forwardfangtai from "./forwardfangtai";
-import guestorders from './guestorders'
-import leasegoods from './leasegoods'
+import guestorders from "./guestorders";
+import leasegoods from "./leasegoods";
 import { TreeSelect } from "ant-design-vue";
 const SHOW_PARENT = TreeSelect.SHOW_PARENT;
 const treeData = [
@@ -803,10 +803,10 @@ export default {
           });
         });
       });
-      if (selectRoom.length === 0) {
-        this.$message.warning("请先选择房间");
-        return;
-      }
+      // if (selectRoom.length === 0) {
+      //   this.$message.warning("请先选择房间");
+      //   return;
+      // }
       this.$refs.ModalBillRoomForm.addList(selectRoom);
       this.$refs.ModalBillRoomForm.title = "入住登记";
       this.$refs.ModalBillRoomForm.disableSubmit = false;
@@ -838,14 +838,16 @@ export default {
       }, 100);
     },
     handleBillInfo(roomLive) {
-      console.log("handleBillInfo");
+      console.log("handleBillInfo",roomLive.detail.status);
       if (this.timeId) {
         clearTimeout(this.timeId);
       }
       if (roomLive.detail.status === 0) {
         this.handleCheckInAdd(roomLive);
       } else {
-        this.$refs.ModalBillRoomInfo.add();
+        var e = "YD20230406181756590";
+        console.log(e)
+        this.$refs.ModalBillRoomInfo.add(e);
         this.$refs.ModalBillRoomInfo.title = "账单";
         this.$refs.ModalBillRoomInfo.disableSubmit = true;
       }
@@ -890,6 +892,12 @@ export default {
       this.$refs.modalForm.title = "维修";
       this.$refs.modalForm.disableSubmit = false;
     },
+    modalBillRoomFormOk(e) {
+      console.log("e", e);
+      this.$refs.ModalBillRoomInfo.add(e);
+      this.$refs.ModalBillRoomInfo.title = "账单";
+      this.$refs.ModalBillRoomInfo.disableSubmit = true;
+    },
     modalFormOk(e) {
       console.log("e", e);
       // this.loadData();

Fichier diff supprimé car celui-ci est trop grand
+ 593 - 123
src/views/room/modules/checkIn/BillRoomForm.vue


+ 3 - 3
src/views/room/modules/checkIn/BillRoomFormModal.vue

@@ -24,7 +24,7 @@ export default {
   data() {
     return {
       title: "",
-      width: 1200,
+      width: 1300,
       visible: false,
       disableSubmit: false,
     };
@@ -55,8 +55,8 @@ export default {
     handleOk() {
       this.$refs.realForm.submitForm();
     },
-    submitCallback() {
-      this.$emit("ok");
+    submitCallback(e) {
+      this.$emit("ok",e);
       this.visible = false;
     },
     handleCancel() {

+ 265 - 97
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -28,99 +28,166 @@
           </div>
         </div>
         <a-divider />
-
-        <a-descriptions :column="2">
-          <a-descriptions-item label="主客姓名">
-            张三
-            <a-icon
-              type="edit"
-              style="color: rgba(255, 141, 26, 1); font-size: 18px"
-          /></a-descriptions-item>
-          <a-descriptions-item label="房间数量"> 3间 </a-descriptions-item>
-          <a-descriptions-item label="手机号">
-            1588888888
-            <a-icon
-              type="edit"
-              style="color: rgba(255, 141, 26, 1); font-size: 18px"
-          /></a-descriptions-item>
-          <a-descriptions-item label="房间号"> 8888/9999 </a-descriptions-item>
-          <a-descriptions-item label="宾客类型">
-            散客
-            <a-icon
-              type="edit"
-              style="color: rgba(255, 141, 26, 1); font-size: 18px"
-          /></a-descriptions-item>
-          <a-descriptions-item label="入住时间">
-            2023-03-21 18:55
-          </a-descriptions-item>
-          <a-descriptions-item label="房价方案">
-            会员京卡折扣
-          </a-descriptions-item>
-          <a-descriptions-item label="预离时间">
-            2023-03-21 18:55
-          </a-descriptions-item>
-          <a-descriptions-item label="订单来源">
-            美团
-            <a-icon
-              type="edit"
-              style="color: rgba(255, 141, 26, 1); font-size: 18px"
-          /></a-descriptions-item>
-          <a-descriptions-item label="已住时长"> 3天 </a-descriptions-item>
-          <a-descriptions-item label="外部单号">
-            MT8888888888
-          </a-descriptions-item>
-          <a-descriptions-item label="销售员工">
-            无
-            <a-icon
-              type="edit"
-              style="color: rgba(255, 141, 26, 1); font-size: 18px"
-          /></a-descriptions-item>
-          <a-descriptions-item label="订单备注" :span="2">
-            该房间打碎玻璃杯1只,应赔付80元<a-icon
-              type="edit"
-              style="color: rgba(255, 141, 26, 1); font-size: 18px"
-            />
-          </a-descriptions-item>
-          <a-descriptions-item
-            label="叫醒服务"
-            :span="2"
-            v-for="(item, index) in wakeList"
-            :key="index"
+        <a-tabs>
+          <a-tab-pane
+            :key="item.id"
+            :tab="item.roomName"
+            v-for="(item, livingIndex) in model.livingRoomIds"
           >
-            <a-select
-              style="width: 100px"
-              placeholder="房间号"
-              @change="onChange"
-            >
-              <a-select-option value="jack"> 1001 </a-select-option>
-              <a-select-option value="lucy"> 1002 </a-select-option>
-            </a-select>
-            <a-date-picker
-              style="width: 120px; margin-left: 2px"
-              placeholder="日期"
-              @change="onChange"
-            />
-            <a-time-picker
-              style="width: 100px; margin-left: 2px"
-              :default-value="moment('12:08', 'HH:mm')"
-              format="HH:mm"
-            />
-            <a-icon
-              v-if="wakeList.length - 1 == index"
-              type="plus-circle"
-              class="dynamic-delete-button"
-              @click="puls()"
-            />
-            <a-icon
-              type="minus-circle"
-              style="color: #f56c6c"
-              class="dynamic-delete-button"
-              v-if="wakeList.length > 1"
-              @click="() => remove(index)"
-            />
-          </a-descriptions-item>
-        </a-descriptions>
-        <h4
+            <a-descriptions :column="2">
+              <a-descriptions-item label="主客姓名">
+                {{ item.livingCustomers[0].customerName }}
+                <a-icon
+                  type="edit"
+                  style="color: rgba(255, 141, 26, 1); font-size: 18px"
+              /></a-descriptions-item>
+              <a-descriptions-item label="性别">
+                {{
+                  item.livingCustomers[0].gender === 1 ? "男" : "女"
+                }}</a-descriptions-item
+              >
+              <a-descriptions-item label="房间数量">
+                {{ livingIndex == 0 ? model.livingRoomIds.length : 1 }}间
+              </a-descriptions-item>
+              <a-descriptions-item label="手机号">
+                {{ item.livingCustomers[0].phone }}
+                <a-icon
+                  type="edit"
+                  style="color: rgba(255, 141, 26, 1); font-size: 18px"
+              /></a-descriptions-item>
+
+              <a-descriptions-item label="宾客类型">
+                {{ customerTypeName(model.orderInfo.customerType) }}
+                <a-icon
+                  type="edit"
+                  style="color: rgba(255, 141, 26, 1); font-size: 18px"
+              /></a-descriptions-item>
+              <a-descriptions-item label="入住时间">
+                {{ model.orderInfo.arrivalTime }}
+              </a-descriptions-item>
+              <a-descriptions-item label="房价方案"> -- </a-descriptions-item>
+              <a-descriptions-item label="预离时间">
+                {{ model.orderInfo.dueOutTime }}
+              </a-descriptions-item>
+              <a-descriptions-item label="订单来源">
+                {{ customerSourceName(model.orderInfo.customerSource) }}
+                <a-icon
+                  type="edit"
+                  style="color: rgba(255, 141, 26, 1); font-size: 18px"
+              /></a-descriptions-item>
+              <a-descriptions-item label="入住类型">
+                {{ model.orderInfo.bookingType == 1 ? "全天" : "钟点" }}
+              </a-descriptions-item>
+              <a-descriptions-item label="入住天数">
+                {{ model.orderInfo.dayCount }}
+              </a-descriptions-item>
+              <a-descriptions-item label="早餐券">
+                {{ model.orderInfo.breakfastNum }}
+              </a-descriptions-item>
+              <a-descriptions-item label="外部单号">
+                {{ model.orderInfo.outerOrdersNo }}
+              </a-descriptions-item>
+              <a-descriptions-item label="销售员工">
+                {{ warranterName(model.orderInfo.warranter) }}
+                <a-icon
+                  type="edit"
+                  style="color: rgba(255, 141, 26, 1); font-size: 18px"
+              /></a-descriptions-item>
+              <a-descriptions-item label="订单备注" :span="2">
+                {{ model.orderInfo.remark
+                }}<a-icon
+                  type="edit"
+                  style="color: rgba(255, 141, 26, 1); font-size: 18px"
+                />
+              </a-descriptions-item>
+              <a-descriptions-item
+                label="叫醒服务"
+                :span="2"
+                v-for="(item, index) in wakeList"
+                :key="index"
+              >
+                <a-select
+                  style="width: 100px"
+                  placeholder="房间号"
+                  @change="onChange"
+                >
+                  <a-select-option value="jack"> 1001 </a-select-option>
+                  <a-select-option value="lucy"> 1002 </a-select-option>
+                </a-select>
+                <a-date-picker
+                  style="width: 120px; margin-left: 2px"
+                  placeholder="日期"
+                  @change="onChange"
+                />
+                <a-time-picker
+                  style="width: 100px; margin-left: 2px"
+                  :default-value="moment('12:08', 'HH:mm')"
+                  format="HH:mm"
+                />
+                <a-icon
+                  v-if="wakeList.length - 1 == index"
+                  type="plus-circle"
+                  class="dynamic-delete-button"
+                  @click="puls()"
+                />
+                <a-icon
+                  type="minus-circle"
+                  style="color: #f56c6c"
+                  class="dynamic-delete-button"
+                  v-if="wakeList.length > 1"
+                  @click="() => remove(index)"
+                />
+              </a-descriptions-item>
+            </a-descriptions>
+            <div style="display: flex; justify-content: space-between">
+              <h4
+                style="
+                  color: rgba(255, 141, 26, 1);
+                  font-weight: 600;
+                  margin-top: 15px;
+                "
+              >
+                同住人
+              </h4>
+              <div style="display: flex">
+                <div style="display: flex; flex-direction: column">
+                  <a-icon
+                    type="user-add"
+                    style="color: rgba(255, 141, 26, 1); font-size: 18px"
+                  /><a-button
+                    type="link"
+                    @click="addlivingCustomer(item.livingOrder.id, item.roomId)"
+                  >
+                    添加
+                  </a-button>
+                </div>
+              </div>
+            </div>
+            <div id="livingCustomers-grid">
+              <a-row
+                v-for="(customer, index) in item.livingCustomers"
+                :key="customer.id"
+              >
+                <template v-if="index > 0">
+                  <a-col :span="7"> {{ customer.customerName }} </a-col>
+                  <a-col :span="1"
+                    >{{ customer.gender == 1 ? "男" : "女" }}
+                  </a-col>
+                  <a-col :span="8"> {{ customer.certNo }}</a-col>
+                  <a-col :span="6"> {{ customer.phone }}</a-col>
+                  <a-col :span="2">
+                    <a-icon
+                      type="minus-circle"
+                      style="color: #f56c6c"
+                      class="dynamic-delete-button"
+                      @click="() => removeLivingCustomer(customer.id)"
+                  /></a-col>
+                </template>
+              </a-row>
+            </div>
+          </a-tab-pane>
+        </a-tabs>
+        <!-- <h4
           style="
             color: rgba(255, 141, 26, 1);
             font-weight: 600;
@@ -140,7 +207,7 @@
           <a-descriptions-item label="会员级别"> 金卡 </a-descriptions-item>
           <a-descriptions-item label="余额"> 3000.00元 </a-descriptions-item>
           <a-descriptions-item label="积分"> 888888分 </a-descriptions-item>
-        </a-descriptions>
+        </a-descriptions> -->
       </div>
       <div style="width: 40%">
         <div style="display: flex; justify-content: space-between">
@@ -268,13 +335,15 @@
         >
       </div>
     </div>
+    <customer-modal ref="modalCustomerForm" @ok="modalFormOk"></customer-modal>
   </div>
 </template>
 
 <script>
-import { httpAction, getAction } from "@/api/manage";
+import { httpAction, getAction, deleteAction } from "@/api/manage";
 import { validateDuplicateValue } from "@/utils/util";
 import moment from "moment";
+import CustomerModal from "./CustomerModal.vue";
 const columns = [
   // {
   //     title: "",
@@ -358,9 +427,11 @@ for (let i = 0; i < 8; i++) {
     amount: 888,
   });
 }
+const date = new Date();
+const endDate = new Date(date.setDate(date.getDate() + 1));
 export default {
   name: "BusMeetingRoomForm",
-  components: {},
+  components: { CustomerModal },
   props: {
     //表单禁用
     disabled: {
@@ -377,7 +448,13 @@ export default {
       data2,
       columns2,
       wakeList: [{}],
-      model: {},
+      model: {
+        // data: data,
+        orderInfo: {},
+        roomIds: [],
+        layoutDayPrices: [],
+        livingRoomIds: [],
+      },
       labelCol: {
         xs: { span: 24 },
         sm: { span: 5 },
@@ -395,7 +472,12 @@ export default {
         add: "/business/busMeetingRoom/add",
         edit: "/business/busMeetingRoom/edit",
         queryById: "/business/busMeetingRoom/queryById",
+        getBookingOrderInfo:
+          "/business/busRoomBookingOrders/getBookingOrderInfo",
       },
+      id: "",
+      customerSourceList: [],
+      warranterList: [],
     };
   },
   computed: {
@@ -410,8 +492,85 @@ export default {
     }
     //备份model原始值
     this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    getAction("/business/busDictItem/list", {
+      hotelId: _info.id,
+      dictId: "1639538915239743490",
+    }).then((res) => {
+      if (res.success) {
+        this.customerSourceList = res.result.records;
+      }
+    });
+    getAction("/business/busSalesPerson/list", {
+      hotelId: _info.id,
+      pageNo: 1,
+      pageSize: 100,
+    }).then((res) => {
+      if (res.success) {
+        this.warranterList = res.result.records;
+      }
+    });
   },
   methods: {
+    removeLivingCustomer(id) {
+      deleteAction("/business/busLivingCustomer/delete", { id: id }).then(
+        (res) => {
+          if (res.success) {
+            this.getBookingOrderInfo();
+          }
+        }
+      );
+    },
+    addlivingCustomer(id, roomId) {
+      console.log(id);
+      this.$refs.modalCustomerForm.add(id, roomId);
+      this.$refs.modalCustomerForm.title = "添加同住人";
+      this.$refs.modalCustomerForm.disableSubmit = false;
+    },
+    modalFormOk(e) {
+      this.getBookingOrderInfo();
+    },
+    customerTypeName(customerType) {
+      switch (customerType) {
+        case 1:
+          return "散客";
+        case 2:
+          return "会员";
+        case 3:
+          return "协议单位";
+        case 4:
+          return "中介";
+        default:
+          return "散客";
+      }
+    },
+    warranterName(warranter) {
+      var find = this.warranterList.find((t) => t.id == warranter);
+      return find ? find.name : "--";
+    },
+    customerSourceName(customerSource) {
+      var find = this.customerSourceList.find((t) => t.id == customerSource);
+      return find ? find.itemText : "--";
+    },
+    getBookingOrderInfo() {
+      getAction(this.url.getBookingOrderInfo, {
+        bookingNo: this.id,
+      }).then((res) => {
+        if (res.success) {
+          var livingRoomId = JSON.parse(
+            JSON.stringify(res.result.livingRoomIds[0])
+          );
+          livingRoomId.id = "1";
+          livingRoomId.roomName = "全部";
+          var list = [];
+          res.result.livingRoomIds.forEach((t) => {
+            list = [...list, ...t.livingCustomers];
+          });
+          livingRoomId.livingCustomers = list;
+          res.result.livingRoomIds.unshift(livingRoomId);
+          this.model = res.result;
+        }
+      });
+    },
     onSelectChange(selectedRowKeys, selectionRows) {
       this.selectedRowKeys = selectedRowKeys;
       this.selectionRows = selectionRows;
@@ -427,8 +586,10 @@ export default {
     onChange(e) {
       console.log(e);
     },
-    add() {
+    add(id) {
+      this.id = id;
       this.edit(this.modelDefault);
+      this.getBookingOrderInfo();
     },
     edit(record) {
       this.model = Object.assign({}, record);
@@ -513,4 +674,11 @@ export default {
   padding: 5px 5px !important;
   overflow-wrap: break-word;
 }
+
+#livingCustomers-grid [class~="ant-col"] {
+  border: #ccc 1px solid;
+}
+#livingCustomers-grid [class~="ant-col"]:last-child {
+  border: 0;
+}
 </style>

+ 3 - 2
src/views/room/modules/checkIn/BillRoomInfoModal.vue

@@ -98,10 +98,11 @@
       }
     },
     methods: {
-      add () {
+      add (id) {
+        console.log("id",id)
         this.visible=true
         this.$nextTick(()=>{
-          this.$refs.realForm.add();
+          this.$refs.realForm.add(id);
         })
       },
       edit (record) {

+ 236 - 0
src/views/room/modules/checkIn/CustomerForm.vue

@@ -0,0 +1,236 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <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="certType"
+            >
+              <a-select
+                v-model="model.certType"
+                style="width: 100%"
+                placeholder="证件类型"
+                :allowClear="true"
+              >
+                <a-select-option :value="1">身份证</a-select-option>
+                <a-select-option :value="2">护照</a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="姓名"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="customerName"
+            >
+              <a-auto-complete
+                v-model="model.customerName"
+                placeholder="联系人"
+                @search="handleSearch"
+                @select="(e) => handleSelectMember(e)"
+              >
+                <template slot="dataSource">
+                  <a-select-option v-for="item in customerList" :key="item.id"
+                    >{{ item.name }}-{{ item.phone }}</a-select-option
+                  >
+                </template>
+              </a-auto-complete>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="性别"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="gender"
+            >
+              <a-radio-group v-model="model.gender">
+                <a-radio :value="1">男</a-radio>
+                <a-radio :value="2">女</a-radio>
+              </a-radio-group>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="手机号"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="phone"
+            >
+              <a-input
+                v-model="model.phone"
+                placeholder="请输入手机号"
+              ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="证件号"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="certNo"
+            >
+              <a-input
+                v-model="model.certNo"
+                placeholder="请输入证件号"
+              ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <!-- <a-col :span="24">
+            <a-form-model-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address">
+              <a-input v-model="model.address" placeholder="请输入地址"  ></a-input>
+            </a-form-model-item>
+          </a-col> -->
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+
+export default {
+  name: "BusMemberCardForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: { payType: 1, livingOrderId: "",certType:1,gender:1 },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        mobile: [
+          {
+            required: true,
+            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+            message: "请输入手机号!",
+          },
+        ],
+        cardNo: [{ required: true, message: "请输入会员卡号!" }],
+        gradeId: [{ required: true, message: "请输入等级类型!" }],
+        payType: [{ required: true, message: "请输入付款类型!" }],
+        paymentMethod: [{ required: true, message: "请输入付款方式!" }],
+        customerName: [{ required: true, message: "请输入会员姓名!" }],
+        sex: [{ required: true, message: "请输入性别!" }],
+        certificateType: [{ required: true, message: "请输入证件类型!" }],
+        validity: [{ required: true, message: "请输入有效期!" }],
+      },
+      url: {
+        add: "/business/busRoomBookingOrders/booking-to-live",
+        edit: "/business/busMemberCard/edit",
+        queryById: "/business/busMemberCard/queryById",
+      },
+      gradeList: [],
+      paymentMethodList: [],
+      staffList: [],
+      customerList: [],
+      oldcustomerList: [],
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    this.getbusCustomer();
+  },
+  methods: {
+    handleSearch(value) {
+      let result;
+      if (!value) {
+        result = this.oldcustomerList;
+      } else {
+        result = this.oldcustomerList.filter((t) => t.name.includes(value));
+      }
+      this.customerList = result;
+    },
+    handleSelectMember(e) {
+      var find = this.customerList.find((t) => t.id === e);
+      this.model.phone = find.phone;
+      this.model.customerName = find.name;
+      this.model.customerId = find.id;
+    },
+    getbusCustomer() {
+      getAction("/bus/busCustomer/list", {}).then((res) => {
+        if (res.success) {
+          this.customerList = res.result.records;
+          this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+        }
+      });
+    },
+    add(livingOrderId,roomId) {
+      this.modelDefault.livingOrderId = livingOrderId;
+      this.modelDefault.roomId = roomId;
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          that.confirmLoading = true;
+          // var customers = [];
+          // customers.push({
+          //   certNo: this.model.certNo,
+          //   certType: this.model.certType,
+          //   customerId: this.model.customerId,
+          //   customerName: this.model.customerName,
+          //   gender: this.model.gender,
+          //   phone: this.model.phone,
+          //   roomId: this.model.roomId,
+          // });
+          httpAction("/business/busLivingCustomer/add", this.model, "post")
+            .then((res) => {
+              if (res.success) {
+                that.$message.success("入住成功");
+                that.$emit("ok");
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+            });
+        }
+      });
+    },
+  },
+};
+</script>

+ 60 - 0
src/views/room/modules/checkIn/CustomerModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <bus-member-card-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-member-card-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import BusMemberCardForm from './CustomerForm'
+  export default {
+    name: 'BusMemberCardModal',
+    components: {
+      BusMemberCardForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add (livingOrderId,roomId) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add(livingOrderId,roomId);
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 80 - 22
src/views/room/modules/checkIn/SelectRoomForm.vue

@@ -13,15 +13,23 @@
               label="房型"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
-              prop="roomType"
             >
-              <a-checkbox-group
-                v-model="model.roomType"
-                :options="roomTypeOptions"
-              />
+              <a-checkbox-group @change="onChange" v-model="checkLayoutList">
+                <a-row>
+                  <a-col
+                    :span="12"
+                    v-for="(item, index) in roomLayoutList"
+                    :key="item.id"
+                  >
+                    <a-checkbox :value="item.id">
+                      {{ item.name }}
+                    </a-checkbox>
+                  </a-col>
+                </a-row>
+              </a-checkbox-group>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
+          <!-- <a-col :span="24">
             <a-form-model-item
               label="房态"
               :labelCol="labelCol"
@@ -33,7 +41,7 @@
                 :options="roomStatusOptions"
               />
             </a-form-model-item>
-          </a-col>
+          </a-col> -->
           <a-col :span="24">
             <a-form-model-item
               label="已选"
@@ -48,10 +56,10 @@
                 color="blue"
                 closable
                 :visible="visible"
-                @close.stop="tagClose2(index, item.roomNo)"
+                @close.stop="tagClose2(index, item.name)"
                 v-for="(item, index) in model.rooms"
                 :key="index"
-                >{{ item.roomNo }}</a-tag
+                >{{ item.name }}</a-tag
               >
             </a-form-model-item>
           </a-col>
@@ -65,14 +73,14 @@
               }"
             >
               <a-tabs
-                :default-active-key="0"
+                default-active-key="room0"
                 tab-position="left"
                 :style="{ height: '300px' }"
               >
                 <a-tab-pane
                   v-for="(room, index) in roomList"
-                  :key="index"
-                  :tab="room.key"
+                  :key="'room' + index"
+                  :tab="room.floorName"
                 >
                   <div
                     id="components-grid-demo-playground"
@@ -81,8 +89,8 @@
                     <a-row :gutter="[8, 8]">
                       <a-col
                         :span="3"
-                        v-for="(r, rIndex) in room.child"
-                        :key="rIndex"
+                        v-for="(r, rIndex) in room.floorRooms"
+                        :key="'floorRooms' + rIndex"
                       >
                         <div
                           :class="[
@@ -91,7 +99,7 @@
                           ]"
                           @click="checkRoomClick(r)"
                         >
-                          {{ r.roomNo }}
+                          {{ r.name }}
                         </div></a-col
                       >
                     </a-row>
@@ -145,9 +153,9 @@ export default {
         { key: "1层", child: rooms },
         { key: "2层", child: rooms2 },
       ],
-      roomTypeOptions: ["休闲家庭房", "特价房"],
+      roomTypeOptions: [],
       roomStatusOptions: ["空净", "空脏"],
-      model: { rooms: [] },
+      model: { roomType: "", rooms: [] },
       labelCol: {
         xs: { span: 24 },
         sm: { span: 2 },
@@ -166,6 +174,13 @@ export default {
         edit: "/business/busMeetingRoom/edit",
         queryById: "/business/busMeetingRoom/queryById",
       },
+      layoutName: "",
+      presetNum: 0,
+      canUserRooms: [],
+      oldcanUserRooms: [],
+      checkLayoutList: [],
+      roomLayoutList: [],
+      oldroomList: [],
     };
   },
   computed: {
@@ -180,6 +195,19 @@ export default {
     }
     //备份model原始值
     this.modelDefault = JSON.parse(JSON.stringify(this.model));
+
+    getAction("/rooms/cesRoomLayout/list", { pageSize: 99999, pageNo: 1 }).then(
+      (res) => {
+        if (res.success) {
+          this.roomLayoutList = res.result.records;
+          if (this.roomLayoutList && this.roomLayoutList.length > 0) {
+            this.roomLayoutList.forEach((item) => {
+              this.checkLayoutList.push(item.id);
+            });
+          }
+        }
+      }
+    );
   },
   methods: {
     checkRoomClick(row) {
@@ -195,8 +223,8 @@ export default {
     tagClose2(index, key1) {
       this.model.rooms.splice(index, 1);
       this.roomList.some((t) => {
-        var r = t.child.some((c) => {
-          if (c.roomNo === key1) {
+        var r = t.floorRooms.some((c) => {
+          if (c.name === key1) {
             c.check = 0;
             return true;
           }
@@ -207,14 +235,44 @@ export default {
         }
       });
     },
-    onChange(date, dateString) {
-      console.log(date, dateString);
+    onChange(e) {
+      console.log(e);
+      var list = [];
+      this.oldroomList.forEach((item) => {
+        var floorRooms = [];
+        item.floorRooms.forEach((f) => {
+          if (e.includes(f.layoutId)) {
+            floorRooms.push(f);
+          }
+        });
+        var itemd = JSON.parse(JSON.stringify(item));
+        itemd.floorRooms = floorRooms;
+        list.push(itemd);
+      });
+      this.roomList = list;
+      // result = this.oldcustomerList.filter((t) => t.name.includes(value));
+      console.log("this.oldroomList", this.oldroomList);
+      console.log("this.roomList", this.roomList);
     },
-    add() {
+    add(row) {
+      console.log("canUserRooms", row);
+      // this.canUserRooms = row;
+      this.oldroomList = JSON.parse(JSON.stringify(row[0].buildingRooms));
+
+      // this.layoutName = row.layout.name;
+      // this.presetNum = row.layout.presetNum;
+      this.roomList = row[0].buildingRooms;
       this.edit(this.modelDefault);
     },
     edit(record) {
       this.model = Object.assign({}, record);
+      this.roomList.forEach((t) => {
+        t.floorRooms.forEach((f) => {
+          if (f.check && f.check == 1) {
+            this.model.rooms.push(f);
+          }
+        });
+      });
       this.visible = true;
     },
     submitForm() {

+ 2 - 2
src/views/room/modules/checkIn/SelectRoomFormModal.vue

@@ -33,10 +33,10 @@ export default {
     };
   },
   methods: {
-    add() {
+    add(row) {
       this.visible = true;
       this.$nextTick(() => {
-        this.$refs.realForm.add();
+        this.$refs.realForm.add(row);
       });
     },
     edit(record) {

+ 239 - 0
src/views/room/modules/customer/CustomerForm.vue

@@ -0,0 +1,239 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <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="certType"
+            >
+              <a-select
+                v-model="model.certType"
+                style="width: 100%"
+                placeholder="证件类型"
+                :allowClear="true"
+              >
+                <a-select-option :value="1">身份证</a-select-option>
+                <a-select-option :value="2">护照</a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="姓名"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="customerName"
+            >
+              <a-auto-complete
+                v-model="model.customerName"
+                placeholder="联系人"
+                @search="handleSearch"
+                @select="(e) => handleSelectMember(e)"
+              >
+                <template slot="dataSource">
+                  <a-select-option v-for="item in customerList" :key="item.id"
+                    >{{ item.name }}-{{ item.phone }}</a-select-option
+                  >
+                </template>
+              </a-auto-complete>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="性别"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="gender"
+            >
+              <a-radio-group v-model="model.gender">
+                <a-radio :value="1">男</a-radio>
+                <a-radio :value="2">女</a-radio>
+              </a-radio-group>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="手机号"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="phone"
+            >
+              <a-input
+                v-model="model.phone"
+                placeholder="请输入手机号"
+              ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="证件号"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="certNo"
+            >
+              <a-input
+                v-model="model.certNo"
+                placeholder="请输入证件号"
+              ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <!-- <a-col :span="24">
+            <a-form-model-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address">
+              <a-input v-model="model.address" placeholder="请输入地址"  ></a-input>
+            </a-form-model-item>
+          </a-col> -->
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+
+export default {
+  name: "BusMemberCardForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: { payType: 1 },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        mobile: [
+          {
+            required: true,
+            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+            message: "请输入手机号!",
+          },
+        ],
+        cardNo: [{ required: true, message: "请输入会员卡号!" }],
+        gradeId: [{ required: true, message: "请输入等级类型!" }],
+        payType: [{ required: true, message: "请输入付款类型!" }],
+        paymentMethod: [{ required: true, message: "请输入付款方式!" }],
+        customerName: [{ required: true, message: "请输入会员姓名!" }],
+        sex: [{ required: true, message: "请输入性别!" }],
+        certificateType: [{ required: true, message: "请输入证件类型!" }],
+        validity: [{ required: true, message: "请输入有效期!" }],
+      },
+      url: {
+        add: "/business/busRoomBookingOrders/booking-to-live",
+        edit: "/business/busMemberCard/edit",
+        queryById: "/business/busMemberCard/queryById",
+      },
+      gradeList: [],
+      paymentMethodList: [],
+      staffList: [],
+      customerList: [],
+      oldcustomerList: [],
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    this.getbusCustomer();
+  },
+  methods: {
+    handleSearch(value) {
+      let result;
+      if (!value) {
+        result = this.oldcustomerList;
+      } else {
+        result = this.oldcustomerList.filter((t) => t.name.includes(value));
+      }
+      this.customerList = result;
+    },
+    handleSelectMember(e) {
+      var find = this.customerList.find((t) => t.id === e);
+      this.model.phone = find.phone;
+      this.model.customerName = find.name;
+      this.model.customerId = find.id;
+    },
+    getbusCustomer() {
+      getAction("/bus/busCustomer/list", {}).then((res) => {
+        if (res.success) {
+          this.customerList = res.result.records;
+          this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+        }
+      });
+    },
+    add() {
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          that.confirmLoading = true;
+          var customers = [];
+          customers.push({
+            certNo: this.model.certNo,
+            certType: this.model.certType,
+            customerId: this.model.customerId,
+            customerName: this.model.customerName,
+            gender: this.model.gender,
+            phone: this.model.phone,
+            roomId: this.model.roomId,
+          });
+          httpAction(
+            "/business/busRoomBookingOrders/booking-to-live?bookingRoomId=" +
+              this.model.bookingRoomId,
+            customers,
+            "post"
+          )
+            .then((res) => {
+              if (res.success) {
+                that.$message.success('入住成功');
+                that.$emit("ok");
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+            });
+        }
+      });
+    },
+  },
+};
+</script>

+ 60 - 0
src/views/room/modules/customer/CustomerModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <bus-member-card-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-member-card-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import BusMemberCardForm from './CustomerForm'
+  export default {
+    name: 'BusMemberCardModal',
+    components: {
+      BusMemberCardForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 37 - 6
src/views/room/modules/schedule/EditScheduleRoomForm.vue

@@ -276,7 +276,7 @@
                       <a-select-option
                         v-for="item in customerList"
                         :key="item.id"
-                        >{{ item }}</a-select-option
+                        >{{ item.name }}-{{ item.phone }}</a-select-option
                       >
                     </template>
                   </a-auto-complete>
@@ -406,15 +406,19 @@
                 </template>
 
                 <span slot="selectRoom" slot-scope="text, record, index">
-                  <a-button type="link" @click="pulsRoom2(record, index)">{{
-                    text ? text : "排房"
-                  }}</a-button>
+                  <a-button
+                    :disabled="record.roomStatus == 3 || record.roomStatus == 4"
+                    type="link"
+                    @click="pulsRoom2(record, index)"
+                    >{{ text ? text : "排房" }}</a-button
+                  >
                 </span>
                 <span slot="action" slot-scope="text, record, index">
                   <div style="gap: 10px; display: flex">
                     <a-button
                       v-if="record.roomStatus != 3 && record.roomStatus != 4"
                       size="small"
+                      @click="addCustomer(record)"
                       >入住</a-button
                     >
                     <a-button
@@ -423,7 +427,9 @@
                       @click="setMain(record.id)"
                       >设主房</a-button
                     >
-                    <a-button v-if="record.roomStatus == 3" size="small"
+                    <a-button
+                      v-if="record.roomStatus == 3 || record.roomStatus == 4"
+                      size="small"
                       >查看详单</a-button
                     >
                   </div>
@@ -531,6 +537,10 @@
       ref="modalSelectRoomForm2"
       @ok="modalFormOk2"
     ></select-room-form-modal>
+    <customer-modal
+      ref="modalCustomerForm"
+      @ok="modalCustomerFormOk"
+    ></customer-modal>
   </a-spin>
 </template>
 
@@ -540,6 +550,7 @@ import { validateDuplicateValue } from "@/utils/util";
 import moment from "moment";
 import EditableCell from "@views/room/modules/checkIn/EditableCell.vue";
 import SelectRoomFormModal from "./SelectRoomFormModal.vue";
+import CustomerModal from "@views/room/modules/customer/CustomerModal.vue";
 const date = new Date();
 const endDate = new Date(date.setDate(date.getDate() + 1));
 const columns = [
@@ -592,7 +603,7 @@ for (let i = 0; i < 2; i++) {
 }
 export default {
   name: "ScheduleRoomForm",
-  components: { EditableCell, SelectRoomFormModal },
+  components: { EditableCell, SelectRoomFormModal, CustomerModal },
   props: {
     //表单禁用
     disabled2: {
@@ -1107,6 +1118,26 @@ export default {
         }
       });
     },
+    addCustomer(record) {
+      if (!record.roomId) {
+        this.$message.warning("请先排房");
+        return;
+      }
+      this.$refs.modalCustomerForm.edit({
+        customerName: this.model.contactName,
+        phone: this.model.phone,
+        roomId: record.roomId,
+        gender: 1,
+        certType: 1,
+        bookingRoomId: record.id,
+        customerId: this.model.orderInfo.contactId,
+      });
+      this.$refs.modalCustomerForm.title = "添加同住";
+      this.$refs.modalCustomerForm.disableSubmit = false;
+    },
+    modalCustomerFormOk() {
+      this.getBookingOrderInfo();
+    },
     setMain(id) {
       postAction("/business/busBookingRooms/set-main", { id: id }).then(
         (res) => {