Merge branch 'test' of https://e.coding.net/g-cphe0354/yinshoukeguanliduan/management into wwz
This commit is contained in:
commit
41b5156605
|
|
@ -5,11 +5,11 @@ import request from "@/utils/request";
|
|||
* @returns
|
||||
*/
|
||||
export function gettbConsType(params) {
|
||||
return request({
|
||||
url: '/api/tbConsType',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
return request({
|
||||
url: "/api/tbConsType",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -17,73 +17,72 @@ export function gettbConsType(params) {
|
|||
* @returns
|
||||
*/
|
||||
export function posttbConsType(data) {
|
||||
return request({
|
||||
url: '/api/tbConsType',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: "/api/tbConsType",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 修改耗材类型
|
||||
* @returns
|
||||
*/
|
||||
export function puttbConsType(data) {
|
||||
return request({
|
||||
url: '/api/tbConsType',
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: "/api/tbConsType",
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查询耗材信息
|
||||
* @returns
|
||||
*/
|
||||
export function gettbConsInfo(params) {
|
||||
// return request({
|
||||
// url: '/api/tbConsInfo',
|
||||
// method: "get",
|
||||
// params
|
||||
// });
|
||||
return request({
|
||||
url: "/api/viewConInfoFlow",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
// return request({
|
||||
// url: '/api/tbConsInfo',
|
||||
// method: "get",
|
||||
// params
|
||||
// });
|
||||
return request({
|
||||
url: "/api/viewConInfoFlow",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 耗材入库
|
||||
* @returns
|
||||
*/
|
||||
export function posttbConsInfostockIn(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo/stockIn',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: "/api/tbConsInfo/stockIn",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 修改单位耗材值耗材
|
||||
* @returns
|
||||
*/
|
||||
export function postapitbConsInfo(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo',
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: "/api/tbConsInfo",
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 新增耗材信息
|
||||
* @returns
|
||||
*/
|
||||
export function posttbConsInfo(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: "/api/tbConsInfo",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -91,55 +90,55 @@ export function posttbConsInfo(data) {
|
|||
* @returns
|
||||
*/
|
||||
export function getviewConSku(params) {
|
||||
return request({
|
||||
url: '/api/viewConSku',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
return request({
|
||||
url: "/api/viewConSku",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查询查询商品规格
|
||||
* @returns
|
||||
*/
|
||||
export function gettbProductSpec(params) {
|
||||
return request({
|
||||
url: '/api/viewProductSkuShop',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
return request({
|
||||
url: "/api/viewProductSkuShop",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 新增商品规格耗材信息
|
||||
* @returns
|
||||
*/
|
||||
export function posttbProskuCon(data) {
|
||||
return request({
|
||||
url: '/api/tbProskuCon',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: "/api/tbProskuCon",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 新增商品规格耗材信息-修改后
|
||||
* @returns
|
||||
*/
|
||||
export function posttbProskuCons(data) {
|
||||
return request({
|
||||
url: '/api/tbProskuCon',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: "/api/tbProskuCon",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 修改商品规格耗材信息状态
|
||||
* @returns
|
||||
*/
|
||||
export function puttbProskuCon(data) {
|
||||
return request({
|
||||
url: '/api/tbProskuCon',
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: "/api/tbProskuCon",
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 编辑单位耗材值
|
||||
// export function puttbProskuCon(data) {
|
||||
|
|
@ -154,74 +153,86 @@ export function puttbProskuCon(data) {
|
|||
* @returns
|
||||
*/
|
||||
export function deletetbProskuCon(data) {
|
||||
return request({
|
||||
url: '/api/tbProskuCon',
|
||||
method: "delete",
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: "/api/tbProskuCon",
|
||||
method: "delete",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查询耗材流水信息
|
||||
* @returns
|
||||
*/
|
||||
export function gettbConsInfoFlow(params) {
|
||||
return request({
|
||||
url: '/api/tbConsInfoFlow',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
return request({
|
||||
url: "/api/tbConsInfoFlow",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 分组查询获取耗材流水信息
|
||||
*/
|
||||
export function viewConInfoFlow(data) {
|
||||
return request({
|
||||
url: "/api/viewConInfoFlow",
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
return request({
|
||||
url: "/api/viewConInfoFlow",
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 查询耗材单位列表
|
||||
*/
|
||||
export function queryTbConUnitInfo(data) {
|
||||
return request({
|
||||
url: "/api/tbConUnit/queryTbConUnitInfo",
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
return request({
|
||||
url: "/api/tbConUnit/queryTbConUnitInfo",
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增耗材单位
|
||||
*/
|
||||
export function addtbConUnit(data) {
|
||||
return request({
|
||||
url: '/api/tbConUnit',
|
||||
method: "post",
|
||||
data:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
return request({
|
||||
url: "/api/tbConUnit",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改耗材单位
|
||||
*/
|
||||
export function edittbConUnit(data) {
|
||||
return request({
|
||||
url: '/api/tbConUnit',
|
||||
method: "put",
|
||||
data:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
return request({
|
||||
url: "/api/tbConUnit",
|
||||
method: "put",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定关系
|
||||
*/
|
||||
export function tbProskuConV2(data) {
|
||||
return request({
|
||||
url: "/api/tbProskuCon/V2",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -573,6 +573,17 @@ export function tbPlussShopStaff(data) {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
export function tbShopPermissionlist(params) {
|
||||
return request({
|
||||
url: `/api/tbShopPermission/list`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过id获取员工信息
|
||||
* @returns
|
||||
|
|
@ -603,6 +614,13 @@ export function callRecord(params) {
|
|||
params
|
||||
});
|
||||
}
|
||||
export function callTablecall(data) {
|
||||
return request({
|
||||
url: `/callTable/call`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
// 删除桌型
|
||||
export function callTabledelete(data) {
|
||||
return request({
|
||||
|
|
@ -612,11 +630,11 @@ export function callTabledelete(data) {
|
|||
});
|
||||
}
|
||||
export function callTablepost(data) {
|
||||
return request({
|
||||
url: '/callTable',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: "/callTable",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 桌型列表
|
||||
export function callTable(params) {
|
||||
|
|
@ -636,44 +654,44 @@ export function callTabledataput(data) {
|
|||
}
|
||||
// 叫号列表
|
||||
export function callTablequeue(params) {
|
||||
return request({
|
||||
url: '/callTable/queue',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
return request({
|
||||
url: "/callTable/queue",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
// 取消叫号
|
||||
export function callTableput(data) {
|
||||
return request({
|
||||
url: `/callTable/updateState`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: `/callTable/updateState`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
export function callTabletakeNumber(data) {
|
||||
return request({
|
||||
url: '/callTable/takeNumber',
|
||||
method: 'post',
|
||||
data: {
|
||||
...data
|
||||
}
|
||||
})
|
||||
return request({
|
||||
url: "/callTable/takeNumber",
|
||||
method: "post",
|
||||
data: {
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 叫号配置获取
|
||||
export function callTableconfig(params) {
|
||||
return request({
|
||||
url: '/callTable/config',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
return request({
|
||||
url: "/callTable/config",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
// 叫号配置修改
|
||||
export function callTableconfigput(data) {
|
||||
return request({
|
||||
url: `/callTable/config`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: `/callTable/config`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 员工删除
|
||||
|
|
@ -727,4 +745,13 @@ export function tbProductListV2(params) {
|
|||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 修改商品相关(快捷接口)
|
||||
export function updateProductData(data) {
|
||||
return request({
|
||||
url: `/api/stock/updateProductData`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
// 桌台管理
|
||||
import request from "@/utils/request";
|
||||
|
||||
//就餐形式,默认堂食后付费
|
||||
const useType='dine-in-after'
|
||||
function getUseType(){
|
||||
const type=localStorage.getItem("useType")
|
||||
return type?type:useType
|
||||
}
|
||||
/**
|
||||
* 台桌列表
|
||||
* @returns
|
||||
|
|
@ -133,6 +138,7 @@ export function getCart(params) {
|
|||
method: "get",
|
||||
params:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
useType: getUseType(),
|
||||
...params
|
||||
}
|
||||
});
|
||||
|
|
@ -162,6 +168,7 @@ export function addCart(data) {
|
|||
method: "post",
|
||||
data:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
useType: getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
|
|
@ -177,6 +184,7 @@ export function $clearCart(data) {
|
|||
method: "delete",
|
||||
data:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
useType: getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
|
|
@ -192,6 +200,7 @@ export function $removeCart(data) {
|
|||
method: "delete",
|
||||
data:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
useType: getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
|
|
@ -234,6 +243,7 @@ export function $getMasterId(data) {
|
|||
method: "get",
|
||||
params:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
useType: getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
|
|
@ -262,6 +272,7 @@ export function $createOrder(data) {
|
|||
method: "post",
|
||||
data:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
useType: getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
|
|
@ -278,6 +289,7 @@ export function $cacheOrder(data) {
|
|||
method: "post",
|
||||
data:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
useType: getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
|
|
@ -293,6 +305,7 @@ export function $getCacheOrder(data) {
|
|||
method: "get",
|
||||
params:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
useType: getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
|
|
@ -362,6 +375,7 @@ export function $choseCount(data) {
|
|||
method: "put",
|
||||
data:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
useType: getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
|
|
@ -403,3 +417,14 @@ export function $printDishes(data) {
|
|||
});
|
||||
}
|
||||
|
||||
// 就餐模式切换
|
||||
export function $changeUseType(data) {
|
||||
return request({
|
||||
url: '/api/place/choseModel',
|
||||
method: "put",
|
||||
data:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@
|
|||
height: 100%;
|
||||
}
|
||||
#app .sidebar-container.has-logo .el-scrollbar {
|
||||
height: calc(100% - 50px);
|
||||
height: calc(100% - 110px);
|
||||
}
|
||||
#app .sidebar-container .is-horizontal {
|
||||
display: none;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
&.has-logo {
|
||||
.el-scrollbar {
|
||||
height: calc(100% - 50px);
|
||||
height: calc(100% - 110px);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@
|
|||
</li>
|
||||
</ul>
|
||||
<div class="buttonstyle">
|
||||
<el-button type="primary" @click="dialogVisibles = true">取号</el-button>
|
||||
<el-button type="primary" @click="dialogVisibles = true; phone = ''">取号</el-button>
|
||||
<el-button plain type="primary" @click="toUrl">叫号记录</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;align-items: center;flex-wrap: wrap;justify-content: space-between; ">
|
||||
<div class="lineUpBoxList" v-for="item in list.records" :key="item.id">
|
||||
<div style="display: flex;align-items: center;flex-wrap: wrap; ">
|
||||
<div class="lineUpBoxList" v-for="item in list.records" style="margin-right: 20px;" :key="item.id">
|
||||
<ul>
|
||||
<li>
|
||||
<div>用户</div>
|
||||
|
|
@ -50,11 +50,27 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- 播报弹窗 -->
|
||||
<el-dialog title="提示" :visible.sync="dialogVisible" width="30%">
|
||||
<span>通知消息已发送</span>
|
||||
<el-dialog title="提示" :visible.sync="dialogVisible" center width="30%">
|
||||
<div style="text-align: center;">
|
||||
<div style="font-size: 16px;">正在叫号,请稍等</div>
|
||||
<div v-if="profilepicturedata.state == 1" style="color: #52C41A;font-size: 16px;margin-top: 17px;">
|
||||
已发送至用户<i class="el-icon-circle-check" style="color: #52C41A;"></i>
|
||||
</div>
|
||||
<div v-else style="color:#FF4D4F;font-size: 16px;margin-top: 17px;">用户未订阅消息 <i style="color: #FF4D4F;" class="el-icon-circle-close"></i></div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button style="" @click="dialogConfirm(2)">完成</el-button>
|
||||
<el-button type="primary" @click="dialogConfirm(3)">过号</el-button>
|
||||
<el-button style="width: 176px;
|
||||
height: 48px;
|
||||
background: #F7F7FA;
|
||||
box-shadow: 0px 2px 0px 0px rgba(0,0,0,0.02);
|
||||
border-radius: 2px 2px 2px 2px;
|
||||
border: 1px solid rgba(255,255,255,0);" @click="dialogConfirm(2)">完成</el-button>
|
||||
<el-button type="primary" style="width: 189px;
|
||||
height: 45px;
|
||||
background: #FF4D4F;
|
||||
box-shadow: 0px 2px 0px 0px rgba(0,0,0,0.02);
|
||||
border-radius: 2px 2px 2px 2px;
|
||||
border: 1px solid rgba(255,255,255,0.28);" @click="dialogConfirm(3)">过号</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- 取号 -->
|
||||
|
|
@ -84,7 +100,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { callTable, callTablequeue, callTableput, callTabletakeNumber } from '@/api/shop'
|
||||
import { callTable, callTablequeue, callTableput, callTabletakeNumber, callTablecall } from '@/api/shop'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -107,7 +123,9 @@ export default {
|
|||
dialogVisibles: false,
|
||||
profilepictureInfo: "",
|
||||
phone: "",
|
||||
selectTabletype: ""
|
||||
selectTabletype: "",
|
||||
// 播报弹窗显示是否订阅
|
||||
profilepicturedata: ""
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
|
|
@ -131,9 +149,16 @@ export default {
|
|||
|
||||
}
|
||||
},
|
||||
profilepicture(d) {
|
||||
this.dialogVisible = true
|
||||
this.profilepictureInfo = d
|
||||
async profilepicture(d) {
|
||||
let res = await callTablecall({
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
callQueueId: d.id
|
||||
})
|
||||
if (res) {
|
||||
this.dialogVisible = true
|
||||
this.profilepicturedata = res
|
||||
this.profilepictureInfo = d
|
||||
}
|
||||
},
|
||||
gettypeevent(d) {
|
||||
this.selecttopType = d
|
||||
|
|
@ -155,7 +180,7 @@ export default {
|
|||
} else if (value == 2) {
|
||||
const res = await callTableput({
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
state: 1,
|
||||
state: 2,
|
||||
callQueueId: this.profilepictureInfo.id
|
||||
})
|
||||
if (res) {
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ export default {
|
|||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
<style scoped lang="scss">
|
||||
.login {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
|
|
|||
|
|
@ -1,22 +1,11 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="140px"
|
||||
label-position="left"
|
||||
>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="140px" label-position="left">
|
||||
<el-form-item label="商品类型" prop="typeEnum">
|
||||
<div class="shop_type_box" :class="{}">
|
||||
<!-- <div class="shop_type_box" :class="{ disabled: form.id }"> -->
|
||||
<div
|
||||
class="item"
|
||||
v-for="(item, index) in shopTypes"
|
||||
:key="index"
|
||||
:class="{ active: shopTypesActive == index }"
|
||||
@click="changeTypeEnum(index)"
|
||||
>
|
||||
<div class="item" v-for="(item, index) in shopTypes" :key="index"
|
||||
:class="{ active: shopTypesActive == index }" @click="changeTypeEnum(index)">
|
||||
<div class="s_title">{{ item.label }}</div>
|
||||
<div class="intro">({{ item.intro }})</div>
|
||||
<div class="active_dot">
|
||||
|
|
@ -26,109 +15,42 @@
|
|||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称" prop="name">
|
||||
<el-input
|
||||
v-model="form.name"
|
||||
placeholder="请输入商品名称"
|
||||
style="width: 500px"
|
||||
></el-input>
|
||||
<el-input v-model="form.name" placeholder="请输入商品名称" style="width: 500px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品介绍" prop="shortTitle">
|
||||
<el-input
|
||||
v-model="form.shortTitle"
|
||||
type="textarea"
|
||||
placeholder="请输入商品介绍"
|
||||
style="width: 500px"
|
||||
></el-input>
|
||||
<el-input v-model="form.shortTitle" type="textarea" placeholder="请输入商品介绍" style="width: 500px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="unitId">
|
||||
<el-select
|
||||
v-model="form.unitId"
|
||||
placeholder="请选择单位"
|
||||
style="width: 500px"
|
||||
@change="selectUnitt"
|
||||
>
|
||||
<el-option
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in units"
|
||||
:key="item.id"
|
||||
></el-option>
|
||||
<el-select v-model="form.unitId" placeholder="请选择单位" style="width: 500px" @change="selectUnitt">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in units" :key="item.id"></el-option>
|
||||
</el-select>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
@click="$refs.addUnitRef.show()"
|
||||
>添加单位</el-button
|
||||
>
|
||||
<el-button type="primary" plain icon="el-icon-plus" @click="$refs.addUnitRef.show()">添加单位</el-button>
|
||||
<addUnit ref="addUnitRef" @success="tbShopUnit" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="团购券分类"
|
||||
prop="groupCategoryId"
|
||||
v-if="form.typeEnum == 'group'"
|
||||
>
|
||||
<el-table
|
||||
:data="form.groupCategoryId"
|
||||
border
|
||||
style="width: 500px"
|
||||
v-if="form.groupCategoryId.length"
|
||||
>
|
||||
<el-form-item label="团购券分类" prop="groupCategoryId" v-if="form.typeEnum == 'group'">
|
||||
<el-table :data="form.groupCategoryId" border style="width: 500px" v-if="form.groupCategoryId.length">
|
||||
<el-table-column label="名称" prop="name"></el-table-column>
|
||||
<el-table-column label="操作" width="160">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
@click="form.groupCategoryId.splice(scope.$index, 1)"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button type="text" @click="form.groupCategoryId.splice(scope.$index, 1)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button
|
||||
type="text"
|
||||
@click="$refs.groupTypeList.show(form.groupCategoryId)"
|
||||
>添加团购券分类</el-button
|
||||
>
|
||||
<el-button type="text" @click="$refs.groupTypeList.show(form.groupCategoryId)">添加团购券分类</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品分类" prop="categoryId" v-else>
|
||||
<el-select
|
||||
v-model="form.categoryId"
|
||||
placeholder="请选择商品分类"
|
||||
style="width: 500px"
|
||||
>
|
||||
<el-option
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in categorys"
|
||||
:key="item.id"
|
||||
></el-option>
|
||||
<el-select v-model="form.categoryId" placeholder="请选择商品分类" style="width: 500px">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in categorys" :key="item.id"></el-option>
|
||||
</el-select>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
@click="$refs.addClassifyRef.show()"
|
||||
>添加分类</el-button
|
||||
>
|
||||
<el-button type="primary" plain icon="el-icon-plus" @click="$refs.addClassifyRef.show()">添加分类</el-button>
|
||||
<addClassify ref="addClassifyRef" @success="tbShopCategoryGet" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品图片">
|
||||
<div style="display: flex; flex-wrap: wrap">
|
||||
<div
|
||||
v-for="(item,index) in imgList"
|
||||
:key="index"
|
||||
style="position: relative"
|
||||
class="showStyle"
|
||||
>
|
||||
<div v-for="(item, index) in imgList" :key="index" style="position: relative" class="showStyle">
|
||||
<i class="el-icon-error buttonstyle" @click="deleteEvent(item)"></i>
|
||||
<img
|
||||
style="width: 148px; height: 148px; margin-right: 6px"
|
||||
class="imgStyle"
|
||||
:key="item.id"
|
||||
:src="item.url"
|
||||
alt=""
|
||||
/>
|
||||
<img style="width: 148px; height: 148px; margin-right: 6px" class="imgStyle" :key="item.id" :src="item.url"
|
||||
alt="" />
|
||||
</div>
|
||||
<div class="upImgStyle" @click="$refs.addImg.show()">+</div>
|
||||
</div>
|
||||
|
|
@ -136,44 +58,25 @@
|
|||
<div class="tips">注:第一张图为商品封面图,图片尺寸为750×750</div>
|
||||
<!-- <el-button type="primary" plain icon="el-icon-plus" @click="$refs.addImg.show()">选择图片</el-button> -->
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="套餐商品"
|
||||
v-if="shopTypes[shopTypesActive].typeEnum == 'group'"
|
||||
>
|
||||
<el-form-item label="套餐商品" v-if="shopTypes[shopTypesActive].typeEnum == 'group'">
|
||||
<el-table :data="form.groupSnap" border v-if="form.groupSnap.length">
|
||||
<el-table-column label="标题" prop="title">
|
||||
<template v-slot="scope">
|
||||
<el-input
|
||||
v-model="scope.row.title"
|
||||
placeholder="请输入标题:自选小吃"
|
||||
></el-input>
|
||||
<el-input v-model="scope.row.title" placeholder="请输入标题:自选小吃"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品信息">
|
||||
<template v-slot="scope">
|
||||
<div class="shop_list">
|
||||
<div
|
||||
class="item"
|
||||
v-for="(item, index) in scope.row.goods"
|
||||
:key="item.id"
|
||||
>
|
||||
<div class="item" v-for="(item, index) in scope.row.goods" :key="item.id">
|
||||
<span class="dot"></span>
|
||||
<div class="name">
|
||||
<div class="t">{{ item.name }}</div>
|
||||
<div class="t" v-if="!form.id">x{{ item.groupNum }}</div>
|
||||
<el-input-number
|
||||
v-model="item.groupNum"
|
||||
:step="1"
|
||||
step-strictly
|
||||
:min="1"
|
||||
size="mini"
|
||||
v-else
|
||||
></el-input-number>
|
||||
<el-input-number v-model="item.groupNum" :step="1" step-strictly :min="1" size="mini"
|
||||
v-else></el-input-number>
|
||||
</div>
|
||||
<i
|
||||
class="del el-icon-delete"
|
||||
@click="delGoods(scope.row.goods, index, scope.$index)"
|
||||
></i>
|
||||
<i class="del el-icon-delete" @click="delGoods(scope.row.goods, index, scope.$index)"></i>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -181,57 +84,33 @@
|
|||
<el-table-column label="几选几">
|
||||
<template v-slot="scope">
|
||||
<span>{{ scope.row.goods.length }}选</span>
|
||||
<el-input-number
|
||||
v-model="scope.row.number"
|
||||
controls-position="right"
|
||||
:min="1"
|
||||
></el-input-number>
|
||||
<el-input-number v-model="scope.row.number" controls-position="right" :min="1"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="160">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
@click="tableAddShop(scope.$index, scope.row.goods)"
|
||||
>添加商品</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
@click="form.groupSnap.splice(scope.$index, 1)"
|
||||
>删除分组</el-button
|
||||
>
|
||||
<el-button type="text" @click="tableAddShop(scope.$index, scope.row.goods)">添加商品</el-button>
|
||||
<el-button type="text" @click="form.groupSnap.splice(scope.$index, 1)">删除分组</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button type="text" @click="$refs.shopListRef.show()"
|
||||
>添加分组</el-button
|
||||
>
|
||||
<el-button type="text" @click="$refs.shopListRef.show()">添加分组</el-button>
|
||||
<shopList ref="shopListRef" @success="selectShopRes" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="规格属性"
|
||||
v-if="shopTypes[shopTypesActive].typeEnum != 'sku'"
|
||||
>
|
||||
<el-form-item label="规格属性" v-if="shopTypes[shopTypesActive].typeEnum != 'sku'">
|
||||
<el-table :data="form.skuList" border>
|
||||
<el-table-column label="售价" prop="salePrice">
|
||||
<template v-slot="scope">
|
||||
<el-input-number
|
||||
size="mini"
|
||||
@change="priceFormat(scope.row, 'salePrice')"
|
||||
@blur="priceFormat(scope.row, 'salePrice')"
|
||||
v-model="scope.row.salePrice"
|
||||
controls-position="right"
|
||||
></el-input-number>
|
||||
<el-input-number size="mini" @change="priceFormat(scope.row, 'salePrice')"
|
||||
@blur="priceFormat(scope.row, 'salePrice')" v-model="scope.row.salePrice"
|
||||
controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会员价" prop="memberPrice">
|
||||
<template v-slot="scope">
|
||||
<el-input-number
|
||||
@change="priceFormat(scope.row, 'memberPrice')"
|
||||
@blur="priceFormat(scope.row, 'memberPrice')"
|
||||
v-model="scope.row.memberPrice"
|
||||
controls-position="right"
|
||||
></el-input-number>
|
||||
<el-input-number @change="priceFormat(scope.row, 'memberPrice')"
|
||||
@blur="priceFormat(scope.row, 'memberPrice')" v-model="scope.row.memberPrice"
|
||||
controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="成本价" prop="costPrice">
|
||||
|
|
@ -256,16 +135,11 @@
|
|||
</el-table-column>-->
|
||||
<el-table-column label="起售数量" prop="suit">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
@change="priceFormat(scope.row, 'suit')"
|
||||
@blur="priceFormat(scope.row, 'suit')"
|
||||
:min="1"
|
||||
v-model="scope.row.suit"
|
||||
controls-position="right"
|
||||
></el-input-number>
|
||||
<el-input-number @change="priceFormat(scope.row, 'suit')" @blur="priceFormat(scope.row, 'suit')" :min="1"
|
||||
v-model="scope.row.suit" controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存数量" prop="stockNumber">
|
||||
<!-- <el-table-column label="库存数量" prop="stockNumber">
|
||||
<template v-slot="scope">
|
||||
<el-input-number
|
||||
@change="priceFormat(scope.row, 'stockNumber')"
|
||||
|
|
@ -275,15 +149,12 @@
|
|||
controls-position="right"
|
||||
></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="分销金额" prop="firstShared">
|
||||
<template v-slot="scope">
|
||||
<el-input-number
|
||||
@change="priceFormat(scope.row, 'firstShared')"
|
||||
@blur="priceFormat(scope.row, 'firstShared')"
|
||||
v-model="scope.row.firstShared"
|
||||
controls-position="right"
|
||||
></el-input-number>
|
||||
<el-input-number @change="priceFormat(scope.row, 'firstShared')"
|
||||
@blur="priceFormat(scope.row, 'firstShared')" v-model="scope.row.firstShared"
|
||||
controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品条码">
|
||||
|
|
@ -298,220 +169,107 @@
|
|||
</el-form-item>
|
||||
<template v-if="form.typeEnum == 'group'">
|
||||
<el-form-item label="使用日期说明" prop="notices.dateUsed">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.notices.dateUsed"
|
||||
:autosize="{ minRows: 3, maxRows: 10 }"
|
||||
style="width: 500px"
|
||||
placeholder="请输入使用日期说明"
|
||||
></el-input>
|
||||
<el-input type="textarea" v-model="form.notices.dateUsed" :autosize="{ minRows: 3, maxRows: 10 }"
|
||||
style="width: 500px" placeholder="请输入使用日期说明"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="可用时间说明" prop="notices.availableTime">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.notices.availableTime"
|
||||
:autosize="{ minRows: 3, maxRows: 10 }"
|
||||
style="width: 500px"
|
||||
placeholder="请输入可用时间说明
|
||||
"
|
||||
></el-input>
|
||||
<el-input type="textarea" v-model="form.notices.availableTime" :autosize="{ minRows: 3, maxRows: 10 }"
|
||||
style="width: 500px" placeholder="请输入可用时间说明
|
||||
"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="预约方式" prop="notices.bookingType">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.notices.bookingType"
|
||||
:autosize="{ minRows: 3, maxRows: 10 }"
|
||||
style="width: 500px"
|
||||
placeholder="请输入预约方式
|
||||
"
|
||||
></el-input>
|
||||
<el-input type="textarea" v-model="form.notices.bookingType" :autosize="{ minRows: 3, maxRows: 10 }"
|
||||
style="width: 500px" placeholder="请输入预约方式
|
||||
"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="退款说明" prop="notices.refundPolicy">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.notices.refundPolicy"
|
||||
:autosize="{ minRows: 3, maxRows: 10 }"
|
||||
style="width: 500px"
|
||||
placeholder="请输入退款说明
|
||||
"
|
||||
></el-input>
|
||||
<el-input type="textarea" v-model="form.notices.refundPolicy" :autosize="{ minRows: 3, maxRows: 10 }"
|
||||
style="width: 500px" placeholder="请输入退款说明
|
||||
"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="团购价说明">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.notices.groupPurInfo"
|
||||
:autosize="{ minRows: 3, maxRows: 10 }"
|
||||
style="width: 500px"
|
||||
placeholder="请输入团购价说明"
|
||||
></el-input>
|
||||
<el-input type="textarea" v-model="form.notices.groupPurInfo" :autosize="{ minRows: 3, maxRows: 10 }"
|
||||
style="width: 500px" placeholder="请输入团购价说明"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="门市价/划线价说明">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.notices.marketPriceInfo"
|
||||
:autosize="{ minRows: 3, maxRows: 10 }"
|
||||
style="width: 500px"
|
||||
placeholder="请输入门市价/划线价说明"
|
||||
></el-input>
|
||||
<el-input type="textarea" v-model="form.notices.marketPriceInfo" :autosize="{ minRows: 3, maxRows: 10 }"
|
||||
style="width: 500px" placeholder="请输入门市价/划线价说明"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="折扣说明">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.notices.discountInfo"
|
||||
:autosize="{ minRows: 3, maxRows: 10 }"
|
||||
style="width: 500px"
|
||||
placeholder="请输入折扣说明"
|
||||
></el-input>
|
||||
<el-input type="textarea" v-model="form.notices.discountInfo" :autosize="{ minRows: 3, maxRows: 10 }"
|
||||
style="width: 500px" placeholder="请输入折扣说明"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="发票说明">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.notices.invoiceInfo"
|
||||
:autosize="{ minRows: 3, maxRows: 10 }"
|
||||
style="width: 500px"
|
||||
placeholder="请输入发票说明"
|
||||
></el-input>
|
||||
<el-input type="textarea" v-model="form.notices.invoiceInfo" :autosize="{ minRows: 3, maxRows: 10 }"
|
||||
style="width: 500px" placeholder="请输入发票说明"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用规则">
|
||||
<Editor
|
||||
:minHeight="200"
|
||||
:value="form.notices.usageRules"
|
||||
v-model="form.notices.usageRules"
|
||||
/>
|
||||
<Editor :minHeight="200" :value="form.notices.usageRules" v-model="form.notices.usageRules" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item
|
||||
label="选择规格"
|
||||
v-if="shopTypes[shopTypesActive].typeEnum == 'sku'"
|
||||
>
|
||||
<el-select
|
||||
v-model="form.specId"
|
||||
placeholder="请选择规格"
|
||||
style="width: 500px"
|
||||
@change="selectSpecHandle"
|
||||
>
|
||||
<el-option
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in specList"
|
||||
:key="item.id"
|
||||
></el-option>
|
||||
<el-form-item label="选择规格" v-if="shopTypes[shopTypesActive].typeEnum == 'sku'">
|
||||
<el-select v-model="form.specId" placeholder="请选择规格" style="width: 500px" @change="selectSpecHandle">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in specList" :key="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="item.name"
|
||||
v-if="selectSpec.length"
|
||||
v-for="item in selectSpec"
|
||||
:key="item.name"
|
||||
>
|
||||
<el-checkbox-group
|
||||
v-model="item.selectSpecResult"
|
||||
@change="selectSpecResultChange"
|
||||
>
|
||||
<el-checkbox
|
||||
:label="item"
|
||||
v-for="(item, index) in item.value"
|
||||
:key="index"
|
||||
></el-checkbox>
|
||||
<el-form-item :label="item.name" v-if="selectSpec.length" v-for="item in selectSpec" :key="item.name">
|
||||
<el-checkbox-group v-model="item.selectSpecResult" @change="selectSpecResultChange">
|
||||
<el-checkbox :label="item" v-for="(item, index) in item.value" :key="index"></el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="selectSpecResult && shopTypes[shopTypesActive].typeEnum == 'sku'"
|
||||
>
|
||||
<el-form-item v-if="selectSpecResult && shopTypes[shopTypesActive].typeEnum == 'sku'">
|
||||
<el-table :data="form.skuList" border>
|
||||
<el-table-column
|
||||
:label="item.label"
|
||||
:prop="item.value"
|
||||
v-for="(item, index) in specTableHeaders"
|
||||
:key="index"
|
||||
>
|
||||
<el-table-column :label="item.label" :prop="item.value" v-for="(item, index) in specTableHeaders"
|
||||
:key="index">
|
||||
</el-table-column>
|
||||
<el-table-column label="图片" prop="coverImg" width="80">
|
||||
<template v-slot="scope">
|
||||
<uploadImg
|
||||
v-if="!scope.row.coverImg"
|
||||
type="text"
|
||||
:limit="1"
|
||||
@success="uploadImgSucess($event, scope.row)"
|
||||
/>
|
||||
<el-image
|
||||
style="width: 30px; height: 30px"
|
||||
:src="scope.row.coverImg"
|
||||
v-else
|
||||
/>
|
||||
<i
|
||||
class="el-icon-error"
|
||||
v-if="scope.row.coverImg"
|
||||
@click="scope.row.coverImg = ''"
|
||||
/>
|
||||
<uploadImg v-if="!scope.row.coverImg" type="text" :limit="1"
|
||||
@success="uploadImgSucess($event, scope.row)" />
|
||||
<el-image style="width: 30px; height: 30px" :src="scope.row.coverImg" v-else />
|
||||
<i class="el-icon-error" v-if="scope.row.coverImg" @click="scope.row.coverImg = ''" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="售价" prop="salePrice">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<span>售价</span>
|
||||
<i
|
||||
class="icon el-icon-edit"
|
||||
@click="batchNumber('salePrice')"
|
||||
></i>
|
||||
<i class="icon el-icon-edit" @click="batchNumber('salePrice')"></i>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
@change="priceFormat(scope.row, 'salePrice')"
|
||||
@blur="priceFormat(scope.row, 'salePrice')"
|
||||
v-model="scope.row.salePrice"
|
||||
controls-position="right"
|
||||
></el-input-number>
|
||||
<el-input-number @change="priceFormat(scope.row, 'salePrice')" @blur="priceFormat(scope.row, 'salePrice')"
|
||||
v-model="scope.row.salePrice" controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会员价" prop="memberPrice">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<span>会员价</span>
|
||||
<i
|
||||
class="icon el-icon-edit"
|
||||
@click="batchNumber('memberPrice')"
|
||||
></i>
|
||||
<i class="icon el-icon-edit" @click="batchNumber('memberPrice')"></i>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
@change="priceFormat(scope.row, 'memberPrice')"
|
||||
@blur="priceFormat(scope.row, 'memberPrice')"
|
||||
v-model="scope.row.memberPrice"
|
||||
controls-position="right"
|
||||
></el-input-number>
|
||||
<el-input-number @change="priceFormat(scope.row, 'memberPrice')"
|
||||
@blur="priceFormat(scope.row, 'memberPrice')" v-model="scope.row.memberPrice"
|
||||
controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成本价" prop="costPrice">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<span>成本价</span>
|
||||
<i
|
||||
class="icon el-icon-edit"
|
||||
@click="batchNumber('costPrice')"
|
||||
></i>
|
||||
<i class="icon el-icon-edit" @click="batchNumber('costPrice')"></i>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
@change="priceFormat(scope.row, 'costPrice')"
|
||||
@blur="priceFormat(scope.row, 'costPrice')"
|
||||
v-model="scope.row.costPrice"
|
||||
controls-position="right"
|
||||
></el-input-number>
|
||||
<el-input-number @change="priceFormat(scope.row, 'costPrice')" @blur="priceFormat(scope.row, 'costPrice')"
|
||||
v-model="scope.row.costPrice" controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="原价" prop="originPrice">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<span>原价</span>
|
||||
<i
|
||||
class="icon el-icon-edit"
|
||||
@click="batchNumber('originPrice')"
|
||||
></i>
|
||||
<i class="icon el-icon-edit" @click="batchNumber('originPrice')"></i>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
@change="priceFormat(scope.row, 'originPrice')"
|
||||
@blur="priceFormat(scope.row, 'originPrice')"
|
||||
v-model="scope.row.originPrice"
|
||||
controls-position="right"
|
||||
></el-input-number>
|
||||
<el-input-number @change="priceFormat(scope.row, 'originPrice')"
|
||||
@blur="priceFormat(scope.row, 'originPrice')" v-model="scope.row.originPrice"
|
||||
controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="起售数量" prop="suit">
|
||||
|
|
@ -520,16 +278,11 @@
|
|||
<i class="icon el-icon-edit" @click="batchNumber('suit')"></i>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
@change="priceFormat(scope.row, 'originsuitrice')"
|
||||
@blur="priceFormat(scope.row, 'suit')"
|
||||
v-model="scope.row.suit"
|
||||
controls-position="right"
|
||||
:min="1"
|
||||
></el-input-number>
|
||||
<el-input-number @change="priceFormat(scope.row, 'originsuitrice')" @blur="priceFormat(scope.row, 'suit')"
|
||||
v-model="scope.row.suit" controls-position="right" :min="1"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存数量" prop="stockNumber">
|
||||
<!-- <el-table-column label="库存数量" prop="stockNumber">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<span>库存数量</span>
|
||||
<i
|
||||
|
|
@ -547,22 +300,16 @@
|
|||
controls-position="right"
|
||||
></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="分销金额" prop="firstShared">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<span>分销金额</span>
|
||||
<i
|
||||
class="icon el-icon-edit"
|
||||
@click="batchNumber('firstShared')"
|
||||
></i>
|
||||
<i class="icon el-icon-edit" @click="batchNumber('firstShared')"></i>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
@change="priceFormat(scope.row, 'firstShared')"
|
||||
@blur="priceFormat(scope.row, 'firstShared')"
|
||||
v-model="scope.row.firstShared"
|
||||
controls-position="right"
|
||||
></el-input-number>
|
||||
<el-input-number @change="priceFormat(scope.row, 'firstShared')"
|
||||
@blur="priceFormat(scope.row, 'firstShared')" v-model="scope.row.firstShared"
|
||||
controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品条码">
|
||||
|
|
@ -587,21 +334,13 @@
|
|||
<template v-if="form.typeEnum != 'group'">
|
||||
<el-form-item label="上架区域">
|
||||
<div class="shop_type_box">
|
||||
<div
|
||||
class="item"
|
||||
:class="{ active: form.isShowCash }"
|
||||
@click="areaChange('isShowCash')"
|
||||
>
|
||||
<div class="item" :class="{ active: form.isShowCash }" @click="areaChange('isShowCash')">
|
||||
<div class="s_title">收银台</div>
|
||||
<div class="active_dot">
|
||||
<i class="el-icon-check"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="item"
|
||||
:class="{ active: form.isShowMall }"
|
||||
@click="areaChange('isShowMall')"
|
||||
>
|
||||
<div class="item" :class="{ active: form.isShowMall }" @click="areaChange('isShowMall')">
|
||||
<div class="s_title">小程序商城</div>
|
||||
<div class="active_dot">
|
||||
<i class="el-icon-check"></i>
|
||||
|
|
@ -610,79 +349,52 @@
|
|||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="库存开关">
|
||||
<el-switch
|
||||
v-model="form.isStock"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
></el-switch>
|
||||
<el-switch v-model="form.isStock" :active-value="1" :inactive-value="0"></el-switch>
|
||||
<div class="tips">注:关闭则不计算出入库数据</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="库存数量" v-if="form.isStock">
|
||||
<el-input-number @change="priceFormat(form, 'stockNumber')" @blur="priceFormat(form, 'stockNumber')"
|
||||
v-model="form.stockNumber" controls-position="right"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签打印">
|
||||
<el-switch
|
||||
v-model="form.enableLabel"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
></el-switch>
|
||||
<el-switch v-model="form.enableLabel" :active-value="1" :inactive-value="0"></el-switch>
|
||||
<div class="tips">开启后: 收银完成后会自动打印对应数量的标签数</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="打包费">
|
||||
<el-input-number
|
||||
@change="priceFormat(form, 'packFee')"
|
||||
@blur="priceFormat(form, 'packFee')"
|
||||
v-model="form.packFee"
|
||||
controls-position="right"
|
||||
></el-input-number>
|
||||
<el-input-number @change="priceFormat(form, 'packFee')" @blur="priceFormat(form, 'packFee')"
|
||||
v-model="form.packFee" controls-position="right"></el-input-number>
|
||||
<div class="tips">
|
||||
单份商品打包费。注:店铺开启外卖模式下该数据才生效
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="虚拟销量">
|
||||
<el-input-number
|
||||
@change="priceFormat(form, 'baseSalesNumber')"
|
||||
@blur="priceFormat(form, 'baseSalesNumber')"
|
||||
v-model="form.baseSalesNumber"
|
||||
controls-position="right"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="虚拟销量">
|
||||
<el-input-number @change="priceFormat(form, 'baseSalesNumber')" @blur="priceFormat(form, 'baseSalesNumber')"
|
||||
v-model="form.baseSalesNumber" controls-position="right"></el-input-number>
|
||||
</el-form-item> -->
|
||||
</template>
|
||||
<el-form-item label="排序" v-if="form.id">
|
||||
<el-input-number
|
||||
v-model="form.sort"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
></el-input-number>
|
||||
<el-input-number v-model="form.sort" controls-position="right" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" v-loading="loading" @click="submitHandle"
|
||||
>确定</el-button
|
||||
>
|
||||
<el-button type="primary" v-loading="loading" @click="submitHandle">确定</el-button>
|
||||
<el-button @click="$router.back()">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-dialog title="批量修改" width="400px" :visible.sync="showBatchModal">
|
||||
<el-form :model="batchNumberForm">
|
||||
<el-form-item>
|
||||
<el-input-number
|
||||
@change="priceFormat(batchNumberForm, 'batchNumber')"
|
||||
@blur="priceFormat(batchNumberForm, 'batchNumber')"
|
||||
v-model="batchNumberForm.batchNumber"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
></el-input-number>
|
||||
<el-input-number @change="priceFormat(batchNumberForm, 'batchNumber')"
|
||||
@blur="priceFormat(batchNumberForm, 'batchNumber')" v-model="batchNumberForm.batchNumber"
|
||||
controls-position="right" style="width: 100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="showBatchModal = false">取 消</el-button>
|
||||
<el-button type="primary" @click="batchNumberFormConfirm"
|
||||
>确 定</el-button
|
||||
>
|
||||
<el-button type="primary" @click="batchNumberFormConfirm">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- 选择团购券分类 -->
|
||||
<groupTypeList
|
||||
ref="groupTypeList"
|
||||
@success="(res) => (form.groupCategoryId = res)"
|
||||
/>
|
||||
<groupTypeList ref="groupTypeList" @success="(res) => (form.groupCategoryId = res)" />
|
||||
<!-- 选择图片 -->
|
||||
<addImg ref="addImg" @successEvent="successEvent"></addImg>
|
||||
</div>
|
||||
|
|
@ -792,6 +504,7 @@ export default {
|
|||
refundPolicy: "",
|
||||
usageRules: "",
|
||||
},
|
||||
stockNumber: 0
|
||||
},
|
||||
imgList: [],
|
||||
rules: {
|
||||
|
|
@ -1043,7 +756,7 @@ export default {
|
|||
this.form.specTableHeaders = JSON.stringify(this.specTableHeaders);
|
||||
this.form.specInfo = JSON.stringify(this.form.skuList);
|
||||
this.form.skuList[0].costPrice = 0
|
||||
this.form.skuList[0].originPrice = this.form.skuList[0].salePrice
|
||||
this.form.skuList[0].originPrice = this.form.skuList[0].salePrice
|
||||
if (this.form.id) {
|
||||
await tbProductPut(this.form);
|
||||
} else {
|
||||
|
|
@ -1255,7 +968,7 @@ export default {
|
|||
size: 100,
|
||||
});
|
||||
this.specList = res.content;
|
||||
} catch (error) {}
|
||||
} catch (error) { }
|
||||
},
|
||||
// 获取单位
|
||||
async tbShopUnit() {
|
||||
|
|
@ -1267,7 +980,7 @@ export default {
|
|||
size: 100,
|
||||
});
|
||||
this.units = res.content;
|
||||
} catch (error) {}
|
||||
} catch (error) { }
|
||||
},
|
||||
// 商品分类列表
|
||||
async tbShopCategoryGet() {
|
||||
|
|
@ -1383,7 +1096,7 @@ export default {
|
|||
z-index: 10;
|
||||
}
|
||||
|
||||
.showStyle:hover > .buttonstyle {
|
||||
.showStyle:hover>.buttonstyle {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,215 @@
|
|||
<template>
|
||||
<el-dialog width="80%" :visible.sync="dialogVisible" :show-close="false" @close="reset">
|
||||
<div class="header_wrap">
|
||||
<div class="title">耗材信息</div>
|
||||
<div class="btn_wrap">
|
||||
<div class="refund_stock">
|
||||
<span>退款退回库存</span>
|
||||
<el-switch v-model="isRefundStock"></el-switch>
|
||||
</div>
|
||||
<el-radio-group v-model="type">
|
||||
<el-radio-button label="1">添加至商品</el-radio-button>
|
||||
<el-radio-button label="2" v-if="goodsDetail.typeEnum == '多规格'">添加至规格</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name_wrap">
|
||||
<div class="name">商品名:{{ goodsDetail.name }}</div>
|
||||
</div>
|
||||
<el-table :data="tableData.cons">
|
||||
<el-table-column label="序号" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="耗材名称">
|
||||
<template v-slot="scope">
|
||||
<el-select v-model="scope.row.conInfoId" filterable remote reserve-keyword placeholder="请输入关键词"
|
||||
:remote-method="remoteMethod" :loading="loading" @change="selectionChange($event, scope.row)">
|
||||
<el-option v-for="item in options" :key="item.consId" :label="item.conName"
|
||||
:value="item.consId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<div class="tips" v-if="scope.row.stockNumber">库存:{{ scope.row.stockNumber }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位">
|
||||
<template v-slot="scope">
|
||||
<span v-if="scope.row.conInfoId">{{ scope.row.conUnit }}</span>
|
||||
<span v-else>请选择耗材</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="使用数量">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.surplusStock" :min="0" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px">
|
||||
<template v-slot="scope">
|
||||
<div class="table_btn_wrap">
|
||||
<div class="btn sub" @click="tableData.cons.splice(scope.$index, 1)">
|
||||
<i class="el-icon-remove-outline"></i>
|
||||
</div>
|
||||
<div class="btn add" @click="createItem">
|
||||
<i class="el-icon-circle-plus-outline"></i>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading=formLoading @click="onSubmitHandle">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { gettbConsInfo, tbProskuConV2 } from "@/api/consumable"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
type: '1',
|
||||
isRefundStock: true,
|
||||
goodsDetail: '',
|
||||
tableData: {
|
||||
productId: '',
|
||||
cons: [],
|
||||
},
|
||||
loading: false,
|
||||
options: [],
|
||||
formLoading: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.gettbConsInfo()
|
||||
},
|
||||
methods: {
|
||||
// 提交
|
||||
async onSubmitHandle() {
|
||||
try {
|
||||
this.formLoading = true
|
||||
const res = await tbProskuConV2(this.tableData)
|
||||
this.formLoading = false
|
||||
this.$message.success('编辑成功')
|
||||
this.dialogVisible = false
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
this.formLoading = false
|
||||
}
|
||||
},
|
||||
// 选择耗材
|
||||
selectionChange(e, row) {
|
||||
let item = this.options.find(item => item.consId == e)
|
||||
row.name = item.conName
|
||||
row.conUnit = item.conUnit
|
||||
},
|
||||
// 远程搜索耗材
|
||||
remoteMethod(query) {
|
||||
if (query !== '') {
|
||||
this.gettbConsInfo(query)
|
||||
}
|
||||
},
|
||||
// 获取耗材列表
|
||||
async gettbConsInfo(query = '') {
|
||||
try {
|
||||
this.loading = true;
|
||||
const res = await gettbConsInfo({
|
||||
page: 0,
|
||||
size: 100,
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
conName: query,
|
||||
})
|
||||
this.loading = false;
|
||||
this.options = res.content;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 显示
|
||||
show(obj) {
|
||||
this.dialogVisible = true
|
||||
this.goodsDetail = { ...obj }
|
||||
this.tableData.productId = this.goodsDetail.id
|
||||
if (obj.conInfos.length) {
|
||||
this.tableData.cons = [...obj.conInfos]
|
||||
} else {
|
||||
this.createItem()
|
||||
}
|
||||
},
|
||||
// 生成新关系项
|
||||
createItem() {
|
||||
let item = {}
|
||||
item.id = ''
|
||||
item.shopId = localStorage.getItem('shopId')
|
||||
item.productId = this.goodsDetail.id
|
||||
item.productSkuId = 0
|
||||
item.conInfoId = ''
|
||||
item.name = ''
|
||||
item.conUnit = ''
|
||||
item.surplusStock = 0
|
||||
item.status = 1
|
||||
this.tableData.cons.push(item)
|
||||
},
|
||||
reset() {
|
||||
this.goodsDetail = ''
|
||||
this.tableData.productId = ''
|
||||
this.tableData.cons = []
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .el-dialog__header {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.header_wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.btn_wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.refund_stock {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 20px;
|
||||
|
||||
span {
|
||||
margin-right: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.name_wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
.table_btn_wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
|
||||
.btn {
|
||||
font-size: 26px;
|
||||
|
||||
&.sub {
|
||||
color: #FF4D4F;
|
||||
}
|
||||
|
||||
&.add {
|
||||
color: #52C41A;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -32,13 +32,15 @@
|
|||
</el-row>
|
||||
</div>
|
||||
<div class="head-container" id="table_drag">
|
||||
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
|
||||
<el-table-column prop="id" label="ID" width="50px"></el-table-column>
|
||||
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id"
|
||||
:tree-props="{ children: 'skuList', hasChildren: 'hasChildren' }">
|
||||
<el-table-column width="50px"></el-table-column>
|
||||
<el-table-column label="商品信息">
|
||||
<template v-slot="scope">
|
||||
<div class="shop_info">
|
||||
<el-image :src="scope.row.coverImg"
|
||||
style="width: 50px;height: 50px;border-radius: 4px;background-color: #efefef;">
|
||||
style="width: 50px;height: 50px;border-radius: 4px;background-color: #efefef;"
|
||||
v-if="scope.row.coverImg">
|
||||
<div class="img_error" slot="error">
|
||||
<i class="icon el-icon-document-delete"></i>
|
||||
</div>
|
||||
|
|
@ -51,52 +53,68 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="售价">
|
||||
<template v-slot="scope">
|
||||
<span>¥{{ scope.row.lowPrice }}</span>
|
||||
<span v-if="scope.row.typeEnum == '多规格'">~¥{{ scope.row.maxPrice }}</span>
|
||||
<el-button type="text" v-if="scope.row.typeEnum == '多规格' && scope.row.skuList.length">
|
||||
{{ scope.row.lowPrice }}
|
||||
</el-button>
|
||||
<el-button type="text" v-else @click="changePrice('salePrice', scope.row,)">
|
||||
¥{{ scope.row.lowPrice }}
|
||||
<i class="el-icon-edit"></i>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品规格" prop="typeEnum">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="商品规格" prop="typeEnum"></el-table-column>
|
||||
<el-table-column label="库存">
|
||||
<template v-slot="scope">
|
||||
<span>{{ scope.row.stockNumber }}</span>
|
||||
<el-button type="text" v-if="scope.row.typeEnum" @click="changePrice('stockNumber', scope.row,)">
|
||||
{{ scope.row.stockNumber }}
|
||||
<i class="el-icon-edit"></i>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耗材信息">
|
||||
<el-table-column label="耗材信息" width="200">
|
||||
<template v-slot="scope">
|
||||
<div v-if="scope.row.conInfos.length">{{ scope.row.conInfos.join(',') }}</div>
|
||||
<el-button type="text" icon="el-icon-edit" v-else>绑定</el-button>
|
||||
<div class="cons_wrap">
|
||||
<div v-if="scope.row.conInfos && scope.row.conInfos.length">
|
||||
<span v-for="item in scope.row.conInfos" :key="item.id">{{ item.conName }}、</span>
|
||||
</div>
|
||||
<el-button type="text" @click="showBindCons(scope.row)">
|
||||
绑定
|
||||
<i class="el-icon-edit"></i>
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上架区域">
|
||||
<el-table-column label="上架">
|
||||
<template v-slot="scope">
|
||||
<!-- <el-button type="text" icon="el-icon-edit" v-if="scope.row.isShowCash">收银端</el-button>
|
||||
<el-button type="text" icon="el-icon-edit" v-if="scope.row.isShowMall">小程序</el-button>
|
||||
<el-button type="text" icon="el-icon-edit"
|
||||
v-if="!scope.row.isShowCash && !scope.row.isShowMall">未上架</el-button> -->
|
||||
<el-switch v-model="scope.row.isGrounding" :active-value="1" :inactive-value="0"
|
||||
@change="changeHot($event, scope.row)"></el-switch>
|
||||
@change="changeGrounding($event, scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" prop="sort" sortable />
|
||||
<el-table-column label="更新时间" prop="createdAt">
|
||||
<el-table-column label="更新时间" prop="createdAt" width="150">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设为热门" prop="createdAt">
|
||||
<!-- <el-table-column label="设为热门" prop="createdAt">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.isHot" :active-value="1" :inactive-value="0"
|
||||
@change="changeHot($event, scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" width="150">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" icon="el-icon-rank" v-if="isPcBowser">排序</el-button>
|
||||
<router-link :to="{ path: '/product/add_shop', query: { goods_id: scope.row.id } }"
|
||||
<!-- <el-button type="text" icon="el-icon-rank" v-if="isPcBowser">排序</el-button> -->
|
||||
<!-- <router-link :to="{ path: '/product/add_shop', query: { goods_id: scope.row.id } }"
|
||||
style="margin-left: 20px !important;">
|
||||
<el-button type="text" icon="el-icon-edit">编辑</el-button>
|
||||
</router-link> -->
|
||||
<router-link :to="{ path: '/product/add_shop', query: { goods_id: scope.row.id } }">
|
||||
<el-button type="text" icon="el-icon-edit">编辑</el-button>
|
||||
</router-link>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
||||
|
|
@ -111,6 +129,20 @@
|
|||
:page-size="tableData.size" @current-change="paginationChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</div>
|
||||
<!-- 绑定耗材 -->
|
||||
<BindCons ref="bindCons" />
|
||||
<!-- 编辑售价、库存 -->
|
||||
<el-dialog :title="editorEumn[editorForm.key]" :visible.sync="editorVisable" :show-close="false" width="300px">
|
||||
<el-form :model="editorForm">
|
||||
<el-form-item>
|
||||
<el-input-number v-model="editorForm.value" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="editorVisable = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="editorFormLoading" @click="editorConfirmChange">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -118,8 +150,12 @@
|
|||
import Sortable from 'sortablejs'
|
||||
import dayjs from 'dayjs'
|
||||
import settings from '@/settings'
|
||||
import { tbProductListV2, tbShopCategoryGet, tbProductDelete, tbProductIsHot, upProSort } from '@/api/shop'
|
||||
import BindCons from './components/bindCons.vue'
|
||||
import { tbProductListV2, tbShopCategoryGet, tbProductDelete, tbProductIsHot, upProSort, updateProductData } from '@/api/shop'
|
||||
export default {
|
||||
components: {
|
||||
BindCons
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dayjs,
|
||||
|
|
@ -137,6 +173,21 @@ export default {
|
|||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
editorEumn: {
|
||||
grounding: '上下架',
|
||||
pauseSale: '商品',
|
||||
stockNumber: '库存数量',
|
||||
salePrice: '售价'
|
||||
},
|
||||
editorVisable: false,
|
||||
editorFormLoading: false,
|
||||
editorForm: {
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
isSku: '',
|
||||
id: '',
|
||||
key: '',
|
||||
value: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -156,6 +207,53 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
changeGrounding(event, row) {
|
||||
this.editorForm.key = 'grounding'
|
||||
this.editorForm.id = row.id
|
||||
this.editorForm.isSku = !row.typeEnum
|
||||
this.editorForm.value = event
|
||||
|
||||
this.editorConfirmChange()
|
||||
},
|
||||
// 确认修改
|
||||
async editorConfirmChange() {
|
||||
try {
|
||||
this.editorFormLoading = true
|
||||
const res = await updateProductData([this.editorForm])
|
||||
this.editorFormLoading = false
|
||||
this.$message.success('修改成功')
|
||||
this.editorVisable = false
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
this.editorFormLoading = false
|
||||
}
|
||||
},
|
||||
// 修改售价
|
||||
changePrice(type, row) {
|
||||
this.editorVisable = true
|
||||
this.editorForm.key = type
|
||||
this.editorForm.id = row.id
|
||||
this.editorForm.isSku = !row.typeEnum
|
||||
|
||||
switch (type) {
|
||||
case 'salePrice':
|
||||
// 修改售价
|
||||
this.editorForm.value = row.lowPrice
|
||||
break;
|
||||
case 'stockNumber':
|
||||
// 修改库存
|
||||
this.editorForm.value = row.stockNumber
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 显示绑定耗材
|
||||
showBindCons(item) {
|
||||
// console.log(item);
|
||||
this.$refs.bindCons.show(item)
|
||||
},
|
||||
// 选择分类
|
||||
queryHandle() {
|
||||
localStorage.setItem('shopIndexQuery', JSON.stringify(this.query))
|
||||
|
|
@ -271,6 +369,12 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.cons_wrap {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.handle {
|
||||
font-size: 18px;
|
||||
color: #999;
|
||||
|
|
|
|||
|
|
@ -1,49 +1,79 @@
|
|||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" @open="reset">
|
||||
<el-dialog :title="title" top="80px" :visible.sync="dialogVisible" @open="reset">
|
||||
<h3 style="color: #3F9EFF;">
|
||||
基本信息设置
|
||||
</h3>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="140px" label-position="left">
|
||||
<el-form-item label="员工姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入员工姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="员工编号" prop="code">
|
||||
<el-input v-model="form.code" placeholder="请输入员工编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="员工账号" prop="account">
|
||||
<el-input v-model="form.account" placeholder="请输入员工账号,建议使用手机号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="登录密码">
|
||||
<el-input type="password" v-model="form.password" placeholder="请输入登录密码,不填默认123456" />
|
||||
</el-form-item>
|
||||
<el-form-item label="优惠类型">
|
||||
<el-radio-group v-model="form.discountType" @change="form.maxDiscountAmount = 0">
|
||||
<el-radio-button label="1">折扣</el-radio-button>
|
||||
<el-radio-button label="0">金额</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="最大优惠金额" v-if="form.discountType == 0">
|
||||
<el-input-number v-model="form.maxDiscountAmount" controls-position="right" :min="0" :max="100000"
|
||||
:step="0.1" style="width: 200px;"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="最低优惠折扣" v-if="form.discountType == 1">
|
||||
<el-input-number v-model="form.maxDiscountAmount" controls-position="right" :min="0" :max="0.99"
|
||||
:step="0.1" style="width: 200px;"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色" prop="roleId">
|
||||
<el-select v-model="form.roleId" placeholder="请选择角色">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in roles" :key="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="允许登录PC桌面端">
|
||||
<el-switch v-model="form.isPc" :active-value="1" :inactive-value="0"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="允许登录管理端">
|
||||
<el-switch v-model="form.isManage" :active-value="1" :inactive-value="0"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用">
|
||||
<el-switch v-model="form.status" :active-value="1" :inactive-value="0"></el-switch>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="员工姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入员工姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4"> </el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="员工编号" prop="code">
|
||||
<el-input v-model="form.code" placeholder="请输入员工编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="手机号" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4"> </el-col>
|
||||
<el-col :span="10"> <el-form-item label="员工账号" prop="account">
|
||||
<el-input v-model="form.account" placeholder="请输入员工账号,建议使用手机号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10"> <el-form-item label="登录密码">
|
||||
<el-input type="password" v-model="form.password" placeholder="请输入登录密码,不填默认123456" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4"> </el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="优惠类型">
|
||||
<el-radio-group v-model="form.discountType" @change="form.maxDiscountAmount = 0">
|
||||
<el-radio-button label="1">折扣</el-radio-button>
|
||||
<el-radio-button label="0">金额</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="最大优惠金额" v-if="form.discountType == 0">
|
||||
<el-input-number v-model="form.maxDiscountAmount" controls-position="right" :min="0"
|
||||
:max="100000" :step="0.1" style="width: 200px;"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="最低优惠折扣" v-if="form.discountType == 1">
|
||||
<el-input-number v-model="form.maxDiscountAmount" controls-position="right" :min="0" :max="0.99"
|
||||
:step="0.1" style="width: 200px;"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4"> </el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="角色" prop="roleId">
|
||||
<el-select v-model="form.roleId" placeholder="请选择角色">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in roles"
|
||||
:key="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<h3 style="color: #3F9EFF;">
|
||||
员工权限设置
|
||||
</h3>
|
||||
<div v-for="item in form.permissions" :key="item.id">
|
||||
<h4>{{ item.label }}</h4>
|
||||
<el-checkbox v-for="ele in item.children" :true-label="1" :false-label="0" v-model="ele.hasPermission"
|
||||
:key="ele.id" :label="ele.label"></el-checkbox>
|
||||
</div>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
|
|
@ -53,7 +83,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { tbPlussShopStaff, rolesGet, tbPlussShopStaffDetail } from '@/api/shop.js'
|
||||
import { tbPlussShopStaff, rolesGet, tbPlussShopStaffDetail, tbShopPermissionlist } from '@/api/shop.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -64,14 +94,15 @@ export default {
|
|||
name: '',
|
||||
code: '',
|
||||
account: '',
|
||||
discountType: '1',
|
||||
discountType: '',
|
||||
maxDiscountAmount: '',
|
||||
status: 1,
|
||||
isPc: 1,
|
||||
isManage: 1,
|
||||
roleId: '',
|
||||
phone: '',
|
||||
password: ''
|
||||
password: '',
|
||||
checkList: ['选中且禁用', '复选框 A']
|
||||
},
|
||||
resetForm: '',
|
||||
rules: {
|
||||
|
|
@ -126,6 +157,7 @@ export default {
|
|||
return this.form.id ? '编辑员工' : '添加员工'
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.resetForm = { ...this.form }
|
||||
this.rolesGet()
|
||||
|
|
@ -137,6 +169,9 @@ export default {
|
|||
if (valid) {
|
||||
try {
|
||||
this.loading = true
|
||||
if (this.form.id) {
|
||||
this.form.staff_id = this.form.id
|
||||
}
|
||||
await tbPlussShopStaff(this.form)
|
||||
this.loading = false
|
||||
this.$emit('success')
|
||||
|
|
@ -174,9 +209,15 @@ export default {
|
|||
// this.form = { ...row }
|
||||
this.tbPlussShopStaffDetail(row.id)
|
||||
} else {
|
||||
this.reset()
|
||||
// this.reset()
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
// 获取员工信息
|
||||
async getList() {
|
||||
const res = await tbShopPermissionlist()
|
||||
this.$set(this.form, 'permissions', res)
|
||||
},
|
||||
// 通过id获取员工信息
|
||||
async tbPlussShopStaffDetail(id) {
|
||||
try {
|
||||
|
|
@ -188,4 +229,9 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
<style>
|
||||
el-dialog {
|
||||
padding-top: 6vh !important;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="app-container">
|
||||
<el-radio-group v-model="tableActive" @change="selectItemChange">
|
||||
<el-radio-button :label="item.autokey" v-for="item in tableData" :key="item.autokey">
|
||||
{{ item.title }}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<el-tab-pane label="基础配置" name="2"></el-tab-pane>
|
||||
<!-- <el-tab-pane label="通知配置" name="3"></el-tab-pane> -->
|
||||
<el-tab-pane label="安全设置" name="4"></el-tab-pane>
|
||||
<el-tab-pane label="店铺装修" name="5"></el-tab-pane>
|
||||
<!-- <el-tab-pane label="店铺装修" name="5"></el-tab-pane> -->
|
||||
<el-tab-pane label="跳转小程序" name="6" v-if="shopId == 1"></el-tab-pane>
|
||||
<el-tab-pane label="通知中心" name="7"></el-tab-pane>
|
||||
<el-tab-pane label="店铺收款码" name="9"></el-tab-pane>
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
<shopSetting v-if="activeName == 2" />
|
||||
<notice v-if="activeName == 3" />
|
||||
<securitySetting v-if="activeName == 4" />
|
||||
<Fitment v-if="activeName == 5" />
|
||||
<!-- <Fitment v-if="activeName == 5" /> -->
|
||||
<goxcx v-if="activeName == 6" />
|
||||
<notifications v-if="activeName == 7" />
|
||||
<ShopMode v-if="activeName == 8" />
|
||||
|
|
@ -49,7 +49,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: '5',
|
||||
activeName: '1',
|
||||
shopId: localStorage.getItem('shopId')
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ export default {
|
|||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
<style scoped lang="scss">
|
||||
.avatar {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
|
|
|
|||
|
|
@ -476,7 +476,7 @@ export default {
|
|||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
<style scoped lang="scss" scoped>
|
||||
::v-deep .vue-treeselect__control,::v-deep .vue-treeselect__placeholder,::v-deep .vue-treeselect__single-value {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,9 @@
|
|||
label-position="left"
|
||||
>
|
||||
<el-form-item label="选择区域" prop="areaId">
|
||||
<el-select v-model="form.areaId" placeholder="请选择区域">
|
||||
<el-select v-model="form.areaId" placeholder="请选择区域"
|
||||
@change="selectChange($event, 'form' , 'areaId')"
|
||||
>
|
||||
<el-option
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
|
|
@ -32,7 +34,7 @@
|
|||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="台桌标识" >
|
||||
<el-form-item label="台桌标识" prop="sign">
|
||||
<div class="u-flex">
|
||||
<div class="u-flex" style="width: 57px;">
|
||||
<el-input
|
||||
|
|
@ -155,14 +157,14 @@ export default {
|
|||
{
|
||||
required: true,
|
||||
message: "请选择区域",
|
||||
trigger: "blur",
|
||||
trigger: ["blur","change"],
|
||||
},
|
||||
],
|
||||
sign: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入台桌标识",
|
||||
trigger: "blur",
|
||||
trigger: ["blur","change"],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -173,6 +175,10 @@ export default {
|
|||
this.resetForm = { ...this.form };
|
||||
},
|
||||
methods: {
|
||||
//解决selectc值改变后未验证问题
|
||||
selectChange($event, ref, type) {
|
||||
this.$refs[ref][0].validateField(type)
|
||||
},
|
||||
onSubmitHandle() {
|
||||
this.$refs.form.validate(async (valid) => {
|
||||
if (valid) {
|
||||
|
|
|
|||
|
|
@ -97,7 +97,6 @@ export default {
|
|||
this.number = newval;
|
||||
},
|
||||
number(newval) {
|
||||
console.log(newval);
|
||||
this.$emit("input", newval);
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -53,13 +53,10 @@ export default {
|
|||
},
|
||||
watch: {
|
||||
number(newval) {
|
||||
console.log(newval)
|
||||
console.log(this.max)
|
||||
if (newval >this.max) {
|
||||
this.number = this.max;
|
||||
this.$message("最多只能选择"+this.max+"位就餐人数");
|
||||
}
|
||||
console.log(newval);
|
||||
// 使用正则表达式匹配正整数
|
||||
const regex = /^[1-9]\d*$/;
|
||||
// 如果输入的值不是正整数,则将其设置为上一个有效值
|
||||
|
|
@ -76,14 +73,13 @@ export default {
|
|||
this.number = "";
|
||||
},
|
||||
confirm() {
|
||||
console.log(this.number)
|
||||
console.log(this.max)
|
||||
if (this.number >this.max) {
|
||||
return this.$message("最多只能选择"+this.max+"位就餐人数");
|
||||
}
|
||||
if (!this.number) {
|
||||
return this.$message("请选择就餐人数");
|
||||
}
|
||||
console.log(this.number)
|
||||
this.$emit("confirm", this.number);
|
||||
this.close();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@
|
|||
<div class="el-dialog__title" style="margin-right: 10px">
|
||||
{{ title }}
|
||||
</div>
|
||||
<el-dropdown @command="changePostPay">
|
||||
<!-- 先付后付start -->
|
||||
<!-- <el-dropdown @command="changePostPay">
|
||||
<el-button plain type="primary" size="mini">
|
||||
{{ postPay ? "后付费" : "先付费" }}
|
||||
<i class="el-icon-caret-bottom"></i>
|
||||
|
|
@ -21,7 +22,11 @@
|
|||
<el-dropdown-item :command="false">先付费</el-dropdown-item>
|
||||
<el-dropdown-item :command="true">后付费</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-dropdown> -->
|
||||
<el-button plain type="primary" size="mini">
|
||||
{{ postPay ? "后付费" : "先付费" }}
|
||||
</el-button>
|
||||
<!-- 先付后付end -->
|
||||
<span
|
||||
@click="toggleFullScreen"
|
||||
class="flex flex-xy-center cur-pointer full-screen"
|
||||
|
|
@ -173,6 +178,18 @@
|
|||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="u-m-l-20 u-p-b-10 meal_box">
|
||||
<el-button-group>
|
||||
<el-button
|
||||
:class="{ active: item.value == useTypes.sel }"
|
||||
:disabled="order.old.list.length > 0"
|
||||
v-for="(item, index) in useTypes.list"
|
||||
@click="changeUseType(item.value)"
|
||||
:key="index"
|
||||
>{{ item.name }}</el-button
|
||||
>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<div class="flex row-between table-list u-m-l-20">
|
||||
<!-- <div class="tableId" @click="chooseTableOpen"> -->
|
||||
<el-popover
|
||||
|
|
@ -203,15 +220,27 @@
|
|||
|
||||
<div class="u-flex">
|
||||
<div class="u-p-r-14 border-r u-m-r-14">
|
||||
<div
|
||||
class="u-flex cur-pointer"
|
||||
@click="refToggle('refChooseDinersNumber', true, perpole)"
|
||||
>
|
||||
<span>就餐人数:{{ perpole }}位</span>
|
||||
<span
|
||||
class="el-icon-arrow-right diningPeople_cell_arrow"
|
||||
></span>
|
||||
</div>
|
||||
<template v-if="!shopInfo.isTableFee">
|
||||
<div
|
||||
class="u-flex cur-pointer"
|
||||
@click="
|
||||
refToggle('refChooseDinersNumber', true, perpole)
|
||||
"
|
||||
>
|
||||
<span>就餐人数:{{ perpole }}位</span>
|
||||
<span
|
||||
class="el-icon-arrow-right diningPeople_cell_arrow"
|
||||
></span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="u-flex">
|
||||
<span>就餐人数:-位</span>
|
||||
<span
|
||||
class="el-icon-arrow-right diningPeople_cell_arrow"
|
||||
></span>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<el-button
|
||||
@click="clearCart"
|
||||
|
|
@ -1071,6 +1100,8 @@ import chooseDinersNumber from "./table-diancan-components/choose-diners-number.
|
|||
import returnCart from "./table-diancan-components/return-cart.vue";
|
||||
import moneyKeyboard from "./money-keyboard.vue";
|
||||
import dayjs from "dayjs";
|
||||
import { tbShopInfo } from "@/api/user";
|
||||
|
||||
import {
|
||||
getGoodsLists,
|
||||
addCart,
|
||||
|
|
@ -1090,7 +1121,8 @@ import {
|
|||
$choseCount,
|
||||
$returnCart,
|
||||
$printOrder,
|
||||
tbShopTableGet
|
||||
tbShopTableGet,
|
||||
$changeUseType,
|
||||
} from "@/api/table";
|
||||
import { tbShopCategoryGet } from "@/api/shop";
|
||||
import {
|
||||
|
|
@ -1115,6 +1147,22 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
//店铺信息
|
||||
shopInfo: {},
|
||||
//就餐饭方式
|
||||
useTypes: {
|
||||
list: [
|
||||
{
|
||||
name: "堂食",
|
||||
value: "dine-in",
|
||||
},
|
||||
{
|
||||
name: "自取",
|
||||
value: "takeout",
|
||||
},
|
||||
],
|
||||
sel: "dine-in",
|
||||
},
|
||||
//台桌列表
|
||||
tableList: [],
|
||||
tableShow: false,
|
||||
|
|
@ -1179,7 +1227,7 @@ export default {
|
|||
total: 0,
|
||||
},
|
||||
order: {
|
||||
seatFee:{totalAmount:0},//餐位费
|
||||
seatFee: { totalAmount: 0 }, //餐位费
|
||||
orderId: "",
|
||||
payType: "",
|
||||
masterId: "",
|
||||
|
|
@ -1218,7 +1266,7 @@ export default {
|
|||
},
|
||||
query: {
|
||||
page: 1,
|
||||
size: 20,
|
||||
size: 200,
|
||||
},
|
||||
number: 1,
|
||||
cacheNumber: 1,
|
||||
|
|
@ -1318,7 +1366,7 @@ export default {
|
|||
allPrice() {
|
||||
const oldPrice = this.order.old.list.reduce((a, b) => {
|
||||
const bTotal = b.info
|
||||
.filter((v) => v.isGift !== "true"&& v.status !== "return")
|
||||
.filter((v) => v.isGift !== "true" && v.status !== "return")
|
||||
.reduce((prve, cur) => {
|
||||
return prve + cur.number * cur.salePrice;
|
||||
}, 0);
|
||||
|
|
@ -1329,7 +1377,7 @@ export default {
|
|||
.reduce((a, b) => {
|
||||
return a + b.number * b.salePrice;
|
||||
}, 0);
|
||||
return (oldPrice + price+this.order.seatFee.totalAmount*1).toFixed(2);
|
||||
return (oldPrice + price + this.order.seatFee.totalAmount * 1).toFixed(2);
|
||||
},
|
||||
allNumber() {
|
||||
const oldNumber = this.order.old.list.reduce((a, b) => {
|
||||
|
|
@ -1374,8 +1422,13 @@ export default {
|
|||
},
|
||||
},
|
||||
watch: {
|
||||
perpole(newval,oldval) {
|
||||
if (!oldval&&newval&&this.table.tableId) {
|
||||
"useTypes.sel": function (newval, oldval) {
|
||||
console.log(newval);
|
||||
this.setPostPay();
|
||||
this.setUseType();
|
||||
},
|
||||
perpole(newval, oldval) {
|
||||
if (!oldval && newval && this.table.tableId) {
|
||||
// $choseCount({
|
||||
// masterId: this.masterId,
|
||||
// tableId: this.table.tableId,
|
||||
|
|
@ -1386,9 +1439,9 @@ export default {
|
|||
}
|
||||
},
|
||||
table(oldval, newval) {
|
||||
if(oldval&&newval) {
|
||||
this.onTableChange()
|
||||
}
|
||||
if (oldval && newval) {
|
||||
this.onTableChange();
|
||||
}
|
||||
// if (oldval && newval) {
|
||||
// console.log(oldval, newval);
|
||||
// $choseTable({
|
||||
|
|
@ -1407,8 +1460,8 @@ export default {
|
|||
}
|
||||
},
|
||||
"vipUser.id": async function (val) {
|
||||
if(!this.table.tableId){
|
||||
return
|
||||
if (!this.table.tableId) {
|
||||
return;
|
||||
}
|
||||
let masterId = this.order.masterId;
|
||||
if (!masterId) {
|
||||
|
|
@ -1533,17 +1586,69 @@ export default {
|
|||
// this.getCategory();
|
||||
// this.refToggle('refScanCode',true)
|
||||
// this.refToggle("refDiscount", true);
|
||||
this.getShopInfo();
|
||||
},
|
||||
methods: {
|
||||
changeOrderUseType(useType) {
|
||||
if (useType && this.order.list.length) {
|
||||
$changeUseType({
|
||||
useType,
|
||||
cartIds: this.order.list.map((v) => v.id),
|
||||
});
|
||||
}
|
||||
},
|
||||
//设置用餐类型
|
||||
setUseType() {
|
||||
// 自取
|
||||
let useType = "takeout";
|
||||
if (this.useTypes.sel == "takeout") {
|
||||
localStorage.setItem("useType", "takeout");
|
||||
} else {
|
||||
//堂食
|
||||
useType = `dine-in-${this.postPay ? "after" : "before"}`;
|
||||
localStorage.setItem("useType", useType);
|
||||
}
|
||||
this.changeOrderUseType(useType);
|
||||
},
|
||||
//设置先付后付
|
||||
setPostPay() {
|
||||
// 自取
|
||||
// postPay true 后付 false 先付
|
||||
|
||||
if (this.useTypes.sel == "takeout") {
|
||||
this.postPay = false;
|
||||
} else {
|
||||
//munchies 先付 restaurant 后付
|
||||
this.postPay = this.shopInfo.registerType == "munchies" ? false : true;
|
||||
}
|
||||
},
|
||||
//获取店铺信息
|
||||
async getShopInfo() {
|
||||
try {
|
||||
const shopId = localStorage.getItem("shopId");
|
||||
const res = await tbShopInfo(shopId);
|
||||
this.shopInfo = res;
|
||||
this.setPostPay();
|
||||
this.setUseType();
|
||||
} catch (error) {}
|
||||
},
|
||||
//更改就餐方式
|
||||
changeUseType(type) {
|
||||
if (this.order.old.list.length > 0) {
|
||||
return this.$message("下单后不支持更改就餐方式");
|
||||
}
|
||||
console.log(type);
|
||||
this.useTypes.sel = type;
|
||||
},
|
||||
//更改就餐人数
|
||||
changePerpole(){
|
||||
changePerpole() {
|
||||
$choseCount({
|
||||
masterId: this.masterId,
|
||||
tableId: this.table.tableId,
|
||||
num: this.perpole,
|
||||
}).then(res=>{
|
||||
this.order.seatFee=res
|
||||
})
|
||||
masterId: this.masterId,
|
||||
tableId: this.table.tableId,
|
||||
num: this.perpole,
|
||||
}).then((res) => {
|
||||
this.order.seatFee = res;
|
||||
});
|
||||
},
|
||||
//台桌变化时重新获取取餐号、购物车数据,如果是正在结账状态,创建订单到待支付页面
|
||||
async onTableChange() {
|
||||
|
|
@ -1555,11 +1660,11 @@ export default {
|
|||
}
|
||||
},
|
||||
// 获取台桌详情
|
||||
async getTableDetail(){
|
||||
const res=await tbShopTableGet({
|
||||
qrcode:this.table.tableId
|
||||
})
|
||||
console.log(res)
|
||||
async getTableDetail() {
|
||||
const res = await tbShopTableGet({
|
||||
qrcode: this.table.tableId,
|
||||
});
|
||||
console.log(res);
|
||||
},
|
||||
//打印制作单
|
||||
printOrder() {
|
||||
|
|
@ -1587,7 +1692,7 @@ export default {
|
|||
tableId: this.table.tableId,
|
||||
});
|
||||
this.order.selGoods.status = "return";
|
||||
this.order.old.selIndex=-1;
|
||||
this.order.old.selIndex = -1;
|
||||
console.log(this.order.selGoods);
|
||||
},
|
||||
// 台桌列表
|
||||
|
|
@ -1596,7 +1701,7 @@ export default {
|
|||
const { content, total } = await tbShopTableGet({
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
});
|
||||
this.tableList = content.filter(v=>v.status!='closed');
|
||||
this.tableList = content.filter((v) => v.status != "closed");
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
|
@ -1607,8 +1712,7 @@ export default {
|
|||
},
|
||||
chooseDinersNumberConfirm(e) {
|
||||
this.perpole = e;
|
||||
this.changePerpole()
|
||||
|
||||
this.changePerpole();
|
||||
},
|
||||
//扫码支付弹窗确认
|
||||
scanPayConfirm(code) {
|
||||
|
|
@ -1794,6 +1898,8 @@ export default {
|
|||
},
|
||||
//生成订单
|
||||
toCreateOrderDebounce(isNowPay) {
|
||||
console.log(this.createOrder.status);
|
||||
|
||||
if (
|
||||
this.createOrder.status != "" &&
|
||||
this.createOrder.status != "success"
|
||||
|
|
@ -1806,7 +1912,9 @@ export default {
|
|||
async toCreateOrder(isNowPay = false) {
|
||||
console.log(this.order);
|
||||
console.log(this.order.orderId);
|
||||
const res = await $createOrder({
|
||||
let res=''
|
||||
try {
|
||||
res = await $createOrder({
|
||||
masterId: this.order.masterId || this.masterId,
|
||||
vipUserId: this.vipUser.id,
|
||||
tableId: this.table.tableId,
|
||||
|
|
@ -1814,6 +1922,13 @@ export default {
|
|||
postPay: this.postPay,
|
||||
orderld: this.order.orderId,
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
if(!res){
|
||||
this.createOrder.status = "success";
|
||||
return
|
||||
}
|
||||
//后付款
|
||||
console.log(this.postPay);
|
||||
console.log(isNowPay);
|
||||
|
|
@ -2394,7 +2509,7 @@ export default {
|
|||
.filter((v) => v.specSnap.match(i))
|
||||
.every((v) => {
|
||||
// return isCanBuy(v,this.selGoods.data.isStock)
|
||||
return isCanBuy(v);
|
||||
return !isCanBuy(v);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -2443,7 +2558,7 @@ export default {
|
|||
this.order.selPlaceNum = -1;
|
||||
this.order.old.list = [];
|
||||
this.order.selGoods = "";
|
||||
this.order.seatFee={totalAmount:0}//餐位费
|
||||
this.order.seatFee = { totalAmount: 0 }; //餐位费
|
||||
this.prveOrder.list = [];
|
||||
this.prveOrder.selIndex = -1;
|
||||
this.order.old.selIndex = -1;
|
||||
|
|
@ -2461,21 +2576,22 @@ export default {
|
|||
this.key = "";
|
||||
this.order.orderId = "";
|
||||
this.perpole = "";
|
||||
this.useTypes.sel = "dine-in";
|
||||
},
|
||||
//获取购物车数据
|
||||
async getCart() {
|
||||
console.log(this.table)
|
||||
console.log(this.table);
|
||||
const res = await getCart({
|
||||
...this.order.query,
|
||||
masterId: this.masterId,
|
||||
tableId: this.table.tableId,
|
||||
});
|
||||
this.order.seatFee=res.seatFee?res.seatFee:this.order.seatFee;
|
||||
this.perpole=res.seatFee?res.seatFee.totalNumber:1;
|
||||
const nowCart=res.records.find((v) => v.placeNum == 0);
|
||||
this.order.list=nowCart?nowCart.info:[];
|
||||
const oldCart=res.records.filter((v) => v.placeNum != 0);
|
||||
this.order.old.list=oldCart?oldCart:[];
|
||||
this.order.seatFee = res.seatFee ? res.seatFee : this.order.seatFee;
|
||||
this.perpole = res.seatFee ? res.seatFee.totalNumber : 1;
|
||||
const nowCart = res.records.find((v) => v.placeNum == 0);
|
||||
this.order.list = nowCart ? nowCart.info : [];
|
||||
const oldCart = res.records.filter((v) => v.placeNum != 0);
|
||||
this.order.old.list = oldCart ? oldCart : [];
|
||||
// if (this.key|| res.records.length) {
|
||||
// this.order.old.list = res.records;
|
||||
// } else {
|
||||
|
|
@ -2723,6 +2839,10 @@ export default {
|
|||
},
|
||||
async open(item, key, perpoleNumber) {
|
||||
this.table = item;
|
||||
if(item.useType){
|
||||
localStorage.setItem("useType",item.useType);
|
||||
this.useTypes.sel = item.useType=='takeout'?item.useType:item.useType.replace(/-after|-before/g,'');
|
||||
}
|
||||
this.key = key;
|
||||
if (this.key == "isPayOrder") {
|
||||
this.isCreateOrder = true;
|
||||
|
|
@ -2738,7 +2858,17 @@ export default {
|
|||
// if(this.key!=='isPayOrder'){
|
||||
// this.getCart();
|
||||
// }
|
||||
this.changePerpole()
|
||||
// this.changePerpole()
|
||||
|
||||
if (!this.shopInfo.isTableFee) {
|
||||
//不免餐位费
|
||||
await $choseCount({
|
||||
masterId: this.masterId,
|
||||
tableId: this.table.tableId,
|
||||
num: this.perpole,
|
||||
});
|
||||
}
|
||||
|
||||
this.getCart();
|
||||
this.getGoods();
|
||||
this.getCategory();
|
||||
|
|
@ -2822,6 +2952,19 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||
::v-deep .el-button--text {
|
||||
// color: #000;
|
||||
}
|
||||
::v-deep .meal_box .el-button-group {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
}
|
||||
::v-deep .meal_box .el-button-group .el-button {
|
||||
flex: 1;
|
||||
}
|
||||
::v-deep .meal_box .el-button-group .active {
|
||||
border: 1px solid #409eff !important;
|
||||
color: #409eff !important;
|
||||
background: rgba(24, 144, 255, 0.1) !important;
|
||||
z-index: 10;
|
||||
}
|
||||
::v-deep .number-box .el-input__inner {
|
||||
border: none;
|
||||
padding: 0 4px;
|
||||
|
|
|
|||
|
|
@ -223,6 +223,7 @@ import downloadTableCode from "./components/downloadTableCode";
|
|||
import tableDiancan from "./components/table-diancan.vue";
|
||||
import $status from "./status.js";
|
||||
import chooseDinersNumber from "./components/table-diancan-components/choose-diners-number.vue";
|
||||
import { tbShopInfo } from "@/api/user";
|
||||
|
||||
import {
|
||||
tbShopTableGet,
|
||||
|
|
@ -251,10 +252,13 @@ export default {
|
|||
status: $status,
|
||||
selTable: "", //当前选中的桌台
|
||||
areaMap: {},
|
||||
shopInfo:{},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.tbShopAreaGet();
|
||||
this.getShopInfo()
|
||||
|
||||
},
|
||||
filters: {
|
||||
formatTime(time) {
|
||||
|
|
@ -262,6 +266,15 @@ export default {
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
//获取店铺信息
|
||||
async getShopInfo() {
|
||||
try {
|
||||
const shopId = localStorage.getItem("shopId");
|
||||
const res = await tbShopInfo(shopId);
|
||||
this.shopInfo=res
|
||||
console.log(res)
|
||||
} catch (error) {}
|
||||
},
|
||||
// 清台
|
||||
cleanTableHandle(item) {
|
||||
this.$confirm("确定要清台:"+item.name, "提示", {
|
||||
|
|
@ -308,6 +321,11 @@ export default {
|
|||
//key isAddGoods 加菜
|
||||
//key isPayOrder结账
|
||||
this.selTable = item;
|
||||
if(this.shopInfo.isTableFee){
|
||||
//免餐位费
|
||||
this.$refs.diancan.open(item, key, '');
|
||||
return
|
||||
}
|
||||
const num = item.useNum || 0;
|
||||
if (item.useNum <= 0) {
|
||||
return this.$refs.refChooseDinersNumber.open();
|
||||
|
|
|
|||
Loading…
Reference in New Issue