Browse Source

团练宝分润完成

1
mo 3 years ago
parent
commit
a8b5dfea7c

+ 21 - 7
src/components/remote-search/index.vue

@@ -24,8 +24,10 @@
         :label="item.userName"
         :value="item.userId"
       >
-      <span style="float: left">{{ item.userName }}</span>
-      <span style="float: right; color: #8492a6; font-size: 13px">{{ item.userId }}</span>
+        <span style="float: left">{{ item.userName }}</span>
+        <span style="float: right; color: #8492a6; font-size: 13px">{{
+          item.userId
+        }}</span>
       </el-option>
     </el-select>
   </div>
@@ -34,7 +36,8 @@
 const placeholder = {
   setTeachers: "请选择老师",
   setEducations: "请选乐团主管",
-  setEmploys:"请选择操作人"
+  setEmploys: "请选择操作人",
+  setTenantUser: "请选择推荐人",
 };
 import { throttle, slice, uniqBy } from "lodash";
 import selects from "@/store/modules/selects";
@@ -57,16 +60,26 @@ export default {
     // this.getList();
     //  (this.value)
     this.getOptions(this.value || "");
+    console.log(this.value)
   },
   methods: {
     async getList() {
       // 处理乐团主管数据请求
-      const commit = this.commit == 'setEducations' ? 'setOrganRole' : this.commit
-      await this.$store.dispatch(commit);
-      if(commit == 'setOrganRole') {
+      const commit =
+        this.commit == "setEducations" ? "setOrganRole" : this.commit;
+        if(this.commit == 'setTenantUser'){
+          await this.$store.dispatch(commit,this.value);
+        }else{
+          await this.$store.dispatch(commit);
+        }
+
+      if (commit == "setOrganRole") {
         this.list = this.selects.roles[this.enumer[commit]];
       } else {
+
         this.list = this.selects[this.enumer[commit]];
+
+        console.log(this.selects,this.selects[this.enumer[commit]],this.enumer[commit])
       }
       const data = {};
       for (const item of this.list) {
@@ -140,7 +153,8 @@ export default {
       return {
         setTeachers: "teachers",
         setOrganRole: "EDUCATION",
-        setEmploys:'employs'
+        setEmploys: "employs",
+        setTenantUser: "tenantUsers",
       };
     },
   },

+ 3 - 1
src/router/index.js

@@ -551,7 +551,9 @@ export const asyncRoutes = {
   // 小课学员管理
   smallStudentManager:()=>import('@/views/smallStudentManager'),
   // 代理商管理
-  agentList:()=>import('@/views/agentManager/agentList')
+  agentList:()=>import('@/views/agentManager/agentList'),
+  // 团练宝分润
+  memberShareList:()=>import('@/views/agentManager/memberShareList'),
 }
 
 export default router

+ 123 - 105
src/store/modules/selects.js

@@ -6,20 +6,15 @@ import {
   findEducationUsers,
   getEmployeeOrgan,
   getOrganRole
-} from '@/api/buildTeam'
-import {
-  getSchool,
-  queryEmployByOrganId
-} from '@/api/systemManage'
-import {
-  vipGroupCategory,
-
-} from "@/api/vipSeting"
+} from "@/api/buildTeam";
+import { getSchool, queryEmployByOrganId } from "@/api/systemManage";
+import { vipGroupCategory } from "@/api/vipSeting";
+import { getTenantUserList } from '@/views/agentManager/api'
 // import {
 //   findTechnician
 // } from '@/api/repairManager'
 
-const loadings = {}
+const loadings = {};
 
 /**
  *
@@ -42,14 +37,15 @@ export default {
     educations: [],
     technician: [],
     employs: [],
-    roles: []
+    roles: [],
+    tenantUsers:[]
   },
   mutations: {
     commit_branchs: (state, branchs) => {
-      state.branchs = branchs
+      state.branchs = branchs;
     },
     commit_subjects: (state, subjects) => {
-      state.subjects = subjects
+      state.subjects = subjects;
     },
     commit_teachers: (state, teachers) => {
       state.teachers = teachers.map(teacher => {
@@ -59,23 +55,23 @@ export default {
           userId: teacher.id,
           userName: teacher.realName,
           realName: teacher.realName
-        }
-      })
+        };
+      });
     },
     commit_schools: (state, schools) => {
-      state.schools = schools
+      state.schools = schools;
     },
     commit_vip_group_category: (state, vipGroupCategory) => {
-      state.vipGroupCategory = vipGroupCategory
+      state.vipGroupCategory = vipGroupCategory;
     },
     commit_educations: (state, educations) => {
-      state.educations = educations
+      state.educations = educations;
     },
     commit_technician: (state, technician) => {
-      state.technician = technician
+      state.technician = technician;
     },
     commit_roles: (state, roles) => {
-      state.roles = roles
+      state.roles = roles;
     },
     commit_employs: (state, employs) => {
       state.employs = employs.map(emloys => {
@@ -85,123 +81,133 @@ export default {
           userId: emloys.id,
           userName: emloys.realName,
           realName: emloys.realName
+        };
+      });
+    },
+    commit_tenantUsers:(state,tenantUsers)=>{
+      state.tenantUsers = tenantUsers.map(tenantUser=>{
+        return {
+          ...tenantUser,
+          userId: tenantUser.userId,
+          userName: tenantUser.name,
+          realName: tenantUser.name
         }
       })
     }
   },
   actions: {
-    async setBranchs({
-      commit,
-      state
-    }, force) {
-      if ((!state.branchs.length || force === true) && !loadings.commit_branchs) {
-        loadings.commit_branchs = getEmployeeOrgan()
+    async setBranchs({ commit, state }, force) {
+      if (
+        (!state.branchs.length || force === true) &&
+        !loadings.commit_branchs
+      ) {
+        loadings.commit_branchs = getEmployeeOrgan();
         try {
-          const res = await loadings.commit_branchs
-          commit('commit_branchs', res.data)
+          const res = await loadings.commit_branchs;
+          commit("commit_branchs", res.data);
         } catch (error) {}
-        loadings.commit_branchs = false
+        loadings.commit_branchs = false;
       }
     },
-    async setSubjects({
-      commit,
-      state
-    }, force) {
-      if ((!state.subjects.length || force === true) && !loadings.commit_subjects) {
+    async setSubjects({ commit, state }, force) {
+      if (
+        (!state.subjects.length || force === true) &&
+        !loadings.commit_subjects
+      ) {
         loadings.commit_subjects = getSubject({
           rows: 9999,
-          tenantId: '1'
-        })
+          tenantId: "1"
+        });
         try {
-          const res = await loadings.commit_subjects
-          commit('commit_subjects', res.data)
+          const res = await loadings.commit_subjects;
+          commit("commit_subjects", res.data);
         } catch (error) {}
-        loadings.commit_subjects = false
+        loadings.commit_subjects = false;
       }
     },
-    async setTeachers({
-      commit,
-      state
-    }, force) {
-      if ((!state.teachers.length || force === true) && !loadings.commit_teachers) {
-        loadings.commit_teachers = getTeacher()
+    async setTeachers({ commit, state }, force) {
+      if (
+        (!state.teachers.length || force === true) &&
+        !loadings.commit_teachers
+      ) {
+        loadings.commit_teachers = getTeacher();
         try {
-          const res = await loadings.commit_teachers
-          commit('commit_teachers', res.data)
+          const res = await loadings.commit_teachers;
+          commit("commit_teachers", res.data);
         } catch (error) {}
-        loadings.commit_teachers = false
+        loadings.commit_teachers = false;
       }
     },
-    async setSchools({
-      commit,
-      state
-    }, force) {
-      if ((!state.schools.length || force === true) && !loadings.commit_schools) {
-        loadings.commit_schools = getSchool()
+    async setSchools({ commit, state }, force) {
+      if (
+        (!state.schools.length || force === true) &&
+        !loadings.commit_schools
+      ) {
+        loadings.commit_schools = getSchool();
         try {
-          const res = await loadings.commit_schools
-          commit('commit_schools', res.data)
+          const res = await loadings.commit_schools;
+          commit("commit_schools", res.data);
         } catch (error) {}
-        loadings.commit_schools = false
+        loadings.commit_schools = false;
       }
-      return loadings.commit_schools
+      return loadings.commit_schools;
     },
-    async setVipGroupCategory({
-      commit,
-      state
-    }, force) {
-
-      if ((!state.vipGroupCategory.length || force === true) && !loadings.commit_vip_group_category) {
-
-        loadings.commit_vip_group_category = vipGroupCategory()
+    async setVipGroupCategory({ commit, state }, force) {
+      if (
+        (!state.vipGroupCategory.length || force === true) &&
+        !loadings.commit_vip_group_category
+      ) {
+        loadings.commit_vip_group_category = vipGroupCategory();
         try {
-          const res = await loadings.commit_vip_group_category
-          commit('commit_vip_group_category', res.data)
-        } catch (error) {console.log(error)}
-        loadings.commit_vip_group_category = false
+          const res = await loadings.commit_vip_group_category;
+          commit("commit_vip_group_category", res.data);
+        } catch (error) {
+          console.log(error);
+        }
+        loadings.commit_vip_group_category = false;
       }
     },
-    async setEducations({
-      commit,
-      state
-    }, force) {
-      if ((!state.educations.length || force === true) && !loadings.commit_educations) {
-        loadings.commit_educations = findEducationUsers()
+    async setEducations({ commit, state }, force) {
+      if (
+        (!state.educations.length || force === true) &&
+        !loadings.commit_educations
+      ) {
+        loadings.commit_educations = findEducationUsers();
         try {
-          const res = await loadings.commit_educations
-          commit('commit_educations', res.data)
+          const res = await loadings.commit_educations;
+          commit("commit_educations", res.data);
         } catch (error) {}
-        loadings.commit_educations = false
+        loadings.commit_educations = false;
       }
     },
-    async setOrganRole({
-      commit,
-      state
-    }, force) {
-      if ((!state.educations.length || force === true) && !loadings.commit_roles) {
-        loadings.commit_roles = getOrganRole()
+    async setOrganRole({ commit, state }, force) {
+      if (
+        (!state.educations.length || force === true) &&
+        !loadings.commit_roles
+      ) {
+        loadings.commit_roles = getOrganRole();
         try {
-          const res = await loadings.commit_roles
-          const tempArr = []
-          const tempData = res.data
+          const res = await loadings.commit_roles;
+          const tempArr = [];
+          const tempData = res.data;
           // 初始化数据
           for (let i in tempData) {
-            tempArr[i] = []
+            tempArr[i] = [];
             if (tempData[i]) {
               for (let t in tempData[i]) {
                 tempArr[i].push({
                   value: tempData[i][t].userId,
                   label: tempData[i][t].realName,
                   ...tempData[i][t]
-                })
+                });
               }
             }
           }
-          commit('commit_roles', tempArr)
+          commit("commit_roles", tempArr);
         } catch (error) {}
-        loadings.commit_roles = false
+        loadings.commit_roles = false;
       }
-      getOrganRole
+      getOrganRole;
     },
     // async setTechnician({
     //   commit,
@@ -217,21 +223,33 @@ export default {
     //   }
 
     // },
-    async setEmploys({
-      commit,
-      state
-    }, force) {
-      if ((!state.employs.length || force === true) && !loadings.commit_employs) {
+    async setEmploys({ commit, state }, force) {
+      if (
+        (!state.employs.length || force === true) &&
+        !loadings.commit_employs
+      ) {
         loadings.commit_employs = queryEmployByOrganId({
-          rows: 99999
-        })
+
+        });
         try {
-          const res = await loadings.commit_employs
-          commit('commit_employs', res.data.rows)
+          const res = await loadings.commit_employs;
+          commit("commit_employs", res.data.rows);
         } catch (error) {}
-        loadings.commit_employs = false
+        loadings.commit_employs = false;
+      }
+    },
+    async setTenantUser({ commit, state },value, force) {
+      if (
+        (!state.employs.length || force === true) &&
+        !loadings.commit_tenantUsers
+      ) {
+        loadings.commit_tenantUsers = getTenantUserList();
+        try {
+          const res = await loadings.commit_tenantUsers;
+          commit("commit_tenantUsers", res.data);
+        } catch (error) {}
+        loadings.commit_tenantUsers = false;
       }
-
     }
   }
-}
+};

+ 53 - 9
src/templateList.vue

@@ -6,20 +6,25 @@
       班级列表
     </h2>
     <div class="m-core">
-      <save-form :inline="true" :model="searchForm" @submit="search" @reset='onReSet'>
+      <save-form
+        :inline="true"
+        :model="searchForm"
+        @submit="search"
+        @reset="onReSet"
+      >
         <el-form-item>
           <el-input
             v-model.trim="searchForm.search"
             clearable
             @keyup.enter.native="search"
-            placeholder='请输入乐团编号'
+            placeholder="请输入乐团编号"
           ></el-input>
         </el-form-item>
-          <el-form-item>
+        <el-form-item>
           <el-input
             v-model.trim="searchForm.search"
             @keyup.enter.native="search"
-            placeholder='请输入乐团编号'
+            placeholder="请输入乐团编号"
           ></el-input>
         </el-form-item>
         <el-form-item>
@@ -36,7 +41,37 @@
           <el-table-column
             align="center"
             prop="studentId"
-            label="分部"
+            label="代理商编号"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="studentId"
+            label="代理商名称"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="studentId"
+            label="机构编号"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="studentId"
+            label="机构名称"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="studentId"
+            label="激活时间"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="studentId"
+            label="激活数量"
+          ></el-table-column>
+                 <el-table-column
+            align="center"
+            prop="studentId"
+            label="推荐人"
           ></el-table-column>
         </el-table>
         <pagination
@@ -57,6 +92,7 @@ import axios from "axios";
 import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
+import { getTimes } from "@/utils";
 export default {
   components: { pagination },
   data() {
@@ -86,12 +122,20 @@ export default {
   },
   methods: {
     init() {},
-    getList() {},
-    search(){
+    getList() {
+      let { timer, ...rest } = this.searchForm;
+      let params = {
+        ...rest,
+        page: this.rules.page,
+        rows: this.rules.limit,
+        ...getTimes(timer, ["startTime", "endTime"]),
+      };
+    },
+    search() {
       this.rules.page = 1;
-      this.getList()
+      this.getList();
     },
-    onReSet(){},
+    onReSet() {},
   },
 };
 </script>

+ 62 - 26
src/views/agentManager/agentList.vue

@@ -33,7 +33,6 @@
       </save-form>
       <div class="btnList">
         <el-button
-          v-permission="'/teacherOperationAdd'"
           type="primary"
           style="margin-bottom: 20px"
           @click="addAgent"
@@ -41,9 +40,9 @@
           新建代理商
         </el-button>
         <el-button
-          v-permission="'/teacherOperationAdd'"
           type="primary"
           style="margin-bottom: 20px"
+          @click="lookH5"
         >
           代理商H5
         </el-button>
@@ -54,6 +53,7 @@
           :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
           :data="tableList"
           row-key="userId"
+          ref="table1"
           lazy
           :load="getStaffList"
           :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
@@ -100,21 +100,35 @@
                 <el-button type="text" @click="onJoinQrCode(scope.row)"
                   >入驻二维码</el-button
                 >
-                <el-button type="text" @click="addAgentStaff(scope.row)"
+                <el-button
+                  type="text"
+                  v-if="!scope.row.parentId"
+                  @click="addAgentStaff(scope.row)"
                   >添加员工</el-button
                 >
                 <!-- permission -->
-                <el-button type="text" @click="addAgent(scope.row)"
+                <el-button
+                  type="text"
+                  v-if="!scope.row.parentId"
+                  @click="addAgent(scope.row)"
                   >修改</el-button
                 >
-
                 <el-button
                   type="text"
-                  v-if="scope.row.state == '0'"
+                  v-if="scope.row.parentId"
+                  @click="addAgentStaff(scope.row)"
+                  >修改</el-button
+                >
+                <el-button
+                  type="text"
+                  v-if="scope.row.state == '0' && !scope.row.parentId"
                   @click="freezeProxy(scope.row)"
                   >冻结</el-button
                 >
-                <el-button type="text" v-else @click="freezeProxy(scope.row)"
+                <el-button
+                  type="text"
+                  v-if="scope.row.state != '0' && !scope.row.parentId"
+                  @click="freezeProxy(scope.row)"
                   >启用</el-button
                 >
               </div>
@@ -132,7 +146,7 @@
       </div>
     </div>
     <eidtAgentMager ref="eidtAgentMagerRef" @getList="getList" />
-    <eidthStaff ref="eidthStaffRef" @getList="getStaffList" />
+    <eidthStaff ref="eidthStaffRef" @getList="resetTreedata" />
     <qr-code
       v-model="codeStatus"
       :isDown="true"
@@ -148,11 +162,15 @@ import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
 import { permission } from "@/utils/directivePage";
-import { getProxyUserList, freezeProxyUser,getProxyUserStaffList } from "./api";
+import {
+  getProxyUserList,
+  freezeProxyUser,
+  getProxyUserStaffList,
+} from "./api";
 import eidtAgentMager from "./modals/eidtAgentMager";
 import eidthStaff from "./modals/eidthStaff";
 import qrCode from "@/components/QrCode/index";
-import { isvalidPhone, vaildStudentUrl } from "@/utils/validate";
+import { isvalidPhone, vaildStudentUrl,vaildTeachingUrl } from "@/utils/validate";
 export default {
   components: { pagination, eidtAgentMager, qrCode, eidthStaff },
   data() {
@@ -194,11 +212,11 @@ export default {
           page: this.rules.page,
           rows: this.rules.limit,
         });
-        this.tableList = res.data.rows.map(item=>{
+        this.tableList = res.data.rows.map((item) => {
           return {
             ...item,
-            hasChildren:true,
-          }
+            hasChildren: true,
+          };
         });
         this.rules.total = res.data.total;
       } catch (e) {}
@@ -208,9 +226,9 @@ export default {
       this.getList();
     },
     onReSet() {
-      this.$nextTick(()=>{
-        this.search()
-      })
+      this.$nextTick(() => {
+        this.search();
+      });
     },
     permission(str) {
       return permission(str);
@@ -229,6 +247,12 @@ export default {
         row.userId;
       this.codeStatus = true;
     },
+    lookH5(){
+      this.qrCodeUrl =
+        vaildTeachingUrl() +
+        "/#/saas-home";
+      this.codeStatus = true;
+    },
     async freezeProxy(row) {
       let str = "";
       let state = "";
@@ -248,17 +272,29 @@ export default {
         this.getList();
       } catch (e) {}
     },
-   async getStaffList(tree, treeNode, resolve) {
-      console.log(tree,treeNode,resolve)
-      try{
-        const res = await getProxyUserStaffList({id:tree.userId})
-        console.log(res.data)
-        resolve(res.data)
-        // treeNode.loaded = true;
-        // treeNode.loading = false;
-      }catch(e){
-    //  resolve([])
+    async getStaffList(tree, treeNode, resolve) {
+      try {
+        const res = await getProxyUserStaffList({ id: tree.userId });
+        console.log(res.data);
+        resolve(res.data);
+      } catch (e) {
+        //  resolve([])
+      }
+    },
+   async resetTreedata(parentId) {
+      console.log("parentId", parentId);
+           try {
+        const res = await getProxyUserStaffList({ id: parentId });
+        console.log(res.data);
+         this.$set(
+        this.$refs.table1.store.states.lazyTreeNodeMap,
+        parentId,
+        res.data
+      );
+      } catch (e) {
+        //  resolve([])
       }
+
     },
   },
 };

+ 24 - 0
src/views/agentManager/api.js

@@ -69,3 +69,27 @@ export const getProxyUserStaffList = data=>{
     method: 'get',
   })
 }
+
+// 获取平台员工
+export const getTenantUserList = data=>{
+  return request({
+    url: '/api-web/tenantProxyInfo/queryUserList',
+    // params: data,
+    data,
+    method: 'post',
+    requestType:'json',
+    hideLoading:true
+  })
+}
+
+
+// 代理商分润查询
+export const getProxyDividend = data=>{
+  return request({
+    url: '/api-web/tenantProxyDividend/queryProxyDividend',
+    // params: data,
+    data,
+    method: 'post',
+    requestType:'json'
+  })
+}

+ 204 - 0
src/views/agentManager/memberShareList.vue

@@ -0,0 +1,204 @@
+<!--  -->
+<template>
+  <div class="m-container">
+    <h2>
+      <div class="squrt"></div>
+      团练宝分润
+    </h2>
+    <div class="m-core">
+      <save-form
+        :inline="true"
+        :model="searchForm"
+        @submit="search"
+        @reset="onReSet"
+      >
+        <el-form-item prop="proxyId">
+          <el-select
+            class="multiple"
+            v-model.trim="searchForm.proxyId"
+            filterable
+            clearable
+            placeholder="请选代理商"
+          >
+            <el-option
+              v-for="(item, index) in proxyList"
+              :key="index"
+              :label="item.name"
+              :value="item.userId"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-form-item prop="recommenderId">
+            <remote-search
+              :commit="'setTenantUser'"
+              aria-placeholder="请选择推荐人"
+              v-model="searchForm.recommenderId"
+            />
+          </el-form-item>
+        </el-form-item>
+        <el-form-item>
+          <el-date-picker
+          :clearable="false"
+            v-model.trim="searchForm.timer"
+            style="width: 420px"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            :picker-options="{
+              firstDayOfWeek: 1,
+            }"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item>
+          <el-button native-type="submit" type="primary">搜索</el-button>
+          <el-button native-type="reset" type="danger">重置</el-button>
+        </el-form-item>
+      </save-form>
+      <div class="tableWrap">
+        <el-table
+          style="width: 100%"
+          :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+          :data="tableList"
+        >
+          <el-table-column
+            align="center"
+            prop="proxyId"
+            label="代理商编号"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="proxyName"
+            label="代理商名称"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="tenantId"
+            label="机构编号"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="tenantName"
+            label="机构名称"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="activeDate"
+            label="激活时间"
+          >
+           <template slot-scope="scope">
+              {{ scope.row.activeDate | formatTimer }}
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="activeCount"
+            label="激活数量"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="recommenderName"
+            label="推荐人"
+          ></el-table-column>
+        </el-table>
+        <pagination
+          sync
+          :total.sync="rules.total"
+          :page.sync="rules.page"
+          :limit.sync="rules.limit"
+          :page-sizes="rules.page_size"
+          @pagination="getList"
+        />
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import axios from "axios";
+import { getToken } from "@/utils/auth";
+import pagination from "@/components/Pagination/index";
+import { getTimes } from "@/utils";
+import load from "@/utils/loading";
+import { getProxyUserList,getProxyDividend } from "./api";
+export default {
+  components: { pagination },
+  data() {
+    return {
+      searchForm: {
+        search: null,
+        timer: [],
+      },
+
+      tableList: [],
+      organList: [],
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+      proxyList: [],
+    };
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+    // 获取分部
+     this.searchForm.timer = this.getInitDate()
+    this.init();
+  },
+  methods: {
+    init() {
+      this.getProxList();
+      this.getList()
+    },
+   async getProxList() {
+      try {
+        const res = await getProxyUserList({
+          page: 1,
+          rows: 9999,
+          state: "0",
+        });
+        this.proxyList = res.data.rows;
+      } catch (e) {}
+    },
+   async getList() {
+      let { timer, ...rest } = this.searchForm;
+      let params = {
+        ...rest,
+        page: this.rules.page,
+        rows: this.rules.limit,
+        ...getTimes(timer, ["startData", "endData"]),
+      };
+      try{
+      const res = await getProxyDividend({...params})
+      this.tableList = res.data.rows;
+      this.rules.total = res.data.total;
+      }catch(e){
+        console.log(e)
+      }
+    },
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    onReSet() {},
+       getInitDate() {
+      const end = this.$helpers.dayjs(new Date()).format("YYYY-MM-DD");
+      const start = this.$helpers
+        .dayjs(new Date())
+        .set("date", 1)
+        .format("YYYY-MM-DD");
+      return [start, end];
+    },
+  },
+};
+</script>
+<style lang='scss' scoped>
+</style>

+ 2 - 3
src/views/agentManager/modals/eidthStaff.vue

@@ -77,11 +77,10 @@ export default {
           // 验证通过
           if (this.agentForm.userId) {
             // 修改
-
                    try {
               const res = await updateProxyUser({...this.agentForm})
               this.$message.success('修改成功')
-              this.$emit('getList')
+              this.$emit('getList',this.agentForm.parentId)
               this.agentVisible = false;
             }catch(e){
               console.log(e)
@@ -91,7 +90,7 @@ export default {
             try {
               const res = await addProxyUserStaff({...this.agentForm})
               this.$message.success('新增成功')
-              this.$emit('getList')
+              this.$emit('getList',this.agentForm.parentId)
               this.agentVisible = false;
             }catch(e){
               console.log(e)