| | |
| | | <form id="detail" class="layui-form" style="text-align: center"> |
| | | <div class="layui-form layui-card-header"> |
| | | <div class="layui-inline" style="width:83%;margin-top: 0px;margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>订单号 :</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="orderNo" class="layui-input" type="text" lay-verify="required" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:40%;margin-top: 0px;margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>客户名称:</label> |
| | | <label class="layui-form-label"><span class="not-null">*</span>订单 号:</label> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="customer" class="layui-input" type="text" style="display: none" lay-verify="required"> |
| | | <input id="customerV" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" onfocus=this.blur()> |
| | | <input id="orderNo" class="layui-input" type="text" style="display: none" lay-verify="required"> |
| | | <input id="orderNoV" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="locOwnerQueryBylocOwner" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="locOwnerQueryBylocOwnerSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | <input class="cool-auto-complete-window-input" data-key="orderQueryByorderId" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="orderQueryByorderIdSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:40%;margin-top: 0px;margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>客户电话:</label> |
| | | <label class="layui-form-label"><span class="not-null">*</span>牌 号:</label> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="maktx" class="layui-input" type="text" style="display: none" lay-verify="required"> |
| | | <input id="maktxV" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="orderDetlQueryByMaktx" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="orderDetlQueryByMaktxSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:40%; margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>订单重量:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="phone" class="layui-input" type="text" lay-verify="required" readonly="readonly"> |
| | | <input id="weight" class="layui-input" type="text" lay-verify="required" readonly="readonly"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:40%;margin-top: 0px;margin-bottom: 5px;"> |
| | | <label class="layui-form-label">客户名称:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="customer" class="layui-input" type="text" readonly="readonly"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:40%;margin-top: 0px;margin-bottom: 5px;"> |
| | | <label class="layui-form-label">客户电话:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="phone" class="layui-input" type="text" readonly="readonly"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:83%; margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>客户地址:</label> |
| | | <label class="layui-form-label">客户地址:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="addr" class="layui-input" type="text" lay-verify="required" readonly="readonly"> |
| | | <input id="addr" class="layui-input" type="text" readonly="readonly"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:83%; margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>发货重量:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="weight" class="layui-input" type="text" lay-verify="required" placeholder="KG"> |
| | | <input id="qtyWeight" class="layui-input" type="text" lay-verify="required" readonly="readonly"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form layui-card-header"> |
| | | <div class="layui-inline" style="width:83%; margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>调拨到 :</label> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="allocate" class="layui-input" type="text" style="display: none" lay-verify="required"> |
| | | <input id="allocateV" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="configTypeQueryByAllocate" data-value="allocate" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="configTypeQueryByAllocateSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | <label class="layui-form-label">调拨 到:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="allocate" class="layui-input" type="text" readonly="readonly"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:83%; margin-bottom: 5px;"> |
| | |
| | | <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/pla/plaDetl.js" charset="utf-8"></script> |
| | | |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="editForm" lay-filter="editForm" class="layui-form" style="text-align: center"> |
| | | <table class="layui-table" id="detailTable" lay-filter="detailTable"></table> |
| | | <div class="layui-btn-container layui-form-item"> |
| | | <button class="layui-btn layui-btn-normal" type="button" lay-submit ew-event="closeDialog">取消</button> |
| | | <button class="layui-btn layui-btn-normal" type="button" lay-submit lay-filter="detailEditSubmit" lay-submit>保存</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | |
| | | |
| | | </html> |
| | | <script> |
| | | |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | return; |
| | | } |
| | | }); |
| | | |
| | | var checkData = []; |
| | | var detailData = []; |
| | | var deliveryTime; |
| | | function child(data){ |
| | | checkData = data; |
| | | var allWeight = 0; |
| | | for (var i in checkData){ |
| | | allWeight += (checkData[i].weightAnfme - checkData[i].qtyAnfme) |
| | | } |
| | | $('#qtyWeight').val(allWeight); |
| | | delivery(); |
| | | |
| | | } |
| | | |
| | | //显示4天内预约出库的时间 |
| | | function delivery(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/plaQty/delivery/auth", |
| | |
| | | var layer = layui.layer; |
| | | var table = layui.table; |
| | | |
| | | // 数据修改动作 |
| | | form.on('submit(edit)', function () { |
| | | var dataList = []; |
| | | for (var i in checkData){ |
| | | var data = { |
| | | "batch" : checkData[i].batch, |
| | | "packageNo" : checkData[i].packageNo, |
| | | "weight" : checkData[i].weightAnfme - checkData[i].qtyAnfme, |
| | | } |
| | | dataList.push(data); |
| | | } |
| | | if(detailData.length > 0){ |
| | | dataList = detailData; |
| | | } |
| | | layer.open({ |
| | | type: 1, |
| | | title: "数量修改", |
| | | content: $('#editDialog').html(), |
| | | area: '700px', |
| | | success: function (layero, dIndex) { |
| | | // 明细表格 |
| | | tableIns = table.render({ |
| | | elem: '#detailTable', |
| | | data: dataList, |
| | | limit: 100, |
| | | even: true, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {field: 'batch', title: '批号', width: 160}, |
| | | {field: 'packageNo', title: '包号', width: 200}, |
| | | {field: 'weight', title: '数量',edit: true}, |
| | | ]], |
| | | }); |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | // 数据提交动作 |
| | | form.on('submit(save)', function () { |
| | | |
| | | for(var i in checkData){ |
| | | checkData[i].packageType = $('#packageTypeV').val(); |
| | | checkData[i].zpalletType = $('#zpalletTypeV').val(); |
| | | checkData[i].filmWrap = $('#filmWrapV').val(); |
| | | checkData[i].step = 3; |
| | | if($('#maktxV').val() != checkData[0].brand){ |
| | | layer.msg("选中的库存牌号与订单牌号不一致,请重新选择订单"); |
| | | return; |
| | | } |
| | | |
| | | checkData[0].type = 'sellOut'; |
| | | for (var i in checkData){ |
| | | checkData[i].type = 'sellOut'; |
| | | checkData[i].orderNo = $('#orderNoV').val(); |
| | | checkData[i].customer = $('#customer').val(); |
| | | checkData[i].phone = $('#phone').val(); |
| | | checkData[i].addr = $('#addr').val(); |
| | | checkData[i].orderWeight = detailData[i] ? detailData[i].weight : checkData[i].weightAnfme; |
| | | checkData[i].allocate = $('#allocate').val(); |
| | | checkData[i].memo = $('#memo').val(); |
| | | checkData[i].pakoutTime = deliveryTime; |
| | | } |
| | | |
| | | checkData[0].orderNo = $('#orderNo').val(); |
| | | checkData[0].customer = $('#customerV').val(); |
| | | checkData[0].phone = $('#phone').val(); |
| | | checkData[0].addr = $('#addr').val(); |
| | | checkData[0].orderWeight = $('#weight').val(); |
| | | checkData[0].allocate = $('#allocateV').val(); |
| | | checkData[0].memo = $('#memo').val(); |
| | | if(!deliveryTime){ |
| | | layer.msg("请选择发货时间"); |
| | | return; |
| | | } |
| | | checkData[0].pakoutTime = deliveryTime; |
| | | |
| | | $.ajax({ |
| | | url: baseUrl+"/pla/sellout/auth", |
| | |
| | | }) |
| | | }); |
| | | |
| | | form.on('submit(detailEditSubmit)', function () { |
| | | |
| | | detailData = table.cache.detailTable; |
| | | var allWeight = +0; |
| | | for (var i in checkData){ |
| | | //检测修改的数量是否小于等于最大可出库数量 |
| | | if(detailData[i].weight <= checkData[i].weightAnfme - checkData[i].qtyAnfme){ |
| | | checkData[i].orderWeight = detailData[i].weight; |
| | | allWeight = allWeight + Number(detailData[i].weight); |
| | | }else { |
| | | layer.msg("批号:" + detailData[i].batch + ",包号:" + detailData[i].packageNo + "可出库重量小于修改后的数量,请重新填写"); |
| | | return; |
| | | } |
| | | } |
| | | $('#qtyWeight').val(allWeight); |
| | | layer.closeAll(); |
| | | }) |
| | | |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |