Browse Source

修改结账界面

许智捷 2 years ago
parent
commit
c563b382c1

+ 18 - 14
src/views/room/modules/checkIn/BillRoomForm.vue

@@ -1341,7 +1341,7 @@ export default {
       }
     },
     'model.orderInfo.bookingType'(val, old) {
-      
+
       if (val) {
         this.model.orderInfo.dayCount = this.daysBetween(this.model.orderInfo.arrivalTime2, this.model.orderInfo.dueOutTime2)
       }
@@ -1434,7 +1434,7 @@ export default {
       }
     },
     paymentSplit(value) {
-      
+
       if (this.loadRemenmberPayState) {
         console.log(1111111, this.loadRemenmberPayState)
         if (!value) {
@@ -1580,7 +1580,7 @@ export default {
     //
     // getAction('/business/busHousePriceSchemeLayout/list?hotelId=' + this.model.hotelId, {}
     // ).then((res) => {
-    //   
+    //
     //   if (res.success) {
     //     this.housePriceSchemeList = res.result;
     //   }
@@ -1791,11 +1791,16 @@ export default {
         onOk: function () {
           let idx = that.model.roomIds.findIndex(item => item.id == that.roomIdsIndexId)
           idx = (idx === -1 ? 0 : idx)
-          that.model.roomIds[idx].key1 = that.vipCustomerData.name
-          that.model.roomIds[idx].key2 = that.vipCustomerData.sex
-          that.model.roomIds[idx].key4 = that.vipCustomerData.certificateNo
-          that.model.roomIds[idx].key5 = that.vipCustomerData.mobile
-          that.model.roomIds[idx].key6 = that.vipCustomerData.address
+          that.$set(that.model.roomIds[idx], 'key1', that.vipCustomerData.name)
+          that.$set(that.model.roomIds[idx], 'key2', that.vipCustomerData.sex)
+          that.$set(that.model.roomIds[idx], 'key4', that.vipCustomerData.certificateNo)
+          that.$set(that.model.roomIds[idx], 'key5', that.vipCustomerData.mobile)
+          that.$set(that.model.roomIds[idx], 'key6', that.vipCustomerData.address)
+          // that.model.roomIds[idx].key1 = that.vipCustomerData.name
+          // that.model.roomIds[idx].key2 = that.vipCustomerData.sex
+          // that.model.roomIds[idx].key4 = that.vipCustomerData.certificateNo
+          // that.model.roomIds[idx].key5 = that.vipCustomerData.mobile
+          // that.model.roomIds[idx].key6 = that.vipCustomerData.address
           console.log(that.vipCustomerData)
           let findPayType = that.payTypeList.find(e => e.name === '会员卡')
           that.model.orderFees.forEach(e => {
@@ -1911,7 +1916,7 @@ export default {
         var payType = this.payTypeList[0]
         let plusDeposit = this.bookingPaidMoney
         console.log(this.model.roomPrices)
-        
+
         this.model.roomPrices.forEach((item) => {
           // 未支付的押金扣减掉预约支付的押金
           var money = item.roomFee
@@ -1987,7 +1992,7 @@ export default {
               }
             }
           } else {
-            
+
             var find = orderFees.find(
                 (t) => t.subjectType == 2 && t.roomId == this.model.roomIds[0].id
             )
@@ -2523,7 +2528,7 @@ export default {
         if (item.bookingYj) {
           continue
         }
-        
+
         if (item.editPrice && item.editPrice.length > 0) {
           item.editPrice.forEach((p) => {
             money += p
@@ -2789,7 +2794,7 @@ export default {
       }
       console.log(orderInfo)
       console.log(this.modelDefault)
-      
+
       if (this.modelDefault.roomIds.length > 0) {
         this.edit(this.modelDefault)
       }
@@ -2799,7 +2804,7 @@ export default {
       this.activeKey = record.roomIds[0].id
       this.visible = true
       this.model = Object.assign({}, record)
-      
+
       console.log('this.model', this.model)
       if (this.model.roomIds && this.model.roomIds.length > 0) {
         this.roomIdsIndexId = this.model.roomIds[0].id
@@ -3028,7 +3033,6 @@ export default {
     },
     submitForm() {
       const that = this
-      console.log(that.model.orderInfo)
       that.model.livingRoomDayPrices = []
       console.log('that.model.roomPrices', that.model.roomPrices)
       that.model.roomPrices.forEach((t) => {

+ 16 - 8
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -414,7 +414,6 @@
                 style="color: rgba(255, 141, 26, 1); font-size: 18px"
               /><a-button
                 type="link"
-                :disabled="consumSelectedRowKeys.length == 0 || selectRoomId == '1'"
                 @click="partialSettle"
               >
                 部分结账
@@ -441,7 +440,7 @@
                 <span v-else>{{ getSubjectTypeText(text,record) }}</span>
               </template>
               <template slot="roomId" slot-scope="text, record, index">
-                <span class="strike_style" v-if="record.returnItem">{{ getRoomName(text) }}</span> 
+                <span class="strike_style" v-if="record.returnItem">{{ getRoomName(text) }}</span>
                 <span v-else>{{ getRoomName(text) }}</span>
               </template>
               <template slot="dayTime" slot-scope="text, record, index" class="strike_style">
@@ -1508,6 +1507,14 @@ export default {
     // },
     // 部分结账
     partialSettle() {
+      if (this.selectRoomId === '1') {
+        this.$message.warning('请先选择房间')
+        return
+      }
+      if (this.consumSelectedRowKeys.length === 0) {
+        this.$message.warning('请先勾选消费')
+        return
+      }
       var list2 = this.feesList.filter((t) =>
         this.consumSelectedRowKeys.includes(t.id)
       )
@@ -1518,6 +1525,7 @@ export default {
       var index = this.model.livingRoomIds.findLastIndex(
         (t) => t.roomId == this.selectRoomId
       )
+      debugger
       var livingRoom = this.model.livingRoomIds[index]
       this.$refs.modalPaymentForm.edit({
         billAmount: parseFloat(amount.toFixed(2)),
@@ -1539,7 +1547,7 @@ export default {
       this.$refs.modalPaymentForm.showYinshou = false
     },
     tabChange(e) {
-      // 
+      //
       console.log(e)
       this.selectRoomId = e
       if (e == '1') {
@@ -1573,7 +1581,7 @@ export default {
       var msg = ''
       if (text == 1) {
         msg = '押金'
-        // 
+        //
         if (record.remark != null && record.remark != '') {
           msg = record.remark
         }
@@ -1759,7 +1767,7 @@ export default {
       getAction('/business/busOrderFee/strike-balance-page', { bookingOrderId: this.model.orderInfo.id })
           .then(res => {
             if (res.success) {
-              // 
+              //
               if (res.result && res.result.records.length > 0) {
                 // 未支付的费用账单,oldfeesList用于存放所有费用账单,feesList为当前房间账单
                 this.strikeList = res.result.records
@@ -1767,7 +1775,7 @@ export default {
                 console.log(this.strikeList, '冲帐单')
                 // this.entiretyAmount = this.entiretyList
                 // console.log(this.entiretyAmount, '冲帐单')
-                
+
                 // let templist = this.strikeList.find()
 
                 // this.strikeList.forEach(item => {
@@ -1795,7 +1803,7 @@ export default {
                 //     templist.push(this.entiretyList.find(index => index.id = item.returnFeeId),item)
                   // }
                 //   // if ()
-                  
+
                 //   // this.strikeList.forEach(index => {
                 //   //   if(item.id = index.returnFeeId) {
                 //   //     templist.push(item,index)
@@ -1901,7 +1909,7 @@ export default {
           }
           // console.log(templistid);
         }
-        
+
         if (differMoney > 0) {
           this.$refs.modalPayOrRefundForm.edit({
             money: differMoney,