Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
提交
议题看板
打开侧边栏
jingqi.liu
pica.cloud.web-education-admin
提交
768eeacf
提交
768eeacf
编写于
3月 27, 2019
作者:
zhentian.jia
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug
上级
42c552a8
变更
3
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
204 行增加
和
244 行删除
+204
-244
operation.js
src/utils/operation.js
+96
-7
add-manager.vue
src/views/education/add-manager.vue
+74
-225
item-role.vue
src/views/system/item-role.vue
+34
-12
未找到文件。
src/utils/operation.js
浏览文件 @
768eeacf
//求并集
export
function
getUnion
(
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
,...
set2
]));
}
return
null
;
}
//求差集
export
function
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
;
}
//求交集
export
function
getIntersect
(
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
;
}
//获取id的list
export
function
getIdList
(
data
)
{
let
list
=
[];
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
list
.
push
(
data
[
i
].
id
);
}
return
list
;
}
//区域
export
function
getAdministrative
(
data
)
{
export
function
getAdministrative
(
data
)
{
let
list
=
data
.
split
(
'|'
);
let
list
=
data
.
split
(
'|'
);
//for(let i)
//for(let i)
...
@@ -13,24 +49,66 @@ export function getLevelList(data) {
...
@@ -13,24 +49,66 @@ export function getLevelList(data) {
}
}
level
.
push
(
obj
);
level
.
push
(
obj
);
}
}
console
.
log
(
level
);
//
console.log(level);
return
level
;
return
level
;
}
}
function
recursiveTraverse
(
node
)
{
function
inTags
(
id
,
tags
)
{
let
flag
=
false
;
for
(
let
i
=
0
;
i
<
tags
.
length
;
i
++
)
{
if
(
tags
[
i
].
key
==
id
)
{
flag
=
true
;
}
}
return
flag
;
}
export
function
inOrganization
(
list
,
id
)
{
let
flag
=
false
;
if
(
list
.
length
==
0
)
{
flag
=
true
;
}
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
if
(
list
[
i
].
id
!=
id
)
{
flag
=
true
;
}
}
return
flag
;
}
function
recursiveTraverse
(
node
,
tags
)
{
let
afterTree
=
[];
let
afterTree
=
[];
let
add
=
0
;
node
.
forEach
(
function
(
item
,
index
)
{
node
.
forEach
(
function
(
item
,
index
)
{
let
obj
=
{
let
obj
=
{
value
:
item
.
id
,
value
:
item
.
id
,
label
:
item
.
label
,
label
:
item
.
label
,
}
}
afterTree
.
push
(
obj
);
if
(
inTags
(
item
.
id
,
tags
))
{
afterTree
[
add
]
=
obj
;
add
++
;
}
else
if
(
item
.
children
.
length
>
0
)
{
afterTree
[
add
]
=
obj
;
afterTree
[
add
].
children
=
[];
add
++
;
let
add2
=
0
;
item
.
children
.
forEach
(
function
(
item2
,
index2
)
{
let
obj
=
{
value
:
item2
.
id
,
label
:
item2
.
label
,
}
console
.
log
(
afterTree
[
add
],
add2
)
//afterTree[add].children[add2] = obj;
});
}
});
});
return
afterTree
;
return
afterTree
;
}
}
//拼装选择的tree
//拼装选择的tree
export
function
getTreeData
(
data
)
{
export
function
getTreeData
(
data
,
tags
)
{
console
.
log
(
'allTree'
,
data
,
data
.
length
);
console
.
log
(
'allTree'
,
data
.
children
,
'tags'
,
tags
);
let
afterTree
=
recursiveTraverse
(
data
.
children
);
console
.
log
(
JSON
.
stringify
(
data
.
children
));
console
.
log
(
JSON
.
stringify
(
tags
));
let
afterTree
=
recursiveTraverse
(
data
.
children
,
tags
);
console
.
log
(
'afterTree '
,
afterTree
);
console
.
log
(
'afterTree '
,
afterTree
);
let
options
=
[
let
options
=
[
{
{
...
@@ -230,3 +308,14 @@ export function getTreeData(data) {
...
@@ -230,3 +308,14 @@ export function getTreeData(data) {
}];
}];
return
afterTree
;
return
afterTree
;
}
}
export
function
organizationList
(
data
)
{
let
list
=
[];
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
let
obj
=
{
value
:
data
[
i
].
key
,
label
:
data
[
i
].
name
,
}
list
.
push
(
obj
);
}
return
list
;
}
\ No newline at end of file
src/views/education/add-manager.vue
浏览文件 @
768eeacf
...
@@ -113,7 +113,12 @@
...
@@ -113,7 +113,12 @@
<p
class=
"upload-message"
v-if=
"uploadImgMessage"
>
请选择列表图片
</p>
<p
class=
"upload-message"
v-if=
"uploadImgMessage"
>
请选择列表图片
</p>
</div>
</div>
<el-form-item
label=
"封面类型:"
>
<el-form-item
label=
"封面类型:"
>
<el-radio-group
size=
"mini"
v-model=
"formData.type"
@
change=
"changeCover"
:disabled=
"peopleLevel == 'L3'"
>
<el-radio-group
size=
"mini"
v-model=
"formData.type"
@
change=
"changeCover"
:disabled=
"peopleLevel == 'L3'"
>
<el-radio
:label=
"1"
>
图片
</el-radio>
<el-radio
:label=
"1"
>
图片
</el-radio>
<el-radio
:label=
"2"
>
视频
</el-radio>
<el-radio
:label=
"2"
>
视频
</el-radio>
</el-radio-group>
</el-radio-group>
...
@@ -232,19 +237,20 @@
...
@@ -232,19 +237,20 @@
<el-tab-pane
label=
"设定机构"
name=
"second"
>
<el-tab-pane
label=
"设定机构"
name=
"second"
>
<el-form
:inline=
"true"
:model=
"formOrganization"
class=
"demo-form-inline"
>
<el-form
:inline=
"true"
:model=
"formOrganization"
class=
"demo-form-inline"
>
<el-form-item
label
>
<el-form-item
label
>
<
!--
<
el-select
size=
"mini"
v-model=
"formOrganization.region"
placeholder=
"全部地区"
>
<el-select
size=
"mini"
v-model=
"formOrganization.region"
placeholder=
"全部地区"
>
<el-option
<el-option
v-for=
"(item, index) in organizationRegion"
v-for=
"(item, index) in organizationRegion"
:key=
"index"
:key=
"index"
:label=
"item.label"
:label=
"item.label"
:value=
"item.id"
:value=
"item.id"
></el-option>
></el-option>
</el-select>
-->
</el-select>
<el-cascader
<!--
<el-cascader
size=
"mini"
expand-trigger=
"hover"
expand-trigger=
"hover"
:options=
"organizationRegion"
:options=
"organizationRegion"
v-model=
"formOrganization.region"
v-model=
"formOrganization.region"
></el-cascader>
></el-cascader>
-->
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-select
size=
"mini"
v-model=
"formOrganization.grade"
placeholder=
"全部医院级别"
>
<el-select
size=
"mini"
v-model=
"formOrganization.grade"
placeholder=
"全部医院级别"
>
...
@@ -284,8 +290,9 @@
...
@@ -284,8 +290,9 @@
tooltip-effect=
"dark"
tooltip-effect=
"dark"
style=
"width: 100%"
style=
"width: 100%"
@
selection-change=
"selectionChangeOrganization"
@
selection-change=
"selectionChangeOrganization"
:row-key=
"getRowKeys"
>
>
<el-table-column
type=
"selection"
width=
"55"
></el-table-column>
<el-table-column
type=
"selection"
width=
"55"
:reserve-selection=
"true"
></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>
<el-table-column
prop=
"hospitalLevel"
label=
"医院级别"
align=
"center"
></el-table-column>
<el-table-column
prop=
"hospitalLevel"
label=
"医院级别"
align=
"center"
></el-table-column>
<el-table-column
prop=
"provinceName"
label=
"所属省份"
align=
"center"
></el-table-column>
<el-table-column
prop=
"provinceName"
label=
"所属省份"
align=
"center"
></el-table-column>
...
@@ -380,8 +387,9 @@
...
@@ -380,8 +387,9 @@
tooltip-effect=
"dark"
tooltip-effect=
"dark"
style=
"width: 100%"
style=
"width: 100%"
@
selection-change=
"selectionChangePerson"
@
selection-change=
"selectionChangePerson"
:row-key=
"getRowKeysPerson"
>
>
<el-table-column
type=
"selection"
width=
"55"
></el-table-column>
<el-table-column
type=
"selection"
width=
"55"
:reserve-selection=
"true"
></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>
...
@@ -567,6 +575,9 @@ export default {
...
@@ -567,6 +575,9 @@ export default {
treeData
:
[],
treeData
:
[],
tagsRegion
:
[],
tagsRegion
:
[],
//设定机构 数据
//设定机构 数据
getRowKeys
(
row
)
{
return
row
.
id
;
},
checkTableState
:
{
checkTableState
:
{
multipleOrganization
:
true
,
multipleOrganization
:
true
,
multipleDepartment
:
true
,
multipleDepartment
:
true
,
...
@@ -589,7 +600,7 @@ export default {
...
@@ -589,7 +600,7 @@ export default {
currentOrganization
:
1
,
currentOrganization
:
1
,
totalOrganization
:
10
,
totalOrganization
:
10
,
pageSizeOrganization
:
2
,
pageSizeOrganization
:
2
,
changedOrganization
:
{}
,
changedOrganization
:
[]
,
//设定科室 数据
//设定科室 数据
firstDepartment
:
true
,
firstDepartment
:
true
,
formDepartment
:
{
formDepartment
:
{
...
@@ -600,6 +611,9 @@ export default {
...
@@ -600,6 +611,9 @@ export default {
updatedDepartment
:
false
,
updatedDepartment
:
false
,
changedDepartment
:
{},
changedDepartment
:
{},
//设定人员 数据
//设定人员 数据
getRowKeysPerson
(
row
)
{
return
row
.
id
;
},
formPerson
:
{
formPerson
:
{
hospital
:
""
,
hospital
:
""
,
department
:
""
,
department
:
""
,
...
@@ -614,7 +628,7 @@ export default {
...
@@ -614,7 +628,7 @@ export default {
pageSizePerson
:
2
,
pageSizePerson
:
2
,
totalPerson
:
10
,
totalPerson
:
10
,
updatedPerson
:
false
,
updatedPerson
:
false
,
changedPerson
:
{}
,
changedPerson
:
[]
,
//选择项目组件 数据
//选择项目组件 数据
optionsComponent
:
[],
optionsComponent
:
[],
optionsCertificate
:
[],
optionsCertificate
:
[],
...
@@ -961,6 +975,7 @@ export default {
...
@@ -961,6 +975,7 @@ export default {
}
else
if
(
active
==
1
)
{
}
else
if
(
active
==
1
)
{
this
.
stepData
=
[
false
,
true
,
false
];
this
.
stepData
=
[
false
,
true
,
false
];
this
.
initRange
();
this
.
initRange
();
this
.
getDepartment
();
}
else
if
(
active
==
2
)
{
}
else
if
(
active
==
2
)
{
this
.
stepData
=
[
false
,
false
,
true
];
this
.
stepData
=
[
false
,
false
,
true
];
}
}
...
@@ -993,10 +1008,11 @@ export default {
...
@@ -993,10 +1008,11 @@ export default {
};
};
vm
.
GET
(
"portal/portalInfo/checkProjectName"
,
param
).
then
(
res
=>
{
vm
.
GET
(
"portal/portalInfo/checkProjectName"
,
param
).
then
(
res
=>
{
//console.log(res);
//console.log(res);
this
.
$message
.
info
(
res
.
message
);
if
(
res
.
code
==
"000000"
)
{
if
(
res
.
code
==
"000000"
)
{
//移动到第二页 选择范围
//移动到第二页 选择范围
this
.
insertOrUpdate
(
"storage"
);
this
.
insertOrUpdate
(
"storage"
);
}
else
{
this
.
$message
.
info
(
res
.
message
);
}
}
});
});
}
else
{
}
else
{
...
@@ -1400,16 +1416,18 @@ export default {
...
@@ -1400,16 +1416,18 @@ export default {
}
else
if
(
tabName
==
"fourth"
)
{
}
else
if
(
tabName
==
"fourth"
)
{
//设定人员
//设定人员
this
.
departmentList
=
this
.
getDepartmentList
();
this
.
departmentList
=
this
.
getDepartmentList
();
console
.
log
(
this
.
tableDepartment
);
//
console.log(this.tableDepartment);
console
.
log
(
this
.
departmentList
);
//
console.log(this.departmentList);
this
.
getPeople
();
this
.
getPeople
();
}
}
},
},
//获取勾选树
//获取勾选树
getCheckedTree
()
{
getCheckedTree
()
{
let
allTree
=
Object
.
assign
({},
this
.
treeData
[
0
].
children
);
let
allTree
=
Object
.
assign
({},
this
.
treeData
[
0
].
children
);
//this.organizationRegion = operationData.getTreeData(this.treeData[0]);
//this.organizationRegion =
//console.log('allTree',this.treeData[0]);
//operationData.getTreeData(this.treeData[0],this.tagsRegion);
//改
this
.
organizationRegion
=
operationData
.
organizationList
(
this
.
tagsRegion
);
},
},
//初始化范围树
//初始化范围树
setTreeData
(
administrative
)
{
setTreeData
(
administrative
)
{
...
@@ -1611,52 +1629,27 @@ export default {
...
@@ -1611,52 +1629,27 @@ export default {
}
}
return
null
;
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
;
},
//获取医院等级
//获取医院等级
listLevels
()
{
listLevels
()
{
let
req
=
{};
let
req
=
{};
vm
.
GET
(
"contents/courseDoctor/listLevels?sysCode=10"
,
req
).
then
(
res
=>
{
vm
.
GET
(
"contents/courseDoctor/listLevels?sysCode=10"
,
req
).
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
if
(
res
.
code
==
"000000"
)
{
console
.
log
(
res
);
//
console.log(res);
this
.
organizationRank
=
operationData
.
getLevelList
(
res
.
data
.
list
);
this
.
organizationRank
=
operationData
.
getLevelList
(
res
.
data
.
list
);
}
}
});
});
},
},
//改变 设定机构选项
//改变 设定机构选项
selectionChangeOrganization
(
val
)
{
selectionChangeOrganization
(
rows
)
{
this
.
multipleSelectionOrganization
=
val
;
this
.
changedOrganization
=
[];
//console.log(val.length , this.formOrganization.pageSize , this.updatedOrganization)
if
(
rows
)
{
if
(
rows
.
forEach
(
row
=>
{
val
.
length
!=
0
&&
if
(
row
)
{
val
.
length
!=
this
.
formOrganization
.
pageSize
&&
this
.
changedOrganization
.
push
(
row
.
id
);
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);
}
}
console
.
log
(
this
.
changedOrganization
);
},
},
//改变机构 table 的check状态
//改变机构 table 的check状态
selectionChangeDepartment
(
val
)
{
selectionChangeDepartment
(
val
)
{
...
@@ -1664,37 +1657,24 @@ export default {
...
@@ -1664,37 +1657,24 @@ export default {
//console.log(this.multipleSelectionDepartment);
//console.log(this.multipleSelectionDepartment);
},
},
//改变人员 table的check状态
//改变人员 table的check状态
selectionChangePerson
(
val
)
{
selectionChangePerson
(
rows
)
{
this
.
multipleSelectionPerson
=
val
;
this
.
changedPerson
=
[];
//console.log(this.multipleSelectionPerson);
if
(
rows
)
{
if
(
rows
.
forEach
(
row
=>
{
val
.
length
!=
0
&&
if
(
row
)
{
val
.
length
!=
this
.
formPerson
.
pageSize
&&
this
.
changedPerson
.
push
(
row
.
id
);
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
);
}
}
});
}
console
.
log
(
this
.
changedPerson
);
},
},
//设定机构table全选
//设定机构table全选
checkAll
(
flag
,
name
)
{
checkAll
(
flag
,
name
)
{
//console.log(flag + " " + name);
//console.log(flag + " " + name);
if
(
name
==
"multipleOrganization"
)
{
if
(
name
==
"multipleOrganization"
)
{
this
.
changedOrganization
=
{}
;
this
.
changedOrganization
=
[]
;
}
else
if
(
name
==
"multiplePerson"
)
{
}
else
if
(
name
==
"multiplePerson"
)
{
this
.
changedPerson
=
{}
;
this
.
changedPerson
=
[]
;
}
}
if
(
flag
===
true
)
{
if
(
flag
===
true
)
{
if
(
this
.
checkTableState
[
name
]
===
false
)
{
if
(
this
.
checkTableState
[
name
]
===
false
)
{
...
@@ -1710,7 +1690,7 @@ export default {
...
@@ -1710,7 +1690,7 @@ export default {
getKind
(
type
)
{
getKind
(
type
)
{
let
kind
=
0
;
let
kind
=
0
;
if
(
type
==
"administrative"
)
{
if
(
type
==
"administrative"
)
{
console
.
log
(
"this.updatedTree"
,
this
.
updatedTree
);
//
console.log("this.updatedTree", this.updatedTree);
if
(
this
.
tagsRegion
.
length
>
0
&&
this
.
updatedTree
==
true
)
{
if
(
this
.
tagsRegion
.
length
>
0
&&
this
.
updatedTree
==
true
)
{
kind
=
3
;
kind
=
3
;
}
}
...
@@ -1722,20 +1702,16 @@ export default {
...
@@ -1722,20 +1702,16 @@ export default {
if
(
this
.
checkTableState
.
multipleOrganization
==
true
)
{
if
(
this
.
checkTableState
.
multipleOrganization
==
true
)
{
//设置机构类别0:无 1:全选 2:去掉 3:选中
//设置机构类别0:无 1:全选 2:去掉 3:选中
kind
=
1
;
kind
=
1
;
for
(
let
key
in
this
.
changedOrganization
)
{
if
(
this
.
changedOrganization
.
length
>
0
)
{
if
(
this
.
changedOrganization
[
key
][
1
].
length
>
0
)
{
kind
=
2
;
kind
=
2
;
}
}
}
}
else
{
}
else
{
//全部不选
//全部不选
kind
=
0
;
kind
=
0
;
for
(
let
key
in
this
.
changedOrganization
)
{
if
(
this
.
changedOrganization
.
length
>
0
)
{
if
(
this
.
changedOrganization
[
key
][
0
].
length
>
0
)
{
kind
=
3
;
kind
=
3
;
}
}
}
}
}
}
else
if
(
type
==
"department"
)
{
}
else
if
(
type
==
"department"
)
{
if
(
this
.
multipleSelectionDepartment
.
length
>
0
)
{
if
(
this
.
multipleSelectionDepartment
.
length
>
0
)
{
kind
=
3
;
kind
=
3
;
...
@@ -1744,21 +1720,17 @@ export default {
...
@@ -1744,21 +1720,17 @@ export default {
if
(
this
.
checkTableState
.
multiplePerson
==
true
)
{
if
(
this
.
checkTableState
.
multiplePerson
==
true
)
{
//设置机构类别0:无 1:全选 2:去掉 3:选中
//设置机构类别0:无 1:全选 2:去掉 3:选中
kind
=
1
;
kind
=
1
;
for
(
let
key
in
this
.
changedPerson
)
{
if
(
this
.
changedPerson
.
length
>
0
)
{
if
(
this
.
changedPerson
[
key
][
1
].
length
>
0
)
{
kind
=
2
;
kind
=
2
;
}
}
}
}
else
{
}
else
{
//全部不选
//全部不选
kind
=
0
;
kind
=
0
;
for
(
let
key
in
this
.
changedPerson
)
{
if
(
this
.
changedPerson
.
length
>
0
)
{
if
(
this
.
changedPerson
[
key
][
0
].
length
>
0
)
{
kind
=
3
;
kind
=
3
;
}
}
}
}
}
}
}
return
kind
;
return
kind
;
},
},
//设定的行政范围内容
//设定的行政范围内容
...
@@ -1798,8 +1770,7 @@ export default {
...
@@ -1798,8 +1770,7 @@ export default {
initOrganizationStatus
()
{
initOrganizationStatus
()
{
let
tableStatus
=
this
.
tableOrganization
;
let
tableStatus
=
this
.
tableOrganization
;
tableStatus
.
forEach
(
row
=>
{
tableStatus
.
forEach
(
row
=>
{
//console.log("row", row);
if
(
row
.
status
==
1
)
{
if
(
row
.
status
==
0
)
{
this
.
$nextTick
(
function
()
{
this
.
$nextTick
(
function
()
{
this
.
$refs
.
multipleOrganization
.
toggleRowSelection
(
row
);
this
.
$refs
.
multipleOrganization
.
toggleRowSelection
(
row
);
});
});
...
@@ -1825,66 +1796,12 @@ export default {
...
@@ -1825,66 +1796,12 @@ 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);
//console.log('机构状态:'+this.checkTableState.multipleOrganization);
let
idList
=
operationData
.
getIdList
(
this
.
tableOrganization
);
if
(
this
.
checkTableState
.
multipleOrganization
==
true
)
{
let
intersect
=
operationData
.
getIntersect
(
idList
,
this
.
changedOrganization
);
//全选
if
(
intersect
.
length
==
0
)
{
if
(
this
.
updatedOrganization
==
true
&&
this
.
changedOrganization
[
this
.
formOrganization
.
pageNum
]
!=
undefined
)
{
//table的status
//机构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
();
//table的status
this
.
initOrganizationStatus
();
this
.
initOrganizationStatus
();
}
}
}
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
);
});
});
}
else
{
this
.
initOrganizationStatus
();
}
}
}
}
});
});
},
},
...
@@ -1911,20 +1828,9 @@ export default {
...
@@ -1911,20 +1828,9 @@ export default {
//获取机构id列表
//获取机构id列表
getScopeOrganization
(
type
)
{
getScopeOrganization
(
type
)
{
let
scope
=
""
;
let
scope
=
""
;
if
(
type
==
2
)
{
if
(
type
==
2
||
type
==
3
)
{
for
(
let
key
in
this
.
changedOrganization
)
{
for
(
let
i
=
0
;
i
<
this
.
changedOrganization
.
length
;
i
++
)
{
let
organizationItem
=
this
.
changedOrganization
[
key
][
1
];
scope
+=
this
.
changedOrganization
[
i
]
+
"|"
;
console
.
log
(
"organizationItem:"
,
organizationItem
);
for
(
let
i
=
0
;
i
<
organizationItem
.
length
;
i
++
)
{
scope
+=
organizationItem
[
i
].
id
+
"|"
;
}
}
}
else
if
(
type
==
3
)
{
for
(
let
key
in
this
.
changedOrganization
)
{
let
organizationItem
=
this
.
changedOrganization
[
key
][
0
];
for
(
let
i
=
0
;
i
<
organizationItem
.
length
;
i
++
)
{
scope
+=
organizationItem
[
i
].
id
+
"|"
;
}
}
}
}
}
scope
=
scope
.
substring
(
0
,
scope
.
length
-
1
);
scope
=
scope
.
substring
(
0
,
scope
.
length
-
1
);
...
@@ -1934,20 +1840,9 @@ export default {
...
@@ -1934,20 +1840,9 @@ export default {
//获取人员id列表
//获取人员id列表
getScopePeople
(
type
)
{
getScopePeople
(
type
)
{
let
scope
=
""
;
let
scope
=
""
;
if
(
type
==
2
)
{
if
(
type
==
2
||
type
==
3
)
{
for
(
let
key
in
this
.
changedPerson
)
{
for
(
let
i
=
0
;
i
<
this
.
changedPerson
.
length
;
i
++
)
{
let
peopleItem
=
this
.
changedPerson
[
key
][
1
];
scope
+=
this
.
changedPerson
[
i
]
+
"|"
;
//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
);
scope
=
scope
.
substring
(
0
,
scope
.
length
-
1
);
...
@@ -1995,52 +1890,6 @@ export default {
...
@@ -1995,52 +1890,6 @@ export default {
this
.
tablePerson
=
res
.
data
.
people
;
this
.
tablePerson
=
res
.
data
.
people
;
this
.
totalPerson
=
res
.
data
.
total
;
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
);
});
});
}
}
}
}
});
});
},
},
...
...
src/views/system/item-role.vue
浏览文件 @
768eeacf
...
@@ -197,7 +197,8 @@ export default {
...
@@ -197,7 +197,8 @@ export default {
full
:
false
full
:
false
},
},
dialogFull
:
false
,
dialogFull
:
false
,
scopeRow
:
{}
scopeRow
:
{},
activeUser
:
''
,
};
};
},
},
created
()
{
created
()
{
...
@@ -230,7 +231,8 @@ export default {
...
@@ -230,7 +231,8 @@ export default {
if
(
res
.
code
==
"000000"
)
{
if
(
res
.
code
==
"000000"
)
{
vm
.
tableData
=
res
.
data
.
projectRoleInfoModels
;
vm
.
tableData
=
res
.
data
.
projectRoleInfoModels
;
vm
.
totalRows
=
res
.
data
.
total
;
vm
.
totalRows
=
res
.
data
.
total
;
vm
.
activeUser
=
res
.
data
.
activeUser
;
console
.
log
(
'activeUser'
,
vm
.
activeUser
);
//this.roleList = setRoleList(res.data.roleList);
//this.roleList = setRoleList(res.data.roleList);
this
.
organizationList
=
res
.
data
.
organizationList
;
this
.
organizationList
=
res
.
data
.
organizationList
;
this
.
departmentsList
=
res
.
data
.
departmentsList
;
this
.
departmentsList
=
res
.
data
.
departmentsList
;
...
@@ -287,7 +289,8 @@ export default {
...
@@ -287,7 +289,8 @@ export default {
//按钮展示情况
//按钮展示情况
showButton
(
row
,
projeceRole
)
{
showButton
(
row
,
projeceRole
)
{
let
flag
=
false
;
let
flag
=
false
;
//console.log("当前等级 " + row.projeceRole + " 改变成等级 " + projeceRole);
if
(
vm
.
activeUser
==
"L1"
)
{
//当前内部管理员
if
(
row
.
projeceRole
==
"L2"
)
{
if
(
row
.
projeceRole
==
"L2"
)
{
if
(
projeceRole
==
"L0"
)
{
if
(
projeceRole
==
"L0"
)
{
flag
=
true
;
flag
=
true
;
...
@@ -301,6 +304,25 @@ export default {
...
@@ -301,6 +304,25 @@ export default {
flag
=
true
;
flag
=
true
;
}
}
}
}
}
else
if
(
vm
.
activeUser
==
"L2"
)
{
//当前项目负责人
if
(
row
.
projeceRole
==
"L3"
)
{
if
(
projeceRole
==
"L2"
||
projeceRole
==
"L0"
)
{
flag
=
true
;
}
}
else
if
(
row
.
projeceRole
==
"L0"
)
{
if
(
projeceRole
==
"L2"
||
projeceRole
==
"L3"
)
{
flag
=
true
;
}
}
}
else
if
(
vm
.
activeUser
==
"L3"
)
{
//当前次级负责人
if
(
row
.
projeceRole
==
"L0"
)
{
if
(
projeceRole
==
"L3"
)
{
flag
=
true
;
}
}
}
return
flag
;
return
flag
;
},
},
//打开弹出框
//打开弹出框
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录