涂煌豪
2022-04-24 e38a0e2aa1542aa51a3eaaca977542ad39eac482
force-app/main/default/pages/SelectAssetEstimateVM.page
@@ -57,7 +57,17 @@
            return false;  
        }
    }
        return true;
    // 先款后修-提交报价时如果是先款对象进行提示 thh 20220408 start
    var FirstParagraphEnd = j$(escapeVfId('allPage:allForm:allBlock:contract:FirstParagraphEnd'))[0].checked;
    if(FirstParagraphEnd){
        if (confirm('本次签约经销商是先款对象,请确认是否提交报价?')) {
         return true;
        }else{
            return false;
        }
    }
    // 先款后修-提交报价时如果是先款对象进行提示 thh 20220408 end
    return true;
}
//add by gwy 2021-01-27 end 提交时的提示框
@@ -331,7 +341,7 @@
}
function refreshAsset(cnt) {
    //alert('1111111111');
    // alert(cnt);
    // 提交后就页面不计算了
    var isDisabled = {!PageDisabled};
    // 合同总理
@@ -345,6 +355,10 @@
    // 新品合同 判断
    var newCon = true;
    var contractStartDate = new Date(j$(escapeVfId('allPage:allForm:contractstartdate')).value());
    //多年保续签合同数量 thh 20220316 start
    var GuranteeCount = 0;
    //多年保续签合同数量 thh 20220316 end
    // 预定开始日
@@ -422,6 +436,10 @@
                    var lastContRange = 0;
                    if(LastMContractRecord == 'VM_Contract'){
                        newCount++;
                        //多年保续签合同数量,多年保续签到服务合同时视为首签设备 thh 20220316 start
                        GuranteeCount++;
                        newCon = false;
                        //多年保续签合同数量,多年保续签到服务合同时视为首签设备 thh 20220316 end
                        lastendDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':endDateGurantee_Text')).value());
                        lastContRange = 36;
                    }else{
@@ -429,7 +447,7 @@
                    }
                    //最后结束日+1年
                    lastendDate.setMonth(lastendDate.getMonth() + 12);
                    if (Date.parse(contractStartDate) > Date.parse(lastendDate)) {
                    if (Date.parse(contractStartDate) > Date.parse(lastendDate) ) {
                        oyearCount ++;
                    }
                    // 取联动价格
@@ -515,7 +533,7 @@
            } else {
                strMoney = month * strMoney + month2 * strMoney;
            }
            var b = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Contract_No')).value();
            var b = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':Contract_No')).value();
            var LastMContractRecord = j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':LastMContractRecord')).value();
            if(b != ''){
                conCCount ++;
@@ -526,6 +544,10 @@
                var lastContRange = 0;
                if(LastMContractRecord == 'VM_Contract'){
                    newCount++;
                    //多年保续签合同数量,多年保续签到服务合同时视为首签设备 thh 20220316 start
                    GuranteeCount++;
                    newCon = false;
                    //多年保续签合同数量,多年保续签到服务合同时视为首签设备 thh 20220316 end
                    lastendDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:assetSection:assetTable:' + i + ':endDateGurantee_Text')).value());
                    lastContRange = 36;
                }else{
@@ -615,18 +637,25 @@
    var result = '';
    if (allcount == 0) {
        result = null;
    }else
    if (newCount > 0 && newCount == allcount && newCon == true) {
    //如果所有设备的上期合同都是多年保合同,则合同种类为市场多年保续签合同 thh 20220315 start
    }else if(GuranteeCount > 0 && GuranteeCount == allcount){
        result = '市场多年保续签合同';
    //如果所有设备的上期合同都是多年保合同,则合同种类为市场多年保续签合同 thh 20220315 end
    }else if (newCount > 0 && newCount == allcount && newCon == true) {
        result = '新品合同';
    }else if (((newCount > 0 && newCount == allcount) ||(newCount + firstCCount == allcount)) && newCon == false) {
        result = '首签合同';
    }else if(firstCCount > 0 && firstCCount == allcount){
        result = '首签合同';
    }else if(oyearCount > 0 && oyearCount == conCCount){
    // 20220328 ljh update  LJPH-C8FB4P【委托】配合PBI设备覆盖率的数据准备 start
    // }else if(oyearCount > 0 && oyearCount == conCCount){
    }else if(oyearCount > 0 && oyearCount == conCCount && allcount == oyearCount ){
    // 20220328 ljh update  LJPH-C8FB4P【委托】配合PBI设备覆盖率的数据准备 start
        result = '非续签合同(空白期一年以上)';
    }else{
        result = '续签合同';
    }
    console.log(result);
    document.getElementById("allPage:allForm:allBlock:contractInfo:Contract_TypeTXT").innerHTML = result;
    document.getElementById("allPage:allForm:allBlock:contractInfo:Contract_TypeTXTHidden").value = result;
    // 取消酸化水