$(function(){
    // resize时设置操作部分的样式(定位的top值)
    $('body').resize(function(){
        $(".projectManagementBottom").css('top',$(".projectManagementTop").height()+$(".businessNavigation").height()+$('.projectManagementBottom .detailContentBox-title').height()+'px');
    });
    $('body').resize();

    // 拖动中间线
    $(".projectManagementBottom .detailContentBox-title").mousedown(function(){
        var isDrag = true;
        $(document).mousemove(function(e){
            if( isDrag ){
                if( e.clientY>=($(".breadcrumb").height()+$(".yk_head").height()) && $('.detailContentBox').height()-e.clientY+$(".breadcrumb").height()+$(".yk_head").height()>200 ){
                    $(".projectManagementTop").css('height',(e.clientY-$(".businessNavigation").height()-$(".breadcrumb").height()-$(".yk_head").height())+'px');
                    $(".projectManagementBottom").css('top',(e.clientY-$(".breadcrumb").height()-$(".yk_head").height())+'px');
                };
            };
        });
        $(document).unbind('mouseup').bind('mouseup',function(){
            $(document).unbind('mousemove');
            isDrag = false;
        });
        return false;
    });

    // 点击历史信息标题展开对应内容
    $(".projectManagementTop").on('click','.detailContentBox-title',function(){
        if( $(this).hasClass('up') ){
            $(this).removeClass('up');
            $(this).nextAll().each(function(i,ele){
                if( !$(ele).hasClass('hide') ){
                    $(ele).show();
                }
            });
        }else{
            $(this).addClass('up');
            $(this).nextAll().hide();
        }
    });

    // 点击导航展开对应部分的内容
    $('.businessNavigation').on("click","li",function(){
        var scrollTopNo = $('.businessNavigation li').index($(this));
        if( $('.projectManagementTop .detailContentBox-title').eq(scrollTopNo).hasClass('up') ){
            $('.projectManagementTop .detailContentBox-title').eq(scrollTopNo).removeClass('up');
            $('.projectManagementTop .detailContentBox-title').eq(scrollTopNo).nextAll().each(function(i,ele){
                if( !$(ele).hasClass('hide') ){
                    $(ele).show();
                }
            });
        };
        var scrollTopHeight = 0;
        if( scrollTopNo == 0 ){
            scrollTopHeight = 0;
        }else{
            for( var i=0;i<scrollTopNo;i++ ){
                scrollTopHeight += $('.projectManagementTop .nodeShow').eq(i).height();
            };
            i = null;
        };
        $('.projectManagementTop .newTabAddUpdateBox').animate({'scrollTop':scrollTopHeight})
    });

    // 加载查看历史信息dom元素
    $(".projectManagementTop .newTabAddUpdateBox").load('/sign/confirmation/history',function(){
        var businessKey,async = true;
        if( GetRequest() && GetRequest()['historyId'] ){
            businessKey = GetRequest()['historyId'];
            async = false;
            //window.location.href = window.location.href.split('?')[0]
        }else{
            businessKey = $('[name=businessKey]').val();
        };

        // 获取历史信息
        $.ajax({
            url:'/businessProcessingTask/doBusinessHistoryView',
            type:'get',
            data:{
                'businessKey':businessKey,
                'businessType':'SignConfirmation'
            },
            async:async,
            success:function(data){
                if( data.success ){
                    var contractHistoryData = data.data;
                    for( var i=0;i<contractHistoryData.length;i++ ){
                        // 添加导航dom
                        $(".businessNavigation ul").append('<li><div class="businessCircle">'+(i+1)+'</div><div class="businessWord"><span>'+contractHistoryData[i].formBusinessName+'</span></div></li>');

                        // 验收单法务审核
                        if( contractHistoryData[i].formBusinessName == '验收单法务审核' ) {
                            //标题log
                            var logText = '';
                            if(contractHistoryData[i].businessProcessingLogVo) {
                                if (contractHistoryData[i].businessProcessingLogVo.assigneeTypeName) {
                                    logText += '<span style="color: #333;font-size: 0.13rem;font-weight: normal">' + contractHistoryData[i].businessProcessingLogVo.assigneeTypeName + '：' + contractHistoryData[i].businessProcessingLogVo.assigneeName + ' </span>';
                                }

                                if (contractHistoryData[i].businessProcessingLogVo.status) {
                                    logText += '<span style="color: #333;font-size: 0.13rem;font-weight: normal">状态：' + contractHistoryData[i].businessProcessingLogVo.status + ' </span>';
                                }

                                if (contractHistoryData[i].businessProcessingLogVo.startTime) {
                                    logText += '<span style="color: #333;font-size: 0.13rem;font-weight: normal">开始时间：' + contractHistoryData[i].businessProcessingLogVo.startTime + ' </span>';
                                }

                                if (contractHistoryData[i].businessProcessingLogVo.endTime) {
                                    logText += '<span style="color: #333;font-size: 0.13rem;font-weight: normal">完成时间：' + contractHistoryData[i].businessProcessingLogVo.endTime + ' </span>';
                                }
                            }

                            var checkMakingViewBox = $(".historyHideArea .checkContractApprovalViewBox").clone();
                            checkMakingViewBox.find('.checkContractApprovalViewBox-log').append(logText)

                            //销售合同文件
                            if(contractHistoryData[i].obj.salesContract) {
                                let fileStorages = ''
                                contractHistoryData[i].obj.salesContract.forEach(item => {
                                    fileStorages += `<div class="fileStorage" style="display:none">
                                        <input type="text" class="originalId"   value="${item.id}">
                                        <input type="text" class="originalUrl"  value="${item.path}">
                                        <input type="text" class="originalType" value="${item.fileType}">
                                        <input type="text" class="originalName" value="${item.originalName}">
                                        <input type="text" class="originalSize" value="${item.size}">
                                    </div>`
                                })
                                showOriginalFile(fileStorages, checkMakingViewBox.find('.saleFile .fileListBox'), 'onlyView')
                            }

                            //采购合同文件
                            if(contractHistoryData[i].obj.purchContract) {
                                let fileStorages = ''
                                contractHistoryData[i].obj.purchContract.forEach(item => {
                                    fileStorages += `<div class="fileStorage" style="display:none">
                                        <input type="text" class="originalId"   value="${item.id}">
                                        <input type="text" class="originalUrl"  value="${item.path}">
                                        <input type="text" class="originalType" value="${item.fileType}">
                                        <input type="text" class="originalName" value="${item.originalName}">
                                        <input type="text" class="originalSize" value="${item.size}">
                                    </div>`
                                })
                                showOriginalFile(fileStorages, checkMakingViewBox.find('.procureFile .fileListBox'), 'onlyView')
                            }

                            //验收单文件
                            if(contractHistoryData[i].obj.acceptanceUpstreamFile) {
                                let fileStorages = ''
                                contractHistoryData[i].obj.acceptanceUpstreamFile.forEach(item => {
                                    fileStorages += `<div class="fileStorage" style="display:none">
                                        <input type="text" class="originalId"   value="${item.id}">
                                        <input type="text" class="originalUrl"  value="${item.path}">
                                        <input type="text" class="originalType" value="${item.fileType}">
                                        <input type="text" class="originalName" value="${item.originalName}">
                                        <input type="text" class="originalSize" value="${item.size}">
                                    </div>`
                                })
                                showOriginalFile(fileStorages, checkMakingViewBox.find('.checkFile .fileListBox'), 'onlyView')
                            }

                            //审批结论
							checkMakingViewBox.find(".checkContractApprovalView-approvalConclusion").text(contractHistoryData[i].obj.result);
							//审批意见
							if( contractHistoryData[i].obj.approvalComment ){
								checkMakingViewBox.find(".checkContractApprovalView-approvalOpinion").text(contractHistoryData[i].obj.approvalComment);
							}

                            //签署确认
                            if(contractHistoryData[i].obj.result == '通过') {
                                checkMakingViewBox.find(".signConfirmation").show()
                                checkMakingViewBox.find(".terminationContractApprovalView-signConfirmation").text(contractHistoryData[i].obj.signConfirm == 1 ? '是' : '否');
                            }
                            if(contractHistoryData[i].obj.signConfirm == 1) {
                                checkMakingViewBox.find(".signingInformation").show()
                                //签署文件
                                let fileStorages = ''
                                contractHistoryData[i].obj.file.forEach(item => {
                                    fileStorages += `<div class="fileStorage" style="display:none">
                                        <input type="text" class="originalId"   value="${item.id}">
                                        <input type="text" class="originalUrl"  value="${item.path}">
                                        <input type="text" class="originalType" value="${item.fileType}">
                                        <input type="text" class="originalName" value="${item.originalName}">
                                        <input type="text" class="originalSize" value="${item.size}">
                                    </div>`
                                })
                                showOriginalFile(fileStorages, checkMakingViewBox.find('.originalFileList').find('.fileListBox'), 'onlyView')
                                //签署人信息
                                var signPersonalConditionList = [contractHistoryData[i].obj.acceptancePersonInfoHistoryRef];
                                if( signPersonalConditionList ){
                                    var str='';
                                    for(var ii=0;ii<signPersonalConditionList.length;ii++ ){
                                        str += 
                                            '<tr>'+
                                                '<td width="20%" class="enter">'+signPersonalConditionList[ii].type+'</td>'+
                                                '<td width="20%" class="enter">'+signPersonalConditionList[ii].name+'</td>'+
                                                '<td width="20%" class="enter">'+signPersonalConditionList[ii].cardType+'</td>'+
                                                '<td width="20%" class="enter">'+signPersonalConditionList[ii].socialCreditCode+'</td>'+
                                                '<td width="20%" class="enter">'+signPersonalConditionList[ii].mobile+'</td>'+
                                            '</tr>';
                                        
                                    }
                                    checkMakingViewBox.find(".signTable").find(".signerContent").append(str);
                                }
                            }

                            //已签署文件
                            let acceptanceSignedFile = [contractHistoryData[i].obj.acceptanceSignedFile]
                            if(acceptanceSignedFile) {
                                let fileStorages = ''
                                acceptanceSignedFile.forEach(item => {
                                    fileStorages += `<div class="fileStorage" style="display:none">
                                        <input type="text" class="originalId"   value="${item.id}">
                                        <input type="text" class="originalUrl"  value="${item.path}">
                                        <input type="text" class="originalType" value="${item.fileType}">
                                        <input type="text" class="originalName" value="${item.originalName}">
                                        <input type="text" class="originalSize" value="${item.size}">
                                    </div>`
                                })
                                showOriginalFile(fileStorages, checkMakingViewBox.find('.signedFile .fileListBox'), 'onlyView')
                            }
                            $(".showarea").append(checkMakingViewBox.show());
                        }

                        // 销售合同补充合同变更合同审核
                        if( contractHistoryData[i].formBusinessName == '销售合同变更合同审核' || contractHistoryData[i].formBusinessName == '销售合同审核') {
                            //标题log
                            var logText = '';
                            if(contractHistoryData[i].businessProcessingLogVo) {
                                if (contractHistoryData[i].businessProcessingLogVo.assigneeTypeName) {
                                    logText += '<span style="color: #333;font-size: 0.13rem;font-weight: normal">' + contractHistoryData[i].businessProcessingLogVo.assigneeTypeName + '：' + contractHistoryData[i].businessProcessingLogVo.assigneeName + ' </span>';
                                }

                                if (contractHistoryData[i].businessProcessingLogVo.status) {
                                    logText += '<span style="color: #333;font-size: 0.13rem;font-weight: normal">状态：' + contractHistoryData[i].businessProcessingLogVo.status + ' </span>';
                                }

                                if (contractHistoryData[i].businessProcessingLogVo.startTime) {
                                    logText += '<span style="color: #333;font-size: 0.13rem;font-weight: normal">开始时间：' + contractHistoryData[i].businessProcessingLogVo.startTime + ' </span>';
                                }

                                if (contractHistoryData[i].businessProcessingLogVo.endTime) {
                                    logText += '<span style="color: #333;font-size: 0.13rem;font-weight: normal">完成时间：' + contractHistoryData[i].businessProcessingLogVo.endTime + ' </span>';
                                }
                            }

                            var saleMakingViewBox = $(".historyHideArea .saleContractApprovalViewBox").clone();
                            saleMakingViewBox.find('.saleContractApprovalViewBox-log').append(logText)

                            if(contractHistoryData[i].formBusinessName == '销售合同审核') {
                                saleMakingViewBox.find(".detailContentBox-title-small").text('销售合同审核')
                            }else if(contractHistoryData[i].formBusinessName == '销售合同变更合同审核'){
                                saleMakingViewBox.find(".detailContentBox-title-small").text('销售合同变更合同审核')
                            }

                            if(contractHistoryData[i].formBusinessName == '销售合同变更合同审核') {
                                //审批结论
                                saleMakingViewBox.find(".saleContractApprovalView-approvalConclusion").text(contractHistoryData[i].obj.approvalConclusion);
                                //审批意见
                                if( contractHistoryData[i].obj.approvalComment ){
                                    saleMakingViewBox.find(".saleContractApprovalView-approvalOpinion").text(contractHistoryData[i].obj.approvalComment);
                                }
                                //签署确认
                                if(contractHistoryData[i].obj.approvalConclusion == '通过') {
                                    saleMakingViewBox.find(".signConfirmationHistory").show()
                                    saleMakingViewBox.find(".saleContractApprovalView-signConfirmation").text(contractHistoryData[i].obj.signConfirm == 1 ? '是' : '否');
                                }
                                if(contractHistoryData[i].obj.signConfirm == 1) {
                                    saleMakingViewBox.find(".signingInformationHistory").show()
                                    //签署文件
                                    let fileStorages = ''
                                    contractHistoryData[i].obj.files.forEach(item => {
                                        fileStorages += `<div class="fileStorage" style="display:none">
                                            <input type="text" class="originalId"   value="${item.id}">
                                            <input type="text" class="originalUrl"  value="${item.path}">
                                            <input type="text" class="originalType" value="${item.fileType}">
                                            <input type="text" class="originalName" value="${item.originalName}">
                                            <input type="text" class="originalSize" value="${item.size}">
                                        </div>`
                                    })
                                    showOriginalFile(fileStorages, saleMakingViewBox.find('.originalFileListHistory').find('.fileListBox'), 'onlyView')
                                    //签署人信息
                                    var signPersonalConditionList = [contractHistoryData[i].obj.salesContractSupplementApprovalPersonInfoHistoryRef];
                                    if( signPersonalConditionList ){
                                        var str='';
                                        for(var ii=0;ii<signPersonalConditionList.length;ii++ ){
                                            str += 
                                                '<tr>'+
                                                    '<td width="20%" class="enter">'+signPersonalConditionList[ii].type+'</td>'+
                                                    '<td width="20%" class="enter">'+signPersonalConditionList[ii].name+'</td>'+
                                                    // '<td width="20%" class="enter">'+signPersonalConditionList[ii].cardType+'</td>'+
                                                    // '<td width="20%" class="enter">'+signPersonalConditionList[ii].socialCreditCode+'</td>'+
                                                    '<td width="20%" class="enter">'+signPersonalConditionList[ii].mobile+'</td>'+
                                                '</tr>';
                                            
                                        }
                                        saleMakingViewBox.find(".signTable").find(".signerContent").append(str);
                                    }

                                }
                            }else {
                                //审批结论
                                saleMakingViewBox.find(".saleContractApprovalView-approvalConclusion").text(contractHistoryData[i].obj.salesContractApproval.approvalConclusion);
                                //审批意见
                                if( contractHistoryData[i].obj.salesContractApproval.approvalComment ){
                                    saleMakingViewBox.find(".saleContractApprovalView-approvalOpinion").text(contractHistoryData[i].obj.salesContractApproval.approvalComment);
                                }
                                //签署确认
                                if(contractHistoryData[i].obj.salesContractApproval.approvalConclusion == '通过') {
                                    saleMakingViewBox.find(".signConfirmationHistory").show()
                                    saleMakingViewBox.find(".saleContractApprovalView-signConfirmation").text(contractHistoryData[i].obj.salesContractApproval.signConfirm == 1 ? '是' : '否');
                                }
                                if(contractHistoryData[i].obj.salesContractApproval.signConfirm == 1) {
                                    saleMakingViewBox.find(".signingInformationHistory").show()
                                    //签署文件
                                    let fileStorages = ''
                                    contractHistoryData[i].obj.fileList.forEach(item => {
                                        fileStorages += `<div class="fileStorage" style="display:none">
                                            <input type="text" class="originalId"   value="${item.id}">
                                            <input type="text" class="originalUrl"  value="${item.path}">
                                            <input type="text" class="originalType" value="${item.fileType}">
                                            <input type="text" class="originalName" value="${item.originalName}">
                                            <input type="text" class="originalSize" value="${item.size}">
                                        </div>`
                                    })
                                    showOriginalFile(fileStorages, saleMakingViewBox.find('.originalFileListHistory').find('.fileListBox'), 'onlyView')
                                    //签署人信息
                                    var signPersonalConditionList = [contractHistoryData[i].obj.salesContractApprovalPersonInfoHistoryRef];
                                    if( signPersonalConditionList ){
                                        var str='';
                                        for(var ii=0;ii<signPersonalConditionList.length;ii++ ){
                                            str += 
                                                '<tr>'+
                                                    '<td width="20%" class="enter">'+signPersonalConditionList[ii].type+'</td>'+
                                                    '<td width="20%" class="enter">'+signPersonalConditionList[ii].name+'</td>'+
                                                    // '<td width="20%" class="enter">'+signPersonalConditionList[ii].cardType+'</td>'+
                                                    // '<td width="20%" class="enter">'+signPersonalConditionList[ii].socialCreditCode+'</td>'+
                                                    '<td width="20%" class="enter">'+signPersonalConditionList[ii].mobile+'</td>'+
                                                '</tr>';
                                            
                                        }
                                        saleMakingViewBox.find(".signTable").find(".signerContent").append(str);
                                    }

                                }
                            }
                            $(".showarea").append(saleMakingViewBox.show());
                        }

                        //签署确认
                        if( contractHistoryData[i].formBusinessName == '签署确认' ){
                            //标题log
                            var logText = '';
                            if(contractHistoryData[i].businessProcessingLogVo) {
                                if (contractHistoryData[i].businessProcessingLogVo.assigneeTypeName) {
                                    logText += '<span style="color: #333;font-size: 0.13rem;font-weight: normal">' + contractHistoryData[i].businessProcessingLogVo.assigneeTypeName + '：' + contractHistoryData[i].businessProcessingLogVo.assigneeName + ' </span>';
                                }

                                if (contractHistoryData[i].businessProcessingLogVo.status) {
                                    logText += '<span style="color: #333;font-size: 0.13rem;font-weight: normal">状态：' + contractHistoryData[i].businessProcessingLogVo.status + ' </span>';
                                }

                                if (contractHistoryData[i].businessProcessingLogVo.startTime) {
                                    logText += '<span style="color: #333;font-size: 0.13rem;font-weight: normal">开始时间：' + contractHistoryData[i].businessProcessingLogVo.startTime + ' </span>';
                                }

                                if (contractHistoryData[i].businessProcessingLogVo.endTime) {
                                    logText += '<span style="color: #333;font-size: 0.13rem;font-weight: normal">完成时间：' + contractHistoryData[i].businessProcessingLogVo.endTime + ' </span>';
                                }
                            }

                            var contractMakingViewBox = $(".historyHideArea .signConfirmationViewBox").clone();
                            contractMakingViewBox.find('.signConfirmationViewBox-log').append(logText)

                            // 电子合同信息
                            let electronicInfoList =  contractHistoryData[i].obj.electronicSignaturePersonal
                            let str = ''
                                str += `                                     
                                <tr>
                                    <td width="20%"  rowspan="${contractHistoryData[i].obj.signConfirmationElectronicInfos.length + 2 }"> 
                                        <div class="signConfirmationView-certificationLink">${electronicInfoList.name}</div>
                                    </td>
                                    <td width="10%" class="enter">
                                        <span>认证链接</span>:   
                                    </td>
                                    <td width="45%" class="enter">
                                        <textarea style="width: 75%;" readonly class="signConfirmationView-copyUrl">${electronicInfoList.shortAuthUrl}</textarea>
                                    </td>
                                    <td  width="25%" class="enter">
                                        <span style="float: left; line-height: 0.51rem;">认证状态:</span>
                                        <input style="width: 25%; float: left; margin-top: 0.08rem;" class="form-control signConfirmationView-certificationStatus" readonly value=${electronicInfoList.authStatus == 1 ? '已认证' : '未认证'}>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="10%" class="enter">
                                        <span>签署链接</span>:
                                    </td>
                                    <td width="70%" class="enter" colspan="3">
                                        <textarea readonly style="width:50%;" class=" signConfirmationView-copyUrl">${contractHistoryData[i].obj.shortContractLink}</textarea>
                                    </td>
                                </tr>`
                                contractHistoryData[i].obj.signConfirmationElectronicInfos.forEach(row => {
                                    str += ` 
                                        <tr>
                                            <td width="10%" class="enter">
                                                <div class="signConfirmationView-certificationLink" > ${row.contractName}</div>
                                            </td>
                                            <td  width="70%" class="enter" colspan="3">
                                                <span style="float: left; line-height: 0.51rem;">签署状态:</span>
                                                <input style="width: 70%; float: left; margin-top: 0.08rem;" class="form-control signConfirmationView-signStatus" readonly value=${row.signStatus == 1 ? '已签署' : '未签署'}>
                                            </td>
                                        </tr>
                                    `
                                })
                            contractMakingViewBox.find('.signConfirmationView-signConfirmInfoBox').append(str)
                            //签署结论
							contractMakingViewBox.find(".signConfirmationView-conclusion").text(contractHistoryData[i].obj.signConclusion == 1 ? '完成' : '');
							//说明
							if( contractHistoryData[i].obj.remark ){
								contractMakingViewBox.find(".signConfirmationView-remark").text(contractHistoryData[i].obj.remark);
							}
                            $(".showarea").append(contractMakingViewBox.show());
                        };

                        if( contractHistoryData[i].formBusinessName == '法务审批' ){
                            // 添加导航dom
                            // $(".businessNavigation ul").append('<li><div class="businessCircle">'+(i+1)+'</div><div class="businessWord"><span>'+contractHistoryData[i].formBusinessName+'</span></div></li>');
                            //标题log
                            var logText = '';
                            if(contractHistoryData[i].businessProcessingLogVo) {
                                if (contractHistoryData[i].businessProcessingLogVo.assigneeTypeName) {
                                    logText += '<span style="color: #333;font-size: 0.13rem;font-weight: normal">' + contractHistoryData[i].businessProcessingLogVo.assigneeTypeName + '：' + contractHistoryData[i].businessProcessingLogVo.assigneeName + ' </span>';
                                }

                                if (contractHistoryData[i].businessProcessingLogVo.status) {
                                    logText += '<span style="color: #333;font-size: 0.13rem;font-weight: normal">状态：' + contractHistoryData[i].businessProcessingLogVo.status + ' </span>';
                                }

                                if (contractHistoryData[i].businessProcessingLogVo.startTime) {
                                    logText += '<span style="color: #333;font-size: 0.13rem;font-weight: normal">开始时间：' + contractHistoryData[i].businessProcessingLogVo.startTime + ' </span>';
                                }

                                if (contractHistoryData[i].businessProcessingLogVo.endTime) {
                                    logText += '<span style="color: #333;font-size: 0.13rem;font-weight: normal">完成时间：' + contractHistoryData[i].businessProcessingLogVo.endTime + ' </span>';
                                }
                            }
                            var legalPersonalViewBox = $(".historyHideArea .legalPersonalViewBox").clone();
                            legalPersonalViewBox.find('.legalPersonalViewBox-log').append(logText)

                            //已签文件
                            let fileStorages = ''
                            if(contractHistoryData[i].obj.fileStorages) {
                                contractHistoryData[i].obj.fileStorages.forEach(item => {
                                    fileStorages += `<div class="fileStorage" style="display:none">
                                        <input type="text" class="originalId"   value="${item.id}">
                                        <input type="text" class="originalUrl"  value="${item.path}">
                                        <input type="text" class="originalType" value="${item.fileType}">
                                        <input type="text" class="originalName" value="${item.originalName}">
                                        <input type="text" class="originalSize" value="${item.size}">
                                    </div>`
                                })
                                showOriginalFile(fileStorages, legalPersonalViewBox.find('.fileListBox'), 'onlyView')
                            }
                            //审批结论
							legalPersonalViewBox.find(".legalPersonalView-approvalConclusion").text(contractHistoryData[i].obj.approvalConclusion == 'pass' ? '完成' : '');
							//审批意见
							if( contractHistoryData[i].obj.approvalComments ){
								legalPersonalViewBox.find(".legalPersonalView-approvalOpinion").text(contractHistoryData[i].obj.approvalComments);
							}
                            $(".showarea").append(legalPersonalViewBox.show());

                        }


                    };
                }else{
                    if( data.msg != '返回结果为空' ){
                        new $.zui.Messager('获取历史信息失败:'+data.msg, {
                            type: 'danger'
                        }).show();
                    };
                };

                // 导航排序
                $('.businessNavigation .businessCircle').each(function(i,ele){
                    $(ele).text(i+1)
                })

                // 历史信息排序
                $(".projectManagementTop .detailContentBox-title").each(function(i,ele){
                    $(ele).text( (i+1)+'、'+$(ele).text() );
                    $(ele).addClass('up');
                    $(ele).nextAll().hide();
                });

                if( $('.projectManagementTop .showarea .nodeShow').length<=0 ){
                    $('.projectManagementBottom').css('top','0')
                };

                // 新窗口查看时需要计算高度
                $(".projectManagementTop.historyTop").css('height',$("body").height()-$(".breadcrumb").height()-$(".businessNavigation").height()-15 )
                $(window).bind('resize',function(){
                    $(".projectManagementTop.historyTop").css('height',$("body").height()-$(".breadcrumb").height()-$(".businessNavigation").height()-15 )
                })
            },
            error:function(status){
                new $.zui.Messager('获取历史信息时发生错误:'+status, {
                    type: 'danger'
                }).show();
            }
        });

    });


})