         //chrome brower need F12-> Network->disable cache
         // *************************重要：
         //1. eval(fun + "('不是数字！')");小心使用，会把字符串参数，转为数学运算，如参数为："2022-01-01",转为2022-1-1=2020，所以，无论是什么类型的参数，都加上双引号或单引号，不让其认为是计算公式；
         //2. window[fun]( txt )；在vue中使用，存在兼容问题


		 var str2=null;

		  function import_excel_to_json(file){
			return new  Promise(function (resolve, reject) {
			  let jsonData = {};
			  let reader = new FileReader();
			  reader.readAsBinaryString(file);
			  reader.onload =  function () {
				  let data = reader.result
				  let workbook = XLSX.read(data, {
					  type: 'binary'
				  })
				  resolve(workbook);
			  }
			})
		  }; 
		 
	              // 读取本地excel文件
	              function readWorkbookFromLocalFile(file, callback) {
	                  var reader = new FileReader();
	                  reader.onload = function (e) {
	                      var data = e.target.result;
	                      var workbook = XLSX.read(data, { type: 'binary' });
	                      if (callback) callback(workbook);
	                  };
	                  reader.readAsBinaryString(file);
	                  //reader.readAsArrayBuffer(file);
	              }
	
				  //sheet数	  
				  function SheetAmount(workbook){
					  if (workbook.SheetNames.length >= 15) {
						  return true;
					  } else {
						  return  "少于15个表，不是正确日报文件！";
					  }
				  }

				  //sheet是否存在
				   function HaveSheets(workbook){
					var arraySheetNames = ["B1","B2","B3","B4","B6","B7","B8","B9","B10","B11","B12","B13","B14","B15","C"];
					let arrStr = new Array(arraySheetNames.length).fill("");
					var sheetNames = workbook.SheetNames; // 工作表名称集合
					for (let i = 0; i < arraySheetNames.length; i++) {
						for (let index = 0; index < sheetNames.length; index++) {						
							if (arraySheetNames[i] === sheetNames[index]) {
								arrStr[i]=arraySheetNames[i];													
						    }  						
					    }
				    }

					var flag = true;
					var str ="不存在的表: ";
					for (let n = 0; n < arrStr.length; n++) {
						if (arrStr[n] === "") {
							flag = false;
							str +=  arraySheetNames[n] + " ";
						}						
					}

					if (flag === true) {
						return true;
					} else {
						return str;
					}
				}//sheet是否存在

               //是否为空表,2022-4-20停用，新函数为HaveData3Para
			   /* function HaveDatas(workbook){
				    var worksheet = workbook.Sheets["C"]; 
					if (worksheet["C16"] === undefined) {
						return "单元格: C16 " + " -> 空值！" + '\n';		
					} else {
						if (worksheet["C16"].v > 0){
							return true;	
						}else{
							return "表C单元格C16 " + " 等于或小于 0，无需上报！" + '\n';
						}			   						
					}
			   }*/

			   function 项目号(str) {	
				if (str.length != 10){
					return "所填："+ str +"，不是10字符！";
				}else if(str.substr(0,1)!="U" || !myIsNaN(str.substr(1,4)) || str.substr(5,1)!="P" || !myIsNaN(str.substr(6,4)) ){
					return "所填："+ str +"，格式有误！";
				}else{
					return true;
				};	
			};

	              // 检验日报excel文件
	              function readWorkbook(workbook,logID,strDate,userID,unitID,projectID) {
                 
					 var arraySheetNames = ["B1","B2","B3","B4","B6","B7","B8","B9","B10","B11","B12","B13","B14","B15"];
					 var arrayFunNames=[
						["必填","站归类B1","区域归类","经度","纬度","文字","日期","上传人","单元号","项目号","受阻归类","通过"],
						["必填","站归类B2","区域归类","经度","纬度","文字","日期","上传人","单元号","项目号","通过"],
						["必填","段归类","区域归类","文字","数值","日期","上传人","单元号","项目号","通过"],
						["必填","段归类","区域归类","文字","数值","数值","日期","上传人","单元号","项目号","通过"],
						["必填","日期","上传人","单元号","项目号","数值","通过"],
						["必填","室分归类B7","经度","纬度","文字","数值","日期","上传人","单元号","项目号","通过"],
						["必填","室分归类B8","经度","纬度","文字","数值","数值","数值","日期","上传人","单元号","项目号","通过"],
						["必填","室分归类B9","经度","纬度","文字","数值","数值","日期","上传人","单元号","项目号","通过"],
						["必填","经度","纬度","文字","数值","数值","日期","上传人","单元号","项目号","通过"],
						["必填","经度","纬度","文字","数值","数值","日期","上传人","单元号","项目号","通过"],
						["必填","经度","纬度","文字","数值","日期","上传人","单元号","项目号","通过"],
						["必填","经度","纬度","文字","数值","日期","上传人","单元号","项目号","通过"],
						["日期","文字","文字","上传人","单元号","项目号","交通归类","用车归类","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","文字","通过"],
						["日期","单元号","项目号","上传人","文字","文字","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","通过"]
					 ];

					 var stc = workbook.Sheets["C"]; 
					 for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
						var stid=i+2;
						if (stc["C"+stid].v > 0 ) {// 只检查有数据行的sheet

							
							var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
							//var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
							var rows = stc["C"+stid].v 

							var cell_ref;
							var index;
				
							for (var R = 2; R <= rows+1; ++R) {//loop row
								index = 0;
								for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	

		                            str2="";
									cell_ref = number2alphabet(C) + R;
									str2=null;
		  
									//xlsx.full.min.js 里面没有Cell对象，要访问Cell值，只能通worksheet对象，可以从workbook object的内部结构看出来
									//如果单元格为空，控制台会提示错误，运行停止，下面是解决办法！
									if (worksheet[cell_ref] === undefined) {
										document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] + "单元格" + cell_ref + "  空值！" + '\n';
										index++;	
							         //  alert(index);

									} else {
																	       //   alert(index);
										if (arrayFunNames[i][index]==="日期") {
											//alert(window[arrayFunNames[i][index]](worksheet[cell_ref].v,strDate));
											if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true){
											   document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
											}else if (formatExcelDate(worksheet[cell_ref].v,"-") != strDate) {
											   document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + "所填："+ formatExcelDate(worksheet[cell_ref].v,"-")  +"，不等于所选：" + strDate +  '\n';
											};

										} else if (arrayFunNames[i][index]==="上传人") {
											if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") != true ){
											   document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") + '\n';
											};

										}else if (arrayFunNames[i][index]==="单元号") {
											if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true){
												document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
											 }else if (worksheet[cell_ref].v != unitID) {
												document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + "所填："+ worksheet[cell_ref].v  +"，不等于用户归属：" + unitID +  '\n';
											 };

										}else if (arrayFunNames[i][index]==="项目号") {
											var strs= new Array();
											var  bHaveMoreID=false
											if (projectID.includes(',') && !projectID.includes('，')) {
												strs = projectID.split(',')
												bHaveMoreID=true
											} else if (projectID.includes('，')  && !projectID.includes(',') ) {
												strs = projectID.split('，')
												bHaveMoreID=true
											}else if (projectID.includes('，')  && projectID.includes(',') ) {
												document.getElementById(logID).innerHTML += "所填："+ projectID +"，同时包含中英文豆号！"+ '\n';
											}
         
											if (bHaveMoreID) {												
												for (let index = 0; index < strs.length; index++) {													
													if (项目号(strs[index]) != true) {
														document.getElementById(logID).innerHTML += 项目号(strs[index])+ '\n';
													}
												}

												var bEqual=false
												for (let index = 0; index < strs.length; index++) {
													if (worksheet[cell_ref].v == strs[index]) {
														bEqual = true 
													}
													
												}
												if (bEqual != true ) {
													document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + "所填："+ worksheet[cell_ref].v +"，不含于：" + projectID +  '\n';
												}

											} else {
												if (worksheet[cell_ref].v != projectID) {
													document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + "所填："+ worksheet[cell_ref].v +"，不等于：" + projectID +  '\n';
												 };												
											}

											if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true){
												document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
											 }

										}else{
											if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true ){				  
											   document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] +  "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
											};
										};
																	   
										index++;
		  
									};//cell is not blank
		  
								};//loop col
																
							};//loop row					 

						};// 只检查有数据行的sheet
					 };//loop sheet
	              };//// 检验日报excel文件
	              
//自定义单元格核验函数/////////////////////////////////////////////////////////////////////////////////////////////////////	 
				  function 必填(str) {
					//要求非空字符，非0
					if(str.toString()==="0"){
					   return "所填为0！";
					}else if(myTrim(str)===""){
					  return "所填为空！";
					}else{
					  return true;
				  };
				 };

				 function 站归类B1(str) {
					var arrStr = ["新址","共址","维护","微站"];	
					if(!myMatch(arrStr,str)){					 
					   return "所填："+ str +"，不是其一：新址|共址|维护|微站 ！";
					}else{
					   return true;
					};
				 };
				 
				 function 站归类B2(str) {
						var arrStr = ["新址","共址","维护","微站","存满","软扩"];	
					if(!myMatch(arrStr,str)){								
					   return "所填："+ str +"，不是其一：新址|共址|维护|微站|存满|软扩 ！";
					}else{
					   return true;
					};
				 };

				 function 区域归类(str) {
					var arrStr = ["城区","非城区"];	
					if(!myMatch(arrStr,str)){	
					   return "所填："+ str +"，不是其一：城区|非城区 ！";
					}else{
					   return true;
					};
				 };	

				 function 经度(str) {				   			      								   
					if (!myIsNaN(str)){
					   return "所填："+ str +"，不是数值！";
					}else if(str>140||str<60){
				   return "所填："+ str +"，不在区间60-140！";
				}else{
				   return true;
				};
			 };
			 
			 function 纬度(str) {
					if (!myIsNaN(str)){
					   return "所填："+ str +"，不是数值！";
					}else if(str>125||str<1){
				   return "所填："+ str +"，不在区间1-125！";
				 }else{
					return true;
				 };
			  };

			  function 文字(str) {
				if (myIsNaN(str)){
				   return "所填："+ str +"，是数值！";
				}else if(myTrim(str)===""){
					return "所填为空！";
			 }else{
				return true;
			 };
		  };			  

		  function 日期(strX) {
			  var str=formatExcelDate(strX,"-")
			if(isNaN(str) && !isNaN(Date.parse(str))) {
				    return true;
				}else{
					return "所填："+ str +"，不是日期格式！";
				};
			  };
		  
			  
			  function 上传人(str,userID) {		
						if (str != userID) {
							return "所填："+ str +"，和用户名："+ userID +"，不相等！";
						}else{
							return true;
						};					
				  };		  

				  //2022-4-21停用，使用只有1个参数的新版
				  /*function 单元号(str,unitID) {		
					if (str != unitID) {
						return "所填："+ str +"，和用户单元号："+ unitID +"，不相等！";
					}else{
						return true;
					};					
			      };*/	
              //2022-4-22停用，使用只有1个参数的新版
			  /*function 项目号(str,projectID) {		
				if (str != projectID) {
					return "所填："+ str +"，和所选项目号："+ projectID +"，不相等！";
				}else{
					return true;
				};					
		      };*/	

			  function myMatch(arrClass,str) {
				  var b=false
				  for (let index = 0; index < arrClass.length; index++) {
					  if (arrClass[index]===str) {
						b=true
					  }					  
				  }
				  return b;
			  };

			  function 受阻归类(str) {
				var arrStr = ["成功","部分","失败"];				
				if(!myMatch(arrStr,str)){
				   return "所填："+ str +"，不是其一：成功|部分|失败 ！";
				}else{
				   return true;
				};
			 };		

			 function 段归类(str) {
				var arrStr = ["新建管道","干线","城域","家集客"];				
				if(!myMatch(arrStr,str)){
				   return "所填："+ str +"，不是其一：新建管道|干线|城域|家集客 ！";
				}else{
				   return true;
				};
			 };			

			 function 数值(str) {
				if (!myIsNaN(str)){
				   return "所填："+ str +"，不是数值！";				
				  }else{
					 return true;
				  };
				};

			 
			 function 室分归类B7(str) {
				var arrStr = ["信源改造","传统分布","新型分布"];				
				if(!myMatch(arrStr,str)){
				   return "所填："+ str +"，不是其一：信源改造|传统分布|新型分布 ！";
				}else{
				   return true;
				};
			 };			
			 
			 function 室分归类B8(str) {
				var arrStr = ["传统分布","新型分布"];				
				if(!myMatch(arrStr,str)){
				   return "所填："+ str +"，不是其一：传统分布|新型分布 ！";
				}else{
				   return true;
				};
			 };			

			 function 室分归类B9(str) {		
				if(str != "仅信源"){
				   return "所填："+ str +"，不是：仅信源 ！";
				}else{
				   return true;
				};
			 };			

			 function 交通归类(str) {
				var arrStr = ["租公司车","租个人车","打车","网约车","公交地铁","步行","他方出车","按出图包干"];				
				if(!myMatch(arrStr,str)){
				   return "所填："+ str +"，不是其一：租公司车|租个人车|打车|网约车|公交地铁|步行|他方出车|按出图包干 ！";
				}else{
				   return true;
				};
			 };			

			 function 用车归类(str) {
				var arrStr = ["普通车","越野车","其他"];				
				if(!myMatch(arrStr,str)){
				   return "所填："+ str +"，不是其一：普通车|越野车|其他 ！";
				}else{
				   return true;
				};
			 };			

							function myTrim(x) {
								var x2 = String(x);
							  return x2.replace(/^\s+|\s+$/gm,'');
							};
							
							function myIsNaN(value) {
								let numX = Number(value);
								return typeof numX === 'number' && !isNaN(numX);
							};

							function isNumber(val){    
								var regPos = /^\d+(\.\d+)?$/;
								var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; 
								if(regPos.test(val) && regNeg.test(val)){
									return true;
								}else{        
									return false;
								}
							}
							
							              function CheckFile(obj) {
											 alert( typeof obj);
											  alert(obj.value);
											  console.log(obj);
							                  var array = new Array('xlsx'); //可以上传的文件类型'gif', 'jpeg', 'png', 'jpg' 
							                  if (obj.value == '') {
							                      alert("选择要上传的xlsx文件!");
							                      return false;
							                  }
							                  else {
							                      var fileContentType = obj.value.match(/^(.*)(\.)(.{1,8})$/)[3]; //这个文件类型正则很有用：） 
							                      var isExists = false;
							                      for (var i in array) {
							                          if (fileContentType.toLowerCase() == array[i].toLowerCase()) {
							                              isExists = true;
							                              
														  //can next sub
														  readWorkbookFromLocalFile(obj, function(workbook) {
														  	                readWorkbook(workbook);
														  	            });
																		return true;
							                          }
							                      }
							                      if (isExists == false) {
							                          obj.value = null;
							                          alert("文件类型不是xlsx!");
							                          return false;
							                      }
							                      return false;
							                  }
							              };
										  
    /**
     * 格式化excel传递的时间
     * @param numb 需转化的时间 43853
     * @param format 分隔符 "-"
     * @returns {string} 2020-1-22
     */
