提交 9bdee209 编写于 作者: zhentian.jia's avatar zhentian.jia

选择范围关联设定机构 科室 人员的逻辑 fix bug

上级 5cab5727
...@@ -9,7 +9,7 @@ export const envConfig = { ...@@ -9,7 +9,7 @@ export const envConfig = {
// baseUrl: 'https://test1-sc.yunqueyi.com/', // baseUrl: 'https://test1-sc.yunqueyi.com/',
//baseUrl: 'https://uat-sc.yunqueyi.com/', //baseUrl: 'https://uat-sc.yunqueyi.com/',
baseUrl: 'http://localhost:11905/portal/', baseUrl: 'http://192.168.110.226:11905/portal/',
qiniuFileUrl: "http://localhost:10201/contents/admin/qiniu/token1", qiniuFileUrl: "http://localhost:10201/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com", qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com", qiniuImgUrl: "https://test1-file.yunqueyi.com",
......
...@@ -216,15 +216,15 @@ ...@@ -216,15 +216,15 @@
:data="tableOrganization" :data="tableOrganization"
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%" style="width: 100%"
@selection-change="handleSelectionOrganization" @selection-change="selectionChangeOrganization"
> >
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="name" label="医院名称"></el-table-column> <el-table-column prop="name" label="医院名称" min-width="100" align="center"></el-table-column>
<el-table-column prop="hospitalLevel" label="医院级别"></el-table-column> <el-table-column prop="hospitalLevel" label="医院级别" align="center"></el-table-column>
<el-table-column prop="provinceName" label="所属省份"></el-table-column> <el-table-column prop="provinceName" label="所属省份" align="center"></el-table-column>
<el-table-column prop="cityName" label="所属城市"></el-table-column> <el-table-column prop="cityName" label="所属城市" align="center"></el-table-column>
<el-table-column prop="countyName" label="所属区县"></el-table-column> <el-table-column prop="countyName" label="所属区县" align="center"></el-table-column>
<el-table-column prop="townName" label="所属街道"></el-table-column> <el-table-column prop="townName" label="所属街道" align="center"></el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination <el-pagination
...@@ -247,10 +247,10 @@ ...@@ -247,10 +247,10 @@
:data="tableDepartment" :data="tableDepartment"
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%" style="width: 100%"
@selection-change="handleSelectionChange" @selection-change="selectionChangeDepartment"
> >
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="name" label="科室名称"></el-table-column> <el-table-column prop="name" label="科室名称" align="center"></el-table-column>
</el-table> </el-table>
</el-col> </el-col>
</el-tab-pane> </el-tab-pane>
...@@ -300,15 +300,15 @@ ...@@ -300,15 +300,15 @@
:data="tablePerson" :data="tablePerson"
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%" style="width: 100%"
@selection-change="handleSelectionChange" @selection-change="selectionChangePerson"
> >
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="name" label="人员名称"></el-table-column> <el-table-column prop="name" label="人员名称" align="center"></el-table-column>
<el-table-column prop="hospitalName" label="所属医院"></el-table-column> <el-table-column prop="hospitalName" label="所属医院" align="center"></el-table-column>
<el-table-column prop="departmentName" label="所属部门"></el-table-column> <el-table-column prop="departmentName" label="所属部门" align="center"></el-table-column>
<el-table-column prop="provinceName" label="所属省份"></el-table-column> <el-table-column prop="provinceName" label="所属省份" align="center"></el-table-column>
<el-table-column prop="cityName" label="所属城市"></el-table-column> <el-table-column prop="cityName" label="所属城市" align="center"></el-table-column>
<el-table-column prop="countyName" label="所属区县" show-overflow-tooltip></el-table-column> <el-table-column prop="countyName" label="所属区县" align="center"></el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination <el-pagination
...@@ -395,6 +395,7 @@ import BreadCrumb from "../../components/breadcrumb.vue"; ...@@ -395,6 +395,7 @@ import BreadCrumb from "../../components/breadcrumb.vue";
import { doUpload, getFilePath } from "../../utils/qiniuUtil"; import { doUpload, getFilePath } from "../../utils/qiniuUtil";
import { returnData } from "../mock"; import { returnData } from "../mock";
import { setTimeout } from "timers"; import { setTimeout } from "timers";
import { openLoading, closeLoading } from "../../utils/utils";
let vm = null; let vm = null;
export default { export default {
components: { components: {
...@@ -449,11 +450,15 @@ export default { ...@@ -449,11 +450,15 @@ export default {
label: "label", label: "label",
isLeaf: "isLeaf" isLeaf: "isLeaf"
}, },
//treeData: [],
treeData: [], treeData: [],
tagsRegion: [], tagsRegion: [],
//设定机构 数据 //设定机构 数据
organizationChange: false, checkTableState: {
multipleOrganization: true,
multipleDepartment: true,
multiplePerson: true
},
updatedOrganization: false,
formOrganization: { formOrganization: {
name: "", name: "",
region: "", region: "",
...@@ -483,17 +488,20 @@ export default { ...@@ -483,17 +488,20 @@ export default {
} }
], ],
hasOrganizationInit: false, hasOrganizationInit: false,
//tableOrganization: Array(10).fill(itemOrganization),
tableOrganization: new Array(), tableOrganization: new Array(),
multipleSelectionOrganization: [], multipleSelectionOrganization: [],
currentOrganization: 1, currentOrganization: 1,
totalOrganization: 10, totalOrganization: 10,
pageSizeOrganization: 2, pageSizeOrganization: 2,
changedOrganization: {},
//设定科室 数据 //设定科室 数据
formDepartment: { formDepartment: {
grade: "" grade: ""
}, },
tableDepartment: [], tableDepartment: [],
multipleSelectionDepartment: [],
updatedDepartment: false,
changedDepartment: {},
//设定人员 数据 //设定人员 数据
formPersonnel: { formPersonnel: {
hospital: "", hospital: "",
...@@ -502,10 +510,12 @@ export default { ...@@ -502,10 +510,12 @@ export default {
pageSize: 10 pageSize: 10
}, },
tablePerson: new Array(), tablePerson: new Array(),
multipleSelectionPerson: [],
currentPerson: 1, currentPerson: 1,
pageSizePerson: 2, pageSizePerson: 2,
totalPerson: 10, totalPerson: 10,
updatedPersonn: false,
changedPerson: {},
//选择项目组件 数据 //选择项目组件 数据
optionsComponent: [], optionsComponent: [],
optionsCertificate: [], optionsCertificate: [],
...@@ -582,8 +592,8 @@ export default { ...@@ -582,8 +592,8 @@ export default {
}, },
created() { created() {
vm = this; vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "projectId"), (this.projectId = vm.getUrlSearch(window.location.href, "projectId")),
this.editManager(); this.editManager();
this.changeOnStep(this.active); this.changeOnStep(this.active);
this.$nextTick(function() { this.$nextTick(function() {
...@@ -1024,6 +1034,7 @@ export default { ...@@ -1024,6 +1034,7 @@ export default {
//设定机构 //设定机构
this.getOrganization(); this.getOrganization();
} else if (tabName == "third") { } else if (tabName == "third") {
this.$refs.multipleDepartment.toggleAllSelection();
//设定科室 //设定科室
} else if (tabName == "fourth") { } else if (tabName == "fourth") {
//设定人员 //设定人员
...@@ -1047,21 +1058,23 @@ export default { ...@@ -1047,21 +1058,23 @@ export default {
//查询行政范围(树) //查询行政范围(树)
getAdministrative() { getAdministrative() {
let req = { let req = {
projectId: 54 projectId: this.projectId
}; };
openLoading(vm);
vm.GET("scope/v1/administrative", req).then(res => { vm.GET("scope/v1/administrative", req).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
//console.log(res.data); //console.log(res.data);
closeLoading(vm);
let administrativeAll = res.data.administrativeAll; let administrativeAll = res.data.administrativeAll;
let administrative = res.data.administrative; let administrative = res.data.administrative;
this.treeData = []; this.treeData = [];
this.treeData[0] = administrativeAll; this.treeData[0] = administrativeAll;
this.setTreeData(administrative); this.setTreeData(administrative);
console.log("treeData", this.treeData); //console.log("treeData", this.treeData);
} }
}); });
}, },
//列举选中地区 //列举选中地区
initCheckList(allSelectedKeys) { initCheckList(allSelectedKeys) {
this.tagsRegion = []; this.tagsRegion = [];
...@@ -1088,7 +1101,10 @@ export default { ...@@ -1088,7 +1101,10 @@ export default {
console.log("node:", node); console.log("node:", node);
if (data.children.length == 0) { if (data.children.length == 0) {
let id = data.id + "add"; let id = data.id + "add";
const newChild = [{ id: id, label: "testtest", children: [] },{ id: id, label: "22", children: [] }]; const newChild = [
{ id: id, label: "testtest", children: [] },
{ id: id, label: "22", children: [] }
];
//data.children.push(newChild); //data.children.push(newChild);
let req = { let req = {
...@@ -1158,7 +1174,7 @@ export default { ...@@ -1158,7 +1174,7 @@ export default {
this.initCheckList(allSelectedKeys); this.initCheckList(allSelectedKeys);
//改变行政范围后,更新设定机构和设定人员 //改变行政范围后,更新设定机构和设定人员
this.updateOrganizationAndPerson(allSelectedKeys); this.updateOrganizationAndPerson(allSelectedKeys);
this.organizationChange = true; this.updatedTree = true;
}, },
// 递归删除列表中所有子节点 // 递归删除列表中所有子节点
delSubKeysByNode(node, checkedKeys) { delSubKeysByNode(node, checkedKeys) {
...@@ -1211,58 +1227,186 @@ export default { ...@@ -1211,58 +1227,186 @@ export default {
this.tagsRegion.splice(this.tagsRegion.indexOf(tag), 1); this.tagsRegion.splice(this.tagsRegion.indexOf(tag), 1);
this.setCheckedKeys(this.tagsRegion); this.setCheckedKeys(this.tagsRegion);
}, },
//获取反选数据
getDifference(a, b) {
if (a.constructor === Array && b.constructor === Array) {
let set1 = new Set(a);
let set2 = new Set(b);
return Array.from(new Set([...set1].filter(x => !set2.has(x))));
}
return null;
},
getReverseData(data, check) {
let reverse = [];
//console.log('data',data,'check',check);
for (let i = 0; i < data.length; i++) {
for (let j = 0; j < check.length; j++) {
if (data[i].id !== check[j].id) {
reverse.push(data[i]);
}
}
}
return reverse;
},
//改变 设定机构选项 //改变 设定机构选项
handleSelectionOrganization(val) { selectionChangeOrganization(val) {
this.multipleSelectionOrganization = val; this.multipleSelectionOrganization = val;
//console.log(this.multipleSelectionOrganization); //console.log(val.length , this.formOrganization.pageSize , this.updatedOrganization)
this.updatePerson(this.multipleSelectionOrganization); if (
val.length != 0 &&
val.length != this.formOrganization.pageSize &&
this.updatedOrganization == false
) {
this.updatedOrganization = true;
console.log('机构被更新',this.updatedOrganization);
}
if(this.updatedOrganization == true) {
this.changedOrganization[this.formOrganization.pageNum] = [];
this.changedOrganization[
this.formOrganization.pageNum
][0] = this.multipleSelectionOrganization;
let reverse = this.getDifference(
this.tableOrganization,
this.multipleSelectionOrganization
);
this.changedOrganization[this.formOrganization.pageNum][1] = reverse;
console.log("check机构:", this.changedOrganization);
}
},
//改变机构 table 的check状态
selectionChangeDepartment(val) {
this.multipleSelectionDepartment = val;
console.log(this.multipleSelectionDepartment);
}, },
//改变 table的check状态 //改变人员 table的check状态
handleSelectionChange(val) { selectionChangePerson(val) {
this.multipleSelection = val; this.multipleSelectionPerson = val;
//console.log(this.multipleSelection); //console.log(this.multipleSelectionPerson);
}, },
//设定机构table全选 //设定机构table全选
checkAll(flag, name) { checkAll(flag, name) {
console.log(flag + " " + name); //console.log(flag + " " + name);
if (name == "multipleOrganization") {
this.changedOrganization = {};
} else if (name == "multiplePerson") {
this.changedPerson = {};
}
if (flag === true) { if (flag === true) {
this.$refs[name].toggleAllSelection(); if (this.checkTableState[name] === false) {
this.$refs[name].toggleAllSelection();
this.checkTableState[name] = true;
}
} else { } else {
//this.$refs[name].clearSelection(); this.$refs[name].clearSelection();
this.checkTableState[name] = false;
} }
}, },
//获取用户类型 //获取用户类型
getKind(type) { getKind(type) {
let kind = 0; let kind = 0;
if(type == 'organization') { if (type == "administrative") {
if(this.organizationChange) { if (this.updatedTree) {
kind = 3; kind = 3;
} else {
kind = 0;
} }
} else if(type == '') { } else if (type == "organization") {
if (this.checkTableState.multipleOrganization == true) {
//机构全选
kind = 1;
for(let key in this.changedOrganization) {
}
} else {
}
} }
return kind; return kind;
}, },
//设定的行政范围内容
getScope(type) {
let scope = "";
if (type == "administrative") {
for (let i = 0; i < this.tagsRegion.length; i++) {
scope += this.tagsRegion[i].key;
if (i < this.tagsRegion.length - 1) {
scope += "|";
}
}
}
return scope;
},
//查询机构列表 //查询机构列表
getOrganization() { getOrganization() {
let req = { let req = {
projectId: this.projectId, projectId: this.projectId,
setKind: this.getKind('organization'), setKind: this.getKind("administrative"),
// scope: "000_110", // scope: "000_110",
pageNum: this.formOrganization.pageNum, pageNum: this.formOrganization.pageNum,
pageSize: this.formOrganization.pageSize pageSize: this.formOrganization.pageSize
}; };
if(req.setKind == 3) { if (req.setKind == 3) {
req.scope = '000_110'; req.scope = this.getScope("administrative");
console.log('tagsRegion',this.tagsRegion);
} }
openLoading(vm);
vm.GET("scope/v1/organization", req).then(res => { vm.GET("scope/v1/organization", req).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
console.log(res.data); closeLoading(vm);
//console.log(res.data);
this.tableOrganization = res.data.organizationList; this.tableOrganization = res.data.organizationList;
this.$refs.multipleOrganization.toggleAllSelection(); this.totalOrganization = res.data.total;
console.log("changedOrganization", this.changedOrganization);
//console.log('机构状态:'+this.checkTableState.multipleOrganization);
if (this.checkTableState.multipleOrganization == true) {
//全选
if (
this.updatedOrganization == true &&
this.changedOrganization[this.formOrganization.pageNum] !=
undefined
) {
//机构table 勾选被更新过
let rowCheck = this.changedOrganization[
this.formOrganization.pageNum
][0];
//console.log("rowCheck:",rowCheck);
rowCheck.forEach(row => {
// console.log("row", row);
let rowItem = {};
for (let i = 0; i < this.tableOrganization.length; i++) {
if (this.tableOrganization[i].id == row.id) {
rowItem = this.tableOrganization[i];
}
}
this.$nextTick(function() {
this.$refs.multipleOrganization.toggleRowSelection(rowItem);
});
});
} else {
this.$refs.multipleOrganization.toggleAllSelection();
}
} else {
//全不选
if (
this.updatedOrganization == true &&
this.changedOrganization[this.formOrganization.pageNum] !=
undefined
) {
let rowCheck = this.changedOrganization[
this.formOrganization.pageNum
][0];
//console.log("rowCheck:",rowCheck);
rowCheck.forEach(row => {
// console.log("row", row);
let rowItem = {};
for (let i = 0; i < this.tableOrganization.length; i++) {
if (this.tableOrganization[i].id == row.id) {
rowItem = this.tableOrganization[i];
}
}
this.$nextTick(function() {
this.$refs.multipleOrganization.toggleRowSelection(rowItem);
});
});
}
}
} }
}); });
}, },
...@@ -1280,16 +1424,19 @@ export default { ...@@ -1280,16 +1424,19 @@ export default {
//查询人员列表 //查询人员列表
getPeople() { getPeople() {
let req = { let req = {
projectId: 1, projectId: this.projectId,
setKindOfAdministrative: 3, setKindOfAdministrative: this.getKind("administrative"),
scopeOfAdministrative: "000_110", //scopeOfAdministrative: "000_110",
setKindOfOrganization: 3, setKindOfOrganization: this.getKind("organization"),
scopeOfOrganization: "2|3|4|5|6|7", scopeOfOrganization: "2|3|4|5|6|7",
setKindOfDepartment: 3, setKindOfDepartment: 3,
scopeOfDepartment: 54, scopeOfDepartment: 54,
pageNum: this.formPersonnel.pageNum, pageNum: this.formPersonnel.pageNum,
pageSize: this.formPersonnel.pageSize pageSize: this.formPersonnel.pageSize
}; };
if (req.setKindOfAdministrative == 3) {
req.scopeOfAdministrative = this.getScope("administrative");
}
vm.GET("scope/v1/people", req).then(res => { vm.GET("scope/v1/people", req).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
console.log(res.code); console.log(res.code);
...@@ -1305,7 +1452,7 @@ export default { ...@@ -1305,7 +1452,7 @@ export default {
this.formOrganization.pageSize = val; this.formOrganization.pageSize = val;
}, },
handleCurrentOrganization(val) { handleCurrentOrganization(val) {
console.log(`当前页: ${val}`); //console.log(`当前页: ${val}`);
this.formOrganization.pageNum = val; this.formOrganization.pageNum = val;
this.getOrganization(); this.getOrganization();
}, },
...@@ -1447,6 +1594,12 @@ export default { ...@@ -1447,6 +1594,12 @@ export default {
.el-tree-node__expand-icon { .el-tree-node__expand-icon {
display: none; display: none;
} }
.el-table__header-wrapper {
.el-checkbox__inner {
//display: none;
//visibility: hidden;
}
}
.department { .department {
margin-top: 20px; margin-top: 20px;
border: 1px solid #dddddd; border: 1px solid #dddddd;
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
:data="tableData" :data="tableData"
:header-cell-style="{background:'#FAFAFA',color:'#000'}" :header-cell-style="{background:'#FAFAFA',color:'#000'}"
> >
<el-table-column prop="createdId" label="ID编号" min-width="100" align="center"></el-table-column> <el-table-column prop="id" label="ID编号" min-width="100" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" min-width="100" align="center"></el-table-column> <el-table-column prop="projectName" label="项目名称" min-width="100" align="center"></el-table-column>
<el-table-column prop="createdName" label="创建人" align="center"></el-table-column> <el-table-column prop="createdName" label="创建人" align="center"></el-table-column>
<el-table-column prop="projectIntro" label="项目简介" align="center"></el-table-column> <el-table-column prop="projectIntro" label="项目简介" align="center"></el-table-column>
......
...@@ -232,7 +232,8 @@ export default { ...@@ -232,7 +232,8 @@ export default {
portalProjectId: this.formInline.portalProjectId, portalProjectId: this.formInline.portalProjectId,
updateL: this.scopeRow.updateL, updateL: this.scopeRow.updateL,
userId: this.scopeRow.userId, userId: this.scopeRow.userId,
numL2: this.numL2 numL2: this.numL2,
nowL: this.scopeRow.projeceRole
}; };
vm.GET("portalProjectOrRole/roleLevelUpdate", req).then(res => { vm.GET("portalProjectOrRole/roleLevelUpdate", req).then(res => {
this.dialog.show = false; this.dialog.show = false;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
:data="tableData" :data="tableData"
:header-cell-style="{background:'#FAFAFA',color:'#000'}" :header-cell-style="{background:'#FAFAFA',color:'#000'}"
> >
<el-table-column prop="createdId" label="ID编号" min-width="100" align="center"></el-table-column> <el-table-column prop="id" label="ID编号" min-width="100" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" min-width="100" align="center"></el-table-column> <el-table-column prop="projectName" label="项目名称" min-width="100" align="center"></el-table-column>
<el-table-column prop="createdName" label="创建人" align="center"></el-table-column> <el-table-column prop="createdName" label="创建人" align="center"></el-table-column>
<el-table-column prop="projectIntro" label="项目简介" align="center"></el-table-column> <el-table-column prop="projectIntro" label="项目简介" align="center"></el-table-column>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册