Commit 36ace9dc by duanguohui

厨师

parent 4f041eaa
...@@ -4,6 +4,7 @@ import Login from './views/Login.vue' ...@@ -4,6 +4,7 @@ import Login from './views/Login.vue'
import Layout from './components/Layout' import Layout from './components/Layout'
import CookList from './views/cookManage/CookList' import CookList from './views/cookManage/CookList'
import CookAdd from './views/cookManage/CookAdd'
import CookDetail from './views/cookManage/CookDetail' import CookDetail from './views/cookManage/CookDetail'
import OrderList from './views/orderList/OrderList' import OrderList from './views/orderList/OrderList'
import OrderDetail from './views/orderList/OrderDetail' import OrderDetail from './views/orderList/OrderDetail'
...@@ -64,6 +65,11 @@ export default new Router({ ...@@ -64,6 +65,11 @@ export default new Router({
component: CookList component: CookList
}, },
{ {
path: 'cookAdd',
name: 'cookAdd',
component: CookAdd
},
{
path: '/cookDetail/:id', path: '/cookDetail/:id',
name: 'cookDetail', name: 'cookDetail',
component: CookDetail component: CookDetail
......
<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>
...@@ -5,40 +5,40 @@ ...@@ -5,40 +5,40 @@
</p> </p>
<div class="cook_infor"> <div class="cook_infor">
<el-row> <el-row>
<el-col :span="2"><span>厨师名称:</span></el-col> <el-col :span="3"><span>厨师名称:</span></el-col>
<el-col :span="10"><div class="col_rt">顾晓亮</div></el-col> <el-col :span="10"><div class="col_rt">{{cookData.name}}</div></el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="2"><span>电话:</span></el-col> <el-col :span="3"><span>电话:</span></el-col>
<el-col :span="10"><div class="col_rt">13581782261</div></el-col> <el-col :span="10"><div class="col_rt">{{cookData.phone}}</div></el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="2"><span>菜系:</span></el-col> <el-col :span="3"><span>菜系:</span></el-col>
<el-col :span="10"><div class="col_rt">粤菜、川菜、东北菜、本帮菜、客家菜、京菜、清真菜</div></el-col> <el-col :span="10"><div class="col_rt">{{cookData.cuisine}}</div></el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="2"><span>类型:</span></el-col> <el-col :span="3"><span>类型:</span></el-col>
<el-col :span="10"><div class="col_rt">面点/冷菜</div></el-col> <el-col :span="10"><div class="col_rt">{{cookData.type}}</div></el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="2"><span>拿手菜:</span></el-col> <el-col :span="3"><span>拿手菜:</span></el-col>
<el-col :span="10"><div class="col_rt">佛跳墙、秘制酱肘花、水果拼盘</div></el-col> <el-col :span="10"><div class="col_rt">{{cookData.food}}</div></el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="2"><span>可预约:</span></el-col> <el-col :span="3"><span>可预约:</span></el-col>
<el-col :span="10"><div class="col_rt"></div></el-col> <el-col :span="10"><div class="col_rt">{{cookData.status == 'Y' ? '是' : '否'}}</div></el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="2"><span>预约时间:</span></el-col> <el-col :span="3"><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="10"><div class="col_rt">{{cookData.starDate}} ~ {{cookData.endDate}}</div></el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="2"><span>排序号:</span></el-col> <el-col :span="3"><span>排序号:</span></el-col>
<el-col :span="10"><div class="col_rt">12</div></el-col> <el-col :span="10"><div class="col_rt">{{cookData.num}}</div></el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="2"><span>备注:</span></el-col> <el-col :span="3"><span>备注:</span></el-col>
<el-col :span="10"><div class="col_rt">自行买菜</div></el-col> <el-col :span="10"><div class="col_rt">{{cookData.message}}</div></el-col>
</el-row> </el-row>
<el-row style="text-align: center; padding-top: 150px"> <el-row style="text-align: center; padding-top: 150px">
<el-col :span="24"><el-button type="primary" @click="goBack">返回</el-button></el-col> <el-col :span="24"><el-button type="primary" @click="goBack">返回</el-button></el-col>
...@@ -50,7 +50,20 @@ ...@@ -50,7 +50,20 @@
<script> <script>
export default { export default {
name: 'cookDetail', name: 'cookDetail',
data () {
return {
cookData: {}
}
},
created (){
this.getData()
},
methods: { methods: {
getData () {
this.$axios.get('/pccook/get/' + this.$route.params.id).then((res)=>{
this.cookData = res.data.data
})
},
goBack () { goBack () {
this.$router.go(-1) this.$router.go(-1)
} }
...@@ -61,12 +74,12 @@ export default { ...@@ -61,12 +74,12 @@ export default {
<style scoped lang="less"> <style scoped lang="less">
.cook-detail { .cook-detail {
width: 100%; width: 100%;
height: calc(100% - 34px); // height: calc(100% - 34px);
background-color: #ffffff; background-color: #ffffff;
padding: 30px 40px; padding: 30px 40px;
box-sizing: border-box; box-sizing: border-box;
.my_title {margin-bottom: 45px} .my_title {margin-bottom: 45px}
.cook_infor {font-size: 16px; padding-left: 70px; padding-right: 70px; .cook_infor {font-size: 16px; padding-left: 30px; padding-right: 70px;
.el-row {margin-bottom: 24px; .el-row {margin-bottom: 24px;
span {color: #333333} span {color: #333333}
.col_rt {color: #666666} .col_rt {color: #666666}
......
...@@ -10,72 +10,77 @@ ...@@ -10,72 +10,77 @@
</el-form-item> </el-form-item>
<el-form-item label="预约"> <el-form-item label="预约">
<el-select v-model="formInline.status"> <el-select v-model="formInline.status">
<el-option label="是" value=""></el-option> <el-option label="是" value="true"></el-option>
<el-option label="否" value=""></el-option> <el-option label="否" value="false"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<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-item>
</el-form> </el-form>
</div> </div>
<div class="main_table"> <div class="main_table">
<p class="my_title"> <p class="my_title">
<em>厨师信息</em> <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> </p>
<el-table <el-table
:data="data" :data="data"
stripe stripe
class="my-table" class="my-table"
@row-click="handleRowChange"
:header-cell-style="{background:'#f0fafe',color:'#333333'}" :header-cell-style="{background:'#f0fafe',color:'#333333'}"
:header-row-style="{height: '60px'}" :header-row-style="{height: '60px'}"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
prop="name" prop="name"
label="厨师姓名" label="厨师姓名"
align="center" align="center">
>
<template slot-scope="scope">
<router-link :to="{name: 'cookDetail', params: {id: scope.row.id}}"
class="buttonText">厨师姓名</router-link>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="cookName" prop="cuisine"
label="菜系" label="菜系"
align="center" align="center"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="cookType" prop="food"
align="center" align="center"
label="类型"> label="类型">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="isYu" prop="status"
align="center" align="center"
label="是否可预约"> label="是否可预约">
<template slot-scope="scope">
<span>{{scope.row.status == 'Y' ? '是' : '否'}}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="dateTime" prop="starDate"
align="center" align="center"
label="预约时间"> label="预约时间">
<template slot-scope="scope">
<span>{{scope.row.starDate}} ~ {{scope.row.endDate}}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
label="操作" label="操作">
> <template slot-scope="scope">
<a href="javascript:;" class="btn_edit">编辑</a> <a href="javascript:;" @click="goEdit(scope.row.id, $event)" class="btn_edit">编辑</a>
<a href="javascript:;" class="btn_delete">删除</a> <a href="javascript:;" @click="goDelete" class="btn_delete">删除</a>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination_box"> <div class="pagination_box" v-if="data && data.length">
<el-button icon="el-icon-arrow-left" size="mini"></el-button> <el-button icon="el-icon-arrow-left" size="mini" @click="goPage(-1)" v-if="allPage > 1"></el-button>
<div class="page_num"><span>2</span> / <span>7</span></div> <el-button icon="el-icon-arrow-left" size="mini" disabled v-if="allPage === 1"></el-button>
<el-button icon="el-icon-arrow-right" size="mini"></el-button> <div class="page_num"><span>{{page}}</span> / <span>{{countPage}}</span></div>
<input type="text" class="page_search"> <el-button icon="el-icon-arrow-right" size="mini" @click="goPage(1)" v-if="allPage !== countPage"></el-button>
<el-button type="primary" size="mini">跳转</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> </div>
</div> </div>
...@@ -105,6 +110,27 @@ export default { ...@@ -105,6 +110,27 @@ export default {
onSubmit () { onSubmit () {
console.log('submit!') 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 () { getList () {
let parms = { let parms = {
"name": this.formInline.name, "name": this.formInline.name,
...@@ -122,6 +148,9 @@ export default { ...@@ -122,6 +148,9 @@ export default {
console.log(res.data) console.log(res.data)
}) })
}, },
handleRowChange (row, event, column) {
this.$router.push('/cookDetail/' + row.id)
},
searchList () { searchList () {
this.getOrderList() this.getOrderList()
}, },
...@@ -137,4 +166,7 @@ export default { ...@@ -137,4 +166,7 @@ export default {
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.searchButton{
margin-top: 43px;
}
</style> </style>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<el-breadcrumb separator-class="el-icon-arrow-right"> <el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item>您当前的位置为:</el-breadcrumb-item> <el-breadcrumb-item>您当前的位置为:</el-breadcrumb-item>
<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> </el-breadcrumb>
</div> </div>
<div class="order-list"> <div class="order-list">
...@@ -233,6 +233,9 @@ export default { ...@@ -233,6 +233,9 @@ export default {
this.getOrderList() this.getOrderList()
}, },
methods: { methods: {
save () {
},
onSubmit () { onSubmit () {
alert(1) alert(1)
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment