Commit 4edd7cc0 by duanguohui

添加花卉绿植管理

parent 1c5e1206
......@@ -19,9 +19,9 @@
<template slot="title"><i class="icon"><img src="../assets/img/icon/ico3.png" alt=""></i>菜单管理</template>
<el-menu-item-group>
<el-menu-item index="/tab/bannerList">banner管理</el-menu-item>
<!-- <el-menu-item index="/tab/defaultPage/2">外卖管理</el-menu-item> -->
<el-menu-item index="/tab/cookbook">菜谱管理</el-menu-item>
<el-menu-item index="/tab/cookList">厨师管理</el-menu-item>
<el-menu-item index="/tab/flowerList">花卉绿植管理</el-menu-item>
<el-menu-item index="/tab/orderList">订单管理</el-menu-item>
</el-menu-item-group>
</el-submenu>
......
......@@ -6,6 +6,9 @@ import Layout from './components/Layout'
import CookList from './views/cookManage/CookList'
import CookAdd from './views/cookManage/CookAdd'
import CookDetail from './views/cookManage/CookDetail'
import flowerList from './views/flowerManage/flowerList'
import flowerAdd from './views/flowerManage/flowerAdd'
import flowerDetail from './views/flowerManage/flowerDetail'
import OrderList from './views/orderList/OrderList'
import OrderDetail from './views/orderList/OrderDetail'
import DefaultPage from './views/DefaultPage'
......@@ -75,6 +78,21 @@ export default new Router({
component: CookDetail
},
{
path: 'flowerList',
name: 'flowerList',
component: flowerList
},
{
path: 'flowerAdd',
name: 'flowerAdd',
component: flowerAdd
},
{
path: '/flowerDetail/:id',
name: 'flowerDetail',
component: flowerDetail
},
{
path: 'orderList',
name: 'orderList',
component: OrderList
......
<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="$ImageUploadUrl"
: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="面点">面点</el-radio>
<el-radio v-model="addForm.type" label="热炒">热炒</el-radio>
<el-radio v-model="addForm.type" label="冷菜">冷菜</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>
import moment from 'moment'
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) {
delete param.createDate
param.status ? param.status = 'Y' : param.status = 'N'
param.starDate = moment(param.starDate).format('YYYY-MM-DD HH:MM:SS')
param.endDate = moment(param.endDate).format('YYYY-MM-DD HH:MM:SS')
this.$axios.post('/pccook/update/cook', param).then(()=>{
this.$message.success('修改成功')
this.goBack()
})
} else {
param.id = 0
param.status ? param.status = 'Y' : param.status = 'N'
param.starDate = moment(param.starDate).format('YYYY-MM-DD HH:MM:SS')
param.endDate = moment(param.endDate).format('YYYY-MM-DD HH:MM:SS')
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>
<template>
<div class="cook-detail">
<p class="my_title">
<em>厨师信息</em>
</p>
<div class="cook_infor">
<el-row>
<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="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="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="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="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="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="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="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="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>
</el-row>
</div>
</div>
</template>
<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)
}
}
}
</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>
<template>
<div>
<div class="breadcrumb-box" style="margin-bottom: 20px">
<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>
</div>
<div class="cook-list">
<div class="cook_top">
<el-form :inline="true" :model="formInline" class="demo-form-inline" label-width="60px" label-position="left">
<el-form-item label="姓名">
<el-input v-model="formInline.name" placeholder="姓名"></el-input>
</el-form-item>
<el-form-item label="手机号">
<el-input v-model="formInline.phone" placeholder="手机号"></el-input>
</el-form-item>
<el-form-item label="预约">
<el-select v-model="formInline.status">
<el-option label="是" value="true"></el-option>
<el-option label="否" value="false"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<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" @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">
</el-table-column>
<el-table-column
prop="cuisine"
label="菜系"
align="center"
>
</el-table-column>
<el-table-column
prop="food"
align="center"
label="类型">
</el-table-column>
<el-table-column
prop="status"
align="center"
label="是否可预约">
<template slot-scope="scope">
<span>{{scope.row.status == 'Y' ? '是' : '否'}}</span>
</template>
</el-table-column>
<el-table-column
prop="starDate"
align="center"
label="预约时间">
<template slot-scope="scope">
<span v-if="scope.row.status == 'Y'">{{scope.row.starDate}} ~ {{scope.row.endDate}}</span>
</template>
</el-table-column>
<el-table-column
align="center"
label="操作">
<template slot-scope="scope">
<a href="javascript:;" @click="goEdit(scope.row.id, $event)" class="btn_edit">编辑</a>
<a href="javascript:;" @click="goDelete(scope.row.id, $event)" class="btn_delete">删除</a>
</template>
</el-table-column>
</el-table>
<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>
</div>
</template>
<script>
export default {
name: 'cookList',
data () {
return {
formInline: {
name: '',
phone: '',
status: ''
},
allPage: 1,
currentPage: 10,
countPage: '',
page: '',
data: []
}
},
created () {
this.getList()
},
methods: {
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 (id, e) {
e.stopPropagation()
this.$confirm('提示', '确认删除此条信息?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$axios({
method: 'get',
url: '/pccook/delete/' + id,
}).then((res) => {
this.getList()
})
}).catch(() => {
})
},
getList () {
let parms = {
"name": this.formInline.name,
"phone": this.formInline.phone,
"status": this.formInline.status
}
this.$axios({
method: 'post',
url: '/pccook/get/list?p=' + this.allPage + '&c=' + this.currentPage,
data: parms
}).then((res) => {
this.data = res.data.data.resultList
this.countPage = res.data.data.countPage
this.page = res.data.data.page
console.log(res.data)
})
},
handleRowChange (row, event, column) {
this.$router.push('/cookDetail/' + row.id)
},
searchList () {
this.getOrderList()
},
goPage (num) {
this.allPage = Number(this.allPage) + num
this.getOrderList()
},
goToPage () {
this.getOrderList()
},
}
}
</script>
<style scoped lang="less">
.searchButton{
margin-top: 43px;
}
</style>
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