优化订单打印

This commit is contained in:
gyq
2025-04-15 14:47:04 +08:00
parent f466bdc9f4
commit 0a0f672a02
9 changed files with 77 additions and 53 deletions

View File

@@ -130,6 +130,7 @@ export function formatPhoneNumber(phone, isFormat = true) {
*/
export async function getOrderByIdAjax(orderId) {
try {
if (!orderId) return;
const res = await getOrderById({ orderId: orderId });
let arr = [];
@@ -162,8 +163,8 @@ export function commOrderPrintData(orderInfo) {
shop_name: userStore.shopInfo.shopName,
loginAccount: userStore.userInfo.name,
carts: [],
amount: formatDecimal(orderInfo.payAmount),
originAmount: formatDecimal(orderInfo.originAmount),
amount: formatDecimal(+orderInfo.payAmount),
originAmount: formatDecimal(+orderInfo.originAmount),
discountAmount:
orderInfo.status == "unpaid"
? "0.00"
@@ -182,7 +183,7 @@ export function commOrderPrintData(orderInfo) {
name: item.productName,
number: item.num,
skuName: item.skuName,
salePrice: formatDecimal(item.price),
salePrice: formatDecimal(+item.price),
totalAmount: formatDecimal(+item.payAmount),
proGroupInfo: item.proGroupInfo
? item.proGroupInfo.map((item) => item.goods).flat()