Browse Source

附属房间同步住房信息设置

gqx 2 years ago
parent
commit
cebbabe761

+ 37 - 13
src/views/room/modules/checkIn/BillRoomForm.vue

@@ -35,7 +35,7 @@
                       >
                         宾客信息
                       </h4>
-                      <div><a-switch v-model="otherRoomSync" />附属房间录入信息</div>
+                      <div v-if="model.roomIds&&model.roomIds.length>1"><a-switch v-model="otherRoomSync" />附属房间录入信息</div>
                     </div>
                     <a-divider />
                     <!-- <a-col :span="8">
@@ -1032,7 +1032,7 @@ const columns2 = [
     title: "应缴",
     dataIndex: "receivable",
     width: "25%",
-    scopedSlots: { customRender: "prefPrice" }
+    scopedSlots: { customRender: "prefPrice" },
   },
   {
     title: "实收",
@@ -1068,7 +1068,7 @@ export default {
       vipCustomerData: {},
       agreementUnitData: { customerName: "" },
       busMarketAgreementCustomer: {},
-      otherRoomSync: false,
+      otherRoomSync: true,
       payPalModel: { list: [{ key1: "", key2: "", key3: "" }] },
       depositSplit: true,
       paymentSplit: true,
@@ -1228,6 +1228,30 @@ export default {
     },
   },
   watch: {
+    otherRoomSync(value) {
+      if (!value) {
+        if (this.modelDefault.roomIds && this.modelDefault.roomIds.length > 0) {
+          if (this.modelDefault.roomIds[0].key1) {
+            for (var i = 1; i < this.modelDefault.roomIds.length; i++) {
+              var room = this.modelDefault.roomIds[i];
+              if (!room.key1) {
+                this.$set(room, "key1", this.modelDefault.roomIds[0].key1);
+                this.$set(room, "key2", this.modelDefault.roomIds[0].key2);
+                this.$set(room, "key3", this.modelDefault.roomIds[0].key3);
+                this.$set(room, "key4", this.modelDefault.roomIds[0].key4);
+                this.$set(room, "key5", this.modelDefault.roomIds[0].key5);
+                this.$set(room, "key6", this.modelDefault.roomIds[0].key6);
+                this.$set(
+                  room,
+                  "customerId",
+                  this.modelDefault.roomIds[0].customerId
+                );
+              }
+            }
+          }
+        }
+      }
+    },
     depositSplit(value) {
       if (!value) {
         var yajin = this.model.roomPrices.reduce((sum, val) => {
@@ -2075,7 +2099,7 @@ export default {
         // target.deposit = this.compuleDeposit(value);
         this.model.roomPrices = dataSource;
       }
-      
+
       var sum = 0;
       var money2 = 0;
       var deposit2 = 0;
@@ -2289,18 +2313,18 @@ export default {
       }
       console.log(this.modelDefault);
       console.log(" this.modelDefault.roomIds", this.modelDefault.roomIds);
-      this.canUserRooms[0].buildingRooms.forEach(ele=>{
-        ele.floorRooms.forEach(b=>{
-            b.check = 0
-        })
-        this.modelDefault.roomIds.forEach(t=>{
-          ele.floorRooms.forEach(b=>{
+      this.canUserRooms[0].buildingRooms.forEach((ele) => {
+        ele.floorRooms.forEach((b) => {
+          b.check = 0;
+        });
+        this.modelDefault.roomIds.forEach((t) => {
+          ele.floorRooms.forEach((b) => {
             if (b.id == t.id) {
               b.check = 1;
             }
-          })
-        })
-      })
+          });
+        });
+      });
       this.edit(this.modelDefault);
     },
     compuleDeposit(prefPrice) {

+ 200 - 0
src/views/room/modules/checkIn/EditCustomerForm.vue

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

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

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

+ 183 - 0
src/views/room/modules/checkIn/EditCustomerSourceForm.vue

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

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

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

+ 378 - 0
src/views/room/modules/checkIn/EditCustomerTypeForm.vue

@@ -0,0 +1,378 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+        slot="detail"
+      >
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item
+              label="宾客类型"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="customerType"
+            >
+              <a-select placeholder="宾客类型" v-model="model.customerType">
+                <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>
+          <a-col :span="24" v-if="model.customerType === 2">
+            <a-card :bordered="true" style="width: 100%; padding: 0 !important">
+              <p>
+                <a-form-model-item
+                  label="会员"
+                  :labelCol="{
+                    xs: { span: 24 },
+                    sm: { span: 2 },
+                  }"
+                  :wrapperCol="{
+                    xs: { span: 24 },
+                    sm: { span: 22 },
+                  }"
+                  prop="vipCustomerId"
+                >
+                  <a-auto-complete
+                    v-model="vipCustomerData.name"
+                    @select="(e) => handleSelectVip(e)"
+                    @search="handleSearchVip"
+                  >
+                    <template slot="dataSource">
+                      <a-select-option
+                        :key="item.id"
+                        :value="item.id"
+                        :label="item.name"
+                        v-for="(item, index) in busMemberCardList"
+                      >
+                        {{ item.name }}-{{ item.gradeName }}-{{ item.balance }}
+                      </a-select-option>
+                    </template>
+                  </a-auto-complete>
+                </a-form-model-item>
+              </p>
+              <p>
+                <a-row>
+                  <a-col :span="8">名称:{{ vipCustomerData.name }}</a-col>
+                  <a-col :span="8">电话:{{ vipCustomerData.mobile }}</a-col>
+                  <a-col :span="8">级别:{{ vipCustomerData.gradeName }}</a-col>
+                </a-row>
+                <a-row>
+                  <a-col :span="8">余额:{{ vipCustomerData.balance }}</a-col>
+                  <a-col :span="8">积分:{{ vipCustomerData.integral }}</a-col>
+                  <a-col :span="8">卡号:{{ vipCustomerData.cardNo }}</a-col>
+                </a-row>
+              </p>
+            </a-card>
+          </a-col>
+          <a-col :span="24" v-if="model.customerType === 3">
+            <a-card :bordered="true" style="width: 100%; padding: 0 !important">
+              <a-row>
+                <a-col :span="12">
+                  <a-form-model-item
+                    label="协议单位"
+                    :labelCol="labelCol"
+                    :wrapperCol="wrapperCol"
+                    prop="contractTeamId"
+                  >
+                    <a-auto-complete
+                      v-model="agreementUnitData.customerName"
+                      @select="(e) => handleSelectAgreementUnit(e)"
+                      @search="handleSearchAgreementUnit"
+                    >
+                      <template slot="dataSource">
+                        <a-select-option
+                          :key="item.id"
+                          :value="item.id"
+                          :label="item.customerName"
+                          v-for="(item, index) in busMarketAgreementUnitList"
+                        >
+                          {{ item.customerName }}
+                        </a-select-option>
+                      </template>
+                    </a-auto-complete>
+                  </a-form-model-item>
+                </a-col>
+                <a-col :span="12">
+                  <a-form-model-item
+                    label="协议合同"
+                    :labelCol="labelCol"
+                    :wrapperCol="wrapperCol"
+                    prop="contractTeamProtocolId"
+                  >
+                    <span
+                      style="color: red; cursor: pointer"
+                      @click="showAgreementUnitTable(model.contractTeamId)"
+                      >{{ model.contractTeamProtocolName }}</span
+                    >
+                  </a-form-model-item>
+                </a-col>
+              </a-row>
+              <p>
+                <a-row>
+                  <a-col :span="12"
+                    >名称:{{ agreementUnitData.customerName }}</a-col
+                  >
+                  <a-col :span="12"
+                    >签约开始日期:{{
+                      busMarketAgreementCustomer.signTime
+                    }}</a-col
+                  >
+                  <a-col :span="12"
+                    >签约结束日期:{{
+                      busMarketAgreementCustomer.effective
+                    }}</a-col
+                  >
+                  <a-col :span="12"
+                    >可用额度:{{ agreementUnitData.balance || 0 }}</a-col
+                  >
+                </a-row>
+              </p>
+            </a-card>
+          </a-col>
+        </a-row>
+      </a-form-model> </j-form-container
+    ><agreement-unit-modal-table
+      ref="modalAgreementUnitTable"
+      @ok="modalAgreementUnitTableOk"
+    ></agreement-unit-modal-table>
+  </a-spin>
+</template>
+
+<script>
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+import AgreementUnitModalTable from "./AgreementUnitModalTable";
+export default {
+  name: "BusMemberCardForm",
+  components: { AgreementUnitModalTable },
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: { payType: 1, livingOrderId: "", certType: 1, gender: 1 },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        mobile: [
+          {
+            required: true,
+            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+            message: "请输入手机号!",
+          },
+        ],
+        customerType: [{ required: true, message: "请选择宾客类型!" }],
+        gradeId: [{ required: true, message: "请输入等级类型!" }],
+        payType: [{ required: true, message: "请输入付款类型!" }],
+        paymentMethod: [{ required: true, message: "请输入付款方式!" }],
+        cusName: [{ required: true, message: "请输入会员姓名!" }],
+        sex: [{ required: true, message: "请输入性别!" }],
+        certificateType: [{ required: true, message: "请输入证件类型!" }],
+        validity: [{ required: true, message: "请输入有效期!" }],
+      },
+      url: {
+        add: "/business/busRoomBookingOrders/booking-to-live",
+        edit: "/business/busMemberCard/edit",
+        queryById: "/business/busMemberCard/queryById",
+      },
+      gradeList: [],
+      paymentMethodList: [],
+      staffList: [],
+      customerList: [],
+      oldcustomerList: [],
+      vipCustomerData: {},
+      agreementUnitData: { customerName: "" },
+      oldBusMemberCardList: [],
+      busMemberCardList: [],
+      oldBusMarketAgreementUnitList: [],
+      busMarketAgreementUnitList: [],
+      busMarketAgreementCustomer: {},
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    // this.getbusCustomer();
+    getAction("/business/busMemberCard/list", {
+      pageSize: 99999,
+      pageNo: 1,
+    }).then((res) => {
+      if (res.success) {
+        this.busMemberCardList = res.result.records;
+        this.oldBusMemberCardList = JSON.parse(
+          JSON.stringify(this.busMemberCardList)
+        );
+        if (this.model.vipCustomerId) {
+          this.handleSelectVip(this.model.vipCustomerId);
+        }
+      }
+    });
+    getAction("/business/busMarketAgreementUnit/list", {
+      pageSize: 99999,
+      pageNo: 1,
+    }).then((res) => {
+      if (res.success) {
+        this.busMarketAgreementUnitList = res.result.records;
+        this.oldBusMarketAgreementUnitList = JSON.parse(
+          JSON.stringify(res.result.records)
+        );
+        if (this.model.contractTeamId && this.model.contractTeamProtocolId) {
+          this.handleSelectAgreementUnit(this.model.contractTeamId);
+        }
+      }
+    });
+  },
+  methods: {
+    modalAgreementUnitTableOk(e) {
+      var info = e;
+      this.model.contractTeamProtocolName = info.name;
+      this.model.contractTeamProtocolId = info.id;
+      this.busMarketAgreementCustomer = info;
+    },
+    showAgreementUnitTable(agreementId) {
+      this.$refs.modalAgreementUnitTable.add(agreementId);
+      this.$refs.modalAgreementUnitTable.title = "选择协议";
+      this.$refs.modalAgreementUnitTable.disableSubmit = true;
+    },
+    handleSearchAgreementUnit(value) {
+      let result;
+      if (!value) {
+        result = this.oldBusMarketAgreementUnitList;
+      } else {
+        result = this.oldBusMarketAgreementUnitList.filter((t) =>
+          t.customerName.includes(value)
+        );
+      }
+      this.busMarketAgreementUnitList = JSON.parse(JSON.stringify(result));
+    },
+    handleSelectAgreementUnit(value) {
+      let result = this.busMarketAgreementUnitList.find((t) => t.id == value);
+      this.model.contractTeamId = value;
+      this.agreementUnitData = JSON.parse(JSON.stringify(result));
+      this.contractTeamIdChange(value);
+    },
+    contractTeamIdChange(e) {
+      this.model.contractTeamId = e;
+      getAction("/business/busMarketAgreementCustomer/list", {
+        agreementId: this.model.contractTeamId,
+      }).then((res) => {
+        if (res.success) {
+          var list = res.result.records;
+          if (list && list.length > 0) {
+            this.model.contractTeamProtocolName = list[0].name;
+            this.model.contractTeamProtocolId = list[0].id;
+            this.busMarketAgreementCustomer = list[0];
+          }
+        }
+      });
+    },
+    handleSearchVip(value) {
+      let result;
+      if (!value) {
+        result = this.oldBusMemberCardList;
+      } else {
+        console.log("this.oldBusMemberCardList", this.oldBusMemberCardList);
+        result = this.oldBusMemberCardList.filter((t) => {
+          return (
+            t.name.includes(value) ||
+            (t.cardNo && t.cardNo.includes(value)) ||
+            (t.mobile && t.mobile.includes(value))
+          );
+        });
+      }
+      this.busMemberCardList = JSON.parse(JSON.stringify(result));
+    },
+    handleSelectVip(value) {
+      console.log(value);
+      let result = this.busMemberCardList.find((t) => t.id == value);
+      this.model.vipCustomerId = value;
+      this.vipCustomerData = JSON.parse(JSON.stringify(result));
+      // this.vipCustomerIdChange(result.id);
+    },
+    handleSearch(value) {
+      let result;
+      if (!value) {
+        result = this.oldcustomerList;
+      } else {
+        result = this.oldcustomerList.filter((t) => t.name.includes(value));
+      }
+      this.customerList = result;
+    },
+    handleSelectMember(e) {
+      var find = this.customerList.find((t) => t.id === e);
+      this.model.cusPhone = find.phone;
+      this.model.cusName = find.name;
+      this.model.cusId = find.id;
+    },
+    getbusCustomer() {
+      getAction("/bus/busCustomer/list", {}).then((res) => {
+        if (res.success) {
+          this.customerList = res.result.records;
+          this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+        }
+      });
+    },
+    add(livingOrderId, roomId) {
+      this.modelDefault.livingOrderId = livingOrderId;
+      this.modelDefault.roomId = roomId;
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          that.confirmLoading = true;
+          httpAction(
+            "/business/busRoomBookingOrders/update-orders?type=2",
+            this.model,
+            "post"
+          )
+            .then((res) => {
+              if (res.success) {
+                that.$message.success("修改成功");
+                that.$emit("ok");
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+            });
+        }
+      });
+    },
+  },
+};
+</script>

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

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

