Browse Source

收款方式关联会员和单位逻辑

gqx 2 years ago
parent
commit
f56a669524

+ 1 - 1
src/views/room/modules/checkIn/BillRoomForm.vue

@@ -1804,7 +1804,7 @@ export default {
      * 修改完成
      */
     editPriceOk() {
-      console.log(this.editPriceData);
+      console.log(this.model.roomPrices);
       // this.model.roomPrices[this.editPriceIndex].editPriceTime = [];
       // this.model.roomPrices[this.editPriceIndex].editPrice = [];
       // this.editPriceData.forEach((ele) => {

+ 13 - 2
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -309,7 +309,12 @@
               <a-icon
                 type="import"
                 style="color: rgba(255, 141, 26, 1); font-size: 18px"
-              /><a-button type="link"> 退单 </a-button>
+              /><a-button
+                type="link"
+                :disabled="selectedRowKeys1.length == 0 || selectRoomId == '1'"
+              >
+                退单
+              </a-button>
             </div>
             <div style="display: flex; flex-direction: column">
               <a-icon
@@ -952,6 +957,7 @@ export default {
       });
       this.$refs.modalPaymentForm.title = "部分结账收款";
       this.$refs.modalPaymentForm.disableSubmit = false;
+      this.$refs.modalPaymentForm.showYinshou = false;
     },
     tabChange(e) {
       console.log(e);
@@ -1142,6 +1148,9 @@ export default {
           bookingOrderId: this.model.orderInfo.id,
           livingOrderId:
             livingRoom.roomId != "1" ? livingRoom.livingOrder.id : "",
+          vipCustomerId: livingRoom.livingOrder.vipCustomerId,
+          contractTeamId: livingRoom.livingOrder.contractTeamId,
+          contractTeamProtocolId: livingRoom.livingOrder.contractTeamProtocolId,
         });
         this.$refs.modalRefundForm.title = "结账退款";
         this.$refs.modalRefundForm.disableSubmit = false;
@@ -1162,7 +1171,9 @@ export default {
           preferentialType: 1,
           couponFirstAmount: 0,
           discount: 9,
-          vipCustomerId: this.model.orderInfo.vipCustomerId,
+          vipCustomerId: livingRoom.livingOrder.vipCustomerId,
+          contractTeamId: livingRoom.livingOrder.contractTeamId,
+          contractTeamProtocolId: livingRoom.livingOrder.contractTeamProtocolId,
         });
         this.$refs.modalPaymentForm.title = "结账收款";
         this.$refs.modalPaymentForm.disableSubmit = false;

+ 84 - 10
src/views/room/modules/checkIn/Payment.vue

@@ -8,7 +8,7 @@
         slot="detail"
       >
         <a-row>
-          <a-col :span="24">
+          <a-col :span="24" v-show="showYinshou">
             <a-form-model-item
               label="结账应收"
               :labelCol="labelCol"
@@ -127,6 +127,7 @@
                         :value="item2.id"
                         v-for="item2 in payTypeList"
                         :key="item2.id"
+                        :disabled="item2.delFlag == 99"
                       >
                         {{ item2.name }}
                       </a-select-option>
@@ -158,6 +159,20 @@
                   <!-- <a-col :span="12"> 本次扣后剩余: </a-col>
                 <a-col :span="12"> 本次新增积分: </a-col> -->
                 </a-row>
+                <a-row type="flex" v-if="item.isDanwei">
+                  <a-col :span="12">
+                    协议单位:{{ agreementUnitData.customerName }}
+                  </a-col>
+                  <a-col :span="12">
+                    签约开始日期:{{ danwei.signTime }}
+                  </a-col>
+                  <a-col :span="12">
+                    签约结束日期: {{ danwei.effective }}</a-col
+                  >
+                  <a-col :span="12">
+                    可用额度:{{ agreementUnitData.balance || 0 }}
+                  </a-col>
+                </a-row>
               </div>
             </a-form-model-item>
           </a-col>
@@ -190,6 +205,11 @@ export default {
       default: false,
       required: false,
     },
