Merge branch 'ymf' of https://e.coding.net/g-cphe0354/yinshoukeguanliduan/management into test
This commit is contained in:
commit
516ce90284
|
|
@ -5,7 +5,10 @@ ENV = 'development'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.2.42:8000'
|
# VUE_APP_BASE_API = 'http://192.168.2.42:8000'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.2.133:8000'
|
# VUE_APP_BASE_API = 'http://192.168.2.133:8000'
|
||||||
# 测试
|
# 测试
|
||||||
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
# VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
||||||
|
#预发布
|
||||||
|
VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn'
|
||||||
|
|
||||||
# 生产
|
# 生产
|
||||||
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.2.96:8000'
|
# VUE_APP_BASE_API = 'http://192.168.2.96:8000'
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@ ENV = 'production'
|
||||||
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
||||||
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
||||||
# 测试
|
# 测试
|
||||||
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
# VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
||||||
|
|
||||||
# 生产
|
# 生产
|
||||||
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||||
|
|
||||||
# 预发布接口
|
# 预发布接口
|
||||||
# VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn'
|
VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn'
|
||||||
|
|
||||||
# VUE_APP_BASE_API = 'http://192.168.2.98:8000'
|
# VUE_APP_BASE_API = 'http://192.168.2.98:8000'
|
||||||
# 如果接口是 http 形式, wss 需要改为 ws
|
# 如果接口是 http 形式, wss 需要改为 ws
|
||||||
|
|
|
||||||
|
|
@ -450,3 +450,14 @@ export function $returnOrder(data) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
//获取台桌详情状态
|
||||||
|
export function $returnTableDetail(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/tbShopTable/state',
|
||||||
|
method: "get",
|
||||||
|
params:{
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,12 +130,14 @@
|
||||||
¥{{ scope.row.priceAmount }}
|
¥{{ scope.row.priceAmount }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作">
|
<!-- <el-table-column label="操作">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button v-if="detail.status=='closed'" type="text" size="mini" @click="tuikuan(scope.row)"><span >退款</span></el-button>
|
<template v-if="scope.row.status!='refund'">
|
||||||
|
<el-button v-if="detail.status=='closed'||detail.status=='refund'" type="text" size="mini" @click="tuikuan(scope.row)"><span >退款</span></el-button>
|
||||||
|
</template>
|
||||||
<el-button v-if="detail.status=='unpaid'" type="text" size="mini" @click="tuiCai(scope.row)"><span >退菜</span></el-button>
|
<el-button v-if="detail.status=='unpaid'" type="text" size="mini" @click="tuiCai(scope.row)"><span >退菜</span></el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<!-- </el-tab-pane> -->
|
<!-- </el-tab-pane> -->
|
||||||
|
|
|
||||||
|
|
@ -790,7 +790,7 @@ export default {
|
||||||
this.form.selectSpec = JSON.stringify(this.selectSpec);
|
this.form.selectSpec = JSON.stringify(this.selectSpec);
|
||||||
this.form.specTableHeaders = JSON.stringify(this.specTableHeaders);
|
this.form.specTableHeaders = JSON.stringify(this.specTableHeaders);
|
||||||
this.form.specInfo = JSON.stringify(this.form.skuList);
|
this.form.specInfo = JSON.stringify(this.form.skuList);
|
||||||
this.form.skuList[0].costPrice = 0
|
// 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) {
|
if (this.form.id) {
|
||||||
await tbProductPut(this.form);
|
await tbProductPut(this.form);
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,18 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div class="btn_wrap">
|
<div class="btn_wrap" v-if="!form.list.length">
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<el-button>一键生成菜单</el-button>
|
<el-button @click="oneClick">一键生成菜单</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="goods_list" v-else>
|
||||||
|
<div class="btn_wrap" :class="[`div${index + 1}`]" v-for="(item, index) in form.list"
|
||||||
|
:key="index" @click="selectGoods(item)">
|
||||||
|
<div class="info" :class="{ active: item.active }">
|
||||||
|
<span class="t1">{{ item.name }}</span>
|
||||||
|
<span class="t1">¥{{ item.lowPrice }}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -43,6 +52,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import shopList from '@/components/shopList/index.vue'
|
import shopList from '@/components/shopList/index.vue'
|
||||||
|
import { tbProduct } from '@/api/shop.js'
|
||||||
import { layoutlist, productGroup, productCategoryDetail, productGroupPut } from '@/api/pad.js'
|
import { layoutlist, productGroup, productCategoryDetail, productGroupPut } from '@/api/pad.js'
|
||||||
export default {
|
export default {
|
||||||
components: { shopList },
|
components: { shopList },
|
||||||
|
|
@ -71,9 +81,58 @@ export default {
|
||||||
this.layoutlist()
|
this.layoutlist()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 选中菜品
|
||||||
|
selectGoods(item) {
|
||||||
|
item.active = !item.active
|
||||||
|
},
|
||||||
|
// 一键生成菜单
|
||||||
|
async oneClick() {
|
||||||
|
try {
|
||||||
|
const res = await tbProduct({
|
||||||
|
categoryId: this.category,
|
||||||
|
page: 0,
|
||||||
|
size: 20,
|
||||||
|
sort: "id",
|
||||||
|
shopId: localStorage.getItem('shopId')
|
||||||
|
})
|
||||||
|
this.form.list = res.content.map((item, index) => {
|
||||||
|
if (index == 0 || index == 12) {
|
||||||
|
item.active = true
|
||||||
|
} else {
|
||||||
|
item.active = false
|
||||||
|
}
|
||||||
|
return item
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
// 提交
|
// 提交
|
||||||
async submitHandle() {
|
async submitHandle() {
|
||||||
try {
|
try {
|
||||||
|
if (this.typeList.find(item => item.id == this.typeListActive).code == 'text-menu') {
|
||||||
|
if (!this.form.list.length) {
|
||||||
|
this.$notify.error({
|
||||||
|
title: '错误',
|
||||||
|
message: '请生成菜单'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let isEmpty = true
|
||||||
|
this.form.list.map(item => {
|
||||||
|
if (!item.id) isEmpty = false
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!isEmpty) {
|
||||||
|
this.$notify.error({
|
||||||
|
title: '错误',
|
||||||
|
message: '请添加商品'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
this.loading = true
|
this.loading = true
|
||||||
let res = null
|
let res = null
|
||||||
if (this.form.id) {
|
if (this.form.id) {
|
||||||
|
|
@ -99,7 +158,17 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.$message.success(this.form.id ? '编辑成功' : '添加成功')
|
if (this.form.id) {
|
||||||
|
this.$notify.success({
|
||||||
|
title: '提示',
|
||||||
|
message: '编辑成功'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$notify.success({
|
||||||
|
title: '提示',
|
||||||
|
message: '添加成功'
|
||||||
|
})
|
||||||
|
}
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.$emit('success')
|
this.$emit('success')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -264,9 +333,139 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.type6 {
|
||||||
|
.goods_list {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
grid-template-rows: repeat(10, 1fr);
|
||||||
|
grid-column-gap: 20px;
|
||||||
|
grid-row-gap: 0px;
|
||||||
|
|
||||||
|
.div1 {
|
||||||
|
grid-area: 1 / 1 / 2 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div2 {
|
||||||
|
grid-area: 2 / 1 / 3 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div3 {
|
||||||
|
grid-area: 3 / 1 / 4 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div4 {
|
||||||
|
grid-area: 4 / 1 / 5 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div5 {
|
||||||
|
grid-area: 5 / 1 / 6 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div6 {
|
||||||
|
grid-area: 6 / 1 / 7 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div7 {
|
||||||
|
grid-area: 7 / 1 / 8 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div8 {
|
||||||
|
grid-area: 8 / 1 / 9 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div9 {
|
||||||
|
grid-area: 9 / 1 / 10 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div10 {
|
||||||
|
grid-area: 10 / 1 / 11 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div11 {
|
||||||
|
grid-area: 1 / 2 / 2 / 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div12 {
|
||||||
|
grid-area: 2 / 2 / 3 / 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div13 {
|
||||||
|
grid-area: 3 / 2 / 4 / 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div14 {
|
||||||
|
grid-area: 4 / 2 / 5 / 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div15 {
|
||||||
|
grid-area: 5 / 2 / 6 / 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div16 {
|
||||||
|
grid-area: 6 / 2 / 7 / 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div17 {
|
||||||
|
grid-area: 7 / 2 / 8 / 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div18 {
|
||||||
|
grid-area: 8 / 2 / 9 / 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div19 {
|
||||||
|
grid-area: 9 / 2 / 10 / 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div20 {
|
||||||
|
grid-area: 10 / 2 / 11 / 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods_list {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.btn_wrap {
|
.btn_wrap {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.info {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-bottom: 1px solid #ececec;
|
||||||
|
padding: 0 20px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
background-color: #BC1414;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: "";
|
||||||
|
width: 120px;
|
||||||
|
height: 60px;
|
||||||
|
border: 22px solid #fff;
|
||||||
|
border-top: none;
|
||||||
|
border-right: none;
|
||||||
|
opacity: .3;
|
||||||
|
position: absolute;
|
||||||
|
top: -20px;
|
||||||
|
right: 10%;
|
||||||
|
transform: rotate(-45deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,10 @@ export default {
|
||||||
if (this.selectCatory.id) {
|
if (this.selectCatory.id) {
|
||||||
this.$refs.AddPadPage.show()
|
this.$refs.AddPadPage.show()
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning('请选择分类')
|
this.$notify.error({
|
||||||
|
title: '错误',
|
||||||
|
message: '请选择分类'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 分类被点击
|
// 分类被点击
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,7 @@ export default {
|
||||||
number: "0",
|
number: "0",
|
||||||
show: false,
|
show: false,
|
||||||
timer: null,
|
timer: null,
|
||||||
|
payPar:{}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -136,17 +137,10 @@ export default {
|
||||||
this.$refs.refInputCode.focus();
|
this.$refs.refInputCode.focus();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
this.getPayUrl()
|
||||||
this.tips = "请用户使用微信/支付宝扫描付款码";
|
this.tips = "请用户使用微信/支付宝扫描付款码";
|
||||||
this.startGetOrderInfo();
|
this.startGetOrderInfo();
|
||||||
this.$nextTick(() => {
|
|
||||||
QRCode.toCanvas(
|
|
||||||
this.$refs.canvas,
|
|
||||||
this.paymentQrcode,
|
|
||||||
function (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
number(newval) {
|
number(newval) {
|
||||||
|
|
@ -192,14 +186,28 @@ export default {
|
||||||
this.close();
|
this.close();
|
||||||
this.$emit("confirm", this.form.code);
|
this.$emit("confirm", this.form.code);
|
||||||
},
|
},
|
||||||
open() {
|
getPayUrl(){
|
||||||
this.show = true;
|
$getOrderPayUrl(this.payPar).then((res) => {
|
||||||
this.form.money = Number(this.price).toFixed(2);
|
|
||||||
if (this.openSwitch) {
|
|
||||||
$getOrderPayUrl({ orderId: this.order.id,payAmount:this.price.toFixed(2) }).then((res) => {
|
|
||||||
console.log(res);
|
console.log(res);
|
||||||
this.paymentQrcode = res;
|
this.paymentQrcode = res;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
QRCode.toCanvas(
|
||||||
|
this.$refs.canvas,
|
||||||
|
this.paymentQrcode,{width: 160,
|
||||||
|
height: 160,},
|
||||||
|
function (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
open(data) {
|
||||||
|
this.show = true;
|
||||||
|
this.form.money = Number(this.price).toFixed(2);
|
||||||
|
this.payPar=data
|
||||||
|
if (this.openSwitch) {
|
||||||
|
// this.getPayUrl();
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.refInputCode.focus();
|
this.$refs.refInputCode.focus();
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,13 @@
|
||||||
trigger="click"
|
trigger="click"
|
||||||
v-model="tableShow"
|
v-model="tableShow"
|
||||||
>
|
>
|
||||||
<div style="max-height: 398px; overflow-y: scroll">
|
<el-input
|
||||||
|
placeholder="请输入内容"
|
||||||
|
prefix-icon="el-icon-search"
|
||||||
|
v-model="tableSearchText"
|
||||||
|
@input="searchInput">
|
||||||
|
</el-input>
|
||||||
|
<div style="max-height: 398px; overflow-y: scroll" class="u-m-t-12">
|
||||||
<div
|
<div
|
||||||
class="u-flex u-row-between u-p-t-8 table-item u-p-b-8 u-p-r-30"
|
class="u-flex u-row-between u-p-t-8 table-item u-p-b-8 u-p-r-30"
|
||||||
v-for="(item, index) in tableList"
|
v-for="(item, index) in tableList"
|
||||||
|
|
@ -54,7 +60,7 @@
|
||||||
@click="changeTable(item, index)"
|
@click="changeTable(item, index)"
|
||||||
>
|
>
|
||||||
<span> {{ item.name }}</span>
|
<span> {{ item.name }}</span>
|
||||||
<span :style="{ color: status[item.status].type }">
|
<span :style="{ color: returnTableColor(item.status) }">
|
||||||
{{
|
{{
|
||||||
status[item.status] ? status[item.status].label : ""
|
status[item.status] ? status[item.status].label : ""
|
||||||
}}</span
|
}}</span
|
||||||
|
|
@ -396,6 +402,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex mt-14">
|
<div class="flex mt-14">
|
||||||
|
<template v-if="table">
|
||||||
<template v-if="!postPay">
|
<template v-if="!postPay">
|
||||||
<template v-if="isCreateOrder">
|
<template v-if="isCreateOrder">
|
||||||
<!-- <template v-if="false"> -->
|
<!-- <template v-if="false"> -->
|
||||||
|
|
@ -469,6 +476,20 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<button class="my-btn flex-1 primary" @click="scanPayClick">
|
||||||
|
<span>微信/支付宝</span>
|
||||||
|
</button>
|
||||||
|
<div style="width: 15px"></div>
|
||||||
|
<button class="my-btn flex-1 primary" @click="cashPayClick">
|
||||||
|
<span>现金</span>
|
||||||
|
</button>
|
||||||
|
<div style="width: 15px"></div>
|
||||||
|
<button class="my-btn flex-1 default" @click="morePayClick">
|
||||||
|
<span>更多支付</span>
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -594,7 +615,11 @@
|
||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="goods">
|
<div
|
||||||
|
class="goods"
|
||||||
|
v-infinite-scroll="loadMoreGoods"
|
||||||
|
infinite-scroll-distance="40"
|
||||||
|
>
|
||||||
<template v-if="!isCreateOrder">
|
<template v-if="!isCreateOrder">
|
||||||
<div class="flex categoty u-col-center">
|
<div class="flex categoty u-col-center">
|
||||||
<div
|
<div
|
||||||
|
|
@ -637,7 +662,8 @@
|
||||||
>
|
>
|
||||||
未找到相关商品
|
未找到相关商品
|
||||||
</div>
|
</div>
|
||||||
<div class="goods-list" v-if="goods.list.length">
|
<template v-if="goods.list.length">
|
||||||
|
<div class="goods-list">
|
||||||
<div
|
<div
|
||||||
class="goods-item"
|
class="goods-item"
|
||||||
:class="{
|
:class="{
|
||||||
|
|
@ -659,7 +685,12 @@
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<div class="flex img-box" v-if="layout.sel !== 'text'">
|
<div class="flex img-box" v-if="layout.sel !== 'text'">
|
||||||
<img class="goods-img" :src="item.coverImg" alt="" />
|
<!-- <img class="goods-img" :src="item.coverImg" alt="" /> -->
|
||||||
|
<el-image
|
||||||
|
:src="item.coverImg"
|
||||||
|
scroll-container="goods"
|
||||||
|
class="goods-img"
|
||||||
|
></el-image>
|
||||||
<template v-if="layout.sel === 'img-and-text'">
|
<template v-if="layout.sel === 'img-and-text'">
|
||||||
<div class="sell-out-svg" v-if="isSellOut(item)">
|
<div class="sell-out-svg" v-if="isSellOut(item)">
|
||||||
<svg
|
<svg
|
||||||
|
|
@ -749,6 +780,16 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="u-m-t-20 color-999 text-center">
|
||||||
|
{{ goods.status == "end" ? "没有更多了" : "加载中" }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div
|
||||||
|
class="no-search-result"
|
||||||
|
v-if="goods.list.length <= 0 && goods.query.productId === ''"
|
||||||
|
>
|
||||||
|
未找到相关商品
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-else>
|
<template v-else>
|
||||||
|
|
@ -945,6 +986,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
|
<template v-if="skuGoods.data">
|
||||||
<div class="flex row-between">
|
<div class="flex row-between">
|
||||||
<div>
|
<div>
|
||||||
<div class="price">¥ {{ skuGoods.data.salePrice | to2 }}</div>
|
<div class="price">¥ {{ skuGoods.data.salePrice | to2 }}</div>
|
||||||
|
|
@ -973,26 +1015,51 @@
|
||||||
v-if="!skuGoods.data.isGrounding"
|
v-if="!skuGoods.data.isGrounding"
|
||||||
disabled
|
disabled
|
||||||
>
|
>
|
||||||
已下架/库存不足
|
已下架
|
||||||
</button>
|
</button>
|
||||||
<template v-else>
|
|
||||||
<button
|
<button
|
||||||
class="my-btn disabled flex-1"
|
class="my-btn disabled flex-1"
|
||||||
v-if="skuGoods.data.stockNumber <= 0"
|
v-else-if="
|
||||||
|
selGoods.isStock == 1 && skuGoods.data.stockNumber <= 0
|
||||||
|
"
|
||||||
disabled
|
disabled
|
||||||
>
|
>
|
||||||
库存不足
|
库存不足
|
||||||
</button>
|
</button>
|
||||||
<button
|
<template v-else>
|
||||||
class="my-btn primary flex-1"
|
<button class="my-btn primary flex-1" @click="chooseSkuConfirm">
|
||||||
v-else
|
|
||||||
:disabled="CanConfirm"
|
|
||||||
@click="chooseSkuConfirm"
|
|
||||||
>
|
|
||||||
确定
|
确定
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<div class="flex row-between">
|
||||||
|
<div>
|
||||||
|
<div class="price">¥</div>
|
||||||
|
<div class="sku-group-text">
|
||||||
|
<span> </span>
|
||||||
|
<span>库存:</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex">
|
||||||
|
<i class="icon-remove" @click="skuNumberReduce"></i>
|
||||||
|
<div style="width: 40px" class="number-box">
|
||||||
|
<el-input
|
||||||
|
:min="0"
|
||||||
|
:max="0"
|
||||||
|
type="number"
|
||||||
|
placeholder="0"
|
||||||
|
></el-input>
|
||||||
|
</div>
|
||||||
|
<!-- <i class="el-icon-remove"></i> -->
|
||||||
|
<i class="el-icon-circle-plus icon-add" @click="skuNumberAdd"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex" style="margin-top: 14px">
|
||||||
|
<button class="my-btn disabled flex-1" disabled>已下架/售罄</button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
|
@ -1166,7 +1233,7 @@
|
||||||
|
|
||||||
<return-cart
|
<return-cart
|
||||||
ref="refReturnCart"
|
ref="refReturnCart"
|
||||||
:max="order.selGoods.number"
|
:max="order.selGoods ? order.selGoods.number : 1"
|
||||||
@confirm="refReturnCartConfirm"
|
@confirm="refReturnCartConfirm"
|
||||||
></return-cart>
|
></return-cart>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1209,16 +1276,19 @@ import {
|
||||||
$printOrder,
|
$printOrder,
|
||||||
tbShopTableGet,
|
tbShopTableGet,
|
||||||
$changeUseType,
|
$changeUseType,
|
||||||
|
$returnTableDetail,
|
||||||
} from "@/api/table";
|
} from "@/api/table";
|
||||||
import { tbShopCategoryGet } from "@/api/shop";
|
import { tbShopCategoryGet } from "@/api/shop";
|
||||||
import {
|
import {
|
||||||
isCanBuy,
|
isCanBuy,
|
||||||
arrayContainsAll,
|
arrayContainsAll,
|
||||||
generateCombinations,
|
generateCombinations,
|
||||||
returnReverseVal,
|
returnReverseVal,$strMatch,
|
||||||
returnGiftArr,
|
returnGiftArr,
|
||||||
} from "./util.js";
|
} from "./util.js";
|
||||||
import { $status } from "@/utils/table.js";
|
import { $status } from "@/utils/table.js";
|
||||||
|
|
||||||
|
let $originTableList=[]
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
returnCart,
|
returnCart,
|
||||||
|
|
@ -1234,6 +1304,8 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
//台桌搜索文字
|
||||||
|
tableSearchText:"",
|
||||||
//是否允许收款
|
//是否允许收款
|
||||||
canShoukuan: false,
|
canShoukuan: false,
|
||||||
//是否允许下单
|
//是否允许下单
|
||||||
|
|
@ -1261,6 +1333,11 @@ export default {
|
||||||
},
|
},
|
||||||
//台桌列表
|
//台桌列表
|
||||||
tableList: [],
|
tableList: [],
|
||||||
|
//台桌参数
|
||||||
|
tableQuery: {
|
||||||
|
page: 1,
|
||||||
|
size: 999,
|
||||||
|
},
|
||||||
tableShow: false,
|
tableShow: false,
|
||||||
status: $status,
|
status: $status,
|
||||||
//就餐人数
|
//就餐人数
|
||||||
|
|
@ -1293,10 +1370,7 @@ export default {
|
||||||
},
|
},
|
||||||
skuGoods: {
|
skuGoods: {
|
||||||
number: 1,
|
number: 1,
|
||||||
data: {
|
data: undefined,
|
||||||
stockNumber: 0,
|
|
||||||
salePrice: 0,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
selGoods: {
|
selGoods: {
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
|
|
@ -1312,12 +1386,13 @@ export default {
|
||||||
informationdialogshow: false,
|
informationdialogshow: false,
|
||||||
informationdialogshowedit: false,
|
informationdialogshowedit: false,
|
||||||
goods: {
|
goods: {
|
||||||
|
status: "loadmore", //loadmore end
|
||||||
list: [],
|
list: [],
|
||||||
query: {
|
query: {
|
||||||
productId: "",
|
productId: "",
|
||||||
categoryId: "",
|
categoryId: "",
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 300,
|
size: 66,
|
||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
total: 0,
|
total: 0,
|
||||||
|
|
@ -1554,13 +1629,22 @@ export default {
|
||||||
this.selGoods.show = false;
|
this.selGoods.show = false;
|
||||||
},
|
},
|
||||||
CanConfirm() {
|
CanConfirm() {
|
||||||
if (!this.selGoods.skuList.length) {
|
// if (!this.skuGoods.data) {
|
||||||
return true;
|
// return;
|
||||||
}
|
// }
|
||||||
return (
|
// if (!this.selGoods.skuList.length) {
|
||||||
this.selGoods.skuList.filter((v) => v.sel !== "").length !==
|
// return true;
|
||||||
this.selGoods.skuList.length
|
// }
|
||||||
);
|
// const canBuyArr = this.selGoods.skuList.filter((v) =>
|
||||||
|
// isCanBuy(v, this.selGoods.isStock)
|
||||||
|
// );
|
||||||
|
// if (canBuyArr.length <= 0) {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// return (
|
||||||
|
// this.selGoods.skuList.filter((v) => v.sel !== "").length !==
|
||||||
|
// this.selGoods.skuList.length
|
||||||
|
// );
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
|
|
@ -1581,6 +1665,12 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
"goods.query.categoryId": function (newval) {
|
||||||
|
this.goods.query.page = 1;
|
||||||
|
this.goods.list = [];
|
||||||
|
this.goods.status = "loadmore";
|
||||||
|
this.getGoods();
|
||||||
|
},
|
||||||
"useTypes.sel": function (newval, oldval) {
|
"useTypes.sel": function (newval, oldval) {
|
||||||
console.log(newval);
|
console.log(newval);
|
||||||
this.setPostPay();
|
this.setPostPay();
|
||||||
|
|
@ -1740,6 +1830,20 @@ export default {
|
||||||
this.open(this.$route.query.tableId ? this.$route.query : "");
|
this.open(this.$route.query.tableId ? this.$route.query : "");
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
searchInput(e){
|
||||||
|
console.log(e)
|
||||||
|
this.tableList=$originTableList.filter(v=>$strMatch(v.name,e.trim()))
|
||||||
|
},
|
||||||
|
returnTableColor(key) {
|
||||||
|
const item = $status[key];
|
||||||
|
return item ? item.type : "";
|
||||||
|
},
|
||||||
|
loadMoreGoods() {
|
||||||
|
if (this.goods.query.page * this.goods.query.size < this.goods.total) {
|
||||||
|
this.goods.query.page = this.goods.query.page + 1;
|
||||||
|
this.getGoods();
|
||||||
|
}
|
||||||
|
},
|
||||||
async shoukuanClick() {
|
async shoukuanClick() {
|
||||||
this.canShoukuan = await hasPermission("允许收款");
|
this.canShoukuan = await hasPermission("允许收款");
|
||||||
return this.canShoukuan;
|
return this.canShoukuan;
|
||||||
|
|
@ -1748,7 +1852,6 @@ export default {
|
||||||
async xiadanClick() {
|
async xiadanClick() {
|
||||||
this.canXiadan = await hasPermission("允许下单");
|
this.canXiadan = await hasPermission("允许下单");
|
||||||
return this.canXiadan;
|
return this.canXiadan;
|
||||||
|
|
||||||
},
|
},
|
||||||
changeOrderExtraSel(index, canChangeNumber, placeNum) {
|
changeOrderExtraSel(index, canChangeNumber, placeNum) {
|
||||||
// console.log(index,canChangeNumber,placeNum)
|
// console.log(index,canChangeNumber,placeNum)
|
||||||
|
|
@ -1855,10 +1958,11 @@ export default {
|
||||||
if (!canJiesuan) {
|
if (!canJiesuan) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await this.returnCreateOrderData();
|
const order = await this.returnCreateOrderData();
|
||||||
this.payBeforeClear();
|
console.log(this.createOrder.data);
|
||||||
this.order.payType = "scanCode";
|
this.order.payType = "scanCode";
|
||||||
this.payTypeItemClick({ payType: "scanCode" });
|
this.payTypeItemClick({ payType: "scanCode", order });
|
||||||
|
this.payBeforeClear();
|
||||||
},
|
},
|
||||||
async changeOrderUseType(useType) {
|
async changeOrderUseType(useType) {
|
||||||
if (useType && this.order.list.length) {
|
if (useType && this.order.list.length) {
|
||||||
|
|
@ -2010,16 +2114,51 @@ export default {
|
||||||
async getTable() {
|
async getTable() {
|
||||||
try {
|
try {
|
||||||
const { content, total } = await tbShopTableGet({
|
const { content, total } = await tbShopTableGet({
|
||||||
|
...this.tableQuery,
|
||||||
shopId: localStorage.getItem("shopId"),
|
shopId: localStorage.getItem("shopId"),
|
||||||
});
|
});
|
||||||
this.tableList = content.filter(
|
this.tableList = content.filter(
|
||||||
(v) => v.status != "closed" && v.status != "cleaning"
|
(v) => v.status != "closed" && v.status != "cleaning"
|
||||||
);
|
);
|
||||||
|
$originTableList=this.tableList
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeTable(item) {
|
async changeTable(item) {
|
||||||
|
console.log(this.table);
|
||||||
|
if (this.table || this.order.list.length <= 0) {
|
||||||
|
this.table = item;
|
||||||
|
this.tableShow = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (item.status != "idle") {
|
||||||
|
return this.$message.error("该台桌已在使用中");
|
||||||
|
}
|
||||||
|
const res = await $returnTableDetail({
|
||||||
|
tableId: item.tableId,
|
||||||
|
});
|
||||||
|
let res1 = null;
|
||||||
|
if (res.cartCount > 0) {
|
||||||
|
try {
|
||||||
|
res1 = await this.$confirm(
|
||||||
|
"该台桌购物车里有商品,是否清除该台桌里的商品?",
|
||||||
|
"提示",
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await $choseTable({
|
||||||
|
masterId: this.masterId,
|
||||||
|
tableId: item.tableId,
|
||||||
|
isClear: res1 == "confirm" ? true : false,
|
||||||
|
});
|
||||||
this.table = item;
|
this.table = item;
|
||||||
this.tableShow = false;
|
this.tableShow = false;
|
||||||
},
|
},
|
||||||
|
|
@ -2035,9 +2174,8 @@ export default {
|
||||||
}
|
}
|
||||||
this.pays();
|
this.pays();
|
||||||
},
|
},
|
||||||
payTypeItemClick(item) {
|
payTypeItemClick(item, order) {
|
||||||
console.log(item);
|
order = order ? order : this.createOrder.data;
|
||||||
console.log(this.vipUser.id);
|
|
||||||
if (item.payType == "vipPay") {
|
if (item.payType == "vipPay") {
|
||||||
return this.refChooseUserOpen();
|
return this.refChooseUserOpen();
|
||||||
}
|
}
|
||||||
|
|
@ -2047,7 +2185,10 @@ export default {
|
||||||
}
|
}
|
||||||
if (item.payType == "scanCode") {
|
if (item.payType == "scanCode") {
|
||||||
//扫码支付
|
//扫码支付
|
||||||
return this.refToggle("refWxScanCode", true);
|
return this.refToggle("refWxScanCode", true, {
|
||||||
|
orderId: order.id,
|
||||||
|
payAmount: (this.createOrder.data.amount * order.discount).toFixed(2),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ChangeDiscount(discount) {
|
ChangeDiscount(discount) {
|
||||||
|
|
@ -2181,7 +2322,12 @@ export default {
|
||||||
return this.refChooseUserOpen();
|
return this.refChooseUserOpen();
|
||||||
}
|
}
|
||||||
if (this.order.payType == "scanCode") {
|
if (this.order.payType == "scanCode") {
|
||||||
return this.refToggle("refWxScanCode", true);
|
return this.refToggle("refWxScanCode", true, {
|
||||||
|
orderId: this.createOrder.data.id,
|
||||||
|
payAmount: (
|
||||||
|
this.createOrder.data.amount * this.createOrder.discount
|
||||||
|
).toFixed(2),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (this.order.payType == "deposit") {
|
if (this.order.payType == "deposit") {
|
||||||
return this.refToggle("refScanCode", true);
|
return this.refToggle("refScanCode", true);
|
||||||
|
|
@ -2272,14 +2418,15 @@ export default {
|
||||||
console.log(this.order.orderId);
|
console.log(this.order.orderId);
|
||||||
let res = "";
|
let res = "";
|
||||||
try {
|
try {
|
||||||
|
if (!this.shopInfo.isTableFee) {
|
||||||
const seatFee = await $choseCount({
|
const seatFee = await $choseCount({
|
||||||
masterId: this.masterId,
|
masterId: this.masterId,
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
num: this.perpole,
|
num: this.perpole,
|
||||||
});
|
});
|
||||||
this.order.seatFee = seatFee;
|
this.order.seatFee = seatFee;
|
||||||
|
|
||||||
this.order.seatFee = res;
|
this.order.seatFee = res;
|
||||||
|
}
|
||||||
res = await $createOrder({
|
res = await $createOrder({
|
||||||
masterId: this.order.masterId || this.masterId,
|
masterId: this.order.masterId || this.masterId,
|
||||||
vipUserId: this.vipUser.id,
|
vipUserId: this.vipUser.id,
|
||||||
|
|
@ -2315,23 +2462,15 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取取餐号
|
// 获取取餐号
|
||||||
getMasterId() {
|
async getMasterId() {
|
||||||
// if(!this.table.tableId){
|
const res = await $getMasterId({
|
||||||
// return this.$message.error("请选择桌台");
|
|
||||||
// }
|
|
||||||
if (this.table.tableId) {
|
|
||||||
return $getMasterId({
|
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
orderId: this.table.orderId,
|
orderId: this.table.orderId,
|
||||||
vipUserId: this.vipUser.id,
|
vipUserId: this.vipUser.id,
|
||||||
useType: this.useTypes.sel == "takeout" ? "takeout" : "",
|
useType: this.useTypes.sel == "takeout" ? "takeout" : "",
|
||||||
});
|
});
|
||||||
} else {
|
this.masterId = res.masterId;
|
||||||
// return $getMasterId({
|
return res;
|
||||||
// useType:'takeout',
|
|
||||||
// vipUserId: this.vipUser.id,
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onSelGoodsSkuClose() {
|
onSelGoodsSkuClose() {
|
||||||
this.selGoods.isEdit = false;
|
this.selGoods.isEdit = false;
|
||||||
|
|
@ -2884,7 +3023,7 @@ export default {
|
||||||
.filter((v) => v.specSnap.match(i))
|
.filter((v) => v.specSnap.match(i))
|
||||||
.every((v) => {
|
.every((v) => {
|
||||||
// return isCanBuy(v,this.selGoods.data.isStock)
|
// return isCanBuy(v,this.selGoods.data.isStock)
|
||||||
return !isCanBuy(v, true);
|
return !isCanBuy(v, this.selGoods.data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3007,7 +3146,7 @@ export default {
|
||||||
return prve;
|
return prve;
|
||||||
}, {});
|
}, {});
|
||||||
const canBudyGoods = this.selGoods.data.specList
|
const canBudyGoods = this.selGoods.data.specList
|
||||||
.filter((v) => isCanBuy(v, true))
|
.filter((v) => isCanBuy(v, this.selGoods.data))
|
||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
const aNumber = a.specSnap.split(",").reduce((prve, cur) => {
|
const aNumber = a.specSnap.split(",").reduce((prve, cur) => {
|
||||||
return prve + skuMapNumber[cur];
|
return prve + skuMapNumber[cur];
|
||||||
|
|
@ -3021,6 +3160,7 @@ export default {
|
||||||
},
|
},
|
||||||
//设置商品默认选中,规格禁止以及选中
|
//设置商品默认选中,规格禁止以及选中
|
||||||
setSkugoodsDefaultInit() {
|
setSkugoodsDefaultInit() {
|
||||||
|
this.skuGoods.data = undefined;
|
||||||
const skuList = this.selGoods.skuList;
|
const skuList = this.selGoods.skuList;
|
||||||
const goodsListMap = this.selGoods.skuMap;
|
const goodsListMap = this.selGoods.skuMap;
|
||||||
const skuGoods = this.findGoods(skuList, goodsListMap);
|
const skuGoods = this.findGoods(skuList, goodsListMap);
|
||||||
|
|
@ -3056,9 +3196,9 @@ export default {
|
||||||
},
|
},
|
||||||
//根据右侧商品单规格多规格做不同处理
|
//根据右侧商品单规格多规格做不同处理
|
||||||
async goodsClick(item) {
|
async goodsClick(item) {
|
||||||
if (!this.table) {
|
// if (!this.table) {
|
||||||
return this.$message.error("暂不支持无桌台下单,请先选择桌台");
|
// return this.$message.error("暂不支持无桌台下单,请先选择桌台");
|
||||||
}
|
// }
|
||||||
if (item.typeEnum === "sku") {
|
if (item.typeEnum === "sku") {
|
||||||
this.selGoods.data = item;
|
this.selGoods.data = item;
|
||||||
this.selGoods.skuMap = {};
|
this.selGoods.skuMap = {};
|
||||||
|
|
@ -3109,6 +3249,10 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getGoods() {
|
async getGoods() {
|
||||||
|
if (this.goods.status == "end") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.goods.status = "loadmore";
|
||||||
const res = await getGoodsLists(this.goods.query);
|
const res = await getGoodsLists(this.goods.query);
|
||||||
let $goodsMap = {};
|
let $goodsMap = {};
|
||||||
const goods = res.records.filter((v) => {
|
const goods = res.records.filter((v) => {
|
||||||
|
|
@ -3124,8 +3268,11 @@ export default {
|
||||||
});
|
});
|
||||||
return isShow;
|
return isShow;
|
||||||
});
|
});
|
||||||
console.log($goodsMap);
|
for (let i in goods) {
|
||||||
this.goods.list = goods;
|
this.goods.list.push(goods[i]);
|
||||||
|
}
|
||||||
|
this.goods.status =
|
||||||
|
this.goods.list.length >= res.total ? "end" : "loadmore";
|
||||||
this.goods.total = res.total;
|
this.goods.total = res.total;
|
||||||
this.$goodsData = goods;
|
this.$goodsData = goods;
|
||||||
},
|
},
|
||||||
|
|
@ -3181,7 +3328,7 @@ export default {
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
if (this.table.tableId) {
|
if (this.table.tableId) {
|
||||||
this.$router.replace({ path: "/table/table_list" });
|
this.$router.replace({ path: "/tool/table_list" });
|
||||||
} else {
|
} else {
|
||||||
this.$router.go(0);
|
this.$router.go(0);
|
||||||
// this.reset();
|
// this.reset();
|
||||||
|
|
@ -3975,11 +4122,12 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||||
.goods-list {
|
.goods-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
min-height: 10px;
|
||||||
.goods-item {
|
.goods-item {
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
min-width: 98px;
|
// min-width: 98px;
|
||||||
|
min-width: 100px;
|
||||||
max-width: 100px;
|
max-width: 100px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
// flex: 1;
|
// flex: 1;
|
||||||
|
|
@ -4447,6 +4595,11 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||||
::v-deep .cashier_left .el-form-item__label {
|
::v-deep .cashier_left .el-form-item__label {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
::v-deep .goods .el-image {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
.cashier_left .detail_box .usercard .info .nickname .vip_level {
|
.cashier_left .detail_box .usercard .info .nickname .vip_level {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,17 @@
|
||||||
//判断商品是否可以下单
|
//判断商品是否可以下单
|
||||||
export function isCanBuy(goods,isStock) {
|
export function isCanBuy(skuGoods,goods) {
|
||||||
return goods.isGrounding && goods.isPauseSale == 0 && (isStock?goods.stockNumber > 0:true) ;
|
if(goods.typeEnum=='normal'){
|
||||||
|
//单规格
|
||||||
|
return goods.isGrounding&&goods.isPauseSale==0&&(goods.isStock?goods.stockNumber>0:true);
|
||||||
|
}else{
|
||||||
|
//多规格
|
||||||
|
return goods.isGrounding&&goods.isPauseSale==0&&skuGoods.isGrounding&&skuGoods.isPauseSale==0&&(goods.isStock?goods.stockNumber>0:true);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//字符匹配
|
||||||
|
export function $strMatch(matchStr,str){
|
||||||
|
return matchStr.toLowerCase().includes(str.toLowerCase())
|
||||||
}
|
}
|
||||||
|
|
||||||
// 一个数组是否包含另外一个数组全部元素
|
// 一个数组是否包含另外一个数组全部元素
|
||||||
|
|
@ -15,6 +26,8 @@ export function arrayContainsAll(arr1, arr2) {
|
||||||
|
|
||||||
//n项 n-1项组合,生成全部结果
|
//n项 n-1项组合,生成全部结果
|
||||||
export function generateCombinations(arr, k) {
|
export function generateCombinations(arr, k) {
|
||||||
|
console.log(arr)
|
||||||
|
console.log(k)
|
||||||
let result = [];
|
let result = [];
|
||||||
|
|
||||||
function helper(index, current) {
|
function helper(index, current) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue