自动化立体仓库 - WMS系统
LSH
2023-09-09 0dd158492d2dd62de471f3e5841c01bfeb1f34c6
#出库优化、显示优化、流程优化
24个文件已修改
1个文件已添加
599 ■■■■ 已修改文件
src/main/java/com/zy/asrs/entity/OrderDetl.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/WrkDetl.java 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/param/StockOutParam.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/InitStaDesc.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/OutboundAllocationUtil.java 250 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/model/LocDetlDto.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WrkDetlMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/adjDetl/adjDetl.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/common.js 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/locDetl/locDetl.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/locDetlStatis/locDetlStatis.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/manLocDetl/manLocDetl.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/order/order.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/order/out.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/orderDetl/orderDetl.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/pack/pack.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/pakStore/pakStore.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/pakStore/stockAdjust.js 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/pakStore/stockOut.js 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/pakStore/stockOutOrder.js 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/saas/locDetl.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/saas/stockAdjust.js 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/order/order.html 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/OrderDetl.java
@@ -236,7 +236,7 @@
    private Integer deadWarn;
    /**
     * 制购 1: 制造  2: 采购  3: 外协
     * 制购 1: 制造  2: 采购  3: 外协  、、江铜:是否确认   1: 确认  2: 未确认
     */
    @ApiModelProperty(value= "制购 1: 制造  2: 采购  3: 外协  ")
    private Integer source;
@@ -360,17 +360,26 @@
        }
    }
//    public String getSource$(){
//        if (null == this.source){ return null; }
//        switch (this.source){
//            case 1:
//                return "制造";
//            case 2:
//                return "采购";
//            case 3:
//                return "外协";
//            default:
//                return String.valueOf(this.source);
//        }
//    }
    public String getSource$(){
        if (null == this.source){ return null; }
        if (null == this.source){ return "未确认"; }
        switch (this.source){
            case 1:
                return "制造";
            case 2:
                return "采购";
            case 3:
                return "外协";
                return "确认";
            default:
                return String.valueOf(this.source);
                return "未确认";
        }
    }
@@ -442,6 +451,13 @@
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
    }
    public String getQty$(){
        if (getAnfme().equals(getQty())){
            return "已完成";
        }
        return "未完成";
    }
    public Double getEnableQty() {
        if (null != this.anfme && this.workQty != null) {
            return this.anfme - this.workQty;
src/main/java/com/zy/asrs/entity/WrkDetl.java
@@ -204,7 +204,7 @@
    private Integer beBatch;
    /**
     * 保质期
     * 保质期 、、江铜:是否确认   1: 确认  2: 未确认
     */
    @ApiModelProperty(value= "保质期")
    @TableField("dead_time")
@@ -218,7 +218,7 @@
    private Integer deadWarn;
    /**
     * 制购 1: 制造  2: 采购  3: 外协
     * 制购 1: 制造  2: 采购  3: 外协 、、江铜:是否确认   1: 确认  2: 未确认
     */
    @ApiModelProperty(value= "制购 1: 制造  2: 采购  3: 外协  ")
    private Integer source;
@@ -289,17 +289,37 @@
        }
    }
//    public String getSource$(){
//        if (null == this.source){ return null; }
//        switch (this.source){
//            case 1:
//                return "制造";
//            case 2:
//                return "采购";
//            case 3:
//                return "外协";
//            default:
//                return String.valueOf(this.source);
//        }
//    }
    public String getSource$(){
        if (null == this.source){ return null; }
        if (null == this.source){ return "未确认"; }
        switch (this.source){
            case 1:
                return "制造";
            case 2:
                return "采购";
            case 3:
                return "外协";
                return "确认";
            default:
                return String.valueOf(this.source);
                return "未确认";
        }
    }
    public String getDeadTime(){
        if (null == this.source){ return "未确认"; }
        switch (this.source){
            case 1:
                return "确认";
            default:
                return "未确认";
        }
    }
src/main/java/com/zy/asrs/entity/param/StockOutParam.java
@@ -47,6 +47,11 @@
        // 木箱中铜箔数量
        private Double count;
        public void setAnfme(Double anfme){
            this.anfme=anfme;
            this.count=anfme;
        }
    }
}
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -13,6 +13,7 @@
import com.zy.asrs.entity.param.LocDetlAdjustParam;
import com.zy.asrs.entity.param.StockOutParam;
import com.zy.asrs.service.*;
import com.zy.asrs.utils.OutboundAllocationUtil;
import com.zy.asrs.utils.Utils;
import com.zy.common.model.*;
import com.zy.common.model.enums.IoWorkType;
@@ -166,7 +167,7 @@
        for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) {
            if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) {
                LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch());
                if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount()));
                if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount(), param.getOrderNo()));
            }
        }
        if (!locDetlDtos.isEmpty()) {
@@ -219,7 +220,7 @@
                    null,    // 发货时间
                    null,    // 物流名称
                    null,    // 物流单号
                    1L,    // 订单状态
                    2L,    // 订单状态
                    1,    // 状态
                    userId,    // 添加人员
                    now,    // 添加时间
@@ -245,10 +246,11 @@
                orderDetl.setSuppCode(String.valueOf(i));  // 行号
                orderDetl.setManu(locDetl.getLocNo());  //库位号
                orderDetl.setBatch(locDetl.getBatch()); //木箱编码
                orderDetl.setAnfme(locDetl.getCount());//出库数量
                orderDetl.setAnfme(locDetl.getAnfme());//出库数量
                orderDetl.setModel(locDetl.getModel());//批次
                orderDetl.setSpecs(locDetl.getSpecs());//规格
                orderDetl.setBrand(locDetl.getBrand());//木箱类型
                orderDetl.setWorkQty(locDetl.getAnfme());
                orderDetl.setOrderId(order.getId());
                orderDetl.setOrderNo(order.getOrderNo());
                orderDetl.setCreateBy(userId);
@@ -261,6 +263,12 @@
                    throw new CoolException("生成单据明细失败,请联系管理员");
                }
            }
            List<StockOutParam> stockOutParams = OutboundAllocationUtil.OutboundClassification(param);
            for (StockOutParam stockOutParam : stockOutParams){
                startupFullTakeStore(stockOutParam,userId);
            }
        } else {
            throw new CoolException("订单号重复,订单"+param.getOrderNo()+"已存在!!!");
        }