+ 181 - 0
src/views/room/modules/checkIn/EditRemarkForm.vue

@@ -0,0 +1,181 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+        slot="detail"
+      >
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item
+              label="订单备注"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="remark"
+            >
+              <a-textarea
+                v-model="model.remark"
+                rows="4"
+                placeholder="订单备注"
+              />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+
+export default {
+  name: "BusMemberCardForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: { payType: 1, livingOrderId: "", certType: 1, gender: 1 },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        mobile: [
+          {
+            required: true,
+            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+            message: "请输入手机号!",
+          },
+        ],
+        cardNo: [{ required: true, message: "请输入会员卡号!" }],
+        gradeId: [{ required: true, message: "请输入等级类型!" }],
+        payType: [{ required: true, message: "请输入付款类型!" }],
+        paymentMethod: [{ required: true, message: "请输入付款方式!" }],
+        cusName: [{ required: true, message: "请输入会员姓名!" }],
+        sex: [{ required: true, message: "请输入性别!" }],
+        certificateType: [{ required: true, message: "请输入证件类型!" }],
+        validity: [{ required: true, message: "请输入有效期!" }],
+      },
+      url: {
+        add: "/business/busRoomBookingOrders/booking-to-live",
+        edit: "/business/busMemberCard/edit",
+        queryById: "/business/busMemberCard/queryById",
+      },
+      gradeList: [],
+      paymentMethodList: [],
+      staffList: [],
+      customerList: [],
+      oldcustomerList: [],
+      customerSourceList: [],
+      warranterList: [],
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    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 = this.oldcustomerList;
+      } else {
+        result = this.oldcustomerList.filter((t) => t.name.includes(value));
+      }
+      this.customerList = result;
+    },
+    handleSelectMember(e) {
+      var find = this.customerList.find((t) => t.id === e);
+      this.model.cusPhone = find.phone;
+      this.model.cusName = find.name;
+      this.model.cusId = find.id;
+    },
+    getbusCustomer() {
+      getAction("/bus/busCustomer/list", {}).then((res) => {
+        if (res.success) {
+          this.customerList = res.result.records;
+          this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+        }
+      });
+    },
+    add(livingOrderId, roomId) {
+      this.modelDefault.livingOrderId = livingOrderId;
+      this.modelDefault.roomId = roomId;
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          that.confirmLoading = true;
+          // var customers = [];
+          // customers.push({
+          //   certNo: this.model.certNo,
+          //   certType: this.model.certType,
+          //   customerId: this.model.customerId,
+          //   customerName: this.model.customerName,
+          //   gender: this.model.gender,
+          //   phone: this.model.phone,
+          //   roomId: this.model.roomId,
+          // });
+          httpAction(
+            "/business/busRoomBookingOrders/update-orders?type=2",
+            this.model,
+            "post"
+          )
+            .then((res) => {
+              if (res.success) {
+                that.$message.success("修改成功");
+                that.$emit("ok");
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+            });
+        }
+      });
+    },
+  },
+};
+</script>

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

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

+ 185 - 0
src/views/room/modules/checkIn/EditWarranterForm.vue

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

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

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