Commit 5dc4b6bc by duanguohui

超市管理

parent 4edd7cc0
...@@ -2873,8 +2873,7 @@ ...@@ -2873,8 +2873,7 @@
"version": "4.6.0", "version": "4.6.0",
"resolved": "https://registry.npm.taobao.org/co/download/co-4.6.0.tgz", "resolved": "https://registry.npm.taobao.org/co/download/co-4.6.0.tgz",
"integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=",
"dev": true, "dev": true
"optional": true
}, },
"coa": { "coa": {
"version": "2.0.2", "version": "2.0.2",
...@@ -3674,8 +3673,7 @@ ...@@ -3674,8 +3673,7 @@
"deep-equal": { "deep-equal": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/deep-equal/download/deep-equal-1.0.1.tgz", "resolved": "https://registry.npm.taobao.org/deep-equal/download/deep-equal-1.0.1.tgz",
"integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU="
"dev": true
}, },
"deep-is": { "deep-is": {
"version": "0.1.3", "version": "0.1.3",
...@@ -4858,8 +4856,7 @@ ...@@ -4858,8 +4856,7 @@
"extend": { "extend": {
"version": "3.0.2", "version": "3.0.2",
"resolved": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz", "resolved": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz",
"integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=", "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo="
"dev": true
}, },
"extend-shallow": { "extend-shallow": {
"version": "3.0.2", "version": "3.0.2",
...@@ -4971,6 +4968,11 @@ ...@@ -4971,6 +4968,11 @@
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
"dev": true "dev": true
}, },
"fast-diff": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/fast-diff/download/fast-diff-1.1.2.tgz",
"integrity": "sha1-S2LEK44D3j+EhGC2OQeZIGldAVQ="
},
"fast-glob": { "fast-glob": {
"version": "2.2.7", "version": "2.2.7",
"resolved": "https://registry.npm.taobao.org/fast-glob/download/fast-glob-2.2.7.tgz", "resolved": "https://registry.npm.taobao.org/fast-glob/download/fast-glob-2.2.7.tgz",
...@@ -5312,8 +5314,7 @@ ...@@ -5312,8 +5314,7 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
...@@ -5334,14 +5335,12 @@ ...@@ -5334,14 +5335,12 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
...@@ -5356,20 +5355,17 @@ ...@@ -5356,20 +5355,17 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
...@@ -5486,8 +5482,7 @@ ...@@ -5486,8 +5482,7 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
...@@ -5499,7 +5494,6 @@ ...@@ -5499,7 +5494,6 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
...@@ -5514,7 +5508,6 @@ ...@@ -5514,7 +5508,6 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
...@@ -5522,14 +5515,12 @@ ...@@ -5522,14 +5515,12 @@
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
...@@ -5548,7 +5539,6 @@ ...@@ -5548,7 +5539,6 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
...@@ -5629,8 +5619,7 @@ ...@@ -5629,8 +5619,7 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
...@@ -5642,7 +5631,6 @@ ...@@ -5642,7 +5631,6 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
...@@ -5728,8 +5716,7 @@ ...@@ -5728,8 +5716,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
...@@ -5765,7 +5752,6 @@ ...@@ -5765,7 +5752,6 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
...@@ -5785,7 +5771,6 @@ ...@@ -5785,7 +5771,6 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
...@@ -5829,14 +5814,12 @@ ...@@ -5829,14 +5814,12 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
} }
} }
}, },
...@@ -7882,8 +7865,7 @@ ...@@ -7882,8 +7865,7 @@
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npm.taobao.org/object-assign/download/object-assign-4.1.1.tgz", "resolved": "https://registry.npm.taobao.org/object-assign/download/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
"dev": true
}, },
"object-copy": { "object-copy": {
"version": "0.1.0", "version": "0.1.0",
...@@ -8186,6 +8168,11 @@ ...@@ -8186,6 +8168,11 @@
"no-case": "^2.2.0" "no-case": "^2.2.0"
} }
}, },
"parchment": {
"version": "1.1.4",
"resolved": "https://registry.npm.taobao.org/parchment/download/parchment-1.1.4.tgz",
"integrity": "sha1-rt7Xq5OP6SHUw0vDOc4RaLwv/eU="
},
"parent-module": { "parent-module": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/parent-module/download/parent-module-1.0.1.tgz", "resolved": "https://registry.npm.taobao.org/parent-module/download/parent-module-1.0.1.tgz",
...@@ -9167,6 +9154,41 @@ ...@@ -9167,6 +9154,41 @@
"integrity": "sha1-YOWl/WSn+L+k0qsu1v30yFutFU4=", "integrity": "sha1-YOWl/WSn+L+k0qsu1v30yFutFU4=",
"dev": true "dev": true
}, },
"quill": {
"version": "1.3.6",
"resolved": "https://registry.npm.taobao.org/quill/download/quill-1.3.6.tgz",
"integrity": "sha1-mfTeH+6FkloNfUFjttgyjyMxek0=",
"requires": {
"clone": "^2.1.1",
"deep-equal": "^1.0.1",
"eventemitter3": "^2.0.3",
"extend": "^3.0.1",
"parchment": "^1.1.4",
"quill-delta": "^3.6.2"
},
"dependencies": {
"clone": {
"version": "2.1.2",
"resolved": "https://registry.npm.taobao.org/clone/download/clone-2.1.2.tgz",
"integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18="
},
"eventemitter3": {
"version": "2.0.3",
"resolved": "https://registry.npm.taobao.org/eventemitter3/download/eventemitter3-2.0.3.tgz",
"integrity": "sha1-teEHm1n7XhuidxwKmTvgYKWMmbo="
}
}
},
"quill-delta": {
"version": "3.6.3",
"resolved": "https://registry.npm.taobao.org/quill-delta/download/quill-delta-3.6.3.tgz",
"integrity": "sha1-sZ/SuJQSMBxg4f8hPY2GDqwPEDI=",
"requires": {
"deep-equal": "^1.0.1",
"extend": "^3.0.2",
"fast-diff": "1.1.2"
}
},
"randombytes": { "randombytes": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/randombytes/download/randombytes-2.1.0.tgz", "resolved": "https://registry.npm.taobao.org/randombytes/download/randombytes-2.1.0.tgz",
...@@ -9648,8 +9670,7 @@ ...@@ -9648,8 +9670,7 @@
"version": "4.0.8", "version": "4.0.8",
"resolved": "https://registry.npm.taobao.org/rx-lite/download/rx-lite-4.0.8.tgz", "resolved": "https://registry.npm.taobao.org/rx-lite/download/rx-lite-4.0.8.tgz",
"integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=",
"dev": true, "dev": true
"optional": true
}, },
"rx-lite-aggregates": { "rx-lite-aggregates": {
"version": "4.0.8", "version": "4.0.8",
...@@ -11301,6 +11322,15 @@ ...@@ -11301,6 +11322,15 @@
"vue-style-loader": "^4.1.0" "vue-style-loader": "^4.1.0"
} }
}, },
"vue-quill-editor": {
"version": "3.0.6",
"resolved": "https://registry.npm.taobao.org/vue-quill-editor/download/vue-quill-editor-3.0.6.tgz",
"integrity": "sha1-H4VkYhHWijGoCnLLf0W7LxGbyPs=",
"requires": {
"object-assign": "^4.1.1",
"quill": "^1.3.4"
}
},
"vue-router": { "vue-router": {
"version": "3.0.6", "version": "3.0.6",
"resolved": "https://registry.npm.taobao.org/vue-router/download/vue-router-3.0.6.tgz", "resolved": "https://registry.npm.taobao.org/vue-router/download/vue-router-3.0.6.tgz",
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
"element-ui": "^2.9.1", "element-ui": "^2.9.1",
"moment": "^2.24.0", "moment": "^2.24.0",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-quill-editor": "^3.0.6",
"vue-router": "^3.0.3", "vue-router": "^3.0.3",
"vuex": "^3.0.1" "vuex": "^3.0.1"
}, },
......
...@@ -8,6 +8,12 @@ import 'element-ui/lib/theme-chalk/index.css' ...@@ -8,6 +8,12 @@ import 'element-ui/lib/theme-chalk/index.css'
import '../src/assets/css/reset.css' import '../src/assets/css/reset.css'
import '../src/assets/css/function.less' import '../src/assets/css/function.less'
import '../src/assets/css/main.less' import '../src/assets/css/main.less'
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
// use
Vue.use(VueQuillEditor)
axios.defaults.baseURL = 'http://47.94.209.240:8088/' axios.defaults.baseURL = 'http://47.94.209.240:8088/'
// axios.defaults.baseURL = 'https://www.i-sirius.com/api/' // axios.defaults.baseURL = 'https://www.i-sirius.com/api/'
......
<template> <template>
<div class="cook-detail"> <div class="cook-detail">
<p class="my_title"> <p class="my_title">
<em>请填写厨师信息</em> <em>请编辑商品信息</em>
</p> </p>
<div class="cook_infor"> <div class="cook_infor">
<el-row> <el-row>
<el-form label-width="110px" :model="addForm"> <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-col :span="15">
<el-form-item label="厨师名称:" :rules="{required: true}"> <el-form-item label="花卉绿植名称:" :rules="{required: true}">
<el-input v-model="addForm.name" placeholder="请输入厨师名称"></el-input> <el-input v-model="addForm.name1" placeholder="请输入名称" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="15"> <!-- <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-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-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-form-item>
</el-col> </el-col> -->
<el-col :span="15"> <el-col :span="15">
<el-form-item label="拿手菜:" :rules="{required: true}"> <el-form-item label="价格:" :rules="{required: true}">
<el-input v-model="addForm.food" placeholder="请输入拿手菜"></el-input> <el-input v-model="addForm.marketPrice" placeholder="请输入价格" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="15"> <el-col :span="15">
<el-form-item label="可预约:" :rules="{required: true}"> <el-form-item label="库存:" :rules="{required: true}">
<el-switch v-model="addForm.status"></el-switch> <el-input value="0" placeholder="请输入库存" disabled></el-input>
</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-form-item>
</el-col> </el-col>
<el-col class="line" :sm="2" style="text-align: center">-</el-col> <el-col :span="15">
<el-col :sm="11"> <el-form-item label="标签:" :rules="{required: true}">
<el-form-item prop="date2"> <el-input v-model="addForm.name2" placeholder="请输入标签" disabled></el-input>
<el-date-picker v-model="addForm.endDate" type="datetime" placeholder="结束时间">
</el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<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"
>
<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-form-item>
</el-col> </el-col>
<el-col :span="15"> <el-col :span="15">
<el-form-item label="排序号:" :rules="{required: true}"> <el-form-item label="详情:">
<el-input type="number" v-model="addForm.num" placeholder="请输入排序号"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="15"> <el-col :span="24">
<el-form-item label="备注:" :rules="{required: true}"> <quill-editor
<el-input v-model="addForm.message" placeholder="请输入备注"></el-input> class="edit_class"
</el-form-item> v-model="addForm.sourceInfo"
ref="myQuillEditor"
@change="onEditorChange($event)">
</quill-editor>
</el-col> </el-col>
</el-form> </el-form>
</el-row> </el-row>
<el-row style="text-align: center; padding-top: 50px"> <el-row style="text-align: center; margin-top: 150px">
<el-button type="primary" @click="saveBtn">保存</el-button> <el-button type="primary" @click="saveBtn">保存</el-button>
<el-button type="primary" @click="goBack" plain>取消</el-button> <el-button type="primary" @click="goBack" plain>取消</el-button>
</el-row> </el-row>
...@@ -92,54 +72,46 @@ ...@@ -92,54 +72,46 @@
</template> </template>
<script> <script>
import moment from 'moment' import moment from 'moment'
import { quillEditor } from 'vue-quill-editor'
export default { export default {
name: 'cookDetail', name: 'cookDetail',
data () { data () {
return { return {
addForm: { addForm: {
}, },
imageUrl: '' imageUrl: ''
} }
}, },
created (){ created (){
if (this.$route.params.id) { this.addForm = this.$route.params.item
this.getData() this.imageUrl = this.$route.params.item.masterImg
} },
components: {
quillEditor
}, },
methods: { methods: {
getData () { onEditorChange ({ editor, html, text }) {
this.$axios.get('/pccook/get/' + this.$route.params.id).then((res)=>{ console.log('editor change!', editor, html, text)
this.addForm = res.data.data
this.imageUrl = this.addForm.url
res.data.data.status == 'Y' ? this.addForm.status = true : this.addForm.status = false
})
}, },
saveBtn () { saveBtn () {
var param = this.addForm var params = {
if (this.$route.params.id) { id: this.addForm.id,
delete param.createDate imgUrl: this.imageUrl,
param.status ? param.status = 'Y' : param.status = 'N' message: this.addForm.sourceInfo
param.starDate = moment(param.starDate).format('YYYY-MM-DD HH:MM:SS') }
param.endDate = moment(param.endDate).format('YYYY-MM-DD HH:MM:SS') if (!this.imageUrl || !this.addForm.sourceInfo) {
this.$axios.post('/pccook/update/cook', param).then(()=>{ this.$message.error('请填写完整信息')
this.$message.success('修改成功') return
this.goBack() }
}) this.$axios.post('/pcproduct/update/product', params).then(()=>{
} else { this.$message.success('编辑成功')
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() this.goBack()
}) })
}
}, },
handleAvatarSuccess(res, file) { handleAvatarSuccess(res, file) {
this.addForm.url = res.data this.imageUrl = res.data
this.imageUrl = URL.createObjectURL(file.raw); // console.log(res, file)
// this.imageUrl = URL.createObjectURL(file.raw);
}, },
goBack () { goBack () {
this.$router.go(-1) this.$router.go(-1)
...@@ -149,6 +121,11 @@ export default { ...@@ -149,6 +121,11 @@ export default {
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.edit_class{
margin-left: 100px;
height: 200px;
width: 100%;
}
.cook-detail { .cook-detail {
width: 100%; width: 100%;
// height: calc(100% - 34px); // height: calc(100% - 34px);
......
<template> <template>
<div class="cook-detail"> <div class="cook-detail">
<p class="my_title"> <p class="my_title">
<em>厨师信息</em> <em>商品信息</em>
</p> </p>
<div class="cook_infor"> <div class="cook_infor">
<el-row> <el-row>
<el-col :span="3"><span>厨师名称:</span></el-col> <el-form label-width="110px" :model="addForm">
<el-col :span="10"><div class="col_rt">{{cookData.name}}</div></el-col> <el-col :span="15">
</el-row> <el-form-item label="花卉绿植名称:" :rules="{required: true}">
<el-row> <el-input v-model="addForm.name1" placeholder="请输入名称" disabled></el-input>
<el-col :span="3"><span>电话:</span></el-col> </el-form-item>
<el-col :span="10"><div class="col_rt">{{cookData.phone}}</div></el-col> </el-col>
</el-row> <!-- <el-col :span="15">
<el-row> <el-form-item label="类型:" :rules="{required: true}">
<el-col :span="3"><span>菜系:</span></el-col> <el-radio v-model="addForm.type" label="面点">面点</el-radio>
<el-col :span="10"><div class="col_rt">{{cookData.cuisine}}</div></el-col> <el-radio v-model="addForm.type" label="热炒">热炒</el-radio>
</el-row> <el-radio v-model="addForm.type" label="冷菜">冷菜</el-radio>
<el-row> </el-form-item>
<el-col :span="3"><span>类型:</span></el-col> </el-col> -->
<el-col :span="10"><div class="col_rt">{{cookData.type}}</div></el-col> <el-col :span="15">
</el-row> <el-form-item label="价格:" :rules="{required: true}">
<el-row> <el-input v-model="addForm.marketPrice" placeholder="请输入价格" disabled></el-input>
<el-col :span="3"><span>拿手菜:</span></el-col> </el-form-item>
<el-col :span="10"><div class="col_rt">{{cookData.food}}</div></el-col> </el-col>
</el-row> <el-col :span="15">
<el-row> <el-form-item label="库存:" :rules="{required: true}">
<el-col :span="3"><span>可预约:</span></el-col> <el-input value="0" placeholder="请输入库存" disabled></el-input>
<el-col :span="10"><div class="col_rt">{{cookData.status == 'Y' ? '是' : '否'}}</div></el-col> </el-form-item>
</el-row> </el-col>
<el-row> <el-col :span="15">
<el-col :span="3"><span>预约时间:</span></el-col> <el-form-item label="标签:" :rules="{required: true}">
<el-col :span="10"><div class="col_rt">{{cookData.starDate}} ~ {{cookData.endDate}}</div></el-col> <el-input v-model="addForm.name2" placeholder="请输入标签" disabled></el-input>
</el-row> </el-form-item>
<el-row> </el-col>
<el-col :span="3"><span>排序号:</span></el-col> <el-col :span="18" class="mt30">
<el-col :span="10"><div class="col_rt">{{cookData.num}}</div></el-col> <el-form-item label="主图:" :rules="{required: true}">
</el-row> <el-upload
<el-row> class="avatar-uploader"
<el-col :span="3"><span>备注:</span></el-col> :action="$ImageUploadUrl"
<el-col :span="10"><div class="col_rt">{{cookData.message}}</div></el-col> :show-file-list="false"
:on-success="handleAvatarSuccess"
disabled
>
<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="详情:">
</el-form-item>
</el-col>
<el-col :span="24">
<div class="edit_class" v-html="addForm.description"></div>
</el-col>
</el-form>
</el-row> </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 style="text-align: center; margin-top: 50px">
<el-button type="primary" @click="saveBtn">保存</el-button>
<el-button type="primary" @click="goBack" plain>取消</el-button>
</el-row> </el-row>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import moment from 'moment'
import { quillEditor } from 'vue-quill-editor'
export default { export default {
name: 'cookDetail', name: 'cookDetail',
data () { data () {
return { return {
cookData: {} addForm: {
},
imageUrl: ''
} }
}, },
created (){ created (){
this.getData() this.addForm = this.$route.params.item
this.imageUrl = this.$route.params.item.masterImg
},
components: {
quillEditor
}, },
methods: { methods: {
getData () { onEditorChange ({ editor, html, text }) {
this.$axios.get('/pccook/get/' + this.$route.params.id).then((res)=>{ console.log('editor change!', editor, html, text)
this.cookData = res.data.data },
saveBtn () {
var params = {
id: this.addForm.id,
imgUrl: this.imageUrl,
message: this.addForm.sourceInfo
}
if (!this.imageUrl || !this.addForm.sourceInfo) {
this.$message.error('请填写完整信息')
return
}
this.$axios.post('/pcproduct/update/product', params).then(()=>{
this.$message.success('编辑成功')
// this.goBack()
}) })
}, },
handleAvatarSuccess(res, file) {
this.imageUrl = res.data
// console.log(res, file)
// this.imageUrl = URL.createObjectURL(file.raw);
},
goBack () { goBack () {
this.$router.go(-1) this.$router.go(-1)
} }
...@@ -72,6 +117,11 @@ export default { ...@@ -72,6 +117,11 @@ export default {
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.edit_class{
margin-left: 100px;
// height: 200px;
width: 100%;
}
.cook-detail { .cook-detail {
width: 100%; width: 100%;
// height: calc(100% - 34px); // height: calc(100% - 34px);
......
...@@ -10,27 +10,18 @@ ...@@ -10,27 +10,18 @@
<div class="cook-list"> <div class="cook-list">
<div class="cook_top"> <div class="cook_top">
<el-form :inline="true" :model="formInline" class="demo-form-inline" label-width="60px" label-position="left"> <el-form :inline="true" :model="formInline" class="demo-form-inline" label-width="60px" label-position="left">
<el-form-item label="姓名"> <el-form-item label="名称">
<el-input v-model="formInline.name" placeholder="姓名"></el-input> <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-form-item> <el-form-item>
<el-button class="searchButton" type="primary" @click="onSubmit" size="small">搜索</el-button> <el-button type="primary" @click="getList" 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" @click="add" 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"
...@@ -41,43 +32,31 @@ ...@@ -41,43 +32,31 @@
: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="name1"
label="厨师姓名" label="名称"
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="cuisine" prop="marketPrice"
label="菜系"
align="center" align="center"
> label="价格">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="food" prop="stock"
align="center" align="center"
label="类型"> label="库存">
0
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="status" prop="name2"
align="center" align="center"
label="是否可预约"> 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>
<el-table-column <el-table-column
align="center" align="center"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<a href="javascript:;" @click="goEdit(scope.row.id, $event)" class="btn_edit">编辑</a> <a href="javascript:;" @click="goEdit(scope.row, $event)" class="btn_edit btn_edit_add">编辑</a>
<a href="javascript:;" @click="goDelete(scope.row.id, $event)" class="btn_delete">删除</a>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -102,8 +81,6 @@ export default { ...@@ -102,8 +81,6 @@ export default {
return { return {
formInline: { formInline: {
name: '', name: '',
phone: '',
status: ''
}, },
allPage: 1, allPage: 1,
currentPage: 10, currentPage: 10,
...@@ -117,15 +94,16 @@ export default { ...@@ -117,15 +94,16 @@ export default {
}, },
methods: { methods: {
onSubmit () { onSubmit () {
console.log('submit!')
}, },
add () { add () {
this.$router.push({name: 'cookAdd', params: {}}) this.$router.push({name: 'flowerAdd', params: {}})
}, },
goEdit (id, e) { goEdit (item, e) {
console.log(item)
e.stopPropagation() e.stopPropagation()
this.$router.push({name: 'cookAdd', params: { this.$router.push({name: 'flowerAdd', params: {
id: id item: item
}}) }})
}, },
goDelete (id, e) { goDelete (id, e) {
...@@ -147,13 +125,11 @@ export default { ...@@ -147,13 +125,11 @@ export default {
}, },
getList () { getList () {
let parms = { let parms = {
"name": this.formInline.name, "name1": this.formInline.name,
"phone": this.formInline.phone,
"status": this.formInline.status
} }
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: '/pccook/get/list?p=' + this.allPage + '&c=' + this.currentPage, url: '/pcproduct/get/list?p=' + this.allPage + '&c=' + this.currentPage,
data: parms data: parms
}).then((res) => { }).then((res) => {
this.data = res.data.data.resultList this.data = res.data.data.resultList
...@@ -163,17 +139,19 @@ export default { ...@@ -163,17 +139,19 @@ export default {
}) })
}, },
handleRowChange (row, event, column) { handleRowChange (row, event, column) {
this.$router.push('/cookDetail/' + row.id) this.$router.push({name: 'flowerDetail', params: {
item: row
}})
}, },
searchList () { searchList () {
this.getOrderList() this.getList()
}, },
goPage (num) { goPage (num) {
this.allPage = Number(this.allPage) + num this.allPage = Number(this.allPage) + num
this.getOrderList() this.getList()
}, },
goToPage () { goToPage () {
this.getOrderList() this.getList()
}, },
} }
} }
...@@ -183,4 +161,8 @@ export default { ...@@ -183,4 +161,8 @@ export default {
.searchButton{ .searchButton{
margin-top: 43px; margin-top: 43px;
} }
.btn_edit_add {
// text-align: center;
margin-right: 0!important;
}
</style> </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