瀏覽代碼

Merge branch 'master' of http://49.4.53.36:3000/hotel/hotel-saas-tenant-frontend

DESKTOP-B78GIPM\admin 2 年之前
父節點
當前提交
0b406fdabb

+ 4 - 0
src/api/api.js

@@ -7,6 +7,8 @@ const addRole = (params)=>postAction("/sys/role/add",params);
 const editRole = (params)=>putAction("/sys/role/edit",params);
 const checkRoleCode = (params)=>getAction("/sys/role/checkRoleCode",params);
 const queryall = (params)=>getAction("/sys/role/queryall",params);
+const saveRoleAndPermission = (params)=>postAction("/sys/role/saveRoleAndPermission",params);
+const editRoleAndPermission = (params)=>postAction("/sys/role/editRoleAndPermission",params);
 
 //用户管理
 const addUser = (params)=>postAction("/sys/user/add",params);
@@ -126,6 +128,8 @@ export const transitRESTful = {
 
 export {
   addRole,
+  saveRoleAndPermission,
+  editRoleAndPermission,
   editRole,
   checkRoleCode,
   addUser,

+ 3 - 2
src/utils/excloudHotelIdParamPath/CesRoomLayoutPriceController.js

@@ -2,6 +2,7 @@ export default {
     name: '房价管理模块',
     excloudUrls: [
         '/sys/randomImage',
-        '/rooms/cesRoomBuildingFloor/delete'
+        '/rooms/cesRoomBuildingFloor/delete',
+        '/sys/role/list',
     ]
-}
+}

+ 3 - 2
src/views/hotel/newHotelForm.vue

@@ -60,7 +60,7 @@
             <a-input-number placeholder="1~9999" style="width: 180px;" :min="1" :max="9999"  v-decorator="['roomCount', { rules: [{ required: true, message: '1~9999' }], }]"/>
         </a-form-item>
 
-        
+
 
 
         <a-form-item label="集团品牌">
@@ -103,6 +103,7 @@ export default {
     },
     methods: {
         handleSubmit(e) {
+            this.$router.go(0);
             // e.preventDefault();
             this.form.validateFields((err, values) => {
                 if (!err) {
@@ -130,4 +131,4 @@ export default {
 .short-anl{
     width: 70%;
 }
-</style>
+</style>

+ 29 - 3
src/views/markets/modules/agreementUnit/agreementAccount.vue

@@ -191,11 +191,16 @@
                     <a-tag v-if="record.status == 2" color="green">已结算</a-tag>
                     <a-tag v-else color="red">未结算</a-tag>
                 </template>
+                <template slot="remarksSlot" slot-scope="text,record">
+                    <a-input v-model="record.remarks" placeholder="" @blur="handleAccountRemarks(record)"></a-input>
+                </template>
                 <span slot="action" slot-scope="text, record">
-                    <a v-if="record.type == 3" @click="handleGoodsReturn(record)">退货</a>
                     <a-popconfirm v-if="record.status == 2" title="确定撤销结算吗?" @confirm="() => handleRevoke(record)">
                       <a>撤销</a>
                     </a-popconfirm>
+                    <span v-else>
+                        <a v-if="record.type == 3" @click="handleGoodsReturn(record)">退货</a>
+                    </span>
                 </span>
             </a-table>
         </div>
@@ -286,8 +291,10 @@ export default {
                 },
                 {
                     title:'备注',
+                    width: 200,
                     align:"center",
-                    dataIndex: 'remarks'
+                    dataIndex: 'remarks',
+                    scopedSlots: { customRender: 'remarksSlot' }
                 },
                 {
                     title:'操作员',
@@ -319,6 +326,7 @@ export default {
                 exportXlsUrl: "/business/busAgreementOrderFee/exportXls",
                 importExcelUrl: "business/busAgreementOrderFee/importExcel",
                 revoke: "/business/busAgreementOrderFee/revoke",
+                editRemarks: "/business/busAgreementOrderFee/editRemarks",
                 queryAgreementAccount: "/business/busAgreementOrderFee/queryAgreementAccount",//获取协议单位消费、收款信息
             },
             queryParam: {
@@ -372,7 +380,7 @@ export default {
             if (this.settleType == 1 || this.settleType == 2){
                 this.url.list = this.url.baseList +"?status="+this.settleType+"&agreementUnitId="+this.agreementUnitInfo.id;
             }else{
-                this.url.list = this.url.baseList+"?status=1&agreementUnitId="+this.agreementUnitInfo.id;
+                this.url.list = this.url.baseList+"?agreementUnitId="+this.agreementUnitInfo.id;
             }
             // if (!this.queryParam.startTime=="") {
             //     this.url.list = this.url.list + "&startDate=" + this.queryParam.startTime
@@ -493,6 +501,24 @@ export default {
                     that.accountModel = res.result;
                 }
             });
+        },
+        handleAccountRemarks(record){
+            console.log(record)
+            const that = this;
+            that.confirmLoading = true;
+            let httpurl = this.url.editRemarks;
+            let method = 'put';
+            httpAction(httpurl,record,method).then((res)=>{
+                if(res.success){
+                    that.$message.success(res.message);
+                    // that.$emit('ok');
+                    // that.loadData(1);
+                }else{
+                    that.$message.warning(res.message);
+                }
+            }).finally(() => {
+                that.confirmLoading = false;
+            })
         }
     }
 }

+ 6 - 1
src/views/room/leasegoods.vue

@@ -215,7 +215,12 @@ export default {
   },
   methods: {
     handleAdd() {
-      this.$refs.modalForm.add(this.livingOrderId);
+      var id = null;
+      if (this.livingOrderId) {
+        var ids = this.livingOrderId.split(",");
+        id = ids[0];
+      }
+      this.$refs.modalForm.add(id);
       this.$refs.modalForm.title = "新增";
       this.$refs.modalForm.disableSubmit = false;
     },

+ 148 - 81
src/views/room/modules/checkIn/BillRoomForm.vue

@@ -1186,6 +1186,8 @@ export default {
       oldBusMarketAgreementUnitList: [],
       busMarketAgreementUnitList: [],
       ruZhuHistoryList: [],
+      remenmberPayState: null,
+      loadRemenmberPayState: false,
     };
   },
   computed: {
@@ -1218,18 +1220,23 @@ export default {
       let copy = JSON.parse(JSON.stringify(this.model.roomPrices));
       for (let i = 0; i < copy.length; i++) {
         let money = copy[i].prefPrice;
-        let brr = []
+        let brr = [];
         brr.length = this.model.orderInfo.dayCount;
         for (let j = 0; j < brr.length; j++) {
           brr[j] = {
             day: this.addDate(this.model.orderInfo.arrivalTime2, j),
-            price:money
+            price: money,
           };
-          if (this.model.roomPrices[i].editPriceTime && this.model.roomPrices[i].editPriceTime.length > 0) {
-            let idx = this.model.roomPrices[i].editPriceTime.findIndex((item) => item == brr[j].day);
+          if (
+            this.model.roomPrices[i].editPriceTime &&
+            this.model.roomPrices[i].editPriceTime.length > 0
+          ) {
+            let idx = this.model.roomPrices[i].editPriceTime.findIndex(
+              (item) => item == brr[j].day
+            );
             if (idx > -1) {
               brr[j].price = this.model.roomPrices[i].editPrice[idx];
-            }            
+            }
           }
         }
         // brr.fill({day: this.addDate(this.model.orderInfo.arrivalTime2, i),price:money})
@@ -1237,8 +1244,8 @@ export default {
         //   day: this.addDate(this.model.orderInfo.arrivalTime2, i),
         //   price:money
         // };
-        copy[i].edit = brr
-        copy[i].day = this.model.orderInfo.dayCount
+        copy[i].edit = brr;
+        copy[i].day = this.model.orderInfo.dayCount;
       }
       this.PriceData = copy;
       return copy;
@@ -1314,51 +1321,55 @@ export default {
       }
     },
     paymentSplit(value) {
-      if (!value) {
-        var list2 = this.model.orderFees.filter(
-          (t) => t.subjectType == 2 && (!t.add || t.add != 1)
-        );
-        var list1 = this.model.orderFees.filter((t) => t.subjectType == 1);
-        var list = this.model.orderFees.filter(
-          (t) =>
-            (t.subjectType != 1 && t.subjectType != 2) || (t.add && t.add == 1)
-        );
-        list2.forEach((t) => {
-          var yjList = list1.filter((b) => b.roomId == t.roomId);
-          var yajin = yjList.reduce((sum, val) => {
-            let total = sum + val.money;
-            return isNaN(total) ? 0 : total;
-          }, 0);
-          t.yajing = yajin;
-          t.money += yajin;
-          t.receivable = t.money;
-        });
-        this.model.orderFees = [...list, ...list2];
-      } else {
-        // var list2 = this.model.orderFees.filter(
-        //   (t) => t.subjectType == 2 && (!t.add || t.add != 1)
-        // );
-        // var list1 = [];
+      if (this.loadRemenmberPayState) {
+        console.log(1111111, this.loadRemenmberPayState);
+        if (!value) {
+          var list2 = this.model.orderFees.filter(
+            (t) => t.subjectType == 2 && (!t.add || t.add != 1)
+          );
+          var list1 = this.model.orderFees.filter((t) => t.subjectType == 1);
+          var list = this.model.orderFees.filter(
+            (t) =>
+              (t.subjectType != 1 && t.subjectType != 2) ||
+              (t.add && t.add == 1)
+          );
+          list2.forEach((t) => {
+            var yjList = list1.filter((b) => b.roomId == t.roomId);
+            var yajin = yjList.reduce((sum, val) => {
+              let total = sum + val.money;
+              return isNaN(total) ? 0 : total;
+            }, 0);
+            t.yajing = yajin;
+            t.money += yajin;
+            t.receivable = t.money;
+          });
+          this.model.orderFees = [...list, ...list2];
+        } else {
+          // var list2 = this.model.orderFees.filter(
+          //   (t) => t.subjectType == 2 && (!t.add || t.add != 1)
+          // );
+          // var list1 = [];
 
-        // var list = this.model.orderFees.filter(
-        //   (t) =>
-        //     (t.subjectType != 1 && t.subjectType != 2) || (t.add && t.add == 1)
-        // );
-        // list2.forEach((t) => {
-        //   if (t.yajing && t.yajing > 0) {
-        //     t.money -= t.yajing;
-        //     t.receivable = t.money;
-        //     var item = JSON.parse(JSON.stringify(t));
-        //     item.subjectType = 1;
-        //     item.money = t.yajing;
-        //     item.yajing = 0;
-        //     item.receivable = item.money;
-        //     list1.push(item);
-        //   }
-        // });
-        // list = [...list, ...list1];
-        // this.model.orderFees = [...list, ...list2];
-        this.loadOrderFees();
+          // var list = this.model.orderFees.filter(
+          //   (t) =>
+          //     (t.subjectType != 1 && t.subjectType != 2) || (t.add && t.add == 1)
+          // );
+          // list2.forEach((t) => {
+          //   if (t.yajing && t.yajing > 0) {
+          //     t.money -= t.yajing;
+          //     t.receivable = t.money;
+          //     var item = JSON.parse(JSON.stringify(t));
+          //     item.subjectType = 1;
+          //     item.money = t.yajing;
+          //     item.yajing = 0;
+          //     item.receivable = item.money;
+          //     list1.push(item);
+          //   }
+          // });
+          // list = [...list, ...list1];
+          // this.model.orderFees = [...list, ...list2];
+          this.loadOrderFees();
+        }
       }
     },
     // "model.roomIds": {
@@ -1517,7 +1528,7 @@ export default {
     //  this.getcesRoomLayout();
   },
   methods: {
-    priceInput(e,idx,sidx){
+    priceInput(e, idx, sidx) {
       console.log(e, idx, sidx);
       this.editPriceData[idx].edit[sidx].price = e;
     },
@@ -1563,18 +1574,15 @@ export default {
     },
 
     loadOrderFees() {
+      var arr = [];
+      if (!this.loadRemenmberPayState) {
+        arr = this.remenmberPayState.split("-");
+        this.paymentSplit = arr[0] == "1";
+      }
       var orderFees = [];
       var roomIndex = 0;
       var payType = this.payTypeList[0];
-      // roomNo: item.name,
-      //         roomId: item.id,
-      //         marketPrice: item.marketPrice,
-      //         prefPrice: item.marketPrice,
-      //         day: this.model.orderInfo.dayCount,
-      //         roomFee: item.marketPrice * this.model.orderInfo.dayCount,
-      //         deposit: this.compuleDeposit(item.marketPrice),
-      //         layoutName: roomLayout ? roomLayout.name : "",
-      //         layoutId: item.layoutId,
+
       this.model.roomPrices.forEach((item) => {
         var money = item.roomFee;
         var deposit = item.deposit;
@@ -1582,15 +1590,52 @@ export default {
           if (!this.paymentSplit) {
             money = item.roomFee + deposit;
           }
-          orderFees.push({
-            subjectType: 2,
-            subjectTypeLabel: "预收房费",
-            payType: payType ? payType.id : "",
-            payTypeLabel: payType ? payType.name : "",
-            receivable: money,
-            money: money,
-            roomId: this.model.roomIds[0].id,
-          });
+          if (!this.paymentSplit) {
+            if (arr.length === 3) {
+              if (arr[1] == "1") {
+                orderFees.push({
+                  subjectType: 2,
+                  subjectTypeLabel: "预收房费",
+                  payType: payType ? payType.id : "",
+                  payTypeLabel: payType ? payType.name : "",
+                  receivable: money,
+                  money: money,
+                  roomId: this.model.roomIds[0].id,
+                });
+              } else if (arr[1] == "2") {
+                orderFees.push({
+                  subjectType: 1,
+                  subjectTypeLabel: "押金",
+                  payType: payType ? payType.id : "",
+                  payTypeLabel: payType ? payType.name : "",
+                  receivable: deposit,
+                  money: deposit,
+                  roomId: this.model.roomIds[0].id,
+                });
+              }
+            } else {
+              orderFees.push({
+                subjectType: 2,
+                subjectTypeLabel: "预收房费",
+                payType: payType ? payType.id : "",
+                payTypeLabel: payType ? payType.name : "",
+                receivable: money,
+                money: money,
+                roomId: this.model.roomIds[0].id,
+              });
+            }
+          } else {
+            orderFees.push({
+              subjectType: 2,
+              subjectTypeLabel: "预收房费",
+              payType: payType ? payType.id : "",
+              payTypeLabel: payType ? payType.name : "",
+              receivable: money,
+              money: money,
+              roomId: this.model.roomIds[0].id,
+            });
+          }
+
           if (this.paymentSplit) {
             if (deposit > 0) {
               orderFees.push({
@@ -1640,7 +1685,11 @@ export default {
         }
         roomIndex++;
       });
+
       this.model.orderFees = orderFees;
+      setTimeout(() => {
+        this.loadRemenmberPayState = true;
+      }, 100);
     },
     readCardNo() {
       this.$message.error("接口程序未打开,请打开接口程序");
@@ -1762,7 +1811,7 @@ export default {
       this.$refs.modalAgreementUnitTable.disableSubmit = true;
     },
     //批量调价
-    batchPrice(e,index) {
+    batchPrice(e, index) {
       console.log(e);
       // this.editPriceData.forEach((ele) => {
       //   ele.price = e;
@@ -1793,10 +1842,7 @@ export default {
     onCellExpand(idx) {
       console.log(idx);
       this.editPriceIndex = idx;
-      console.log(
-        "11111111111111111111111",
-        this.model.roomPrices
-      );
+      console.log("11111111111111111111111", this.model.roomPrices);
       this.editPriceModal = true;
     },
 
@@ -1823,15 +1869,14 @@ export default {
       //   ele.price = 0;
       // });
       this.model.roomPrices = JSON.parse(JSON.stringify(this.editPriceData));
-      this.model.roomPrices.forEach((ele,index)=>{
+      this.model.roomPrices.forEach((ele, index) => {
         ele.editPriceTime = [];
         ele.editPrice = [];
-        ele.edit.forEach((t,tdx)=>{
-          ele.editPriceTime.push(t.day),
-          ele.editPrice.push(t.price)
-        })
+        ele.edit.forEach((t, tdx) => {
+          ele.editPriceTime.push(t.day), ele.editPrice.push(t.price);
+        });
         ele.prefPrice = ele.edit[0].price;
-      })
+      });
       // this.editPriceData.forEach((ele, index) => {
       //   if (this.model.roomPrices[index].roomId==ele.roomId) {
       //     this.model.roomPrices[index].editPriceTime = [];
@@ -2455,6 +2500,9 @@ export default {
       if (this.payTypeList == 0) {
         await this.getbusRoomPayType();
       }
+      if (!this.remenmberPayState) {
+        await this.getHotelInfo();
+      }
       if (this.customerSourceList) {
         if (!this.model.orderInfo.customerSource) {
           this.model.orderInfo.customerSource = this.customerSourceList[0].id;
@@ -2611,6 +2659,16 @@ export default {
         // this.model.orderFees = [...this.model.orderFees, ...orderFees];
       }
     },
+    async getHotelInfo() {
+      var _info = JSON.parse(localStorage.getItem("storeInfo"));
+      await getAction("/business/busHotel/queryById", { id: _info.id }).then(
+        (res) => {
+          if (res.success) {
+            this.remenmberPayState = res.result.remenmberPayState || "1-1-2";
+          }
+        }
+      );
+    },
     submitForm() {
       const that = this;
       that.model.livingRoomDayPrices = [];
@@ -2694,6 +2752,15 @@ export default {
               if (res.success) {
                 that.$message.success(res.message);
                 that.$emit("ok", { order: res.result, model: that.model });
+                var arr = [
+                  that.paymentSplit ? 1 : 2,
+                  this.model.orderFees[0].subjectType == 1 ? 2 : 1,
+                  this.model.orderFees[0].subjectType == 1 ? 2 : 1,
+                ];
+                getAction("/business/busHotel/set-pay-state", {
+                  hotelId: this.model.hotelId,
+                  type: arr.join("-"),
+                }).then((res) => {});
               } else {
                 if (res.message.indexOf("与预约时间有冲突") >= 0) {
                   that.$confirm({

+ 110 - 62
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -225,11 +225,15 @@
                 :key="customer.id"
               >
                 <template v-if="index > 0">
-                  <a-col :span="7"> {{ customer.customerName }} </a-col>
-                  <a-col :span="1"
+                  <a-col :span="6">
+                    ({{ getRoomName(customer.roomId) }}){{
+                      customer.customerName
+                    }}
+                  </a-col>
+                  <a-col :span="2"
                     >{{ customer.gender == 1 ? "男" : "女" }}
                   </a-col>
-                  <a-col :span="8"> {{ customer.certNo }}</a-col>
+                  <a-col :span="8"> {{ customer.certNo || "--" }}</a-col>
                   <a-col :span="6"> {{ customer.phone }}</a-col>
                   <a-col :span="2">
                     <a-icon
@@ -994,18 +998,28 @@ export default {
       this.$refs.modalSelectCheckInRoomOrder.livingRoomId = find.roomId;
     },
     addLeaseGoods() {
-      if (this.selectRoomId === "1") {
-        this.$message.warning("请先选择房间");
-        return;
-      }
+      // if (this.selectRoomId === "1") {
+      //   this.$message.warning("请先选择房间");
+      //   return;
+      // }
       var index = this.model.livingRoomIds.findLastIndex(
         (t) => t.roomId == this.selectRoomId
       );
       var find = this.model.livingRoomIds[index];
+      var livingOrderId = "";
+      if (find.roomId != "1") {
+        livingOrderId = find.livingOrder.id;
+      } else {
+        this.model.livingRoomIds
+          .filter((t) => t.roomId != "1")
+          .forEach((t) => {
+            livingOrderId += t.livingOrder.id + ",";
+          });
+      }
       this.$refs.modalLeaseGoods.add();
       this.$refs.modalLeaseGoods.title = "客人留言";
       this.$refs.modalLeaseGoods.disableSubmit = false;
-      this.$refs.modalLeaseGoods.livingOrderId = find.livingOrder.id;
+      this.$refs.modalLeaseGoods.livingOrderId = livingOrderId; //find.livingOrder.id;
     },
     addMessage() {
       if (this.selectRoomId === "1") {
@@ -1245,65 +1259,99 @@ export default {
       this.selectedRowKeys = selectedRowKeys;
       this.selectionRows = selectionRows;
     },
-    handleAdd() {
-      var list = this.paymentList.filter((t) => t.subjectType === 1);
-      var deposit = list.reduce(function (total, item) {
-        return total + item.money;
-      }, 0);
-
-      var list2 = this.paymentList.filter((t) => t.subjectType === 2);
-      var sum = list2.reduce(function (total, item) {
-        return total + item.money;
-      }, 0);
-
-      var list3 = this.feesList.filter((t) => t.subjectType === 3);
-      var sum2 = list3.reduce(function (total, item) {
-        return total + item.money;
-      }, 0);
+    async handleAdd() {
+      var that = this;
       var index = this.model.livingRoomIds.findLastIndex(
         (t) => t.roomId == this.selectRoomId
       );
       var livingRoom = this.model.livingRoomIds[index];
-      if (this.paymentAmount - this.feesAmount > 0) {
-        this.$refs.modalRefundForm.edit({
-          billRefund: this.paymentAmount - this.feesAmount,
-          deposit: deposit - (sum - sum2),
-          roomFee: sum - sum2,
-          money: this.paymentAmount - this.feesAmount,
-          subjectType: 5,
-          feeType: 2,
-          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;
+      var livingOrderId = "";
+      if (livingRoom.roomId != "1") {
+        livingOrderId = livingRoom.livingOrder.id;
       } else {
-        this.$refs.modalPaymentForm.edit({
-          billAmount: parseFloat(
-            Math.abs(this.paymentAmount - this.feesAmount).toFixed(2)
-          ),
-          deposit: deposit - (sum - sum2),
-          roomFee: parseFloat(
-            Math.abs(this.paymentAmount - this.feesAmount).toFixed(2)
-          ),
-          subjectType: 5,
-          feeType: 2,
-          bookingOrderId: this.model.orderInfo.id,
-          livingOrderId:
-            livingRoom.roomId != "1" ? livingRoom.livingOrder.id : "",
-          preferentialType: 1,
-          couponFirstAmount: 0,
-          discount: 9,
-          vipCustomerId: livingRoom.livingOrder.vipCustomerId,
-          contractTeamId: livingRoom.livingOrder.contractTeamId,
-          contractTeamProtocolId: livingRoom.livingOrder.contractTeamProtocolId,
-        });
-        this.$refs.modalPaymentForm.title = "结账收款";
-        this.$refs.modalPaymentForm.disableSubmit = false;
+        this.model.livingRoomIds
+          .filter((t) => t.roomId != "1")
+          .forEach((t) => {
+            livingOrderId += t.livingOrder.id + ",";
+          });
+      }
+      /*判断是否有租借物品未归还*/
+      var count = 0;
+      await getAction("/order/cesOrderLeaseGoods/checkReturnGoods", {
+        livingOrderId: livingOrderId,
+      }).then((res) => {
+        if (res.success) {
+          if (res.result && res.result > 0) {
+            count = res.result;
+            that.$confirm({
+              title: "提示",
+              content: "您还有" + count + "件物品未归还,是否跳转物品租借页面?",
+              onOk: function () {
+                that.addLeaseGoods();
+              },
+              onCancel() {},
+            });
+          }
+        }
+      });
+      if (count == 0) {
+        var list = this.paymentList.filter((t) => t.subjectType === 1);
+        var deposit = list.reduce(function (total, item) {
+          return total + item.money;
+        }, 0);
+
+        var list2 = this.paymentList.filter((t) => t.subjectType === 2);
+        var sum = list2.reduce(function (total, item) {
+          return total + item.money;
+        }, 0);
+
+        var list3 = this.feesList.filter((t) => t.subjectType === 3);
+        var sum2 = list3.reduce(function (total, item) {
+          return total + item.money;
+        }, 0);
+        if (this.paymentAmount - this.feesAmount > 0) {
+          this.$refs.modalRefundForm.edit({
+            billRefund: this.paymentAmount - this.feesAmount,
+            deposit: deposit - (sum - sum2),
+            roomFee: sum - sum2,
+            money: this.paymentAmount - this.feesAmount,
+            subjectType: 5,
+            feeType: 2,
+            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;
+        } else {
+          this.$refs.modalPaymentForm.edit({
+            billAmount: parseFloat(
+              Math.abs(this.paymentAmount - this.feesAmount).toFixed(2)
+            ),
+            deposit: deposit - (sum - sum2),
+            roomFee: parseFloat(
+              Math.abs(this.paymentAmount - this.feesAmount).toFixed(2)
+            ),
+            subjectType: 5,
+            feeType: 2,
+            bookingOrderId: this.model.orderInfo.id,
+            livingOrderId:
+              livingRoom.roomId != "1" ? livingRoom.livingOrder.id : "",
+            preferentialType: 1,
+            couponFirstAmount: 0,
+            discount: 9,
+            vipCustomerId: livingRoom.livingOrder.vipCustomerId,
+            contractTeamId: livingRoom.livingOrder.contractTeamId,
+            contractTeamProtocolId:
+              livingRoom.livingOrder.contractTeamProtocolId,
+          });
+          this.$refs.modalPaymentForm.title = "结账收款";
+          this.$refs.modalPaymentForm.disableSubmit = false;
+        }
       }
     },
     puls() {

+ 99 - 0
src/views/room/modules/checkIn/EditBatchRoomPriceForm.vue

@@ -0,0 +1,99 @@
+<template>
+  <a-card :bordered="false">
+    <div>
+      <a-list
+        :grid="{ gutter: 0, column: 6 }"
+        :data-source="model.livingDayPrices"
+      >
+        <a-list-item slot="renderItem" slot-scope="item, index">
+          <a-card title="价格">
+            <p>{{ item.dayTime }}</p>
+            <p>
+              <a-input-number
+                :disabled="item.dayTime < currentDate"
+                v-model="item.price"
+                placeholder="价格"
+                :min="0"
+              ></a-input-number>
+            </p>
+          </a-card>
+        </a-list-item>
+      </a-list>
+    </div>
+  </a-card>
+</template>
+
+<script>
+import { httpAction, getAction, postAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+import moment from "moment";
+export default {
+  name: "BusMemberCardForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      currentDate: moment(new Date()).format("YYYY-MM-DD"),
+      model: { livingDayPrices: [] },
+      url: {
+        add: "/business/busRoomBookingOrders/booking-to-live",
+        edit: "/business/busMemberCard/edit",
+        queryById: "/business/busMemberCard/queryById",
+      },
+      gradeList: [],
+      paymentMethodList: [],
+      staffList: [],
+      customerList: [],
+      oldcustomerList: [],
+      hourRoomRuleList: [],
+    };
+  },
+  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));
+  },
+  methods: {
+    moment,
+    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() {
+      this.$emit("ok", this.model.livingDayPrices);
+    },
+  },
+};
+</script>
+
+<style scoped>
+/deep/ .ant-card-head {
+  text-align: center;
+  background: #f0f0f0;
+  height: 28px !important;
+}
+/deep/ .ant-card-body {
+  padding: 2px !important;
+  text-align: center;
+}
+</style>

+ 64 - 0
src/views/room/modules/checkIn/EditBatchRoomPriceModal.vue

@@ -0,0 +1,64 @@
+<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 "./EditBatchRoomPriceForm";
+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(e) {
+      this.$emit("ok", e);
+      this.visible = false;
+    },
+    handleCancel() {
+      this.close();
+    },
+  },
+};
+</script>

+ 271 - 0
src/views/room/modules/checkIn/EditBookingTypeForm.vue

@@ -0,0 +1,271 @@
+<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"
+            >
+              {{ sumPrice
+              }}<a-icon
+                @click="editBatchRoomPrice()"
+                type="edit"
+                style="color: rgba(255, 141, 26, 1); font-size: 18px"
+              />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="入住类型"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="liveType"
+            >
+              <a-select
+                placeholder="入住类型"
+                v-model="model.liveType"
+                @change="bookingTypeChange"
+              >
+                <a-select-option :value="1"> 全天 </a-select-option>
+                <a-select-option :value="2"> 钟点 </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24" v-if="model.liveType == 2">
+            <a-form-model-item
+              label="时长"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="fangAnId"
+            >
+              <a-select
+                placeholder="时长"
+                v-model="model.fangAnId"
+                @change="hourRoomIdChange"
+              >
+                <a-select-option
+                  :value="item.id"
+                  v-for="(item, index) in hourRoomRuleList"
+                  :key="item.id"
+                >
+                  {{ item.hourRoomName }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+    <edit-batch-room-price-modal
+      ref="modalEditBatchRoomPriceModal"
+      @ok="modalFormOk"
+    ></edit-batch-room-price-modal>
+  </a-spin>
+</template>
+
+<script>
+import moment from "moment";
+import { httpAction, getAction, postAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+import EditBatchRoomPriceModal from "./EditBatchRoomPriceModal.vue";
+export default {
+  name: "BusMemberCardForm",
+  components: { EditBatchRoomPriceModal },
+  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: "请输入手机号!",
+          },
+        ],
+        liveType: [{ 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: [],
+      hourRoomRuleList: [],
+      currentDate: moment(new Date()).format("YYYY-MM-DD"),
+      roomPrice: 0,
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+    sumPrice() {
+      var sum = 0;
+      // if (this.model.liveType == 1) {
+      (this.model.livingDayPrices || []).forEach((item) => {
+        sum += item.price;
+      });
+      // } else if (this.model.liveType == 2) {
+      //   var find = this.hourRoomRuleList.find(
+      //     (t) => t.id == this.model.fangAnId
+      //   );
+      //   if (find) {
+      //     sum = find.afterOpenRoomPay;
+      //   }
+      // }
+      return sum;
+    },
+  },
+  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("/rooms/cesHourRoomRule/list", {
+      pageNo: 1,
+      pageSize: 100,
+    }).then((res) => {
+      if (res.success) {
+        this.hourRoomRuleList = res.result.records;
+      }
+    });
+  },
+  methods: {
+    moment,
+    modalFormOk(e) {
+      console.log("e", e);
+    },
+    editBatchRoomPrice() {
+      this.$refs.modalEditBatchRoomPriceModal.edit(this.model);
+      this.$refs.modalEditBatchRoomPriceModal.title = "修改";
+      this.$refs.modalEditBatchRoomPriceModal.disableSubmit = false;
+    },
+    bookingTypeChange(e) {
+      if (this.model.liveType == 1) {
+        this.model.fangAnId = "";
+        if (this.model.oldliveType == 1) {
+          this.model.livingDayPrices = this.model.oldlivingDayPrices;
+        } else if (this.model.oldliveType == 2) {
+          //钟点转全天,每日房价要重新赋值
+          this.model.livingDayPrices = this.model.oldlivingDayPrices;
+          var item = JSON.parse(
+            JSON.stringify(this.model.oldlivingDayPrices[0])
+          );
+          item.dayTime = this.currentDate;
+          item.price = this.roomPrice;
+          this.model.livingDayPrices = [item];
+        }
+      } else {
+        var hourRoomRule = this.hourRoomRuleList[0];
+        if (hourRoomRule) {
+          this.model.fangAnId = hourRoomRule.id;
+          this.bindLivingDayPrices();
+        }
+      }
+    },
+    bindLivingDayPrices() {
+      var find = this.hourRoomRuleList.find((t) => t.id == this.model.fangAnId);
+      var item = JSON.parse(JSON.stringify(this.model.oldlivingDayPrices[0]));
+      item.dayTime = this.currentDate;
+      item.price = 0;
+      if (find) {
+        item.price = find.afterOpenRoomPay;
+      }
+      this.model.livingDayPrices = [item];
+    },
+    hourRoomIdChange() {
+      this.bindLivingDayPrices();
+    },
+    add(livingOrderId, roomId) {
+      this.modelDefault.livingOrderId = livingOrderId;
+      this.modelDefault.roomId = roomId;
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.model.oldlivingDayPrices = JSON.parse(
+        JSON.stringify(this.model.livingDayPrices)
+      );
+      this.model.oldliveType = JSON.parse(JSON.stringify(this.model.liveType));
+      this.visible = true;
+
+      getAction(
+        "/rooms/cesRooms/get-room-mkt-price?roomId=" + this.model.roomId,
+        {}
+      ).then((res) => {
+        if (res.success) {
+          this.roomPrice = res.result;
+        }
+      });
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate((valid) => {
+        console.log(this.model);
+        // return;
+        if (valid) {
+          that.model.prices = {
+            livingOrderId: that.model.orderId,
+            dayPrices: that.model.livingDayPrices,
+          };
+          that.confirmLoading = true;
+          postAction(
+            "/business/busRoomBookingOrders/update-orders?type=2",
+            this.model
+          )
+            .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/EditBookingTypeModal.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 './EditBookingTypeForm'
+  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>

+ 182 - 0
src/views/room/modules/checkIn/EditBreakfastNumForm.vue

@@ -0,0 +1,182 @@
+<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="brkfstNum"
+            >
+              <a-input-number
+                v-model="model.brkfstNum"
+                placeholder="早餐数量"
+                :min="0"
+              ></a-input-number
+              >份
+            </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/EditBreakfastNumModal.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 './EditBreakfastNumForm'
+  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>

+ 12 - 1
src/views/room/modules/checkIn/Payment.vue

@@ -185,6 +185,10 @@
               {{ sumAmount.toFixed(2) }}元
             </a-form-model-item>
           </a-col>
+          <a-col :span="24" style="text-align: end">
+            <a-checkbox default-checked>打印结账单</a-checkbox>
+            <a-checkbox default-checked>打印发票二维码</a-checkbox>
+          </a-col>
         </a-row>
       </a-form-model>
     </j-form-container>
@@ -371,8 +375,15 @@ export default {
       });
     },
     puls() {
+      var sum = this.payList.reduce(function (total, item) {
+        return total + item.money;
+      }, 0);
+      var money = this.realityAmount - sum;
+      if (money < 0) {
+        money = 0;
+      }
       this.payList.push({
-        money: 0,
+        money: money,
         payType: this.payTypeList[0].id,
         isVipMemmber: false,
         isDanwei: false,

+ 100 - 69
src/views/settings/components/roomModules/roomNumSettings/roomNumTable.vue

@@ -4,32 +4,41 @@
 
     <!-- 操作按钮区域 -->
     <div class="table-operator">
-        <a-tag color="pink" v-if="buildingFloorSearchTag.name" >
-            {{ buildingFloorSearchTag.name }}
-            <a-icon type="close"  @click="onFliterClose" />
-        </a-tag>
+      <a-tag color="pink" v-if="buildingFloorSearchTag.name">
+        {{ buildingFloorSearchTag.name }}
+        <a-icon type="close" @click="onFliterClose" />
+      </a-tag>
       <a-button @click="handleAdd" type="primary" icon="plus"
         >新增房间</a-button
       >
       <a-button @click="onAddBatch" type="primary" icon="tags"
         >批量新增</a-button
       >
+      <a-popconfirm title="确定全部删除吗?" @confirm="delAll">
+        <a-button
+          :disabled="delLoading"
+          :loading="delLoading"
+          type="primary"
+          icon="stop"
+          >全部删除</a-button
+        >
+      </a-popconfirm>
+
       <a-popconfirm
-            title="确定全部删除吗?"
-            @confirm="delAll"
-          >
-          <a-button :disabled="delLoading" :loading="delLoading" type="primary" icon="stop">全部删除</a-button>
-          </a-popconfirm>
-      
-      <a-popconfirm
-      v-if="selectedRowKeys.length > 0"
-            title="确定删除吗?"
-            @confirm="delBatch"
-          >
-          <a-button :disabled="delLoading" :loading="delLoading" icon="stop" style="margin-left: 8px">
-          批量删除</a-button>
-          </a-popconfirm>
-      
+        v-if="selectedRowKeys.length > 0"
+        title="确定删除吗?"
+        @confirm="delBatch"
+      >
+        <a-button
+          :disabled="delLoading"
+          :loading="delLoading"
+          icon="stop"
+          style="margin-left: 8px"
+        >
+          批量删除</a-button
+        >
+      </a-popconfirm>
+
       <!-- <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-button style="margin-left: 8px">
           批量操作 <a-icon type="down"
@@ -59,7 +68,11 @@
         class="j-table-force-nowrap"
         @change="handleTableChange"
       >
-
+        <template slot="numberSlot" slot-scope="text, record">
+          <div style="display: flex; align-items: center">
+            <a-input v-model="record.passWord" @blur="(e) => handleNumber(e, record)" />
+          </div>
+        </template>
         <template slot="layoutId" slot-scope="text, record">
           {{ getLayoutName(record) }}
         </template>
@@ -72,7 +85,7 @@
         <template slot="htmlSlot" slot-scope="text">
           <div v-html="text"></div>
         </template>
-       
+
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
 
@@ -94,17 +107,18 @@
 </template>
   
 <script>
+import { httpAction, getAction } from "@/api/manage";
 import { JeecgListMixin } from "@/mixins/JeecgListMixin";
 import roomNumModal from "./roomNumModal.vue"; // todo roomLayoutForm 需要替换成房型的表单弹窗
-import roomImgs from './roomImagesForm.vue'
+import roomImgs from "./roomImagesForm.vue";
 import { getAllLayouts } from "@/api/roomLayout";
-import { delBatch, delAll } from '@/api/roomBuildingApi'
+import { delBatch, delAll } from "@/api/roomBuildingApi";
 let hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
 export default {
   mixins: [JeecgListMixin],
   components: {
     roomNumModal,
-    roomImgs
+    roomImgs,
   },
   data() {
     return {
@@ -153,9 +167,10 @@ export default {
           scopedSlots: { customRender: "prefix_name" },
         },
         {
-          title: "创建时间",
+          title: "门锁密码",
           align: "center",
-          dataIndex: "createAt",
+          dataIndex: "passWord",
+          scopedSlots: { customRender: "numberSlot" },
         },
         {
           title: "操作",
@@ -175,7 +190,7 @@ export default {
         importExcelUrl: "rooms/cesRooms/importExcel",
       },
       buildingFloorSearchTag: {
-        name: null
+        name: null,
       },
       dictOptions: {},
       superFieldList: [],
@@ -196,31 +211,43 @@ export default {
     });
   },
   methods: {
+    handleNumber(e, record) {
+      const that = this;
+      let method = "put";
+      httpAction("/rooms/cesRooms/modify", record, method)
+        .then((res) => {
+          if (res.success) {
+            that.$message.success(res.message);
+          } else {
+            that.$message.warning(res.message);
+          }
+        });
+    },
     onImgSave() {
-      this.loadData()
+      this.loadData();
     },
     onFliterClose() {
-        this.filters['buildId'] = null
-        this.filters['floorId'] = null
-        this.ipagination.current = 1
-        this.buildingFloorSearchTag.name = null
-        this.loadData()
+      this.filters["buildId"] = null;
+      this.filters["floorId"] = null;
+      this.ipagination.current = 1;
+      this.buildingFloorSearchTag.name = null;
+      this.loadData();
     },
     // 搜索
     searchParam(id, name, isBuilding) {
-        this.$set(this.buildingFloorSearchTag,'name',name)
-        if(isBuilding) {
-            this.filters['buildId'] = id
-            if(this.filters['floorId']) {
-                delete this.filters.floorId
-            }
-        } else {
-            this.filters['floorId'] = id
-            if(this.filters['buildId']) {
-                delete this.filters.buildId
-            }
+      this.$set(this.buildingFloorSearchTag, "name", name);
+      if (isBuilding) {
+        this.filters["buildId"] = id;
+        if (this.filters["floorId"]) {
+          delete this.filters.floorId;
         }
-        this.loadData()
+      } else {
+        this.filters["floorId"] = id;
+        if (this.filters["buildId"]) {
+          delete this.filters.buildId;
+        }
+      }
+      this.loadData();
     },
     getLayoutName(row) {
       let i = this.layouts.findIndex((s) => s.id == row.layoutId);
@@ -231,47 +258,51 @@ export default {
     },
     // 批量删除
     delBatch() {
-      let hotelInfo = JSON.parse(localStorage.getItem('storeInfo'))
-      let keys = this.selectedRowKeys
-      this.delLoading = true
+      let hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
+      let keys = this.selectedRowKeys;
+      this.delLoading = true;
       delBatch({
         hotelId: hotelInfo.id,
-        idStr: keys.toString()
-      }).then(res => {
-        if(res.code == 200) {
-          this.selectedRowKeys = []
-          this.$message.success('删除成功');
-          this.loadData()
-        }
-      }).finally(_ => {
-        this.delLoading = false
+        idStr: keys.toString(),
       })
+        .then((res) => {
+          if (res.code == 200) {
+            this.selectedRowKeys = [];
+            this.$message.success("删除成功");
+            this.loadData();
+          }
+        })
+        .finally((_) => {
+          this.delLoading = false;
+        });
     },
     // 删除所有
     delAll() {
-      let hotelInfo = JSON.parse(localStorage.getItem('storeInfo'))
-      this.delLoading = true
+      let hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
+      this.delLoading = true;
       delAll({
         hotelId: hotelInfo.id,
-      }).then(res => {
-        if(res.code == 200) {
-          this.selectedRowKeys = []
-          this.$message.success('全部删除成功');
-          this.loadData()
-        }
-      }).finally(_ => {
-        this.delLoading = false
       })
+        .then((res) => {
+          if (res.code == 200) {
+            this.selectedRowKeys = [];
+            this.$message.success("全部删除成功");
+            this.loadData();
+          }
+        })
+        .finally((_) => {
+          this.delLoading = false;
+        });
     },
     // 批量添加按钮
     onAddBatch() {
-        this.$router.push('/tenant/gen/rooms');
+      this.$router.push("/tenant/gen/rooms");
     },
     // 全部删除
     onDelAll() {},
     // 显示图片弹窗
     handleImage(row) {
-      this.$refs.roomimgmodal.setModel(row)
+      this.$refs.roomimgmodal.setModel(row);
     },
     onSaveOk() {
       this.loadData();

+ 2 - 2
src/views/settings/systemInfo.vue

@@ -48,13 +48,13 @@
 
                 </div>
             </a-tab-pane>
-            <a-tab-pane key="6">
+            <!-- <a-tab-pane key="6">
                 <span slot="tab">
                     <a-icon type="pay" />
                     门锁管理
                 </span>
                 <door-lock-list></door-lock-list>
-            </a-tab-pane>
+            </a-tab-pane> -->
             <a-tab-pane key="7">
                 <span slot="tab">
                     <a-icon type="payinterface" />

+ 34 - 27
src/views/system/RoleList.vue

@@ -68,23 +68,25 @@
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
           <a-divider type="vertical" />
+          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+            <a>删除</a>
+          </a-popconfirm>
 
-
-          <a-dropdown>
-            <a class="ant-dropdown-link">
-              更多 <a-icon type="down" />
-            </a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a @click="handlePerssion(record.id)">授权</a>
-              </a-menu-item>
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
+<!--          <a-dropdown>-->
+<!--            <a class="ant-dropdown-link">-->
+<!--              更多 <a-icon type="down" />-->
+<!--            </a>-->
+<!--            <a-menu slot="overlay">-->
+<!--              <a-menu-item>-->
+<!--                <a @click="handlePerssion(record.id)">授权</a>-->
+<!--              </a-menu-item>-->
+<!--              <a-menu-item>-->
+<!--                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
+<!--                  <a>删除</a>-->
+<!--                </a-popconfirm>-->
+<!--              </a-menu-item>-->
+<!--            </a-menu>-->
+<!--          </a-dropdown>-->
         </span>
 
 
@@ -131,15 +133,20 @@
             }
           },
           {
-            title: '角色名称',
+            title: '商家名称',
             align:"center",
-            dataIndex: 'roleName'
+            dataIndex: 'hotelName'
           },
           {
-            title: '角色编码',
+            title: '角色名称',
             align:"center",
-            dataIndex: 'roleCode'
+            dataIndex: 'roleName'
           },
+          // {
+          //   title: '角色编码',
+          //   align:"center",
+          //   dataIndex: 'roleCode'
+          // },
           {
             title: '备注',
             align:"center",
@@ -151,12 +158,12 @@
             align:"center",
             sorter: true
           },
-          {
-            title: '更新时间',
-            dataIndex: 'updateTime',
-            align:"center",
-            sorter: true
-          },
+          // {
+          //   title: '更新时间',
+          //   dataIndex: 'updateTime',
+          //   align:"center",
+          //   sorter: true
+          // },
           {
             title: '操作',
             dataIndex: 'action',
@@ -191,4 +198,4 @@
 </script>
 <style scoped>
   @import '~@assets/less/common.less'
-</style>
+</style>

+ 4 - 4
src/views/system/RoleUserList.vue

@@ -68,9 +68,9 @@
                 更多 <a-icon type="down"/>
               </a>
               <a-menu slot="overlay">
-                <a-menu-item>
-                  <a @click="handlePerssion(record.id)">授权</a>
-                </a-menu-item>
+<!--                <a-menu-item>-->
+<!--                  <a @click="handlePerssion(record.id)">授权</a>-->
+<!--                </a-menu-item>-->
                 <a-menu-item>
                   <a @click="handleEdit(record)">编辑</a>
                 </a-menu-item>
@@ -542,4 +542,4 @@
   .ant-btn {
     margin-left: 8px
   }
-</style>
+</style>

+ 7 - 1
src/views/system/UserList.vue

@@ -2,10 +2,14 @@
   <a-card style="width: 100%; height: 100%">
     <a-tabs default-active-key="1">
       <a-tab-pane key="1">
+        <span slot="tab"> 角色管理 </span>
+        <role-list></role-list>
+      </a-tab-pane>
+      <a-tab-pane key="2">
         <span slot="tab"> 员工管理 </span>
         <yuangong-list></yuangong-list>
       </a-tab-pane>
-      <a-tab-pane key="2">
+      <a-tab-pane key="3">
         <span slot="tab"> 业主管理 </span>
         <yezhu-list></yezhu-list>
       </a-tab-pane>
@@ -16,8 +20,10 @@
 <script>
 import YuangongList from "./YuangongList.vue";
 import YezhuList from "./YezhuList.vue";
+import RoleList from './RoleList'
 export default {
   components: {
+    RoleList,
     YuangongList,
     YezhuList,
   },

+ 81 - 6
src/views/system/modules/RoleModal.vue

@@ -21,13 +21,34 @@
         <a-form-model-item label="描述" prop="description">
           <a-textarea :rows="5" v-model="model.description" placeholder="请输入角色描述"/>
         </a-form-model-item>
+        <a-form-item label='授权'>
+          <a-card style="max-height: 400px;overflow: scroll;">
+            <a-tree
+                    checkable
+                    @check="onCheck"
+                    :checkedKeys="checkedKeys"
+                    :treeData="treeData"
+                    @expand="onExpand"
+                    @select="onTreeNodeSelect"
+                    :selectedKeys="selectedKeys"
+                    :expandedKeys="expandedKeysss"
+                    :checkStrictly="checkStrictly">
+          <span slot="hasDatarule" slot-scope="{slotTitle,ruleFlag}">
+            {{ slotTitle }}<a-icon v-if="ruleFlag" type="align-left" style="margin-left:5px;color: red;"></a-icon>
+          </span>
+            </a-tree>
+          </a-card>
+        </a-form-item>
       </a-form-model>
     </a-spin>
   </a-modal>
 </template>
 
 <script>
-  import {addRole,editRole,duplicateCheck } from '@/api/api'
+  import {addRole,editRole,duplicateCheck,queryTreeListForRole,queryRolePermission,
+    saveRolePermission,saveRoleAndPermission,editRoleAndPermission } from '@/api/api'
+
+  const hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
   export default {
     name: "RoleModal",
     data () {
@@ -55,6 +76,13 @@
             { min: 0, max: 126, message: '长度不超过 126 个字符', trigger: 'blur' }
           ]
         },
+        treeData: [],
+        checkedKeys:[],
+        expandedKeysss:[],
+        selectedKeys:[],
+        defaultCheckedKeys:[],
+        allTreeKeys:[],
+        checkStrictly: true,
       }
     },
     created () {
@@ -74,6 +102,7 @@
         }else{
           this.roleDisabled = false;
         }
+        this.loadData();
       },
       close () {
         this.$refs.form.clearValidate();
@@ -87,10 +116,22 @@
           if (valid) {
             that.confirmLoading = true;
             let obj;
+            if (hotelInfo && hotelInfo.id){
+              this.model.hotelId = hotelInfo.id;
+            }
+            var param = {
+              role: this.model,
+              permissionJson: {
+                permissionIds: that.checkedKeys.join(","),
+                lastpermissionIds: that.defaultCheckedKeys.join(","),
+              }
+            }
             if(!this.model.id){
-              obj=addRole(this.model);
-            }else{
-              obj=editRole(this.model);
+              // obj=addRole(this.model);
+              obj=saveRoleAndPermission(param);
+            }else {
+              // obj=editRole(this.model);
+              obj = editRoleAndPermission(param);
             }
             obj.then((res)=>{
               if(res.success){
@@ -129,11 +170,45 @@
             }
           });
         }
-      }
+      },
+      loadData(){
+        var _this = this;
+        var _roleId = "";
+        if (_this.model.id !== null &&_this.model.id !== undefined){
+          _roleId = _this.model.id;
+        }
+        queryTreeListForRole().then((res) => {
+          this.treeData = res.result.treeList
+          this.allTreeKeys = res.result.ids
+          queryRolePermission({roleId:_roleId}).then((res)=>{
+            this.checkedKeys = [...res.result];
+            this.defaultCheckedKeys = [...res.result];
+            this.expandedKeysss = this.allTreeKeys;
+            console.log(this.defaultCheckedKeys)
+          })
+        })
+      },
+      onCheck (o) {
+        if(this.checkStrictly){
+          this.checkedKeys = o.checked;
+        }else{
+          this.checkedKeys = o
+        }
+      },
+      onExpand(expandedKeys){
+        this.expandedKeysss = expandedKeys;
+        this.autoExpandParent = false
+      },
+      onTreeNodeSelect(id){
+        if(id && id.length>0){
+          this.selectedKeys = id
+        }
+        this.$refs.datarule.show(this.selectedKeys[0],this.roleId)
+      },
     }
   }
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 3 - 3
src/views/system/modules/UserModal.vue

@@ -175,7 +175,7 @@ export default {
       title: "操作",
       visible: false,
       model: {
-       
+
       },
       labelCol: {
         xs: { span: 24 },
@@ -226,7 +226,7 @@ export default {
       this.resetScreenSize();
       that.userId = record.id;
       that.model = Object.assign({}, { selectedroles: '', selecteddeparts: '' }, record);
-      
+
       //身份为上级显示负责部门,否则不显示
       if (this.model.userIdentity == 2) {
         this.departIdShow = true;
@@ -236,7 +236,7 @@ export default {
 
       if (record.hasOwnProperty("id")) {
         that.getUserRoles(record.id);
-        that.getUserDeparts(record.id);
+        // that.getUserDeparts(record.id);
       }
       console.log('that.model=', that.model)
     },