| | |
| | | return R.ok("出库启动成功"); |
| | | } |
| | | |
| | | @RequestMapping("/plate/order/out/start") |
| | | @ManagerAuth(memo = "手动订单出库作业") |
| | | public R fullStoreTakeStartOrder(@RequestBody StockOutParam param) { |
| | | workService.startupFullTakeStoreOrder(param, getUserId()); |
| | | return R.ok("出库启动成功"); |
| | | } |
| | | |
| | | @RequestMapping("/empty/plate/in/start") |
| | | @ManagerAuth(memo = "空板入库") |
| | | public R emptyPlateInStart(@RequestParam Integer sourceStaNo) { |
| | |
| | | private String origin; |
| | | |
| | | /** |
| | | * 厂家 |
| | | * 厂家 、、江铜:暂存库位号 |
| | | */ |
| | | @ApiModelProperty(value= "厂家") |
| | | private String manu; |
| | |
| | | |
| | | // 出站口 |
| | | private Integer outSite; |
| | | private String orderNo; |
| | | |
| | | // 物料编号集合 |
| | | private List<LocDetl> locDetls; |
| | |
| | | // 库位号 |
| | | private String locNo; |
| | | |
| | | // 商品编号 |
| | | // 物料编码 |
| | | private String matnr; |
| | | |
| | | // 序列码 |
| | | //木箱编码 |
| | | private String batch; |
| | | |
| | | // 数量 |
| | | //批次 |
| | | private String model; |
| | | |
| | | //规格 |
| | | private String specs; |
| | | |
| | | //木箱类型 |
| | | private String brand; |
| | | |
| | | //托盘码 |
| | | private String zpallet; |
| | | |
| | | // 木箱中铜箔数量 |
| | | private Double anfme; |
| | | |
| | | // 木箱中铜箔数量 |
| | | private Double count; |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 出库作业 |
| | | */ |
| | | void startupFullTakeStoreOrder(StockOutParam param, Long userId); |
| | | |
| | | /** |
| | | * 出库作业 |
| | | * @param staNo 目标站点 |
| | | * @param locDetls 待出库物料 |
| | | * @param ioType 入出库类型 |
| | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | |
| | | throw new CoolException("库存不存在"); |
| | | } |
| | | } |
| | | @Override |
| | | @Transactional |
| | | public void startupFullTakeStoreOrder(StockOutParam param, Long userId) { |
| | | if (Cools.isEmpty(param) || Cools.isEmpty(param.getOrderNo()) || Cools.isEmpty(param.getLocDetls())){ |
| | | throw new CoolException("参数为空"); |
| | | } |
| | | DocType docType = docTypeService.selectOrAdd("手动出库单", Boolean.FALSE); |
| | | Order order = orderService.selectByNo(param.getOrderNo()); |
| | | if (Cools.isEmpty(order)){ |
| | | Date now = new Date(); |
| | | order = new Order( |
| | | String.valueOf(snowflakeIdWorker.nextId()), // 编号[非空] |
| | | param.getOrderNo(), // 订单编号 |
| | | DateUtils.convert(now), // 单据日期 |
| | | docType.getDocId(), // 单据类型 |
| | | null, // 项目编号 |
| | | null, // |
| | | null, // 调拨项目编号 |
| | | null, // 初始票据号 |
| | | null, // 票据号 |
| | | null, // 客户编号 |
| | | null, // 客户 |
| | | null, // 联系方式 |
| | | null, // 操作人员 |
| | | null, // 合计金额 |
| | | null, // 优惠率 |
| | | null, // 优惠金额 |
| | | null, // 销售或采购费用合计 |
| | | null, // 实付金额 |
| | | null, // 付款类型 |
| | | null, // 业务员 |
| | | null, // 结算天数 |
| | | null, // 邮费支付类型 |
| | | null, // 邮费 |
| | | null, // 付款时间 |
| | | null, // 发货时间 |
| | | null, // 物流名称 |
| | | null, // 物流单号 |
| | | 1L, // 订单状态 |
| | | 1, // 状态 |
| | | userId, // 添加人员 |
| | | now, // 添加时间 |
| | | userId, // 修改人员 |
| | | now, // 修改时间 |
| | | null // 备注 |
| | | ); |
| | | if (!orderService.insert(order)) { |
| | | throw new CoolException("保存订单主档失败"); |
| | | } |
| | | // 单据明细档 |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | List<StockOutParam.LocDetl> locDetls = param.getLocDetls(); |
| | | int i=0; |
| | | for (StockOutParam.LocDetl locDetl : locDetls) { |
| | | i++; |
| | | Mat mat = matService.selectByMatnr(locDetl.getMatnr()); |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(locDetl.getMatnr() + "物料编码检索失败,请先添加商品"); |
| | | } |
| | | OrderDetl orderDetl = new OrderDetl(); |
| | | orderDetl.sync(mat); |
| | | orderDetl.setSuppCode(String.valueOf(i)); // 行号 |
| | | orderDetl.setManu(locDetl.getLocNo()); //库位号 |
| | | orderDetl.setBatch(locDetl.getBatch()); //木箱编码 |
| | | orderDetl.setAnfme(locDetl.getCount());//出库数量 |
| | | orderDetl.setModel(locDetl.getModel());//批次 |
| | | orderDetl.setSpecs(locDetl.getSpecs());//规格 |
| | | orderDetl.setBrand(locDetl.getBrand());//木箱类型 |
| | | orderDetl.setOrderId(order.getId()); |
| | | orderDetl.setOrderNo(order.getOrderNo()); |
| | | orderDetl.setCreateBy(userId); |
| | | orderDetl.setCreateTime(now); |
| | | orderDetl.setUpdateBy(userId); |
| | | orderDetl.setUpdateTime(now); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | | } |
| | | } else { |
| | | throw new CoolException("订单号重复,订单"+param.getOrderNo()+"已存在!!!"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | ,{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} |
| | | ,{field: 'anfme', align: 'center',title: '数量', hide: false, sort:true} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码', hide: false} |
| | | |
| | | ,{field: 'specs', align: 'center',title: '规格', hide: false} |
| | |
| | | ,{field: 'manuDate', align: 'center',title: '生产日期', hide: true} |
| | | ,{field: 'itemNum', align: 'center',title: '品项数', hide: true} |
| | | ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '单箱净重', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '单箱净重', hide: false, sort:true} |
| | | ,{field: 'length', align: 'center',title: '单箱毛重', hide: true} |
| | | ,{field: 'volume', align: 'center',title: '单箱体积', hide: true} |
| | | ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true} |
| | | ,{field: 'supp', align: 'center',title: '供应商', hide: true} |
| | | ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true} |
| | | ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true} |
| | | ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true, sort:true} |
| | | ,{field: 'deadTime', align: 'center',title: '保质期', hide: true} |
| | | ,{field: 'deadWarn', align: 'center',title: '预警天数', hide: true} |
| | | ,{field: 'source$', align: 'center',title: '制购', hide: true} |
New file |
| | |
| | | var locDetlLayerIdx; |
| | | 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: 'locNo$', align: 'center',title: '库位号'} |
| | | ]; |
| | | arrRemove(detlCols, 'field', 'anfme'); |
| | | cols.push.apply(cols, detlCols); |
| | | cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 80}) |
| | | return cols; |
| | | } |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | data: [], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | limit: 500, |
| | | cols: [getCol()], |
| | | done: function(res, curr, count) { |
| | | limit(); |
| | | getOutBound(); |
| | | } |
| | | }); |
| | | |
| | | // 页面修改 |
| | | table.on('edit(chooseData)', function (obj) { |
| | | 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 (modify) { |
| | | data[obj.field] = obj.value; |
| | | } |
| | | tableIns.reload({data: locDetlData}); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(chooseData)', function (obj) { |
| | | switch (obj.event) { |
| | | case 'outbound': |
| | | if (locDetlData.length === 0){ |
| | | layer.msg('请先提取商品库存', {icon: 2}); |
| | | } else { |
| | | // var staNo = $("#staNoSelect").val(); |
| | | // if (staNo === "" || staNo === null){ |
| | | // layer.msg("请选择出库口", {icon: 2}); |
| | | // return; |
| | | // } |
| | | var orderNo = $("#orderNo").val(); |
| | | if (orderNo === "" || orderNo === null){ |
| | | layer.msg("请输入出库单号", {icon: 2}); |
| | | return; |
| | | } |
| | | for (var i=0;i<locDetlData.length;i++){ |
| | | locDetlData[i]["orderNo"]=orderNo |
| | | } |
| | | let param = { |
| | | orderNo: orderNo, |
| | | locDetls: locDetlData |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/plate/order/out/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | locDetlData = []; |
| | | tableIns.reload({data: locDetlData,done:function (res) {limit();getOutBound();}}); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(chooseData)', function(obj){ |
| | | switch (obj.event) { |
| | | case 'remove': |
| | | let index = obj.tr.attr("data-index"); |
| | | locDetlData.splice(index, 1); |
| | | tableIns.reload({data: locDetlData}); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 获取出库口 |
| | | function getOutBound(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/available/take/site", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var tpl = $("#takeSiteSelectTemplate").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#staNoSelect').append(html); |
| | | form.render('select'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | $(document).on('click','#mat-query', function () { |
| | | let loadIndex = layer.msg('请求中...', {icon: 16, shade: 0.01, time: false}); |
| | | locDetlLayerIdx = layer.open({ |
| | | type: 2, |
| | | title: false, |
| | | closeBtn: false, |
| | | maxmin: false, |
| | | area: ['90%', '85%'], |
| | | shadeClose: true, |
| | | content: 'locDetlQuery.html', |
| | | success: function(layero, index){ |
| | | layer.close(loadIndex); |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | }) |
| | | |
| | | // 添加表格数据 |
| | | function addTableData(data) { |
| | | for (var i=0;i<data.length;i++){ |
| | | let pass = false; |
| | | for (var j=0;j<locDetlData.length;j++){ |
| | | if (data[i].matnr === locDetlData[j].matnr && data[i].batch === locDetlData[j].batch && data[i].locNo$ === locDetlData[j].locNo$) { |
| | | pass = true; |
| | | break; |
| | | } |
| | | } |
| | | if (pass) { |
| | | data.splice(i--, 1); |
| | | } else { |
| | | data[i]["count"] = data[i]["anfme"]; |
| | | } |
| | | } |
| | | locDetlData.push.apply(locDetlData, data); |
| | | tableIns.reload({data: locDetlData}); |
| | | layer.close(locDetlLayerIdx); |
| | | } |
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/common.css" media="all"> |
| | | <style> |
| | | html { |
| | | height: 100%; |
| | | padding: 10px; |
| | | background-color: #f1f1f1; |
| | | box-sizing: border-box; |
| | | } |
| | | body { |
| | | background-color: #fff; |
| | | border-radius: 5px; |
| | | box-shadow: 0 0 3px rgba(0,0,0,.3); |
| | | padding-bottom: 20px; |
| | | } |
| | | |
| | | #staNoSpan { |
| | | text-align: center; |
| | | display: inline-block; |
| | | width: 100px; |
| | | font-size: 13px; |
| | | } |
| | | .layui-btn-container .layui-form-select { |
| | | display: inline-block; |
| | | width: 150px; |
| | | height: 30px; |
| | | } |
| | | .layui-btn-container .layui-form-select.layui-form-selected { |
| | | display: inline-block; |
| | | width: 150px; |
| | | } |
| | | .layui-btn-container .layui-select-title input { |
| | | font-size: 13px; |
| | | } |
| | | .layui-btn-container .layui-anim.layui-anim-upbit dd { |
| | | font-size: 13px; |
| | | } |
| | | |
| | | #btn-outbound { |
| | | margin-left: 60px; |
| | | display: none; |
| | | } |
| | | |
| | | /*----------------------------------*/ |
| | | .function-area { |
| | | padding: 20px 50px; |
| | | } |
| | | .function-btn { |
| | | font-size: 16px; |
| | | padding: 1px 2px; |
| | | width: 100px; |
| | | height: 50px; |
| | | border-color: #2b425b; |
| | | border-radius: 4px; |
| | | border-width: 2px; |
| | | background: none; |
| | | border-style: solid; |
| | | transition: 0.4s; |
| | | cursor: pointer; |
| | | letter-spacing: 1.5px; |
| | | } |
| | | .function-btn:hover { |
| | | background-color: #2b425b; |
| | | color: #fff; |
| | | } |
| | | |
| | | #mat-query { |
| | | display: none; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 功能区 --> |
| | | <div class="function-area"> |
| | | <button id="mat-query" class="function-btn">提取库存</button> |
| | | </div> |
| | | |
| | | <hr> |
| | | |
| | | <!-- 表格 --> |
| | | <div style="padding-bottom: 5px; margin-bottom: 45px"> |
| | | |
| | | <!-- 头部 --> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-form"> |
| | | <div class="layui-form layui-card-header"> |
| | | <span id="memeoSpan" style="margin-left: 25px">订单号:</span> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input id="orderNo" class="layui-input" type="text" name="orderNo" placeholder="订单号" autocomplete="off" style="margin-left: 15px;width: 300px"> |
| | | </div> |
| | | </div> |
| | | <button class="layui-btn layui-btn-lg" id="btn-outbound" lay-event="outbound">启动出库</button> |
| | | </div> |
| | | <!-- <div class="layui-btn-container">--> |
| | | <!-- <!– 1.选择出库口 –>--> |
| | | <!-- <span id="staNoSpan">订单号:</span>--> |
| | | <!-- <select id="staNoSelect" lay-verify="required">--> |
| | | <!-- <option value="">请选择站点</option>--> |
| | | <!-- </select>--> |
| | | <!-- 2.启动出库 --> |
| | | |
| | | <!-- </div>--> |
| | | </div> |
| | | </script> |
| | | |
| | | <!-- 行 --> |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</a> |
| | | </script> |
| | | |
| | | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | </div> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.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/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/pakStore/stockOutOrder.js" charset="utf-8"></script> |
| | | |
| | | <script type="text/template" id="takeSiteSelectTemplate"> |
| | | {{#each data}} |
| | | <option value="{{siteId}}">{{desc}}</option> |
| | | {{/each}} |
| | | </script> |
| | | </body> |
| | | </html> |
| | | |