刘恒 1 год назад
Родитель
Сommit
90547b07e1

+ 6 - 6
.editorconfig

@@ -1,9 +1,9 @@
 root = true
 
 [*]
-charset = utf-8
-indent_style = space
-indent_size = 2
-end_of_line = lf
-insert_final_newline = true
-trim_trailing_whitespace = true
+charset = utf-8 # 字符编码 utf-8
+indent_style = space # 输入的 tab 都用空格代替
+indent_size = 2 # 一个 tab 用 2 个空格代替
+end_of_line = lf # 换行符使用 unix 的换行符 \n
+insert_final_newline = true # 去掉每行末尾的空格
+trim_trailing_whitespace = true # 文件末尾都加一个空行

+ 3 - 1
.env.development

@@ -4,7 +4,9 @@ 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.53:8001  #田智
+VITE_APP_API_BASEURL = http://192.168.0.106:8001  #屈晨
+#VITE_APP_API_BASEURL = http://192.168.0.59:8001  #徐强
 
 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
 VITE_APP_DEBUG_TOOL =

+ 5 - 1
src/api/index.ts

@@ -12,6 +12,8 @@ import institutionApi from './modules/institution'
 import areaApi from "./modules/area"
 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";
 
 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,
@@ -94,6 +96,8 @@ const api = {
   institutionApi:institutionApi(axiosInstance),
   areaApi:areaApi(axiosInstance),
   operationApi: operationApi(axiosInstance),
-  menuApi:menuApi(axiosInstance)
+  menuApi:menuApi(axiosInstance),
+  commonApi: commonApi(axiosInstance),
+  teamApi: teamApi(axiosInstance)
 }
 export default api

+ 18 - 0
src/api/modules/common.ts

@@ -0,0 +1,18 @@
+import { ApiInstance } from '../type'
+
+/*
+* 性别        gender
+  民族        nation
+  婚姻状况     marriage
+  政治面貌     political_status
+  健康状况     health_status
+  学历        educational
+  银行        bank_info
+* */
+const commonApi = (axiosInstance: ApiInstance) => ({
+  personInfo: (data: string) => axiosInstance.get(`/dict/get?dictCode=${data}`),
+  fileUpload: (data: any) => axiosInstance.post('/file/upload', data, {}), // 文件上传
+})
+
+export default commonApi
+

+ 40 - 8
src/api/modules/operation.ts

@@ -5,7 +5,7 @@ import {LocationQueryValue} from "vue-router";
 export interface AddOperation {
   typeAttr: string,
   deptId: string,
-  username: string,
+  name: string,
   mobile: string,
   identity: string,
   identityTimeStart: string,
@@ -34,25 +34,42 @@ export interface AddOperation {
   salary?: string,
   salaryLevel?: string,
   bankCardId?: string,
-  bankName?: string
+  bankName?: string,
 
+  sfz1?: string,
+  sfz2?: string,
+  qualification?: string,
+  contract?: string,
+  applicant?: string,
+  salaryTable?: string,
+  leaveTable?: string
 }
 // 列表
 export interface OperationSearch {
   pages: number,
   size: number,
-  salesman?: string
+  salesman?: string,
+  organizationName?: string,
   deptId?: string,
   typeAttr?: string,
   deptName?: string,
   status?: number,
-  isEnable?: number,
+  isEnable?: string,
   leaderId?: string
 }
+// 银行卡
+export interface AddBankCard {
+  userJzgInfoId: string,
+  bankCardNumber: string,
+  bankName: string,
+  bankAddress: string,
+  attachment?: string
+}
 // 启用/禁用
 export interface OperationIsEnable {
-  id: string[],
-  isEnable: number
+  ids: string[],
+  isEnable: number,
+  getAll: number
 }
 export interface OperationEdit extends AddOperation {
   id: string
@@ -60,11 +77,26 @@ export interface OperationEdit extends AddOperation {
 // 业务员管理相关接口
 const operationApi = (axiosInstance: ApiInstance) => ({
   addOperation: (data: AddOperation) => axiosInstance.post('/userInfo/add', data), // 新赠
+  updateOperation: (data: any) => axiosInstance.post('/userInfo/update', data), //编辑
   operationList: (data: OperationSearch) => axiosInstance.post('/userInfo/getUserInfoList', data), // 列表
-  operationDelete: (data: string[]) => axiosInstance.post('/userInfo/delete', data), // 删除
+  operationDelete: (data: {
+    ids: string[],
+    getAll: number
+  }) => axiosInstance.post('/userInfo/delete', data), // 删除
   operationIsEnable: (data: OperationIsEnable) => axiosInstance.post('/userInfo/isEnable', data), // 启用/禁用
   operationDetail: (data: string | null | LocationQueryValue[] | undefined) => axiosInstance.get(`/userInfo/getUserInfo?id=${data}`), // 详情
-  operationEdit: (data: OperationEdit) => axiosInstance.post('/userInfo/update', data), // 编辑
+  setLeader: (data: {
+    ids: string[],
+    leaderId: string,
+    getAll: number
+  }) => axiosInstance.post('/userInfo/batchLeader', data), // 设置负责人
+  getUser: (data: string) => axiosInstance.post('/userInfo/getUser', { deptId: data }), // 获取管理人/推荐人
+  addBankCard: (data: AddBankCard) => axiosInstance.post('/userInfo/addBankCard', data), // 添加银行卡
+  salesmanAuthSuccess: (data: { userInfoId: string }) => axiosInstance.post('/userInfo/salesmanAuthSuccess', data), // 审核通过
+  salesmanAuthFailed: (data: {
+    userInfoId: string,
+    approvalOpinion: string
+  }) => axiosInstance.post('/userInfo/salesmanAuthFailed', data), // 审核不通过
 })
 
 export default operationApi

+ 18 - 0
src/api/modules/team.ts

@@ -0,0 +1,18 @@
+import { ApiInstance } from '../type'
+
+export interface AddTeamProps {
+  name: string,
+  deptId: number,
+  managerId: number,
+  systemCode: string,
+  attribute: number, // 1 团队 2 渠道 3 电销
+  describeInformation?: string
+}
+
+const teamApi = (axiosInstance: ApiInstance) => ({
+  teamList: (data: any) => axiosInstance.post('/sysOrganization/leftList', data), // 查询(不分页)
+  addTeam: (data: AddTeamProps) => axiosInstance.post('/sysOrganization/save', data), // 新增
+  queryPageList: (data: any) => axiosInstance.post('/sysOrganization/queryPageList', data), // 查询(分页)
+})
+
+export default teamApi

+ 353 - 4
src/views/operationManagement/channel.vue

@@ -1,11 +1,360 @@
 <template>
-  <div>channel</div>
+  <div class="team">
+    <el-row :gutter="20" style="width: 100%; overflow:hidden;">
+      <el-col :span="4">
+        <div class="teamTree">
+          <el-input class="search-input" v-model="treeValue" placeholder="渠道名称查找" prefix-icon="Search"></el-input>
+          <div class="custom-tree-node" v-for="item in teamData" :key="item.id">
+            <span class="custom-tree-node-label">{{ item.name }}</span>
+            <el-dropdown class="custom-tree-node-more" @command="treeNodeCommend(item, $event)">
+              <el-icon><MoreFilled /></el-icon>
+              <template #dropdown>
+                <el-dropdown-menu>
+                  <el-dropdown-item command="编辑">编辑</el-dropdown-item>
+                  <el-dropdown-item command="删除">删除</el-dropdown-item>
+                </el-dropdown-menu>
+              </template>
+            </el-dropdown>
+          </div>
+        </div>
+        <el-button class="add-btn" icon="plus" @click="addTeamShow = true">添加渠道</el-button>
+      </el-col>
+      <el-col :span="20">
+        <el-row :gutter="20">
+          <el-col :span="22" class="info">
+            <h3>渠道名称</h3>
+            <p>所属机构: 机构名称</p>
+            <p>管理人: 管理人姓名-管理人工号</p>
+            <p>描述:</p>
+          </el-col>
+          <el-col :span="2" class="btn">
+            <el-button plain @click="setPeople">设置负责人</el-button>
+          </el-col>
+        </el-row>
+        <el-input style="width: 300px; margin: 10px 0" v-model="searchValue" prefix-icon="Search" placeholder="输入姓名,手机号,工号查找" ></el-input>
+        <el-table
+          :data="tableData"
+          ref="operationListRef"
+          height="530"
+          @selection-change="handleSelectionChange"
+        >
+          <el-table-column type="selection" width="55"></el-table-column>
+          <el-table-column label="姓名" prop="name" width="80"></el-table-column>
+          <el-table-column label="手机号" prop="mobile" width="150"></el-table-column>
+          <el-table-column label="工号" prop="userId" width="200"></el-table-column>
+          <el-table-column label="类型" prop="typeAttr" width="100"></el-table-column>
+          <el-table-column label="归属" prop="deptName" width="200"></el-table-column>
+          <el-table-column label="所属机构" prop="deptName" width="200"></el-table-column>
+          <el-table-column label="人员状态" prop="status" width="150">
+            <template #default="scope">
+              {{ scope.row.status == '1'?'前线人员':scope.row.status == '2'?'后线人员':scope.row.status == '3'?'合伙人':scope.row.status == '4'?'工作室管理员':scope.row.status == '5'?'团队长':scope.row.status == '6'?'个代':scope.row.status == '7'?'电销':scope.row.status == '8'?'渠道': '--' }}
+            </template>
+          </el-table-column>
+          <el-table-column label="账号状态" prop="isEnable" width="150"></el-table-column>
+          <el-table-column label="管理人" prop="leaderName" width="150"></el-table-column>
+          <el-table-column label="管理人工号" prop="leaderId" width="200"></el-table-column>
+          <el-table-column label="推荐人" prop="referrerName" width="150"></el-table-column>
+          <el-table-column label="推荐人工号" prop="referrerId" width="200"></el-table-column>
+          <el-table-column fixed="right" label="操作" width="120">
+            <template #default="scope">
+              <div style="display: flex; align-items: center; justify-content: space-between">
+                <a style="color: #409EFF; cursor: pointer" @click="showDetail(scope)">详情</a>&nbsp;
+                <el-dropdown placement="bottom" trigger="click" @command="tableDataCommand(scope, $event)">
+                  <a style="color: #409EFF; cursor: pointer">更多</a>
+                  <template #dropdown>
+                    <el-dropdown-menu>
+                      <el-dropdown-item command="编辑">编辑</el-dropdown-item>
+                      <el-dropdown-item command="启用">启用</el-dropdown-item>
+                      <el-dropdown-item command="禁用">禁用</el-dropdown-item>
+                      <el-dropdown-item command="删除">删除</el-dropdown-item>
+                      <el-dropdown-item command="分配管理人">分配管理人</el-dropdown-item>
+                    </el-dropdown-menu>
+                  </template>
+                </el-dropdown>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+        <div style="display: flex; justify-content: center; margin-top: 15px">
+          <el-pagination
+            v-model:current-page="currentPage"
+            v-model:page-size="pageSize"
+            :page-sizes="[10, 20, 30, 40]"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="total"
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+          />
+        </div>
+      </el-col>
+    </el-row>
+    <el-dialog
+      v-model="dialogShow"
+      :title="title"
+      width="1000"
+    >
+      <addOperation @closeDialog="closeAddOperation" :options="options"></addOperation>
+    </el-dialog>
+    <el-dialog
+      v-model="addTeamShow"
+      title="添加"
+      width="800"
+    >
+      <addTeam @closeDialog="closeAddTeamDialog" :editData="editItemData"></addTeam>
+    </el-dialog>
+    <el-dialog
+      v-model="allocationShow"
+      title="分配管理人"
+      width="800"
+    >
+      <allocation></allocation>
+    </el-dialog>
+  </div>
 </template>
 
-<script setup>
+<script setup lang="ts">
+import { ref, onMounted } from 'vue'
+import {ElMessageBox, ElMessage, TableInstance} from 'element-plus'
+import { useRouter } from 'vue-router'
+import api from "@/api";
+import addOperation from './modules/addOperation.vue'
+import allocation from './modules/allocation.vue'
+import addTeam from './modules/addTeam.vue'
+import Allocation from "@/views/operationManagement/modules/allocation.vue";
+import {initial} from "lodash-es";
+import team from "@/api/modules/team.ts";
 
-</script>
+let myRouter = useRouter()
+
+// 机构数据
+let options = ref([])
+// 获取机构数据
+const institutionList = () => {
+  api.institutionApi.institutionList({ name: '', system: '' }).then(res => {
+    if(res?.code == 200) {
+      options.value = res.data
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
+
+// 渠道
+let treeValue = ref('')
+let teamData = ref([])
+let addTeamShow = ref(false)
+let editItemData = ref(null)
+const initTeam = () => {
+  api.teamApi.teamList({}).then(res => {
+    if(res.code == 200) {
+      teamData.value = res.data
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
+const treeNodeCommend = (item, e) => {
+  switch (e) {
+    case '编辑':
+      addTeamShow.value = true
+      editItemData.value = item
+      break;
+    case '删除':
+      ElMessageBox({
+        title: '删除渠道',
+        message: '确定要删除该渠道吗?',
+        type: 'warning',
+        showCancelButton: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+      }).then(( action ) => {
+        if(action === 'confirm') {
+
+        }
+      }).catch(( action ) => {
+
+      })
+      break;
+  }
+}
+const closeAddTeamDialog = (type) => {
+  addTeamShow.value = false
+}
+
+// 分页
+let currentPage = ref(1)
+let pageSize = ref(10)
+let total = ref(0)
+const handleSizeChange = (size) => {
+
+}
+const handleCurrentChange = (page) => {
+
+}
+
+// 搜索字段
+let searchValue = ref('')
+// 列表数据
+let tableData = ref([
+  {name: 1}
+])
+// 编辑弹框
+let dialogShow = ref(false)
+// 编辑弹框标题
+let title = ref('编辑')
+// 表格组件中的勾选
+const handleSelectionChange = (row) => {
+
+}
+// 详情
+const showDetail = (scope) => {
+  myRouter.push({
+    path: '/operationDetail',
+    query: {
+      id: scope.row.id
+    }
+  })
+}
 
-<style scoped>
+// 分配管理人
+let allocationShow = ref(false)
+
+// 设置负责人
+const setPeople = () => {
+  allocationShow.value = true
+}
+// 更多
+const tableDataCommand = (scope, e) => {
+  switch (e) {
+    case '编辑':
+      dialogShow.value = true
+      title.value = '编辑'
+      break;
+    case '删除':
+      ElMessageBox({
+        title: '删除业务员',
+        message: '确定要删除该业务员吗?',
+        type: 'warning',
+        showCancelButton: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+      }).then(( action ) => {
+        if(action === 'confirm') {
+          let ids = [scope.row.id]
+
+        }
+      }).catch(( action ) => {
+
+      })
+      break;
+    case '禁用':
+      ElMessageBox({
+        title: '禁用业务员',
+        message: '确定要禁用该业务员吗?',
+        type: 'warning',
+        showCancelButton: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+      }).then(( action ) => {
+        if(action === 'confirm') {
+          let data = {
+            id: [scope.row.id],
+            isEnable: 0
+          }
+        }
+      }).catch(( action ) => {
+
+      })
+      break;
+    case '启用':
+      ElMessageBox({
+        title: '启用业务员',
+        message: '确定要启用该业务员吗?',
+        type: 'warning',
+        showCancelButton: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+      }).then(( action ) => {
+        if(action === 'confirm'){
+          let data = {
+            id: [scope.row.id],
+            isEnable: 1
+          }
+        }
+      }).catch(( action ) => {
+
+      })
+      break;
+    case '分配管理人':
+      allocationShow.value = true
+      break;
+  }
+}
+
+const closeAddOperation = (type: string) => {
+  dialogShow.value = false
+}
+
+onMounted(() => {
+  institutionList()
+  initTeam()
+})
+
+</script>
 
+<style scoped lang="scss">
+.team{
+  height: 770px;
+  background: #fff;
+  .search-input{
+    padding: 10px 20px;
+  }
+  .teamTree{
+    height: 700px;
+    overflow-y: auto;
+    background: #fff;
+    .custom-tree-node{
+      width: calc(100% - 40px);
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      padding: 5px 10px;
+      margin: 5px auto;
+      &:hover{
+        background: rgba(0,0,0,.1);
+      }
+      .custom-tree-node-label{
+        width: 70%;
+        overflow: hidden;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+      }
+    }
+  }
+  .add-btn{
+    display: block;
+    margin: 0 auto;
+  }
+  .info{
+    h3{
+      margin: 10px 0;
+    }
+    p{
+      margin: 6px 0;
+      font-size: 14px;
+      color: rgba(0,0,0,.7);
+    }
+  }
+  .btn{
+    display: flex;
+    justify-content: flex-end;
+    align-items: flex-end;
+  }
+}
 </style>

+ 188 - 25
src/views/operationManagement/modules/addCard.vue

@@ -1,76 +1,239 @@
 <template>
-  <div>
+  <div class="form">
     <el-form ref="BankRef" :rules="bankRules" :model="bankForm" label-width="80">
       <el-form-item prop="name" label="姓名">
         <el-input v-model="bankForm.name" disabled></el-input>
       </el-form-item>
       <el-form-item prop="bank" label="银行">
-        <el-select v-model="bankForm.bank">
-          <el-option key="1" value="银行1"></el-option>
+        <el-select v-model="bankForm.bankName" :disabled="bankForm.isRead">
+          <el-option v-for="item in bankOption" :key="item.id" :value="item.id" :label="item.label"></el-option>
         </el-select>
       </el-form-item>
       <el-form-item prop="card" label="银行卡号">
-        <el-input v-model="bankForm.card"></el-input>
+        <el-input v-model="bankForm.bankCardNumber" :disabled="bankForm.isRead"></el-input>
       </el-form-item>
       <el-form-item prop="bankName" label="开户行">
-        <el-input v-model="bankForm.bankName"></el-input>
+        <el-input v-model="bankForm.bankAddress" :disabled="bankForm.isRead"></el-input>
       </el-form-item>
-      <el-form-item prop="photo" label="照片">
-        <ImageUpload action="#" :ext="['png','jpg','jpeg']" :size="5"></ImageUpload>
+      <el-form-item prop="photo" label="照片" class="upload-btn">
+        <el-upload :auto-upload="false" v-if="!bankForm.imageUrl" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage">
+          <el-button size="large" icon="Plus" />
+        </el-upload>
+        <div class="image-view" v-else>
+          <img :src="bankForm.imageUrl" />
+          <div class="btns" v-if="!bankForm.isRead">
+            <el-upload  :disabled="bankForm.isRead" style="display: inline" :auto-upload="false" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage">
+              <el-icon class="btn-icon"><Upload /></el-icon>
+            </el-upload>
+<!--            <el-icon class="btn-icon" @click="imageView"><View /></el-icon>-->
+          </div>
+        </div>
       </el-form-item>
       <div style="display: flex; justify-content: flex-end">
-        <el-button @click="onSubmit(0)">取消</el-button>
+        <el-button @click="onSubmit(BankRef, 0)">取消</el-button>
         <el-button type="primary" @click="onSubmit(BankRef, 1)">确定</el-button>
       </div>
     </el-form>
+    <div class="image-show" v-show="imageShow" @click="() => { imageShow = false }">
+      <img :src="bankForm.imageUrl" />
+    </div>
   </div>
 </template>
 
 <script setup lang="ts">
-import { ref } from 'vue'
+import { ref, defineEmits, onMounted, watch } from 'vue'
 import {ElMessage, FormInstance} from 'element-plus'
+import api from "@/api";
 
 const BankRef = ref<FormInstance>()
 
+let props = defineProps<{
+  userInfo: {
+    userJzgInfoId: string,
+    name: string,
+    bankName?: string,
+    bankCardNumber?: string,
+    bankAddress?: string,
+    attachment?: string,
+    imageUrl?: string
+    isRead?: boolean
+  }
+}>()
 const emits = defineEmits(['closeDialog'])
+watch(() => props.userInfo, (newVal, oldVal) => {
+  console.log(123123123, newVal, oldVal)
+  bankForm.value = newVal
+}, { deep: true });
 
 let bankForm = ref({
-  name: '',
-  bank: '',
-  card: '',
-  bankName: '',
-  photo: ''
+  userJzgInfoId: props.userInfo.userJzgInfoId,
+  name: props.userInfo.name,
+  bankName: props.userInfo.bankName,
+  bankCardNumber: props.userInfo.bankCardNumber,
+  bankAddress: props.userInfo.bankAddress,
+  attachment: props.userInfo.attachment,
+  imageUrl: props.userInfo.attachment,
+  isRead: props.userInfo.isRead
 })
 const bankRules = {
   name: [
     { required: true, message: '请填写姓名', trigger: 'blur' }
   ],
-  card: [
-    { required: true, message: '请填写银行卡号', trigger: 'blur' }
-  ],
   bankName: [
+    { required: true, message: '请选择银行', trigger: 'change' }
+  ],
+  bankCardNumber: [
+    { required: true, message: '请填写银行卡号', trigger: 'blur' },
+    {
+      pattern: /^([1-9]{1})(\d{15}|\d{16}|\d{18})$/,
+      message: '请填写正确的银行卡号',
+      trigger: 'blur'
+    }
+  ],
+  bankAddress: [
     { required: true, message: '请填写开户行', trigger: 'blur' }
   ],
 }
-const onSubmit = async (BankRef:FormInstance, type: number) => {
-  if(!BankRef) {
-    emits('closeDialog', false)
-    return
+
+// 照片
+let imageShow = ref(false)
+const uploadImage = async (file) => {
+  let files = file.raw
+  const params = new FormData(); // 声明formData数据类型
+  params.append("file", files);
+  params.append("type", "image");
+  const { code, data, msg } = await api.commonApi.fileUpload(params)
+  console.log(123, data)
+  if(code == 200) {
+    bankForm.value.imageUrl = data.downloadUrl
+    bankForm.value.attachment = data.id
   }
-  await BankRef.validate((valid) => {
-    if(valid) {
+}
+const imageView = () => {
+  imageShow.value = true
+}
 
+// 初始化银行数据
+let bankOption = ref([])
+const initBankCard = () => {
+  api.commonApi.personInfo('bank_info').then(res => {
+    if(res.code == 200) {
+      bankOption.value = res.data
     } else {
       ElMessage({
-        message: '请正确填写相关信息!',
+        message: res.msg,
         type: 'warning'
       })
     }
   })
 }
 
+const onSubmit = async (BankRef:FormInstance | undefined, type: number) => {
+  if(!BankRef) {
+    BankRef.resetFields()
+    emits('closeDialog', '取消')
+    return
+  }
+  if(type) {
+    await BankRef.validate((valid) => {
+      if(valid) {
+        api.operationApi.addBankCard(bankForm.value).then(res => {
+          if(res.code == 200) {
+            ElMessage({
+              message: res.msg,
+              type: 'success'
+            })
+          } else {
+            ElMessage({
+              message: res.msg,
+              type: 'warning'
+            })
+          }
+          BankRef.resetFields()
+          emits('closeDialog', '确定')
+        })
+      } else {
+        ElMessage({
+          message: '请正确填写相关信息!',
+          type: 'warning'
+        })
+      }
+    })
+  } else {
+    BankRef.resetFields()
+    emits('closeDialog', '取消')
+  }
+}
+
+onMounted(() => {
+  initBankCard()
+})
+
 </script>
 
 <style scoped lang="scss">
-
+.form{
+  position: relative;
+  .upload-btn{
+    :deep(.el-button) {
+      width: 80px;
+      height: 80px;
+      font-size: 30px;
+      color: #ccc;
+    }
+  }
+  .image-view{
+    width: 80px;
+    height: 80px;
+    border-radius: 5px;
+    position: relative;
+    img{
+      display: block;
+      width: 100%;
+      height: 100%;
+      border-radius: 5px;
+    }
+    .btns{
+      display: none;
+    }
+    &:hover{
+      .btns{
+        width: 100%;
+        height: 100%;
+        border-radius: 5px;
+        position: absolute;
+        background: rgba(0,0,0, .3);
+        top: 0;
+        left: 0;
+        line-height: 80px;
+        display: flex;
+        align-content: center;
+        justify-content: center;
+        .btn-icon{
+          color: #fff;
+          font-size: 18px;
+          margin: 0 10px;
+          cursor: pointer;
+        }
+      }
+    }
+  }
+  .image-show{
+    width: 100%;
+    height: 100%;
+    position: absolute;
+    margin: auto;
+    top: 0;
+    left: 0;
+    display: flex;
+    align-content: center;
+    justify-content: center;
+    background: rgba(0,0,0,.4);
+    img{
+      display: block;
+      width: 80%;
+      height: 100%;
+    }
+  }
+}
 </style>

+ 482 - 130
src/views/operationManagement/modules/addOperation.vue

@@ -13,22 +13,29 @@
               <el-col :span="10">
                 <el-form-item prop="typeAttr" label="业务员类型">
                   <el-select v-model="operationForm.typeAttr" placeholder="请选择业务员类型">
-                    <el-option key="1" value="类型1"></el-option>
+                    <el-option key="1" value="1" label="前线人员"></el-option>
+                    <el-option key="2" value="2" label="后线人员"></el-option>
+                    <el-option key="3" value="3" label="合伙人"></el-option>
+                    <el-option key="4" value="4" label="工作室管理员"></el-option>
+                    <el-option key="5" value="5" label="团队长"></el-option>
+                    <el-option key="6" value="6" label="个代"></el-option>
+                    <el-option key="7" value="7" label="电销"></el-option>
+                    <el-option key="8" value="8" label="渠道"></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="10">
                 <el-form-item prop="deptId" label="所属团队">
-                  <el-select v-model="operationForm.deptId" placeholder="请选择所属团队">
-                    <el-option key="1" value="团队1"></el-option>
+                  <el-select v-model="operationForm.organizationId" placeholder="请选择所属团队" @change="deptChange">
+                    <el-option v-for="item in teamList" :key="item.id" :value="item.id" :label="item.name"></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
             </el-row>
             <el-row :gutter="20">
               <el-col :span="10">
-                <el-form-item prop="username" label="姓名">
-                  <el-input v-model="operationForm.username" placeholder="请填写姓名"></el-input>
+                <el-form-item prop="name" label="姓名">
+                  <el-input v-model="operationForm.name" placeholder="请填写姓名"></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="10">
@@ -40,9 +47,8 @@
             <el-row :gutter="20">
               <el-col :span="10">
                 <el-form-item prop="organization" label="所属机构">
-                  <el-select v-model="operationForm.organization" placeholder="请选择所属机构">
-                    <el-option key="1" value="机构1"></el-option>
-                  </el-select>
+                  <el-input disabled v-model="operationForm.organization"></el-input>
+<!--                  <el-cascader style="width: 100%" v-model="operationForm.organization" placeholder="请选择所属机构" :options="option" :props="cascaderProps"></el-cascader>-->
                 </el-form-item>
               </el-col>
               <el-col :span="10">
@@ -59,6 +65,7 @@
                     type="date"
                     placeholder="请选择"
                     format="YYYY-MM-DD"
+                    value-format="YYYY-MM-DD"
                     style="width: 100%"
                   />
                 </el-form-item>
@@ -70,6 +77,7 @@
                     type="date"
                     placeholder="请选择"
                     format="YYYY-MM-DD"
+                    value-format="YYYY-MM-DD"
                     style="width: 100%"
                   />
                 </el-form-item>
@@ -84,28 +92,28 @@
             <el-row :gutter="20">
               <el-col :span="10">
                 <el-form-item prop="leaderId" label="管理人">
-                  <el-select v-model="operationForm.leaderId" placeholder="请选择管理人">
-                    <el-option key="1" value="机构1"></el-option>
+                  <el-select v-model="operationForm.leaderId" filterable placeholder="请选择管理人" @change="(e) => {operationForm.leaderNumber = e}">
+                    <el-option v-for="(item, index) in userList" :key="item.id" :value="item.id" :label="item.name"></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="10">
                 <el-form-item prop="leaderNumber" label="管理人工号">
-                  <el-input v-model="operationForm.leaderNumber" placeholder="请填写管理人工号"></el-input>
+                  <el-input readonly v-model="operationForm.leaderNumber" placeholder="请填写管理人工号"></el-input>
                 </el-form-item>
               </el-col>
             </el-row>
             <el-row :gutter="20">
               <el-col :span="10">
                 <el-form-item prop="referrerId" label="推荐人">
-                  <el-select v-model="operationForm.referrerId" placeholder="请选择推荐人">
-                    <el-option key="1" value="机构1"></el-option>
+                  <el-select v-model="operationForm.referrerId" filterable placeholder="请选择推荐人" @change="(e) => {operationForm.referrerNumber = e}">
+                    <el-option v-for="(item, index) in userList" :key="item.id" :value="item.id" :label="item.name"></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="10">
                 <el-form-item prop="referrerNumber" label="推荐人工号">
-                  <el-input v-model="operationForm.referrerNumber" placeholder="请填写推荐人工号"></el-input>
+                  <el-input readonly v-model="operationForm.referrerNumber" placeholder="请填写推荐人工号"></el-input>
                 </el-form-item>
               </el-col>
             </el-row>
@@ -116,13 +124,13 @@
         <el-descriptions-item>
           <template #default>
             <el-form-item prop="" label="身份证(人像面)" label-width="150">
-              <el-upload v-if="!IDCardFront" action="#" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 1)">
+              <el-upload action="" v-if="!IDCardFront" :auto-upload="false" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 1)">
                 <el-button link type="primary">上传</el-button>
               </el-upload>
               <div class="fileInfo" v-else>
                 <div class="fileName">{{ IDCardFrontName }}</div>
                 <div class="fileBtn">
-                  <el-upload action="#" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 1)" style="display: flex; align-items: center">
+                  <el-upload :show-file-list="false" :auto-upload="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>
@@ -132,13 +140,13 @@
               </div>
             </el-form-item>
             <el-form-item prop="" label="身份证(国徽面)" label-width="150">
-              <el-upload v-if="!IDCardBack" action="#" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 2)">
+              <el-upload v-if="!IDCardBack" :auto-upload="false"  :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 2)">
                 <el-button link type="primary">上传</el-button>
               </el-upload>
               <div class="fileInfo" v-else>
                 <div class="fileName">{{ IDCardBackName }}</div>
                 <div class="fileBtn">
-                  <el-upload action="#" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 2)" style="display: flex; align-items: center">
+                  <el-upload :auto-upload="false" :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>
@@ -148,13 +156,13 @@
               </div>
             </el-form-item>
             <el-form-item prop="" label="展业资格证" label-width="150">
-              <el-upload v-if="!certification" action="#" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 3)">
+              <el-upload :auto-upload="false" v-if="!certification"  :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 3)">
                 <el-button link type="primary">上传</el-button>
               </el-upload>
               <div class="fileInfo" v-else>
                 <div class="fileName">{{ certificationName }}</div>
                 <div class="fileBtn">
-                  <el-upload action="#" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 3)" style="display: flex; align-items: center">
+                  <el-upload :auto-upload="false" :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>
@@ -177,17 +185,18 @@
               <el-col :span="10">
                 <el-form-item prop="sex" label="性别">
                   <el-select v-model="operationForm.sex" placeholder="请选择性别">
-                    <el-option key="1" value="类型1"></el-option>
+                    <el-option v-for="item in options[0]" :key="item.value" :value="item.value" :label="item.label"></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="10">
-                <el-form-item prop="born" label="出生日期">
+                <el-form-item prop="birthday" label="出生日期">
                   <el-date-picker
                     v-model="operationForm.birthday"
                     type="date"
                     placeholder="请选择"
                     format="YYYY-MM-DD"
+                    value-format="YYYY-MM-DD"
                     style="width: 100%"
                   />
                 </el-form-item>
@@ -195,58 +204,62 @@
             </el-row>
             <el-row :gutter="20">
               <el-col :span="10">
-                <el-form-item prop="type" label="民族">
+                <el-form-item prop="nations" label="民族">
                   <el-select v-model="operationForm.nations" placeholder="请选择业务员类型">
-                    <el-option key="1" value="类型1"></el-option>
+                    <el-option v-for="item in options[1]" :key="item.value" :value="item.value" :label="item.label"></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="10">
-                <el-form-item prop="team" label="户籍">
+                <el-form-item prop="koseki" label="户籍">
                   <el-input v-model="operationForm.koseki" placeholder="请填写户籍"></el-input>
                 </el-form-item>
               </el-col>
             </el-row>
             <el-row :gutter="20">
               <el-col :span="10">
-                <el-form-item prop="type" label="婚姻状况">
+                <el-form-item prop="maritalStatus" label="婚姻状况">
                   <el-select v-model="operationForm.maritalStatus" placeholder="请选择婚姻状况">
-                    <el-option key="1" value="类型1"></el-option>
+                    <el-option v-for="item in options[2]" :key="item.value" :value="item.value" :label="item.label"></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="10">
-                <el-form-item prop="team" label="政治面貌">
+                <el-form-item prop="politicsStatus" label="政治面貌">
                   <el-select v-model="operationForm.politicsStatus" placeholder="请选择政治面貌">
-                    <el-option key="1" value="团队1"></el-option>
+                    <el-option v-for="item in options[3]" :key="item.value" :value="item.value" :label="item.label"></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
             </el-row>
             <el-row :gutter="20">
               <el-col :span="10">
-                <el-form-item prop="type" label="健康状况">
+                <el-form-item prop="health" label="健康状况">
                   <el-select v-model="operationForm.health" placeholder="请选择健康状况">
-                    <el-option key="1" value="类型1"></el-option>
+                    <el-option v-for="item in options[4]" :key="item.value" :value="item.value" :label="item.label"></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="10">
-                <el-form-item prop="team" label="居住地区">
-                  <el-select v-model="operationForm.address" placeholder="请选择居住地区">
-                    <el-option key="1" value="团队1"></el-option>
-                  </el-select>
+                <el-form-item prop="address" label="居住地区">
+                  <el-cascader
+                    clearable
+                    style="width: 100%"
+                    v-model="operationForm.address"
+                    :options="areaOptions"
+                    :props="areaProps"
+                  />
                 </el-form-item>
               </el-col>
             </el-row>
             <el-row :gutter="20">
               <el-col :span="10">
-                <el-form-item prop="team" label="详细地址">
+                <el-form-item prop="liveAddress" label="详细地址">
                   <el-input v-model="operationForm.liveAddress" placeholder="请填写详细地址"></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="10">
-                <el-form-item prop="team" label="邮政编码">
+                <el-form-item prop="postalCode" label="邮政编码">
                   <el-input v-model="operationForm.postalCode" placeholder="请填写邮政编码"></el-input>
                 </el-form-item>
               </el-col>
@@ -259,19 +272,20 @@
           <template #default>
             <el-row :gutter="20">
               <el-col :span="10">
-                <el-form-item prop="sex" label="学历">
+                <el-form-item prop="education" label="学历">
                   <el-select v-model="operationForm.education" placeholder="请选择学历">
-                    <el-option key="1" value="类型1"></el-option>
+                    <el-option v-for="item in options[5]" :key="item.value" :value="item.value" :label="item.label"></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="10">
-                <el-form-item prop="born" label="毕业时间">
+                <el-form-item prop="graduationTime" label="毕业时间">
                   <el-date-picker
                     v-model="operationForm.graduationTime"
                     type="date"
                     placeholder="请选择"
                     format="YYYY-MM-DD"
+                    value-format="YYYY-MM-DD"
                     style="width: 100%"
                   />
                 </el-form-item>
@@ -279,15 +293,15 @@
             </el-row>
             <el-row :gutter="20">
               <el-col :span="10">
-                <el-form-item prop="type" label="毕业院校">
+                <el-form-item prop="school" label="毕业院校">
                   <el-input v-model="operationForm.school" placeholder="请填写毕业院校"></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="10">
-                <el-form-item prop="team" label="是否计算机专业">
+                <el-form-item prop="isComputer" label="是否计算机专业">
                   <el-select v-model="operationForm.isComputer" placeholder="请选择是否计算机专业">
-                    <el-option key="是" value="是"></el-option>
-                    <el-option key="否" value="否"></el-option>
+                    <el-option key="1" value="1" label="是"></el-option>
+                    <el-option key="0" value="0" label="否"></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
@@ -300,12 +314,12 @@
           <template #default>
             <el-row :gutter="20">
               <el-col :span="10">
-                <el-form-item prop="team" label="姓名">
+                <el-form-item prop="emergencyContactName" label="姓名">
                   <el-input v-model="operationForm.emergencyContactName" placeholder="请填写姓名"></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="10">
-                <el-form-item prop="team" label="手机号">
+                <el-form-item prop="emergencyContactTel" label="手机号">
                   <el-input v-model="operationForm.emergencyContactTel" placeholder="请填写手机号"></el-input>
                 </el-form-item>
               </el-col>
@@ -318,25 +332,27 @@
           <template #default>
             <el-row :gutter="20">
               <el-col :span="10">
-                <el-form-item prop="team" label="工资">
+                <el-form-item prop="salary" label="工资">
                   <el-input v-model="operationForm.salary" placeholder="请填写工资"></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="10">
-                <el-form-item prop="team" label="工资等级">
+                <el-form-item prop="salaryLevel" label="工资等级">
                   <el-input v-model="operationForm.salaryLevel" placeholder="请填写工资等级"></el-input>
                 </el-form-item>
               </el-col>
             </el-row>
             <el-row :gutter="20">
               <el-col :span="10">
-                <el-form-item prop="team" label="银行卡号">
+                <el-form-item prop="bankCardId" label="银行卡号">
                   <el-input v-model="operationForm.bankCardId" placeholder="请填写银行卡号"></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="10">
-                <el-form-item prop="team" label="开户行">
-                  <el-input v-model="operationForm.bankName" placeholder="请填写开户行"></el-input>
+                <el-form-item prop="bankName" label="开户行">
+                  <el-select v-model="operationForm.bankName" placeholder="请选择开户行">
+                    <el-option v-for="item in bankOption" :key="item.id" :value="item.id" :label="item.label"></el-option>
+                  </el-select>
                 </el-form-item>
               </el-col>
             </el-row>
@@ -348,13 +364,13 @@
         <el-descriptions-item>
           <template #default>
             <el-form-item prop="" label="劳动合同" label-width="150">
-              <el-upload v-if="!contract" action="#" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 4)">
+              <el-upload v-if="!contract" :auto-upload="false" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 4)">
                 <el-button link type="primary">上传</el-button>
               </el-upload>
               <div class="fileInfo" v-else>
                 <div class="fileName">{{ contractName }}</div>
                 <div class="fileBtn">
-                  <el-upload action="#" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 4)" style="display: flex; align-items: center">
+                  <el-upload :auto-upload="false" :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>
@@ -364,13 +380,13 @@
               </div>
             </el-form-item>
             <el-form-item prop="" label="应聘表" label-width="150">
-              <el-upload v-if="!applicant" action="#" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 5)">
+              <el-upload v-if="!applicant" :auto-upload="false" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 5)">
                 <el-button link type="primary">上传</el-button>
               </el-upload>
               <div class="fileInfo" v-else>
                 <div class="fileName">{{ applicantName }}</div>
                 <div class="fileBtn">
-                  <el-upload action="#" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 5)" style="display: flex; align-items: center">
+                  <el-upload :auto-upload="false"  :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>
@@ -380,13 +396,13 @@
               </div>
             </el-form-item>
             <el-form-item prop="" label="定薪表" label-width="150">
-              <el-upload v-if="!decidePay" action="#" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 6)">
+              <el-upload :auto-upload="false" v-if="!decidePay"  :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 6)">
                 <el-button link type="primary">上传</el-button>
               </el-upload>
               <div class="fileInfo" v-else>
                 <div class="fileName">{{ decidePayName }}</div>
                 <div class="fileBtn">
