Pārlūkot izejas kodu

Merge branch 'liuheng' into dev

刘恒 1 gadu atpakaļ
vecāks
revīzija
3e412e4a9c

+ 3 - 2
.env.development

@@ -4,9 +4,10 @@ VITE_APP_SETTING = true
 VITE_APP_TITLE = 掌柜运营平台
 # 接口请求地址,会设置到 axios 的 baseURL 参数上
 # VITE_APP_API_BASEURL = https://test.baoxianzhanggui.com/web-api #默认地址
-VITE_APP_API_BASEURL = http://192.168.0.253:8001  #田智
+# VITE_APP_API_BASEURL = http://192.168.0.253:8001  #田智
+VITE_APP_API_BASEURL = http://192.168.0.55:8001  #董鑫
 # VITE_APP_API_BASEURL = http://192.168.0.106:8001  #屈晨
-#VITE_APP_API_BASEURL = http://192.168.0.59:8001  #徐强
+# VITE_APP_API_BASEURL = http://192.168.0.59:8001  #徐强
 
 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
 VITE_APP_DEBUG_TOOL =

+ 1 - 1
.env.test

@@ -3,7 +3,7 @@ VITE_APP_SETTING = false
 # 页面标题
 VITE_APP_TITLE = 测试环境
 # 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = https://test.baoxianzhanggui.com/web-api
+VITE_APP_API_BASEURL = http://test-tennat.baoxianzhanggui.com/api
 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
 VITE_APP_DEBUG_TOOL =
 # 是否禁用开发者工具,可防止被调试

+ 1 - 1
package.json