@@ -341,7 +349,7 @@
                if (detlDto.getCount()==null || detlDto.getCount() <= 0.0D) {continue;}
                WrkDetl wrkDetl = new WrkDetl();
                wrkDetl.sync(detlDto.getLocDetl());
                wrkDetl.setOrderNo(""); // 手动出库不需要带出库存中的单据编号
                wrkDetl.setOrderNo(detlDto.getOrderNo()); // 手动出库不需要带出库存中的单据编号
                wrkDetl.setWrkNo(workNo);
                wrkDetl.setIoTime(now);
                Double anfme = ioType==101?detlDto.getLocDetl().getAnfme():detlDto.getCount();
@@ -648,7 +656,7 @@
        for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) {
            if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) {
                LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch());
                if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount()));
                if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount(),param.getOrderNo()));
            }
        }
        if (!locDetlDtos.isEmpty()) {
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -117,7 +117,7 @@
                        // 更新订单完成数量
                        OrderDetl orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
                        if (orderDetl==null){
                            orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), null);
                            orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
                        }
                        try {
                            if(!Cools.isEmpty(orderDetl)){
@@ -169,7 +169,7 @@
                        // 更新订单完成数量
                        OrderDetl orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
                        if (orderDetl==null){
                            orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), null);
                            orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
                        }
                        try {
                            if(!Cools.isEmpty(orderDetl)){
src/main/java/com/zy/asrs/utils/InitStaDesc.java
@@ -24,7 +24,7 @@
    }
    public void in() {
        // 全班入库
        // 全板入库
        int[] stnNos = new int[] {305, 303, 301};
        int[] crnStns = new int[] {321, 320, 319, 318, 317, 316, 315, 314, 313, 311, 309, 307};
        for (int stnNo : stnNos) {
src/main/java/com/zy/asrs/utils/OutboundAllocationUtil.java
New file
@@ -0,0 +1,250 @@
package com.zy.asrs.utils;
import com.zy.asrs.entity.param.StockOutParam;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class OutboundAllocationUtil {
    public static void main(String[] args) {
        int numLanes = 3;
        int numWarehouses = 2;
        List<Integer> goods = new ArrayList<>();
        // Generate random goods// 生成随机货物数量
        Random random = new Random();
        for (int i = 0; i < numLanes; i++) {
            int goodsCount = random.nextInt(10) + 1; // Randomly generate goods count (1-10)// 随机生成货物数量 (1-10)
            goods.add(goodsCount);
        }
        int[] warehouses = distributeGoods(numLanes, numWarehouses,goods);
        System.out.println("Goods distribution:");//货物分配情况
        for (int i = 0; i < numWarehouses; i++) {
            System.out.println("Warehouse " + (i + 1) + ": " + warehouses[i] + " goods");
        }
        int[] warehouses2 = distributeGoods2(numLanes, numWarehouses,goods);
        System.out.println("Goods distribution2:");//货物分配情况
        for (int i = 0; i < numWarehouses; i++) {
            System.out.println("Warehouse " + (i + 1) + ": " + warehouses2[i] + " goods");
        }
        int totalItems = 1000; // 替换为实际的出库箱子数量
        distributeItemsToTrucks(totalItems);
    }
    public static int[] distributeGoods(int numLanes, int numWarehouses,List<Integer> goods) {
        int[] warehouses = new int[numWarehouses];
        // Calculate average goods per warehouse // 计算每个仓库应分配的平均货物数量
        int totalGoods = goods.stream().mapToInt(Integer::intValue).sum();
        int averageGoods = totalGoods / numWarehouses;
        // Distribute goods to warehouses// 生成随机货物数量
        int currentWarehouse = 0;
        for (int i = 0; i < numLanes; i++) {
            int goodsCount = goods.get(i);
            if (warehouses[currentWarehouse] + goodsCount <= averageGoods) {
                // Assign goods to current warehouse // 将货物分配给当前仓库
                warehouses[currentWarehouse] += goodsCount;
            } else {
                // Move to the next warehouse// 移至下一个仓库
                if (currentWarehouse==0){
                    currentWarehouse++;
                }
                warehouses[currentWarehouse] += goodsCount;
            }
        }
        return warehouses;
    }
    public static int[] distributeGoods2(int numLanes, int numWarehouses,List<Integer> goods) {
        int[] warehouses = new int[numWarehouses];
        // Calculate total goods// 计算总货物数量
        int totalGoods = goods.stream().mapToInt(Integer::intValue).sum();
        // Distribute goods to warehouses// 将货物分配给仓库
        int currentWarehouse = 0;
        for (int i = 0; i < numLanes; i++) {
            int goodsCount = goods.get(i);
            while (goodsCount > 0) {
                if (currentWarehouse >= numWarehouses) {
                    currentWarehouse = 0; // Wrap around to the first warehouse if all warehouses are filled// 如果所有仓库都已经装满,则回到第一个仓库
                }
                int spaceAvailable = totalGoods / numWarehouses - warehouses[currentWarehouse];
                int goodsToAssign = Math.min(spaceAvailable, goodsCount);
                warehouses[currentWarehouse] += goodsToAssign;
                goodsCount -= goodsToAssign;
                currentWarehouse++;
            }
        }
        return warehouses;
    }
    public static void distributeItemsToTrucks(int totalItems) {
        int totalSlots = 1200 * 3; // 总库位数量
        int itemsPerTruck = totalItems / 2; // 每辆货车应装载的箱子数量
        // 初始出库数量
        int itemsInLane1 = totalItems / 6;
        int itemsInLane2 = totalItems / 6;
        int itemsInLane3 = totalItems / 6;
        int totalItemsInLanes = itemsInLane1 + itemsInLane2 + itemsInLane3;
        // 调整出库数量直到总数等于N
        while (totalItemsInLanes - totalItems< 0|| totalItemsInLanes - totalItems>=3) {
            if (totalItemsInLanes > totalItems) {
                // 初始值过大,减少每个巷道的出库数量
                itemsInLane1--;
                itemsInLane2--;
                itemsInLane3--;
            } else {
                // 初始值过小,增加每个巷道的出库数量
                itemsInLane1++;
                itemsInLane2++;
                itemsInLane3++;
            }
            totalItemsInLanes = itemsInLane1 + itemsInLane2 + itemsInLane3;
        }
        // 分配到2个货车
        int itemsPerTruckPerLane = itemsPerTruck / 3; // 每个巷道每辆货车应装载的箱子数量
        // 巷道1分配
        int lane1Truck1Items = itemsPerTruckPerLane;
        int lane1Truck2Items = itemsInLane1 - itemsPerTruckPerLane;
        // 巷道2分配
        int lane2Truck1Items = itemsPerTruckPerLane;
        int lane2Truck2Items = itemsInLane2 - itemsPerTruckPerLane;
        // 巷道3分配
        int lane3Truck1Items = itemsPerTruckPerLane;
        int lane3Truck2Items = itemsInLane3 - itemsPerTruckPerLane;
        // 打印结果
        System.out.println("巷道1:");
        System.out.println("货车1装载数量:" + lane1Truck1Items);
        System.out.println("货车2装载数量:" + lane1Truck2Items);
        System.out.println("巷道2:");
        System.out.println("货车1装载数量:" + lane2Truck1Items);
        System.out.println("货车2装载数量:" + lane2Truck2Items);
        System.out.println("巷道3:");
        System.out.println("货车1装载数量:" + lane3Truck1Items);
        System.out.println("货车2装载数量:" + lane3Truck2Items);
    }
    public static List<StockOutParam> OutboundClassification(StockOutParam param){
        List<StockOutParam> stockOutParams = new ArrayList<>();
        List<StockOutParam.LocDetl> locDetls = param.getLocDetls();
        List<String> brands = new ArrayList<>();
        for (StockOutParam.LocDetl locDetl:locDetls){
            if (!brands.contains(locDetl.getBrand())){
                brands.add(locDetl.getBrand());
            }
        }
        for (String brand : brands){
            List<StockOutParam.LocDetl> locDetls1 = new ArrayList<>();
            List<StockOutParam.LocDetl> locDetls2 = new ArrayList<>();
            List<StockOutParam.LocDetl> locDetls3 = new ArrayList<>();
            List<StockOutParam.LocDetl> locDetls4 = new ArrayList<>();
            List<StockOutParam.LocDetl> locDetls5 = new ArrayList<>();
            List<StockOutParam.LocDetl> locDetls6 = new ArrayList<>();
            for (StockOutParam.LocDetl locDetl:locDetls){
                if (locDetl.getBrand().equals(brand)){
                    switch (Utils.getRow(locDetl.getLocNo())){
                        case 1: case 2: case 3: case 4:
                            locDetls1.add(locDetl);
                            break;
                        case 5: case 6: case 7: case 8:
                            locDetls2.add(locDetl);
                            break;
                        case 9: case 10: case 11: case 12:
                            locDetls3.add(locDetl);
                            break;
                        case 13: case 14: case 15: case 16:
                            locDetls4.add(locDetl);
                            break;
                        case 17: case 18: case 19: case 20:
                            locDetls5.add(locDetl);
                            break;
                        case 21: case 22: case 23: case 24:
                            locDetls6.add(locDetl);
                            break;
                        default:
                    }
                }
            }
            ArrayList<List<StockOutParam.LocDetl>> lists = new ArrayList<>();
            lists.add(locDetls1);
            lists.add(locDetls2);
            lists.add(locDetls3);
            lists.add(locDetls4);
            lists.add(locDetls5);
            lists.add(locDetls6);
            int sign = 0;
            int staA=118;
            int staB=119;
            for (List<StockOutParam.LocDetl> locDetlList:lists){
                sign++;
                if (locDetlList.size()==0){
                    continue;
                }
                if (sign>lists.size()/2) {
                    //120、121
                    staA=120;
                    staB=121;
                }
                List<StockOutParam.LocDetl> locDetlsA = new ArrayList<>();
                List<StockOutParam.LocDetl> locDetlsB = new ArrayList<>();
                List<String> locNos = new ArrayList<>();
                for (StockOutParam.LocDetl locDetl:locDetlList){
                    if (locDetlsA.size()<locDetlList.size()/2){
                        locDetlsA.add(locDetl);
                        if (!locNos.contains(locDetl.getLocNo())){
                            locNos.add(locDetl.getLocNo());
                        }
                    }else {
                        if (locNos.contains(locDetl.getLocNo())){
                            locDetlsA.add(locDetl);
                        }else {
                            locDetlsB.add(locDetl);
                        }
                    }
                }
                if (locDetlsA.size()!=0){
                    StockOutParam stockOutParamA = new StockOutParam();
                    stockOutParamA.setOutSite(staA);
                    stockOutParamA.setOrderNo(param.getOrderNo());
                    stockOutParamA.setLocDetls(locDetlsA);
                    stockOutParams.add(stockOutParamA);
                }
                if (locDetlsB.size()!=0){
                    StockOutParam stockOutParamB = new StockOutParam();
                    stockOutParamB.setOutSite(staB);
                    stockOutParamB.setOrderNo(param.getOrderNo());
                    stockOutParamB.setLocDetls(locDetlsB);
                    stockOutParams.add(stockOutParamB);
                }
            }
        }
        return stockOutParams;
    }
}
src/main/java/com/zy/common/model/LocDetlDto.java
@@ -9,14 +9,17 @@
    private LocDetl locDetl;
    private String orderNo;
    private Double count;
    public LocDetlDto() {
    }
    public LocDetlDto(LocDetl locDetl, Double count) {
    public LocDetlDto(LocDetl locDetl, Double count ,String orderNo) {
        this.locDetl = locDetl;
        this.count = count;
        this.orderNo = orderNo;
    }
    public LocDetl getLocDetl() {
@@ -34,4 +37,12 @@
    public void setCount(Double count) {
        this.count = count;
    }
    public String getOrderNo() {
        return orderNo;
    }
    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }
}
src/main/resources/mapper/WrkDetlMapper.xml
@@ -113,19 +113,19 @@
    </select>
    <select id="selectAndLogByOrderNoGroupByMatnrOfSum" resultMap="BaseResultMap">
        select awd.wrk_no, awd.io_time, awd.matnr,awd.zpallet,awd.specs,awd.maktx, sum(awd.anfme) as anfme
        select awd.wrk_no, awd.io_time, awd.matnr,awd.zpallet,awd.specs,awd.maktx,awd.batch,awd.source, sum(awd.anfme) as anfme
        from asr_wrk_detl awd
        left join asr_wrk_mast awm on awd.wrk_no = awm.wrk_no and awd.io_time = awm.io_time
        where order_no = #{orderNo}
        group by awd.wrk_no, awd.io_time, awd.matnr ,awd.zpallet,awd.specs,awd.maktx
        group by awd.wrk_no, awd.io_time, awd.matnr ,awd.zpallet,awd.specs,awd.maktx,awd.batch,awd.source
        union
        select distinct awdl.wrk_no, awdl.io_time, awdl.matnr,awdl.zpallet,awdl.specs,awdl.maktx, sum(awdl.anfme) as anfme
        select distinct awdl.wrk_no, awdl.io_time, awdl.matnr,awdl.zpallet,awdl.specs,awdl.maktx,awdl.batch,awdl.source, sum(awdl.anfme) as anfme
        from asr_wrk_detl_log awdl
        left join asr_wrk_mast_log awml on awdl.wrk_no = awml.wrk_no and awdl.io_time = awml.io_time
        where awdl.order_no = #{orderNo}
        and (awml.manu_type is null or awml.manu_type != '手动取消')
        and awml.io_type != 103
        group by awdl.wrk_no, awdl.io_time, awdl.matnr ,awdl.zpallet,awdl.specs,awdl.maktx
        group by awdl.wrk_no, awdl.io_time, awdl.matnr ,awdl.zpallet,awdl.specs,awdl.maktx,awdl.batch,awdl.source
    </select>
</mapper>
src/main/webapp/static/js/adjDetl/adjDetl.js
@@ -24,7 +24,7 @@
            {field: 'locNo', align: 'center',title: '库位号'}
            ,{field: 'matnrOld', align: 'center',title: '原品号'}
            ,{field: 'matnr', align: 'center',title: '当前品号'}
            ,{field: 'batch', align: 'center',title: '批号'}
            ,{field: 'batch', align: 'center',title: '箱号'}
            // ,{field: 'oriCtns', align: 'center',title: '原箱数'}
            ,{field: 'oriQty', align: 'center',title: '原数量'}
            // ,{field: 'oriWt', align: 'center',title: '原重量'}
src/main/webapp/static/js/common.js
@@ -225,17 +225,17 @@
    {field: 'matnr', align: 'center',title: '商品编号(品号)', sort:true}
    ,{field: 'maktx', align: 'center',title: '商品名称(品名)', sort:true}
    ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false}
    ,{field: 'batch', align: 'center',title: '货品特征', sort:true}
    ,{field: 'anfme', align: 'center',title: '数量', hide: false, sort:true}
    ,{field: 'batch', align: 'center',title: '箱号', hide: false, sort:true}
    ,{field: 'brand', align: 'center',title: '木箱类型', hide: false, sort:true}
    ,{field: 'anfme', align: 'center',title: '木箱中铜箔数量', hide: false, sort:true}
    ,{field: 'zpallet', align: 'center',title: '托盘条码', hide: false}
    ,{field: 'specs', align: 'center',title: '规格', hide: false}
    ,{field: 'model', align: 'center',title: '代码', hide: true}
    ,{field: 'model', align: 'center',title: '批次', hide: false}
    ,{field: 'color', align: 'center',title: '颜色', hide: true}
    ,{field: 'brand', align: 'center',title: '品牌', hide: true}
    ,{field: 'unit', align: 'center',title: '单位', hide: false}
    ,{field: 'price', align: 'center',title: '单价', hide: true}
    ,{field: 'sku', align: 'center',title: '木箱编码', hide: false}
    ,{field: 'sku', align: 'center',title: 'sku', hide: true}
    ,{field: 'units', align: 'center',title: '单位量', hide: true}
    ,{field: 'barcode', align: 'center',title: '条码', hide: true}
    ,{field: 'origin', align: 'center',title: '木箱位置', hide: false}
src/main/webapp/static/js/locDetl/locDetl.js
@@ -5,16 +5,16 @@
        {field: 'matnr', align: 'center',title: '商品编号', sort:true}
        ,{field: 'maktx', align: 'center',title: '商品名称', sort:true}
        ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false}
        ,{field: 'batch', align: 'center',title: '批号', width: 300, sort:true}
        ,{field: 'anfme', align: 'center',title: '数量'}
        ,{field: 'batch', align: 'center',title: '箱号', width: 300, sort:true}
        ,{field: 'anfme', align: 'center',title: '木箱中铜箔数量'}
        ,{field: 'zpallet', align: 'center',title: '托盘条码'}
        ,{field: 'specs', align: 'center',title: '规格'}
        ,{field: 'model', align: 'center',title: '代码', hide: true}
        ,{field: 'model', align: 'center',title: '批号', hide: true}
        ,{field: 'color', align: 'center',title: '颜色', hide: true}
        ,{field: 'brand', align: 'center',title: '品牌', hide: true}
        ,{field: 'unit', align: 'center',title: '单位', hide: true}
        ,{field: 'price', align: 'center',title: '单价', hide: true}
        ,{field: 'sku', align: 'center',title: '木箱编码', hide: false}
        ,{field: 'sku', align: 'center',title: 'sku', hide: true}
        ,{field: 'units', align: 'center',title: '单位量', hide: true}
        ,{field: 'barcode', align: 'center',title: '条码', hide: true}
        ,{field: 'origin', align: 'center',title: '木箱位置', hide: false}
src/main/webapp/static/js/locDetlStatis/locDetlStatis.js
@@ -1,7 +1,7 @@
var pageCurr;
function getCol() {
    var cols = [
        {field: 'anfme', align: 'center',title: '库存数量', style: 'font-weight: bold'}
        {field: 'anfme', align: 'center',title: '木箱中铜箔数量', style: 'font-weight: bold'}
    ];
    arrRemove(detlCols, "field", "anfme")
    arrRemove(detlCols, "field", "zpallet")
src/main/webapp/static/js/manLocDetl/manLocDetl.js
@@ -5,7 +5,7 @@
        {field: 'matnr', align: 'center',title: '商品编号', sort:true}
        ,{field: 'maktx', align: 'center',title: '商品名称', sort:true}
        ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false}
        ,{field: 'batch', align: 'center',title: '批号', width: 300, sort:true}
        ,{field: 'batch', align: 'center',title: '箱号', width: 300, sort:true}
        ,{field: 'anfme', align: 'center',title: '数量'}
        //,{field: 'zpallet', align: 'center',title: '托盘条码'}
        ,{field: 'specs', align: 'center',title: '配置'}
src/main/webapp/static/js/order/order.js
@@ -104,7 +104,7 @@
            layer.open({
                type: 1,
                title: false,
                area: '820px',
                area: '1020px',
                offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'],
                shade: .01,
                shadeClose: true,
@@ -124,10 +124,10 @@
                            {type: 'numbers'},
                            {field: 'matnr', title: '商品编码', width: 160},
                            {field: 'maktx', title: '商品名称', width: 160},
                            {field: 'batch', title: '批号'},
                            {field: 'anfme', title: '数量'},
                            {field: 'workQty', title: '作业数量'},
                            {field: 'qty', title: '完成数量', style: 'font-weight: bold'},
                            {field: 'batch', title: '箱号'},
                            {field: 'anfme', title: '木箱中铜箔数量'},
                            // {field: 'workQty', title: '作业数量'},
                            // {field: 'unit', title: '单位'},
                            // {
                            //     field: 'createTime$', title: '创建时间', sort: true, templet: function (d) {
@@ -136,7 +136,9 @@
                            // },
                            // {field: 'inQty', title: '已入库量'},
                            // {field: 'color', title: '颜色'},
                            {field: 'specs', title: '规格'}
                            {field: 'specs', title: '规格'},
                            {field: 'qty$', title: '状态', style: 'font-weight: bold'},
                            {field: 'source$', title: '是否确认', style: 'font-weight: bold'}
                        ]],
                        request: {
                            pageName: 'curr',
@@ -236,7 +238,7 @@
                        {type: 'numbers', title: '#'},
                        {field: 'matnr', title: '商品编码', width: 160},
                        {field: 'maktx', title: '商品名称', width: 200},
                        {field: 'batch', title: '批号', edit: true},
                        {field: 'batch', title: '箱号', edit: true},
                        {field: 'specs', title: '规格'},
                        {field: 'anfme', title: '数量(修改)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
                        {field: 'workQty', title: '作业数量',  minWidth: 100, width: 100},
@@ -508,7 +510,7 @@
                                    },
                                    color: ['#10B4E8', '#E0E0E0', '#FF0000'],
                                    tooltip: {trigger: 'item'},
                                    series: [{name: '数量', type: 'pie', radius: ['75%', '80%'], label: {normal: {show: false}}}]
                                    series: [{name: '箱子数量', type: 'pie', radius: ['75%', '80%'], label: {normal: {show: false}}}]
                                };
                                traceCharts.setOption(traceOptions);
                                // 赋值
src/main/webapp/static/js/order/out.js
@@ -34,7 +34,7 @@
            ,{field: 'orderNo', align: 'center',title: '单据编号', templet: '#orderNoTpl', width: 160}
            ,{field: 'matnr', align: 'center',title: '商品编码', width: 160}
            ,{field: 'maktx', align: 'center',title: '商品名称', width: 200}
            ,{field: 'batch', align: 'center',title: '序列码'}
            ,{field: 'batch', align: 'center',title: '箱号'}
            ,{field: 'specs', align: 'center',title: '规格'}
            // ,{field: 'anfme', align: 'center',title: '数量'}
            // ,{field: 'qty', align: 'center',title: '作业数量', style: 'font-weight: bold'}
@@ -159,7 +159,7 @@
                                    // {type: 'checkbox', merge: ['orderNo']},
                                    {field: 'orderNo', title: '单据编号', merge: true, align: 'center'},
                                    {field: 'title', title: '商品', merge: true, align: 'center', width: 350},
                                    {field: 'batch', title: '序列码', align: 'center'},
                                    {field: 'batch', title: '箱号', align: 'center'},
                                    {field: 'anfme', title: '数量', align: 'center', width: 90, style: 'font-weight: bold'},
                                    {field: 'locNo', title: '货位', align: 'center', width: 100, templet: '#locNoTpl'},
                                    {field: 'staNos', align: 'center', title: '出库站', merge: ['locNo'], templet: '#tbBasicTbStaNos'},
src/main/webapp/static/js/orderDetl/orderDetl.js
@@ -30,7 +30,7 @@
            ,{field: 'name', align: 'center',title: '名称'}
            ,{field: 'specs', align: 'center',title: '规格'}
            ,{field: 'model', align: 'center',title: '型号'}
            ,{field: 'batch', align: 'center',title: '批号'}
            ,{field: 'batch', align: 'center',title: '箱号'}
            ,{field: 'unit', align: 'center',title: '单位'}
            ,{field: 'barcode', align: 'center',title: '商品条码'}
            ,{field: 'supplier', align: 'center',title: '供应商'}
src/main/webapp/static/js/pack/pack.js
@@ -25,7 +25,7 @@
            // ,{field: 'id', align: 'center',title: 'ID'}
            ,{field: 'barcode',title: '条码'}
            ,{field: 'matnr', align: 'center',title: '商品编号', minWidth: 250, width: 250}
            ,{field: 'batch', align: 'center',title: '批号', hide: true}
            ,{field: 'batch', align: 'center',title: '箱号', hide: true}
            ,{field: 'settle$', align: 'center',title: '状态', templet: '#settleTpl',  minWidth: 160, width: 160}
            // ,{field: 'status$', align: 'center',title: '状态'}
            // ,{field: 'createTime$', align: 'center',title: '添加时间'}
src/main/webapp/static/js/pakStore/pakStore.js
@@ -4,7 +4,7 @@
function getCol() {
    var cols = [
        {fixed: 'left', field: 'anfme', title: '数量(必填)', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'},
        {field: 'batch', title: '批号(选填)', align: 'center', edit:'text', width: 200,  style:'color: block;font-weight: bold'}
        {field: 'batch', title: '箱号(选填)', align: 'center', edit:'text', width: 200,  style:'color: block;font-weight: bold'}
    ];
    cols.push.apply(cols, matCols);
    cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 80})
src/main/webapp/static/js/pakStore/stockAdjust.js
@@ -5,9 +5,9 @@
var matCodeLayerIdx;
function getCol() {
    var cols = [
        {fixed: 'left', field: 'count', title: '实际数量', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'}
        ,{field: 'anfme', align: 'center',title: '数量'}
        ,{field: 'batch', align: 'center',title: '批号(编辑)', edit: true, style: 'font-weight:bold'}
        // {fixed: 'left', field: 'count', title: '实际数量', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'},
        {field: 'anfme', align: 'center',title: '数量'}
        ,{field: 'batch', align: 'center',title: '箱号(编辑)', edit: true, style: 'font-weight:bold'}
    ];
    arrRemove(detlCols, "field", "anfme");
    arrRemove(detlCols, "field", "batch");
@@ -44,18 +44,18 @@
        let index = obj.tr.attr("data-index");
        let data = matCodeData[index];
        let modify = true;
        if (obj.field === 'count'){
            let vle = Number(obj.value);
            if (isNaN(vle)) {
                layer.msg("请输入数字", {icon: 2});
                modify = false;
            } else {
                if (vle <= 0) {
                    layer.msg("数量必须大于零", {icon: 2});
                    modify = false;
                }
            }
        }
        // if (obj.field === 'count'){
        //     let vle = Number(obj.value);
        //     if (isNaN(vle)) {
        //         layer.msg("请输入数字", {icon: 2});
        //         modify = false;
        //     } else {
        //         if (vle <= 0) {
        //             layer.msg("数量必须大于零", {icon: 2});
        //             modify = false;
        //         }
        //     }
        // }
        if (modify) {
            data[obj.field] = obj.value;
        }
src/main/webapp/static/js/pakStore/stockOut.js
@@ -2,8 +2,8 @@
var locDetlData = [];
function getCol() {
    var cols = [
        {field: 'count', align: 'center',title: '出库数量', edit:'text', width: 130,  style:'color: blue;font-weight: bold'}
        ,{field: 'anfme', align: 'center',title: '库存数量'}
        // {field: 'count', align: 'center',title: '出库数量', edit:'text', width: 130,  style:'color: blue;font-weight: bold'},
        {field: 'anfme', align: 'center',title: '木箱中铜箔数量'}
        ,{field: 'locNo$', align: 'center',title: '库位号'}
    ];
    arrRemove(detlCols,  'field', 'anfme');
@@ -41,22 +41,22 @@
        let index = obj.tr.attr("data-index");
        let data = locDetlData[index];
        let modify = true;
        if (obj.field === 'count'){
            let vle = Number(obj.value);
            if (isNaN(vle)) {
                layer.msg("请输入数字", {icon: 2});
                modify = false;
            } else {
                if (vle <= 0) {
                    layer.msg("数量必须大于零", {icon: 2});
                    modify = false;
                }
                if (vle > Number(data.anfme)) {
                    layer.msg("出库数量不得大于库存数量", {icon: 2});
                    modify = false;
                }
            }
        }
        // if (obj.field === 'count'){
        //     let vle = Number(obj.value);
        //     if (isNaN(vle)) {
        //         layer.msg("请输入数字", {icon: 2});
        //         modify = false;
        //     } else {
        //         if (vle <= 0) {
        //             layer.msg("数量必须大于零", {icon: 2});
        //             modify = false;
        //         }
        //         if (vle > Number(data.anfme)) {
        //             layer.msg("出库数量不得大于库存数量", {icon: 2});
        //             modify = false;
        //         }
        //     }
        // }
        if (modify) {
            data[obj.field] = obj.value;
        }
src/main/webapp/static/js/pakStore/stockOutOrder.js
@@ -2,8 +2,8 @@
var locDetlData = [];
function getCol() {
    var cols = [
        {field: 'count', align: 'center',title: '出库数量', edit:'text', width: 130,  style:'color: blue;font-weight: bold'},
        {field: 'anfme', align: 'center',title: '库存数量'}
        // {field: 'count', align: 'center',title: '出库数量', edit:'text', width: 130,  style:'color: blue;font-weight: bold'},
        {field: 'anfme', align: 'center',title: '木箱中铜箔数量'}
        ,{field: 'locNo$', align: 'center',title: '库位号'}
    ];
    arrRemove(detlCols,  'field', 'anfme');
@@ -41,22 +41,22 @@
        let index = obj.tr.attr("data-index");
        let data = locDetlData[index];
        let modify = true;
        if (obj.field === 'count'){
            let vle = Number(obj.value);
            if (isNaN(vle)) {
                layer.msg("请输入数字", {icon: 2});
                modify = false;
            } else {
                if (vle <= 0) {
                    layer.msg("数量必须大于零", {icon: 2});
                    modify = false;
                }
                if (vle > Number(data.anfme)) {
                    layer.msg("出库数量不得大于库存数量", {icon: 2});
                    modify = false;
                }
            }
        }
        // if (obj.field === 'count'){
        //     let vle = Number(obj.value);
        //     if (isNaN(vle)) {
        //         layer.msg("请输入数字", {icon: 2});
        //         modify = false;
        //     } else {
        //         if (vle <= 0) {
        //             layer.msg("数量必须大于零", {icon: 2});
        //             modify = false;
        //         }
        //         if (vle > Number(data.anfme)) {
        //             layer.msg("出库数量不得大于库存数量", {icon: 2});
        //             modify = false;
        //         }
        //     }
        // }
        if (modify) {
            data[obj.field] = obj.value;
        }
@@ -83,6 +83,8 @@
                    for (var i=0;i<locDetlData.length;i++){
                        locDetlData[i]["orderNo"]=orderNo
                    }
                    console.log(locDetlData)
                    console.log(locDetlData[0])
                    let param = {
                        orderNo: orderNo,
                        locDetls: locDetlData
src/main/webapp/static/js/saas/locDetl.js
@@ -5,7 +5,7 @@
        {field: 'matnr', align: 'center',title: '商品编号', sort:true}
        ,{field: 'maktx', align: 'center',title: '商品名称', sort:true}
        ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false}
        ,{field: 'batch', align: 'center',title: '批号', width: 300, sort:true , hide: true}
        ,{field: 'batch', align: 'center',title: '箱号', width: 300, sort:true , hide: true}
        ,{field: 'anfme', align: 'center',title: '数量'}
        ,{field: 'zpallet', align: 'center',title: '托盘条码', hide: true}
        ,{field: 'specs', align: 'center',title: '配置' , hide: true}
src/main/webapp/static/js/saas/stockAdjust.js
@@ -5,9 +5,9 @@
var matCodeLayerIdx;
function getCol() {
    var cols = [
        {fixed: 'left', field: 'count', title: '实际数量', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'}
        ,{field: 'anfme', align: 'center',title: '数量'}
        ,{field: 'batch', align: 'center',title: '批号(编辑)', edit: true, style: 'font-weight:bold'}
        // {fixed: 'left', field: 'count', title: '实际数量', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'},
        {field: 'anfme', align: 'center',title: '数量'}
        ,{field: 'batch', align: 'center',title: '箱号(编辑)', edit: true, style: 'font-weight:bold'}
    ];
    arrRemove(detlCols, "field", "anfme");
    arrRemove(detlCols, "field", "batch");
@@ -44,18 +44,18 @@
        let index = obj.tr.attr("data-index");
        let data = matCodeData[index];
        let modify = true;
        if (obj.field === 'count'){
            let vle = Number(obj.value);
            if (isNaN(vle)) {
                layer.msg("请输入数字", {icon: 2});
                modify = false;
            } else {
                if (vle <= 0) {
                    layer.msg("数量必须大于零", {icon: 2});
                    modify = false;
                }
            }
        }
        // if (obj.field === 'count'){
        //     let vle = Number(obj.value);
        //     if (isNaN(vle)) {
        //         layer.msg("请输入数字", {icon: 2});
        //         modify = false;
        //     } else {
        //         if (vle <= 0) {
        //             layer.msg("数量必须大于零", {icon: 2});
        //             modify = false;
        //         }
        //     }
        // }
        if (modify) {
            data[obj.field] = obj.value;
        }
src/main/webapp/views/order/order.html
@@ -79,8 +79,8 @@
                        <button class="layui-btn icon-btn" lay-filter="tbSearch" lay-submit>
                            <i class="layui-icon">&#xe615;</i>搜索
                        </button>
                        <button id="orderAddBtn" class="layui-btn icon-btn btn-add"><i class="layui-icon">&#xe654;</i>添加
                        </button>
<!--                        <button id="orderAddBtn" class="layui-btn icon-btn btn-add"><i class="layui-icon">&#xe654;</i>添加-->
<!--                        </button>-->
                    </div>
                </div>
            </div>
@@ -97,7 +97,7 @@
<!-- 表格操作列 -->
<script type="text/html" id="operate">
    {{# if (d.settle == 0 || d.settle == 1) { }}
        <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a>
<!--        <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a>-->
        <a class="layui-btn layui-btn-danger layui-btn-xs btn-delete" lay-event="del">删除</a>
    {{# } }}
    {{# if (d.settle == 2) { }}
@@ -256,31 +256,24 @@
                        </div>
                        <table class="layui-table" lay-skin="nob" style="width: 80%">
                            <tbody>
                            {{#  layui.each(item.wrkDetls, function(idx, wrkDetl){ }}
                            <thead>
                            <tr style="background: none">
                                <td>No.</td>
                                <td>商品编号</td>
                                <!--                                <td>规格</td>-->
                                <td>箱号</td>
<!--                                <td>箱子类型</td>-->
                                <td>是否确认</td>
                            </tr>
                            </thead>
                            <tbody>
                            {{#  layui.each(item.wrkDetls, function(idx, wrkDetl){ }}
                            <tr>
                                <td><span class="layui-badge layui-bg-cyan">{{ idx+1 }}</span></td>
                            </tr>
                            <tr style="background: none">
                                <td>品号:</td>
                                <td>{{ wrkDetl.matnr }}</td>
                            </tr>
                            <tr style="background: none">
                                <td>品名:</td>
                                <td>{{ wrkDetl.maktx }}</td>
                            </tr>
                            <tr style="background: none">
                                <td>规格:</td>
                                <td>{{ wrkDetl.specs }}</td>
                            </tr>
                            <tr style="background: none">
                                <td>数量:</td>
                                <td style="font-weight: bold">{{ wrkDetl.anfme }}</td>
                            </tr>
                            <tr style="background: none">
                                <td>条码:</td>
                                <td style="font-weight: bold">{{ wrkDetl.zpallet }}</td>
                                <!--                                <td>{{ wrkDetl.specs }}</td>-->
                                <td style="font-weight: bold">{{ wrkDetl.batch }}</td>
                                <td style="font-weight: bold">{{ wrkDetl.source$ }}</td>
                            </tr>
                            {{#  }); }}
                            </tbody>