| | |
| | | var matCodeData = []; |
| | | var currLocNo; |
| | | function getCol() { |
| | | arrRemove(detlCols, "field", "str3"); |
| | | arrRemove(detlCols, "field", "str4") |
| | | arrRemove(detlCols, "field", "str5$") |
| | | arrRemove(detlCols, "field", "str6") |
| | | var cols = [ |
| | | {fixed: 'left', field: 'count', title: '实际数量', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'} |
| | | {fixed: 'left', field: 'count', title: '实际数量', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'}, |
| | | // {field: 'supplier', title: '批号', align: 'center', edit:'text', width: 120}, |
| | | {field: 'source', title: '来源', align: 'center', edit:'text', width: 120}, |
| | | {field: 'vendor', title: '供应商', align: 'center', edit:'text', width: 120} |
| | | ,{field: 'qtyBox', align: 'center', title: '每箱数量(PCS)'} |
| | | // {field: 'allqty', title: '总数量', align: 'center'}, |
| | | // {field: 'allweight', title: '总重量', align: 'center'} |
| | | // ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ]; |
| | | arrRemove(detlCols, "field", "anfme") |
| | |
| | | |
| | | // 页面修改 |
| | | table.on('edit(chooseData)', function (obj) { |
| | | updateMatCodeData(obj.data.matNo,obj.data.supplier, Number(obj.value)); |
| | | if(obj.field === 'count'){ |
| | | updateMatCodeData(obj.data.matNo,obj.data.supplier, Number(obj.value)); |
| | | } |
| | | |
| | | if (obj.field === 'supplier'){ |
| | | for (var i=0;i<matCodeData.length;i++){ |
| | | if (matCodeData[i]["matNo"] === obj.data.matNo && matCodeData[i]["count"] === obj.data.count && matCodeData[i]["qty"] === obj.data.qty){ |
| | | matCodeData[i]["supplier"] = obj.data.supplier; |
| | | } |
| | | } |
| | | } |
| | | if (obj.field === 'source'){ |
| | | for (var i=0;i<matCodeData.length;i++){ |
| | | if (matCodeData[i]["matNo"] === obj.data.matNo && matCodeData[i]["supplier"] === obj.data.supplier){ |
| | | matCodeData[i]["source"] = obj.data.source; |
| | | } |
| | | } |
| | | } |
| | | if (obj.field === 'vendor'){ |
| | | for (var i=0;i<matCodeData.length;i++){ |
| | | if (matCodeData[i]["matNo"] === obj.data.matNo && matCodeData[i]["supplier"] === obj.data.supplier){ |
| | | matCodeData[i]["vendor"] = obj.data.vendor; |
| | | } |
| | | } |
| | | } |
| | | tableIns.reload({data: matCodeData,done:function (res) { |
| | | limit(); |
| | | }}); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | |
| | | layer.msg("请先添加产品"); |
| | | return; |
| | | } |
| | | // debugger |
| | | for (var i=0;i<matCodeData.length;i++){ |
| | | |
| | | if (isNaN(matCodeData[i].count)) { |
| | |
| | | unit: data[i].unit, |
| | | zpallet:zpa, |
| | | supplier:'', |
| | | qtyBox:data[i].str6, |
| | | weight:data[i].weight, |
| | | qty:0 |
| | | }) |
| | | } |