|  |  |  | 
|---|
|  |  |  | var locDetlData = []; | 
|---|
|  |  |  | function getCol() { | 
|---|
|  |  |  | var cols = [ | 
|---|
|  |  |  | {field: 'count', align: 'center',title: '出库数量', edit:'text', width: 130,  style:'color: blue;font-weight: bold'} | 
|---|
|  |  |  | {field: 'countWeight', align: 'center',title: '出库辅数量', edit:'text', width: 130,  style:'color: blue;font-weight: bold'} | 
|---|
|  |  |  | ,{field: 'count', align: 'center',title: '出库数量', width: 130,  style:'color: blue;font-weight: bold'} | 
|---|
|  |  |  | ,{field: 'anfme', align: 'center',title: '库存数量'} | 
|---|
|  |  |  | ,{field: 'locNo$', align: 'center',title: '库位号'} | 
|---|
|  |  |  | ]; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (obj.field === 'countWeight'){ | 
|---|
|  |  |  | 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.weight)) { | 
|---|
|  |  |  | layer.msg("出库数量不得大于库存数量", {icon: 2}); | 
|---|
|  |  |  | modify = false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | let arr = data.origin.split("/") | 
|---|
|  |  |  | let mainAnfme = vle * parseFloat(arr[1]) * parseFloat(arr[0]) | 
|---|
|  |  |  | let flooredNum = Math.floor(mainAnfme * 10000) / 10000; // 截断到小数点后4位 | 
|---|
|  |  |  | data.count = flooredNum | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (modify) { | 
|---|
|  |  |  | data[obj.field] = obj.value; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | layer.msg('请先提取商品库存', {icon: 2}); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | var staNo = $("#staNoSelect").val(); | 
|---|
|  |  |  | var itemId = $("#itemId").val(); | 
|---|
|  |  |  | if (staNo === "" || staNo === null){ | 
|---|
|  |  |  | layer.msg("请选择出库口", {icon: 2}); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | 
|---|
|  |  |  | data.splice(i--, 1); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | data[i]["count"] = data[i]["anfme"]; | 
|---|
|  |  |  | data[i]["countWeight"] = data[i]["weight"]; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | locDetlData.push.apply(locDetlData, data); | 
|---|