| | |
| | | ,{field: 'model', align: 'center',title: '型号'} |
| | | ,{field: 'standby1$', align: 'center',title: '仓库'} |
| | | ,{field: 'cstateid$', align: 'center',title: '库存状态'} |
| | | ,{field: 'mk', align: 'center',title: '是否盘点', hide:false, templet: function(row){ |
| | | if (row.mk === 'Y') { |
| | | return '<span style="color: #5FB878;">已盘点</span>'; |
| | | } else { |
| | | return '<span style="color: #999;">未盘点</span>'; |
| | | } |
| | | }} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'price', align: 'center',title: '单价', hide: true} |
| | |
| | | }); |
| | | }); |
| | | break; |
| | | case 'clearMk': |
| | | var data = checkStatus.data; |
| | | if (data.length === 0){ |
| | | layer.msg("请选择要清除盘点状态的库存明细", {icon: 2}); |
| | | return; |
| | | } |
| | | // 去重获取库位号列表 |
| | | var locNoSet = new Set(); |
| | | data.forEach(function(elem) { |
| | | if (elem.locNo) { |
| | | locNoSet.add(elem.locNo); |
| | | } |
| | | }); |
| | | var 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}); |
| | | tableReload(false); |
| | | } 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; |
| | | // 冻结 |
| | | case 'frozen': |
| | | let frozenData = checkStatus.data; |