@@ -7,7 +7,7 @@
   "scripts": {
     "dev": "vite",
     "build": "vue-tsc -b && vite build",
-    "build:test": "vue-tsc -b && vite build --mode test",
+    "build:test": "vue-tsc --noEmit && vite build --mode test",
     "serve": "http-server ./dist -o",
     "serve:test": "http-server ./dist-test -o",
     "svgo": "svgo -f src/assets/icons",

+ 13 - 2
src/api/index.ts

@@ -14,7 +14,10 @@ import operationApi from './modules/operation.ts'
 import menuApi from './modules/menu.ts'
 import commonApi from "./modules/common.ts";
 import teamApi from "@/api/modules/team.ts";
-
+import representativeApi from "@/api/modules/representative.ts"
+// import { useRouter } from 'vue-router'
+// const router = useRouter()
+import router from "@/router"
 const axiosInstance:ApiInstance = axios.create({
   baseURL: (import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true') ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL,
   timeout: 1000 * 60,
@@ -60,6 +63,13 @@ axiosInstance.interceptors.response.use(
     }
     else {
       if (response.data.code === 401) {
+        // console.log(router)
+        localStorage.setItem("token",'')
+        // router.push({
+        //   path:"/login"
+        // })
+    
+        // console.log(localStorage.getItem('token'))
         Message({
           message: '登录信息已过期,请重新登录!!!',
           type: 'error',
@@ -98,6 +108,7 @@ const api = {
   operationApi: operationApi(axiosInstance),
   menuApi:menuApi(axiosInstance),
   commonApi: commonApi(axiosInstance),
-  teamApi: teamApi(axiosInstance)
+  teamApi: teamApi(axiosInstance),
+  representativeApi: representativeApi(axiosInstance)
 }
 export default api

+ 72 - 0
src/api/modules/representative.ts

@@ -0,0 +1,72 @@
+import { ApiInstance } from '../type'
+import {LocationQueryValue} from "vue-router";
+
+// 新增
+export interface Request {
+  /**
+   * 归属机构id
+   */
+  deptId?: string;
+  /**
+   * 归属机构名称
+   */
+  deptName?: string;
+  /**
+   * 启用禁用
+   */
+  isEnable?: string;
+  /**
+   * 管理人id
+   */
+  leaderId?: string;
+  /**
+   * 搜索关键字
+   */
+  name?: string;
+  page?: number;
+  pages?: number;
+  /**
+   * 业务员
+   */
+  salesman?: string;
+  size?: number;
+  /**
+   * 状态  1:正常   0:删除 2:审批中  3:审批不通过
+   */
+  status?: number;
+  /**
+   * 团队ID
+   */
+  sysOrganizationId?: string;
+  /**
+   * 用户类型
+   */
+  typeAttr?: string;
+  [property: string]: any;
+}
+
+/**
+* Page
+*/
+
+// 代办
+const representativeApi = (axiosInstance: ApiInstance) => ({
+  //分页获取业务员列表
+  getUserInfoList: (data:  Request ) => axiosInstance.post('/userInfo/getUserInfoList', data), 
+   
+  //审核通过-业务员
+  salesmanAuthSuccess: (data:  Request ) => axiosInstance.post('/userInfo/salesmanAuthSuccess', data), 
+
+  //审核不通过-业务员
+  salesmanAuthFailed: (data:  Request ) => axiosInstance.post('/userInfo/salesmanAuthFailed', data), 
+
+  //  salesmanAuthSuccess: (data: { userInfoId: string }) => axiosInstance.post('/userInfo/salesmanAuthSuccess', data), // 审核通过
+
+  // salesmanAuthSuccess: (data: { userInfoId: string }) => axiosInstance.post('/userInfo/salesmanAuthSuccess', data), // 审核通过
+  // salesmanAuthFailed: (data: {
+  //   userInfoId: string,
+  //   approvalOpinion: string
+  // }) => axiosInstance.post('/userInfo/salesmanAuthFailed', data), // 审核不通过
+})
+
+export default representativeApi

+ 32 - 2
src/components/DialogSetDeptLeader/index.vue

@@ -38,6 +38,8 @@
             :default-expand-all="true"
             :expand-on-click-node="false"
             @node-click="treeClick"
+            node-key="id"
+            highlight-current
           >
           </el-tree>
         </div>
@@ -84,9 +86,9 @@
 </template>
 
 <script setup lang="ts">
-import { defineProps, ref, onMounted, defineEmits } from "vue";
+import { defineProps, ref, onMounted, defineEmits,nextTick,watch } from "vue";
 import api from "@/api";
-import { ElMessage } from "element-plus";
+import { ElMessage,ElTree } from "element-plus";
 type tableType = {
   id: string;
   name: string;
@@ -107,6 +109,30 @@ interface ListItem {
   value: string;
   label: string;
 }
+const treeRef = ref<InstanceType<typeof ElTree>>();
+// onMounted(async ()=>{
+//   await nextTick()
+//   console.log(treeRef.value)
+//   if(props.deptIds.length<2){
+//       treeRef.value!.setCurrentKey(props.deptIds[0]);
+//     }
+// })
+watch(props, (val) => {
+  nextTick(()=>{
+    if(props.dialogVisible)
+    if(props.deptIds.length<2){
+      treeRef.value?.setCurrentKey(props?.deptIds[0]);
+      treeClick({id:props.deptIds[0]}) 
+    }
+  })
+  
+  // if(val.dialogVisible){
+   
+   
+  // }
+  
+ 
+});
 
 const list = ref<ListItem[]>([]);
 const options = ref<ListItem[]>([]);
@@ -260,6 +286,10 @@ const handleClose = (done: () => void) => {
   border-radius: 10px;
   min-height: 500px;
   margin-top: 20px;
+  .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
+    background-color: #f0f9eb; /* 浅黄色背景 */
+    color: #1f569d; /* 深蓝色字体 */
+  }
   > div {
     flex: 1;
     padding: 15px;

+ 1 - 1
src/components/LoginForm/index.vue

@@ -39,7 +39,7 @@ const form = ref({
   userName: props.userName ?? localStorage.login_account ?? "",
   passWord: "",
   captcha: "",
-  system: "PLATFORM",
+  system: "",
   captchaId: 0,
   systemCode: "",
 });

+ 14 - 6
src/router/guards.ts

@@ -15,6 +15,7 @@ function setupRoutes(router: Router) {
     const routeStore = useRouteStore()
     const menuStore = useMenuStore()
     // 是否已登录
+    // console.log(556)
     if (userStore.isLogin) {
       // 是否已根据权限动态生成并注册路由
       if (routeStore.isGenerate) {
@@ -47,6 +48,7 @@ function setupRoutes(router: Router) {
       }
       else {
         // 获取用户权限
+        // console.log(123456789)
         settingsStore.settings.app.enablePermission && await userStore.getPermissions()
         // 生成动态路由
         switch (settingsStore.settings.app.routeBaseOn) {
@@ -75,7 +77,7 @@ function setupRoutes(router: Router) {
         routeStore.flatRoutes.forEach((route) => {
 
           if (!/^(?:https?:|mailto:|tel:)/.test(route.path)) {
-            console.log(router)
+            
             removeRoutes.push(router.addRoute(route as RouteRecordRaw))
           }
         })
@@ -87,11 +89,17 @@ function setupRoutes(router: Router) {
         }
         routeStore.setCurrentRemoveRoutes(removeRoutes)
         // 动态路由生成并注册后,重新进入当前路由
-        next({
-          path: to.path,
-          query: to.query,
-          replace: true,
-        })
+        console.log(156789,localStorage.getItem("token"))
+        if(localStorage.getItem("token")!=''){
+          next({
+            path: to.path,
+            query: to.query,
+            replace: true,
+          })
+        }else{
+          next()
+        }
+       
       }
     }
     else {

+ 1 - 0
src/router/index.ts

@@ -11,6 +11,7 @@ const router = createRouter({
   history: createWebHashHistory(),
   routes: useSettingsStore(pinia).settings.app.routeBaseOn === 'filesystem' ? constantRoutesByFilesystem : constantRoutes,
 })
+// console.log(router)
 
 setupGuards(router)
 

+ 42 - 0
src/router/modules/content.ts

@@ -0,0 +1,42 @@
+import type { RouteRecordRaw } from 'vue-router'
+
+const Layout = () => import('@/layouts/index.vue')
+
+const routes: RouteRecordRaw = {
+  path: '/content',
+  component: Layout,
+  redirect: '/content/message',
+  name: 'Content',
+  meta: {
+    title: '内容管理',
+  },
+  children: [
+    {
+      path: 'message',
+      name: 'contentMessage',
+      component: () => import('@/views/contentManagement/message.vue'),
+      meta: {
+        title: '消息通知',
+
+      },
+      children:[
+        {
+          path: 'messageEdit',
+          name: 'messageEdit',
+          component: () => import('@/views/contentManagement/modules/addMessage.vue'),
+          meta: {
+            title: '消息通知',
+            menu:false
+          }, 
+        },
+        
+      ]
+    },
+    
+    
+   
+    
+  ],
+}
+
+export default routes

+ 61 - 0
src/router/modules/representative.ts

@@ -0,0 +1,61 @@
+import type { RouteRecordRaw } from 'vue-router'
+
+const Layout = () => import('@/layouts/index.vue')
+
+const routes: RouteRecordRaw = {
+  path: '/representative',
+  component: Layout,
+  redirect: '/representative/member',
+  name: 'representative',
+  meta: {
+    title: '代办事项',
+  },
+  children: [
+    {
+      path: 'member',
+      name: 'RepresentativeMember',
+      component: () => import('@/views/representative/member.vue'),
+      meta: {
+        title: '成员审核',
+
+      },
+      children:[
+        {
+          path: 'memberMessage',
+          name: 'representativeMemberMessage',
+          component: () => import('@/views/representative/detail.vue'),
+          meta: {
+            title: '成员详情',
+            menu:false
+          }, 
+        },
+      ]
+      
+    },
+    {
+      path: 'salesman',
+      name: 'RepresentativeSalesman',
+      component: () => import('@/views/representative/salesman.vue'),
+      meta: {
+        title: '业务员审核',
+
+      },
+      children:[
+        {
+          path: 'salesmanMessage',
+          name: 'representativeSalesmanMessage',
+          component: () => import('@/views/representative/detail.vue'),
+          meta: {
+            title: '业务员详情',
+            menu:false
+          }, 
+        },
+      ]
+      
+    },
+    
+    
+  ],
+}
+
+export default routes

+ 18 - 2
src/router/routes.ts

@@ -3,10 +3,11 @@ import type { RouteRecordRaw } from "vue-router";
 import useSettingsStore from "@/store/modules/settings";
 import generatedRoutes from "virtual:generated-pages";
 import { setupLayouts } from "virtual:meta-layouts";
-import MultilevelMenuExample from "./modules/multilevel.menu.example";
-import organizationManagement from "./modules/organization";
+
+import representative from "./modules/representative";
 import operationManagement from "./modules/operation";
 import personnel from "./modules/personnel";
+import content from "./modules/content"
 // import {  } from "@/store/modules/user";
 // 固定路由(默认路由
 // console.log(useUserStore)
@@ -87,6 +88,21 @@ const asyncRoutes: Route.recordMainRaw[] = [
     },
     children: [operationManagement],
   },
+  {
+    meta: {
+      title: "代办事项",
+      icon: "i-uim:box",
+    },
+    children: [representative],
+  },
+  {
+    meta: {
+      title: "内容管理",
+      icon: "i-uim:box",
+    },
+    children: [content],
+  },
+  
   // {
   //   meta: {
   //     title: "租户运营",

+ 399 - 0
src/views/contentManagement/message.vue

@@ -0,0 +1,399 @@
+<template>
+  <div class="institution">
+    <div class="institution-main">
+          <el-form label-position="left" label-width="auto">
+            <el-row :gutter="24">
+              <el-col :span="6">
+                <el-form-item label="成员信息">
+                  <el-input
+                    v-model="formAccessibility.firstName"
+                    placeholder="输入成员信息查找"
+                    :prefix-icon="Search"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="归属机构">
+                  <el-cascader
+                    clearable
+                    style="width: 100%"
+                    v-model="info.deptId"
+                    :options="institutionList"
+                    :props="tableProps"
+                    
+                  />
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="4">
+                <el-form-item label="">
+                  <el-button type="primary">查询</el-button>
+                  <el-button type="primary" plain @click="reset"
+                    >重置</el-button
+                  >
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+
+          <Table
+            :tableData="tableData"
+            :columns="columns"
+            :showIndex="false"
+            :showSelect="true"
+            :pageInfo="pageInfo"
+            @getList="getList"
+            :treeProps="{ children: 'children', hasChildren: 'hasChildren' }"
+            @select-all-change="selectAllChange"
+            @select-change="selectChange"
+          >
+            <template v-slot:table-title-btn>
+              <div>
+                <!-- <el-button type="primary" @click="add(ruleFormRef)">
+              <el-icon><Plus /></el-icon>添加机构</el-button
+            > -->
+                <el-button @click="router.push({path:'/content/message/messageEdit'})"><el-icon><Position /></el-icon>发布新的通知</el-button>
+              </div>
+            </template>
+            <template v-slot:operation="scope">
+              <el-button
+                type="primary"
+                link
+                @click="editor(scope.operationData.row)"
+              >
+                详情
+              </el-button>
+            </template>
+            <template v-slot:search="scope">
+              {{ scope.slotData.label }}
+            </template>
+          </Table>
+        </div>
+
+    
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref, reactive, watch, onMounted } from "vue";
+import type {
+  ComponentSize,
+  FormInstance,
+  FormRules,
+  TabsPaneContext,
+} from "element-plus";
+import { Plus, Search,Position } from "@element-plus/icons-vue";
+import { useRouter } from "vue-router";
+
+// import universalTable from "../"
+import { ElMessage, ElMessageBox, ElPopconfirm, ElTree } from "element-plus";
+import api from "@/api";
+import { h } from "vue";
+import setDept from "@/components/DialogSetDeptLeader/index.vue";
+interface Tree {
+  [key: string]: any;
+}
+
+const filterText = ref("");
+const treeRef = ref<InstanceType<typeof ElTree>>();
+const activeName = ref("hold");
+const defaultProps = {
+  children: "children",
+  label: "label",
+};
+
+//批量设置负责人
+
+watch(filterText, (val) => {
+  treeRef.value!.filter(val);
+});
+
+const formAccessibility = reactive({
+  fullName: "",
+  firstName: "",
+  lastName: "",
+  phone: "",
+});
+const ruleFormRef = ref<FormInstance>();
+let form = reactive({
+  name: "", //机构名称
+  parentId: "", //上级机构id
+  comType: "", //机构类型
+  exhibitionScope: "", //展业范围
+  address: "", //地址
+  leaderId: "", //负责人id
+  area: [], //地区
+});
+
+interface PageInfo {
+  pageNum: number;
+  pageSize: number;
+  sizes: number[];
+  total: number;
+  show: boolean;
+}
+
+const dialogVisible = ref(false);
+
+// import Select from "@/components/select/selectMain.vue";
+// import TestTable from "@/components/Table/index.vue";
+//业务员列表
+type tableType = {
+  id: string;
+  name: string;
+};
+const tableData = ref<tableType[]>([]);
+const tableProps = ref({
+  value: "id",
+  label: "name",
+  children: "children",
+  checkStrictly: true,
+});
+const typeformatter = (row: any, column: any, cellValue: any) => {
+  let comType = "";
+  comTypeList.value.map((ele) => {
+    if (ele.value == row.comType) {
+      comType = ele.label;
+    }
+  });
+
+  return () => h("div", {}, comType);
+};
+const columns = [
+  { prop: "name", label: "发布消息" },
+  { prop: "mobile", label: "发布机构" },
+  // { prop: "id", label: "工号" },
+  { prop: "deptName", label: "下级机构是否发布" },
+  {
+    prop: "username",
+    label: "是否强制查看",
+  },
+  { prop: "createTime", label: "查看人数" },
+
+];
+
+const pageInfo = {
+  pageNum: 1,
+  pageSize: 10,
+  sizes: [10, 20, 30, 40, 50],
+  total: 0,
+  show: true,
+};
+//分页列表功能
+const getList = (item: PageInfo) => {
+  pageInfo.pageNum = item.pageNum;
+  pageInfo.pageSize = item.pageSize;
+  salesmanAuth();
+};
+
+const checkTableIdList = ref([]);
+//表格选择事件
+function selectAllChange(list: any) {
+  checkTableIdList.value = list;
+}
+
+function selectChange(list: any) {
+  checkTableIdList.value = list;
+}
+//审核
+const userInfoId = ref("");
+const toExamine = (item: any, type: string) => {
+  if (type == "success") {
+    ElMessageBox.confirm(`确定审核通过${item.name}账号吗?`, "审核通过", {
+      confirmButtonText: "确认",
+      cancelButtonText: "取消",
+      type: "warning",
+      center: true,
+    })
+      .then(() => {
+        api.representativeApi
+          .salesmanAuthSuccess({
+            userInfoId: item.id,
+          })
+          .then((res: any) => {
+            if (res.code == 200) {
+              ElMessage.success("操作成功");
+              salesmanAuth(); //业务员列表
+            } else {
+              ElMessage.error(res.msg);
+              // salesmanAuth(); //业务员列表
+            }
+          });
+      })
+      .catch(() => {
+        ElMessage.warning("用户取消操作");
+      });
+  } else {
+    dialogVisible.value = true;
+    userInfoId.value = item.id;
+    // ElMessageBox.confirm(`<textarea placeholder='请输入审核不通过原因' oninput='handleText()' style="width:300px"></textarea>`, "审核不通过", {
+    //   confirmButtonText: "确认",
+    //   cancelButtonText: "取消",
+    //   dangerouslyUseHTMLString: true ,
+    //   type: "warning",
+    //   center: true,
+
+    // })
+    //   .then(() => {
+    //     api.representativeApi.salesmanAuthFailed({}).then((res: any) => {
+    //       if (res.code == 200) {
+    //         ElMessage.success("操作成功");
+    //         salesmanAuth(); //业务员列表
+    //       } else {
+    //         ElMessage.error(res.msg);
+    //         // salesmanAuth(); //业务员列表
+    //       }
+    //     });
+    //   })
+    //   .catch(() => {
+    //     ElMessage.warning("用户取消操作");
+    //   });
+  }
+};
+function cancel() {
+  ElMessage.warning("用户取消操作");
+  dialogVisible.value = false;
+}
+const textValue = ref("");
+//审核不通过
+function confirm() {
+  api.representativeApi
+    .salesmanAuthFailed({
+      userInfoId: userInfoId.value,
+      approvalOpinion: textValue.value,
+    })
+    .then((res: any) => {
+      if (res.code == 200) {
+        ElMessage.success("操作成功");
+        salesmanAuth(); //业务员列表
+        dialogVisible.value = false;
+      }
+    });
+}
+
+interface institutionData {
+  typeAttr: string;
+  deptId: string;
+  status: number;
+}
+const info = ref<institutionData>({
+  typeAttr: "2",
+  deptId: "",
+  status: 4,
+});
+
+const router = useRouter();
+
+//详情
+const editor = (item: any) => {
+  console.log(item);
+  router.push({
+    path: "/representative/member/memberMessage",
+    query: {
+      id: item.userId,
+    },
+  });
+  // pageInfo.pageNum=item.pageNum
+  // pageInfo.pageSize=item.pageSize
+};
+
+//获取机构类型字典值
+type comType = {
+  value: string;
+  label: string;
+};
+let comTypeList = ref<comType[]>([]);
+
+const handleClick = (tab: TabsPaneContext, event: Event) => {
+  // console.log(tab.props.name);
+  if (tab.props.name == "pass") {
+    info.value.status = 5;
+    salesmanAuth();
+  } else {
+    info.value.status = 4;
+    salesmanAuth();
+  }
+};
+
+//获取成员员列表
+const salesmanAuth = () => {
+  api.representativeApi
+    .getUserInfoList({
+      ...info.value,
+      pages: pageInfo.pageNum,
+      size: pageInfo.pageSize,
+    })
+    .then((res) => {
+      tableData.value = res.data.records;
+      pageInfo.total = res.data.total;
+    });
+};
+
+//机构列表
+const institutionList = ref([]);
+const getAllMemberList = () => {
+  api.institutionApi.institutionList({}).then((res: any) => {
+    if (res.code === 200) institutionList.value = res.data;
+  });
+  // pageInfo.pageSize=item.pageSize
+};
+
+const reset = (item: any) => {
+  // ElMessage({})
+};
+
+onMounted(() => {
+  // 对 asyncRoutes 进行预处理并转换为树形结构
+  salesmanAuth(); //业务员列表
+  // getAreaList(); //省市区级联数据
+  // getSystemList(); //机构类型字典
+  // getExhibitionScopeSystemList(); //展业范围字段
+  getAllMemberList(); //机构列表
+});
+</script>
+<style lang="scss" scoped>
+:deep(.table-title-btn) {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  > div {
+    display: flex;
+  }
+}
+.institution {
+  background: #fff;
+  width: 100%;
+  // height: 100%;
+  // padding: 20px;
+  box-sizing: border-box;
+  display: flex;
+ 
+  .institution-main {
+    flex: 1;
+    // width: 80%;
+    padding: 20px;
+    box-sizing: border-box;
+  }
+}
+:deep(.el-dropdown-link) {
+  cursor: pointer;
+  color: var(--el-color-primary);
+  display: flex;
+  align-items: center;
+  margin-left: 15px;
+}
+.custom-tree-node {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 14px;
+  padding-right: 8px;
+}
+:deep(.el-message-box__container) {
+  width: 100% !important;
+  .el-message-box__message {
+    width: 100% !important;
+  }
+}
+</style>

+ 208 - 0
src/views/contentManagement/modules/addMessage.vue

@@ -0,0 +1,208 @@
+<template>
+  <div class="message-main">
+    <h4>基本信息</h4>
+    <el-form
+      ref="ruleFormRef"
+      :model="ruleForm"
+      :rules="rules"
+      label-width="auto"
+      class="demo-ruleForm"
+      :size="formSize"
+      :inline="true"
+      status-icon
+    >
+      <el-row :gutter="24">
+        <el-col :span="9">
+          <el-form-item label="标题" prop="name">
+            <el-input v-model="ruleForm.name" clearable style="width: 400px" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="9">
+          <el-form-item label="发布机构" prop="region">
+            <el-cascader
+              clearable
+              style="width: 400px"
+              v-model="ruleForm.deptId"
+              :options="institutionList"
+              :props="tableProps"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row :gutter="24">
+        <el-col :span="9">
+          <el-form-item label="子机构是否发布" prop="resource">
+            <el-radio-group v-model="ruleForm.resource">
+              <el-radio value="是">是</el-radio>
+              <el-radio value="否">否</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+        <el-col :span="9">
+          <el-form-item label="是否强制查看" prop="resource">
+            <el-radio-group v-model="ruleForm.resource">
+              <el-radio value="是">是</el-radio>
+              <el-radio value="否">否</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <el-form-item label="消息内容" prop="desc">
+        <el-input
+          style="width: 400px"
+          v-model="ruleForm.desc"
+          type="textarea"
+        />
+      </el-form-item>
+      <el-row style="justify-content: center;">
+        <el-form-item>
+          <el-button @click="resetForm(ruleFormRef)">取消</el-button>
+
+          <el-button type="primary" @click="submitForm(ruleFormRef)">
+            保存
+          </el-button>
+        </el-form-item>
+      </el-row>
+    </el-form>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref, reactive, onMounted } from "vue";
+import type { ComponentSize, FormInstance, FormRules } from "element-plus";
+import api from "@/api";
+interface RuleForm {
+  name: string;
+  region: string;
+  count: string;
+  date1: string;
+  date2: string;
+  delivery: boolean;
+  location: string;
+  type: string[];
+  resource: string;
+  desc: string;
+}
+const tableProps = ref({
+  value: "id",
+  label: "name",
+  children: "children",
+  checkStrictly: true,
+});
+onMounted(() => {
+  getAllMemberList(); //机构列表
+});
+
+const formSize = ref<ComponentSize>("default");
+const ruleFormRef = ref<FormInstance>();
+const ruleForm = reactive<RuleForm>({
+  name: "",
+  region: "",
+  count: "",
+  date1: "",
+  date2: "",
+  delivery: false,
+  location: "",
+  type: [],
+  resource: "",
+  desc: "",
+});
+
+const rules = reactive<FormRules<RuleForm>>({
+  name: [
+    { required: true, message: "Please input Activity name", trigger: "blur" },
+    { min: 3, max: 5, message: "Length should be 3 to 5", trigger: "blur" },
+  ],
+  region: [
+    {
+      required: true,
+      message: "Please select Activity zone",
+      trigger: "change",
+    },
+  ],
+  count: [
+    {
+      required: true,
+      message: "Please select Activity count",
+      trigger: "change",
+    },
+  ],
+  date1: [
+    {
+      type: "date",
+      required: true,
+      message: "Please pick a date",
+      trigger: "change",
+    },
+  ],
+  date2: [
+    {
+      type: "date",
+      required: true,
+      message: "Please pick a time",
+      trigger: "change",
+    },
+  ],
+  location: [
+    {
+      required: true,
+      message: "Please select a location",
+      trigger: "change",
+    },
+  ],
+  type: [
+    {
+      type: "array",
+      required: true,
+      message: "Please select at least one activity type",
+      trigger: "change",
+    },
+  ],
+  resource: [
+    {
+      required: true,
+      message: "Please select activity resource",
+      trigger: "change",
+    },
+  ],
+  desc: [
+    { required: true, message: "Please input activity form", trigger: "blur" },
+  ],
+});
+
+const submitForm = async (formEl: FormInstance | undefined) => {
+  if (!formEl) return;
+  await formEl.validate((valid, fields) => {
+    if (valid) {
+      console.log("submit!");
+    } else {
+      console.log("error submit!", fields);
+    }
+  });
+};
+
+const resetForm = (formEl: FormInstance | undefined) => {
+  if (!formEl) return;
+  formEl.resetFields();
+};
+
+//机构列表
+const institutionList = ref([]);
+const getAllMemberList = () => {
+  api.institutionApi.institutionList({}).then((res: any) => {
+    if (res.code === 200) institutionList.value = res.data;
+  });
+  // pageInfo.pageSize=item.pageSize
+};
+</script>
+<style lang="scss" scoped>
+.message-main {
+  flex: 1;
+  width: 100%;
+  height: 100%;
+  background: #fff;
+  padding: 15px;
+  box-sizing: border-box;
+}
+</style>

+ 1 - 1
src/views/operationManagement/modules/allocation.vue

@@ -38,7 +38,7 @@
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted, defineEmits } from 'vue'
+import { ref, onMounted, defineEmits,watch } from 'vue'
 import api from '@/api'
 import { ElMessage } from 'element-plus'
 

+ 16 - 10
src/views/personnel/institutionManage.vue

@@ -250,13 +250,18 @@ function setDeptUser(item:any){
 //批量设置负责人
 
 function manySetDeptUser(){
-  
-  deptIdList.value=checkTableIdList.value
-  deptDialogVisible.value=true
+  if(checkTableIdList.value.length>0){
+    deptIdList.value=checkTableIdList.value
+    deptDialogVisible.value=true
+  }else{
+    ElMessage.warning("请选择机构后,再进行设置负责人")
+  }
+ 
 }
 
 function confirmCharge(){
   deptDialogVisible.value=false
+  getInstitutionList(); //机构列表
 }
 
 
@@ -338,7 +343,7 @@ const typeformatter = (row: any, column: any, cellValue: any) => {
 };
 const columns = [
   { prop: "name", label: "机构名称" },
-  { prop: "Phone", label: "人数" },
+  { prop: "userCount", label: "人数" },
   { prop: "comType", label: "机构类型", formatter: typeformatter },
   {
     prop: "comAttribute",
@@ -387,6 +392,7 @@ function selectChange(list:any){
 const isDisabledId = ref("");
 const addChild = (item: any) => {
   // form.id=item.id
+  console.log(item)
   form.parentId = item.id;
   isDisabledId.value = item.id;
   dialogVisible.value = true;
@@ -396,7 +402,7 @@ const addChild = (item: any) => {
   // pageInfo.pageSize=item.pageSize
 };
 const editor = (item: any) => {
-  console.log(item);
+  
   // form={...item}
   for (let key in item) {
     form[key] = item[key];
@@ -537,7 +543,7 @@ const getInstitutionList = () => {
 
     // }
     tableData.value = res.data;
-    console.log(tableData.value);
+   
   });
   // pageInfo.pageSize=item.pageSize
 };
@@ -561,7 +567,7 @@ const confirm = async (formEl: FormInstance | undefined) => {
     if (valid) {
       const obj = { ...form };
       delete obj.area;
-
+      console.log(obj)
       if (operationType.value == "add") {
         api.institutionApi
           .institutionAdd({
@@ -570,7 +576,7 @@ const confirm = async (formEl: FormInstance | undefined) => {
             province: form.area[0],
             city: form.area[1],
             area: form.area[2],
-            parentId:obj.parentId[obj.parentId.length-1]
+            parentId:typeof obj.parentId=='string' ? obj.parentId:obj.parentId[obj.parentId.length-1]
           })
           .then((res) => {
             if (res.code === 200) {
@@ -587,11 +593,11 @@ const confirm = async (formEl: FormInstance | undefined) => {
             province: form.area[0],
             city: form.area[1],
             area: form.area[2],
-            parentId:obj.parentId[obj.parentId.length-1]
+            parentId:typeof obj.parentId=='string' ? obj.parentId:obj.parentId[obj.parentId.length-1]
 
           })
           .then((res) => {
-           
+            
             if (res.code === 200) {
               ElMessage.success("操作成功");
               dialogVisible.value = false;

+ 16 - 4
src/views/personnel/memberManagement.vue

@@ -23,6 +23,7 @@
         :default-expand-all="isExpand"
         :filter-node-method="filterNode"
         :expand-on-click-node="false"
+        @node-click="treeClickTable"
         >
         <template #default="{ node, data }">
           <span class="custom-tree-node">
@@ -81,7 +82,7 @@
                 </el-dropdown-menu>
               </template>
             </el-dropdown>
-            <el-button type="primary" @click="manySetDeptUser()">
+            <el-button type="primary" :disabled="!deptItem.id" @click="manySetDeptUser()">
               设置负责人</el-button
             >
           </div>
@@ -163,12 +164,14 @@
       </template>
     </el-dialog>
     <setDept
+    
       :dialogVisible="deptDialogVisible"
       :dept-list="deptTreeData"
-      :dept-ids="deptIdList"
+      :dept-ids="[deptItem.id]"
       @close-dialog="confirmDialogInfo"
       :title="title"
       @cancel-dialog="deptDialogVisible=false"
+      
     ></setDept>
     <el-dialog
       v-model="changeDeptDialog"
@@ -297,6 +300,12 @@ const filterNode = (value: string, data: Tree) => {
   if (!value) return true;
   return data.name.includes(value);
 };
+
+function treeClickTable(node: any) {
+  deptItem.value=node
+  getUserList()
+
+}
 //全部展示机构树,或全部收起
 const isExpand=ref(false)
 function expandTree(){
@@ -420,11 +429,13 @@ const pageInfo =reactive( {
 const getList = (item: PageInfo) => {
   pageInfo.pageNum = item.pageNum;
   pageInfo.pageSize = item.pageSize;
+  getUserList()
 };
 
 const getUserList= () => {
   api.userApi.memberList({
-    ...pageInfo
+    ...pageInfo,
+    deptId:deptItem.value.id
   }).then((res:any)=>{
     
     if(res.code===200){
@@ -465,7 +476,7 @@ const operationMany = (item: any) => {
 };
 
 const append = (data: Tree) => {
-  console.log(data);
+  
   // const newChild = { id: id++, label: 'testtest', children: [] }
   if (!data.children) {
     data.children = [];
@@ -507,6 +518,7 @@ function changeDept(item:any) {
 //选择变更的机构
 const deptItem = ref({});
 function treeClick(node: any) {
+
   deptItem.value = node;
 }
 

+ 2 - 2
src/views/personnel/modules/addOperation.vue

@@ -81,7 +81,7 @@
               <el-col :span="12">
                 <el-form-item prop="identity" label="证件号">
                   <el-input
-                    v-model="operationForm.identity"
+                    v-model.trim="operationForm.identity"
                     placeholder="请填写证件号"
                   ></el-input>
                 </el-form-item>
@@ -821,7 +821,7 @@ const operationRules = ref<FormRules>({
   mobile: [
     { required: true, trigger: "blur", message: "请填写手机号" },
     {
-      pattern: /^1[34578][0-9]{9}$/,
+      pattern: /^1[23456789][0-9]{9}$/,
       message: "请填写正确的手机号",
       trigger: "blur",
     },

+ 956 - 0
src/views/representative/detail.vue

@@ -0,0 +1,956 @@
+<template>
+  <div class="message-info">
+    <div class="error"></div>
+    <div style="background-color: #fff; padding: 15px; box-sizing: border-box">
+      <el-row :gutter="24">
+        <el-col :span="20">
+          <div style="display: flex; align-items: center">
+            <div class="img-title">
+              {{ pinyin.getFullChars(operationForm.name).substring(0, 1) }}
+            </div>
+            <h4>{{ operationForm.name }}</h4>
+          </div>
+        </el-col>
+        <el-col :span="4" v-show="operationForm.status=='4'">
+          <el-button type="primary" @click="toExamine(operationForm, 'success')">审核通过</el-button>
+          
+            <el-button type="primary" @click="toExamine(operationForm, 'error')"> 审核驳回 </el-button>
+           
+          
+        </el-col>
+      </el-row>
+      <el-row :gutter="24">
+        <el-col :span="18">
+          <el-descriptions title="" class="info-list" :column="2">
+            <el-descriptions-item label="工号:">{{
+              operationForm.userId
+            }}</el-descriptions-item>
+            <el-descriptions-item label="手机号:">{{
+              operationForm.mobile
+            }}</el-descriptions-item>
+            <el-descriptions-item label="所在机构:">
+              {{ operationForm.deptName }}
+            </el-descriptions-item>
+            <el-descriptions-item label="角色:">
+              {{ operationForm.deptName }}
+            </el-descriptions-item>
+            <el-descriptions-item label="创建人:">
+              {{ operationForm.createBy }}
+            </el-descriptions-item>
+            <el-descriptions-item label="创建时间:">
+              {{ operationForm.createTime }}
+            </el-descriptions-item>
+          </el-descriptions>
+        </el-col>
+        <el-col :span="6">
+          <h2>
+            {{
+              statusList
+                .map((item) => {
+                  return item.value == operationForm.status ? item.label : "";
+                })
+                .join("")
+            }}
+          </h2>
+          <p>状态</p>
+        </el-col>
+      </el-row>
+    </div>
+    <el-form
+      :model="operationForm"
+      ref="OperationFormRef"
+      label-width="120"
+      style="background-color: #fff; padding: 20px; box-sizing: border-box"
+    >
+      <el-tabs v-model="activeName" class="demo-tabs">
+        <el-tab-pane label="基本信息" name="first">
+          <el-descriptions title="个人信息">
+            <el-descriptions-item>
+              <template #default>
+                <el-row :gutter="24">
+                  <el-col :span="12">
+                    <el-form-item prop="name" label="姓名:">
+                      {{ operationForm.name }}
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="12">
+                    <el-form-item prop="mobile" label="手机号:">
+                      {{ operationForm.mobile }}
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row :gutter="24">
+                  <el-col :span="12">
+                    <el-form-item prop="deptId" label="所属机构:">
+                      {{ operationForm.deptName || "--" }}
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="12">
+                    <el-form-item prop="identity" label="证件号:">
+                      {{ operationForm.identity }}
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row :gutter="24">
+                  <el-col :span="12">
+                    <el-form-item
+                      prop="identityTimeStart"
+                      label="证件有效期始:"
+                    >
+                      {{ operationForm.identityTimeStart }}
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="12">
+                    <el-form-item prop="identityTimeEnd" label="证件有效期止:">
+                      {{ operationForm.identityTimeEnd }}
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+
+                <el-row :gutter="24">
+                  <el-col :span="12">
+                    <el-form-item prop="sex" label="性别:">
+                      {{
+                        genderList
+                          .map((item) => {
+                            return item.value == operationForm.sex
+                              ? item.label
+                              : "";
+                          })
+                          .join("")
+                      }}
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="12">
+                    <el-form-item prop="born" label="出生日期:">
+                      {{ operationForm.birthday }}
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row :gutter="24">
+                  <el-col :span="12">
+                    <el-form-item prop="type" label="民族:">
+                      {{
+                        nation
+                          .map((item) => {
+                            return item.value == operationForm.nations
+                              ? item.label
+                              : "";
+                          })
+                          .join("")
+                      }}
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="12">
+                    <el-form-item prop="team" label="户籍:">
+                      {{ operationForm.koseki }}
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row :gutter="24">
+                  <el-col :span="12">
+                    <el-form-item prop="type" label="婚姻状况:">
+                      {{
+                        marriage
+                          .map((item) => {
+                            return item.value == operationForm.maritalStatus
+                              ? item.label
+                              : "";
+                          })
+                          .join("")
+                      }}
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="12">
+                    <el-form-item prop="team" label="政治面貌:">
+                      {{
+                        political_status
+                          .map((item) => {
+                            return item.value == operationForm.politicsStatus
+                              ? item.label
+                              : "";
+                          })
+                          .join("")
+                      }}
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row :gutter="24">
+                  <el-col :span="12">
+                    <el-form-item prop="type" label="健康状况:">
+                      {{
+                        health_status
+                          .map((item) => {
+                            return item.value == operationForm.health
+                              ? item.label
+                              : "";
+                          })
+                          .join("")
+                      }}
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="12">
+                    <el-form-item prop="team" label="居住地区:">
+                      <!-- <el-select
+                    v-model="operationForm.address"
+                    placeholder="请选择居住地区"
+                  >
+                    <el-option key="1" value="团队1"></el-option>
+                  </el-select> -->
+                      {{ operationForm.region || "--" }}
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row :gutter="24">
+                  <el-col :span="12">
+                    <el-form-item prop="team" label="详细地址:">
+                      {{ operationForm.liveAddress }}
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="12">
+                    <el-form-item prop="team" label="邮政编码:">
+                      {{ operationForm.postalCode }}
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+              </template>
+            </el-descriptions-item>
+          </el-descriptions>
+
+          <el-descriptions title="学历信息" v-show="recordShow">
+            <el-descriptions-item>
+              <template #default>
+                <el-row :gutter="24">
+                  <el-col :span="12">
+                    <el-form-item prop="sex" label="学历:">
+                      {{
+                        educational
+                          .map((item) => {
+                            return item.value == operationForm.education
+                              ? item.label
+                              : "";
+                          })
+                          .join("")
+                      }}
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="12">
+                    <el-form-item prop="born" label="毕业时间:">
+                      {{ operationForm.graduationTime }}
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row :gutter="24">
+                  <el-col :span="12">
+                    <el-form-item prop="type" label="毕业院校:">
+                      {{ operationForm.school }}
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="12">
+                    <el-form-item prop="team" label="是否计算机专业:">
+                      {{ operationForm.isComputer }}
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+              </template>
+            </el-descriptions-item>
+          </el-descriptions>
+          <el-descriptions title="紧急联系人信息" v-show="recordShow">
+            <el-descriptions-item>
+              <template #default>
+                <el-row :gutter="24">
+                  <el-col :span="12">
+                    <el-form-item prop="team" label="姓名:">
+                      {{ operationForm.emergencyContactName }}
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="12">
+                    <el-form-item prop="team" label="手机号:">
+                      {{ operationForm.emergencyContactTel }}
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+              </template>
+            </el-descriptions-item>
+          </el-descriptions>
+          <el-descriptions title="工资信息" v-show="recordShow">
+            <el-descriptions-item>
+              <template #default>
+                <el-row :gutter="24">
+                  <el-col :span="12">
+                    <el-form-item prop="team" label="工资:">
+                      {{ operationForm.salary }}
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="12">
+                    <el-form-item prop="team" label="工资等级:">
+                      {{ operationForm.salaryLevel }}
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row :gutter="24">
+                  <el-col :span="12">
+                    <el-form-item prop="team" label="银行卡号:">
+                      {{ operationForm.bankCardId }}
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="12">
+                    <el-form-item prop="team" label="开户行:">
+                      {{ operationForm.bankName }}
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+              </template>
+            </el-descriptions-item>
+          </el-descriptions>
+        </el-tab-pane>
+        <el-tab-pane label="资料附件" name="second">
+          <el-descriptions v-show="recordShow" title="资料附件">
+            <el-descriptions-item>
+              <template #default>
+                <el-form-item
+                  prop=""
+                  label="身份证(人像面)"
+                  label-width="150"
+                  label-position="left"
+                >
+                  <!-- <el-upload
+                    :auto-upload="false"
+                    v-if="!IDCardFront"
+                    action="#"
+                    :show-file-list="false"
+                    accept=".png, .jpg, .jpeg"
+                    @change="uploadImage($event, 1)"
+                  >
+                    <el-button link type="primary">上传</el-button>
+                  </el-upload> -->
+                  <div class="fileInfo" >
+                    <div class="fileName">{{ IDCardFrontName }}</div>
+                    <div class="fileBtn">
+                      <!-- <el-upload
+                        :auto-upload="false"
+                        action="#"
+                        :show-file-list="false"
+                        accept=".png, .jpg, .jpeg"
+                        @change="uploadImage($event, 1)"
+                        style="display: flex; align-items: center"
+                      >
+                        <el-icon class="btn-icon"><Upload /></el-icon>
+                      </el-upload> -->
+                      <el-icon class="btn-icon" @click="imageView(1)"
+                        ><View
+                      /></el-icon>
+                      <el-icon class="btn-icon"><Download /></el-icon>
+                      <!-- <el-icon class="btn-icon"><Delete /></el-icon> -->
+                    </div>
+                  </div>
+                </el-form-item>
+                <el-form-item
+                  prop=""
+                  label="身份证(国徽面)"
+                  label-width="150"
+                  label-position="left"
+                >
+                  <!-- <el-upload
+                    :auto-upload="false"
+                    v-if="!IDCardBack"
+                    action="#"
+                    :show-file-list="false"
+                    accept=".png, .jpg, .jpeg"
+                    @change="uploadImage($event, 2)"
+                  >
+                    <el-button link type="primary">上传</el-button>
+                  </el-upload> -->
+                  <div class="fileInfo" >
+                    <div class="fileName">{{ IDCardBackName }}</div>
+                    <div class="fileBtn">
+                      <!-- <el-upload
+                        :auto-upload="false"
+                        action="#"
+                        :show-file-list="false"
+                        accept=".png, .jpg, .jpeg"
+                        @change="uploadImage($event, 2)"
+                        style="display: flex; align-items: center"
+                      >
+                        <el-icon class="btn-icon"><Upload /></el-icon>
+                      </el-upload> -->
+                      <el-icon class="btn-icon" @click="imageView(2)"
+                        ><View
+                      /></el-icon>
+                      <el-icon class="btn-icon"><Download /></el-icon>
+                      <!-- <el-icon class="btn-icon"><Delete /></el-icon> -->
+                    </div>
+                  </div>
+                </el-form-item>
+                <el-form-item
+                  prop=""
+                  label="银行卡"
+                  label-width="150"
+                  label-position="left"
+                >
+                  <!-- <el-upload
+                    :auto-upload="false"
+                    v-if="!bankSize"
+                    action="#"
+                    :show-file-list="false"
+                    accept=".png, .jpg, .jpeg"
+                    @change="uploadImage($event, 3)"
+                  >
+                    <el-button link type="primary">上传</el-button>
+                  </el-upload> -->
+                  <div class="fileInfo" >
+                    <div class="fileName">{{ bankName }}</div>
+                    <div class="fileBtn">
+                      <!-- <el-upload
+                        :auto-upload="false"
+                        action="#"
+                        :show-file-list="false"
+                        accept=".png, .jpg, .jpeg"
+                        @change="uploadImage($event, 3)"
+                        style="display: flex; align-items: center"
+                      >
+                        <el-icon class="btn-icon"><Upload /></el-icon>
+                      </el-upload> -->
+                      <el-icon class="btn-icon" @click="imageView(3)"
+                        ><View
+                      /></el-icon>
+                      <el-icon class="btn-icon"><Download /></el-icon>
+                      <!-- <el-icon class="btn-icon"><Delete /></el-icon> -->
+                    </div>
+                  </div>
+                </el-form-item>
+                <el-form-item
+                  prop=""
+                  label="劳动合同"
+                  label-width="150"
+                  label-position="left"
+                >
+                  <!-- <el-upload
+                    :auto-upload="false"
+                    v-if="!contract"
+                    action="#"
+                    :show-file-list="false"
+                    accept=".png, .jpg, .jpeg"
+                    @change="uploadImage($event, 4)"
+                  >
+                    <el-button link type="primary">上传</el-button>
+                  </el-upload> -->
+                  <div class="fileInfo" >
+                    <div class="fileName">{{ contractName }}</div>
+                    <div class="fileBtn">
+                      <!-- <el-upload
+                        :auto-upload="false"
+                        action="#"
+                        :show-file-list="false"
+                        accept=".png, .jpg, .jpeg"
+                        @change="uploadImage($event, 4)"
+                        style="display: flex; align-items: center"
+                      >
+                        <el-icon class="btn-icon"><Upload /></el-icon>
+                      </el-upload> -->
+                      <el-icon class="btn-icon" @click="imageView(4)"
+                        ><View
+                      /></el-icon>
+                      <el-icon class="btn-icon"><Download /></el-icon>
+                      <!-- <el-icon class="btn-icon"><Delete /></el-icon> -->
+                    </div>
+                  </div>
+                </el-form-item>
+                <el-form-item
+                  prop=""
+                  label="应聘表"
+                  label-width="150"
+                  label-position="left"
+                >
+                  <!-- <el-upload
+                    :auto-upload="false"
+                    v-if="!applicant"
+                    action="#"
+                    :show-file-list="false"
+                    accept=".png, .jpg, .jpeg"
+                    @change="uploadImage($event, 5)"
+                  >
+                    <el-button link type="primary">上传</el-button>
+                  </el-upload> -->
+                  <div class="fileInfo" >
+                    <div class="fileName">{{ applicantName }}</div>
+                    <div class="fileBtn">
+                      <!-- <el-upload
+                        :auto-upload="false"
+                        action="#"
+                        :show-file-list="false"
+                        accept=".png, .jpg, .jpeg"
+                        @change="uploadImage($event, 5)"
+                        style="display: flex; align-items: center"
+                      >
+                        <el-icon class="btn-icon"><Upload /></el-icon>
+                      </el-upload> -->
+                      <el-icon class="btn-icon" @click="imageView(5)"
+                        ><View
+                      /></el-icon>
+                      <el-icon class="btn-icon"><Download /></el-icon>
+                      <!-- <el-icon class="btn-icon"><Delete /></el-icon> -->
+                    </div>
+                  </div>
+                </el-form-item>
+                <el-form-item
+                  prop=""
+                  label="定薪表"
+                  label-width="150"
+                  label-position="left"
+                >
+                  <!-- <el-upload
+                    :auto-upload="false"
+                    v-if="!decidePay"
+                    action="#"
+                    :show-file-list="false"
+                    accept=".png, .jpg, .jpeg"
+                    @change="uploadImage($event, 6)"
+                  >
+                    <el-button link type="primary">上传</el-button>
+                  </el-upload> -->
+                  <div class="fileInfo" >
+                    <div class="fileName">{{ decidePayName }}</div>
+                    <div class="fileBtn">
+                      <!-- <el-upload
+                        :auto-upload="false"
+                        action="#"
+                        :show-file-list="false"
+                        accept=".png, .jpg, .jpeg"
+                        @change="uploadImage($event, 6)"
+                        style="display: flex; align-items: center"
+                      >
+                        <el-icon class="btn-icon"><Upload /></el-icon>
+                      </el-upload> -->
+                      <el-icon class="btn-icon" @click="imageView(6)"
+                        ><View
+                      /></el-icon>
+                      <el-icon class="btn-icon"><Download /></el-icon>
+                      <!-- <el-icon class="btn-icon"><Delete /></el-icon> -->
+                    </div>
+                  </div>
+                </el-form-item>
+                <el-form-item
+                  prop=""
+                  label="离职表"
+                  label-width="150"
+                  label-position="left"
+                >
+                  <!-- <el-upload
+                    :auto-upload="false"
+                    v-if="!dimission"
+                    action="#"
+                    :show-file-list="false"
+                    accept=".png, .jpg, .jpeg"
+                    @change="uploadImage($event, 7)"
+                  >
+                    <el-button link type="primary">上传</el-button>
+                  </el-upload> -->
+                  <div class="fileInfo" >
+                    <div class="fileName">{{ dimissionName }}</div>
+                    <div class="fileBtn">
+                      <!-- <el-upload
+                        :auto-upload="false"
+                        action="#"
+                        :show-file-list="false"
+                        accept=".png, .jpg, .jpeg"
+                        @change="uploadImage($event, 7)"
+                        style="display: flex; align-items: center"
+                      >
+                        <el-icon class="btn-icon"><Upload /></el-icon>
+                      </el-upload> -->
+                      <el-icon class="btn-icon" @click="imageView(7)"
+                        ><View
+                      /></el-icon>
+                      <el-icon class="btn-icon"><Download /></el-icon>
+                      <!-- <el-icon class="btn-icon"><Delete /></el-icon> -->
+                    </div>
+                  </div>
+                </el-form-item>
+              </template>
+            </el-descriptions-item>
+          </el-descriptions>
+        </el-tab-pane>
+      </el-tabs>
+
+      <!-- <div style="display: flex; justify-content: flex-end">
+        <el-button @click="onSubmit(0)">取消</el-button>
+        <el-button type="primary" @click="onSubmit(OperationFormRef, 1)"
+          >确定</el-button
+        >
+      </div> -->
+    </el-form>
+    <div class="image-view" v-if="imageShow" @click="imageShow = false">
+      <img :src="imageUrl" />
+    </div>
+    <el-dialog v-model="dialogVisible" title="审核不通过" width="500" draggable>
+      <el-input
+        type="textarea"
+        placeholder="请输入审核不通过原因"
+        v-model="textValue"
+      />
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="cancel()">取 消</el-button>
+          <el-button type="primary" @click="confirm()"> 保 存 </el-button>
+        </div>
+      </template>
+    </el-dialog>
+    
+  
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref, defineEmits, onMounted, watch } from "vue";
+import { memberType } from "@/api/modules/user";
+import type { FormRules, FormInstance, ElTree } from "element-plus";
+import api from "@/api";
+import { Search } from "@element-plus/icons-vue";
+import { ElMessage, ElMessageBox } from "element-plus";
+import { getDictItems } from "@/api/dict";
+import { useRoute } from "vue-router";
+import pinyin from "js-pinyin";
+import { useRouter } from "vue-router";
+
+interface dictType {
+  value: string;
+  id: string;
+  label: string;
+
+  [property: string]: any;
+}
+
+interface institutionData {
+  name: string;
+  system: string;
+}
+const info = ref<institutionData>({
+  name: "",
+  system: "",
+});
+//转移资源
+const dialogVisible = ref(false);
+
+//选择交接人
+
+const route = useRoute();
+
+const activeName = ref("first");
+const statusList = ref<dictType[]>([]);
+onMounted(async () => {
+  genderList.value = await getDictItems({ dictCode: "gender" });
+  nation.value = await getDictItems({ dictCode: "nation" });
+  marriage.value = await getDictItems({ dictCode: "marriage" });
+  political_status.value = await getDictItems({ dictCode: "political_status" });
+  health_status.value = await getDictItems({ dictCode: "health_status" });
+  educational.value = await getDictItems({ dictCode: "educational" });
+  statusList.value = await getDictItems({ dictCode: "person_status" });
+  getAreaList(); //省市区级联数据
+  api.institutionApi.institutionList(info.value).then((res) => {
+    tableData.value = [...res.data];
+  });
+  api.userApi
+    .getUserInfo({
+      id: route.query.id || "",
+    })
+    .then((res: any) => {
+      console.log(res);
+      if (res.code === 200) {
+        operationForm.value = res.data;
+      }
+    });
+});
+const areaOptins = ref([]);
+
+const getAreaList = () => {
+  api.areaApi.areaList({}).then((res) => {
+    areaOptins.value = res.data;
+  });
+};
+//性别字典
+const genderList = ref<dictType[]>([]);
+//民族
+const nation = ref<dictType[]>([]);
+//婚姻状况
+const marriage = ref<dictType[]>([]);
+//政治面貌
+const political_status = ref<dictType[]>([]);
+//健康状况
+const health_status = ref<dictType[]>([]);
+//学历
+const educational = ref<dictType[]>([]);
+
+interface OperationFormProps extends memberType {
+  deptId: string;
+  leaderNumber: string;
+  referrerNumber: string;
+  address?: [];
+  [key: string]: any;
+}
+// console.log(memberType,5555)
+
+let emits = defineEmits(["closeDialog"]);
+
+const OperationFormRef = ref<FormInstance>();
+// 添加/编辑业务员表单
+let operationForm = ref<OperationFormProps>({
+  deptId: "",
+  name: "",
+  mobile: "",
+  identity: "",
+  identityTimeStart: "",
+  identityTimeEnd: "",
+  leaderId: "",
+  leaderNumber: "",
+  referrerId: "",
+  referrerNumber: "",
+
+  sex: "",
+  birthday: "",
+  nations: "",
+  koseki: "",
+  maritalStatus: "",
+  politicsStatus: "",
+  health: "",
+  province: "",
+  city: "",
+  district: "",
+  address: [],
+  liveAddress: "",
+  postalCode: "",
+  education: "",
+  graduationTime: "",
+  school: "",
+  isComputer: "",
+  emergencyContactName: "",
+  emergencyContactTel: "",
+  salary: "",
+  salaryLevel: "",
+  bankCardId: "",
+  bankName: "",
+});
+
+ 
+// 身份证人像面
+let IDCardFrontName = ref("");
+let IDCardFront = ref("");
+let sfz1 = ref("");
+// 身份证国徽面
+let IDCardBackName = ref("");
+let IDCardBack = ref("");
+let sfz2 = ref("");
+// 银行卡
+let bankName = ref("");
+let bankSize = ref("");
+let bankCard = ref("");
+// 劳务合同
+let contractName = ref("");
+let contract = ref("");
+let contractId = ref("");
+// 应聘表
+let applicantName = ref("");
+let applicant = ref("");
+let applicantId = ref("");
+// 定薪表
+let decidePayName = ref("");
+let decidePay = ref("");
+let salaryTable = ref("");
+// 离职表
+let dimissionName = ref("");
+let dimission = ref("");
+let leaveTable = ref("");
+// 图片预览地址
+let imageShow = ref(false);
+let imageUrl = ref("");
+
+//机构列表
+type tableType = {
+  id: string;
+  name: string;
+};
+const tableData = ref<tableType[]>([]);
+
+
+const router = useRouter();
+const userInfoId=ref('')
+const toExamine = (item: any, type: string) => {
+  if (type == "success") {
+    ElMessageBox.confirm(`确定审核通过${item.name}账号吗?`, "审核通过", {
+      confirmButtonText: "确认",
+      cancelButtonText: "取消",
+      type: "warning",
+      center: true,
+    })
+      .then(() => {
+        api.representativeApi
+          .salesmanAuthSuccess({
+            userInfoId: item.id,
+          })
+          .then((res: any) => {
+            if (res.code == 200) {
+              ElMessage.success("操作成功");
+              
+            } else {
+              ElMessage.error(res.msg);
+              
+            }
+          });
+      })
+      .catch(() => {
+        ElMessage.warning("用户取消操作");
+      });
+  } else {
+    dialogVisible.value = true;
+    userInfoId.value = item.id;
+    // ElMessageBox.confirm(`<textarea placeholder='请输入审核不通过原因' oninput='handleText()' style="width:300px"></textarea>`, "审核不通过", {
+    //   confirmButtonText: "确认",
+    //   cancelButtonText: "取消",
+    //   dangerouslyUseHTMLString: true ,
+    //   type: "warning",
+    //   center: true,
+
+    // })
+    //   .then(() => {
+    //     api.representativeApi.salesmanAuthFailed({}).then((res: any) => {
+    //       if (res.code == 200) {
+    //         ElMessage.success("操作成功");
+    //         salesmanAuth(); //业务员列表
+    //       } else {
+    //         ElMessage.error(res.msg);
+    //         // salesmanAuth(); //业务员列表
+    //       }
+    //     });
+    //   })
+    //   .catch(() => {
+    //     ElMessage.warning("用户取消操作");
+    //   });
+  }
+};
+
+function cancel() {
+  ElMessage.warning("用户取消操作");
+  dialogVisible.value = false;
+}
+const textValue = ref("");
+//审核不通过
+function confirm() {
+  api.representativeApi
+    .salesmanAuthFailed({
+      userInfoId: userInfoId.value,
+      approvalOpinion: textValue.value,
+    })
+    .then((res: any) => {
+      if (res.code == 200) {
+        ElMessage.success("操作成功");
+        
+        dialogVisible.value = false;
+      }
+    });
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+//变更机构弹框
+interface Tree {
+  [key: string]: any;
+}
+const filterText = ref("");
+const treeRef = ref<InstanceType<typeof ElTree>>();
+
+watch(filterText, (val) => {
+  treeRef.value!.filter(val);
+});
+
+
+
+
+
+
+</script>
+
+<style scoped lang="scss">
+.message-info {
+  // background: #fff;
+  padding: 15px;
+  box-sizing: border-box;
+  h4 {
+    margin: 0;
+  }
+}
+.img-title {
+  border-radius: 50%;
+  width: 30px;
+  height: 30px;
+  color: #fff;
+  background: #00a0f4;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin-right: 20px;
+}
+.fileInfo {
+  display: flex;
+  align-items: center;
+  justify-content: flex-start;
+  padding: 2px 20px;
+  border-radius: 5px;
+  margin: 0 10px;
+  &:hover {
+    background: #ccc;
+  }
+  .fileName {
+    width: 200px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+  .fileBtn {
+    display: flex;
+    align-items: center;
+    .btn-icon {
+      margin: 0 10px;
+      font-size: 16px;
+      cursor: pointer;
+      &:hover {
+        color: #00a0f4;
+      }
+    }
+  }
+}
+.image-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background: rgba(0, 0, 0, 0.6);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  z-index: 9999;
+  img {
+    width: 800px;
+    height: 800px;
+    border-radius: 5px;
+  }
+}
+.custom-tree-node {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 14px;
+  padding-right: 8px;
+}
+</style>

+ 529 - 0
src/views/representative/member.vue

@@ -0,0 +1,529 @@
+<template>
+  <div class="institution">
+    <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
+      <el-tab-pane label="待审核" name="hold">
+        <div class="institution-main">
+          <el-form label-position="left" label-width="auto">
+            <el-row :gutter="24">
+              <el-col :span="6">
+                <el-form-item label="成员信息">
+                  <el-input
+                    v-model="formAccessibility.firstName"
+                    placeholder="输入成员信息查找"
+                    :prefix-icon="Search"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="归属机构">
+                  
+                  <el-cascader
+                    clearable
+                    style="width: 100%"
+                    v-model="info.deptId"
+                    :options="institutionList"
+                    :props="tableProps"
+                    
+                  />
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="4">
+                <el-form-item label="">
+                  <el-button type="primary">查询</el-button>
+                  <el-button type="primary" plain @click="reset"
+                    >重置</el-button
+                  >
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+
+          <Table
+            :tableData="tableData"
+            :columns="columns"
+            :showIndex="false"
+            :showSelect="true"
+            :pageInfo="pageInfo"
+            @getList="getList"
+            :treeProps="{ children: 'children', hasChildren: 'hasChildren' }"
+            @select-all-change="selectAllChange"
+            @select-change="selectChange"
+          >
+            <template v-slot:table-title-btn>
+              <div>
+                <!-- <el-button type="primary" @click="add(ruleFormRef)">
+              <el-icon><Plus /></el-icon>添加机构</el-button
+            > -->
+                <el-dropdown placement="bottom-start">
+                  <el-button>
+                    批量操作<el-icon class="el-icon--right">
+                      <arrow-down />
+                    </el-icon>
+                  </el-button>
+                  <template #dropdown>
+                    <el-dropdown-menu>
+                      <el-dropdown-item>审核</el-dropdown-item>
+                      <!-- <el-dropdown-item v-on:click="manySetDeptUser()">设置负责人</el-dropdown-item> -->
+                    </el-dropdown-menu>
+                  </template>
+                </el-dropdown>
+              </div>
+            </template>
+            <template v-slot:operation="scope">
+              <el-button
+                type="primary"
+                link
+                @click="toExamine(scope.operationData.row, 'success')"
+              >
+                审核通过
+              </el-button>
+              <el-button
+                type="primary"
+                link
+                @click="toExamine(scope.operationData.row, 'error')"
+              >
+                审核不通过
+              </el-button>
+              <el-button
+                type="primary"
+                link
+                @click="editor(scope.operationData.row)"
+              >
+                详情
+              </el-button>
+            </template>
+            <template v-slot:search="scope">
+              {{ scope.slotData.label }}
+            </template>
+          </Table>
+        </div>
+      </el-tab-pane>
+      <el-tab-pane label="审核不通过" name="pass">
+        <div class="institution-main">
+          <el-form label-position="left" label-width="auto">
+            <el-row :gutter="24">
+              <el-col :span="6">
+                <el-form-item label="成员信息">
+                  <el-input
+                    v-model="formAccessibility.firstName"
+                    placeholder="输入成员信息查找"
+                    :prefix-icon="Search"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="归属机构">
+                  <el-cascader
+                    clearable
+                    style="width: 100%"
+                    v-model="info.deptId"
+                    :options="institutionList"
+                    :props="tableProps"
+                    
+                  />
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="4">
+                <el-form-item label="">
+                  <el-button type="primary">查询</el-button>
+                  <el-button type="primary" plain @click="reset"
+                    >重置</el-button
+                  >
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+
+          <Table
+            :tableData="tableData"
+            :columns="columns"
+            :showIndex="false"
+            :showSelect="true"
+            :pageInfo="pageInfo"
+            @getList="getList"
+            :treeProps="{ children: 'children', hasChildren: 'hasChildren' }"
+            @select-all-change="selectAllChange"
+            @select-change="selectChange"
+          >
+            <template v-slot:table-title-btn>
+              <div>
+                <!-- <el-button type="primary" @click="add(ruleFormRef)">
+              <el-icon><Plus /></el-icon>添加机构</el-button
+            > -->
+                <el-dropdown placement="bottom-start">
+                  <el-button>
+                    批量操作<el-icon class="el-icon--right">
+                      <arrow-down />
+                    </el-icon>
+                  </el-button>
+                  <template #dropdown>
+                    <el-dropdown-menu>
+                      <el-dropdown-item>审核</el-dropdown-item>
+                      <!-- <el-dropdown-item v-on:click="manySetDeptUser()">设置负责人</el-dropdown-item> -->
+                    </el-dropdown-menu>
+                  </template>
+                </el-dropdown>
+              </div>
+            </template>
+            <template v-slot:operation="scope">
+              <el-button
+                type="primary"
+                link
+                @click="editor(scope.operationData.row)"
+              >
+                详情
+              </el-button>
+            </template>
+            <template v-slot:search="scope">
+              {{ scope.slotData.label }}
+            </template>
+          </Table>
+        </div>
+      </el-tab-pane>
+    </el-tabs>
+
+    <el-dialog v-model="dialogVisible" title="审核不通过" width="500" draggable>
+      <el-input
+        type="textarea"
+        placeholder="请输入审核不通过原因"
+        v-model="textValue"
+      />
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="cancel()">取 消</el-button>
+          <el-button type="primary" @click="confirm()"> 保 存 </el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref, reactive, watch, onMounted } from "vue";
+import type {
+  ComponentSize,
+  FormInstance,
+  FormRules,
+  TabsPaneContext,
+} from "element-plus";
+import { Plus, Search } from "@element-plus/icons-vue";
+import { useRouter } from "vue-router";
+import type Node from "element-plus/es/components/tree/src/model/node";
+// import universalTable from "../"
+import { ElMessage, ElMessageBox, ElPopconfirm, ElTree } from "element-plus";
+import api from "@/api";
+import { h } from "vue";
+import setDept from "@/components/DialogSetDeptLeader/index.vue";
+interface Tree {
+  [key: string]: any;
+}
+
+const filterText = ref("");
+const treeRef = ref<InstanceType<typeof ElTree>>();
+const activeName = ref("hold");
+const defaultProps = {
+  children: "children",
+  label: "label",
+};
+
+//批量设置负责人
+
+watch(filterText, (val) => {
+  treeRef.value!.filter(val);
+});
+
+const formAccessibility = reactive({
+  fullName: "",
+  firstName: "",
+  lastName: "",
+  phone: "",
+});
+const ruleFormRef = ref<FormInstance>();
+let form = reactive({
+  name: "", //机构名称
+  parentId: "", //上级机构id
+  comType: "", //机构类型
+  exhibitionScope: "", //展业范围
+  address: "", //地址
+  leaderId: "", //负责人id
+  area: [], //地区
+});
+
+interface PageInfo {
+  pageNum: number;
+  pageSize: number;
+  sizes: number[];
+  total: number;
+  show: boolean;
+}
+
+const dialogVisible = ref(false);
+
+// import Select from "@/components/select/selectMain.vue";
+// import TestTable from "@/components/Table/index.vue";
+//业务员列表
+type tableType = {
+  id: string;
+  name: string;
+};
+const tableData = ref<tableType[]>([]);
+const tableProps = ref({
+  value: "id",
+  label: "name",
+  children: "children",
+  checkStrictly: true,
+});
+const typeformatter = (row: any, column: any, cellValue: any) => {
+  let comType = "";
+  comTypeList.value.map((ele) => {
+    if (ele.value == row.comType) {
+      comType = ele.label;
+    }
+  });
+
+  return () => h("div", {}, comType);
+};
+const columns = [
+  { prop: "name", label: "姓名" },
+  { prop: "mobile", label: "手机号" },
+  // { prop: "id", label: "工号" },
+  { prop: "deptName", label: "归属机构" },
+  {
+    prop: "username",
+    label: "角色",
+  },
+  { prop: "createTime", label: "创建时间" },
+  { prop: "createBy", label: "创建人" },
+];
+
+const pageInfo = {
+  pageNum: 1,
+  pageSize: 10,
+  sizes: [10, 20, 30, 40, 50],
+  total: 0,
+  show: true,
+};
+//分页列表功能
+const getList = (item: PageInfo) => {
+  pageInfo.pageNum = item.pageNum;
+  pageInfo.pageSize = item.pageSize;
+  salesmanAuth();
+};
+
+const checkTableIdList = ref([]);
+//表格选择事件
+function selectAllChange(list: any) {
+  checkTableIdList.value = list;
+}
+
+function selectChange(list: any) {
+  checkTableIdList.value = list;
+}
+//审核
+const userInfoId = ref("");
+const toExamine = (item: any, type: string) => {
+  if (type == "success") {
+    ElMessageBox.confirm(`确定审核通过${item.name}账号吗?`, "审核通过", {
+      confirmButtonText: "确认",
+      cancelButtonText: "取消",
+      type: "warning",
+      center: true,
+    })
+      .then(() => {
+        api.representativeApi
+          .salesmanAuthSuccess({
+            userInfoId: item.id,
+          })
+          .then((res: any) => {
+            if (res.code == 200) {
+              ElMessage.success("操作成功");
+              salesmanAuth(); //业务员列表
+            } else {
+              ElMessage.error(res.msg);
+              // salesmanAuth(); //业务员列表
+            }
+          });
+      })
+      .catch(() => {
+        ElMessage.warning("用户取消操作");
+      });
+  } else {
+    dialogVisible.value = true;
+    userInfoId.value = item.id;
+    // ElMessageBox.confirm(`<textarea placeholder='请输入审核不通过原因' oninput='handleText()' style="width:300px"></textarea>`, "审核不通过", {
+    //   confirmButtonText: "确认",
+    //   cancelButtonText: "取消",
+    //   dangerouslyUseHTMLString: true ,
+    //   type: "warning",
+    //   center: true,
+
+    // })
+    //   .then(() => {
+    //     api.representativeApi.salesmanAuthFailed({}).then((res: any) => {
+    //       if (res.code == 200) {
+    //         ElMessage.success("操作成功");
+    //         salesmanAuth(); //业务员列表
+    //       } else {
+    //         ElMessage.error(res.msg);
+    //         // salesmanAuth(); //业务员列表
+    //       }
+    //     });
+    //   })
+    //   .catch(() => {
+    //     ElMessage.warning("用户取消操作");
+    //   });
+  }
+};
+function cancel() {
+  ElMessage.warning("用户取消操作");
+  dialogVisible.value = false;
+}
+const textValue = ref("");
+//审核不通过
+function confirm() {
+  api.representativeApi
+    .salesmanAuthFailed({
+      userInfoId: userInfoId.value,
+      approvalOpinion: textValue.value,
+    })
+    .then((res: any) => {
+      if (res.code == 200) {
+        ElMessage.success("操作成功");
+        salesmanAuth(); //业务员列表
+        dialogVisible.value = false;
+      }
+    });
+}
+
+interface institutionData {
+  typeAttr: string;
+  deptId: string;
+  status: number;
+}
+const info = ref<institutionData>({
+  typeAttr: "2",
+  deptId: "",
+  status: 4,
+});
+
+const router = useRouter();
+
+//详情
+const editor = (item: any) => {
+  console.log(item);
+  router.push({
+    path: "/representative/member/memberMessage",
+    query: {
+      id: item.userId,
+    },
+  });
+  // pageInfo.pageNum=item.pageNum
+  // pageInfo.pageSize=item.pageSize
+};
+
+//获取机构类型字典值
+type comType = {
+  value: string;
+  label: string;
+};
+let comTypeList = ref<comType[]>([]);
+
+const handleClick = (tab: TabsPaneContext, event: Event) => {
+  // console.log(tab.props.name);
+  if (tab.props.name == "pass") {
+    info.value.status = 5;
+    salesmanAuth();
+  } else {
+    info.value.status = 4;
+    salesmanAuth();
+  }
+};
+
+//获取成员员列表
+const salesmanAuth = () => {
+  api.representativeApi
+    .getUserInfoList({
+      ...info.value,
+      pages: pageInfo.pageNum,
+      size: pageInfo.pageSize,
+    })
+    .then((res) => {
+      tableData.value = res.data.records;
+      pageInfo.total = res.data.total;
+    });
+};
+
+//成员列表
+const institutionList = ref([]);
+const getAllMemberList = () => {
+  api.institutionApi.institutionList({}).then((res: any) => {
+    if (res.code === 200) institutionList.value = res.data;
+  });
+  // pageInfo.pageSize=item.pageSize
+};
+
+const reset = (item: any) => {
+  // ElMessage({})
+};
+
+onMounted(() => {
+  // 对 asyncRoutes 进行预处理并转换为树形结构
+  salesmanAuth(); //业务员列表
+  // getAreaList(); //省市区级联数据
+  // getSystemList(); //机构类型字典
+  // getExhibitionScopeSystemList(); //展业范围字段
+  getAllMemberList(); //成员列表
+});
+</script>
+<style lang="scss" scoped>
+:deep(.table-title-btn) {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  > div {
+    display: flex;
+  }
+}
+.institution {
+  background: #fff;
+  width: 100%;
+  // height: 100%;
+  // padding: 20px;
+  box-sizing: border-box;
+  display: flex;
+  :deep(.demo-tabs) {
+    width: 100%;
+    padding: 20px;
+    box-sizing: border-box;
+  }
+  // .institution-main {
+  //   flex: 1;
+  //   // width: 80%;
+  //   padding: 20px;
+  //   box-sizing: border-box;
+  // }
+}
+:deep(.el-dropdown-link) {
+  cursor: pointer;
+  color: var(--el-color-primary);
+  display: flex;
+  align-items: center;
+  margin-left: 15px;
+}
+.custom-tree-node {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 14px;
+  padding-right: 8px;
+}
+:deep(.el-message-box__container) {
+  width: 100% !important;
+  .el-message-box__message {
+    width: 100% !important;
+  }
+}
+</style>

+ 530 - 0
src/views/representative/salesman.vue

@@ -0,0 +1,530 @@
+<template>
+  <div class="institution">
+    <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
+      <el-tab-pane label="待审核" name="hold">
+        <div class="institution-main">
+          <el-form label-position="left" label-width="auto">
+            <el-row :gutter="24">
+              <el-col :span="6">
+                <el-form-item label="成员信息">
+                  <el-input
+                    v-model="formAccessibility.firstName"
+                    placeholder="输入成员信息查找"
+                    :prefix-icon="Search"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="归属机构">
+                  <el-select
+                    v-model="form.leaderId"
+                    placeholder="归属机构"
+                    clearable
+                  >
+                    <el-option
+                      v-for="item in memberList"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.id"
+                    />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="4">
+                <el-form-item label="">
+                  <el-button type="primary">查询</el-button>
+                  <el-button type="primary" plain @click="reset"
+                    >重置</el-button
+                  >
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+
+          <Table
+            :tableData="tableData"
+            :columns="columns"
+            :showIndex="false"
+            :showSelect="true"
+            :pageInfo="pageInfo"
+            @getList="getList"
+            :treeProps="{ children: 'children', hasChildren: 'hasChildren' }"
+            @select-all-change="selectAllChange"
+            @select-change="selectChange"
+          >
+            <template v-slot:table-title-btn>
+              <div>
+                <!-- <el-button type="primary" @click="add(ruleFormRef)">
+              <el-icon><Plus /></el-icon>添加机构</el-button
+            > -->
+                <el-dropdown placement="bottom-start">
+                  <el-button>
+                    批量操作<el-icon class="el-icon--right">
+                      <arrow-down />
+                    </el-icon>
+                  </el-button>
+                  <template #dropdown>
+                    <el-dropdown-menu>
+                      <el-dropdown-item>审核</el-dropdown-item>
+                      <!-- <el-dropdown-item v-on:click="manySetDeptUser()">设置负责人</el-dropdown-item> -->
+                    </el-dropdown-menu>
+                  </template>
+                </el-dropdown>
+              </div>
+            </template>
+            <template v-slot:operation="scope">
+              <el-button
+                type="primary"
+                link
+                @click="toExamine(scope.operationData.row, 'success')"
+              >
+                审核通过
+              </el-button>
+              <el-button
+                type="primary"
+                link
+                @click="toExamine(scope.operationData.row, 'error')"
+              >
+                审核不通过
+              </el-button>
+              <el-button
+                type="primary"
+                link
+                @click="editor(scope.operationData.row)"
+              >
+                详情
+              </el-button>
+            </template>
+            <template v-slot:search="scope">
+              {{ scope.slotData.label }}
+            </template>
+          </Table>
+        </div>
+      </el-tab-pane>
+      <el-tab-pane label="审核不通过" name="pass">
+        <div class="institution-main">
+          <el-form label-position="left" label-width="auto">
+            <el-row :gutter="24">
+              <el-col :span="6">
+                <el-form-item label="成员信息">
+                  <el-input
+                    v-model="formAccessibility.firstName"
+                    placeholder="输入成员信息查找"
+                    :prefix-icon="Search"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="归属机构">
+                  <el-select
+                    v-model="form.leaderId"
+                    placeholder="归属机构"
+                    clearable
+                  >
+                    <el-option
+                      v-for="item in memberList"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.id"
+                    />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="4">
+                <el-form-item label="">
+                  <el-button type="primary">查询</el-button>
+                  <el-button type="primary" plain @click="reset"
+                    >重置</el-button
+                  >
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+
+          <Table
+            :tableData="tableData"
+            :columns="columns"
+            :showIndex="false"
+            :showSelect="true"
+            :pageInfo="pageInfo"
+            @getList="getList"
+            :treeProps="{ children: 'children', hasChildren: 'hasChildren' }"
+            @select-all-change="selectAllChange"
+            @select-change="selectChange"
+          >
+            <template v-slot:table-title-btn>
+              <div>
+                <!-- <el-button type="primary" @click="add(ruleFormRef)">
+              <el-icon><Plus /></el-icon>添加机构</el-button
+            > -->
+                <el-dropdown placement="bottom-start">
+                  <el-button>
+                    批量操作<el-icon class="el-icon--right">
+                      <arrow-down />
+                    </el-icon>
+                  </el-button>
+                  <template #dropdown>
+                    <el-dropdown-menu>
+                      <el-dropdown-item>审核</el-dropdown-item>
+                      <!-- <el-dropdown-item v-on:click="manySetDeptUser()">设置负责人</el-dropdown-item> -->
+                    </el-dropdown-menu>
+                  </template>
+                </el-dropdown>
+              </div>
+            </template>
+            <template v-slot:operation="scope">
+              <el-button
+                type="primary"
+                link
+                @click="editor(scope.operationData.row)"
+              >
+                详情
+              </el-button>
+            </template>
+            <template v-slot:search="scope">
+              {{ scope.slotData.label }}
+            </template>
+          </Table>
+        </div>
+      </el-tab-pane>
+    </el-tabs>
+
+    <el-dialog v-model="dialogVisible" title="审核不通过" width="500" draggable>
+      <el-input
+        type="textarea"
+        placeholder="请输入审核不通过原因"
+        v-model="textValue"
+      />
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="cancel()">取 消</el-button>
+          <el-button type="primary" @click="confirm()"> 保 存 </el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref, reactive, watch, onMounted } from "vue";
+import type {
+  ComponentSize,
+  FormInstance,
+  FormRules,
+  TabsPaneContext,
+} from "element-plus";
+import { Plus, Search } from "@element-plus/icons-vue";
+import { useRouter } from "vue-router";
+import type Node from "element-plus/es/components/tree/src/model/node";
+// import universalTable from "../"
+import { ElMessage, ElMessageBox, ElPopconfirm, ElTree } from "element-plus";
+import api from "@/api";
+import { h } from "vue";
+import setDept from "@/components/DialogSetDeptLeader/index.vue";
+interface Tree {
+  [key: string]: any;
+}
+
+const filterText = ref("");
+const treeRef = ref<InstanceType<typeof ElTree>>();
+const activeName = ref("hold");
+const defaultProps = {
+  children: "children",
+  label: "label",
+};
+
+//批量设置负责人
+
+watch(filterText, (val) => {
+  treeRef.value!.filter(val);
+});
+
+const formAccessibility = reactive({
+  fullName: "",
+  firstName: "",
+  lastName: "",
+  phone: "",
+});
+const ruleFormRef = ref<FormInstance>();
+let form = reactive({
+  name: "", //机构名称
+  parentId: "", //上级机构id
+  comType: "", //机构类型
+  exhibitionScope: "", //展业范围
+  address: "", //地址
+  leaderId: "", //负责人id
+  area: [], //地区
+});
+
+interface PageInfo {
+  pageNum: number;
+  pageSize: number;
+  sizes: number[];
+  total: number;
+  show: boolean;
+}
+
+const dialogVisible = ref(false);
+
+// import Select from "@/components/select/selectMain.vue";
+// import TestTable from "@/components/Table/index.vue";
+//业务员列表
+type tableType = {
+  id: string;
+  name: string;
+};
+const tableData = ref<tableType[]>([]);
+const typeformatter = (row: any, column: any, cellValue: any) => {
+  let comType = "";
+  comTypeList.value.map((ele) => {
+    if (ele.value == row.comType) {
+      comType = ele.label;
+    }
+  });
+
+  return () => h("div", {}, comType);
+};
+const columns = [
+  { prop: "name", label: "姓名" },
+  { prop: "mobile", label: "手机号" },
+  // { prop: "id", label: "工号" },
+  { prop: "deptName", label: "归属机构" },
+  {
+    prop: "username",
+    label: "角色",
+  },
+  { prop: "createTime", label: "创建时间" },
+  { prop: "createBy", label: "创建人" },
+];
+
+const pageInfo = {
+  pageNum: 1,
+  pageSize: 10,
+  sizes: [10, 20, 30, 40, 50],
+  total: 0,
+  show: true,
+};
+//分页列表功能
+const getList = (item: PageInfo) => {
+  pageInfo.pageNum = item.pageNum;
+  pageInfo.pageSize = item.pageSize;
+  salesmanAuth();
+};
+
+const checkTableIdList = ref([]);
+//表格选择事件
+function selectAllChange(list: any) {
+  checkTableIdList.value = list;
+}
+
+function selectChange(list: any) {
+  checkTableIdList.value = list;
+}
+//审核
+const userInfoId = ref("");
+const toExamine = (item: any, type: string) => {
+  if (type == "success") {
+    ElMessageBox.confirm(`确定审核通过${item.name}账号吗?`, "审核通过", {
+      confirmButtonText: "确认",
+      cancelButtonText: "取消",
+      type: "warning",
+      center: true,
+    })
+      .then(() => {
+        api.representativeApi
+          .salesmanAuthSuccess({
+            userInfoId: item.id,
+          })
+          .then((res: any) => {
+            if (res.code == 200) {
+              ElMessage.success("操作成功");
+              salesmanAuth(); //业务员列表
+            } else {
+              ElMessage.error(res.msg);
+              // salesmanAuth(); //业务员列表
+            }
+          });
+      })
+      .catch(() => {
+        ElMessage.warning("用户取消操作");
+      });
+  } else {
+    dialogVisible.value = true;
+    userInfoId.value = item.id;
+    // ElMessageBox.confirm(`<textarea placeholder='请输入审核不通过原因' oninput='handleText()' style="width:300px"></textarea>`, "审核不通过", {
+    //   confirmButtonText: "确认",
+    //   cancelButtonText: "取消",
+    //   dangerouslyUseHTMLString: true ,
+    //   type: "warning",
+    //   center: true,
+
+    // })
+    //   .then(() => {
+    //     api.representativeApi.salesmanAuthFailed({}).then((res: any) => {
+    //       if (res.code == 200) {
+    //         ElMessage.success("操作成功");
+    //         salesmanAuth(); //业务员列表
+    //       } else {
+    //         ElMessage.error(res.msg);
+    //         // salesmanAuth(); //业务员列表
+    //       }
+    //     });
+    //   })
+    //   .catch(() => {
+    //     ElMessage.warning("用户取消操作");
+    //   });
+  }
+};
+function cancel() {
+  ElMessage.warning("用户取消操作");
+  dialogVisible.value = false;
+}
+const textValue = ref("");
+//审核不通过
+function confirm() {
+  api.representativeApi
+    .salesmanAuthFailed({
+      userInfoId: userInfoId.value,
+      approvalOpinion: textValue.value,
+    })
+    .then((res: any) => {
+      if (res.code == 200) {
+        ElMessage.success("操作成功");
+        salesmanAuth(); //业务员列表
+        dialogVisible.value = false;
+      }
+    });
+}
+
+interface institutionData {
+  typeAttr: string;
+  deptId: string;
+  status: number;
+}
+const info = ref<institutionData>({
+  typeAttr: "1",
+  deptId: "",
+  status: 4,
+});
+
+const router = useRouter();
+
+//详情
+const editor = (item: any) => {
+  console.log(item);
+  router.push({
+    path: "/representative/salesman/salesmanMessage",
+    query: {
+      id: item.userId,
+    },
+  });
+  // pageInfo.pageNum=item.pageNum
+  // pageInfo.pageSize=item.pageSize
+};
+
+//获取机构类型字典值
+type comType = {
+  value: string;
+  label: string;
+};
+let comTypeList = ref<comType[]>([]);
+
+const handleClick = (tab: TabsPaneContext, event: Event) => {
+  // console.log(tab.props.name);
+  if (tab.props.name == "pass") {
+    info.value.status = 5;
+    salesmanAuth();
+  } else {
+    info.value.status = 4;
+    salesmanAuth();
+  }
+};
+
+//获取成员员列表
+const salesmanAuth = () => {
+  api.representativeApi
+    .getUserInfoList({
+      ...info.value,
+      pages: pageInfo.pageNum,
+      size: pageInfo.pageSize,
+    })
+    .then((res) => {
+      tableData.value = res.data.records;
+      pageInfo.total = res.data.total;
+    });
+};
+
+//成员列表
+const memberList = ref([]);
+const getAllMemberList = () => {
+  api.userApi.AllMemberList({}).then((res: any) => {
+    if (res.code === 200) memberList.value = res.data;
+  });
+  // pageInfo.pageSize=item.pageSize
+};
+
+const reset = (item: any) => {
+  // ElMessage({})
+};
+
+onMounted(() => {
+  // 对 asyncRoutes 进行预处理并转换为树形结构
+  salesmanAuth(); //业务员列表
+  // getAreaList(); //省市区级联数据
+  // getSystemList(); //机构类型字典
+  // getExhibitionScopeSystemList(); //展业范围字段
+  getAllMemberList(); //成员列表
+});
+</script>
+<style lang="scss" scoped>
+:deep(.table-title-btn) {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  > div {
+    display: flex;
+  }
+}
+.institution {
+  background: #fff;
+  width: 100%;
+  // height: 100%;
+  // padding: 20px;
+  box-sizing: border-box;
+  display: flex;
+  :deep(.demo-tabs) {
+    width: 100%;
+    padding: 20px;
+    box-sizing: border-box;
+  }
+  // .institution-main {
+  //   flex: 1;
+  //   // width: 80%;
+  //   padding: 20px;
+  //   box-sizing: border-box;
+  // }
+}
+:deep(.el-dropdown-link) {
+  cursor: pointer;
+  color: var(--el-color-primary);
+  display: flex;
+  align-items: center;
+  margin-left: 15px;
+}
+.custom-tree-node {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 14px;
+  padding-right: 8px;
+}
+:deep(.el-message-box__container) {
+  width: 100% !important;
+  .el-message-box__message {
+    width: 100% !important;
+  }
+}
+</style>