From fb8ebb92202e59b902d3976e75ddae7ad2e60cb8 Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期三, 26 八月 2026 09:03:40 +0800
Subject: [PATCH] feat(erp): 销售订单列表支持打印/导出详情单据,供企业盖章留存

---
 src/views/erp/sale/order/index.vue |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/views/erp/sale/order/index.vue b/src/views/erp/sale/order/index.vue
index 7071c8e..6124ec7 100644
--- a/src/views/erp/sale/order/index.vue
+++ b/src/views/erp/sale/order/index.vue
@@ -24,6 +24,7 @@
 
 import { useGridColumns, useGridFormSchema } from './data';
 import Form from './modules/form.vue';
+import SaleOrderPrint from './modules/print.vue';
 import SalesNoticeForm from '#/views/wls/salesnotice/modules/form.vue';
 
 /** ERP 閿�鍞鍗曞垪琛� */
@@ -140,6 +141,12 @@
   formModalApi.setData({ formType: 'detail', id: row.id }).open();
 }
 
+/** 鎵撳嵃/瀵煎嚭閿�鍞鍗曡鎯咃紝渚涗紒涓氱洊绔犵暀瀛� */
+const printRef = ref<InstanceType<typeof SaleOrderPrint>>();
+function handlePrint(row: ErpSaleOrderApi.SaleOrder) {
+  printRef.value?.print(row.id!);
+}
+
 /** 鏌ョ湅鍏宠仈鍚堝悓 */
 function handleViewContract(row: ErpSaleOrderApi.SaleOrder) {
   if (row.contractId) {
@@ -220,6 +227,7 @@
   <Page auto-content-height>
     <FormModal @success="handleRefresh" />
     <SalesNoticeFormModal />
+    <SaleOrderPrint ref="printRef" />
     <Grid table-title="閿�鍞鍗曞垪琛�">
       <template #toolbar-tools>
         <TableAction
@@ -304,6 +312,13 @@
               onClick: handleDetail.bind(null, row),
             },
             {
+              label: '鎵撳嵃',
+              type: 'link',
+              icon: 'lucide:printer',
+              auth: ['erp:sale-order:query'],
+              onClick: handlePrint.bind(null, row),
+            },
+            {
               label: $t('common.edit'),
               type: 'link',
               icon: ACTION_ICON.EDIT,
@@ -360,7 +375,7 @@
               type: 'link',
               icon: 'ant-design:file-protect-outlined',
               auth: ['mes:wm-sales-notice:create'],
-              ifShow: () => row.status === 20 && row.canCreateSalesNotice,
+              ifShow: () => row.status === 20 && !!row.canCreateSalesNotice,
               onClick: handleGenerateNotice.bind(null, row),
             },
             {

--
Gitblit v1.9.3