优化商品编辑

This commit is contained in:
gyq
2025-03-12 18:24:33 +08:00
parent 48c9f24d4c
commit cfe9f7bb36
18 changed files with 574 additions and 223 deletions

View File

@@ -94,6 +94,7 @@ import { useGlobal } from '@/store/global.js'
import { usePrint } from '@/store/print.js'
import { useGoods } from '@/store/goods.js'
import { useSocket } from '@/store/socket.js'
import { orderPrint } from '@/api/order.js'
import { staffPermission } from '@/api/user.js'
@@ -193,13 +194,12 @@ async function printOrderLable(isBefore = false) {
printStore.pushReceiptData(commOrderPrintData({ ...data, isBefore: isBefore }));
} else {
// 本地没有可用打印机使用云打印机
await print({
type: "normal",
ispre: true,
orderId: props.orderInfo.id,
await orderPrint({
type: isBefore ? 1 : 0,
id: goodsStore.orderListInfo.id,
});
printLoading.value = false;
ElMessage.success("打印成功");
ElMessage.success(`云打印${isBefore ? '预' : ''}结算单成功`);
}
} catch (error) {
console.log(error);
@@ -211,7 +211,7 @@ function paySuccess() {
emits('success')
dialogVisible.value = false;
ElMessage.success('支付成功')
printOrderLable()
if (isPrint.value) printOrderLable()
useStorage.del('tableCode')
socket.cartInit()
goodsStore.successClearCart()