|  |  | 
 |  |  |         ,{field: 'pakinTime$', title: '入库时间', align: 'center' , sort:true} | 
 |  |  |         ,{field: 'matnr', align: 'center',title: '存货编码',hide:true,edit:true} | 
 |  |  |         ,{field: 'brand', align: 'center',title: '牌号',edit:true} | 
 |  |  |         ,{field: 'batch', align: 'center',title: '批号',edit:true, width: 150, sort:true} | 
 |  |  |         ,{field: 'batch', align: 'center',title: '批号',edit:true, sort:true} | 
 |  |  |         ,{field: 'packageNo', align: 'center',title: '包装号',edit:true, sort:true} | 
 |  |  |         ,{field: 'proDate', align: 'center',title: '生产日期',edit:true, width: 100} | 
 |  |  |         ,{field: 'weight', align: 'center',title: '重量KG',edit:true,totalRow:true} | 
 |  |  | 
 |  |  |         ,{field: 'workshop', align: 'center',title: '生产车间',hide:true,edit:true} | 
 |  |  |         ,{field: 'line', align: 'center',title: '生产线',hide:true,edit:true} | 
 |  |  |         ,{field: 'weightAnfme', align: 'center',title: '剩余重量(KG)',edit:true,totalRow:true} | 
 |  |  |         ,{field: 'qtyAnfme', align: 'center',title: '待出库重量(KG)',hide:true} | 
 |  |  |         ,{field: 'qtyAnfme', align: 'center',title: '待出库重量(KG)',hide:true,edit:true} | 
 |  |  |         ,{field: 'status', align: 'center',title: '状态', templet: setState ,edit:true} | 
 |  |  |         ,{field: 'stockFreeze', align: 'center',title: '库存冻结', templet: '#stockFreezeTpl'} | 
 |  |  |         ,{field: 'stockFreezeBy', align: 'center',title: '操作人员',hide:true} | 
 |  |  |         ,{field: 'stockFreezeDate$', align: 'center',title: '操作日期',hide:true} | 
 |  |  |         ,{align: 'center', title: '流转明细', toolbar: '#tbLook'} | 
 |  |  |         ,{field: 'createTime$', title: '创建时间', align: 'center' , sort:true} | 
 |  |  |         ,{field: 'newBrand', align: 'center',title: '关联牌号',edit:true} | 
 |  |  |         ,{field: 'newBatch', align: 'center',title: '关联批号',edit:true, width: 150, sort:true} | 
 |  |  |         ,{field: 'newPackageNo', align: 'center',title: '关联包装号',edit:true, sort:true} | 
 |  |  |         ,{field: 'createTime$', title: '创建时间', align: 'center' , sort:true,hide:true} | 
 |  |  |         ,{field: 'newBrand', align: 'center',title: '关联牌号',edit:true,hide:true} | 
 |  |  |         ,{field: 'newBatch', align: 'center',title: '关联批号',edit:true, width: 150, sort:true,hide:true} | 
 |  |  |         ,{field: 'newPackageNo', align: 'center',title: '关联包装号',edit:true, sort:true,hide:true} | 
 |  |  |         // ,{field: 'orderNo', align: 'center',title: '单号', hide:true} | 
 |  |  |         // ,{field: 'pakoutTime', align: 'center',title: '出库时间', hide:true} | 
 |  |  |         // ,{field: 'orderWeight', align: 'center',title: '重量', hide:true} | 
 |  |  |         // ,{field: 'handlerBy', align: 'center',title: '经办人', hide:true} | 
 |  |  |         // ,{field: 'transfer', align: 'center',title: '流转形式', hide:true} | 
 |  |  |         ,{field: 'transfer', align: 'center',title: '退货标识', hide:true} | 
 |  |  |         ,{field: 'modifyUser', align: 'center',title: '退货人', hide:true} | 
 |  |  |         ,{field: 'createUser', align: 'center',title: '退货备注', hide:true} | 
 |  |  |         // ,{field: 'customer', align: 'center',title: '客户名称', hide:true} | 
 |  |  |         // ,{field: 'allocate', align: 'center',title: '调拨到', hide:true} | 
 |  |  |         // ,{field: 'memo', align: 'center',title: '备注', hide:true} | 
 |  |  | 
 |  |  |  | 
 |  |  | layui.config({ | 
 |  |  |     base: baseUrl + "/static/layui/lay/modules/" | 
 |  |  | }).use(['table','laydate', 'form', 'admin', 'dropdown'], function() { | 
 |  |  | }).use(['table','laydate', 'form', 'admin', 'xmSelect', 'dropdown'], function() { | 
 |  |  |     var dropdown = layui.dropdown; | 
 |  |  |     var table = layui.table; | 
 |  |  |     var $ = layui.jquery; | 
 |  |  | 
 |  |  |             return $(window).height() - otherHeight - 100; // 返回 number 类型 | 
 |  |  |         }, | 
 |  |  |         //height: 'full', | 
 |  |  |         limit: 16, | 
 |  |  |         limits: [16, 50, 100, 200, 500,2000,5000,10000], | 
 |  |  |         limit: 500, | 
 |  |  |         limits: [16, 50, 100, 200, 500,], | 
 |  |  |         even: true, | 
 |  |  |         toolbar: '#toolbar', | 
 |  |  |         cellMinWidth: 50, | 
 |  |  | 
 |  |  |             }); | 
 |  |  |         } | 
 |  |  |     }); | 
 |  |  |  | 
 |  |  |     // 渲染物料选择 | 
 |  |  |     var matXmSelect = xmSelect.render({ | 
 |  |  |         el: '#mat', | 
 |  |  |         style: { | 
 |  |  |             width: '270px', | 
 |  |  |         }, | 
 |  |  |         autoRow: true, | 
 |  |  |         toolbar: { show: true }, | 
 |  |  |         filterable: true, | 
 |  |  |         remoteSearch: true, | 
 |  |  |         remoteMethod: function(val, cb, show){ | 
 |  |  |             $.ajax({ | 
 |  |  |                 url: baseUrl+"/pla/batch/all/get/kv", | 
 |  |  |                 headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                 data: { | 
 |  |  |                     condition: val | 
 |  |  |                 }, | 
 |  |  |                 method: 'POST', | 
 |  |  |                 success: function (res) { | 
 |  |  |                     if (res.code === 200){ | 
 |  |  |                         cb(res.data) | 
 |  |  |                     } else { | 
 |  |  |                         cb([]); | 
 |  |  |                         layer.msg(res.msg, {icon: 2}); | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |             }); | 
 |  |  |         } | 
 |  |  |     }) | 
 |  |  |  | 
 |  |  |     // 复选框事件 | 
 |  |  |     table.on('checkbox(plaDetl)', function(obj){ | 
 |  |  | 
 |  |  |         if(customValue !== undefined){ | 
 |  |  |             searchData['type'] = customValue | 
 |  |  |         } | 
 |  |  |         if(searchData.select){ | 
 |  |  |             searchData.batch = searchData.select; | 
 |  |  |             searchData.select = null; | 
 |  |  |         } | 
 |  |  |         (child ? parent.tableIns : tableIns).reload({ | 
 |  |  |             where: searchData, | 
 |  |  |             page: { | 
 |  |  | 
 |  |  |  | 
 |  |  |         for(var i=0; i<data.length; i++){ | 
 |  |  |             if(data[i].LAY_CHECKED){ | 
 |  |  |                 if(data[i].status === "暂入库" || data[i].status === "待入库" || data[i].status === "全部出库"|| data[i].weightAnfme <= data[i].qtyAnfme){ | 
 |  |  |                 if(data[i].status === "暂入库" || data[i].status === "待入库" || data[i].status === "全部出库"|| data[i].weightAnfme < data[i].qtyAnfme){ | 
 |  |  |                     layer.msg("选中的明细还未入库或者已全部出库或者没有剩余可出重量,请重新选择"); | 
 |  |  |                     return; | 
 |  |  |                 } | 
 |  |  | 
 |  |  |                     layer.msg("选中的明细中含有多种牌号,请重新选择"); | 
 |  |  |                     return; | 
 |  |  |                 } | 
 |  |  |                 if(data[i].stockFreeze === 0){ | 
 |  |  |                     layer.msg("选中的明细中含有冻结的库存,请解冻后操作"); | 
 |  |  |                 //if (data[i].zpalletType == null && data[i].packageType == null && data[i].massState == null) { | 
 |  |  |                 if (typeof data[i].massState === 'undefined' || data[i].massState === null || data[i].massState.trim().length === 0){ | 
 |  |  |                     layer.msg("质量指标未上传"); | 
 |  |  |                     return; | 
 |  |  |                 } | 
 |  |  |                 // if(data[i].stockFreeze === 0){ | 
 |  |  |                 //     layer.msg("选中的明细中含有冻结的库存,请解冻后操作"); | 
 |  |  |                 //     return; | 
 |  |  |                 // } | 
 |  |  |                 dataSave.push(data[i]); | 
 |  |  |             }else { | 
 |  |  |                 dataOld.push(data[i]); |