新增订单打印
This commit is contained in:
@@ -64,6 +64,14 @@ const OrderApi = {
|
|||||||
data
|
data
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 订单打印
|
||||||
|
printOrder(data: any) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/print`,
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default OrderApi;
|
export default OrderApi;
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ const contentConfig: IContentConfig = {
|
|||||||
label: "操作",
|
label: "操作",
|
||||||
align: "center",
|
align: "center",
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 150,
|
width: 180,
|
||||||
templet: "custom",
|
templet: "custom",
|
||||||
slotName: "operate",
|
slotName: "operate",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -72,6 +72,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #operate="scope">
|
<template #operate="scope">
|
||||||
<div>
|
<div>
|
||||||
|
<el-button link @click="printOrderHandle(scope.row)">打印</el-button>
|
||||||
<el-button link @click="showdetail(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 == 'done'" link>开票</el-button>
|
||||||
<el-button v-if="scope.row.status == 'unpaid'" type="primary" @click="toPayOrder(scope.row)">
|
<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() {
|
async function handleAddClick() {
|
||||||
addModalRef.value?.setModalVisible();
|
addModalRef.value?.setModalVisible();
|
||||||
|
|||||||
Reference in New Issue
Block a user