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

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: "操作", label: "操作",
align: "center", align: "center",
fixed: "right", fixed: "right",
width: 180, width: 240,
templet: "custom", templet: "custom",
slotName: "operate", slotName: "operate",
}, },

View File

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