| | |
| | | <legend>搜索栏</legend> |
| | | <!-- 搜索栏 --> |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <!-- <div class="layui-input-inline" style="margin-top: -10px">--> |
| | | <!-- <select id="crnNo" name="crnNo">--> |
| | | <!-- <option value="" style="display: none">请选择巷道</option>--> |
| | | <!-- <option value="1">1号</option>--> |
| | | <!-- <option value="2">2号</option>--> |
| | | <!-- <option value="3">3号</option>--> |
| | | <!-- <option value="4">4号</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="crnNo" class="layui-input" name="crnNo" type="text" placeholder="请输入" autocomplete="off" style="display: none"> |
| | | <input id="crnNo$" 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="basCrnpQueryBycrnNo" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basCrnpQueryBycrnNoSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off"> |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="maktx" placeholder="物料描述" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="batch" placeholder="批号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="specs" placeholder="规格" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input class="layui-input" type="text" name="maktx" placeholder="物料描述" autocomplete="off">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="frozen" class="layui-input" type="text" autocomplete="off"> |
| | | <option value="">冻结否</option> |
| | | <option value="0">未冻结</option> |
| | | <option value="1">已冻结</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="mk" class="layui-input" type="text" autocomplete="off"> |
| | | <option value="">盘点状态</option> |
| | | <option value="Y">已盘点</option> |
| | | <option value="N">未盘点</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="modi_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | <input class="layui-input layui-laydate-range" name="appe_time" type="text" placeholder="入库起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <!-- 待添加 --> |
| | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn" id="btn-confirm" lay-event="confirm" style="">提取</button> |
| | | <button class="layui-btn layui-btn-normal" id="btn-clear-mk" lay-event="clearMk" style="">清除盘点状态</button> |
| | | </div> |
| | | </script> |
| | | |
| | |
| | | ,{field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | let cstateidIndex = cols.findIndex(col => col.field === 'cstateid$'); |
| | | // if (cstateidIndex !== -1) { |
| | | // cols.splice(cstateidIndex + 1, 0, { |
| | | // field: 'mk', |
| | | // align: 'center', |
| | | // title: '是否盘点', |
| | | // templet: function(row) { |
| | | // if (row.mk === 'Y') { |
| | | // return '<span style="color: #5FB878;">已盘点</span>'; |
| | | // } else { |
| | | // return '<span style="color: #999;">未盘点</span>'; |
| | | // } |
| | | // } |
| | | // }); |
| | | // } |
| | | cols.push({field: 'modiUser$', align: 'center',title: '修改人员', hide: true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'}) |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'appeTime$', align: 'center',title: '入库时间'}) |
| | | return cols; |
| | | } |
| | | |
| | |
| | | switch(obj.event) { |
| | | case 'confirm': |
| | | if (data.length === 0){ |
| | | layer.msg("请选择数据"); |
| | | layer.msg("请选择数据", {icon: 2}); |
| | | return; |
| | | } |
| | | var locNos = []; |
| | | if (data.some(obj => obj.frozen === 1)) { |
| | | layer.msg("冻结的库存不允许出库!"); |
| | | return; |
| | | } |
| | | |
| | | let locNos = []; |
| | | data.forEach(function(elem) { |
| | | locNos.push(elem.locNo); |
| | | }); |
| | |
| | | }) |
| | | parent.addTableData(data); |
| | | break; |
| | | case 'clearMk': |
| | | if (data.length === 0){ |
| | | layer.msg("请选择要清除盘点状态的库位", {icon: 2}); |
| | | return; |
| | | } |
| | | // 去重获取库位号列表 |
| | | let locNoSet = new Set(); |
| | | data.forEach(function(elem) { |
| | | if (elem.locNo) { |
| | | locNoSet.add(elem.locNo); |
| | | } |
| | | }); |
| | | let locNoList = Array.from(locNoSet); |
| | | |
| | | layer.confirm('确定要清除所选库位的盘点状态吗?', {icon: 3, title:'提示'}, function(index){ |
| | | $.ajax({ |
| | | url: baseUrl+"/locMast/clearMk/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | data: JSON.stringify({locNos: locNoList}), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | layer.msg("清除盘点状态成功", {icon: 1}); |
| | | locDetlTableIns.reload(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg || "清除盘点状态失败", {icon: 2}); |
| | | } |
| | | }, |
| | | error: function() { |
| | | layer.msg("请求失败,请稍后重试", {icon: 2}); |
| | | } |
| | | }); |
| | | layer.close(index); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |