| | |
| | | package zy.cloud.wms.common.model; |
| | | |
| | | import lombok.Data; |
| | | import zy.cloud.wms.manager.entity.CustOrder; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | @Data |
| | | public class OrderStoDto { |
| | | |
| | | private String number; |
| | | private String orderNo; |
| | | |
| | | private List<CustOrder> custOrders; |
| | | private List<MatnrDto> dtos; |
| | | |
| | | public OrderStoDto() { |
| | | } |
| | | |
| | | public OrderStoDto(String number, List<CustOrder> custOrders) { |
| | | this.number = number; |
| | | this.custOrders = custOrders; |
| | | public OrderStoDto(String orderNo, List<MatnrDto> dtos) { |
| | | this.orderNo = orderNo; |
| | | this.dtos = dtos; |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import zy.cloud.wms.common.model.MatnrDto; |
| | | import zy.cloud.wms.common.model.OrderStoDto; |
| | | import zy.cloud.wms.common.utils.VersionUtils; |
| | | import zy.cloud.wms.manager.entity.*; |
| | | import zy.cloud.wms.manager.service.CustOrderService; |
| | | import zy.cloud.wms.manager.service.LocDetlService; |
| | | import zy.cloud.wms.manager.service.MatService; |
| | | import zy.cloud.wms.manager.service.PakoutService; |
| | | import zy.cloud.wms.manager.service.*; |
| | | |
| | | import java.util.*; |
| | | |
| | |
| | | @Autowired |
| | | private PakoutService pakoutService; |
| | | @Autowired |
| | | private CustOrderService custOrderService; |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @Transactional |
| | | public List<StoPreTab> stockOutPreview(OrderStoDto dto) { |
| | | if (Cools.isEmpty(dto) || Cools.isEmpty(dto.getCustOrders())) { |
| | | public List<StoPreTab> stockOutPreview(OrderStoDto orderStoDto) { |
| | | if (Cools.isEmpty(orderStoDto) || Cools.isEmpty(orderStoDto.getDtos())) { |
| | | throw new CoolException("数据异常,请联系管理员"); |
| | | } |
| | | List<StoPreTab> res = new ArrayList<>(); |
| | | // 检查库存是否足够 |
| | | locDetlService.checkLocDetlCount(dto.getNumber()); |
| | | locDetlService.checkLocDetlCount(orderStoDto.getDtos()); |
| | | |
| | | for (CustOrder custOrder : dto.getCustOrders()) { |
| | | for (MatnrDto matnrDto : orderStoDto.getDtos()) { |
| | | // 判断物料是否存在 |
| | | Mat mat = matService.selectByMatnr(custOrder.getUserCode()); |
| | | Mat mat = matService.selectByMatnr(matnrDto.getMatnr()); |
| | | if (null == mat) { |
| | | throw new CoolException(custOrder.getUserCode() + "物料尚未更新。" + custOrder.getNumber() +"单据因此中断!"); |
| | | throw new CoolException(matnrDto.getMatnr() + "物料尚未更新。" + orderStoDto.getOrderNo() +"单据因此中断!"); |
| | | } |
| | | // 查询存有当前物料的货位 |
| | | List<LocDetl> locDetls = locDetlService.findOfSort(mat.getMatnr()); |
| | | double issued = Optional.ofNullable(custOrder.getQty()).orElse(0.0D) ; |
| | | double issued = Optional.ofNullable(matnrDto.getCount()).orElse(0.0D) ; |
| | | double anfme = issued; |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (issued > 0) { |
| | |
| | | } |
| | | |
| | | @Transactional |
| | | public void stockOutProcess(OrderStoDto dto) { |
| | | if (Cools.isEmpty(dto) || Cools.isEmpty(dto.getCustOrders())) { |
| | | public void stockOutProcess(OrderStoDto orderStoDto) { |
| | | if (Cools.isEmpty(orderStoDto) || Cools.isEmpty(orderStoDto.getDtos())) { |
| | | return; |
| | | } |
| | | Order order = orderService.selectByOrderNo(orderStoDto.getOrderNo()); |
| | | if (order == null) { |
| | | throw new CoolException(orderStoDto.getOrderNo() + "单据不存在"); |
| | | } |
| | | Date now = new Date(); |
| | | |
| | | /******************************* 立库拣货单 ********************************/ |
| | | // 检查库存是否足够 |
| | | locDetlService.checkLocDetlCount(dto.getNumber()); |
| | | locDetlService.checkLocDetlCount(orderStoDto.getDtos()); |
| | | |
| | | /******************************* 平仓拣货单 ********************************/ |
| | | for (CustOrder custOrder : dto.getCustOrders()) { |
| | | for (MatnrDto matnrDto : orderStoDto.getDtos()) { |
| | | // 判断物料是否存在 |
| | | Mat mat = matService.selectByMatnr(custOrder.getUserCode()); |
| | | Mat mat = matService.selectByMatnr(matnrDto.getMatnr()); |
| | | if (null == mat) { |
| | | throw new CoolException(custOrder.getUserCode() + "物料尚未更新。" + custOrder.getNumber() +"单据因此中断!"); |
| | | throw new CoolException(matnrDto.getMatnr() + "物料尚未更新。" + matnrDto.getCount() +"单据因此中断!"); |
| | | } |
| | | // 查询存有当前物料的货位 |
| | | List<LocDetl> locDetls = locDetlService.findOfSort(mat.getMatnr()); |
| | | double issued = Optional.ofNullable(custOrder.getQty()).orElse(0.0D) ; |
| | | double issued = Optional.ofNullable(matnrDto.getCount()).orElse(0.0D) ; |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (issued > 0) { |
| | | // 保存出库通知单 |
| | |
| | | pakout.setNodeId(locDetl.getNodeId()); |
| | | pakout.setWrkNo(String.valueOf(snowflakeIdWorker.nextId())); |
| | | VersionUtils.setPakout(pakout, mat); |
| | | pakout.setDocId(getDocId(dto.getNumber())); // 单据类型 |
| | | pakout.setDocNum(custOrder.getNumber()); // 单据编号 |
| | | pakout.setDocId(order.getDocType()); // 单据类型 |
| | | pakout.setDocNum(order.getOrderNo()); // 单据编号 |
| | | pakout.setCreateTime(now); |
| | | pakout.setUpdateTime(now); |
| | | pakout.setStatus(1); |
| | |
| | | } |
| | | } |
| | | // 修改单据状态 |
| | | if (!custOrderService.updateStatus(custOrder.getNumber(), 2)) { |
| | | if (!orderService.updateSettle(orderStoDto.getOrderNo(), 2L)) { |
| | | throw new CoolException("修改单据状态失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private Long getDocId(String number) { |
| | | if (number.startsWith("PR")) { |
| | | return 6L; |
| | | } |
| | | return 11L; |
| | | } |
| | | |
| | | } |
| | |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | else { |
| | | wrapper.orderBy("update_time", false); |
| | | } |
| | | return R.ok(orderService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | |
| | | @Data |
| | | public class StockOutParam { |
| | | |
| | | // 销售订单号 |
| | | private String number; |
| | | // 订单号 |
| | | private String orderNo; |
| | | |
| | | } |
| | |
| | | package zy.cloud.wms.manager.mapper; |
| | | |
| | | import zy.cloud.wms.manager.entity.OrderDetl; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | import zy.cloud.wms.manager.entity.OrderDetl; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface OrderDetlMapper extends BaseMapper<OrderDetl> { |
| | | |
| | | List<OrderDetl> selectByOrderNo(String orderNo); |
| | | |
| | | } |
| | |
| | | package zy.cloud.wms.manager.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import zy.cloud.wms.manager.entity.Order; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | @Repository |
| | | public interface OrderMapper extends BaseMapper<Order> { |
| | | |
| | | Boolean updateSettle(@Param("orderNo")String orderNo, @Param("settle")Long settle); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import zy.cloud.wms.common.model.MatnrDto; |
| | | import zy.cloud.wms.manager.entity.LocDetl; |
| | | import zy.cloud.wms.manager.entity.param.StockTransferParam; |
| | | |
| | |
| | | |
| | | /** |
| | | * 查看当前订单号的物料在库存中是否充足 |
| | | * @param number |
| | | * @param dtos |
| | | */ |
| | | void checkLocDetlCount(String number); |
| | | void checkLocDetlCount(List<MatnrDto> dtos); |
| | | |
| | | List<StockTransferParam> checkLocDetlCountOfRes(String number); |
| | | List<StockTransferParam> checkLocDetlCountOfRes(List<MatnrDto> dtos); |
| | | |
| | | /** |
| | | * 减少库存 |
| | |
| | | package zy.cloud.wms.manager.service; |
| | | |
| | | import zy.cloud.wms.manager.entity.OrderDetl; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import zy.cloud.wms.manager.entity.OrderDetl; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface OrderDetlService extends IService<OrderDetl> { |
| | | |
| | | List<OrderDetl> selectByOrderNo(String orderNo); |
| | | |
| | | } |
| | |
| | | package zy.cloud.wms.manager.service; |
| | | |
| | | import zy.cloud.wms.manager.entity.Order; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import zy.cloud.wms.manager.entity.Order; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface OrderService extends IService<Order> { |
| | | |
| | |
| | | |
| | | Boolean insertReturnId(Order order); |
| | | |
| | | List<Order> selectOrderBySettle(Long settle); |
| | | |
| | | Boolean updateSettle(String orderNo, Long settle); |
| | | |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import zy.cloud.wms.common.config.CodeCoolException; |
| | | import zy.cloud.wms.manager.entity.CustOrder; |
| | | import zy.cloud.wms.common.model.MatnrDto; |
| | | import zy.cloud.wms.manager.entity.LocDetl; |
| | | import zy.cloud.wms.manager.entity.Mat; |
| | | import zy.cloud.wms.manager.entity.Prior; |
| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service("locDetlService") |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void checkLocDetlCount(String number) { |
| | | List<CustOrder> custOrders = custOrderService.selectList(new EntityWrapper<CustOrder>().eq("number", number).eq("status", 1)); |
| | | public void checkLocDetlCount(List<MatnrDto> dtos) { |
| | | StringBuilder errorMsg = new StringBuilder(); |
| | | boolean error = false; |
| | | for (CustOrder custOrder : custOrders) { |
| | | Double count = this.baseMapper.selectCountByMatnr(custOrder.getUserCode()); |
| | | if (count == null) { |
| | | count = 0.0D; |
| | | } |
| | | if (count < custOrder.getQty()) { |
| | | for (MatnrDto dto : dtos) { |
| | | Double count = Optional.ofNullable(baseMapper.selectCountByMatnr(dto.getMatnr())).orElse(0.0D); |
| | | if (count < dto.getCount()) { |
| | | if (!error) { |
| | | error = true; |
| | | } |
| | | Mat mat = matService.selectByMatnr(custOrder.getUserCode()); |
| | | errorMsg.append(mat == null ? custOrder.getUserCode() : mat.getMaktx()).append("库存不足,缺货数量:").append(custOrder.getQty() - count).append("</br>"); |
| | | Mat mat = matService.selectByMatnr(dto.getMatnr()); |
| | | errorMsg.append(mat == null ? dto.getMatnr() : mat.getMaktx()).append("库存不足,缺货数量:").append(dto.getCount() - count).append("</br>"); |
| | | } |
| | | } |
| | | if (error) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<StockTransferParam> checkLocDetlCountOfRes(String number) { |
| | | List<CustOrder> custOrders = custOrderService.selectList(new EntityWrapper<CustOrder>().eq("number", number).eq("status", 1)); |
| | | public List<StockTransferParam> checkLocDetlCountOfRes(List<MatnrDto> dtos) { |
| | | boolean asrs = false; |
| | | List<StockTransferParam> params = new ArrayList<>(); |
| | | for (CustOrder custOrder : custOrders) { |
| | | Double count = this.baseMapper.selectCountByMatnr(custOrder.getUserCode()); |
| | | if (count == null) { |
| | | count = 0.0D; |
| | | } |
| | | if (count < custOrder.getQty()) { |
| | | for (MatnrDto dto : dtos) { |
| | | Double count = Optional.ofNullable(baseMapper.selectCountByMatnr(dto.getMatnr())).orElse(0.0D); |
| | | if (count < dto.getCount()) { |
| | | if (!asrs) { asrs = true; } |
| | | StockTransferParam param = new StockTransferParam(); |
| | | param.setMatnr(custOrder.getUserCode()); |
| | | param.setAnfme(custOrder.getQty() - count); |
| | | param.setTotal(custOrder.getQty()); |
| | | param.setMatnr(dto.getMatnr()); |
| | | param.setAnfme(dto.getCount() - count); |
| | | param.setTotal(dto.getCount()); |
| | | params.add(param); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("orderDetlService") |
| | | public class OrderDetlServiceImpl extends ServiceImpl<OrderDetlMapper, OrderDetl> implements OrderDetlService { |
| | | |
| | | @Override |
| | | public List<OrderDetl> selectByOrderNo(String orderNo) { |
| | | return this.baseMapper.selectByOrderNo(orderNo); |
| | | } |
| | | } |
| | |
| | | import zy.cloud.wms.manager.mapper.OrderMapper; |
| | | import zy.cloud.wms.manager.service.OrderService; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("orderService") |
| | | public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService { |
| | | |
| | |
| | | return this.baseMapper.insert(order) > 0; |
| | | } |
| | | |
| | | @Override |
| | | public List<Order> selectOrderBySettle(Long settle) { |
| | | return this.selectList(new EntityWrapper<Order>().eq("settle", settle)); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateSettle(String orderNo, Long settle) { |
| | | return this.baseMapper.updateSettle(orderNo, settle); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @Override |
| | | public R stockOutPrint(StockOutParam param, Long userId) { |
| | | List<Pakout> pakouts = pakoutService.selectList(new EntityWrapper<Pakout>().eq("doc_num", param.getNumber())); |
| | | List<Pakout> pakouts = pakoutService.selectList(new EntityWrapper<Pakout>().eq("doc_num", param.getOrderNo())); |
| | | Double total = 0.0D; |
| | | String custName = ""; |
| | | for (Pakout pakout : pakouts) { |
| | |
| | | custName = pakout.getCustName(); |
| | | } |
| | | StoPrintVo vo = new StoPrintVo(); |
| | | vo.setDocNum(param.getNumber()); |
| | | vo.setDocNum(param.getOrderNo()); |
| | | vo.setList(pakouts); |
| | | vo.setTotal(total); |
| | | vo.setCustName("浙江中扬立库技术有限公司"); |
| | |
| | | |
| | | @Override |
| | | public R stockOutPreview(StockOutParam param, Long userId) { |
| | | List<CustOrder> custOrders = custOrderService.selectList(new EntityWrapper<CustOrder>() |
| | | .eq("number", param.getNumber()) |
| | | .eq("status", 1) |
| | | ); |
| | | Order order = orderService.selectByOrderNo(param.getOrderNo()); |
| | | if (order.getSettle() != 1) { |
| | | return R.error("此单据无法生成拣货单"); |
| | | } |
| | | List<OrderDetl> orderDetls = orderDetlService.selectByOrderNo(order.getOrderNo()); |
| | | if (Cools.isEmpty(orderDetls)) { |
| | | return R.error("此单据已失效,请联系管理员"); |
| | | } |
| | | OrderStoDto dto = new OrderStoDto(); |
| | | dto.setNumber(param.getNumber()); |
| | | dto.setCustOrders(custOrders); |
| | | dto.setOrderNo(param.getOrderNo()); |
| | | List<MatnrDto> matnrDtos = new ArrayList<>(); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | MatnrDto matnrDto = new MatnrDto(); |
| | | matnrDto.setMatnr(orderDetl.getMatnr()); |
| | | matnrDto.setCount(orderDetl.getAnfme()); |
| | | matnrDtos.add(matnrDto); |
| | | } |
| | | dto.setDtos(matnrDtos); |
| | | return R.ok().add(mainService.stockOutPreview(dto)); |
| | | } |
| | | |
| | | @Override |
| | | public R stockOut(StockOutParam param, Long userId) { |
| | | List<CustOrder> custOrders = custOrderService.selectList(new EntityWrapper<CustOrder>() |
| | | .eq("number", param.getNumber()) |
| | | .eq("number", param.getOrderNo()) |
| | | .eq("status", 1) |
| | | ); |
| | | List<OrderDetl> orderDetls = orderDetlService.selectByOrderNo(param.getOrderNo()); |
| | | if (Cools.isEmpty(orderDetls)) { |
| | | return R.error("此单据已失效,请联系管理员"); |
| | | } |
| | | OrderStoDto dto = new OrderStoDto(); |
| | | dto.setNumber(param.getNumber()); |
| | | dto.setCustOrders(custOrders); |
| | | dto.setOrderNo(param.getOrderNo()); |
| | | List<MatnrDto> matnrDtos = new ArrayList<>(); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | MatnrDto matnrDto = new MatnrDto(); |
| | | matnrDto.setMatnr(orderDetl.getMatnr()); |
| | | matnrDto.setCount(orderDetl.getAnfme()); |
| | | matnrDtos.add(matnrDto); |
| | | } |
| | | dto.setDtos(matnrDtos); |
| | | // 开始整理出库数据 |
| | | mainService.stockOutProcess(dto); |
| | | return R.ok("生成拣货单成功"); |
| | |
| | | null, // 发货时间 |
| | | null, // 物流名称 |
| | | null, // 物流单号 |
| | | null, // 订单状态 |
| | | 1L, // 订单状态 |
| | | 1, // 状态 |
| | | userId, // 添加人员 |
| | | now, // 添加时间 |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="selectByOrderNo" resultMap="BaseResultMap"> |
| | | select |
| | | mod.* |
| | | from man_order_detl mod |
| | | left join man_order mo on mo.id = mod.order_id |
| | | where 1=1 |
| | | and mo.order_no = #{orderNo} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <update id="updateSettle"> |
| | | update man_order set settle = #{settle} where 1=1 and order_no = #{orderNo} |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | }).use(['table','laydate', 'form', 'admin', 'tableMerge'], 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 tableMerge = layui.tableMerge; |
| | | |
| | | /****************************************** 左边表 *************************************************/ |
| | | |
| | |
| | | ,{field: 'sendTime$', align: 'center',title: '发货时间', hide: true} |
| | | ,{field: 'shipName', align: 'center',title: '物流名称', hide: true} |
| | | ,{field: 'shipCode', align: 'center',title: '物流单号', hide: true} |
| | | ,{field: 'settle$', align: 'center',title: '订单状态'} |
| | | ,{field: 'settle$', align: 'center',title: '订单状态', templet: '#settleTpl', width: 100} |
| | | // ,{field: 'status$', align: 'center',title: '状态'} |
| | | // ,{field: 'createBy$', align: 'center',title: '添加人员',event: 'createBy', style: 'cursor:pointer'} |
| | | // ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | |
| | | |
| | | /* 表格2工具条点击事件 */ |
| | | table.on('tool(orderTable)', function (obj) { |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 拣货 |
| | | case 'stockOut': |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl + "/work/stock/out/preview", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | data: JSON.stringify({ |
| | | orderNo: data.orderNo |
| | | }), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | // 成功 |
| | | if (res.code === 200){ |
| | | layer.open({ |
| | | type: 1 |
| | | ,title: false |
| | | ,closeBtn: false |
| | | ,offset: '100px' |
| | | ,area: '1000px' |
| | | ,shade: 0.5 |
| | | ,shadeClose: true |
| | | ,btn: ['立即生成', '稍后处理'] |
| | | ,btnAlign: 'c' |
| | | ,moveType: 1 //拖拽模式,0或者1 |
| | | ,content: $('#stoukOutPreview') |
| | | ,success: function(layero, index){ |
| | | table.render({ |
| | | elem: '#stoPreTab', |
| | | data: res.data, |
| | | page: true, |
| | | cellMinWidth: 100, |
| | | height: 432, |
| | | cols: [[ |
| | | {field: 'title', title: '商品', merge: true, align: 'center'}, |
| | | {field: 'anfme', title: '总数量', merge: ['title'], align: 'center', style: 'font-weight: bold', width: 90}, |
| | | {field: 'type', title: '仓库', merge: true, align: 'center', templet: '#typeTpl', width: 90}, |
| | | {field: 'locNo', title: '货位', align: 'center'}, |
| | | {field: 'prior$', title: '推荐货位', align: 'center', width: 100}, |
| | | {field: 'reduce', title: '数量', align: 'center', width: 90, style: 'font-weight: bold'}, |
| | | // {field: 'remQty', title: '余量', align: 'center', width: 80}, |
| | | {field: 'total', title: '总量', align: 'center', width: 90}, |
| | | ]], |
| | | done: function () { |
| | | tableMerge.render(this); |
| | | // tableX.merges('stoPreTab', [0,1,2]); |
| | | $('.layui-table-body.layui-table-main').css("overflow", "auto") |
| | | } |
| | | }); |
| | | |
| | | } |
| | | ,yes: function(index, layero){ |
| | | //按钮【马上拣货】的回调 |
| | | stockOut(data.number); |
| | | } |
| | | ,btn2: function(index, layero){ |
| | | //按钮【稍后处理】的回调 |
| | | //return false 开启该代码可禁止点击该按钮关闭 |
| | | } |
| | | }); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | break; |
| | | // 打印 |
| | | case 'print': |
| | | layer.confirm('开始打印' +data.number + ' 拣货单?', {shadeClose: true}, function(){ |
| | | layer.closeAll(); |
| | | printPakouts(data.number); |
| | | }) |
| | | break; |
| | | |
| | | } |
| | | if (obj.event === 'edit') { // 修改 |
| | | showEditModel2(obj.data); |
| | | } else if (obj.event === 'del') { // 删除 |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | {{#if (d.settle == 1){ }} |
| | | <a class="layui-btn layui-btn-sm layui-btn-danger" lay-event="stockOut" style="font-size: 16px">拣货单</a> |
| | | {{# } }} |
| | | {{#if (d.settle == 2 || d.settle == 4){ }} |
| | | <a class="layui-btn layui-btn-sm layui-btn-normal" lay-event="print" style="font-size: 16px">打印</a> |
| | | {{# } }} |
| | | </script> |
| | | |
| | | <script type="text/html" id="settleTpl"> |
| | | <span name="settle" |
| | | {{# if( d.settle === 1){ }} |
| | | class="layui-badge layui-badge-blue" |
| | | {{# } else if(d.settle === 2){ }} |
| | | class="layui-badge layui-badge-red" |
| | | {{# } else if(d.settle === 3){ }} |
| | | class="layui-badge layui-badge-gray" |
| | | {{# } else if(d.settle === 4){ }} |
| | | class="layui-badge layui-badge-green" |
| | | {{# } }} |
| | | >{{d.settle$}}</span> |
| | | </script> |
| | | |
| | | <script type="text/html" id="typeTpl"> |
| | | <span name="type" |
| | | {{# if( d.type === 1){ }} |
| | | class="layui-badge layui-badge-blue" ><span style="display: none">{{d.number}}</span>平仓</span> |
| | | {{# } else if(d.type === 2){ }} |
| | | class="layui-badge layui-badge-green" ><span style="display: none">{{d.number}}</span>立库</span> |
| | | {{# } else if(d.type === 0){ }} |
| | | class="layui-badge layui-badge-red" ><span style="display: none">{{d.number}}</span>缺货</span> |
| | | {{# } }} |
| | | </script> |
| | | |
| | | <!-- 打印容器 --> |
| | | <div id="pakoutPrintBox" style="display: none"></div> |
| | | <!-- 出库预览容器 --> |
| | | <div id="stoukOutPreview" 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> |
| | | <table id="stoPreTab" lay-filter="stoPreTab"></table> |
| | | </div> |
| | | |
| | | <!-- 单据类型表单 --> |
| | | <script type="text/html" id="docTypeEditDialog"> |
| | | <form id="docTypeEditForm" lay-filter="docTypeEditForm" class="layui-form model-form"> |