Pārlūkot izejas kodu

fix:对接接口

wuguojie 1 gadu atpakaļ
vecāks
revīzija
280ee82457

+ 1 - 0
src/api/modules/operation.ts

@@ -76,6 +76,7 @@ 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), // 删除
   operationIsEnable: (data: OperationIsEnable) => axiosInstance.post('/userInfo/isEnable', data), // 启用/禁用

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

+ 30 - 31
src/views/operationManagement/modules/addCard.vue

@@ -5,24 +5,24 @@
         <el-input v-model="bankForm.name" disabled></el-input>
       </el-form-item>
       <el-form-item prop="bank" label="银行">
-        <el-select v-model="bankForm.bankName">
+        <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.bankCardNumber"></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.bankAddress"></el-input>
+        <el-input v-model="bankForm.bankAddress" :disabled="bankForm.isRead"></el-input>
       </el-form-item>
       <el-form-item prop="photo" label="照片" class="upload-btn">
-        <el-upload :auto-upload="false" v-if="!imageUrl" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage">
+        <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="imageUrl" />
-          <div class="btns">
-            <el-upload style="display: inline" :auto-upload="false" :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage">
+          <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>-->
@@ -35,45 +35,46 @@
       </div>
     </el-form>
     <div class="image-show" v-show="imageShow" @click="() => { imageShow = false }">
-      <img :src="imageUrl" />
+      <img :src="bankForm.imageUrl" />
     </div>
   </div>
 </template>
 
 <script setup lang="ts">
-import { ref, defineProps, defineEmits, onMounted, watch } 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({
+let props = defineProps<{
   userInfo: {
-    type: Object
+    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({
-  userJzgInfoId: props.userInfo.id,
+  userJzgInfoId: props.userInfo.userJzgInfoId,
   name: props.userInfo.name,
   bankName: props.userInfo.bankName,
   bankCardNumber: props.userInfo.bankCardNumber,
   bankAddress: props.userInfo.bankAddress,
-  attachment: props.userInfo.attachment
+  attachment: props.userInfo.attachment,
+  imageUrl: props.userInfo.attachment,
+  isRead: props.userInfo.isRead
 })
-let bankData = ref(null)
-console.log('银行卡信息', props.userInfo)
-watch(() => props.userInfo, (newVal) => {
-  bankData.value = newVal
-  bankForm.value = {
-    userJzgInfoId: bankData.value.id,
-    name: bankData.value.name,
-    bankName: bankData.value.bankName,
-    bankCardNumber: bankData.value.bankCardNumber,
-    bankAddress: bankData.value.bankAddress,
-    attachment: bankData.value.attachment
-  }
-});
 const bankRules = {
   name: [
     { required: true, message: '请填写姓名', trigger: 'blur' }
@@ -95,7 +96,6 @@ const bankRules = {
 }
 
 // 照片
-let imageUrl = ref('')
 let imageShow = ref(false)
 const uploadImage = async (file) => {
   let files = file.raw
@@ -103,8 +103,9 @@ const uploadImage = async (file) => {
   params.append("file", files);
   params.append("type", "image");
   const { code, data, msg } = await api.commonApi.fileUpload(params)
+  console.log(123, data)
   if(code == 200) {
-    imageUrl.value = data.downloadUrl
+    bankForm.value.imageUrl = data.downloadUrl
     bankForm.value.attachment = data.id
   }
 }
@@ -148,7 +149,6 @@ const onSubmit = async (BankRef:FormInstance | undefined, type: number) => {
               type: 'warning'
             })
           }
-          imageUrl = ''
           BankRef.resetFields()
           emits('closeDialog', '确定')
         })
@@ -160,7 +160,6 @@ const onSubmit = async (BankRef:FormInstance | undefined, type: number) => {
       }
     })
   } else {
-    imageUrl = ''
     BankRef.resetFields()
     emits('closeDialog', '取消')
   }

+ 158 - 33
src/views/operationManagement/modules/addOperation.vue

@@ -450,7 +450,8 @@ interface OperationFormProps extends AddOperation {
   organization: string
   leaderNumber: string,
   referrerNumber: string,
-  address?: string[]
+  address?: string[],
+  id?: string
 }
 
 let emits = defineEmits(['closeDialog'])
@@ -604,6 +605,92 @@ 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`)
 // 上传图片
@@ -716,42 +803,76 @@ const onSubmit = async (OperationFormRef: FormInstance, type: number) => {
     await OperationFormRef.validate((valid) => {
       if(valid) {
         let formData = {...operationForm.value}
-        formData.organization = operationForm.value.organization[operationForm.value.organization.length - 1]
+        // 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]:'':''
-        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', '取消')
-        })
+        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 {
         ElMessage({
           message: '请正确填写相关信息!',
@@ -844,6 +965,10 @@ onMounted(() => {
   getTeamList()
 })
 
+defineExpose({
+  initEditData
+})
+
 
 </script>
 

+ 9 - 13
src/views/operationManagement/modules/addTeam.vue

@@ -35,7 +35,7 @@
 </template>
 
 <script setup lang="ts">
-import { ref, defineEmits, onMounted, defineProps } from 'vue'
+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";
@@ -45,10 +45,6 @@ interface EditDataProps extends AddTeamProps {
   id: string
 }
 
-let props = defineProps({
-  editData: Object<EditDataProps>
-})
-
 let emits = defineEmits(['closeDialog'])
 
 // 表单
@@ -74,6 +70,10 @@ let teamRules = ref<FormRules>({
   ]
 })
 
+const initEdit = (data) => {
+
+}
+
 // 机构
 let option = ref([])
 const cascaderProps = {
@@ -114,14 +114,6 @@ const getUser = (id) => {
   })
 }
 
-// 编辑数据
-if(props.editData) {
-  console.log(123, props.editData)
-  let editData = props.editData
-  teamForm.value = editData
-  getUser(editData.deptId)
-}
-
 // 提交/取消
 const onSubmit = async (AddTeamRef: FormInstance, type) => {
   if(!AddTeamRef) {
@@ -167,6 +159,10 @@ onMounted(() => {
   institutionList()
 })
 
+defineExpose({
+  initEdit
+})
+
 </script>
 
 <style scoped lang="scss">

+ 12 - 8
src/views/operationManagement/operation.vue

@@ -158,7 +158,7 @@
       :title="title"
       width="1000"
     >
-      <addOperation @closeDialog="closeAddOperation"></addOperation>
+      <addOperation ref="AddOperationRef" @closeDialog="closeAddOperation"></addOperation>
     </el-dialog>
     <el-dialog
       v-model="bankCardDialogShow"
@@ -178,20 +178,21 @@
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted } 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 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 myRouter = useRouter()
 
 const operationListRef = ref<TableInstance>()
+const AddOperationRef = ref(null)
 
 interface TableDataProps {
   name: string,
@@ -469,7 +470,10 @@ const showDetail = (scope) => {
 }
 
 // 添加银行卡弹框
-let addName = ref(null)
+let addName = ref({
+  userJzgInfoId: '',
+  name: '',
+})
 let bankCardDialogShow = ref(false)
 
 // 更多
@@ -477,6 +481,9 @@ const tableDataCommand = (scope, e) => {
   switch (e) {
     case '编辑':
       dialogShow.value = true
+      nextTick(() => {
+        AddOperationRef.value.initEditData(scope.row.id)
+      })
       title.value = '编辑'
       break;
     case '删除':
@@ -556,11 +563,8 @@ const tableDataCommand = (scope, e) => {
       addName.value = {
         userJzgInfoId: scope.row.id,
         name: scope.row.name,
-        bankName: '',
-        bankCardNumber: '',
-        bankAddress: '',
-        attachment: ''
       }
+      console.log(456, addName.value)
       bankCardDialogShow.value = true
       break;
     case '分配管理人':

+ 3 - 6
src/views/operationManagement/operationDetail.vue

@@ -252,14 +252,9 @@ let bankCardDialogShow = ref(false)
 const addBankCard = () => {
   bankTitle.value = '添加银行卡'
   bankCardDialogShow.value = true
-  console.log(123123123, dataDetail.value)
   bankCardInfo.value = {
     userJzgInfoId: dataDetail.value.id,
     name: dataDetail.value.name,
-    bankName: '',
-    bankCardNumber: '',
-    bankAddress: '',
-    attachment: ''
   }
 }
 // 编辑银行卡
@@ -272,7 +267,9 @@ const editBankCard = (row) => {
     bankName: row.bankName,
     bankCardNumber: row.bankCardNumber,
     bankAddress: row.bankAddress,
-    attachment: row.cardFile
+    attachment: row.cardFile,
+    imageUrl: row.cardFile,
+    isRead: true
   }
 }
 // 关闭添加银行卡弹框

+ 11 - 5
src/views/operationManagement/team.vue

@@ -28,7 +28,7 @@
             <p>描述:</p>
           </el-col>
           <el-col :span="2" class="btn">
-            <el-button plain>设置负责人</el-button>
+            <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>
@@ -100,7 +100,7 @@
       title="添加"
       width="800"
     >
-      <addTeam @closeDialog="closeAddTeamDialog" :editData="editItemData"></addTeam>
+      <addTeam ref="AddTeamRef" @closeDialog="closeAddTeamDialog"></addTeam>
     </el-dialog>
     <el-dialog
       v-model="allocationShow"
@@ -125,6 +125,7 @@ import {initial} from "lodash-es";
 import team from "@/api/modules/team.ts";
 
 let myRouter = useRouter()
+const AddTeamRef = ref(null)
 
 // 机构数据
 let options = ref([])
@@ -146,7 +147,6 @@ const institutionList = () => {
 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) {
@@ -163,7 +163,7 @@ const treeNodeCommend = (item, e) => {
   switch (e) {
     case '编辑':
       addTeamShow.value = true
-      editItemData.value = item
+      AddTeamRef.value.initEdit(item)
       break;
     case '删除':
       ElMessageBox({
@@ -201,7 +201,9 @@ const handleCurrentChange = (page) => {
 // 搜索字段
 let searchValue = ref('')
 // 列表数据
-let tableData = ref([])
+let tableData = ref([
+  {name: 1}
+])
 // 编辑弹框
 let dialogShow = ref(false)
 // 编辑弹框标题
@@ -223,6 +225,10 @@ const showDetail = (scope) => {
 // 分配管理人
 let allocationShow = ref(false)
 
+// 设置负责人
+const setPeople = () => {
+  allocationShow.value = true
+}
 // 更多
 const tableDataCommand = (scope, e) => {
   switch (e) {

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