Merge remote-tracking branch 'origin/ghjtasrs' into ghjtasrs
| | |
| | | return R.ok(param); |
| | | } |
| | | |
| | | /** |
| | | * 计划组货单 |
| | | */ |
| | | @PostMapping("/groupOrderConfirm/auth/v1") |
| | | @AppAuth(memo = "计划单据下发") |
| | | public synchronized R groupOrderConfirm(@RequestHeader(required = false) String appkey, |
| | | @RequestBody GroupOrderConfirmParam param, |
| | | HttpServletRequest request) { |
| | | // auth(appkey, param, request); |
| | | openService.groupOrderConfirm(param); |
| | | return R.ok(param); |
| | | } |
| | | |
| | | /*...........................上饶江铜..............以上.............徐工汉云...........................*/ |
| | | |
| | | } |
| | |
| | | if (!Cools.isEmpty(orderNo)) { |
| | | wrapper.like("order_no", orderNo); |
| | | } |
| | | wrapper.le("settle", 2).eq("status", 1); |
| | | wrapper.le("settle", 2).eq("status", 1).ne("doc_type",25); |
| | | wrapper.orderBy("create_time", false); |
| | | List<Order> orders = orderService.selectList(wrapper); |
| | | // 保留出库单 |
| | |
| | | return R.ok().add(orders); |
| | | } |
| | | |
| | | @RequestMapping(value = "/order/nav/listMes/auth") |
| | | @ManagerAuth |
| | | public R navListMes(@RequestParam(required = false) String orderNo){ |
| | | EntityWrapper<Order> wrapper = new EntityWrapper<>(); |
| | | if (!Cools.isEmpty(orderNo)) { |
| | | wrapper.like("order_no", orderNo); |
| | | } |
| | | wrapper.le("settle", 2).eq("status", 0).eq("doc_type", 25); |
| | | wrapper.orderBy("create_time", false); |
| | | List<Order> orders = orderService.selectList(wrapper); |
| | | // // 保留出库单 |
| | | // if (!Cools.isEmpty(orders)) { |
| | | // Iterator<Order> iterator = orders.iterator(); |
| | | // while (iterator.hasNext()) { |
| | | // Order order = iterator.next(); |
| | | // if (order.getDocType() != null) { |
| | | // DocType docType = docTypeService.selectById(order.getDocType()); |
| | | // if (docType != null) { |
| | | // if (docType.getPakout() == 0) { |
| | | // iterator.remove(); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | return R.ok().add(orders); |
| | | } |
| | | |
| | | @RequestMapping(value = "/order/head/page/auth") |
| | | @ManagerAuth |
| | | public R head(@RequestParam(defaultValue = "1")Integer curr, |
| | |
| | | import com.core.common.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.PakoutRequest; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.model.LocDetlDto; |
| | |
| | | Thread.sleep(200); |
| | | return R.ok().add(orderDetlService.selectByOrderId(orderId).stream().map(OrderDetl::getId).distinct().collect(Collectors.toList())); |
| | | } |
| | | |
| | | @PostMapping("/getMesOrder/auth") |
| | | @ManagerAuth |
| | | public R getMesOrder() { |
| | | List<String> orderNoList = orderService.getOrderNosByDocType(25L); |
| | | return R.ok().add(orderNoList); |
| | | } |
| | | @PostMapping("/out/pakout/preview/auth") |
| | | @ManagerAuth |
| | | public R pakoutPreview(@RequestBody List<Long> ids) { |
| | |
| | | |
| | | @PostMapping("/out/pakout/auth") |
| | | @ManagerAuth(memo = "订单出库") |
| | | public synchronized R pakout(@RequestBody List<LocDto> locDtos) throws InterruptedException { |
| | | public synchronized R pakout(@RequestBody PakoutRequest request) throws InterruptedException { |
| | | List<LocDto> locDtos = request.getTableCache(); |
| | | String optionValue = request.getOptionValue(); |
| | | if (Cools.isEmpty(locDtos)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | |
| | | workService.stockOut(staNo, locDetlDtos, |
| | | order.getDocType() != null && order.getDocType() == 23 |
| | | ? IoWorkType.CHECK_OUT : null, |
| | | getUserId()); |
| | | getUserId(),optionValue); |
| | | } else { |
| | | throw new CoolException("所选库位状态不为F/D,库位号:" + |
| | | locMast.getLocNo() + ",当前状态:" + |
New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class GroupOrderConfirmParam { |
| | | private String groupOrderNumber; //组货单号 |
| | | private String groupStatus; //组货状态:0未确认组货、1确认组货 |
| | | private List<PackageGroupNo> packageGroupNos; // 多个包装组号 |
| | | private List<VolumeNumber> volumeNumbers; // 多个包装组号 |
| | | |
| | | @Data |
| | | public static class PackageGroupNo { |
| | | private String packageGroupNo; |
| | | } |
| | | |
| | | @Data |
| | | public static class VolumeNumber { |
| | | private String volumeNumber; |
| | | } |
| | | } |
| | |
| | | private List<MatList> matList; // 木箱集合 |
| | | //1一厂平库 2 一厂立库 3二厂平库 4二厂立库 |
| | | private Integer warehouseType ; |
| | | private String groupOrderNumber; //组货单号 |
| | | |
| | | @Data |
| | | public static class MatList{ |
| | | private String boxPos; // 箱子位置 |
New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import com.zy.common.model.LocDto; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class PakoutRequest { |
| | | private List<LocDto> tableCache; |
| | | private String optionValue; |
| | | } |
| | |
| | | List<String> selectDetlList(@Param("orderNo") String orderNo); |
| | | |
| | | List<OrderDetl> selectByBrand(@Param("brand") String brand); |
| | | |
| | | OrderDetl selectByOrderNoAndPkgGroupNoAndVolumeNo(@Param("orderNo") String orderNo,@Param("brand") String brand,@Param("model") String model); |
| | | } |
| | |
| | | * 获取未完成订单统计信息(orderNo为空则查询所有) |
| | | */ |
| | | List<OrderStatisticsDto> getUnfulfilledOrders(@Param("orderNo") String orderNo); |
| | | |
| | | Order selectOrderByOrderNo(@Param("orderNo") String orderNo); |
| | | |
| | | List<String> getOrderNosByDocType(@Param("docType")Long docType); |
| | | } |
| | |
| | | |
| | | void updateBarcode(); |
| | | |
| | | R groupOrderConfirm(GroupOrderConfirmParam param); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | List<Order> selectorderNoL(String orderNo); |
| | | |
| | | List<String> getOrderNosByDocType(Long docType); |
| | | |
| | | } |
| | |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.model.TaskDto; |
| | | import com.zy.common.model.enums.IoWorkType; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | void startupFullTakeStoreOrder(StockOutParam param, Long userId); |
| | | |
| | | @Transactional |
| | | void stockOut(BasDevp staNo, List<LocDetlDto> locDetlDtos, IoWorkType ioWorkType, Long userId); |
| | | |
| | | /** |
| | | * 出库作业 |
| | | * @param staNo 目标站点 |
| | | * @param locDetls 待出库物料 |
| | | * @param ioType 入出库类型 |
| | | */ |
| | | void stockOut(BasDevp staNo, List<LocDetlDto> locDetls, IoWorkType ioWorkType, Long userId); |
| | | void stockOut(BasDevp staNo, List<LocDetlDto> locDetls, IoWorkType ioWorkType, Long userId,String groupOrderNumber); |
| | | |
| | | void stockOut(BasDevp staNo, TaskDto taskDto, Long userId); |
| | | |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | |
| | | |
| | | @Resource |
| | | private OrderMapper orderMapper; |
| | | |
| | | @Resource |
| | | private OrderDetlMapper orderDetlMapper; |
| | | |
| | | @Resource |
| | | private BasCrnpMapper basCrnpMapper; |
| | |
| | | gwmsGenerateInventoryDto.setWarehouseType(4); |
| | | gwmsGenerateInventoryDto.setBarcode(wrkMast.getBarcode()); |
| | | gwmsGenerateInventoryDto.setPalletizingNo(wrkMast.getStaNo()); |
| | | gwmsGenerateInventoryDto.setGroupOrderNumber(wrkMast.getMemo()); |
| | | List<GwmsGenerateInventoryDto.MatList> matLists = new ArrayList<>(); |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | | boolean flag = true; |
| | |
| | | return crnStn; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public R groupOrderConfirm(GroupOrderConfirmParam param) { |
| | | // 1. 查询单据是否存在 |
| | | Order order = orderMapper.selectOrderByOrderNo(param.getGroupOrderNumber()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | if (order == null) { |
| | | // 1.1 不存在,新建单据 |
| | | order = new Order(); |
| | | order.setOrderNo(param.getGroupOrderNumber()); |
| | | order.setStatus(Integer.valueOf(param.getGroupStatus())); |
| | | order.setOrderTime(sdf.format(new Date())); |
| | | order.setCreateTime(new Date()); |
| | | order.setSettle(1L); |
| | | order.setDocType(25L); |
| | | orderMapper.insert(order); |
| | | } else { |
| | | // 1.2 存在,更新单据状态 |
| | | order.setStatus(Integer.valueOf(param.getGroupStatus())); |
| | | orderMapper.updateById(order); |
| | | } |
| | | |
| | | // 2. 一一对应遍历 |
| | | List<GroupOrderConfirmParam.PackageGroupNo> pkgList = param.getPackageGroupNos(); |
| | | List<GroupOrderConfirmParam.VolumeNumber> volList = param.getVolumeNumbers(); |
| | | |
| | | int size = Math.min(pkgList.size(), volList.size()); // 防止越界 |
| | | for (int i = 0; i < size; i++) { |
| | | GroupOrderConfirmParam.PackageGroupNo pg = pkgList.get(i); |
| | | GroupOrderConfirmParam.VolumeNumber vn = volList.get(i); |
| | | |
| | | // 查询是否已存在该 detl |
| | | OrderDetl detl = orderDetlMapper.selectByOrderNoAndPkgGroupNoAndVolumeNo( |
| | | param.getGroupOrderNumber(), pg.getPackageGroupNo(), vn.getVolumeNumber() |
| | | ); |
| | | |
| | | if (detl == null) { |
| | | detl = new OrderDetl(); |
| | | detl.setOrderId(order.getId()); |
| | | detl.setOrderNo(param.getGroupOrderNumber()); |
| | | detl.setCreateTime(new Date()); |
| | | detl.setAnfme(1.0); |
| | | detl.setBrand(pg.getPackageGroupNo()); // 包装组号 |
| | | detl.setModel(vn.getVolumeNumber()); // 卷号 |
| | | orderDetlMapper.insert(detl); |
| | | } |
| | | } |
| | | |
| | | return R.ok("组货确认成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /*...........................上饶江铜..............以上.............徐工汉云...........................*/ |
| | | } |
| | |
| | | return this.baseMapper.selectorderNoL(orderNo); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getOrderNosByDocType(Long docType){ |
| | | return this.baseMapper.getOrderNosByDocType(docType); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional |
| | | @Override |
| | | public void stockOut(BasDevp staNo, List<LocDetlDto> locDetlDtos, IoWorkType ioWorkType, Long userId) { |
| | | Date now = new Date(); |
| | | // 合并同类项 |
| | |
| | | wrkMast.setEmptyMk("N"); // 空板 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setSheetNo("0"); |
| | | // wrkMast.setMemo(groupOrderNumber); |
| | | if (staDesc.getStnNo()<118 || staDesc.getStnNo()>121){ |
| | | wrkMast.setSheetNo("3"); |
| | | } |
| | | wrkMast.setBarcode(locMast.getBarcode()); |
| | | wrkMast.setAppeUser(userId); // 操作人员数据 |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | throw new CoolException("保存工作档失败,出库库位号:"+dto.getLocNo()); |
| | | } |
| | | // 生成工作档明细 |
| | | for (LocDetlDto detlDto : dto.getLocDetlDtos()) { |
| | | if (detlDto.getCount()==null || detlDto.getCount() <= 0.0D) {continue;} |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | List<OrderDetl> orderDetl = orderDetlService.selectByBrand(detlDto.getLocDetl().getBrand()); |
| | | wrkDetl.sync(detlDto.getLocDetl()); |
| | | for (OrderDetl orderDetlDto : orderDetl) { |
| | | if(orderDetlDto.getSupp() != null){ |
| | | wrkDetl.setSupp(orderDetlDto.getSupp()); |
| | | } |
| | | if(orderDetlDto.getMemo() != null){ |
| | | wrkDetl.setMemo(orderDetlDto.getMemo()); |
| | | } |
| | | } |
| | | wrkDetl.setOrderNo(detlDto.getOrderNo()); // 手动出库不需要带出库存中的单据编号 |
| | | wrkDetl.setWrkNo(workNo); |
| | | wrkDetl.setIoTime(now); |
| | | Double anfme = ioType==101?detlDto.getLocDetl().getAnfme():detlDto.getCount(); |
| | | wrkDetl.setAnfme(anfme); // 数量 |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setModiTime(now); |
| | | wrkDetl.setModiUser(userId); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | | // 修改订单明细 |
| | | orderDetlMapper.updateOrderDetlByGroupNo(detlDto.getOrderNo(), detlDto.getLocDetl().getBrand(), 1); |
| | | // 修改订单状态 |
| | | orderMapper.updateSettleByOrderNo(detlDto.getOrderNo(),2L, userId); |
| | | } |
| | | |
| | | // 修改库位状态: F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中 |
| | | locMast = locMastService.selectById(dto.getLocNo()); |
| | | if (locMast.getLocSts().equals("F")) { |
| | | locMast.setLocSts(ioType==101?"R":"P"); |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("预约库位状态失败,库位号:"+dto.getLocNo()); |
| | | } |
| | | } else { |
| | | throw new CoolException(dto.getLocNo() + "库位不是在库状态"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void stockOut(BasDevp staNo, List<LocDetlDto> locDetlDtos, IoWorkType ioWorkType, Long userId,String groupOrderNumber) { |
| | | Date now = new Date(); |
| | | // 合并同类项 |
| | | Set<String> locNos = new HashSet<>(); |
| | | List<OutLocDto> dtos = new ArrayList<>(); |
| | | for (LocDetlDto locDetlDto : locDetlDtos) { |
| | | String locNo = locDetlDto.getLocDetl().getLocNo(); |
| | | if (locNos.contains(locNo)) { |
| | | for (OutLocDto dto : dtos) { |
| | | if (dto.getLocNo().equals(locNo)) { |
| | | dto.getLocDetlDtos().add(locDetlDto); |
| | | break; |
| | | } |
| | | } |
| | | } else { |
| | | locNos.add(locNo); |
| | | dtos.add(new OutLocDto(locNo, locDetlDto)); |
| | | } |
| | | } |
| | | Integer ioType = null; |
| | | // 生成工作档 |
| | | for (OutLocDto dto : dtos) { |
| | | // 判断入出库类型:101.全板出库 or 103.拣料出库 |
| | | if (ioWorkType == null) { |
| | | ioType = dto.isAll() ? 101 : 103; |
| | | } else if (ioWorkType.equals(IoWorkType.CHECK_OUT)) { |
| | | ioType = 107; |
| | | } |
| | | assert ioType != null; |
| | | // 获取库位 |
| | | LocMast locMast = locMastService.selectById(dto.getLocNo()); |
| | | |
| | | Integer outSta = staNo.getDevNo(); |
| | | // //2号堆垛机全板出库站指定为204站,拣料站指定为202 |
| | | // if(locMast.getCrnNo()==2){ |
| | | // outSta = ioType == 101 ? 204 : 202; |
| | | // } |
| | | |
| | | // 获取路径 |
| | | StaDesc staDesc = staDescService.queryCrnStn(ioType, locMast.getCrnNo(), outSta); |
| | | // 生成工作号 |
| | | int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(ioType)); |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(now); |
| | | wrkMast.setWrkSts(11L); // 工作状态:11.生成出库ID |
| | | wrkMast.setIoType(ioType); // 入出库状态 |
| | | wrkMast.setIoPri(13D); // 优先级:13 |
| | | wrkMast.setCrnNo(locMast.getCrnNo()); |
| | | wrkMast.setSourceStaNo(staDesc.getCrnStn()); // 源站 |
| | | wrkMast.setStaNo(staDesc.getStnNo()); // 目标站 |
| | | wrkMast.setSourceLocNo(dto.getLocNo()); // 源库位 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk("N"); // 空板 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setSheetNo("0"); |
| | | wrkMast.setMemo(groupOrderNumber); |
| | | if (staDesc.getStnNo()<118 || staDesc.getStnNo()>121){ |
| | | wrkMast.setSheetNo("3"); |
| | | } |
| | |
| | | <select id="getPakoutPage" resultMap="BaseResultMap"> |
| | | select * from |
| | | ( |
| | | select |
| | | ROW_NUMBER() over (order by mo.create_time desc) as row, |
| | | mod.* |
| | | from man_order_detl mod |
| | | inner join man_order mo on mod.order_id = mo.id |
| | | inner join man_doc_type mdt on mo.doc_type = mdt.doc_id |
| | | where 1=1 |
| | | and mo.settle <= 2 |
| | | and mo.status = 1 |
| | | and mdt.pakout = 1 |
| | | <include refid="pakOutPageCondition"></include> |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | select |
| | | ROW_NUMBER() over (order by mo.create_time desc) as row, |
| | | mod.* |
| | | from man_order_detl mod |
| | | inner join man_order mo on mod.order_id = mo.id |
| | | inner join man_doc_type mdt on mo.doc_type = mdt.doc_id |
| | | where 1=1 |
| | | and mo.settle <= 2 |
| | | and mo.status = |
| | | case when mo.doc_type = 25 then 0 else 1 end |
| | | and mdt.pakout = 1 |
| | | <include refid="pakOutPageCondition"></include> |
| | | ) t |
| | | where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | |
| | | |
| | | <select id="getPakoutPageCount" parameterType="java.util.Map" resultType="java.lang.Integer"> |
| | | select |
| | |
| | | where brand = #{brand} |
| | | </select> |
| | | |
| | | <select id="selectByOrderNoAndPkgGroupNoAndVolumeNo" resultMap="BaseResultMap"> |
| | | select * |
| | | from man_order_detl |
| | | where order_no = #{orderNo} |
| | | and brand = #{brand} |
| | | and model = #{model} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | GROUP BY |
| | | mo.order_no |
| | | </select> |
| | | <select id="selectOrderByOrderNo" resultMap="BaseResultMap"> |
| | | select * |
| | | from man_order |
| | | where order_no = #{orderNo} |
| | | </select> |
| | | <select id="getOrderNosByDocType" resultType="String"> |
| | | select order_no |
| | | from man_order |
| | | where doc_type =#{docType} |
| | | and status = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | // ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | | ,{field: 'updateBy$', align: 'center',title: '修改人员', hide: true} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间', hide: true} |
| | | ,{field: 'memo', align: 'center',title: '备注', hide: true} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | ] |
| | | |
| | | var detlCols = [ |
| | |
| | | } |
| | | |
| | | } |
| | | ,yes: function(index, layero){ |
| | | //按钮【立即出库】的回调 |
| | | pakout(tableCache, index); |
| | | ,yes: function(layerIndex, layero){ |
| | | // 立即出库按钮点击 → 先请求下拉列表 |
| | | let loadIndex = layer.load(10); |
| | | $.ajax({ |
| | | url: baseUrl + "/getMesOrder/auth", // 你提供的接口 |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function(res){ |
| | | layer.close(loadIndex); |
| | | if(res.code === 200){ |
| | | // 弹出二次确认框 |
| | | layer.open({ |
| | | type: 1, |
| | | title: '请选择组货单号', |
| | | area: ['400px','200px'], |
| | | content: $('#staBatchSelectDialog').html(), |
| | | success: function(layero2, index2){ |
| | | // 渲染下拉框 |
| | | let select = $(layero2).find('#batchSelectStaBox'); |
| | | select.empty().append(`<option value="">请选择组货单号</option>`); // 保持默认空 |
| | | res.data.forEach(item => { |
| | | select.append(`<option value="${item}">${item}</option>`); |
| | | }); |
| | | layui.form.render('select'); // 重新渲染下拉框 |
| | | |
| | | |
| | | // 确认按钮 |
| | | form.on('submit(staBatchSelectConfirm)', function(obj){ |
| | | let selectedValue = obj.field.batchSta; |
| | | console.log(selectedValue) |
| | | layer.close(index2); |
| | | // 调用原来的出库函数,同时传下拉值 |
| | | pakout(tableCache, layerIndex, selectedValue); |
| | | return false; |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | ,btn2: function(index, layero){ |
| | | //按钮【稍后处理】的回调 |
| | | layer.close(index) |
| | |
| | | }) |
| | | } |
| | | |
| | | function pakout(tableCache, layerIndex) { |
| | | // let loadIndex = layer.load(2); |
| | | function pakout(tableCache, layerIndex, optionValue) { |
| | | // 可以把 optionValue 传给接口 |
| | | notice.msg('正在生成出库任务......', {icon: 4}); |
| | | $.ajax({ |
| | | url: baseUrl + "/out/pakout/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | data: JSON.stringify(tableCache), |
| | | data: JSON.stringify({tableCache,optionValue}), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | notice.destroy(); |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /* 删除订单 */ |
| | | function doDelSensor(obj) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
New file |
| | |
| | | var pageCurr; |
| | | var insTb2; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).extend({ |
| | | notice: 'notice/notice', |
| | | }).use(['table','laydate', 'form', 'util', 'admin', 'notice', 'treeTable', 'xmSelect', 'tableMerge', 'tableX'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | var util = layui.util; |
| | | var notice = layui.notice; |
| | | var treeTable = layui.treeTable; |
| | | var xmSelect = layui.xmSelect; |
| | | var tableMerge = layui.tableMerge; |
| | | var tableX = layui.tableX; |
| | | |
| | | insTb2 = table.render({ |
| | | elem: '#orderDetlTable', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/orderDetl/pakout/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#orderDetToolbar', |
| | | height: 'full-120', |
| | | where: {order_id: 9999999999}, |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{type: 'numbers', title: '#'} |
| | | ,{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: 'specs', align: 'center',title: '接头'} |
| | | // ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'brand', align: 'center',title: '包装组号'} |
| | | ,{field: 'model', align: 'center',title: '卷号'} |
| | | |
| | | // ,{field: 'supp', align: 'center',title: '客户名称', hide: false} |
| | | // ,{field: 'memo', align: 'center',title: '备注', hide: false} |
| | | // ,{field: 'qty', align: 'center',title: '作业数量', style: 'font-weight: bold'} |
| | | // ,{field: 'enableQty', align: 'center',title: '待出数量', style: 'font-weight: bold'} |
| | | // ,{field: 'finishStatus', align: 'center', title: '是否完成', templet: function(d){ |
| | | // if (d.qty === 0 && d.enableQty === 0) { |
| | | // return '<span style="color:green;font-weight:bold;">完成</span>'; |
| | | // } else { |
| | | // return '<span style="color:red;">未完成</span>'; |
| | | // } |
| | | // }} |
| | | |
| | | |
| | | // ,{field: 'name', align: 'center',title: '名称'} |
| | | // ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | | // ,{field: 'barcode', align: 'center',title: '商品条码', hide: true} |
| | | // ,{field: 'supplier', align: 'center',title: '供应商'} |
| | | // ,{field: 'unitPrice', align: 'center',title: '单价'} |
| | | // ,{field: 'itemNum', align: 'center',title: '品项数'} |
| | | // ,{field: 'count', align: 'center',title: '数量'} |
| | | // ,{field: 'weight', align: 'center',title: '重量'} |
| | | // ,{field: 'status$', align: 'center',title: '状态'} |
| | | // ,{field: 'createBy$', align: 'center',title: '添加人员'} |
| | | // ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | | // ,{field: 'updateBy$', align: 'center',title: '修改人员'} |
| | | // ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | // ,{field: 'memo', align: 'center',title: '备注'} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 160} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | /* 表格2搜索 */ |
| | | form.on('submit(sensorTbSearch)', function (data) { |
| | | insTb2.reload({where: data.field, page: {curr: 1}}); |
| | | return false; |
| | | }); |
| | | |
| | | /* 表格2头工具栏点击事件 */ |
| | | table.on('toolbar(orderDetlTable)', function (obj) { |
| | | |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | if (obj.event === 'pakoutPreview') { // 添加 |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择至少一条出库明细', {icon: 2}); |
| | | return; |
| | | } |
| | | pakoutPreview(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | } else if (obj.event === 'del') { // 删除 |
| | | var checkRows = table.checkStatus('sensorTable'); |
| | | if (checkRows.data.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | var ids = checkRows.data.map(function (d) { |
| | | return d.id; |
| | | }); |
| | | doDelSensor({ids: ids}); |
| | | } |
| | | }); |
| | | |
| | | /* 表格2工具条点击事件 */ |
| | | table.on('tool(orderDetlTable)', function (obj) { |
| | | console.log(obj); |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 出库 |
| | | case 'pakoutPreview': |
| | | pakoutPreview([data.id]) |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | function pakoutPreview(ids) { |
| | | let loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl + "/out/pakout/preview/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | data: JSON.stringify(ids), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | var tableCache; |
| | | if (res.code === 200){ |
| | | layer.open({ |
| | | type: 1 |
| | | ,title: false |
| | | ,closeBtn: false |
| | | ,offset: '50px' |
| | | ,area: ['1500px', '700px'] |
| | | ,shade: 0.5 |
| | | ,shadeClose: false |
| | | ,btn: ['立即出库', '稍后处理'] |
| | | ,btnAlign: 'c' |
| | | ,moveType: 1 //拖拽模式,0或者1 |
| | | ,content: $('#pakoutPreviewBox').html() |
| | | ,success: function(layero, index){ |
| | | stoPreTabIdx = table.render({ |
| | | elem: '#stoPreTab', |
| | | data: res.data, |
| | | height: 520, |
| | | page: false, |
| | | limit: Number.MAX_VALUE, |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {field: 'orderNo', title: '单据编号', merge: true, align: 'center'}, |
| | | // {type: 'checkbox', merge: ['brand'],width: 100}, |
| | | // {field: 'title', title: '商品', merge: true, align: 'center', width: 350}, |
| | | {field: 'unit', title: '箱号', align: 'center',hide:false}, |
| | | {field: 'model', title: '卷号', align: 'center', hide: false}, |
| | | { |
| | | field: 'threeCode', |
| | | align: 'center', |
| | | title: '合格否', |
| | | hide: false, |
| | | templet: function(d) { |
| | | return d.threeCode ? d.threeCode : '待判'; |
| | | } |
| | | }, |
| | | // {field: 'specs', title: '接头', align: 'center'}, |
| | | {field: 'brand', align: 'center',title: '包装组号', merge: true, hide: false}, |
| | | // {field: 'brand$', align: 'center',title: '木箱类型', hide: false}, |
| | | // {field: 'zpallet', title: '托盘码', align: 'center'}, |
| | | // {field: 'anfme', title: '数量', align: 'center', width: 90, style: 'font-weight: bold'}, |
| | | // {field: 'count', 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'}, |
| | | // {type: 'checkbox', merge: ['locNo']}, |
| | | ]], |
| | | done: function (res) { |
| | | tableMerge.render(this); |
| | | $('.layui-table-body.layui-table-main').css("overflow", "auto"); |
| | | tableCache = tableData = table.cache.stoPreTab; |
| | | } |
| | | }); |
| | | // 修改出库站 |
| | | form.on('select(tbBasicTbStaNos)', function (obj) { |
| | | let index = obj.othis.parents('tr').attr("data-index"); |
| | | let data = tableCache[index]; |
| | | for (let i = 0; i<tableCache.length; i++) { |
| | | if (tableCache[i].locNo === data.locNo) { |
| | | tableCache[i]['staNo'] = Number(obj.elem.value); |
| | | } |
| | | } |
| | | obj.othis.children().find("input").css("color", "blue"); |
| | | return false; |
| | | }); |
| | | // 批量修改出库站 |
| | | form.on('submit(batchModifySta)', function () { |
| | | let stoPreTabData = layui.table.checkStatus('stoPreTab').data; |
| | | if (stoPreTabData.length < 1) { |
| | | layer.msg("请至少选择一条以上合并数据", {icon: 7}); |
| | | return false; |
| | | } |
| | | modifySta(stoPreTabData); |
| | | }); |
| | | form.on('submit(checkModifySta)', function () { |
| | | if (!tableCache || tableCache.length === 0) { |
| | | layer.msg("没有可处理的数据", {icon: 7}); |
| | | return false; |
| | | } |
| | | |
| | | let updatedRows = []; |
| | | |
| | | for (let i = 0; i < tableCache.length; i++) { |
| | | let row = tableCache[i]; |
| | | let locNo = row.locNo; |
| | | if (!locNo || locNo.length < 2) continue; |
| | | |
| | | let rowPrefix = parseInt(locNo.substring(0, 2), 10); |
| | | let newStaNo; |
| | | |
| | | if (rowPrefix >= 17 && rowPrefix <= 24) { |
| | | newStaNo = 3092; |
| | | } else if (rowPrefix >= 9 && rowPrefix <= 16) { |
| | | newStaNo = 3102; |
| | | } else if (rowPrefix >= 1 && rowPrefix <= 8) { |
| | | newStaNo = 3095; |
| | | } |
| | | |
| | | if (newStaNo) { |
| | | row.staNo = newStaNo; |
| | | updatedRows.push({index: i, staNo: newStaNo}); |
| | | } |
| | | } |
| | | |
| | | // 重载表格数据 |
| | | stoPreTabIdx.reload({data: tableCache}); |
| | | |
| | | // 更新下拉框颜色和值 |
| | | updatedRows.forEach(item => { |
| | | $('div[lay-id=stoPreTab] tr[data-index="' + item.index + '"] .order-sta-select').val(item.staNo); |
| | | }); |
| | | layui.form.render('select'); |
| | | updatedRows.forEach(item => { |
| | | $('div[lay-id=stoPreTab] tr[data-index="' + item.index + '"] .layui-select-title input').css("color", "blue"); |
| | | }); |
| | | |
| | | layer.msg("出库站点均分已完成", {icon: 1}); |
| | | return false; |
| | | }); |
| | | |
| | | // 批量修改出库站 - 站点选择 |
| | | function modifySta(stoPreTabData) { |
| | | // 出库站取交集 |
| | | let staBatchSelectVal = []; |
| | | for(let i = 0; i<stoPreTabData.length; i++) { |
| | | let staNos = stoPreTabData[i].staNos; |
| | | if (staNos !== null) { |
| | | if (staBatchSelectVal.length === 0) { |
| | | staBatchSelectVal = staNos; |
| | | } else { |
| | | staBatchSelectVal = staBatchSelectVal.filter(val => |
| | | { |
| | | return new Set(staNos).has(val) |
| | | } |
| | | ) |
| | | } |
| | | } |
| | | } |
| | | if (staBatchSelectVal.length === 0) { |
| | | layer.msg("出库站没有交集,无法批量修改", {icon: 2}); |
| | | return; |
| | | } |
| | | admin.open({ |
| | | type: 1, |
| | | area: '300px', |
| | | offset: 'auto', |
| | | title: '请选择站点', |
| | | content: $('#staBatchSelectDialog').html(), |
| | | success: function (layero, ddIndex) { |
| | | // 渲染下拉框 |
| | | let template = Handlebars.compile($('#batchStaSelectTpl').html()); |
| | | $('#batchSelectStaBox').html(template({list: staBatchSelectVal})); |
| | | // 确认 |
| | | form.on('submit(staBatchSelectConfirm)', function (obj) { |
| | | let loadIdx = layer.load(2); |
| | | let batchSta = Number(obj.field.batchSta); |
| | | let arr = []; |
| | | for (let j = 0; j<stoPreTabData.length; j++) { |
| | | for (let i = 0; i<tableCache.length; i++) { |
| | | if (tableCache[i].orderNo === stoPreTabData[j].orderNo |
| | | && tableCache[i].matnr === stoPreTabData[j].matnr |
| | | && tableCache[i].locNo === stoPreTabData[j].locNo) { |
| | | tableCache[i]['staNo'] = batchSta; |
| | | arr.push(i); |
| | | } |
| | | } |
| | | } |
| | | stoPreTabIdx.reload({data: tableCache}); |
| | | arr.forEach(item => { |
| | | $('div[lay-id=stoPreTab] tr[data-index="' + item + '"] .order-sta-select').val(batchSta); |
| | | }); |
| | | layui.form.render('select'); |
| | | arr.forEach(item => { |
| | | $('div[lay-id=stoPreTab] tr[data-index="' + item + '"] .layui-select-title').find("input").css("color", "blue"); |
| | | }); |
| | | layer.close(loadIdx); layer.close(ddIndex); |
| | | return false; |
| | | }); |
| | | // 弹窗不出现滚动条 |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | }, |
| | | }) |
| | | } |
| | | |
| | | } |
| | | ,yes: function(index, layero){ |
| | | //按钮【立即出库】的回调 |
| | | pakout(tableCache, index); |
| | | } |
| | | ,btn2: function(index, layero){ |
| | | //按钮【稍后处理】的回调 |
| | | layer.close(index) |
| | | //return false 开启该代码可禁止点击该按钮关闭 |
| | | } |
| | | }); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | function pakout(tableCache, layerIndex) { |
| | | // let loadIndex = layer.load(2); |
| | | notice.msg('正在生成出库任务......', {icon: 4}); |
| | | $.ajax({ |
| | | url: baseUrl + "/out/pakout/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | data: JSON.stringify(tableCache), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | notice.destroy(); |
| | | if (res.code === 200) { |
| | | layer.close(layerIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | insTb.reload({where: null}); |
| | | insTb2.reload({where: null, page: {curr: 1}}); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | /* 删除订单 */ |
| | | function doDelSensor(obj) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/sensor/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: obj.ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | $(".layui-laypage-btn")[0].click(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 修改状态 |
| | | form.on('switch(statusSwitch)', function (obj) { |
| | | var index = obj.othis.parents('tr').attr("data-index"); |
| | | var data = tableData[index]; |
| | | data[this.name] = obj.elem.checked?1:0; |
| | | http.post(baseUrl+"/sensor/edit/auth", {id: data.id, status: data[this.name]}, function (res) { |
| | | layer.msg(res.msg, {icon: 1}); |
| | | }) |
| | | }) |
| | | |
| | | window.pakoutPreview = pakoutPreview; |
| | | |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 一键出库 |
| | | */ |
| | | function autoOut(orderId) { |
| | | let loadIndex = layer.msg('请求中...', {icon: 16, shade: 0.01, time: false}); |
| | | $.ajax({ |
| | | url: baseUrl + "/out/pakout/orderDetlIds/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { orderId : orderId }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | pakoutPreview(res.data); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | } |
New file |
| | |
| | | var insTb; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" // 配置模块所在的目录 |
| | | }).use(['table','laydate', 'form', 'admin', 'tableX'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | var tableX = layui.tableX; |
| | | |
| | | /****************************************** 左边表 *************************************************/ |
| | | |
| | | insTb = table.render({ |
| | | elem: '#originTable', |
| | | url: baseUrl + '/order/nav/listMes/auth', |
| | | height: 'full-120', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | page: false, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'data': res.data |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | // toolbar: ['<p>', |
| | | // '<button lay-event="add" class="layui-btn layui-btn-sm icon-btn"><i class="layui-icon"></i>添加</button> ', |
| | | // '<button lay-event="edit" class="layui-btn layui-btn-sm layui-btn-warm icon-btn"><i class="layui-icon"></i>修改</button> ', |
| | | // '<button lay-event="del" class="layui-btn layui-btn-sm layui-btn-danger icon-btn"><i class="layui-icon"></i>删除</button>', |
| | | // '</p>'].join(''), |
| | | defaultToolbar: [], |
| | | cols: [[ |
| | | // {type: 'numbers', title: '#'}, |
| | | {field: 'orderTime', title: '日期'}, |
| | | {field: 'orderNo', title: '单据编号', align: 'center'}, |
| | | {field: 'docType$', title: '单据类型'}, |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | $('#dictTable+.layui-table-view .layui-table-body tbody>tr:first').trigger('click'); |
| | | |
| | | // 绑定鼠标右键 |
| | | tableX.bindCtxMenu('originTable', function (d) { |
| | | return [ |
| | | { |
| | | icon: 'layui-icon layui-icon-ok', |
| | | name: '一键出库', |
| | | click: function (d) { |
| | | autoOut(d.id); |
| | | } |
| | | } |
| | | ] |
| | | |
| | | }) |
| | | |
| | | } |
| | | }); |
| | | |
| | | /* 表格搜索 */ |
| | | form.on('submit(originTableSearch)', function (data) { |
| | | insTb.reload({where: data.field}); |
| | | return false; |
| | | }); |
| | | |
| | | /* 表格重置 */ |
| | | form.on('submit(originTbReset)', function (data) { |
| | | insTb.reload({where: null}); |
| | | insTb2.reload({where: null, page: {curr: 1}}); |
| | | return false; |
| | | }); |
| | | |
| | | /* 表格头工具栏点击事件 */ |
| | | table.on('toolbar(originTable)', function (obj) { |
| | | if (obj.event === 'add') { // 添加 |
| | | showEdit(); |
| | | } else if (obj.event === 'edit') { // 修改 |
| | | if (selObj == null) { |
| | | return; |
| | | } |
| | | showEdit(selObj.data); |
| | | } else if (obj.event === 'del') { // 删除 |
| | | if (selObj == null) { |
| | | return; |
| | | } |
| | | doDel(selObj); |
| | | } |
| | | }); |
| | | |
| | | |
| | | /* 监听行单击事件 */ |
| | | var selObj; |
| | | table.on('row(originTable)', function (obj) { |
| | | |
| | | selObj = obj; |
| | | obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click'); |
| | | insTb2.reload({where: {order_id: obj.data.id}, page: {curr: 1}}); |
| | | }); |
| | | |
| | | /* 显示表单弹窗 */ |
| | | function showEdit(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | title: (mData ? '修改' : '添加') + '项目', |
| | | content: $('#hostEditDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | // 回显表单数据 |
| | | form.val('hostEditForm', mData); |
| | | // 表单提交事件 |
| | | form.on('submit(hostEditSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/host/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | selObj = null; |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | insTb.reload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function doDel(obj) { |
| | | layer.confirm('确定要删除此单据类型吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/host/delete/one/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {param: JSON.stringify(obj.data)}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | selObj = null; |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | insTb.reload(); |
| | | $('#dictTable+.layui-table-view .layui-table-body tbody>tr:first').trigger('click'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | }) |
| | |
| | | ,{field: 'sourceLocNo$', align: 'center',title: '源库位'} |
| | | ,{field: 'locNo$', align: 'center',title: '目标库位'} |
| | | ,{field: 'barcode', align: 'center',title: '条码'} |
| | | ,{field: 'memo', align: 'center',title: '组货单号'} |
| | | |
| | | // ,{field: 'sheetNo$', align: 'center',title: '机械臂', hide: false} |
| | | ,{field: 'preHave', align: 'center',title: '先入品', hide: true} |
| | | ,{field: 'takeNone', align: 'center',title: '空操作', hide: true} |
| | |
| | | <script type="text/html" id="staBatchSelectDialog"> |
| | | <form class="layui-form" style="padding: 25px 50px 30px 50px;text-align: center"> |
| | | <select id="batchSelectStaBox" name="batchSta" lay-vertype="tips" lay-verify="required" required=""> |
| | | <option value="">请选择组货单号</option> <!-- 默认空值 --> |
| | | </select> |
| | | <button style="margin-top: 30px" class="layui-btn" lay-filter="staBatchSelectConfirm" lay-submit="">确定</button> |
| | | </form> |
| | | </script> |
| | | |
| | | |
| | | <script type="text/html" id="locNoTpl"> |
| | | <span name="locNo" |
| | | {{# if( d.lack === false){ }} |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/originTable.css" media="all"> |
| | | <style> |
| | | body { |
| | | color: #595959; |
| | | background-color: #f5f7f9; |
| | | } |
| | | |
| | | .admin-form { |
| | | padding: 25px 30px 0 0 !important; |
| | | margin: 0 !important; |
| | | } |
| | | |
| | | .layui-table-view .layui-table-cell .layui-select-title .layui-input { |
| | | height: 28px; |
| | | line-height: 28px; |
| | | } |
| | | |
| | | .layui-table-view [lay-size="lg"] .layui-table-cell .layui-select-title .layui-input { |
| | | height: 40px; |
| | | line-height: 40px; |
| | | } |
| | | |
| | | .layui-table-view [lay-size="lg"] .layui-table-cell .layui-select-title .layui-input { |
| | | height: 40px; |
| | | line-height: 40px; |
| | | } |
| | | |
| | | .layui-table-view [lay-size="sm"] .layui-table-cell .layui-select-title .layui-input { |
| | | height: 20px; |
| | | line-height: 20px; |
| | | } |
| | | |
| | | .layui-table-view [lay-size="sm"] .layui-table-cell .layui-btn-xs { |
| | | height: 18px; |
| | | line-height: 18px; |
| | | } |
| | | |
| | | /* 权限控制 */ |
| | | #btn-pakoutPreview { |
| | | display: none; |
| | | } |
| | | /*#btn-delete {*/ |
| | | /* display: none;*/ |
| | | /*}*/ |
| | | /*.btn-edit {*/ |
| | | /* display: none;*/ |
| | | /*}*/ |
| | | /*.btn-more {*/ |
| | | /* display: none;*/ |
| | | /*}*/ |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <!-- 正文开始 --> |
| | | <div class="layui-fluid" style="padding-bottom: 0;"> |
| | | <div class="layui-row layui-col-space15"> |
| | | <!-- 左 --> |
| | | <div class="layui-col-md3" id="left-table"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body" style="padding: 10px;"> |
| | | <form class="layui-form toolbar"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline" style="max-width: 300px;"> |
| | | <input name="orderNo" class="layui-input" placeholder="输入单据编号" autocomplete="off"/> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <button class="layui-btn icon-btn" lay-filter="originTableSearch" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="originTbReset" lay-submit> |
| | | <i class="layui-icon"></i>重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <table id="originTable" lay-filter="originTable"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 右 --> |
| | | <div class="layui-col-md9"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body" style="padding: 10px;"> |
| | | <form class="layui-form toolbar"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">包装组号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="brand" class="layui-input" placeholder="包装组号"/> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <label class="layui-form-label">商品名称:</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input name="maktx" class="layui-input" placeholder="商品名称"/>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <label class="layui-form-label">序列码:</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input name="batch" class="layui-input" placeholder="序列码"/>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <label class="layui-form-label">状态:</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <select name="isOnline">--> |
| | | <!-- <option value="1">充电中</option>--> |
| | | <!-- <option value="1">充电中</option>--> |
| | | <!-- <option value="0">不在充电</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="sensorTbSearch" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <table id="orderDetlTable" lay-filter="orderDetlTable"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 头工具栏 --> |
| | | <script type="text/html" id="orderDetToolbar"> |
| | | |
| | | <!-- <div class="layui-btn-container">--> |
| | | <!-- <div class="layui-col-md3">--> |
| | | <!-- <select id="staNoSelect" lay-verify="required">--> |
| | | <!-- <option value="">请选择站点</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger btn-pakoutPreview" id="btn-pakoutPreview" lay-event="pakoutPreview">批量出库</button> |
| | | |
| | | </script> |
| | | |
| | | <!-- 行工具栏 --> |
| | | <script type="text/html" id="operate"> |
| | | <!-- {{#if (d.enableQty > 0){ }}--> |
| | | <!-- <a class="layui-btn layui-btn-xs layui-btn-danger btn-pakoutPreview" lay-event="pakoutPreview"><i class="layui-icon layui-icon-prev-circle"></i>出库</a>--> |
| | | <!-- {{# } }}--> |
| | | </script> |
| | | |
| | | <!-- 出库预览 --> |
| | | <script type="text/html" id="pakoutPreviewBox" style="display: none"> |
| | | <div style="padding: 25px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;"> |
| | | <span style="font-size: large; font-weight: bold">出库预览</span> |
| | | </div> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body" style="padding: 10px"> |
| | | <table id="stoPreTab" lay-filter="stoPreTab"></table> |
| | | </div> |
| | | <button class="layui-btn layui-btn-primary layui-border-black layui-btn-sm" |
| | | lay-filter="checkModifySta" |
| | | lay-submit |
| | | style="display: block; float: right; margin-right: 3rem; transform: scale(1.2);margin-bottom: 3rem; transform-origin: right center;"> |
| | | 盘点均分 |
| | | </button> |
| | | |
| | | <!-- <button class="layui-btn layui-btn-primary layui-border-black layui-btn-sm" lay-filter="batchModifySta" lay-submit style="display: block;float: right;margin-right: 1rem">--> |
| | | <!-- 批量修改--> |
| | | <!-- </button>--> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="tbBasicTbStaNos"> |
| | | <div class="ew-select-fixed"> |
| | | <select class="order-sta-select" lay-filter="tbBasicTbStaNos"> |
| | | {{#if (d.staNos!=null) {}} |
| | | {{# for(let i=0; i<d.staNos.length; i++) { }} |
| | | <option value="{{d.staNos[i]}}">{{d.staNos[i]}}</option> |
| | | {{# } }} |
| | | {{# } }} |
| | | </select> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="staBatchSelectDialog"> |
| | | <form class="layui-form" style="padding: 25px 50px 30px 50px;text-align: center"> |
| | | <select id="batchSelectStaBox" name="batchSta" lay-vertype="tips" lay-verify="required" required=""> |
| | | </select> |
| | | <button style="margin-top: 30px" class="layui-btn" lay-filter="staBatchSelectConfirm" lay-submit="">确定</button> |
| | | </form> |
| | | </script> |
| | | |
| | | <script type="text/html" id="locNoTpl"> |
| | | <span name="locNo" |
| | | {{# if( d.lack === false){ }} |
| | | class="layui-badge layui-badge-green" >{{d.locNo}}</span> |
| | | {{# } else { }} |
| | | class="layui-badge layui-badge-red" >库存不足</span> |
| | | {{# } }} |
| | | </script> |
| | | |
| | | <!-- 行样式 --> |
| | | <script type="text/html" id="orderNoTpl"> |
| | | <span name="orderNo" class="layui-badge layui-badge-gray">{{d.orderNo}}</span> |
| | | </script> |
| | | <script type="text/html" id="statusTpl"> |
| | | <input type="checkbox" name="status" value="{{d.status}}" lay-skin="switch" lay-text="正常|禁用" lay-filter="statusSwitch" {{ d.status === 1 ? 'checked' : '' }}> |
| | | </script> |
| | | |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form"> |
| | | <input name="id" type="hidden"> |
| | | <input name="status" type="hidden"> |
| | | <div class="layui-row"> |
| | | |
| | | <div class="layui-col-md4"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">设备编号</label> |
| | | <div class="layui-input-block"> |
| | | <input name="uuid" placeholder="请输入设备编号" class="layui-input" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-md4"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">设备类型:</label> |
| | | <div class="layui-input-block"> |
| | | <div id="modelSel" class="ew-xmselect-tree"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-md4"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">所属项目: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input name="hostId" class="layui-input" style="display: none"> |
| | | <input id="hostId$" name="hostId$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请选择所属项目" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="hostQueryByhostId" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="hostQueryByhostIdSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">详细地址</label> |
| | | <div class="layui-input-block"> |
| | | <input name="addr" placeholder="请输入详细地址" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | <div class="layui-col-md12" style="text-align: center"> |
| | | <iframe id="mapIframe" src="map.html" scrolling="no" frameborder="0" |
| | | style="display: inline-block; width: 90%;height: 400px;margin: auto"> |
| | | </iframe> |
| | | </div> |
| | | |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/tools/md5.js"></script> |
| | | <script type="text/javascript" src="../../static/js/orderTableMes.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/order/outMes.js" charset="utf-8"></script> |
| | | <!--<script type="text/template" id="takeSiteSelectTemplate">--> |
| | | <!-- {{#each data}}--> |
| | | <!-- <option value="{{siteId}}">{{desc}}</option>--> |
| | | <!-- {{/each}}--> |
| | | <!--</script>--> |
| | | <!-- 项目编辑窗口 --> |
| | | <script type="text/html" id="hostEditDialog"> |
| | | <form id="hostEditForm" lay-filter="hostEditForm" class="layui-form model-form"> |
| | | <input name="id" type="hidden"/> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">项目名称:</label> |
| | | <div class="layui-input-block"> |
| | | <input name="name" placeholder="请输入类型名称" class="layui-input" |
| | | lay-verType="tips" lay-verify="required" required/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn" lay-filter="hostEditSubmit" lay-submit>保存</button> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | |
| | | </body> |
| | | |
| | | <script type="text/template" id="batchStaSelectTpl"> |
| | | <option value="">选择出库站</option> |
| | | {{#each list}} |
| | | <option value="{{this}}">{{this}}</option> |
| | | {{/each}} |
| | | </script> |
| | | |
| | | </html> |
| | | |
| | |
| | | <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-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-edit" lay-event="complete">完结</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs " lay-event="del">删除</a> |
| | | <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs " lay-event="complete">完结</a> |
| | | <!-- <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="labelUp">上传标签</a>--> |
| | | {{# } }} |
| | | {{# if (d.settle == 2) { }} |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs " lay-event="del">删除</a> |
| | | <!-- <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="labelUp">上传标签</a>--> |
| | | <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-edit" lay-event="complete">完结</a> |
| | | <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs " lay-event="complete">完结</a> |
| | | {{# } }} |
| | | {{# if (d.settle == 4 && d.tkType=='1') { }} |
| | | <!-- <a class="layui-btn layui-btn-danger layui-btn-xs btn-delete" lay-event="refundLoc">退库</a>--> |