+    showYinshou: {
+      type: Boolean,
+      default: true,
+      required: false,
+    },
   },
   data() {
     return {
@@ -240,9 +260,12 @@ export default {
       oldcustomerList: [],
       payTypeList: [],
       memberCard: {},
+      danwei: {},
       isVipMemmber: false,
+      isDanwei: false,
       payList: [],
       memeberCouponList: [],
+      agreementUnitData: {},
     };
   },
   computed: {
@@ -291,14 +314,14 @@ export default {
     }
     //备份model原始值
     this.modelDefault = JSON.parse(JSON.stringify(this.model));
-    getAction("/business/busRoomPayType/list", {
-      pageSize: 99999,
-      pageNo: 1,
-    }).then((res) => {
-      if (res.success) {
-        this.payTypeList = res.result.records;
-      }
-    });
+    // getAction("/business/busRoomPayType/list", {
+    //   pageSize: 99999,
+    //   pageNo: 1,
+    // }).then((res) => {
+    //   if (res.success) {
+    //     this.payTypeList = res.result.records;
+    //   }
+    // });
   },
   methods: {
     getbusRoomPayType() {
@@ -309,6 +332,30 @@ export default {
         if (res.success) {
           this.payTypeList = res.result.records;
           if (this.payTypeList && this.payTypeList.length > 0) {
+            if (
+              !this.model.vipCustomerId ||
+              this.model.vipCustomerId.length == 0
+            ) {
+              var index = this.payTypeList.findIndex((t) =>
+                t.name.includes("会员")
+              );
+              if (index >= 0) {
+                this.payTypeList[index].delFlag = 99;
+              }
+            }
+            if (
+              !this.model.contractTeamId ||
+              this.model.contractTeamId.length == 0 ||
+              !this.model.contractTeamProtocolId ||
+              this.model.contractTeamProtocolId.length == 0
+            ) {
+              var index = this.payTypeList.findIndex((t) =>
+                t.name.includes("单位")
+              );
+              if (index >= 0) {
+                this.payTypeList[index].delFlag = 99;
+              }
+            }
             this.$set(this.model, "payType", this.payTypeList[0].id);
 
             this.payList = [
@@ -316,6 +363,7 @@ export default {
                 money: this.realityAmount,
                 payType: this.payTypeList[0].id,
                 isVipMemmber: false,
+                isDanwei: false,
               },
             ];
           }
@@ -327,6 +375,7 @@ export default {
         money: 0,
         payType: this.payTypeList[0].id,
         isVipMemmber: false,
+        isDanwei: false,
       });
     },
     remove(index) {
@@ -336,7 +385,8 @@ export default {
       console.log("value", value);
       console.log("e", e);
       var find = this.payTypeList.find((t) => t.id == value.payType);
-      value.isVipMemmber = find && find.name == "会员卡";
+      value.isVipMemmber = find && find.name.includes("会员");
+      value.isDanwei = find && find.name.includes("单位");
     },
     handleSearch(value) {
       let result;
@@ -388,6 +438,30 @@ export default {
           }
         });
       }
+      if (this.model.contractTeamId && this.model.contractTeamProtocolId) {
+        getAction("/business/busMarketAgreementUnit/list", {
+          id: this.model.contractTeamId,
+        }).then((res) => {
+          if (res.success) {
+            var list = res.result.records;
+            if (list.length > 0) {
+              this.agreementUnitData = list[0];
+              getAction("/business/busMarketAgreementCustomer/list", {
+                agreementId: this.model.contractTeamId,
+              }).then((res2) => {
+                if (res2.success) {
+                  var list2 = res2.result.records;
+                  if (list2 && list2.length > 0) {
+                    this.danwei = list2.find(
+                      (t) => t.id == this.model.contractTeamProtocolId
+                    );
+                  }
+                }
+              });
+            }
+          }
+        });
+      }
       this.visible = true;
     },
     submitForm() {

+ 51 - 45
src/views/room/modules/checkIn/PaymentModal.vue

@@ -5,56 +5,62 @@
     :visible="visible"
     switchFullscreen
     @ok="handleOk"
-    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
     @cancel="handleCancel"
-    cancelText="关闭">
-    <payment ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></payment>
+    cancelText="关闭"
+  >
+    <payment
+      ref="realForm"
+      @ok="submitCallback"
+      :disabled="disableSubmit"
+      :showYinshou="showYinshou"
+    ></payment>
   </j-modal>
 </template>
 
 <script>
-
-  import payment from './Payment'
-  export default {
-    name: 'PaymentModal',
-    components: {
-      payment
+import payment from "./Payment";
+export default {
+  name: "PaymentModal",
+  components: {
+    payment,
+  },
+  data() {
+    return {
+      title: "",
+      width: 800,
+      visible: false,
+      disableSubmit: false,
+      showYinshou: true,
+    };
+  },
+  methods: {
+    add(record) {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.$refs.realForm.add(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;
     },
-    data () {
-      return {
-        title:'',
-        width:800,
-        visible: false,
-        disableSubmit: false
-      }
+    handleCancel() {
+      this.close();
     },
-    methods: {
-      add (record) {
-        this.visible=true
-        this.$nextTick(()=>{
-          this.$refs.realForm.add(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>

+ 26 - 2
src/views/room/modules/checkIn/Refund.vue

@@ -42,12 +42,12 @@
                 v-model="model.payType"
                 style="width: 200px"
                 placeholder="支付类型"
-                :allowClear="true"
               >
                 <a-select-option
                   :value="item.id"
                   v-for="item in payTypeList"
                   :key="item.id"
+                  :disabled="item.delFlag == 99"
                   >{{ item.name }}</a-select-option
                 >
               </a-select>
@@ -71,12 +71,12 @@
                 v-model="model.payType"
                 style="width: 200px"
                 placeholder="支付类型"
-                :allowClear="true"
               >
                 <a-select-option
                   :value="item.id"
                   v-for="item in payTypeList"
                   :key="item.id"
+                  :disabled="item.delFlag == 99"
                   >{{ item.name }}</a-select-option
                 >
               </a-select>
@@ -190,6 +190,30 @@ export default {
         if (res.success) {
           this.payTypeList = res.result.records;
           if (this.payTypeList && this.payTypeList.length > 0) {
+            if (
+              !this.model.vipCustomerId ||
+              this.model.vipCustomerId.length == 0
+            ) {
+              var index = this.payTypeList.findIndex((t) =>
+                t.name.includes("会员")
+              );
+              if (index >= 0) {
+                this.payTypeList[index].delFlag = 99;
+              }
+            }
+            if (
+              !this.model.contractTeamId ||
+              this.model.contractTeamId.length == 0 ||
+              !this.model.contractTeamProtocolId ||
+              this.model.contractTeamProtocolId.length == 0
+            ) {
+              var index = this.payTypeList.findIndex((t) =>
+                t.name.includes("单位")
+              );
+              if (index >= 0) {
+                this.payTypeList[index].delFlag = 99;
+              }
+            }
             this.$set(this.model, "payType", this.payTypeList[0].id);
           }
         }