优化小票 新增存酒管理
This commit is contained in:
@@ -251,18 +251,21 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import _ from 'lodash'
|
||||
import { ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import takeFoodCode from '@/components/takeFoodCode.vue'
|
||||
import TableMerging from './tableMerging.vue'
|
||||
import skuModal from '@/components/skuModal.vue'
|
||||
import { useGoods } from '@/store/goods.js'
|
||||
import { inputFilterFloat, formatDecimal } from '@/utils/index.js'
|
||||
import { inputFilterFloat, formatDecimal, getOrderByIdAjax, commOrderPrintData } from '@/utils/index.js'
|
||||
import { refundOrder } from '@/api/order.js'
|
||||
import { useSocket } from '@/store/socket.js'
|
||||
import { usePrint } from '@/store/print.js'
|
||||
|
||||
const goodsStore = useGoods()
|
||||
const socket = useSocket()
|
||||
const printStore = usePrint()
|
||||
|
||||
const tableMergingRef = ref(null)
|
||||
|
||||
@@ -339,6 +342,25 @@ async function returnOrderItemAjax(num = 1) {
|
||||
await refundOrder(data)
|
||||
goodsStore.cartOrderItem.returnNum += num
|
||||
goodsStore.calcCartInfo()
|
||||
|
||||
getOrderByIdAjax(goodsStore.orderListInfo.id).then(res => {
|
||||
let originOrderInfo = res
|
||||
console.log('originOrderInfo1===', originOrderInfo);
|
||||
|
||||
console.log('goodsStore.cartOrderItem.id', goodsStore.cartOrderItem.id);
|
||||
|
||||
let index = originOrderInfo.cartList.findIndex(item => item.id == goodsStore.cartOrderItem.id)
|
||||
|
||||
console.log('index===', index);
|
||||
|
||||
originOrderInfo.cartList = _.at(originOrderInfo.cartList, index);
|
||||
console.log('originOrderInfo2===', originOrderInfo);
|
||||
// return
|
||||
|
||||
printStore.printRefund(commOrderPrintData({ ...originOrderInfo, isGuest: false, isBefore: false, title: '退菜单' }));
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
})
|
||||
// await goodsStore.historyOrderAjax('', data.orderId)
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
Reference in New Issue
Block a user