|
|
@@ -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;
|