소스 검색

打印模板

覃浩 2 년 전
부모
커밋
a077a82d4f

+ 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

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 321 - 0
src/views/settings/components/modules/printComponents/incomePrint.vue


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 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>

+ 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>