/*Obfuscated by JShaman.com*/var layer;var grainData;var form;var table;var element;var compareData=null;var listGrainData;var mapGrainData;var checkDepotIds;$(function(){layui['use'](['layer','laydate','form','table','element'],function(){element=layui['element'];form=layui['form'];layer=layui['layer'];var _0x58cac8=layui['laydate'];table=layui['table'];_0x58cac8['render']({'elem':'#checkDateMore','type':'month','theme':'#7b8e9f','position':'static','done':function(_0x237969,_0x128b69,_0x43918c){flushGrain(_0x237969);}});_0x58cac8['render']({'elem':'#compareCheckDate','type':'month','theme':'#7b8e9f','done':function(_0x5fc2b7,_0x321395,_0x3af6b9){compareStep2(_0x5fc2b7);}});_0x58cac8['render']({'elem':'#printCheckDate','theme':'#7b8e9f'});form['render']();form['on']('select(select_depotId)',function(_0x5b6011){var _0x17bbd8=_0x5b6011['elem'][_0x5b6011['elem']['selectedIndex']]['getAttribute']('type');depotId=$('#depotId')['val']();if(_0x17bbd8==DEPT_TYPE){flushGrain(null);}else{if(socket){socket['close']();}window['location']['href']='../../basic/grain/gateway?depotId='+depotId+'&depotType='+_0x17bbd8;}});form['on']('select(select_batchId)',function(_0x204aaa){var _0x52ee3f=_0x204aaa['value'];if(_0x52ee3f=='0'){showMore();}else{flushGrainByBatchId(_0x52ee3f);}});form['on']('switch(filter_switch)',function(_0x65d107){var _0x3b59c8=_0x65d107['value'];var _0x4ad3f7=_0x65d107['elem']['checked'];if(_0x4ad3f7){if('lay'==_0x3b59c8){$('#switch_row')['prop']('checked',![]);$('#switch_col')['prop']('checked',![]);lay();}if('row'==_0x3b59c8){$('#switch_lay')['prop']('checked',![]);$('#switch_col')['prop']('checked',![]);row();}if('col'==_0x3b59c8){$('#switch_lay')['prop']('checked',![]);$('#switch_row')['prop']('checked',![]);col();}form['render']();}});form['on']('switch(filter_switch2)',function(_0x587125){var _0x900272=_0x587125['value'];var _0x5168fd=_0x587125['elem']['checked'];if(_0x5168fd){if('inner'==_0x900272){$('#switch_all')['prop']('checked',![]);$('#switch_outer')['prop']('checked',![]);display_inside();}if('outer'==_0x900272){$('#switch_all')['prop']('checked',![]);$('#switch_inner')['prop']('checked',![]);display_outside();}if('all'==_0x900272){$('#switch_inner')['prop']('checked',![]);$('#switch_outer')['prop']('checked',![]);display_all();}form['render']();}});table['on']('radio(filterTable)',function(_0x326f59){compareData=_0x326f59['data'];});});initGrainChar3d();initWS(companyId,bizType,userId);});window['onload']=function(){if(depotId){$('#depotId')['val'](depotId);form['render']();flushGrain(null);}};function depotMonitor(){form['on']('select(select_depotId)',function(_0x5d3c76){var _0x578bc6=_0x5d3c76['elem'][_0x5d3c76['elem']['selectedIndex']]['getAttribute']('type');depotId=$('#depotId')['val']();if(_0x578bc6==DEPT_TYPE){flushGrain(null);}else{DEPT_TYPE=_0x578bc6;if(socket){socket['close']();}window['location']['href']='../../basic/grain/gateway?depotId='+depotId+'&depotType='+_0x578bc6;}});}function socketOnMessage(_0x4834f0){if(_0x4834f0['orderResp']=='MSG_SUCCESS'){flushGrain(null);window['parent']['sysNotify'](_0x4834f0['data']);}if(_0x4834f0['orderResp']=='ORDER_INPROGRESS'){showCheckProgress(_0x4834f0['data']);}};function showCheckProgress(_0x542bdb){checkDepotIds=_0x542bdb['depotIds'];var _0x229bc3=_0x542bdb['completeNum']/_0x542bdb['sumNum']*0x64;_0x229bc3=_0x229bc3['toFixed'](0x1);if(_0x542bdb['completeNum']>_0x542bdb['sumNum']){_0x229bc3=0x64;}element['progress']('filter_grain_progress',_0x229bc3+'%');if(_0x542bdb['sumNum']==0x1&&_0x542bdb['completeNum']==0x1){flushGrain(null);}if('INIT'==_0x542bdb['progress']){$('#grain_progress_log')['empty']();layer['open']({'type':0x1,'title':'粮情检测执行中……','area':['600px','400px'],'shade':0x0,'content':$('#dialogCheckProgress'),'btn':['重新执行失败仓','关闭'],'yes':function(){if(!checkDepotIds||checkDepotIds['length']==0x0){layer['msg']('本次沒有执行失败的仓库!');return;}var _0x3798d3=checkDepotIds['join'](',');checkBatchTodoStep2(_0x3798d3);},'cancel':function(){checkDepotIds=null;layer['close'](0x1);},'closeBtn':0x0});}$('#grain_check_sumNum')['text'](_0x542bdb['sumNum']);$('#grain_check_completeNum')['text'](_0x542bdb['completeNum']);$('#grain_check_errorNum')['text'](_0x542bdb['errorNum']);if(_0x542bdb['msg']){if(_0x542bdb['errorTag']){$('#grain_progress_log')['append'](''+_0x542bdb['msg']+'');window['parent']['addMsg'](_0x542bdb['msg']);}else{$('#grain_progress_log')['append']('
  • '+_0x542bdb['msg']+'
  • ');}}}function printSingle(){layer['msg']('开始调用后台打印模板……');toPrintSingle(grainData);}function printBatch(){$('#batchPrintSelect\x20input')['each'](function(){var _0x3fc49e=$(this)['prop']('name');if(_0x3fc49e=='printCheckDate'){return!![];}$(this)['prop']('disabled',![]);$(this)['prop']('checked',![]);});form['render']();initModel();layer['open']({'type':0x1,'title':'批量粮情打印(红色表示没有粮情记录,默认为当天)','area':['690px','450px'],'shade':0x0,'content':$('#batchPrintSelect'),'btn':['全选','反选','重选','执行打印','取消打印'],'yes':function(){var _0x298b92;$('#batchPrintSelect\x20input')['each'](function(){_0x298b92=$(this)['prop']('name');if(_0x298b92=='printCheckDate'||$(this)['prop']('disabled')){}else{$(this)['prop']('checked',!![]);}});form['render']();},'btn2':function(){var _0x108350;$('#batchPrintSelect\x20input')['each'](function(){_0x108350=$(this)['prop']('name');if(_0x108350=='printCheckDate'||$(this)['prop']('disabled')){}else{if($(this)['prop']('checked')){$(this)['prop']('checked',![]);}else{$(this)['prop']('checked',![]);}}});form['render']();return![];},'btn3':function(){var _0x400297;$('#batchPrintSelect\x20input')['each'](function(){_0x400297=$(this)['prop']('name');if(_0x400297=='printCheckDate'||$(this)['prop']('disabled')){}else{$(this)['prop']('checked',![]);}});form['render']();return![];},'btn4':function(){printBatchTodo();},'btn5':function(){layer['close'](0x0);},'closeBtn':0x0});$('#printCheckDate')['prop']('value',dateFtt('yyyy-MM-dd',new Date()));getPrintBatchDepot();};function getPrintBatchDepot(){layer['msg']('验证粮情检测记录……');var _0x5edb62=$('#printCheckDate')['val']();$['ajax']({'type':'POST','url':'../../basic/grain/query-checkDate-map','dataType':'json','contentType':'application/json;charset=UTF-8','data':JSON['stringify']({'checkDate':_0x5edb62}),'success':function(_0x360b43){if(_0x360b43['code']!='0000'){layer['msg'](_0x360b43['msg']);disabledAllSelectDepot();}else{mapGrainData=_0x360b43['data'];updateSelectDepot();}},'error':function(){layer['msg']('批量打印获取粮情信息失败!');}});};function printBatchTodo(){layer['msg']('开始批量生成打印模版……');var _0x55329e;var _0x2960c7;var _0x47a154;var _0x5510d5;var _0x20a375={};$['each'](listDepot,function(_0x2984cd,_0x1ad576){_0x20a375[_0x1ad576['id']]=_0x1ad576;});var _0x4b87ee=CLODOP;_0x4b87ee['PRINT_INIT']('粮情报表');_0x4b87ee['SET_PRINT_PAGESIZE'](0x1,0x0,0x0,'A4');$('#batchPrintSelect\x20input')['each'](function(){if($(this)['prop']('name')=='printCheckDate'){return!![];}_0x47a154=$(this)['prop']('checked');if(_0x47a154){_0x2960c7=$(this)['val']();_0x5510d5=mapGrainData[_0x2960c7];if(!_0x5510d5){return!![];}_0x4b87ee['NewPage']();_0x5510d5['depotData']=_0x20a375[_0x2960c7];_0x55329e=builderModel(_0x5510d5);_0x4b87ee['ADD_PRINT_HTM'](0x1e,0x28,'180mm','100%',_0x55329e);}});layer['msg']('开始调用打印程序预览……');_0x4b87ee['SET_PRINT_MODE']('PRINT_PAGE_PERCENT','Full-Page');_0x4b87ee['PREVIEW']();};function disabledAllSelectDepot(){var _0x197432;$('#batchPrintSelect\x20input')['each'](function(){_0x197432=$(this)['prop']('name');if(_0x197432=='printCheckDate'){return!![];}$(this)['prop']('disabled',!![]);});form['render']();};function updateSelectDepot(){var _0x104280,_0x29febd;$('#batchPrintSelect\x20input')['each'](function(){_0x104280=$(this)['val']();_0x29febd=$(this)['prop']('name');if(_0x29febd=='printCheckDate'){return!![];}if(mapGrainData[_0x104280]){$(this)['prop']('disabled',![]);}else{$(this)['prop']('disabled',!![]);}});form['render']();};function compare(){if(!depotId){layer['msg']('请先选择仓库……');return;}var _0xdc5b57=$('#batchId')['val']();if(!_0xdc5b57){layer['msg']('当前没有可以比较的数据……');return;}if(compareData){flushGrainByBatchId(_0xdc5b57);}layer['open']({'type':0x1,'title':'粮情对比选择','area':['330px','640px'],'shade':0x0,'content':$('#compareSelect'),'btn':['确认对比','取消对比'],'yes':function(){if(compareData){layer['msg']('开始执行批次对比……');compareStep3(grainData,compareData);}else{layer['msg']('没有获取到对比数据!!');}},'btn2':function(){layer['closeAll']();},'closeBtn':0x1});$('#compareCheckDate')['prop']('value',null);compareStep2(null);form['render']();};function compareStep2(_0x455745){if(!depotId){layer['msg']('请先选择仓库!');return;}if(!_0x455745){_0x455745=$('#compareCheckDate')['val']();}var _0x17b3c9={'depotId':depotId,'checkMonth':_0x455745,'extBatchId':grainData['batchId']};$['ajax']({'type':'POST','url':'../../basic/grain/page-list','dataType':'json','contentType':'application/json;charset=UTF-8','data':JSON['stringify'](_0x17b3c9),'success':function(_0x43ced8){if(_0x43ced8['code']!='0000'){layer['msg'](_0x43ced8['msg']);}else{table['render']({'elem':'#tableSelect','height':0x1c2,'data':_0x43ced8['data'],'page':![],'limit':0x64,'skin':'nob','even':!![],'size':'sm','cols':[[{'type':'radio','fixed':'left','title':'选择'},{'field':'receiveDate','title':'检测时间','align':'center'}]]});}},'error':function(){layer['msg']('获取当前仓库检测记录失败,请重新尝试!!');}});};function compareStep3(_0x14ea46,_0xe4fe48){$['ajax']({'type':'POST','url':'../../basic/grain/data-compare','dataType':'json','contentType':'application/json;charset=UTF-8','data':JSON['stringify']({'dataA':_0x14ea46,'dataB':_0xe4fe48}),'success':function(_0x7289bc){if(_0x7289bc['code']!='0000'){layer['msg'](_0x7289bc['msg']);}else{grainData=_0x7289bc['data'];resetGrainChart3d();renderGrainInfo();layer['closeAll']();}},'error':function(){layer['msg']('批次对比出现异常,请重新选择');}});};function flushGrain(_0x1f1232){compareData=null;if(!depotId){layer['msg']('请先选择仓库!');return;}var _0x5419ab={'depotId':depotId,'checkMonth':_0x1f1232};$['ajax']({'type':'POST','url':'../../basic/grain/query-list-data','dataType':'json','contentType':'application/json;charset=UTF-8','data':JSON['stringify'](_0x5419ab),'success':function(_0x3ac741){if(_0x3ac741['code']!='0000'){layer['msg'](_0x3ac741['msg']);clearGrainChart3d();}listGrainData=_0x3ac741['data'];if(!listGrainData){return;}grainData=listGrainData[0x0];resetGrainChart3d();renderGrainInfo();resetSelectBatchId();layer['closeAll']();layer['msg']('更新成功……');},'error':function(){layer['msg']('根据当前条件获取粮情数据渲染图标失败!!');}});};function renderGrainInfo(){var _0x395bd3=grainData['depotData'];$('#depotTypeName')['text'](_0x395bd3['depotTypeName']);$('#storeDate')['text'](_0x395bd3['storeDate']);$('#storageReal')['text'](_0x395bd3['storageReal']);$('#foodVarietyName')['text'](_0x395bd3['foodVarietyName']);$('#perWet')['text'](_0x395bd3['perWet']);$('#depotStatus')['text'](DEPOT_STATUS_MSG(_0x395bd3['depotStatus']));$('#foodLocation')['text'](_0x395bd3['foodLocation']);$('#perImpurity')['text'](_0x395bd3['perImpurity']);$('#storeKeeperName')['text'](_0x395bd3['storeKeeperName']);$('#checkUser')['text'](grainData['checkUser']);$('#tempMax')['text'](grainData['tempMax']);$('#tempAve')['text'](grainData['tempAve']);$('#tempMin')['text'](grainData['tempMin']);$('#tempIn')['text'](grainData['tempIn']<=-0x64?'--':grainData['tempIn']);$('#tempOut')['text'](grainData['tempOut']<=-0x64?'--':grainData['tempOut']);$('#humidityIn')['text'](grainData['humidityIn']<=-0x64?'--':grainData['humidityIn']);$('#humidityOut')['text'](grainData['humidityOut']<=-0x64?'--':grainData['humidityOut']);};function flushGrainByBatchId(_0x131bb5){var _0x3bbe9f;$['each'](listGrainData,function(_0x3ab2ce,_0x506ee4){if(_0x506ee4['batchId']==_0x131bb5){_0x3bbe9f=_0x506ee4;return![];}});if(_0x3bbe9f){grainData=_0x3bbe9f;resetGrainChart3d();renderGrainInfo();layer['msg']('更新成功……');}};function resetSelectBatchId(){$('#batchId')['empty']();$['each'](listGrainData,function(_0x31af7c,_0x3683ea){$('#batchId')['append'](new Option(_0x3683ea['receiveDate'],_0x3683ea['batchId']));});$('#batchId')['append'](new Option('选择时间……','0'));form['render']();};function showMore(){layer['open']({'type':0x1,'title':'选择检测时间','area':['300px','400px'],'shade':0x0,'content':$('#dialogMoreSelect'),'btn':0x0,'closeBtn':0x1});};function checkGrain(){if(!depotId){layer['msg']('请先选择仓库!');return;}layer['msg']('开始执行粮情采集……');var _0x506cb7={'depotId':depotId};$['ajax']({'type':'POST','url':'../../basic/grain/check-single','dataType':'json','contentType':'application/json;charset=UTF-8','data':JSON['stringify'](_0x506cb7),'success':function(_0x3600b5){if(_0x3600b5['code']!='ORDER_SUCCESS'){if(_0x3600b5['msg']){layer['msg'](_0x3600b5['msg']);}else{layer['msg']('执行出现异常,请重试或联系管理员');}}else{layer['msg']('命令已经成功发送,待终端响应……');}},'error':function(){layer['msg']('粮情检测出现异常,执行失败!');}});};function checkGrainBatch(){$('#batchCheckSelect\x20input')['each'](function(){$(this)['prop']('checked',![]);});form['render']();layer['open']({'type':0x1,'title':'批量检测选择仓库','area':['690px','450px'],'shade':0x0,'content':$('#batchCheckSelect'),'btn':['全选','反选','重选','确定检测','取消检测'],'yes':function(){$('#batchCheckSelect\x20input')['each'](function(){$(this)['prop']('checked',!![]);});form['render']();},'btn2':function(){$('#batchCheckSelect\x20input')['each'](function(){if($(this)['prop']('checked')){$(this)['prop']('checked',![]);}else{$(this)['prop']('checked',!![]);}});form['render']();return![];},'btn3':function(){$('#batchCheckSelect\x20input')['each'](function(){$(this)['prop']('checked',![]);});form['render']();return![];},'btn4':function(){return checkBatchTodo();},'btn5':function(){layer['close'](0x0);},'closeBtn':0x0});};function checkBatchTodo(){var _0x3b7c09='';$('#batchCheckSelect\x20input')['each'](function(){if($(this)['prop']('checked')){_0x3b7c09+=$(this)['val']()+',';}});if(_0x3b7c09==''){layer['msg']('请先选择需要检测的仓库……');return![];}layer['msg']('开始执行批量检测……');var _0x4b9084={'depotIds':_0x3b7c09};$['ajax']({'type':'POST','url':'../../basic/grain/check-batch','dataType':'json','contentType':'application/json;charset=UTF-8','data':JSON['stringify'](_0x4b9084),'success':function(_0x1b79b6){if(_0x1b79b6['code']!='ORDER_SUCCESS'){if(_0x1b79b6['msg']){layer['msg'](_0x1b79b6['msg']);}else{layer['msg']('执行出现异常,请重试或联系管理员');}return![];}else{layer['msg']('命令已经成功发送,待终端响应……');return!![];}},'error':function(){layer['msg']('粮情检测出现异常,执行失败!');return![];}});return!![];};function checkBatchTodoStep2(_0x19bcad){layer['msg']('开始执行批量检测……');var _0x10b46e={'depotIds':_0x19bcad};$['ajax']({'type':'POST','url':'../../basic/grain/check-batch','dataType':'json','contentType':'application/json;charset=UTF-8','data':JSON['stringify'](_0x10b46e),'success':function(_0x30f688){if(_0x30f688['code']!='ORDER_SUCCESS'){if(_0x30f688['msg']){layer['msg'](_0x30f688['msg']);}else{layer['msg']('执行出现异常,请重试或联系管理员');}}else{layer['msg']('命令已经成功发送,待终端响应……');}},'error':function(){layer['msg']('粮情检测出现异常,执行失败!');}});};