<%@ page contentType="text/html;charset=UTF-8" %>
<script>
$(document).ready(function() {
	$('#basicTable').bootstrapTable({
		  //请求方法
               method: 'post',
               //类型json
               dataType: "json",
               contentType: "application/x-www-form-urlencoded",
               //显示检索按钮
				showSearch: true,
               //显示刷新按钮
               showRefresh: true,
               //显示切换手机试图按钮
               showToggle: true,
               //显示 内容列下拉框
    	       showColumns: true,
    	       //显示到处按钮
    	       showExport: true,
    	       //显示切换分页按钮
    	       showPaginationSwitch: true,
    	       //显示详情按钮
    	       detailView: true,
    	       	//显示详细内容函数
	           // detailFormatter: "detailFormatter",
    	       //最低显示2行
    	       minimumCountColumns: 2,
               //是否显示行间隔色
               striped: true,
               //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
               cache: false,
               //是否显示分页（*）
               pagination: true,
                //排序方式
               sortOrder: "asc",
               //初始化加载第一页，默认第一页
               pageNumber:1,
               //每页的记录行数（*）
               pageSize: 10,
               //可供选择的每页的行数（*）
               pageList: [10, 25, 50, 100],
               //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
               url: "${ctx}/filing/summary/data",
               //默认值为 'limit',传给服务端的参数为：limit, offset, search, sort, order Else
               //queryParamsType:'',
               ////查询参数,每次调用是会带上这个参数，可自定义
               queryParams : function(params) {
               	var searchParam = $("#searchForm").serializeJSON();
               	searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1;
               	searchParam.pageSize = params.limit === undefined? -1 : params.limit;
               	searchParam.orderBy = params.sort === undefined? "" : params.sort+ " "+  params.order;
                   return searchParam;
               },
               //分页方式：client客户端分页，server服务端分页（*）
               sidePagination: "server",
               contextMenuTrigger:"right",//pc端 按右键弹出菜单
               contextMenuTriggerMobile:"press",//手机端 弹出菜单，click：单击， press：长按。
               contextMenu: '#context-menu',
               onContextMenuItem: function(row, $el){
                   if($el.data("item") == "edit"){
                   		edit(row.id);
                   }else if($el.data("item") == "view"){
                       view(row.id);
                   } else if($el.data("item") == "delete"){
                        jp.confirm('确认要删除该基础信息记录吗？', function(){
                       	jp.loading();
                       	jp.get("${ctx}/filing/summary/delete?id="+row.id, function(data){
                   	  		if(data.success){
                   	  			$('#basicTable').bootstrapTable('refresh');
                   	  			jp.success(data.msg);
                   	  		}else{
                   	  			jp.error(data.msg);
                   	  		}
                   	  	})

                   	});

                   }
               },
		/*		onPostBody:function(){
					window.rowProps = undefined;
					_table_rowspan("#basicTable" , 1);
					_table_rowspan("#basicTable" , 2);
					_table_rowspan("#basicTable" , 3);
					_table_rowspan("#basicTable" , 4);
					_table_rowspan("#basicTable" , 5);
					return true;
				},*/
               onClickRow: function(row, $el){
               },
               	onShowSearch: function () {
			$("#search-collapse").slideToggle();
		},
               columns: [{
		        checkbox: true

		    }
			,{
		        field: 'projectCode',
		        title: '项目编码',
			    width: 100,
		        sortable: true,
		        sortName: 'projectCode'
		        ,formatter:function(value, row , index){
			   if(value == null || value ==""){
				   value = "-";
			   }
			   <c:choose>
				   <c:when test="${fns:hasPermission('test:filing:summary:edit')}">
				      return "<a href='javascript:edit(\""+row.id+"\")'>"+value+"</a>";
			      </c:when>
				  <c:when test="${fns:hasPermission('test:filing:summary:view')}">
				      return "<a href='javascript:view(\""+row.id+"\")'>"+value+"</a>";
			      </c:when>
				  <c:otherwise>
				      return value;
			      </c:otherwise>
			   </c:choose>

		        }
		    }
			,{
		        field: 'monomerCode',
		        title: '单体编码',
		        sortable: true,
			   width: 100,
		        sortName: 'monomerCode'

		    }
			,{
		        field: 'entryName',
		        title: '项目名称',
					   width: 100,
		        sortable: true,
		        sortName: 'entryName'

		    }
			,{
		        field: 'constructionYear',
		        title: '建设年度1',
					   width: 100,
		        sortable: true,
		        sortName: 'constructionYear'
		    }
			,{
		        field: 'annualInvestment',
		        title: '建设年度1</br>投资',
					   width: 100,
		        sortable: true,
		        sortName: 'annualInvestment'

		    }
				   ,{
					   field: 'constructionYearTwo',
					   title: '建设年度2',
					   width: 100,
					   sortable: true,
					   sortName: 'constructionYearTwo'
				   }
				   ,{
					   field: 'annualInvestmentTwo',
					   title: '建设年度2</br>投资',
					   width: 100,
					   sortable: true,
					   sortName: 'annualInvestmentTwo'

				   }
				   ,{
					   field: 'constructionYearThree',
					   title: '建设年度3',
					   width: 100,
					   sortable: true,
					   sortName: 'constructionYearThree'
				   }
				   ,{
					   field: 'annualInvestmentThree',
					   title: '建设年度3</br>投资',
					   width: 100,
					   sortable: true,
					   sortName: 'annualInvestmentThree'

				   }
				   ,{
					   field: 'constructionYearFour',
					   title: '建设年度4',
					   width: 100,
					   sortable: true,
					   sortName: 'constructionYearFour'
				   }
				   ,{
					   field: 'annualInvestmentFour',
					   title: '建设年度4</br>投资',
					   width: 100,
					   sortable: true,
					   sortName: 'annualInvestmentFour'

				   }
			,{
		        field: 'emphasis',
		        title: '工程属性/重点程度',
			   width: 100,
		        sortable: true,
		        sortName: 'emphasis'

		    },{
					   field: 'approvalNumber',
					   title: '核准文号',
					   width: 100,
					   sortable: true,
					   sortName: 'approvalNumber'
				   }
				   ,{
					   field: 'dateOfApproval',
					   title: '核准日期',
					   width: 100,
					   sortable: true,
					   sortName: 'dateOfApproval'

				   }
				   ,{
					   field: 'approvedAmount',
					   title: '核准金额',
					   width: 100,
					   sortable: true,
					   sortName: 'approvedAmount'
				   },{
					   field: 'earlyReplyNo',
					   title: '可研批复<br/>文号',
					   width: 100,
					   sortable: true,
					   sortName: 'earlyReplyNo'
				   }
				   ,{
					   field: 'approvalDate',
					   title: '可研批复<br/>日期',
					   width: 100,
					   sortable: true,
					   sortName: 'approvalDate'

				   }
				   ,{
					   field: 'staticInvestment',
					   title: '可研静态<br/>投资金额',
					   width: 100,
					   sortable: true,
					   sortName: 'staticInvestment'
				   },{
					   field: 'dynamicInvestment',
					   title: '可研动态<br/>投资金额',
					   width: 100,
					   sortable: true,
					   sortName: 'dynamicInvestment'
				   },{
					   field: 'constructionScaleVA',
					   title: '建设规模<br/>（变电容量）<br/>万伏安',
					   width: 150,
					   sortable: true,
					   sortName: 'constructionScaleVA'
				   }
				   ,{
					   field: 'constructionScaleKM',
					   title: '建设规模<br/>（线路长度）<br/>千米',
					   width: 150,
					   sortable: true,
					   sortName: 'constructionScaleKM'

				   }
				   ,{
					   field: 'numberOf',
					   title: '铁塔数量<br/>/钢管杆数量',
					   width: 150,
					   sortable: true,
					   sortName: 'numberOf'
				   },{
					   field: 'conductorType',
					   title: '导线型号<br/>及双回否型号',
					   width: 150,
					   sortable: true,
					   sortName: 'conductorType'
				   },{
					   field: 'conductorLength',
					   title: '导线型号<br/>及双回否长度',
					   width: 150,
					   sortable: true,
					   sortName: 'conductorLength'
				   },{
					   field: 'theSource',
					   title: '变压器来源<br/>新购/利旧，<br/>主变来源的<br/>变电站',
					   width: 150,
					   sortable: true,
					   sortName: 'theSource'
				   },{
					   field: 'modularConstructionScheme',
					   title: '模块化<br/>建设方案',
					   width: 150,
					   sortable: true,
					   sortName: 'modularConstructionScheme'
				   },{
					   field: 'descriptionOf',
					   title: '工程难点<br/>描述',
					   width: 150,
					   sortable: true,
					   sortName: 'descriptionOf'
				   },{
					   field: 'milestoneStartDate',
					   title: '里程碑<br/>开工日期',
					   width: 150,
					   sortable: true,
					   sortName: 'milestoneStartDate'
				   },{
					   field: 'milestoneCommissioningDate',
					   title: '里程碑<br/>投产日期',
					   width: 150,
					   sortable: true,
					   sortName: 'milestoneCommissioningDate'
				   },{
					   field: 'startDate',
					   title: '内控开工<br/>日期',
					   width: 150,
					   sortable: true,
					   sortName: 'startDate'
				   },{
					   field: 'internalControl',
					   title: '内控投产<br/>日期',
					   width: 150,
					   sortable: true,
					   sortName: 'internalControl'
				   },{
					   field: 'earliestArrival',
					   title: '主设备<br/>最早到货<br/>时间',
					   width: 150,
					   sortable: true,
					   sortName: 'earliestArrival'
				   },{
					   field: 'arrivalPlan',
					   title: '线路塔材<br/>到货计划',
					   width: 150,
					   sortable: true,
					   sortName: 'arrivalPlan'
				   },{
					   field: 'preDesignNo',
					   title: '初设批复文号',
					   width: 100,
					   sortable: true,
					   sortName: 'preDesignNo'
				   }
				   , {
					   field: 'initialDesignDate',
					   title: '初设批复日期',
					   width: 100,
					   sortable: true,
					   sortName: 'initialDesignDate'
				   },{
					   field: 'batchOverview',
					   title: '批概动态',
					   width: 100,
					   sortable: true,
					   sortName: 'batchOverview'
				   }
				   ,{
					   field: 'batchStatistics',
					   title: '批概静态',
					   width: 100,
					   sortable: true,
					   sortName: 'batchStatistics'
				   }
				   , {
					   field: 'estimateCode',
					   title: '批概场地清理费',
					   width: 100,
					   sortable: true,
					   sortName: 'estimateCode'

				   }, {
					   field: 'designCost',
					   title: '设计费批概',
					   width: 100,
					   sortable: true,
					   sortName: 'designCost'

				   }, {
					   field: 'supervisionFeeCode',
					   title: '监理费批概',
					   width: 100,
					   sortable: true,
					   sortName: 'supervisionFeeCode'

				   }, {
					   field: 'managementFeeCode',
					   title: '批概法人管理费',
					   width: 100,
					   sortable: true,
					   sortName: 'managementFeeCode'

				   }, {
					   field: 'dataCode',
					   title: '其他概算中需要的数据',
					   width: 100,
					   sortable: true,
					   sortName: 'dataCode'

				   },{
					   field: 'threeDepartment',
					   title: '三个项目部关键人员信息',
					   width: 100,
					   sortable: true,
					   sortName: 'threeDepartment'
				   },{
					   field: 'landNo',
					   title: '用地预审意见（变电站） 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'landNo'
				   },{
					   field: 'landDate',
					   title: '用地预审意见（变电站） 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'landDate'
				   },{
					   field: 'eiaNo',
					   title: '环评批复（变电站、线路） 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'eiaNo'
				   },{
					   field: 'eiaDate',
					   title: '环评批复（变电站、线路） 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'eiaDate'
				   },{
					   field: 'acceptanceNo',
					   title: '环评验收文号及日期 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'acceptanceNo'
				   },{
					   field: 'acceptanceDate',
					   title: '环评验收文号及日期 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'acceptanceDate'
				   },{
					   field: 'replyNo',
					   title: '水保批复（变电站、线路） 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'replyNo'
				   },{
					   field: 'replyDate',
					   title: '水保批复（变电站、线路） 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'replyDate'
				   },{
					   field: 'soilNo',
					   title: '水保验收文号及日期 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'soilNo'
				   },{
					   field: 'soilDate',
					   title: '水保验收文号及日期 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'soilDate'
				   },{
					   field: 'depositNo',
					   title: '压覆矿藏复函（变电站） 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'depositNo'
				   },{
					   field: 'depositDate',
					   title: '压覆矿藏复函（变电站） 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'depositDate'
				   },{
					   field: 'recordNo',
					   title: '地灾评估备案表（变电站） 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'recordNo'
				   },{
					   field: 'recordDate',
					   title: '地灾评估备案表（变电站） 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'recordDate'
				   },{
					   field: 'siteProposalNo',
					   title: '选址意见书（变电站） 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'siteProposalNo'
				   },{
					   field: 'siteProposalDate',
					   title: '选址意见书（变电站） 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'siteProposalDate'
				   },{
					   field: 'planningNo',
					   title: '线路路径规划意见 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'planningNo'
				   },{
					   field: 'planningDate',
					   title: '线路路径规划意见 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'planningDate'
				   },{
					   field: 'usePlanNo',
					   title: '用地规划许可证 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'usePlanNo'
				   },{
					   field: 'usePlanDate',
					   title: '用地规划许可证 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'usePlanDate'
				   },{
					   field: 'requisitonNo',
					   title: '征地补偿批复 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'requisitonNo'
				   },{
					   field: 'requisitonDate',
					   title: '征地补偿批复 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'requisitonDate'
				   },{
					   field: 'conLandNo',
					   title: '建设用地批准书 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'conLandNo'
				   },{
					   field: 'conLandDate',
					   title: '建设用地批准书 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'conLandDate'
				   },{
					   field: 'transferNo',
					   title: '划拨决定书 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'transferNo'
				   },{
					   field: 'transferDate',
					   title: '划拨决定书 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'transferDate'
				   },{
					   field: 'certificateNo',
					   title: '土地证（变电站） 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'certificateNo'
				   },{
					   field: 'certificateDate',
					   title: '土地证（变电站） 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'certificateDate'
				   },{
					   field: 'permitNo',
					   title: '建设工程规划许可证（变电站） 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'permitNo'
				   },{
					   field: 'permitDate',
					   title: '建设工程规划许可证（变电站） 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'permitDate'
				   },{
					   field: 'fireProNo',
					   title: '消防设计审查/备案意见（变电站） 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'fireProNo'
				   },{
					   field: 'fireProdate',
					   title: '消防设计审查/备案意见（变电站） 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'fireProdate'
				   },{
					   field: 'fireAccNo',
					   title: '消防验收/备案意见（变电站） 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'fireAccNo'
				   },{
					   field: 'fireAccDate',
					   title: '消防验收/备案意见（变电站） 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'fireAccDate'
				   },{
					   field: 'estateNo',
					   title: '不动产权证 文号',
					   width: 100,
					   sortable: true,
					   sortName: 'estateNo'
				   },{
					   field: 'estateDate',
					   title: '不动产权证 日期',
					   width: 100,
					   sortable: true,
					   sortName: 'estateDate'
				   },{
					   field: 'planningLevel',
					   title: '规划总平（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'planningLevel'
				   }
				   , {
					   field: 'surveyReport',
					   title: '勘察定界报告（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'surveyReport'

				   }, {
					   field: 'redLineMap',
					   title: '征地红线图（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'redLineMap'

				   }, {
					   field: 'redLineLand',
					   title: '用地红线图（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'redLineLand'

				   }, {
					   field: 'zongMap',
					   title: '宗地图',
					   width: 100,
					   sortable: true,
					   sortName: 'zongMap'

				   }, {
					   field: 'recordSurvey',
					   title: '勘察合同备案表（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'recordSurvey'

				   }, {
					   field: 'recordDesign',
					   title: '设计合同备案表（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'recordDesign'

				   }, {
					   field: 'recordContract',
					   title: '施工合同备案表（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'recordContract'

				   }, {
					   field: 'supervisionRecord',
					   title: '监理合同备案表（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'supervisionRecord'

				   }, {
					   field: 'qulifiedOpinions',
					   title: '岩土勘察报告审查合格意见（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'qulifiedOpinions'

				   }, {
					   field: 'constructionComments',
					   title: '施工图审查合格意见（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'constructionComments'

				   }, {
					   field: 'constructionDrawing',
					   title: '施工图审查合格证（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'constructionDrawing'

				   }, {
					   field: 'seismicReview',
					   title: '抗震设防审查证书（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'seismicReview'

				   }, {
					   field: 'planningSetting',
					   title: '规划放线报告（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'planningSetting'

				   }, {
					   field: 'safetyRecord',
					   title: '安监申报书、备案表（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'safetyRecord'

				   }, {
					   field: 'qualityRecord',
					   title: '质监申报书、备案表（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'qualityRecord'

				   }, {
					   field: 'constructionPermit',
					   title: '施工许可证',
					   width: 100,
					   sortable: true,
					   sortName: 'constructionPermit'

				   }, {
					   field: 'planBuiltMapping',
					   title: '规划竣工测绘现状图及管线、绿化、比较图（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'planBuiltMapping'

				   }, {
					   field: 'qualityAcceptance',
					   title: '质监竣工验收意见（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'qualityAcceptance'

				   }, {
					   field: 'urbanArchives',
					   title: '城建档案接收合格证明（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'urbanArchives'

				   }, {
					   field: 'completionRecord',
					   title: '竣工备案表（变电站）',
					   width: 100,
					   sortable: true,
					   sortName: 'completionRecord'

				   }, {
					   field: 'realEstate',
					   title: '房产测绘报告',
					   width: 100,
					   sortable: true,
					   sortName: 'realEstate'

				   }, {
					   field: 'reportOnLang',
					   title: '宗地复测报告',
					   width: 100,
					   sortable: true,
					   sortName: 'reportOnLang'

				   },{
					   field: 'commDate',
					   title: '开工日期',
					   width: 100,
					   sortable: true,
					   sortName: 'commDate'
				   }
				   , {
					   field: 'compDate',
					   title: '竣工日期',
					   width: 100,
					   sortable: true,
					   sortName: 'compDate'

				   }
				   , {
					   field: 'cossDate',
					   title: '投运日期',
					   width: 100,
					   sortable: true,
					   sortName: 'cossDate'

				   }
				   , {
					   field: 'conAcceptanceDate',
					   title: '环评验收日期',
					   width: 100,
					   sortable: true,
					   sortName: 'conAcceptanceDate'

				   }
				   , {
					   field: 'soilWaterDate',
					   title: '水保验收日期',
					   width: 100,
					   sortable: true,
					   sortName: 'soilWaterDate'

				   }
				   , {
					   field: 'dispatchingNaming',
					   title: '调度命名编号',
					   width: 100,
					   sortable: true,
					   sortName: 'dispatchingNaming'

				   }
				   , {
					   field: 'resultsSafety',
					   title: '安全质量量化考核成果',
					   width: 100,
					   sortable: true,
					   sortName: 'resultsSafety'

				   }
				   , {
					   field: 'cardInformation',
					   title: '增资产生的卡片信息',
					   width: 100,
					   sortable: true,
					   sortName: 'cardInformation'

				   }
				   , {
					   field: 'nameOfSubcontractor',
					   title: '分包单位名称',
					   width: 100,
					   sortable: true,
					   sortName: 'nameOfSubcontractor'
				   }
				   , {
					   field: 'projectLocation',
					   title: '项目地点',
					   width: 100,
					   sortable: true,
					   sortName: 'projectLocation'

				   }
				   , {
					   field: 'levelRiskContent',
					   title: '四级风险内容',
					   width: 100,
					   sortable: true,
					   sortName: 'levelRiskContent'

				   }
				   , {
					   field: 'levelRiskTime',
					   title: '四级风险实施时间',
					   width: 100,
					   sortable: true,
					   sortName: 'levelRiskTime'

				   }
				   , {
					   field: 'standStartTime',
					   title: '“标准化开工”时间',
					   width: 100,
					   sortable: true,
					   sortName: 'standStartTime'

				   }
				   , {
					   field: 'standTransferTime',
					   title: '“标准化转序”时间',
					   width: 100,
					   sortable: true,
					   sortName: 'standTransferTime'

				   }
				   , {
					   field: 'standAcceptanceTime',
					   title: '“标准化预验收”时间',
					   width: 100,
					   sortable: true,
					   sortName: 'standAcceptanceTime'

				   }
				   , {
					   field: 'dateOfInterview',
					   title: '约谈日期',
					   width: 100,
					   sortable: true,
					   sortName: 'dateOfInterview'

				   }
				   , {
					   field: 'accumulatedAmount',
					   title: '累计扣款金额',
					   width: 100,
					   sortable: true,
					   sortName: 'accumulatedAmount'

				   }
				   , {
					   field: 'mattersLeft',
					   title: '工程遗留相关事项',
					   width: 100,
					   sortable: true,
					   sortName: 'mattersLeft'

				   }
		     ],
		onExpandRow: function (index, row, $detail) {
			initSubTable(index, row, $detail);
		}
		});

	//初始化子表格(无线循环)
	initSubTable = function (index, row, $detail) {
		var parentid = row.projectCode;
		var cur_table = $detail.html('<table></table>').find('table');
		$(cur_table).bootstrapTable({
			url: '${ctx}/filing/summary/detail',
			method: 'post',
			//类型json
			dataType: "json",
			contentType: "application/x-www-form-urlencoded",
			queryParams : function(params) {
				var searchParam = $("#searchForm").serializeJSON();
				searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1;
				searchParam.pageSize = params.limit === undefined? -1 : params.limit;
				searchParam.orderBy = params.sort === undefined? "" : params.sort+ " "+  params.order;
				searchParam.projectCode = parentid;
				return searchParam;
			},
			striped: true, //是否显示行间隔色
			pagination: false,//显示分页
			sidePagination: "server",
			pageNumber:1,
			pageSize: 10,
			pageList: [10, 25],
			columns: [{
				width: 63
			},{
				field: 'projectCode',
				title: '',
				width: 100
				,formatter:function(value, row , index){
					if(value == null || value ==""){
						value = "-";
					}
				<c:choose>
					<c:when test="${fns:hasPermission('test:filing:summary:edit')}">
					return "<a href='javascript:editChild(\""+row.id+"\")'>"+value+"</a>";
				</c:when>
				<c:otherwise>
					return value;
				</c:otherwise>
					</c:choose>

				}
			}, {
				field: 'monomerCode',
				title: '',
				width: 100
			}, {
				field: 'entryName',
				title: '',
				width: 100,
			},{
					field: 'constructionYear',
					title: '',
				width: 100,
				}
				,{
					field: 'annualInvestment',
					title: '',
					width: 100,
				}
				,{
					field: 'constructionYearTwo',
					title: '',
					width: 100,
				}
				,{
					field: 'annualInvestmentTwo',
					title: '',
					width: 100,
				}
				,{
					field: 'constructionYearThree',
					title: '',
					width: 100,
				}
				,{
					field: 'annualInvestmentThree',
					title: '',
					width: 100,
				}
				,{
					field: 'constructionYearFour',
					title: '',
					width: 100,
				}
				,{
					field: 'annualInvestmentFour',
					title: '',
					width: 100,
				}
				,{
					field: 'emphasis',
					title: '',
					width: 100,
				},{
					field: 'approvalNumber',
					width: 100,
				}
				,{
					field: 'dateOfApproval',
					width: 100,
				}
				,{
					field: 'approvedAmount',
					width: 100,
				},{
					field: 'earlyReplyNo',
					width: 100,
				}
				,{
					field: 'approvalDate',
					width: 100,
				}
				,{
					field: 'staticInvestment',
					width: 100,
				},{
					field: 'dynamicInvestment',
					width: 100,
				},{
					field: 'constructionScaleVA',
					width: 150,
				}
				,{
					field: 'constructionScaleKM',
					width: 150,
				}
				,{
					field: 'numberOf',
					width: 150,
				},{
					field: 'conductorType',
					width: 150,
				},{
					field: 'conductorLength',
					width: 150,
				},{
					field: 'theSource',
					width: 150,
				},{
					field: 'modularConstructionScheme',
					width: 150,
				},{
					field: 'descriptionOf',
					width: 150,
				},{
					field: 'milestoneStartDate',
					width: 150,
				},{
					field: 'milestoneCommissioningDate',
					width: 150,
				},{
					field: 'startDate',
					width: 150,
				},{
					field: 'internalControl',
					width: 150,
				},{
					field: 'earliestArrival',
					width: 150,
				},{
					field: 'arrivalPlan',
					width: 150,
				},{
					field: 'preDesignNo',
					width: 100,
				},{
					field: 'initialDesignDate',
					width: 100,
				},{
					field: 'batchOverview',
					width: 100,
				},{
					field: 'batchStatistics',
					width: 100,
				}
				, {
					field: 'estimateCode',
					width: 100,
				}, {
					field: 'designCost',
					width: 100,
				}, {
					field: 'supervisionFeeCode',
					width: 100,
				}, {
					field: 'managementFeeCode',
					width: 100,
				}, {
					field: 'dataCode',
					width: 100,
				},{
					field: 'threeDepartment',
					width: 100,
				},{
					field: 'landNo',
					width: 100,
				},{
					field: 'landDate',
					width: 100,
				},{
					field: 'eiaNo',
					width: 100,
				},{
					field: 'eiaDate',
					width: 100,
				},{
					field: 'acceptanceNo',
					width: 100,
				},{
					field: 'acceptanceDate',
					width: 100,
				},{
					field: 'replyNo',
					width: 100,
				},{
					field: 'replyDate',
					width: 100,
				},{
					field: 'soilNo',
					width: 100,
				},{
					field: 'soilDate',
					width: 100,
				},{
					field: 'depositNo',
					width: 100,
				},{
					field: 'depositDate',
					width: 100,
				},{
					field: 'recordNo',
					width: 100,
				},{
					field: 'recordDate',
					width: 100,
				},{
					field: 'siteProposalNo',
					width: 100,
				},{
					field: 'siteProposalDate',
					width: 100,
				},{
					field: 'planningNo',
					width: 100,
				},{
					field: 'planningDate',
					width: 100,
				},{
					field: 'usePlanNo',
					width: 100,
				},{
					field: 'usePlanDate',
					width: 100,
				},{
					field: 'requisitonNo',
					width: 100,
				},{
					field: 'requisitonDate',
					width: 100,
				},{
					field: 'conLandNo',
					width: 100,
				},{
					field: 'conLandDate',
					width: 100,
				},{
					field: 'transferNo',
					width: 100,
				},{
					field: 'transferDate',
					width: 100,
				},{
					field: 'certificateNo',
					width: 100,
				},{
					field: 'certificateDate',
					width: 100,
				},{
					field: 'permitNo',
					width: 100,
				},{
					field: 'permitDate',
					width: 100,
				},{
					field: 'fireProNo',
					width: 100,
				},{
					field: 'fireProdate',
					width: 100,
				},{
					field: 'fireAccNo',
					width: 100,
				},{
					field: 'fireAccDate',
					width: 100,
				},{
					field: 'estateNo',
					width: 100,
				},{
					field: 'estateDate',
					width: 100,
				},{
					field: 'planningLevel',
					width: 100,
				}
				, {
					field: 'surveyReport',
					width: 100,
				}, {
					field: 'redLineMap',
					width: 100,
				}, {
					field: 'redLineLand',
					width: 100,
				}, {
					field: 'zongMap',
					width: 100,
				}, {
					field: 'recordSurvey',
					width: 100,
				}, {
					field: 'recordDesign',
					width: 100,
				}, {
					field: 'recordContract',
					width: 100,
				}, {
					field: 'supervisionRecord',
					width: 100,
				}, {
					field: 'qulifiedOpinions',
					width: 100,
				}, {
					field: 'constructionComments',
					width: 100,
				}, {
					field: 'constructionDrawing',
					width: 100,
				}, {
					field: 'seismicReview',
					width: 100,
				}, {
					field: 'planningSetting',
					width: 100,
				}, {
					field: 'safetyRecord',
					width: 100,
				}, {
					field: 'qualityRecord',
					width: 100,
				}, {
					field: 'constructionPermit',
					width: 100,
				}, {
					field: 'planBuiltMapping',
					width: 100,
				}, {
					field: 'qualityAcceptance',
					width: 100,
				}, {
					field: 'urbanArchives',
					width: 100,
				}, {
					field: 'completionRecord',
					width: 100,
				}, {
					field: 'realEstate',
					width: 100,
				}, {
					field: 'reportOnLang',
					width: 100,
				},{
					field: 'commDate',
					width: 100,
				}
				, {
					field: 'compDate',
					width: 100,
				}
				, {
					field: 'cossDate',
					width: 100,
				}
				, {
					field: 'conAcceptanceDate',
					width: 100,
				}
				, {
					field: 'soilWaterDate',
					width: 100,
				}
				, {
					field: 'dispatchingNaming',
					width: 100,
				}
				, {
					field: 'resultsSafety',
					width: 100,
				}
				, {
					field: 'cardInformation',
					width: 100,
				},{
					field: 'nameOfSubcontractor',
					width: 100,
				}
				, {
					field: 'projectLocation',
					width: 100,
				}
				, {
					field: 'levelRiskContent',
					width: 100,
				}
				, {
					field: 'levelRiskTime',
					width: 100,
				}
				, {
					field: 'standStartTime',
					width: 100,
				}
				, {
					field: 'standTransferTime',
					width: 100,
				}
				, {
					field: 'standAcceptanceTime',
					width: 100,
				}
				, {
					field: 'dateOfInterview',
					width: 100,
				}
				, {
					field: 'accumulatedAmount',
					width: 100,
				}
				, {
					field: 'mattersLeft',
					width: 100,
				}]
		});
	};

		  
	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端

		 
		  $('#basicTable').bootstrapTable("toggleView");
		}
	  
	  $('#basicTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
                'check-all.bs.table uncheck-all.bs.table', function () {
            $('#remove').prop('disabled', ! $('#basicTable').bootstrapTable('getSelections').length);
            $('#view,#edit').prop('disabled', $('#basicTable').bootstrapTable('getSelections').length!=1);
        });
		  
		$("#btnImport").click(function(){
			jp.open({
			    type: 2,
                area: [500, 200],
                auto: true,
			    title:"导入数据",
			    content: "${ctx}/tag/importExcel" ,
			    btn: ['下载模板','确定', '关闭'],
				btn1: function(index, layero){
					  jp.downloadFile('${ctx}/filing/summary/import/template');
				  },
			    btn2: function(index, layero){
						var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
						iframeWin.contentWindow.importExcel('${ctx}/filing/summary/import', function (data) {
							if(data.success){
								jp.success(data.msg);
								refresh();
							}else{
								jp.error(data.msg);
							}
                            jp.close(index);
                        });//调用保存事件
                    return false;
				  },
				 
				  btn3: function(index){ 
					  jp.close(index);
	    	       }
			}); 
		});
	  $("#export").click(function(){//导出Excel文件
			jp.downloadFile('${ctx}/filing/summary/export');
	  });

	$("#exportFiles").bind("click", function () {
		$("#searchForm").attr("action","${ctx}/filing/filingImages/exportSummary?ids="+ getIdSelections());
		$("#searchForm").submit();
		return true;
	});


	$("#search").click("click", function() {// 绑定查询按扭
		  $('#basicTable').bootstrapTable('refresh');
		});

	  $("#open").click(function () {
		  $("#basicTable").bootstrapTable('expandAllRows');
	  })

		$("#close").click(function (row) {
			$('#basicTable').bootstrapTable('refresh');
		})

	 $("#reset").click("click", function() {// 绑定查询按扭
		  $("#searchForm  input").val("");
		  $("#searchForm  select").val("");
		   $("#searchForm  .select-item").html("");
		  $('#basicTable').bootstrapTable('refresh');
		});
		
				$('#beginInDate').datetimepicker({
					 format: "YYYY-MM-DD HH:mm:ss"
				});
				$('#endInDate').datetimepicker({
					 format: "YYYY-MM-DD HH:mm:ss"
				});
		
	});
		
  function getIdSelections() {
        return $.map($("#basicTable").bootstrapTable('getSelections'), function (row) {
            return row.id
        });
    }
  
  function deleteAll(){

		jp.confirm('确认要删除该基础信息记录吗？', function(){
			jp.loading();  	
			jp.get("${ctx}/filing/summary/deleteAll?ids=" + getIdSelections(), function(data){
         	  		if(data.success){
         	  			$('#basicTable').bootstrapTable('refresh');
         	  			jp.success(data.msg);
         	  		}else{
         	  			jp.error(data.msg);
         	  		}
         	  	})
          	   
		})
  }
  
    //刷新列表
  function refresh() {
      $('#basicTable').bootstrapTable('refresh');
  }
  function add(){
	  jp.openSaveDialog('新增基础信息', "${ctx}/filing/summary/form",'1000px', '800px');
  }
  
   function edit(id){//没有权限时，不显示确定按钮
       if(id == undefined){
	      id = getIdSelections();
	}
	jp.openSaveDialog('编辑基础信息', "${ctx}/filing/summary/form?id=" + id, '800px', '500px');
  }

