| | |
| | | private Integer deadWarn; |
| | | |
| | | /** |
| | | * 制购 1: 制造 2: 采购 3: 外协 |
| | | * 制购 1: 制造 2: 采购 3: 外协 、、江铜:是否确认 1: 确认 2: 未确认 |
| | | */ |
| | | @ApiModelProperty(value= "制购 1: 制造 2: 采购 3: 外协 ") |
| | | private Integer source; |
| | |
| | | } |
| | | } |
| | | |
| | | // 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 "未确认"; |
| | | } |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | private Integer beBatch; |
| | | |
| | | /** |
| | | * 保质期 |
| | | * 保质期 、、江铜:是否确认 1: 确认 2: 未确认 |
| | | */ |
| | | @ApiModelProperty(value= "保质期") |
| | | @TableField("dead_time") |
| | |
| | | private Integer deadWarn; |
| | | |
| | | /** |
| | | * 制购 1: 制造 2: 采购 3: 外协 |
| | | * 制购 1: 制造 2: 采购 3: 外协 、、江铜:是否确认 1: 确认 2: 未确认 |
| | | */ |
| | | @ApiModelProperty(value= "制购 1: 制造 2: 采购 3: 外协 ") |
| | | private Integer source; |
| | |
| | | } |
| | | } |
| | | |
| | | // 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 "未确认"; |
| | | } |
| | | } |
| | | |
| | |
| | | // 木箱中铜箔数量 |
| | | private Double count; |
| | | |
| | | public void setAnfme(Double anfme){ |
| | | this.anfme=anfme; |
| | | this.count=anfme; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | 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()) { |
| | |
| | | null, // 发货时间 |
| | | null, // 物流名称 |
| | | null, // 物流单号 |
| | | 1L, // 订单状态 |
| | | 2L, // 订单状态 |
| | | 1, // 状态 |
| | | userId, // 添加人员 |
| | | now, // 添加时间 |
| | |
| | | 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); |
| | |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | | } |
| | | |
| | | List<StockOutParam> stockOutParams = OutboundAllocationUtil.OutboundClassification(param); |
| | | for (StockOutParam stockOutParam : stockOutParams){ |
| | | startupFullTakeStore(stockOutParam,userId); |
| | | } |
| | | |
| | | } else { |
| | | throw new CoolException("订单号重复,订单"+param.getOrderNo()+"已存在!!!"); |
| | | } |
| | |
| | | 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(); |
| | |
| | | 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()) { |
| | |
| | | // 更新订单完成数量 |
| | | 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)){ |
| | |
| | | // 更新订单完成数量 |
| | | 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)){ |
| | |
| | | } |
| | | |
| | | 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) { |
New file |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | |
| | | 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() { |
| | |
| | | public void setCount(Double count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public String getOrderNo() { |
| | | return orderNo; |
| | | } |
| | | |
| | | public void setOrderNo(String orderNo) { |
| | | this.orderNo = orderNo; |
| | | } |
| | | } |
| | |
| | | </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> |
| | |
| | | {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: '原重量'} |
| | |
| | | {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} |
| | |
| | | {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} |
| | |
| | | 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") |
| | |
| | | {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: '配置'} |
| | |
| | | layer.open({ |
| | | type: 1, |
| | | title: false, |
| | | area: '820px', |
| | | area: '1020px', |
| | | offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'], |
| | | shade: .01, |
| | | shadeClose: true, |
| | |
| | | {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) { |
| | |
| | | // }, |
| | | // {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', |
| | |
| | | {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}, |
| | |
| | | }, |
| | | 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); |
| | | // 赋值 |
| | |
| | | ,{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'} |
| | |
| | | // {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'}, |
| | |
| | | ,{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: '供应商'} |
| | |
| | | // ,{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: '添加时间'} |
| | |
| | | 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}) |
| | |
| | | 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"); |
| | |
| | | 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; |
| | | } |
| | |
| | | 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'); |
| | |
| | | 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; |
| | | } |
| | |
| | | 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'); |
| | |
| | | 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; |
| | | } |
| | |
| | | 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 |
| | |
| | | {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} |
| | |
| | | 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"); |
| | |
| | | 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; |
| | | } |
| | |
| | | <button class="layui-btn icon-btn" lay-filter="tbSearch" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button id="orderAddBtn" class="layui-btn icon-btn btn-add"><i class="layui-icon"></i>添加 |
| | | </button> |
| | | <!-- <button id="orderAddBtn" class="layui-btn icon-btn btn-add"><i class="layui-icon"></i>添加--> |
| | | <!-- </button>--> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <!-- 表格操作列 --> |
| | | <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) { }} |
| | |
| | | </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> |