新增订单打印
This commit is contained in:
@@ -64,6 +64,14 @@ const OrderApi = {
|
||||
data
|
||||
});
|
||||
},
|
||||
// 订单打印
|
||||
printOrder(data: any) {
|
||||
return request<any>({
|
||||
url: `${baseURL}/print`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default OrderApi;
|
||||
|
||||
@@ -131,7 +131,7 @@ const contentConfig: IContentConfig = {
|
||||
label: "操作",
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
width: 150,
|
||||
width: 180,
|
||||
templet: "custom",
|
||||
slotName: "operate",
|
||||
},
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user