-                  <el-upload action="#" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 6)" style="display: flex; align-items: center">
+                  <el-upload :auto-upload="false"  :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>
@@ -396,13 +412,13 @@
               </div>
             </el-form-item>
             <el-form-item prop="" label="离职表" label-width="150">
-              <el-upload v-if="!dimission" action="#" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 7)">
+              <el-upload :auto-upload="false" v-if="!dimission"  :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 7)">
                 <el-button link type="primary">上传</el-button>
               </el-upload>
               <div class="fileInfo" v-else>
                 <div class="fileName">{{ dimissionName }}</div>
                 <div class="fileBtn">
-                  <el-upload action="#" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage($event, 7)" style="display: flex; align-items: center">
+                  <el-upload :auto-upload="false"  :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>
@@ -415,7 +431,7 @@
         </el-descriptions-item>
       </el-descriptions>
       <div style="display: flex; justify-content: flex-end">
-        <el-button @click="onSubmit(0)">取消</el-button>
+        <el-button @click="onSubmit(OperationFormRef, 0)">取消</el-button>
         <el-button type="primary" @click="onSubmit(OperationFormRef, 1)">确定</el-button>
       </div>
     </el-form>
@@ -426,27 +442,29 @@
 </template>
 
 <script setup lang="ts">
-import { ref, defineEmits } from 'vue'
+import { ref, reactive, defineEmits, onMounted } from 'vue'
 import type { AddOperation } from '@/api/modules/operation.ts'
 import type { FormRules, FormInstance } from "element-plus";
 import api from "@/api";
-import {ElMessage} from "element-plus";
+import { ElMessage } from "element-plus";
 
 interface OperationFormProps extends AddOperation {
   organization: string
   leaderNumber: string,
   referrerNumber: string,
-  address?: string[]
+  address?: string[],
+  id?: string
 }
 
 let emits = defineEmits(['closeDialog'])
