点开一个页面安卓闪退

BUG
MuYuan
   2018-01-25 11:07:24发布 0收藏, 91浏览
ExMobi客户端技术
已关闭
0

点击一个普通修改页面在电脑上点开没事,ios没事,安卓闪退 (当然其他修改页面点开也不闪退,就这一个闪退,也不报错,找不到问题,望大神支持)

<html id="xsjhglEdit">
	<head>
		<title show="false"/>
		<link rel="stylesheet" type="text/css" href="res:css/global.css" />
		<link rel="stylesheet" type="text/css" href="res:css/control.css" />
		<script type="text/javascript" src="res:script/exmobijs/base.js"></script>
		<script type="text/javascript" src="res:script/exmobijs/utility.js"></script>
		<script type="text/javascript" src="res:script/exmobijs/xpath.js"></script>
		<script type="text/javascript" src="res:script/exmobijs/config.js"></script>
		<script type="text/javascript" src="res:script/exmobijs/app.js"></script>
		<script type="text/javascript" src="res:script/project/common.js"></script>
		<script type="text/javascript" src="res:script/project/exmobiajax.js"></script>
		<style type="text/css">
			.left{
				width: 29%;
			}
			.right{
				width: 71%;
				border-size:1;
			}
			object{
				font-size: 16dp;
				padding:12 0 12 2;
			}
		</style>
		
		<script type="text/javascript">
			<![CDATA[
				var ly = "";
				var lyId = "";
				var module_id = "";
				var isSh = "";
				var plansaleno = "";
				 var type=0;
				function init() {
					ly = window.getParameter("ly");
					type = window.getParameter("type");
					module_id = window.getParameter("module_id");
					if(ly == "xsddgl"){
						$("moduleStr").value = "add";
						$("titlebar").title = "新增销售计划";
						lyId = window.getParameter("lyId");
						progressbar.setMessage("正在加载...");
						progressbar.show(true);
						var url = "http://myurl/xsddgldetail.jsp";
						var data = "forderno=" + lyId;
						var method = "post";
						var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
						var isShowProgress = false;
						var ajax = new Ajax(url, method, data, getxsddDetailResult, failFunction, requestHeader, isShowProgress);
						ajax.send();
					}else if(ly == "xsddgl1"){
						$("moduleStr").value = "add";
						$("titlebar").title = "新增销售计划";
						lyId = window.getParameter("lyId");
						progressbar.setMessage("正在加载...");
						progressbar.show(true);
						var url = "http://myurl/xsddgldetail.jsp";
						var data = "forderno=" + lyId;
						var method = "post";
						var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
						var isShowProgress = false;
						var ajax = new Ajax(url, method, data, getxsddDetailResult, failFunction, requestHeader, isShowProgress);
						ajax.send();
					}else{
						isSh = window.getParameter("isSh");
						plansaleno = window.getParameter("detailId");
						progressbar.setMessage("正在加载...");
						progressbar.show(true);
						var url = "http://myurl/xsjhgldetail.jsp";
						var data = "plansaleno=" + plansaleno;
						var method = "post";
						var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
						var isShowProgress = false;
						var ajax = new Ajax(url, method, data, getDetailResult, failFunction, requestHeader, isShowProgress);
						ajax.send();
					}
				}
				
				var fclass = "";//类别
				var fweightdur = "";//重量区间
				var areaname = "";//子公司
				var fieldname = "";//场次
				//var flargearea ="";//区域
				//var fprovince="";//省份
				//var fcity ="";//城市
				//var khx ="";//区县
				//var khxz ="";//乡镇
				//var fsalemodel ="";//销售模式
				var fdockmanager = "";//对接经理
				//var fslaughter ="";//屠宰场
				var fby05 = "";//等级备注
				var fby11 ="";//孕龄备注
				var distributor ="";//经销商
				var distributorid="";//经销商ID
				var unit = "";//单元
				
				function getDetailResult(ajax) {
					var jsonObj = ajax.responseText.toJSON();
				
					//种猪、仔猪【重量区间改成:品种;屠宰场改成:养殖场;单价变成:种猪(50KG基价)仔猪:15KG基价】
					//种猪、仔猪【体重范围、超重计价、经销商  显示,否则不显示】
					areaname = jsonObj.areaname;
					fieldname = jsonObj.fieldname;
					fclass = jsonObj.fclass;
					fweightdur = jsonObj.fweightdur;
					//flargearea = jsonObj.flargearea;
					//fprovince = jsonObj.fprovince;
					//fcity = jsonObj.fcity;
					//khx = jsonObj.khx;
					//khxz = jsonObj.khxz;
					//fsalemodel = jsonObj.fsalemodel;
					fdockmanager = jsonObj.dockingmanager;
					//fslaughter = jsonObj.fslaughter;
					fby05 = jsonObj.fby05;
					unit = jsonObj.unit;
					fby11 = jsonObj.fby11;
					$("detail").clear().provide(jsonObj).show();
					$("unit").value = unit;
					if(jsonObj.fby08!=""&&jsonObj.fby12!=""){
				 		$("fby08").value = jsonObj.fby08+"|"+jsonObj.fby12;
				 	}else{
				 		$("fby08").value ="";
				 	}
					$("fnote").value = jsonObj.fnote.replaceAll("#%#", "\"").replaceAll("#@#", "\n").replace("[来自智慧牧原]", "").replace("[来自智慧牧原客户版]", "").replace("[来自掌上牧原]", "");
					childCompany();//获取子公司
					getPikType();//生猪类别
					//getFlargearea();//获取区域
					//getFsalemodel();//获取销售模式
					getFdockmanager();//获取对接经理
				
					$("titlebar").ishidericon = false;
					progressbar.cancel();
				}
				
				function getxsddDetailResult(ajax) {
					var jsonObj = ajax.responseText.toJSON();
					$("detail").clear().provide(jsonObj).show();
					//种猪、仔猪【重量区间改成:品种;屠宰场改成:养殖场;单价变成:种猪(50KG基价)仔猪:15KG基价】
					//种猪、仔猪【体重范围、超重计价、经销商  显示,否则不显示】
				
					fclass = jsonObj.fclass;
					fweightdur = jsonObj.fweightdur;
					//flargearea = jsonObj.flargearea;
					//fprovince = jsonObj.fprovince;
					//fcity = jsonObj.fcity;
					//khx = jsonObj.khx;
					//khxz = jsonObj.khxz;
					//fsalemodel = jsonObj.fsalemodel;
					fdockmanager = jsonObj.fdockmanager;
					//fslaughter = jsonObj.fslaughter;
					fby05 = jsonObj.fby04;
					fby11 = jsonObj.fby13;
					$("fby03").value = jsonObj.forderno;
					$("fqty").value = jsonObj.fqty;
					$("amount").value = jsonObj.fqty;
					$("fby02").value = jsonObj.fcstomer;
					$("customer").value = jsonObj.fby09;
				
					//$("detail").clear().provide(jsonObj).show();
					//$("FSingle").value = userCN;
					$("putDate").value = jsonObj.putDate;
					$("putTime").value = jsonObj.putTime;
					//$("fcstomer").value = jsonObj.fcstomer+"|"+jsonObj.fby06;
					$("price").value = jsonObj.fprice;
					$("amount").value = jsonObj.fqty;
				
					$("fby06").value = jsonObj.fby06;
					//$("fby07").value = jsonObj.fby07;
					$("fby09").value = jsonObj.fby11;
					if(jsonObj.fby08!=""&&jsonObj.fby14!=""){
				 		$("fby08").value = jsonObj.fby08+"|"+jsonObj.fby14;
				 	}else{
				 		$("fby08").value ="";
				 	}
				
					$("fnote").value = jsonObj.fnote.replaceAll("#%#", "\"").replaceAll("#@#", "\n").replace("[来自智慧牧原]", "").replace("[来自智慧牧原客户版]", "").replace("[来自掌上牧原]", "");
					childCompany();//获取子公司
					getPikType();//生猪类别
					//getFlargearea();//获取区域
					//getFsalemodel();//获取销售模式
					getFdockmanager();//获取对接经理
					$("titlebar").ishidericon = false;
					progressbar.cancel();
				}
				
				function initOtherData() {//新建时的函数
					module_id = window.getParameter("module_id");
					onsubmit(user_id, devicetype, newxsjhglFun);
				}
				
				function newxsjhglFun() {
					childCompany();//获取子公司
					getPikType();//生猪类别
					//getFlargearea();//获取区域
					//getFsalemodel();//获取销售模式
					getFdockmanager();//获取对接经理
					//$("FBY14").value = user_id;//当前登录人的id
					$("FSingle").value = userCN;
					$("titlebar").ishidericon = false;
				}
				
				function changeInner() {
					//4.00种猪销售 ; 5.00仔猪销售
					var selectFc = $("fclass");
					var index = selectFc.selectedIndex;
					if (selectFc.options[index].id == "4.00" || selectFc.options[index].id == "5.00") {
						//$("tzc").innerHTML = "养  殖  场:";
						$("zlqjFont").innerHTML = "品  种:";
						var selectQj = $("zlqj");
						var qjIndex = selectQj.selectedIndex;
						if (selectQj.options[qjIndex].id == "65") {
							if (selectFc.options[index].id == "4.00") {
								$("dj").innerHTML = "50KG基价:";
							}
						} else {
							$("dj").innerHTML = "单  价:";
						}
						if (selectFc.options[index].id == "5.00") {
							$("dj").innerHTML = "15KG基价:";
						}
						$("czjj").show();
					} else {
						//$("tzc").innerHTML = "屠  宰  场:";
						$("zlqjFont").innerHTML = "重量区间:";
						$("dj").innerHTML = "单  价:";
						$("czjj").hide();
					}
					//$("FClassID").value = selectFc.options[index].id;
				}
				
				function childCompany() {//获取子公司
					var url = "http://myurl/childcompany.jsp";
					var data = "";
					var method = "get";
					var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
					var isShowProgress = false;
					var ajax = new Ajax(url, method, data, getCompanyList, failFunction, requestHeader, isShowProgress);
					ajax.send();
				}
				
				function getCompanyList(ajax) {
					var jsonObj = ajax.responseText.toJSON();
					var companylist = jsonObj.companylist;
					var selectObj = document.getElementById("farea");
					if (companylist.length > 0) {
						var v = new Array();
						var option0 = new Option();
					        option0.text = "";
					        option0.value = "0";
					        v.push(option0);
						for (var i = 0; i < companylist.length; i++) {
							var option = new Option();
							option.text = companylist[i].fname;
							option.value = companylist[i].fitemid;
							if (companylist[i].fname == areaname) {
								option.selected = true;
							}
							v.push(option);
						}
						selectObj.adds(v);
					}
					getCc();//获取子公司
				}
				
				function getUnit() {//获取单元
					var Farea = $("farea").value;
					var FieldID = $("fieldid").value;
					var ApplyDate = $("putDate").value;
					var selectZlqj = $("zlqj");
					var ind = selectZlqj.selectedIndex;
					var BoarWeight = selectZlqj.options[ind].id;
					var FClass = $("fclass").value;
					var Djbz = $("djbz").value;
					var Ylbz = $("ylbz").value;
					var url = "http://myurl/getunit.jsp";
					var data = "Farea=" + Farea +"&FieldID=" + FieldID + "&ApplyDate=" + ApplyDate + "&BoarWeight=" + BoarWeight + "&FClass=" + FClass + "&Djbz=" + Djbz + "&Ylbz=" + Ylbz;
					var method = "post";
					var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
					var isShowProgress = false;
					var ajax = new Ajax(url, method, data, getUnitRet, failFunction, requestHeader, isShowProgress);
					ajax.send();
				
				}
				
				function getUnitRet(ajax) {
					var jsonObj = ajax.responseText.toJSON();
					var resultlist = jsonObj.resultlist;
					var funitstr="";
					if(resultlist.length >0){
						for(var i=0;i<resultlist.length;i++){
						   funitstr =funitstr+";"+resultlist[i].FSegmentName+resultlist[i].SaleUnit;
						}
						$("unit").value = funitstr.substr(1,funitstr.length);
					}else{
						$("unit").value ="";
						if($("farea").value!=0 &&$("fieldid").value!=0 ){
							var storesel1 = $("fieldid").selectedIndex;//获取当前选中项下标值
							var Fieldid = $("fieldid").options[storesel1].text;//场次
							var ApplyDate = $("putDate").value;//日期
							var storesel2 = $("fclass").selectedIndex;//获取当前选中项下标值
							var Fclass = $("fclass").options[storesel2].text;//类别
							var storesel3 = $("zlqj").selectedIndex;//获取当前选中项下标值
							var Zlqj = $("zlqj").options[storesel3].text;//重量区间
							alert(Fieldid+" "+ApplyDate+" "+Fclass+" "+Zlqj+" "+"暂无出栏计划,请核实");
						}
						
					}
					//$("unit").value = jsonObj.FSegmentName+"段"+jsonObj.SaleUnit+"单元";
					//$("amount").value =jsonObj.UnSaleQty;
					//下拉框分割选单元值
					//var str =jsonObj.SaleUnit;
				 	//if(str !=""){
				  	 	//var selectObj = document.getElementById("unit");
				  	 	//selectObj.removeAll();
				  	 	 //if(str.indexOf("、") !=-1){
				  	 	 	//var bz = str.split("、");
				 			//var v = new Array();
				  	 	 	//for(var i=0;i<bz.length;i++){
				  	 	 		  //var option = new Option();
					              //option.text = bz[i];
					              //option.value = bz[i];
					              //if(bz[i] ==unit){
					              	//option.selected = true;
					              //}
					              //v.push(option);
				  	 	 	//}
				  	 	 	//selectObj.adds(v);
				  	 	 //}else{
				  	 	 	 //var option = new Option();
						     //option.text=str;
						     //option.value=str;
						     //if(str ==unit){
					          	//option.selected = true;
					          //}
						     //selectObj.add(option);
				  	 	 //}
				  	 //}else{
				  	 	 //document.getElementById("unit").removeAll();
				  	 //}
				}
				
				function getCc() {//获取场次
					var selectObj = document.getElementById("farea");
					var index = selectObj.selectedIndex;
					var url = "http://myurl/getcc.jsp";
					var data = "zgs=" + selectObj.options[index].value;
					var method = "post";
					var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
					var isShowProgress = false;
					var ajax = new Ajax(url, method, data, getCcList, failFunction, requestHeader, isShowProgress);
					ajax.send();
				}
				
				function getCcList(ajax) {
					var jsonObj = ajax.responseText.toJSON();
					var cclist = jsonObj.cclist;
					var selectObj = document.getElementById("fieldid");
					selectObj.removeAll();
					if (cclist.length > 0) {
						var v = new Array();
						var option0 = new Option();
					        option0.text = "";
					        option0.value = "0";
					        v.push(option0);
						for (var i = 0; i < cclist.length; i++) {
							var option = new Option();
							option.text = cclist[i].fname;
							option.value = cclist[i].fitemid;
							if (cclist[i].fname == fieldname) {
								option.selected = true;
							}
							v.push(option);
						}
						selectObj.adds(v);
					}
					var selectZlqj = $("zlqj");
					var ind = selectZlqj.selectedIndex;
					if (selectZlqj.options[ind] != null) {
						getUnit();
						//+++++
					}
				}
				
				function getPikType() {//生猪类别
					var url = "http://myurl/piktype.jsp";
					var data = "";
					var method = "get";
					var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
					var isShowProgress = false;
					var ajax = new Ajax(url, method, data, getPikResult, failFunction, requestHeader, isShowProgress);
					ajax.send();
				}
				
				function getPikResult(ajax) {
					var jsonObj = ajax.responseText.toJSON();
					var resultList = jsonObj.resultList;
					var selectObj = document.getElementById("fclass");
					selectObj.removeAll();
					if (resultList.length > 0) {
						var v = new Array();
						for (var i = 0; i < resultList.length; i++) {
							var option = new Option();
							option.text = resultList[i].typeStr;
							option.value = resultList[i].typeStr;
							option.id = resultList[i].fby01;
							if (resultList[i].typeStr == fclass) {
								option.selected = true;
							}
							v.push(option);
						}
						selectObj.adds(v);
					}
					getZlqj();
				
				}
				
				function getZlqj(){//重量区间
				 	var selectObj = $("fclass");
				 	var index = selectObj.selectedIndex;
					var url = "http://myurl/zlqj.jsp";
					var data ="lb="+selectObj.options[index].id;
					var method="post";
					var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
					var isShowProgress = false;
					var ajax = new Ajax(url,method,data,getZlqjResult,failFunction,requestHeader,isShowProgress);						
					ajax.send();
				 }
				 
				 function getZlqjResult(ajax){
				 	var jsonObj = ajax.responseText.toJSON();
				 	var resultList = jsonObj.resultList;
				 	var selectObj = document.getElementById("zlqj");
				 	selectObj.removeAll();
				 	var v = new Array();
				 	if(resultList.length > 0){
				 		var selectText ="";
				 		var selectText1 ="";
				 		for(var i=0;i<resultList.length;i++){
					 		  var option = new Option();
				              option.text = resultList[i].zsStr;
				              option.value = resultList[i].zsStr;
				              option.id = resultList[i].nmStr;
				              option.onclick="getDjbz('"+resultList[i].bzStr+"','"+resultList[i].ylStr+"');";
				              if(resultList[i].zsStr ==fweightdur){
				              	 option.selected = true;
				              	 selectText = resultList[i].bzStr;
				              	 selectText1 = resultList[i].ylStr;
				              }else{
				              	 if(i==0){
				              		selectText = resultList[0].bzStr;
				              		selectText1 = resultList[0].ylStr;
				              	 }
				              }
				              v.push(option);
					 	}
					 	selectObj.adds(v);
					 	getDjbz(selectText,selectText1);
					 	changeInner();//改变名称
				 	}
				 }
				 
				 function getDjbz(str,ylstr){//等级备注,孕龄备注
				  	 if(str !=""){
				  	 	var selectObj = document.getElementById("djbz");
				  	 	selectObj.removeAll();
				  	 	 if(str.indexOf("、") !=-1){
				  	 	 	var bz = str.split("、");
				 			var v = new Array();
				  	 	 	for(var i=0;i<bz.length;i++){
				  	 	 		  var option = new Option();
					              option.text = bz[i];
					              option.value = bz[i];
					              if(bz[i] ==fby05){
					              	option.selected = true;
					              }
					              v.push(option);
				  	 	 	}
				  	 	 	selectObj.adds(v);
				  	 	 }else{
				  	 	 	 var option = new Option();
						     option.text=str;
						     option.value=str;
						     if(str ==fby05){
					          	option.selected = true;
					          }
						     selectObj.add(option);
				  	 	 }
				  	 }else{
				  	 	 document.getElementById("djbz").removeAll();
				  	 }
				  	 
				  	 //孕龄备注
				  	 if(ylstr !=""){
				  	 	var selectObj = document.getElementById("ylbz");
				  	 	selectObj.removeAll();
				  	 	 if(ylstr.indexOf("、") !=-1){
				  	 	 	var bz = ylstr.split("、");
				 			var v = new Array();
				  	 	 	for(var i=0;i<bz.length;i++){
				  	 	 		  var option = new Option();
					              option.text = bz[i];
					              option.value = bz[i];
					              if(bz[i] ==fby11){
					              	option.selected = true;
					              }
					              v.push(option);
				  	 	 	}
				  	 	 	selectObj.adds(v);
				  	 	 }else{
				  	 	 	 var option = new Option();
						     option.text=ylstr;
						     option.value=ylstr;
						     if(str ==fby11){
					          	option.selected = true;
					          }
						     selectObj.add(option);
				  	 	 }
				  	 }else{
				  	 	 document.getElementById("ylbz").removeAll();
				  	 }
				 }
				 
				 
				//自动填充————经销商
				function searchDistributor(){//经销商查询
					var distributor=$("fby08").value;
					if(distributor!=""){
						var type=0;
						var url = "http://myurl/distributor.jsp";
						var data ="distributor="+distributor+"&type="+type;
						var method="post";
						var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
						var isShowProgress = false;
						var ajax = new Ajax(url,method,data,searchDistributorResult,failFunction,requestHeader,isShowProgress);						
						ajax.send();
					}
				}
				
				function searchDistributorResult(ajax){
					var jsonObj = ajax.responseText.toJSON();
					var resultList=jsonObj.resultList;
					if(resultList.length>0){
						var autoObj= document.getElementById("fby08");
						autoObj.removeall();
						for(var i=0;i<resultList.length;i++){
							//JSP返回的是销售报单时的fby10+fby19
							autoObj.add(resultList[i].fby10+"|"+resultList[i].fby19);
						}
					}
				 }
				
				 
				 function getChangeDistributorText(){
					var fby08 = $("fby08").value;
					var nameStr = fby08.substring(0,fby08.indexOf("|"));
					var codeStr = fby08.substring(fby08.indexOf("|")+1);
					if(codeStr!="")
					{ 	
				    	var type=1;
						var url = "http://myurl/distributor.jsp";
						var data ="nameStr="+nameStr+"&codeStr="+codeStr+"&type="+type;
						var method="post";
						var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
						var isShowProgress = false;
						var ajax = new Ajax(url,method,data,getChangeDistributorTextResult,failFunction,requestHeader,isShowProgress);						
						ajax.send();
					}
				 }
				 
				function getChangeDistributorTextResult(ajax){
					var jsonObj = ajax.responseText.toJSON();
				 	var resultList=jsonObj.resultList;
					if(!resultList.length>0){
						$("fby08").value = "";
					}
				}
				
				
				
				function getFlargearea() {//区域
					var url = "http://myurl/flargearea.jsp";
					var data = "";
					var method = "get";
					var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
					var isShowProgress = false;
					var ajax = new Ajax(url, method, data, getFlargeareaResult, failFunction, requestHeader, isShowProgress);
					ajax.send();
				}
				
				function getFlargeareaResult(ajax) {
					var jsonObj = ajax.responseText.toJSON();
					var arealist = jsonObj.arealist;
					var selectObj = document.getElementById("flargearea");
					if (arealist.length > 0) {
						var v = new Array();
						for (var i = 0; i < arealist.length; i++) {
							var option = new Option();
							option.text = arealist[i].fname;
							option.value = arealist[i].fitemid;
							if (arealist[i].fname == flargearea) {
								option.selected = true;
							}
							v.push(option);
						}
						selectObj.adds(v);
					}
				
					getFprovince();
					//获取省份
				}
				
				function getFprovince() {
					var url = "http://myurl/fprovince.jsp";
					var data = "flargearea=" + $("flargearea").value;
					var method = "post";
					var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
					var isShowProgress = false;
					var ajax = new Ajax(url, method, data, getFprovinceResult, failFunction, requestHeader, isShowProgress);
					ajax.send();
				}
				
				function getFprovinceResult(ajax) {
					var jsonObj = ajax.responseText.toJSON();
					var provincelist = jsonObj.provincelist;
					var selectObj = document.getElementById("fprovince");
					selectObj.removeAll();
					if (provincelist.length > 0) {
						var v = new Array();
						for (var i = 0; i < provincelist.length; i++) {
							var option = new Option();
							option.text = provincelist[i].fname;
							option.value = provincelist[i].fitemid;
							if (provincelist[i].fname == fprovince) {
								option.selected = true;
							}
							v.push(option);
						}
						selectObj.adds(v);
					}
				
					getFcity();
					//获取城市
				}
				
				function getFcity() {
					var url = "http://myurl/fcity.jsp";
					var data = "fprovince=" + $("fprovince").value;
					var method = "post";
					var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
					var isShowProgress = false;
					var ajax = new Ajax(url, method, data, getFCityResult, failFunction, requestHeader, isShowProgress);
					ajax.send();
				}
				
				function getFCityResult(ajax) {
					var jsonObj = ajax.responseText.toJSON();
					var citylist = jsonObj.citylist;
					var selectObj = document.getElementById("fcity");
					selectObj.removeAll();
					if (citylist.length > 0) {
						var v = new Array();
						for (var i = 0; i < citylist.length; i++) {
							var option = new Option();
							option.text = citylist[i].fname;
							option.value = citylist[i].fitemid;
							if (citylist[i].fname == fcity) {
								option.selected = true;
							}
							v.push(option);
						}
						selectObj.adds(v);
					}
				
					getDistrict();
					//获取区县
				
					var selectFc = $("fclass");
					var index = selectFc.selectedIndex;
					if (selectFc.options[index].id != "4.00" || selectFc.options[index].id != "5.00") {
						getFslaughter();
					}
				}
				
				function getDistrict() {
					//4.00种猪销售 ; 5.00仔猪销售
					var selectFc = $("fclass");
					var index = selectFc.selectedIndex;
					if (selectFc.options[index].id == "4.00" || selectFc.options[index].id == "5.00") {
						var url = "http://myurl/district.jsp";
						var data = "fcity=" + $("fcity").value;
						var method = "post";
						var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
						var isShowProgress = false;
						var ajax = new Ajax(url, method, data, getDistrictResult, failFunction, requestHeader, isShowProgress);
						ajax.send();
						$("qxxz").show();
					} else {
						getFslaughter();
						$("qxxz").hide();
						document.getElementById("district").removeAll();
						document.getElementById("town").removeAll();
					}
				}
				
				function getDistrictResult(ajax) {
					var jsonObj = ajax.responseText.toJSON();
					var districtlist = jsonObj.districtlist;
					var selectObj = document.getElementById("district");
					selectObj.removeAll();
					if (districtlist.length > 0) {
						var v = new Array();
						for (var i = 0; i < districtlist.length; i++) {
							var option = new Option();
							option.text = districtlist[i].fname;
							option.value = districtlist[i].fitemid;
							if (districtlist[i].fname == khx) {
								option.selected = true;
							}
							v.push(option);
						}
						selectObj.adds(v);
					}
				
					getTown();
					//获取乡镇
				}
				
				function getTown() {
					var url = "http://myurl/town.jsp";
					var data = "district=" + $("district").value;
					var method = "post";
					var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
					var isShowProgress = false;
					var ajax = new Ajax(url, method, data, getTownResult, failFunction, requestHeader, isShowProgress);
					ajax.send();
				}
				
				function getTownResult(ajax) {
					var jsonObj = ajax.responseText.toJSON();
					var townlist = jsonObj.townlist;
					var selectObj = document.getElementById("town");
					selectObj.removeAll();
					if (townlist.length > 0) {
						var v = new Array();
						for (var i = 0; i < townlist.length; i++) {
							var option = new Option();
							option.text = townlist[i].fname;
							option.value = townlist[i].fitemid;
							if (townlist[i].fname == khxz) {
								option.selected = true;
							}
							v.push(option);
						}
						selectObj.adds(v);
					}
					getFslaughter();
				}
				
				function getFsalemodel() {//销售模式
					var url = "http://myurl/fsalemodel.jsp";
					var data = "";
					var method = "get";
					var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
					var isShowProgress = false;
					var ajax = new Ajax(url, method, data, getFsalemodelResult, failFunction, requestHeader, isShowProgress);
					ajax.send();
				}
				
				function getFsalemodelResult(ajax) {
					var jsonObj = ajax.responseText.toJSON();
					var fsalemodellist = jsonObj.fsalemodellist;
					var selectObj = document.getElementById("fsalemodel");
					if (fsalemodellist.length > 0) {
						var v = new Array();
						for (var i = 0; i < fsalemodellist.length; i++) {
							var option = new Option();
							option.text = fsalemodellist[i].fname;
							option.value = fsalemodellist[i].fid;
							if (fsalemodellist[i].fname == fsalemodel) {
								option.selected = true;
							}
							v.push(option);
						}
						selectObj.adds(v);
					}
				}
				
				function getFdockmanager() {//对接经理
					 
				
					var url = "http://myurl/fdockmanager.jsp";
					var data = "";
					var method = "get";
					var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
					var isShowProgress = false;
					var ajax = new Ajax(url, method, data, getFdockmanagerResult, failFunction, requestHeader, isShowProgress);
					ajax.send();
				}
				
				function getFdockmanagerResult(ajax) {
					var jsonObj = ajax.responseText.toJSON();
				
					var fdockmanagerlist = jsonObj.fdockmanagerlist;
				
					var selectObj = document.getElementById("fdockmanager");
					if (fdockmanagerlist.length > 0) {
						var v = new Array();
						for (var i = 0; i < fdockmanagerlist.length; i++) {
							var option = new Option();
							option.text = fdockmanagerlist[i].fname;
							option.value = fdockmanagerlist[i].fid;
							if ($("moduleStr").value == "add") {
								if (fdockmanagerlist[i].fname == userCN) {
									option.selected = true;
								}
							} else {
								if (fdockmanagerlist[i].fname == fdockmanager) {
									option.selected = true;
									$("fdockmanager").value = fdockmanagerlist[i].fname;
				
								}
							}
							v.push(option);
						}
						selectObj.adds(v);
				
						//++++++
						//var obj = $("fdockmanager");
						//var index = obj.selectedIndex;
						//$("fdockmanager").value= obj.options[index].text;
						var si = selectObj.length;
						for (var j = 0; j < si; j++) {
							var te = $("fdockmanager").options[j].text;
							//alert(fdockmanager+"-------"+te);
							if (fdockmanager == te) {
				
								$("fdockmanager").options[j].selected = true;
							}
				
						}
				
					}
				}
				
				function getFslaughter() {//屠宰场或者养殖场
					//4.00种猪销售 ; 5.00仔猪销售
					var typeObj = "";
					var searchId = "";
					var fby01 = "";
					var selectFc = $("fclass");
					var index = selectFc.selectedIndex;
					if (selectFc.options[index].id == "4.00" || selectFc.options[index].id == "5.00") {
						if ($("town").value != "") {
							typeObj = "FXiangZhenId";
							searchId = $("town").value;
						} else {
							typeObj = "FXianId";
							searchId = $("district").value;
						}
						fby01 = "1";
					} else {
						if ($("fcity").value != "") {
							typeObj = "FCityId";
							searchId = $("fcity").value;
						} else {
							typeObj = "FProvinceId";
							searchId = $("fprovince").value;
						}
						fby01 = "0";
					}
					var url = "http://myurl/fslaughter.jsp";
					var data = "typeObj=" + typeObj + "&searchId=" + searchId + "&fby01=" + fby01;
					var method = "post";
					var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
					var isShowProgress = false;
					var ajax = new Ajax(url, method, data, getFslaughterResult, failFunction, requestHeader, isShowProgress);
					ajax.send();
				}
				
				function getFslaughterResult(ajax) {
					var jsonObj = ajax.responseText.toJSON();
					var fslaughterlist = jsonObj.fslaughterlist;
					var selectObj = document.getElementById("fslaughter");
					selectObj.removeAll();
					if (fslaughterlist.length > 0) {
						var v = new Array();
						for (var i = 0; i < fslaughterlist.length; i++) {
							var option = new Option();
							option.text = fslaughterlist[i].fcompany;
							option.value = fslaughterlist[i].fcompany;
							if (fslaughterlist[i].fcompany == fslaughter) {
								option.selected = true;
							}
							v.push(option);
						}
						selectObj.adds(v);
					}
				}
				
				function searchFcstomer() {//客户查询
					var fcstomer = $("fcstomer").value;
					var autoObj = document.getElementById("fcstomer");
					var flag = db.isOpen();
					var result = true;
					if (!flag) {
						result = db.open("DB.zhmy", "sys:db/");
						/*打开DB.zhmy数据库,如果不存在则在目录db下创建*/
					}
					if (result) {
						var sql = "select id_,name_ from customer_sys_org where id_ like '%" + fcstomer + "%' or name_ like '%" + fcstomer + "%' limit 0,5";
						var listArr = db.query(sql);
						if (listArr.length > 0) {
							autoObj.removeall();
							for (var i = 0; i < listArr.length; i++) {
								autoObj.add(listArr[i].name_ + "|" + listArr[i].id_);
							}
						}
					}
					db.close();
				}
				
				function getChangeFcstomerText() {
					var fcstomer = $("fcstomer").value;
					var flag = db.isOpen();
					var result = true;
					if (!flag) {
						result = db.open("DB.zhmy", "sys:db/");
						/*打开DB.zhmy数据库,如果不存在则在目录db下创建*/
					}
					if (result) {
						var nameStr = fcstomer.substring(0, fcstomer.indexOf("|"));
						var codeStr = fcstomer.substring(fcstomer.indexOf("|") + 1);
						var sql = "select id_ from customer_sys_org where id_='" + codeStr + "' and name_='" + nameStr + "'";
						var listArr = db.query(sql);
						if (listArr.length == 0) {
							$("fcstomer").value = "";
							$("FBY09").value = "";
							$("FCstomer").value = "";
						} else {
							$("FBY09").value = codeStr;
							$("FCstomer").value = nameStr;
						}
					}
					db.close();
				}
				
				function submitModify() {
					if ($("fby02").value == "") {
						alert("请选择客户!");
						return false;
					} else if ($("putDate").value == "") {
						alert("请输装猪日期!");
						return false;
					} else if ($("putTime").value == "") {
						alert("请输入装猪时间!");
						return false;
					} else if ($("price").value == "") {
						alert("请输入单价!");
						return false;
					} else if ($("amount").value == "") {
						alert("请输入数量!");
						return false;
					} else if ($("fieldid").value == "") {
						alert("请输入场次!");
						return false;
					} else if ($("unit").value == "") {
						alert("请输入单元!");
						return false;
					}
					cacheRiconHref = "submitModify()";
					$("titlebar").riconhref = "";
					//防止重复点击
					onsubmit(user_id, devicetype, lastModifySub);
				}
				
				var toastMsg = "修改";
				function lastModifySub() {
					if (ly == "xsddgl") {
						$("moduleStr").value = "add";
					}
					if (ly == "xsddgl1") {
						$("moduleStr").value = "add";
					}
					var params = [];
					params.push("PlanSaleDate=", $("putDate").value + " " + $("putTime").value + ":00");
					params.push("&Price=", $("price").value);
					params.push("&FieldID=", $("fieldid").value);
					params.push("&Amount=", $("amount").value);
					params.push("&Unit=", $("unit").value);
					var selectZlqj = $("zlqj");
					var ind = selectZlqj.selectedIndex;
					params.push("&WeightInterval=", selectZlqj.options[ind].id);
					params.push("&FNote=", $("fnote").value);
				
					var obj = $("fdockmanager");
					var index = obj.selectedIndex;
					var val = obj.options[index].text;
					params.push("&DockingManager=", val);
				
					var fby08 = $("fby08").value;
				 	var nameStr = fby08.substring(0,fby08.indexOf("|"));
					var codeStr = fby08.substring(fby08.indexOf("|")+1);
				
					params.push("&FBY05=", $("djbz").value);
					params.push("&FBY11=", $("ylbz").value);
					params.push("&FBY06=", $("fby06").value);
					params.push("&FBY07=", "");
					params.push("&FBY08=",nameStr);
					params.push("&FBY09=",$("FBY09").value);
				 	params.push("&FBY12=",codeStr);
				 	params.push("&FBY14=",$("FBY14").value);
					params.push("&moduleStr=",$("moduleStr").value);
					if ($("moduleStr").value == "edit") {
						var dateString = getDateString();
						params.push("&FBY04=", dateString + " " + userCN + "编辑了此计划");
						params.push("&PLanSaleNo=", $("plansaleno").value);
					} else if ($("moduleStr").value == "add") {
						toastMsg = "新建";
						params.push("&Customer=", $("customer").value);
						params.push("&FWritePeople=", userCN);
						params.push("&FBY02=", $("fby02").value);
						params.push("&FBY03=", $("fby03").value);
					}
				
					var url = "http://myurl/xsjhgleditmodify.jsp";
					var data = params.join("");
					var method = "post";
					var requestHeader = '{"Content-Type":"application/x-www-form-urlencoded","Accept-Language":"GBK"}';
					var isShowProgress = true;
					var ajax = new Ajax(url, method, data, successSubmit, sucFailFunction, requestHeader, isShowProgress);
					ajax.send();
				}
				
				function sucFailFunction(data) {
					var str = data.responseText.trim();
					var msg = "请求错误!";
					var nextaction = "";
					str.replace(/<faultstring>(.*)<\/faultstring>/g, function(s, s1) {
						if (s1 != "")
							msg = s1;
						if (s1.indexOf("超时") > -1)
							nextaction = "script:reloadapp";
					});
					str.replace(/<faultactor>(.*)<\/faultactor>/g, function(s, s1) {
						if (s1 != "")
							nextaction = s1;
						$("titlebar").riconhref = "submitModify()";
					});
					window.openData('<html type="alert"><body><alert title="提示" icontype="info"><msg>' + msg + '</msg><nextaction href="' + nextaction + '"></nextaction></alert></body></html>');
				}
				
				function successSubmit(ajax) {
					var jsonObj = ajax.responseText.toJSON();
					cacheRiconHref = "";
					if (jsonObj.result == "true") {
						var ctype = 1;
						if (toastMsg == "修改") {
							ctype = 2;
						}
						var logMsg = toastMsg + "了一条数据";
						submitSysLog(module_id, ctype, 0, logMsg, plansaleno);
						alert(toastMsg + "成功!", modifySucc);
					} else {
						alert(toastMsg + "失败,请联系管理员!");
						$("titlebar").riconhref = "submitModify()";
						return false;
					}
				}
				
				function modifySucc() {
					if ($("moduleStr").value == "add") {
						if(ly == "xsddgl"){
							window.open("res:page/scgl/xsjhgl.uixml?module_id=1908", true, false);
						}else if(ly == "xsddgl1"){
							window.open("res:page/scgl/xsjhglh5/nxsjhgl.uixml?module_id=2514", true, false);
						}else {
							PageUtil.getWindowById("xsjhgl").callFunction("chooseData('btn')");
						}
					} else {
						if(type == 1){
							PageUtil.getWindowById("nxsjhglDetail").callFunction("init");
						}else{
							PageUtil.getWindowById("xsjhglDetail").callFunction("init");
						}
					}
					window.close();
				}

				 
			]]>
		</script>
	</head>
	<header>
		<titlebar title="修改销售计划" iconhref="script:close" id="titlebar" hidericon="false" ricon="res:image/titlebar/submit.png" clickricon="res:image/titlebar/submit_click.png" riconhref="submitModify()"/>
	</header>
	<body onload="init()" style="background-color: #ffffff;padding: 0;margin: 0">
			<div id="detail" class="container" style="display: none">
				<input type="hidden" id="plansaleno" name="PLanSaleNo" value="${plansaleno}" />
				<font style="width: 30%">订单编号:</font>
				<input type="text" id="fby03" name="FBY03" value="${fby03}" class="right" readonly="true"/>
				<hr color="#f2f2f2"/>
				<font style="width: 30%">订单头数:</font>
				<input type="text"  id="fqty" value="${fqty}" class="right" readonly="true"/>
				<hr color="#f2f2f2"/>
				<font style="width: 30%">客  户:</font>
				<input type="text" id="fby02" name="FBY02" value="${customer}" class="right" readonly="true"/>
				<hr color="#f2f2f2"/>
				<input type="hidden" value="${customerid}" name="Customer" id="customer"/>
				<font style="width: 30%">装猪时间:</font>
				<object type="date" id="putDate" value="${putDate}" style="width: 40%;margin: 4 1 4 4" onchange="getUnit();"></object>
				<object type="time" id="putTime" value="${putTime}" style="width: 29%;margin: 4 4 4 0"></object>
				<hr color="#f2f2f2"/>
				<input type="hidden" value="" name="PlanSaleDate" id="plansaledate"/>
				
				<font style="width: 30%" id="dj">单  价:</font>
				<input type="text" id="price" name="Price" value="${price}" class="right" inputlimit="num"/>
				<hr color="#f2f2f2"/>
				
				<div id="czjj" style="display: none">
					<font style="width: 30%">超重计价:</font>
					<input type="text" id="fby06" name="FBY06" value="${fby06}" class="right" inputlimit="num"/>
					<hr color="#f2f2f2"/>
					<font style="width: 30%">代  理  费:</font>
					<input type="text" id="fby09" name="FBY09" value="${fby09}" class="right" inputlimit="num"/>
					<hr color="#f2f2f2"/>
					<!--<font style="width: 30%">体重范围:</font>
					<input type="text" id="fby07" name="FBY07" value="${fby07}" class="right"/>
					<hr color="#f2f2f2"/>-->
					<font style="width: 30%">经  销   商</font>
					<input type="autocompletetext" id="fby08" name="FBY08" value="${fby08}|${fby12}" class="right" shownum="5" ontextchanged="searchDistributor()" onchange="getChangeDistributorText()"/>
					<hr color="#f2f2f2"/>
				</div>
				<font style="width: 30%">类  别:</font>
				<select id="fclass" name="FClass" class="right" multiple="true" title="选择类别" onchange="getZlqj();changeInner();"/>
				<hr color="#f2f2f2"/>
				<font style="width: 30%" id="zlqjFont">重量区间:</font>
				<select id="zlqj" name="WeightInterval" class="right" multiple="true" title="请选择重量区间" onchange="changeInner();getUnit();"/>
				<hr color="#f2f2f2"/>
				<font style="width: 30%">等级备注:</font>
				<select id="djbz" name="FBY05" class="right"/>
				<hr color="#f2f2f2"/>
				<font style="width: 30%">孕       龄:</font>
				<select id="ylbz" name="FBY11" class="right"/>
				<hr color="#f2f2f2"/>
				<font style="width: 30%">子  公  司:</font>
				<select id="farea" class="right" multiple="true" title="请选择子公司" onchange="getCc();" />
				<hr color="#f2f2f2"/>
				<font style="width: 30%">场  次:</font>
				<select id="fieldid" name="FieldID" class="right" multiple="true" title="请选择场次" onchange="getUnit();"/>
				<hr color="#f2f2f2"/>
				<font style="width: 30%">单  元:</font>
				<!--<select id="unit" name="Unit" class="right"/>-->
				<!--<input type="text" id="unit" name="Unit" value="${unit}" class="right"  readonly="true" />-->
				<input type="text" id="unit" name="Unit"  class="right">${unit}</input>
				<hr color="#f2f2f2"/>
				<font style="width: 30%">数  量:</font>
				<input type="text" id="amount" name="Amount" value="${amount}" class="right" inputlimit="num"/>
				<hr color="#f2f2f2"/>
				<font style="width: 30%">对接经理:</font>
				<select id="fdockmanager" name="FDockManager" class="right" multiple="true" onchange=""/>
				<hr color="#f2f2f2"/>
				<font style="width: 30%">备注信息:</font>
				<textarea rows="4" id="fnote" name="FNote" class="right">${fnote}</textarea>
				<hr color="#f2f2f2"/>
				<!--<font style="width: 30%">客户评价:</font>
				<textarea rows="4" id="fby12" name="FBY12" class="right" readonly="true">${fby12}</textarea>-->
				
				<!--
				<input type="hidden" value="${fsingledate}" name="FSingleDate" id="FSingleDate"/>
				<input type="hidden" value="${fcheck}" name="FCheck" id="FCheck"/>
				<input type="hidden" value="${fcheckdate}" name="FCheckDate" id="FCheckDate"/>
				<input type="hidden" value="${fcheckpeople}" name="FCheckPeople" id="FCheckPeople"/>
				<input type="hidden" value="${fdelete}" name="FDelete" id="FDelete"/>-->
				
				<input type="hidden" value="zhmy" name="FBY14" id="FBY14"/>
				<input type="hidden" value="edit" name="moduleStr" id="moduleStr"/>
			</div>
	</body>
	<dialogset>
		<dialog id="pushdialogid" style="padding:0;" title="提示" oktext="查看"  canceltext="取消">
		</dialog>
	</dialogset>
</html>

运行平台及版本 : 5.15.6.1

手机型号 : 所有的安卓手机

基座版本 : 5.15.4.1

我要回答

下载APP
扫码下载栗子社区APP