|  |  | 
 |  |  | <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,
 | 
 |  |  | 
 |  |  |         ...getColumnSearchProps('orderSettle$'),
 | 
 |  |  |     },
 | 
 |  |  |     {
 | 
 |  |  |         title: formatMessage('db.man_order.order_settle', '客户名称'),
 | 
 |  |  |         dataIndex: 'customer',
 | 
 |  |  |         width: 140,
 | 
 |  |  |         ellipsis: true,
 | 
 |  |  |         ...getColumnSearchProps('customer'),
 | 
 |  |  |     },
 | 
 |  |  |     {
 | 
 |  |  |         title: formatMessage('db.man_order.order_settle', '电话'),
 | 
 |  |  |         dataIndex: 'phone',
 | 
 |  |  |         width: 140,
 | 
 |  |  |         ellipsis: true,
 | 
 |  |  |         ...getColumnSearchProps('phone'),
 | 
 |  |  |     },
 | 
 |  |  |     {
 | 
 |  |  |         title: formatMessage('db.man_order.order_settle', '地址'),
 | 
 |  |  |         dataIndex: 'address',
 | 
 |  |  |         width: 140,
 | 
 |  |  |         ellipsis: true,
 | 
 |  |  |         ...getColumnSearchProps('address'),
 | 
 |  |  |     },
 | 
 |  |  |     {
 | 
 |  |  |         title: formatMessage('db.man_order.ioPri', '优先级'),
 | 
 |  |  |         dataIndex: 'ioPri',
 | 
 |  |  |         width: 100,
 | 
 |  |  | 
 |  |  |         ellipsis: true,
 | 
 |  |  |         ...getColumnSearchProps('memo'),
 | 
 |  |  |     },
 | 
 |  |  | 
 | 
 |  |  |     {
 | 
 |  |  |         title: formatMessage('common.operation', '操作'),
 | 
 |  |  |         name: 'oper',
 | 
 |  |  |         dataIndex: 'oper',
 | 
 |  |  |         key: 'oper',
 | 
 |  |  |         width: 240,
 | 
 |  |  |         width: 350,
 | 
 |  |  |         fixed: 'right',
 | 
 |  |  |     },
 | 
 |  |  | ];
 | 
 |  |  | 
 |  |  | 
 | 
 |  |  | function getPage() {
 | 
 |  |  |     state.loading = true;
 | 
 |  |  | 
 | 
 |  |  |     let apiUrl = '/api/order/page';
 | 
 |  |  |     if (props.ioModel == 'in') {
 | 
 |  |  |         apiUrl = '/api/order/in/page';
 | 
 |  |  | 
 |  |  |         return true;
 | 
 |  |  |     })
 | 
 |  |  | };
 | 
 |  |  | 
 | 
 |  |  | 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.data = record.__v_raw;
 | 
 |  |  |     printChild.value.orderNo = record.__v_raw.orderNo
 | 
 |  |  |     printChild.value.open = true;
 | 
 |  |  | }
 | 
 |  |  | 
 | 
 |  |  | const onSearch = () => {
 | 
 |  |  |     // console.log('search');
 | 
 |  |  | 
 |  |  |                         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>
 | 
 |  |  | 
 |  |  |                     <a-select v-model:value="channel" :options="channelList" mode="multiple"
 | 
 |  |  |                         style="width: 100px;"></a-select>
 | 
 |  |  |                     <a-button @click="handleGenerateWave()">{{ formatMessage('common.generateWave', '生成波次')
 | 
 |  |  |                         }}</a-button>
 | 
 |  |  |                     }}</a-button>
 | 
 |  |  |                 </div>
 | 
 |  |  |             </div>
 | 
 |  |  | 
 | 
 |  |  | 
 |  |  |                         <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>
 | 
 |  |  |                         <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '删除')
 | 
 |  |  |                             }}</a-button>
 | 
 |  |  |                         }}</a-button>
 | 
 |  |  |                     </div>
 | 
 |  |  |                 </template>
 | 
 |  |  |             </template>
 | 
 |  |  |         </a-table>
 | 
 |  |  | 
 | 
 |  |  |         <ShowOrderDetlComponent ref="showOrderDetlChild" />
 | 
 |  |  | 
 | 
 |  |  |     </div>
 | 
 |  |  |     <OrderPrint ref="printChild" />
 | 
 |  |  | </template>
 | 
 |  |  | 
 | 
 |  |  | <style></style>
 |