pang.jiabao
2025-04-03 20235a873f123a83f7763c0327e5845caa32c9b9
入出库订单打印,拣货单打印,搜索条件增加
6个文件已修改
2个文件已添加
244 ■■■■■ 已修改文件
zy-asrs-admin/src/components/order/order/orderIn.vue 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/components/order/order/orderOut.vue 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/components/print/orderPrint/index.vue 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/components/print/orderPrint/template/template1.vue 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/views/log/viewWorkIn/index.vue 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/statistics/ViewWorkIn.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/manage/OutManage.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/components/order/order/orderIn.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,
@@ -216,6 +217,28 @@
  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,
@@ -367,6 +390,9 @@
          <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>
@@ -378,6 +404,7 @@
    <ShowOrderDetlComponent ref="showOrderDetlChild" />
  </div>
  <OrderPrint ref="printChild" />
</template>
<style></style>
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()
@@ -441,6 +462,9 @@
                        <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', '删除')
@@ -453,6 +477,7 @@
        <ShowOrderDetlComponent ref="showOrderDetlChild" />
    </div>
  <OrderPrint ref="printChild" />
</template>
<style></style>
zy-asrs-admin/src/components/print/orderPrint/index.vue
New file
@@ -0,0 +1,56 @@
<script setup>
import {ref, toRaw} from 'vue';
import { formatMessage } from '@/utils/localeUtils';
import Template1 from './template/template1.vue';
const template = {
    Template1
}
const printChild = ref(null);
const selectTemplate = ref('Template1');
let open = ref(false);
let printData = ref([]);
let repeatNum = ref(1);
let orderNo = ref('');
const handleOk = () => {
}
const printObj = ref({
    id: "printOrder",
    beforeOpenCallback(vue) {
        // console.log(toRaw(printData.value))
    },
    openCallback(vue) {
        console.log('执行了打印')
    },
    closeCallback(vue) {
        console.log('关闭了打印工具')
    },
});
defineExpose({
    open,
    orderNo,
    printData
})
</script>
<template>
    <a-modal v-model:open="open" :title="formatMessage('', '订单打印')" @ok="handleOk" :width="'60%'" v-if="open">
        <div style="height: 500px;overflow-x: hidden;overflow-y: scroll;">
            <div style="margin-top: 20px;">
                <Component :is="template[selectTemplate]" ref="printChild" :list="printData" :repeatNum="repeatNum" :orderNo="orderNo" />
            </div>
        </div>
        <template #footer>
            <a-button key="submit" type="primary" v-print="printObj" @click="handleOk">
                {{ formatMessage('common.print', '打印') }}
            </a-button>
        </template>
    </a-modal>
</template>
<style></style>
zy-asrs-admin/src/components/print/orderPrint/template/template1.vue
New file
@@ -0,0 +1,81 @@
<script setup>
import {toRefs, ref, defineProps, watch} from 'vue';
import { globalState } from '@/config.js'
import { formatMessage } from '@/utils/localeUtils';
const props = defineProps({
  orderNo: {
    type: String,
    default: ''
  },
    list: {
        type: Array,
        default: []
    },
    repeatNum: {
        type: Number,
        default: 1
    }
});
const { orderNo,list, repeatNum } = toRefs(props)
</script>
<template>
    <div id="printOrder">
                <div>
                    <table class="contain" width="1200"
                        style="overflow: hidden;font-size: xx-small;table-layout: fixed;">
                        <tr style="height: 100px">
                            <td colspan="1" align="center" scope="col">订单号</td>
                            <td colspan="2" align="center" scope="col">{{orderNo}}</td>
                            <td class="barcode" colspan="9" align="center" scope="col">
                                <img :src="globalState.url + '/api/code/auth?type=1&param=' + orderNo" width="70%;" />
                                <div style="letter-spacing: 2px;margin-top: 1px; text-align: center;">
                                    <span>{{ orderNo }} </span>
                                </div>
                            </td>
                        </tr>
                      <tr style="height: 40px">
                        <td align="center" colspan="1">序号</td>
                        <td align="center" colspan="2">商品编号</td>
                        <td align="center" colspan="3">商品名称</td>
                        <td align="center" colspan="2">批次</td>
                        <td align="center" colspan="2">规格</td>
                        <td align="center" colspan="1">数量 </td>
                      </tr>
                        <template v-for="(item, index) in list" :key="index">
                        <tr style="height: 40px">
                          <td align="center" colspan="1">{{index + 1}}</td>
                          <td align="center" colspan="2">{{ item.matnr }}</td>
                          <td align="center" colspan="3">{{ item.maktx }}</td>
                          <td align="center" colspan="2">{{ item.batch }}</td>
                          <td align="center" colspan="2">{{ item.specs }}</td>
                          <td align="center" colspan="1">{{ item.anfme }}</td>
                        </tr>
                        </template>
                    </table>
                </div>
    </div>
</template>
<style>
@media print {
    body {
        margin: 0;
        padding: 0;
    }
    .print-area {
        margin: 0;
        padding: 0;
        height: auto;
    }
}
.contain td {
    border: 1px solid #000;
}
</style>
zy-asrs-admin/src/config.js
@@ -1,7 +1,7 @@
import { reactive, inject } from 'vue';
export const globalState = reactive({
    url: 'http://127.0.0.1:8081/wms',
    url: 'http://192.168.8.14:8081/wms',
    token: '',
    user: null,
    locale: 'zh_CN', // 默认语言
zy-asrs-admin/src/views/log/viewWorkIn/index.vue
@@ -14,6 +14,14 @@
let currentPage = 1;
let pageSize = 10;
const searchInput = ref("")
const searchParam = ref({
  createTime: null,
  targetLoc: null,
  matnr: null,
  maktx: null,
  batch: null,
  barcode: null,
})
const editChild = ref(null)
const state = reactive({
@@ -102,7 +110,8 @@
    post('/api/viewWorkIn/page', {
        current: currentPage,
        pageSize: pageSize,
        condition: searchInput.value
        condition: searchInput.value,
        _param: searchParam.value,
    }).then((resp) => {
        let result = resp.data;
        if (result.code == 200) {
@@ -150,7 +159,8 @@
const handleExport = async (intl) => {
    postBlob('/api/viewWorkIn/export', {
        condition: searchInput.value
        condition: searchInput.value,
        _param: searchParam.value,
    }).then(result => {
        const blob = new Blob([result.data], { type: 'application/vnd.ms-excel' });
        window.location.href = window.URL.createObjectURL(blob);
@@ -184,8 +194,22 @@
<template>
    <div>
        <div class="table-header">
        <div>
          <a-input v-model:value="searchParam.createTime" :placeholder="formatMessage('page.locDetl.createTime.input', '入库日期')"
                   style="width: 140px;margin-right: 10px;"/>
          <a-input v-model:value="searchParam.targetLoc" :placeholder="formatMessage('page.locDetl.targetLoc.input', '库位号')"
                   style="width: 140px;margin-right: 10px;"/>
          <a-input v-model:value="searchParam.matnr" :placeholder="formatMessage('page.locDetl.matnr.input', '商品编号')"
                   style="width: 140px;margin-right: 10px;"/>
          <a-input v-model:value="searchParam.maktx" :placeholder="formatMessage('page.locDetl.maktx.input', '商品名称')"
                   style="width: 140px;margin-right: 10px;"/>
          <a-input v-model:value="searchParam.batch" :placeholder="formatMessage('page.locDetl.batch.input', '批次')"
                   style="width: 140px;margin-right: 10px;"/>
          <a-input v-model:value="searchParam.barcode" :placeholder="formatMessage('page.locDetl.barcode.input', '条码')"
                   style="width: 140px;margin-right: 10px;"/>
            <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '请输入')"
                style="width: 200px;" @search="onSearch" />
        </div>
            <div class="table-header-right">
                <a-button @click="handleExport">{{ formatMessage('page.export', '导出') }}</a-button>
            </div>
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/statistics/ViewWorkIn.java
@@ -10,4 +10,7 @@
@TableName("view_work_in")
public class ViewWorkIn extends TaskDetlLog {
    private String maktx;
    private String targetLoc;
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/manage/OutManage.java
@@ -1,16 +1,13 @@
package com.zy.asrs.wms.asrs.manage;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.fasterxml.jackson.datatype.jsr310.DecimalUtils;
import com.mysql.cj.util.StringUtils;
import com.zy.asrs.framework.exception.CoolException;
import com.zy.asrs.wms.asrs.entity.*;
import com.zy.asrs.wms.asrs.entity.dto.*;
import com.zy.asrs.wms.asrs.entity.dto.OrderOutMergeDto;
import com.zy.asrs.wms.asrs.entity.enums.*;
import com.zy.asrs.wms.asrs.entity.param.*;
import com.zy.asrs.wms.asrs.entity.*;
import com.zy.asrs.wms.asrs.service.*;
import com.zy.asrs.wms.utils.OrderUtils;
import com.zy.asrs.wms.utils.OutUtils;
@@ -23,11 +20,9 @@
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
 * 出库管理
@@ -1053,11 +1048,11 @@
        if (!flatOrders.isEmpty()) {
            //平库出库
            outStockByFlat(flatOrders, wave);
        }
        if (!tucOrders.isEmpty()) {
        } else if (!tucOrders.isEmpty()) {
            //CTU出库
            outStockByTUC(tucOrders, wave);
        } else {
            throw new CoolException("库存不足");
        }
    }
@@ -1438,9 +1433,7 @@
                    }
                    CacheSite cacheSite = cacheSiteService.getOne(new LambdaQueryWrapper<CacheSite>().eq(CacheSite::getOrderId, order.getId()));
                    if (cacheSite == null) {
                        throw new CoolException("缓存站不存在");
                    }
                    if (cacheSite != null) {
                    cacheSite.setSiteStatus(CacheSiteStatusType.O.id);
                    cacheSite.setOrderId(null);
                    cacheSite.setOrderNo(null);
@@ -1449,6 +1442,7 @@
                        throw new CoolException("缓存站清空失败");
                    }
                }
                }
                waveDetlService.removeById(waveDetl.getId());
            }