Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bms-vue-obear
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
daywrite
bms-vue-obear
Commits
7984f4f9
Commit
7984f4f9
authored
Mar 18, 2019
by
huai.li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加编辑功能
parent
a4c401cb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
78 additions
and
67 deletions
+78
-67
app.scss
src/assets/css/app.scss
+1
-0
scheduleItem.vue
src/components/common/scheduleItem.vue
+9
-27
scheduleForm.vue
src/components/schedule/scheduleForm.vue
+4
-28
scheduleModal.vue
src/components/schedule/scheduleModal.vue
+5
-9
scheduleHome.vue
src/components/schedule_list/scheduleHome.vue
+32
-3
commonMixin.js
src/lib/commonMixin.js
+1
-0
util.js
src/lib/util.js
+26
-0
No files found.
src/assets/css/app.scss
View file @
7984f4f9
...
...
@@ -2,6 +2,7 @@
.mb20
{
margin-bottom
:
20px
;
}
.el-button--cancel
{
color
:white
;
background-color
:
#EB7567
;
...
...
src/components/common/scheduleItem.vue
View file @
7984f4f9
...
...
@@ -4,15 +4,13 @@
<el-col
:span=
"4"
:xs=
"24"
class=
"obear-schedule-left"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"24"
>
<
i
class=
"fa fa-star"
aria-hidden=
"true"
></i><span
>
客户名称(
{{
isNullClient
?
'未设置'
:
item
.
client
.
name
}}
)
</span>
<
span><i
class=
"fa fa-star"
aria-hidden=
"true"
></i
>
客户名称(
{{
isNullClient
?
'未设置'
:
item
.
client
.
name
}}
)
</span>
</el-col>
<el-col
:span=
"24"
>
<img
class=
"user-avatar rounded-circle"
:src=
"item.createdBy.avatar.name"
>
<span>
{{
item
.
createdBy
.
name
}}
</span>
<span><img
class=
"user-avatar rounded-circle"
:src=
"item.createdBy.avatar.name"
>
{{
item
.
createdBy
.
name
}}
</span>
</el-col>
<el-col
:span=
"24"
>
<i
class=
"fa fa-connectdevelop"
aria-hidden=
"true"
></i>
<span>
{{
item
.
department
.
name
}}
</span>
<span><i
class=
"fa fa-connectdevelop"
aria-hidden=
"true"
></i>
{{
item
.
department
.
name
}}
</span>
<span
class=
"obear-schedule-left__private"
:class=
"[isPublic ? 'colRed' : 'colGreen']"
>
{{
isPublic
?
'私人'
:
'共享'
}}
</span>
</el-col>
</el-row>
...
...
@@ -56,10 +54,8 @@
<el-col
:span=
"6"
:xs=
"24"
>
</el-col>
<el-col
:span=
"6"
:xs=
"24"
>
<el-button
type=
"primary"
size=
"mini"
><i
class=
"el-icon-share el-icon--left"
></i>
留言
</el-button>
<el-button
type=
"primary"
size=
"mini"
><i
class=
"el-icon-share el-icon--left"
></i>
汇报
</el-button>
<el-button
type=
"primary"
size=
"mini"
><i
class=
"el-icon-share el-icon--left"
></i>
编辑
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"deleteSch(item.id)"
><i
class=
"el-icon-share el-icon--left"
></i>
删除
</el-button>
<slot
name=
"opearate"
>
</slot>
</el-col>
</el-row>
</el-col>
...
...
@@ -68,10 +64,6 @@
</
template
>
<
script
>
import
{
requestWithJsonAPI
,
api
}
from
'@/lib/commonMixin'
export
default
{
name
:
'scheduleItem'
,
...
...
@@ -98,20 +90,6 @@ export default {
},
methods
:
{
deleteSch
(
id
)
{
this
.
$confirm
(
'删除该待办事项?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
requestWithJsonAPI
(
api
.
deleteSchedule
)
.
then
((
res
)
=>
{
console
.
log
(
res
)
})
}).
catch
(()
=>
{
this
.
$message
.
info
(
'取消删除'
)
})
}
}
}
</
script
>
...
...
@@ -166,6 +144,10 @@ export default {
display
:
inline-block
;
padding-left
:
5px
;
}
i
{
display
:inline-block
;
padding-right
:
5px
;
}
@include
e
(
'private'
)
{
display
:
inline-block
;
padding-right
:
5px
;
...
...
src/components/schedule/scheduleForm.vue
View file @
7984f4f9
<
template
>
<section
class=
"ec-page-wrapper"
style=
"overflow: hidden; padding-bottom: 0px;"
>
<el-form
label-width=
"120px"
ref=
"form"
:rules=
"rules"
:model=
"model"
class=
"ec-create-form"
>
<el-form-item
label=
"客户名称"
prop=
"actName"
class=
"ec-clear-left"
>
<el-form-item
label=
"客户名称"
prop=
"actName"
class=
"ec-clear-left"
v-if=
"isCreate"
>
<dep-select
:query=
"query"
:inputWidth=
"340"
...
...
@@ -138,20 +138,12 @@ export default {
mounted
()
{
this
.
initSetting
([
'getNewArray'
])
// if (this.isEdit) {
// let id = this.$route.params.id
// this.getActById(id)
// }
},
computed
:
{
// isCreate () {
// return this.pageType === 'create'
// },
//
// isEdit () {
// return this.pageType === 'edit'
// }
isCreate
()
{
return
!
this
.
model
.
client_id
}
},
methods
:
{
...
...
@@ -163,22 +155,6 @@ export default {
})
},
edit
(
res
)
{
let
resModel
=
res
.
actFullCutDetailModel
this
.
visStatus
=
resModel
.
visStatus
this
.
oldBeginTimeFormat
=
resModel
.
beginTimeFormat
this
.
oldEndTimeFormat
=
resModel
.
endTimeFormat
this
.
oaDeptNameArray
.
push
(
{
oaDepCode
:
resModel
.
bearOaCode
,
oaDepName
:
resModel
.
bearOaName
}
)
// UTIL.flatten(this.Act.form.editModel.actFullcutParam, resModel)
},
saveEvent
()
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
...
...
src/components/schedule/scheduleModal.vue
View file @
7984f4f9
...
...
@@ -14,7 +14,8 @@
<
script
>
import
{
requestAPI
,
api
api
,
UTIL
}
from
'@/lib/commonMixin'
import
ScheduleForm
from
'./scheduleForm'
export
default
{
...
...
@@ -27,7 +28,7 @@ export default {
return
{
diaVis
:
false
,
model
:
{
client_id
:
'
111
'
,
client_id
:
''
,
schedule_title
:
''
,
start_at
:
''
,
end_at
:
''
,
...
...
@@ -41,12 +42,12 @@ export default {
},
methods
:
{
show
()
{
show
(
model
)
{
model
&&
UTIL
.
flatten
(
this
.
model
,
model
)
this
.
diaVis
=
true
},
save
()
{
console
.
log
(
'this.model'
,
this
.
model
)
requestAPI
(
Object
.
assign
({},
api
.
saveNewSchedule
,
{
method
:
'POST'
}),
this
.
model
)
.
then
((
res
)
=>
{
console
.
log
(
res
)
...
...
@@ -56,9 +57,4 @@ export default {
}
</
script
>
<
style
lang=
"scss"
scoped
>
.el-dialog
.el-dialog__header
{
background-color
:
#333744
!
important
;
}
@include
c
(
'dialog-title'
)
{
}
</
style
>
src/components/schedule_list/scheduleHome.vue
View file @
7984f4f9
...
...
@@ -7,7 +7,7 @@
:search-key=
"'ClientSearch'"
:add-title=
"'新建待办事项'"
@
update:headerSearch=
"search => searchKeyword(search)"
@
update:headerAdd=
"() => add()"
>
@
update:headerAdd=
"() => add
Sch
()"
>
</search-header>
<search-form
ref=
"clientForm"
...
...
@@ -19,6 +19,12 @@
v-for=
"item in result.list"
:item=
"item"
:key=
"item.id"
>
<span
slot=
"opearate"
class=
"obear-opearate-button"
>
<el-button
type=
"primary"
size=
"mini"
><i
class=
"el-icon-share el-icon--left"
></i>
留言
</el-button>
<el-button
type=
"primary"
size=
"mini"
><i
class=
"el-icon-share el-icon--left"
></i>
汇报
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"editSch(item)"
><i
class=
"fa fa-edit animated"
></i>
编辑
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"deleteSch(item.id)"
><i
class=
"el-icon-share el-icon--left"
></i>
删除
</el-button>
</span>
</ScheduleItem>
</div>
<Pagenation
...
...
@@ -95,10 +101,29 @@ export default {
})
},
add
()
{
add
Sch
()
{
this
.
$refs
.
scheduleModal
.
show
()
},
editSch
(
item
)
{
this
.
$refs
.
scheduleModal
.
show
(
item
)
},
deleteSch
(
id
)
{
this
.
$confirm
(
'删除该待办事项?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
requestWithJsonAPI
(
api
.
deleteSchedule
)
.
then
((
res
)
=>
{
console
.
log
(
res
)
})
}).
catch
(()
=>
{
this
.
$message
.
info
(
'取消删除'
)
})
},
getScheduleList
()
{
requestWithJsonAPI
(
api
.
getScheduleList
)
.
then
((
res
)
=>
{
...
...
@@ -119,5 +144,9 @@ export default {
</
script
>
<
style
scoped
lang=
"scss"
>
@include
c
(
'opearate-button'
)
{
>
.el-button
{
margin-right
:
0px
;
}
}
</
style
>
src/lib/commonMixin.js
View file @
7984f4f9
...
...
@@ -2,3 +2,4 @@
export
{
requestAPI
,
requestWithJsonAPI
}
from
'../ajax'
export
{
requestJanusAPI
}
from
'../ajax-janus'
export
{
default
as
api
}
from
'@/api'
export
{
default
as
UTIL
}
from
'./util'
src/lib/util.js
0 → 100644
View file @
7984f4f9
import
{
MessageBox
}
from
'element-ui'
function
flatten
(
target
,
src
)
{
if
(
!
isObject
(
target
)
||
!
isObject
(
src
))
return
Object
.
keys
(
src
).
forEach
(
key
=>
{
target
.
hasOwnProperty
(
key
)
&&
(
target
[
key
]
=
src
[
key
])
})
}
function
isObject
(
o
)
{
return
Object
.
prototype
.
toString
.
call
(
o
)
===
'[object Object]'
}
function
confirm
(
tips
)
{
return
MessageBox
.
confirm
(
tips
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
})
}
export
default
{
flatten
,
isObject
,
confirm
}
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