Explorar el Código

Merge branch 'dongk' into dev

@dongkboy hace 10 meses
padre
commit
e13653608b

+ 4 - 4
src/views/operationManagement/operation.vue

@@ -443,7 +443,7 @@ const dropdownCommand = (e) => {
           let ids = []
           if(selectedList.value.length>0) {
             selectedList.value.forEach(item => {
-              ids.push(item.userId)
+              ids.push(item.id)
             })
           } else {
             if(selectType == 'cur') {
@@ -478,7 +478,7 @@ const dropdownCommand = (e) => {
           let ids = []
           if(selectedList.value.length>0) {
             selectedList.value.forEach(item => {
-              ids.push(item.userId)
+              ids.push(item.id)
             })
           } else {
             if(selectType == 'cur') {
@@ -583,7 +583,7 @@ const tableDataCommand = (scope, e) => {
       }).then(( action ) => {
         if(action === 'confirm') {
           let data = {
-            ids: [scope.row.userId],
+            ids: [scope.row.id],
             isEnable: 1,
             getAll: selectType.value == 'all'?1:0
           }
@@ -620,7 +620,7 @@ const tableDataCommand = (scope, e) => {
       }).then(( action ) => {
         if(action === 'confirm'){
           let data = {
-            ids: [scope.row.userId],
+            ids: [scope.row.id],
             isEnable: 0,
             getAll: selectType.value == 'all'?1:0
           }

+ 32 - 2
src/views/operationManagement/operationDetail.vue

@@ -38,8 +38,8 @@
         </template>
         <el-descriptions-item label="工号:" width="33%">{{ dataDetail?.userId }}</el-descriptions-item>
         <el-descriptions-item label="所属机构:" width="33%">{{ dataDetail?.deptName }}</el-descriptions-item>
-        <el-descriptions-item label="状态:" width="33%">{{  dataDetail?.status == '0'?'待认证': dataDetail?.status == '1'?'已认证': dataDetail?.status == '2'?'待提交资料': dataDetail?.status == '3'?'已入职':'' }}</el-descriptions-item>
-        <el-descriptions-item label="类型:" width="33%">{{  dataDetail?.typeAttr == '1'?'个代': dataDetail?.typeAttr == '2'?'渠道': dataDetail?.typeAttr == '3'?'团队': dataDetail?.typeAttr == '4'?'电销组': '' }}</el-descriptions-item>
+        <el-descriptions-item label="状态:" width="33%">{{  statusMap(dataDetail?.status)}}</el-descriptions-item>
+        <el-descriptions-item label="类型:" width="33%">{{ typeAttrMap(dataDetail?.typeAttr) }}</el-descriptions-item>
         <el-descriptions-item label="所属团队:" width="33%">{{ dataDetail?.organizationName }}</el-descriptions-item>
         <el-descriptions-item label="创建人:" width="33%">{{ dataDetail?.updateBy }}</el-descriptions-item>
         <el-descriptions-item label="创建时间:" width="33%">{{ dataDetail?.createTime }}</el-descriptions-item>
@@ -279,6 +279,36 @@ let allocationShow = ref(false)
 const closeAllocation = (type: boolean) => {
   allocationShow.value = type
 }
+//状态匹配
+const statusMap = (value: any) => {
+  const map = {
+    "0": '未认证',
+    "1": '认证中',
+    "2": '认证失败',
+    "3": '待入职',
+    "4": '入司审核中',
+    "5": '入司审核失败',
+    "6": '已入职',
+    "7": '离职待审核',
+    "8": '离职',
+  }
+  return map[value]
+}
+//人员类型匹配
+const typeAttrMap=(value)=>{
+  const map = {
+    "1": '前线人员',
+    "2": '后线人员',
+    "3": '合伙人',
+    "4": '工作是管理员',
+    "5": '团队',
+    "6": '个代',
+    "7": '电销',
+    "8": '渠道',
+  }
+  return map[value]
+}
+
 
 // 银行卡列表数据
 // let tableData = ref([])

+ 118 - 109
src/views/operationManagement/team.vue

@@ -3,11 +3,14 @@
     <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" @keyup.enter="initTeam"></el-input>
+          <el-input class="search-input" v-model="treeValue" placeholder="团队名称查找" prefix-icon="Search"
+            @keyup.enter="initTeam"></el-input>
           <div class="custom-tree-node" v-for="item in teamData" :key="item.id" @click.stop="initList(item)">
             <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>
+              <el-icon>
+                <MoreFilled />
+              </el-icon>
               <template #dropdown>
                 <el-dropdown-menu>
                   <el-dropdown-item command="编辑">编辑</el-dropdown-item>
@@ -24,20 +27,16 @@
           <el-col :span="22" class="info">
             <h3>{{ teamInfo.name }}</h3>
             <p>所属机构: {{ teamInfo?.deptName }}</p>
-            <p>管理人: {{ teamInfo?.managerName?`${teamInfo?.managerName}-`:'' }}{{ teamInfo?.managerId }}</p>
+            <p>管理人: {{ teamInfo?.managerName ? `${teamInfo?.managerName}-` : '' }}{{ teamInfo?.managerId }}</p>
             <p>描述:{{ teamInfo?.describeInformation }}</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="输入姓名,手机号,工号查找" clearable @keyup.enter="initList(teamInfo)"></el-input>
-        <el-table
-          :data="tableData"
-          ref="operationListRef"
-          height="530"
-          @selection-change="handleSelectionChange"
-        >
+        <el-input style="width: 300px; margin: 10px 0" v-model="searchValue" prefix-icon="Search"
+          placeholder="输入姓名,手机号,工号查找" clearable @keyup.enter="initList(teamInfo)"></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">
             <template #default="scope">
@@ -48,19 +47,19 @@
           <el-table-column label="工号" prop="workNumber" width="200"></el-table-column>
           <el-table-column label="类型" prop="typeAttr" width="100">
             <template #default="scope">
-              {{ scope.row.typeAttr == '1'?'个代':scope.row.typeAttr == '3'?'渠道':scope.row.typeAttr == '2'?'团队':scope.row.typeAttr == '4'?'电销组': '' }}
+              {{ typeAttrMap(scope.row.typeAttr) }}
             </template>
           </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 == '0'?'待认证':scope.row.status == '1'?'已认证':scope.row.status == '2'?'待提交资料':scope.row.status == '3'?'已入职':'' }}
+              {{ statusMap(scope.row.status) }}
             </template>
           </el-table-column>
           <el-table-column label="账号状态" prop="isEnable" width="150">
             <template #default="scope">
-              {{ scope.row.isEnable == '1'?'禁用':scope.row.isEnable == '0'?'启用': '--' }}
+              {{ scope.row.isEnable == '1' ? '禁用' : scope.row.isEnable == '0' ? '启用' : '--' }}
             </template>
           </el-table-column>
           <el-table-column label="管理人" prop="leaderName" width="150"></el-table-column>
@@ -88,65 +87,38 @@
           </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"
-          />
+          <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"
-    >
+    <el-dialog v-model="dialogShow" :title="title" width="1000">
       <addOperation ref="AddOperationRef" @closeDialog="closeAddOperation"></addOperation>
     </el-dialog>
-    <el-dialog
-      v-model="addTeamShow"
-      title="添加"
-      width="800"
-    >
+    <el-dialog v-model="addTeamShow" title="添加" width="800">
       <addTeam ref="AddTeamRef" @closeDialog="closeAddTeamDialog"></addTeam>
     </el-dialog>
-    <el-dialog
-      v-model="allocationShow"
-      title="分配管理人"
-      width="800"
-    >
+    <el-dialog v-model="allocationShow" title="分配管理人" width="800">
       <allocation ref="AllocationRef" @closeDialog="closeAllocation"></allocation>
     </el-dialog>
-    <el-dialog
-      v-model="peopleShow"
-      title="设置负责人"
-      width="800"
-    >
-        <el-row :gutter="20">
-            <el-col :span="12">
-                <el-tree
-                        ref="treeRef"
-                        :data="options"
-                        :props="cascaderProps"
-                        @node-click="handleNodeClick"
-                />
-            </el-col>
-            <el-col :span="12">
-                <el-radio-group v-if="tableData?.length>0" v-model="radioValue" class="allocation-radio">
-                    <el-radio v-for="item in tableData" :value="item.id" size="large">
-                        <template #default>
-                            <div>{{ item.name }}</div>
-                            <div>{{ item.id }}</div>
-                        </template>
-                    </el-radio>
-                </el-radio-group>
-                <el-empty v-else description="暂无数据" />
-            </el-col>
-        </el-row>
+    <el-dialog v-model="peopleShow" title="设置负责人" width="800">
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-tree ref="treeRef" :data="options" :props="cascaderProps" @node-click="handleNodeClick" />
+        </el-col>
+        <el-col :span="12">
+          <el-radio-group v-if="tableData?.length > 0" v-model="radioValue" class="allocation-radio">
+            <el-radio v-for="item in tableData" :value="item.id" size="large">
+              <template #default>
+                <div>{{ item.name }}</div>
+                <div>{{ item.id }}</div>
+              </template>
+            </el-radio>
+          </el-radio-group>
+          <el-empty v-else description="暂无数据" />
+        </el-col>
+      </el-row>
       <template #footer>
         <el-button @click="onCancel">取消</el-button>
         <el-button type="primary" @click="onConfirm">确定</el-button>
@@ -156,13 +128,13 @@
 </template>
 
 <script setup lang="ts">
-import {ElMessageBox, ElMessage, TableInstance} from 'element-plus'
+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 {initial} from "lodash-es";
+import { initial } from "lodash-es";
 import team from "@/api/modules/team.ts";
 
 let myRouter = useRouter()
@@ -172,15 +144,15 @@ const AllocationRef = ref(null)
 
 // 机构数据
 const cascaderProps = {
-    value: 'id',
-    label: 'name',
-    children: 'children'
+  value: 'id',
+  label: 'name',
+  children: 'children'
 }
 let options = ref([])
 // 获取机构数据
 const institutionList = () => {
   api.institutionApi.institutionList({ name: '', system: '' }).then(res => {
-    if(res?.code == 200) {
+    if (res?.code == 200) {
       options.value = res.data
     } else {
       ElMessage({
@@ -191,9 +163,35 @@ const institutionList = () => {
   })
 }
 const handleNodeClick = (data) => {
-    initList(teamData.value[0])
+  initList(teamData.value[0])
+}
+const statusMap = (value: any) => {
+  const map = {
+    "0": '未认证',
+    "1": '认证中',
+    "2": '认证失败',
+    "3": '待入职',
+    "4": '入司审核中',
+    "5": '入司审核失败',
+    "6": '已入职',
+    "7": '离职待审核',
+    "8": '离职',
+  }
+  return map[value]
+}
+const typeAttrMap=(value)=>{
+  const map = {
+    "1": '前线人员',
+    "2": '后线人员',
+    "3": '合伙人',
+    "4": '工作是管理员',
+    "5": '团队',
+    "6": '个代',
+    "7": '电销',
+    "8": '渠道',
+  }
+  return map[value]
 }
-
 // 团队
 let treeValue = ref('')
 let teamData = ref([])
@@ -203,9 +201,9 @@ const initTeam = () => {
     param: treeValue.value,
     attribute: 1
   }).then(res => {
-    if(res.code == 200) {
+    if (res.code == 200) {
       teamData.value = res.data
-      if(teamData.value) {
+      if (teamData.value) {
         initList(teamData.value[0])
       }
     } else {
@@ -245,7 +243,7 @@ const initList = (item) => {
     pages: currentPage.value,
     size: pageSize.value
   }).then(res => {
-    if(res.code == 200) {
+    if (res.code == 200) {
       tableData.value = res.data.records
       total.value = res.data.total
     } else {
@@ -272,10 +270,10 @@ const treeNodeCommend = (item, e) => {
         showCancelButton: true,
         confirmButtonText: '确定',
         cancelButtonText: '取消',
-      }).then(( action ) => {
-        if(action === 'confirm') {
+      }).then((action) => {
+        if (action === 'confirm') {
           api.teamApi.deleteById(item.id).then(res => {
-            if(res.code == 200) {
+            if (res.code == 200) {
               ElMessage({
                 message: res.msg,
                 type: 'success'
@@ -289,7 +287,7 @@ const treeNodeCommend = (item, e) => {
             }
           })
         }
-      }).catch(( action ) => {
+      }).catch((action) => {
 
       })
       break;
@@ -344,7 +342,7 @@ const onCancel = () => {
   radioValue.value = ''
 }
 const onConfirm = () => {
-  if(!radioValue.value) {
+  if (!radioValue.value) {
     ElMessage({
       message: '请选择负责人',
       type: 'warning'
@@ -355,7 +353,7 @@ const onConfirm = () => {
     id: teamInfo.value.id,
     managerId: radioValue.value
   }).then(res => {
-    if(res.code == 200) {
+    if (res.code == 200) {
       ElMessage({
         message: res.msg,
         type: 'success'
@@ -392,13 +390,13 @@ const tableDataCommand = (scope, e) => {
         showCancelButton: true,
         confirmButtonText: '确定',
         cancelButtonText: '取消',
-      }).then(( action ) => {
-        if(action === 'confirm') {
+      }).then((action) => {
+        if (action === 'confirm') {
           api.teamApi.deleteAssociatedUsers({
             id: teamInfo.value.id,
             userIds: [scope.row.id]
           }).then(res => {
-            if(res?.code == 200) {
+            if (res?.code == 200) {
               ElMessage({
                 message: res.msg,
                 type: 'success'
@@ -412,7 +410,7 @@ const tableDataCommand = (scope, e) => {
             }
           })
         }
-      }).catch(( action ) => {
+      }).catch((action) => {
 
       })
       break;
@@ -424,15 +422,15 @@ const tableDataCommand = (scope, e) => {
         showCancelButton: true,
         confirmButtonText: '确定',
         cancelButtonText: '取消',
-      }).then(( action ) => {
-        if(action === 'confirm') {
+      }).then((action) => {
+        if (action === 'confirm') {
           let data = {
-            id: [scope.row.id],
+            ids: [scope.row.id],
             isEnable: 1,
             getAll: 0
           }
           api.operationApi.operationIsEnable(data).then(res => {
-            if(res?.code == 200) {
+            if (res?.code == 200) {
               ElMessage({
                 message: res.msg,
                 type: 'success'
@@ -446,7 +444,7 @@ const tableDataCommand = (scope, e) => {
             }
           })
         }
-      }).catch(( action ) => {
+      }).catch((action) => {
 
       })
       break;
@@ -458,15 +456,15 @@ const tableDataCommand = (scope, e) => {
         showCancelButton: true,
         confirmButtonText: '确定',
         cancelButtonText: '取消',
-      }).then(( action ) => {
-        if(action === 'confirm'){
+      }).then((action) => {
+        if (action === 'confirm') {
           let data = {
-            id: [scope.row.id],
+            ids: [scope.row.id],
             isEnable: 0,
             getAll: 0
           }
           api.operationApi.operationIsEnable(data).then(res => {
-            if(res?.code == 200) {
+            if (res?.code == 200) {
               ElMessage({
                 message: res.msg,
                 type: 'success'
@@ -480,7 +478,7 @@ const tableDataCommand = (scope, e) => {
             }
           })
         }
-      }).catch(( action ) => {
+      }).catch((action) => {
 
       })
       break;
@@ -505,17 +503,20 @@ onMounted(() => {
 </script>
 
 <style scoped lang="scss">
-.team{
+.team {
   height: 770px;
   background: #fff;
-  .search-input{
+
+  .search-input {
     padding: 10px 20px;
   }
-  .teamTree{
+
+  .teamTree {
     height: 700px;
     overflow-y: auto;
     background: #fff;
-    .custom-tree-node{
+
+    .custom-tree-node {
       width: calc(100% - 40px);
       display: flex;
       justify-content: space-between;
@@ -523,10 +524,12 @@ onMounted(() => {
       padding: 5px 10px;
       margin: 5px auto;
       cursor: pointer;
-      &:hover{
-        background: rgba(0,0,0,.1);
+
+      &:hover {
+        background: rgba(0, 0, 0, .1);
       }
-      .custom-tree-node-label{
+
+      .custom-tree-node-label {
         width: 70%;
         overflow: hidden;
         white-space: nowrap;
@@ -534,30 +537,36 @@ onMounted(() => {
       }
     }
   }
-  .add-btn{
+
+  .add-btn {
     display: block;
     margin: 0 auto;
   }
-  .info{
-    h3{
+
+  .info {
+    h3 {
       margin: 10px 0;
     }
-    p{
+
+    p {
       margin: 6px 0;
       font-size: 14px;
-      color: rgba(0,0,0,.7);
+      color: rgba(0, 0, 0, .7);
     }
   }
-  .btn{
+
+  .btn {
     display: flex;
     justify-content: flex-end;
     align-items: flex-end;
   }
-  .nameInfo{
+
+  .nameInfo {
     display: flex;
     justify-content: center;
     align-content: center;
-    span{
+
+    span {
       background: #f0f0f0;
       padding: 2px 4px;
       border-radius: 2px;

+ 97 - 116
src/views/personnel/institutionManage.vue

@@ -5,11 +5,7 @@
         <el-row :gutter="16">
           <el-col :span="6">
             <el-form-item label="">
-              <el-input
-                v-model="info.name"
-                placeholder="输入机构名称查找"
-                :prefix-icon="Search"
-              />
+              <el-input v-model="info.name" placeholder="输入机构名称查找" :prefix-icon="Search" />
             </el-form-item>
           </el-col>
 
@@ -22,22 +18,15 @@
         </el-row>
       </el-form>
 
-      <Table
-        :tableData="tableData"
-        :columns="columns"
-        :showIndex="false"
-        :showSelect="true"
-        :pageInfo="pageInfo"
-        @getList="getList"
-        :treeProps="{ children: 'children', hasChildren: 'hasChildren' }"
-        @select-all-change="selectAllChange"
-        @select-change="selectChange"
-      >
+      <Table :tableData="tableData" :columns="columns" :showIndex="false" :showSelect="true" :pageInfo="pageInfo"
+        @getList="getList" :treeProps="{ children: 'children', hasChildren: 'hasChildren' }"
+        @select-all-change="selectAllChange" @select-change="selectChange">
         <template v-slot:table-title-btn>
           <div>
             <el-button type="primary" @click="add(ruleFormRef)">
-              <el-icon><Plus /></el-icon>添加机构</el-button
-            >
+              <el-icon>
+                <Plus />
+              </el-icon>添加机构</el-button>
             <el-dropdown placement="bottom-start">
               <el-button>
                 批量操作<el-icon class="el-icon--right">
@@ -54,20 +43,14 @@
           </div>
         </template>
         <template v-slot:operation="scope">
-          <el-button
-            type="primary"
-            link
-            @click="addChild(scope.operationData.row)"
-          >
+          <el-button type="primary" link @click="addChild(scope.operationData.row)">
             添加子机构
           </el-button>
           <el-dropdown placement="bottom-start">
             <span class="el-dropdown-link"> 更多 </span>
             <template #dropdown>
               <el-dropdown-menu>
-                <el-dropdown-item v-on:click="editor(scope.operationData.row)"
-                  >编辑</el-dropdown-item
-                >
+                <el-dropdown-item v-on:click="editor(scope.operationData.row)">编辑</el-dropdown-item>
                 <el-dropdown-item v-on:click="del(scope.operationData.row)">
                   删除
                 </el-dropdown-item>
@@ -83,15 +66,9 @@
     </div>
 
 
-    <setDept
-    :dialogVisible="deptDialogVisible"
-      :dept-list="tableData"
-      :dept-ids="deptIdList"
-      :dept-selected = "deptSelected"
-      :title="'设置负责人'"
-      @close-dialog="confirmCharge"
-      @cancel-dialog="deptDialogVisible=false"
-    ></setDept>
+    <setDept :dialogVisible="deptDialogVisible" :dept-list="tableData" :dept-ids="deptIdList"
+      :dept-selected="deptSelected" :title="'设置负责人'" @close-dialog="confirmCharge"
+      @cancel-dialog="deptDialogVisible = false"></setDept>
   </div>
 </template>
 
@@ -109,7 +86,7 @@ import setDept from "@/components/DialogSetDeptLeader/index.vue"
 // import router from "@/router";
 import { useRouter } from "vue-router";
 
-const router=useRouter()
+const router = useRouter()
 interface Tree {
   [key: string]: any;
 }
@@ -122,57 +99,57 @@ const defaultProps = {
   label: "label",
 };
 //设置负责人弹框
-const deptDialogVisible=ref(false)
-const deptIdList=ref([])
+const deptDialogVisible = ref(false)
+const deptIdList = ref([])
 let deptSelected = ref('')
-function setDeptUser(item:any){
+function setDeptUser(item: any) {
   deptSelected.value = item.leaderId
-  deptIdList.value=[item.id]
-  deptDialogVisible.value=true
+  deptIdList.value = [item.id]
+  deptDialogVisible.value = true
 }
 
 // 批量删除
 const betchDel = () => {
-    ElMessageBox({
-        title: '提示',
-        message: '确认要删除当前数据吗?',
-        confirmButtonText: "确认",
-        cancelButtonText: "取消",
-        type: "warning",
-        center:true
-    }).then((action) => {
-        if(action === 'confirm') {
-            api.institutionApi
-                .batchDeleteDept({
-                    deptIds: checkTableIdList.value,
-                })
-                .then((res) => {
-                    if(res.code == 200) {
-                        ElMessage.success("操作成功");
-                        getInstitutionList(); //机构列表
-                    }
-                });
-        }
-    })
-        .catch(() => {
-            ElMessage.warning("用户取消操作");
+  ElMessageBox({
+    title: '提示',
+    message: '确认要删除当前数据吗?',
+    confirmButtonText: "确认",
+    cancelButtonText: "取消",
+    type: "warning",
+    center: true
+  }).then((action) => {
+    if (action === 'confirm') {
+      api.institutionApi
+        .batchDeleteDept({
+          deptIds: checkTableIdList.value,
+        })
+        .then((res) => {
+          if (res.code == 200) {
+            ElMessage.success("操作成功");
+            getInstitutionList(); //机构列表
+          }
         });
+    }
+  })
+    .catch(() => {
+      ElMessage.warning("用户取消操作");
+    });
 }
 
 //批量设置负责人
 
-function manySetDeptUser(){
-  if(checkTableIdList.value.length>0){
-    deptIdList.value=checkTableIdList.value
-    deptDialogVisible.value=true
-  }else{
+function manySetDeptUser() {
+  if (checkTableIdList.value.length > 0) {
+    deptIdList.value = checkTableIdList.value
+    deptDialogVisible.value = true
+  } else {
     ElMessage.warning("请选择机构后,再进行设置负责人")
   }
 
 }
 
-function confirmCharge(){
-  deptDialogVisible.value=false
+function confirmCharge() {
+  deptDialogVisible.value = false
   getInstitutionList(); //机构列表
 }
 
@@ -213,7 +190,7 @@ interface PageInfo {
   pageSize: number;
   sizes: number[];
   total: number;
-  show:boolean;
+  show: boolean;
 }
 const value = ref("");
 const dialogVisible = ref(false);
@@ -258,18 +235,16 @@ const columns = [
   { prop: "userCount", label: "人数" },
   { prop: "comType", label: "机构类型", formatter: typeformatter },
   {
-    prop: "comAttribute",
+    prop: "exhibitionScope",
     label: "展业范围",
     formatter: (row: any, column: any, cellValue: any) => {
-      let newArr = []
-      let comType = "";
-      newArr = exhibitionScopeTypeList.value.filter(item => row.exhibitionScope.some(sub => sub !=item.value))
-      if(newArr.length > 0) {
-        newArr.forEach(item => {
-          comType+=`${item.label} `
-        })
+      console.log(row)
+      const exhibitionScopeMap = {
+        "1": '车险',
+        "2": '寿险'
       }
-      return () => h("div", {}, comType);
+      let data = row.exhibitionScope.map((val: any) => exhibitionScopeMap[val] || val)
+      return () => h("div", {}, data.toString());
     },
   },
   { prop: "address", label: "所属地区" },
@@ -281,7 +256,7 @@ const pageInfo = {
   pageSize: 10,
   sizes: [10, 20, 30, 40, 50],
   total: 100,
-  show:false
+  show: false
 };
 //分页列表功能
 const getList = (item: PageInfo) => {
@@ -289,16 +264,16 @@ const getList = (item: PageInfo) => {
   pageInfo.pageSize = item.pageSize;
 };
 
-const checkTableIdList=ref([])
+const checkTableIdList = ref([])
 //表格选择事件
-function selectAllChange(list:any){
+function selectAllChange(list: any) {
 
-  checkTableIdList.value=list
+  checkTableIdList.value = list
 }
 
-function selectChange(list:any){
+function selectChange(list: any) {
 
-  checkTableIdList.value=list
+  checkTableIdList.value = list
 }
 //添加子机构
 
@@ -306,10 +281,10 @@ const isDisabledId = ref("");
 const addChild = (item: any) => {
   console.log(123, item)
   router.push({
-    path:'/personnel/institution/institutionEdit',
-    query:{
-      type:"add",
-      id:item.id
+    path: '/personnel/institution/institutionEdit',
+    query: {
+      type: "add",
+      id: item.id
     }
   })
 
@@ -317,10 +292,10 @@ const addChild = (item: any) => {
 const editor = (item: any) => {
 
   router.push({
-    path:'/personnel/institution/institutionEdit',
-    query:{
-      type:"edit",
-      id:item.id
+    path: '/personnel/institution/institutionEdit',
+    query: {
+      type: "edit",
+      id: item.id
     }
   })
 
@@ -334,24 +309,24 @@ const del = (item: any) => {
     confirmButtonText: "确认",
     cancelButtonText: "取消",
     type: "warning",
-    center:true
+    center: true
   }).then((action) => {
-    if(action === 'confirm') {
+    if (action === 'confirm') {
       api.institutionApi
         .institutionDel({
           id: item.id,
         })
         .then((res) => {
-            if(res.code == 200) {
-                ElMessage.success("操作成功");
-                getInstitutionList(); //机构列表
-            }
+          if (res.code == 200) {
+            ElMessage.success("操作成功");
+            getInstitutionList(); //机构列表
+          }
         });
     }
   })
-  .catch(() => {
-    ElMessage.warning("用户取消操作");
-  });
+    .catch(() => {
+      ElMessage.warning("用户取消操作");
+    });
 };
 
 //添加的弹框
@@ -360,9 +335,9 @@ const add = (formEl: FormInstance | undefined) => {
   // dialogVisible.value = true;
   // operationType.value = "add";
   router.push({
-    path:'/personnel/institution/institutionEdit',
-    query:{
-      type:"add"
+    path: '/personnel/institution/institutionEdit',
+    query: {
+      type: "add"
     }
   })
 
@@ -469,13 +444,13 @@ const getInstitutionList = () => {
 };
 
 //成员列表
-const memberList=ref([])
+const memberList = ref([])
 const getAllMemberList = () => {
   // pageInfo.pageNum=item.pageNum
-  api.userApi.AllMemberList({}).then((res:any) => {
+  api.userApi.AllMemberList({}).then((res: any) => {
 
-    if(res.code===200)
-    memberList.value=res.data
+    if (res.code === 200)
+      memberList.value = res.data
   });
   // pageInfo.pageSize=item.pageSize
 };
@@ -496,7 +471,7 @@ const confirm = async (formEl: FormInstance | undefined) => {
             province: form.area[0],
             city: form.area[1],
             area: form.area[2],
-            parentId:typeof obj.parentId=='string' ? obj.parentId:obj.parentId[obj.parentId.length-1]
+            parentId: typeof obj.parentId == 'string' ? obj.parentId : obj.parentId[obj.parentId.length - 1]
           })
           .then((res) => {
             if (res.code === 200) {
@@ -513,7 +488,7 @@ const confirm = async (formEl: FormInstance | undefined) => {
             province: form.area[0],
             city: form.area[1],
             area: form.area[2],
-            parentId:typeof obj.parentId=='string' ? obj.parentId:obj.parentId[obj.parentId.length-1]
+            parentId: typeof obj.parentId == 'string' ? obj.parentId : obj.parentId[obj.parentId.length - 1]
 
           })
           .then((res) => {
@@ -538,8 +513,8 @@ const remove = (node: Node, data: Tree) => {
 };
 const reset = (item: any) => {
   // ElMessage({})
-    info.value.name = ''
-    getInstitutionList()
+  info.value.name = ''
+  getInstitutionList()
 };
 
 onMounted(() => {
@@ -556,10 +531,12 @@ onMounted(() => {
   display: flex;
   align-items: center;
   justify-content: space-between;
-  > div {
+
+  >div {
     display: flex;
   }
 }
+
 .institution {
   background: #fff;
   width: 100%;
@@ -567,6 +544,7 @@ onMounted(() => {
   // padding: 20px;
   box-sizing: border-box;
   display: flex;
+
   .institution-tree {
     flex: none;
     width: 20%;
@@ -574,6 +552,7 @@ onMounted(() => {
     box-sizing: border-box;
     border-right: 1px solid #ccc;
   }
+
   .institution-main {
     flex: 1;
     // width: 80%;
@@ -581,6 +560,7 @@ onMounted(() => {
     box-sizing: border-box;
   }
 }
+
 :deep(.el-dropdown-link) {
   cursor: pointer;
   color: var(--el-color-primary);
@@ -588,6 +568,7 @@ onMounted(() => {
   align-items: center;
   margin-left: 15px;
 }
+
 .custom-tree-node {
   flex: 1;
   display: flex;

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 304 - 519
src/views/personnel/modules/addOperation.vue


+ 26 - 116
src/views/personnel/modules/editInstitution.vue

@@ -1,112 +1,47 @@
 <template>
   <div class="institution">
-    <el-form
-      label-position="top"
-      label-width="auto"
-      :rules="rules"
-      :model="form"
-      ref="ruleFormRef"
-    >
+    <el-form label-position="top" label-width="auto" :rules="rules" :model="form" ref="ruleFormRef">
       <el-row :gutter="24">
         <el-col :span="12">
           <el-form-item label="机构名称" prop="name">
-            <el-input
-              v-model.trim="form.name"
-              maxlength="50"
-              placeholder="输入机构名称"
-              clearable
-            />
+            <el-input v-model.trim="form.name" maxlength="50" placeholder="输入机构名称" clearable />
           </el-form-item>
         </el-col>
-        <el-col :span="12">
+        <el-col :span="12" v-if="route.query.id">
           <el-form-item label="上级机构" prop="parentId">
-            <el-cascader
-              clearable
-              style="width: 100%"
-              v-model="form.parentId"
-              :options="tableData"
-              :props="tableProps"
-              @change="handleChange"
-            />
-            <!-- <el-select v-model="form.parentId" placeholder="选择上级机构" clearable>
-                <el-option
-                  v-for="item in tableData"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
-
-              </el-select> -->
+            <el-cascader clearable style="width: 100%"  v-model="form.parentId"
+              :options="tableData" :props="tableProps" @change="handleChange" />
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="机构类型" prop="comType">
-            <el-select
-              v-model="form.comType"
-              placeholder="选择机构类型"
-              clearable
-            >
-              <el-option
-                v-for="item in comTypeList"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              />
+            <el-select v-model="form.comType" placeholder="选择机构类型" clearable>
+              <el-option v-for="item in comTypeList" :key="item.value" :label="item.label" :value="item.value" />
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="地区" prop="area">
-            <el-cascader
-              clearable
-              style="width: 100%"
-              v-model="form.area"
-              :options="areaOptins"
-              :props="areaProps"
-            />
+            <el-cascader clearable style="width: 100%" v-model="form.area" :options="areaOptins" :props="areaProps" />
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="展业范围" prop="exhibitionScope">
-            <el-select
-              v-model="form.exhibitionScope"
-              placeholder="选择展业范围"
-              multiple
-              clearable
-            >
-              <el-option
-                v-for="item in exhibitionScopeTypeList"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              />
+            <el-select v-model="form.exhibitionScope" placeholder="选择展业范围" multiple clearable>
+              <el-option v-for="item in exhibitionScopeTypeList" :key="item.value" :label="item.label"
+                :value="item.value" />
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="机构地址" prop="address">
-            <el-input
-              v-model.trim="form.address"
-              maxlength="50"
-              placeholder="请输入机构地址"
-              type="textarea"
-              clearable
-            />
+            <el-input v-model.trim="form.address" maxlength="50" placeholder="请输入机构地址" type="textarea" clearable />
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="机构负责人" prop="leaderId">
-            <el-select
-              v-model="form.leaderId"
-              placeholder="选择机构负责人"
-              clearable
-            >
-              <el-option
-                v-for="item in memberList"
-                :key="item.userId"
-                :label="item.name"
-                :value="item.userId"
-              />
+            <el-select v-model="form.leaderId" placeholder="选择机构负责人" clearable>
+              <el-option v-for="item in memberList" :key="item.userId" :label="item.name" :value="item.userId" />
             </el-select>
           </el-form-item>
         </el-col>
@@ -149,26 +84,20 @@ onMounted(() => {
             form[key] = res.data[key];
           }
           form.area = [res.data.province, res.data.city, res.data.area];
-          console.log(123, form)
         }
       });
-  }else{
-    form.parentId= route.query.id
-  }
 
-  if(route.query.id) {
     setTimeout(() => {
       disabledEditTree(tableData.value);
     }, 1000);
   } else {
-    setTimeout(() => {
-      disabledAddTree(tableData.value);
-    }, 1000);
+    form.parentId = route.query.id
   }
 });
 
 const handleChange = (e) => {
   console.log(123123123, e)
+  form.parentId=e[e.length-1]
 }
 
 //禁用机构选择
@@ -176,7 +105,7 @@ function disabledEditTree(list) {
   for (let i = 0; i < list.length; i++) {
     const node = list[i];
     if (route.query.id) {
-      if (list[i].id === route.query.id || list[i].parentId == '0') {
+      if (list[i].id === route.query.id ) {
         list[i].disabled = true;
       }
     } else {
@@ -187,20 +116,9 @@ function disabledEditTree(list) {
       disabledEditTree(node.children);
     }
   }
+  console.log(tableData.value)
 }
-const disabledAddTree = (list) => {
-  for (let i = 0; i < list.length; i++) {
-    const node = list[i];
-    if (list[i].parentId == '0') {
-      list[i].disabled = true;
-    } else {
-      list[i].disabled = false;
-    }
-    if (node.children && node.children.length > 0) {
-      disabledAddTree(node.children);
-    }
-  }
-}
+
 interface institutionData {
   name: string;
   system: string;
@@ -349,23 +267,18 @@ const confirm = async (formEl: FormInstance | undefined) => {
   if (!formEl) return;
   await formEl.validate((valid, fields) => {
     if (valid) {
-      const obj = { ...form };
-      delete obj.area;
-      // console.log(obj)
+      console.log(form)
+
       if (route.query.type == "add") {
         api.institutionApi
           .institutionAdd({
-            ...obj,
+            ...form,
             systemCode: localStorage.getItem("login_system") || "",
             province: form.area[0],
             city: form.area[1],
             area: form.area[2],
-            parentId:
-              typeof obj.parentId == "string"
-                ? obj.parentId
-                : obj.parentId[obj.parentId.length - 1],
           })
-          .then((res) => {
+          .then((res: any) => {
             if (res.code === 200) {
               ElMessage.success("操作成功");
               dialogVisible.value = false;
@@ -375,17 +288,13 @@ const confirm = async (formEl: FormInstance | undefined) => {
       } else {
         api.institutionApi
           .institutionEdit({
-            ...obj,
+            ...form,
             systemCode: localStorage.getItem("login_system") || "",
             province: form.area[0],
             city: form.area[1],
             area: form.area[2],
-            parentId:
-              typeof obj.parentId == "string"
-                ? obj.parentId
-                : obj.parentId[obj.parentId.length - 1],
           })
-          .then((res) => {
+          .then((res:any) => {
             if (res.code === 200) {
               ElMessage.success("操作成功");
               dialogVisible.value = false;
@@ -402,6 +311,7 @@ const confirm = async (formEl: FormInstance | undefined) => {
   padding: 15px;
   box-sizing: border-box;
   background: #fff;
+
   .dialog-footer {
     display: flex;
     align-items: center;

+ 2 - 4
src/views/personnel/modules/memberMessage.vue

@@ -43,7 +43,7 @@
               {{ operationForm.deptName }}
             </el-descriptions-item>
             <el-descriptions-item label="角色:">
-              {{ operationForm.deptName }}
+              {{ operationForm.roleNames }}
             </el-descriptions-item>
             <el-descriptions-item label="创建人:">
               {{ operationForm.createBy }}
@@ -765,10 +765,8 @@ onMounted(async () => {
       if (res.code === 200) {
         operationForm.value = res.data;
         let formData = res.data
-
+        operationForm.value.roleNames=operationForm.value.roleNames.join(',')
         if(formData.fileList) {
-
-
           let sfz1 = formData.fileList.find(item => item.fileType == 'sfz1')
           let sfz2 = formData.fileList.find(item => item.fileType == 'sfz2')
 

+ 4 - 1
src/views/quoteConfig/agreement/agreementAdd.vue

@@ -360,8 +360,11 @@ const detailsInfo = () => {
           agreementFrom[key as keyof AgreementForm] = res.data.agreement[key] as AgreementForm[keyof AgreementForm];
         }
       });
+      console.log(res.data.agreement)
       imageUrl.value = res.data.agreement.fileUrl
-      imageName.value = processFileName(res.data.agreement.fileName)
+      if(res.data.agreement.fileName){
+        imageName.value = processFileName(res.data.agreement.fileName)
+      }
       fileSize.value = res.data.agreement.fileSize?formatFileSize(res.data.agreement.fileSize):''
       managerName.value = res.data.agreement.managerName + ' - ' + res.data.agreement.deptName;
       attributionName.value = `用户名:${res.data.agreement.username}\n简称:${res.data.agreement.userAbbr}`;

+ 2 - 2
src/views/quoteConfig/agreement/components/orderAccount.vue

@@ -5,8 +5,8 @@
       <div class="flex a-c j-s ">
         <div class="flex a-c">
           <el-input v-model="searchValue" style="width: 240px;margin-right: 10px;" clearable
-            placeholder="输入姓名,手机号,工号查找" />
-          <el-button type="primary">查询</el-button>
+            placeholder="输入用户名,简称,保险公司查找" />
+          <el-button type="primary" @click="refresh">查询</el-button>
         </div>
         <div>
           <el-button type="default" @click="addAccount">添加账号

+ 1 - 1
src/views/quoteConfig/insuranceCompanyAccount/modules/insuranceAccountAdd.vue

@@ -64,7 +64,7 @@
           <template #default>
             <el-row :gutter="20">
               <el-col :span="12" v-for="item in fielsOption" :key="item.field">
-                <el-form-item :label="item.label" :prop="item.field">
+                <el-form-item :label="item.label" :prop="item.field" label-width="200">
                   <el-input v-model="insuranceAccountForm[item.field]" placeholder="请填写配置字段"></el-input>
                 </el-form-item>
               </el-col>

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio