Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
W
work-log
Project
Project
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
高宇
work-log
Commits
debf18c1
Commit
debf18c1
authored
Mar 30, 2019
by
高宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成工作日志列表;
parent
e6a2a88e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
657 additions
and
11 deletions
+657
-11
workLog.js
src/apis/workLog.js
+19
-0
leaveMessage.vue
src/components/common/leaveMessage.vue
+373
-0
leaveMessagePagenation.vue
src/components/common/leaveMessagePagenation.vue
+57
-0
scheduleItem.vue
src/components/common/scheduleItem.vue
+24
-5
addLog.vue
src/components/workLog/addLog.vue
+21
-0
editLog.vue
src/components/workLog/editLog.vue
+21
-0
list.vue
src/components/workLog/list.vue
+104
-6
operationLog.vue
src/components/workLog/operationLog.vue
+21
-0
bind.js
src/lib/bind.js
+17
-0
No files found.
src/apis/workLog.js
View file @
debf18c1
...
...
@@ -7,5 +7,24 @@ export default {
// 获取列表
getWorkLogList
:
{
url
:
'/vue/work-log/list'
},
// 删除日志
delWorkLog
:
{
url
:
'/vue/work-log/delete'
},
// 留言
getCommentList
:
{
url
:
'/vue/comment/list'
},
// 留言新建
saveNewComment
:
{
url
:
'/vue/comment/save-new'
},
// 留言删除
deleteComment
:
{
url
:
'/vue/comment/delete'
}
}
src/components/common/leaveMessage.vue
0 → 100644
View file @
debf18c1
This diff is collapsed.
Click to expand it.
src/components/common/leaveMessagePagenation.vue
0 → 100644
View file @
debf18c1
<
template
>
<section>
<el-pagination
v-if=
"total > 0"
class=
"mb20 mt20"
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"pager.thispage"
:page-sizes=
"[2, 10, 20, 40, 60, 80, 100]"
:page-size=
"pager.pagesize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
</section>
</
template
>
<
script
>
export
default
{
props
:
{
total
:
{
type
:
Number
,
default
:
0
}
},
data
()
{
return
{
pager
:
{
thispage
:
1
,
pagesize
:
10
,
totalcount
:
0
}
}
},
created
()
{
this
.
$emit
(
'update:pager'
,
this
.
pager
)
},
methods
:
{
handleSizeChange
(
val
)
{
this
.
pager
.
thispage
=
1
this
.
pager
.
pagesize
=
val
this
.
pager
.
totalcount
=
this
.
total
this
.
$emit
(
'update:pager'
,
this
.
pager
)
this
.
$parent
.
init
()
},
handleCurrentChange
(
val
)
{
this
.
pager
.
page
=
val
this
.
pager
.
totalcount
=
this
.
total
this
.
$emit
(
'update:pager'
,
this
.
pager
)
this
.
$parent
.
init
()
}
}
}
</
script
>
<
style
scoped
>
</
style
>
src/components/common/scheduleItem.vue
View file @
debf18c1
...
...
@@ -22,6 +22,9 @@
</el-row>
</el-col>
<el-col
:span=
"20"
:xs=
"24"
class=
"client-schedule-right"
>
<div
class=
"draft"
style=
"position: absolute;right:5%;top:5%;width:100px;"
v-if=
"item.is_draft"
>
<img
src=
"https://beta.jinchangxiao.com/img/img_draft.png"
width=
"100%"
>
</div>
<el-row
:gutter=
"10"
>
<el-col
:span=
"6"
:xs=
"24"
>
开始时间:
{{
item
.
start_at
!==
''
?
item
.
start_at
:
noneText
}}
...
...
@@ -34,11 +37,18 @@
</el-col>
<el-col
:span=
"6"
:xs=
"24"
>
签到:
<el-tooltip
class=
"item"
effect=
"dark"
placement=
"top"
v-if=
"Object.keys(item.location).length > 0"
>
<el-tooltip
class=
"item"
effect=
"dark"
placement=
"top"
v-if=
"Object.keys(item.location).length > 0"
>
<i
class=
"fa fa-fw fa-location-arrow"
></i>
<template
slot=
"content"
><p>
地址:
{{
item
.
location
.
address
}}
</p>
<p>
距离:
{{
item
.
distance
!==
''
?
item
.
distance
:
noneText
}}
</p>
<p>
时间:
</p></
template
>
<template
slot=
"content"
>
<div
style=
"width: 150px; font-size: 12px; line-height: 18px;"
>
地址:
{{
item
.
location
.
address
}}
<br>
距离:
{{
item
.
distance
!==
''
?
item
.
distance
:
noneText
}}
<br>
时间:
{{
item
.
location
.
time
!==
''
?
item
.
location
.
time
:
noneText
}}
</div>
</
template
>
</el-tooltip>
<span
v-else
>
(未设置)
</span>
</el-col>
...
...
@@ -65,7 +75,7 @@
<el-row
:gutter=
"10"
>
<el-col
:span=
"12"
:xs=
"24"
>
<span
class=
"border border-danger text-danger rounded px-1"
>
备注
</span>
:
{{item.description !== '' ? item.description : noneText}}
<span
v-html=
"setBr(item)"
></span>
</el-col>
<el-col
:span=
"12"
:xs=
"24"
>
<slot
name=
"opearate"
>
...
...
@@ -90,6 +100,13 @@
}
},
methods
:
{
setBr
(
item
)
{
if
(
item
.
description
===
''
)
{
return
this
.
noneText
}
else
{
return
item
.
description
.
replace
(
/
\n
/g
,
'<br />'
)
}
},
toView
(
item
)
{
let
obj
=
{
name
:
'viewClient'
,
...
...
@@ -247,6 +264,7 @@
vertical-align
:
baseline
;
display
:
inline
;
padding
:
2px
6px
;
text-align
:
center
;
}
span
.badge-unread
{
&
:hover
{
...
...
@@ -277,3 +295,4 @@
}
}
</
style
>
src/components/workLog/addLog.vue
0 → 100644
View file @
debf18c1
<
template
>
<div>
</div>
</
template
>
<
script
>
export
default
{
name
:
''
,
data
()
{
return
{}
},
methods
:
{},
created
()
{
}
}
</
script
>
<
style
scoped
>
</
style
>
src/components/workLog/editLog.vue
0 → 100644
View file @
debf18c1
<
template
>
<div>
</div>
</
template
>
<
script
>
export
default
{
name
:
''
,
data
()
{
return
{}
},
methods
:
{},
created
()
{
}
}
</
script
>
<
style
scoped
>
</
style
>
src/components/workLog/list.vue
View file @
debf18c1
...
...
@@ -20,16 +20,28 @@
:key=
"key"
@
update:image=
"imgs =>
{setImage(imgs)}">
<span
slot=
"opearate"
>
<el-button
class=
"pull-right"
type=
"primary"
size=
"mini"
:disabled=
"!item.can_give_up"
@
click=
"giveUp(item.id)"
>
<el-button
class=
"pull-right"
type=
"primary"
size=
"mini"
:disabled=
"!item.can_delete"
@
click=
"delLog(item.id)"
>
<i
class=
"fa fa-trash-o faa-shake"
></i>
删除
</el-button>
<el-button
class=
"pull-right"
type=
"primary"
size=
"mini"
:disabled=
"!item.can_update"
<el-button
class=
"pull-right"
type=
"primary"
size=
"mini"
:disabled=
"!item.can_update"
@
click=
"edit(item.id)"
>
<i
class=
"fa fa-edit"
></i>
编辑
</el-button>
<el-button
class=
"pull-right"
type=
"primary"
size=
"mini"
@
click=
"addMessage(item.id)"
>
<span
:class=
"['badge',
{'badge-unread': item.unread > 0}]" v-if="item.commentCount">
{{
item
.
commentCount
.
comment
}}
</span>
<el-button
class=
"pull-right"
type=
"primary"
size=
"mini"
@
click
.
prevent
.
stop=
"leaveMessageSch(item)"
>
<span
:class=
"['badge',
{'badge-unread': item.unread > 0}]"
v-if="item.commentCount">
{{
item
.
commentCount
.
comment
}}
</span>
<i
class=
"fa fa-commenting"
></i>
留言
</el-button>
</span>
...
...
@@ -51,6 +63,12 @@
<div
class=
"images clearfix"
style=
"display: none;"
>
<img
v-for=
"(source, index) in images"
:key=
"index"
:src=
"source"
class=
"image"
>
</div>
<leave-message
v-click-outside=
"lmClose"
ref=
"leaveMessage"
:lmTemplate=
"lmTemplate"
:type=
"2"
>
</leave-message>
</section>
</
template
>
...
...
@@ -58,7 +76,9 @@
import
ScheduleItem
from
'../common/scheduleItem'
import
Pagenation
from
'./schedulePagenation'
import
clientHeader
from
'../common/clientHeader'
import
LeaveMessage
from
'../common/leaveMessage'
import
clientForm
from
'./workLogListForm'
import
clickOutside
from
'@/lib/bind'
import
{
requestAPI
,
api
...
...
@@ -71,10 +91,53 @@
clientHeader
,
clientForm
,
ScheduleItem
,
Pagenation
Pagenation
,
LeaveMessage
},
directives
:
{
clickOutside
},
data
()
{
return
{
lmTemplate
:
[
{
name
:
'客户名称'
,
value
:
'client.name'
,
default
:
'未设置'
},
{
name
:
'内容'
,
value
:
'description'
},
{
name
:
'待办时间'
,
value
:
'schedule_week_display'
},
{
name
:
'状态'
,
value
:
'schedule_status_display'
},
{
name
:
'开始时间'
,
value
:
'start_at'
},
{
name
:
'结束时间'
,
value
:
'end_at'
},
{
name
:
'重复'
,
value
:
'repeatSchedule'
},
{
name
:
'负责人'
,
value
:
'repeatSchedule'
},
{
name
:
'创建时间'
,
value
:
'created_at'
}
],
options
:
{
toolbar
:
true
,
url
:
'data-source'
...
...
@@ -95,6 +158,13 @@
}
},
methods
:
{
leaveMessageSch
(
item
)
{
this
.
$refs
.
leaveMessage
.
isShow
(
item
)
},
lmClose
()
{
this
.
$refs
.
leaveMessage
&&
this
.
$refs
.
leaveMessage
.
isClose
()
},
setImage
(
imgs
)
{
this
.
images
=
imgs
const
viewer
=
new
Viewer
(
this
.
$el
.
querySelector
(
'.images'
),
{
...
...
@@ -107,12 +177,39 @@
viewer
.
update
()
})
},
edit
()
{},
delLog
(
id
)
{
this
.
$confirm
(
'确认删除吗?'
,
'提示'
).
then
(()
=>
{
requestAPI
(
api
.
delWorkLog
,
{
data
:
{
id
}
}).
then
(()
=>
{
this
.
$message
(
'删除成功!'
)
this
.
getList
()
},
error
=>
{
if
(
Array
.
isArray
(
error
.
msg
))
{
error
.
msg
.
forEach
(
item
=>
{
this
.
$notify
.
error
({
title
:
'错误'
,
message
:
item
.
error
})
})
}
})
}).
catch
(
_
=>
{
})
},
addNewUser
()
{
this
.
$refs
.
leaveModule
.
isShow
(
'新建客户'
,
'clientAdd'
)
},
searchKeyword
(
search
)
{
this
.
updateForm
(
search
)
},
updatePage
(
pager
)
{
Object
.
assign
(
this
.
pagenation
,
pager
)
this
.
getList
()
},
updateForm
(
form
)
{
console
.
log
(
form
)
Object
.
assign
(
this
.
form
,
form
)
...
...
@@ -133,6 +230,7 @@
// this.pagenation.page = res.pagenation.thispage
this
.
totalcount
=
res
.
pagenation
.
totalcount
// this.totalcount = 8
this
.
$el
.
querySelector
(
'.page-body-content'
).
scrollTo
(
0
,
0
)
}).
finally
(
_
=>
{
this
.
loading
=
false
})
...
...
src/components/workLog/operationLog.vue
0 → 100644
View file @
debf18c1
<
template
>
<div>
</div>
</
template
>
<
script
>
export
default
{
name
:
''
,
data
()
{
return
{}
},
methods
:
{},
created
()
{
}
}
</
script
>
<
style
scoped
>
</
style
>
src/lib/bind.js
0 → 100644
View file @
debf18c1
export
default
{
bind
:
function
(
el
,
binding
,
vNode
)
{
el
.
__vueClickOutside__
=
event
=>
{
if
(
!
el
.
contains
(
event
.
target
))
{
// call method provided in v-click-outside value
vNode
.
context
[
binding
.
expression
](
event
)
event
.
stopPropagation
()
}
}
document
.
body
.
addEventListener
(
'click'
,
el
.
__vueClickOutside__
)
},
unbind
:
function
(
el
,
binding
,
vNode
)
{
// Remove Event Listeners
document
.
removeEventListener
(
'click'
,
el
.
__vueClickOutside__
)
el
.
__vueClickOutside__
=
null
}
}
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