CZT
2023-09-06 71c4fa1e27f75ae4b765c95c67a3069c84dc72ba
1
/*Obfuscated by JShaman.com*/var layer;var grainChar3d;var grainData;var numX=0x7,numY=0x5,numZ=0x4;var form;var table;var compareData=null;var listGrainData;var mapGrainData;$(function(){layui['use'](['layer','laydate','form','table'],function(){form=layui['form'];layer=layui['layer'];var _0x333384=layui['laydate'];table=layui['table'];_0x333384['render']({'elem':'#checkDateMore','type':'month','theme':'#7b8e9f','position':'static','done':function(_0x456360,_0x2e5307,_0x1dc8f1){flushGrain(_0x456360);}});_0x333384['render']({'elem':'#compareCheckDate','type':'month','theme':'#7b8e9f','done':function(_0x28283a,_0x356092,_0x46c80f){compareStep2(_0x28283a);}});_0x333384['render']({'elem':'#printCheckDate','theme':'#7b8e9f'});form['render']();form['on']('select(select_depotId)',function(_0x2653b1){var _0x4744ad=_0x2653b1['elem'][_0x2653b1['elem']['selectedIndex']]['getAttribute']('type');depotId=$('#depotId')['val']();if(_0x4744ad==DEPT_TYPE){flushGrain(null);}else{DEPT_TYPE=_0x4744ad;if(socket){socket['close']();}window['location']['href']='../../basic/grain/gateway?depotId='+depotId+'&depotType='+_0x4744ad;}});form['on']('select(select_batchId)',function(_0x2a9607){var _0x67be27=_0x2a9607['value'];if(_0x67be27=='0'){showMore();}else{flushGrainByBatchId(_0x67be27);}});form['on']('switch(filter_switch)',function(_0x24ef8f){var _0x4f384a=_0x24ef8f['value'];var _0x598b64=_0x24ef8f['elem']['checked'];if(_0x598b64){if('lay'==_0x4f384a){$('#switch_row')['prop']('checked',![]);$('#switch_col')['prop']('checked',![]);$('#switch_all')['prop']('checked',![]);}if('row'==_0x4f384a){$('#switch_lay')['prop']('checked',![]);$('#switch_col')['prop']('checked',![]);$('#switch_all')['prop']('checked',![]);}if('col'==_0x4f384a){$('#switch_lay')['prop']('checked',![]);$('#switch_row')['prop']('checked',![]);$('#switch_all')['prop']('checked',![]);}if('all'==_0x4f384a){$('#switch_lay')['prop']('checked',![]);$('#switch_row')['prop']('checked',![]);$('#switch_col')['prop']('checked',![]);}form['render']();resetGrainChartAlpha(_0x4f384a);}});table['on']('radio(filterTable)',function(_0x242d97){compareData=_0x242d97['data'];});});grainChar3d=initGrainChar3d();initWS(companyId,bizType,userId);});window['onload']=function(){if(depotId){$('#depotId')['val'](depotId);form['render']();flushGrain(null);}};function socketOnMessage(_0xe82568){if(_0xe82568['orderResp']=='MSG_SUCCESS'){flushGrain(null);window['parent']['sysNotify'](_0xe82568['data']);}};function printSingle(){layer['msg']('开始调用后台打印模板……');toPrintSingle(grainData);}function printBatch(){$('#batchPrintSelect\x20input')['each'](function(){var _0x28fa02=$(this)['prop']('name');if(_0x28fa02=='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 _0x433463;$('#batchPrintSelect\x20input')['each'](function(){_0x433463=$(this)['prop']('name');if(_0x433463=='printCheckDate'||$(this)['prop']('disabled')){}else{$(this)['prop']('checked',!![]);}});form['render']();},'btn2':function(){var _0x285af8;$('#batchPrintSelect\x20input')['each'](function(){_0x285af8=$(this)['prop']('name');if(_0x285af8=='printCheckDate'||$(this)['prop']('disabled')){}else{if($(this)['prop']('checked')){$(this)['prop']('checked',![]);}else{$(this)['prop']('checked',![]);}}});form['render']();return![];},'btn3':function(){var _0x5eb977;$('#batchPrintSelect\x20input')['each'](function(){_0x5eb977=$(this)['prop']('name');if(_0x5eb977=='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 _0x15dd47=$('#printCheckDate')['val']();$['ajax']({'type':'POST','url':'../../basic/grain/query-checkDate-map','dataType':'json','contentType':'application/json;charset=UTF-8','data':JSON['stringify']({'checkDate':_0x15dd47}),'success':function(_0x31e4e8){if(_0x31e4e8['code']!='0000'){layer['msg'](_0x31e4e8['msg']);disabledAllSelectDepot();}else{mapGrainData=_0x31e4e8['data'];updateSelectDepot();}},'error':function(){layer['msg']('批量打印获取粮情信息失败!');}});};function printBatchTodo(){layer['msg']('开始批量生成打印模版……');var _0x385889;var _0x57fbe7;var _0xfbb072;var _0x1ed917;var _0x56e11a={};$['each'](listDepot,function(_0x559354,_0x5a8d8a){_0x56e11a[_0x5a8d8a['id']]=_0x5a8d8a;});var _0x5d054c=CLODOP;_0x5d054c['PRINT_INIT']('粮情报表');_0x5d054c['SET_PRINT_PAGESIZE'](0x1,0x0,0x0,'A4');$('#batchPrintSelect\x20input')['each'](function(){if($(this)['prop']('name')=='printCheckDate'){return!![];}_0xfbb072=$(this)['prop']('checked');if(_0xfbb072){_0x57fbe7=$(this)['val']();_0x1ed917=mapGrainData[_0x57fbe7];if(!_0x1ed917){return!![];}_0x5d054c['NewPage']();_0x1ed917['depotData']=_0x56e11a[_0x57fbe7];_0x385889=builderModel(_0x1ed917);_0x5d054c['ADD_PRINT_HTM'](0x1e,0x28,'180mm','100%',_0x385889);}});layer['msg']('开始调用打印程序预览……');_0x5d054c['SET_PRINT_MODE']('PRINT_PAGE_PERCENT','Full-Page');_0x5d054c['PREVIEW']();};function disabledAllSelectDepot(){var _0x2a33f6;$('#batchPrintSelect\x20input')['each'](function(){_0x2a33f6=$(this)['prop']('name');if(_0x2a33f6=='printCheckDate'){return!![];}$(this)['prop']('disabled',!![]);});form['render']();};function updateSelectDepot(){var _0x5dbc08,_0x3b9a5d;$('#batchPrintSelect\x20input')['each'](function(){_0x5dbc08=$(this)['val']();_0x3b9a5d=$(this)['prop']('name');if(_0x3b9a5d=='printCheckDate'){return!![];}if(mapGrainData[_0x5dbc08]){$(this)['prop']('disabled',![]);}else{$(this)['prop']('disabled',!![]);}});form['render']();};function compare(){if(!depotId){layer['msg']('请先选择仓库……');return;}var _0x47a546=$('#batchId')['val']();if(!_0x47a546){layer['msg']('当前没有可以比较的数据……');return;}if(compareData){flushGrainByBatchId(_0x47a546);}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(_0x5c530f){if(!depotId){layer['msg']('请先选择仓库!');return;}if(!_0x5c530f){_0x5c530f=$('#compareCheckDate')['val']();}var _0x365f54={'depotId':depotId,'checkMonth':_0x5c530f,'extBatchId':grainData['batchId']};$['ajax']({'type':'POST','url':'../../basic/grain/page-list','dataType':'json','contentType':'application/json;charset=UTF-8','data':JSON['stringify'](_0x365f54),'success':function(_0x488571){if(_0x488571['code']!='0000'){layer['msg'](_0x488571['msg']);}else{table['render']({'elem':'#tableSelect','height':0x1c2,'data':_0x488571['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(_0x1231c6,_0x5a2733){$['ajax']({'type':'POST','url':'../../basic/grain/data-compare','dataType':'json','contentType':'application/json;charset=UTF-8','data':JSON['stringify']({'dataA':_0x1231c6,'dataB':_0x5a2733}),'success':function(_0xd40b69){if(_0xd40b69['code']!='0000'){layer['msg'](_0xd40b69['msg']);}else{grainData=_0xd40b69['data'];resetGrainChart3d();renderGrainInfo();layer['closeAll']();}},'error':function(){layer['msg']('批次对比出现异常,请重新选择');}});};function flushGrain(_0x3be4f5){compareData=null;if(!depotId){layer['msg']('请先选择仓库!');return;}var _0x59038f={'depotId':depotId,'checkMonth':_0x3be4f5};$['ajax']({'type':'POST','url':'../../basic/grain/query-list-data','dataType':'json','contentType':'application/json;charset=UTF-8','data':JSON['stringify'](_0x59038f),'success':function(_0x1c5f9e){if(_0x1c5f9e['code']!='0000'){layer['msg'](_0x1c5f9e['msg']);}listGrainData=_0x1c5f9e['data'];if(!listGrainData){return;}grainData=listGrainData[0x0];resetGrainChart3d();renderGrainInfo();resetSelectBatchId();layer['closeAll']();layer['msg']('更新成功……');},'error':function(){layer['msg']('根据当前条件获取粮情数据渲染图标失败!!');}});};function renderGrainInfo(){var _0x458311=grainData['depotData'];$('#depotTypeName')['text'](_0x458311['depotTypeName']);$('#storeDate')['text'](_0x458311['storeDate']);$('#storageReal')['text'](_0x458311['storageReal']);$('#foodVarietyName')['text'](_0x458311['foodVarietyName']);$('#perWet')['text'](_0x458311['perWet']);$('#depotStatus')['text'](DEPOT_STATUS_MSG(_0x458311['depotStatus']));$('#foodLocation')['text'](_0x458311['foodLocation']);$('#bulkWeight')['text'](_0x458311['bulkWeight']);$('#perImpurity')['text'](_0x458311['perImpurity']);$('#broken')['text'](_0x458311['broken']);$('#storeKeeperName')['text'](_0x458311['storeKeeperName']);$('#rough')['text'](_0x458311['rough']);$('#waterGluten')['text'](_0x458311['waterGluten']);$('#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(_0x12a5ab){var _0x24c29b;$['each'](listGrainData,function(_0x13a5a1,_0x3c742d){if(_0x3c742d['batchId']==_0x12a5ab){_0x24c29b=_0x3c742d;return![];}});if(_0x24c29b){grainData=_0x24c29b;resetGrainChart3d();renderGrainInfo();layer['msg']('更新成功……');}};function resetSelectBatchId(){$('#batchId')['empty']();$['each'](listGrainData,function(_0x16e8cc,_0x3e0e2b){$('#batchId')['append'](new Option(_0x3e0e2b['receiveDate'],_0x3e0e2b['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 _0x48a251={'depotId':depotId};$['ajax']({'type':'POST','url':'../../basic/grain/check-single','dataType':'json','contentType':'application/json;charset=UTF-8','data':JSON['stringify'](_0x48a251),'success':function(_0x419b68){if(_0x419b68['code']!='ORDER_SUCCESS'){if(_0x419b68['msg']){layer['msg'](_0x419b68['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 _0x4088a9='';$('#batchCheckSelect\x20input')['each'](function(){if($(this)['prop']('checked')){_0x4088a9+=$(this)['val']()+',';}});if(_0x4088a9==''){layer['msg']('请先选择需要检测的仓库……');return![];}layer['msg']('开始执行批量检测……');var _0x1d21e3={'depotIds':_0x4088a9};$['ajax']({'type':'POST','url':'../../basic/grain/check-batch','dataType':'json','contentType':'application/json;charset=UTF-8','data':JSON['stringify'](_0x1d21e3),'success':function(_0x45ba3c){if(_0x45ba3c['code']!='ORDER_SUCCESS'){if(_0x45ba3c['msg']){layer['msg'](_0x45ba3c['msg']);}else{layer['msg']('执行出现异常,请重试或联系管理员');}return![];}else{layer['msg']('命令已经成功发送,待终端响应……');return!![];}},'error':function(){layer['msg']('粮情检测出现异常,执行失败!');return![];}});return!![];};