FUYU
2023-12-13 4488f711dbc01a8db6753907cae2ef4021dede68
force-app/main/default/staticresources/NewQuoteIraiJS.js
@@ -94,6 +94,8 @@
function reSet(){
}
function calonLoad(){
    debugger
    calPriceAll.call();
    EstimationListPrice.call();
    // CHAN-BJQ4VZ 精琢技术 2019/12/10 Start 
     EstimationListPrice2.call();
@@ -103,6 +105,7 @@
    quoteTotalPrice.call();
    setOCMAmount.call();
    checkProductStatusValidPeriod();
    // checkQuoteIrai_Status(true);
}
function number_format() {
    for(var i=0; i<QuoteEntryMaxLine; i++){
@@ -130,8 +133,17 @@
    j$(escapeVfId( 'ListPriceTotal')).val(ListPriceTotal);
    j$(escapeVfId( 'UnitPriceTotal')).val(unitPriceTotal);
}
// function ObsapUsersChange(){
//     var ObsapUsersId = j$(escapeVfId('Page:mainForm:block:j_id45:ObsapUsersId')).value();
//     debugger
//     j$(escapeVfId('Page:mainForm:block:IraiUser')).val(ObsapUsersId);
// }
function calPrice(i){
    var x,y,z,c,d,e;
    debugger
    //DB202212304166 【紧急-报价委托与购买意向】请将最后操作的报价委托状态放到购买意向中 fy start
    var x,y,z,c,d,e,CanNotCancelledGurantee,cancelMultiyearInsurance;
    // var x,y,z,c,d,e;
    //DB202212304166 【紧急-报价委托与购买意向】请将最后操作的报价委托状态放到购买意向中 fy end
    x = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':Quantity')).value();
    y = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':UnitPrice')).value();
    c = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':Cost')).value();
@@ -143,6 +155,7 @@
    c = localParseFloat( c);
    d = localParseFloat( d);
    e = localParseFloat( e);
    j$(escapeVfId('Page:mainForm:block:lists:' + i + ':Quantity')).val(x);
    j$(escapeVfId('Page:mainForm:block:lists:' + i + ':UnitPrice')).val(toNumComma(y));
@@ -161,9 +174,19 @@
    j$(escapeVfId('Page:mainForm:block:lists:' + i + ':ListPriceTotalText')).text(toNumComma(z));
    j$(escapeVfId('Page:mainForm:block:lists:' + i + ':ListPriceTotal')).val(toNum(z));
    z = x * e;
    //DB202212304166 【紧急-报价委托与购买意向】请将最后操作的报价委托状态放到购买意向中 fy start
    // z = x * e;
    CanNotCancelledGurantee = j$(escapeVfId("Page:mainForm:block:lists:"+ i +":CanNotCancelledGurantee__c")).value();
    cancelMultiyearInsurance = j$(escapeVfId("Page:mainForm:block:cancelMultiyearInsurance")).value();
    if(CanNotCancelledGurantee =='false' && cancelMultiyearInsurance == '不要'){
        z = 0.00;
    }else{
        z = x * e;
    }
    //DB202212304166 【紧急-报价委托与购买意向】请将最后操作的报价委托状态放到购买意向中 fy end
    j$(escapeVfId('Page:mainForm:block:lists:' + i + ':NoDiscountTotalText')).text(toNumComma(z));
    j$(escapeVfId('Page:mainForm:block:lists:' + i + ':NoDiscountTotal')).val(toNum(z));
    // CHAN-BHNBX6 NoDiscount小计 2019/11/20 END
    EstimationListPrice.call();
    calUnitPriceTotal.call();
@@ -175,7 +198,12 @@
}
function calPriceAll(){
    var x,y,z,c,d,e;
    debugger
    //DB202212304166 【紧急-报价委托与购买意向】请将最后操作的报价委托状态放到购买意向中 fy start
    var x,y,z,c,d,e,CanNotCancelledGurantee,cancelMultiyearInsurance;
    cancelMultiyearInsurance = j$(escapeVfId("Page:mainForm:block:cancelMultiyearInsurance")).value();
    // var x,y,z,c,d,e;
    //DB202212304166 【紧急-报价委托与购买意向】请将最后操作的报价委托状态放到购买意向中 fy end
    for(var i=0; i<QuoteEntryMaxLine; i++){
        x = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':Quantity')).value();
        x = localParseInt( x);
@@ -198,7 +226,16 @@
            j$(escapeVfId('Page:mainForm:block:lists:' + i + ':ListPriceTotalText')).text(toNumComma(z));
            j$(escapeVfId('Page:mainForm:block:lists:' + i + ':ListPriceTotal')).val(toNum(z));
            z = x * e;
            //DB202212304166 【紧急-报价委托与购买意向】请将最后操作的报价委托状态放到购买意向中 fy start
            // z = x * e;
            CanNotCancelledGurantee = j$(escapeVfId("Page:mainForm:block:lists:"+ i +":CanNotCancelledGurantee__c")).value();
            if(CanNotCancelledGurantee =='false' && cancelMultiyearInsurance == '不要'){
                z = 0.00;
            }else{
                z = x * e;
            }
            //DB202212304166 【紧急-报价委托与购买意向】请将最后操作的报价委托状态放到购买意向中 fy end
            j$(escapeVfId('Page:mainForm:block:lists:' + i + ':NoDiscountTotalText')).text(toNumComma(z));
            j$(escapeVfId('Page:mainForm:block:lists:' + i + ':NoDiscountTotal')).val(toNum(z));
            // CHAN-BHNBX6 NoDiscount小计 2019/11/20 END
@@ -1027,6 +1064,7 @@
    }
}
function save2btn() {
    debugger
    checkchangedAfterPrint();
    var changedAfterPrint = j$(escapeVfId('Page:mainForm:changedAfterPrint')).value();
    if (changedAfterPrint == 'true') {
@@ -1037,9 +1075,24 @@
            unblockUI();
        }
    } else {
        var username = j$(escapeVfId("Page:mainForm:block:IraiUser")).val();
        var userid = j$(escapeVfId("Page:mainForm:block:IraiUser_lkid")).val();
        if (userid != null && userid != '000000000000000' && userid.length > 0) {
        // var username = j$(escapeVfId("Page:mainForm:block:IraiUser")).val();
        debugger
        var username1 = j$(escapeVfId("Page:mainForm:block:j_id43:IraiUser")).val();
        var userid = j$(escapeVfId("Page:mainForm:block:j_id43:IraiUser_lkid")).val();
        var username2 = j$(escapeVfId("Page:mainForm:block:j_id46:IraiUser")).val();
        if(username1!=undefined){
            username=username1;
        }else{
            username=username2
        }
        if (userid != null&&userid != '000000000000000' && userid.length > 0) {
            if (confirm(Confirm_saveBtn)) {
                Save.call();
                return true;
            } else {
                unblockUI();
            }
        } else if(username2){
            if (confirm(Confirm_saveBtn)) {
                Save.call();
                return true;
@@ -1424,4 +1477,25 @@
function excelImportGateway(str) {
    blockme();
    excelImport(str);
}
// function checkQuoteIrai_Status(flag) {
//     debugger
//     var QuoteIrai_Statusvalue = j$(escapeVfId('Page:mainForm:block:j_id32')).value();
//     var Statusflg=true;
//     if(flag){
//         if(QuoteIrai_Statusvalue == '草案中'){
//             Statusflg = false;
//         }
//     }
//     if(Statusflg){
//         j$(escapeVfId('Page:mainForm:block:QuoteIraiBtn')).attr('disabled',false);
//         j$(escapeVfId('Page:mainForm:block:j_id85')).attr('disabled',false);
//         j$(escapeVfId('Page:mainForm:block:j_id87')).attr('disabled',false);
//     }
//     return true;
// }
function cancelMultiyearInsurancechange(){
    debugger;
    calPriceAll.call();
}