function formatExcelDate(numb, format) {
	const old = numb - 1;
	const t = Math.round((old - Math.floor(old)) * 24 * 60 * 60);
	const time = new Date(1900, 0, old, 0, 0, t)
	const year = time.getFullYear() ;
	const month = time.getMonth() + 1 ;
	const date = time.getDate() ;
	return year + format + (month < 10 ? '0' + month : month) + format + (date < 10 ? '0' + date : date)
};

//数字列转字母列
str2="";//全局变量，用之前str2=""，用完了要手工str2=null;
function number2alphabet(number){
// number要大于0
 var str1="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  if (number <= 26 ) {
	//var num1 = parseInt(number / 26);
	var num2 =  number % 26
	if (num2 === 0) {
		str2 += "Z";
	} else  {
		str2 += str1.charAt(num2-1);//charAt从0开始的
	};
   
 } else {
	var num1=parseInt(number / 26);
	var num2=  number % 26;
	    if (num1 >= 2 && num2 === 0) {
			num1 -= 1 ;
		}
		number2alphabet(num1);
		if (num2 === 0) {
			str2 += "Z";
		} else  {
			str2 += str1.charAt(num2-1);//charAt从0开始的
		};
	 
   };

   return str2;
};

//generate json string from workbook
function makeJSONstring(workbook){
	var arraySheetNames = ["B1","B2","B3","B4","B6","B7","B8","B9","B10","B11","B12","B13","B14","B15"];
	var arrayFunNames=[
		["必填","站归类B1","区域归类","经度","纬度","文字","日期","上传人","单元号","项目号","受阻归类","通过"],
		["必填","站归类B2","区域归类","经度","纬度","文字","日期","上传人","单元号","项目号","通过"],
		["必填","段归类","区域归类","文字","数值","日期","上传人","单元号","项目号","通过"],
		["必填","段归类","区域归类","文字","数值","数值","日期","上传人","单元号","项目号","通过"],
		["必填","日期","上传人","单元号","项目号","数值","通过"],
		["必填","室分归类B7","经度","纬度","文字","数值","日期","上传人","单元号","项目号","通过"],
		["必填","室分归类B8","经度","纬度","文字","数值","数值","数值","日期","上传人","单元号","项目号","通过"],
		["必填","室分归类B9","经度","纬度","文字","数值","数值","日期","上传人","单元号","项目号","通过"],
		["必填","经度","纬度","文字","数值","数值","日期","上传人","单元号","项目号","通过"],
		["必填","经度","纬度","文字","数值","数值","日期","上传人","单元号","项目号","通过"],
		["必填","经度","纬度","文字","数值","日期","上传人","单元号","项目号","通过"],
		["必填","经度","纬度","文字","数值","日期","上传人","单元号","项目号","通过"],
		["日期","文字","文字","上传人","单元号","项目号","交通归类","用车归类","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","文字","通过"],
		["日期","单元号","项目号","上传人","文字","文字","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","通过"]
	 ];
	
	var strB="";
	var stc = workbook.Sheets["C"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=i+2;
	   if (stc["C"+stid].v > 0 ) {// 只检查有数据行的sheet
	
		strB += '\"'+arraySheetNames[i]+'\"' +":\"[";
	
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["C"+stid].v 
	
		   var cell_ref;
		   for (var R = 2; R <= rows+1; ++R) {//loop row	
			   if (R===2) {
				   strB +="[";
			   }else{
				   strB +="▓[";
			   };
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	
	
				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;
					 
					 if (C===(arrayFunNames[i].length+1)) {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") ;		 
						}else{
							strB += worksheet[cell_ref].v; 
						};
					 } else {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") + "∮";		 
						}else{
							strB += worksheet[cell_ref].v + "∮"; 
						};
					 };
	
			   };//loop col				
			 strB +="]";		
		   };//loop row					 
		   strB +="]\",";
	   };// 只检查有数据行的sheet
	};//loop sheet
	
	return "{"+strB+"}";
	};


///////////////////under this line special for income xlsx file //////////////////////////////////

function 年月(str) {	
	var str1 = str.substr(0,4);
	var str2 = str.substr(4,2);
  if(isNaN(str1+"-"+str2+"-01") && !isNaN(Date.parse(str1+"-"+str2+"-01"))) {
	return true;
  }else{
	return "所填："+ str +"，不是年月！";
  };
};

function 是否(str) {
	var arrStr = ["是","否"];				
	if(!myMatch(arrStr,str)){
	   return "所填："+ str +"，不是其一：是|否 ！";
	}else{
	   return true;
	};
 };		

 function 收入凭证(str) {
	var arrStr = ["无","邮件","聊天截图","签证图片","其他"];				
	if(!myMatch(arrStr,str)){
	   return "所填："+ str +"，不是其一：无|邮件|聊天截图|签证图片|其他 ！";
	}else{
	   return true;
	};
 };		

 function 结算模式(str) {
	var arrStr = ["比例","计件","人天","比例计件","比例人天","计件人天","比例计件人天"];				
	if(!myMatch(arrStr,str)){
	   return "所填："+ str +"，不是其一：比例|计件|人天|比例计件|比例人天|计件人天|比例计件人天 ！";
	}else{
	   return true;
	};
 };	

 function 通过(str) {					
	   return true;
 };			

 				  //Single sheet是否存在
				   function HaveSingleSheetName(workbook,sheetname){
					var flag = false;
					var sheetNames = workbook.SheetNames; // 工作表名称集合
						for (let index = 0; index < sheetNames.length; index++) {						
							if (sheetname === sheetNames[index]) {
								flag = true;													
						    }  						
					    }				    					
					if (flag === true) {
						return true;
					} else {
						return sheetname + ",表不存在!";
					}
				} ;				  //Single sheet是否存在


               //是否为空表3参数通用版
			   function HaveData3Para(workbook,sheetname,cellname){
				    var worksheet = workbook.Sheets[sheetname]; 
					if (worksheet[cellname] === undefined) {
				    var worksheet = workbook.Sheets[sheetname]; 
						return "表"+ sheetname +"单元格" + cellname + " 为空！" + '\n';		
					} else {
						if (worksheet[cellname].v > 0){
							return true;	
						}else{
							return "表"+ sheetname +"单元格" + cellname  + " 等于或小于 0，无需上报！" + '\n';
						}			   						
					}
			   };

			   	              // 检验收入excel文件
								 function checkIncomeFile(workbook,logID,strYYYYMM,userID,unitID) {                 
									var arraySheetNames = ["SR"];
									var arrayFunNames=[
									   ["年月","单元号","上传人","文字","文字","文字","文字","日期","日期","是否","数值","数值","收入凭证","结算模式","文字","文字","通过","通过"]								  
									];
									var stc = workbook.Sheets["SR"]; 
									for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
									   var stid=1;
									   if (stc["T"+stid].v > 0 ) {// 只检查有数据行的sheet
			   
										   
										   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
										   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
										   var rows = stc["T"+stid].v 
			   
										   var cell_ref;
										   var index;
							   
										   for (var R = 2; R <= rows+1; ++R) {//loop row
											   index = 0;
											   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	
			   
												   str2="";
												   cell_ref = number2alphabet(C) + R;
												   str2=null;
						 
												   //xlsx.full.min.js 里面没有Cell对象，要访问Cell值，只能通worksheet对象，可以从workbook object的内部结构看出来
												   //如果单元格为空，控制台会提示错误，运行停止，下面是解决办法！
												   if (worksheet[cell_ref] === undefined) {
													   document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] + "单元格" + cell_ref + "  空值！" + '\n';
													   index++;	
													//  alert(index);
			   
												   } else {
																						  //   alert(index);
													   if (arrayFunNames[i][index]==="年月") {
														   //alert(window[arrayFunNames[i][index]](worksheet[cell_ref].v,strDate));
														   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true){
															  document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
														   }else if (worksheet[cell_ref].v != strYYYYMM) {
															  document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + "所填："+ worksheet[cell_ref].v +"，不等于所选：" + strYYYYMM +  '\n';
														   };
			   
													   } else if (arrayFunNames[i][index]==="上传人") {
														   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") != true ){
															  document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") + '\n';
														   };
			   
													   }else if (arrayFunNames[i][index]==="单元号") {
														if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true){
															document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
														 }else if (worksheet[cell_ref].v != unitID) {
															document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + "所填："+ worksheet[cell_ref].v  +"，不等于用户归属：" + unitID +  '\n';
														 };
			   													      
													   }else{
														   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true ){				  
															  document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] +  "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
														   };
													   };
																					  
													   index++;
						 
												   };//cell is not blank
						 
											   };//loop col
																			   
										   };//loop row					 
			   
									   };// 只检查有数据行的sheet
									};//loop sheet
								 };//// 检验收入excel文件

//generate income data to json string from workbook
function makeIncomeJSONstring(workbook){
	var arraySheetNames = ["SR"];
	var arrayFunNames=[
		["年月","单元号","上传人","文字","文字","文字","文字","日期","日期","是否","数值","数值","收入凭证","结算模式","文字","文字","通过","通过"]	   
	];
	
	var strB="";
	var stc = workbook.Sheets["SR"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=1;
	   if (stc["T"+stid].v > 0 ) {// 只检查有数据行的sheet
	
		//strB +=","+ arraySheetNames[i] +":[";
		strB += '\"'+arraySheetNames[i]+'\"' +":\"[";
	
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["T"+stid].v 
	
		   var cell_ref;
		   for (var R = 2; R <= rows+1; ++R) {//loop row	
			   if (R===2) {
				   strB +="[";
			   }else{
				   strB +="▓[";
			   };
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	
	
				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;
					 
					 if (C===(arrayFunNames[i].length+1)) {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") ;		 
						}else{
							strB += worksheet[cell_ref].v; 
						};
					 } else {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") + "∮";		 
						}else{
							strB += worksheet[cell_ref].v + "∮"; 
						};
					 };
	
			   };//loop col				
			 strB +="]";		
		   };//loop row					 
		   strB +="]\",";
	   };// 只检查有数据行的sheet
	};//loop sheet
	
	return "{"+strB+"}";
	};//generate income data to json string from workbook



///////////////////under this line start for balance xlsx file //////////////////////////////////
function 单元号(str) {	
	if (str.length != 5){
		return "所填："+ str +"，不是5字符！";
	}else if(str.substr(0,1)!="U" || !myIsNaN(str.substr(1,4))){
		return "所填："+ str +"，格式有误！";
	}else{
		return true;
	};	
};

function 住宿归类(str) {
	var arrStr = ["宾馆","宿舍"];				
	if(!myMatch(arrStr,str)){
	   return "所填："+ str +"，不是其一：宾馆|宿舍 ！";
	}else{
	   return true;
	};
 };	


 // 检验 支援 excel文件
 function checkBalanceFile(workbook,logID,strStartDate,strEndDate,userID) {                 
	var arraySheetNames = ["GRZY","JJZY"];
	var arrayFunNames=[
	   ["文字","单元号","单元号","日期","住宿归类","数值","上传人","通过"],
	   ["文字","单元号","单元号","日期","文字","文字","文字","数值","数值","数值","上传人","通过"]									  
	];
	var stc = workbook.Sheets["C"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=i+2;
	   if (stc["C"+stid].v > 0 ) {// 只检查有数据行的sheet

		   
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["C"+stid].v 

		   var cell_ref;
		   var index;

		   for (var R = 2; R <= rows+1; ++R) {//loop row
			   index = 0;
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	

				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;

				   //xlsx.full.min.js 里面没有Cell对象，要访问Cell值，只能通worksheet对象，可以从workbook object的内部结构看出来
				   //如果单元格为空，控制台会提示错误，运行停止，下面是解决办法！
				   if (worksheet[cell_ref] === undefined) {
					   document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] + "单元格" + cell_ref + "  空值！" + '\n';
					   index++;	
					//  alert(index);

				   } else {
														  //   alert(index);
														  if (arrayFunNames[i][index]==="日期") {
															//alert(window[arrayFunNames[i][index]](worksheet[cell_ref].v,strDate));
															if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true){
															   document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
															}else {
																var objStartDate = new Date(strStartDate);
																var objEndDate = new Date(strEndDate);
																var objTableDate = new Date(formatExcelDate(worksheet[cell_ref].v,"-"));
																if (objTableDate.getTime()<objStartDate.getTime() || objTableDate.getTime()>objEndDate.getTime() ){
																	document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + "所填："+ formatExcelDate(worksheet[cell_ref].v,"-")  +"，不在界面日期区间内！" +   '\n';
																}															   
															};

					   } else if (arrayFunNames[i][index]==="上传人") {
						   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") != true ){
							  document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") + '\n';
						   };					  
					   }else{
						   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true ){				  
							  document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] +  "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
						   };
					   };
													  
					   index++;

				   };//cell is not blank

			   };//loop col
											   
		   };//loop row					 

	   };// 只检查有数据行的sheet
	};//loop sheet
 }; // 检验 支援 excel文件

 //generate balance data to json string from workbook
function makeBalanceJSONstring(workbook){
	var arraySheetNames = ["GRZY","JJZY"];
	var arrayFunNames=[
	   ["文字","单元号","单元号","日期","住宿归类","数值","上传人","通过"],
	   ["文字","单元号","单元号","日期","文字","文字","文字","数值","数值","数值","上传人","通过"]									  
	];
	
	var strB="";
	var stc = workbook.Sheets["C"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=i+2;
	   if (stc["C"+stid].v > 0 ) {// 只检查有数据行的sheet
	
		//strB +=","+ arraySheetNames[i] +":[";
		strB += '\"'+arraySheetNames[i]+'\"' +":\"[";
	
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["C"+stid].v 
	
		   var cell_ref;
		   for (var R = 2; R <= rows+1; ++R) {//loop row	
			   if (R===2) {
				   strB +="[";
			   }else{
				   strB +="▓[";
			   };
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	
	
				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;
					 
					 if (C===(arrayFunNames[i].length+1)) {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") ;		 
						}else{
							strB += worksheet[cell_ref].v; 
						};
					 } else {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") + "∮";		 
						}else{
							strB += worksheet[cell_ref].v + "∮"; 
						};
					 };
	
			   };//loop col				
			 strB +="]";		
		   };//loop row					 
		   strB +="]\",";
	   };// 只检查有数据行的sheet
	};//loop sheet
	
	return "{"+strB+"}";
	};//generate balance data to json string from workbook

///////////////////under this line start for invoice xlsx file //////////////////////////////////


			   	              // 检验 开票 excel文件
								 function checkInvoiceFile(workbook,logID,userID) {                 
									var arraySheetNames = ["KP"];
									var arrayFunNames=[
										["通过","通过","通过","通过","文字","数值","数值","数值","文字","数值","数值","日期","结算模式","文字","文字","是否","项目号","通过","文字","上传人","通过"]								  
									];
									var stc = workbook.Sheets["KP"]; 
									for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
									   var stid=1;
									   if (stc["W"+stid].v > 0 ) {// 只检查有数据行的sheet
			   
										   
										   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
										   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
										   var rows = stc["W"+stid].v 
			   
										   var cell_ref;
										   var index;
							   
										   for (var R = 2; R <= rows+1; ++R) {//loop row
											   index = 0;
											   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	
			   
												   str2="";
												   cell_ref = number2alphabet(C) + R;
												   str2=null;
						 
												   //xlsx.full.min.js 里面没有Cell对象，要访问Cell值，只能通worksheet对象，可以从workbook object的内部结构看出来
												   //如果单元格为空，控制台会提示错误，运行停止，下面是解决办法！
												   if (worksheet[cell_ref] === undefined) {
													   document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] + "单元格" + cell_ref + "  空值！" + '\n';
													   index++;	
																   
												   } else {
																						  //   alert(index);
                                                       if (arrayFunNames[i][index]==="上传人") {
														   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") != true ){
															  document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") + '\n';
														   };
													   }else if(arrayFunNames[i][index]==="项目号"){
																str2="";
																var cell_ref2 = number2alphabet(C-1) + R;
																str2=null;
																if (worksheet[cell_ref2].v=== "是" ){				  
																	//worksheet[cell_ref].v = "见拆分";
																 }else{
																	if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true ){				  
																		document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] +  "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
																	 };
																 };
													   }else{
														   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true ){				  
															  document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] +  "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
														   };
													   };
																					  
													   index++;
						 
												   };//cell is not blank						 
											   };//loop col																			   
										   };//loop row					 			   
									   };// 只检查有数据行的sheet
									};//loop sheet
								 };//// 检验 开票 excel文件

//generate invoice data to json string from workbook
function makeInvoiceJSONstring(workbook){
	var arraySheetNames = ["KP"];
	var arrayFunNames=[
		["通过","通过","通过","通过","文字","数值","数值","数值","文字","数值","数值","日期","结算模式","文字","文字","是否","项目号","通过","文字","上传人","通过"]	   
	];
	
	var strB="";
	var stc = workbook.Sheets["KP"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=1;
	   if (stc["W"+stid].v > 0 ) {// 只检查有数据行的sheet
	
		//strB +=","+ arraySheetNames[i] +":[";
		strB += '\"'+arraySheetNames[i]+'\"' +":\"[";
	
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["W"+stid].v 
	
		   var cell_ref;
		   for (var R = 2; R <= rows+1; ++R) {//loop row	
			   if (R===2) {
				   strB +="[";
			   }else{
				   strB +="▓[";
			   };
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	
	
				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;
					 
					 if (C===(arrayFunNames[i].length+1)) {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") ;		 
						}else{
							strB += worksheet[cell_ref].v; 
						};
					 } else {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") + "∮";		 
						}else{
							strB += worksheet[cell_ref].v + "∮"; 
						};
					 };
	
			   };//loop col				
			 strB +="]";		
		   };//loop row					 
		   strB +="]\",";
	   };// 只检查有数据行的sheet
	};//loop sheet
	
	return "{"+strB+"}";
	};//generate invoice data to json string from workbook



///////////////////under this line start for invoice_split xlsx file //////////////////////////////////


			   	              // 检验 开票拆分 excel文件
								 function checkInvoiceSplitFile(workbook,logID,userID) {                 
									var arraySheetNames = ["KPCF"];
									var arrayFunNames=[
										["通过","数值","项目号","通过","文字","上传人"]								  
									];
									var stc = workbook.Sheets["KPCF"]; 
									for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
									   var stid=1;
									   if (stc["H"+stid].v > 0 ) {// 只检查有数据行的sheet
			   
										   
										   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
										   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
										   var rows = stc["H"+stid].v 
			   
										   var cell_ref;
										   var index;
							   
										   for (var R = 2; R <= rows+1; ++R) {//loop row
											   index = 0;
											   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	
			   
												   str2="";
												   cell_ref = number2alphabet(C) + R;
												   str2=null;
						 
												   //xlsx.full.min.js 里面没有Cell对象，要访问Cell值，只能通worksheet对象，可以从workbook object的内部结构看出来
												   //如果单元格为空，控制台会提示错误，运行停止，下面是解决办法！
												   if (worksheet[cell_ref] === undefined) {
													   document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] + "单元格" + cell_ref + "  空值！" + '\n';
													   index++;	
																   
												   } else {
																						  //   alert(index);
                                                       if (arrayFunNames[i][index]==="上传人") {
														   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") != true ){
															  document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") + '\n';
														   };
													   }else{
														   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true ){				  
															  document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] +  "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
														   };
													   };
																					  
													   index++;
						 
												   };//cell is not blank						 
											   };//loop col																			   
										   };//loop row					 			   
									   };// 只检查有数据行的sheet
									};//loop sheet
								 };//// 检验 开票 excel文件

//generate invoice-split data to json string from workbook
function makeInvoiceSplitJSONstring(workbook){
	var arraySheetNames = ["KPCF"];
	var arrayFunNames=[
		["通过","数值","项目号","通过","文字","上传人"]		   
	];
	
	var strB="";
	var stc = workbook.Sheets["KPCF"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=1;
	   if (stc["H"+stid].v > 0 ) {// 只检查有数据行的sheet
	
		//strB +=","+ arraySheetNames[i] +":[";
		strB += '\"'+arraySheetNames[i]+'\"' +":\"[";
	
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["H"+stid].v 
	
		   var cell_ref;
		   for (var R = 2; R <= rows+1; ++R) {//loop row	
			   if (R===2) {
				   strB +="[";
			   }else{
				   strB +="▓[";
			   };
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	
	
				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;
					 
					 if (C===(arrayFunNames[i].length+1)) {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") ;		 
						}else{
							strB += worksheet[cell_ref].v; 
						};
					 } else {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") + "∮";		 
						}else{
							strB += worksheet[cell_ref].v + "∮"; 
						};
					 };
	
			   };//loop col				
			 strB +="]";		
		   };//loop row					 
		   strB +="]\",";
	   };// 只检查有数据行的sheet
	};//loop sheet
	
	return "{"+strB+"}";
	};//generate invoice data to json string from workbook


///////////////////under this line start for salary xlsx file //////////////////////////////////

// 检验 工资 excel文件
function checkSalaryFile(workbook,logID,strYYYYMM,userID) {                 
	var arraySheetNames = ["CGZ","CQT","CJT"];
	var arrayFunNames=[
	   ["单元号","年月","文字","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","通过","通过","数值","数值","上传人"],
	   ["单元号","年月","数值","数值","数值","数值","通过","上传人"],
	   ["单元号","年月","文字","文字","数值","通过","上传人"]									  
	];
	var stc = workbook.Sheets["C"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=i+2;
	   if (stc["C"+stid].v > 0 ) {// 只检查有数据行的sheet

		   
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["C"+stid].v 

		   var cell_ref;
		   var index;

		   for (var R = 2; R <= rows+1; ++R) {//loop row
			   index = 0;
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	

				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;

				   //xlsx.full.min.js 里面没有Cell对象，要访问Cell值，只能通worksheet对象，可以从workbook object的内部结构看出来
				   //如果单元格为空，控制台会提示错误，运行停止，下面是解决办法！
				   if (worksheet[cell_ref] === undefined) {
					   document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] + "单元格" + cell_ref + "  空值！" + '\n';
					   index++;	
					//  alert(index);

				   } else {
					 if (arrayFunNames[i][index]==="年月") {
							//alert(window[arrayFunNames[i][index]](worksheet[cell_ref].v,strDate));
							if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true){
							document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
							}else if (worksheet[cell_ref].v != strYYYYMM) {
							document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + "所填："+ worksheet[cell_ref].v +"，不等于所选：" + strYYYYMM +  '\n';
							};

					   } else if (arrayFunNames[i][index]==="上传人") {
						   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") != true ){
							  document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") + '\n';
						   };					  
					   }else{
						   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true ){				  
							  document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] +  "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
						   };
					   };
													  
					   index++;

				   };//cell is not blank

			   };//loop col
											   
		   };//loop row					 

	   };// 只检查有数据行的sheet
	};//loop sheet
 }; // 检验 支援 excel文件

 //generate salary data to json string from workbook
function makeSalaryJSONstring(workbook){
	var arraySheetNames = ["CGZ","CQT","CJT"];
	var arrayFunNames=[
	   ["单元号","年月","文字","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","通过","通过","数值","数值","上传人"],
	   ["单元号","年月","数值","数值","数值","数值","通过","上传人"],
	   ["单元号","年月","文字","文字","数值","通过","上传人"]									  
	];
	
	var strB="";
	var stc = workbook.Sheets["C"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=i+2;
	   if (stc["C"+stid].v > 0 ) {// 只检查有数据行的sheet
	
		//strB +=","+ arraySheetNames[i] +":[";
		strB += '\"'+arraySheetNames[i]+'\"' +":\"[";
	
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["C"+stid].v 
	
		   var cell_ref;
		   for (var R = 2; R <= rows+1; ++R) {//loop row	
			   if (R===2) {
				   strB +="[";
			   }else{
				   strB +="▓[";
			   };
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	
	
				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;
					 
					 if (C===(arrayFunNames[i].length+1)) {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") ;		 
						}else{
							strB += worksheet[cell_ref].v; 
						};
					 } else {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") + "∮";		 
						}else{
							strB += worksheet[cell_ref].v + "∮"; 
						};
					 };
	
			   };//loop col				
			 strB +="]";		
		   };//loop row					 
		   strB +="]\",";
	   };// 只检查有数据行的sheet
	};//loop sheet
	
	return "{"+strB+"}";
	};//generate salary data to json string from workbook


///////////////////under this line start for cash_in xlsx file //////////////////////////////////

// 检验 到款 excel文件
function checkCashInFile(workbook,logID,strStartDate,strEndDate,userID) {                 
	var arraySheetNames = ["DK"];
	var arrayFunNames=[
	   ["日期","数值","通过","项目号","文字","通过","上传人"]							  
	];
	var stc = workbook.Sheets["DK"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=1;
	   if (stc["I"+stid].v > 0 ) {// 只检查有数据行的sheet

		   
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["I"+stid].v 

		   var cell_ref;
		   var index;

		   for (var R = 2; R <= rows+1; ++R) {//loop row
			   index = 0;
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	

				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;

				   //xlsx.full.min.js 里面没有Cell对象，要访问Cell值，只能通worksheet对象，可以从workbook object的内部结构看出来
				   //如果单元格为空，控制台会提示错误，运行停止，下面是解决办法！
				   if (worksheet[cell_ref] === undefined) {
					   document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] + "单元格" + cell_ref + "  空值！" + '\n';
					   index++;	
					//  alert(index);

				   } else {
														  //   alert(index);
														  if (arrayFunNames[i][index]==="日期") {
															//alert(window[arrayFunNames[i][index]](worksheet[cell_ref].v,strDate));
															if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true){
															   document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
															}else {
																var objStartDate = new Date(strStartDate);
																var objEndDate = new Date(strEndDate);
																var objTableDate = new Date(formatExcelDate(worksheet[cell_ref].v,"-"));
																if (objTableDate.getTime()<objStartDate.getTime() || objTableDate.getTime()>objEndDate.getTime() ){
																	document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + "所填："+ formatExcelDate(worksheet[cell_ref].v,"-")  +"，不在界面日期区间内！" +   '\n';
																}															   
															};

					   } else if (arrayFunNames[i][index]==="上传人") {
						   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") != true ){
							  document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") + '\n';
						   };					  
					   }else{
						   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true ){				  
							  document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] +  "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
						   };
					   };
													  
					   index++;

				   };//cell is not blank

			   };//loop col
											   
		   };//loop row					 

	   };// 只检查有数据行的sheet
	};//loop sheet
 }; // 检验 到款 excel文件

 //generate cashin data to json string from workbook
function makeCashInJSONstring(workbook){
	var arraySheetNames = ["DK"];
	var arrayFunNames=[
		["日期","数值","通过","项目号","文字","通过","上传人"]							  
	];
	
	var strB="";
	var stc = workbook.Sheets["DK"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=1;
	   if (stc["I"+stid].v > 0 ) {// 只检查有数据行的sheet
	
		//strB +=","+ arraySheetNames[i] +":[";
		strB += '\"'+arraySheetNames[i]+'\"' +":\"[";
	
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["I"+stid].v 
	
		   var cell_ref;
		   for (var R = 2; R <= rows+1; ++R) {//loop row	
			   if (R===2) {
				   strB +="[";
			   }else{
				   strB +="▓[";
			   };
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	
	
				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;
					 
					 if (C===(arrayFunNames[i].length+1)) {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") ;		 
						}else{
							strB += worksheet[cell_ref].v; 
						};
					 } else {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") + "∮";		 
						}else{
							strB += worksheet[cell_ref].v + "∮"; 
						};
					 };
	
			   };//loop col				
			 strB +="]";		
		   };//loop row					 
		   strB +="]\",";
	   };// 只检查有数据行的sheet
	};//loop sheet
	
	return "{"+strB+"}";
	};//generate cashin data to json string from workbook


///////////////////under this line start for cash_out xlsx file //////////////////////////////////

// 检验 付款 excel文件
function checkCashOutFile(workbook,logID,strStartDate,strEndDate,userID) {                 
	var arraySheetNames = ["FK"];
	var arrayFunNames=[
	   ["日期","数值","通过","项目号","通过","上传人"]							  
	];
	var stc = workbook.Sheets["FK"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=1;
	   if (stc["H"+stid].v > 0 ) {// 只检查有数据行的sheet

		   
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["H"+stid].v 

		   var cell_ref;
		   var index;

		   for (var R = 2; R <= rows+1; ++R) {//loop row
			   index = 0;
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	

				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;

				   //xlsx.full.min.js 里面没有Cell对象，要访问Cell值，只能通worksheet对象，可以从workbook object的内部结构看出来
				   //如果单元格为空，控制台会提示错误，运行停止，下面是解决办法！
				   if (worksheet[cell_ref] === undefined) {
					   document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] + "单元格" + cell_ref + "  空值！" + '\n';
					   index++;	
					//  alert(index);

				   } else {
														  //   alert(index);
														  if (arrayFunNames[i][index]==="日期") {
															//alert(window[arrayFunNames[i][index]](worksheet[cell_ref].v,strDate));
															if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true){
															   document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
															}else {
																var objStartDate = new Date(strStartDate);
																var objEndDate = new Date(strEndDate);
																var objTableDate = new Date(formatExcelDate(worksheet[cell_ref].v,"-"));
																if (objTableDate.getTime()<objStartDate.getTime() || objTableDate.getTime()>objEndDate.getTime() ){
																	document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref + "所填："+ formatExcelDate(worksheet[cell_ref].v,"-")  +"，不在界面日期区间内！" +   '\n';
																}															   
															};

					   } else if (arrayFunNames[i][index]==="上传人") {
						   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") != true ){
							  document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") + '\n';
						   };					  
					   }else{
						   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true ){				  
							  document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] +  "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
						   };
					   };
													  
					   index++;

				   };//cell is not blank

			   };//loop col
											   
		   };//loop row					 

	   };// 只检查有数据行的sheet
	};//loop sheet
 }; // 检验 付款 excel文件

 //generate cashout data to json string from workbook
function makeCashOutJSONstring(workbook){
	var arraySheetNames = ["FK"];
	var arrayFunNames=[
		["日期","数值","通过","项目号","通过","上传人"]						  
	];
	
	var strB="";
	var stc = workbook.Sheets["FK"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=1;
	   if (stc["H"+stid].v > 0 ) {// 只检查有数据行的sheet
	
		//strB +=","+ arraySheetNames[i] +":[";
		strB += '\"'+arraySheetNames[i]+'\"' +":\"[";
	
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["H"+stid].v 
	
		   var cell_ref;
		   for (var R = 2; R <= rows+1; ++R) {//loop row	
			   if (R===2) {
				   strB +="[";
			   }else{
				   strB +="▓[";
			   };
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	
	
				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;
					 
					 if (C===(arrayFunNames[i].length+1)) {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") ;		 
						}else{
							strB += worksheet[cell_ref].v; 
						};
					 } else {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") + "∮";		 
						}else{
							strB += worksheet[cell_ref].v + "∮"; 
						};
					 };
	
			   };//loop col				
			 strB +="]";		
		   };//loop row					 
		   strB +="]\",";
	   };// 只检查有数据行的sheet
	};//loop sheet
	
	return "{"+strB+"}";
	};//generate cashout data to json string from workbook
	

///////////////////under this line start for b14c xlsx file //////////////////////////////////

// 检验 B14C excel文件
function checkB14CFile(workbook,logID,userID) {                 
	var arraySheetNames = ["B14C"];
	var arrayFunNames=[
	   ["日期","文字","文字","文字","单元号","项目号","交通归类","用车归类","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","通过","通过","文字","日期","通过","通过","通过","通过","通过","数值","通过","通过","通过","通过","通过","通过","数值","数值","数值","数值","通过","通过","日期","文字","上传人"]							  
	];
	var stc = workbook.Sheets["C"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=2;
	   if (stc["C"+stid].v > 0 ) {// 只检查有数据行的sheet

		   
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["C"+stid].v 

		   var cell_ref;
		   var index;

		   for (var R = 2; R <= rows+1; ++R) {//loop row
			   index = 0;
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	

				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;

				   //xlsx.full.min.js 里面没有Cell对象，要访问Cell值，只能通worksheet对象，可以从workbook object的内部结构看出来
				   //如果单元格为空，控制台会提示错误，运行停止，下面是解决办法！
				   if (worksheet[cell_ref] === undefined) {
					   document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] + "单元格" + cell_ref + "  空值！" + '\n';
					   index++;	
					//  alert(index);

				   } else {
					   if (arrayFunNames[i][index]==="上传人") {
						   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") != true ){
							  document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") + '\n';
						   };					  
					   }else{
						   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true ){				  
							  document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] +  "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
						   };
					   };
													  
					   index++;

				   };//cell is not blank

			   };//loop col
											   
		   };//loop row					 

	   };// 只检查有数据行的sheet
	};//loop sheet
 }; // 检验 B14C excel文件

 //generate b14c data to json string from workbook
function makeB14CJSONstring(workbook){
	var arraySheetNames = ["B14C"];
	var arrayFunNames=[
		["日期","文字","文字","文字","单元号","项目号","交通归类","用车归类","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","通过","通过","文字","日期","通过","通过","通过","通过","通过","数值","通过","通过","通过","通过","通过","通过","数值","数值","数值","数值","通过","通过","日期","文字","上传人"]						  
	];
	
	var strB="";
	var stc = workbook.Sheets["C"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=2;
	   if (stc["C"+stid].v > 0 ) {// 只检查有数据行的sheet
	
		//strB +=","+ arraySheetNames[i] +":[";
		strB += '\"'+arraySheetNames[i]+'\"' +":\"[";
	
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["C"+stid].v 
	
		   var cell_ref;
		   for (var R = 2; R <= rows+1; ++R) {//loop row	
			   if (R===2) {
				   strB +="[";
			   }else{
				   strB +="▓[";
			   };
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	
	
				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;
					 
					 if (C===(arrayFunNames[i].length+1)) {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") ;		 
						}else{
							strB += worksheet[cell_ref].v; 
						};
					 } else {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") + "∮";		 
						}else{
							strB += worksheet[cell_ref].v + "∮"; 
						};
					 };
	
			   };//loop col				
			 strB +="]";		
		   };//loop row					 
		   strB +="]\",";
	   };// 只检查有数据行的sheet
	};//loop sheet
	
	return "{"+strB+"}";
	};//generate b14c data to json string from workbook


///////////////////under this line start for b15c xlsx file //////////////////////////////////

// 检验 B15C excel文件
function checkB15CFile(workbook,logID,userID) {                 
	var arraySheetNames = ["B15C"];
	var arrayFunNames=[
	   ["日期","单元号","项目号","文字","通过","通过","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","通过","文字","通过","文字","通过","通过","通过","通过","数值","数值","数值","数值","数值","通过","数值","数值","数值","通过","通过","通过","文字","通过","通过","通过","通过","通过","通过","上传人"]							  
	];
	var stc = workbook.Sheets["C"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=2;
	   if (stc["C"+stid].v > 0 ) {// 只检查有数据行的sheet

		   
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["C"+stid].v 

		   var cell_ref;
		   var index;

		   for (var R = 2; R <= rows+1; ++R) {//loop row
			   index = 0;
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	

				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;

				   //xlsx.full.min.js 里面没有Cell对象，要访问Cell值，只能通worksheet对象，可以从workbook object的内部结构看出来
				   //如果单元格为空，控制台会提示错误，运行停止，下面是解决办法！
				   if (worksheet[cell_ref] === undefined) {
					   document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] + "单元格" + cell_ref + "  空值！" + '\n';
					   index++;	
					//  alert(index);

				   } else {
					   if (arrayFunNames[i][index]==="上传人") {
						   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") != true ){
							  document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") + '\n';
						   };					  
					   }else{
						   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true ){				  
							  document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] +  "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
						   };
					   };
													  
					   index++;

				   };//cell is not blank

			   };//loop col
											   
		   };//loop row					 

	   };// 只检查有数据行的sheet
	};//loop sheet
 }; // 检验 B15C excel文件

 //generate b15c data to json string from workbook
function makeB15CJSONstring(workbook){
	var arraySheetNames = ["B15C"];
	var arrayFunNames=[
		["日期","单元号","项目号","文字","通过","通过","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","数值","通过","文字","日期","文字","通过","通过","通过","通过","数值","数值","数值","数值","数值","通过","数值","数值","数值","通过","通过","日期","文字","通过","通过","通过","通过","通过","通过","上传人"]						  
	];
	
	var strB="";
	var stc = workbook.Sheets["C"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=2;
	   if (stc["C"+stid].v > 0 ) {// 只检查有数据行的sheet
	
		//strB +=","+ arraySheetNames[i] +":[";
		strB += '\"'+arraySheetNames[i]+'\"' +":\"[";
	
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["C"+stid].v 
	
		   var cell_ref;
		   for (var R = 2; R <= rows+1; ++R) {//loop row	
			   if (R===2) {
				   strB +="[";
			   }else{
				   strB +="▓[";
			   };
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	
	
				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;
					 
					 if (C===(arrayFunNames[i].length+1)) {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") ;		 
						}else{
							strB += worksheet[cell_ref].v; 
						};
					 } else {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") + "∮";		 
						}else{
							strB += worksheet[cell_ref].v + "∮"; 
						};
					 };
	
			   };//loop col				
			 strB +="]";		
		   };//loop row					 
		   strB +="]\",";
	   };// 只检查有数据行的sheet
	};//loop sheet
	
	return "{"+strB+"}";
	};//generate b15c data to json string from workbook


///////////////////under this line start for b16-b19 xlsx file //////////////////////////////////

// 检验 b16-b19 excel文件
function checkB16toB19File(workbook,logID,userID) {                 
	var arraySheetNames = ["B16","B17","B18","B19"];
	var arrayFunNames=[
		["通过","日期","文字","单元号","日期","文字","文字","文字","数值","文字","上传人"],
		["通过","日期","文字","单元号","日期","文字","文字","数值","数值","文字","上传人"],
		["通过","日期","文字","单元号","日期","文字","文字","文字","数值","文字","上传人"],
		["通过","日期","文字","单元号","文字","数值","文字","上传人"]	
	];
	var stc = workbook.Sheets["C"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=i+2;
	   if (stc["C"+stid].v > 0 ) {// 只检查有数据行的sheet

		   
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["C"+stid].v 

		   var cell_ref;
		   var index;

		   for (var R = 2; R <= rows+1; ++R) {//loop row
			   index = 0;
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	

				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;

				   //xlsx.full.min.js 里面没有Cell对象，要访问Cell值，只能通worksheet对象，可以从workbook object的内部结构看出来
				   //如果单元格为空，控制台会提示错误，运行停止，下面是解决办法！
				   if (worksheet[cell_ref] === undefined) {
					   document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] + "单元格" + cell_ref + "  空值！" + '\n';
					   index++;	
					//  alert(index);

				   } else {
					   if (arrayFunNames[i][index]==="上传人") {
						   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") != true ){
							  document.getElementById(logID).innerHTML += "表" + arraySheetNames[i] + "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"','"+userID+"')") + '\n';
						   };					  
					   }else{
						   if (eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") != true ){				  
							  document.getElementById(logID).innerHTML +="表" + arraySheetNames[i] +  "单元格" + cell_ref  + eval(arrayFunNames[i][index]+"('"+worksheet[cell_ref].v+"')") + '\n';
						   };
					   };
													  
					   index++;

				   };//cell is not blank

			   };//loop col
											   
		   };//loop row					 

	   };// 只检查有数据行的sheet
	};//loop sheet
 }; // 检验 b16-b19 excel文件

 //generate b16-b19 data to json string from workbook
function makeB16toB19JSONstring(workbook){
	var arraySheetNames = ["B16","B17","B18","B19"];
	var arrayFunNames=[
	   ["通过","日期","文字","单元号","日期","文字","文字","文字","数值","文字","上传人"],
	   ["通过","日期","文字","单元号","日期","文字","文字","数值","数值","文字","上传人"],
	   ["通过","日期","文字","单元号","日期","文字","文字","文字","数值","文字","上传人"],
	   ["通过","日期","文字","单元号","文字","数值","文字","上传人"]						  
	];
	
	var strB="";
	var stc = workbook.Sheets["C"]; 
	for (let i = 0; i < arraySheetNames.length; i++) {//loop sheet						
	   var stid=i+2;
	   if (stc["C"+stid].v > 0 ) {// 只检查有数据行的sheet
	
		//strB +=","+ arraySheetNames[i] +":[";
		strB += '\"'+arraySheetNames[i]+'\"' +":\"[";
	
		   var worksheet = workbook.Sheets[arraySheetNames[i]]; // 这里我们只读取每个sheet
		   //var strRange = worksheet['!ref'];// 取已使用区域,格式为：A1:U3,包含很多空的行，不能使用这个方式了，从C表中，取真实的数据行数
		   var rows = stc["C"+stid].v 
	
		   var cell_ref;
		   for (var R = 2; R <= rows+1; ++R) {//loop row	
			   if (R===2) {
				   strB +="[";
			   }else{
				   strB +="▓[";
			   };
			   for (var C = 2; C <= arrayFunNames[i].length+1; ++C) {//loop col	
	
				   str2="";
				   cell_ref = number2alphabet(C) + R;
				   str2=null;
					 
					 if (C===(arrayFunNames[i].length+1)) {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") ;		 
						}else{
							strB += worksheet[cell_ref].v; 
						};
					 } else {
						if (arrayFunNames[i][C-2]==="日期") {
							strB += formatExcelDate(worksheet[cell_ref].v,"-") + "∮";		 
						}else{
							strB += worksheet[cell_ref].v + "∮"; 
						};
					 };
	
			   };//loop col				
			 strB +="]";		
		   };//loop row					 
		   strB +="]\",";
	   };// 只检查有数据行的sheet
	};//loop sheet
	
	return "{"+strB+"}";
	};//generate b16-b19 data to json string from workbook
/*
	export{import_excel_to_json,readWorkbookFromLocalFile,SheetAmount,HaveSheets,HaveData3Para,readWorkbook,makeJSONstring}
	export{HaveSingleSheetName,makeIncomeJSONstring,checkIncomeFile}
	export{ checkBalanceFile,makeBalanceJSONstring }
	export{ makeInvoiceJSONstring,checkInvoiceFile }
	export{ checkInvoiceSplitFile,makeInvoiceSplitJSONstring }
	export { checkSalaryFile,makeSalaryJSONstring }
	export { checkCashInFile,makeCashInJSONstring }
	export { checkCashOutFile,makeCashOutJSONstring }
	export { checkB14CFile,makeB14CJSONstring }
	export { checkB15CFile,makeB15CJSONstring }
	export { checkB16toB19File,makeB16toB19JSONstring }
*/
