代码合并
This commit is contained in:
commit
1ada98907c
|
|
@ -0,0 +1,68 @@
|
||||||
|
// 代客下单
|
||||||
|
import request from "@/utils/request";
|
||||||
|
//就餐形式,默认堂食后付费
|
||||||
|
const useType='dine-in-after'
|
||||||
|
function getUseType(){
|
||||||
|
const type=localStorage.getItem("useType")
|
||||||
|
return type?type:useType
|
||||||
|
}
|
||||||
|
|
||||||
|
// 购物车-临时菜添加
|
||||||
|
export function $temporaryDishes(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/place/temporaryDishes',
|
||||||
|
method: "post",
|
||||||
|
data:{
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
useType:getUseType(),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 购物车-单品改价
|
||||||
|
export function $updatePrice(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/place/updatePrice',
|
||||||
|
method: "put",
|
||||||
|
data:{
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 团购券-获取可使用团购券列表
|
||||||
|
|
||||||
|
export function $thirdPartyCoupon(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/thirdPartyCoupon/list',
|
||||||
|
method: "get",
|
||||||
|
params:{
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//核销团购券商品
|
||||||
|
export function $checkCoupon(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/place/checkCoupon',
|
||||||
|
method: "post",
|
||||||
|
data:{
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//整体等叫/取消等叫
|
||||||
|
export function $waitCall(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/place/waitCall',
|
||||||
|
method: "put",
|
||||||
|
data:{
|
||||||
|
useType:getUseType(),
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
|
|
@ -69,6 +69,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
<!-- <div class="item" v-for="item in payCountList" :key="item.payType">
|
<!-- <div class="item" v-for="item in payCountList" :key="item.payType">
|
||||||
|
</div>
|
||||||
|
<div class="item" v-for="item in payCountList" :key="item.payType">
|
||||||
<div class="icon_wrap" style="--bg-color:#fff">
|
<div class="icon_wrap" style="--bg-color:#fff">
|
||||||
<el-image class="img" :src="item.icon"></el-image>
|
<el-image class="img" :src="item.icon"></el-image>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -77,6 +79,7 @@
|
||||||
<div class="t">{{ item.payType }}</div>
|
<div class="t">{{ item.payType }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>-->
|
</div>-->
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,12 @@
|
||||||
:class="[isActive]"
|
:class="[isActive]"
|
||||||
@click="itemClick"
|
@click="itemClick"
|
||||||
>
|
>
|
||||||
<span class="absolute pack" v-if="item.isPack === 'true'"> 包 </span>
|
<div class="absolute status-box">
|
||||||
<span class="absolute tui" v-if="item.status === 'return'"> 退 </span>
|
<span class="pack" v-if="item.isPack === 'true'"> 包 </span>
|
||||||
|
<span class="da" v-if="item.isPrint"> 打 </span>
|
||||||
|
<span class="isWaitCall" v-if="item.isWaitCall">等 </span>
|
||||||
|
<span class="tui" v-if="item.status === 'return'"> 退 </span>
|
||||||
|
</div>
|
||||||
<div class="flex u-col-top">
|
<div class="flex u-col-top">
|
||||||
<div class="img">
|
<div class="img">
|
||||||
<div
|
<div
|
||||||
|
|
@ -30,7 +34,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="" v-if="placeNum == 0">
|
<div class="" v-if="placeNum == 0">
|
||||||
<div class="note" v-if="item.note">备注:{{ item.note || "" }}</div>
|
<div class="note" v-if="item.note">备注:{{ item.note }}</div>
|
||||||
<div class="note flex" v-else>
|
<div class="note flex" v-else>
|
||||||
<span>备注:</span>
|
<span>备注:</span>
|
||||||
<span class="el-icon-edit u-font-12" @click="editNote"></span>
|
<span class="el-icon-edit u-font-12" @click="editNote"></span>
|
||||||
|
|
@ -74,11 +78,23 @@
|
||||||
<span v-else> ¥{{ isShowVipPrice ? vipAllPrice : allPrice }}</span>
|
<span v-else> ¥{{ isShowVipPrice ? vipAllPrice : allPrice }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else-if="item.discountSaleAmount">
|
||||||
|
<div>¥{{ discountNewPrice }}</div>
|
||||||
|
<div class="free-price">
|
||||||
|
<span> ¥{{ isShowVipPrice ? vipAllPrice : allPrice }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div v-if="isSeatFee">¥{{ item.totalAmount }}</div>
|
<div v-if="isSeatFee">¥{{ item.totalAmount }}</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div v-if="isShowVipPrice&&vipAllPrice!=allPrice">¥{{ vipAllPrice }}</div>
|
<div v-if="isShowVipPrice && vipAllPrice != allPrice">
|
||||||
<div :class="{ 'free-price': isShowVipPrice&&vipAllPrice!=allPrice }">
|
¥{{ vipAllPrice }}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
:class="{
|
||||||
|
'free-price': isShowVipPrice && vipAllPrice != allPrice,
|
||||||
|
}"
|
||||||
|
>
|
||||||
<span> ¥{{ allPrice }}</span>
|
<span> ¥{{ allPrice }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -142,13 +158,21 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
discountNewPrice(){
|
||||||
|
const item = this.item;
|
||||||
|
const originPrice=this.isShowVipPrice?this.vipAllPrice:this.allPrice
|
||||||
|
const discount=(this.item.discountSaleAmount*this.item.number)
|
||||||
|
return (originPrice-discount).toFixed(2)
|
||||||
|
},
|
||||||
vipAllPrice() {
|
vipAllPrice() {
|
||||||
const item = this.item;
|
const item = this.item;
|
||||||
const price =
|
const price =
|
||||||
this.isShowVipPrice &&
|
this.isShowVipPrice &&
|
||||||
item.memberPrice != null &&
|
item.memberPrice != null &&
|
||||||
item.memberPrice != undefined
|
item.memberPrice != undefined
|
||||||
? (item.memberPrice<=0?item.salePrice:item.memberPrice)
|
? item.memberPrice <= 0
|
||||||
|
? item.salePrice
|
||||||
|
: item.memberPrice
|
||||||
: item.salePrice;
|
: item.salePrice;
|
||||||
return (price * item.number + (item.packAmount || 0)).toFixed(2);
|
return (price * item.number + (item.packAmount || 0)).toFixed(2);
|
||||||
},
|
},
|
||||||
|
|
@ -262,27 +286,36 @@ export default {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
background-color: rgba(0, 0, 0, 0);
|
background-color: rgba(0, 0, 0, 0);
|
||||||
transition: all 0.3s;
|
transition: all 0.3s;
|
||||||
.pack {
|
.status-box {
|
||||||
right: 100%;
|
|
||||||
width: 18px;
|
width: 18px;
|
||||||
height: 18px;
|
position: absolute;
|
||||||
|
top: 4px;
|
||||||
|
right: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 2px;
|
||||||
|
> span {
|
||||||
|
display: block;
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
border-radius: 4px 0 4px 0;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 17px;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.isWaitCall {
|
||||||
|
background: #d3adf7;
|
||||||
|
}
|
||||||
|
.pack {
|
||||||
|
background: #35ac6a;
|
||||||
|
}
|
||||||
|
.da {
|
||||||
background: #35ac6a;
|
background: #35ac6a;
|
||||||
border-radius: 4px 0 4px 0;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #fff;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 17px;
|
|
||||||
}
|
}
|
||||||
.tui {
|
.tui {
|
||||||
right: 100%;
|
|
||||||
width: 18px;
|
|
||||||
height: 18px;
|
|
||||||
background: #ac4735;
|
background: #ac4735;
|
||||||
border-radius: 4px 0 4px 0;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #fff;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 17px;
|
|
||||||
}
|
}
|
||||||
&.active {
|
&.active {
|
||||||
background-color: rgba(0, 0, 0, 0.04);
|
background-color: rgba(0, 0, 0, 0.04);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,181 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog title="选择挂账人" width="850px" :visible.sync="show" top="20px">
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="head-container filtration">
|
||||||
|
<div class="r">
|
||||||
|
<el-input
|
||||||
|
v-model="tableData.keywords"
|
||||||
|
placeholder="按挂账人或手机号"
|
||||||
|
style="width: 138px"
|
||||||
|
/>
|
||||||
|
<!-- <el-select
|
||||||
|
v-model="tableData.status"
|
||||||
|
placeholder="全部状态"
|
||||||
|
clearable
|
||||||
|
style="width: 123px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select> -->
|
||||||
|
<el-button type="primary" @click="getTableData()"> 查询 </el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="head-container content">
|
||||||
|
<el-table
|
||||||
|
v-loading="tableData.loading"
|
||||||
|
:data="tableData.data"
|
||||||
|
@cell-click="cellClick"
|
||||||
|
>
|
||||||
|
<el-table-column label="ID" prop="id" />
|
||||||
|
|
||||||
|
<el-table-column label="挂账人" prop="debtor" />
|
||||||
|
<el-table-column label="手机号" prop="mobile" />
|
||||||
|
<el-table-column label="已挂账金额(元)" prop="owedAmount" />
|
||||||
|
<el-table-column label="可用挂账额度(元)" prop="remainingAmount" />
|
||||||
|
<el-table-column label="操作">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button type="text" @click="cellClick(scope.row)"
|
||||||
|
>选择</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<div class="head-container">
|
||||||
|
<el-pagination
|
||||||
|
:total="tableData.total"
|
||||||
|
:current-page="tableData.page"
|
||||||
|
:page-size="tableData.size"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@current-change="paginationChange"
|
||||||
|
@size-change="sizeChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getCreditBuyerList, delCreditBuyer } from "@/api/credit";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
show: false,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
value: "1",
|
||||||
|
label: "启用",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "0",
|
||||||
|
label: "停用",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
tableData: {
|
||||||
|
keywords: "",
|
||||||
|
status: "1",
|
||||||
|
data: [],
|
||||||
|
page: 1,
|
||||||
|
size: 10,
|
||||||
|
loading: false,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// this.getTableData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
cellClick(row) {
|
||||||
|
this.$emit("confirm", row);
|
||||||
|
this.show = false;
|
||||||
|
},
|
||||||
|
open() {
|
||||||
|
this.getTableData();
|
||||||
|
this.show = true;
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取挂账人列表
|
||||||
|
*/
|
||||||
|
async getTableData() {
|
||||||
|
this.tableData.loading = true;
|
||||||
|
try {
|
||||||
|
const res = await getCreditBuyerList({
|
||||||
|
page: this.tableData.page,
|
||||||
|
size: this.tableData.size,
|
||||||
|
keywords: this.tableData.keywords,
|
||||||
|
status: this.tableData.status,
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
});
|
||||||
|
this.tableData.loading = false;
|
||||||
|
this.tableData.data = res.content;
|
||||||
|
this.tableData.total = res.totalElements;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除挂账人
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
async delTableHandle(id) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const res = await delCreditBuyer(id);
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作
|
||||||
|
*/
|
||||||
|
openDialog(row, type) {
|
||||||
|
if (type === "add") {
|
||||||
|
this.$refs.creditAdd.show();
|
||||||
|
} else if (type === "edit") {
|
||||||
|
this.$refs.creditAdd.show(row);
|
||||||
|
} else if (type === "repayment" && row.repaymentMethod === "total") {
|
||||||
|
this.$refs.creditRepayment.show(row);
|
||||||
|
} else if (type === "rePaymentRecord") {
|
||||||
|
this.$refs.creditRepaymentRecord.show(row);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 重置查询
|
||||||
|
resetHandle() {
|
||||||
|
this.page = 1;
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
// 分页大小改变
|
||||||
|
sizeChange(e) {
|
||||||
|
this.tableData.size = e;
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
// 分页回调
|
||||||
|
paginationChange(e) {
|
||||||
|
this.tableData.page = e;
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.title {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
.filtration {
|
||||||
|
overflow: hidden;
|
||||||
|
.l {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.r {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
<span> {{ number }}</span>
|
<span> {{ number }}</span>
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
|
<slot name="tips"></slot>
|
||||||
<div class="number_list_box">
|
<div class="number_list_box">
|
||||||
<div class="yd-keyboard">
|
<div class="yd-keyboard">
|
||||||
<div class="mini-number-box1">
|
<div class="mini-number-box1">
|
||||||
|
|
@ -79,13 +80,18 @@ export default {
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
max: {
|
max: {
|
||||||
type: Number,
|
type: [Number,String],
|
||||||
default: Infinity,
|
default: Infinity,
|
||||||
},
|
},
|
||||||
value: {
|
value: {
|
||||||
type: [String, Number],
|
type: [String, Number],
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
|
// 是否启用小数
|
||||||
|
isFloat: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -102,14 +108,21 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
clearFunction() {
|
clearFunction() {
|
||||||
|
if(this.isFloat){
|
||||||
|
return this.keyboradAdd('.')
|
||||||
|
}
|
||||||
this.$emit("clear", this.number);
|
this.$emit("clear", this.number);
|
||||||
},
|
},
|
||||||
keyboradAdd(n) {
|
keyboradAdd(n) {
|
||||||
|
if(n=='.'&& `${this.number}`.includes('.')){
|
||||||
|
return
|
||||||
|
}
|
||||||
if (Number(this.number) == 0) {
|
if (Number(this.number) == 0) {
|
||||||
return (this.number = n);
|
return (this.number = n);
|
||||||
}
|
}
|
||||||
const newval = this.number + n;
|
const newval = this.number + n;
|
||||||
if (newval > this.max) {
|
console.log(newval)
|
||||||
|
if (newval*1 > this.max*1) {
|
||||||
return this.$message( this.maxTips);
|
return this.$message( this.maxTips);
|
||||||
}
|
}
|
||||||
this.number = newval;
|
this.number = newval;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,205 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="单品改价"
|
||||||
|
width="410px"
|
||||||
|
:visible.sync="show"
|
||||||
|
@close="reset"
|
||||||
|
:modal="modal"
|
||||||
|
>
|
||||||
|
<div class="u-m-t-30 u-flex">
|
||||||
|
<div class="no-wrap u-m-r-20">价格更改</div>
|
||||||
|
<el-input
|
||||||
|
:min="min"
|
||||||
|
:max="max"
|
||||||
|
placeholder="减8.88元请输入8.88元"
|
||||||
|
v-model="price"
|
||||||
|
@blur="checkPrice"
|
||||||
|
type="number"
|
||||||
|
>
|
||||||
|
<template slot="append">元</template>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
<div class="u-m-t-16">
|
||||||
|
<span class="color-red">*</span>
|
||||||
|
<span>当前单品单价:{{max }}元</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="u-m-t-30">
|
||||||
|
<div><span>更改原因</span> <span class="color-red">*</span></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="u-flex u-flex-wrap tags">
|
||||||
|
<div
|
||||||
|
class="tag"
|
||||||
|
v-for="(tag, index) in tags"
|
||||||
|
@click="changeSel(tag)"
|
||||||
|
:key="index"
|
||||||
|
:class="{ active: tag.checked }"
|
||||||
|
>
|
||||||
|
{{ tag.label }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="u-m-t-20">
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
v-model="note"
|
||||||
|
size="medium"
|
||||||
|
placeholder="请输入自定义内容"
|
||||||
|
></el-input>
|
||||||
|
</div>
|
||||||
|
<div slot="footer">
|
||||||
|
<el-button size="medium" @click="close"> 取消 </el-button>
|
||||||
|
<el-button size="medium" type="primary" @click="confirm">确定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { returnCartPrice } from "../util.js";
|
||||||
|
import {$updatePrice} from '@/api/Instead';
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
modal: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
vipUser:{
|
||||||
|
type:Object,
|
||||||
|
default:()=>{
|
||||||
|
return {
|
||||||
|
isVip:false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
max: 0,
|
||||||
|
min: 0,
|
||||||
|
price: '',
|
||||||
|
tagSel: -1,
|
||||||
|
show: false,
|
||||||
|
tags: [
|
||||||
|
{ label: "顾客投诉质量", checked: false },
|
||||||
|
{ label: "友情打折", checked: false },
|
||||||
|
{ label: "临时活动", checked: false },
|
||||||
|
],
|
||||||
|
note: "",
|
||||||
|
goods: {
|
||||||
|
productId: -999,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isSeatFee() {
|
||||||
|
return returnIsSeatFee(this.goods);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkPrice(){
|
||||||
|
if(this.price>this.max||this.price<0){
|
||||||
|
this.$message.error(`改价的区间为${this.min}-${this.max}元`);
|
||||||
|
}
|
||||||
|
if(this.price>this.max){
|
||||||
|
this.price=this.max;
|
||||||
|
}
|
||||||
|
if(this.price<0){
|
||||||
|
this.price=0;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeSel(item) {
|
||||||
|
item.checked = !item.checked;
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.note = "";
|
||||||
|
this.number = 1;
|
||||||
|
this.tags.map((v) => {
|
||||||
|
v.checked = false;
|
||||||
|
});
|
||||||
|
console.log(this.number);
|
||||||
|
},
|
||||||
|
delTag(index) {
|
||||||
|
this.tags.splice(index, 1);
|
||||||
|
},
|
||||||
|
addNote(tag) {
|
||||||
|
if (this.note.length <= 0) {
|
||||||
|
return (this.note = tag);
|
||||||
|
}
|
||||||
|
this.note = tag + "," + this.note;
|
||||||
|
},
|
||||||
|
open(item) {
|
||||||
|
this.goods = item ? item : this.goods;
|
||||||
|
this.max=returnCartPrice(this.goods,this.vipUser)
|
||||||
|
this.show = true;
|
||||||
|
if (item.productId != "-999") {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.price = item.discountSaleAmount||'';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.show = false;
|
||||||
|
this.number = 1;
|
||||||
|
},
|
||||||
|
async confirm() {
|
||||||
|
const selTag = this.tags
|
||||||
|
.filter((item) => item.checked)
|
||||||
|
.map((item) => item.label)
|
||||||
|
.join(",");
|
||||||
|
const note = selTag + (this.note.length > 0 ? "," + this.note : "");
|
||||||
|
if (!note) {
|
||||||
|
return this.$message.error("请输入更改原因");
|
||||||
|
}
|
||||||
|
const res=await $updatePrice({
|
||||||
|
cartId: this.goods.id,
|
||||||
|
saleAmount:this.price,
|
||||||
|
note:note,
|
||||||
|
})
|
||||||
|
this.$message.success("修改价格成功");
|
||||||
|
this.close();
|
||||||
|
this.$emit('updateCart',res)
|
||||||
|
// this.$emit("confirm", { note: note, num: this.number });
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
::v-deep .el-dialog__body {
|
||||||
|
margin-bottom: 14px;
|
||||||
|
margin-top: 14px;
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
|
::v-deep .el-tag {
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 35px;
|
||||||
|
height: 35px;
|
||||||
|
}
|
||||||
|
.tags {
|
||||||
|
.tag {
|
||||||
|
margin: 10px 10px 0 0;
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 10px 13px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #666;
|
||||||
|
cursor: pointer;
|
||||||
|
&.active {
|
||||||
|
color: #1890ff;
|
||||||
|
background: #e8f4ff;
|
||||||
|
border-color: #a3d3ff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep .el-dialog__body {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
::v-deep input::-webkit-outer-spin-button,
|
||||||
|
::v-deep input::-webkit-inner-spin-button {
|
||||||
|
-webkit-appearance: none !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,357 @@
|
||||||
|
<template>
|
||||||
|
<div class="select_desk">
|
||||||
|
<el-dialog width="410px" title="挂账" :visible.sync="show">
|
||||||
|
<div class="guazhangren u-flex u-row-between" @click="guazhangShow">
|
||||||
|
<template v-if="guazhangRen">
|
||||||
|
<div>
|
||||||
|
<div class="name">
|
||||||
|
{{ guazhangRen.debtor }}/{{ guazhangRen.position }}
|
||||||
|
</div>
|
||||||
|
<div class="u-m-t-6">手机号:{{ guazhangRen.mobile }}</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="">可用额度</div>
|
||||||
|
<div class="u-m-t-6">{{ guazhangRen.remainingAmount }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<div class="color-999">选择挂账人/单位</div>
|
||||||
|
<span class="el-icon-caret-bottom"></span>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<div class="select_desk_dialog u-p-b-20">
|
||||||
|
<key-board
|
||||||
|
isCanEmpty
|
||||||
|
v-model="number"
|
||||||
|
isFloat
|
||||||
|
@clear="clear"
|
||||||
|
:max="payMoney"
|
||||||
|
:maxTips="'超出未结账金额'"
|
||||||
|
>
|
||||||
|
<div slot="clear">.</div>
|
||||||
|
<div
|
||||||
|
|
||||||
|
slot="tips"
|
||||||
|
class="color-red w-full u-p-l-20 u-text-left u-m-t-10 u-m-b-30"
|
||||||
|
>
|
||||||
|
{{ tips }}
|
||||||
|
</div>
|
||||||
|
<div slot="input" class="u-p-l-20 u-p-r-20 u-flex w-full">
|
||||||
|
<div class="font-bold u-font-32">¥</div>
|
||||||
|
<el-input
|
||||||
|
placeholder="请输入挂账金额"
|
||||||
|
v-model="number"
|
||||||
|
@input="inputNumber"
|
||||||
|
@change="inputChange"
|
||||||
|
@focus="inputFocus"
|
||||||
|
@blur="inputBlur"
|
||||||
|
:type="focus ? 'number' : 'text'"
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
</key-board>
|
||||||
|
<div class="confirm_btns">
|
||||||
|
<el-button size="medium" @click="close">取消</el-button>
|
||||||
|
<el-button type="primary" size="medium" @click="confirm"
|
||||||
|
>确定</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<choose-guazhang
|
||||||
|
ref="refChooseGuazhang"
|
||||||
|
@confirm="chooseGuazhangConfirm"
|
||||||
|
></choose-guazhang>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import keyBoard from "./keyboard.vue";
|
||||||
|
import chooseGuazhang from "./choose-guazhang.vue";
|
||||||
|
export default {
|
||||||
|
components: { keyBoard, chooseGuazhang },
|
||||||
|
props: {
|
||||||
|
payMoney: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
guazhangRen: "",
|
||||||
|
number: "",
|
||||||
|
show: false,
|
||||||
|
hasOpen: false,
|
||||||
|
loading: false,
|
||||||
|
tips: "",
|
||||||
|
focus: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
number(newval) {
|
||||||
|
console.log(newval);
|
||||||
|
if (newval * 1 > this.payMoney * 1) {
|
||||||
|
this.number = this.payMoney;
|
||||||
|
this.number = newval;
|
||||||
|
}
|
||||||
|
if (newval * 1 > this.payMoney * 1) {
|
||||||
|
this.tips =
|
||||||
|
"已超出未结账金额";
|
||||||
|
} else {
|
||||||
|
const shengyu=this.payMoney - this.number
|
||||||
|
|
||||||
|
this.tips =shengyu>0?
|
||||||
|
"还需额外支付" + shengyu.toFixed(2) + "元":'';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
inputFocus() {
|
||||||
|
this.focus = true;
|
||||||
|
},
|
||||||
|
inputBlur() {
|
||||||
|
this.focus = false;
|
||||||
|
},
|
||||||
|
chooseGuazhangConfirm(e) {
|
||||||
|
this.guazhangRen = e;
|
||||||
|
},
|
||||||
|
guazhangShow() {
|
||||||
|
this.$refs.refChooseGuazhang.open();
|
||||||
|
},
|
||||||
|
|
||||||
|
inputNumber(e) {
|
||||||
|
console.log("inputNumber");
|
||||||
|
if (e * 1 > this.payMoney * 1) {
|
||||||
|
this.tips = "已超出未结账金额";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
inputChange(e) {
|
||||||
|
if (e * 1 > this.payMoney * 1) {
|
||||||
|
this.tips = "已超出未结账金额";
|
||||||
|
}
|
||||||
|
console.log(e);
|
||||||
|
},
|
||||||
|
clear(e) {
|
||||||
|
console.log(e);
|
||||||
|
this.number = "";
|
||||||
|
},
|
||||||
|
confirm() {
|
||||||
|
if (this.number*1 > this.payMoney*1) {
|
||||||
|
return this.$message("已超出未结账金额");
|
||||||
|
}
|
||||||
|
if (this.number * 1 <= 0) {
|
||||||
|
return this.$message("支付金额不正确");
|
||||||
|
}
|
||||||
|
if (!this.guazhangRen) {
|
||||||
|
return this.$message("请选择挂账人");
|
||||||
|
}
|
||||||
|
this.$emit("confirm",this.guazhangRen, this.number);
|
||||||
|
this.close();
|
||||||
|
},
|
||||||
|
open(number) {
|
||||||
|
this.number = this.payMoney*1
|
||||||
|
this.show = true;
|
||||||
|
this.tips = "还需额外支付" + this.payMoney + "元";
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.show = false;
|
||||||
|
this.number = "";
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
::v-deep.el-button {
|
||||||
|
padding: 12px 20px;
|
||||||
|
}
|
||||||
|
::v-deep .carts .box_status {
|
||||||
|
margin-bottom: 0;
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
::v-deep .select_desk_dialog .el-input__inner {
|
||||||
|
border: none;
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
::v-deep .el-input__inner::-webkit-inner-spin-button {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
::v-deep .el-input__inner::-webkit-outer-spin-button {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
::v-deep .el-button--success {
|
||||||
|
border-color: #22bf64;
|
||||||
|
background-color: #22bf64;
|
||||||
|
}
|
||||||
|
.select_desk .btn {
|
||||||
|
height: 34px;
|
||||||
|
}
|
||||||
|
.tags {
|
||||||
|
font-size: 16px;
|
||||||
|
&.using {
|
||||||
|
color: rgb(234, 64, 37);
|
||||||
|
}
|
||||||
|
&.wait {
|
||||||
|
color: rgb(252, 236, 79);
|
||||||
|
}
|
||||||
|
&.idle {
|
||||||
|
color: rgb(137, 234, 71);
|
||||||
|
}
|
||||||
|
&.closed {
|
||||||
|
color: rgb(221, 221, 221);
|
||||||
|
filter: grayscale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep .inputs .el-input__inner {
|
||||||
|
border-color: transparent !important;
|
||||||
|
color: rgba(0, 0, 0, 0.8);
|
||||||
|
letter-spacing: 1.25px;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.select_desk .select_desk_dialog {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .nav {
|
||||||
|
width: 286px;
|
||||||
|
height: 38px;
|
||||||
|
background: #dcf0e8;
|
||||||
|
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .nav .li,
|
||||||
|
.select_desk .select_desk_dialog .nav {
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .nav .li {
|
||||||
|
width: 140px;
|
||||||
|
height: 34px;
|
||||||
|
color: #0fc161;
|
||||||
|
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 14px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .nav .lion {
|
||||||
|
background: #0fc161;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .inputs {
|
||||||
|
width: 370px;
|
||||||
|
line-height: 54px;
|
||||||
|
margin-top: 24px;
|
||||||
|
height: 54px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
border-radius: 4px;
|
||||||
|
color: rgba(0, 0, 0, 0.8);
|
||||||
|
letter-spacing: 1.25px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 20px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .inputs .close {
|
||||||
|
color: #aaa;
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
height: 30px;
|
||||||
|
width: 30px;
|
||||||
|
line-height: 30px;
|
||||||
|
top: 50%;
|
||||||
|
margin-top: -15px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.guazhangren {
|
||||||
|
padding: 12px 10px;
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin-top: 20px;
|
||||||
|
min-height: 58px;
|
||||||
|
color: #999;
|
||||||
|
cursor: pointer;
|
||||||
|
.name {
|
||||||
|
color: #3f9eff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .keyboard {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
flex-wrap: wrap;
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-right: 1px solid #dcdfe6;
|
||||||
|
border-bottom: 1px solid #dcdfe6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .keyboard .li {
|
||||||
|
height: 60px;
|
||||||
|
width: 33.333%;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
align-items: center;
|
||||||
|
font-size: 24px;
|
||||||
|
color: #212121;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
user-select: none;
|
||||||
|
border-left: 1px solid #dcdfe6;
|
||||||
|
border-top: 1px solid #dcdfe6;
|
||||||
|
|
||||||
|
transition: all 0.1s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .keyboard .li:hover {
|
||||||
|
background: #dcdfe6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .keyboard .li .icon {
|
||||||
|
font-size: 1.3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .keyboard .confirm {
|
||||||
|
height: 140px;
|
||||||
|
background: #ff9f2e;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .keyboard .confirm:hover {
|
||||||
|
background: #f88502;
|
||||||
|
}
|
||||||
|
|
||||||
|
.confirm_btns {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.confirm_btns .el-button {
|
||||||
|
width: 175px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -8,12 +8,20 @@
|
||||||
<div>
|
<div>
|
||||||
<div>将临时菜添加至购物车,不会影响总商品库</div>
|
<div>将临时菜添加至购物车,不会影响总商品库</div>
|
||||||
<div class="u-m-t-16">
|
<div class="u-m-t-16">
|
||||||
<el-form ref="form" :model="form" label-width="80px">
|
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
|
||||||
<el-form-item label="菜品名称">
|
<el-form-item label="菜品名称" prop="name">
|
||||||
<el-input v-model="form.name"></el-input>
|
<el-input
|
||||||
|
v-model="form.name"
|
||||||
|
placeholder="请输入菜品名称"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="菜品分类">
|
<el-form-item label="菜品分类" prop="categoryId">
|
||||||
<el-select v-model="form.category" filterable placeholder="选择分类">
|
<el-select
|
||||||
|
v-model="form.categoryId"
|
||||||
|
@change="selectChange($event, 'form', 'categoryId')"
|
||||||
|
filterable
|
||||||
|
placeholder="选择分类"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in category"
|
v-for="item in category"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
|
|
@ -23,13 +31,22 @@
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="价格">
|
<el-form-item label="价格" prop="price">
|
||||||
<el-input v-model="form.price" placeholder="请输入价格" type="number">
|
<el-input
|
||||||
<template slot="append">元</template>
|
v-model="form.price"
|
||||||
|
placeholder="请输入价格"
|
||||||
|
type="number"
|
||||||
|
>
|
||||||
|
<template slot="append">元</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="单位">
|
<el-form-item label="单位" prop="unit">
|
||||||
<el-select v-model="form.unit" filterable placeholder="选择单位">
|
<el-select
|
||||||
|
v-model="form.unit"
|
||||||
|
filterable
|
||||||
|
placeholder="选择单位"
|
||||||
|
@change="selectChange($event, 'form', 'unit')"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in units"
|
v-for="item in units"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
|
|
@ -39,13 +56,16 @@
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="下单数量">
|
<el-form-item label="下单数量" prop="num">
|
||||||
<el-input v-model="form.num" placeholder="请输入下单数量" type="number">
|
<el-input
|
||||||
|
v-model="form.num"
|
||||||
|
placeholder="请输入下单数量"
|
||||||
|
type="number"
|
||||||
|
>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
<el-input v-model="form.note" placeholder="请输入备注" >
|
<el-input v-model="form.note" placeholder="请输入备注"> </el-input>
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -57,22 +77,32 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { tbShopCategoryGet,tbShopUnit } from "@/api/shop";
|
import { tbShopCategoryGet, tbShopUnit } from "@/api/shop";
|
||||||
|
import * as $InsteadApi from "@/api/Instead";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
show: false,
|
show: false,
|
||||||
|
rules: {
|
||||||
|
name: [{ required: true, message: "请输入菜品名称", trigger: "blur" }],
|
||||||
|
categoryId: [
|
||||||
|
{ required: true, message: "请选择菜品分类", trigger: "blur" },
|
||||||
|
],
|
||||||
|
price: [{ required: true, message: "请输入菜品价格", trigger: "blur" }],
|
||||||
|
unit: [{ required: true, message: "请选择菜品单位", trigger: "blur" }],
|
||||||
|
num: [{ required: true, message: "请输入下单数量", trigger: "blur" }],
|
||||||
|
},
|
||||||
form: {
|
form: {
|
||||||
name: "",
|
name: "",
|
||||||
category:'',
|
categoryId: "",
|
||||||
price: "",
|
price: "",
|
||||||
unit:'',
|
unit: "",
|
||||||
num:1,
|
num: 1,
|
||||||
note:''
|
note: "",
|
||||||
},
|
},
|
||||||
category:[],
|
category: [],
|
||||||
units:[]
|
units: [],
|
||||||
|
option:{}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -96,24 +126,52 @@ export default {
|
||||||
sort: "id",
|
sort: "id",
|
||||||
shopId: localStorage.getItem("shopId"),
|
shopId: localStorage.getItem("shopId"),
|
||||||
});
|
});
|
||||||
this.units = content
|
this.units = content;
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.$refs.form.resetFields();
|
||||||
},
|
},
|
||||||
reset() {},
|
|
||||||
|
|
||||||
open() {
|
open(opt) {
|
||||||
this.show = true;
|
this.show = true;
|
||||||
|
this.option=opt
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.show = false;
|
this.show = false;
|
||||||
},
|
},
|
||||||
confirm() {
|
|
||||||
this.$emit("confirm", this.form);
|
//解决selectc值改变后未验证问题
|
||||||
|
selectChange($event, ref, type) {
|
||||||
|
// this.$refs[ref][0].validateField(type)
|
||||||
|
this.$refs[ref].validateField(type);
|
||||||
|
},
|
||||||
|
async submit() {
|
||||||
|
const res = await $InsteadApi.$temporaryDishes({...this.option,...this.form});
|
||||||
|
console.log(res);
|
||||||
|
this.$notify({
|
||||||
|
title: "临时菜添加成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.$emit("updateCart");
|
||||||
this.close();
|
this.close();
|
||||||
},
|
},
|
||||||
|
confirm() {
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
console.log(valid);
|
||||||
|
// this.$emit("confirm", this.form);
|
||||||
|
// this.close();
|
||||||
|
this.submit();
|
||||||
|
} else {
|
||||||
|
console.log("error submit!!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getCategory()
|
this.getCategory();
|
||||||
this.getUnit()
|
this.getUnit();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -131,7 +189,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
::v-deep .el-input__inner::-webkit-inner-spin-button {
|
::v-deep .el-input__inner::-webkit-inner-spin-button {
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,165 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-dialog width="400px" :title="title" :visible.sync="show" @close="reset">
|
||||||
|
<div class="u-p-15">
|
||||||
|
<div class="u-m-t-20">
|
||||||
|
<el-alert
|
||||||
|
:closable="false"
|
||||||
|
v-if="tips"
|
||||||
|
:title="tips"
|
||||||
|
type="warning"
|
||||||
|
show-icon
|
||||||
|
>
|
||||||
|
</el-alert>
|
||||||
|
</div>
|
||||||
|
<div class="u-m-t-20">
|
||||||
|
<template>
|
||||||
|
<el-form label-width="90px" label-position="left">
|
||||||
|
<el-form-item label="团购代金券">
|
||||||
|
<el-input
|
||||||
|
v-model="form.code"
|
||||||
|
@change="codeInputChange"
|
||||||
|
placeholder="请扫码或者输入付款码"
|
||||||
|
ref="refInputCode"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<div class="u-flex u-row-center u-m-t-50">
|
||||||
|
<el-button size="medium" @click="close">取消</el-button>
|
||||||
|
<el-button size="medium" type="primary" @click="confirm"
|
||||||
|
>确定</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<el-dialog width="400px" title="团购券商品" :visible.sync="tuanGoodsShow">
|
||||||
|
<tuan-quan-table
|
||||||
|
:data="canDikouGoods"
|
||||||
|
ref="refGoodsTable"
|
||||||
|
></tuan-quan-table>
|
||||||
|
<div class="u-flex u-row-center u-m-t-30 u-p-b-20">
|
||||||
|
<el-button size="medium" @click="tuanGoodsShow = false">取消</el-button>
|
||||||
|
<el-button size="medium" type="primary" @click="tuanGoodsConfirm"
|
||||||
|
>确定</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { $thirdPartyCoupon } from "@/api/Instead";
|
||||||
|
import tuanQuanTable from "./tuan-quan-table.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { tuanQuanTable },
|
||||||
|
props: {
|
||||||
|
cartGoods: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: "团购代金券核销",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filters: {
|
||||||
|
to2(n) {
|
||||||
|
return n.toFixed(2);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
canDikouGoods: [],
|
||||||
|
tuanQuan: {
|
||||||
|
goods: [],
|
||||||
|
},
|
||||||
|
tuanGoodsShow: false,
|
||||||
|
tips: "请使用扫码枪扫描团购代金券",
|
||||||
|
form: {
|
||||||
|
money: "",
|
||||||
|
code: "",
|
||||||
|
},
|
||||||
|
number: "0",
|
||||||
|
show: false,
|
||||||
|
timer: null,
|
||||||
|
payPar: {},
|
||||||
|
selGoodsArr: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
defaultTips(val) {
|
||||||
|
this.tips = val;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
codeInputChange(e) {
|
||||||
|
console.log(e);
|
||||||
|
// this.$emit("confirm", this.form.code);
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.tuanQuan = {
|
||||||
|
goods: [],
|
||||||
|
};
|
||||||
|
this.form.code = "";
|
||||||
|
this.selGoodsArr = [];
|
||||||
|
},
|
||||||
|
tuanGoodsConfirm() {
|
||||||
|
const selGoods = this.$refs.refGoodsTable.getSelectRows();
|
||||||
|
if (selGoods.length == 0) {
|
||||||
|
return this.$message.error("请选择商品");
|
||||||
|
}
|
||||||
|
this.$emit("confirm", {
|
||||||
|
...this.tuanQuan,
|
||||||
|
goods: selGoods,
|
||||||
|
});
|
||||||
|
this.tuanGoodsShow = false;
|
||||||
|
this.show = false;
|
||||||
|
},
|
||||||
|
async confirm() {
|
||||||
|
if (!this.form.code) {
|
||||||
|
return this.$message.error("请输入或扫团购代金券");
|
||||||
|
}
|
||||||
|
const res = await $thirdPartyCoupon({
|
||||||
|
code: this.form.code,
|
||||||
|
});
|
||||||
|
this.tuanQuan = res;
|
||||||
|
this.tuanGoodsShow = true;
|
||||||
|
console.log(res);
|
||||||
|
// this.close();
|
||||||
|
// this.$emit("confirm", this.form.code);
|
||||||
|
},
|
||||||
|
open(data) {
|
||||||
|
this.show = true;
|
||||||
|
this.canDikouGoods=this.cartGoods.filter(item=>item.productId!='-999')
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.refInputCode.focus();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.show = false;
|
||||||
|
},
|
||||||
|
numberInput(val) {
|
||||||
|
console.log(val);
|
||||||
|
this.number = `${Number(val)}`;
|
||||||
|
},
|
||||||
|
keyboradConfirm() {
|
||||||
|
this.$emit("confirm", this.number);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.number = `${this.value}`;
|
||||||
|
this.tips = this.defaultTips;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.codeImg {
|
||||||
|
width: 164px;
|
||||||
|
border: 1px solid rgb(220, 223, 230);
|
||||||
|
height: 164px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
:data="data"
|
||||||
|
style="width: 100%"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
@cell-click="cellClick"
|
||||||
|
>
|
||||||
|
<template v-if="type == 'edit'">
|
||||||
|
<el-table-column type="selection" width="55"> </el-table-column>
|
||||||
|
</template>
|
||||||
|
<el-table-column
|
||||||
|
prop="productName"
|
||||||
|
label="商品名称"
|
||||||
|
width="100"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column prop="price" label="商品单价"></el-table-column>
|
||||||
|
<el-table-column prop="num" label="商品数量"></el-table-column>
|
||||||
|
<el-table-column prop="priceAmount" label="商品总价"></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
type: {
|
||||||
|
type: String, //edit show
|
||||||
|
default: "edit",
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selArr: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getSelectRows() {
|
||||||
|
return this.selArr;
|
||||||
|
},
|
||||||
|
handleSelectionChange(e) {
|
||||||
|
if (this.type == "edit") {
|
||||||
|
this.selArr = e;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cellClick(row) {
|
||||||
|
if (this.type == "edit") {
|
||||||
|
this.$refs.table.toggleRowSelection(row);
|
||||||
|
}
|
||||||
|
console.log(row);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -399,11 +399,18 @@
|
||||||
<div slot="content">
|
<div slot="content">
|
||||||
<div
|
<div
|
||||||
class="u-flex color-000 u-font-14 u-row-between"
|
class="u-flex color-000 u-font-14 u-row-between"
|
||||||
v-if="vipDiscountPrice > 0"
|
v-if="vipDiscountPrice * 1 > 0"
|
||||||
>
|
>
|
||||||
<span class="font-bold">会员优惠 </span>
|
<span class="font-bold">会员优惠 </span>
|
||||||
<span class="">{{ vipDiscountPrice }} </span>
|
<span class="">{{ vipDiscountPrice }} </span>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
class="u-flex color-000 u-font-14 u-row-between"
|
||||||
|
v-if="discountSaleAmount * 1 > 0"
|
||||||
|
>
|
||||||
|
<span class="font-bold">单品改价优惠 </span>
|
||||||
|
<span class="">{{ discountSaleAmount }} </span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span> 已优惠¥{{ youhuiAllPrice }} </span>
|
<span> 已优惠¥{{ youhuiAllPrice }} </span>
|
||||||
<i class="el-icon-arrow-right"></i>
|
<i class="el-icon-arrow-right"></i>
|
||||||
|
|
@ -500,7 +507,7 @@
|
||||||
<el-button
|
<el-button
|
||||||
size="medium"
|
size="medium"
|
||||||
:disabled="
|
:disabled="
|
||||||
!order.list.length && !order.old.list.length
|
!order.list.length && order.old.list.length <= 0
|
||||||
"
|
"
|
||||||
@click="toCreateOrderDebounce(true)"
|
@click="toCreateOrderDebounce(true)"
|
||||||
>
|
>
|
||||||
|
|
@ -639,21 +646,36 @@
|
||||||
>
|
>
|
||||||
退菜
|
退菜
|
||||||
</div>
|
</div>
|
||||||
<!-- <div
|
<div
|
||||||
|
@click="orderBtnsClick('print')"
|
||||||
|
:class="{ disabled: order.selIndex < 0 }"
|
||||||
|
class="btn"
|
||||||
|
>
|
||||||
|
{{ returnPrintText }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
@click="refPopChangePriceShow"
|
||||||
|
:class="{ disabled: order.selIndex < 0 }"
|
||||||
class="btn"
|
class="btn"
|
||||||
>
|
>
|
||||||
单品改价
|
单品改价
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="btn"
|
class="btn"
|
||||||
|
@click="orderBtnsClick('isWaitCall')"
|
||||||
|
:class="{ disabled: order.selIndex < 0 }"
|
||||||
>
|
>
|
||||||
等叫
|
{{ returnWaingText }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="btn no-wrap u-font-12"
|
class="btn no-wrap u-font-12"
|
||||||
|
@click="orderBtnsClick('AllWaitCall')"
|
||||||
|
:class="{ disabled: isCreateOrder}"
|
||||||
|
|
||||||
>
|
>
|
||||||
取消全部等叫
|
{{ returnWaingAllText }}
|
||||||
</div> -->
|
</div>
|
||||||
|
|
||||||
<!-- <div
|
<!-- <div
|
||||||
class="btn"
|
class="btn"
|
||||||
|
|
@ -713,7 +735,7 @@
|
||||||
</div>
|
</div>
|
||||||
<template v-if="goods.list.length">
|
<template v-if="goods.list.length">
|
||||||
<div class="goods-list">
|
<div class="goods-list">
|
||||||
<!-- <div
|
<div
|
||||||
@click="lingshicaiShow"
|
@click="lingshicaiShow"
|
||||||
class="goods-item lingshicai text-center color-999"
|
class="goods-item lingshicai text-center color-999"
|
||||||
:class="{
|
:class="{
|
||||||
|
|
@ -723,7 +745,7 @@
|
||||||
>
|
>
|
||||||
<span class="el-icon-plus" style="font-size: 26px"></span>
|
<span class="el-icon-plus" style="font-size: 26px"></span>
|
||||||
<div class="u-m-t-10">临时菜</div>
|
<div class="u-m-t-10">临时菜</div>
|
||||||
</div> -->
|
</div>
|
||||||
<div
|
<div
|
||||||
class="goods-item"
|
class="goods-item"
|
||||||
:class="{
|
:class="{
|
||||||
|
|
@ -933,8 +955,35 @@
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="u-flex flex-wrap">
|
<div class="u-flex flex-wrap">
|
||||||
|
<span class="font-bold no-wrap">团购代金券</span>
|
||||||
|
<div
|
||||||
|
class="border u-p-l-20 cur-pointer u-m-r-20 u-flex no-wrap u-p-t-10 u-p-b-10 border-r-4 selQuan"
|
||||||
|
@click="shouwTuanQuan"
|
||||||
|
>
|
||||||
|
<span class="color-999 u-p-r-10">代金券名称</span>
|
||||||
|
<span
|
||||||
|
class="el-icon-arrow-down color-999 u-m-r-10"
|
||||||
|
></span>
|
||||||
|
</div>
|
||||||
|
<img
|
||||||
|
style="width: 30px; height: 30px"
|
||||||
|
class="cur-pointer"
|
||||||
|
@click="shouwTuanQuan"
|
||||||
|
src="@/assets/images/scan.png"
|
||||||
|
/>
|
||||||
|
<!-- <el-button size="medium " type="text">
|
||||||
|
查看不可用券
|
||||||
|
</el-button> -->
|
||||||
|
</div>
|
||||||
|
<template v-if="tuanQuan">
|
||||||
|
<tuan-quan-table
|
||||||
|
:data="tuanQuan.goods"
|
||||||
|
type="show"
|
||||||
|
ref="refGoodsTable"
|
||||||
|
></tuan-quan-table>
|
||||||
|
</template>
|
||||||
|
<div class="u-flex flex-wrap u-m-t-20">
|
||||||
<span class="font-bold no-wrap">优惠券</span>
|
<span class="font-bold no-wrap">优惠券</span>
|
||||||
<div
|
<div
|
||||||
class="border u-p-l-20 cur-pointer u-m-r-20 u-flex no-wrap u-p-t-10 u-p-b-10 border-r-4 selQuan"
|
class="border u-p-l-20 cur-pointer u-m-r-20 u-flex no-wrap u-p-t-10 u-p-b-10 border-r-4 selQuan"
|
||||||
|
|
@ -945,6 +994,7 @@
|
||||||
class="el-icon-arrow-down color-999 u-m-r-10"
|
class="el-icon-arrow-down color-999 u-m-r-10"
|
||||||
></span>
|
></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <el-button size="medium " type="text">
|
<!-- <el-button size="medium " type="text">
|
||||||
查看不可用券
|
查看不可用券
|
||||||
</el-button> -->
|
</el-button> -->
|
||||||
|
|
@ -1019,6 +1069,7 @@
|
||||||
:disabledPayType="disabledPayType"
|
:disabledPayType="disabledPayType"
|
||||||
>
|
>
|
||||||
</pay-type>
|
</pay-type>
|
||||||
|
<el-button @click="guazhangShow" size="medium">挂账</el-button>
|
||||||
<div style="margin-top: 20px">
|
<div style="margin-top: 20px">
|
||||||
<el-button type="primary" size="medium" @click="payOrder">
|
<el-button type="primary" size="medium" @click="payOrder">
|
||||||
<span>立即支付</span>
|
<span>立即支付</span>
|
||||||
|
|
@ -1413,7 +1464,25 @@
|
||||||
></return-cart>
|
></return-cart>
|
||||||
|
|
||||||
<!-- 临时菜 -->
|
<!-- 临时菜 -->
|
||||||
<cai-add ref="refPopAddCai"></cai-add>
|
<cai-add ref="refPopAddCai" @updateCart="getCart"></cai-add>
|
||||||
|
<!-- 单品改价 -->
|
||||||
|
<cart-change-price
|
||||||
|
ref="refPopChangePrice"
|
||||||
|
:vipUser="vipUser"
|
||||||
|
@updateCart="updateCartItem"
|
||||||
|
></cart-change-price>
|
||||||
|
<!-- 团购券 -->
|
||||||
|
<pop-tuan-quan
|
||||||
|
:cartGoods="createOrder.data.detailList || []"
|
||||||
|
ref="refPopTuanQuan"
|
||||||
|
@confirm="tuanQuanConfirm"
|
||||||
|
></pop-tuan-quan>
|
||||||
|
<!-- 挂账 -->
|
||||||
|
<popup-choose-guazhang
|
||||||
|
ref="refGuaZhang"
|
||||||
|
:payMoney="yinFuJinE"
|
||||||
|
@confirm="guazhangPayConfirm"
|
||||||
|
></popup-choose-guazhang>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -1431,6 +1500,11 @@ import chooseDinersNumber from "./components/choose-diners-number.vue";
|
||||||
import returnCart from "./components/return-cart.vue";
|
import returnCart from "./components/return-cart.vue";
|
||||||
import moneyKeyboard from "./components/money-keyboard.vue";
|
import moneyKeyboard from "./components/money-keyboard.vue";
|
||||||
import caiAdd from "./components/popup-linshiCai.vue";
|
import caiAdd from "./components/popup-linshiCai.vue";
|
||||||
|
import cartChangePrice from "./components/popup-cart-changePrice.vue";
|
||||||
|
import popTuanQuan from "./components/popup-tuan-quan.vue";
|
||||||
|
import tuanQuanTable from "./components/tuan-quan-table.vue";
|
||||||
|
import popupChooseGuazhang from "./components/popup-choose-guazhang.vue";
|
||||||
|
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { tbShopInfo } from "@/api/user";
|
import { tbShopInfo } from "@/api/user";
|
||||||
import { hasPermission } from "@/utils/limits.js";
|
import { hasPermission } from "@/utils/limits.js";
|
||||||
|
|
@ -1463,7 +1537,9 @@ import {
|
||||||
$calcUsablePoints,
|
$calcUsablePoints,
|
||||||
$calcDeDuctionPoints,
|
$calcDeDuctionPoints,
|
||||||
} from "@/api/table";
|
} from "@/api/table";
|
||||||
|
|
||||||
import { tbShopCategoryGet } from "@/api/shop";
|
import { tbShopCategoryGet } from "@/api/shop";
|
||||||
|
import { $checkCoupon,$waitCall } from "@/api/Instead";
|
||||||
import {
|
import {
|
||||||
isCanBuy,
|
isCanBuy,
|
||||||
arrayContainsAll,
|
arrayContainsAll,
|
||||||
|
|
@ -1480,10 +1556,15 @@ import { returnProductCoupAllPrice } from "./quan_util.js";
|
||||||
//商品数量从0到n每一个对应的价格
|
//商品数量从0到n每一个对应的价格
|
||||||
let $goodsPayPriceMap = {};
|
let $goodsPayPriceMap = {};
|
||||||
import { $status } from "@/utils/table.js";
|
import { $status } from "@/utils/table.js";
|
||||||
|
import PopupChooseGuazhang from "./components/popup-choose-guazhang.vue";
|
||||||
|
|
||||||
let $originTableList = [];
|
let $originTableList = [];
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
popupChooseGuazhang,
|
||||||
|
cartChangePrice,
|
||||||
|
popTuanQuan,
|
||||||
|
tuanQuanTable,
|
||||||
caiAdd,
|
caiAdd,
|
||||||
quansPop,
|
quansPop,
|
||||||
returnCart,
|
returnCart,
|
||||||
|
|
@ -1496,9 +1577,12 @@ export default {
|
||||||
moneyDiscount,
|
moneyDiscount,
|
||||||
cartItem,
|
cartItem,
|
||||||
chooseDinersNumber,
|
chooseDinersNumber,
|
||||||
|
PopupChooseGuazhang,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
//挂账人
|
||||||
|
guazhangRen: "",
|
||||||
disabledPayType: [],
|
disabledPayType: [],
|
||||||
//积分抵扣
|
//积分抵扣
|
||||||
points: {
|
points: {
|
||||||
|
|
@ -1512,6 +1596,8 @@ export default {
|
||||||
value: 0,
|
value: 0,
|
||||||
toMoney: 0,
|
toMoney: 0,
|
||||||
},
|
},
|
||||||
|
//团购券
|
||||||
|
tuanQuan: "",
|
||||||
//选中可用优惠券
|
//选中可用优惠券
|
||||||
quansSelArr: [],
|
quansSelArr: [],
|
||||||
//台桌搜索文字
|
//台桌搜索文字
|
||||||
|
|
@ -1710,9 +1796,33 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
timer: null,
|
timer: null,
|
||||||
|
isAllWaitCall: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
returnPrintText(){
|
||||||
|
if (this.order.selIndex < 0) {
|
||||||
|
return "免厨打";
|
||||||
|
}
|
||||||
|
return this.order.list[this.order.selIndex].isPrint
|
||||||
|
? "免厨打"
|
||||||
|
: "打印";
|
||||||
|
},
|
||||||
|
returnWaingText() {
|
||||||
|
if (this.order.selIndex < 0) {
|
||||||
|
return "等叫";
|
||||||
|
}
|
||||||
|
return this.order.list[this.order.selIndex].isWaitCall == 1
|
||||||
|
? "取消等叫"
|
||||||
|
: "等叫";
|
||||||
|
},
|
||||||
|
isHasWaiting() {
|
||||||
|
const waitingArr = this.order.list.filter((v) => v.isWaitCall == 1);
|
||||||
|
return waitingArr.length > 0 ? true : false;
|
||||||
|
},
|
||||||
|
returnWaingAllText() {
|
||||||
|
return this.isAllWaitCall ? "取消全部等叫" : "整单等叫";
|
||||||
|
},
|
||||||
pointsDiscountAmount() {
|
pointsDiscountAmount() {
|
||||||
if (this.points.selected) {
|
if (this.points.selected) {
|
||||||
return this.points.toMoney;
|
return this.points.toMoney;
|
||||||
|
|
@ -1918,8 +2028,28 @@ export default {
|
||||||
}, 0);
|
}, 0);
|
||||||
return (oldMemberPrice + nowMemberprice).toFixed(2);
|
return (oldMemberPrice + nowMemberprice).toFixed(2);
|
||||||
},
|
},
|
||||||
|
discountSaleAmount() {
|
||||||
|
const oldTotal = this.order.old.list.reduce((a, b) => {
|
||||||
|
const bTotal = b.info
|
||||||
|
.filter((v) => v.discountSaleAmount && v.discountSaleAmount > 0)
|
||||||
|
.reduce((prve, cur) => {
|
||||||
|
return prve + cur.number * cur.discountSaleAmount;
|
||||||
|
}, 0);
|
||||||
|
return a + bTotal;
|
||||||
|
}, 0);
|
||||||
|
const nowTotal = this.order.list
|
||||||
|
.filter((v) => v.discountSaleAmount && v.discountSaleAmount > 0)
|
||||||
|
.reduce((a, b) => {
|
||||||
|
return a + b.number * b.discountSaleAmount;
|
||||||
|
}, 0);
|
||||||
|
return (oldTotal + nowTotal).toFixed(2);
|
||||||
|
},
|
||||||
youhuiAllPrice() {
|
youhuiAllPrice() {
|
||||||
return (this.vipDiscountPrice * 1 + this.allGiftMoney * 1).toFixed(2);
|
return (
|
||||||
|
this.vipDiscountPrice * 1 +
|
||||||
|
this.allGiftMoney * 1 +
|
||||||
|
this.discountSaleAmount * 1
|
||||||
|
).toFixed(2);
|
||||||
},
|
},
|
||||||
allNumber() {
|
allNumber() {
|
||||||
const oldNumber = this.order.old.list.reduce((a, b) => {
|
const oldNumber = this.order.old.list.reduce((a, b) => {
|
||||||
|
|
@ -2194,6 +2324,38 @@ export default {
|
||||||
this.open(this.$route.query);
|
this.open(this.$route.query);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//挂账人支付确认
|
||||||
|
guazhangPayConfirm(guazhangren, price) {
|
||||||
|
this.guazhangRen = guazhangren;
|
||||||
|
this.pays({
|
||||||
|
creditBuyerId: this.guazhangRen.id,
|
||||||
|
payType: "creditBuyer",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//挂账
|
||||||
|
guazhangShow() {
|
||||||
|
this.$refs.refGuaZhang.open();
|
||||||
|
},
|
||||||
|
//团购券扫码弹窗
|
||||||
|
shouwTuanQuan() {
|
||||||
|
this.$refs.refPopTuanQuan.open();
|
||||||
|
},
|
||||||
|
tuanQuanConfirm(e) {
|
||||||
|
console.log(e);
|
||||||
|
this.tuanQuan = e;
|
||||||
|
},
|
||||||
|
//更新单品改价数据
|
||||||
|
updateCartItem(res) {
|
||||||
|
if (res) {
|
||||||
|
// this.order.list[this.order.selIndex] = res;
|
||||||
|
this.$set(this.order.list, this.order.selIndex, res)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 单品改价
|
||||||
|
refPopChangePriceShow() {
|
||||||
|
const orderGoods = this.order.list[this.order.selIndex];
|
||||||
|
this.$refs.refPopChangePrice.open(orderGoods);
|
||||||
|
},
|
||||||
returnProDiscount(row) {
|
returnProDiscount(row) {
|
||||||
console.log(row);
|
console.log(row);
|
||||||
//相同商品抵扣券数组
|
//相同商品抵扣券数组
|
||||||
|
|
@ -2216,20 +2378,24 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
lingshicaiShow() {
|
lingshicaiShow() {
|
||||||
this.$refs.refPopAddCai.open();
|
this.$refs.refPopAddCai.open({
|
||||||
|
masterId: this.masterId,
|
||||||
|
tableId: this.table.tableId,
|
||||||
|
vipUserId: this.vipUser.id,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
delQuan(row) {
|
delQuan(row) {
|
||||||
const index = this.quansSelArr.findIndex((v) => v.id == row.id);
|
const index = this.quansSelArr.findIndex((v) => v.id == row.id);
|
||||||
console.log(index);
|
console.log(index);
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
this.quansSelArr.splice(index, 1);
|
this.quansSelArr.splice(index, 1);
|
||||||
this.quansSelArr
|
this.quansSelArr.map((v, index) => {
|
||||||
.map((v, index) => {
|
return {
|
||||||
return {
|
...v,
|
||||||
...v,
|
discountAmount:
|
||||||
discountAmount:v.type==2?this.returnProDiscount(v):v.discountAmount,
|
v.type == 2 ? this.returnProDiscount(v) : v.discountAmount,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getCalcUsablePoints() {
|
async getCalcUsablePoints() {
|
||||||
|
|
@ -2249,8 +2415,8 @@ export default {
|
||||||
this.vipUser.accountPoints,
|
this.vipUser.accountPoints,
|
||||||
this.points.res.maxUsablePoints || 0
|
this.points.res.maxUsablePoints || 0
|
||||||
);
|
);
|
||||||
if(!pointsRes.usable){
|
if (!pointsRes.usable) {
|
||||||
this.points.selected=false
|
this.points.selected = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return pointsRes;
|
return pointsRes;
|
||||||
|
|
@ -2296,11 +2462,12 @@ export default {
|
||||||
this.createOrder.discount = 1;
|
this.createOrder.discount = 1;
|
||||||
this.points.selected = "";
|
this.points.selected = "";
|
||||||
e.map((v, index) => {
|
e.map((v, index) => {
|
||||||
return {
|
return {
|
||||||
...v,
|
...v,
|
||||||
discountAmount:v.type==2? this.returnProDiscount(v):v.discountAmount,
|
discountAmount:
|
||||||
};
|
v.type == 2 ? this.returnProDiscount(v) : v.discountAmount,
|
||||||
});
|
};
|
||||||
|
});
|
||||||
this.quansSelArr = [...e];
|
this.quansSelArr = [...e];
|
||||||
$goodsPayPriceMap = goodsPayPriceMap;
|
$goodsPayPriceMap = goodsPayPriceMap;
|
||||||
},
|
},
|
||||||
|
|
@ -2892,7 +3059,7 @@ export default {
|
||||||
this.pays();
|
this.pays();
|
||||||
},
|
},
|
||||||
// 支付订单
|
// 支付订单
|
||||||
async pays() {
|
async pays(par) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const userCouponInfos = this.quansSelArr.reduce((prve, cur) => {
|
const userCouponInfos = this.quansSelArr.reduce((prve, cur) => {
|
||||||
const index = prve.findIndex((v) => v.userCouponId == cur.couponId);
|
const index = prve.findIndex((v) => v.userCouponId == cur.couponId);
|
||||||
|
|
@ -2907,6 +3074,15 @@ export default {
|
||||||
return prve;
|
return prve;
|
||||||
}, []);
|
}, []);
|
||||||
try {
|
try {
|
||||||
|
// 核销团购券商品
|
||||||
|
if (this.tuanQuan && this.tuanQuan.goods.length > 0) {
|
||||||
|
await $checkCoupon({
|
||||||
|
code: this.tuanQuan.couponCode,
|
||||||
|
num: this.tuanQuan.number,
|
||||||
|
orderId: this.createOrder.data.id,
|
||||||
|
cartId: this.tuanQuan.goods.map((v) => v.cartId),
|
||||||
|
});
|
||||||
|
}
|
||||||
const res = await $payOrder({
|
const res = await $payOrder({
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
masterId: this.masterId,
|
masterId: this.masterId,
|
||||||
|
|
@ -2915,8 +3091,9 @@ export default {
|
||||||
vipUserId: this.createOrder.data.memberId || this.vipUser.id,
|
vipUserId: this.createOrder.data.memberId || this.vipUser.id,
|
||||||
discount: this.createOrder.discount,
|
discount: this.createOrder.discount,
|
||||||
code: this.createOrder.code,
|
code: this.createOrder.code,
|
||||||
userCouponInfos,
|
userCouponInfos: userCouponInfos.length > 0 ? userCouponInfos : "",
|
||||||
pointsNum: this.points.value,
|
pointsNum: this.points.value,
|
||||||
|
...par,
|
||||||
});
|
});
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.payOrderSuccess();
|
this.payOrderSuccess();
|
||||||
|
|
@ -3044,7 +3221,16 @@ export default {
|
||||||
updateOrder(par = {}) {
|
updateOrder(par = {}) {
|
||||||
let item = this.order.list[this.order.selIndex];
|
let item = this.order.list[this.order.selIndex];
|
||||||
console.log(this.table);
|
console.log(this.table);
|
||||||
const { productId, skuId, isPack, isGift, number, id } = item;
|
const {
|
||||||
|
productId,
|
||||||
|
skuId,
|
||||||
|
isPack,
|
||||||
|
isGift,
|
||||||
|
number,
|
||||||
|
id,
|
||||||
|
isPrint,
|
||||||
|
isWaitCall,
|
||||||
|
} = item;
|
||||||
$updateCart({
|
$updateCart({
|
||||||
cartId: id,
|
cartId: id,
|
||||||
masterId: this.masterId,
|
masterId: this.masterId,
|
||||||
|
|
@ -3055,6 +3241,8 @@ export default {
|
||||||
num: number,
|
num: number,
|
||||||
isPack: isPack === "true" ? true : false,
|
isPack: isPack === "true" ? true : false,
|
||||||
isGift: isGift === "true" ? true : false,
|
isGift: isGift === "true" ? true : false,
|
||||||
|
isPrint,
|
||||||
|
isWaitCall,
|
||||||
...par,
|
...par,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.$set(this.order.list, this.order.selIndex, {
|
this.$set(this.order.list, this.order.selIndex, {
|
||||||
|
|
@ -3107,7 +3295,7 @@ export default {
|
||||||
// },
|
// },
|
||||||
|
|
||||||
//右侧控制按钮点击事件
|
//右侧控制按钮点击事件
|
||||||
orderBtnsClick(key) {
|
async orderBtnsClick(key) {
|
||||||
const orderGoods = this.order.list[this.order.selIndex];
|
const orderGoods = this.order.list[this.order.selIndex];
|
||||||
if (this.key != "isJieZhang" && this.payAfter) {
|
if (this.key != "isJieZhang" && this.payAfter) {
|
||||||
this.createOrderClose();
|
this.createOrderClose();
|
||||||
|
|
@ -3132,6 +3320,27 @@ export default {
|
||||||
if (key === "del") {
|
if (key === "del") {
|
||||||
return this.removeCart();
|
return this.removeCart();
|
||||||
}
|
}
|
||||||
|
if (key === "print") {
|
||||||
|
const isPrint = orderGoods.isPrint;
|
||||||
|
this.updateOrder({ isPrint: !isPrint });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (key === "isWaitCall") {
|
||||||
|
const isWaitCall = orderGoods.isWaitCall;
|
||||||
|
this.updateOrder({ isWaitCall: !isWaitCall });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (key == "AllWaitCall") {
|
||||||
|
await $waitCall({
|
||||||
|
orderId:this.createOrder.data.id,
|
||||||
|
masterId:this.masterId,
|
||||||
|
tableId:this.table.tableId,
|
||||||
|
isWaitCall: !this.isAllWaitCall?1:0
|
||||||
|
})
|
||||||
|
this.isAllWaitCall=!this.isAllWaitCall;
|
||||||
|
this.getCart()
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (key === "save") {
|
if (key === "save") {
|
||||||
this.prveOrder.list.push({
|
this.prveOrder.list.push({
|
||||||
cart: this.order.list,
|
cart: this.order.list,
|
||||||
|
|
@ -3532,6 +3741,7 @@ export default {
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
num: this.skuGoods.number, // 0会删除此商品
|
num: this.skuGoods.number, // 0会删除此商品
|
||||||
isPack: false, // 是否打包
|
isPack: false, // 是否打包
|
||||||
|
isWaitCall:this.isAllWaitCall //是否等叫
|
||||||
});
|
});
|
||||||
this.orderListPush({ ...res, specSnap: name });
|
this.orderListPush({ ...res, specSnap: name });
|
||||||
// this.orderListPush({
|
// this.orderListPush({
|
||||||
|
|
@ -3637,6 +3847,7 @@ export default {
|
||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
// this.goods.list = [];
|
// this.goods.list = [];
|
||||||
|
this.guazhangRen = "";
|
||||||
this.order.status = "";
|
this.order.status = "";
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.table = "";
|
this.table = "";
|
||||||
|
|
@ -3833,6 +4044,7 @@ export default {
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
num: item.specList[0].suit, // 0会删除此商品
|
num: item.specList[0].suit, // 0会删除此商品
|
||||||
isPack: false, // 是否打包
|
isPack: false, // 是否打包
|
||||||
|
isWaitCall:this.isAllWaitCall //是否等叫
|
||||||
});
|
});
|
||||||
this.orderListPush(res);
|
this.orderListPush(res);
|
||||||
}
|
}
|
||||||
|
|
@ -4114,9 +4326,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
::v-deep .el-button--text {
|
|
||||||
// color: #000;
|
|
||||||
}
|
|
||||||
::v-deep .meal_box .el-button-group {
|
::v-deep .meal_box .el-button-group {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -4635,13 +4845,6 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border: 1px solid #dcdfe6;
|
border: 1px solid #dcdfe6;
|
||||||
}
|
}
|
||||||
::v-deep .el-checkbox__input.is-checked .el-checkbox__inner {
|
|
||||||
// background-color: #22bf64;
|
|
||||||
// border-color: #22bf64;
|
|
||||||
}
|
|
||||||
::v-deep .el-checkbox__input.is-checked + .el-checkbox__label {
|
|
||||||
// color: #22bf64;
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep .tag-group .el-tag--dark {
|
::v-deep .tag-group .el-tag--dark {
|
||||||
background: rgba(34, 191, 100, 0.1);
|
background: rgba(34, 191, 100, 0.1);
|
||||||
|
|
|
||||||
|
|
@ -218,4 +218,14 @@ export function returnCouponAllPrice(coupArr, goodsArr, vipUser) {
|
||||||
const poductAllprice=returnProductCouponAllPrice(coupArr, goodsArr, vipUser)
|
const poductAllprice=returnProductCouponAllPrice(coupArr, goodsArr, vipUser)
|
||||||
const pointAllPrice=returnFullReductionCouponAllPrice(coupArr)
|
const pointAllPrice=returnFullReductionCouponAllPrice(coupArr)
|
||||||
return (poductAllprice*1+pointAllPrice*1).toFixed(2);
|
return (poductAllprice*1+pointAllPrice*1).toFixed(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
//返回购物车商品价格
|
||||||
|
export function returnCartPrice(goods, vipUser) {
|
||||||
|
const price=goods.price||goods.salePrice
|
||||||
|
if(!vipUser||!vipUser.id ||!vipUser.isVip){
|
||||||
|
return price
|
||||||
|
}
|
||||||
|
const memberPrice = goods.memberPrice ? goods.memberPrice :price;
|
||||||
|
return memberPrice
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue