|  |  | 
 |  |  | var checkStatus = []; | 
 |  |  | var dataCheck = []; | 
 |  |  | var admin; | 
 |  |  | var printData = []; | 
 |  |  | var layDate; | 
 |  |  | function getCol() { | 
 |  |  |     var cols = [ | 
 |  |  |         {field: 'id', title: 'id', align: 'center',hide:true} | 
 |  |  |         ,{type: 'checkbox'} | 
 |  |  |         ,{type: 'checkbox',totalRow:true} | 
 |  |  |         ,{field:'id', width:80, title: '', sort: true, totalRowText: '合计:',hide: true} | 
 |  |  |         ,{field: 'pakinTime$', title: '入库时间', align: 'center' , sort:true} | 
 |  |  |         ,{field: 'owner', align: 'center',title: '主体',edit:true} | 
 |  |  |         ,{field: 'type', align: 'center',title: '物资类别',hide:true,edit:true} | 
 |  |  |         ,{field: 'proOrderNo', align: 'center',title: '生产订单编号',hide:true,edit:true} | 
 |  |  |         ,{field: 'workshop', align: 'center',title: '生产车间',hide:true,edit:true} | 
 |  |  |         ,{field: 'line', align: 'center',title: '生产线',hide:true,edit: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} | 
 |  |  |         ,{field: 'packageType', align: 'center',title: '包装类型',edit:true} | 
 |  |  |         ,{field: 'zpalletType', align: 'center',title: '托盘类型',edit:true} | 
 |  |  |         ,{field: 'weight', align: 'center',title: '重量KG',edit:true,totalRow:true} | 
 |  |  |         ,{field: 'filmWrap', align: 'center',title: '缠膜',edit:true,hide:true} | 
 |  |  |         ,{field: 'fingerMelting', align: 'center',title: '熔指,g/10min',edit:true} | 
 |  |  |         ,{field: 'water', align: 'center',title: '水分,ppm', hide:true,edit:true} | 
 |  |  |         ,{field: 'fusingPoint', align: 'center',title: '熔点,℃',edit:true} | 
 |  |  |         ,{field: 'vadf1', align: 'center',title: '挥发段,%', hide:true,edit:true} | 
 |  |  |         ,{field: 'vadf2', align: 'center',title: '分解段,%', hide:true,edit:true} | 
 |  |  |         ,{field: 'fingerMelting', align: 'center',title: '熔指,g/10min',edit:true} | 
 |  |  |         ,{field: 'water', align: 'center',title: '水分,ppm', hide:true,edit:true} | 
 |  |  |         ,{field: 'fusingPoint', align: 'center',title: '熔点,℃',edit:true} | 
 |  |  |         ,{field: 'vadf1', align: 'center',title: '挥发段,%', hide:true,edit:true} | 
 |  |  |         ,{field: 'vadf2', align: 'center',title: '分解段,%', hide:true,edit:true} | 
 |  |  |         ,{field: 'yellowness', align: 'center',title: '黄度',edit:true} | 
 |  |  |         ,{field: 'opacity', align: 'center',title: '不透明度,%',edit:true} | 
 |  |  |         ,{field: 'opacity', align: 'center',title: '不透明度,%',edit:true} | 
 |  |  |         ,{field: 'l', align: 'center',title: 'L*', hide:true,edit:true} | 
 |  |  |         ,{field: 'a', align: 'center',title: 'a*', hide:true,edit:true} | 
 |  |  |         ,{field: 'b', align: 'center',title: 'b*', hide:true,edit:true} | 
 |  |  |         ,{field: 'fillIn', align: 'center',title: '填充,%',hide:true,edit:true} | 
 |  |  |         ,{field: 'str1', align: 'center',title: '拉伸强度,MPa',hide:true,edit:true} | 
 |  |  |         ,{field: 'str2', align: 'center',title: '断裂伸长率,%',hide:true,edit:true} | 
 |  |  |         ,{field: 'str3', align: 'center',title: '缺口冲击,KJ/m2',hide:true,edit:true} | 
 |  |  |         ,{field: 'str4', align: 'center',title: '维卡,℃',hide:true,edit:true} | 
 |  |  |         ,{field: 'str5', align: 'center',title: '半结晶时间,min',hide:true,edit:true} | 
 |  |  |         ,{field: 'str6', align: 'center',title: '结晶度.%',hide:true,edit:true} | 
 |  |  |         ,{field: 'fillIn', align: 'center',title: '填充,%',hide:true,edit:true} | 
 |  |  |         ,{field: 'str1', align: 'center',title: '拉伸强度,MPa',hide:true,edit:true} | 
 |  |  |         ,{field: 'str2', align: 'center',title: '断裂伸长率,%',hide:true,edit:true} | 
 |  |  |         ,{field: 'str3', align: 'center',title: '缺口冲击,KJ/m2',hide:true,edit:true} | 
 |  |  |         ,{field: 'str4', align: 'center',title: '维卡,℃',hide:true,edit:true} | 
 |  |  |         ,{field: 'str5', align: 'center',title: '半结晶时间,min',hide:true,edit:true} | 
 |  |  |         ,{field: 'str6', align: 'center',title: '结晶度,%',hide:true,edit:true} | 
 |  |  |         ,{field: 'packageType', align: 'center',title: '包装类型',edit:true} | 
 |  |  |         ,{field: 'zpalletType', align: 'center',title: '托盘类型',edit:true} | 
 |  |  |         ,{field: 'massState', align: 'center',title: '质量状态',edit:true} | 
 |  |  |         ,{field: 'problem', align: 'center',title: '备注',edit:true,hide:true} | 
 |  |  |         ,{field: 'direction', align: 'center',title: '应用方向',edit:true,hide:true} | 
 |  |  |         ,{field: 'position', align: 'center',title: '存放位置',edit:true,hide:true} | 
 |  |  |         ,{field: 'stash', align: 'center',title: '仓库',edit:true,hide:true} | 
 |  |  |         ,{field: 'locNo', align: 'center',title: '库位',edit:true} | 
 |  |  |         ,{field: 'weightAnfme', align: 'center',title: '剩余重量(KG)',edit:true} | 
 |  |  |         ,{field: 'qtyAnfme', align: 'center',title: '待出库重量(KG)',hide:true} | 
 |  |  |         ,{field: 'owner', align: 'center',title: '主体',edit:true} | 
 |  |  |         ,{field: 'type', align: 'center',title: '物资类别',hide:true,edit:true} | 
 |  |  |         ,{field: 'proOrderNo', align: 'center',title: '生产订单编号',hide:true,edit: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,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,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/" | 
 |  |  | }).extend({ | 
 |  |  |     dropdown: 'dropdown/dropdown', | 
 |  |  | }).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; | 
 |  |  |     var layer = layui.layer; | 
 |  |  |     var layDate = layui.laydate; | 
 |  |  |     laydate = layui.laydate; | 
 |  |  |     var form = layui.form; | 
 |  |  |     admin = layui.admin; | 
 |  |  |  | 
 |  |  |     // 日期时间范围 | 
 |  |  |     laydate.render({ | 
 |  |  |         elem: '#ID-laydate-range-datetime', | 
 |  |  |         type: 'datetime', | 
 |  |  |         range: true | 
 |  |  |     }); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     // 数据渲染 | 
 |  |  |     tableIns = table.render({ | 
 |  |  | 
 |  |  |         headers: {token: localStorage.getItem('token')}, | 
 |  |  |         url: baseUrl+'/pla/list/auth?step=2', | 
 |  |  |         page: true, | 
 |  |  |         limit: 16, | 
 |  |  |         limits: [16, 30, 50, 100, 200, 500], | 
 |  |  |         totalRow: true, // 开启合计行 | 
 |  |  |         height: function(){ | 
 |  |  |             var otherHeight = $('.function-area').outerHeight() + $('#search-box').outerHeight(); // 自定义其他区域的高度 | 
 |  |  |             console.log($(window).height() - otherHeight); | 
 |  |  |             return $(window).height() - otherHeight - 100; // 返回 number 类型 | 
 |  |  |         }, | 
 |  |  |         //height: 'full', | 
 |  |  |         limit: 500, | 
 |  |  |         limits: [16, 50, 100, 200, 500,], | 
 |  |  |         even: true, | 
 |  |  |         toolbar: '#toolbar', | 
 |  |  |         cellMinWidth: 50, | 
 |  |  |         cols: [getCol()], | 
 |  |  |         cols: [function(){ | 
 |  |  |             var arr = getCol(); | 
 |  |  |  | 
 |  |  |             // 初始化筛选状态 | 
 |  |  |             var local = layui.data('table-filter-test'); // 获取对应的本地记录 | 
 |  |  |             layui.each(arr, function(index, item){ | 
 |  |  |                 if(item.field in local){ | 
 |  |  |                     item.hide = local[item.field]; | 
 |  |  |                 } | 
 |  |  |             }); | 
 |  |  |             return arr; | 
 |  |  |         }() ], | 
 |  |  |         where:{ | 
 |  |  |             type: function() { | 
 |  |  |                 const tabPosition = JSON.parse(sessionStorage.getItem('easyweb-iframe_tempData')).tabPosition | 
 |  |  |                 return tabPosition.match(/\d+$/)[0] === '90646' ? '改性树脂' : | 
 |  |  |                     (tabPosition.match(/\d+$/)[0] === '90657' ? '纯树脂' : '') | 
 |  |  |                  } | 
 |  |  |             }, | 
 |  |  |         request: { | 
 |  |  |             pageName: 'curr', | 
 |  |  |             pageSize: 'limit' | 
 |  |  |         }, | 
 |  |  |         parseData: function (res) { | 
 |  |  |             console.log(res) | 
 |  |  |             return { | 
 |  |  |                 'code': res.code, | 
 |  |  |                 'msg': res.msg, | 
 |  |  |                 'count': res.data.total, | 
 |  |  |                 'data': res.data.records | 
 |  |  |                 'data': res.data.records, | 
 |  |  |             } | 
 |  |  |         }, | 
 |  |  |         response: { | 
 |  |  |             statusCode: 200 | 
 |  |  |         }, | 
 |  |  |         done: function(res, curr, count) { | 
 |  |  |             // 记录筛选状态 | 
 |  |  |             var that = this; | 
 |  |  |             that.elem.next().on('mousedown', 'input[lay-filter="LAY_TABLE_TOOL_COLS"]+', function(){ | 
 |  |  |                 var input = $(this).prev()[0]; | 
 |  |  |                 // 此处表名可任意定义 | 
 |  |  |                 layui.data('table-filter-test', { | 
 |  |  |                     key: input.name | 
 |  |  |                     ,value: input.checked | 
 |  |  |                 }) | 
 |  |  |             }); | 
 |  |  |  | 
 |  |  |             //$(".lavui-table-grid-down").hide(); | 
 |  |  |             if (res.code === 403) { | 
 |  |  |                 top.location.href = baseUrl+"/"; | 
 |  |  |             } | 
 |  |  | 
 |  |  |         } | 
 |  |  |     }); | 
 |  |  |  | 
 |  |  |     //滚动body,header跟随滚动 | 
 |  |  |     $('.layui-table-body').on('scroll', function(e) { | 
 |  |  |         var leftPx = $(e.target).scrollLeft(); //获取表格body,滚动条距离左边的长度 | 
 |  |  |         var left = 'translateX(-' + leftPx + 'px)'; | 
 |  |  |         $('.layui-table-header .layui-table').css('transform', left); //设置表格header的内容反向(-)移动 | 
 |  |  |     // 渲染物料选择 | 
 |  |  |     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){ | 
 |  |  |         // console.log(obj); // 查看对象所有成员 | 
 |  |  |         // console.log(obj.checked); // 当前是否选中状态 | 
 |  |  |         // console.log(obj.data); // 选中行的相关数据 | 
 |  |  |         // console.log(obj.type); // 若触发的是全选,则为:all;若触发的是单选,则为:one | 
 |  |  |         var checkStatus = table.checkStatus(obj.config.id) | 
 |  |  |         var selectedNum = checkStatus.data.length; | 
 |  |  |         var weightAll = 0; | 
 |  |  |         var weightAnfmeAll = 0; | 
 |  |  |  | 
 |  |  |         for (var i in checkStatus.data){ | 
 |  |  |             weightAll += checkStatus.data[i].weight; | 
 |  |  |             weightAnfmeAll += checkStatus.data[i].weightAnfme; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         $('.layui-table-total').find('.laytable-cell-1-0-1').text(selectedNum); | 
 |  |  |         $('.layui-table-total').find('.laytable-cell-1-0-9').text(weightAll); | 
 |  |  |         $('.layui-table-total').find('.laytable-cell-1-0-41').text(weightAnfmeAll); | 
 |  |  |  | 
 |  |  |     }); | 
 |  |  |  | 
 |  |  |     // 行单击事件( 双击事件为: rowDouble ) | 
 |  |  |     table.on('row(plaDetl)', function(obj){ | 
 |  |  |  | 
 |  |  |     }); | 
 |  |  |  | 
 |  |  |     table.on('tool(plaDetl)', function (obj) { | 
 |  |  | 
 |  |  |                         headers: {token: localStorage.getItem('token')}, | 
 |  |  |                         url: baseUrl+'/plaQty/list/auth', | 
 |  |  |                         where: { | 
 |  |  |                             brand: data.brand, | 
 |  |  |                             batch: data.batch, | 
 |  |  |                             package_no: data.packageNo | 
 |  |  |                         }, | 
 |  |  | 
 |  |  |                     }); | 
 |  |  |                 } | 
 |  |  |             }); | 
 |  |  |  | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |     }) | 
 |  |  |  | 
 |  |  |     // 监听头工具栏事件 | 
 |  |  |     table.on('toolbar(plaDetl)', function (obj) { | 
 |  |  |         var checkStatus = table.checkStatus(obj.config.id) | 
 |  |  |         printData = checkStatus; | 
 |  |  |         switch(obj.event) { | 
 |  |  |             case 'updateData': | 
 |  |  |                 var data = checkStatus.data; | 
 |  |  | 
 |  |  |                     }); | 
 |  |  |                 } | 
 |  |  |                 break; | 
 |  |  |             // 批量打印 | 
 |  |  |             case "btnPrintBatch": | 
 |  |  |                 printMatCodeNos = []; | 
 |  |  |                 var data = checkStatus.data; | 
 |  |  |                 if (data.length === 0){ | 
 |  |  |                     layer.msg('请选择打印数据'); | 
 |  |  |                 } else { | 
 |  |  |                     layer.open({ | 
 |  |  |                         type: 1, | 
 |  |  |                         area: ['600px', '750px'], | 
 |  |  |                         title: '批量打印 [数量'+ data.length +']', | 
 |  |  |                         shadeClose: true, | 
 |  |  |                         content: $('#printDataDiv'), | 
 |  |  |                         success: function(layero, index){ | 
 |  |  |                             for (var i = 0; i<data.length;i++) { | 
 |  |  |                                 printMatCodeNos.push(data[i].matnr); | 
 |  |  |                             } | 
 |  |  |                         }, | 
 |  |  |                         end: function () { | 
 |  |  |                         } | 
 |  |  |                     }); | 
 |  |  |                 } | 
 |  |  |                 break; | 
 |  |  |         } | 
 |  |  |     }) | 
 |  |  |  | 
 |  |  |     // 模板选择 | 
 |  |  |     form.on('radio(selectTemplateRadio)', function (data) { | 
 |  |  |         $('.template-preview').hide(); | 
 |  |  |         $('#template-preview-'+data.value).show(); | 
 |  |  |     }); | 
 |  |  |  | 
 |  |  |     // 开始打印 | 
 |  |  |     form.on('submit(doPrint)', function (data) { | 
 |  |  |         var templateNo = data.field.selectTemplate; | 
 |  |  |         var templateDom = $("#templatePreview"+templateNo); | 
 |  |  |         var className = templateDom.attr("class"); | 
 |  |  |         layer.closeAll(); | 
 |  |  |         for (let i=0;i<printData.data.length;i++){ | 
 |  |  |             if (className === 'template-barcode') { | 
 |  |  |                 printData.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=1¶m="+(printData.data[i].brand+";"+printData.data[i].batch+";"+printData.data[i].packageNo+";"+printData.data[i].line) | 
 |  |  |             } else { | 
 |  |  |                 printData.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=2¶m="+(printData.data[i].brand+";"+printData.data[i].batch+";"+printData.data[i].packageNo+";"+printData.data[i].line) | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         var tpl = templateDom.html(); | 
 |  |  |         var template = Handlebars.compile(tpl); | 
 |  |  |         var html = template(printData); | 
 |  |  |         var box = $("#box"); | 
 |  |  |         box.html(html);box.show(); | 
 |  |  |         box.print({mediaPrint:true}); | 
 |  |  |         box.hide(); | 
 |  |  |         // $.ajax({ | 
 |  |  |         //     url: baseUrl+"/pla/print/auth", | 
 |  |  |         //     headers: {'token': localStorage.getItem('token')}, | 
 |  |  |         //     data: JSON.stringify(printData.data), | 
 |  |  |         //     contentType:'application/json;charset=UTF-8', | 
 |  |  |         //     method: 'POST', | 
 |  |  |         //     async: false, | 
 |  |  |         //     success: function (res) { | 
 |  |  |         //         if (res.code === 200){ | 
 |  |  |         //             layer.closeAll(); | 
 |  |  |         //             for (let i=0;i<res.data.length;i++){ | 
 |  |  |         //                 var templateDom = $("#templatePreview"+templateNo); | 
 |  |  |         //                 var className = templateDom.attr("class"); | 
 |  |  |         //                 if (className === 'template-barcode') { | 
 |  |  |         //                     res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=1¶m="+res.data[i].matnr; | 
 |  |  |         //                 } else { | 
 |  |  |         //                     res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=2¶m="+res.data[i].matnr; | 
 |  |  |         //                 } | 
 |  |  |         //             } | 
 |  |  |         //             var tpl = templateDom.html(); | 
 |  |  |         //             var template = Handlebars.compile(tpl); | 
 |  |  |         //             var html = template(res); | 
 |  |  |         //             var box = $("#box"); | 
 |  |  |         //             box.html(html);box.show(); | 
 |  |  |         //             box.print({mediaPrint:true}); | 
 |  |  |         //             box.hide(); | 
 |  |  |         //         } else if (res.code === 403){ | 
 |  |  |         //             top.location.href = baseUrl+"/"; | 
 |  |  |         //         }else { | 
 |  |  |         //             layer.msg(res.msg) | 
 |  |  |         //         } | 
 |  |  |         //     } | 
 |  |  |         // }) | 
 |  |  |     }); | 
 |  |  |  | 
 |  |  |     // 搜索栏搜索事件 | 
 |  |  |     form.on('submit(search)', function (data) { | 
 |  |  | 
 |  |  |         tableReload(false); | 
 |  |  |     }); | 
 |  |  |  | 
 |  |  |     // 用来标识搜索重置时,改性树脂和纯树脂从点击事件传过来名称,进行物质类别限定 | 
 |  |  |     let customValue = undefined | 
 |  |  |     // 重置事件 | 
 |  |  |     form.on('submit(reset)', function (data) { | 
 |  |  |         customValue = $(this).attr('data-value'); | 
 |  |  |         reset(); | 
 |  |  |     }); | 
 |  |  |  | 
 |  |  | 
 |  |  |         clearFormVal($('#search-box')); | 
 |  |  |         matCodeData = []; | 
 |  |  |         tableReload(); | 
 |  |  |         locTips(false); | 
 |  |  |  | 
 |  |  |         // locTips(false); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     // 重载表格 | 
 |  |  | 
 |  |  |         $.each($('#search-box [name]').serializeArray(), function() { | 
 |  |  |             searchData[this.name] = this.value; | 
 |  |  |         }); | 
 |  |  |         if(customValue !== undefined){ | 
 |  |  |             searchData['type'] = customValue | 
 |  |  |         } | 
 |  |  |         if(searchData.select){ | 
 |  |  |             searchData.batch = searchData.select; | 
 |  |  |             searchData.select = null; | 
 |  |  |         } | 
 |  |  |         (child ? parent.tableIns : tableIns).reload({ | 
 |  |  |             where: searchData, | 
 |  |  |             page: { | 
 |  |  | 
 |  |  |             } | 
 |  |  |         }); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     $(document).on('click','#updateZpallet',function (){ | 
 |  |  |         debugger; | 
 |  |  |     }) | 
 |  |  |     $("[name='layTableCheckbox']").click(function(){ // 通过name属性选取元素,并添加点击事件 | 
 |  |  |         alert("Hello World!"); // 在控制台输出提示信息 | 
 |  |  |         debugger | 
 |  |  |     }); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  | 
 |  |  |  | 
 |  |  |         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]); | 
 |  |  | 
 |  |  |     var res = JSON.parse(evt.target.responseText); | 
 |  |  |     layer.msg(res.msg, {icon: 2}); | 
 |  |  | } | 
 |  |  | function clearTable(){ | 
 |  |  |  | 
 |  |  | } | 
 |  |  |  |