提交 569ca78a 编写于 作者: zhentian.jia's avatar zhentian.jia

流程全部走通

上级 69f0c762
...@@ -83,7 +83,15 @@ export function inOrganization(list,id) { ...@@ -83,7 +83,15 @@ export function inOrganization(list,id) {
} }
return flag; return flag;
} }
export function initTags(value) {
let tags = [];
for (let j = 0; j < value.length; j++) {
let tagsComponent = {};
tagsComponent.value = value.value;
tagsComponent[j].name = this.optionsComponent[j].label;
}
return tags;
}
//机构列表 //机构列表
export function getOrganizationList(data) { export function getOrganizationList(data) {
let list = []; let list = [];
...@@ -114,7 +122,7 @@ export function getHospitalList(data) { ...@@ -114,7 +122,7 @@ export function getHospitalList(data) {
} }
list.push(obj); list.push(obj);
} }
console.log(list); //console.log(list);
return list; return list;
} }
......
...@@ -299,7 +299,7 @@ ...@@ -299,7 +299,7 @@
<el-table-column <el-table-column
type="selection" type="selection"
width="55" width="55"
:selectable="selectableOrganization" :selectable="selectableTableList"
:reserve-selection="true" :reserve-selection="true"
></el-table-column> ></el-table-column>
<el-table-column prop="name" label="医院名称" min-width="100" align="center"></el-table-column> <el-table-column prop="name" label="医院名称" min-width="100" align="center"></el-table-column>
...@@ -338,7 +338,11 @@ ...@@ -338,7 +338,11 @@
style="width: 100%" style="width: 100%"
@selection-change="selectionChangeDepartment" @selection-change="selectionChangeDepartment"
> >
<el-table-column type="selection" width="55"></el-table-column> <el-table-column
type="selection"
width="55"
:selectable="selectableTableList"
></el-table-column>
<el-table-column prop="name" label="科室名称" align="center"></el-table-column> <el-table-column prop="name" label="科室名称" align="center"></el-table-column>
<div slot="empty"> <div slot="empty">
<div class="table-empty"> <div class="table-empty">
...@@ -401,7 +405,12 @@ ...@@ -401,7 +405,12 @@
@selection-change="selectionChangePerson" @selection-change="selectionChangePerson"
:row-key="getRowKeysPerson" :row-key="getRowKeysPerson"
> >
<el-table-column type="selection" width="55" :reserve-selection="true"></el-table-column> <el-table-column
type="selection"
width="55"
:reserve-selection="true"
:selectable="selectableTableList"
></el-table-column>
<el-table-column prop="name" label="人员名称" align="center"></el-table-column> <el-table-column prop="name" label="人员名称" align="center"></el-table-column>
<el-table-column prop="hospitalName" label="所属医院" align="center"></el-table-column> <el-table-column prop="hospitalName" label="所属医院" align="center"></el-table-column>
<el-table-column prop="departmentName" label="所属科室" align="center"></el-table-column> <el-table-column prop="departmentName" label="所属科室" align="center"></el-table-column>
...@@ -631,7 +640,7 @@ export default { ...@@ -631,7 +640,7 @@ export default {
}, },
formPerson: { formPerson: {
hospitalId: 0, hospitalId: 0,
departmentId: 0, departmentId: -1,
name: "", name: "",
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
...@@ -644,7 +653,9 @@ export default { ...@@ -644,7 +653,9 @@ export default {
pageSizePerson: 2, pageSizePerson: 2,
totalPerson: 10, totalPerson: 10,
updatedPerson: false, updatedPerson: false,
lookedPerson: [],
changedPerson: [], changedPerson: [],
changedPerson2: [],
//记录上次 //记录上次
scopeOfOrganizationLast: [], scopeOfOrganizationLast: [],
scopeOfPeopleLast: [], scopeOfPeopleLast: [],
...@@ -732,9 +743,10 @@ export default { ...@@ -732,9 +743,10 @@ export default {
vm = this; vm = this;
(this.projectId = vm.getUrlSearch(window.location.href, "projectId")), (this.projectId = vm.getUrlSearch(window.location.href, "projectId")),
(this.peopleLevel = vm.getUrlSearch(window.location.href, "level")); (this.peopleLevel = vm.getUrlSearch(window.location.href, "level"));
this.editManager();
this.changeOnStep(this.active); this.changeOnStep(this.active);
this.getComponentInfo(); this.getComponentInfo();
this.editManager();
this.idTypeValue = vm.idType; this.idTypeValue = vm.idType;
//console.log('this.idType:'+vm.idType); //console.log('this.idType:'+vm.idType);
if (vm.idType == 2) { if (vm.idType == 2) {
...@@ -743,6 +755,7 @@ export default { ...@@ -743,6 +755,7 @@ export default {
this.$nextTick(function() { this.$nextTick(function() {
//this.getDepartment(); //this.getDepartment();
//this.idTypeValue = 2; //this.idTypeValue = 2;
//this.editManager();
}); });
}, },
// 挂载到Dom完成时 // 挂载到Dom完成时
...@@ -816,7 +829,7 @@ export default { ...@@ -816,7 +829,7 @@ export default {
componentEdit.push(editData.componentData[i].relevanceId); componentEdit.push(editData.componentData[i].relevanceId);
} }
this.formComponent.component = componentEdit; this.formComponent.component = componentEdit;
this.changeValue(componentEdit); this.initTags(componentEdit);
if (editData.certificateData.length > 0) { if (editData.certificateData.length > 0) {
this.formComponent.configure = 1; this.formComponent.configure = 1;
this.formComponent.certificate = this.formComponent.certificate =
...@@ -1144,6 +1157,7 @@ export default { ...@@ -1144,6 +1157,7 @@ export default {
} }
} }
} else if (this.active == 1) { } else if (this.active == 1) {
//进入第三步
if (this.idType == 1) { if (this.idType == 1) {
//内部管理员 //内部管理员
if (this.tagsRegion.length > 0 || this.idTypeProject == 2) { if (this.tagsRegion.length > 0 || this.idTypeProject == 2) {
...@@ -1176,6 +1190,7 @@ export default { ...@@ -1176,6 +1190,7 @@ export default {
if (req.setKindOfPeople == 2 || req.setKindOfPeople == 3) { if (req.setKindOfPeople == 2 || req.setKindOfPeople == 3) {
req.scopeOfPeople = this.getScopePeople(req.setKindOfPeople); req.scopeOfPeople = this.getScopePeople(req.setKindOfPeople);
} }
openLoading(vm); openLoading(vm);
vm.POST("portal/scope", req).then(res => { vm.POST("portal/scope", req).then(res => {
closeLoading(vm); closeLoading(vm);
...@@ -1442,6 +1457,7 @@ export default { ...@@ -1442,6 +1457,7 @@ export default {
//设定人员 //设定人员
this.getHospital(); this.getHospital();
this.departmentList = this.getDepartmentList(); this.departmentList = this.getDepartmentList();
//console.log('departmentList',this.departmentList);
this.getPeople(); this.getPeople();
} }
}, },
...@@ -1664,7 +1680,7 @@ export default { ...@@ -1664,7 +1680,7 @@ export default {
} }
}); });
}, },
selectableOrganization(row, index) { selectableTableList(row, index) {
if (this.projectStatus == 4) { if (this.projectStatus == 4) {
if (row.status == 1) { if (row.status == 1) {
//console.log("scopeReq",this.scopeReq); //console.log("scopeReq",this.scopeReq);
...@@ -1704,6 +1720,7 @@ export default { ...@@ -1704,6 +1720,7 @@ export default {
//改变人员 table的check状态 //改变人员 table的check状态
selectionChangePerson(rows) { selectionChangePerson(rows) {
this.changedPerson = []; this.changedPerson = [];
this.changedPerson2 = [];
if (rows) { if (rows) {
rows.forEach(row => { rows.forEach(row => {
if (row) { if (row) {
...@@ -1711,11 +1728,19 @@ export default { ...@@ -1711,11 +1728,19 @@ export default {
} }
}); });
} }
console.log(this.changedPerson); this.changedPerson2 = operationData.getDifference(
this.lookedPerson,
this.changedPerson
);
console.log(
"选",
this.changedPerson,
"没",
this.changedPerson2
);
}, },
//设定机构table全选 //设定机构table全选
checkAll(flag, name) { checkAll(flag, name) {
//console.log(flag + " " + name);
if (name == "multipleOrganization") { if (name == "multipleOrganization") {
//机构全选 //机构全选
let checkItem = this.checkTableState[name]; let checkItem = this.checkTableState[name];
...@@ -1751,32 +1776,54 @@ export default { ...@@ -1751,32 +1776,54 @@ export default {
} else if (name == "multiplePerson") { } else if (name == "multiplePerson") {
//人员全选 //人员全选
if (flag === true) { if (flag === true) {
let checkItem = this.checkTableState[name]; let idList = operationData.getIdList(this.tablePerson);
if (checkItem !== true) { //console.log('idList',idList,'changedPerson',this.changedPerson);
let difference = operationData.getDifference(
idList,
this.changedPerson
);
//console.log('difference',difference);
if (difference.length > 0) {
this.$refs[name].toggleAllSelection(); this.$refs[name].toggleAllSelection();
this.checkTableState[name] = true;
} }
this.checkTableState[name] = true;
this.changedPerson2 = [];
this.changedPerson = operationData.getDifference(
this.lookedPerson,
this.changedPerson2
);
} else { } else {
this.$refs[name].clearSelection(); this.$refs[name].clearSelection();
this.checkTableState[name] = false; this.checkTableState[name] = false;
this.changedPerson = [];
this.changedPerson2 = operationData.getDifference(
this.lookedPerson,
this.changedPerson
);
} }
//置空
this.changedPerson = [];
} }
}, },
//获取用户类型 //获取用户类型
getKind(type) { getKind(type) {
let kind = 0; let kind = 3;
if (type == "administrative") { if (type == "administrative") {
kind = 3; kind = 3;
if (this.updatedTree == true) { if (this.updatedTree == true) {
kind = 3; kind = 3;
} }
if(this.idType === 2) {
return 0;
}
} else if (type == "administrativeScope") { } else if (type == "administrativeScope") {
kind = 3; kind = 3;
if (this.tagsRegion.length > 0) { if (this.tagsRegion.length > 0) {
kind = 3; kind = 3;
} }
if(this.idType === 2) {
return 0;
}
} else if (type == "organization") { } else if (type == "organization") {
//设置机构类别0:无 1:全选 2:去掉 3:选中 //设置机构类别0:无 1:全选 2:去掉 3:选中
if (this.checkTableState.multipleOrganization === false) { if (this.checkTableState.multipleOrganization === false) {
...@@ -1920,6 +1967,7 @@ export default { ...@@ -1920,6 +1967,7 @@ export default {
//console.log(res.data); //console.log(res.data);
this.tableOrganization = res.data.organizationList; this.tableOrganization = res.data.organizationList;
this.totalOrganization = res.data.total; this.totalOrganization = res.data.total;
//console.log("changedOrganization", this.changedOrganization); //console.log("changedOrganization", this.changedOrganization);
let idList = operationData.getIdList(this.tableOrganization); let idList = operationData.getIdList(this.tableOrganization);
let intersect = operationData.getIntersect( let intersect = operationData.getIntersect(
...@@ -1982,7 +2030,6 @@ export default { ...@@ -1982,7 +2030,6 @@ export default {
//console.log('differenceScope',differenceScope); //console.log('differenceScope',differenceScope);
let unionScope = operationData.getUnion(this.changedOrganization2,differenceScope); let unionScope = operationData.getUnion(this.changedOrganization2,differenceScope);
//console.log('unionScope',unionScope); //console.log('unionScope',unionScope);
// debugger;
for (let i = 0; i < unionScope.length; i++) { for (let i = 0; i < unionScope.length; i++) {
scope += unionScope[i] + "|"; scope += unionScope[i] + "|";
} }
...@@ -2002,14 +2049,22 @@ export default { ...@@ -2002,14 +2049,22 @@ export default {
let scope = ""; let scope = "";
//2:去掉 3:选中 //2:去掉 3:选中
if (type == 2) { if (type == 2) {
for (let i = 0; i < this.changedPerson2.length; i++) { let differenceScope = operationData.getDifference(this.scopeOfPeopleLast,this.changedPerson);
scope += this.changedPerson2[i] + "|"; //console.log('differenceScope',differenceScope);
let unionScope = operationData.getUnion(this.changedPerson2,differenceScope);
for (let i = 0; i < unionScope.length; i++) {
scope += unionScope[i] + "|";
} }
} else if (type == 3) { } else if (type == 3) {
for (let i = 0; i < this.changedPerson.length; i++) { //console.log(this.changedPerson2,this.scopeOfPeople);
scope += this.changedPerson[i] + "|"; let differenceScope = operationData.getDifference(this.scopeOfPeopleLast,this.changedPerson2);
let unionScope = operationData.getUnion(this.changedPerson,differenceScope);
// debugger;
for (let i = 0; i < unionScope.length; i++) {
scope += unionScope[i] + "|";
} }
} }
scope = scope.substring(0, scope.length - 1); scope = scope.substring(0, scope.length - 1);
console.log("scope people", scope); console.log("scope people", scope);
return scope; return scope;
...@@ -2064,8 +2119,8 @@ export default { ...@@ -2064,8 +2119,8 @@ export default {
searchPeople() { searchPeople() {
let searchForm = this.formPerson; let searchForm = this.formPerson;
if ( if (
searchForm.hospitalId == "0" && searchForm.hospitalId === 0 &&
searchForm.departmentId == "0" && searchForm.departmentId === -1 &&
searchForm.name == "" searchForm.name == ""
) { ) {
this.getPeople(); this.getPeople();
...@@ -2106,7 +2161,7 @@ export default { ...@@ -2106,7 +2161,7 @@ export default {
closeLoading(vm); closeLoading(vm);
console.log(res); console.log(res);
if (res.code == "000000") { if (res.code == "000000") {
this.tablePerson = res.data.organizationList; this.tablePerson = res.data.people;
this.totalPerson = res.data.total; this.totalPerson = res.data.total;
} }
}); });
...@@ -2148,8 +2203,28 @@ export default { ...@@ -2148,8 +2203,28 @@ export default {
idList, idList,
this.changedPerson this.changedPerson
); );
if (intersect.length == 0) { this.lookedPerson = operationData.getUnion(
this.initPeopleStatus(); this.lookedPerson,
idList
);
this.changedPerson2 = operationData.getDifference(
this.lookedPerson,
this.changedPerson
);
//console.log('全部看过的:',this.lookedPerson);
if (vm.checkTableState.multiplePerson === "") {
if (intersect.length == 0) {
this.initPeopleStatus();
}
} else if (vm.checkTableState.multiplePerson === true) {
let intersect2 = operationData.getIntersect(
idList,
this.changedPerson
);
// console.log('intersect2',intersect2);
if (intersect2.length == 0) {
this.$refs.multiplePerson.toggleAllSelection();
}
} }
} }
}); });
...@@ -2158,13 +2233,13 @@ export default { ...@@ -2158,13 +2233,13 @@ export default {
getDepartmentList() { getDepartmentList() {
let list = []; let list = [];
list[0] = { list[0] = {
value: 0, value: -1,
label: '全部', label: '全部',
}; };
for (let i = 0; i < this.tableDepartment.length; i++) { for (let i = 0; i < this.tableDepartment.length; i++) {
if (this.tableDepartment[i].status == 1) { if (this.tableDepartment[i].status == 1) {
let obj = { let obj = {
id: this.tableDepartment[i].id, value: this.tableDepartment[i].id,
label: this.tableDepartment[i].name label: this.tableDepartment[i].name
}; };
list.push(obj); list.push(obj);
...@@ -2222,9 +2297,26 @@ export default { ...@@ -2222,9 +2297,26 @@ export default {
} }
//console.log('this.tagsComponent',this.tagsComponent); //console.log('this.tagsComponent',this.tagsComponent);
}, },
initTags(value) {
console.log('value',value,'optionsComponent',this.optionsComponent);
//debugger;
this.tagsComponent = [];
let len = 0;
for (let i = 0; i < value.length; i++) {
for (let j = 0; j < this.optionsComponent.length; j++) {
if (value[i] == this.optionsComponent[j].value) {
this.tagsComponent[len] = {};
this.tagsComponent[len].value = this.optionsComponent[j].value;
this.tagsComponent[len].name = this.optionsComponent[j].label;
len++;
}
}
}
//console.log('this.tagsComponent',this.tagsComponent);
},
//选择组件数据绑定 //选择组件数据绑定
handleCloseComponent(tag) { handleCloseComponent(tag) {
if (this.projectStatus != 4) { if (this.projectStatus == 1 || this.projectStatus == 2) {
this.tagsComponent.splice(this.tagsComponent.indexOf(tag), 1); this.tagsComponent.splice(this.tagsComponent.indexOf(tag), 1);
this.formComponent.component = []; this.formComponent.component = [];
for (let j = 0; j < this.tagsComponent.length; j++) { for (let j = 0; j < this.tagsComponent.length; j++) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册