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

+ 36 - 14
src/views/room/fangtailive.vue

@@ -60,7 +60,6 @@
               disabled
               style="margin-bottom: 10px"
               @click="handleAdd"
-              disabled
               type="danger"
               >联房</a-button
             ><a-button
@@ -358,7 +357,8 @@
                               >
                             </div>
                             <a-tag color="blue">欠</a-tag>
-                            <a-tag color="blue"
+                            <a-tag
+                              color="blue"
                               v-if="
                                 roomLive.livingData &&
                                 roomLive.livingData.livingOrder &&
@@ -366,14 +366,16 @@
                               "
                               >钟</a-tag
                             >
-                            <a-tag color="blue"
+                            <a-tag
+                              color="blue"
                               v-if="
                                 roomLive.livingData &&
                                 roomLive.livingData.livingOrder &&
                                 roomLive.livingData.livingOrder.isTeam
                               "
                               >团</a-tag
-                            ><a-tag color="blue"
+                            ><a-tag
+                              color="blue"
                               v-if="
                                 roomLive.livingData &&
                                 roomLive.livingData.livingOrder &&
@@ -622,7 +624,7 @@ export default {
     forwardfangtai,
     leasegoods,
     membermessage,
-    membergoodsmanage
+    membergoodsmanage,
   },
   data() {
     return {
@@ -863,11 +865,21 @@ export default {
 
         if (roomLive.roomInfo.state !== 88) {
           roomLive.roomInfo.state = 88;
-          this.checkInBtnDis =
-            roomLive.livingData && roomLive.livingData.livingOrder;
-          this.scheduleBtnDis =
+
+          if (roomLive.livingData && roomLive.livingData.livingOrder) {
+            this.checkInBtnDis = true;
+          } else {
+            this.checkInBtnDis = false;
+          }
+
+          if (
             (roomLive.livingData && roomLive.livingData.livingOrder) ||
-            (roomLive.bookingData && roomLive.bookingData.bookingOrder);
+            (roomLive.bookingData && roomLive.bookingData.bookingOrder)
+          ) {
+            this.scheduleBtnDis = true;
+          } else {
+            this.scheduleBtnDis = false;
+          }
         } else {
           roomLive.roomInfo.state = 0;
         }
@@ -878,12 +890,21 @@ export default {
             item.rooms.forEach((c) => {
               if (c.roomInfo.state === 88) {
                 if (!this.checkInBtnDis) {
-                  this.checkInBtnDis = c.livingData && c.livingData.livingOrder;
+                  if (c.livingData && c.livingData.livingOrder) {
+                    this.checkInBtnDis = true;
+                  } else {
+                    this.checkInBtnDis = false;
+                  }
                 }
                 if (!this.scheduleBtnDis) {
-                  this.scheduleBtnDis =
+                  if (
                     (c.livingData && c.livingData.livingOrder) ||
-                    (c.bookingData && c.bookingData.bookingOrder);
+                    (c.bookingData && c.bookingData.bookingOrder)
+                  ) {
+                    this.scheduleBtnDis = true;
+                  } else {
+                    this.scheduleBtnDis = false;
+                  }
                 }
               }
             });
@@ -920,8 +941,9 @@ export default {
       if (this.timeId) {
         clearTimeout(this.timeId);
       }
-      this.$refs.ModalBillRoomForm.add(roomLive);
-      this.$refs.ModalBillRoomForm.title = "入住登记";
+      roomLive.roomInfo.marketPrice = roomLive.layout.marketPrice;
+      this.$refs.ModalBillRoomForm.addList([roomLive.roomInfo], 1);
+      this.$refs.ModalBillRoomForm.title = "散客入住登记";
       this.$refs.ModalBillRoomForm.disableSubmit = false;
     },
     multipleRoomChange() {

+ 3 - 0
src/views/room/modules/checkIn/BillRoomForm.vue

@@ -1340,6 +1340,7 @@ export default {
         payTypeLabel: payType ? payType.name : "",
         receivable: 0,
         money: 0,
+        roomId: this.model.orderFees[0].roomId,
       });
     },
     onCellChange(key, dataIndex, value) {
@@ -1498,6 +1499,7 @@ export default {
             payTypeLabel: payType ? payType.name : "",
             receivable: item.marketPrice,
             money: item.marketPrice,
+            roomId: item.id,
           });
           var deposit = this.compuleDeposit(item.marketPrice);
           if (deposit > 0) {
@@ -1508,6 +1510,7 @@ export default {
               payTypeLabel: payType ? payType.name : "",
               receivable: deposit,
               money: deposit,
+              roomId: item.id,
             });
           }
         });

+ 115 - 34
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -244,15 +244,22 @@
         <a-divider />
         <a-table
           :columns="columns"
-          :data-source="data"
+          :data-source="feesList"
           :pagination="false"
-          :scroll="{ y: 160, x: 500 }"
+          :scroll="{ y: 160 }"
           rowKey="id"
           :rowSelection="{
             selectedRowKeys: selectedRowKeys,
             onChange: onSelectChange,
           }"
-        />
+        >
+          <template slot="subjectType" slot-scope="text, record, index">
+            {{ getSubjectTypeText(text) }}
+          </template>
+          <template slot="roomId" slot-scope="text, record, index">
+            {{ getRoomName(text) }}
+          </template>
+        </a-table>
         <div
           style="
             color: rgba(255, 87, 51, 1);
@@ -260,7 +267,7 @@
             text-align: right;
           "
         >
-          合计消费:2922:00
+          合计消费:{{ feesAmount.toFixed(2) }}
         </div>
         <div
           style="
@@ -302,15 +309,22 @@
         <a-divider />
         <a-table
           :columns="columns2"
-          :data-source="data2"
+          :data-source="paymentList"
           :pagination="false"
-          :scroll="{ y: 160, x: 500 }"
+          :scroll="{ y: 160}"
           rowKey="id"
           :rowSelection="{
             selectedRowKeys: selectedRowKeys,
             onChange: onSelectChange,
           }"
-        />
+        >
+          <template slot="payType" slot-scope="text, record, index">
+            {{ getPayTypeText(text) }}
+          </template>
+          <template slot="subjectType" slot-scope="text, record, index">
+            {{ getSubjectTypeText(text) }}
+          </template>
+        </a-table>
         <div
           style="
             color: rgba(255, 87, 51, 1);
@@ -318,19 +332,25 @@
             text-align: right;
           "
         >
-          合计收款:2922:00
+          合计收款:{{ paymentAmount.toFixed(2) }}
         </div>
       </div>
       <div style="width: 20%">
         <h4 style="color: rgba(255, 141, 26, 1); font-weight: 600">财务汇总</h4>
         <a-divider />
         <a-descriptions :column="1">
-          <a-descriptions-item label="合计收款"> + 2500 </a-descriptions-item>
-          <a-descriptions-item label="合计消费">-2500 </a-descriptions-item>
-          <a-descriptions-item label="结账应退"> 0 </a-descriptions-item>
+          <a-descriptions-item label="合计收款">
+            + {{ paymentAmount.toFixed(2) }}
+          </a-descriptions-item>
+          <a-descriptions-item label="合计消费"
+            >-{{ feesAmount.toFixed(2) }}
+          </a-descriptions-item>
+          <a-descriptions-item label="结账应退">
+            {{ (feesAmount - paymentAmount).toFixed(2) }}
+          </a-descriptions-item>
         </a-descriptions>
 
-        <a-button @click="handleAdd" type="danger" style="margin-left: 100px"
+        <a-button @click="handleAdd" type="danger" style="margin-left: 100px" disabled
           >结账退款</a-button
         >
       </div>
