优化订单无法再次打印的问题

This commit is contained in:
gyq
2026-05-13 09:48:03 +08:00
parent 32e24c6d52
commit a719807b0e
2 changed files with 17 additions and 46 deletions

View File

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

View File

@@ -2,37 +2,19 @@
<div class="app-container">
<!-- 列表 -->
<!-- 搜索 -->
<page-search
ref="searchRef"
:search-config="searchConfig"
:isOpenAutoSearch="true"
@query-click="handleQueryClick"
@reset-click="handleResetClick"
/>
<page-search ref="searchRef" :search-config="searchConfig" :isOpenAutoSearch="true" @query-click="handleQueryClick"
@reset-click="handleResetClick" />
<!-- 列表 -->
<page-content
ref="contentRef"
:content-config="contentConfig"
@add-click="handleAddClick"
@edit-click="handleEditClick"
@export-click="handleExportClick"
@search-click="handleSearchClick"
@toolbar-click="handleToolbarClick"
@operat-click="handleOperatClick"
@filter-change="handleFilterChange"
>
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
<template #originAmount="scope">
{{ returnOriginAmount(scope.row) }}
</template>
<template #orderNo="scope">
<div style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap">
<el-tooltip
class="box-item"
effect="dark"
:content="scope.row.orderNo"
placement="top-start"
>
<el-tooltip class="box-item" effect="dark" :content="scope.row.orderNo" placement="top-start">
{{ scope.row.orderNo }}
</el-tooltip>
</div>
@@ -73,7 +55,7 @@
<!-- 打印状态 -->
<template #printStatus="scope">
<span v-if="scope.row.printStatus.length > 0" style="color: var(--el-color-danger)">
打印失败{{ scope.row.printStatus.map((item) => item.name).join("、") }}
打印失败{{scope.row.printStatus.map((item) => item.name).join("、")}}
</span>
</template>
@@ -87,25 +69,18 @@
</template>
<template #mobile="scope">
<el-text>{{ scope.row[scope.prop] }}</el-text>
<copy-button
v-if="scope.row[scope.prop]"
:text="scope.row[scope.prop]"
style="margin-left: 2px"
/>
<copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
</template>
<template #payType="scope">
{{ returnPayTypeOptionsLabel(scope.prop, scope.row[scope.prop]) }}
</template>
<template #operate="scope">
<div>
<el-button link @click="printOrderHandle(scope.row)">打印</el-button>
<el-button type="primary" link @click="printOrderHandle(scope.row, 2)">打印前台</el-button>
<el-button type="warning" link @click="printOrderHandle(scope.row, 3)">打印厨房</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)"
>
<el-button v-if="scope.row.status == 'unpaid'" type="primary" @click="toPayOrder(scope.row)">
结账
</el-button>
</div>
@@ -121,11 +96,7 @@
</page-modal>
<!-- 编辑 -->
<page-modal
ref="editModalRef"
:modal-config="editModalConfig"
@submit-click="handleSubmitClick"
>
<page-modal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick">
<template #url="scope">
<FileUpload v-model="scope.formData[scope.prop]" :limit="1" v-bind="scope.attrs" />
<!-- <Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" /> -->
@@ -191,11 +162,11 @@ onMounted(() => {
});
// 打印订单
async function printOrderHandle(order: getListResponse) {
async function printOrderHandle(order: getListResponse, type: number) {
try {
await orderApi.printOrder({
id: order.id,
type: 0,
type: type,
});
ElMessage.success("打印成功");
} catch (error) {
@@ -404,7 +375,7 @@ function showdetail(row: OrderInfoVo) {
left: 36%;
padding: 18px;
> div:first-child {
>div:first-child {
display: flex;
align-items: center;
justify-content: space-between;
@@ -415,7 +386,7 @@ function showdetail(row: OrderInfoVo) {
transform: translateX(-80px);
}
> div:last-child {
>div:last-child {
text-align: center;
}
}