浏览代码

散客钟点房前端规则改动

gqx 2 年之前
父节点
当前提交
5d7adcd021

+ 17 - 8
src/views/room/fangtailive.vue

@@ -58,10 +58,12 @@
             <a-button style="margin-bottom: 10px" @click="toPage" type="danger"
               >查询散客详单</a-button
             >
-            <a-button style="margin-bottom: 10px" @click="toTeamPage" type="danger"
+            <a-button
+              style="margin-bottom: 10px"
+              @click="toTeamPage"
+              type="danger"
               >查询团队详单</a-button
             >
-            
           </div>
           <div class="week-top">
             <div class="w-choose-status">
@@ -718,10 +720,10 @@ export default {
   methods: {
     toPage() {
       this.$router.push({
-        path: "/room/scheduledetail",
-        query: { id: "YD20230331112026203" },
-        // name:'room-scheduledetail',
-        // params:{id:'YD20230330144437313'}
+        // path: "/room/scheduledetail",
+        // query: { id: "YD20230331112026203" },
+        name: "room-scheduledetail",
+        params: { id: "YD20230331112026203" },
       });
     },
     toTeamPage() {
@@ -852,8 +854,15 @@ export default {
       this.$refs.modalForm.title = "维修";
       this.$refs.modalForm.disableSubmit = false;
     },
-    modalFormOk() {
-      this.loadData();
+    modalFormOk(e) {
+      console.log("e", e);
+      // this.loadData();
+      this.$router.push({
+        // path: "/room/scheduledetail",
+        // query: { id: e },
+        name: "room-scheduledetail",
+        params: { id: e },
+      });
     },
     loadData() {
       // var _info = JSON.parse(localStorage.getItem("storeInfo"));

+ 85 - 20
src/views/room/modules/checkIn/BillRoomForm.vue

@@ -36,7 +36,7 @@
                       </h4>
                     </div>
                     <a-divider />
-                    <a-col :span="8">
+                    <!-- <a-col :span="8">
                       <a-form-model-item
                         label="姓名"
                         :labelCol="labelCol"
@@ -50,10 +50,6 @@
                           },
                         ]"
                       >
-                        <!-- <a-input
-                          v-model="room.key1"
-                          placeholder="请输入姓名"
-                        ></a-input> -->
                         <a-auto-complete
                           v-model="room.key1"
                           placeholder="请输入姓名"
@@ -69,6 +65,36 @@
                           </template>
                         </a-auto-complete>
                       </a-form-model-item>
+                    </a-col> -->
+                    <a-col :span="8">
+                      <a-form-model-item
+                        label="姓名"
+                        :labelCol="labelCol"
+                        :wrapperCol="wrapperCol"
+                        :prop="`rooms[${index}].key1`"
+                        :rules="[
+                          {
+                            required: true,
+                            message: '请输入姓名!',
+                            trigger: 'change',
+                          },
+                        ]"
+                      >
+                        <a-auto-complete
+                          v-model="room.key1"
+                          placeholder="请输入姓名"
+                          @search="handleSearch"
+                          @select="(e) => handleSelectMember(room, 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="8">
                       <a-form-model-item
@@ -312,8 +338,8 @@
                     prop="sex"
                   >
                     <a-select placeholder="入住类型">
-                      <a-select-option value="全天"> 全天 </a-select-option>
-                      <a-select-option value="钟点"> 钟点 </a-select-option>
+                      <a-select-option :value="1"> 全天 </a-select-option>
+                      <a-select-option :value="2"> 钟点 </a-select-option>
                     </a-select>
                   </a-form-model-item>
                 </a-col>
@@ -325,8 +351,13 @@
                     prop="sex"
                   >
                     <a-select placeholder="订单来源">
-                      <a-select-option value="散客"> 散客 </a-select-option>
-                      <a-select-option value="美团"> 美团 </a-select-option>
+                      <a-select-option
+                        :value="item.id"
+                        v-for="(item, index) in customerSourceList"
+                        :key="item.id"
+                      >
+                        {{ item.itemText }}
+                      </a-select-option>
                     </a-select>
                   </a-form-model-item>
                 </a-col>
@@ -385,8 +416,10 @@
                     prop="sex"
                   >
                     <a-select placeholder="宾客类型">
-                      <a-select-option value="散客"> 散客 </a-select-option>
-                      <a-select-option value="会员"> 会员 </a-select-option>
+                      <a-select-option :value="1"> 散客 </a-select-option>
+                      <a-select-option :value="2"> 会员 </a-select-option>
+                      <a-select-option :value="3"> 协议单位 </a-select-option>
+                      <a-select-option :value="4"> 中介 </a-select-option>
                     </a-select>
                   </a-form-model-item>
                 </a-col>
@@ -430,8 +463,13 @@
                     prop="sex"
                   >
                     <a-select placeholder="销售员工">
-                      <a-select-option value="a"> a </a-select-option>
-                      <a-select-option value="b"> b </a-select-option>
+                      <a-select-option
+                        :value="item.id"
+                        v-for="item in warranterList"
+                        :key="item.id"
+                      >
+                        {{ item.name }}
+                      </a-select-option>
                     </a-select>
                   </a-form-model-item>
                 </a-col>
@@ -830,6 +868,10 @@ export default {
         queryById: "/business/busMeetingRoom/queryById",
       },
       result: [],
+      customerList: [],
+      oldcustomerList: [],
+      customerSourceList: [],
+      warranterList: [],
     };
   },
   computed: {
@@ -844,24 +886,47 @@ export default {
     }
     //备份model原始值
     this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    getAction("/bus/busCustomer/list", {}).then((res) => {
+      if (res.success) {
+        this.customerList = res.result.records;
+        this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+      }
+    });
+    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: {
     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(room, e) {
+      var find = this.customerList.find((t) => t.id === e);
+      room.key1 = find.name;
       room.key2 = "男";
       room.key3 = "汉";
-      room.key4 = "11111111111";
-      room.key5 = "158888888888";
+      room.key4 = find.phone;
+      room.key5 = find.phone;
       room.key6 = "火星";
     },
     pulsRoom() {

+ 84 - 9
src/views/room/modules/schedule/EditScheduleRoomForm.vue

@@ -90,6 +90,7 @@
                     :default-value="moment('12:00', 'HH:mm')"
                     format="HH:mm"
                     :allowClear="false"
+                    @change="arrivalTimeSpanChange"
                   />
                 </a-form-model-item>
               </a-col>
@@ -101,20 +102,20 @@
                   prop="orderInfo.dueOutTime2"
                 >
                   <j-date
-                    :disabled="disabled"
+                    :disabled="disabled || model.orderInfo.bookingType === 2"
                     placeholder="预离时间"
                     v-model="model.orderInfo.dueOutTime2"
                     style="width: 180px"
                     :allowClear="false"
                     :disabled-date="disabledDate"
-                    @change="arrivalTimeChange"
+                    @change="arrivalTimeChange2"
                   />
                   <a-time-picker
-                    :disabled="disabled"
                     style="width: 80px; margin-left: 2px"
                     v-model="model.orderInfo.dueOutTimeSpan"
                     format="HH:mm"
                     :allowClear="false"
+                    :disabled="disabled || model.orderInfo.bookingType === 2"
                   />
                 </a-form-model-item>
               </a-col>
@@ -325,7 +326,7 @@
                     v-model="model.orderInfo.warranter"
                   >
                     <a-select-option
-                      value="a"
+                      :value="item.id"
                       v-for="item in warranterList"
                       :key="item.id"
                     >
@@ -944,6 +945,29 @@ export default {
           this.model.orderInfo.hourRoomId = hourRoomRule.id;
         }
       }
+      if (this.model.orderInfo.bookingType === 2) {
+        var find = this.hourRoomRuleList.find(
+          (t) => t.id === this.model.orderInfo.hourRoomId
+        );
+        if (find) {
+          var mDate = moment(
+            this.model.orderInfo.arrivalTime2 +
+              " " +
+              moment(this.model.orderInfo.arrivalTimeSpan).format("HH:mm")
+          ).add(find.afterOpenRoom, "minutes");
+          this.model.orderInfo.dueOutTime2 = mDate.format("YYYY-MM-DD");
+
+          this.model.orderInfo.dueOutTimeSpan = moment(
+            mDate.format("HH:mm"),
+            "HH:mm"
+          );
+        }
+      } else if (this.model.orderInfo.bookingType === 1) {
+        var mDate = moment(
+          this.model.orderInfo.arrivalTime2
+        ).add(1, "days");
+        this.model.orderInfo.dueOutTime2 = mDate.format("YYYY-MM-DD");
+      }
       this.loadRooms();
     },
     dayCountChange(e) {
@@ -958,18 +982,69 @@ export default {
       return current && current < moment().add(-1, "days").endOf("day");
     },
     arrivalTimeChange(e) {
-      this.model.orderInfo.dayCount = Math.abs(
-        parseInt(
-          (new Date(this.model.orderInfo.arrivalTime2).getTime() -
-            new Date(this.model.orderInfo.dueOutTime2).getTime()) /
-            (1000 * 60 * 60 * 24)
+      var v = parseInt(
+        (new Date(this.model.orderInfo.dueOutTime2).getTime() -
+          new Date(this.model.orderInfo.arrivalTime2).getTime()) /
+          (1000 * 60 * 60 * 24)
+      );
+      if (v <= 0) {
+        this.model.orderInfo.dueOutTime2 = moment(
+          this.model.orderInfo.arrivalTime2
         )
+          .add(1, "days")
+          .format("YYYY-MM-DD");
+      }
+      v = parseInt(
+        (new Date(this.model.orderInfo.dueOutTime2).getTime() -
+          new Date(this.model.orderInfo.arrivalTime2).getTime()) /
+          (1000 * 60 * 60 * 24)
       );
+      this.model.orderInfo.dayCount = Math.abs(v);
+      this.loadRooms();
+    },
+    arrivalTimeChange2(e) {
+      var v = parseInt(
+        (new Date(this.model.orderInfo.dueOutTime2).getTime() -
+          new Date(this.model.orderInfo.arrivalTime2).getTime()) /
+          (1000 * 60 * 60 * 24)
+      );
+      if (v <= 0) {
+        this.model.orderInfo.arrivalTime2 = moment(
+          this.model.orderInfo.dueOutTime2
+        )
+          .add(-1, "days")
+          .format("YYYY-MM-DD");
+      }
+      v = parseInt(
+        (new Date(this.model.orderInfo.dueOutTime2).getTime() -
+          new Date(this.model.orderInfo.arrivalTime2).getTime()) /
+          (1000 * 60 * 60 * 24)
+      );
+      this.model.orderInfo.dayCount = Math.abs(v);
       this.loadRooms();
     },
     arrivalTimeSpanChange(m, time) {
       console.log(time);
       console.log(moment(m).format("HH:mm"));
+      if (this.model.orderInfo.bookingType === 2) {
+        var find = this.hourRoomRuleList.find(
+          (t) => t.id === this.model.orderInfo.hourRoomId
+        );
+        if (find) {
+          var mDate = moment(
+            this.model.orderInfo.arrivalTime2 +
+              " " +
+              moment(this.model.orderInfo.arrivalTimeSpan).format("HH:mm")
+          ).add(find.afterOpenRoom, "minutes");
+          this.model.orderInfo.dueOutTime2 = mDate.format("YYYY-MM-DD");
+
+          this.model.orderInfo.dueOutTimeSpan = moment(
+            mDate.format("HH:mm"),
+            "HH:mm"
+          );
+        }
+      }
+      this.loadRooms();
     },
     tagClose2(rindex, bindex, index) {
       console.log(rindex, index);

+ 85 - 8
src/views/room/modules/schedule/ScheduleRoomForm.vue

@@ -53,6 +53,7 @@
                     :default-value="moment('12:00', 'HH:mm')"
                     format="HH:mm"
                     :allowClear="false"
+                    @change="arrivalTimeSpanChange"
                   />
                 </a-form-model-item>
               </a-col>
@@ -69,13 +70,15 @@
                     style="width: 180px"
                     :allowClear="false"
                     :disabled-date="disabledDate"
-                    @change="arrivalTimeChange"
+                    :disabled="model.orderInfo.bookingType === 2"
+                    @change="arrivalTimeChange2"
                   />
                   <a-time-picker
                     style="width: 80px; margin-left: 2px"
                     v-model="model.orderInfo.dueOutTimeSpan"
                     format="HH:mm"
                     :allowClear="false"
+                    :disabled="model.orderInfo.bookingType === 2"
                   />
                 </a-form-model-item>
               </a-col>
@@ -272,7 +275,7 @@
                     v-model="model.orderInfo.warranter"
                   >
                     <a-select-option
-                      value="a"
+                      :value="item.id"
                       v-for="item in warranterList"
                       :key="item.id"
                     >
@@ -688,6 +691,29 @@ export default {
           this.model.orderInfo.hourRoomId = hourRoomRule.id;
         }
       }
+      if (this.model.orderInfo.bookingType === 2) {
+        var find = this.hourRoomRuleList.find(
+          (t) => t.id === this.model.orderInfo.hourRoomId
+        );
+        if (find) {
+          var mDate = moment(
+            this.model.orderInfo.arrivalTime2 +
+              " " +
+              moment(this.model.orderInfo.arrivalTimeSpan).format("HH:mm")
+          ).add(find.afterOpenRoom, "minutes");
+          this.model.orderInfo.dueOutTime2 = mDate.format("YYYY-MM-DD");
+
+          this.model.orderInfo.dueOutTimeSpan = moment(
+            mDate.format("HH:mm"),
+            "HH:mm"
+          );
+        }
+      } else if (this.model.orderInfo.bookingType === 1) {
+        var mDate = moment(
+          this.model.orderInfo.arrivalTime2
+        ).add(1, "days");
+        this.model.orderInfo.dueOutTime2 = mDate.format("YYYY-MM-DD");
+      }
       this.loadRooms();
     },
     dayCountChange(e) {
@@ -702,18 +728,69 @@ export default {
       return current && current < moment().add(-1, "days").endOf("day");
     },
     arrivalTimeChange(e) {
-      this.model.orderInfo.dayCount = Math.abs(
-        parseInt(
-          (new Date(this.model.orderInfo.arrivalTime2).getTime() -
-            new Date(this.model.orderInfo.dueOutTime2).getTime()) /
-            (1000 * 60 * 60 * 24)
+      var v = parseInt(
+        (new Date(this.model.orderInfo.dueOutTime2).getTime() -
+          new Date(this.model.orderInfo.arrivalTime2).getTime()) /
+          (1000 * 60 * 60 * 24)
+      );
+      if (v <= 0) {
+        this.model.orderInfo.dueOutTime2 = moment(
+          this.model.orderInfo.arrivalTime2
         )
+          .add(1, "days")
+          .format("YYYY-MM-DD");
+      }
+      v = parseInt(
+        (new Date(this.model.orderInfo.dueOutTime2).getTime() -
+          new Date(this.model.orderInfo.arrivalTime2).getTime()) /
+          (1000 * 60 * 60 * 24)
       );
+      this.model.orderInfo.dayCount = Math.abs(v);
+      this.loadRooms();
+    },
+    arrivalTimeChange2(e) {
+      var v = parseInt(
+        (new Date(this.model.orderInfo.dueOutTime2).getTime() -
+          new Date(this.model.orderInfo.arrivalTime2).getTime()) /
+          (1000 * 60 * 60 * 24)
+      );
+      if (v <= 0) {
+        this.model.orderInfo.arrivalTime2 = moment(
+          this.model.orderInfo.dueOutTime2
+        )
+          .add(-1, "days")
+          .format("YYYY-MM-DD");
+      }
+      v = parseInt(
+        (new Date(this.model.orderInfo.dueOutTime2).getTime() -
+          new Date(this.model.orderInfo.arrivalTime2).getTime()) /
+          (1000 * 60 * 60 * 24)
+      );
+      this.model.orderInfo.dayCount = Math.abs(v);
       this.loadRooms();
     },
     arrivalTimeSpanChange(m, time) {
       console.log(time);
       console.log(moment(m).format("HH:mm"));
+      if (this.model.orderInfo.bookingType === 2) {
+        var find = this.hourRoomRuleList.find(
+          (t) => t.id === this.model.orderInfo.hourRoomId
+        );
+        if (find) {
+          var mDate = moment(
+            this.model.orderInfo.arrivalTime2 +
+              " " +
+              moment(this.model.orderInfo.arrivalTimeSpan).format("HH:mm")
+          ).add(find.afterOpenRoom, "minutes");
+          this.model.orderInfo.dueOutTime2 = mDate.format("YYYY-MM-DD");
+
+          this.model.orderInfo.dueOutTimeSpan = moment(
+            mDate.format("HH:mm"),
+            "HH:mm"
+          );
+        }
+      }
+      this.loadRooms();
     },
     tagClose2(rindex, bindex, index) {
       var id =
@@ -844,7 +921,7 @@ export default {
             .then((res) => {
               if (res.success) {
                 that.$message.success(res.message);
-                that.$emit("ok");
+                that.$emit("ok", res.result);
               } else {
                 that.$message.warning(res.message);
               }

+ 53 - 48
src/views/room/modules/schedule/ScheduleRoomModal.vue

@@ -5,70 +5,75 @@
     :visible="visible"
     switchFullscreen
     @ok="handleOk"
-    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
     @cancel="handleCancel"
-    cancelText="关闭">
-    <schedule-room-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" :bookingOrdersId="bookingOrdersId"></schedule-room-form>
+    cancelText="关闭"
+  >
+    <schedule-room-form
+      ref="realForm"
+      @ok="submitCallback"
+      :disabled="disableSubmit"
+      :bookingOrdersId="bookingOrdersId"
+    ></schedule-room-form>
   </j-modal>
 </template>
 
 <script>
-
-  import ScheduleRoomForm from './ScheduleRoomForm'
-  export default {
-    name: 'ScheduleRoomModal',
-    components: {
-      ScheduleRoomForm
-    },
-    props: {
+import ScheduleRoomForm from "./ScheduleRoomForm";
+export default {
+  name: "ScheduleRoomModal",
+  components: {
+    ScheduleRoomForm,
+  },
+  props: {
     bookingOrdersId: {
       type: String,
       default: "",
     },
   },
-    data () {
-      return {
-        title:'',
-        width:1300,
-        visible: false,
-        disableSubmit: false
-      }
+  data() {
+    return {
+      title: "",
+      width: 1300,
+      visible: false,
+      disableSubmit: false,
+    };
+  },
+  methods: {
+    add() {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.$refs.realForm.add();
+      });
     },
-    methods: {
-      add () {
-        this.visible=true
-        this.$nextTick(()=>{
-          this.$refs.realForm.add();
-        })
-      },
-      addList(record) {
+    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()
-      }
-    }
-  }
+    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(e) {
+      this.$emit("ok", e);
+      this.visible = false;
+    },
+    handleCancel() {
+      this.close();
+    },
+  },
+};
 </script>
 <style scoped>
 /deep/.ant-modal-body {

+ 1 - 1
src/views/room/modules/scheduleTeam/EdiBatchScheduleRoomForm.vue

@@ -317,7 +317,7 @@
                     v-model="model.orderInfo.warranter"
                   >
                     <a-select-option
-                      value="a"
+                      :value="item.id"
                       v-for="item in warranterList"
                       :key="item.id"
                     >

+ 1 - 1
src/views/room/modules/scheduleTeam/ScheduleRoomForm.vue

@@ -291,7 +291,7 @@
                     v-model="model.orderInfo.warranter"
                   >
                     <a-select-option
-                      value="item.id"
+                      :value="item.id"
                       v-for="item in warranterList"
                       :key="item.id"
                     >

+ 4 - 1
src/views/room/scheduledetail.vue

@@ -137,9 +137,12 @@ export default {
       isShow: true,
     };
   },
+  created(){
+    this.id = this.$route.params.id;
+  },
   activated() {
     //重新进入界面可能参数id不一样,需要重新加载数据,使用钩子方式
-    this.id = this.$route.query.id;
+    this.id = this.$route.params.id;
     this.isShow = true;
   },
   deactivated() {