代客下单新增称重商品
This commit is contained in:
parent
01a5c81235
commit
bfe0529036
|
|
@ -8,13 +8,13 @@
|
||||||
<div class="">
|
<div class="">
|
||||||
<div>单价</div>
|
<div>单价</div>
|
||||||
<div class="u-m-t-10">
|
<div class="u-m-t-10">
|
||||||
<el-tag type="primary" size="medium">¥{{ item.lowPrice }}/{{ item.unitName }}</el-tag>
|
<el-tag type="primary" size="medium">¥{{ price }}/{{ item.unitName }}</el-tag>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="u-font-14">重量</div>
|
<div class="u-font-14">重量</div>
|
||||||
<div class="u-m-t-10">
|
<div class="u-m-t-10">
|
||||||
<el-input placeholder="请输入挂账金额" v-model="number" @input="inputNumber" @change="inputChange"
|
<el-input placeholder="请输入重量" v-model="number" @input="inputNumber" @change="inputChange"
|
||||||
@focus="inputFocus" @blur="inputBlur" :type="focus ? 'number' : 'text'">
|
@focus="inputFocus" @blur="inputBlur" :type="focus ? 'number' : 'text'">
|
||||||
<template slot="append">{{ item.unitName }}</template>
|
<template slot="append">{{ item.unitName }}</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</key-board>
|
</key-board>
|
||||||
<div class="price u-text-left w-full">¥ {{ item.lowPrice * number }}</div>
|
<div class="price u-text-left w-full">¥ {{ allPrice }}</div>
|
||||||
|
|
||||||
<div class="confirm_btns u-flex u-m-t-20">
|
<div class="confirm_btns u-flex u-m-t-20">
|
||||||
<el-button style="width: 100%;" type="primary" size="medium" @click="confirm">确定</el-button>
|
<el-button style="width: 100%;" type="primary" size="medium" @click="confirm">确定</el-button>
|
||||||
|
|
@ -30,20 +30,22 @@
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<choose-guazhang ref="refChooseGuazhang" @confirm="chooseGuazhangConfirm"></choose-guazhang>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import keyBoard from "./keyboard.vue";
|
import keyBoard from "./keyboard.vue";
|
||||||
import chooseGuazhang from "./choose-guazhang.vue";
|
|
||||||
export default {
|
export default {
|
||||||
components: { keyBoard, chooseGuazhang },
|
components: { keyBoard },
|
||||||
props: {
|
props: {
|
||||||
payMoney: {
|
payMoney: {
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
|
isShowVipPrice:{
|
||||||
|
type:Boolean,
|
||||||
|
default:false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -79,6 +81,17 @@ export default {
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
computed:{
|
||||||
|
allPrice(){
|
||||||
|
return (this.price*this.number).toFixed(2);
|
||||||
|
},
|
||||||
|
price(){
|
||||||
|
if(!this.item){
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return this.item.lowPrice;
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
inputFocus() {
|
inputFocus() {
|
||||||
this.focus = true;
|
this.focus = true;
|
||||||
|
|
@ -86,13 +99,6 @@ export default {
|
||||||
inputBlur() {
|
inputBlur() {
|
||||||
this.focus = false;
|
this.focus = false;
|
||||||
},
|
},
|
||||||
chooseGuazhangConfirm(e) {
|
|
||||||
this.guazhangRen = e;
|
|
||||||
},
|
|
||||||
guazhangShow() {
|
|
||||||
this.$refs.refChooseGuazhang.open();
|
|
||||||
},
|
|
||||||
|
|
||||||
inputNumber(e) {
|
inputNumber(e) {
|
||||||
console.log("inputNumber");
|
console.log("inputNumber");
|
||||||
if (e * 1 > this.payMoney * 1) {
|
if (e * 1 > this.payMoney * 1) {
|
||||||
|
|
@ -108,29 +114,24 @@ export default {
|
||||||
clear(e) {
|
clear(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
this.number = "";
|
this.number = "";
|
||||||
|
this.item=""
|
||||||
},
|
},
|
||||||
confirm() {
|
confirm() {
|
||||||
// if (this.number * 1 > this.payMoney * 1) {
|
if(this.number*1<=0){
|
||||||
// return this.$message("已超出未结账金额");
|
return this.$message("请输入重量");
|
||||||
// }
|
}
|
||||||
// if (this.number * 1 <= 0) {
|
|
||||||
// return this.$message("支付金额不正确");
|
|
||||||
// }
|
|
||||||
// if (!this.guazhangRen) {
|
|
||||||
// return this.$message("请选择挂账人");
|
|
||||||
// }
|
|
||||||
this.$emit("confirm", this.item, this.number);
|
this.$emit("confirm", this.item, this.number);
|
||||||
this.close();
|
this.close();
|
||||||
},
|
},
|
||||||
open(item) {
|
open(item) {
|
||||||
|
console.log(item);
|
||||||
this.item = item
|
this.item = item
|
||||||
this.number = this.payMoney * 1;
|
|
||||||
this.show = true;
|
this.show = true;
|
||||||
this.tips = "还需额外支付" + this.payMoney + "元";
|
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.show = false;
|
this.show = false;
|
||||||
this.number = "";
|
this.number = "";
|
||||||
|
this.item=""
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() { },
|
mounted() { },
|
||||||
|
|
|
||||||
|
|
@ -1321,7 +1321,9 @@
|
||||||
<div class="key" @click="keyboradAdd('9')">9</div>
|
<div class="key" @click="keyboradAdd('9')">9</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="key-line">
|
<div class="key-line">
|
||||||
<div class="key"></div>
|
<div class="key" @click="keyboradAdd('.')">
|
||||||
|
<span v-if="selGoods.isSku=='weight'">.</span>
|
||||||
|
</div>
|
||||||
<div class="key" @click="keyboradAdd('0')">0</div>
|
<div class="key" @click="keyboradAdd('0')">0</div>
|
||||||
<div
|
<div
|
||||||
class="key"
|
class="key"
|
||||||
|
|
@ -1502,6 +1504,8 @@
|
||||||
|
|
||||||
<!-- 称重商品 -->
|
<!-- 称重商品 -->
|
||||||
<popup-weight-goods
|
<popup-weight-goods
|
||||||
|
:isShowVipPrice="isShowVipPrice"
|
||||||
|
|
||||||
ref="refWeightGoods"
|
ref="refWeightGoods"
|
||||||
@confirm="refWeightGoodsConfirm"
|
@confirm="refWeightGoodsConfirm"
|
||||||
>
|
>
|
||||||
|
|
@ -2361,15 +2365,9 @@ export default {
|
||||||
},
|
},
|
||||||
//称重商品确认
|
//称重商品确认
|
||||||
async refWeightGoodsConfirm(item,number){
|
async refWeightGoodsConfirm(item,number){
|
||||||
let {masterId} =await this.getMasterId()
|
console.log(item)
|
||||||
let obj = {
|
console.log(number)
|
||||||
num:number *1,
|
this.goodsClick(item,number,true)
|
||||||
masterId,
|
|
||||||
productId: this.selGoods.data.id,
|
|
||||||
}
|
|
||||||
// console.log(obj,'拿到的obj')
|
|
||||||
// console.log(this.selGoods,'拿到的')
|
|
||||||
this.chooseSkuConfirm()
|
|
||||||
},
|
},
|
||||||
//挂账人支付确认
|
//挂账人支付确认
|
||||||
guazhangPayConfirm(guazhangren, price) {
|
guazhangPayConfirm(guazhangren, price) {
|
||||||
|
|
@ -3299,6 +3297,9 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
keyboradAdd(n) {
|
keyboradAdd(n) {
|
||||||
|
if(this.selGoods.isSku!='weight'&&n=='.'){
|
||||||
|
return
|
||||||
|
}
|
||||||
if (Number(this.keyborad.number) === 0) {
|
if (Number(this.keyborad.number) === 0) {
|
||||||
return (this.keyborad.number = n);
|
return (this.keyborad.number = n);
|
||||||
}
|
}
|
||||||
|
|
@ -3327,9 +3328,13 @@ export default {
|
||||||
},
|
},
|
||||||
changeKeyboradShow(show) {
|
changeKeyboradShow(show) {
|
||||||
if (show) {
|
if (show) {
|
||||||
|
this.selGoods=this.order.list[this.order.selIndex]
|
||||||
this.keyborad.number = `${this.order.list[this.order.selIndex].number}`;
|
this.keyborad.number = `${this.order.list[this.order.selIndex].number}`;
|
||||||
}
|
}
|
||||||
this.keyborad.show = show;
|
this.keyborad.show = show;
|
||||||
|
if(!show){
|
||||||
|
this.selGoods=''
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 获取本地缓存挂单
|
// 获取本地缓存挂单
|
||||||
// getPrveCart() {
|
// getPrveCart() {
|
||||||
|
|
@ -4069,11 +4074,11 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//根据右侧商品单规格多规格做不同处理
|
//根据右侧商品单规格多规格做不同处理
|
||||||
async goodsClick(item) {
|
async goodsClick(item,number=0, isConfirm=false) {
|
||||||
// if (!this.table) {
|
// if (!this.table) {
|
||||||
// return this.$message.error("暂不支持无桌台下单,请先选择桌台");
|
// return this.$message.error("暂不支持无桌台下单,请先选择桌台");
|
||||||
// }
|
// }
|
||||||
if(item.type=='weigh'){
|
if(item.type=='weigh'&&!isConfirm){
|
||||||
return this.refWeightGoodsShow(item)
|
return this.refWeightGoodsShow(item)
|
||||||
}
|
}
|
||||||
if (item.typeEnum === "sku") {
|
if (item.typeEnum === "sku") {
|
||||||
|
|
@ -4107,7 +4112,8 @@ export default {
|
||||||
// tableId: this.table.tableId,
|
// tableId: this.table.tableId,
|
||||||
// num: orderGoods.number * 1 + item.specList[0].suit, // 0会删除此商品
|
// num: orderGoods.number * 1 + item.specList[0].suit, // 0会删除此商品
|
||||||
// });
|
// });
|
||||||
orderGoods.number += item.specList[0].suit;
|
const suit=number||item.specList[0].suit
|
||||||
|
orderGoods.number +=suit*1 ;
|
||||||
this.order.number = orderGoods.number;
|
this.order.number = orderGoods.number;
|
||||||
this.changeOrderSel(orderGoodsIndex);
|
this.changeOrderSel(orderGoodsIndex);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -4122,7 +4128,7 @@ export default {
|
||||||
productId: item.id,
|
productId: item.id,
|
||||||
skuId: item.specList[0].id,
|
skuId: item.specList[0].id,
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
num: item.specList[0].suit, // 0会删除此商品
|
num:number|| item.specList[0].suit, // 0会删除此商品
|
||||||
isPack: false, // 是否打包
|
isPack: false, // 是否打包
|
||||||
isWaitCall:this.isAllWaitCall //是否等叫
|
isWaitCall:this.isAllWaitCall //是否等叫
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue