新增订单打印

This commit is contained in:
gyq
2025-12-30 14:25:37 +08:00
parent d96009bf6f
commit 01c2cbcfb4
3 changed files with 23 additions and 1 deletions

View File

@@ -131,7 +131,7 @@ const contentConfig: IContentConfig = {
label: "操作",
align: "center",
fixed: "right",
width: 150,
width: 180,
templet: "custom",
slotName: "operate",
},

View File

@@ -72,6 +72,7 @@
</template>
<template #operate="scope">
<div>
<el-button link @click="printOrderHandle(scope.row)">打印</el-button>
<el-button link @click="showdetail(scope.row)">详情</el-button>
<el-button v-if="scope.row.status == 'done'" link>开票</el-button>
<el-button v-if="scope.row.status == 'unpaid'" type="primary" @click="toPayOrder(scope.row)">
@@ -155,6 +156,19 @@ onMounted(() => {
}
});
// 打印订单
async function printOrderHandle(order: getListResponse) {
try {
await orderApi.printOrder({
id: order.id,
type: 0
});
ElMessage.success("打印成功");
} catch (error) {
ElMessage.error("打印失败,请稍后重试");
}
}
// 新增
async function handleAddClick() {
addModalRef.value?.setModalVisible();