DESKTOP-B78GIPM\admin před 2 roky
rodič
revize
88caf15825

+ 79 - 5
src/views/room/modules/checkIn/BillRoomForm.vue

@@ -718,6 +718,12 @@
                     /> -->
                     </div>
                   </template>
+                  <template slot="deposit" slot-scope="text, record, index">
+                    <editable-cell
+                      :text="text"
+                      @change="onCellChangeCopy('deposit', index, $event)"
+                    />
+                  </template>
                 </a-table>
                 <div
                   style="
@@ -994,17 +1000,18 @@ const columns = [
   {
     title: "天数",
     dataIndex: "day",
-    width: 60,
+    width: 40,
   },
   {
     title: "房费",
     dataIndex: "roomFee",
-    width: 80,
+    width: 60,
   },
   {
     title: "押金",
     dataIndex: "deposit",
-    // width: 60,
+    scopedSlots: { customRender: "deposit" },
+    width: 120,
   },
 ];
 
@@ -1025,6 +1032,7 @@ const columns2 = [
     title: "应缴",
     dataIndex: "receivable",
     width: "25%",
+    scopedSlots: { customRender: "prefPrice" }
   },
   {
     title: "实收",
@@ -1055,6 +1063,7 @@ export default {
   },
   data() {
     return {
+      editDepositModal: false,
       //会员选中数据
       vipCustomerData: {},
       agreementUnitData: { customerName: "" },
@@ -2052,6 +2061,68 @@ export default {
       // this.amount = sum;
       // console.log("this.model.roomPrices", this.model.roomPrices);
     },
+    onCellChangeCopy(key, dataIndex, value) {
+      console.log(key, value);
+      console.log(this.depositRule);
+      console.log(this.model.roomPrices[dataIndex]);
+      const dataSource = [...this.model.roomPrices];
+      const target = dataSource[dataIndex];
+      console.log("target", target);
+      if (target) {
+        target[key] = value;
+        // target.roomFee = value * target.day;
+        // target.deposit = this.compuleDeposit(value);
+        this.model.roomPrices = dataSource;
+      }
+      
+      var sum = 0;
+      var money2 = 0;
+      var deposit2 = 0;
+      for (var i = 0; i < this.model.roomPrices.length; i++) {
+        var money = 0;
+        var item = this.model.roomPrices[i];
+        if (item.editPrice && item.editPrice.length > 0) {
+          item.editPrice.forEach((p) => {
+            money += p;
+          });
+          item.roomFee = money;
+          sum += money + item.deposit;
+        } else {
+          sum += item.roomFee + item.deposit;
+        }
+
+        money2 += item.roomFee;
+        deposit2 += item.deposit;
+        // var find = this.model.orderFees.find(
+        //   (t) =>
+        //     t.subjectType == 2 &&
+        //     t.roomId == this.model.roomPrices[this.editPriceIndex].roomId
+        // );
+        // if (find && find.roomId == item.roomId) {
+        //   find.money = money;
+        //   find.receivable = money;
+        // }
+      }
+      var find = this.model.orderFees.find(
+        (t) => t.subjectType == 2 && t.roomId == this.model.roomIds[0].id
+      );
+      if (find) {
+        find.money = money2;
+        find.receivable = money2;
+        if (!this.paymentSplit) {
+          find.money += deposit2;
+          find.receivable += deposit2;
+        }
+      }
+      var find2 = this.model.orderFees.find(
+        (t) => t.subjectType == 1 && t.roomId == this.model.roomIds[0].id
+      );
+      if (find2) {
+        find2.money = deposit2;
+        find2.receivable = deposit2;
+      }
+      this.amount = sum;
+    },
     // handleChange(value, index, column) {
     //   const newData = [...this.data2];
     //   const target = newData[index];
@@ -2495,7 +2566,7 @@ export default {
             .then((res) => {
               if (res.success) {
                 that.$message.success(res.message);
-                that.$emit("ok", {order:res.result, model:that.model});
+                that.$emit("ok", { order: res.result, model: that.model });
               } else {
                 if (res.message.indexOf("与预约时间有冲突") >= 0) {
                   that.$confirm({
@@ -2507,7 +2578,10 @@ export default {
                         .then((res) => {
                           if (res.success) {
                             that.$message.success(res.message);
-                            that.$emit("ok", {order:res.result, model:that.model});
+                            that.$emit("ok", {
+                              order: res.result,
+                              model: that.model,
+                            });
                           } else {
                             if (res.message.indexOf("与预约时间有冲突") >= 0) {
                             } else {

+ 13 - 0
src/views/room/modules/checkIn/SelectRoomForm.vue

@@ -223,6 +223,7 @@ export default {
       checkLayoutList: [],
       roomLayoutList: [],
       oldroomList: [],
+      kzfLiving: false,
     };
   },
   computed: {
@@ -263,6 +264,13 @@ export default {
                 this.checkChange('',[this.roomStatusOptions[0].value,this.roomStatusOptions[1].value])
             }
         });
+    getAction("/business/busOtherEmptyDirtyRoom/queryByHotelId", {}).then(
+        (res) => {
+          if (res.success) {
+            this.kzfLiving = res.result.status === 1;
+          }
+        }
+      );
   },
   methods: {
     filterColor(state){
@@ -348,6 +356,11 @@ export default {
         },
 
     checkRoomClick(row) {
+      console.log(row);
+      if (!this.kzfLiving && row.roomStatus === 2) {
+            this.$message.warning("空脏房不允许入住");
+            return;
+          }
       if (row.check === 1) {
         row.check = 0;
         var index = this.model.rooms.findIndex((t) => t.key1 == row.key1);