Bladeren bron

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

DESKTOP-B78GIPM\admin 2 jaren geleden
bovenliggende
commit
cefd92a69a

+ 1 - 1
src/components/tools/HeaderNotice.vue

@@ -272,7 +272,7 @@ export default {
       let token = Vue.ls.get(ACCESS_TOKEN);
       // this.websock = new WebSocket(url, [token]);
       this.websock = new WebSocket(
-        "ws://localhost:8080/jeecg-boot/websocket/" + userId,
+        "ws://118.195.195.200:8080/jeecg-boot/websocket/" + userId,
         [token]
       );
       //update-end-author:taoyan date:2022-4-22 for:  v2.4.6 的 websocket 服务端,存在性能和安全问题。 #3278

+ 1 - 0
src/views/hotel/entry.vue

@@ -301,6 +301,7 @@ export default {
 .img-hotel img {
     width: 100%;
     height: auto;
+    max-height:100%;
 }
 
 .hotel-name {

+ 288 - 105
src/views/room/modules/checkIn/BillRoomForm.vue

@@ -682,6 +682,9 @@
                               <a-select-option :value="1">
                                 押金
                               </a-select-option>
+                              <a-select-option :value="3">
+                                押金2
+                              </a-select-option>
                             </a-select>
                           </div>
                         </template>
@@ -708,7 +711,7 @@
                           <div>
                             <a-input-number
                               v-model="record.money"
-                              :min="1"
+                              :min="0"
                               @change="presetNumChange($event, record)"
                             />
                           </div>
@@ -717,9 +720,10 @@
                       <div
                         style="color: rgba(255, 141, 26, 1); font-weight: 200"
                       >
-                        <!-- <p style="margin-bottom: 2px">
-                          实收:支付宝600.00元;微信292.00元;现金1000.00元;会员卡400元。
-                        </p> -->
+                        <p style="margin-bottom: 2px">
+                          <template></template>
+                          实收:{{ orderFeesText }}
+                        </p>
                         <p style="margin-bottom: 2px">
                           合计实款:{{ orderFeesAmout.toFixed(2) }}
                         </p>
@@ -973,9 +977,9 @@ export default {
       PriceData: [],
       newTabIndex: 0,
       //调价弹窗
-      editPriceModal:false,
+      editPriceModal: false,
       //调价的索引
-      editPriceIndex:null,
+      editPriceIndex: null,
       selectedRowKeys: [],
       // data,
       columns,
@@ -1061,23 +1065,31 @@ export default {
     };
   },
   computed: {
-
-    editPriceData(){
-      let arr = []
-      arr.length = this.model.orderInfo.dayCount
+    editPriceData() {
+      let arr = [];
+      arr.length = this.model.orderInfo.dayCount;
       for (let i = 0; i < arr.length; i++) {
         arr[i] = {
-          day:this.addDate(this.model.orderInfo.arrivalTime2,i),
-          price: this.model.roomPrices[this.editPriceIndex] && this.model.roomPrices[this.editPriceIndex].prefPrice || 0
-        }
-        let idx = this.model.roomPrices[this.editPriceIndex] && this.model.roomPrices[this.editPriceIndex].editPriceTime && this.model.roomPrices[this.editPriceIndex].editPriceTime.findIndex( item => item == arr[i].day)
-        if ( idx > -1) {
-          console.log(idx)
-          arr[i].price = this.model.roomPrices[this.editPriceIndex].editPrice[idx]
+          day: this.addDate(this.model.orderInfo.arrivalTime2, i),
+          price:
+            (this.model.roomPrices[this.editPriceIndex] &&
+              this.model.roomPrices[this.editPriceIndex].prefPrice) ||
+            0,
+        };
+        let idx =
+          this.model.roomPrices[this.editPriceIndex] &&
+          this.model.roomPrices[this.editPriceIndex].editPriceTime &&
+          this.model.roomPrices[this.editPriceIndex].editPriceTime.findIndex(
+            (item) => item == arr[i].day
+          );
+        if (idx > -1) {
+          console.log(idx);
+          arr[i].price =
+            this.model.roomPrices[this.editPriceIndex].editPrice[idx];
         }
       }
-      this.PriceData = arr
-      return arr
+      this.PriceData = arr;
+      return arr;
     },
 
     formDisabled() {
@@ -1093,6 +1105,81 @@ export default {
     orderFeesArrearsAmout() {
       return this.orderFeesAmout - this.amount;
     },
+    orderFeesText() {
+      var text = "";
+      this.model.orderFees.forEach((item) => {
+        var find = this.payTypeList.find((t) => t.id == item.payType);
+        if (find) {
+          text += find.name + ":" + item.money + "元;";
+        }
+      });
+      return text;
+    },
+  },
+  watch: {
+    depositSplit(value) {
+      if (!value) {
+        var yajin = this.model.roomPrices.reduce((sum, val) => {
+          let total = sum + val.deposit;
+          return isNaN(total) ? 0 : total;
+        }, 0);
+        this.model.roomPrices.forEach((t) => {
+          t.deposit = 0;
+        });
+        this.model.roomPrices[0].deposit = yajin;
+      } else {
+        this.model.roomPrices.forEach((t) => {
+          t.deposit = this.compuleDeposit(t.marketPrice);
+        });
+      }
+    },
+    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 = [];
+
+        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];
+      }
+    },
   },
   created() {
     var _info = JSON.parse(localStorage.getItem("storeInfo"));
@@ -1178,60 +1265,92 @@ export default {
     //  this.getcesRoomLayout();
   },
   methods: {
-
     //批量调价
-    batchPrice(e){
+    batchPrice(e) {
       console.log(e);
-      this.editPriceData.forEach(ele=>{
-        ele.price = e
-      })
+      this.editPriceData.forEach((ele) => {
+        ele.price = e;
+      });
     },
 
-
     //根据传入的数字将日期加上对应的天数
-		addDate(date,days){
-			console.log(date, days);
-			let time = new Date(date);
-			time.setDate(time.getDate() + days);
-			let m = time.getMonth() + 1;
-			let d = time.getDate();
-			if (m<10) {
-				m = '0' + m;
-			}
-			if (d<10) {
-				d = '0' + d;
-			}
-			return time.getFullYear() + '-' + m + '-' + d;
-		},
+    addDate(date, days) {
+      console.log(date, days);
+      let time = new Date(date);
+      time.setDate(time.getDate() + days);
+      let m = time.getMonth() + 1;
+      let d = time.getDate();
+      if (m < 10) {
+        m = "0" + m;
+      }
+      if (d < 10) {
+        d = "0" + d;
+      }
+      return time.getFullYear() + "-" + m + "-" + d;
+    },
     /**
      * 点击修改图标时
      */
-    onCellExpand(idx){
+    onCellExpand(idx) {
       console.log(idx);
-      this.editPriceIndex = idx
-      console.log('11111111111111111111111',this.model.roomPrices[this.editPriceIndex]);
+      this.editPriceIndex = idx;
+      console.log(
+        "11111111111111111111111",
+        this.model.roomPrices[this.editPriceIndex]
+      );
       this.editPriceModal = true;
     },
 
     /**
      * 修改完成
      */
-    editPriceOk(){
+    editPriceOk() {
       console.log(this.editPriceData);
-      this.model.roomPrices[this.editPriceIndex].editPriceTime = []
-      this.model.roomPrices[this.editPriceIndex].editPrice = []
-      this.editPriceData.forEach(ele=>{
-        this.model.roomPrices[this.editPriceIndex].editPriceTime.push(ele.day)
-        this.model.roomPrices[this.editPriceIndex].editPrice.push(ele.price)
-      })
+      this.model.roomPrices[this.editPriceIndex].editPriceTime = [];
+      this.model.roomPrices[this.editPriceIndex].editPrice = [];
+      this.editPriceData.forEach((ele) => {
+        this.model.roomPrices[this.editPriceIndex].editPriceTime.push(ele.day);
+        this.model.roomPrices[this.editPriceIndex].editPrice.push(ele.price);
+      });
       console.log(this.model.roomPrices);
-      this.model.roomPrices[this.editPriceIndex].prefPrice = this.editPriceData[0].price
-      this.onCellChange('prefPrice', this.editPriceIndex, this.editPriceData[0].price)
-      this.editPriceData.forEach(ele=>{
-        ele.prcie = 0
-      })
+      this.model.roomPrices[this.editPriceIndex].prefPrice =
+        this.editPriceData[0].price;
+      this.onCellChange(
+        "prefPrice",
+        this.editPriceIndex,
+        this.editPriceData[0].price
+      );
+      this.editPriceData.forEach((ele) => {
+        ele.prcie = 0;
+      });
       console.log(this.editPriceData);
-      this.editPriceModal = false
+      this.editPriceModal = false;
+
+      var sum = 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;
+        }
+
+        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;
+        }
+      }
+      this.amount = sum;
     },
 
     presetNumChange(e, record) {
@@ -1264,7 +1383,7 @@ export default {
     loadRooms() {
       // this.model.roomPrices = [];
       // this.model.roomIds = [];
-      this.amount = 0;
+      // this.amount = 0;
       getAction("/rooms/cesRooms/can-user-rooms", {
         startOf:
           this.model.orderInfo.arrivalTime2 +
@@ -1286,7 +1405,11 @@ export default {
             // });
             t.buildingRooms.forEach((b) => {
               b.floorRooms.forEach((f) => {
-                this.$set(f, "check", 0);
+                this.$set(
+                  f,
+                  "check",
+                  this.model.roomIds.some((r) => r.id == f.id) ? 1 : 0
+                );
               });
             });
           });
@@ -1348,13 +1471,23 @@ export default {
       this.loadRooms();
     },
     dayCountChange(e) {
-      this.model.orderInfo.dueOutTime2 = moment(
-        this.model.orderInfo.arrivalTime2
-      )
-        .add(e, "days")
-        .format("YYYY-MM-DD");
+      if (e) {
+        this.model.orderInfo.dueOutTime2 = moment(
+          this.model.orderInfo.arrivalTime2
+        )
+          .add(e, "days")
+          .format("YYYY-MM-DD");
+      }
       this.loadRooms();
-      this.edit(this.modelDefault);
+
+      // this.edit(this.modelDefault);
+      var i = 0;
+      this.model.roomPrices.forEach((t) => {
+        t.day = this.model.orderInfo.dayCount;
+        this.editPriceIndex = i;
+        this.editPriceOk();
+        i++;
+      });
     },
     disabledDate(current) {
       return current && current < moment().add(-1, "days").endOf("day");
@@ -1378,7 +1511,8 @@ export default {
           (1000 * 60 * 60 * 24)
       );
       this.model.orderInfo.dayCount = Math.abs(v);
-      this.loadRooms();
+      // this.loadRooms();
+      this.dayCountChange();
     },
     arrivalTimeChange2(e) {
       var v = parseInt(
@@ -1399,7 +1533,8 @@ export default {
           (1000 * 60 * 60 * 24)
       );
       this.model.orderInfo.dayCount = Math.abs(v);
-      this.loadRooms();
+      // this.loadRooms();
+      this.dayCountChange();
     },
     arrivalTimeSpanChange(m, time) {
       console.log(time);
@@ -1452,6 +1587,7 @@ export default {
     pulsFee() {
       var payType = this.payTypeList[0];
       this.model.orderFees.push({
+        add: 1,
         subjectType: 2,
         subjectTypeLabel: "预收房费",
         payType: payType ? payType.id : "",
@@ -1474,12 +1610,12 @@ export default {
         this.model.roomPrices = dataSource;
       }
 
-      var sum = 0;
-      this.model.roomPrices.forEach(function (item) {
-        sum += item.roomFee + item.deposit;
-      });
-      this.amount = sum;
-      console.log("this.model.roomPrices", this.model.roomPrices);
+      // var sum = 0;
+      // this.model.roomPrices.forEach(function (item) {
+      //   sum += item.roomFee + item.deposit;
+      // });
+      // this.amount = sum;
+      // console.log("this.model.roomPrices", this.model.roomPrices);
     },
     // handleChange(value, index, column) {
     //   const newData = [...this.data2];
@@ -1535,6 +1671,25 @@ export default {
       console.log("editTabs", e);
       var index = this.model.roomIds.findIndex((t) => t.id == e);
       this.model.roomIds.splice(index, 1);
+      this.model.roomPrices = this.model.roomPrices.filter(
+        (t) => t.roomId != e
+      );
+      this.model.orderFees = this.model.orderFees.filter((t) => t.roomId != e);
+      var sum = 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;
+        }
+      }
+      this.amount = sum;
     },
     tabClick(e) {
       console.log("tabClick", e);
@@ -1543,8 +1698,16 @@ export default {
     },
     modalFormOk(e) {
       console.log("e", e);
+      this.model.roomPrices = this.model.roomPrices.filter((t) =>
+        e.some((r) => r.id == t.roomId)
+      );
+      this.model.orderFees = this.model.orderFees.filter((t) =>
+        e.some((r) => r.id == t.roomId)
+      );
       this.modelDefault = Object.assign({}, this.modelDefault, {
         roomIds: e,
+        roomPrices: this.model.roomPrices,
+        orderFees: this.model.orderFees,
       });
       this.edit(this.modelDefault);
     },
@@ -1599,52 +1762,69 @@ export default {
           var roomLayout = this.roomLayoutList.find(
             (t) => (t.id = item.layoutId)
           );
-          roomPrices.push({
-            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.editPriceIndex = this.model.roomPrices.findIndex(
+            (t) => t.roomId == item.id
+          );
+          var find = this.model.roomPrices[this.editPriceIndex];
+          if (!find) {
+            var obj = {
+              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,
+            };
+            roomPrices.push(obj);
+          } else {
+            find.day = this.model.orderInfo.dayCount;
+            this.editPriceOk();
+          }
           var payType = this.payTypeList[0];
-
-          orderFees.push({
-            subjectType: 2,
-            subjectTypeLabel: "预收房费",
-            payType: payType ? payType.id : "",
-            payTypeLabel: payType ? payType.name : "",
-            receivable: item.marketPrice * this.model.orderInfo.dayCount,
-            money: item.marketPrice * this.model.orderInfo.dayCount,
-            roomId: item.id,
-          });
-          var deposit = this.compuleDeposit(item.marketPrice);
-          if (deposit > 0) {
+          if (!this.model.orderFees.some((t) => t.roomId == item.id)) {
             orderFees.push({
-              subjectType: 1,
-              subjectTypeLabel: "押金",
+              subjectType: 2,
+              subjectTypeLabel: "预收房费",
               payType: payType ? payType.id : "",
               payTypeLabel: payType ? payType.name : "",
-              receivable: deposit,
-              money: deposit,
+              receivable: item.marketPrice * this.model.orderInfo.dayCount,
+              money: item.marketPrice * this.model.orderInfo.dayCount,
               roomId: item.id,
             });
+            var deposit = this.compuleDeposit(item.marketPrice);
+            if (deposit > 0) {
+              orderFees.push({
+                subjectType: 1,
+                subjectTypeLabel: "押金",
+                payType: payType ? payType.id : "",
+                payTypeLabel: payType ? payType.name : "",
+                receivable: deposit,
+                money: deposit,
+                roomId: item.id,
+              });
+            }
+          } else {
+            // var find = this.model.orderFees.find(
+            //   (t) => t.subjectType == 2 && t.roomId == item.id
+            // );
+            // if (find) {
+            //   find.money = money;
+            //   find.receivable = money;
+            // }
           }
         });
-        this.model.roomPrices = roomPrices;
+        this.model.roomPrices = [...this.model.roomPrices, ...roomPrices];
         var sum = 0;
         this.model.roomPrices.forEach(function (item) {
           sum += item.roomFee + item.deposit;
         });
         this.amount = sum;
-
-        this.model.orderFees = orderFees;
-        console.log("this.model", this.model);
+        console.log("orderFees", orderFees);
+        this.model.orderFees = [...this.model.orderFees, ...orderFees];
       }
-      // console.log("this.amount2", JSON.stringify(this.amount));
     },
     submitForm() {
       const that = this;
@@ -1657,9 +1837,12 @@ export default {
             .format("YYYY-MM-DD");
           that.model.livingRoomDayPrices.push({
             livingType: 1,
-            dayTime: t.editPriceTime? t.editPriceTime[b].toString() : dayTime,
+            dayTime: t.editPriceTime ? t.editPriceTime[b].toString() : dayTime,
             // price:  t.editPrice? t.editPrice[b].toString() : t.prefPrice,
-            price: ( t.editPrice && t.editPriceTime && t.editPriceTime[b]==dayTime ) ? t.editPrice[b].toString() : t.prefPrice,
+            price:
+              t.editPrice && t.editPriceTime && t.editPriceTime[b] == dayTime
+                ? t.editPrice[b].toString()
+                : t.prefPrice,
             // dayTime: dayTime,
             // price: t.prefPrice,
             roomLayoutId: t.layoutId,

File diff suppressed because it is too large
+ 321 - 0
src/views/settings/components/modules/printComponents/incomePrint.vue


File diff suppressed because it is too large
+ 301 - 0
src/views/settings/components/modules/printComponents/settlePrint.vue


+ 13 - 10
src/views/settings/components/modules/printTemplateForm.vue

@@ -62,11 +62,8 @@
         </j-form-container>
       </div>
       <div class="right">
-        <a-card class="template" :style="{width:width}">
-          <p>Card content</p>
-          <p>Card content</p>
-          <p>Card content</p>
-        </a-card>
+        <!-- <jzd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></jzd> -->
+        <skd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></skd>
       </div>
     </div>
 
@@ -77,10 +74,14 @@
 
   import { httpAction, getAction } from '@/api/manage'
   import { validateDuplicateValue } from '@/utils/util'
+  import jzd from './printComponents/settlePrint.vue'
+  import skd from './printComponents/incomePrint.vue'
 
   export default {
     name: 'printTemplateForm',
     components: {
+      jzd,
+      skd
     },
     props: {
       //表单禁用
@@ -92,6 +93,7 @@
     },
     data () {
       return {
+        sizeTypeClass: 'mm58',
         model:{
          },
         labelCol: {
@@ -180,11 +182,12 @@
         })
       },
       onSpecsChange(val){
-        console.log('规格切换  ————  '+val)
-        this.width = val;
-        console.log(this.width)
-        if (val === 'A5'){
-          // this.width = '210mm';
+        if(val == '80mm') {
+          this.sizeTypeClass = 'mm80'
+        } else if(val == '58mm') {
+          this.sizeTypeClass = 'mm58'
+        } else {
+          this.sizeTypeClass = 'a5'
         }
       }
     }

+ 147 - 224
src/views/settings/components/roomModules/roomGen.vue

@@ -20,72 +20,28 @@
           </a-select>
         </a-form-model-item> -->
 
-        <a-form-model-item
-          label="楼栋名称"
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          prop="layoutId"
-        >
-          <a-select
-            show-search
-            placeholder="请选择楼栋"
-            v-model="buildingId"
-            option-filter-prop="children"
-            @change="onBuildChange"
-          >
-            <a-select-option v-for="item in buildingTreeData" :key="item.id" >
+        <a-form-model-item label="楼栋名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="layoutId">
+          <a-select show-search placeholder="请选择楼栋" v-model="buildingId" option-filter-prop="children"
+            @change="onBuildChange">
+            <a-select-option v-for="item in buildingTreeData" :key="item.id">
               {{ item.name }}
             </a-select-option>
           </a-select>
         </a-form-model-item>
 
-        <a-form-model-item
-          label="层数最高"
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          prop="layoutId"
-        >
-          <a-input-number
-            placeholder="输入楼层数"
-            v-model="model.floorCount"
-            :min="1"
-            style="width: 120px"
-          />层
+        <a-form-model-item label="层数最高" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="layoutId">
+          <a-input-number placeholder="输入楼层数" v-model="model.floorCount" :min="1" style="width: 120px" />层
         </a-form-model-item>
-        <a-form-model-item
-          label="每层房间数量"
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          prop="layoutId"
-        >
-          <a-input-number
-            placeholder="输入每层房间数"
-            v-model="model.roomCount"
-            :min="1"
-            style="width: 120px"
-          />间
+        <a-form-model-item label="每层房间数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="layoutId">
+          <a-input-number placeholder="输入每层房间数" v-model="model.roomCount" :min="1" style="width: 120px" />间
         </a-form-model-item>
 
-        <a-form-model-item
-          label="设置前缀"
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          prop="layoutId"
-        >
+        <a-form-model-item label="设置前缀" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="layoutId">
           <a-input placeholder="输入房号前缀" v-model="model.prefix" />
         </a-form-model-item>
-        <a-form-model-item
-          label="设置前缀"
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          prop="layoutId"
-        >
+        <a-form-model-item label="尾号排除" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="layoutId">
           <a-checkbox v-model="model.isExpectEnd"> 尾号排除 </a-checkbox>
-          <a-input
-            :disabled="!model.isExpectEnd"
-            placeholder="输入排除的其他尾号"
-            v-model="tailNumber"
-          />
+          <a-input :disabled="!model.isExpectEnd" placeholder="输入排除的其他尾号" v-model="tailNumber" />
         </a-form-model-item>
         <a-button type="primary" @click="genRooms"> 批量生成 </a-button>
       </a-form>
@@ -94,52 +50,24 @@
       <div v-if="roomTree.length > 0">
         <div v-for="(item, index) in roomTree" :key="index" style="width: 100%">
           <div style="font-width: 600; font-size: 20px" @click="sele(item)">
-            <a-input
-              placeholder="请填写楼层名"
-              v-model="item.name"
-              class="floor-input"
-            ></a-input>
-            <a-button
-              @click="delFloor(index)"
-              type="danger"
-              shape="circle"
-              size="small"
-              icon="minus"
-              style="margin-left: 5px"
-            />
+            <a-input placeholder="请填写楼层名" v-model="item.name" class="floor-input"></a-input>
+            <a-button @click="delFloor(index)" type="danger" shape="circle" size="small" icon="minus"
+              style="margin-left: 5px" />
           </div>
           <div style="color:red;" v-if="isExistNames(item.name)">名称已存在</div>
-          <div
-            style="display: flex;justify-content: start;margin: 20px;flex-wrap: wrap;"
-          >
-            <div
-              v-for="(room, indexs) in item.children"
-              :key="indexs"
-              style="width: 25%; margin-top: 10px"
-            >
+          <div style="display: flex;justify-content: start;margin: 20px;flex-wrap: wrap;">
+            <div v-for="(room, indexs) in item.children" :key="indexs" style="width: 15%; margin-top: 10px">
               <input v-model="room.name" style="width: 50%; margin: auto" />
-              
-              <a-button
-                @click="delRoom(index, indexs)"
-                type="danger"
-                shape="circle"
-                size="small"
-                icon="minus"
-                style="margin-left: 5px"
-              />
-              <div style="color:red;" v-if="repeatName(item.children,indexs)">房名重复</div>
+
+              <a-button @click="delRoom(index, indexs)" type="danger" shape="circle" size="small" icon="minus"
+                style="margin-left: 5px" />
+              <div style="color:red;" v-if="repeatName(item.children, indexs)">房名重复</div>
             </div>
-            
+
           </div>
           <div>
-            <a-button
-              @click="addRoom(index)"
-              type="primary"
-              shape="circle"
-              size="small"
-              icon="plus"
-              style="margin-left: 20px; margin: 0 20px 20px"
-            />
+            <a-button @click="addRoom(index)" type="primary" shape="circle" size="small" icon="plus"
+              style="margin-left: 20px; margin: 0 20px 20px" />
           </div>
         </div>
       </div>
@@ -153,81 +81,57 @@
     </div>
   </div>
   <div v-else class="room-layout-settings">
-    <div class="layout-rooms-item" v-for="(item, layoutIndex) in layouts" :key="item.id">
-      <div class="title-laytou">
-        {{ item.name }}
-        
+
+
+    <div style="flex:1;height: calc(100vh - 180px);overflow-y: auto;">
+      <div class="wait-select-title">
+        <div class="color-title">待配置房间</div>
       </div>
-      <div class="room-items">
-        <div v-for="(element, roomIndex) in item.rooms" :key="element.id" class="layout-room-item">
-          {{ element.name }}
-          <a-button
-          @click="delLayoutRoom(element, layoutIndex, roomIndex)"
-          type="danger"
-          shape="circle"
-          size="small"
-          icon="minus"
-          style="margin-left: 5px"
-        />
+      <div v-for="(item, index) in roomTree" :key="index" style="width: 100%; padding-left: 30px">
+        <div style="font-width: 600; font-size: 20px" @click="sele(item)">
+          {{ item.name }}
         </div>
-      </div>
-    </div>
-    <div class="wait-select-title">
-      <div class="color-title">待配置房间</div>
-    </div>
-    <div
-      v-for="(item, index) in roomTree"
-      :key="index"
-      style="width: 100%; padding-left: 30px"
-    >
-      <div style="font-width: 600; font-size: 20px" @click="sele(item)">
-        {{ item.name }}
-      </div>
-      <div
-        style="display: flex;justify-content: start;margin: 20px;flex-wrap: wrap;"
-      >
-        <div
-          v-for="(room, indexs) in item.children"
-          :key="indexs"
-          class="select-room-item"
-          :class="[room.checked ? 'checked-room' : '']"
-          @click="room.checked = !room.checked"
-          style="width: 80px; margin-top: 10px"
-        >
-          {{ room.name }}
+        <div style="display: flex;justify-content: start;margin: 20px;flex-wrap: wrap;">
+          <div v-for="(room, indexs) in item.children" :key="indexs" class="select-room-item"
+            :class="[room.checked ? 'checked-room' : '']" @click="room.checked = !room.checked"
+            style="width: 80px; margin-top: 10px">
+            {{ room.name }}
+          </div>
         </div>
+
       </div>
-      
-    </div>
-    <div class="bottom-sele-btn">
+      <div class="bottom-sele-btn">
         <a-popover placement="topRight" v-if="canMove.can">
           <template slot="content">
-            <a-button
-              type="link"
-              v-for="(item, index) in layouts"
-              :key="item.id"
-              @click="moveTo(index)"
-            >
+            <a-button type="link" v-for="(item, index) in layouts" :key="item.id" @click="moveTo(index)">
               {{ item.name }}
             </a-button>
           </template>
           <template slot="title">
             <span>要移动到的目标房型</span>
           </template>
-          <a-button :disabled="false" type="primary"
-            >移动到房型({{ canMove.count }})</a-button
-          >
+          <a-button :disabled="false" type="primary">移动到房型({{ canMove.count }})</a-button>
         </a-popover>
-        <a-button v-else :disabled="true" type="primary"
-          >移动到房型(0)</a-button
-        >
-        <a-button :disabled="saveLoading" :loading="saveLoading" @click="back" type="primary"
-          >取消</a-button
-        >
-        <a-button :disabled="saveLoading" :loading="saveLoading" @click="save" type="primary"
-          >保存并查看房间列表</a-button
-        >
+        <a-button v-else :disabled="true" type="primary">移动到房型(0)</a-button>
+        <a-button :disabled="saveLoading" :loading="saveLoading" @click="back" type="primary">取消</a-button>
+        <a-button :disabled="saveLoading" :loading="saveLoading" @click="save" type="primary">保存并查看房间列表</a-button>
 
+      </div>
+    </div>
+    <div style="flex:1;height: calc(100vh - 180px); overflow-y: auto;">
+      <div class="layout-rooms-item" v-for="(item, layoutIndex) in layouts" :key="item.id">
+        <div class="title-laytou">
+          {{ item.name }}
+
+        </div>
+        <div class="room-items">
+          <div v-for="(element, roomIndex) in item.rooms" :key="element.id" class="layout-room-item">
+            {{ element.name }}
+            <a-button @click="delLayoutRoom(element, layoutIndex, roomIndex)" type="danger" shape="circle" size="small"
+              icon="minus" style="margin-left: 5px" />
+          </div>
+        </div>
+      </div>
     </div>
   </div>
 </template>
@@ -244,8 +148,8 @@ export default {
   },
   data() {
     return {
-      floorNames:[],
-        saveLoading: false,
+      floorNames: [],
+      saveLoading: false,
       myArray: [
         {
           id: 1,
@@ -306,6 +210,10 @@ export default {
     buildingTree().then((res) => {
       if (res.code == 200) {
         this.buildingTreeData = res.result;
+        if (res.result && res.result.length > 0) {
+
+          this.buildingId = res.result[0].id
+        }
       }
     });
     getAllLayouts().then((res) => {
@@ -321,17 +229,17 @@ export default {
   methods: {
     onBuildChange() {
       let bIndex = this.buildingTreeData.findIndex(s => s.id == this.buildingId)
-      let currentFloorNames = (this.buildingTreeData[bIndex].children||[]).map(s => s.name)
+      let currentFloorNames = (this.buildingTreeData[bIndex].children || []).map(s => s.name)
       this.floorNames = currentFloorNames
       // this.roomTree = JSON.parse(JSON.stringify(this.roomTree))
     },
     delLayoutRoom(item, layoutIndex, roomIndex) {
-        this.roomTree[item.floorIndex].children.push({
-            checked: false,
-            name: item.name,
-            floorIndex: item.floorIndex
-        })
-        this.layouts[layoutIndex].rooms.splice(roomIndex,1)
+      this.roomTree[item.floorIndex].children.push({
+        checked: false,
+        name: item.name,
+        floorIndex: item.floorIndex
+      })
+      this.layouts[layoutIndex].rooms.splice(roomIndex, 1)
     },
     moveTo(idx) {
       let roomItems = [];
@@ -387,37 +295,37 @@ export default {
         return;
       }
       let errMsg = '';
-      
-      for(let i =0;i<this.roomTree.length;i++) {
+
+      for (let i = 0; i < this.roomTree.length; i++) {
         let s = this.roomTree[i]
-        if(this.isExistNames(s.name)) {
+        if (this.isExistNames(s.name)) {
           errMsg = '楼层名称有重复';
           break;
         }
       }
-      if(errMsg == '') {
-        for(let i =0;i<this.roomTree.length;i++) {
-        let s = this.roomTree[i]
-        for(let j=0;j<s.children.length;j++) {
-          let room = s.children[j]
-          if(!room.name){
-            errMsg = '存在空房名,请填写'
-            break
-          }
-          if(this.repeatName(s.children, j)) {
-            errMsg = '存在重复房名'
-            break
+      if (errMsg == '') {
+        for (let i = 0; i < this.roomTree.length; i++) {
+          let s = this.roomTree[i]
+          for (let j = 0; j < s.children.length; j++) {
+            let room = s.children[j]
+            if (!room.name) {
+              errMsg = '存在空房名,请填写'
+              break
+            }
+            if (this.repeatName(s.children, j)) {
+              errMsg = '存在重复房名'
+              break
+            }
           }
+          if (errMsg) break
         }
-        if(errMsg) break
-      }
       }
-      if(errMsg) {
+      if (errMsg) {
         this.$message.error(errMsg)
         return
       }
-      
-      
+
+
       if (this.step == 1) {
         this.step = 2;
         return;
@@ -425,43 +333,43 @@ export default {
       let treeData = this.getParams();
       this.saveLoading = true
       saveBatch(treeData).then(res => {
-        if(res.code == 200) {
-            this.$message.success("批量保存成功")
-            this.closeCurrent()
+        if (res.code == 200) {
+          this.$message.success("批量保存成功")
+          this.closeCurrent()
         }
       }).finally(_ => {
         this.saveLoading = false
       })
     },
     getParams() {
-        let param = {
-            hotelId: null,
-            buildId: null,
-            children: [],
-        };
-        let hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
-        param.buildId = this.buildingId;
-        param.hotelId = hotelInfo.id;
-        let roomTree = JSON.parse(JSON.stringify(this.roomTree))
-        roomTree.forEach(a => {
-            param.children.push({
-                floorName: a.name,
-                children: []
-            })
+      let param = {
+        hotelId: null,
+        buildId: null,
+        children: [],
+      };
+      let hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
+      param.buildId = this.buildingId;
+      param.hotelId = hotelInfo.id;
+      let roomTree = JSON.parse(JSON.stringify(this.roomTree))
+      roomTree.forEach(a => {
+        param.children.push({
+          floorName: a.name,
+          children: []
         })
-        this.layouts.forEach(layout => {
-            layout.rooms.forEach(room => {
-                param.children[room.floorIndex].children.push({
-                    hotelId: hotelInfo.id,
-                    buildId: this.buildingId,
-                    layoutId: layout.id,
-                    name: room.name,
-                    prefix: this.model.prefix,
-                })
-            })
+      })
+      this.layouts.forEach(layout => {
+        layout.rooms.forEach(room => {
+          param.children[room.floorIndex].children.push({
+            hotelId: hotelInfo.id,
+            buildId: this.buildingId,
+            layoutId: layout.id,
+            name: room.name,
+            prefix: this.model.prefix,
+          })
         })
+      })
 
-        return param
+      return param
     },
     addRoom(index) {
       this.roomTree[index].children.push({
@@ -488,9 +396,9 @@ export default {
     back() {
       this.closeCurrent();
     },
-    check() {},
-    genRooms() { 
-      if(!this.buildingId) {
+    check() { },
+    genRooms() {
+      if (!this.buildingId) {
         this.$message.error("请先选择楼栋")
         return
       }
@@ -524,7 +432,7 @@ export default {
       }
       this.roomTree = floors;
       let bIndex = this.buildingTreeData.findIndex(s => s.id == this.buildingId)
-      let currentFloorNames = (this.buildingTreeData[bIndex].children||[]).map(s => s.name)
+      let currentFloorNames = (this.buildingTreeData[bIndex].children || []).map(s => s.name)
       this.floorNames = currentFloorNames
     },
     isExistNames(name) {
@@ -533,9 +441,9 @@ export default {
     repeatName(items, index) {
       let name = items[index].name
       let newArr = JSON.parse(JSON.stringify(items)).map(s => s.name)
-      newArr.splice(index,1)
+      newArr.splice(index, 1)
 
-      if(newArr.includes(items[index].name)) {
+      if (newArr.includes(items[index].name)) {
         return true
       }
       return false
@@ -554,16 +462,19 @@ export default {
   justify-content: center;
   align-items: center;
 }
+
 .bottom-btns {
   display: flex;
   justify-content: center;
   margin-bottom: 20px;
 }
+
 .floor-input {
   width: 200px;
 }
+
 .room-items {
-    display: inline-block;
+  display: inline-block;
   border: 1px solid #cccccc77;
   height: 200px;
   overflow-y: auto;
@@ -571,6 +482,7 @@ export default {
   border-radius: 10px;
   margin-bottom: 30px;
 }
+
 .title-laytou {
   font-size: 17px;
   font-weight: bold;
@@ -580,12 +492,15 @@ export default {
   line-height: 25px;
   background-color: antiquewhite;
 }
+
 .room-items-dr {
   border: 1px solid #f00 !important;
 }
+
 .wait-select-title {
   border-bottom: 4px solid #1cb1ac;
 }
+
 .color-title {
   background-color: #1cb1ac;
   color: white;
@@ -596,6 +511,7 @@ export default {
   border-top-right-radius: 4px;
   text-align: center;
 }
+
 .select-room-item {
   border: 1px solid #cccccc77;
   border-radius: 4px;
@@ -606,17 +522,24 @@ export default {
   background-color: white;
   cursor: pointer;
 }
+
 .checked-room {
   background-color: #1cb1ac !important;
   color: white !important;
   border: none !important;
 }
+
 .bottom-sele-btn {
   padding-bottom: 30px;
 }
-.layout-room-item{
-    display: inline-block;
-    width: fit-content;
-    padding: 10px 12px;
+
+.layout-room-item {
+  display: inline-block;
+  width: fit-content;
+  padding: 10px 12px;
+}
+
+.room-layout-settings {
+  display: flex;
 }
 </style>

+ 200 - 0
src/views/settings/components/storeAuthInformation.vue

@@ -0,0 +1,200 @@
+<template>
+    <a-form ref="form" :model="model" :form="form"  labelAlign="left"  :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+        <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item>
+        <a-row :gutter="[16,16]">
+            <a-col :span="8">
+                <a-form-item label="企业法人">
+                    <a-input type="text" placeholder="请填写企业法人"
+                             v-decorator="['legalPerson', { rules: [{ required: true, message: '请填写企业法人!' }] }]"></a-input>
+                </a-form-item>
+
+                <a-form-item label="经营场所">
+                    <a-input type="text" placeholder="请填写经营场所"
+                             v-decorator="['registeredAddress', { rules: [{ required: true, message: '请填写经营场所!' }] }]"></a-input>
+                </a-form-item>
+
+                <a-form-item label="有效期">
+                    <a-date-picker type="text" placeholder="请选择有效期"
+                                   v-decorator="['businessTerm', { rules: [{ required: false, message: '请选择有效期!' }] }]"></a-date-picker>
+                </a-form-item>
+                <a-form-item label="联系人姓名">
+                    <a-input type="text" placeholder="请填写联系人姓名"
+                             v-decorator="['sfzName', { rules: [{ required: true, message: '请填写联系人姓名!' }] }]"></a-input>
+                </a-form-item>
+
+                <a-form-item label="身份证号">
+                    <a-input type="text" placeholder="请填写身份证号"
+                             v-decorator="['idCard', { rules: [{ required: true, message: '请填写身份证号!' }] }]"></a-input>
+                </a-form-item>
+            </a-col>
+            <a-col :span="2">
+            </a-col>
+            <a-col :span="14">
+                <a-form-item label="上传实名证照"  :label-col="{ span: 3 }" :wrapper-col="{ span: 20 }">
+                    <a-row>
+                        <a-col span="20" push="16" >
+                            <a-button type="link" @click="warning">手持证件要求</a-button>
+                        </a-col>
+                    </a-row>
+                    <a-row >
+                        <a-col span="5" class="upload">
+                            <j-image-upload class="avatar-uploader" text="上传"
+                                            v-decorator="['ewmLogo', { rules: [{ required: true, message: '请上传门头照片!' }] }]"></j-image-upload>
+                            <span class="margin-top-18"><span style="color: red">*</span>门头照片</span>
+                        </a-col>
+                        <a-col span="5" class="upload">
+                            <j-image-upload class="avatar-uploader" text="上传"
+                                            v-decorator="['imgs', { rules: [{ required: true, message: '请上传前台照片!' }] }]"></j-image-upload>
+                            <span class="margin-top-18"><span style="color: red">*</span>前台照片</span>
+                        </a-col>
+                        <a-col span="5" class="upload">
+                            <j-image-upload class="avatar-uploader" text="上传"
+                                                        v-decorator="['sfzImg1', { rules: [{ required: true, message: '请上传法人身份证(正面)!' }] }]"></j-image-upload>
+                            <span class="margin-top-18"><span style="color: red">*</span>法人身份证(正面)</span>
+                        </a-col>
+                        <a-col span="5" class="upload">
+                            <j-image-upload class="avatar-uploader" text="上传"
+                                                         v-decorator="['sfzImg2', { rules: [{ required: true, message: '请上传法人身份证(反面)!' }] }]"></j-image-upload>
+                            <span class="margin-top-18"><span style="color: red">*</span>法人身份证(反面)</span>
+                        </a-col>
+                        <a-col span="5" class="upload">
+                            <j-image-upload class="avatar-uploader" text="上传"
+                                                        v-decorator="['sfzImg3', { rules: [{ required: true, message: '请上传法人手持身份证照片!' }] }]"></j-image-upload>
+                            <span class="margin-top-18"><span style="color: red">*</span>法人手持身份证照片</span>
+                        </a-col>
+                        <a-col span="5" class="upload">
+                            <j-image-upload class="avatar-uploader" text="上传"
+                                            v-decorator="['yyImg', { rules: [{ required: true, message: '请上传营业执照!' }] }]"></j-image-upload>
+                            <span class="margin-top-18"><span style="color: red">*</span>营业执照</span>
+                        </a-col>
+                        <a-col span="5" class="upload">
+                            <j-image-upload class="avatar-uploader" text="上传"
+                                            v-decorator="['tzhyImg']"></j-image-upload>
+                            <span class="margin-top-18">特种行业许可证</span>
+                        </a-col>
+                    </a-row>
+
+                </a-form-item>
+            </a-col>
+        </a-row>
+        <a-divider />
+        <a-row>
+            <a-col :span="24" :style="{ textAlign: 'right' }">
+                <a-button type="primary" @click="submit">确定</a-button>
+            </a-col>
+        </a-row>
+
+    </a-form>
+</template>
+
+<script>
+    import { Modal } from 'ant-design-vue';
+    import { editAuthInfo} from "../../../api/hotel";
+
+    export default {
+        created() {
+            // alert("这里获取当前缓存门店信息,照片信息");
+            var info = JSON.parse(localStorage.getItem("storeInfo"));
+            console.log(info);
+            setTimeout(() => {
+                this.form.setFieldsValue(
+                    {
+                        id: info.id,
+                        yyImg: info.yyImg,
+                        tzhyImg: info.tzhyImg,
+                        legalPerson: info.legalPerson,
+                        registeredAddress: info.registeredAddress,
+                        businessTerm: info.businessTerm,
+                        sfzImg1: info.sfzImg1,
+                        sfzImg2: info.sfzImg2,
+                        sfzImg3: info.sfzImg3,
+                        sfzName: info.sfzName,
+                        idCard: info.idCard,
+                        ewmLogo:info.ewmLogo,
+                        imgs:info.imgs
+                    }
+                )
+            },100)
+            // if (info.ewmLogo){
+            //     this.model.ewm = info.ewmLogo
+            // }
+            // if (info.imgs){
+            //     this.model.imgList = info.imgs;
+            // }
+        },
+        data() {
+            return {
+                visible: false,
+                formLayout: 'horizontal',
+                form: this.$form.createForm(this, { certImg: null }),
+                model: {
+                    certImg: null,
+                    id: 0,
+                    ewm: null,
+                    imgList: null
+                }
+            }
+        },
+        computed: {
+            formItemLayout() {
+                const { formLayout } = this;
+                return formLayout === 'horizontal'
+                    ? {
+                        labelCol: { span: 4 },
+                        wrapperCol: { span: 14 },
+                    }
+                    : {};
+            },
+        },
+        methods: {
+            warning() {
+                this.$warning({
+                    title: '手持身份证拍照要求',
+                    // JSX support
+                    content: (
+                        <ul>
+                        <li>免冠,建议未化妆,五官可见;</li>
+                <li>身份证全部信息清晰无遮挡,否则将无法通过认证;</li>
+                <li>完整露出手臂;</li>
+                <li>以酒店门头招牌为背景图片;</li>
+                <li>请勿进行任何软件处理;</li>
+                <li>单张图片不超过5M,尺寸要求500(长)X412(宽)以上,支持jpg、png、gif;</li>
+                </ul>
+            ),
+            });
+            },
+            submit() {
+                // console.log(this.form.values.certImg)
+                this.form.validateFields((err, values) => {
+                    console.log(values)
+                    if (!err) {
+                        // values['ewmLogo'] = this.model.ewm
+                        // values['imgs'] = this.model.imgList;
+                        editAuthInfo(values).then(res=>{
+                            if (res.code == 200){
+                                this.$message.success('编辑成功')
+                                localStorage.setItem("storeInfo", JSON.stringify(res.result))
+                            }else{
+                                this.$message.error(res.message)
+                            }
+
+                        })
+                    }
+                });
+            }
+        },
+    }
+</script>
+
+<style scoped>
+.upload{
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-items: center;
+    margin-top: 10px;
+}
+    .margin-top-18{
+        margin-top: -18px;
+    }
+</style>

+ 430 - 0
src/views/settings/components/storeInformation.vue

@@ -0,0 +1,430 @@
+<template>
+    <a-form ref="form" :model="model" :form="form" :rules="validatorRules"  labelAlign="left"  :label-col="{ span: 3 }" :wrapper-col="{ span: 21 }">
+        <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item>
+        <a-row :gutter="[16,16]">
+            <a-col :span="11">
+                <a-form-item label="门店名称">
+                    <a-input type="text" placeholder="请输入门店名称"
+                             v-decorator="['name', { rules: [{ required: true, message: '请输入门店名称!' }] }]"></a-input>
+                </a-form-item>
+<!--                <a-form-item label="所在地区">-->
+<!--                </a-form-item>-->
+                <a-form-item label="详细地址">
+                    <a-row>
+                        <a-col :span="20">
+                            <a-input type="text" placeholder="请输入详细地址"
+                                     v-decorator="['address', { rules: [{ required: true, message: '请输入详细地址!' }] }]"></a-input>
+                        </a-col>
+                        <a-col :span="3" class="padding_left_10">
+                            <a-button >地图选点</a-button>
+                        </a-col>
+                    </a-row>
+                    <a-row>
+                    <!-- 地图-->
+                    </a-row>
+                </a-form-item>
+                <a-form-item label="门店管理员">
+                    <a-input type="text" placeholder="请输入联系人"
+                             v-decorator="['linkName', { rules: [{ required: true, message: '请输入联系人!' }] }]"></a-input>
+                </a-form-item>
+
+                <a-form-item label="联系电话">
+                    <a-input type="text" placeholder="请输入联系电话"
+                             v-decorator="['linkTel', { rules: [{ required: true, message: '请输入联系电话!' }] }]"></a-input>
+                </a-form-item>
+
+                <a-form-item label="前台电话">
+                    <a-input type="text" placeholder="请输入联系电话"
+                             v-decorator="['tel', { rules: [{ required: true, message: '请输入联系电话!' }] }]"></a-input>
+                </a-form-item>
+
+                <a-form-item label="酒店设施">
+                    <a-row>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange" value="1" :checked="facilityList.indexOf('1')>-1?true:false" >
+                                温泉
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange" value="2" :checked="facilityList.indexOf('2')>-1?true:false">
+                                租车
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange" value="3" :checked="facilityList.indexOf('3')>-1?true:false">
+                                有餐饮
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange" value="4" :checked="facilityList.indexOf('4')>-1?true:false">
+                                游泳池
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange" value="5" :checked="facilityList.indexOf('5')>-1?true:false">
+                                叫早
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange" value="6" :checked="facilityList.indexOf('6')>-1?true:false">
+                                有早餐
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange" value="7" :checked="facilityList.indexOf('7')>-1?true:false">
+                                WIFI
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange" value="8" :checked="facilityList.indexOf('8')>-1?true:false">
+                                电热水壶
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange" value="9" :checked="facilityList.indexOf('9')>-1?true:false">
+                                电梯
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange" value="10" :checked="facilityList.indexOf('10')>-1?true:false">
+                                吹风机
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange" value="11" :checked="facilityList.indexOf('11')>-1?true:false">
+                                免费停车
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange" value="12" :checked="facilityList.indexOf('12')>-1?true:false">
+                                会议室
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange" value="13" :checked="facilityList.indexOf('13')>-1?true:false">
+                                残疾人设施
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange" value="14" :checked="facilityList.indexOf('14')>-1?true:false">
+                                邮政服务
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange" value="15" :checked="facilityList.indexOf('15')>-1?true:false">
+                                婚宴服务
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange" value="16" :checked="facilityList.indexOf('16')>-1?true:false">
+                                全天前台
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange" value="17" :checked="facilityList.indexOf('17')>-1?true:false">
+                                接待外宾
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange" value="18" :checked="facilityList.indexOf('18')>-1?true:false">
+                                棋牌室
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange" value="19" :checked="facilityList.indexOf('19')>-1?true:false">
+                                收费停车
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange" value="20" :checked="facilityList.indexOf('20')>-1?true:false">
+                                送餐服务
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange" value="21" :checked="facilityList.indexOf('21')>-1?true:false">
+                                洗衣服务
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange" value="22" :checked="facilityList.indexOf('22')>-1?true:false">
+                                商务中心
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange" value="23" :checked="facilityList.indexOf('23')>-1?true:false">
+                                叫车服务
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange" value="24" :checked="facilityList.indexOf('24')>-1?true:false">
+                                房间WIFI
+                            </a-checkbox>
+                        </a-col>
+                    </a-row>
+                </a-form-item>
+            </a-col>
+            <a-col :span="2">
+            </a-col>
+            <a-col :span="11">
+                <a-form-item label="开业时间">
+                    <a-date-picker type="text" placeholder="请选择开业时间"
+                                   v-decorator="['openTime', { rules: [{ required: true, message: '请选择开业时间!' }] }]"></a-date-picker>
+                </a-form-item>
+
+                <a-form-item label="装修时间">
+                    <a-date-picker type="text" placeholder="请选择装修时间"
+                                   v-decorator="['renovationTime', { rules: [{ required: true, message: '请选择装修时间!' }] }]"></a-date-picker>
+                </a-form-item>
+                <a-form-item label="酒店星级" :wrapper-col="{ span: 5 }">
+                    <j-dict-select-tag v-decorator="['star', {rules: [{ required: true, message: '请选择酒店星级!' }]}]"
+                                       placeholder="请选择酒店星级" dictCode="hotel_star"/>
+                </a-form-item>
+                <a-form-item label="集团品牌">
+                    <a-input type="text" placeholder="请输入酒店品牌"
+                             v-decorator="['sellerName']"></a-input>
+                </a-form-item>
+                <a-form-item label="酒店标签">
+                    <template v-for="(tag, index) in tags">
+                        <a-tooltip v-if="tag.length > 20" :key="tag" :title="tag">
+                            <a-tag :key="tag" :closable="index !== -1" @close="() => handleClose(tag)">
+                                {{ `${tag.slice(0, 20)}...` }}
+                            </a-tag>
+                        </a-tooltip>
+                        <a-tag v-else :key="tag" :closable="index !== -1" @close="() => handleClose(tag)">
+                            {{ tag }}
+                        </a-tag>
+                    </template>
+                    <a-input
+                            v-if="inputVisible"
+                            ref="input"
+                            type="text"
+                            size="small"
+                            :style="{ width: '78px' }"
+                            :value="inputValue"
+                            @change="handleInputChange"
+                            @blur="handleInputConfirm"
+                            @keyup.enter="handleInputConfirm"
+                    />
+                    <a-tag v-else style="background: #fff; borderStyle: dashed;" @click="showInput">
+                        <a-icon type="plus" />添加
+                    </a-tag>
+                </a-form-item>
+                <a-form-item label="酒店介绍" >
+<!--                    <j-editor v-model="model.introduction"/>-->
+                    <a-textarea v-model="model.introduction" placeholder="请输入酒店介绍" :rows="5" />
+                </a-form-item>
+                <a-form-item label="预定规则">
+<!--                    <j-editor style="height: 200px;" v-model="model.reserveRemind"/>-->
+                    <a-textarea v-model="model.reserveRemind" placeholder="请输入预定规则" :rows="5" />
+                </a-form-item>
+            </a-col>
+        </a-row>
+        <a-divider />
+        <a-row>
+            <a-col :span="24" :style="{ textAlign: 'right' }">
+                <a-button type="primary" @click="submit">确定</a-button>
+            </a-col>
+        </a-row>
+
+    </a-form>
+</template>
+
+<script>
+    import {getHotelInfo, editMainInfo, hotelList} from "../../../api/hotel";
+    export default {
+        created() {
+            // alert("这里获取当前缓存门店信息");
+            var _info = JSON.parse(localStorage.getItem("storeInfo"));
+            setTimeout(() => {
+                getHotelInfo({
+                    id: _info.id
+                }).then(res => {
+                    console.log(res)
+                    if (res.code == 200 && res.result ) {
+                        var info = res.result
+
+                        this.form.setFieldsValue(
+                            {
+                                id: info.id,
+                                name: info.name,
+                                star: info.star,
+                                address: info.address,
+                                latlng: info.lat+','+info.lng,
+                                linkName: info.linkName,
+                                linkTel: info.linkTel,
+                                tel: info.tel,
+                                openTime: info.openTime,
+                                renovationTime: info.renovationTime,
+                                superiorSellerId: info.superiorSellerId,
+                                rule: info.rule,
+                                topic: info.topic,
+                                unionpay: info.unionpay,
+                                wxOpen: info.wxOpen,
+                                ddOpen: info.ddOpen,
+                                yeOpen: info.yeOpen,
+                                policy:info.policy,
+                                introduction:info.introduction,
+                                reserveRemind:info.reserveRemind,
+                                traffic:info.traffic,
+                            }
+                        )
+
+                        this.model = {
+                            policy:info.policy,
+                            introduction:info.introduction,
+                            reserveRemind:info.reserveRemind,
+                            traffic:info.traffic
+                        };
+
+                        this.tags = info.tagList.split(',')
+                        this.facilityList = info.facility.split(',')
+                        console.log(this.facilityList)
+                    }
+                })
+            }, 100)
+        },
+        data() {
+            return {
+                visible: false,
+                formLayout: 'horizontal',
+                validatorRules: {
+                    name: [{
+                        required: true, message: '请输入酒店名称!'
+                    }],
+                    linkName: [{
+                        required: true, message: '请输入联系人!'
+                    }],
+                    linkTel: [{
+                        required: true, message: '请输入联系电话!'
+                    }, {validator: this.validatePhone}],//, {validator: this.validatePhone}
+                    tel: [{
+                        required: true, message: '请输入酒店电话!'
+                    }],
+                    address: [{
+                        required: true, message: '请输入酒店地址!'
+                    }],
+                    star: [{
+                        required: true, message: '请输入星级!'
+                    }],
+                    lng: [{
+                        required: true, message: '请输入经度!'
+                    }],
+                    lat: [{
+                        required: true, message: '请输入纬度!'
+                    }],
+                    roomCount: [{
+                        required: true, message: '请输入客房总数!'
+                    }],
+                    // openTime: [{
+                    //     required: true, message: '请输入开业时间!'
+                    // }],
+                    // renovationTime: [{
+                    //     required: true, message: '请输入装修时间!'
+                    // }],
+                    checkStatus: [{
+                        required: true, message: '请选择审核状态', trigger: 'change'
+                    }]
+                },
+                form: this.$form.createForm(this),
+                model: {
+                    policy:'',
+                    introduction:'',
+                    reserveRemind:'',
+                    traffic:'',
+                },
+                tags: [],
+                inputVisible: false,
+                inputValue: '',
+                facilityList:[],
+            }
+        },
+        computed: {
+            formItemLayout() {
+                const { formLayout } = this;
+                return formLayout === 'horizontal'
+                    ? {
+                        labelCol: { span: 4 },
+                        wrapperCol: { span: 14 },
+                    }
+                    : {};
+            },
+        },
+        methods: {
+            submit() {
+                // console.log(this.form.values.certImg)
+                console.log(this.facilityList)
+                this.form.validateFields((err, values) => {
+                    // console.log(values.lnglat)
+                    if (!err) {
+                        // values['lat'] = values.latlng.split(',')[0]
+                        // values['lng'] = values.latlng.split(',')[1]
+                        values['tagList'] = this.tags.join(",");
+                        values['facility'] = this.facilityList.join(",");
+                        if(this.model.policy) values['policy'] = this.model.policy
+                        if(this.model.introduction) values['introduction'] = this.model.introduction
+                        if(this.model.reserveRemind) values['reserveRemind'] = this.model.reserveRemind
+                        if(this.model.traffic) values['traffic'] = this.model.traffic
+                        editMainInfo(values).then(res=>{
+                            // this.$message.success('编辑成功')
+                            // localStorage.setItem("storeInfo", JSON.stringify(res.result))
+                            if (res.code == 200){
+                                this.$message.success('编辑成功')
+                                localStorage.setItem("storeInfo", JSON.stringify(res.result))
+                            }else{
+                                this.$message.error(res.message)
+                            }
+                        })
+                    }
+                });
+            },
+            addHotelLable(){
+                console.log('添加酒店标签')
+            },
+            onChange(e) {
+                console.log(e);
+                console.log(`checked = ${e.target.checked}`);
+                console.log(`checked = ${e.target.value}`);
+                if (e.target.checked){
+                    this.facilityList.push(e.target.value)
+                }
+            },
+            handleClose(removedTag) {
+                const tags = this.tags.filter(tag => tag !== removedTag);
+                console.log(tags);
+                this.tags = tags;
+            },
+
+            showInput() {
+                this.inputVisible = true;
+                this.$nextTick(function() {
+                    this.$refs.input.focus();
+                });
+            },
+
+            handleInputChange(e) {
+                this.inputValue = e.target.value;
+            },
+
+            handleInputConfirm() {
+                const inputValue = this.inputValue;
+                let tags = this.tags;
+                if (inputValue && tags.indexOf(inputValue) === -1) {
+                    tags = [...tags, inputValue];
+                }
+                console.log(tags);
+                Object.assign(this, {
+                    tags,
+                    inputVisible: false,
+                    inputValue: '',
+                });
+            }
+        },
+    }
+</script>
+
+<style scoped>
+    .padding_left_10{
+        padding-left: 10px;
+    }
+
+</style>

+ 30 - 12
src/views/settings/hotelInfo.vue

@@ -1,26 +1,40 @@
 <template>
     <a-card style="width: 100%; height:100%;">
         <a-tabs default-active-key="1">
+<!--            <a-tab-pane key="1">-->
+<!--                <span slot="tab">-->
+<!--                    <a-icon type="picture" />-->
+<!--                    门店照片-->
+<!--                </span>-->
+<!--                <store-images></store-images>-->
+<!--            </a-tab-pane>-->
+<!--            <a-tab-pane key="2">-->
+<!--                <span slot="tab">-->
+<!--                    <a-icon type="audit" />-->
+<!--                    实名信息-->
+<!--                </span>-->
+<!--                <store-auth-info></store-auth-info>-->
+<!--            </a-tab-pane>-->
+<!--            <a-tab-pane key="3">-->
+<!--                <span slot="tab">-->
+<!--                    <a-icon type="shop" />-->
+<!--                    门店信息-->
+<!--                </span>-->
+<!--                <store-infos></store-infos>-->
+<!--            </a-tab-pane>-->
             <a-tab-pane key="1">
                 <span slot="tab">
                     <a-icon type="picture" />
-                    门店照片
+                    门店信息
                 </span>
-                <store-images></store-images>
+                <store-information></store-information>
             </a-tab-pane>
             <a-tab-pane key="2">
                 <span slot="tab">
-                    <a-icon type="audit" />
-                    实名信息
-                </span>
-                <store-auth-info></store-auth-info>
-            </a-tab-pane>
-            <a-tab-pane key="3">
-                <span slot="tab">
-                    <a-icon type="shop" />
-                    门店信息
+                    <a-icon type="picture" />
+                    实名登记
                 </span>
-                <store-infos></store-infos>
+                <store-auth-information></store-auth-information>
             </a-tab-pane>
         </a-tabs>
     </a-card>
@@ -30,8 +44,12 @@
 import storeImages from './components/storeImages.vue';
 import storeAuthInfo from './components/storeAuthInfo.vue';
 import storeInfos from './components/storeInfos.vue';
+import StoreInformation from './components/storeInformation'
+import StoreAuthInformation from './components/storeAuthInformation'
 export default {
     components:{
+        StoreAuthInformation,
+        StoreInformation,
         storeImages,
         storeAuthInfo,
         storeInfos

+ 544 - 0
src/views/system/RoleAndUserList.vue

@@ -0,0 +1,544 @@
+<template>
+    <a-row :gutter="10">
+      <a-col :md="leftColMd" :sm="24" style="margin-bottom: 20px">
+        <a-card :bordered="false">
+          <!-- 查询区域 -->
+          <div class="table-page-search-wrapper">
+            <!-- 搜索区域 -->
+            <a-form layout="inline" @keyup.enter.native="searchQuery">
+              <a-row :gutter="24">
+                <a-col :md="12" :sm="8">
+                  <a-form-item label="角色名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
+                    <a-input placeholder="" v-model="queryParam.roleName"></a-input>
+                  </a-form-item>
+                </a-col>
+                <!--
+                <a-col :md="11" :sm="12">
+                  <a-form-item label="创建时间" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
+                    <j-date v-model="queryParam.createTime_begin" :showTime="true" date-format="YYYY-MM-DD HH:mm:ss" style="width:45%" placeholder="请选择开始时间" ></j-date>
+                    <span style="width: 10px;">~</span>
+                    <j-date v-model="queryParam.createTime_end" :showTime="true" date-format="YYYY-MM-DD HH:mm:ss" style="width:45%" placeholder="请选择结束时间"></j-date>
+                  </a-form-item>
+                </a-col>
+                -->
+                <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-col :md="12" :sm="24">
+                 <a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px">查询</a-button>
+                <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              </a-col>
+            </span>
+              </a-row>
+            </a-form>
+          </div>
+          <!-- 操作按钮区域 -->
+          <div class="table-operator" style="margin: 5px 0 10px 2px">
+            <a-button @click="handleAdd" type="primary" icon="plus">新建角色</a-button>
+            <!--<a-button @click="handleEdit(model1)" type="primary" icon="plus">角色编辑</a-button>-->
+            <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+              <a-button type="primary" icon="import">导入</a-button>
+            </a-upload>
+            <a-button type="primary" icon="download" @click="handleExportXls('角色管理')">导出</a-button>
+          </div>
+  
+          <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+            <i class="anticon anticon-info-circle ant-alert-icon">
+            </i> 已选择 <a><b>{{ selectedRowKeys1.length }}</b></a>项
+            <a style="margin-left: 24px" @click="onClearSelected1">清空</a>
+          </div>
+  
+          <div style="margin-top: 15px">
+            <a-table
+              style="height:500px"
+              ref="table"
+              size="middle"
+              bordered
+              rowKey="id"
+              :columns="columns"
+              :dataSource="dataSource"
+              :pagination="ipagination"
+              :loading="loading"
+              :rowSelection="{selectedRowKeys: selectedRowKeys1, onChange: onSelectChange1, type:'radio'}"
+              @change="handleTableChange">
+            <span slot="action" slot-scope="text, record">
+              <a @click="handleOpen(record)">用户</a>
+              <a-divider type="vertical"/>
+  
+              <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 @click="handleEdit(record)">编辑</a>
+                  </a-menu-item>
+                  <a-menu-item>
+                    <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete1(record.id)">
+                      <a>删除</a>
+                    </a-popconfirm>
+                  </a-menu-item>
+                </a-menu>
+              </a-dropdown>
+          </span>
+            </a-table>
+          </div>
+          <!-- 右侧的角色权限配置 -->
+          
+          <role-modal ref="modalForm" @ok="modalFormOk"></role-modal>
+        </a-card>
+      </a-col>
+      <a-col :md="rightColMd" :sm="24" v-if="this.rightcolval == 1">
+        <a-card :bordered="false">
+          <div style="text-align: right;">
+            <a-icon type="close-circle" @click="hideUserList" />
+          </div>
+          <!-- 查询区域 -->
+          <div class="table-page-search-wrapper">
+            <a-form layout="inline">
+              <a-row :gutter="24">
+  
+                <a-col :md="12" :sm="12">
+                  <a-form-item label="用户账号">
+                    <a-input placeholder="" v-model="queryParam2.username"></a-input>
+                  </a-form-item>
+                </a-col>
+                <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-col :md="9" :sm="24">
+               <a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">查询</a-button>
+                <a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">重置</a-button>
+  
+              </a-col>
+            </span>
+              </a-row>
+            </a-form>
+          </div>
+          <!-- 操作按钮区域 -->
+          <div class="table-operator" :md="24" :sm="24">
+            <a-button @click="handleAdd2" type="primary" icon="plus" style="margin-top: 16px">新增用户</a-button>
+            <!--<a-button @click="handleEdit2" type="primary" icon="edit" style="margin-top: 16px">用户编辑</a-button>-->
+            <a-button @click="handleAddUserRole" type="primary" icon="plus" style="margin-top: 16px">已有用户</a-button>
+  
+            <a-dropdown v-if="selectedRowKeys2.length > 0">
+              <a-menu slot="overlay">
+                <a-menu-item key="1" @click="batchDel2">
+                  <a-icon type="delete"/>
+                  取消关联
+                </a-menu-item>
+              </a-menu>
+              <a-button style="margin-left: 8px"> 批量操作
+                <a-icon type="down"/>
+              </a-button>
+            </a-dropdown>
+          </div>
+          <!-- table区域-begin -->
+          <div>
+            <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+              <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
+              selectedRowKeys2.length }}</a>项
+              <a style="margin-left: 24px" @click="onClearSelected2">清空</a>
+            </div>
+            <a-table
+              style="height:500px"
+              ref="table2"
+              bordered
+              size="middle"
+              rowKey="id"
+              :columns="columns2"
+              :dataSource="dataSource2"
+              :pagination="ipagination2"
+              :loading="loading2"
+              :rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}"
+              @change="handleTableChange2">
+             <span slot="action" slot-scope="text, record">
+             <a @click="handleEdit2(record)">编辑</a>
+            <a-divider type="vertical"/>
+            <a-dropdown>
+              <a class="ant-dropdown-link">
+                更多 <a-icon type="down"/>
+              </a>
+              <a-menu slot="overlay">
+                <a-menu-item>
+                  <a-popconfirm title="确定取消关联吗?" @confirm="() => handleDelete2(record.id)">
+                    <a>取消关联</a>
+                  </a-popconfirm>
+                </a-menu-item>
+              </a-menu>
+            </a-dropdown>
+          </span>
+            </a-table>
+          </div>
+          <!-- 表单区域 -->
+          <role-modal ref="modalForm" @ok="modalFormOk"></role-modal>
+          <user-modal ref="modalForm2" @ok="modalFormOk2"></user-modal>
+          <Select-User-Modal ref="selectUserModal" @selectFinished="selectOK"></Select-User-Modal>
+        </a-card>
+      </a-col>
+    </a-row>
+  </template>
+  <script>
+    import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+    import { deleteAction, postAction, getAction } from '@/api/manage'
+    import SelectUserModal from './modules/SelectUserModal'
+    import RoleModal from './modules/RoleModal'
+    import UserModal from './modules/UserModal'
+    import { filterObj } from '@/utils/util'
+    
+    import moment from 'moment'
+  
+    export default {
+      name: 'RoleUserList',
+      mixins: [JeecgListMixin],
+      components: {
+        SelectUserModal,
+        RoleModal,
+        UserModal,
+        moment
+      },
+      data() {
+        return {
+          model1: {},
+          model2: {},
+          currentRoleId: '',
+          queryParam1: {},
+          queryParam2: {},
+          dataSource1: [],
+          dataSource2: [],
+          ipagination1: {
+            current: 1,
+            pageSize: 10,
+            pageSizeOptions: ['10', '20', '30'],
+            showTotal: (total, range) => {
+              return range[0] + '-' + range[1] + ' 共' + total + '条'
+            },
+            showQuickJumper: true,
+            showSizeChanger: true,
+            total: 0
+          },
+          ipagination2: {
+            current: 1,
+            pageSize: 10,
+            pageSizeOptions: ['10', '20', '30'],
+            showTotal: (total, range) => {
+              return range[0] + '-' + range[1] + ' 共' + total + '条'
+            },
+            showQuickJumper: true,
+            showSizeChanger: true,
+            total: 0
+          },
+          isorter1: {
+            column: 'createTime',
+            order: 'desc'
+          },
+          isorter2: {
+            column: 'createTime',
+            order: 'desc'
+          },
+          filters1: {},
+          filters2: {},
+          loading1: false,
+          loading2: false,
+          selectedRowKeys1: [],
+          selectedRowKeys2: [],
+          selectionRows1: [],
+          selectionRows2: [],
+          test:{},
+          rightcolval:0,
+          columns:
+            [
+              {
+                title: '角色编码',
+                align: 'center',
+                dataIndex: 'roleCode'
+              },
+              {
+                title: '角色名称',
+                align: 'center',
+                dataIndex: 'roleName'
+              },
+              {
+                title: '创建时间',
+                dataIndex: 'createTime',
+                align:"center",
+                sorter: true,
+                customRender: (text) => {
+                  return moment(text).format('YYYY-MM-DD')
+                }
+              },
+              {
+                title: '操作',
+                dataIndex: 'action',
+                align: 'center',
+                scopedSlots: { customRender: 'action' }
+              }
+            ],
+          columns2: [{
+            title: '用户账号',
+            align: 'center',
+            dataIndex: 'username',
+            width: 120
+          },
+            {
+              title: '用户名称',
+              align: 'center',
+              width: 100,
+              dataIndex: 'realname'
+            },
+            {
+              title: '状态',
+              align: 'center',
+              width: 80,
+              dataIndex: 'status_dictText'
+            },
+  
+            {
+              title: '操作',
+              dataIndex: 'action',
+              scopedSlots: { customRender: 'action' },
+              align: 'center',
+              width: 120
+            }],
+  
+          // 高级查询参数
+          superQueryParams2: '',
+          // 高级查询拼接条件
+          superQueryMatchType2: 'and',
+          url: {
+            list: '/sys/role/list',
+            delete: '/sys/role/delete',
+            list2: '/sys/user/userRoleList',
+            addUserRole: '/sys/user/addSysUserRole',
+            delete2: '/sys/user/deleteUserRole',
+            deleteBatch2: '/sys/user/deleteUserRoleBatch',
+            exportXlsUrl: 'sys/role/exportXls',
+            importExcelUrl: 'sys/role/importExcel'
+          }
+        }
+      },
+      computed: {
+        importExcelUrl: function() {
+          return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
+        },
+        leftColMd() {
+          return this.selectedRowKeys1.length === 0 ? 24 : 12
+        },
+        rightColMd() {
+          return this.selectedRowKeys1.length === 0 ? 0 : 12
+        }
+      },
+      methods: {
+        onSelectChange2(selectedRowKeys, selectionRows) {
+          this.selectedRowKeys2 = selectedRowKeys
+          this.selectionRows2 = selectionRows
+        },
+        onClearSelected2() {
+          this.selectedRowKeys2 = []
+          this.selectionRows2 = []
+        },
+        onClearSelected1() {
+          this.selectedRowKeys1 = []
+          this.selectionRows1 = []
+        },
+        onSelectChange1(selectedRowKeys, selectionRows) {
+          this.rightcolval = 1
+          this.selectedRowKeys1 = selectedRowKeys
+          this.selectionRows1 = selectionRows
+          this.model1 = Object.assign({}, selectionRows[0])
+          console.log(this.model1)
+          this.currentRoleId = selectedRowKeys[0]
+          this.loadData2()
+        },
+        onClearSelected() {
+        },
+  
+        getQueryParams2() {
+          //获取查询条件
+          let sqp = {}
+          if (this.superQueryParams2) {
+            sqp['superQueryParams'] = encodeURI(this.superQueryParams2)
+            sqp['superQueryMatchType'] = this.superQueryMatchType2
+          }
+          var param = Object.assign(sqp, this.queryParam2, this.isorter2, this.filters2)
+          param.field = this.getQueryField2()
+          param.pageNo = this.ipagination2.current
+          param.pageSize = this.ipagination2.pageSize
+          return filterObj(param)
+        },
+        getQueryField2() {
+          //TODO 字段权限控制
+          var str = 'id,'
+          this.columns2.forEach(function(value) {
+            str += ',' + value.dataIndex
+          })
+          return str
+        },
+        handleEdit2: function(record) {
+          this.$refs.modalForm2.title = '编辑'
+          this.$refs.modalForm2.roleDisabled = true
+          this.$refs.modalForm2.edit(record)
+        },
+        handleAdd2: function() {
+          if (this.currentRoleId == '') {
+            this.$message.error('请选择一个角色!')
+          } else {
+            this.$refs.modalForm2.roleDisabled = true
+            this.$refs.modalForm2.title = '新增'
+            this.$refs.modalForm2.edit({activitiSync:'1',userIdentity:1,selectedroles:this.currentRoleId})
+          }
+        },
+        modalFormOk2() {
+          // 新增/修改 成功时,重载列表
+          this.loadData2()
+        },
+        loadData2(arg) {
+          if (!this.url.list2) {
+            this.$message.error('请设置url.list2属性!')
+            return
+          }
+          //加载数据 若传入参数1则加载第一页的内容
+          if (arg === 1) {
+            this.ipagination2.current = 1
+          }
+          if (this.currentRoleId === '') return
+          let params = this.getQueryParams2()//查询条件
+          params.roleId = this.currentRoleId
+          this.loading2 = true
+          getAction(this.url.list2, params).then((res) => {
+            if (res.success) {
+              this.dataSource2 = res.result.records
+              this.ipagination2.total = res.result.total
+  
+            }
+            this.loading2 = false
+          })
+  
+        },
+        handleDelete1: function(id) {
+          this.handleDelete(id)
+          this.dataSource2 = []
+          this.currentRoleId = ''
+        },
+        handleDelete2: function(id) {
+          if (!this.url.delete2) {
+            this.$message.error('请设置url.delete2属性!')
+            return
+          }
+          var that = this
+          deleteAction(that.url.delete2, { roleId: this.currentRoleId, userId: id }).then((res) => {
+            if (res.success) {
+              that.$message.success(res.message)
+              that.loadData2()
+            } else {
+              that.$message.warning(res.message)
+            }
+          })
+        },
+        batchDel2: function() {
+  
+          if (!this.url.deleteBatch2) {
+            this.$message.error('请设置url.deleteBatch2属性!')
+            return
+          }
+          if (this.selectedRowKeys2.length <= 0) {
+            this.$message.warning('请选择一条记录!')
+            return
+          } else {
+            var ids = ''
+            for (var a = 0; a < this.selectedRowKeys2.length; a++) {
+              ids += this.selectedRowKeys2[a] + ','
+            }
+            var that = this
+            console.log(this.currentDeptId)
+            this.$confirm({
+              title: '确认取消关联',
+              content: '是否删除选中数据?',
+              onOk: function() {
+                deleteAction(that.url.deleteBatch2, { roleId: that.currentRoleId, userIds: ids }).then((res) => {
+                  if (res.success) {
+                    that.$message.success(res.message)
+                    that.loadData2()
+                    that.onClearSelected()
+                  } else {
+                    that.$message.warning(res.message)
+                  }
+                })
+              }
+            })
+          }
+        },
+        selectOK(data) {
+          let params = {}
+          params.roleId = this.currentRoleId
+          params.userIdList = []
+          for (var a = 0; a < data.length; a++) {
+            params.userIdList.push(data[a])
+          }
+          console.log(params)
+          postAction(this.url.addUserRole, params).then((res) => {
+            if (res.success) {
+              this.loadData2()
+              this.$message.success(res.message)
+            } else {
+              this.$message.warning(res.message)
+            }
+          })
+        },
+  
+        handleAddUserRole() {
+          if (this.currentRoleId == '') {
+            this.$message.error('请选择一个角色!')
+          } else {
+            this.$refs.selectUserModal.visible = true
+          }
+        },
+        handleOpen(record) {
+          this.rightcolval = 1
+          this.selectedRowKeys1 = [record.id]
+          this.model1 = Object.assign({}, record)
+          this.currentRoleId = record.id
+          this.onClearSelected2()
+          this.loadData2()
+        },
+        /*handleEdit: function(record) {
+          if (this.currentRoleId == '') {
+            this.$message.error('请选择一个角色!')
+          } else {
+            this.$refs.modalForm.edit(record)
+            this.$refs.modalForm.title = '编辑'
+          }
+        },*/
+        searchQuery2() {
+          this.loadData2(1)
+        },
+        searchReset2() {
+          this.queryParam2 = {}
+          this.loadData2(1)
+        },
+        handleTableChange2(pagination, filters, sorter) {
+          //分页、排序、筛选变化时触发
+          //TODO 筛选
+          if (Object.keys(sorter).length > 0) {
+            this.isorter2.column = sorter.field
+            this.isorter2.order = 'ascend' == sorter.order ? 'asc' : 'desc'
+          }
+          this.ipagination2 = pagination
+          this.loadData2()
+        },
+        hideUserList(){
+          //this.rightcolval = 0
+          this.selectedRowKeys1 = []
+        },
+        handlePerssion(roleId){
+          this.$refs.modalUserRole.show(roleId);
+        },
+      }
+    }
+  </script>
+  <style scoped>
+  @import '~@assets/less/common.less';
+    /** Button按钮间距 */
+    .ant-btn {
+      margin-left: 8px
+    }
+  </style>