Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
account-book
Project
Project
Details
Activity
Releases
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
刘文虎
account-book
Commits
cc67eb5f
Commit
cc67eb5f
authored
Sep 24, 2022
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加成员
parent
91bfbc5f
Pipeline
#3564
canceled with stages
Changes
7
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
338 additions
and
156 deletions
+338
-156
index.js
api/project/index.js
+50
-0
cell-employee.vue
pages/workpoint/employees/components/cell-employee.vue
+17
-11
pop-wage-setting.vue
pages/workpoint/employees/components/pop-wage-setting.vue
+20
-6
wage-setting.vue
pages/workpoint/employees/components/wage-setting.vue
+2
-2
employee-create.vue
pages/workpoint/employees/employee-create.vue
+80
-22
index.vue
pages/workpoint/employees/index.vue
+166
-107
project-edit.vue
pages/workpoint/project/project-edit.vue
+3
-8
No files found.
api/project/index.js
View file @
cc67eb5f
...
@@ -81,3 +81,53 @@ export async function settleProject(data) {
...
@@ -81,3 +81,53 @@ export async function settleProject(data) {
noLoading
:
true
noLoading
:
true
})
})
}
}
// 项目成员
export
async
function
getProjectMembers
(
data
)
{
return
request
({
url
:
`/rest/project/member/page`
,
method
:
'GET'
,
data
,
noLoading
:
true
})
}
// 项目成员
export
async
function
getProjectMembersKnow
(
data
)
{
return
request
({
url
:
`/rest/project/member/all`
,
method
:
'GET'
,
data
,
noLoading
:
true
})
}
// 新增、更新项目成员
export
async
function
updateProjectMember
(
data
)
{
return
request
({
url
:
`/rest/project/member/save`
,
method
:
'POST'
,
data
,
noLoading
:
true
})
}
// 项目成员信息
export
async
function
getProjectMemberInfo
(
data
)
{
return
request
({
url
:
`/rest/project/member/info`
,
method
:
'GET'
,
data
,
noLoading
:
true
})
}
// 删除项目成员
export
async
function
deleteProjectMember
(
data
)
{
return
request
({
url
:
`/rest/project/member`
,
method
:
'DELETE'
,
data
,
noLoading
:
true
})
}
\ No newline at end of file
pages/workpoint/employees/components/cell-employee.vue
View file @
cc67eb5f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<view
class=
"left-view"
>
<view
class=
"left-view"
>
<view
class=
"image-view"
>
{{
imagekName
}}
</view>
<view
class=
"image-view"
>
{{
imagekName
}}
</view>
<view
class=
"name-view"
>
{{
member
.
name
}}
</view>
<view
class=
"name-view"
>
{{
member
.
name
}}
</view>
<view
class=
"info-view
"
>
{{
textInfo
}}
</view>
<view
:class=
"['info-view',
{select: isSelect}]
">
{{
textInfo
}}
</view>
</view>
</view>
<view
class=
"right-view"
>
<view
class=
"right-view"
>
<view
v-if=
"isSelect"
class=
"select-view"
@
click=
"$u.throttle(handleSelect, 500)"
hover-class=
"u-hover-class"
>
<view
v-if=
"isSelect"
class=
"select-view"
@
click=
"$u.throttle(handleSelect, 500)"
hover-class=
"u-hover-class"
>
...
@@ -28,10 +28,10 @@ export default {
...
@@ -28,10 +28,10 @@ export default {
type
:
Object
,
type
:
Object
,
default
()
{
default
()
{
return
{
return
{
memberI
d
:
''
,
i
d
:
''
,
name
:
''
,
name
:
''
,
money
:
''
,
notSettleAmount
:
''
,
phon
e
:
''
,
mobil
e
:
''
,
}
}
},
},
},
},
...
@@ -62,25 +62,26 @@ export default {
...
@@ -62,25 +62,26 @@ export default {
return
this
.
baseUrl
+
'bianjifuwufenlei@3x.png'
return
this
.
baseUrl
+
'bianjifuwufenlei@3x.png'
},
},
textInfo
()
{
textInfo
()
{
return
this
.
isEdit
?
this
.
member
.
phone
:
'¥'
+
formatCount
(
this
.
member
.
money
||
0
)
var
count
=
(
Number
(
this
.
member
.
notSettleAmount
||
0
)
==
0
?
''
:
'¥'
+
formatCount
(
this
.
member
.
notSettleAmount
||
0
))
var
mobile
=
this
.
member
.
mobile
?
(
this
.
member
.
mobile
.
substring
(
0
,
3
)
+
' '
+
this
.
member
.
mobile
.
substring
(
3
,
7
)
+
' '
+
this
.
member
.
mobile
.
substring
(
7
,
11
))
:
''
return
this
.
isEdit
?
count
:
mobile
}
}
},
},
created
()
{
},
created
()
{
},
methods
:
{
methods
:
{
handleClickButton
()
{
handleClickButton
()
{
this
.
$emit
(
'action'
,
this
.
member
.
memberI
d
)
this
.
$emit
(
'action'
,
this
.
member
.
i
d
)
},
},
handleSelect
()
{
handleSelect
()
{
this
.
member
.
selected
=
!
this
.
member
.
selected
this
.
member
.
selected
=
!
this
.
member
.
selected
console
.
log
(
this
.
member
)
this
.
$emit
(
'select'
,
this
.
member
.
id
,
this
.
member
.
selected
)
this
.
$emit
(
'select'
,
this
.
member
.
memberId
,
this
.
member
.
selected
)
},
},
},
},
}
}
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.cell-employee
{
.cell-employee
{
padding
:
32rpx
0
32
rpx
24rpx
;
padding
:
28rpx
0
28
rpx
24rpx
;
min-height
:
120rpx
;
min-height
:
120rpx
;
border-radius
:
8rpx
;
border-radius
:
8rpx
;
background-color
:
#ffffff
;
background-color
:
#ffffff
;
...
@@ -109,12 +110,17 @@ export default {
...
@@ -109,12 +110,17 @@ export default {
font-size
:
26rpx
;
font-size
:
26rpx
;
}
}
.info-view
{}
.info-view
{
color
:
#fc524d
;
&
.select
{
color
:
#333333
;
}
}
.name-view
{
.name-view
{
margin-right
:
32rpx
;
margin-right
:
32rpx
;
margin-left
:
24rpx
;
margin-left
:
24rpx
;
width
:
120rpx
;
max-
width
:
120rpx
;
white-space
:
nowrap
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
overflow
:
hidden
;
...
...
pages/workpoint/employees/components/pop-wage-setting.vue
View file @
cc67eb5f
<
template
>
<
template
>
<u-popup
v-model=
"show"
safe-area-inset-bottom
mode=
"bottom"
width=
"100%"
border-radius=
"16"
:closeable=
"false"
@
close=
"handleClose"
>
<u-popup
v-model=
"show"
safe-area-inset-bottom
mode=
"bottom"
width=
"100%"
border-radius=
"16"
:closeable=
"false"
@
close=
"handleClose"
>
<view
class=
"ppop-cwage-setting"
>
<view
class=
"ppop-cwage-setting"
>
<WageSetting
type=
"pop"
:form=
"form"
@
close=
"handleClose"
:fill
.
sync=
"canConfirm"
@
change=
"handleChange"
/>
<!-- v-if 可以清空上次填写 -->
<WageSetting
v-if=
"visible"
type=
"pop"
:form=
"salary"
@
close=
"handleClose"
:fill
.
sync=
"canConfirm"
@
change=
"handleChange"
/>
<view
class=
"bottom-view"
>
<view
class=
"bottom-view"
>
<u-button
:custom-style=
"customConFirm"
@
click=
"handleClickSure"
:loading=
"buttonLoading"
>
<u-button
:custom-style=
"customConFirm"
@
click=
"handleClickSure"
:loading=
"buttonLoading"
>
<view
class=
"confirm-view"
>
确定
</view>
<view
class=
"confirm-view"
>
确定
</view>
...
@@ -24,7 +25,7 @@ export default {
...
@@ -24,7 +25,7 @@ export default {
type
:
Boolean
,
type
:
Boolean
,
default
:
false
,
default
:
false
,
},
},
form
:
{
form
:
{
// 项目值
type
:
Object
,
type
:
Object
,
default
()
{
default
()
{
return
{
return
{
...
@@ -44,7 +45,17 @@ export default {
...
@@ -44,7 +45,17 @@ export default {
return
{
return
{
buttonLoading
:
false
,
buttonLoading
:
false
,
show
:
false
,
show
:
false
,
canConfirm
:
false
canConfirm
:
false
,
salary
:
{
// 用户输入值
id
:
''
,
normalUnitHours
:
''
,
normalUnitMoney
:
''
,
overHoursMoney
:
''
,
overType
:
'UNIT'
,
overUnitHours
:
''
,
overUnitMoney
:
''
,
projectId
:
''
,
},
}
}
},
},
computed
:
{
computed
:
{
...
@@ -60,6 +71,9 @@ export default {
...
@@ -60,6 +71,9 @@ export default {
},
},
watch
:
{
watch
:
{
visible
(
val
)
{
visible
(
val
)
{
if
(
val
&&
this
.
form
.
id
)
{
// 老项目才用项目值刷新用户输入值;新项目保留用户输入值
this
.
salary
=
{...
this
.
form
}
}
this
.
show
=
val
this
.
show
=
val
this
.
buttonLoading
=
false
this
.
buttonLoading
=
false
},
},
...
@@ -72,11 +86,11 @@ export default {
...
@@ -72,11 +86,11 @@ export default {
this
.
$emit
(
'update:visible'
,
false
)
this
.
$emit
(
'update:visible'
,
false
)
},
},
handleChange
(
key
,
value
)
{
handleChange
(
key
,
value
)
{
this
.
$emit
(
'change'
,
key
,
value
)
this
.
salary
[
key
]
=
value
},
},
handleClickSure
()
{
handleClickSure
()
{
this
.
buttonLoading
=
true
this
.
buttonLoading
=
true
this
.
$emit
(
'sure'
,
{...
this
.
form
})
this
.
$emit
(
'sure'
,
{...
this
.
salary
})
this
.
handleClose
()
this
.
handleClose
()
}
}
},
},
...
...
pages/workpoint/employees/components/wage-setting.vue
View file @
cc67eb5f
...
@@ -223,8 +223,8 @@ export default {
...
@@ -223,8 +223,8 @@ export default {
line-height
:
70rpx
;
line-height
:
70rpx
;
.input-view
{
.input-view
{
width
:
1
60
rpx
;
width
:
1
46
rpx
;
margin
:
0
16
rpx
;
margin
:
0
8
rpx
;
}
}
.type-view
{
.type-view
{
...
...
pages/workpoint/employees/employee-create.vue
View file @
cc67eb5f
...
@@ -19,19 +19,20 @@
...
@@ -19,19 +19,20 @@
</view>
</view>
</view>
</view>
</view>
</view>
<WageSetting
:form=
"form"
:fill
.
sync=
"
canConfirm
"
@
change=
"handleChange"
/>
<WageSetting
:form=
"form"
:fill
.
sync=
"
fill
"
@
change=
"handleChange"
/>
</view>
</view>
<view
:class=
"['bottom-view',
{edit: memberId}]">
<view
:class=
"['bottom-view',
{edit: memberId}]">
<u-button
v-if=
"memberId"
:custom-style=
"customDelete"
@
click=
"handleClickDelete"
class=
"delete-button"
>
<u-button
v-if=
"memberId"
:custom-style=
"customDelete"
@
click=
"handleClickDelete"
class=
"delete-button"
>
<view
class=
"delete-view"
>
删除
</view>
<view
class=
"delete-view"
>
删除
</view>
</u-button>
</u-button>
<u-button
:custom-style=
"customConFirm"
@
click=
"handleClickCon
F
irm"
:loading=
"buttonLoading"
>
<u-button
:custom-style=
"customConFirm"
@
click=
"handleClickCon
f
irm"
:loading=
"buttonLoading"
>
<view
class=
"confirm-view"
>
保存
</view>
<view
class=
"confirm-view"
>
保存
</view>
</u-button>
</u-button>
</view>
</view>
<view
class=
"loading-view"
v-if=
"loading"
>
<view
class=
"loading-view"
v-if=
"loading"
>
<u-loading
mode=
"flower"
></u-loading>
<u-loading
mode=
"flower"
></u-loading>
</view>
</view>
<PopNormal
:visible
.
sync=
"visible"
title=
"删除提醒"
content=
"确认删除该成员吗?"
@
confirm=
"handleClickSure"
/>
<u-toast
ref=
"uToast"
/>
<u-toast
ref=
"uToast"
/>
</view>
</view>
</
template
>
</
template
>
...
@@ -39,13 +40,15 @@
...
@@ -39,13 +40,15 @@
<
script
>
<
script
>
import
NavbarRight
from
'@/components/navbar-right'
import
NavbarRight
from
'@/components/navbar-right'
import
WageSetting
from
'./components/wage-setting'
import
WageSetting
from
'./components/wage-setting'
import
PopNormal
from
'@/components/pop-normal'
;
import
{
repairDetail
}
from
'@/api/maintain
/index.js'
;
import
{
updateProjectMember
,
getProjectMemberInfo
,
deleteProjectMember
}
from
'@/api/project
/index.js'
;
export
default
{
export
default
{
components
:
{
components
:
{
NavbarRight
,
NavbarRight
,
WageSetting
WageSetting
,
PopNormal
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -63,7 +66,8 @@ export default {
...
@@ -63,7 +66,8 @@ export default {
},
},
loading
:
false
,
loading
:
false
,
buttonLoading
:
false
,
buttonLoading
:
false
,
canConfirm
:
false
,
fill
:
false
,
visible
:
false
,
}
}
},
},
computed
:
{
computed
:
{
...
@@ -100,6 +104,9 @@ export default {
...
@@ -100,6 +104,9 @@ export default {
'border-radius'
:
'16rpx'
,
'border-radius'
:
'16rpx'
,
width
:
this
.
memberId
?
'470rpx'
:
'686rpx'
,
width
:
this
.
memberId
?
'470rpx'
:
'686rpx'
,
}
}
},
canConfirm
()
{
return
this
.
fill
&&
this
.
form
.
memberName
&&
this
.
form
.
memberMobile
}
}
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
...
@@ -109,20 +116,15 @@ export default {
...
@@ -109,20 +116,15 @@ export default {
if
(
options
&&
options
.
memberId
)
{
if
(
options
&&
options
.
memberId
)
{
this
.
memberId
=
options
.
memberId
this
.
memberId
=
options
.
memberId
this
.
loading
=
true
this
.
loading
=
true
this
.
repairDetail
()
this
.
getProjectMemberInfo
()
}
}
},
},
methods
:
{
methods
:
{
repairDetail
()
{
getProjectMemberInfo
()
{
// 测试数据
this
.
loading
=
false
this
.
setForm
()
return
this
.
loading
=
true
;
this
.
loading
=
true
;
repairDetail
({
getProjectMemberInfo
({
id
:
this
.
memberId
projectId
:
this
.
projectId
,
memberId
:
this
.
memberId
,
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
data
)
{
if
(
res
.
data
)
{
...
@@ -136,14 +138,14 @@ export default {
...
@@ -136,14 +138,14 @@ export default {
},
},
setForm
(
data
)
{
setForm
(
data
)
{
this
.
form
=
{
this
.
form
=
{
memberId
:
data
.
memberId
,
memberId
:
this
.
memberId
,
projectId
:
data
.
projectId
,
projectId
:
this
.
projectId
,
memberName
:
data
.
memberN
ame
,
memberName
:
data
.
n
ame
,
memberMobile
:
data
.
m
emberM
obile
,
memberMobile
:
data
.
mobile
,
normalUnitHours
:
data
.
normalUnitHours
,
normalUnitHours
:
data
.
normalUnitHours
,
normalUnitMoney
:
data
.
normalUnitMoney
,
normalUnitMoney
:
data
.
normalUnitMoney
,
overHoursMoney
:
data
.
overHoursMoney
,
overHoursMoney
:
data
.
overHoursMoney
,
overType
:
data
.
overType
,
overType
:
data
.
overType
.
code
,
overUnitHours
:
data
.
overUnitHours
,
overUnitHours
:
data
.
overUnitHours
,
overUnitMoney
:
data
.
overUnitMoney
,
overUnitMoney
:
data
.
overUnitMoney
,
};
};
...
@@ -152,9 +154,65 @@ export default {
...
@@ -152,9 +154,65 @@ export default {
this
.
form
[
key
]
=
value
this
.
form
[
key
]
=
value
},
},
handleClickDelete
()
{
handleClickDelete
()
{
this
.
visible
=
true
},
handleClickSure
()
{
this
.
deleteProjectMember
()
},
handleClickConfirm
()
{
this
.
buttonLoading
=
true
this
.
updateProjectMember
()
},
deleteProjectMember
()
{
deleteProjectMember
({
memberId
:
this
.
memberId
,
projectId
:
this
.
projectId
})
.
then
(
res
=>
{
if
(
res
.
data
)
{
this
.
$refs
.
uToast
.
show
({
title
:
'删除成功'
,
type
:
'success'
,
duration
:
1500
,
callback
:
()
=>
{
this
.
goBack
()
}
});
}
})
.
catch
(
res
=>
{
});
},
updateProjectMember
()
{
if
(
!
this
.
form
.
projectId
)
{
this
.
form
.
projectId
=
this
.
projectId
}
updateProjectMember
(
this
.
form
)
.
then
(
res
=>
{
if
(
res
.
data
)
{
this
.
$refs
.
uToast
.
show
({
title
:
'保存成功'
,
type
:
'success'
,
duration
:
1500
,
callback
:
()
=>
{
this
.
goBack
()
}
});
}
}
})
.
catch
(
res
=>
{
});
},
},
goBack
()
{
uni
.
$emit
(
'employees-changed'
)
this
.
$u
.
route
({
type
:
'navigateBack'
,
params
:
{
}
})
},
},
}
}
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
...
...
pages/workpoint/employees/index.vue
View file @
cc67eb5f
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
</u-button>
</u-button>
</view>
</view>
<view
class=
"bottom-select"
v-if=
"isSelect"
>
<view
class=
"bottom-select"
v-if=
"isSelect"
>
<u-button
:custom-style=
"customConFirm"
@
click=
"handleClickCon
F
irm"
>
<u-button
:custom-style=
"customConFirm"
@
click=
"handleClickCon
f
irm"
>
<view
class=
"confirm-view"
>
下一步
</view>
<view
class=
"confirm-view"
>
下一步
</view>
</u-button>
</u-button>
</view>
</view>
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
<u-loading
mode=
"flower"
></u-loading>
<u-loading
mode=
"flower"
></u-loading>
</view>
</view>
<u-toast
ref=
"uToast"
/>
<u-toast
ref=
"uToast"
/>
<PopWageSetting
:form=
"
form"
:visible
.
sync=
"visible"
@
sure=
"handleClickSure"
/>
<PopWageSetting
:form=
"
salary"
:visible
.
sync=
"visible"
@
sure=
"handleClickSure"
/>
</view>
</view>
</
template
>
</
template
>
...
@@ -51,7 +51,7 @@ import CellEmployee from './components/cell-employee';
...
@@ -51,7 +51,7 @@ import CellEmployee from './components/cell-employee';
import
NoData
from
'@/components/no-data'
;
import
NoData
from
'@/components/no-data'
;
import
PopWageSetting
from
'./components/pop-wage-setting'
import
PopWageSetting
from
'./components/pop-wage-setting'
import
{
repair
}
from
'@/api/maintain
/index.js'
;
import
{
getProjectMembers
,
getProjectMembersKnow
,
getProjectSalary
}
from
'@/api/project
/index.js'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -70,16 +70,20 @@ export default {
...
@@ -70,16 +70,20 @@ export default {
triggered
:
true
,
triggered
:
true
,
freshing
:
false
,
freshing
:
false
,
current
:
1
,
current
:
1
,
size
:
10
,
size
:
10
0
,
selectedMembers
:
[],
selectedMembers
:
[],
form
:
{
salary
:
{
hour
:
''
,
id
:
''
,
unit
:
''
,
normalUnitHours
:
''
,
type
:
'day'
,
normalUnitMoney
:
''
,
overHour
:
''
,
overHoursMoney
:
''
,
overUnit
:
''
,
overType
:
'UNIT'
,
overUnitHours
:
''
,
overUnitMoney
:
''
,
projectId
:
''
,
},
},
visible
:
false
,
visible
:
false
,
projectId
:
''
};
};
},
},
computed
:
{
computed
:
{
...
@@ -142,7 +146,7 @@ export default {
...
@@ -142,7 +146,7 @@ export default {
stringEmployees
()
{
stringEmployees
()
{
let
list
=
[]
let
list
=
[]
for
(
var
item
of
this
.
employees
)
{
for
(
var
item
of
this
.
employees
)
{
list
.
push
(
item
.
memberI
d
)
list
.
push
(
item
.
i
d
)
}
}
return
list
.
join
(
','
)
return
list
.
join
(
','
)
},
},
...
@@ -154,21 +158,28 @@ export default {
...
@@ -154,21 +158,28 @@ export default {
}
}
}
}
return
list
.
join
(
','
)
return
list
.
join
(
','
)
}
}
,
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
if
(
options
&&
options
.
type
)
{
if
(
options
&&
options
.
type
)
{
this
.
type
=
options
.
type
this
.
type
=
options
.
type
}
}
if
(
options
&&
options
.
projectId
)
{
this
.
projectId
=
options
.
projectId
}
if
(
options
&&
options
.
selectedMembers
)
{
if
(
options
&&
options
.
selectedMembers
)
{
this
.
selectedMembers
=
options
.
selectedMembers
.
split
(
','
)
this
.
selectedMembers
=
options
.
selectedMembers
.
split
(
','
)
}
}
if
(
this
.
isEdit
)
{
if
(
this
.
isEdit
)
{
this
.
size
=
20
uni
.
$on
(
'employees-changed'
,
res
=>
{
uni
.
$on
(
'employees-changed'
,
res
=>
{
this
.
reloadList
();
this
.
reloadList
();
});
});
}
}
// 测试数据
this
.
projectId
=
'160'
this
.
freshing
=
false
;
this
.
freshing
=
false
;
this
.
reloadList
();
this
.
reloadList
();
},
},
...
@@ -181,75 +192,45 @@ export default {
...
@@ -181,75 +192,45 @@ export default {
reloadList
()
{
reloadList
()
{
this
.
current
=
1
;
this
.
current
=
1
;
this
.
loadStatus
=
'loading'
;
this
.
loadStatus
=
'loading'
;
this
.
getMyDynamic
();
this
.
loadMember
()
},
loadMember
()
{
if
(
this
.
isEdit
)
{
this
.
getProjectMembers
();
}
else
if
(
this
.
isSelect
)
{
this
.
getProjectMembersKnow
()
this
.
getProjectSalary
()
}
},
},
get
MyDynamic
()
{
get
ProjectMembersKnow
()
{
if
(
this
.
current
==
1
)
{
if
(
this
.
current
==
1
)
{
this
.
loading
=
true
;
this
.
loading
=
true
;
}
}
// repair({
getProjectMembersKnow
({
// current: this.current,
current
:
this
.
current
,
// keyword: this.keyword,
keyword
:
this
.
keyword
,
// size: this.size,
excludeProjectId
:
this
.
projectId
,
// })
size
:
this
.
size
,
// .then(res => {
})
var
res
=
{
.
then
(
res
=>
{
data
:
{
console
.
log
(
'-------res------'
,
res
)
employees
:
[
{
memberId
:
'1'
,
name
:
'张三子'
,
money
:
'1000'
,
phone
:
'1851111111'
,
},
{
memberId
:
'2'
,
name
:
'李四'
,
money
:
'2000'
,
phone
:
'18522222222'
,
},
{
memberId
:
'3'
,
name
:
'王五'
,
money
:
'32000'
,
phone
:
'1853333333'
,
},
{
memberId
:
'4'
,
name
:
'fdasfasf'
,
money
:
'4000'
,
phone
:
'18544444444'
,
},
{
memberId
:
'5'
,
name
:
'成吉思汗'
,
money
:
'5000'
,
phone
:
'185255555555'
,
},
{
memberId
:
'6'
,
name
:
'弗朗西斯科'
,
money
:
'6000'
,
phone
:
'18566666666'
,
}
]
}
}
let
data
=
res
.
data
;
let
data
=
res
.
data
;
if
(
this
.
current
==
1
)
{
if
(
this
.
current
==
1
)
{
this
.
employees
=
[];
this
.
employees
=
[];
}
}
if
(
data
.
employees
)
{
if
(
data
.
records
)
{
for
(
var
item
of
data
.
employees
)
{
for
(
var
item
of
data
.
records
)
{
var
selected
=
false
for
(
var
id
of
this
.
selectedMembers
)
{
for
(
var
id
of
this
.
selectedMembers
)
{
if
(
item
.
memberI
d
==
id
)
{
if
(
item
.
i
d
==
id
)
{
item
.
selected
=
true
selected
=
true
break
break
}
}
}
}
item
.
selected
=
selected
}
}
this
.
employees
.
push
(...
data
.
employee
s
);
this
.
employees
.
push
(...
data
.
record
s
);
this
.
loadStatus
=
data
.
total
>
this
.
employees
.
length
?
'loadmore'
:
'nomore'
;
this
.
loadStatus
=
data
.
total
>
this
.
employees
.
length
?
'loadmore'
:
'nomore'
;
}
}
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
...
@@ -259,13 +240,73 @@ export default {
...
@@ -259,13 +240,73 @@ export default {
}
}
});
});
this
.
loading
=
false
;
this
.
loading
=
false
;
// })
})
// .catch(err => {
.
catch
(
err
=>
{
// this.loading = false;
this
.
loading
=
false
;
// console.log(err);
console
.
log
(
err
);
// });
});
},
getProjectMembers
()
{
if
(
this
.
current
==
1
)
{
this
.
loading
=
true
;
}
getProjectMembers
({
current
:
this
.
current
,
projectId
:
this
.
projectId
,
size
:
this
.
size
,
})
.
then
(
res
=>
{
console
.
log
(
'-------res---0---'
,
res
)
let
data
=
res
.
data
;
if
(
this
.
current
==
1
)
{
this
.
employees
=
[];
}
if
(
data
.
records
)
{
this
.
employees
.
push
(...
data
.
records
);
this
.
loadStatus
=
data
.
total
>
this
.
employees
.
length
?
'loadmore'
:
'nomore'
;
}
this
.
$nextTick
(()
=>
{
if
(
this
.
freshing
)
{
this
.
triggered
=
false
;
this
.
freshing
=
false
;
}
});
this
.
loading
=
false
;
})
.
catch
(
err
=>
{
this
.
loading
=
false
;
console
.
log
(
err
);
});
},
getProjectSalary
()
{
this
.
loading
=
true
;
getProjectSalary
({
id
:
this
.
projectId
})
.
then
(
res
=>
{
if
(
res
.
data
)
{
this
.
setSalary
(
res
.
data
)
}
else
{
this
.
salary
.
projectId
=
this
.
projectId
}
this
.
loading
=
false
;
})
.
catch
(
res
=>
{
this
.
loading
=
false
;
});
},
setSalary
(
data
)
{
this
.
salary
=
{
id
:
data
.
id
,
normalUnitHours
:
data
.
normalUnitHours
,
normalUnitMoney
:
data
.
normalUnitMoney
,
overHoursMoney
:
data
.
overHoursMoney
,
overType
:
data
.
overType
.
code
,
overUnitHours
:
data
.
overUnitHours
,
overUnitMoney
:
data
.
overUnitMoney
,
projectId
:
data
.
projectId
,
}
},
},
onRefresh
()
{
onRefresh
()
{
if
(
this
.
freshing
)
return
;
if
(
this
.
freshing
)
return
;
this
.
freshing
=
true
;
this
.
freshing
=
true
;
...
@@ -279,7 +320,7 @@ export default {
...
@@ -279,7 +320,7 @@ export default {
this
.
current
+=
1
;
this
.
current
+=
1
;
if
(
this
.
loadStatus
!=
'loadmore'
)
return
;
if
(
this
.
loadStatus
!=
'loadmore'
)
return
;
this
.
loadStatus
==
'loading'
;
this
.
loadStatus
==
'loading'
;
this
.
getMyDynamic
();
this
.
loadMember
();
},
},
changeSearch
()
{
changeSearch
()
{
this
.
reloadList
();
this
.
reloadList
();
...
@@ -289,20 +330,25 @@ export default {
...
@@ -289,20 +330,25 @@ export default {
url
:
'/pages/workpoint/employees/employee-create'
,
url
:
'/pages/workpoint/employees/employee-create'
,
type
:
'navigateTo'
,
type
:
'navigateTo'
,
params
:
{
params
:
{
memberId
:
employeeId
memberId
:
employeeId
,
projectId
:
this
.
projectId
}
}
});
});
},
},
handleSelectCell
(
id
,
selected
)
{
handleSelectCell
(
id
,
selected
)
{
var
members
=
[]
for
(
var
item
of
this
.
employees
)
{
for
(
var
item
of
this
.
employees
)
{
if
(
item
.
memberI
d
==
id
)
{
if
(
item
.
i
d
==
id
)
{
item
.
selected
=
selected
item
.
selected
=
selected
break
break
}
}
if
(
item
.
selected
)
{
members
.
push
(
item
.
id
)
}
}
}
this
.
selectedMembers
=
members
},
},
handleClickAdd
()
{
handleClickAdd
()
{
console
.
log
(
'--------handleClickAdd------'
,
this
.
stringEmployees
)
this
.
$u
.
route
({
this
.
$u
.
route
({
url
:
'/pages/workpoint/employees/index'
,
url
:
'/pages/workpoint/employees/index'
,
type
:
'navigateTo'
,
type
:
'navigateTo'
,
...
@@ -316,14 +362,26 @@ export default {
...
@@ -316,14 +362,26 @@ export default {
this
.
$u
.
route
({
this
.
$u
.
route
({
url
:
'/pages/workpoint/employees/employee-create'
,
url
:
'/pages/workpoint/employees/employee-create'
,
type
:
'navigateTo'
,
type
:
'navigateTo'
,
params
:
{
projectId
:
this
.
projectId
}
});
});
},
},
handleClickCon
F
irm
()
{
handleClickCon
f
irm
()
{
// this.stringSelectedEmployees
// this.stringSelectedEmployees
if
(
this
.
selectedMembers
.
length
<=
0
)
{
this
.
$refs
.
uToast
.
show
({
title
:
'请选择成员'
,
type
:
'warning'
,
duration
:
1500
});
return
;
}
this
.
visible
=
true
this
.
visible
=
true
},
},
handleClickSure
(
form
)
{
handleClickSure
(
salary
)
{
console
.
log
(
'----handleClickSure-------'
,
form
)
console
.
log
(
'----handleClickSure-------'
,
salary
)
return
// 调接口
// 调接口
this
.
$refs
.
uToast
.
show
({
this
.
$refs
.
uToast
.
show
({
title
:
'添加成功'
,
title
:
'添加成功'
,
...
@@ -411,6 +469,7 @@ export default {
...
@@ -411,6 +469,7 @@ export default {
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
.confirm-view
{
.confirm-view
{
color
:
#ffffff
;
color
:
#ffffff
;
height
:
104rpx
;
height
:
104rpx
;
...
...
pages/workpoint/project/project-edit.vue
View file @
cc67eb5f
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
<view
class=
"loading-view"
v-if=
"loading"
>
<view
class=
"loading-view"
v-if=
"loading"
>
<u-loading
mode=
"flower"
></u-loading>
<u-loading
mode=
"flower"
></u-loading>
</view>
</view>
<PopWageSetting
:form=
"salary"
:visible
.
sync=
"visible"
@
change=
"handleChange"
@
sure=
"handleClickSure"
/>
<PopWageSetting
:form=
"salary"
:visible
.
sync=
"visible"
@
sure=
"handleClickSure"
/>
<PopNormal
:visible
.
sync=
"visiblePop"
:loadingShow=
"true"
:title=
"currentPopInfo.title"
<PopNormal
:visible
.
sync=
"visiblePop"
:loadingShow=
"true"
:title=
"currentPopInfo.title"
:content=
"currentPopInfo.content"
@
confirm=
"handleClickConfirm"
/>
:content=
"currentPopInfo.content"
@
confirm=
"handleClickConfirm"
/>
<u-toast
ref=
"uToast"
/>
<u-toast
ref=
"uToast"
/>
...
@@ -297,7 +297,6 @@ export default {
...
@@ -297,7 +297,6 @@ export default {
updateProject
(
params
)
updateProject
(
params
)
.
then
(
res
=>
{
.
then
(
res
=>
{
let
data
=
res
.
data
;
let
data
=
res
.
data
;
console
.
log
(
'------updateProject-------'
,
data
)
if
(
data
)
{
if
(
data
)
{
this
.
setSuccess
()
this
.
setSuccess
()
}
}
...
@@ -309,14 +308,13 @@ export default {
...
@@ -309,14 +308,13 @@ export default {
},
},
setSuccess
()
{
setSuccess
()
{
this
.
reloadList
()
uni
.
$emit
(
'projects-changed'
)
this
.
$refs
.
uToast
.
show
({
this
.
$refs
.
uToast
.
show
({
title
:
'设置成功'
,
title
:
'设置成功'
,
type
:
'success'
,
type
:
'success'
,
duration
:
1500
,
duration
:
1500
,
callback
:
()
=>
{
callback
:
()
=>
{
this
.
reloadList
()
uni
.
$emit
(
'projects-changed'
)
}
}
});
});
},
},
...
@@ -344,9 +342,6 @@ export default {
...
@@ -344,9 +342,6 @@ export default {
handleClickSure
(
form
)
{
handleClickSure
(
form
)
{
this
.
setProjectSalary
(
form
)
this
.
setProjectSalary
(
form
)
},
},
handleChange
(
key
,
value
)
{
this
.
salary
[
key
]
=
value
},
handleClickDelete
()
{
handleClickDelete
()
{
this
.
currentPopInfo
=
this
.
popInfos
[
0
]
this
.
currentPopInfo
=
this
.
popInfos
[
0
]
this
.
visiblePop
=
true
this
.
visiblePop
=
true
...
...
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