| | |
| | | </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"> |
| | |
| | | <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: 'appeTime$', align: 'center',title: '入库时间'}) |
| | |
| | | }) |
| | | 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; |
| | | } |
| | | }); |
| | | |