ajaxArable(true,''); $(".hide").click(function(){ $("#faqbg").css("display","none"); $("#tanchu").css("display","none"); }); //根据作物和产量查询施肥配方 $("#soilpf").click(function(){ var cropz = $('#cropz').val(); var chanl = $.trim($('#chanl').val()); if(cropz == 0){ alert("请选择作物"); return; }else if(isNaN(chanl) || chanl == ""){ alert("产量为数字类型!"); return; } $.ajax({ type: "post", //url: "/index.php?g=&m=list&a=ajaxarable", url: "/index.php?m=list&a=ajaxDetailspf&id=4", data:{ crop:cropz,chanl:chanl }, cache:false, async:false, dataType: 'json', success: function(json){ $('[name="ppppffff"]').show(); $('#corp').html(json.corp); $('#chanliang').html(json.chanliang); $('#difei').html('氮肥'+json.jianyi.md_FHF_Base_N+'公斤,磷肥'+json.jianyi.md_FHF_Base_P+'公斤,钾肥'+json.jianyi.md_FHF_Base_K+'公斤'); $('#zhuifei1').html('氮肥'+json.jianyi.md_FHF_Zhui1_N+'公斤,磷肥'+json.jianyi.md_FHF_Zhui1_P+'公斤,钾肥'+json.jianyi.md_FHF_Zhui1_K+'公斤'); $('#zhuifei2').html('氮肥'+json.jianyi.md_FHF_Zhui2_N+'公斤,磷肥'+json.jianyi.md_FHF_Zhui2_P+'公斤,钾肥'+json.jianyi.md_FHF_Zhui2_K+'公斤'); },error: function(json){ alert('请求数据发生错误 '); } }); }) }) function ajaxArableDetails(aid){ $.ajax({ type: "post", url: "/index.php?m=list&a=ajaxArableDetails&id=4", data: {aid: aid}, cache: false, async: false, dataType: 'json', success: function (json) { $('#jianyititle').html(''); $('#soil_code').html(''); $('#land_weizhi').html(''); $('#daibiaononghu').html(''); $('#jianjiedan').html(''); $('#jianjiedan_pj').html(''); $('#youxiaolin').html(''); $('#youxiaolin_pj').html(''); $('#suxiaojia').html(''); $('#suxiaojia_pj').html(''); $('#ph').html(''); $('#ph_pj').html(''); $('#youjizhi').html(''); $('#youjizhi_pj').html(''); $('#corp').html(''); $('#chanliang').html(''); $('#difei').html(''); $('#zhuifei1').html(''); $('#zhuifei2').html(''); $('[name="ppppffff"]').hide(); $('#jianyititle').html('甘肃省'+json.xian+json.xiang+'测土配方施肥建议卡'); $('#soil_code').html(json.soil.soil_code); $('#land_weizhi').html(json.soil.land_weizhi); $('#daibiaononghu').html(json.soil.daibiaononghu); $('#jianjiedan').html(json.soil.jianjiedan); $('#jianjiedan_pj').html(json.soil.jianjiedan_pj); $('#youxiaolin').html(json.soil.youxiaolin); $('#youxiaolin_pj').html(json.soil.youxiaolin_pj); $('#suxiaojia').html(json.soil.suxiaojia); $('#suxiaojia_pj').html(json.soil.suxiaojia_pj); $('#ph').html(json.soil.ph); $('#ph_pj').html(json.soil.ph_pj); $('#youjizhi').html(json.soil.youjizhi); $('#youjizhi_pj').html(json.soil.youjizhi_pj); $("#faqbg").css({display:"block",height:$(document).height()}); var yscroll =document.documentElement.scrollTop; $("#tanchu").css("display","block"); document.documentElement.scrollTop=0; }, error: function (json) { alert('请求地块详细建议数据时发生错误 '); } }); } //地图上的搜索 function ajaxArable(key,code){ var $keys = $('#search_show').val(); if(code == ''){ code = 620000000000; } if(''!=$keys||key){ $.ajax({ type: "post", url: "/index.php?m=list&a=ajaxArable&id=4", data:{ key:$keys,vid:code }, cache:false, async:false, dataType: 'json', success: function(json){ appendToMap(json); },error: function(json){ alert('请求报表数据发生错误 '); } }); }else{ if(confirm('您还没有输入关键字,继续将查询全部')){ ajaxArable(true,''); } } } var arable_list=new Array(); //添加到地图浮层 function appendToMap(json){ //数据源 //console.log(json); $("#map_list_main").html(''); arable_list = new Array(); json = eval(json); var $html =''; var iii = 0; for(var o in json){ var iii2 = iii +1; var padding = ''; if(iii2 > 9) padding = 'style="padding: 5px 4px 4px 4px;"' $html=$html+ '

'+iii2+ ''+json[o].land_name+'('+json[o].land_weizhi+')

'+ '进入查看
' ; arable_list[iii]= json[o]; iii++; } if($html != ''){ $html = '