Przeglądaj źródła

fix:数据权限修改

刘恒 2 lat temu
rodzic
commit
f06a06b3fc

+ 0 - 1
src/components/tree/allTree.vue

@@ -64,7 +64,6 @@ export default {
       this.autoExpandParent = false;
       this.autoExpandParent = false;
     },
     },
     setExpandKys(item) {
     setExpandKys(item) {
-      console.log(item);
       this.$nextTick(() => {
       this.$nextTick(() => {
         // this.$refs.tree.expandedKeys = ["99D17"];
         // this.$refs.tree.expandedKeys = ["99D17"];
         // this.$refs.tree.defaultExpandedKeys = ["99D17"];
         // this.$refs.tree.defaultExpandedKeys = ["99D17"];

+ 2 - 2
src/components/tree/tree.vue

@@ -105,8 +105,8 @@ export default {
   
   
 <style lang="less" scoped>
 <style lang="less" scoped>
 .tree {
 .tree {
-  height: 900px;
-  overflow-y: auto;
+  height: 100%;
+  // overflow-y: auto;
 }
 }
 </style>
 </style>
   
   

+ 8 - 0
src/pages/business/sales.vue

@@ -359,10 +359,18 @@ export default {
   .quote-tree {
   .quote-tree {
     padding: 15px;
     padding: 15px;
     box-sizing: border-box;
     box-sizing: border-box;
+    display: flex;
+    flex-direction: column;
     //
     //
     > div:first-child {
     > div:first-child {
       border-bottom: 1px solid #f0f0f0;
       border-bottom: 1px solid #f0f0f0;
     }
     }
+    > div:last-child {
+      flex: 1;
+      overflow: auto;
+      // padding-bottom: 100px;
+      // box-sizing: border-box;
+    }
   }
   }
 }
 }
 .back-line-main {
 .back-line-main {

+ 8 - 0
src/pages/sales/sales.vue

@@ -317,10 +317,18 @@ export default {
   .quote-tree {
   .quote-tree {
     padding: 15px;
     padding: 15px;
     box-sizing: border-box;
     box-sizing: border-box;
+    display: flex;
+    flex-direction: column;
     //
     //
     > div:first-child {
     > div:first-child {
       border-bottom: 1px solid #f0f0f0;
       border-bottom: 1px solid #f0f0f0;
     }
     }
+    > div:last-child {
+      flex: 1;
+      overflow: auto;
+      // padding-bottom: 100px;
+      // box-sizing: border-box;
+    }
   }
   }
 }
 }
 .back-line-main {
 .back-line-main {

+ 195 - 10
src/pages/sys/permissionsAuth.vue

@@ -26,17 +26,94 @@
       :title="title"
       :title="title"
       @ok="handleOk"
       @ok="handleOk"
       layout="inline"
       layout="inline"
-      width="50%"
+      width="70%"
       :confirm-loading="confirmLoading"
       :confirm-loading="confirmLoading"
     >
     >
-      <a-tabs default-active-key="1" :tab-position="'top'">
-        <a-tab-pane key="1" tab="代理人">
-          <tree :checkable="checkable" @checkTree="checkTree" ref="tree"></tree>
-        </a-tab-pane>
-        <a-tab-pane key="2" tab="渠道">
-          <tree :checkable="checkable" @checkTree="checkTree" ref="tree"></tree>
-        </a-tab-pane>
-      </a-tabs>
+      <div style="display: flex">
+        <div style="width: 28%">
+          <tree
+            :checkable="checkable"
+            @checkTree="checkTree"
+            ref="tree"
+            @getList="getMessageList"
+          ></tree>
+        </div>
+        <div style="flex: 1">
+          <a-form layout="inline" :model="formState" class="users">
+            <a-form-item label="姓名" :labelCol="{ span: 5 }" :colon="false">
+              <a-input
+                placeholder="请输入姓名"
+                v-model="formState.userName"
+                allowClear
+              ></a-input>
+            </a-form-item>
+            <a-form-item label="工号" :labelCol="{ span: 5 }" :colon="false">
+              <a-input
+                placeholder="请输入工号"
+                v-model="formState.userId"
+                allowClear
+              ></a-input>
+            </a-form-item>
+
+            <a-form-item label="管理员" :labelCol="{ span: 5 }" :colon="false">
+              <a-select
+                style="width: 200px"
+                placeholder="请选择"
+                v-model="formState.leaderId"
+                allowClear
+                show-search
+                :filter-option="filterOption"
+              >
+                <a-select-option
+                  v-for="item in manageList"
+                  :key="item.id"
+                  :value="item.id"
+                >
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+            <a-form-item
+              label="             "
+              :labelCol="{ span: 5 }"
+              :colon="false"
+              class="form-item-search"
+            >
+              <a-button type="primary" @click="searchChannel()">查询</a-button>
+            </a-form-item>
+          </a-form>
+          <a-tabs
+            default-active-key="1"
+            :tab-position="'top'"
+            style="margin-left: 15px; flex: 1"
+            @change="tabChange"
+          >
+            <a-tab-pane key="1" tab="代理人">
+              <standard-table
+                bordered
+                :columns="columns1"
+                :dataSource="perTable"
+                :pagination="perPagination"
+                @change="onChangePer"
+                :loading="perLoading"
+              >
+              </standard-table>
+            </a-tab-pane>
+            <a-tab-pane key="2" tab="渠道">
+              <standard-table
+                bordered
+                :columns="columns1"
+                :dataSource="perTable"
+                :pagination="perPagination"
+                @change="onChangePer"
+                :loading="perLoading"
+              >
+              </standard-table>
+            </a-tab-pane>
+          </a-tabs>
+        </div>
+      </div>
+
       <!-- <a-form :layout="formLayout"> -->
       <!-- <a-form :layout="formLayout"> -->
       <!-- <tree :checkable="checkable" @checkTree="checkTree" ref="tree"></tree> -->
       <!-- <tree :checkable="checkable" @checkTree="checkTree" ref="tree"></tree> -->
       <!-- </a-form> -->
       <!-- </a-form> -->
@@ -73,14 +150,40 @@ const columns = [
     scopedSlots: { customRender: "operation" },
     scopedSlots: { customRender: "operation" },
   },
   },
 ];
 ];
+const columns1 = [
+  {
+    title: "员工工号",
+    dataIndex: "id",
+    //
+  },
 
 
+  {
+    title: "姓名",
+    dataIndex: "name",
+  },
+  {
+    title: "管理人",
+    dataIndex: "leaderName",
+  },
+  {
+    title: "业务来源",
+    dataIndex: "managementSource",
+  },
+];
+import manageminxin from "../../minins/manageMixin";
 export default {
 export default {
   components: {
   components: {
     StandardTable,
     StandardTable,
     tree,
     tree,
   },
   },
+  mixins: [manageminxin],
   data() {
   data() {
     return {
     return {
+      formState: {
+        userId: undefined,
+        userName: undefined,
+        leaderId: undefined,
+      },
       visible: false,
       visible: false,
       confirmLoading: false,
       confirmLoading: false,
       title: "",
       title: "",
@@ -111,7 +214,21 @@ export default {
         hideOnSinglePage: false,
         hideOnSinglePage: false,
         showQuickJumper: true, //
         showQuickJumper: true, //
         showSizeChanger: true, //是否可以改变pagesize
         showSizeChanger: true, //是否可以改变pagesize
+        showTotal: (total) => `共 ${total} 条数据`,
+      },
+      columns1,
+      perPagination: {
+        current: 1,
+        defaultPageSize: 10,
+        total: 0,
+        pagesize0ptions: ["10", "20", "30", "50", "100"],
+        hideOnSinglePage: false,
+        showQuickJumper: true, //
+        showSizeChanger: true, //是否可以改变pagesize
+        showTotal: (total) => `共 ${total} 条数据`,
       },
       },
+      perTable: [],
+      perLoading: false,
       formItemLayout: {
       formItemLayout: {
         labelCol: {
         labelCol: {
           xs: { span: 5 },
           xs: { span: 5 },
@@ -140,6 +257,8 @@ export default {
       checkList: [],
       checkList: [],
       defaultCheckList: [],
       defaultCheckList: [],
       searchName: "",
       searchName: "",
+      tabs: 1,
+      deptId: "",
     };
     };
   },
   },
   created() {
   created() {
@@ -149,11 +268,56 @@ export default {
   },
   },
   mounted() {},
   mounted() {},
   methods: {
   methods: {
+    filterOption(input, option) {
+      return (
+        option.componentOptions.children[0].text
+          .toLowerCase()
+          .indexOf(input.toLowerCase()) >= 0
+      );
+    },
     searchList() {
     searchList() {
       this.pagination.current = 1;
       this.pagination.current = 1;
       this.pagination.defaultPageSize = 10;
       this.pagination.defaultPageSize = 10;
+
       this.getList();
       this.getList();
     },
     },
+    tabChange(key) {
+      // console.log(key);
+      this.tabs = key;
+      this.perPagination.current = 1;
+      this.perPagination.defaultPageSize = 10;
+      this.getChannelList(this.deptId);
+    },
+    searchChannel() {
+      this.perPagination.current = 1;
+      this.perPagination.defaultPageSize = 10;
+      this.getChannelList(this.deptId);
+    },
+    getMessageList(id) {
+      this.deptId = id;
+      this.perPagination.current = 1;
+      this.perPagination.defaultPageSize = 10;
+      this.getChannelList(id);
+    },
+    getChannelList(id) {
+      this.perLoading = true;
+      this.$API.sysManage
+        .getAgentOrChannel({
+          deptId: id,
+          type: this.tabs,
+          pageNum: this.perPagination.current,
+          pageSize: this.perPagination.defaultPageSize,
+          ...this.formState,
+        })
+        .then((res) => {
+          console.log(res);
+          if (res.data.code === 200) {
+            this.perLoading = false;
+            this.perTable = [...res.data.data.content];
+            this.perPagination.total = res.data.data.totalSize;
+          }
+        });
+    },
     checkTree(list) {
     checkTree(list) {
       this.checkList = [...list];
       this.checkList = [...list];
       //   console.log(list);
       //   console.log(list);
@@ -171,11 +335,21 @@ export default {
       this.title = "数据权限配置";
       this.title = "数据权限配置";
       this.visible = true;
       this.visible = true;
       this.dataForm = { ...item.record };
       this.dataForm = { ...item.record };
-      console.log(item.record);
+
       this.$nextTick(() => {
       this.$nextTick(() => {
         this.$refs.tree.setExpandKys(item.record);
         this.$refs.tree.setExpandKys(item.record);
         // this.defaultCheckList = [""];
         // this.defaultCheckList = [""];
       });
       });
+      this.perTable = [];
+      this.perPagination.current = 1;
+      this.perPagination.defaultPageSize = 10;
+      this.deptId = "";
+      this.formState = {
+        userId: undefined,
+        userName: undefined,
+        leaderId: undefined,
+      };
+
       //   this.setExpandKys(item.record);
       //   this.setExpandKys(item.record);
     },
     },
     setExpandKys() {},
     setExpandKys() {},
@@ -189,6 +363,14 @@ export default {
       };
       };
       this.getList();
       this.getList();
     },
     },
+    onChangePer(pagination) {
+      this.perPagination = {
+        current: pagination.current,
+        defaultPageSize: pagination.pageSize,
+        total: pagination.total,
+      };
+      this.getMessageList(this.deptId);
+    },
     getList() {
     getList() {
       this.loading = true;
       this.loading = true;
       this.$API.sysManage
       this.$API.sysManage
@@ -237,6 +419,9 @@ export default {
 };
 };
 </script>
 </script>
     <style lang='less' scoped>
     <style lang='less' scoped>
+.ant-tabs-tabpane {
+  display: flex;
+}
 .menu {
 .menu {
   display: flex;
   display: flex;
   flex-direction: column;
   flex-direction: column;

+ 6 - 5
src/services/sysManage.js

@@ -95,10 +95,10 @@ export async function getMenuAuthItem(data) {
 export async function removeMenuAuth(data) {
 export async function removeMenuAuth(data) {
     return request("/kztDataPermission/delete?id=" + data.id, METHOD.GET,)
     return request("/kztDataPermission/delete?id=" + data.id, METHOD.GET,)
 }
 }
-// //获取单个用户信息
-// export async function getUserItem(data) {
-//     return request("/kztDataPermission/getByUserId", METHOD.GET, data)
-// }
+//获取数据权限代理人及渠道列表
+export async function getAgentOrChannel(data) {
+    return request("/kztUserDept/findChannelAgent", METHOD.POST, data)
+}
 
 
 
 
 
 
@@ -128,7 +128,8 @@ export default {
     findMenuListByUserId,
     findMenuListByUserId,
     getUserList,
     getUserList,
     UserSetDeptAuth,
     UserSetDeptAuth,
-    getUserItem
+    getUserItem,
+    getAgentOrChannel
 
 
 
 
 }
 }