From 87e897635369f997b6eec25cefb1543739b9832b Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Wed, 19 Mar 2025 18:29:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BC=9A=E5=91=98=E6=94=AF?= =?UTF-8?q?=E4=BB=98=EF=BC=8C=E5=B7=B2=E4=BC=9A=E5=91=98=E4=BB=B7=E7=BB=93?= =?UTF-8?q?=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/account.js | 2 +- src/components/payCard/payCard.vue | 17 +++- src/components/uploadImg.vue | 2 +- src/store/print.js | 30 ++++---- src/views/home/components/settleAccount.vue | 31 ++++---- src/views/member/components/addUserDrawer.vue | 4 + src/views/member/components/recordDialog.vue | 12 ++- src/views/member/index.vue | 1 - src/views/order/components/refundDrawer.vue | 77 ++++++++++++------- src/views/order/index.vue | 67 +++++++++++++++- src/views/queue/components/addTab.vue | 4 +- 11 files changed, 177 insertions(+), 70 deletions(-) diff --git a/src/api/account.js b/src/api/account.js index f2595d7..9b25301 100644 --- a/src/api/account.js +++ b/src/api/account.js @@ -187,7 +187,7 @@ export function callTableConfigPut(data) { */ export function addCallTable(data) { return request({ - method: "post", + method: data.id ? "put" : "post", url: "/account/admin/callTable", data, }); diff --git a/src/components/payCard/payCard.vue b/src/components/payCard/payCard.vue index d93de70..4906d69 100644 --- a/src/components/payCard/payCard.vue +++ b/src/components/payCard/payCard.vue @@ -358,12 +358,23 @@ async function vipPayAjax(row) { return } + goodsStore.showVipPrice = 1 + goodsStore.vipUserInfo = row + + goodsStore.calcCartInfo() + + reset() + payData.value.payType = 'userPay' payData.value.shopUserId = row.id payData.value.checkOrderPay.userId = row.userId payLoading.value = true; await vipPay(payData.value) + + goodsStore.showVipPrice = 0 + goodsStore.vipUserInfo = '' + emit("paySuccess"); } catch (error) { console.log(error); @@ -392,12 +403,12 @@ async function payTypeChange(index, item) { // 挂账支付 showBuyerHandle(); } - if(item.payType == 'deposit'){ + if (item.payType == 'deposit') { scanModalRef.value.show(); } // if (payActive.value != "buyer") { // if (payList.value[payActive.value].payType == "deposit") { - + // } // } } catch (error) { @@ -820,7 +831,7 @@ function reset() { orderId: goodsStore.orderListInfo.id, vipPrice: store.shopInfo.isMemberPrice ? goodsStore.showVipPrice : 0, // 是否使用会员价 allPack: goodsStore.allSelected, // 是否整单打包 - userId: goodsStore.vipUserInfo.id, + userId: goodsStore.vipUserInfo.userId, seatNum: goodsStore.tableInfo.num, // 用餐人数 originAmount: formatDecimal(+goodsStore.cartInfo.totalAmount), // 订单原金额(包含打包费+餐位费) 不含折扣价格 discountRatio: '', // 折扣比例(计算时 向上取整保留 两位小数) diff --git a/src/components/uploadImg.vue b/src/components/uploadImg.vue index 1fae192..95bf3d4 100644 --- a/src/components/uploadImg.vue +++ b/src/components/uploadImg.vue @@ -103,7 +103,7 @@ const beforeUpload = (file) => { return true; }; -function init(arr) { +function init(arr = []) { fileList.value = arr } diff --git a/src/store/print.js b/src/store/print.js index 80c7d33..dabbd27 100644 --- a/src/store/print.js +++ b/src/store/print.js @@ -24,23 +24,25 @@ export const usePrint = defineStore("print", { // 获取本地打印机 ipcRenderer.send("getPrintList"); ipcRenderer.on("printList", (event, arg) => { - // localPrintList.value = arg; - // console.log(localPrintList.value); this.localDevices = arg; }); - // 获取已添加的打印机 - const res = await printerList(); - this.deviceNoteList = res.records.filter( - (item) => item.status && item.subType == "cash" - ); - this.deviceLableList = res.records.filter( - (item) => item.status && item.subType == "label" - ); - console.log("打印队列初始化成功", { - deviceNoteList: this.deviceNoteList, - deviceLableList: this.deviceLableList, - }); + try { + // 获取已添加的打印机 + const res = await printerList(); + this.deviceNoteList = res.records.filter( + (item) => item.status && item.subType == "cash" + ); + this.deviceLableList = res.records.filter( + (item) => item.status && item.subType == "label" + ); + console.log("打印队列初始化成功", { + deviceNoteList: this.deviceNoteList, + deviceLableList: this.deviceLableList, + }); + } catch (error) { + console.error("获取已添加的打印机列表失败", error); + } }, // 检查本地打印机是否能正常使用 checkLocalPrint(address) { diff --git a/src/views/home/components/settleAccount.vue b/src/views/home/components/settleAccount.vue index 1915af6..9d61fa4 100644 --- a/src/views/home/components/settleAccount.vue +++ b/src/views/home/components/settleAccount.vue @@ -18,10 +18,7 @@