function editChild(id){//没有权限时，不显示确定按钮
	if(id == undefined){
		id = getIdSelections();
	}
	jp.openSaveDialog('编辑基础信息', "${ctx}/filing/summary/childForm?id=" + id, '800px', '500px');
}

  
 function view(id){//没有权限时，不显示确定按钮
      if(id == undefined){
             id = getIdSelections();
      }
        jp.openViewDialog('查看基础信息', "${ctx}/filing/summary/form?id=" + id, '800px', '500px');
 }

function _table_rowspan(_t_id, _t_colnum) {
	//声明合并数组
	var _t_merge_arr = [];
	//声明起始行、合并行数
	var _t_start_index = 0;
	var _t_merge_number = 0;
	//声明临时比较变量
	var _t_compare_value = '';
	//获取数据行数
	var _t_rows = null;
	if($(_t_id).length == 1){
		_t_rows = $(_t_id + " tr td:nth-child(" + _t_colnum + ")");
	} else if($(_t_id).length > 1){
		_t_rows = $(_t_id).eq($(_t_id).length - 1).find("tr td:nth-child(" + _t_colnum + ")");
	} else {
		return;
	}
	_t_rows.each(function(i) {
		var _t_temp_value = $(this).text();
		if (i==0) {
			//首行不比较
			_t_compare_value = _t_temp_value;
			_t_merge_number ++;
		} else {
			//对比本行数据和上行数据是否一样
			if (_t_compare_value == _t_temp_value) {
				_t_merge_number ++;
				if(_t_merge_number > 1){
					//声明合并行大于1的对象
					var _t_merge_object = {index: _t_start_index,rowspan: _t_merge_number};
					//取出合并数组最后一个对象
					var _t_merge_arr_last_object = _t_merge_arr[_t_merge_arr.length - 1];
					if (_t_merge_arr.length > 0) {
						//根据起始下标看是否是同一合并
						if (_t_merge_arr_last_object.index == _t_merge_object.index) {
							_t_merge_arr[_t_merge_arr.length - 1] = _t_merge_object;
						} else {
							_t_merge_arr.push(_t_merge_object);
						}
					} else {
						_t_merge_arr.push(_t_merge_object);
					}
				}
			} else {
				_t_merge_number = 1;
				_t_start_index = i;
				_t_compare_value = _t_temp_value;
			}
		}
	});
	for (var i = 0; i < _t_merge_arr.length; i++) {
		var item = _t_merge_arr[i];
		var rowsnum = item.rowspan;
		for ( var j = 0; j < rowsnum-1; j++) {
			$(_t_rows[item.index+j+1]).css('display','none');
		}
		$(_t_rows[item.index]).attr("rowSpan", item.rowspan);
	}
}
  
  
  
		   
  function detailFormatter(index, row) {
	  var htmltpl =  $("#testDataMain1ChildrenTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
	  var html = Mustache.render(htmltpl, {
			idx:row.id
		});
	  $.get("${ctx}/filing/summary/detail?id="+row.id, function(testDataMain1){
    	var testDataMain1Child1RowIdx = 0, testDataMain1Child1Tpl = $("#testDataMain1Child1Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
		var data1 =  testDataMain1.basicChildList;
		for (var i=0; i<data1.length; i++){
			/*data1[i].dict = {};
			data1[i].dict.isHave = jp.getDictLabel(${fns:toJson(fns:getDictList('yes_no'))}, data1[i].isHave, "-");*/
			addRow('#testDataMain1Child-'+row.id+'-1-List', testDataMain1Child1RowIdx, testDataMain1Child1Tpl, data1[i]);
			testDataMain1Child1RowIdx = testDataMain1Child1RowIdx + 1;
		}
      })
        return html;
    }
  
	function addRow(list, idx, tpl, row){
		$(list).append(Mustache.render(tpl, {
			idx: idx, delBtn: true, row: row
		}));
	}
			
</script>
<script type="text/template" id="testDataMain1ChildrenTpl">//<!--
	<div class="tabs-container">
		<div class="tab-content">
				 <div id="tab-{{idx}}-1" class="tab-pane fade in active">
					<table class="ani table">
						<thead>
							<tr>
								<th>项目编码</th>
								<th>单体编码</th>
								<th>项目名称</th>
							</tr>
						</thead>
							<tbody id="testDataMain1Child-{{idx}}-1-List">
							</tbody>
					</table>
		</div>
		</div>//-->
	</script>
	<script type="text/template" id="testDataMain1Child1Tpl">//<!--
				<tr>
					<td>
						{{row.projectCode}}
					</td>
					<td>
						{{row.monomerCode}}
					</td>
					<td>
						{{row.entryName}}
					</td>
				</tr>//-->
	</script>

