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.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 = 'http://192.168.2.96:8000'
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ ENV = 'production'
|
|||
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
||||
# 接口地址,注意协议,如果你没有配置 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://pre-cashieradmin.sxczgkj.cn'
|
||||
VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn'
|
||||
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.98:8000'
|
||||
# 如果接口是 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 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<!-- <el-table-column label="操作">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- </el-tab-pane> -->
|
||||
|
|
|
|||
|
|
@ -790,7 +790,7 @@ export default {
|
|||
this.form.selectSpec = JSON.stringify(this.selectSpec);
|
||||
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].costPrice = 0
|
||||
this.form.skuList[0].originPrice = this.form.skuList[0].salePrice
|
||||
if (this.form.id) {
|
||||
await tbProductPut(this.form);
|
||||
|
|
|
|||
|
|
@ -17,9 +17,18 @@
|
|||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="btn_wrap">
|
||||
<div class="btn_wrap" v-if="!form.list.length">
|
||||
<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>
|
||||
</template>
|
||||
|
|
@ -43,6 +52,7 @@
|
|||
|
||||
<script>
|
||||
import shopList from '@/components/shopList/index.vue'
|
||||
import { tbProduct } from '@/api/shop.js'
|
||||
import { layoutlist, productGroup, productCategoryDetail, productGroupPut } from '@/api/pad.js'
|
||||
export default {
|
||||
components: { shopList },
|
||||
|
|
@ -71,9 +81,58 @@ export default {
|
|||
this.layoutlist()
|
||||
},
|
||||
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() {
|
||||
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
|
||||
let res = null
|
||||
if (this.form.id) {
|
||||
|
|
@ -99,7 +158,17 @@ export default {
|
|||
})
|
||||
}
|
||||
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.$emit('success')
|
||||
} 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 {
|
||||
flex: 1;
|
||||
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 {
|
||||
height: 100%;
|
||||
|
|
|
|||
|
|
@ -97,7 +97,10 @@ export default {
|
|||
if (this.selectCatory.id) {
|
||||
this.$refs.AddPadPage.show()
|
||||
} else {
|
||||
this.$message.warning('请选择分类')
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '请选择分类'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 分类被点击
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ export default {
|
|||
number: "0",
|
||||
show: false,
|
||||
timer: null,
|
||||
payPar:{}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
|
@ -136,17 +137,10 @@ export default {
|
|||
this.$refs.refInputCode.focus();
|
||||
});
|
||||
} else {
|
||||
this.getPayUrl()
|
||||
this.tips = "请用户使用微信/支付宝扫描付款码";
|
||||
this.startGetOrderInfo();
|
||||
this.$nextTick(() => {
|
||||
QRCode.toCanvas(
|
||||
this.$refs.canvas,
|
||||
this.paymentQrcode,
|
||||
function (error) {
|
||||
console.log(error);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
number(newval) {
|
||||
|
|
@ -192,14 +186,28 @@ export default {
|
|||
this.close();
|
||||
this.$emit("confirm", this.form.code);
|
||||
},
|
||||
open() {
|
||||
this.show = true;
|
||||
this.form.money = Number(this.price).toFixed(2);
|
||||
if (this.openSwitch) {
|
||||
$getOrderPayUrl({ orderId: this.order.id,payAmount:this.price.toFixed(2) }).then((res) => {
|
||||
getPayUrl(){
|
||||
$getOrderPayUrl(this.payPar).then((res) => {
|
||||
console.log(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.$refs.refInputCode.focus();
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,17 @@
|
|||
//判断商品是否可以下单
|
||||
export function isCanBuy(goods,isStock) {
|
||||
return goods.isGrounding && goods.isPauseSale == 0 && (isStock?goods.stockNumber > 0:true) ;
|
||||
export function isCanBuy(skuGoods,goods) {
|
||||
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项组合,生成全部结果
|
||||
export function generateCombinations(arr, k) {
|
||||
console.log(arr)
|
||||
console.log(k)
|
||||
let result = [];
|
||||
|
||||
function helper(index, current) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue