From db2c3d7fe3d1e89b49b9628f408ba883dc75dc51 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期四, 03 七月 2025 17:11:43 +0800
Subject: [PATCH] no message

---
 zy-asrs-admin/src/components/order/order/orderOut.vue |   36 +++++++++++++++++++++++++++++-------
 1 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/zy-asrs-admin/src/components/order/order/orderOut.vue b/zy-asrs-admin/src/components/order/order/orderOut.vue
index 8b776d7..85a6da8 100644
--- a/zy-asrs-admin/src/components/order/order/orderOut.vue
+++ b/zy-asrs-admin/src/components/order/order/orderOut.vue
@@ -1,5 +1,5 @@
 <script setup>
-import { getCurrentInstance, ref, computed, reactive, defineProps } from 'vue';
+import {getCurrentInstance, ref, computed, reactive, defineProps, nextTick} from 'vue';
 import { useRouter } from "vue-router";
 import { get, post, postBlob, postForm } from '@/utils/request.js'
 import { message, Modal } from 'ant-design-vue';
@@ -8,6 +8,7 @@
 import { formatMessage } from '@/utils/localeUtils.js';
 import useTableSearch from '@/utils/tableUtils.jsx';
 import ShowOrderDetlComponent from '@/components/orderDetl/show.vue';
+import OrderPrint from '@/components/print/orderPrint/index.vue'
 import {
     DownOutlined,
     UploadOutlined,
@@ -237,6 +238,26 @@
     })
 };
 
+const printChild = ref(null);
+// 鎵撳嵃璁㈠崟
+const handlePrint = async (record) => {
+  let printData = [];
+  const resp = await get("/api/orderDetl/orderId/" + record.__v_raw.id, {});
+  const result = resp.data;
+  result.data.forEach((item) => {
+    let newItem = {};
+    newItem.matnr = item.mat$.matnr
+    newItem.maktx = item.mat$.maktx
+    newItem.specs = item.mat$.specs
+    newItem.batch = item.batch
+    newItem.anfme = item.anfme
+    printData.push(newItem)
+  })
+  printChild.value.printData = printData;
+  printChild.value.orderNo = record.__v_raw.orderNo
+  printChild.value.open = true;
+}
+
 const onSearch = () => {
     // console.log('search');
     getPage()
@@ -389,7 +410,6 @@
                         style="width: 140px;margin-right: 10px;" show-search allowClear :options="orderTypeQueryList"
                         optionFilterProp="label" optionLabelProp="label">
                     </a-select>
-
                     <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '璇疯緭鍏�')"
                         style="width: 200px;" @search="onSearch" />
                 </div>
@@ -438,9 +458,12 @@
             <template #bodyCell="{ column, text, record }">
                 <template v-if="column.dataIndex === 'oper'">
                     <div style="display: flex;justify-content: space-evenly;">
-                        <a-button type="link" primary @click="showDetl(record)">{{ formatMessage('page.order.orderDetl',
-                            '璁㈠崟鏄庣粏')
-                            }}</a-button>
+                      <a-button type="link" primary @click="showDetl(record)">{{ formatMessage('page.order.orderDetl',
+                          '璁㈠崟鏄庣粏')
+                        }}</a-button>
+                      <a-button type="link" primary @click="handlePrint(record)">{{ formatMessage('page.order.orderDetl',
+                          '鎵撳嵃璁㈠崟')
+                        }}</a-button>
                         <a-button type="link" primary @click="handleEdit(record)">{{ formatMessage('page.edit', '缂栬緫')
                             }}</a-button>
                         <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '鍒犻櫎')
@@ -449,10 +472,9 @@
                 </template>
             </template>
         </a-table>
-
         <ShowOrderDetlComponent ref="showOrderDetlChild" />
-
     </div>
+  <OrderPrint ref="printChild" />
 </template>
 
 <style></style>

--
Gitblit v1.9.1