@@ -352,60 +372,73 @@ const columns = [
   //   },
   {
     title: "房间号",
-    dataIndex: "name",
-    width: 80,
+    dataIndex: "roomId",
+    width: 70,
+    scopedSlots: { customRender: "roomId" },
   },
   {
     title: "费项",
-    dataIndex: "age",
-    width: 80,
+    dataIndex: "subjectType",
+    width: 60,
+    scopedSlots: { customRender: "subjectType" },
   },
   {
     title: "入账日期",
-    dataIndex: "address",
-    width: 100,
+    dataIndex: "dayTime",
+    width: 110,
   },
   {
     title: "单价",
-    dataIndex: "address2",
-    width: 60,
+    dataIndex: "id",
+    // width: 60,
+    customRender: function (text, record) {
+      return record.money;
+    },
   },
   {
     title: "优惠价",
-    dataIndex: "address3",
-    width: 80,
+    dataIndex: "money",
+    // width: 80,
   },
   {
     title: "数量",
-    dataIndex: "address4",
-    width: 60,
+    dataIndex: "feeType",
+    // width: 60,
+    customRender: function (text) {
+      return 1;
+    },
   },
   {
     title: "小计",
-    dataIndex: "address5",
-    width: 60,
+    dataIndex: "livingOrderId",
+    // width: 60,
+    customRender: function (text, record) {
+      return record.money;
+    },
   },
 ];
 const columns2 = [
   {
     title: "入账时间",
-    dataIndex: "name",
-    width: 160,
+    dataIndex: "createTime",
+    // width: 110,
   },
   {
     title: "支付方式",
-    dataIndex: "age",
-    width: 100,
+    dataIndex: "payType",
+    // width: 100,
+    scopedSlots: { customRender: "payType" },
   },
   {
     title: "备注",
     dataIndex: "remark",
-    width: 120,
+    // width: 120,
+    scopedSlots: { customRender: "subjectType" },
   },
   {
     title: "金额",
-    dataIndex: "amount",
-    width: 60,
+    dataIndex: "money",
+    // width: 60,
   },
 ];
 const data = [];
@@ -479,12 +512,25 @@ export default {
       customerSourceList: [],
       warranterList: [],
       key: 0,
+      feesList: [],
+      paymentList: [],
+      payTypeList: [],
     };
   },
   computed: {
     formDisabled() {
       return this.disabled;
     },
+    feesAmount() {
+      return this.feesList.reduce(function (total, item) {
+        return total + item.money;
+      }, 0);
+    },
+    paymentAmount() {
+      return this.paymentList.reduce(function (total, item) {
+        return total + item.money;
+      }, 0);
+    },
   },
   created() {
     var _info = JSON.parse(localStorage.getItem("storeInfo"));
@@ -512,6 +558,28 @@ export default {
     });
   },
   methods: {
+    getPayTypeText(text) {
+      var find = this.payTypeList.find((t) => (t.id = text));
+      return find ? find.name : "";
+    },
+    getRoomName(id) {
+      var index = this.model.livingRoomIds.findLastIndex((t) => t.roomId == id);
+      var find = this.model.livingRoomIds[index];
+      return find ? find.roomName : "";
+    },
+    getSubjectTypeText(text) {
+      return text == 1 ? "押金" : "房费";
+    },
+    async getbusRoomPayType() {
+      await getAction("/business/busRoomPayType/list", {
+        pageSize: 99999,
+        pageNo: 1,
+      }).then((res) => {
+        if (res.success) {
+          this.payTypeList = res.result.records;
+        }
+      });
+    },
     removeLivingCustomer(id) {
       deleteAction("/business/busLivingCustomer/delete", { id: id }).then(
         (res) => {
@@ -552,7 +620,10 @@ export default {
       var find = this.customerSourceList.find((t) => t.id == customerSource);
       return find ? find.itemText : "--";
     },
-    getBookingOrderInfo() {
+    async getBookingOrderInfo() {
+      if (this.payTypeList == 0) {
+        await this.getbusRoomPayType();
+      }
       var obj = {
         bookingNo: this.id,
       };
@@ -575,6 +646,16 @@ export default {
           livingRoomId.livingCustomers = list;
           res.result.livingRoomIds.unshift(livingRoomId);
           this.model = res.result;
+          getAction("/business/busRoomBookingOrders/living-fees", {
+            bookingOrderId: this.model.orderInfo.id,
+          }).then((res) => {
+            if (res.success) {
+              if (res.result && res.result.length > 0) {
+                this.feesList = res.result.filter((t) => t.feeType === 1);
+                this.paymentList = res.result.filter((t) => t.feeType === 2);
+              }
+            }
+          });
         }
       });
     },

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

@@ -92,7 +92,7 @@
     data () {
       return {
         title:'',
-        width:1200,
+        width:1400,
         visible: false,
         disableSubmit: false
       }