Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
office-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
office
office-web
Commits
98f19d85
Commit
98f19d85
authored
Dec 24, 2018
by
无尘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 增加会员详情字段
parent
3a0a06f9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
234 additions
and
170 deletions
+234
-170
staff-detail-field.vue
src/components/set/staff-detail-field.vue
+89
-79
staffDetails.vue
src/views/setting/staffDetails.vue
+145
-91
No files found.
src/components/set/staff-detail-field.vue
View file @
98f19d85
...
@@ -7,10 +7,16 @@
...
@@ -7,10 +7,16 @@
<div
class=
"custom-dialog-body"
>
<div
class=
"custom-dialog-body"
>
<template
v-for=
"(item,index) in customData"
>
<template
v-for=
"(item,index) in customData"
>
<div
class=
"detail-field-cell flex"
:key=
"index"
>
<div
class=
"detail-field-cell flex"
:key=
"index"
>
<div
class=
"detail-field-left"
>
{{
item
.
n
ame
}}
</div>
<div
class=
"detail-field-left"
>
{{
item
.
fieldN
ame
}}
</div>
<div
class=
"detail-field-right flex"
>
<div
class=
"detail-field-right flex"
>
<el-checkbox-group
class=
"flex flex-wrap"
v-model=
"item.checkList"
@
change=
"customChange"
>
<el-checkbox-group
class=
"flex flex-wrap"
v-model=
"item.checkList"
@
change=
"customChange"
>
<el-checkbox
v-for=
"(childItem,childIndex) in item.childList"
:label=
"childItem.id"
:key=
"childItem.id"
name=
"type"
>
{{
childItem
.
name
}}
</el-checkbox>
<el-checkbox
v-for=
"(childItem,childIndex) in item.children"
:label=
"childItem.fieldCode"
:key=
"childItem.fieldCode"
:disabled=
"childItem.disable"
name=
"type"
>
{{
childItem
.
fieldName
}}
</el-checkbox>
</el-checkbox-group>
</el-checkbox-group>
</div>
</div>
</div>
</div>
...
@@ -35,91 +41,97 @@
...
@@ -35,91 +41,97 @@
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
},
},
d
a
tailData
:
{
d
e
tailData
:
{
type
:
Array
,
type
:
Array
,
default
:
[]
default
:
[]
},
dataType
:
{
type
:
Number
,
default
:
1
//'类型:1行政架构,2门店架构'
}
}
},
},
data
()
{
data
()
{
return
{
return
{
repProjectName
:
'gic-web'
,
// 项目名
repProjectName
:
'gic-web'
,
// 项目名
customDialog
:
false
,
// 弹框显示
customDialog
:
false
,
// 弹框显示
fixData
:
[
'clerkName'
,
'clerkPhone'
,
'groupName'
,
'positionName'
],
fixDataStore
:
[
'clerkName'
,
'clerkPhone'
,
'groupName'
,
'positionName'
,
'clerkCode'
],
// 复选框数据
// 复选框数据
customData
:
[
customData
:
[
{
{
id
:
1
,
fieldCode
:
1
,
n
ame
:
"基本信息"
,
fieldN
ame
:
"基本信息"
,
checkList
:
[],
checkList
:
[],
child
List
:
[
child
ren
:
[
{
{
id
:
'name'
,
fieldCode
:
'name'
,
n
ame
:
'姓名'
fieldN
ame
:
'姓名'
},
},
{
{
id
:
'depart'
,
fieldCode
:
'depart'
,
n
ame
:
'部门'
fieldN
ame
:
'部门'
},
},
{
{
id
:
'phone'
,
fieldCode
:
'phone'
,
n
ame
:
'手机号'
fieldN
ame
:
'手机号'
},
},
{
{
id
:
'email'
,
fieldCode
:
'email'
,
n
ame
:
'邮箱'
fieldN
ame
:
'邮箱'
},
},
{
{
id
:
'profession'
,
fieldCode
:
'profession'
,
n
ame
:
'职业'
fieldN
ame
:
'职业'
},
},
{
{
id
:
'hiredate'
,
fieldCode
:
'hiredate'
,
n
ame
:
'入职时间'
fieldN
ame
:
'入职时间'
},
},
]
]
},
},
{
{
id
:
2
,
fieldCode
:
2
,
n
ame
:
"工作信息"
,
fieldN
ame
:
"工作信息"
,
checkList
:
[],
checkList
:
[],
child
List
:
[
child
ren
:
[
{
{
id
:
'name'
,
fieldCode
:
'name'
,
n
ame
:
'姓名'
fieldN
ame
:
'姓名'
},
},
{
{
id
:
'depart'
,
fieldCode
:
'depart'
,
n
ame
:
'部门'
fieldN
ame
:
'部门'
}
}
]
]
},
},
{
{
id
:
3
,
fieldCode
:
3
,
n
ame
:
"个人信息"
,
fieldN
ame
:
"个人信息"
,
checkList
:
[],
checkList
:
[],
child
List
:
[
child
ren
:
[
{
{
id
:
'name'
,
fieldCode
:
'name'
,
n
ame
:
'姓名'
fieldN
ame
:
'姓名'
},
},
{
{
id
:
'depart'
,
fieldCode
:
'depart'
,
n
ame
:
'部门'
fieldN
ame
:
'部门'
},
},
]
]
},
},
{
{
id
:
4
,
fieldCode
:
4
,
n
ame
:
"学历信息"
,
fieldN
ame
:
"学历信息"
,
checkList
:
[],
checkList
:
[],
child
List
:
[
child
ren
:
[
{
{
id
:
'name'
,
fieldCode
:
'name'
,
n
ame
:
'姓名'
fieldN
ame
:
'姓名'
},
},
{
{
id
:
'depart'
,
fieldCode
:
'depart'
,
n
ame
:
'部门'
fieldN
ame
:
'部门'
},
},
]
]
},
},
...
@@ -141,6 +153,9 @@
...
@@ -141,6 +153,9 @@
that
.
baseUrl
=
host
that
.
baseUrl
=
host
}
}
},
},
computed
:
{
},
methods
:{
methods
:{
/**
/**
...
@@ -157,16 +172,18 @@
...
@@ -157,16 +172,18 @@
customCancel
()
{
customCancel
()
{
const
that
=
this
;
const
that
=
this
;
that
.
customDialog
=
false
that
.
customDialog
=
false
that
.
$emit
(
'customHandleConfirm'
)
that
.
$emit
(
'customHandleConfirm'
,
'hide'
)
},
},
/**
/**
* 确定
* 确定
*/
*/
customConfirm
()
{
customConfirm
()
{
const
that
=
this
;
const
that
=
this
;
// console.log(that.customData)
that
.
checkList
=
that
.
customData
.
map
(
item
=>
item
.
checkList
).
flat
();
that
.
$emit
(
'customHandleConfirm'
)
that
.
saveFields
(
that
.
dataType
)
},
},
/**
/**
...
@@ -187,13 +204,13 @@
...
@@ -187,13 +204,13 @@
type
:
type
,
// 类型:1行政架构,2门店架构'
type
:
type
,
// 类型:1行政架构,2门店架构'
}
}
postRequest
(
'/haoban-manage-web/
employee-show-field-detail
.json'
,
para
)
postRequest
(
'/haoban-manage-web/
record/employee-show-field-save
.json'
,
para
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
// console.log(res,res.data,res.data.errorCode)
// console.log(res,res.data,res.data.errorCode)
var
resData
=
res
.
data
var
resData
=
res
.
data
if
(
resData
.
errorCode
==
1
)
{
if
(
resData
.
errorCode
==
1
)
{
showMsg
.
showmsg
(
'
操作成功'
,
'success'
)
showMsg
.
showmsg
(
'
添加成功'
,
'success'
);
that
.
$emit
(
'customHandleConfirm'
)
return
;
return
;
}
}
...
@@ -266,40 +283,30 @@
...
@@ -266,40 +283,30 @@
*/
*/
handleAllFields
(
result
)
{
handleAllFields
(
result
)
{
const
that
=
this
const
that
=
this
result
.
forEach
(
function
(
ele
,
index
){
// console.log(that.treeData(result))
if
(
!!
that
.
hasOwnProperty
(
ele
.
parentCode
))
{
let
newResult
=
that
.
treeData
(
result
);
ele
.
fixed
=
parseInt
(
ele
.
fixed
)
===
1
?
true
:
false
;
newResult
.
forEach
(
function
(
ele
,
index
){
ele
.
isMust
=
parseInt
(
ele
.
isMust
)
===
1
?
true
:
false
;
ele
.
checkList
=
[]
ele
.
fieldEdited
=
parseInt
(
ele
.
fieldEdited
)
===
1
?
true
:
false
;
// ele.children.forEach(function(el,key){
ele
.
systemFlag
=
true
;
// el.disable = that.dataType == 1 ? that.fixData.includes(el.fieldCode) : that.fixDataStore.includes(el.fieldCode)
ele
.
fieldOperations
=
!!
ele
.
fieldOperations
?
JSON
.
parse
(
ele
.
fieldOperations
):
{};
// })
ele
.
staffRecordsIds
=
!!
ele
.
staffRecordsIds
?
JSON
.
parse
(
ele
.
staffRecordsIds
):
[];
that
[
ele
.
parentCode
].
push
(
ele
);
};
// 设置 fieldParent
if
(
!!
that
.
fieldParent
.
hasOwnProperty
(
ele
.
fieldCode
))
{
ele
.
children
=
[];
that
.
fieldParent
[
ele
.
fieldCode
]
=
ele
;
ele
.
systemFlag
=
true
;
}
})
})
that
.
customData
=
newResult
;
},
},
formatDate
(
time
,
flag
)
{
/**
* 处理已选信息
*/
handleDetailData
()
{
const
that
=
this
const
that
=
this
// (0-9)年月数字的显示
that
.
customData
.
forEach
(
function
(
ele
,
index
)
{
function
formatDig
(
num
)
{
ele
.
checkList
=
[];
return
num
>
9
?
''
+
num
:
'0'
+
num
;
ele
.
children
.
forEach
(
function
(
el
,
key
){
}
var
myDate
=
new
Date
(
time
);
that
.
checkList
.
includes
(
el
.
fieldCode
)?
ele
.
checkList
.
push
(
el
.
fieldCode
):
''
;
let
y
=
myDate
.
getFullYear
();
el
.
disable
=
that
.
dataType
==
1
?
that
.
fixData
.
includes
(
el
.
fieldCode
)
:
that
.
fixDataStore
.
includes
(
el
.
fieldCode
)
let
m
=
myDate
.
getMonth
()
+
1
;
})
let
d
=
myDate
.
getDate
();
})
return
y
+
flag
+
formatDig
(
m
)
+
flag
+
formatDig
(
d
)
+
flag
}
}
},
},
...
@@ -308,17 +315,20 @@
...
@@ -308,17 +315,20 @@
const
that
=
this
;
const
that
=
this
;
that
.
customDialog
=
newData
that
.
customDialog
=
newData
},
},
d
a
tailData
:
function
(
newData
,
oldData
){
d
e
tailData
:
function
(
newData
,
oldData
){
const
that
=
this
;
const
that
=
this
;
// console.log(newData)
that
.
checkList
=
!!
newData
&&
!!
newData
.
length
?
newData
:
[];
that
.
checkList
=
!!
newData
&&
!!
newData
.
length
?
newData
:
[];
},
that
.
handleDetailData
()
}
},
},
/* 接收数据 */
/* 接收数据 */
mounted
(){
mounted
(){
console
.
log
(
"传递的参数对象:"
,
this
.
showCustomDialog
)
//
console.log("传递的参数对象:",this.showCustomDialog)
const
that
=
this
;
const
that
=
this
;
that
.
customDialog
=
that
.
showCustomDialog
that
.
customDialog
=
that
.
showCustomDialog
;
that
.
getAllFields
()
},
},
}
}
...
...
src/views/setting/staffDetails.vue
View file @
98f19d85
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment