|
|
@@ -11,6 +11,7 @@
|
|
|
<a-card style="width: 30%;">
|
|
|
<a href="#" @click="remarkModal"> <a-icon type="edit" />整单备注</a>
|
|
|
<a-icon type="user" />
|
|
|
+ <spn v-if="posTableId !=''">桌台: {{ posTableName }}</spn>
|
|
|
<span v-if="selectRoomOrder && selectRoomOrder.roomName">
|
|
|
房间:{{ selectRoomOrder.roomName }},姓名:{{
|
|
|
selectRoomOrder.customerName
|
|
|
@@ -47,13 +48,16 @@
|
|
|
<p>数量:{{ sum }}</p>
|
|
|
<div v-if="this.posTableState === 1">
|
|
|
<a-button @click="placeOrder" :disabled="btnDisabled">下单</a-button>
|
|
|
+<!-- <a-button @click="addClear" :disabled="btnDisabled">清空新加</a-button>-->
|
|
|
</div>
|
|
|
<div v-else style="display: flex; gap: 5px; flex-flow: wrap">
|
|
|
<a-button @click="handleClear" :disabled="btnDisabled">清空</a-button>
|
|
|
<!-- <a-button @click="handleAdd" :disabled="btnDisabled">备注</a-button> -->
|
|
|
<!-- <a-button :disabled="btnDisabled">退货</a-button> -->
|
|
|
- <a-button v-if="!btnDisabled" @click="handleAdd">挂单</a-button>
|
|
|
- <a-button v-else @click="handlePickingGoodsOrder">取单</a-button>
|
|
|
+ <div v-if="posTableId === ''">
|
|
|
+ <a-button v-if="!btnDisabled" @click="handleAdd">挂单</a-button>
|
|
|
+ <a-button v-else @click="handlePickingGoodsOrder">取单</a-button>
|
|
|
+ </div>
|
|
|
<a-button
|
|
|
v-if="selectRoomOrder && selectRoomOrder.roomName && !btnDisabled"
|
|
|
@click="handleToRoomFeePayment"
|
|
|
@@ -231,12 +235,17 @@ export default {
|
|
|
tableState: {
|
|
|
type: Number,
|
|
|
default: -1
|
|
|
+ },
|
|
|
+ tableName: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
tableId: function (newValue, oldValue) {
|
|
|
this.posTableId = this.tableId
|
|
|
this.posTableState = this.tableState
|
|
|
+ this.posTableName = this.tableName
|
|
|
if (this.tableId !== '' && this.tableState === 2) {
|
|
|
this.getOrderByTableId(this.tableId)
|
|
|
}
|
|
|
@@ -246,6 +255,7 @@ export default {
|
|
|
return {
|
|
|
posTableId: '',
|
|
|
posTableState: -1,
|
|
|
+ posTableName: '',
|
|
|
tableState2: -1,
|
|
|
isRemarkModal: false,
|
|
|
isSaoma: false,
|
|
|
@@ -327,6 +337,7 @@ export default {
|
|
|
}, 0)
|
|
|
},
|
|
|
amount() {
|
|
|
+ console.log(this.selectGoodsList)
|
|
|
return this.selectGoodsList.reduce(function (total, item) {
|
|
|
return total + item.sellingPrice * item.num
|
|
|
}, 0)
|
|
|
@@ -445,6 +456,11 @@ export default {
|
|
|
this.selectGoodsList.splice(index, 1)
|
|
|
}
|
|
|
},
|
|
|
+ addClear() {
|
|
|
+ let findList = this.selectGoodsList.filter(e => e.id != null)
|
|
|
+ this.selectGoodsList = findList
|
|
|
+ // this.selectOrderInfo = {};
|
|
|
+ },
|
|
|
handleClear() {
|
|
|
this.selectGoodsList = []
|
|
|
// this.selectOrderInfo = {};
|
|
|
@@ -554,7 +570,6 @@ export default {
|
|
|
},
|
|
|
settleAccounts(orderCode) {
|
|
|
console.log(orderCode)
|
|
|
- debugger
|
|
|
var amount = this.oldSelectGoodsList.reduce(function (total, item) {
|
|
|
return total + item.sellingPrice * item.num
|
|
|
}, 0)
|
|
|
@@ -576,7 +591,6 @@ export default {
|
|
|
this.handleAdd()
|
|
|
},
|
|
|
handleAdd(callback) {
|
|
|
- debugger
|
|
|
if (!this.selectGoodsList || this.selectGoodsList.length <= 0) {
|
|
|
this.$message.warning('请先选择商品')
|
|
|
return
|
|
|
@@ -624,7 +638,8 @@ export default {
|
|
|
var posOrderGoodsDetailList = []
|
|
|
this.selectGoodsList.forEach((t) => {
|
|
|
posOrderGoodsDetailList.push({
|
|
|
- goodsId: t.id,
|
|
|
+ id: t.id,
|
|
|
+ goodsId: t.goodsId,
|
|
|
num: t.num,
|
|
|
money: t.sellingPrice
|
|
|
})
|
|
|
@@ -643,9 +658,14 @@ export default {
|
|
|
this.$message.warning('选择的商品已沽清')
|
|
|
return
|
|
|
}
|
|
|
+ if (this.posTableId !== '' && this.posTableState !== 1) {
|
|
|
+ this.posTableState = 1
|
|
|
+ }
|
|
|
var good = JSON.parse(JSON.stringify(row))
|
|
|
this.$set(good, 'num', 1)
|
|
|
- var find = this.selectGoodsList.find((t) => t.id === row.id)
|
|
|
+ this.$set(good, 'goodsId', good.id)
|
|
|
+ delete good.id
|
|
|
+ var find = this.selectGoodsList.find((t) => t.inventory != null && t.goodsId === row.id)
|
|
|
if (find) {
|
|
|
if (find.inventory > find.num) {
|
|
|
find.num++
|
|
|
@@ -658,8 +678,9 @@ export default {
|
|
|
console.log(row)
|
|
|
var good = JSON.parse(JSON.stringify(row))
|
|
|
this.$set(good, 'num', 1)
|
|
|
- this.$set(good, 'sellingPrice', good.price)
|
|
|
- var find = this.selectGoodsList.find((t) => t.id === row.id)
|
|
|
+ this.$set(good, 'goodsId', good.id)
|
|
|
+ delete good.id
|
|
|
+ var find = this.selectGoodsList.find((t) => t.goodsId === row.id)
|
|
|
if (find) {
|
|
|
find.num++
|
|
|
} else {
|