提交 5d34dd3a 编写于 作者: zhentian.jia's avatar zhentian.jia

编辑项目完成

上级 fdf66e66
......@@ -8,7 +8,6 @@ const createComponent = r => require.ensure([], () => r(require('../views/educat
const roleManager = r => require.ensure([], () => r(require('../views/system/role.vue')),'role')
const addManager = r => require.ensure([], () => r(require('../views/education/add-manager.vue')), 'add-manager')
const itemRole = r => require.ensure([], () => r(require('../views/system/item-role.vue')), 'item-role')
const tree = r => require.ensure([], () => r(require('../views/education/tree.vue')), 'tree')
export default [{
path: '/',
......@@ -44,9 +43,6 @@ export default [{
},{
path: '/item-role',
component: itemRole
},{
path: '/tree',
component: tree
},
]
}]
\ No newline at end of file
......@@ -255,9 +255,9 @@
</el-col>
</el-tab-pane>
<el-tab-pane label="设定人员" name="fourth">
<el-form :inline="true" :model="formPersonnel" class="demo-form-inline">
<el-form :inline="true" :model="formPerson" class="demo-form-inline">
<el-form-item label>
<el-select size="mini" v-model="formPersonnel.hospital" placeholder="全部医院">
<el-select size="mini" v-model="formPerson.hospital" placeholder="全部医院">
<el-option
v-for="(item, index) in organizationRank"
:key="index"
......@@ -267,7 +267,7 @@
</el-select>
</el-form-item>
<el-form-item>
<el-select size="mini" v-model="formPersonnel.department" placeholder="全部部门">
<el-select size="mini" v-model="formPerson.department" placeholder="全部部门">
<el-option
v-for="(item, index) in organizationRank"
:key="index"
......@@ -315,9 +315,9 @@
background
@size-change="handleSizePerson"
@current-change="handleCurrentPerson"
:current-page="formPersonnel.pageNum"
:current-page="formPerson.pageNum"
:page-sizes="[10, 20, 40]"
:page-size="formPersonnel.pageSize"
:page-size="formPerson.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalPerson"
></el-pagination>
......@@ -427,7 +427,7 @@ export default {
curmbSecond: "新建项目",
//页面展示位置
stepData: [true, false, false],
active: 1,
active: 0,
activeName: "first",
//基层信息 数据
imageUrl: "",
......@@ -444,6 +444,7 @@ export default {
},
fileList: [],
//设定行政范围 数据
allSelectedKeys: [],
updatedTree: false,
defaultProps: {
children: "children",
......@@ -495,6 +496,7 @@ export default {
pageSizeOrganization: 2,
changedOrganization: {},
//设定科室 数据
firstDepartment: true,
formDepartment: {
grade: ""
},
......@@ -503,7 +505,7 @@ export default {
updatedDepartment: false,
changedDepartment: {},
//设定人员 数据
formPersonnel: {
formPerson: {
hospital: "",
department: "",
pageNum: 1,
......@@ -514,7 +516,7 @@ export default {
currentPerson: 1,
pageSizePerson: 2,
totalPerson: 10,
updatedPersonn: false,
updatedPerson: false,
changedPerson: {},
//选择项目组件 数据
optionsComponent: [],
......@@ -867,16 +869,30 @@ export default {
}
} else if (this.active == 1) {
let req = {
projectId: 54,
setKindOfAdministrative: 3,
scopeOfAdministrative: "000:2|000_110:1",
setKindOfOrganization: 3,
scopeOfOrganization: "2|3|4|5|6|7",
setKindOfDepartment: 3,
scopeOfDepartment: "54",
setKindOfPeople: 1,
scopeOfPeople: ""
projectId: this.projectId,
setKindOfAdministrative: this.getKind("administrative"),
//scopeOfAdministrative: "000:2|000_110:1",
setKindOfOrganization: this.getKind("organization"),
//scopeOfOrganization: "2|3|4|5|6|7",
setKindOfDepartment: this.getKind("department"),
//scopeOfDepartment: "54",
setKindOfPeople: this.getKind("person")
//scopeOfPeople: ""
};
if (req.setKindOfAdministrative == 3) {
req.scopeOfAdministrative = this.getScope("administrativeUpdate");
}
if (req.setKindOfOrganization == 2 || req.setKindOfOrganization == 3) {
req.scopeOfOrganization = this.getScopeOrganization(
req.setKindOfOrganization
);
}
if (req.setKindOfDepartment == 3) {
req.scopeOfDepartment = this.getScopeDepartment();
}
if (req.setKindOfPeople == 2 || req.setKindOfPeople == 3) {
req.scopeOfPeople = this.getScopePeople(req.setKindOfPeople);
}
vm.POST("scope", req).then(res => {
if (res.code == "000000") {
//移动到选择项目组件
......@@ -1034,8 +1050,11 @@ export default {
//设定机构
this.getOrganization();
} else if (tabName == "third") {
this.$refs.multipleDepartment.toggleAllSelection();
//设定科室
if (this.checkTableState.multipleDepartment && this.firstDepartment) {
this.$refs.multipleDepartment.toggleAllSelection();
this.firstDepartment = false;
}
} else if (tabName == "fourth") {
//设定人员
this.getPeople();
......@@ -1084,7 +1103,7 @@ export default {
for (let i = 0; i < nodeData.length; i++) {
for (let j = 0; j < allSelectedKeys.length; j++) {
if (
allSelectedKeys[j].type == 2 &&
allSelectedKeys[j].type == 1 &&
nodeData[i].id == allSelectedKeys[j].key
) {
let tagObj = {};
......@@ -1163,15 +1182,17 @@ export default {
halfCheckedKeys = this.$refs.tree.getHalfCheckedKeys(),
savedCheckedKeys = this.handlerCheckedData(oldData, checkedKeys).map(
key => {
return { type: 2, key: key };
return { type: 1, key: key };
}
),
savedHalfCheckedKeys = halfCheckedKeys.map(key => {
return { type: 1, key: key };
return { type: 2, key: key };
}),
allSelectedKeys = savedCheckedKeys.concat(savedHalfCheckedKeys);
this.allSelectedKeys = allSelectedKeys;
this.initCheckList(allSelectedKeys);
console.log("allSelectedKeys", allSelectedKeys);
//改变行政范围后,更新设定机构和设定人员
this.updateOrganizationAndPerson(allSelectedKeys);
this.updatedTree = true;
......@@ -1276,12 +1297,32 @@ export default {
//改变机构 table 的check状态
selectionChangeDepartment(val) {
this.multipleSelectionDepartment = val;
console.log(this.multipleSelectionDepartment);
//console.log(this.multipleSelectionDepartment);
},
//改变人员 table的check状态
selectionChangePerson(val) {
this.multipleSelectionPerson = val;
//console.log(this.multipleSelectionPerson);
if (
val.length != 0 &&
val.length != this.formPerson.pageSize &&
this.updatedPerson == false
) {
this.updatedPerson = true;
console.log("人员被更新", this.updatedPerson);
}
if (this.updatedPerson == true) {
this.changedPerson[this.formPerson.pageNum] = [];
this.changedPerson[
this.formPerson.pageNum
][0] = this.multipleSelectionPerson;
let reverse = this.getDifference(
this.tablePerson,
this.multipleSelectionPerson
);
this.changedPerson[this.formPerson.pageNum][1] = reverse;
console.log("check人员:", this.changedPerson);
}
},
//设定机构table全选
checkAll(flag, name) {
......@@ -1305,7 +1346,8 @@ export default {
getKind(type) {
let kind = 0;
if (type == "administrative") {
if (this.updatedTree) {
//console.log('this.tagsRegion',this.tagsRegion);
if (this.tagsRegion.length > 0) {
kind = 3;
}
} else if (type == "organization") {
......@@ -1330,6 +1372,24 @@ export default {
if (this.multipleSelectionDepartment.length > 0) {
kind = 3;
}
} else if (type == "person") {
if (this.checkTableState.multiplePerson == true) {
//设置机构类别0:无 1:全选 2:去掉 3:选中
kind = 1;
for (let key in this.changedPerson) {
if (this.changedPerson[key][1].length > 0) {
kind = 2;
}
}
} else {
//全部不选
kind = 0;
for (let key in this.changedPerson) {
if (this.changedPerson[key][0].length > 0) {
kind = 3;
}
}
}
}
return kind;
},
......@@ -1343,7 +1403,17 @@ export default {
scope += "|";
}
}
} else if (type == "administrativeUpdate") {
//console.log("allSelectedKeys", this.allSelectedKeys);
for (let i = 0; i < this.allSelectedKeys.length; i++) {
scope +=
this.allSelectedKeys[i].key + ":" + this.allSelectedKeys[i].type;
if (i < this.allSelectedKeys.length - 1) {
scope += "|";
}
}
}
console.log(scope);
return scope;
},
//查询机构列表
......@@ -1456,6 +1526,29 @@ export default {
console.log("scope", scope);
return scope;
},
//获取人员id列表
getScopePeople(type) {
let scope = "";
if (type == 2) {
for (let key in this.changedPerson) {
let peopleItem = this.changedPerson[key][1];
//console.log("peopleItem:", peopleItem);
for (let i = 0; i < peopleItem.length; i++) {
scope += peopleItem[i].id + "|";
}
}
} else if (type == 3) {
for (let key in this.changedPerson) {
let peopleItem = this.changedPerson[key][0];
for (let i = 0; i < peopleItem.length; i++) {
scope += peopleItem[i].id + "|";
}
}
}
scope = scope.substring(0, scope.length - 1);
console.log("scope people", scope);
return scope;
},
//获取科室列表
getScopeDepartment() {
let scope = "";
......@@ -1475,8 +1568,8 @@ export default {
//scopeOfOrganization: "2|3|4|5|6|7",
setKindOfDepartment: this.getKind("department"),
//scopeOfDepartment: 54,
pageNum: this.formPersonnel.pageNum,
pageSize: this.formPersonnel.pageSize
pageNum: this.formPerson.pageNum,
pageSize: this.formPerson.pageSize
};
if (req.setKindOfAdministrative == 3) {
req.scopeOfAdministrative = this.getScope("administrative");
......@@ -1489,11 +1582,60 @@ export default {
if (req.setKindOfDepartment == 3) {
req.scopeOfDepartment = this.getScopeDepartment();
}
openLoading(vm);
vm.GET("scope/v1/people", req).then(res => {
if (res.code == "000000") {
closeLoading(vm);
console.log(res);
this.tablePerson = res.data.people;
this.totalPerson = res.data.total;
if (this.checkTableState.multiplePerson == true) {
//全选
if (
this.updatedPerson == true &&
this.changedPerson[this.formPerson.pageNum] != undefined
) {
//机构table 勾选被更新过
let rowCheck = this.changedPerson[this.formPerson.pageNum][0];
//console.log("rowCheck:",rowCheck);
rowCheck.forEach(row => {
// console.log("row", row);
let rowItem = {};
for (let i = 0; i < this.tablePerson.length; i++) {
if (this.tablePerson[i].id == row.id) {
rowItem = this.tablePerson[i];
}
}
this.$nextTick(function() {
this.$refs.multiplePerson.toggleRowSelection(rowItem);
});
});
} else {
this.$refs.multiplePerson.toggleAllSelection();
}
} else {
//person 全不选
if (
this.updatedPerson == true &&
this.changedPerson[this.formPerson.pageNum] != undefined
) {
let rowCheck = this.changedPerson[this.formPerson.pageNum][0];
//console.log("rowCheck:",rowCheck);
rowCheck.forEach(row => {
// console.log("row", row);
let rowItem = {};
for (let i = 0; i < this.tablePerson.length; i++) {
if (this.tablePerson[i].id == row.id) {
rowItem = this.tablePerson[i];
}
}
this.$nextTick(function() {
this.$refs.multiplePerson.toggleRowSelection(rowItem);
});
});
}
}
}
});
},
......@@ -1511,11 +1653,11 @@ export default {
//角色table修改
handleSizePerson(val) {
console.log(`每页 ${val} 条`);
this.formPersonnel.pageSize = val;
this.formPerson.pageSize = val;
},
handleCurrentPerson(val) {
console.log(`当前页: ${val}`);
this.formPersonnel.pageNum = val;
this.formPerson.pageNum = val;
this.getPeople();
},
//行政范围改变更新设定机构和设定人员
......
......@@ -57,11 +57,6 @@ export default {
icon: 'el-icon-setting',
index: 'item-manager'
},
{
title: '树',
icon: 'el-icon-setting',
index: 'tree'
}
]
},{
title: '系统管理',
......
......@@ -58,7 +58,6 @@
</el-form>
</el-row>
<el-table
v-loading="loading"
:data="tableData"
:header-cell-style="{background:'#FAFAFA',color:'#000'}"
>
......@@ -133,6 +132,7 @@
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain";
import { openLoading, closeLoading } from "../../utils/utils";
let vm = null;
export default {
components: {
......@@ -203,7 +203,6 @@ export default {
methods: {
//查询用户列表
queryRoleList() {
this.loading = true;
this.formInline.portalProjectId = vm.getUrlSearch(
window.location.href,
"portalProjectId"
......@@ -213,11 +212,12 @@ export default {
}
let req = {};
req = this.formInline;
openLoading(vm);
vm.GET("portalProjectOrRole/queryRoleList", req).then(res => {
if (res.code == "000000") {
closeLoading(vm);
vm.tableData = res.data.projectRoleInfoModels;
vm.totalRows = res.data.total;
this.loading = false;
//this.roleList = setRoleList(res.data.roleList);
this.organizationList = res.data.organizationList;
......
......@@ -29,7 +29,6 @@
</el-form>
</el-row>
<el-table
v-loading="loading"
:data="tableData"
:header-cell-style="{background:'#FAFAFA',color:'#000'}"
>
......@@ -68,6 +67,7 @@
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain";
import { openLoading, closeLoading } from "../../utils/utils";
let vm = null;
export default {
components: {
......@@ -125,11 +125,12 @@ export default {
let req = {};
console.log(this.formInline);
req = this.setParam(this.formInline);
openLoading(vm);
vm.GET("portalInfo/getProjectList", req).then(res => {
if (res.code == "000000") {
closeLoading(vm);
vm.tableData = res.data.data;
vm.totalRows = res.data.totalRows;
this.loading = false;
}
});
},
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册