|  |  |  | 
|---|
|  |  |  | var projIndex = 0; | 
|---|
|  |  |  | var myForm=MForm.initForm({ | 
|---|
|  |  |  | invokeUrl:basePath+"/admin/projService/endPl", | 
|---|
|  |  |  | beforeSubmit : function() { | 
|---|
|  |  |  | var fieldArray = $("#dataform").serializeArray(); | 
|---|
|  |  |  | console.log(fieldArray); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | afterSubmit:function(){ | 
|---|
|  |  |  | if (parent.myGrid) { | 
|---|
|  |  |  | parent.myGrid.serchData(); | 
|---|
|  |  |  | 
|---|
|  |  |  | if (rows) { | 
|---|
|  |  |  | var projInfo = plList[projIndex]; | 
|---|
|  |  |  | var idSelect = "#"+projIndex; | 
|---|
|  |  |  | var allGroup = $(".group").length; | 
|---|
|  |  |  | console.log(idSelect); | 
|---|
|  |  |  | var groupLength = $(idSelect + " .group").length; | 
|---|
|  |  |  | for(var i = 0; i < rows.length; i++) { | 
|---|
|  |  |  | var row = rows[i]; | 
|---|
|  |  |  | var nextIndex = groupLength + i + 1; | 
|---|
|  |  |  | var outItemIndex = allGroup + i; | 
|---|
|  |  |  | var html = '<tr class="group">' | 
|---|
|  |  |  | + '<td>'+ nextIndex +'</td>' | 
|---|
|  |  |  | + '<td>'+ row.goods.name +'</td>' | 
|---|
|  |  |  | + '<td><span></span></td>' | 
|---|
|  |  |  | + '<td ><input autocomplete="off"   class="form-control" style="width: 200px;float: left;"  type="text" name="amount" placeholder="实际用量" >' | 
|---|
|  |  |  | + '<td ><input autocomplete="off"   class="form-control" style="width: 200px;float: left;"  type="text" name="outStoreItem['+ outItemIndex +'].amount" placeholder="实际用量" >' | 
|---|
|  |  |  | + '<span style="line-height: 30px;margin-left: 10px;">'+ row.goods.measure +'</span></td>' | 
|---|
|  |  |  | + '<td><input autocomplete="off"   type="hidden" name="skuId" value="'+ row.goods.id +'">' | 
|---|
|  |  |  | + '<input autocomplete="off" type="text" name="remark"  class="form-control" placeholder="配料备注"></td></tr>'; | 
|---|
|  |  |  | + '<td><input autocomplete="off"   type="hidden" name="outStoreItem['+ outItemIndex +'].skuId" value="'+ row.goods.id +'">' | 
|---|
|  |  |  | + '<input autocomplete="off" type="text" name="outStoreItem['+ outItemIndex +'].remark"  class="form-control" placeholder="配料备注"></td></tr>'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | $(idSelect).children(':last').after(html); | 
|---|
|  |  |  | if ($(idSelect).children(':last').length <= 0) { | 
|---|
|  |  |  | $(idSelect).html(html); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | $(idSelect).children(':last').after(html); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|