-
+let option = ref([])
 const OperationFormRef = ref<FormInstance>()
 // 添加/编辑业务员表单
 let operationForm = ref<OperationFormProps>({
   typeAttr: '',
   deptId: '',
-  username: '',
+  organizationId: '',
+  name: '',
   mobile: '',
   identity: '',
   identityTimeStart: '',
@@ -456,30 +474,44 @@ let operationForm = ref<OperationFormProps>({
   referrerId: '',
   referrerNumber: '',
 
-  sex: '',
-  birthday: '',
-  nations: '',
-  koseki: '',
-  maritalStatus: '',
-  politicsStatus: '',
-  health: '',
-  province: '',
-  city: '',
-  district: '',
+  sex: null,
+  birthday: null,
+  nations: null,
+  koseki: null,
+  maritalStatus: null,
+  politicsStatus: null,
+  health: null,
+  province: null,
+  city: null,
+  district: null,
   address: [],
-  liveAddress: '',
-  postalCode: '',
-  education: '',
-  graduationTime: '',
-  school: '',
-  isComputer: '',
-  emergencyContactName: '',
-  emergencyContactTel: '',
-  salary: '',
-  salaryLevel: '',
-  bankCardId: '',
-  bankName: ''
+  liveAddress: null,
+  postalCode: null,
+  education: null,
+  graduationTime: null,
+  school: null,
+  isComputer: null,
+  emergencyContactName: null,
+  emergencyContactTel: null,
+  salary: null,
+  salaryLevel: null,
+  bankCardId: null,
+  bankName: null,
+
+  sfz1: null,
+  sfz2: null,
+  qualification: null,
+  contract: null,
+  applicant: null,
+  salaryTable: null,
+  leaveTable: null
 })
+// 机构数据渲染格式
+const cascaderProps = {
+  value: 'id',
+  label: 'name',
+  children: 'children'
+}
 // 添加/编辑业务员表单校验
 const operationRules = ref<FormRules>({
   typeAttr: [
@@ -488,7 +520,7 @@ const operationRules = ref<FormRules>({
   deptId: [
     { required: true, trigger: "change", message: "请选择所属团队" }
   ],
-  username: [
+  name: [
     { required: true, trigger: "blur", message: "请填写姓名" }
   ],
   mobile: [
@@ -528,6 +560,27 @@ const operationRules = ref<FormRules>({
   referrerNumber: [
     { required: true, trigger: "blur", message: "请填写推荐人工号" }
   ],
+  bankCardId: [
+    {
+      pattern: /^([1-9]{1})(\d{15}|\d{16}|\d{18})$/,
+      message: '请填写正确的银行卡号',
+      trigger: 'blur'
+    }
+  ],
+  emergencyContactTel: [
+    {
+      pattern: /^1[34578][0-9]{9}$/,
+      message: '请填写正确的手机号',
+      trigger: 'blur'
+    }
+  ],
+  postalCode: [
+    {
+      pattern: /^\d{6}$/,
+      message: '请填写正确的邮政编码',
+      trigger: 'blur'
+    }
+  ]
 })
 // 身份证人像面
 let IDCardFrontName = ref('')
@@ -554,49 +607,152 @@ let dimission = ref('')
 let imageShow = ref(false)
 let imageUrl = ref('')
 
+// 编辑时初始化数据
+// 编辑的id
+let editId = ref('')
+const initEditData = (id) => {
+  if(id) {
+    editId.value = id
+    api.operationApi.operationDetail(id).then(res => {
+      if(res?.code == 200) {
+        let formData = res.data
+        operationForm.value = formData
+        operationForm.value.organization = formData.deptName
+        operationForm.value.deptId = formData.deptId
+        operationForm.value.leaderNumber = formData.leaderId
+        operationForm.value.referrerNumber = formData.referrerId
+        let address = []
+        if(formData.province&&formData.city&&formData.district) {
+          address = [formData.province, formData.city, formData.district]
+        }
+        if(formData.province&&!formData.city&&!formData.district) {
+          address = [formData.province]
+        }
+        if(formData.fileList) {
+          let sfz1 = formData.fileList.find(item => item.fileType == 'sfz1')
+          let sfz2 = formData.fileList.find(item => item.fileType == 'sfz2')
+          let qualification = formData.fileList.find(item => item.fileType == 'qualification')
+          let contractImg = formData.fileList.find(item => item.fileType == 'contract')
+          let applicantImg = formData.fileList.find(item => item.fileType == 'applicant')
+          let salaryTable = formData.fileList.find(item => item.fileType == 'salary')
+          let leaveTable = formData.fileList.find(item => item.fileType == 'leave')
+          console.log('图片', formData.fileList)
+          console.log('身份证1', sfz1)
+          console.log('身份证2', sfz1)
+          console.log('展业资格证', qualification)
+          console.log('劳务合同', contract)
+          console.log('应聘表', applicant)
+          console.log('定薪表', salaryTable)
+          console.log('离职表', leaveTable)
+          if(sfz1) {
+            operationForm.value.sfz1 = sfz1.id
+            IDCardFrontName.value = sfz1.fileName
+            IDCardFront.value = sfz1.fileUrl
+          }
+          if(sfz2) {
+            operationForm.value.sfz2 = sfz2.id
+            IDCardBackName.value = sfz2.fileName
+            IDCardBack.value = sfz2.fileUrl
+          }
+          if(qualification) {
+            operationForm.value.qualification = qualification.id
+            certificationName.value = qualification.fileName
+            certification.value = qualification.fileUrl
+          }
+          if(contractImg) {
+            operationForm.value.contract = contract.id
+            contractName.value = contractImg.fileName
+            contract.value = contractImg.fileUrl
+          }
+          if(applicantImg) {
+            operationForm.value.applicant = applicant.id
+            applicantName.value = applicantImg.fileName
+            applicant.value = applicantImg.fileUrl
+          }
+          if(salaryTable) {
+            operationForm.value.salaryTable = salaryTable.id
+            decidePayName.value = salaryTable.fileName
+            decidePay.value = salaryTable.fileUrl
+          }
+          if(leaveTable) {
+            operationForm.value.leaveTable = leaveTable.id
+            dimissionName.value = leaveTable.fileName
+            dimission.value = leaveTable.fileUrl
+          }
+        }
+        operationForm.value.address = address
+        getUser(operationForm.value.deptId)
+        console.log(123123123, operationForm.value)
+      } else {
+        ElMessage({
+          message: res.msg,
+          type: 'warning'
+        })
+      }
+    })
+  }
+}
+
+// 上传接口
+let postUrl = ref(`${import.meta.env.VITE_APP_API_BASEURL}/file/upload`)
 // 上传图片
-const uploadImage = (file, type) => {
+const uploadImage = async (file, type) => {
   let files = file.raw
-  let url = window.URL.createObjectURL(files); //转临时路径
-  console.log(123123123, file, type)
-  switch (type) {
-    case 1:
-      IDCardFrontName.value = files.name
-      IDCardFront.value = url
-      break;
-    case 2:
-      IDCardBackName.value = files.name
-      IDCardBack.value = url
-      break;
-    case 3:
-      certificationName.value = files.name
-      certification.value = url
-      break;
-    case 4:
-      contractName.value = files.name
-      contract.value = url
-      break;
-    case 5:
-      applicantName.value = files.name
-      applicant.value = url
-      break;
-    case 6:
-      decidePayName.value = files.name
-      decidePay.value = url
-      break;
-    case 7:
-      dimissionName.value = files.name
-      dimission.value = url
-      break;
-  }
   const params = new FormData(); // 声明formData数据类型
-  params.append("multipartFile", files);
+  params.append("file", files);
   params.append("type", "image");
+  const { code, data, msg } = await api.commonApi.fileUpload(params)
+    if(code == 200) {
+      let result = {...data}
+      switch (type) {
+        case 1:
+          IDCardFrontName.value = result.fileName
+          IDCardFront.value = result.downloadUrl
+          operationForm.value.sfz1 = result.id
+          break;
+        case 2:
+          IDCardBackName.value = result.fileName
+          IDCardBack.value = result.downloadUrl
+          operationForm.value.sfz2 = result.id
+          break;
+        case 3:
+          certificationName.value = result.fileName
+          certification.value = result.downloadUrl
+          operationForm.value.qualification = result.id
+          break;
+        case 4:
+          contractName.value = result.fileName
+          contract.value = result.downloadUrl
+          operationForm.value.contract = result.id
+          break;
+        case 5:
+          applicantName.value = result.fileName
+          applicant.value = result.downloadUrl
+          operationForm.value.applicant = result.id
+          break;
+        case 6:
+          decidePayName.value = result.fileName
+          decidePay.value = result.downloadUrl
+          operationForm.value.salaryTable = result.id
+          break;
+        case 7:
+          dimissionName.value = result.fileName
+          dimission.value = result.downloadUrl
+          operationForm.value.leaveTable = result.id
+          break;
+      }
+    } else {
+      ElMessage({
+        message: msg,
+        type: 'error'
+      })
+    }
 }
 
 // 人事档案
 let recordShow = ref(false)
 
+// 图片预览
 const imageView = (type) => {
   imageShow.value = true
   switch (type) {
@@ -623,25 +779,221 @@ const imageView = (type) => {
       break;
   }
 }
-
+// 管理人/推荐人
+let userList = ref([])
+const getUser = (id) => {
+  api.operationApi.getUser(id).then(res => {
+    if(res?.code == 200) {
+      userList.value = res.data
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
+// 确定
 const onSubmit = async (OperationFormRef: FormInstance, type: number) => {
   if(!OperationFormRef) {
-    emits('closeDialog', false)
+    emits('closeDialog', '取消')
+    recordShow.value = false
+    OperationFormRef.resetFields()
     return
   }
-  await OperationFormRef.validate((valid) => {
-    if(valid) {
-      api.operationApi.addOperation(operationForm.value).then(res => {
-        console.log(123, res)
-      })
+  if(type) {
+    await OperationFormRef.validate((valid, error) => {
+      if(valid) {
+        let formData = {...operationForm.value}
+        // formData.organization = operationForm.value.organization[operationForm.value.organization.length - 1]
+        formData.systemCode = localStorage.getItem('login_system')?localStorage.getItem('login_system'):''
+        formData.province = operationForm.value.address?operationForm.value.address[0]:''
+        formData.city = operationForm.value.address?operationForm.value.address[1]?operationForm.value.address[1]:'':''
+        formData.district = operationForm.value.address?operationForm.value.address[2]?operationForm.value.address[2]:'':''
+        if(editId.value) {
+          api.operationApi.updateOperation(formData).then(res => {
+            if(res.code == 200) {
+              ElMessage({
+                message: res.msg,
+                type: 'success'
+              })
+              emits('closeDialog', '确定')
+            } else {
+              ElMessage({
+                message: res.msg,
+                type: 'error'
+              })
+            }
+            IDCardFrontName.value = ''
+            IDCardFront.value = ''
+            IDCardBackName.value = ''
+            IDCardBack.value = ''
+            certificationName.value = ''
+            certification.value = ''
+            contractName.value = ''
+            contract.value = ''
+            applicantName.value = ''
+            applicant.value = ''
+            decidePayName.value = ''
+            decidePay.value = ''
+            dimissionName.value = ''
+            dimission.value = ''
+            recordShow.value = false
+            OperationFormRef.resetFields()
+            emits('closeDialog', '取消')
+          })
+        } else {
+          api.operationApi.addOperation(formData).then(res => {
+            if(res.code == 200) {
+              ElMessage({
+                message: res.msg,
+                type: 'success'
+              })
+              emits('closeDialog', '确定')
+            } else {
+              ElMessage({
+                message: res.msg,
+                type: 'error'
+              })
+            }
+            IDCardFrontName.value = ''
+            IDCardFront.value = ''
+            IDCardBackName.value = ''
+            IDCardBack.value = ''
+            certificationName.value = ''
+            certification.value = ''
+            contractName.value = ''
+            contract.value = ''
+            applicantName.value = ''
+            applicant.value = ''
+            decidePayName.value = ''
+            decidePay.value = ''
+            dimissionName.value = ''
+            dimission.value = ''
+            recordShow.value = false
+            OperationFormRef.resetFields()
+            emits('closeDialog', '取消')
+          })
+        }
+      } else {
+        Object.keys(error).forEach((key,i)=>{
+          if(i==0){
+            const firstFiled = error[key][0].field
+            OperationFormRef.scrollToField(firstFiled)
+          }
+        })
+        ElMessage({
+          message: '请正确填写相关信息!',
+          type: 'warning'
+        })
+      }
+    })
+  } else {
+    IDCardFrontName.value = ''
+    IDCardFront.value = ''
+    IDCardBackName.value = ''
+    IDCardBack.value = ''
+    certificationName.value = ''
+    certification.value = ''
+    contractName.value = ''
+    contract.value = ''
+    applicantName.value = ''
+    applicant.value = ''
+    decidePayName.value = ''
+    decidePay.value = ''
+    dimissionName.value = ''
+    dimission.value = ''
+    recordShow.value = false
+    emits('closeDialog', '取消')
+    OperationFormRef.resetFields()
+  }
+}
+
+// 初始化个人信息
+let options = ref([])
+const initInfo = () => {
+/*
+* 性别        gender
+  民族        nation
+  婚姻状况        marriage
+  政治面貌        political_status
+  健康状况        health_status
+  学历        educational
+* */
+  let infoList = ['gender', 'nation', 'marriage', 'political_status', 'health_status', 'educational']
+  infoList.forEach((item: string, index: number) => {
+    api.commonApi.personInfo(item).then((res) => {
+      if(res?.code == 200) {
+        options.value[index] = [...res.data]
+      } else {
+        ElMessage({
+          message: res.msg,
+          type: 'warning'
+        })
+      }
+    })
+  })
+}
+// 获取地区数据
+const areaOptions = ref([]);
+const areaProps = ref({
+  value: "areaCode",
+  label: "areaCname",
+  children: "child",
+});
+const getArea = () => {
+  api.areaApi.areaList({}).then((res) => {
+    areaOptions.value = res.data;
+  });
+}
+
+// 团队数据
+let teamList = ref([])
+const getTeamList = async () => {
+  const { code, data, msg } = await api.teamApi.teamList({})
+  if(code == 200) {
+    teamList.value = data
+  } else {
+    ElMessage({
+      message: msg,
+      type: 'warning'
+    })
+  }
+}
+const deptChange = (e) => {
+  const obj = teamList.value.find(item => item.id == e)
+  operationForm.value.organization = obj.deptName
+  operationForm.value.deptId = obj.deptId
+  getUser(obj.deptId)
+}
+
+// 初始化银行数据
+let bankOption = ref([])
+const initBankCard = () => {
+  api.commonApi.personInfo('bank_info').then(res => {
+    if(res.code == 200) {
+      bankOption.value = res.data
     } else {
       ElMessage({
-        message: '请正确填写相关信息!',
+        message: res.msg,
         type: 'warning'
       })
     }
   })
 }
+
+onMounted(() => {
+  initInfo()
+  getArea()
+  getTeamList()
+  initBankCard()
+})
+
+defineExpose({
+  initEditData
+})
+
+
 </script>
 
 <style scoped lang="scss">

+ 170 - 0
src/views/operationManagement/modules/addTeam.vue

@@ -0,0 +1,170 @@
+<template>
+  <div class="addTeam">
+    <el-form ref="AddTeamRef" :model="teamForm" :rules="teamRules" label-width="100">
+      <el-form-item label="团队名称" prop="name">
+        <el-input v-model="teamForm.name" placeholder="请输入团队名称"></el-input>
+      </el-form-item>
+      <el-form-item label="所属机构" prop="deptId">
+        <el-cascader
+          clearable
+          v-model="teamForm.deptId"
+          :options="option"
+          :props="cascaderProps"
+          style="width: 100%"
+          placeholder="选择机构"
+          @change="deptIdChange"
+        ></el-cascader>
+      </el-form-item>
+      <el-form-item label="管理人" prop="managerId">
+        <el-select v-model="teamForm.managerId" placeholder="选择管理人">
+          <el-option v-for="item in userList" :key="item.id" :value="item.id" :label="item.name"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="管理人工号" prop="managerId">
+        <el-input disabled v-model="teamForm.managerId"></el-input>
+      </el-form-item>
+      <el-form-item label="描述" prop="describeInformation">
+        <el-input type="textarea" maxlength="500" placeholder="请输入" v-model="teamForm.describeInformation"></el-input>
+      </el-form-item>
+      <div style="display: flex; justify-content: flex-end">
+        <el-button @click="onSubmit(AddTeamRef, 0)">取消</el-button>
+        <el-button type="primary" @click="onSubmit(AddTeamRef, 1)">确定</el-button>
+      </div>
+    </el-form>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref, defineEmits, onMounted, defineProps, defineExpose } from 'vue'
+import type { FormRules, FormInstance } from 'element-plus'
+import type { AddTeamProps } from '@/api/modules/team.ts'
+import { ElMessage } from "element-plus";
+import api from "@/api";
+
+interface EditDataProps extends AddTeamProps {
+  id: string
+}
+
+let emits = defineEmits(['closeDialog'])
+
+// 表单
+const AddTeamRef = ref<FormInstance>()
+let teamForm = ref<AddTeamProps>({
+  name: '',
+  deptId: [],
+  managerId: '',
+  describeInformation: '',
+  attribute: 1
+})
+
+
+let teamRules = ref<FormRules>({
+  name: [
+    { required: true, trigger: "blur", message: "请填写团队名称" }
+  ],
+  deptId: [
+    { required: true, trigger: "change", message: "请选择机构" }
+  ],
+  managerId: [
+    { required: true, trigger: "change", message: "请选择管理人" }
+  ]
+})
+
+const initEdit = (data) => {
+
+}
+
+// 机构
+let option = ref([])
+const cascaderProps = {
+  value: 'id',
+  label: 'name',
+  children: 'children'
+}
+// 获取机构数据
+const institutionList = () => {
+  api.institutionApi.institutionList({ name: '', system: '' }).then(res => {
+    if(res?.code == 200) {
+      option.value = res.data
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
+const deptIdChange = (e) => {
+  let id = e?e[e.length - 1]: ''
+  getUser(id)
+}
+
+// 管理人
+let userList = ref([])
+const getUser = (id) => {
+  api.operationApi.getUser(id).then(res => {
+    if(res?.code == 200) {
+      userList.value = res.data
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
+
+// 提交/取消
+const onSubmit = async (AddTeamRef: FormInstance, type) => {
+  if(!AddTeamRef) {
+    emits('closeDialog', '取消')
+    AddTeamRef.resetFields()
+    return
+  }
+  if(type) {
+    await AddTeamRef.validate((valid) => {
+      if(valid) {
+        let formData = {...teamForm.value}
+        formData.deptId = teamForm.value.deptId[teamForm.value.deptId.length - 1]
+        formData.systemCode = localStorage.getItem('login_system')
+        api.teamApi.addTeam(formData).then(res => {
+          if(res.code == 200) {
+            ElMessage({
+              message: res.msg,
+              type: 'success'
+            })
+          } else {
+            ElMessage({
+              message: res.msg,
+              type: 'warning'
+            })
+          }
+          emits('closeDialog', '确认')
+          AddTeamRef.resetFields()
+        })
+      } else {
+        ElMessage({
+          message: '请正确填写相关信息!',
+          type: 'warning'
+        })
+      }
+    })
+  } else {
+    emits('closeDialog', '取消')
+    AddTeamRef.resetFields()
+  }
+}
+
+onMounted(() => {
+  institutionList()
+})
+
+defineExpose({
+  initEdit
+})
+
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 129 - 74
src/views/operationManagement/modules/allocation.vue

@@ -1,108 +1,163 @@
 <template>
   <div class="allocation">
-    <el-input v-model="searchValue" style="width: 240px" placeholder="输入姓名、手机号、工号查找">
+    <el-input v-model="searchValue" style="width: 240px" placeholder="输入姓名、手机号、工号查找" clearable>
       <template #prefix>
-        <el-icon class="el-input__icon" @click="handleSearch"><Search /></el-icon>
+        <el-icon class="el-input__icon"><Search /></el-icon>
       </template>
     </el-input>
     <el-row :gutter="20" class="allocation-content">
-      <el-col :span="12" style="padding: 10px">
+      <el-col :span="12" style="padding: 10px; box-sizing: border-box;">
         <el-tree
-          :data="data"
+          ref="treeRef"
+          :data="options"
+          :props="cascaderProps"
+          node-key="id"
+          :default-expanded-keys="expandedKeys"
+          :default-checked-keys="checkedKeys"
           @node-click="handleNodeClick"
+          :filter-node-method="filterNode"
         />
       </el-col>
-      <el-col :span="12" style="padding: 10px">
-        <el-radio-group v-model="radioValue" class="allocation-radio">
-          <el-radio value="1" size="large">
+      <el-col :span="12" style="padding: 10px; box-sizing: border-box;border-left: 1px solid #ccc;">
+        <el-radio-group v-if="userList?.length>0" v-model="radioValue" class="allocation-radio">
+          <el-radio v-for="item in userList" :value="item.id" size="large">
             <template #default>
-              <div>姓名1</div>
-              <div>99140109M60D01001</div>
-            </template>
-          </el-radio>
-          <el-radio value="1" size="large">
-            <template #default>
-              <div>姓名2</div>
-              <div>99140109M60D01001</div>
+              <div>{{ item.name }}</div>
+              <div>{{ item.id }}</div>
             </template>
           </el-radio>
         </el-radio-group>
+        <el-empty v-else description="暂无数据" />
       </el-col>
     </el-row>
+    <div style="display: flex; justify-content: flex-end">
+      <el-button @click="onSubmit('取消')">取消</el-button>
+      <el-button type="primary" @click="onSubmit('确定')">确定</el-button>
+    </div>
   </div>
 </template>
 
 <script setup lang="ts">
-import { ref } from 'vue'
+import { ref, onMounted, defineEmits } from 'vue'
+import api from '@/api'
+import { ElMessage } from 'element-plus'
+
+const cascaderProps = {
+  value: 'id',
+  label: 'name',
+  children: 'children'
+}
+
+let emits = defineEmits(['closeDialog'])
 
+// 初始化负责人
+let userList = ref([])
+const initUser = (id) => {
+  api.operationApi.getUser(id).then(res => {
+    if(res.code == 200) {
+      userList.value = res.data
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
+
+// 初始化默认选中的数据
+let checkedKeys = ref([])
+let selectedIds = ref([])
+const initCheckedKeys = (id, type, ids) => {
+  checkedKeys.value = [id]
+  selectedIds.value = [...ids]
+  initUser(id)
+  radioValue.value = ''
+}
+
+// 搜索过滤
 let searchValue = ref('')
+const treeRef = ref(null)
+watch(searchValue, (val) => {
+  treeRef.value!.filter(val);
+});
 const handleSearch = () => {
-
+  filterNode(searchValue.value, options.value)
 }
 
-let data = [
-  {
-    label: 'Level one 1',
-    children: [
-      {
-        label: 'Level two 1-1',
-        children: [
-          {
-            label: 'Level three 1-1-1',
-          },
-        ],
-      },
-    ],
-  },
-  {
-    label: 'Level one 2',
-    children: [
-      {
-        label: 'Level two 2-1',
-        children: [
-          {
-            label: 'Level three 2-1-1',
-          },
-        ],
-      },
-      {
-        label: 'Level two 2-2',
-        children: [
-          {
-            label: 'Level three 2-2-1',
-          },
-        ],
-      },
-    ],
-  },
-  {
-    label: 'Level one 3',
-    children: [
-      {
-        label: 'Level two 3-1',
-        children: [
-          {
-            label: 'Level three 3-1-1',
-          },
-        ],
-      },
-      {
-        label: 'Level two 3-2',
-        children: [
-          {
-            label: 'Level three 3-2-1',
-          },
-        ],
-      },
-    ],
-  },
-]
+// 机构数据
+let options = ref([])
+// 默认展开
+let expandedKeys = ref([])
+// 获取机构数据
+const institutionList = () => {
+  api.institutionApi.institutionList({ name: '', system: '' }).then(res => {
+    if(res?.code == 200) {
+      options.value = res.data
+      if(options.value) {
+        let list = []
+        options.value.forEach(item => {
+          list.push(item.id)
+        })
+        expandedKeys.value = [...list]
+      }
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
 const handleNodeClick = (data) => {
   console.log(data)
+  initUser(data.id)
+}
+const filterNode = (value: string, data: any) => {
+  if (!value) return true
+  return data.name.includes(value)
 }
 
 let radioValue = ref('')
 
+const onSubmit = (type) => {
+  if(type == '确定') {
+    if(!radioValue.value) {
+      ElMessage({
+        message: '请选择管理人',
+        type: 'warning'
+      })
+      return
+    }
+    api.operationApi.setLeader({
+      ids: selectedIds.value,
+      leaderId: radioValue.value,
+      getAll: 0
+    }).then(res => {
+      if(res.code == 200) {
+        ElMessage({
+          message: res.msg,
+          type: 'success'
+        })
+      } else {
+        ElMessage({
+          message: res.msg,
+          type: 'warning'
+        })
+      }
+    })
+  }
+  emits('closeDialog', false)
+}
+
+onMounted(() => {
+  institutionList()
+})
+
+defineExpose({
+  initCheckedKeys
+})
+
 </script>
 
 <style scoped lang="scss">

+ 194 - 76
src/views/operationManagement/operation.vue

@@ -9,20 +9,21 @@
       <el-row :gutter="20">
         <el-col :span="8">
           <el-form-item label="业务员" class="formItem">
-            <el-input v-model="form.salesman" placeholder="输入姓名、手机号、工号查找"></el-input>
+            <el-input v-model="form.salesman" placeholder="输入姓名、手机号、工号查找" clearable></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="归属机构" class="formItem">
-            <el-cascader style="width: 100%" :options="options" @change="organizationChange" />
+            <el-cascader clearable style="width: 100%" :options="options" :props="cascaderProps" @change="organizationChange"  />
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="类型" class="formItem">
-            <el-select v-model="form.typeAttr">
-              <el-option key="1" value="type1"></el-option>
-              <el-option key="2" value="type2"></el-option>
-              <el-option key="3" value="type3"></el-option>
+            <el-select clearable v-model="form.typeAttr">
+              <el-option key="1" value="0" label="个代"></el-option>
+              <el-option key="2" value="1" label="渠道"></el-option>
+              <el-option key="3" value="2" label="团队"></el-option>
+              <el-option key="4" value="3" label="电销组"></el-option>
             </el-select>
           </el-form-item>
         </el-col>
@@ -30,23 +31,24 @@
       <el-row :gutter="20">
         <el-col :span="8">
           <el-form-item label="所属" class="formItem">
-            <el-input v-model="form.deptName" placeholder="渠道、团队、电销组名称查找"></el-input>
+            <el-input clearable v-model="form.deptName" placeholder="渠道、团队、电销组名称查找"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="人员状态" class="formItem">
-            <el-select v-model="form.status">
-              <el-option key="1" value="type1"></el-option>
-              <el-option key="2" value="type2"></el-option>
-              <el-option key="3" value="type3"></el-option>
+            <el-select clearable v-model="form.status">
+              <el-option key="4" value="0" label="待认证"></el-option>
+              <el-option key="1" value="1" label="已认证"></el-option>
+              <el-option key="2" value="2" label="待提交资料"></el-option>
+              <el-option key="3" value="3" label="已入职"></el-option>
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="账号状态" class="formItem">
-            <el-select v-model="form.isEnable">
-              <el-option key="0" value="用"></el-option>
-              <el-option key="1" value="用"></el-option>
+            <el-select clearable v-model="form.isEnable">
+              <el-option key="0" value="0" label="启用"></el-option>
+              <el-option key="1" value="1" label="禁用"></el-option>
             </el-select>
           </el-form-item>
         </el-col>
@@ -54,7 +56,7 @@
       <el-row :gutter="20">
         <el-col :span="8">
           <el-form-item label="管理人" class="formItem">
-            <el-input v-model="form.leaderId" placeholder="管理人姓名、工号"></el-input>
+            <el-input clearable v-model="form.leaderId" placeholder="管理人姓名、工号"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
@@ -67,8 +69,8 @@
       <el-col :span="3" style="display: flex">
         <el-checkbox @change="selectAll" v-model="selectAllValue"></el-checkbox>&nbsp;
         <el-select class="select-all" placeholder="全选" v-model="selectType" style="width: 120px" @change="selectTypeChange">
-          <el-option key="all" value="选中所有数据"></el-option>
-          <el-option key="cur" value="选中本页数据"></el-option>
+          <el-option key="all" value="all" label="选中所有数据"></el-option>
+          <el-option key="cur" value="cur" label="选中本页数据"></el-option>
         </el-select>
       </el-col>
       <el-col :span="2">
@@ -95,14 +97,26 @@
       @selection-change="handleSelectionChange"
     >
       <el-table-column type="selection" width="55"></el-table-column>
-      <el-table-column label="姓名" prop="username" width="80"></el-table-column>
+      <el-table-column label="姓名" prop="name" width="80"></el-table-column>
       <el-table-column label="手机号" prop="mobile" width="150"></el-table-column>
       <el-table-column label="工号" prop="userId" width="200"></el-table-column>
-      <el-table-column label="类型" prop="typeAttr" width="100"></el-table-column>
-      <el-table-column label="归属" prop="deptName" width="200"></el-table-column>
+      <el-table-column label="类型" prop="typeAttr" width="100">
+        <template #default="scope">
+          {{ scope.row.typeAttr == '0'?'个代':scope.row.typeAttr == '1'?'渠道':scope.row.typeAttr == '2'?'团队':scope.row.typeAttr == '3'?'电销组': '' }}
+        </template>
+      </el-table-column>
+      <el-table-column label="归属" prop="organizationName" width="200"></el-table-column>
       <el-table-column label="所属机构" prop="deptName" width="200"></el-table-column>
-      <el-table-column label="人员状态" prop="status" width="150"></el-table-column>
-      <el-table-column label="账号状态" prop="isEnable" width="150"></el-table-column>
+      <el-table-column label="人员状态" prop="status" width="150">
+        <template #default="scope">
+          {{ scope.row.status == '0'?'待认证':scope.row.status == '1'?'已认证':scope.row.status == '2'?'待提交资料':scope.row.status == '3'?'已入职':'' }}
+        </template>
+      </el-table-column>
+      <el-table-column label="账号状态" prop="isEnable" width="150">
+        <template #default="scope">
+          {{ scope.row.isEnable == '1'?'禁用':scope.row.isEnable == '0'?'启用': '--' }}
+        </template>
+      </el-table-column>
       <el-table-column label="管理人" prop="leaderName" width="150"></el-table-column>
       <el-table-column label="管理人工号" prop="leaderId" width="200"></el-table-column>
       <el-table-column label="推荐人" prop="referrerName" width="150"></el-table-column>
@@ -144,43 +158,46 @@
       :title="title"
       width="1000"
     >
-      <addOperation @closeDialog="closeAddOperation"></addOperation>
+      <addOperation ref="AddOperationRef" @closeDialog="closeAddOperation"></addOperation>
     </el-dialog>
     <el-dialog
       v-model="bankCardDialogShow"
       title="添加银行卡"
       width="500"
     >
-      <addCard @closeDialog="closeAddBankCard"></addCard>
+      <addCard @closeDialog="closeAddBankCard" :userInfo="addName"></addCard>
     </el-dialog>
     <el-dialog
       v-model="allocationShow"
       title="分配管理人"
       width="800"
     >
-      <allocation></allocation>
+      <allocation ref="AllocationRef" @closeDialog="closeAllocation"></allocation>
     </el-dialog>
   </div>
 </template>
 
 <script setup lang="ts">
-import { ref } from 'vue'
+import { ref, onMounted, nextTick } from 'vue'
 import { useRouter } from 'vue-router'
 import addOperation from './modules/addOperation.vue'
 import addCard from './modules/addCard.vue'
 import allocation from './modules/allocation.vue'
+import setDept from "@/components/DialogSetDeptLeader/index.vue"
 import type { OperationSearch, OperationIsEnable } from '@/api/modules/operation.ts'
 import api from "@/api";
-import {ElMessageBox, ElMessage, TableInstance} from 'element-plus'
+import { ElMessageBox, ElMessage, TableInstance } from 'element-plus'
 import type { TabBarInstance } from 'element-plus'
 import Allocation from "@/views/operationManagement/modules/allocation.vue";
 
-let muRouter = useRouter()
+let myRouter = useRouter()
 
 const operationListRef = ref<TableInstance>()
+const AddOperationRef = ref(null)
+const AllocationRef = ref(null)
 
 interface TableDataProps {
-  username: string,
+  name: string,
   mobile: string,
   id: string,
   typeAttr: string,
@@ -195,7 +212,7 @@ interface TableDataProps {
 }
 
 const organizationChange = (e) => {
-  console.log(123, e)
+  form.value.deptId = e[e.length - 1]
 }
 
 // 查询条件
@@ -208,36 +225,25 @@ let form = ref<OperationSearch>({
   isEnable: '',
   leaderId: ''
 })
-let options = [
-  {
-    value: 'guide',
-    label: 'Guide',
-    children: [
-      {
-        value: 'disciplines',
-        label: 'Disciplines',
-        children: [
-          {
-            value: 'consistency',
-            label: 'Consistency',
-          },
-          {
-            value: 'feedback',
-            label: 'Feedback',
-          },
-          {
-            value: 'efficiency',
-            label: 'Efficiency',
-          },
-          {
-            value: 'controllability',
-            label: 'Controllability',
-          },
-        ],
-      }
-    ]
-  }
-]
+let options = ref([])
+const cascaderProps = {
+  value: 'id',
+  label: 'name',
+  children: 'children'
+}
+// 获取机构数据
+const institutionList = () => {
+  api.institutionApi.institutionList({ name: '', system: '' }).then(res => {
+    if(res?.code == 200) {
+      options.value = res.data
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
 // 获取列表数据
 const init = () => {
   api.operationApi.operationList({
@@ -258,7 +264,10 @@ const init = () => {
 }
 // 删除
 const operationDel = (id: string[]) => {
-  api.operationApi.operationDelete({ id: id }).then(res => {
+  api.operationApi.operationDelete({
+    ids:id,
+    getAll: selectType.value == 'all'?1:0
+  }).then(res => {
     if(res?.code == 200) {
       ElMessage({
         message: res.msg,
@@ -273,6 +282,7 @@ const operationDel = (id: string[]) => {
     }
   })
 }
+// 启用/禁用
 const operationIsEnable = (data: OperationIsEnable) => {
   api.operationApi.operationIsEnable(data).then(res => {
     if(res?.code == 200) {
@@ -308,29 +318,36 @@ const reset = () => {
   pageSize.value = 10
   init()
 }
+// 选中的数据
+let selectedList = ref<TableDataProps[]>([])
 // 全选的类型
 let selectType = ref('')
 // 外部全选是否勾选
 let selectAllValue = ref(false)
 // 外部的全选
 const selectAll = (type: boolean) => {
-  console.log(1111, type)
   if(type) {
     if(selectType.value) {
       tableData.value.forEach((item: TableDataProps) => {
         operationListRef.value!.toggleRowSelection(item, true)
       })
+      if(selectType.value == 'cur') {
+        selectedList.value = tableData.value
+      } else {
+        selectedList.value = []
+      }
     }
   } else {
     tableData.value.forEach((item: TableDataProps) => {
       operationListRef.value!.toggleRowSelection(item, false)
     })
     selectType.value = ''
+    selectedList.value = []
   }
 }
 // 表格组件中的勾选
 const handleSelectionChange = (row: TableDataProps) => {
-
+  selectedList.value = row
 }
 // 全选类型改变
 const selectTypeChange = (type) => {
@@ -338,6 +355,11 @@ const selectTypeChange = (type) => {
   tableData.value.forEach((item: TableDataProps) => {
     operationListRef.value!.toggleRowSelection(item, true)
   })
+  if(type == 'cur') {
+    selectedList.value = tableData.value
+  } else {
+    selectedList.value =[]
+  }
 }
 // 批量管理
 const dropdownCommand = (e) => {
@@ -351,7 +373,23 @@ const dropdownCommand = (e) => {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
       }).then(( action ) => {
-        init()
+        if(action === 'confirm') {
+          let ids = []
+          if(selectedList.value.length>0) {
+            selectedList.value.forEach(item => {
+              ids.push(item.id)
+            })
+          } else {
+            if(selectType == 'cur') {
+              ElMessage({
+                message: '请选择需要操作的数据',
+                type: 'warning'
+              })
+              return
+            }
+          }
+          operationDel(ids)
+        }
       }).catch(( action ) => {
 
       })
@@ -365,7 +403,28 @@ const dropdownCommand = (e) => {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
       }).then(( action ) => {
-        init()
+        if(action === 'confirm') {
+          let ids = []
+          if(selectedList.value.length>0) {
+            selectedList.value.forEach(item => {
+              ids.push(item.id)
+            })
+          } else {
+            if(selectType == 'cur') {
+              ElMessage({
+                message: '请选择需要操作的数据',
+                type: 'warning'
+              })
+              return
+            }
+          }
+          let data = {
+            ids: ids,
+            isEnable: 1,
+            getAll: selectType.value == 'all'?1:0
+          }
+          operationIsEnable(data)
+        }
       }).catch(( action ) => {
 
       })
@@ -379,7 +438,28 @@ const dropdownCommand = (e) => {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
       }).then(( action ) => {
-        init()
+        if(action === 'confirm') {
+          let ids = []
+          if(selectedList.value.length>0) {
+            selectedList.value.forEach(item => {
+              ids.push(item.id)
+            })
+          } else {
+            if(selectType == 'cur') {
+              ElMessage({
+                message: '请选择需要操作的数据',
+                type: 'warning'
+              })
+              return
+            }
+          }
+          let data = {
+            ids: ids,
+            isEnable: 0,
+            getAll: selectType.value == 'all'?1:0
+          }
+          operationIsEnable(data)
+        }
       }).catch(( action ) => {
 
       })
@@ -412,7 +492,7 @@ const handleCurrentChange = (page) => {
 
 // 详情
 const showDetail = (scope) => {
-  muRouter.push({
+  myRouter.push({
     path: '/operationDetail',
     query: {
       id: scope.row.id
@@ -421,6 +501,10 @@ const showDetail = (scope) => {
 }
 
 // 添加银行卡弹框
+let addName = ref({
+  userJzgInfoId: '',
+  name: '',
+})
 let bankCardDialogShow = ref(false)
 
 // 更多
@@ -428,6 +512,9 @@ const tableDataCommand = (scope, e) => {
   switch (e) {
     case '编辑':
       dialogShow.value = true
+      nextTick(() => {
+        AddOperationRef.value.initEditData(scope.row.id)
+      })
       title.value = '编辑'
       break;
     case '删除':
@@ -441,7 +528,6 @@ const tableDataCommand = (scope, e) => {
       }).then(( action ) => {
         if(action === 'confirm') {
           let ids = [scope.row.id]
-          console.log(123123, ids)
           operationDel(ids)
         }
       }).catch(( action ) => {
@@ -459,16 +545,33 @@ const tableDataCommand = (scope, e) => {
       }).then(( action ) => {
         if(action === 'confirm') {
           let data = {
-            id: [scope.row.id],
-            isEnable: 0
+            ids: [scope.row.id],
+            isEnable: 1,
+            getAll: selectType.value == 'all'?1:0
           }
           operationIsEnable(data)
         }
       }).catch(( action ) => {
 
       })
+      // if(scope.row.isEnable == '0') {
+      //
+      // } else {
+      //   ElMessage({
+      //     message: '该业务员已是禁用状态!',
+      //     type: 'warning'
+      //   })
+      // }
       break;
     case '启用':
+      // if(scope.row.isEnable == '1') {
+      //
+      // } else {
+      //   ElMessage({
+      //     message: '该业务员已是启用状态!',
+      //     type: 'warning'
+      //   })
+      // }
       ElMessageBox({
         title: '启用业务员',
         message: '确定要启用该业务员吗?',
@@ -479,8 +582,9 @@ const tableDataCommand = (scope, e) => {
       }).then(( action ) => {
         if(action === 'confirm'){
           let data = {
-            id: [scope.row.id],
-            isEnable: 1
+            ids: [scope.row.id],
+            isEnable: 0,
+            getAll: selectType.value == 'all'?1:0
           }
           operationIsEnable(data)
         }
@@ -489,10 +593,17 @@ const tableDataCommand = (scope, e) => {
       })
       break;
     case '添加银行卡':
+      addName.value = {
+        userJzgInfoId: scope.row.id,
+        name: scope.row.name,
+      }
       bankCardDialogShow.value = true
       break;
     case '分配管理人':
       allocationShow.value = true
+      nextTick(() => {
+        AllocationRef.value.initCheckedKeys(scope.row.deptId, selectType.value, [scope.row.id])
+      })
       break;
   }
 }
@@ -504,21 +615,28 @@ const addNumber = () => {
 // 添加/编辑业务员弹框
 let dialogShow = ref(false)
 // 关闭新增弹框
-const closeAddOperation = (bool: boolean) => {
-  dialogShow.value = bool
+const closeAddOperation = (text: string) => {
+  if(text == '确定') {
+    init()
+  }
+  dialogShow.value = false
 }
 // 关闭添加银行卡弹框
-const closeAddBankCard = (bool: boolean) => {
-  bankCardDialogShow.value = bool
+const closeAddBankCard = (type: string) => {
+  bankCardDialogShow.value = false
 }
 // 添加/编辑业务员弹框标题
 let title = ref('添加')
 
 // 分配管理人
 let allocationShow = ref(false)
+const closeAllocation = (type: boolean) => {
+  allocationShow.value = type
+}
 
 onMounted(() => {
   init()
+  institutionList()
 })
 
 </script>

+ 244 - 56
src/views/operationManagement/operationDetail.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="detail">
-    <div class="state">
+    <div class="state" v-if="dataDetail?.status == 5">
       <el-icon :size="20" style="color: red; margin: 3px 10px 0 0;">
         <CircleClose />
       </el-icon>
       <div>
         <h3>审核不通过</h3>
-        <p>失败原因。如有问题,请联系审核人员或者拨打客服电话400-400-400。</p>
+        <p>{{ dataDetail?.approvalOpinion }}如有问题,请联系审核人员或者拨打客服电话400-400-400。</p>
         <el-button link type="primary" @click="editDetail">修改并重提交</el-button>
       </div>
     </div>
@@ -15,8 +15,8 @@
         <template #title>
           <el-row :gutter="20" flex justify="space-between">
             <el-col :span="12" style="display: flex; align-items: center;">
-              <span class="firstName">{{ dataDetail.username?dataDetail.username:'' }}</span>
-              <span class="allName">{{ dataDetail.username?dataDetail.username:'--' }}</span>
+              <span class="firstName">{{ initName(dataDetail?.name) }}</span>
+              <span class="allName">{{ dataDetail?.name }}</span>
             </el-col>
             <el-col :span="12" style="display: flex; justify-content: flex-end">
               <el-button plain @click="checkPass">审核通过</el-button>
@@ -36,46 +36,62 @@
             </el-col>
           </el-row>
         </template>
-        <el-descriptions-item label="工号:">工号</el-descriptions-item>
-        <el-descriptions-item label="所属机构:">机构</el-descriptions-item>
-        <el-descriptions-item label="状态:">状态</el-descriptions-item>
-        <el-descriptions-item label="类型:">类型</el-descriptions-item>
-        <el-descriptions-item label="所属团队:">团队</el-descriptions-item>
-        <el-descriptions-item label="创建人:">创建人</el-descriptions-item>
-        <el-descriptions-item label="创建时间:">时间</el-descriptions-item>
+        <el-descriptions-item label="工号:">{{ dataDetail?.userId }}</el-descriptions-item>
+        <el-descriptions-item label="所属机构:">{{ dataDetail?.deptName }}</el-descriptions-item>
+        <el-descriptions-item label="状态:">{{  dataDetail?.status == '0'?'待认证': dataDetail?.status == '1'?'已认证': dataDetail?.status == '2'?'待提交资料': dataDetail?.status == '3'?'已入职':'' }}</el-descriptions-item>
+        <el-descriptions-item label="类型:">{{  dataDetail?.typeAttr == '0'?'个代': dataDetail?.typeAttr == '1'?'渠道': dataDetail?.typeAttr == '2'?'团队': dataDetail?.typeAttr == '3'?'电销组': '' }}</el-descriptions-item>
+        <el-descriptions-item label="所属团队:">{{ dataDetail?.organizationName }}</el-descriptions-item>
+        <el-descriptions-item label="创建人:">{{ dataDetail?.updateBy }}</el-descriptions-item>
+        <el-descriptions-item label="创建时间:">{{ dataDetail?.updateTime }}</el-descriptions-item>
       </el-descriptions>
       <el-tabs v-model="activeName" class="demo-tabs" @tab-click="(tab) => { activeName = tab }">
         <el-tab-pane label="基本信息" name="msg">
           <div class="other">
             <el-descriptions title="个人信息">
-              <el-descriptions-item label="姓名:">姓名</el-descriptions-item>
-              <el-descriptions-item label="手机号:">手机号</el-descriptions-item>
-              <el-descriptions-item label="证件号:">证件号</el-descriptions-item>
-              <el-descriptions-item label="证件有效期始:">证件有效期始</el-descriptions-item>
-              <el-descriptions-item label="证件有效期止:">证件有效期止</el-descriptions-item>
+              <el-descriptions-item label="姓名:">{{ dataDetail?.name }}</el-descriptions-item>
+              <el-descriptions-item label="手机号:">{{ dataDetail?.mobile }}</el-descriptions-item>
+              <el-descriptions-item label="证件号:">{{ dataDetail?.identity }}</el-descriptions-item>
+              <el-descriptions-item label="证件有效期始:">{{ dataDetail?.identityTimeStart }}</el-descriptions-item>
+              <el-descriptions-item label="证件有效期止:">{{ dataDetail?.identityTimeEnd }}</el-descriptions-item>
             </el-descriptions>
             <el-descriptions title="其他信息">
-              <el-descriptions-item label="管理人:">管理人</el-descriptions-item>
-              <el-descriptions-item label="管理人工号:">管理人工号</el-descriptions-item>
-              <el-descriptions-item label="推荐人:">推荐人</el-descriptions-item>
-              <el-descriptions-item label="推荐人工号:">推荐人工号</el-descriptions-item>
+              <el-descriptions-item label="管理人:">{{ dataDetail?.leaderName }}</el-descriptions-item>
+              <el-descriptions-item label="管理人工号:">{{ dataDetail?.leaderId }}</el-descriptions-item>
+              <el-descriptions-item label="推荐人:">{{ dataDetail?.referrerName }}</el-descriptions-item>
+              <el-descriptions-item label="推荐人工号:">{{ dataDetail?.referrerId }}</el-descriptions-item>
             </el-descriptions>
             <el-descriptions title="银行卡信息">
               <el-descriptions-item>
                 <template #default>
                   <el-table
-                    :data="tableData"
+                    :data="dataDetail?.bankCardList"
                   >
                     <el-table-column prop="name" label="姓名"></el-table-column>
-                    <el-table-column prop="" label="开户行"></el-table-column>
-                    <el-table-column prop="" label="卡号"></el-table-column>
-                    <el-table-column prop="" label="开户支行"></el-table-column>
-                    <el-table-column prop="" label="审核状态"></el-table-column>
-                    <el-table-column prop="" label="身份证件照"></el-table-column>
-                    <el-table-column prop="" label="银行卡照"></el-table-column>
+                    <el-table-column prop="bankName" label="开户行">
+                      <template #default="scope">
+                        {{ bankCardChange(bankOption, scope.row.bankName) }}
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="bankCardNumber" label="卡号"></el-table-column>
+                    <el-table-column prop="bankAddress" label="开户支行"></el-table-column>
+                    <el-table-column prop="auditStatus" label="审核状态">
+                      <template #default="scope">
+                        {{ scope.row.auditStatus == '0'?'未审核':scope.row.auditStatus == '1'?'审核通过':scope.row.auditStatus == '2'?'审核驳回':''}}
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="" label="身份证件照">
+                      <template #default="scope">
+                        <img class="cardImage" :src="dataDetail?.fileList?.[0].fileUrl">
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="cardFile" label="银行卡照">
+                      <template #default="scope">
+                        <img class="cardImage" :src="scope.row.cardFile">
+                      </template>
+                    </el-table-column>
                     <el-table-column label="操作">
-                      <template #default>
-                        <a style="color: #409EFF; cursor: pointer">详情</a>
+                      <template #default="scope">
+                        <a style="color: #409EFF; cursor: pointer" @click="editBankCard(scope.row)">详情</a>
                       </template>
                     </el-table-column>
                   </el-table>
@@ -120,44 +136,45 @@
     </div>
     <el-dialog
       v-model="bankCardDialogShow"
-      title="添加银行卡"
+      :title="bankTitle"
       width="500"
     >
-      <addCard></addCard>
-      <template #footer>
-        <div>
-          <el-button plain @click="() => { bankCardDialogShow = false }">取消</el-button>
-          <el-button type="primary">确定</el-button>
-        </div>
-      </template>
+      <addCard @closeDialog="closeAddBankCard" :userInfo="bankCardInfo"></addCard>
     </el-dialog>
     <el-dialog
       v-model="dialogShow"
       title="编辑"
       width="1000"
     >
-      <addOperation></addOperation>
+      <addOperation ref="AddOperationRef" @closeDialog="closeAddOperation"></addOperation>
     </el-dialog>
     <el-dialog
       v-model="allocationShow"
       title="分配管理人"
       width="800"
     >
-      <allocation></allocation>
+      <allocation ref="AllocationRef" @closeDialog="closeAllocation"></allocation>
     </el-dialog>
   </div>
 </template>
 
 <script setup lang="ts">
-import { ref } from 'vue'
+import {nextTick, ref} from 'vue'
 import addOperation from './modules/addOperation.vue'
 import addCard from './modules/addCard.vue'
 import allocation from './modules/allocation.vue'
-import {ElMessage, ElMessageBox} from 'element-plus'
+import pinyin from "js-pinyin";
+import { ElMessage, ElMessageBox } from 'element-plus'
 import Allocation from "@/views/operationManagement/modules/allocation.vue";
-import { useRoute } from 'vue-router'
+import { useRoute, useRouter } from 'vue-router'
 import api from '@/api'
+import {OperationIsEnable} from "@/api/modules/operation.ts";
+import router from "@/router";
+
+let AddOperationRef = ref(null)
+const AllocationRef = ref(null)
 
+let myRouter = useRouter()
 const myRoute = useRoute()
 
 // 更多
@@ -172,7 +189,10 @@ const handleCommand = (e) => {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
       }).then(( action ) => {
-
+        if(action === 'confirm') {
+          let ids = [myRoute.query.id]
+          operationDel(ids)
+        }
       }).catch(( action ) => {
 
       })
@@ -186,42 +206,150 @@ const handleCommand = (e) => {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
       }).then(( action ) => {
-
+        if(action === 'confirm') {
+          let data = {
+            ids: [myRoute.query.id],
+            isEnable: 1,
+            getAll: 0
+          }
+          operationIsEnable(data)
+        }
       }).catch(( action ) => {
 
       })
       break;
     case '启用':
-      ElMessage({
-        message: '启用成功!',
-        type: 'success',
+      ElMessageBox({
+        title: '启用业务员',
+        message: '确定要启用该业务员吗?',
+        type: 'warning',
+        showCancelButton: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+      }).then(( action ) => {
+        if(action === 'confirm'){
+          let data = {
+            ids: [myRoute.query.id],
+            isEnable: 0,
+            getAll: 0
+          }
+          operationIsEnable(data)
+        }
+      }).catch(( action ) => {
+
       })
       break;
     case '分配管理人':
       allocationShow.value = true
+      nextTick(() => {
+        AllocationRef.value.initCheckedKeys(dataDetail.value.deptId, 'cur', [dataDetail.value.id])
+      })
       break;
   }
 }
 // 分配管理人
 let allocationShow = ref(false)
+const closeAllocation = (type: boolean) => {
+  allocationShow.value = type
+}
 
 // 银行卡列表数据
-let tableData = ref([])
+// let tableData = ref([])
 
 // Tabs切换
 let activeName = ref('msg')
 
+// 银行卡信息
+let bankCardInfo = ref(null)
+let bankTitle = ref('添加银行卡')
 // 添加银行卡弹框
 let bankCardDialogShow = ref(false)
 // 添加银行卡
 const addBankCard = () => {
+  bankTitle.value = '添加银行卡'
+  bankCardDialogShow.value = true
+  bankCardInfo.value = {
+    userJzgInfoId: dataDetail.value.id,
+    name: dataDetail.value.name,
+  }
+}
+// 编辑银行卡
+const editBankCard = (row) => {
+  bankTitle.value = '查看银行卡'
   bankCardDialogShow.value = true
+  bankCardInfo.value = {
+    userJzgInfoId: dataDetail.value.id,
+    name: dataDetail.value.name,
+    bankName: row.bankName,
+    bankCardNumber: row.bankCardNumber,
+    bankAddress: row.bankAddress,
+    attachment: row.cardFile,
+    imageUrl: row.cardFile,
+    isRead: true
+  }
+}
+// 关闭添加银行卡弹框
+const closeAddBankCard = (type: string) => {
+  if(type == '确定') {
+    initDetail()
+  }
+  bankCardDialogShow.value = false
 }
+
+// 删除
+const operationDel = (id: string[]) => {
+  api.operationApi.operationDelete({
+    ids: id,
+    getAll: 0
+  }).then(res => {
+    if(res?.code == 200) {
+      ElMessage({
+        message: res.msg,
+        type: 'success'
+      })
+      myRouter.push({
+        path: 'operationManagement/operation',
+      })
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
+// 启用/禁用
+const operationIsEnable = (data: OperationIsEnable) => {
+  api.operationApi.operationIsEnable(data).then(res => {
+    if(res?.code == 200) {
+      ElMessage({
+        message: res.msg,
+        type: 'success'
+      })
+      initDetail()
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
+
 // 审核通过
 const checkPass = () => {
-  ElMessage({
-    message: '审核通过!',
-    type: 'success',
+  api.operationApi.salesmanAuthSuccess({ userInfoId: dataDetail.value.id }).then(res => {
+    if(res.code == 200) {
+      ElMessage({
+        message: res.msg,
+        type: 'success',
+      })
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning',
+      })
+    }
   })
 }
 // 审核不通过
@@ -234,8 +362,25 @@ const checkNotPass = () => {
     showCancelButton: true,
     confirmButtonText: '确定',
     cancelButtonText: '取消',
-  }).then(( action ) => {
-
+  }).then(({ value, action } ) => {
+    if(action == 'confirm') {
+      api.operationApi.salesmanAuthFailed({
+        userInfoId: dataDetail.value.id,
+        approvalOpinion: value
+      }).then(res => {
+        if(res.code == 200) {
+          ElMessage({
+            message: res.msg,
+            type: 'success',
+          })
+        } else {
+          ElMessage({
+            message: res.msg,
+            type: 'warning',
+          })
+        }
+      })
+    }
   }).catch(( action ) => {
 
   })
@@ -245,16 +390,24 @@ const checkNotPass = () => {
 let dialogShow = ref(false)
 const editDetail = () => {
   dialogShow.value = true
+  nextTick(() => {
+    AddOperationRef.value.initEditData(dataDetail.value.id)
+  })
+}
+const closeAddOperation = (text: string) => {
+  if(text == '确定') {
+    initDetail()
+  }
+  dialogShow.value = false
 }
 
 // 详情
-let dataDetail = ref({})
+let dataDetail = ref(null)
 const initDetail = () => {
   let id = myRoute.query?.id
   api.operationApi.operationDetail(id).then(res => {
-    console.log(123, res)
     if(res?.code == 200) {
-      dataDetail.value = res.data.data
+      dataDetail.value = res.data
     } else {
       ElMessage({
         message: res.msg,
@@ -264,8 +417,36 @@ const initDetail = () => {
   })
 }
 
+// 初始化银行数据
+let bankOption = ref([])
+const initBankCard = () => {
+  api.commonApi.personInfo('bank_info').then(res => {
+    if(res.code == 200) {
+      bankOption.value = res.data
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
+// 转换
+const bankCardChange = (list, code) => {
+  if(code&&list.length>0) {
+    let obj = list.find(item => item.id == code)
+    return obj.label
+  }
+}
+
+// 名字转换首字母
+const initName = (name) => {
+  return name?pinyin.getFullChars(name).substring(0, 1):''
+}
+
 onMounted(() => {
   initDetail()
+  initBankCard()
 })
 
 </script>
@@ -293,6 +474,7 @@ onMounted(() => {
   .info{
     background: white;
     padding: 5px 10px;
+    margin: 5px 0;
     border-radius: 10px;
     :deep(.el-descriptions__title) {
       width: 100%;
@@ -358,6 +540,12 @@ onMounted(() => {
           }
         }
       }
+      .cardImage{
+        display: block;
+        width: 80px;
+        height: 80px;
+        border-radius: 5px;
+      }
       :deep(.el-descriptions__title) {
         padding-left: 20px;
         font-size: 16px;

+ 330 - 41
src/views/operationManagement/team.vue

@@ -1,71 +1,360 @@
 <template>
   <div class="team">
-    <el-row :gutter="20">
+    <el-row :gutter="20" style="width: 100%; overflow:hidden;">
       <el-col :span="4">
-        <div>
-          <el-input class="search-input" v-model="teamValue" placeholder="团队名称查找" prefix-icon="Search"></el-input>
-
+        <div class="teamTree">
+          <el-input class="search-input" v-model="treeValue" placeholder="团队名称查找" prefix-icon="Search"></el-input>
+          <div class="custom-tree-node" v-for="item in teamData" :key="item.id">
+            <span class="custom-tree-node-label">{{ item.name }}</span>
+            <el-dropdown class="custom-tree-node-more" @command="treeNodeCommend(item, $event)">
+              <el-icon><MoreFilled /></el-icon>
+              <template #dropdown>
+                <el-dropdown-menu>
+                  <el-dropdown-item command="编辑">编辑</el-dropdown-item>
+                  <el-dropdown-item command="删除">删除</el-dropdown-item>
+                </el-dropdown-menu>
+              </template>
+            </el-dropdown>
+          </div>
         </div>
-        <el-button class="add-btn" link icon="plus">添加团队</el-button>
+        <el-button class="add-btn" icon="plus" @click="addTeamShow = true">添加团队</el-button>
       </el-col>
       <el-col :span="20">
-        222
+        <el-row :gutter="20">
+          <el-col :span="22" class="info">
+            <h3>团队名称</h3>
+            <p>所属机构: 机构名称</p>
+            <p>管理人: 管理人姓名-管理人工号</p>
+            <p>描述:</p>
+          </el-col>
+          <el-col :span="2" class="btn">
+            <el-button plain @click="setPeople">设置负责人</el-button>
+          </el-col>
+        </el-row>
+        <el-input style="width: 300px; margin: 10px 0" v-model="searchValue" prefix-icon="Search" placeholder="输入姓名,手机号,工号查找" ></el-input>
+        <el-table
+          :data="tableData"
+          ref="operationListRef"
+          height="530"
+          @selection-change="handleSelectionChange"
+        >
+          <el-table-column type="selection" width="55"></el-table-column>
+          <el-table-column label="姓名" prop="name" width="80"></el-table-column>
+          <el-table-column label="手机号" prop="mobile" width="150"></el-table-column>
+          <el-table-column label="工号" prop="userId" width="200"></el-table-column>
+          <el-table-column label="类型" prop="typeAttr" width="100"></el-table-column>
+          <el-table-column label="归属" prop="deptName" width="200"></el-table-column>
+          <el-table-column label="所属机构" prop="deptName" width="200"></el-table-column>
+          <el-table-column label="人员状态" prop="status" width="150">
+            <template #default="scope">
+              {{ scope.row.status == '1'?'前线人员':scope.row.status == '2'?'后线人员':scope.row.status == '3'?'合伙人':scope.row.status == '4'?'工作室管理员':scope.row.status == '5'?'团队长':scope.row.status == '6'?'个代':scope.row.status == '7'?'电销':scope.row.status == '8'?'渠道': '--' }}
+            </template>
+          </el-table-column>
+          <el-table-column label="账号状态" prop="isEnable" width="150"></el-table-column>
+          <el-table-column label="管理人" prop="leaderName" width="150"></el-table-column>
+          <el-table-column label="管理人工号" prop="leaderId" width="200"></el-table-column>
+          <el-table-column label="推荐人" prop="referrerName" width="150"></el-table-column>
+          <el-table-column label="推荐人工号" prop="referrerId" width="200"></el-table-column>
+          <el-table-column fixed="right" label="操作" width="120">
+            <template #default="scope">
+              <div style="display: flex; align-items: center; justify-content: space-between">
+                <a style="color: #409EFF; cursor: pointer" @click="showDetail(scope)">详情</a>&nbsp;
+                <el-dropdown placement="bottom" trigger="click" @command="tableDataCommand(scope, $event)">
+                  <a style="color: #409EFF; cursor: pointer">更多</a>
+                  <template #dropdown>
+                    <el-dropdown-menu>
+                      <el-dropdown-item command="编辑">编辑</el-dropdown-item>
+                      <el-dropdown-item command="启用">启用</el-dropdown-item>
+                      <el-dropdown-item command="禁用">禁用</el-dropdown-item>
+                      <el-dropdown-item command="删除">删除</el-dropdown-item>
+                      <el-dropdown-item command="分配管理人">分配管理人</el-dropdown-item>
+                    </el-dropdown-menu>
+                  </template>
+                </el-dropdown>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+        <div style="display: flex; justify-content: center; margin-top: 15px">
+          <el-pagination
+            v-model:current-page="currentPage"
+            v-model:page-size="pageSize"
+            :page-sizes="[10, 20, 30, 40]"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="total"
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+          />
+        </div>
       </el-col>
     </el-row>
+    <el-dialog
+      v-model="dialogShow"
+      :title="title"
+      width="1000"
+    >
+      <addOperation @closeDialog="closeAddOperation" :options="options"></addOperation>
+    </el-dialog>
+    <el-dialog
+      v-model="addTeamShow"
+      title="添加"
+      width="800"
+    >
+      <addTeam ref="AddTeamRef" @closeDialog="closeAddTeamDialog"></addTeam>
+    </el-dialog>
+    <el-dialog
+      v-model="allocationShow"
+      title="分配管理人"
+      width="800"
+    >
+      <allocation></allocation>
+    </el-dialog>
   </div>
 </template>
 
 <script setup lang="ts">
-import { ref } from 'vue'
+import { ref, onMounted } from 'vue'
+import {ElMessageBox, ElMessage, TableInstance} from 'element-plus'
+import { useRouter } from 'vue-router'
+import api from "@/api";
+import addOperation from './modules/addOperation.vue'
+import allocation from './modules/allocation.vue'
+import addTeam from './modules/addTeam.vue'
+import Allocation from "@/views/operationManagement/modules/allocation.vue";
+import {initial} from "lodash-es";
+import team from "@/api/modules/team.ts";
+
+let myRouter = useRouter()
+const AddTeamRef = ref(null)
+
+// 机构数据
+let options = ref([])
+// 获取机构数据
+const institutionList = () => {
+  api.institutionApi.institutionList({ name: '', system: '' }).then(res => {
+    if(res?.code == 200) {
+      options.value = res.data
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
 
 // 团队
-let teamTree = ref([
-  {
-    label: '团队1',
-    value: '1',
-    children: [
-      {
-        label: '团队1-1',
-        value: '1-1',
-        children: [
-          {
-            label: '团队1-1-1',
-            value: '1-1-1',
+let treeValue = ref('')
+let teamData = ref([])
+let addTeamShow = ref(false)
+const initTeam = () => {
+  api.teamApi.teamList({}).then(res => {
+    if(res.code == 200) {
+      teamData.value = res.data
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
+const treeNodeCommend = (item, e) => {
+  switch (e) {
+    case '编辑':
+      addTeamShow.value = true
+      AddTeamRef.value.initEdit(item)
+      break;
+    case '删除':
+      ElMessageBox({
+        title: '删除团队',
+        message: '确定要删除该团队吗?',
+        type: 'warning',
+        showCancelButton: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+      }).then(( action ) => {
+        if(action === 'confirm') {
+
+        }
+      }).catch(( action ) => {
+
+      })
+      break;
+  }
+}
+const closeAddTeamDialog = (type) => {
+  addTeamShow.value = false
+}
+
+// 分页
+let currentPage = ref(1)
+let pageSize = ref(10)
+let total = ref(0)
+const handleSizeChange = (size) => {
+
+}
+const handleCurrentChange = (page) => {
+
+}
+
+// 搜索字段
+let searchValue = ref('')
+// 列表数据
+let tableData = ref([
+  {name: 1}
+])
+// 编辑弹框
+let dialogShow = ref(false)
+// 编辑弹框标题
+let title = ref('编辑')
+// 表格组件中的勾选
+const handleSelectionChange = (row) => {
+
+}
+// 详情
+const showDetail = (scope) => {
+  myRouter.push({
+    path: '/operationDetail',
+    query: {
+      id: scope.row.id
+    }
+  })
+}
+
+// 分配管理人
+let allocationShow = ref(false)
+
+// 设置负责人
+const setPeople = () => {
+  allocationShow.value = true
+}
+// 更多
+const tableDataCommand = (scope, e) => {
+  switch (e) {
+    case '编辑':
+      dialogShow.value = true
+      title.value = '编辑'
+      break;
+    case '删除':
+      ElMessageBox({
+        title: '删除业务员',
+        message: '确定要删除该业务员吗?',
+        type: 'warning',
+        showCancelButton: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+      }).then(( action ) => {
+        if(action === 'confirm') {
+          let ids = [scope.row.id]
+
+        }
+      }).catch(( action ) => {
+
+      })
+      break;
+    case '禁用':
+      ElMessageBox({
+        title: '禁用业务员',
+        message: '确定要禁用该业务员吗?',
+        type: 'warning',
+        showCancelButton: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+      }).then(( action ) => {
+        if(action === 'confirm') {
+          let data = {
+            id: [scope.row.id],
+            isEnable: 0
           }
-        ]
-      }
-    ]
-  },{
-    label: '团队2',
-    value: '2',
-    children: [
-      {
-        label: '团队2-1',
-        value: '2-1',
-        children: [
-          {
-            label: '团队2-1-1',
-            value: '2-1-1',
+        }
+      }).catch(( action ) => {
+
+      })
+      break;
+    case '启用':
+      ElMessageBox({
+        title: '启用业务员',
+        message: '确定要启用该业务员吗?',
+        type: 'warning',
+        showCancelButton: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+      }).then(( action ) => {
+        if(action === 'confirm'){
+          let data = {
+            id: [scope.row.id],
+            isEnable: 1
           }
-        ]
-      }
-    ]
+        }
+      }).catch(( action ) => {
+
+      })
+      break;
+    case '分配管理人':
+      allocationShow.value = true
+      break;
   }
-])
-let teamValue = ref('')
+}
+
+const closeAddOperation = (type: string) => {
+  dialogShow.value = false
+}
+
+onMounted(() => {
+  institutionList()
+  initTeam()
+})
 
 </script>
 
 <style scoped lang="scss">
 .team{
-  background: #00a0f4;
-  height: 100% !important;
+  height: 770px;
+  background: #fff;
   .search-input{
-    margin: 10px 20px;
+    padding: 10px 20px;
+  }
+  .teamTree{
+    height: 700px;
+    overflow-y: auto;
+    background: #fff;
+    .custom-tree-node{
+      width: calc(100% - 40px);
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      padding: 5px 10px;
+      margin: 5px auto;
+      &:hover{
+        background: rgba(0,0,0,.1);
+      }
+      .custom-tree-node-label{
+        width: 70%;
+        overflow: hidden;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+      }
+    }
   }
   .add-btn{
     display: block;
     margin: 0 auto;
   }
+  .info{
+    h3{
+      margin: 10px 0;
+    }
+    p{
+      margin: 6px 0;
+      font-size: 14px;
+      color: rgba(0,0,0,.7);
+    }
+  }
+  .btn{
+    display: flex;
+    justify-content: flex-end;
+    align-items: flex-end;
+  }
 }
 </style>

+ 353 - 4
src/views/operationManagement/telemarketing.vue

@@ -1,11 +1,360 @@
 <template>
-  <div>telemarketing</div>
+  <div class="team">
+    <el-row :gutter="20" style="width: 100%; overflow:hidden;">
+      <el-col :span="4">
+        <div class="teamTree">
+          <el-input class="search-input" v-model="treeValue" placeholder="电销组名称查找" prefix-icon="Search"></el-input>
+          <div class="custom-tree-node" v-for="item in teamData" :key="item.id">
+            <span class="custom-tree-node-label">{{ item.name }}</span>
+            <el-dropdown class="custom-tree-node-more" @command="treeNodeCommend(item, $event)">
+              <el-icon><MoreFilled /></el-icon>
+              <template #dropdown>
+                <el-dropdown-menu>
+                  <el-dropdown-item command="编辑">编辑</el-dropdown-item>
+                  <el-dropdown-item command="删除">删除</el-dropdown-item>
+                </el-dropdown-menu>
+              </template>
+            </el-dropdown>
+          </div>
+        </div>
+        <el-button class="add-btn" icon="plus" @click="addTeamShow = true">添加电销组</el-button>
+      </el-col>
+      <el-col :span="20">
+        <el-row :gutter="20">
+          <el-col :span="22" class="info">
+            <h3>电销组名称</h3>
+            <p>所属机构: 机构名称</p>
+            <p>管理人: 管理人姓名-管理人工号</p>
+            <p>描述:</p>
+          </el-col>
+          <el-col :span="2" class="btn">
+            <el-button plain @click="setPeople">设置负责人</el-button>
+          </el-col>
+        </el-row>
+        <el-input style="width: 300px; margin: 10px 0" v-model="searchValue" prefix-icon="Search" placeholder="输入姓名,手机号,工号查找" ></el-input>
+        <el-table
+          :data="tableData"
+          ref="operationListRef"
+          height="530"
+          @selection-change="handleSelectionChange"
+        >
+          <el-table-column type="selection" width="55"></el-table-column>
+          <el-table-column label="姓名" prop="name" width="80"></el-table-column>
+          <el-table-column label="手机号" prop="mobile" width="150"></el-table-column>
+          <el-table-column label="工号" prop="userId" width="200"></el-table-column>
+          <el-table-column label="类型" prop="typeAttr" width="100"></el-table-column>
+          <el-table-column label="归属" prop="deptName" width="200"></el-table-column>
+          <el-table-column label="所属机构" prop="deptName" width="200"></el-table-column>
+          <el-table-column label="人员状态" prop="status" width="150">
+            <template #default="scope">
+              {{ scope.row.status == '1'?'前线人员':scope.row.status == '2'?'后线人员':scope.row.status == '3'?'合伙人':scope.row.status == '4'?'工作室管理员':scope.row.status == '5'?'团队长':scope.row.status == '6'?'个代':scope.row.status == '7'?'电销':scope.row.status == '8'?'渠道': '--' }}
+            </template>
+          </el-table-column>
+          <el-table-column label="账号状态" prop="isEnable" width="150"></el-table-column>
+          <el-table-column label="管理人" prop="leaderName" width="150"></el-table-column>
+          <el-table-column label="管理人工号" prop="leaderId" width="200"></el-table-column>
+          <el-table-column label="推荐人" prop="referrerName" width="150"></el-table-column>
+          <el-table-column label="推荐人工号" prop="referrerId" width="200"></el-table-column>
+          <el-table-column fixed="right" label="操作" width="120">
+            <template #default="scope">
+              <div style="display: flex; align-items: center; justify-content: space-between">
+                <a style="color: #409EFF; cursor: pointer" @click="showDetail(scope)">详情</a>&nbsp;
+                <el-dropdown placement="bottom" trigger="click" @command="tableDataCommand(scope, $event)">
+                  <a style="color: #409EFF; cursor: pointer">更多</a>
+                  <template #dropdown>
+                    <el-dropdown-menu>
+                      <el-dropdown-item command="编辑">编辑</el-dropdown-item>
+                      <el-dropdown-item command="启用">启用</el-dropdown-item>
+                      <el-dropdown-item command="禁用">禁用</el-dropdown-item>
+                      <el-dropdown-item command="删除">删除</el-dropdown-item>
+                      <el-dropdown-item command="分配管理人">分配管理人</el-dropdown-item>
+                    </el-dropdown-menu>
+                  </template>
+                </el-dropdown>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+        <div style="display: flex; justify-content: center; margin-top: 15px">
+          <el-pagination
+            v-model:current-page="currentPage"
+            v-model:page-size="pageSize"
+            :page-sizes="[10, 20, 30, 40]"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="total"
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+          />
+        </div>
+      </el-col>
+    </el-row>
+    <el-dialog
+      v-model="dialogShow"
+      :title="title"
+      width="1000"
+    >
+      <addOperation @closeDialog="closeAddOperation" :options="options"></addOperation>
+    </el-dialog>
+    <el-dialog
+      v-model="addTeamShow"
+      title="添加"
+      width="800"
+    >
+      <addTeam @closeDialog="closeAddTeamDialog" :editData="editItemData"></addTeam>
+    </el-dialog>
+    <el-dialog
+      v-model="allocationShow"
+      title="分配管理人"
+      width="800"
+    >
+      <allocation></allocation>
+    </el-dialog>
+  </div>
 </template>
 
-<script setup>
+<script setup lang="ts">
+import { ref, onMounted } from 'vue'
+import {ElMessageBox, ElMessage, TableInstance} from 'element-plus'
+import { useRouter } from 'vue-router'
+import api from "@/api";
+import addOperation from './modules/addOperation.vue'
+import allocation from './modules/allocation.vue'
+import addTeam from './modules/addTeam.vue'
+import Allocation from "@/views/operationManagement/modules/allocation.vue";
+import {initial} from "lodash-es";
+import team from "@/api/modules/team.ts";
 
-</script>
+let myRouter = useRouter()
+
+// 机构数据
+let options = ref([])
+// 获取机构数据
+const institutionList = () => {
+  api.institutionApi.institutionList({ name: '', system: '' }).then(res => {
+    if(res?.code == 200) {
+      options.value = res.data
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
+
+// 电销组
+let treeValue = ref('')
+let teamData = ref([])
+let addTeamShow = ref(false)
+let editItemData = ref(null)
+const initTeam = () => {
+  api.teamApi.teamList({}).then(res => {
+    if(res.code == 200) {
+      teamData.value = res.data
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
+const treeNodeCommend = (item, e) => {
+  switch (e) {
+    case '编辑':
+      addTeamShow.value = true
+      editItemData.value = item
+      break;
+    case '删除':
+      ElMessageBox({
+        title: '删除电销组',
+        message: '确定要删除该电销组吗?',
+        type: 'warning',
+        showCancelButton: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+      }).then(( action ) => {
+        if(action === 'confirm') {
+
+        }
+      }).catch(( action ) => {
+
+      })
+      break;
+  }
+}
+const closeAddTeamDialog = (type) => {
+  addTeamShow.value = false
+}
+
+// 分页
+let currentPage = ref(1)
+let pageSize = ref(10)
+let total = ref(0)
+const handleSizeChange = (size) => {
+
+}
+const handleCurrentChange = (page) => {
+
+}
+
+// 搜索字段
+let searchValue = ref('')
+// 列表数据
+let tableData = ref([
+  {name: 1}
+])
+// 编辑弹框
+let dialogShow = ref(false)
+// 编辑弹框标题
+let title = ref('编辑')
+// 表格组件中的勾选
+const handleSelectionChange = (row) => {
+
+}
+// 详情
+const showDetail = (scope) => {
+  myRouter.push({
+    path: '/operationDetail',
+    query: {
+      id: scope.row.id
+    }
+  })
+}
 
-<style scoped>
+// 分配管理人
+let allocationShow = ref(false)
+
+// 设置负责人
+const setPeople = () => {
+  allocationShow.value = true
+}
+// 更多
+const tableDataCommand = (scope, e) => {
+  switch (e) {
+    case '编辑':
+      dialogShow.value = true
+      title.value = '编辑'
+      break;
+    case '删除':
+      ElMessageBox({
+        title: '删除业务员',
+        message: '确定要删除该业务员吗?',
+        type: 'warning',
+        showCancelButton: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+      }).then(( action ) => {
+        if(action === 'confirm') {
+          let ids = [scope.row.id]
+
+        }
+      }).catch(( action ) => {
+
+      })
+      break;
+    case '禁用':
+      ElMessageBox({
+        title: '禁用业务员',
+        message: '确定要禁用该业务员吗?',
+        type: 'warning',
+        showCancelButton: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+      }).then(( action ) => {
+        if(action === 'confirm') {
+          let data = {
+            id: [scope.row.id],
+            isEnable: 0
+          }
+        }
+      }).catch(( action ) => {
+
+      })
+      break;
+    case '启用':
+      ElMessageBox({
+        title: '启用业务员',
+        message: '确定要启用该业务员吗?',
+        type: 'warning',
+        showCancelButton: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+      }).then(( action ) => {
+        if(action === 'confirm'){
+          let data = {
+            id: [scope.row.id],
+            isEnable: 1
+          }
+        }
+      }).catch(( action ) => {
+
+      })
+      break;
+    case '分配管理人':
+      allocationShow.value = true
+      break;
+  }
+}
+
+const closeAddOperation = (type: string) => {
+  dialogShow.value = false
+}
+
+onMounted(() => {
+  institutionList()
+  initTeam()
+})
+
+</script>
 
+<style scoped lang="scss">
+.team{
+  height: 770px;
+  background: #fff;
+  .search-input{
+    padding: 10px 20px;
+  }
+  .teamTree{
+    height: 700px;
+    overflow-y: auto;
+    background: #fff;
+    .custom-tree-node{
+      width: calc(100% - 40px);
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      padding: 5px 10px;
+      margin: 5px auto;
+      &:hover{
+        background: rgba(0,0,0,.1);
+      }
+      .custom-tree-node-label{
+        width: 70%;
+        overflow: hidden;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+      }
+    }
+  }
+  .add-btn{
+    display: block;
+    margin: 0 auto;
+  }
+  .info{
+    h3{
+      margin: 10px 0;
+    }
+    p{
+      margin: 6px 0;
+      font-size: 14px;
+      color: rgba(0,0,0,.7);
+    }
+  }
+  .btn{
+    display: flex;
+    justify-content: flex-end;
+    align-items: flex-end;
+  }
+}
 </style>

+ 1 - 1
src/views/personnel/memberManagement.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="member">
     <div class="member-tree">
-      <el-input
+      <el-inputel-input
         v-model="filterText"
         style="width: 240px"
         placeholder="姓名,手机号,工号查询"