Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
html
/
small-program-web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
36ace9dc
authored
Jul 02, 2019
by
duanguohui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
厨师
parent
4f041eaa
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
259 additions
and
45 deletions
+259
-45
src/router.js
+6
-0
src/views/cookManage/CookAdd.vue
+160
-0
src/views/cookManage/CookDetail.vue
+33
-20
src/views/cookManage/CookList.vue
+56
-24
src/views/orderList/OrderList.vue
+4
-1
No files found.
src/router.js
View file @
36ace9dc
...
...
@@ -4,6 +4,7 @@ import Login from './views/Login.vue'
import
Layout
from
'./components/Layout'
import
CookList
from
'./views/cookManage/CookList'
import
CookAdd
from
'./views/cookManage/CookAdd'
import
CookDetail
from
'./views/cookManage/CookDetail'
import
OrderList
from
'./views/orderList/OrderList'
import
OrderDetail
from
'./views/orderList/OrderDetail'
...
...
@@ -64,6 +65,11 @@ export default new Router({
component
:
CookList
},
{
path
:
'cookAdd'
,
name
:
'cookAdd'
,
component
:
CookAdd
},
{
path
:
'/cookDetail/:id'
,
name
:
'cookDetail'
,
component
:
CookDetail
...
...
src/views/cookManage/CookAdd.vue
0 → 100644
View file @
36ace9dc
<
template
>
<div
class=
"cook-detail"
>
<p
class=
"my_title"
>
<em>
请填写厨师信息
</em>
</p>
<div
class=
"cook_infor"
>
<el-row>
<el-form
label-width=
"110px"
:model=
"addForm"
>
<el-col
:span=
"18"
class=
"mt30"
>
<el-form-item
label=
"头像:"
:rules=
"
{required: true}">
<el-upload
class=
"avatar-uploader"
action=
"http://47.94.209.240:8088/file/fileUpload"
:show-file-list=
"false"
:on-success=
"handleAvatarSuccess"
>
<!-- :before-upload="beforeAvatarUpload" -->
<img
v-if=
"imageUrl"
:src=
"imageUrl"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
</el-col>
<el-col
:span=
"15"
>
<el-form-item
label=
"厨师名称:"
:rules=
"
{required: true}">
<el-input
v-model=
"addForm.name"
placeholder=
"请输入厨师名称"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"15"
>
<el-form-item
label=
"电话:"
:rules=
"
{required: true}">
<el-input
v-model=
"addForm.phone"
placeholder=
"请输入电话"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"15"
>
<el-form-item
label=
"菜系:"
:rules=
"
{required: true}">
<el-input
v-model=
"addForm.cuisine"
placeholder=
"请输入菜系"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"15"
>
<el-form-item
label=
"类型:"
:rules=
"
{required: true}">
<el-radio
v-model=
"addForm.type"
label=
"1"
>
面点
</el-radio>
<el-radio
v-model=
"addForm.type"
label=
"2"
>
热炒
</el-radio>
<el-radio
v-model=
"addForm.type"
label=
"3"
>
冷菜
</el-radio>
</el-form-item>
</el-col>
<el-col
:span=
"15"
>
<el-form-item
label=
"拿手菜:"
:rules=
"
{required: true}">
<el-input
v-model=
"addForm.food"
placeholder=
"请输入拿手菜"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"15"
>
<el-form-item
label=
"可预约:"
:rules=
"
{required: true}">
<el-switch
v-model=
"addForm.status"
></el-switch>
</el-form-item>
</el-col>
<el-col
:sm=
"20"
>
<el-form-item
label=
"预约时间"
>
<el-col
:sm=
"11"
>
<el-form-item
prop=
"date1"
>
<el-date-picker
v-model=
"addForm.starDate"
type=
"datetime"
placeholder=
"开始时间"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col
class=
"line"
:sm=
"2"
style=
"text-align: center"
>
-
</el-col>
<el-col
:sm=
"11"
>
<el-form-item
prop=
"date2"
>
<el-date-picker
v-model=
"addForm.endDate"
type=
"datetime"
placeholder=
"结束时间"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-form-item>
</el-col>
<el-col
:span=
"15"
>
<el-form-item
label=
"排序号:"
:rules=
"
{required: true}">
<el-input
type=
"number"
v-model=
"addForm.num"
placeholder=
"请输入排序号"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"15"
>
<el-form-item
label=
"备注:"
:rules=
"
{required: true}">
<el-input
v-model=
"addForm.message"
placeholder=
"请输入备注"
></el-input>
</el-form-item>
</el-col>
</el-form>
</el-row>
<el-row
style=
"text-align: center; padding-top: 50px"
>
<el-button
type=
"primary"
@
click=
"saveBtn"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"goBack"
plain
>
取消
</el-button>
</el-row>
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
'cookDetail'
,
data
()
{
return
{
addForm
:
{
},
imageUrl
:
''
}
},
created
(){
if
(
this
.
$route
.
params
.
id
)
{
this
.
getData
()
}
},
methods
:
{
getData
()
{
this
.
$axios
.
get
(
'/pccook/get/'
+
this
.
$route
.
params
.
id
).
then
((
res
)
=>
{
this
.
addForm
=
res
.
data
.
data
this
.
imageUrl
=
this
.
addForm
.
url
res
.
data
.
data
.
status
==
'Y'
?
this
.
addForm
.
status
=
true
:
this
.
addForm
.
status
=
false
})
},
saveBtn
()
{
var
param
=
this
.
addForm
if
(
this
.
$route
.
params
.
id
)
{
param
.
status
?
param
.
status
=
'Y'
:
param
.
status
=
'N'
this
.
$axios
.
post
(
'/pccook/update/cook'
,
param
).
then
(()
=>
{
this
.
$message
.
success
(
'修改成功'
)
this
.
goBack
()
})
}
else
{
param
.
id
=
0
this
.
$axios
.
post
(
'/pccook/add/cook'
,
param
).
then
(()
=>
{
this
.
$message
.
success
(
'新增成功'
)
this
.
goBack
()
})
}
},
handleAvatarSuccess
(
res
,
file
)
{
this
.
addForm
.
url
=
res
.
data
this
.
imageUrl
=
URL
.
createObjectURL
(
file
.
raw
);
},
goBack
()
{
this
.
$router
.
go
(
-
1
)
}
}
}
</
script
>
<
style
scoped
lang=
"less"
>
.cook-detail
{
width
:
100%
;
//
height
:
calc
(
100%
-
34px
);
background-color
:
#ffffff
;
padding
:
30px
40px
;
box-sizing
:
border-box
;
.my_title
{
margin-bottom
:
45px
}
.cook_infor
{
font-size
:
16px
;
padding-left
:
30px
;
padding-right
:
70px
;
.el-row
{
margin-bottom
:
24px
;
span
{
color
:
#333333
}
.col_rt
{
color
:
#666666
}
}
}
}
</
style
>
src/views/cookManage/CookDetail.vue
View file @
36ace9dc
...
...
@@ -5,40 +5,40 @@
</p>
<div
class=
"cook_infor"
>
<el-row>
<el-col
:span=
"
2
"
><span>
厨师名称:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
顾晓亮
</div></el-col>
<el-col
:span=
"
3
"
><span>
厨师名称:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
{{
cookData
.
name
}}
</div></el-col>
</el-row>
<el-row>
<el-col
:span=
"
2
"
><span>
电话:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
13581782261
</div></el-col>
<el-col
:span=
"
3
"
><span>
电话:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
{{
cookData
.
phone
}}
</div></el-col>
</el-row>
<el-row>
<el-col
:span=
"
2
"
><span>
菜系:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
粤菜、川菜、东北菜、本帮菜、客家菜、京菜、清真菜
</div></el-col>
<el-col
:span=
"
3
"
><span>
菜系:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
{{
cookData
.
cuisine
}}
</div></el-col>
</el-row>
<el-row>
<el-col
:span=
"
2
"
><span>
类型:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
面点/冷菜
</div></el-col>
<el-col
:span=
"
3
"
><span>
类型:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
{{
cookData
.
type
}}
</div></el-col>
</el-row>
<el-row>
<el-col
:span=
"
2
"
><span>
拿手菜:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
佛跳墙、秘制酱肘花、水果拼盘
</div></el-col>
<el-col
:span=
"
3
"
><span>
拿手菜:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
{{
cookData
.
food
}}
</div></el-col>
</el-row>
<el-row>
<el-col
:span=
"
2
"
><span>
可预约:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
是
</div></el-col>
<el-col
:span=
"
3
"
><span>
可预约:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
{{
cookData
.
status
==
'Y'
?
'是'
:
'否'
}}
</div></el-col>
</el-row>
<el-row>
<el-col
:span=
"
2
"
><span>
预约时间:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
06-05 12:00 ~ 06-08 22:00
</div></el-col>
<el-col
:span=
"
3
"
><span>
预约时间:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
{{
cookData
.
starDate
}}
~
{{
cookData
.
endDate
}}
</div></el-col>
</el-row>
<el-row>
<el-col
:span=
"
2
"
><span>
排序号:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
12
</div></el-col>
<el-col
:span=
"
3
"
><span>
排序号:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
{{
cookData
.
num
}}
</div></el-col>
</el-row>
<el-row>
<el-col
:span=
"
2
"
><span>
备注:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
自行买菜
</div></el-col>
<el-col
:span=
"
3
"
><span>
备注:
</span></el-col>
<el-col
:span=
"10"
><div
class=
"col_rt"
>
{{
cookData
.
message
}}
</div></el-col>
</el-row>
<el-row
style=
"text-align: center; padding-top: 150px"
>
<el-col
:span=
"24"
><el-button
type=
"primary"
@
click=
"goBack"
>
返回
</el-button></el-col>
...
...
@@ -50,7 +50,20 @@
<
script
>
export
default
{
name
:
'cookDetail'
,
data
()
{
return
{
cookData
:
{}
}
},
created
(){
this
.
getData
()
},
methods
:
{
getData
()
{
this
.
$axios
.
get
(
'/pccook/get/'
+
this
.
$route
.
params
.
id
).
then
((
res
)
=>
{
this
.
cookData
=
res
.
data
.
data
})
},
goBack
()
{
this
.
$router
.
go
(
-
1
)
}
...
...
@@ -61,12 +74,12 @@ export default {
<
style
scoped
lang=
"less"
>
.cook-detail
{
width
:
100%
;
height
:
calc
(
100%
-
34px
);
//
height
:
calc
(
100%
-
34px
);
background-color
:
#ffffff
;
padding
:
30px
40px
;
box-sizing
:
border-box
;
.my_title
{
margin-bottom
:
45px
}
.cook_infor
{
font-size
:
16px
;
padding-left
:
7
0px
;
padding-right
:
70px
;
.cook_infor
{
font-size
:
16px
;
padding-left
:
3
0px
;
padding-right
:
70px
;
.el-row
{
margin-bottom
:
24px
;
span
{
color
:
#333333
}
.col_rt
{
color
:
#666666
}
...
...
src/views/cookManage/CookList.vue
View file @
36ace9dc
...
...
@@ -10,72 +10,77 @@
</el-form-item>
<el-form-item
label=
"预约"
>
<el-select
v-model=
"formInline.status"
>
<el-option
label=
"是"
value=
"
是
"
></el-option>
<el-option
label=
"否"
value=
"
否
"
></el-option>
<el-option
label=
"是"
value=
"
true
"
></el-option>
<el-option
label=
"否"
value=
"
false
"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"onSubmit"
size=
"small"
>
搜索
</el-button>
<el-button
class=
"searchButton"
type=
"primary"
@
click=
"onSubmit"
size=
"small"
>
搜索
</el-button>
</el-form-item>
</el-form>
</div>
<div
class=
"main_table"
>
<p
class=
"my_title"
>
<em>
厨师信息
</em>
<el-button
type=
"primary"
plain
class=
"btn-search"
size=
"small"
>
新增
</el-button>
<el-button
type=
"primary"
plain
class=
"btn-search"
@
click=
"add"
size=
"small"
>
新增
</el-button>
</p>
<el-table
:data=
"data"
stripe
class=
"my-table"
@
row-click=
"handleRowChange"
:header-cell-style=
"
{background:'#f0fafe',color:'#333333'}"
:header-row-style="{height: '60px'}"
style="width: 100%">
<el-table-column
prop=
"name"
label=
"厨师姓名"
align=
"center"
>
<template
slot-scope=
"scope"
>
<router-link
:to=
"
{name: 'cookDetail', params: {id: scope.row.id}}"
class="buttonText">厨师姓名
</router-link>
</
template
>
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"c
ookNam
e"
prop=
"c
uisin
e"
label=
"菜系"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"
cookType
"
prop=
"
food
"
align=
"center"
label=
"类型"
>
</el-table-column>
<el-table-column
prop=
"
isYu
"
prop=
"
status
"
align=
"center"
label=
"是否可预约"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
status
==
'Y'
?
'是'
:
'否'
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"
dateTim
e"
prop=
"
starDat
e"
align=
"center"
label=
"预约时间"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
starDate
}}
~
{{
scope
.
row
.
endDate
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
>
<a
href=
"javascript:;"
class=
"btn_edit"
>
编辑
</a>
<a
href=
"javascript:;"
class=
"btn_delete"
>
删除
</a>
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<a
href=
"javascript:;"
@
click=
"goEdit(scope.row.id, $event)"
class=
"btn_edit"
>
编辑
</a>
<a
href=
"javascript:;"
@
click=
"goDelete"
class=
"btn_delete"
>
删除
</a>
</
template
>
</el-table-column>
</el-table>
<div
class=
"pagination_box"
>
<el-button
icon=
"el-icon-arrow-left"
size=
"mini"
></el-button>
<div
class=
"page_num"
><span>
2
</span>
/
<span>
7
</span></div>
<el-button
icon=
"el-icon-arrow-right"
size=
"mini"
></el-button>
<input
type=
"text"
class=
"page_search"
>
<el-button
type=
"primary"
size=
"mini"
>
跳转
</el-button>
<div
class=
"pagination_box"
v-if=
"data && data.length"
>
<el-button
icon=
"el-icon-arrow-left"
size=
"mini"
@
click=
"goPage(-1)"
v-if=
"allPage > 1"
></el-button>
<el-button
icon=
"el-icon-arrow-left"
size=
"mini"
disabled
v-if=
"allPage === 1"
></el-button>
<div
class=
"page_num"
><span>
{{page}}
</span>
/
<span>
{{countPage}}
</span></div>
<el-button
icon=
"el-icon-arrow-right"
size=
"mini"
@
click=
"goPage(1)"
v-if=
"allPage !== countPage"
></el-button>
<el-button
icon=
"el-icon-arrow-right"
size=
"mini"
disabled
v-if=
"allPage === countPage"
></el-button>
<input
type=
"text"
class=
"page_search"
v-model=
"allPage"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"goToPage"
>
跳转
</el-button>
</div>
</div>
</div>
...
...
@@ -105,6 +110,27 @@ export default {
onSubmit
()
{
console
.
log
(
'submit!'
)
},
add
()
{
this
.
$router
.
push
({
name
:
'cookAdd'
,
params
:
{}})
},
goEdit
(
id
,
e
)
{
e
.
stopPropagation
()
this
.
$router
.
push
({
name
:
'cookAdd'
,
params
:
{
id
:
id
}})
},
goDelete
(
e
)
{
e
.
stopPropagation
()
this
.
$confirm
(
'提示'
,
'确认删除此条信息?'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
}).
catch
(()
=>
{
})
},
getList
()
{
let
parms
=
{
"name"
:
this
.
formInline
.
name
,
...
...
@@ -122,6 +148,9 @@ export default {
console
.
log
(
res
.
data
)
})
},
handleRowChange
(
row
,
event
,
column
)
{
this
.
$router
.
push
(
'/cookDetail/'
+
row
.
id
)
},
searchList
()
{
this
.
getOrderList
()
},
...
...
@@ -137,4 +166,7 @@ export default {
</
script
>
<
style
scoped
lang=
"less"
>
.searchButton
{
margin-top
:
43px
;
}
</
style
>
src/views/orderList/OrderList.vue
View file @
36ace9dc
...
...
@@ -4,7 +4,7 @@
<el-breadcrumb
separator-class=
"el-icon-arrow-right"
>
<el-breadcrumb-item>
您当前的位置为:
</el-breadcrumb-item>
<el-breadcrumb-item>
菜单管理
</el-breadcrumb-item>
<el-breadcrumb-item
:to=
"
{ path: '/tab/cookList' }"
>订单管理
</el-breadcrumb-item>
<el-breadcrumb-item>
订单管理
</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div
class=
"order-list"
>
...
...
@@ -233,6 +233,9 @@ export default {
this
.
getOrderList
()
},
methods
:
{
save
()
{
},
onSubmit
()
{
alert
(
1
)
},
...
...
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