Commit e17d8e26 by 张成

店铺推荐

parent 23071bcc
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
"js-beautify": "1.13.0", "js-beautify": "1.13.0",
"js-cookie": "3.0.1", "js-cookie": "3.0.1",
"jsencrypt": "3.2.1", "jsencrypt": "3.2.1",
"moment": "^2.29.3",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"quill": "1.3.7", "quill": "1.3.7",
"screenfull": "5.0.2", "screenfull": "5.0.2",
......
soss @ 9266d4cc
Subproject commit 9266d4ccfb7817a3ce769920982f0f9e18350b41
import request from '@/utils/request' import request from "@/utils/request";
// 查询订单列表 // 查询订单列表
export function listOrder(query) { export function listOrder(query) {
return request({ return request({
url: '/system/order/list', url: "/order/list",
method: 'get', method: "get",
params: query params: query,
}) });
} }
// 查询订单详细 // 查询订单详细
export function getOrder(id) { export function getOrder(id) {
return request({ return request({
url: '/system/order/' + id, url: "/order/" + id,
method: 'get' method: "get",
}) });
} }
// 新增订单 // 新增订单
export function addOrder(data) { export function addOrder(data) {
return request({ return request({
url: '/system/order', url: "/order",
method: 'post', method: "post",
data: data data: data,
}) });
} }
// 修改订单 // 修改订单
export function updateOrder(data) { export function updateOrder(data) {
return request({ return request({
url: '/system/order', url: "/order",
method: 'put', method: "put",
data: data data: data,
}) });
} }
// 删除订单 // 删除订单
export function delOrder(id) { export function delOrder(id) {
return request({ return request({
url: '/system/order/' + id, url: "/order/" + id,
method: 'delete' method: "delete",
}) });
} }
...@@ -95,3 +95,20 @@ export function addRecommend(data) { ...@@ -95,3 +95,20 @@ export function addRecommend(data) {
data, data,
}); });
} }
// 新增推荐
export function recommendList(params) {
return request({
url: "/system/recommend/list",
method: "get",
params,
});
}
// 新增推荐
export function removeRecommend(params) {
return request({
url: "/system/recommend/remove",
method: "get",
params,
});
}
...@@ -63,43 +63,59 @@ ...@@ -63,43 +63,59 @@
</el-row> </el-row>
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column width="55" type="selection" align="center" />
<el-table-column label="主键" align="center" prop="id" /> <el-table-column width="200" label="主键" align="center" prop="id" />
<el-table-column label="订单号" align="center" prop="orderNo" /> <el-table-column width="200" label="订单号" align="center" prop="orderNo" />
<el-table-column label="订单顺序号" align="center" prop="orderNum" /> <el-table-column width="200" label="订单顺序号" align="center" prop="orderNum" />
<el-table-column label="用户ID" align="center" prop="userId" /> <el-table-column width="200" label="用户ID" align="center" prop="userId" />
<el-table-column label="冗余" align="center" prop="userName" /> <el-table-column width="200" label="冗余" align="center" prop="userName" />
<el-table-column label="冗余" align="center" prop="userPhone" /> <el-table-column width="200" label="冗余" align="center" prop="userPhone" />
<el-table-column label="支付时间" align="center" prop="payTime" width="180"> <el-table-column width="200" label="支付时间" align="center" prop="payTime">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.payTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.payTime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="完成时间" align="center" prop="finishTime" width="180"> <el-table-column width="200" label="完成时间" align="center" prop="finishTime">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.finishTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.finishTime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="订单金额" align="center" prop="amount" /> <el-table-column width="200" label="订单金额" align="center" prop="amount" />
<el-table-column label="商品数量" align="center" prop="goodsNum" /> <el-table-column width="200" label="商品数量" align="center" prop="goodsNum" />
<el-table-column label="取餐码" align="center" prop="pickCode" /> <el-table-column width="200" label="取餐码" align="center" prop="pickCode" />
<el-table-column label="店铺ID" align="center" prop="shopId" /> <el-table-column width="200" label="店铺ID" align="center" prop="shopId" />
<el-table-column label="机器ID" align="center" prop="machineId" /> <el-table-column width="200" label="机器ID" align="center" prop="machineId" />
<el-table-column label="点单屏序号" align="center" prop="source" /> <el-table-column width="200" label="点单屏序号" align="center" prop="source" />
<el-table-column <el-table-column width="200" label="订单状态" align="center" prop="state">
label="订单状态 0 创建未校验 1 未支付 2 已支付 3 支付制作中 4 制作完成未取 5 待取超时 6 正常完成 7 未支付取消 8 支付后制作前取消 9 制作中取消 10 制作完成取消 11 已退款 12 部分退款 50 其他人工干预状态" <template slot-scope="scope">
align="center" prop="state" /> <span v-if="scope.row.state == 0">创建未校验</span>
<el-table-column label="创建时间" align="center" prop="createdAt" width="180"> <span v-if="scope.row.state == 1">未支付</span>
<span v-if="scope.row.state == 2">已支付</span>
<span v-if="scope.row.state == 3">支付制作中</span>
<span v-if="scope.row.state == 4">制作完成未取</span>
<span v-if="scope.row.state == 5">待取超时</span>
<span v-if="scope.row.state == 6">正常完成</span>
<span v-if="scope.row.state == 7">未支付取消</span>
<span v-if="scope.row.state == 8">支付后制作前取消</span>
<span v-if="scope.row.state == 9">制作中取消</span>
<span v-if="scope.row.state == 10">制作完成取消</span>
<span v-if="scope.row.state == 11">已退款</span>
<span v-if="scope.row.state == 12">部分退款</span>
<span v-if="scope.row.state == 50">其他人工干预状态</span>
</template>
</el-table-column>
<el-table-column width="200" label="创建时间" align="center" prop="createdAt">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="更新时间" align="center" prop="updatedAt" width="180"> <el-table-column width="200" label="更新时间" align="center" prop="updatedAt">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column width="200" label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['system:order:edit']">修改</el-button> v-hasPermi="['system:order:edit']">修改</el-button>
......
<template>
<div>
<el-table v-loading="loading" :data="orderList">
<el-table-column label="商品名称" align="center" prop="name" />
<el-table-column label="编码" align="center" prop="code" />
<el-table-column label="折扣价" align="center" prop="discount" />
<el-table-column label="原价" align="center" prop="price" />
<el-table-column label="销售总量" align="center" prop="salesVolume" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-popconfirm title="确定要移除吗?" @confirm="removeRecommend(scope.row)">
<el-button type="text" slot="reference">移除推荐</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
</div>
</template>
<script>
import { recommendList, removeRecommend } from '@/api/system/shop'
export default {
props: ['shopId'],
data() {
return {
loading: false,
orderList: [],
radio2: '',
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10,
}
}
},
watch: {
shopId() {
this.getList()
}
},
mounted() {
this.getList()
},
methods: {
getList() {
this.loading = true;
recommendList({ ...this.queryParams, shopId: this.shopId, type: 2 }).then(response => {
this.orderList = response.rows;
this.total = response.total;
this.loading = false
});
},
removeRecommend(data) {
removeRecommend({ goodsId: data.id, type: 2, shopId: this.shopId }).then(res => {
this.$modal.msgSuccess("移除成功");
this.getList()
})
}
}
}
</script>
<style>
.flex {
height: 50px;
align-items: center;
text-align: right;
}
</style>
\ No newline at end of file
...@@ -56,7 +56,8 @@ export default { ...@@ -56,7 +56,8 @@ export default {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
addRecommend(this.form).then((res) => { addRecommend(this.form).then((res) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("推荐成功");
this.open = false;
}); });
} }
}); });
......
<template> <template>
<div> <div>
<SelectGoods ref="selectGoods" @callback="selectGoos" /> <SelectGoods ref="selectGoods" @callback="selectGoos" />
<AddRecommend ref="addRecommend" /> <AddRecommend :shopId="shopId" ref="addRecommend" />
<Preferential ref="preferential" /> <Preferential :shopId="shopId" ref="preferential" />
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="18"> <el-col :span="18">
<el-button :type="item.id == btnId ? 'primary' : ''" v-for="item in options" @click="setData(item)" <el-button :type="item.id == btnId ? 'primary' : ''" v-for="item in options" @click="setData(item)"
:key="item.id">{{ item.categoryName }} :key="item.id">{{ item.name }}
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
......
...@@ -47,7 +47,7 @@ export default { ...@@ -47,7 +47,7 @@ export default {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
addRecommend(this.form).then((res) => { addRecommend(this.form).then((res) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("成功");
}); });
} }
}); });
......
<template> <template>
<div> <div>
<el-table v-loading="loading" :data="orderList">
<el-table v-loading="loading" :data="list"> <el-table-column label="商品名称" align="center" prop="name" />
<el-table-column label="商品名称" align="center" prop="isDefault" /> <el-table-column label="编码" align="center" prop="code" />
<el-table-column label="缩略图" align="center" prop="code" /> <el-table-column label="折扣价" align="center" prop="discount" />
<el-table-column label="折扣价" align="center" prop="lng" /> <el-table-column label="原价" align="center" prop="price" />
<el-table-column label="总销量" align="center" prop="lat" /> <el-table-column label="销售总量" align="center" prop="salesVolume" />
<el-table-column label="上架时间" align="center" prop="lat" />
<el-table-column label="状态" align="center" prop="lat" />
<el-table-column label="排序" align="center" prop="lat" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-delete" v-hasPermi="['system:shop:remove']"> <el-popconfirm title="确定要移除吗?" @confirm="removeRecommend(scope.row)">
推荐 <el-button type="text" slot="reference">移除推荐</el-button>
</el-button> </el-popconfirm>
<el-button size="mini" type="text" icon="el-icon-delete" v-hasPermi="['system:shop:remove']">
特惠
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
</div> </div>
</template> </template>
<script> <script>
import { recommendList, removeRecommend } from '@/api/system/shop'
export default { export default {
props: ['shopId'],
data() { data() {
return { return {
loading: false, loading: false,
list: [], orderList: [],
radio2: '' radio2: '',
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10,
}
}
},
watch: {
shopId() {
this.getList()
}
},
mounted() {
this.getList()
},
methods: {
getList() {
this.loading = true;
recommendList({ ...this.queryParams, shopId: this.shopId, type: 1 }).then(response => {
this.orderList = response.rows;
this.total = response.total;
this.loading = false
});
},
removeRecommend(data) {
removeRecommend({ goodsId: data.id, type: 1, shopId: this.shopId }).then(res => {
this.$modal.msgSuccess("移除成功");
this.getList()
})
} }
} }
} }
......
...@@ -12,7 +12,10 @@ ...@@ -12,7 +12,10 @@
<Commodity :shopId="shopId" /> <Commodity :shopId="shopId" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane :disabled="!shopId" label="点单屏推荐" name="fourth"> <el-tab-pane :disabled="!shopId" label="点单屏推荐" name="fourth">
<Recommend :shopId="shopId" /> <Recommend ref="Recommend" :shopId="shopId" />
</el-tab-pane>
<el-tab-pane :disabled="!shopId" label="今日特惠" name="fixe">
<TodaySpecial ref="TodaySpecial" :shopId="shopId" />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-dialog> </el-dialog>
...@@ -22,6 +25,8 @@ import AddShop from './components/addShop.vue' ...@@ -22,6 +25,8 @@ import AddShop from './components/addShop.vue'
import Machine from './components/machine.vue' import Machine from './components/machine.vue'
import Commodity from './components/commodity.vue' import Commodity from './components/commodity.vue'
import Recommend from './components/recommend.vue' import Recommend from './components/recommend.vue'
import TodaySpecial from './components/TodaySpecial.vue'
export default { export default {
components: { AddShop, Machine, Commodity, Recommend }, components: { AddShop, Machine, Commodity, Recommend },
...@@ -32,6 +37,16 @@ export default { ...@@ -32,6 +37,16 @@ export default {
shopId: '' shopId: ''
}; };
}, },
watch: {
activeName(value) {
if (value == 'fourth') {
this.$refs.Recommend.getList()
}
if (value == 'fixe') {
this.$refs.TodaySpecial.getList()
}
}
},
methods: { methods: {
setShopId(id) { this.shopId = id }, setShopId(id) { this.shopId = id },
handleClick(tab, event) { }, handleClick(tab, event) { },
......
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 to comment