|  |  | 
 |  |  | <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';
 | 
 |  |  | 
 |  |  | 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,
 | 
 |  |  | 
 |  |  |   showOrderDetlChild.value.orderId = item.id;
 | 
 |  |  | }
 | 
 |  |  | 
 | 
 |  |  | const printChild = ref(null);
 | 
 |  |  | // 打印订单
 | 
 |  |  | const handlePrint = async (record) => {
 | 
 |  |  |   let printData = [];
 | 
 |  |  | 
 | 
 |  |  |   const resp = await get("/api/orderDetl/orderId/" + record.__v_raw.id, {});
 | 
 |  |  |   let 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 handleExport = async (intl) => {
 | 
 |  |  |   postBlob('/api/order/export', {
 | 
 |  |  |     ioModel: props.ioModel,
 | 
 |  |  | 
 |  |  | };
 | 
 |  |  | 
 | 
 |  |  | const onSearch = () => {
 | 
 |  |  |       currentPage = 1;
 | 
 |  |  | 
 | 
 |  |  |   getPage()
 | 
 |  |  | }
 | 
 |  |  | 
 | 
 |  |  | 
 |  |  |           <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="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', '删除')
 | 
 |  |  |               }}</a-button>
 | 
 |  |  | 
 |  |  |     <ShowOrderDetlComponent ref="showOrderDetlChild" />
 | 
 |  |  | 
 | 
 |  |  |   </div>
 | 
 |  |  |   <OrderPrint ref="printChild" />
 | 
 |  |  | </template>
 | 
 |  |  | 
 | 
 |  |  | <style></style>
 |