gqx лет назад: 2
Родитель
Сommit
b812434572

+ 2 - 1
src/utils/excloudHotelIdParamPath/MemeberController.js

@@ -2,6 +2,7 @@ export default {
     name: '会员管理模块',
     excloudUrls: [
         '/business/busMemberCard/list',
-        '/business/busMemberBalanceLog/list'
+        '/business/busMemberBalanceLog/list',
+        '/bus/busCustomer/list'
     ]
 }

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

@@ -55,12 +55,13 @@
               type="danger"
               >批量制卡</a-button
             >
-            <a-button
-              style="margin-bottom: 10px"
-              @click="toPage"
-              type="danger"
+            <a-button style="margin-bottom: 10px" @click="toPage" type="danger"
               >查询散客详单</a-button
             >
+            <a-button style="margin-bottom: 10px" @click="toTeamPage" type="danger"
+              >查询团队详单</a-button
+            >
+            
           </div>
           <div class="week-top">
             <div class="w-choose-status">
@@ -713,11 +714,21 @@ export default {
     // this.$refs.ModalEditScheduleRoom.addList([]);
     // this.$refs.ModalEditScheduleRoom.title = "详单";
     // this.$refs.ModalEditScheduleRoom.disableSubmit = false;
-    
   },
   methods: {
-    toPage(){
-      this.$router.push({path:'/room/scheduledetail',query: {id:'YD20230329144252390'}})
+    toPage() {
+      this.$router.push({
+        path: "/room/scheduledetail",
+        query: { id: "YD20230331112026203" },
+        // name:'room-scheduledetail',
+        // params:{id:'YD20230330144437313'}
+      });
+    },
+    toTeamPage() {
+      this.$router.push({
+        path: "/room/scheduleteamdetail",
+        query: { id: "YD20230331115905024" },
+      });
     },
     addScheduleTeam() {
       this.$refs.ModalScheduleTeamRoom.addList([]);

+ 453 - 87
src/views/room/modules/schedule/EditScheduleRoomForm.vue

@@ -1,6 +1,31 @@
 <template>
   <a-spin :spinning="confirmLoading">
-    <j-form-container :disabled="formDisabled">
+    <div style="gap: 10px; display: flex; margin: 10px">
+      <a-button
+        v-if="disabled && model.orderInfo.bookingStatus == 1"
+        @click="disabled = false"
+        >修改预定</a-button
+      >
+      <a-button v-if="!disabled" @click="editOrder">确认修改</a-button>
+      <a-button v-if="!disabled" @click="cancelOrder">取消修改</a-button>
+      <a-button
+        v-if="disabled && model.orderInfo.bookingStatus == 1"
+        @click="setOrderStatus(2)"
+        >取消预定</a-button
+      >
+      <a-button
+        v-if="model.orderInfo.bookingStatus == 2"
+        @click="setOrderStatus(1)"
+        >恢复预定</a-button
+      >
+      <a-button v-if="model.orderInfo.bookingStatus == 2" @click="deleteOrder"
+        >删除预定</a-button
+      >
+      <a-button v-if="disabled && model.orderInfo.bookingStatus == 1"
+        >合并联房</a-button
+      >
+    </div>
+    <j-form-container>
       <a-form-model
         ref="form"
         :model="model"
@@ -14,6 +39,15 @@
                 订价信息
               </h4>
               <a-divider />
+              <a-col :span="24" v-if="disabled">
+                <a-form-model-item
+                  label="预定单号"
+                  :labelCol="labelCol"
+                  :wrapperCol="wrapperCol"
+                >
+                  {{ model.orderInfo.bookingOrdersNo }}
+                </a-form-model-item>
+              </a-col>
               <a-col :span="24">
                 <a-form-model-item
                   label="入住类型"
@@ -22,6 +56,7 @@
                   prop="orderInfo.bookingType"
                 >
                   <a-select
+                    :disabled="disabled"
                     placeholder="入住类型"
                     v-model="model.orderInfo.bookingType"
                     @change="bookingTypeChange"
@@ -40,6 +75,7 @@
                   prop="orderInfo.arrivalTime2"
                 >
                   <j-date
+                    :disabled="disabled"
                     placeholder="预抵时间"
                     v-model="model.orderInfo.arrivalTime2"
                     style="width: 180px"
@@ -48,6 +84,7 @@
                     @change="arrivalTimeChange"
                   />
                   <a-time-picker
+                    :disabled="disabled"
                     style="width: 80px; margin-left: 2px"
                     v-model="model.orderInfo.arrivalTimeSpan"
                     :default-value="moment('12:00', 'HH:mm')"
@@ -64,6 +101,7 @@
                   prop="orderInfo.dueOutTime2"
                 >
                   <j-date
+                    :disabled="disabled"
                     placeholder="预离时间"
                     v-model="model.orderInfo.dueOutTime2"
                     style="width: 180px"
@@ -72,6 +110,7 @@
                     @change="arrivalTimeChange"
                   />
                   <a-time-picker
+                    :disabled="disabled"
                     style="width: 80px; margin-left: 2px"
                     v-model="model.orderInfo.dueOutTimeSpan"
                     format="HH:mm"
@@ -87,6 +126,7 @@
                   prop="orderInfo.customerSource"
                 >
                   <a-select
+                    :disabled="disabled"
                     placeholder="客人来源"
                     v-model="model.orderInfo.customerSource"
                   >
@@ -108,6 +148,7 @@
                   prop="orderInfo.hourRoomId"
                 >
                   <a-select
+                    :disabled="disabled"
                     placeholder="时长"
                     v-model="model.orderInfo.hourRoomId"
                   >
@@ -129,6 +170,7 @@
                   prop="orderInfo.dayCount"
                 >
                   <a-input-number
+                    :disabled="disabled"
                     v-model="model.orderInfo.dayCount"
                     placeholder="天数"
                     :min="1"
@@ -145,6 +187,7 @@
                   prop="orderInfo.breakfastNum"
                 >
                   <a-input-number
+                    :disabled="disabled"
                     v-model="model.orderInfo.breakfastNum"
                     placeholder="早餐"
                     :min="0"
@@ -159,6 +202,7 @@
                   prop="orderInfo.bookingDicWay"
                 >
                   <a-select
+                    :disabled="disabled"
                     placeholder="预定方式"
                     v-model="model.orderInfo.bookingDicWay"
                   >
@@ -180,6 +224,7 @@
                   prop="orderInfo.customerType"
                 >
                   <a-select
+                    :disabled="disabled"
                     placeholder="客人类型"
                     v-model="model.orderInfo.customerType"
                   >
@@ -198,6 +243,7 @@
                   prop="orderInfo.roomPriceSlnId"
                 >
                   <a-select
+                    :disabled="disabled"
                     placeholder="房价方案"
                     v-model="model.orderInfo.roomPriceSlnId"
                   >
@@ -218,15 +264,18 @@
                   prop="contactName"
                 >
                   <a-auto-complete
+                    :disabled="disabled"
                     v-model="model.contactName"
                     placeholder="联系人"
                     @search="handleSearch"
                     @select="(e) => handleSelectMember(e)"
                   >
                     <template slot="dataSource">
-                      <a-select-option v-for="item in result" :key="item">{{
-                        item
-                      }}</a-select-option>
+                      <a-select-option
+                        v-for="item in customerList"
+                        :key="item.id"
+                        >{{ item }}</a-select-option
+                      >
                     </template>
                   </a-auto-complete>
                 </a-form-model-item>
@@ -238,7 +287,11 @@
                   :wrapperCol="wrapperCol"
                   prop="phone"
                 >
-                  <a-input v-model="model.phone" placeholder="电话"></a-input>
+                  <a-input
+                    :disabled="disabled"
+                    v-model="model.phone"
+                    placeholder="电话"
+                  ></a-input>
                 </a-form-model-item>
               </a-col>
               <a-col :span="24">
@@ -249,6 +302,7 @@
                   prop="orderInfo.warrantType"
                 >
                   <a-select
+                    :disabled="disabled"
                     placeholder="担保方式"
                     v-model="model.orderInfo.warrantType"
                   >
@@ -266,6 +320,7 @@
                   prop="orderInfo.warranter"
                 >
                   <a-select
+                    :disabled="disabled"
                     placeholder="销售员"
                     v-model="model.orderInfo.warranter"
                   >
@@ -287,6 +342,7 @@
                   prop="orderInfo.outerOrdersNo"
                 >
                   <a-input
+                    :disabled="disabled"
                     v-model="model.orderInfo.outerOrdersNo"
                     placeholder="外部单号"
                   ></a-input>
@@ -300,6 +356,7 @@
                   prop="orderInfo.remark"
                 >
                   <a-textarea
+                    :disabled="disabled"
                     v-model="model.orderInfo.remark"
                     rows="4"
                     placeholder="备注"
@@ -307,17 +364,92 @@
                 </a-form-model-item>
               </a-col>
             </div>
-            <div style="width: 61%">
+            <div style="width: 61%" v-if="disabled">
               <h4 style="color: rgba(255, 141, 26, 1); font-weight: 600">
                 选择房间
               </h4>
               <a-divider />
-              <p>
-                <span>占房天数:{{ model.orderInfo.dayCount }}晚</span>
-                <span style="padding-left: 10px">总价:{{ amount }}</span>
-              </p>
+              <div style="display: flex; justify-content: space-between">
+                <div>
+                  <span>房间数:{{ model.roomIds.length }}间</span>
+                  <span style="padding-left: 10px"
+                    >占房天数:{{ model.orderInfo.dayCount }}晚</span
+                  >
+                  <span style="padding-left: 10px">总价:{{ amount2 }}</span>
+                </div>
+                <div style="display: flex; gap: 10px">
+                  <a-button>制房卡</a-button>
+                  <a-button>批量排房</a-button>
+                  <a-button>批量入住</a-button>
+                </div>
+              </div>
               <a-table
                 :columns="columns"
+                :data-source="model.roomIds"
+                :pagination="false"
+                rowKey="id"
+              >
+                <template slot="favPrice" slot-scope="text, record, index">
+                  {{ record.layout.favPrice }}
+                </template>
+                <template slot="presetNum" slot-scope="text, record, index">
+                  <div>
+                    <a-input-number
+                      v-model="record.layout.presetNum"
+                      :min="(record.rooms || []).length"
+                      :max="record.layout.oldTags"
+                      @change="presetNumChange($event, record)"
+                    />
+                  </div>
+                </template>
+
+                <span slot="selectRoom" slot-scope="text, record, index">
+                  <a-button 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"
+                      >入住</a-button
+                    >
+                    <a-button
+                      size="small"
+                      v-if="!record.isMain"
+                      @click="setMain(record.id)"
+                      >设主房</a-button
+                    >
+                    <a-button v-if="record.roomStatus == 3" size="small"
+                      >查看详单</a-button
+                    >
+                  </div>
+                </span>
+                <template slot="zhu" slot-scope="text, record, index">
+                  <span
+                    v-if="text == true"
+                    class="booking_circle_span orange_color"
+                    >主</span
+                  >
+                </template>
+              </a-table>
+            </div>
+            <div style="width: 61%" v-else>
+              <h4 style="color: rgba(255, 141, 26, 1); font-weight: 600">
+                选择房间
+              </h4>
+              <a-divider />
+              <div style="display: flex; justify-content: space-between">
+                <div>
+                  <span style="padding-left: 10px"
+                    >占房天数:{{ model.orderInfo.dayCount }}晚</span
+                  >
+                  <span style="padding-left: 10px">总价:{{ amount }}</span>
+                </div>
+              </div>
+              <a-table
+                :columns="columns2"
                 :data-source="canUserRooms"
                 :pagination="false"
                 :rowKey="rowKey"
@@ -393,11 +525,15 @@
       ref="modalSelectRoomForm"
       @ok="modalFormOk"
     ></select-room-form-modal>
+    <select-room-form-modal
+      ref="modalSelectRoomForm2"
+      @ok="modalFormOk2"
+    ></select-room-form-modal>
   </a-spin>
 </template>
 
 <script>
-import { httpAction, getAction, postAction } from "@/api/manage";
+import { httpAction, getAction, postAction, deleteAction } from "@/api/manage";
 import { validateDuplicateValue } from "@/utils/util";
 import moment from "moment";
 import EditableCell from "@views/room/modules/checkIn/EditableCell.vue";
@@ -405,48 +541,33 @@ import SelectRoomFormModal from "./SelectRoomFormModal.vue";
 const date = new Date();
 const endDate = new Date(date.setDate(date.getDate() + 1));
 const columns = [
-  // {
-  //     title: "",
-  //     dataIndex: "key",
-  //     width: 20,
-  //   },
   {
-    title: "房型",
-    dataIndex: "name",
-    width: 150,
-    customRender: function (text, record) {
-      return record.layout.name;
-    },
+    title: "",
+    dataIndex: "isMain",
+    width: 50,
+    scopedSlots: { customRender: "zhu" },
   },
   {
-    title: "门市价",
-    dataIndex: "marketPrice",
-    width: 100,
-    customRender: function (text, record) {
-      return record.layout.marketPrice;
-    },
+    title: "排房",
+    dataIndex: "roomName",
+    scopedSlots: { customRender: "selectRoom" },
   },
   {
-    title: "优惠价",
-    dataIndex: "favPrice",
-    width: 120,
-    scopedSlots: { customRender: "favPrice" },
+    title: "房型",
+    dataIndex: "layoutName",
   },
   {
-    title: "可订数/可超数",
-    dataIndex: "canUseCount",
-    width: 170,
+    title: "房价",
+    dataIndex: "marketPrice",
     customRender: function (text, record) {
-      return record.layout.canUseCount + "/0";
+      var price = 0;
+      if (record.layoutDayPrices && record.layoutDayPrices.length > 0) {
+        price = record.layoutDayPrices[0].price;
+      }
+      return price;
     },
   },
   {
-    title: "预定间数",
-    dataIndex: "presetNum",
-    width: 100,
-    scopedSlots: { customRender: "presetNum" },
-  },
-  {
     title: "操作",
     dataIndex: "action",
     align: "center",
@@ -472,20 +593,71 @@ export default {
   components: { EditableCell, SelectRoomFormModal },
   props: {
     //表单禁用
-    disabled: {
+    disabled2: {
       type: Boolean,
       default: false,
-      required: false,
     },
     id: {
-      type: Boolean,
+      type: String,
       default: "",
     },
   },
   data() {
     return {
+      disabled: false,
       visible: true,
       columns,
+      columns2: [
+        // {
+        //     title: "",
+        //     dataIndex: "key",
+        //     width: 20,
+        //   },
+        {
+          title: "房型",
+          dataIndex: "name",
+          width: 150,
+          customRender: function (text, record) {
+            return record.layout.name;
+          },
+        },
+        {
+          title: "门市价",
+          dataIndex: "marketPrice",
+          width: 100,
+          customRender: function (text, record) {
+            return record.layout.marketPrice;
+          },
+        },
+        {
+          title: "优惠价",
+          dataIndex: "favPrice",
+          width: 120,
+          scopedSlots: { customRender: "favPrice" },
+        },
+        {
+          title: "可订数/可超数",
+          dataIndex: "canUseCount",
+          width: 170,
+          customRender: function (text, record) {
+            return record.layout.canUseCount + "/0";
+          },
+        },
+        {
+          title: "预定间数",
+          dataIndex: "presetNum",
+          width: 100,
+          scopedSlots: { customRender: "presetNum" },
+        },
+        {
+          title: "操作",
+          dataIndex: "action",
+          align: "center",
+          fixed: "right",
+          width: 70,
+          scopedSlots: { customRender: "action" },
+        },
+      ],
       model: {
         // data: data,
         orderInfo: {
@@ -536,7 +708,7 @@ export default {
       },
       url: {
         add: "/business/busRoomBookingOrders/add",
-        edit: "/business/busMeetingRoom/edit",
+        edit: "/business/busRoomBookingOrders/edit",
         getBookingOrderInfo:
           "/business/busRoomBookingOrders/getBookingOrderInfo",
       },
@@ -547,6 +719,9 @@ export default {
       warranterList: [],
       hourRoomRuleList: [],
       canUserRooms: [],
+      canUserRooms2: [],
+      customerList: [],
+      oldcustomerList: [],
     };
   },
   computed: {
@@ -560,8 +735,18 @@ export default {
       });
       return sum.toFixed(2);
     },
+    amount2() {
+      var sum = 0;
+      this.model.roomIds.forEach((t) => {
+        t.layoutDayPrices.forEach((p) => {
+          sum += p.price;
+        });
+      });
+      return sum.toFixed(2);
+    },
   },
   created() {
+    this.disabled = this.disabled2;
     var _info = JSON.parse(localStorage.getItem("storeInfo"));
     if (_info) {
       this.model.hotelId = _info.id;
@@ -603,35 +788,95 @@ export default {
         this.hourRoomRuleList = res.result.records;
       }
     });
+    // postAction("/rooms/cesAllDayPriceRule/fetch", { hotelId: _info.id }).then(
+    //   (res) => {
+    //     if (res.success) {
+    //       if (
+    //         res.result &&
+    //         res.result.cesAllDayPriceRule &&
+    //         res.result.cesAllDayPriceRule.leaveTime
+    //       ) {
+    //         this.model.orderInfo.dueOutTimeSpan = moment(
+    //           res.result.cesAllDayPriceRule.leaveTime,
+    //           "HH:mm"
+    //         );
+    //       }
+    //     }
 
-    postAction("/rooms/cesAllDayPriceRule/fetch", { hotelId: _info.id }).then(
-      (res) => {
+    //     this.loadRooms();
+    //   }
+    // );
+    this.getBookingOrderInfo();
+  },
+  methods: {
+    getBookingOrderInfo() {
+      getAction(this.url.getBookingOrderInfo, {
+        bookingNo: this.id,
+      }).then((res) => {
         if (res.success) {
-          if (
-            res.result &&
-            res.result.cesAllDayPriceRule &&
-            res.result.cesAllDayPriceRule.leaveTime
-          ) {
-            this.model.orderInfo.dueOutTimeSpan = moment(
-              res.result.cesAllDayPriceRule.leaveTime,
-              "HH:mm"
-            );
-          }
-        }
+          this.model = res.result;
+          this.model.orderInfo.arrivalTime2 = moment(
+            this.model.orderInfo.arrivalTime
+          ).format("YYYY-MM-DD");
+          this.model.orderInfo.dueOutTime2 = moment(
+            this.model.orderInfo.dueOutTime
+          ).format("YYYY-MM-DD");
+          this.model.orderInfo.arrivalTimeSpan = moment(
+            this.model.orderInfo.arrivalTime.substr(11, 15),
+            "HH:mm"
+          );
+          this.model.orderInfo.dueOutTimeSpan = moment(
+            this.model.orderInfo.dueOutTime.substr(11, 15),
+            "HH:mm"
+          );
 
-        this.loadRooms();
-      }
-    );
+          this.getbusCustomer();
+          this.loadRooms();
+        }
+      });
+    },
+    deleteOrder() {
+      deleteAction("/business/busRoomBookingOrders/delete", {
+        id: this.model.orderInfo.id,
+      }).then((res) => {
+        if (res.success) {
+          this.$message.success(res.message);
+          this.$router.go(-1);
+        } else {
+          this.$message.warning(res.message);
+        }
+      });
+    },
+    setOrderStatus(status) {
+      postAction("/business/busRoomBookingOrders/set-booking-status", {
+        id: this.model.orderInfo.id,
+        bookingStatus: status,
+      }).then((res) => {
+        if (res.success) {
+          this.$message.success(res.message);
+          this.getBookingOrderInfo();
+        } else {
+          this.$message.warning(res.message);
+        }
+      });
+    },
+    getbusCustomer() {
+      getAction("/bus/busCustomer/list", {}).then((res) => {
+        if (res.success) {
+          this.customerList = res.result.records;
+          this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+          var find = this.oldcustomerList.find(
+            (t) => t.id == this.model.orderInfo.contactId
+          );
+          if (find) {
+            this.model.contactName = find.name;
+            this.model.phone = find.phone;
 
-    getAction(this.url.getBookingOrderInfo, {
-      bookingNo: this.id,
-    }).then((res) => {
-      if (res.success) {
-        this.hourRoomRuleList = res.result.records;
-      }
-    });
-  },
-  methods: {
+            this.$emit("ok", this.model);
+          }
+        }
+      });
+    },
     presetNumChange(e, record) {
       console.log(e);
       record.layout.canUseCount = record.layout.oldTags - e;
@@ -661,20 +906,32 @@ export default {
           moment(this.model.orderInfo.dueOutTimeSpan).format("HH:mm"),
         bookingType: this.model.orderInfo.bookingType,
         hourRoomRuleId: this.model.orderInfo.hourRoomId,
+        orderId: this.model.orderInfo.id,
       }).then((res) => {
         if (res.success) {
           res.result.forEach((t) => {
+            var rooms = [];
+            var layouts = this.model.roomIds.filter(
+              (r) => r.roomLayoutId === t.layout.id
+            );
             t.layout = Object.assign({}, t.layout, {
-              presetNum: 0,
-              oldTags: t.layout.canUseCount,
+              presetNum: layouts.length,
+              oldTags: t.layout.canUseCount + layouts.length,
             });
             t.buildingRooms.forEach((b) => {
               b.floorRooms.forEach((f) => {
-                this.$set(f, "check", 0);
+                var exRoom = this.model.roomIds.some((r) => r.roomId === f.id);
+                if (exRoom) {
+                  rooms.push(f);
+                }
+                this.$set(f, "check", exRoom === true ? 1 : 0);
               });
             });
+
+            this.$set(t, "rooms", rooms);
           });
           this.canUserRooms = res.result;
+          console.log("this.canUserRooms", this.canUserRooms);
         }
       });
     },
@@ -715,9 +972,14 @@ export default {
       console.log(moment(m).format("HH:mm"));
     },
     tagClose2(rindex, bindex, index) {
-      // console.log(rindex, index);
-      // console.log(this.canUserRooms[index]);
-      this.canUserRooms[index].rooms.splice(rindex, 1);
+      console.log(rindex, index);
+      console.log(this.canUserRooms[index]);
+      var id =
+        this.canUserRooms[index].buildingRooms[bindex].floorRooms[rindex].id;
+      var findIndex = this.canUserRooms[index].rooms.findIndex(
+        (t) => t.id === id
+      );
+      this.canUserRooms[index].rooms.splice(findIndex, 1);
 
       this.$set(
         this.canUserRooms[index].buildingRooms[bindex].floorRooms[rindex],
@@ -734,25 +996,90 @@ export default {
       this.$set(this.canUserRooms[this.selectIndex], "rooms", e);
       console.log(this.canUserRooms[this.selectIndex]);
     },
+    modalFormOk2(e) {
+      this.$set(this.canUserRooms2[0], "rooms", e);
+      console.log("modalFormOk2", this.canUserRooms2[0]);
+      this.model.roomIds[this.selectIndex].roomId = e[0].id;
+      this.model.roomIds[this.selectIndex].roomName = e[0].name;
+      postAction(
+        "/business/busBookingRooms/edit",
+        this.model.roomIds[this.selectIndex]
+      ).then((res) => {
+        if (res.success) {
+          this.$message.success(res.message);
+        } else {
+          this.$message.warning(res.message);
+        }
+      });
+    },
+    setMain(id) {
+      postAction("/business/busBookingRooms/set-main", { id: id }).then(
+        (res) => {
+          if (res.success) {
+            this.$message.success(res.message);
+            this.getBookingOrderInfo();
+          } else {
+            this.$message.warning(res.message);
+          }
+        }
+      );
+    },
     pulsRoom(index) {
       this.selectIndex = index;
       this.$refs.modalSelectRoomForm.add(this.canUserRooms[this.selectIndex]);
       this.$refs.modalSelectRoomForm.title = "排房";
       this.$refs.modalSelectRoomForm.disableSubmit = false;
     },
+    pulsRoom2(record, index) {
+      this.selectIndex = index;
+      getAction("/rooms/cesRooms/can-user-rooms", {
+        startOf:
+          this.model.orderInfo.arrivalTime2 +
+          " " +
+          moment(this.model.orderInfo.arrivalTimeSpan).format("HH:mm"),
+        endOf:
+          this.model.orderInfo.dueOutTime2 +
+          " " +
+          moment(this.model.orderInfo.dueOutTimeSpan).format("HH:mm"),
+        bookingType: this.model.orderInfo.bookingType,
+        hourRoomRuleId: this.model.orderInfo.hourRoomId,
+        layoutId: record.roomLayoutId,
+        // orderId: this.model.orderInfo.id,
+      }).then((res) => {
+        if (res.success) {
+          res.result.forEach((t) => {
+            t.layout = Object.assign({}, t.layout, {
+              presetNum: 0,
+              oldTags: t.layout.canUseCount,
+            });
+            t.buildingRooms.forEach((b) => {
+              b.floorRooms.forEach((f) => {
+                this.$set(f, "check", 0);
+              });
+            });
+          });
+          this.canUserRooms2 = res.result;
+          this.canUserRooms2[0].layout.presetNum = 1;
+          this.$refs.modalSelectRoomForm2.add(this.canUserRooms2[0]);
+          this.$refs.modalSelectRoomForm2.title = "排房";
+          this.$refs.modalSelectRoomForm2.disableSubmit = false;
+        }
+      });
+    },
     handleSearch(value) {
       let result;
       if (!value) {
-        result = [];
+        result = this.oldcustomerList;
       } else {
-        result = ["a", "b", "c"].map(
-          (domain) => `${value}${domain}(15888888888)`
-        );
+        result = this.oldcustomerList.filter((t) => t.name.includes(value));
       }
-      this.result = result;
+      this.customerList = result;
     },
     handleSelectMember(e) {
-      this.model.mobile = "158888888888";
+      var find = this.customerList.find((t) => t.id === e);
+      this.model.phone = find.phone;
+      this.model.contactName = find.name;
+      this.model.orderInfo.contactId = find.id;
     },
     moment,
     onChange(date, dateString) {
@@ -771,15 +1098,28 @@ export default {
       this.model = Object.assign({}, record);
       this.visible = true;
     },
+    cancelOrder() {
+      this.disabled = true;
+      this.getBookingOrderInfo();
+    },
+    editOrder() {
+      this.submitForm();
+    },
     submitForm() {
       const that = this;
       that.model.roomIds = [];
+      that.model.layoutDayPrices = [];
       that.canUserRooms.forEach((t) => {
+        console.log("foreach");
         var lastlayoutId = t.layout.id;
         t.buildingRooms.forEach((b) => {
           b.floorRooms.forEach((f) => {
             if (f.check && f.check === 1) {
-              that.model.roomIds.push({ layoutId: t.layout.id, roomId: f.id });
+              that.model.roomIds.push({
+                layoutId: t.layout.id,
+                roomId: f.id,
+                roomLayoutId: t.layout.id,
+              });
             }
           });
         });
@@ -788,7 +1128,11 @@ export default {
         );
         var len = roomIds.length;
         for (var i = len; i < t.layout.presetNum; i++) {
-          that.model.roomIds.push({ layoutId: t.layout.id, roomId: null });
+          that.model.roomIds.push({
+            layoutId: t.layout.id,
+            roomId: null,
+            roomLayoutId: t.layout.id,
+          });
         }
         for (var b = 0; b < that.model.orderInfo.dayCount; b++) {
           var dayTime = moment(this.model.orderInfo.arrivalTime2)
@@ -802,6 +1146,7 @@ export default {
           });
         }
       });
+      console.log(" that.canUserRooms", that.canUserRooms);
       console.log("this.model", this.model);
       if (that.model.roomIds.length <= 0) {
         that.$message.warning("请先添加房间");
@@ -821,7 +1166,7 @@ export default {
           that.confirmLoading = true;
           let httpurl = "";
           let method = "";
-          if (!this.model.id) {
+          if (!this.model.orderInfo.id) {
             httpurl += this.url.add;
             method = "post";
           } else {
@@ -832,7 +1177,12 @@ export default {
             .then((res) => {
               if (res.success) {
                 that.$message.success(res.message);
-                that.$emit("ok");
+                if (that.model.orderInfo.id) {
+                  that.getBookingOrderInfo();
+                  that.disabled = true;
+                } else {
+                  that.$emit("ok");
+                }
               } else {
                 that.$message.warning(res.message);
               }
@@ -853,4 +1203,20 @@ export default {
 /deep/ .ant-form-item {
   margin-bottom: 5px !important;
 }
+.orange_color {
+  border-color: #ff9e35 !important;
+  color: #ff9e35 !important;
+  vertical-align: initial;
+}
+.booking_circle_span {
+  width: 18px;
+  height: 18px;
+  border-radius: 50%;
+  color: #f24e4c;
+  border: 1px solid #f24e4c;
+  font-size: 12px;
+  text-align: center;
+  line-height: 16px;
+  display: inline-block;
+}
 </style>

+ 47 - 22
src/views/room/modules/schedule/ScheduleRoomForm.vue

@@ -224,9 +224,11 @@
                     @select="(e) => handleSelectMember(e)"
                   >
                     <template slot="dataSource">
-                      <a-select-option v-for="item in result" :key="item">{{
-                        item
-                      }}</a-select-option>
+                      <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>
@@ -477,6 +479,10 @@ export default {
       default: false,
       required: false,
     },
+    bookingOrdersId: {
+      type: String,
+      default: "",
+    },
   },
   data() {
     return {
@@ -485,7 +491,7 @@ export default {
       model: {
         // data: data,
         orderInfo: {
-          bookingOrdersType: 1,
+          bookingOrdersType: this.bookingOrdersId ? 2 : 1,
           arrivalTime2: moment(new Date()).format("YYYY-MM-DD"),
           dueOutTime2: moment(endDate).format("YYYY-MM-DD"),
           arrivalTimeSpan: moment("18:00", "HH:mm"),
@@ -542,6 +548,8 @@ export default {
       warranterList: [],
       hourRoomRuleList: [],
       canUserRooms: [],
+      customerList: [],
+      oldcustomerList: [],
     };
   },
   computed: {
@@ -598,6 +606,12 @@ export default {
         this.hourRoomRuleList = res.result.records;
       }
     });
+    getAction("/bus/busCustomer/list", {}).then((res) => {
+      if (res.success) {
+        this.customerList = res.result.records;
+        this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+      }
+    });
 
     postAction("/rooms/cesAllDayPriceRule/fetch", { hotelId: _info.id }).then(
       (res) => {
@@ -702,9 +716,12 @@ export default {
       console.log(moment(m).format("HH:mm"));
     },
     tagClose2(rindex, bindex, index) {
-      // console.log(rindex, index);
-      // console.log(this.canUserRooms[index]);
-      this.canUserRooms[index].rooms.splice(rindex, 1);
+      var id =
+        this.canUserRooms[index].buildingRooms[bindex].floorRooms[rindex].id;
+      var findIndex = this.canUserRooms[index].rooms.findIndex(
+        (t) => t.id === id
+      );
+      this.canUserRooms[index].rooms.splice(findIndex, 1);
 
       this.$set(
         this.canUserRooms[index].buildingRooms[bindex].floorRooms[rindex],
@@ -730,16 +747,17 @@ export default {
     handleSearch(value) {
       let result;
       if (!value) {
-        result = [];
+        result = this.oldcustomerList;
       } else {
-        result = ["a", "b", "c"].map(
-          (domain) => `${value}${domain}(15888888888)`
-        );
+        result = this.oldcustomerList.filter((t) => t.name.includes(value));
       }
-      this.result = result;
+      this.customerList = result;
     },
     handleSelectMember(e) {
-      this.model.mobile = "158888888888";
+      var find = this.customerList.find((t) => t.id === e);
+      this.model.phone = find.phone;
+      this.model.contactName = find.name;
+      this.model.orderInfo.contactId = find.id;
     },
     moment,
     onChange(date, dateString) {
@@ -778,17 +796,20 @@ export default {
           that.model.roomIds.push({ layoutId: t.layout.id, roomId: null });
         }
         for (var b = 0; b < that.model.orderInfo.dayCount; b++) {
-          var dayTime = moment(this.model.orderInfo.arrivalTime2)
-            .add(b, "days")
-            .format("YYYY-MM-DD");
-          that.model.layoutDayPrices.push({
-            bookingType: 1,
-            dayTime: dayTime,
-            price: t.layout.favPrice,
-            roomLayoutId: t.layout.id,
-          });
+          if (t.layout.presetNum > 0) {
+            var dayTime = moment(this.model.orderInfo.arrivalTime2)
+              .add(b, "days")
+              .format("YYYY-MM-DD");
+            that.model.layoutDayPrices.push({
+              bookingType: 1,
+              dayTime: dayTime,
+              price: t.layout.favPrice,
+              roomLayoutId: t.layout.id,
+            });
+          }
         }
       });
+      that.model.orderInfo.bookingOrdersId = this.bookingOrdersId;
       console.log("this.model", this.model);
       if (that.model.roomIds.length <= 0) {
         that.$message.warning("请先添加房间");
@@ -815,6 +836,10 @@ export default {
             httpurl += this.url.edit;
             method = "put";
           }
+          if (this.model.orderInfo.bookingOrdersId) {
+            httpurl = "/business/busRoomBookingOrders/add-batch";
+            method = "post";
+          }
           httpAction(httpurl, this.model, method)
             .then((res) => {
               if (res.success) {

+ 7 - 1
src/views/room/modules/schedule/ScheduleRoomModal.vue

@@ -8,7 +8,7 @@
     :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
     @cancel="handleCancel"
     cancelText="关闭">
-    <schedule-room-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></schedule-room-form>
+    <schedule-room-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" :bookingOrdersId="bookingOrdersId"></schedule-room-form>
   </j-modal>
 </template>
 
@@ -20,6 +20,12 @@
     components: {
       ScheduleRoomForm
     },
+    props: {
+    bookingOrdersId: {
+      type: String,
+      default: "",
+    },
+  },
     data () {
       return {
         title:'',

Разница между файлами не показана из-за своего большого размера
+ 1204 - 0
src/views/room/modules/scheduleTeam/EdiBatchScheduleRoomForm.vue


+ 183 - 327
src/views/room/modules/scheduleTeam/EditScheduleRoomForm.vue

@@ -1,6 +1,10 @@
 <template>
   <a-spin :spinning="confirmLoading">
-    <j-form-container :disabled="formDisabled">
+    <div style="gap: 10px; display: flex; margin: 10px">
+      <a-button>加入团队</a-button>
+      <a-button @click="editOrder">确认修改</a-button>
+    </div>
+    <j-form-container>
       <a-form-model
         ref="form"
         :model="model"
@@ -11,7 +15,7 @@
           <div style="display: flex; gap: 15px">
             <div style="width: 39%">
               <h4 style="color: rgba(255, 141, 26, 1); font-weight: 600">
-                订价信息
+                团队信息
               </h4>
               <a-divider />
               <a-col :span="24">
@@ -99,66 +103,6 @@
                   </a-select>
                 </a-form-model-item>
               </a-col>
-
-              <a-col :span="24">
-                <a-form-model-item
-                  label="预定方式"
-                  :labelCol="labelCol"
-                  :wrapperCol="wrapperCol"
-                  prop="orderInfo.bookingDicWay"
-                >
-                  <a-select
-                    placeholder="预定方式"
-                    v-model="model.orderInfo.bookingDicWay"
-                  >
-                    <a-select-option
-                      :value="item.id"
-                      v-for="(item, index) in bookingdicWayList"
-                      :key="item.id"
-                    >
-                      {{ item.itemText }}
-                    </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="orderInfo.bookingType"
-                >
-                  <a-select
-                    placeholder="入住类型"
-                    v-model="model.orderInfo.bookingType"
-                    @change="bookingTypeChange"
-                  >
-                    <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" v-if="model.orderInfo.bookingType == 2">
-                <a-form-model-item
-                  label="时长"
-                  :labelCol="labelCol"
-                  :wrapperCol="wrapperCol"
-                  prop="orderInfo.hourRoomId"
-                >
-                  <a-select
-                    placeholder="时长"
-                    v-model="model.orderInfo.hourRoomId"
-                  >
-                    <a-select-option
-                      :value="item.id"
-                      v-for="(item, index) in hourRoomRuleList"
-                      :key="item.id"
-                    >
-                      {{ item.hourRoomName }}
-                    </a-select-option>
-                  </a-select>
-                </a-form-model-item>
-              </a-col>
               <a-col :span="24">
                 <a-form-model-item
                   label="公付项目"
@@ -327,119 +271,34 @@
               </a-col>
             </div>
             <div style="width: 61%">
-              <div
-                style="
-                  display: flex;
-                  justify-content: space-between;
-                  align-items: center;
-                "
-              >
-                <h4 style="color: rgba(255, 141, 26, 1); font-weight: 600">
-                  批次
-                </h4>
-                <div>
-                  <a-button type="link" @click="pulsBatch"> 添加 </a-button>
-                </div>
-              </div>
+              <h4 style="color: rgba(255, 141, 26, 1); font-weight: 600">
+                团队汇总
+              </h4>
               <a-divider />
-              <template v-for="(item, brindex) in batchRoomsTypeList">
-                <div :key="brindex">
-                  <div style="display: flex; justify-content: space-between">
-                    <div>
-                      <div style="display: flex; gap: 10px; font-weight: 600">
-                        <div>批次{{ brindex + 1 }}</div>
-                        <div>
-                          预抵时间:{{ item.arrivalTime2
-                          }}{{ moment(item.arrivalTimeSpan).format(" HH:mm") }}
-                        </div>
-                        <div>占房天数:{{ item.dayCount }}晚</div>
-                      </div>
-                      <div style="display: flex; gap: 10px; font-weight: 600">
-                        <div style="margin-left: 46px">
-                          预离时间:{{ item.dueOutTime2
-                          }}{{ moment(item.dueOutTimeSpan).format(" HH:mm") }}
-                        </div>
-                        <div style="padding-left: 10px">
-                          总价:{{ item.amount }}
-                        </div>
-                      </div>
-                    </div>
-                    <div>
-                      <a-button type="link" @click="editBatch(brindex)">
-                        修改
-                      </a-button>
-                      <a-button type="link" @click="deleteBatch(brindex)">
-                        删除
-                      </a-button>
-                    </div>
-                  </div>
+
+              <a-table
+                :columns="columns"
+                :data-source="model.batchRooms"
+                :pagination="false"
+                rowKey="batchNo"
+              >
+                <div
+                  slot="expandedRowRender"
+                  slot-scope="record, index, indent, expanded"
+                  style="margin: 0"
+                >
                   <a-table
-                    :columns="columns"
-                    :data-source="item.data"
+                    :columns="columns2"
+                    :data-source="record.buildingRooms"
                     :pagination="false"
                     :rowKey="rowKey"
                   >
-                    <div
-                      slot="expandedRowRender"
-                      slot-scope="record, index, indent, expanded"
-                      style="margin: 0"
-                    >
-                      <p>
-                        已排房:
-                        <template
-                          v-for="(building, bIndex) in record.buildingRooms"
-                        >
-                          <a-tag
-                            color="blue"
-                            closable
-                            :visible="visible"
-                            @close.stop="
-                              tagClose2(brindex, index, bIndex, rindex)
-                            "
-                            v-for="(item, rindex) in building.floorRooms"
-                            :key="rindex"
-                            v-if="item.check && item.check == 1"
-                            >{{ item.name }}</a-tag
-                          >
-                          <!-- <a-tag
-                        color="blue"
-                        closable
-                        :visible="visible"
-                        @close.stop="tagClose2(rindex, index)"
-                        v-for="(item, rindex) in record.rooms"
-                        :key="rindex"
-                        >{{ item.name }}</a-tag
-                      > -->
-                        </template>
-                      </p>
-                      <p>
-                        未排房:{{
-                          record.layout.presetNum - (record.rooms || []).length
-                        }}间
-                      </p>
-                    </div>
-                    <template slot="favPrice" slot-scope="text, record, index">
-                      <!-- <editable-cell
-                    :text="record.layout.favPrice"
-                    @change="onCellChange('favPrice', index, $event)"
-                  /> -->
-                      {{ record.layout.favPrice }}
-                    </template>
-                    <template slot="presetNum" slot-scope="text, record, index">
-                      <div>
-                        {{ record.layout.presetNum }}
-                      </div>
-                    </template>
                     <span slot="action" slot-scope="text, record, index">
-                      <a
-                        :disabled="record.layout.presetNum <= 0"
-                        @click="pulsRoom(brindex, index)"
-                        >排房</a
-                      >
+                      <a @click="pulsRoom(brindex, index)">退出团队</a>
                     </span>
                   </a-table>
-                </div></template
-              >
+                </div>
+              </a-table>
             </div>
           </div>
         </a-row>
@@ -476,54 +335,24 @@ import EditBatchSelectRoomTypeFormModal from "./EditBatchSelectRoomTypeFormModal
 const date = new Date();
 const endDate = new Date(date.setDate(date.getDate() + 1));
 const columns = [
-  // {
-  //     title: "",
-  //     dataIndex: "key",
-  //     width: 20,
-  //   },
   {
-    title: "房型",
-    dataIndex: "name",
-    width: 150,
-    customRender: function (text, record) {
-      return record.layout.name;
+    title: "批次",
+    dataIndex: "batchNo",
+    customRender: function (text, record, index) {
+      return index + 1;
     },
   },
   {
-    title: "门市价",
-    dataIndex: "marketPrice",
-    width: 100,
-    customRender: function (text, record) {
-      return record.layout.marketPrice;
-    },
+    title: "预抵时间",
+    dataIndex: "arrivalTime",
   },
   {
-    title: "优惠价",
-    dataIndex: "favPrice",
-    width: 120,
-    scopedSlots: { customRender: "favPrice" },
+    title: "预离时间",
+    dataIndex: "dueOutTime",
   },
   {
-    title: "可订数/可超数",
-    dataIndex: "canUseCount",
-    width: 170,
-    customRender: function (text, record) {
-      return record.layout.canUseCount + "/0";
-    },
-  },
-  {
-    title: "预定间数",
-    dataIndex: "presetNum",
-    width: 100,
-    scopedSlots: { customRender: "presetNum" },
-  },
-  {
-    title: "操作",
-    dataIndex: "action",
-    align: "center",
-    fixed: "right",
-    width: 70,
-    scopedSlots: { customRender: "action" },
+    title: "天数",
+    dataIndex: "dayCount",
   },
 ];
 const data = [];
@@ -553,11 +382,46 @@ export default {
       default: false,
       required: false,
     },
+    id: {
+      type: String,
+      default: "",
+    },
   },
   data() {
     return {
+      // id: "",
       visible: true,
       columns,
+      columns2: [
+        {
+          title: "姓名",
+          dataIndex: "name",
+        },
+        {
+          title: "房号",
+          dataIndex: "marketPrice",
+        },
+        {
+          title: "房型",
+          dataIndex: "favPrice",
+        },
+        {
+          title: "入住时间",
+          dataIndex: "canUseCount",
+        },
+        {
+          title: "状态",
+          dataIndex: "canUseCount",
+        },
+        {
+          title: "操作",
+          dataIndex: "action",
+          align: "center",
+          fixed: "right",
+          width: 70,
+          scopedSlots: { customRender: "action" },
+        },
+      ],
       batchOrderInfo: {},
       model: {
         // data: data,
@@ -614,8 +478,10 @@ export default {
       },
       url: {
         add: "/business/busRoomBookingOrders/add",
-        edit: "/business/busMeetingRoom/edit",
+        edit: "/business/busRoomBookingOrders/edit",
         queryById: "/business/busMeetingRoom/queryById",
+        getBookingOrderInfo:
+          "/business/busRoomBookingOrders/getBookingOrderInfo",
       },
       result: [],
       selectIndex: 0,
@@ -627,6 +493,8 @@ export default {
       canUserRooms: [],
       teamTypeDicList: [],
       batchRoomsTypeList: [],
+      customerList: [],
+      oldcustomerList: [],
     };
   },
   computed: {
@@ -642,79 +510,114 @@ export default {
     },
   },
   created() {
-    var _info = JSON.parse(localStorage.getItem("storeInfo"));
-    if (_info) {
-      this.model.hotelId = _info.id;
-    }
-    //备份model原始值
-    this.modelDefault = JSON.parse(JSON.stringify(this.model));
-
-    getAction("/business/busDictItem/list", {
-      hotelId: _info.id,
-      dictId: "1639544105636417538",
-    }).then((res) => {
-      if (res.success) {
-        this.teamTypeDicList = res.result.records;
-      }
-    });
-    getAction("/business/busDictItem/list", {
-      hotelId: _info.id,
-      dictId: "1639538915239743490",
-    }).then((res) => {
-      if (res.success) {
-        this.customerSourceList = res.result.records;
-      }
-    });
-    getAction("/business/busDictItem/list", {
-      hotelId: _info.id,
-      dictId: "1639544187093995521",
-    }).then((res) => {
-      if (res.success) {
-        this.bookingdicWayList = res.result.records;
-      }
-    });
-    getAction("/business/busSalesPerson/list", {
-      hotelId: _info.id,
-      pageNo: 1,
-      pageSize: 100,
-    }).then((res) => {
-      if (res.success) {
-        this.warranterList = res.result.records;
+    this.load()
+  },
+  mounted() {
+    // this.pulsBatch();
+  },
+  methods: {
+    load(id) {
+      // this.id = id;
+      var _info = JSON.parse(localStorage.getItem("storeInfo"));
+      if (_info) {
+        this.model.hotelId = _info.id;
       }
-    });
+      //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
 
-    getAction("/rooms/cesHourRoomRule/list", {
-      pageNo: 1,
-      pageSize: 100,
-    }).then((res) => {
-      if (res.success) {
-        this.hourRoomRuleList = res.result.records;
-      }
-    });
+      getAction("/business/busDictItem/list", {
+        hotelId: _info.id,
+        dictId: "1639544105636417538",
+      }).then((res) => {
+        if (res.success) {
+          this.teamTypeDicList = res.result.records;
+        }
+      });
+      getAction("/business/busDictItem/list", {
+        hotelId: _info.id,
+        dictId: "1639538915239743490",
+      }).then((res) => {
+        if (res.success) {
+          this.customerSourceList = res.result.records;
+        }
+      });
+      getAction("/business/busDictItem/list", {
+        hotelId: _info.id,
+        dictId: "1639544187093995521",
+      }).then((res) => {
+        if (res.success) {
+          this.bookingdicWayList = res.result.records;
+        }
+      });
+      getAction("/business/busSalesPerson/list", {
+        hotelId: _info.id,
+        pageNo: 1,
+        pageSize: 100,
+      }).then((res) => {
+        if (res.success) {
+          this.warranterList = res.result.records;
+        }
+      });
 
-    postAction("/rooms/cesAllDayPriceRule/fetch", { hotelId: _info.id }).then(
-      (res) => {
+      getAction("/rooms/cesHourRoomRule/list", {
+        pageNo: 1,
+        pageSize: 100,
+      }).then((res) => {
         if (res.success) {
-          if (
-            res.result &&
-            res.result.cesAllDayPriceRule &&
-            res.result.cesAllDayPriceRule.leaveTime
-          ) {
-            this.model.orderInfo.dueOutTimeSpan = moment(
-              res.result.cesAllDayPriceRule.leaveTime,
-              "HH:mm"
-            );
+          this.hourRoomRuleList = res.result.records;
+        }
+      });
+
+      // postAction("/rooms/cesAllDayPriceRule/fetch", { hotelId: _info.id }).then(
+      //   (res) => {
+      //     if (res.success) {
+      //       if (
+      //         res.result &&
+      //         res.result.cesAllDayPriceRule &&
+      //         res.result.cesAllDayPriceRule.leaveTime
+      //       ) {
+      //         this.model.orderInfo.dueOutTimeSpan = moment(
+      //           res.result.cesAllDayPriceRule.leaveTime,
+      //           "HH:mm"
+      //         );
+      //       }
+      //     }
+
+      //     // this.loadRooms();
+      //   }
+      // );
+      this.getBookingOrderInfo();
+    },
+    getbusCustomer() {
+      getAction("/bus/busCustomer/list", {}).then((res) => {
+        if (res.success) {
+          this.customerList = res.result.records;
+          this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+          var find = this.oldcustomerList.find(
+            (t) => t.id == this.model.orderInfo.contactId
+          );
+          if (find) {
+            this.model.contactName = find.name;
+            this.model.phone = find.phone;
           }
+
+          this.$emit("ok", this.model);
         }
+      });
+    },
+    getBookingOrderInfo() {
+      console.log("this.id", this.id);
+      getAction(this.url.getBookingOrderInfo, {
+        bookingNo: this.id,
+      }).then((res) => {
+        if (res.success) {
+          this.model = res.result;
 
-        // this.loadRooms();
-      }
-    );
-  },
-  mounted() {
-    // this.pulsBatch();
-  },
-  methods: {
+          this.getbusCustomer();
+          // this.loadRooms();
+        }
+      });
+    },
     deleteBatch(index) {
       this.batchRoomsTypeList.splice(index, 1);
     },
@@ -733,7 +636,7 @@ export default {
       console.log("this.canUserRooms", this.canUserRooms);
     },
     rowKey(record) {
-      return record.layout.id;
+      return record.name;
     },
     loadRooms() {
       getAction("/rooms/cesRooms/can-user-rooms", {
@@ -937,66 +840,19 @@ export default {
       this.model = Object.assign({}, record);
       this.visible = true;
     },
+    editOrder() {
+      this.submitForm();
+    },
     submitForm() {
       const that = this;
-      that.model.roomIds = [];
-      that.model.batchRooms = [];
-      console.log("this.model", this.model);
-      console.log("batchRoomsTypeList", this.batchRoomsTypeList);
-      this.batchRoomsTypeList.forEach((t) => {
-        var dateArr = t.key.split(",");
-        var startOf = dateArr[0];
-        var endOf = dateArr[1];
-        var roomIds = [];
-        var layoutDayPrices = [];
-        t.data.forEach((d) => {
-          d.buildingRooms.forEach((b) => {
-            b.floorRooms.forEach((f) => {
-              if (f.check && f.check === 1) {
-                roomIds.push({
-                  layoutId: d.layout.id,
-                  roomId: f.id,
-                });
-              }
-            });
-          });
 
-          var len = roomIds.filter((it) => it.layoutId === d.layout.id).length;
-          for (var i = len; i < d.layout.presetNum; i++) {
-            roomIds.push({ layoutId: d.layout.id, roomId: null });
-          }
-          for (var b = 0; b < t.dayCount; b++) {
-            var dayTime = moment(t.arrivalTime2)
-              .add(b, "days")
-              .format("YYYY-MM-DD");
-            layoutDayPrices.push({
-              bookingType: 2,
-              dayTime: dayTime,
-              price: d.layout.favPrice,
-              roomLayoutId: d.layout.id,
-            });
-          }
-        });
-        this.model.batchRooms.push({
-          arrivalTime: startOf,
-          dueOutTime: endOf,
-          dayCount: t.dayCount,
-          roomIds: roomIds,
-          layoutDayPrices: layoutDayPrices,
-        });
-      });
-
-      if (that.model.batchRooms.length <= 0) {
-        that.$message.warning("请先添加批次");
-        return;
-      }
       // 触发表单验证
       this.$refs.form.validate((valid) => {
         if (valid) {
           that.confirmLoading = true;
           let httpurl = "";
           let method = "";
-          if (!this.model.id) {
+          if (!this.model.orderInfo.id) {
             httpurl += this.url.add;
             method = "post";
           } else {
@@ -1007,7 +863,7 @@ export default {
             .then((res) => {
               if (res.success) {
                 that.$message.success(res.message);
-                that.$emit("ok");
+                that.getBookingOrderInfo();
               } else {
                 that.$message.warning(res.message);
               }

+ 0 - 88
src/views/room/modules/scheduleTeam/EditScheduleRoomModal.vue

@@ -1,88 +0,0 @@
-<template>
-  <j-modal
-    :title="title"
-    :width="width"
-    :visible="visible"
-    switchFullscreen
-    @ok="handleOk"
-    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
-    @cancel="handleCancel"
-    cancelText="关闭">
-    <schedule-room-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></schedule-room-form>
-  </j-modal>
-</template>
-
-<script>
-
-  import ScheduleRoomForm from './EditScheduleRoomForm'
-  export default {
-    name: 'ScheduleRoomModal',
-    components: {
-      ScheduleRoomForm
-    },
-    data () {
-      return {
-        title:'',
-        width:1300,
-        visible: false,
-        disableSubmit: false
-      }
-    },
-    methods: {
-      add () {
-        this.visible=true
-        this.$nextTick(()=>{
-          this.$refs.realForm.add();
-        })
-      },
-      addList(record) {
-      this.visible = true;
-      this.$nextTick(() => {
-        this.$refs.realForm.addList(record);
-      });
-    },
-      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>
-<style scoped>
-/deep/.ant-modal-body {
-  padding: 12px;
-  max-height: calc(80vh - 150px);
-  overflow-y: auto;
-  &::-webkit-scrollbar {
-    width: 6px;
-    /*高宽分别对应横竖滚动条的尺寸*/
-    height: 1px;
-  }
-
-  &::-webkit-scrollbar-thumb {
-    background: #e3e3e6;
-    border-radius: 6px;
-  }
-
-  &::-webkit-scrollbar-track {
-    background: transparent;
-    border-radius: 5px;
-  }
-}
-</style>

+ 32 - 20
src/views/room/modules/scheduleTeam/ScheduleRoomForm.vue

@@ -229,10 +229,12 @@
                     @search="handleSearch"
                     @select="(e) => handleSelectMember(e)"
                   >
-                    <template slot="dataSource">
-                      <a-select-option v-for="item in result" :key="item">{{
-                        item
-                      }}</a-select-option>
+                  <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>
@@ -627,6 +629,8 @@ export default {
       canUserRooms: [],
       teamTypeDicList: [],
       batchRoomsTypeList: [],
+      customerList: [],
+      oldcustomerList: [],
     };
   },
   computed: {
@@ -691,7 +695,12 @@ export default {
         this.hourRoomRuleList = res.result.records;
       }
     });
-
+    getAction("/bus/busCustomer/list", {}).then((res) => {
+      if (res.success) {
+        this.customerList = res.result.records;
+        this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+      }
+    });
     postAction("/rooms/cesAllDayPriceRule/fetch", { hotelId: _info.id }).then(
       (res) => {
         if (res.success) {
@@ -909,16 +918,17 @@ export default {
     handleSearch(value) {
       let result;
       if (!value) {
-        result = [];
+        result = this.oldcustomerList;
       } else {
-        result = ["a", "b", "c"].map(
-          (domain) => `${value}${domain}(15888888888)`
-        );
+        result = this.oldcustomerList.filter((t) => t.name.includes(value));
       }
-      this.result = result;
+      this.customerList = result;
     },
     handleSelectMember(e) {
-      this.model.mobile = "158888888888";
+      var find = this.customerList.find((t) => t.id === e);
+      this.model.phone = find.phone;
+      this.model.contactName = find.name;
+      this.model.orderInfo.contactId = find.id;
     },
     moment,
     onChange(date, dateString) {
@@ -966,15 +976,17 @@ export default {
             roomIds.push({ layoutId: d.layout.id, roomId: null });
           }
           for (var b = 0; b < t.dayCount; b++) {
-            var dayTime = moment(t.arrivalTime2)
-              .add(b, "days")
-              .format("YYYY-MM-DD");
-            layoutDayPrices.push({
-              bookingType: 2,
-              dayTime: dayTime,
-              price: d.layout.favPrice,
-              roomLayoutId: d.layout.id,
-            });
+            if (d.layout.presetNum > 0) {
+              var dayTime = moment(t.arrivalTime2)
+                .add(b, "days")
+                .format("YYYY-MM-DD");
+              layoutDayPrices.push({
+                bookingType: 2,
+                dayTime: dayTime,
+                price: d.layout.favPrice,
+                roomLayoutId: d.layout.id,
+              });
+            }
           }
         });
         this.model.batchRooms.push({

+ 56 - 21
src/views/room/scheduledetail.vue

@@ -1,13 +1,13 @@
 <template>
-  <a-card style="width: 100%; height: 100%">
-    <div style="display: flex; gap: 10px">
+  <a-card>
+    <div style="display: flex; gap: 10px" v-if="isShow">
       <div style="width: 18%; background: #f4f5f8">
         <div style="font-size: 16px; font-weight: 600; padding: 15px 15px 0">
-          共计关联2个房间
+          共计关联{{ roomCount }}个房间
         </div>
         <a-divider></a-divider>
         <a-collapse v-model="activeKey" :bordered="false">
-          <a-collapse-panel
+          <!-- <a-collapse-panel
             key="1"
             header="接待(1间)"
             style="
@@ -37,8 +37,8 @@
                 </a-row>
               </a-checkbox-group>
             </div>
-          </a-collapse-panel>
-          <a-collapse-panel
+          </a-collapse-panel> -->
+          <!-- <a-collapse-panel
             key="2"
             header="Q100(1人)"
             style="
@@ -59,10 +59,10 @@
               <span style="font-weight: 700">何先生</span>
               <div style="font-weight: 700; float: right">¥ -82.00</div>
             </div>
-          </a-collapse-panel>
+          </a-collapse-panel> -->
           <a-collapse-panel
             key="3"
-            header="预定(2间)"
+            :header="'预定(' + scheduleRoomCount + '间)'"
             style="
               background: #f7f7f7;
               border-radius: 4px;
@@ -71,10 +71,22 @@
               overflow: hidden;
             "
           >
-          <div class="select">
-              <a-tag color="#2db7f5"> 预定中 </a-tag>
-              <span>何先生</span>
-              <div style="float: right">1888888888</div>
+            <div class="select">
+              <div
+                style="
+                  display: flex;
+                  justify-content: space-between;
+                  overflow: hidden;
+                  text-overflow: ellipsis;
+                  white-space: nowrap;
+                "
+              >
+                <div>
+                  <a-tag color="#2db7f5"> 预定中 </a-tag>
+                  <span>{{ busRoomBookingOrders.contactName }}</span>
+                </div>
+                <div style="float: right">{{ busRoomBookingOrders.phone }}</div>
+              </div>
             </div>
           </a-collapse-panel>
         </a-collapse>
@@ -83,7 +95,11 @@
         <a-tabs default-active-key="1">
           <a-tab-pane key="1">
             <span slot="tab"> 详单 </span>
-            <edit-schedule-room-form :id="id"></edit-schedule-room-form>
+            <edit-schedule-room-form
+              :id="id"
+              :disabled2="true"
+              @ok="getCallback"
+            ></edit-schedule-room-form>
           </a-tab-pane>
           <a-tab-pane key="2">
             <span slot="tab"> 账单 </span>
@@ -104,22 +120,41 @@ export default {
   components: {
     EditScheduleRoomForm,
   },
-  props: {
-    id: {
-      type: Boolean,
-      default: "",
-    },
-  },
+  // props: {
+  //   id: {
+  //     type: String,
+  //     default: "",
+  //   },
+  // },
   data() {
     return {
+      id: "",
       activeKey: ["1", "2", "3"],
+      scheduleRoomCount: 0,
+      roomCount: 0,
+      scheduleRoomList: [],
+      busRoomBookingOrders: {},
+      isShow: true,
     };
   },
-  created() {
+  activated() {
+    //重新进入界面可能参数id不一样,需要重新加载数据,使用钩子方式
     this.id = this.$route.query.id;
-    console.log("created");
+    this.isShow = true;
+  },
+  deactivated() {
+    this.isShow = false;
   },
   methods: {
+    getCallback(e) {
+      console.log("getCallback", e);
+      this.busRoomBookingOrders = e;
+      this.roomCount = e.roomIds.length;
+      this.scheduleRoomList = e.roomIds.filter(
+        (t) => t.roomStatus == 1 || t.roomStatus == 2
+      );
+      this.scheduleRoomCount = this.scheduleRoomList.length;
+    },
     onChange(checkedValues) {
       console.log("checked = ", checkedValues);
     },

+ 269 - 0
src/views/room/scheduleteamdetail.vue

@@ -0,0 +1,269 @@
+<template>
+  <a-card>
+    <div style="display: flex; gap: 10px" v-if="isShow">
+      <div style="width: 20%; background: #f4f5f8">
+        <div style="font-size: 16px; font-weight: 600; padding: 15px 15px 0">
+          共计关联2个房间
+        </div>
+        <a-divider></a-divider>
+        <div
+          :class="[selectMain ? 'select' : '']"
+          style="font-size: 16px; font-weight: 500; cursor: pointer"
+          @click="selectMain = true"
+        >
+          查看团队主账务
+        </div>
+        <a-collapse v-model="activeKey" :bordered="false">
+          <!-- <a-collapse-panel
+            key="1"
+            header="接待(1间)"
+            style="
+              background: #f7f7f7;
+              border-radius: 4px;
+              margin-bottom: 24px;
+              border: 0;
+              overflow: hidden;
+            "
+          >
+            <div class="cell_check_group">
+              <a-checkbox-group @change="onChange">
+                <a-row>
+                  <a-col :span="12">
+                    <a-checkbox value="1"> 正常入住 </a-checkbox>
+                  </a-col>
+                  <a-col :span="12">
+                    <a-checkbox value="2"> 未结退房 </a-checkbox>
+                  </a-col>
+                  <a-col :span="12">
+                    <a-checkbox value="3"> 已结退房</a-checkbox>
+                  </a-col>
+                  <a-col :span="12">
+                    <a-checkbox value="4"> 联房退房 </a-checkbox>
+                  </a-col>
+                </a-row>
+              </a-checkbox-group>
+            </div>
+            <a-collapse activeKey="1" expandIconPosition="right">
+              <a-collapse-panel key="1" header="批次2">
+                <a-collapse
+                  activeKey="1"
+                  :bordered="false"
+                  expandIconPosition="right"
+                >
+                  <a-collapse-panel key="1" header="Q100(1人)">
+                    <div class="select" style="padding: 5px">
+                      <a-tag color="#87d068"> 正常入住 </a-tag>
+                      <span
+                        class="booking_circle_span orange_color"
+                        style="margin-left: 4px"
+                        >主</span
+                      >
+                      <span style="font-weight: 700">何先生</span>
+                      <div style="font-weight: 700; float: right">
+                        ¥ -82.00
+                      </div>
+                    </div>
+                  </a-collapse-panel>
+                </a-collapse>
+              </a-collapse-panel>
+            </a-collapse>
+          </a-collapse-panel> -->
+          <a-collapse-panel
+            key="3"
+            :header="'预定(' + batchRoomsCount + '批次)'"
+            style="
+              background: #f7f7f7;
+              border-radius: 4px;
+              margin-bottom: 24px;
+              border: 0;
+              overflow: hidden;
+            "
+          >
+            <div
+              :class="[item.check == 1 ? 'select' : '']"
+              style="padding: 5px; cursor: pointer"
+              @click="selectBatch(item)"
+              v-for="(item, index) in batchRoomsList"
+            >
+              <div
+                style="
+                  display: flex;
+                  justify-content: space-between;
+                  overflow: hidden;
+                  text-overflow: ellipsis;
+                  white-space: nowrap;
+                "
+              >
+                <div>
+                  <a-tag color="#2db7f5"> 预定中 </a-tag>
+                  <span>批次{{ index + 1 }}(2间)</span>
+                </div>
+                <div>{{ busRoomBookingOrders.phone }}</div>
+              </div>
+            </div>
+          </a-collapse-panel>
+        </a-collapse>
+        <div style="display: flex; justify-content: center">
+          <a-button type="link" @click="addPatch">添加批次</a-button>
+        </div>
+      </div>
+      <div style="width: 80%" v-if="selectMain">
+        <a-tabs default-active-key="1">
+          <a-tab-pane key="1">
+            <span slot="tab"> 详单 </span>
+            <edit-schedule-room-form-main
+              :id="id"
+              :disabled="true"
+              @ok="getCallback"
+              ref="EditScheduleRoomFormMain"
+            ></edit-schedule-room-form-main>
+          </a-tab-pane>
+          <a-tab-pane key="2">
+            <span slot="tab"> 账单 </span>
+          </a-tab-pane>
+          <a-tab-pane key="3">
+            <span slot="tab"> 日志 </span>
+          </a-tab-pane>
+        </a-tabs>
+      </div>
+      <div style="width: 80%" v-else>
+        <a-tabs default-active-key="1">
+          <a-tab-pane key="1">
+            <span slot="tab"> 详单 </span>
+            <edi-batch-schedule-room-form
+              :id="batchId"
+              :disabled="true"
+            ></edi-batch-schedule-room-form>
+          </a-tab-pane>
+          <a-tab-pane key="2">
+            <span slot="tab"> 日志 </span>
+          </a-tab-pane>
+        </a-tabs>
+      </div>
+    </div>
+    <add-batch-schedule-room-modal
+      ref="modalAddBatchScheduleRoom"
+      :bookingOrdersId="bookingOrdersId"
+      @ok="modalFormOk"
+    ></add-batch-schedule-room-modal>
+  </a-card>
+</template>
+
+<script>
+import EditScheduleRoomFormMain from "./modules/scheduleTeam/EditScheduleRoomFormMain.vue";
+import EdiBatchScheduleRoomForm from "./modules/scheduleTeam/EdiBatchScheduleRoomForm.vue";
+import AddBatchScheduleRoomModal from "./modules/schedule/ScheduleRoomModal";
+export default {
+  components: {
+    EditScheduleRoomFormMain,
+    EdiBatchScheduleRoomForm,
+    AddBatchScheduleRoomModal,
+  },
+  // props: {
+  //   id: {
+  //     type: String,
+  //     default: "",
+  //   },
+  // },
+  data() {
+    return {
+      isShow: true,
+      selectMain: true,
+      id: "",
+      batchId: "",
+      activeKey: ["1", "2", "3"],
+      activeKey2: ["1"],
+      scheduleRoomCount: 0,
+      batchRoomsCount: 0,
+      batchRoomsList: [],
+      busRoomBookingOrders: {},
+      bookingOrdersId: "",
+    };
+  },
+  created() {
+    this.id = this.$route.query.id;
+    console.log("created", this.id);
+  },
+  // beforeRouteEnter(to, from, next) {
+  //   console.log("to", to.query.id);
+  //   console.log("from", from);
+  //   var id = to.query.id;
+  //   console.log("this.id", id);
+  //   next();
+  // },
+  activated() {
+    //重新进入界面可能参数id不一样,需要重新加载数据,使用钩子方式
+    this.id = this.$route.query.id;
+    this.selectMain = true;
+    // try {
+    //   this.$refs.EditScheduleRoomFormMain.load(this.id);
+    // } catch {}
+    this.isShow = true;
+  },
+  deactivated() {
+    this.isShow = false;
+  },
+  methods: {
+    addPatch() {
+      this.$refs.modalAddBatchScheduleRoom.add();
+      this.$refs.modalAddBatchScheduleRoom.title = "添加批次";
+      this.$refs.modalAddBatchScheduleRoom.disableSubmit = false;
+    },
+    modalFormOk(e) {},
+    selectBatch(item) {
+      item.check = item.check == 1 ? 0 : 1;
+      this.selectMain = item.check == 0;
+      this.batchId = item.id;
+    },
+    getCallback(e) {
+      console.log("getCallback", e);
+      this.busRoomBookingOrders = e;
+      this.batchRoomsCount = e.batchRooms.length;
+      this.batchRoomsList = e.batchRooms;
+      this.batchRoomsList.forEach((t) => {
+        this.$set(t, "check", 0);
+      });
+      this.bookingOrdersId =
+        this.busRoomBookingOrders.orderInfo.id;
+      console.log("bookingOrdersId", this.bookingOrdersId);
+    },
+    onChange(checkedValues) {
+      console.log("checked = ", checkedValues);
+    },
+  },
+};
+</script>
+
+<style scoped>
+.cell_check_group {
+  padding: 10px;
+  background-color: #d9e5ec;
+  border-radius: 4px;
+  margin: 0px 0 6px 0px;
+}
+.orange_color {
+  border-color: #ff9e35 !important;
+  color: #ff9e35 !important;
+  vertical-align: initial;
+}
+.booking_circle_span {
+  width: 18px;
+  height: 18px;
+  border-radius: 50%;
+  color: #f24e4c;
+  border: 1px solid #f24e4c;
+  font-size: 12px;
+  text-align: center;
+  line-height: 16px;
+  display: inline-block;
+}
+.select {
+  color: #000 !important;
+  border: 1px solid #f24e4c !important;
+  background: transparent;
+  border-radius: 4px;
+  /* padding: 0 10px; */
+  line-height: 32px;
+  cursor: pointer;
+}
+</style>