From 35910c355f74e736e2068a0ffb7f39ae9615d8e1 Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期五, 24 五月 2024 16:29:00 +0800
Subject: [PATCH] 1
---
force-app/main/default/lwc/lexNewQuoteEntry/lexNewQuoteEntry.js | 866 +++++++++++++++++++++------------------------------------
1 files changed, 321 insertions(+), 545 deletions(-)
diff --git a/force-app/main/default/lwc/lexNewQuoteEntry/lexNewQuoteEntry.js b/force-app/main/default/lwc/lexNewQuoteEntry/lexNewQuoteEntry.js
index c1dda24..ddffb69 100644
--- a/force-app/main/default/lwc/lexNewQuoteEntry/lexNewQuoteEntry.js
+++ b/force-app/main/default/lwc/lexNewQuoteEntry/lexNewQuoteEntry.js
@@ -64,7 +64,6 @@
import getModulus from '@salesforce/apex/lexNewQuoteEntryController.getModulus'
import getquoDes from '@salesforce/apex/lexNewQuoteEntryController.getquoDes'
import selectOppLItem from '@salesforce/apex/lexNewQuoteEntryController.selectOppLItem'
-import addOptions from '@salesforce/apex/lexNewQuoteEntryController.addOptions'
import getProduct2 from '@salesforce/apex/NewQuoteEntryWebService.getProduct2';
import updateOTCodeweb from '@salesforce/apex/NewQuoteEntryWebService.updateOTCode';
import getQuoteLineItem from '@salesforce/apex/NewQuoteEntryWebService.getQuoteLineItem';
@@ -86,7 +85,7 @@
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {yingYanCheck,qwe,lineDown,lineUp,localParseInt,toNum,initDataTableToBeproductConfig,saveEvoluationLogic,oppInfosave,quoLineItemsave,filterNameoptionList,initDataSetProductTablefig,quoteTotalPriceActionLogic,CheckForCost,actState,tStringe,Agent1comput,
toNumComma,localParseFloat,NewQcopyLogic,productCompareLogic,bflag,jzProductsearchLogic,additionaljzProductLogic,initDataProductTablefig,checkNMPA,saveQuotel,CheckForListPrice,calGuranteePeriodLogic,EstimationL,checkch,
-additionabuttonLoc,DataStatus,InitializeProductAssignment,PriceStatusUpdateLogic,newQuoteFlagex,calGuranteeAllFieldsLogic,MultiYearWarrantyTotalPriceExport,newQuoteFlagExp,AlertForCFDA,UnitPriceUpdateLogic,nafgExp,flg,errorflgw,
+additionabuttonLoc,DataStatus,InitializeProductAssignment,PriceStatusUpdateLogic,newQuoteFlagex,calGuranteeAllFieldsLogic,MultiYearWarrantyTotalPriceExport,newQuoteFlagExp,AlertForCFDA,UnitPriceUpdateLogic,nafgExp,flg,
PrintCustomerNameoptionsvlue,selection_hpExp,options_hpflgExp,initquoassignment,initquoassignmentcopy,salesProfit1Logic,salesCalculation1Logic,salesProfit2Logic,salesCalculation2Logic,SubtotalupdateLogic,alfExp,resultFlag,
productStatusUpdatedExp,initQuoteLineItemcheck,MarkRed,quoteAgencyTotalPriceActionLogic,calPriceAllLogic,QuoteAdjustLogic,quoExp,AgencyDiscountCalculation1Logic,onsaveToBeproductLoc,fagExp,PrintButtonLoc,alertExp,decisionlol,
saverebackloc,DisCalculationfunctionLoc,quoteTotalPriceLoc,calUnitPriceTotalLoc,ListPriceTotalExp,unitPriceTotalExp,pageArrangeLoc,openQuotePage,errorflg,StrExp,quoteinit,IsQuoteTrialExp,setOCMAmountc,DisAmountfunctionc} from "./lexNexQuoteEntryUtil.js";
@@ -171,7 +170,6 @@
QuoteDecision_Button = QuoteDecision_Button;
@track
Copy_Detail = Copy_Detail;
-
@track
Quote_Print = Quote_Print;
@track
@@ -192,7 +190,6 @@
Print_Button = Print_Button;
@track
QuotCalfag = false;
-
quoteEntryMaxLine = QuoteEntryMaxLine2;
@track
IsLoading = false;
@@ -258,16 +255,16 @@
@track
enableContract;
productStatusUpdated =false;
- //init鏌ヨ璇环鐩稿叧鏍囪瘑 end
+ //init鏌ヨ璇环鐩稿叧鏍囪瘑
//鍚堝悓淇濅慨鏈燂紙骞达級鍏ㄥ眬
quoteGurantee_Period;
//鍙栨秷甯傚満澶氬勾淇濅慨鍏ㄥ眬
quotemultiYearWarranty;
- //缁忛攢鍟嗗垵濮嬪寲鏃跺浠� start
+ //缁忛攢鍟嗗垵濮嬪寲鏃跺浠�
agency1Name;
agency2Name;
Saleslet = false;
- //缁忛攢鍟嗗垵濮嬪寲鏃跺浠� end
+ //缁忛攢鍟嗗垵濮嬪寲鏃跺浠�
//鏁版嵁鏄惁鍙戠敓鍙樺寲鏍囪瘑
newQuoteFlag = false;
//鐘舵�佹洿鏂�
@@ -309,22 +306,17 @@
this.displayFlg = true;
this.WinOrDecideAlert = false;
this.OnLoading(true);
- if(this.quoId == ''){
- this.quoId = getQueryVariable('Id',this.location);
- }
- if(this.copyid == ''){
- this.copyid = getQueryVariable('copyid',this.location);
- }
- if(this.oppId == ''){
- this.oppId = getQueryVariable('oppid',this.location);
- }
+ if(this.quoId==''){
+ this.quoId = getQueryVariable('Id',this.location);}
+ if(this.copyid==''){
+ this.copyid = getQueryVariable('copyid',this.location);}
+ if(this.oppId==''){
+ this.oppId = getQueryVariable('oppid',this.location);}
this.nafg = resultFlag(this.nafg,'');
selectQuoteListLineItemCount({quoId:this.quoId,oppId:this.oppId,copyid:this.copyid}).then(quoteByopp=>{
if(this.oppId){
if(this.copyid){
- this.quoId = this.copyid;
- }
- }
+ this.quoId = this.copyid;}}
if(quoteByopp.length > 0){
if (!this.oppId) {
this.oppId = quoteByopp[0].OpportunityId;
@@ -357,11 +349,7 @@
this.jzDataToBeproduct =[].concat(resItem);
this.productStatusUpdated = true;
this.init();
- }
- });
- }
- }
- });
+ }});}} });
this.trade = '澶栬部';
if(JSON.stringify(oppobj) != "{}"){
this.trade = oppobj.Trade__c;
@@ -372,7 +360,7 @@
this.enableSales = false;
this.oppInfo.Wholesale_Price__c = toNumComma(oppobj.Wholesale_Price__c);
if (this.oppInfo.Sales_Root__c != null) {
- if (oppobj.Sales_Root__c == '璨╁2搴�') {
+ if (oppobj.Sales_Root__c=='璨╁2搴�') {
this.enableSales = true;
this.oppInfo.Sales_Root__c = Sales_Outlet;
this.Saleslet = true;
@@ -382,7 +370,6 @@
}
}
this.accountid = this.oppInfo.AccountId;
- debugger
if (this.QuoteDecision) {
this.enableContract = true;
} else {
@@ -392,16 +379,16 @@
if (!this.oppInfo.SAP_Send_OK__c) {
this.displayFlg = true;
} else {
- if(this.oppInfo.Agency1__r == undefined){
+ if(this.oppInfo.Agency1__r==undefined){
this.oppInfo.Agency1__r = {};
}
- if(this.oppInfo.Agency2__r == undefined){
+ if(this.oppInfo.Agency2__r==undefined){
this.oppInfo.Agency2__r = {};
}
- if(this.oppInfo.Account == undefined){
+ if(this.oppInfo.Account==undefined){
this.oppInfo.Account = {};
}else{
- if(this.oppInfo.Account.Parent == undefined){
+ if(this.oppInfo.Account.Parent==undefined){
this.oppInfo.Account.Parent = {};
}
}
@@ -423,9 +410,9 @@
} else {
this.print_buttonflg = false;
}
- if (this.QuoteDecision == false) {
+ if (this.QuoteDecision==false) {
this.sap_button = true;
- } else if (this.specialAuthority == false) {
+ } else if (this.specialAuthority==false) {
this.sap_button = true;
} else {
this.sap_button = false;
@@ -468,7 +455,7 @@
var quoteLineItem = JSON.parse(tempArr[0]);
this.CheckItem = JSON.parse(tempArr[1]);
if(JSON.stringify(quote) != "{}"){
- if(this.copyid == ''){
+ if(this.copyid==''){
this.quo = initquoassignment(quote,this.quo,it);
this.hidden = this.quo.rtn;
this.QuotCalfag = (r&&this.hidden);
@@ -525,14 +512,13 @@
this.QuotCalfag = (r&&it);
}
});
- });
-
+ });
});
- //Add DTT - Hua Jian 20231018 Start
+ //Add DTT - Hua Jian
const inputAlignright = document.createElement('style');
inputAlignright .innerText = `.input-text-align_right input{ text-align: right!important; }`;
document.body.appendChild(inputAlignright);
- //Add DTT - Hua Jian 20231018 End
+ //Add DTT - Hua Jian
}
pageArrange(){
this.quo = pageArrangeLoc(this.quo);
@@ -552,7 +538,6 @@
this.ifquocom = IsQuoteTrial;
var s = this.quo.OCM_Agent1_Price_Page__c;
var id = this.quoId;
- // if(!id){
if(!s){
var IsQuoteTrial =this.quo.IsQuoteTrial__c;
if(!IsQuoteTrial){
@@ -562,7 +547,6 @@
}
}
this.OnLoading(false);
- // }
}
calPriceAll() {
this.calGuranteeAllFields();
@@ -574,7 +558,6 @@
this.quoteAgencyTotalPriceAction();
this.AgencyDiscountCalculation1();
}
- //
calGuranteeAllFields() {
this.jzDataToBeproduct = calGuranteeAllFieldsLogic(this.jzDataToBeproduct,this.quo);
this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
@@ -584,28 +567,24 @@
EstimationListPrice() {
this.jzDataToBeproduct = EstimationL(this.jzDataToBeproduct,this.quo);
this.quo = quoExp;
- }
-
+ }
ListPriceTotalhidden = 0;
UnitPriceTotalhidden = 0;
calUnitPriceTotal() {
this.jzDataToBeproduct = calUnitPriceTotalLoc(this.jzDataToBeproduct);
this.ListPriceTotalhidden = ListPriceTotalExp;
this.UnitPriceTotalhidden = unitPriceTotalExp;
- }
-
+ }
quoteTotalPrice() {
var result = quoteTotalPriceLoc(this.jzDataToBeproduct,this.quo,this.quoId,this.oppInfo,this.Saleslet);
this.quo = quoExp;
this.jzDataToBeproduct =[].concat(result);
var id = this.quoId;
- // if(!id){
var IsQuoteTrial =this.quo.IsQuoteTrial__c;
if(!IsQuoteTrial){
this.setOCMAmount();
this.calFromContactPrice();
}
- // }
this.DisAmountfunction();
this.QuoteAdjust();
this.salesProfit2();
@@ -615,9 +594,7 @@
this.oppInfo = setOCMAmountc(this.enableSales,this.quo,this.oppInfo);
this.quo = quoExp;
}
- /*
- 鍖婚櫌鐨勫悎鍚岄噾棰� 鏍煎紡鍖栦负 甯﹀垎浣嶇鐨勫瓧娈�;
- */
+ //鍖婚櫌鐨勫悎鍚岄噾棰� 鏍煎紡鍖栦负 甯﹀垎浣嶇鐨勫瓧娈�;
calFromContactPrice() {
var x = 0;
x = this.quo.Dealer_Final_Price_Page__c;
@@ -628,7 +605,6 @@
this.salesProfit2();
this.setCostTatal();
}
-
DisAmountfunction() {
this.quo = DisAmountfunctionc(this.quo);
this.DisCalculationfunction();
@@ -650,8 +626,7 @@
this.quo = quoExp;
this.salesCalculation2();
this.salesProfit1();
- }
-
+ }
salesCalculation2() {
this.SalesCalculation2value = salesCalculation2Logic(this.quo,this.Salesprofit2value,this.SalesCalculation2value)
this.quo = quoExp;
@@ -675,8 +650,7 @@
this.jzDataToBeproduct = QuoteAdjustLogic(this.jzDataToBeproduct,this.quo,this.hidden_MultiYearWarrantyTotalPrice,this.QuoteDecision_Button);
this.quo = quoExp;
this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
- }
-
+ }
quoteAgencyTotalPriceAction() {
this.jzDataToBeproduct = quoteAgencyTotalPriceActionLogic(this.jzDataToBeproduct,this.quo,this.oppInfo,this.QuoteDecision_Button,this.hidden_MultiYearWarrantyTotalPrice);
this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
@@ -719,7 +693,7 @@
var reslut = productCompareLogic(this.jzDataToBeproduct,id2Product,t,b);
b = bflag;
this.jzDataToBeproduct =[].concat(reslut);
- if (b == false) {
+ if (b==false) {
if (window.confirm(Message_001)) {
this.PriceStatusUpdate();
this.OnLoading(false);
@@ -739,7 +713,6 @@
} catch (e) {
this.Alert(e,'error');
}
-
}
//鏇挎崲浜у搧otcode
updateOtcode() {
@@ -777,13 +750,12 @@
setOppFromOppInfo() {
this.oppInfo.Agency1__c = this.quo.Agency1__c;
this.oppInfo.Agency2__c = this.quo.Agency2__c;
- }
-
+ }
quoteAgencyTotalPriceAction1(str) {
var Sales_Root = this.oppInfo.Sales_Root__c;
Sales_Root = Sales_Root + '';
Sales_Root = Sales_Root.replace(/\s+/g, "");
- if (str == Sales_Root) {
+ if (str==Sales_Root) {
this.quoteAgencyTotalPriceAction();
}
}
@@ -826,11 +798,10 @@
Agent1Agent2PricePageChange(event){
this.quo.Agent1_Agent2_Price_Page__c = event.target.value;
this.salesProfit2();
- }
-
+ }
copyToClipboardNewQuoteEntry() {
var QuoteId = this.quoId;
- if (QuoteId == null || QuoteId == '') {
+ if (QuoteId==null || QuoteId=='') {
this.Alert(Message_Please_Save_Quote,'error');
return null;
}
@@ -866,7 +837,7 @@
sal(){
this.tobeflag=false;
var shut = AlertForCFDA(this.jzDataToBeproduct);
- if (shut == true) {
+ if (shut==true) {
this.Alert('鎻愮ず锛氬寘鍚噸鏂扮敵璇稢FDA鐨勪骇鍝侊紝涓嶅彲杩涜璁㈣揣銆�','error');
}
var cost = CheckForCost(this.jzDataToBeproduct);
@@ -882,7 +853,6 @@
}
var SaveQuotecan = saveQuotel(this.quo,this.oppInfo,this.jzDataToBeproduct,this.CheckItem,this.WinOrDecideAlert,this.productStatusUpdated,this.enableSales,
this.oppId,this.quoId,this.newQuoteFlag,this.changedAfterPrint,this.quoteGurantee_Period,this.quotemultiYearWarranty,this.selection_hp,this.SkipQuotefilg,this.quoteflg,this.agency1Name);
- debugger
SaveQuote(SaveQuotecan).then(resaut=>{
var Setmap = new Map()
var key = Object.keys(resaut)
@@ -901,9 +871,6 @@
}
this.agency1Name =this.quo.Agency1__c;
if(this.quoteflg){
- if(Setmap.has('warn')){
- this.Alert(Setmap.get('warn'),'warning');
- }
if(Setmap.has('quoId')){
this.quoId = Setmap.get('quoId');
this.quo.IsQuoteTrial__c = false;
@@ -911,7 +878,8 @@
this.quoteGurantee_Period = this.quo.Gurantee_Period__c;
this.quotemultiYearWarranty = this.quo.multiYearWarranty__c;
}
- this.pricePolicyflag = true;
+ this.index = 3;
+ this.quoteTrialInit();
}else{
if(Setmap.has('warn')){
this.Alert(Setmap.get('warn'),'warning');
@@ -930,8 +898,7 @@
this.connectedCallback();
}
}
- }
-
+ }
}
this.nafg = resultFlag(this.nafg,Setmap);
if(er){
@@ -972,10 +939,10 @@
ParamIdStr: this.quoId
}).then(result => {
result.forEach(item => {
- if (item.ismatch__c == "0") {
+ if (item.ismatch__c=="0") {
item = ProductAssignmentSelect(item);
this.OnLoadProduct.push(item);
- } else if (item.ismatch__c == "1") {
+ } else if (item.ismatch__c=="1") {
item = ProductSelected(item);
this.OnLoadSaveProduct.push(item);
}
@@ -1004,10 +971,10 @@
ParamIdStr: this.quoId
}).then(result => {
result.forEach(items => {
- if (items.typess__c == "鎶樻墸鏀跨瓥") {
+ if (items.typess__c=="鎶樻墸鏀跨瓥") {
items = UnselectedScheme(items);
this.OnLoadDiscount.push(items);
- } else if (items.typess__c == "浠锋牸鏀跨瓥") {
+ } else if (items.typess__c=="浠锋牸鏀跨瓥") {
items = SelectedScheme(items)
this.OnLoadFixDiscount.push(items);
}
@@ -1033,7 +1000,7 @@
index = 3;
comparisonUniqueKey() {
this.index--;
- if (this.index == 0) {
+ if (this.index==0) {
comparisonUniqueKeyLogic(this.index,this.flagall,this.jzDataDefaultCopy,this.jzDataDefault,this.jzDataProduct,this.jzDataFixedPrice,this.jzDataDiscount,this.lastQuotation);
this.jzDataDefault = jzDataDefaultExp;
this.jzDataProduct = jzDataProductExp;
@@ -1045,7 +1012,7 @@
Complate = false;
//浠庢暟鎹簱鏇存柊宸蹭繚瀛樼殑鏁版嵁 浜у搧 UpdateBy 2021 06 29
UpdateSaveDataQuoteLineItemSelectByID(flag) {
- if (flag == 0) {
+ if (flag==0) {
var idArr = [];
this.jzDataDefault.forEach(item => {
idArr.push(item.QuiteLineitem__c);
@@ -1060,7 +1027,7 @@
...dp
};
result.forEach(item => {
- if (item.Id == temp.QuiteLineitem__c) {
+ if (item.Id==temp.QuiteLineitem__c) {
var keys = Object.keys(temp);
keys.forEach(k => {
var flag = ChangeProductData(k);
@@ -1076,7 +1043,7 @@
this.jzDataDefault = newArr;
})
}
- if (flag == 1) {
+ if (flag==1) {
var idArrPro = [];
this.jzDataProduct.forEach(item => {
idArrPro.push(item.QuiteLineitem__c);
@@ -1091,7 +1058,7 @@
...dp
};
result.forEach(item => {
- if (item.Id == temp.QuiteLineitem__c) {
+ if (item.Id==temp.QuiteLineitem__c) {
var keys = Object.keys(temp);
keys.forEach(k => {
var flag = ChangeProductData(k);
@@ -1115,11 +1082,11 @@
var newArr = [];
var indexNum = 0;
var jzdpdc = [];
- if (str == "1") {
+ if (str=="1") {
jzdpdc = [].concat(this.jzDataProduct);
- } else if (str == "2") {
+ } else if (str=="2") {
jzdpdc = [].concat(this.jzDataDiscount);
- } else if (str == "3") {
+ } else if (str=="3") {
jzdpdc = [].concat(this.jzDataFixedPrice);
}
jzdpdc.forEach(item => {
@@ -1130,11 +1097,11 @@
temp.DelectId = indexNum;
newArr.push(temp);
})
- if (str == "1") {
+ if (str=="1") {
this.jzDataProduct = [].concat(newArr);
- } else if (str == "2") {
+ } else if (str=="2") {
this.jzDataDiscount = [].concat(newArr);
- } else if (str == "3") {
+ } else if (str=="3") {
this.jzDataFixedPrice = [].concat(newArr);
}
}
@@ -1234,9 +1201,6 @@
this.Alert(alertExp,'error');
this.nafg = nafgExp;
}else{
- if(errorflgw){
- this.Alert(alertExp,'warning');
- }
this.agency1Name =this.quo.Agency1__c;
}
if(flg){
@@ -1369,18 +1333,6 @@
fg = true;
changedAfterPrint = false;
QuotationCalculationFag = false;
- @track SPFlag = false;
-SPcheck(){
-var maps=checkch(this.jzDataToBeproduct);
-var flag=maps.get('flag');
-console.log(this.jzDataToBeproduct);
-if(flag){
- this.SPFlag=flag;
-}else{
- this.decisionbuttonClick();
-}
-
-}
checkchangedAfterPrint(dec) {
this.fg = true;
var id = this.quoId;
@@ -1391,10 +1343,7 @@
}else{
this.fg = false;
}
- // cjw
- var maps = checkch(this.jzDataToBeproduct);
- var activities=maps.get('activities');
- // cjw
+ var activities = checkch(this.jzDataToBeproduct);
getQuoteLineItem({
quoId: id
}).then(results=>{
@@ -1436,48 +1385,37 @@
});
return;
}
-handleCloseChange(){
-this.SPFlag = false;
-}
-handleSPChange(event){
-console.log(event);
-this.jzDataToBeproduct=event.detail;
-this.SPFlag = false;
-this.decisionbuttonClick();
-}
calFromQuoAmont() {
- var x=0,
- y=0;
- x=this.quo.hidden_Estimation_List;
+ var x = 0,
+ y = 0;
+ x = this.quo.hidden_Estimation_List;
x = localParseFloat(x);
- y=this.quo.Quote_Adjust_Amount_Page__c;
+ y = this.quo.Quote_Adjust_Amount_Page__c;
this.quo.Quote_Adjust_Amount_Page__c = toNumComma(y);
- y=localParseFloat(y);
+ y = localParseFloat(y);
var noDiscountPriceTotal = this.hidden_MultiYearWarrantyTotalPrice;
- noDiscountPriceTotal=localParseFloat(noDiscountPriceTotal);
- this.quo.QuoteTotal_Page__c=toNumComma(y + x + noDiscountPriceTotal);
- var z=this.quo.Estimation_List_Price__c;
- var id=this.quoId;
- // if(!id){
- var IsQuoteTrial=this.quo.IsQuoteTrial__c;
+ noDiscountPriceTotal = localParseFloat(noDiscountPriceTotal);
+ this.quo.QuoteTotal_Page__c = toNumComma(y + x + noDiscountPriceTotal);
+ var z = this.quo.Estimation_List_Price__c;
+ var id = this.quoId;
+ var IsQuoteTrial = this.quo.IsQuoteTrial__c;
if(!IsQuoteTrial){
- var mp=this.quo.MultiYearWarrantyTotalPrice__c;
- mp=localParseFloat(mp);
- var num=this.quo.Quote_Adjust_Calculate__c;
- num=localParseFloat(num);
- this.quo.Quote_Adjust_Calculate__c=toNumComma(num);
- num=(100 + num) / 100;
- z=localParseFloat(z);
- var rh=this.oppInfo.rate_hospital;
- var ra=this.oppInfo.rate_agency1;
- this.quo.Dealer_Final_Price_Page__c=toNumComma(z*rh);
- this.quo.OCM_Agent1_Price_Page__c=this.Saleslet ? toNumComma(z*num*ra+mp) : '';
+ var mp =this.quo.MultiYearWarrantyTotalPrice__c;
+ mp = localParseFloat(mp);
+ var num = this.quo.Quote_Adjust_Calculate__c;
+ num = localParseFloat(num);
+ this.quo.Quote_Adjust_Calculate__c = toNumComma(num);
+ num = (100 + num) / 100;
+ z = localParseFloat(z);
+ var rh = this.oppInfo.rate_hospital;
+ var ra = this.oppInfo.rate_agency1;
+ this.quo.Dealer_Final_Price_Page__c = toNumComma(z*rh);
+ this.quo.OCM_Agent1_Price_Page__c = this.Saleslet ? toNumComma(z*num*ra+mp) : '';
this.setOCMAmount();
this.calFromContactPrice();
}
- // }
if (y == 0) {
- this.quo.Quote_Adjust_Calculate__c=0;
+ this.quo.Quote_Adjust_Calculate__c = 0;
this.UnitPriceUpdate();
} else {
this.quoteTotalPriceAction();
@@ -1492,142 +1430,134 @@
this.quoteTotalPrice();
}
Subtotalupdate() {
- this.jzDataToBeproduct=SubtotalupdateLogic(this.jzDataToBeproduct);
+ this.jzDataToBeproduct = SubtotalupdateLogic(this.jzDataToBeproduct);
this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
}
quoteTotalPriceAction() {
- this.jzDataToBeproduct=quoteTotalPriceActionLogic(this.quo,this.jzDataToBeproduct,this.hidden_MultiYearWarrantyTotalPrice,this.QuoteDecision_Button);
+ this.jzDataToBeproduct = quoteTotalPriceActionLogic(this.quo,this.jzDataToBeproduct,this.hidden_MultiYearWarrantyTotalPrice,this.QuoteDecision_Button);
this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
- this.quo=quoExp;
+ this.quo = quoExp;
this.calUnitPriceTotal();
this.QuoteAdjust();
this.DisAmountfunction();
- }
-
+ }
multiYearWarrantyChange(event){
- this.quo.multiYearWarranty__c=event.detail.checked;
+ this.quo.multiYearWarranty__c = event.detail.checked;
this.calPriceAll();
}
//涓绘満涓嶅甫鐩戣鍣ㄥ彴杞hange浜嬩欢
MainEngineWithoutMonitorChange(event){
- this.quo.MainEngineWithoutMonitor__c=event.detail.checked;
+ this.quo.MainEngineWithoutMonitor__c = event.detail.checked;
}
//璺ㄧ瀹hange浜嬩欢
InterdepartmentalChange(event){
- this.quo.Interdepartmental__c=event.detail.checked;
+ this.quo.Interdepartmental__c = event.detail.checked;
this.calPriceAll();
}
//鍗曚环change浜嬩欢
UnitPriceChange(event){
- this.quo.Unit_Price__c=event.detail.checked;
+ this.quo.Unit_Price__c = event.detail.checked;
}
//鎶ヤ环閲戦change浜嬩欢
OfferAmountChange(event){
- this.quo.Offer_Amount__c=event.detail.checked;
+ this.quo.Offer_Amount__c = event.detail.checked;
}
//鎶ヤ环鎬婚change浜嬩欢
TOTALChange(event){
- this.quo.TOTAL__c=event.detail.checked;
+ this.quo.TOTAL__c = event.detail.checked;
}
//浼樻儬鎶樻墸change浜嬩欢
DiscountChange(event){
- this.quo.Discount__c=event.detail.checked;
+ this.quo.Discount__c = event.detail.checked;
}
//浼樻儬浠锋牸change浜嬩欢
PricingChange(event){
- this.quo.Pricing__c=event.detail.checked;
+ this.quo.Pricing__c = event.detail.checked;
}
//浼樻儬鎴愪氦浠穋hange浜嬩欢
PreferentialTradingPriceChange(event){
- this.quo.Preferential_Trading_Price__c=event.detail.checked;
+ this.quo.Preferential_Trading_Price__c = event.detail.checked;
}
//淇濅慨骞撮檺change浜嬩欢
PreferentialGuranteePeriodChange(event){
- this.quo.Preferential_Gurantee_Period__c=event.detail.checked;
+ this.quo.Preferential_Gurantee_Period__c = event.detail.checked;
}
- //鍚堝悓閰嶇疆change浜嬩欢
ContractcChange(event){
- this.quo.Contract__c=event.detail.checked;
- }
-
+ this.quo.Contract__c = event.detail.checked;
+ }
//涓绘満瑁呮満鍦� optionList
- HostInstallationLocationoptionsvalue=[];
+ HostInstallationLocationoptionsvalue = [];
get HostInstallationLocationoptions() {
if(this.HostInstallationLocationoptionsvalue.length<=0){
getPicklistValues({objstr:'Quote',fld:'Installation_location__c',ifempty:true}).then(keyvalue=>{
- this.HostInstallationLocationoptionsvalue=keyvalue;
+ this.HostInstallationLocationoptionsvalue = keyvalue;
});
}else{
return this.HostInstallationLocationoptionsvalue
}
}
-
HostInstallationLocationhandleChange(event) {
- this.quo.Installation_location__c=event.detail.value;
+ this.quo.Installation_location__c = event.detail.value;
}
-
//鍚堝悓淇濅慨鏈燂紙骞达級start
- ContractWarrantyPeriodYearOptionsvalue=[];
+ ContractWarrantyPeriodYearOptionsvalue = [];
get ContractWarrantyPeriodYearOptions() {
if(this.ContractWarrantyPeriodYearOptionsvalue.length<=0){
getPicklistValues({objstr:'Quote',fld:'Gurantee_Period__c',ifempty:false}).then(keyvalue=>{
- this.ContractWarrantyPeriodYearOptionsvalue=keyvalue;
+ this.ContractWarrantyPeriodYearOptionsvalue = keyvalue;
});
}else{
return this.ContractWarrantyPeriodYearOptionsvalue
}
}
-
ContractWarrantyPeriodYearHandleChange(event) {
- this.quo.Gurantee_Period__c=event.detail.value;
+ this.quo.Gurantee_Period__c = event.detail.value;
this.calGuranteePeriod();
}
// 鏇存柊澶氬勾淇濅慨 淇濅慨鏈�
//闅愯棌鍚堝悓淇濅慨鏈燂紙骞达級
HiddenGurantee_Period;
calGuranteePeriod() {
- var AllGurantee_Period=this.quo.Gurantee_Period__c;
- this.HiddenGurantee_Period=AllGurantee_Period;
- this.jzDataToBeproduct=calGuranteePeriodLogic(this.jzDataToBeproduct,AllGurantee_Period);
+ var AllGurantee_Period = this.quo.Gurantee_Period__c;
+ this.HiddenGurantee_Period = AllGurantee_Period;
+ this.jzDataToBeproduct = calGuranteePeriodLogic(this.jzDataToBeproduct,AllGurantee_Period);
this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
}
-
- //鎶ヤ环鍙樺寲 start
- QuotationChangesOptionsvalue=[];
+ //鎶ヤ环鍙樺寲
+ QuotationChangesOptionsvalue = [];
get QuotationChangesOptions() {
if(this.QuotationChangesOptionsvalue.length<=0){
getPicklistValues({objstr:'Quote',fld:'QuotationChange__c',ifempty:true}).then(keyvalue=>{
- this.QuotationChangesOptionsvalue=keyvalue;
+ this.QuotationChangesOptionsvalue = keyvalue;
});
}else{
return this.QuotationChangesOptionsvalue
}
}
-
QuotationChangesHandleChange(event) {
- this.quo.QuotationChange__c=event.detail.value;
+ this.quo.QuotationChange__c = event.detail.value;
}
- // 缁忛攢鍟嗕竴鍚嶇О杈撳叆妗� start
+ // 缁忛攢鍟嗕竴鍚嶇О杈撳叆妗�
onsearchchange1(event){
- this.quo.Agency1__c=event.detail.value;
+ this.quo.Agency1__c = event.detail.value;
}
- // 缁忛攢鍟嗕簩鍚嶇О杈撳叆妗� start
+ // 缁忛攢鍟嗕簩鍚嶇О杈撳叆妗�
onsearchchange2(event){
- this.quo.Agency2__c=event.detail.value;
+ this.quo.Agency2__c = event.detail.value;
}
//鎶ヤ环浜у搧閫変腑鏁版嵁
@track
- selectjzDataTableToBeproduct=[];
+ selectjzDataTableToBeproduct = [];
SelectedToBeproduct(event) {
- let arr=event.detail.rows;
- this.selectjzDataTableToBeproduct=arr;
+ let arr = event.detail.rows;
+ this.selectjzDataTableToBeproduct = arr;
}
//鍒犻櫎鎶ヤ环浜у搧鎸夐挳
deletejzDataToBeproduct(){
var delFlag=false;
- var num=this.jzDataToBeproduct.length;
- for (var j=0; j < this.selectjzDataTableToBeproduct.length; j++) {
- for (var i=0; i < this.jzDataToBeproduct.length; i++) {
+ var num = this.jzDataToBeproduct.length;
+ for (var j = 0; j < this.selectjzDataTableToBeproduct.length; j++) {
+ for (var i = 0; i < this.jzDataToBeproduct.length; i++) {
if (this.selectjzDataTableToBeproduct[j].lineNo == this.jzDataToBeproduct[i].lineNo) {
this.jzDataToBeproduct.splice(i, 1);
i--;
@@ -1635,10 +1565,10 @@
}
}
}
- var ItemL=MarkRed(this.jzDataToBeproduct);
+ var ItemL = MarkRed(this.jzDataToBeproduct);
this.jzDataToBeproduct =[].concat(ItemL);
if(this.jzDataToBeproduct.length!=num){
- this.quo.IsQuoteTrial__c=false;
+ this.quo.IsQuoteTrial__c = false;
}
if(!delFlag){
this.Alert("璇烽�夋嫨鍙互鎿嶄綔鐨勮",'error');
@@ -1648,20 +1578,19 @@
}
getTableDataToBeproduct(event) {
}
- @track jzDataToBeproduct=[];
- @track tableIsLodingToBeproduct=false;
+ @track jzDataToBeproduct = [];
+ @track tableIsLodingToBeproduct = false;
@track
- initDataTableToBeproduct=initDataTableToBeproductConfig;
+ initDataTableToBeproduct = initDataTableToBeproductConfig;
@track
- tobeflag=true
+ tobeflag = true
//鎶ヤ环浜у搧缂栬緫鍒�
onsaveToBeproduct(event){
- this.tobeflag=false
- var data=event.detail.rows;
- console.log('data==>> ' + JSON.stringify(data));
- this.jzDataToBeproduct=onsaveToBeproductLoc(data,this.jzDataToBeproduct);
+ this.tobeflag = false
+ var data = event.detail.rows;
+ this.jzDataToBeproduct = onsaveToBeproductLoc(data,this.jzDataToBeproduct);
if(fagExp){
- this.quo.IsQuoteTrial__c=false;
+ this.quo.IsQuoteTrial__c = false;
this.quoteAgencyTotalPriceAction();
this.AgencyDiscountCalculation1();
}
@@ -1670,35 +1599,35 @@
this.calUnitPriceTotal();
this.quoteTotalPrice();
setTimeout(() => {
- this.tobeflag=true;
+ this.tobeflag = true;
},1);
}
// 璁$畻 No Discount Price鍚堣
updateNoDiscountPricetotal() {
- var noDiscountPriceTotal=0;
+ var noDiscountPriceTotal = 0;
this.jzDataToBeproduct.forEach(jzdtbt=>{
- var noDiscountPrice=jzdtbt.pageObject.ServicePrice__c;
- noDiscountPrice=localParseFloat(noDiscountPrice);
- var Quantity=jzdtbt.Quantity__c;
- Quantity=localParseFloat(Quantity);
- noDiscountPriceTotal=noDiscountPriceTotal + noDiscountPrice * Quantity;
+ var noDiscountPrice = jzdtbt.pageObject.ServicePrice__c;
+ noDiscountPrice = localParseFloat(noDiscountPrice);
+ var Quantity = jzdtbt.Quantity__c;
+ Quantity = localParseFloat(Quantity);
+ noDiscountPriceTotal = noDiscountPriceTotal + noDiscountPrice * Quantity;
if (jzdtbt.NoDiscountTotal__c) {
- jzdtbt.NoDiscountTotal__c=toNumComma(noDiscountPrice * Quantity);
+ jzdtbt.NoDiscountTotal__c = toNumComma(noDiscountPrice * Quantity);
}
});
this.jzDataToBeproduct =[].concat(this.jzDataToBeproduct);
- this.hidden_MultiYearWarrantyTotalPrice=noDiscountPriceTotal;
- this.quo.MultiYearWarrantyTotalPrice__c=toNumComma(noDiscountPriceTotal);
+ this.hidden_MultiYearWarrantyTotalPrice = noDiscountPriceTotal;
+ this.quo.MultiYearWarrantyTotalPrice__c = toNumComma(noDiscountPriceTotal);
}
handleRowAction(event){
- const actionName=event.detail.row;
+ const actionName = event.detail.row;
}
//鎵撳紑浜у搧閰嶅妯℃�佹寮�鍏�
@track
- showSetProductfalg=false;
+ showSetProductfalg = false;
//浜у搧閰嶅鎸夐挳
openSetProduct(event){
- this.showSetProductfalg=true;
+ this.showSetProductfalg = true;
}
//浜у搧閰嶅 optionList
get listViewOptions() {
@@ -1706,58 +1635,58 @@
}
// 浜у搧閰嶅妯℃�佹鍏抽棴
cancelsetProduct(){
- this.showSetProductfalg=false;
- this.jzSetProductData=[];
+ this.showSetProductfalg = false;
+ this.jzSetProductData = [];
}
// 閫傜敤绉戝
filterName;
// 閫傜敤绉戝Change浜嬩欢
filterNameChange(event){
- this.filterName=event.target.value;
+ this.filterName = event.target.value;
}
// 浜у搧閰嶅鍚�
setSearchName;
//浜у搧閰嶅鍚岰hange浜嬩欢
jzSearchNameChange(event){
- this.setSearchName=event.target.value;
+ this.setSearchName = event.target.value;
}
//浜у搧閰嶅缂栫爜
SearchCode;
//浜у搧閰嶅缂栫爜Change浜嬩欢
jzSearchCodeChange(event){
- this.SearchCode=event.target.value;
+ this.SearchCode = event.target.value;
}
- initDataSetProductTable=initDataSetProductTablefig;
+ initDataSetProductTable = initDataSetProductTablefig;
@track
- jzSetProductData=[];
+ jzSetProductData = [];
@track
- tableIsSetProductLoding=false;
+ tableIsSetProductLoding = false;
@track
- IsLoadingjdspt=false;
+ IsLoadingjdspt = false;
//浜у搧閰嶅鎼滅储
jzsetProductsearchbutton(){
- this.IsLoadingjdspt=true;
- let SearchCode=this.SearchCode;
- let filterName=this.filterName;
- let setSearchName=this.setSearchName;
+ this.IsLoadingjdspt = true;
+ let SearchCode = this.SearchCode;
+ let filterName = this.filterName;
+ let setSearchName = this.setSearchName;
serSetContact({SearchName:setSearchName,SearchCode:SearchCode,filterName:filterName}).then(result=>{
- this.jzSetProductData=result;
- this.IsLoadingjdspt=false;
+ this.jzSetProductData = result;
+ this.IsLoadingjdspt = false;
});
}
//浜у搧閰嶅閫変腑鏁版嵁
- SelectedNewsetProduct=[]
+ SelectedNewsetProduct = []
//浜у搧閰嶅閫変腑鏁版嵁
SelectedSetProductFn(event){
- let arr=event.detail.rows;
- this.SelectedNewsetProduct=arr;
+ let arr = event.detail.rows;
+ this.SelectedNewsetProduct = arr;
}
//杩藉姞浜у搧閰嶅鎼滅储
additionaljzsetProductbutton(){
- var dataChunanshen=additionabuttonLoc(this.SelectedNewsetProduct,this.quo,this.oppInfo,this.jzDataToBeproduct)
- var num=this.jzDataToBeproduct.length;
- var isPrepared=DataStatus;
- var Str=StrExp;
+ var dataChunanshen = additionabuttonLoc(this.SelectedNewsetProduct,this.quo,this.oppInfo,this.jzDataToBeproduct)
+ var num = this.jzDataToBeproduct.length;
+ var isPrepared = DataStatus;
+ var Str = StrExp;
if(isPrepared!='Fin'){
confirm(isPrepared);
}else if(!Str){
@@ -1768,7 +1697,6 @@
}else{
this.OnLoading(true);
setProductEntry(dataChunanshen).then(reslut=>{
- debugger
var tempArr=reslut.split("---");
var errormessage=tempArr[0];
var quoteLineItem=JSON.parse(tempArr[1]);
@@ -1787,36 +1715,35 @@
});
this.cancelsetProduct();
}
- this.SelectedNewsetProduct=[];
- }
-
+ this.SelectedNewsetProduct = [];
+ }
getTableSetProductData(event) {
- this.tableIsproductLoding=false;
+ this.tableIsproductLoding = false;
}
@track
- showQuoteExcelImport=false;
+ showQuoteExcelImport = false;
openQuoteExcelImport(event){
- this.showQuoteExcelImport=true;
+ this.showQuoteExcelImport = true;
}
cancelQuoteExcelImport(){
- this.showQuoteExcelImport=false;
- this.exceltextvalue='';
+ this.showQuoteExcelImport = false;
+ this.exceltextvalue = '';
}
SavesSQuoteExcelImport(){
- let Str=this.exceltextvalue;
- var num=this.jzDataToBeproduct.length;
- var quoc=saveEvoluationLogic(this.quo,this.oppInfo,this.jzDataToBeproduct);
- var oppInfoc=oppInfosave;
- var quoLineItemc=quoLineItemsave;
- var quoLineItemCan=JSON.stringify(quoLineItemc);
- var oppInfoCan=JSON.stringify(oppInfoc);
- var quoCan=JSON.stringify(quoc);
+ let Str = this.exceltextvalue;
+ var num = this.jzDataToBeproduct.length;
+ var quoc = saveEvoluationLogic(this.quo,this.oppInfo,this.jzDataToBeproduct);
+ var oppInfoc = oppInfosave;
+ var quoLineItemc = quoLineItemsave;
+ var quoLineItemCan = JSON.stringify(quoLineItemc);
+ var oppInfoCan = JSON.stringify(oppInfoc);
+ var quoCan = JSON.stringify(quoc);
this.OnLoading(true);
excelImport({excel_text:Str,
activitiesCan:quoLineItemCan,
oppInfoc:oppInfoCan,
quoc:quoCan}).then(reslut=>{
- var tempArr=reslut.split("---");
+ var tempArr = reslut.split("---");
var errormessage = tempArr[0];
var quoteLineItem = JSON.parse(tempArr[1]);
quoteLineItem = InitializeProductAssignment(quoteLineItem);
@@ -1867,36 +1794,17 @@
var selectvlue = this.SelectedNewProduct;
var Listvalue = this.jzDataToBeproduct;
this.jzDataToBeproduct = additionaljzProductLogic(selectvlue,Listvalue,this.oppInfo.CurrencyIsoCode,this.quo.IsQuoteTrial__c);
- var idList = [];
- this.jzDataToBeproduct.forEach(item=>{
- idList.push(item.pageObject.PricebookEntry.Product2Id);
- });
- addOptions({idList: idList}).then(result=>{
- this.addOptionsLogic(result);
- if(alertExp){
- this.Alert(alertExp,'error');
- }
- setTimeout(() => {
- this.tobeflag = true;
- },1);
- this.quo.IsQuoteTrial__c = IsQuoteTrialExp;
- this.calPriceAll();
- this.cancelProduct();
- this.SelectedNewProduct = [];
- });
-
- }
- }
- addOptionsLogic(result){
- const options = Object.entries(result).map(([key, value]) => ({
- label: key,
- value: value
- }));
- this.jzDataToBeproduct.forEach(item=>{
- if(result){
- item.Learning_CommunityOptions = options.get(item.pageObject.PricebookEntry.Product2Id);
+ if(alertExp){
+ this.Alert(alertExp,'error');
}
- });
+ setTimeout(() => {
+ this.tobeflag = true;
+ },1);
+ this.quo.IsQuoteTrial__c = IsQuoteTrialExp;
+ this.calPriceAll();
+ this.cancelProduct();
+ this.SelectedNewProduct = [];
+ }
}
//鏂板鎶ヤ环浜у搧妯℃�佹鍙栨秷鎸夐挳
cancelProduct() {
@@ -1932,14 +1840,12 @@
@track tableIsproductLoding = true;
// 鏂板鎶ヤ环浜у搧鍒楄〃鍒楅厤缃�
@track
- initDataProductTable = initDataProductTablefig;
-
+ initDataProductTable = initDataProductTablefig;
//鎵撳紑鎶ヤ环璁$畻鏍囪瘑
quoteflg = false;
@track
QTcss="slds-button slds-button_neutral slds-button_stretch lexBorder";
showQuotationCalculation(event){
- if(!this.yyEvent()) return;
if(this.pricePolicyflag){
this.QTcss = QTcssE(this.pricePolicyflag);
this.pricePolicyflag = false;
@@ -1960,7 +1866,7 @@
}else{
this.quoteflg = true;
if(this.QuoteDecision){
- this.pricePolicyflag = true;
+ this.quoteTrialInit();
}else{
this.savebuttonClick();
}
@@ -1973,37 +1879,50 @@
//鍚堝悓鎬讳环
ContractPrice = 0;
ifFTip=true;
- dealerfinalchange(event){
- var target = {value :event.detail.value};
- var events = {target:target}
- this.DealerFinalPricePageChange(events);
- }
- isloadingchange(event){
- this.IsLoading=event.detail.IsLoading;
- }
- QTcsschange(event){
- debugger
- this.QTcss = event.detail.qtcss;
- }
//淇濆瓨鎶ヤ环璁$畻缁撴灉鎸夐挳鏂规硶
- saveAllDataProductFn(event) {
- debugger
- var ContractPrice = event.detail.contractrice;
- this.IsLoading=false;
- this.quo.IsQuoteTrial__c = true;
- this.SkipQuotefilg = false;
- this.ifquocom = true;
- if(this.oppInfo.Sales_Root__c == Sales_Outlet){
- var target = {value :ContractPrice}
- var event = {target:target}
- this.OCMAgent1PricePageonChange(event);
+ saveAllDataProductFn() {
+ if(!this.yyEvent()) return;
+ var dataChunanshen = saveAllDataProductFnChuanshen(this.jzDataFixedPrice,this.jzDataDiscount,this.quoId,this.QuoteData,this.jzDataProduct,this.jzDataDefault,this.ContractPrice,localParseFloat(this.quo.Dealer_Final_Price_Page__c))
+ var newTemp = newTempExp;
+ if(localParseFloat(this.quo.Dealer_Final_Price_Page__c) < this.ContractPrice){
+ this.Alert("鏈�缁堝鎴锋垚浜や环浣庝簬鍚堝悓閲戦锛屼笉鍙繚瀛�",'error');
}else{
- this.quo.Dealer_Final_Price_Page__c = toNumComma(ContractPrice);
- var target = {value :ContractPrice}
- var event = {target:target}
- this.DealerFinalPricePageChange(event);
+ if (this.jzDataDefault.length == 0) {
+ var ifnunum = saveAllDataProductFnPanduan(this.jzDataProduct,newTemp);
+ var ifnull = ifnullExp;
+ if (ifnull&&ifnunum==1) {
+ this.IsLoading=true;
+ saveAllDataProduct(dataChunanshen).then(result => {
+ this.IsLoading=false;
+ this.quo.IsQuoteTrial__c = true;
+ this.SkipQuotefilg = false;
+ this.ifquocom = true;
+ if(this.oppInfo.Sales_Root__c == Sales_Outlet){
+ var target = {value :this.ContractPrice}
+ var event = {target:target}
+ this.OCMAgent1PricePageonChange(event);
+ }else{
+ this.quo.Dealer_Final_Price_Page__c = toNumComma(this.ContractPrice);
+ var target = {value :this.ContractPrice}
+ var event = {target:target}
+ this.DealerFinalPricePageChange(event);
+ }
+ this.Alert("鏁版嵁宸蹭繚瀛�", 'success');
+ });
+ } else {
+ if(ifnunum==2){
+ this.ifFTip=false;
+ this.Alert("浜у搧鏄庣粏涓噾棰濇湁璐熸暟锛屼笉鍙繚瀛�",'error');
+ }else{
+ this.ifFTip=false;
+ this.Alert("涓�鑸骇鍝佺殑鍚堝悓浠锋牸涓虹┖锛屼笉鍙繚瀛�",'error');
+ }
+ }
+ } else {
+ this.ifFTip=false;
+ this.Alert("浜у搧鏈�夊畬锛屼笉鍙繚瀛�",'error');
+ }
}
- this.Alert("鏁版嵁宸蹭繚瀛�", 'success');
}
//鎶ヤ环璁$畻鎵撳紑鎸夐挳 end
SelectedFnDefault(rows) {
@@ -2111,7 +2030,6 @@
initSearchFormFix = initSearchFormFix2;
@track
initDataTableFix = initDataTableFix2;
-
@track jzDataFix = [];
@track tableIsLodingFix = true;
// 鐐瑰嚮鎼滅储瑙﹀彂
@@ -2186,9 +2104,7 @@
}
});
});
- }
-
- //淇濆瓨浠锋牸鏀跨瓥缂栬緫鍒楁柟娉�
+ }
handleSaveFixedPrice(event) {
this.comparativeAssignment();
let editnewDate = [];
@@ -2205,7 +2121,6 @@
this.Alert("鏁版嵁淇敼鎴愬姛", 'success');
});
this.jzDataProduct = this.newArrsTemp3.concat(this.newArrsTemp4);
- //鍚堝悓浠锋牸姹囨��
this.ContractPriceCompute();
} else if (boolean == 3) {
this.Alert("淇敼閿欒锛屾鏁板凡缁忚秴杩囨渶澶у�硷紝涓嶅彲澧炲姞",'error');
@@ -2219,7 +2134,6 @@
var str3 = str + str1;
this.Alert(str3,'error');
}
- //鍒锋柊
this.jzshows3 = false;
this.IsLoading3 = true;
setTimeout(() => {
@@ -2229,8 +2143,6 @@
}
newArrsTemp3 = [];
newArrsTemp4 = [];
- //========淇冮攢鏂规妯℃�佹 start=========
- // 淇冮攢鏂规鎼滅储妗嗘悳绱㈡寜閽柟娉�
searchData(event) {
let searchParams = event.detail.searchParams || {};
let temp = this.template;
@@ -2238,10 +2150,8 @@
searchParams: searchParams
});
}
- // 淇冮攢鏂规鎼滅储妗嗛厤缃垪
@track
initSearchForm = initSearchForm2;
- //淇冮攢鏂规鍒楄〃閫変簨浠�
SelectedFn(event) {
let arr = event.detail.rows;
if (arr.length > 1) {
@@ -2252,8 +2162,6 @@
}
this.cancel();
}
- //淇冮攢鏂规鍒楄〃鍔犺浇鏁版嵁
- // 鍚庡彴浜や簰锛岃幏鍙栧垪琛ㄦ暟鎹�
getTableData(event) {
let listQuery = event;
if (event.fag == undefined) {
@@ -2276,7 +2184,6 @@
})
}
jzDataDefaultCopyQuantityList = [];
- // 鍚庡彴浜や簰锛岃幏鍙栦竴鑸骇鍝佸垪琛ㄦ暟鎹�
ifqianpi = true;
getTableDataFix(event) {
let listQuery = event;
@@ -2287,11 +2194,9 @@
}
listQuery.pageLimit = 200;
GetNormalProductSearch(listQuery).then(result => {
- //BBBB
var tempArr = result.split("--");
var responseObj = JSON.parse(tempArr[0]);
var responseObjAll = JSON.parse(tempArr[1]);
- //鎺掑簭
var newArrs = new Array;
responseObjAll.forEach(item => {
newArrs.push(item);
@@ -2334,14 +2239,11 @@
if (arr.length > 1) {
this.Alert("浠锋牸鏀跨瓥鍙彲閫夋嫨涓�涓柟妗�",'error');
} else {
- //鑾峰彇鏁版嵁
this.GetSearchProductByIdFn(arr[0].Id, arr[0], "浠锋牸鏀跨瓥", [], arr);
}
this.cancelFix();
}
- //浠锋牸鏀跨瓥鍖归厤
GetSearchProductByIdFn(idStr, jzDataProductParam, TypeName, jzDataDefaultToTemps, arrData, isShow = true) {
- //dddd
var SeachData = {
SearchId: idStr
};
@@ -2352,16 +2254,13 @@
}
jzDataProductParam = this.countListAndNod(tempObject, result);
arrData = [].concat(jzDataProductParam);
- //杩斿洖鏁版嵁姣旇緝瑙勫垯
this.CompareData(result, idStr, jzDataProductParam, TypeName, jzDataDefaultToTemps, arrData, isShow);
})
}
- //璁$畻listPrice鐨勫拰浠ュ強nod鍜�
countListAndNod(item, result) {
var ifTrade = this.QuoteData[0].Opportunity.Trade__c; //鍐呭璐镐俊鎭�
var copydate=this.jzDataDefaultCopy;
var DeftCopyQtyList = this.jzDataDefaultCopyQuantityList;
- //璁$畻list鍜宯od鍚堣閫昏緫
item=countListAndNodLogic(ifTrade,copydate,item,result,DeftCopyQtyList);
this.jzDataDefaultCopyQuantityList=DeftCopyQtyLists;
var arr = {
@@ -2370,16 +2269,13 @@
};
return arr;
}
- //鍖归厤浠锋牸鏀跨瓥鏃舵暟鎹瘮杈冭鍒�
CompareData(list, idStr, jzDataProductParam, TypeName, jzDataDefaultToTemps, arrData, isShow) {
var TempsJzDataToCompare = CompareDataL(list,this.jzDataDefault);
var isChange = isChangeExp;
- //End
if (TempsJzDataToCompare.length == list.length&&list.length!=0) {
TempsJzDataToCompare.forEach(TempsItems => {
this.ComparePushData(TempsItems.item.Quantity, TempsItems.element.Quantity__c, TempsItems.element.Asset_Model_No__c, idStr, jzDataProductParam, TypeName);
});
- //鍒ゆ柇鏄惁鏄剧ず 鎻愮ず妗�
if (isShow) {
if (this.ifqianpi) {
this.Alert("淇冮攢鏂规閫夋嫨瀹屾垚", 'success');
@@ -2397,20 +2293,14 @@
this.ChangeNumZeroTrueChanges();
}
var temps = this.CompareFullData;
- //娣诲姞
this.UpdateJZData(arrData);
- //鏇存柊娆℃暟
this.updatesNums();
- //鍚堝苟閲嶅浠锋牸鏀跨瓥鏂规
var jzarr = [].concat(this.jzDataFixedPrice);;
this.MergeDuplicateSchemes(jzarr);
- //淇濆瓨鏈�澶ф鏁�
this.savecount(idStr);
- //璁$畻浠锋牸
this.ComputeData(idStr, '浠锋牸鏀跨瓥');
}
ComparePushData(length, Quantity, Asset_Model_No__c, Id, jzDataProductParam, TypeName) {
- //淇敼 浜у搧鏄庣粏
let num = parseInt(length / Quantity);
var newDataDefault = ComparePushDataLogic(this.jzDataDefault,this.jzDataProduct,Asset_Model_No__c,Id,TypeName,jzDataProductParam,Quantity,num);
this.jzDataProduct = jzDataProductExp;
@@ -2424,14 +2314,13 @@
this.jzDataDefault = this.ChangeNumZeroTrueData;
}
}
- UpdateJZData(arrs) { //arrs 閫変腑鐨勬暟鎹泦鍚�
+ UpdateJZData(arrs) {
if (this.jzDataFixedPrice == null || this.jzDataFixedPrice.length <= 0) {
this.jzDataFixedPrice = arrs;
} else {
this.jzDataFixedPrice = this.jzDataFixedPrice.concat(arrs);
};
}
- // =======鏇存柊淇冮攢鏂规娆℃暟鏁版嵁
updatesNums() {
var jzDataFixedPriceTemp = [].concat(this.jzDataFixedPrice);
var jzDataDiscountTemp = [].concat(this.jzDataDiscount);
@@ -2440,7 +2329,6 @@
this.jzDataFixedPrice = jzDataFixedPriceTemps;
this.jzDataDiscount = jzDataDiscountTemps;
}
- //鍚堝苟閲嶅浠锋牸鏀跨瓥鏂规
MergeDuplicateSchemes(SchemeSet) {
var arr = [];
arr = MergeDuplicateSchemesLogic(this.CompareFullData,SchemeSet);
@@ -2448,22 +2336,18 @@
this.jzDataFixedPrice = [].concat(arr);
this.ConsolidationProgramProducts(arr);
}
- //璁$畻浠锋牸鏀跨瓥浠锋牸
- ComputeData(id, category) { //id 閫変腑鐨勬暟鎹甀D category 鏂规绫诲瀷
- //璋冪敤鏇挎崲listprice鍗曚环
+ ComputeData(id, category) {
this.ReplacementUnitPrice();
- //鏁版嵁
this.updateIdStr("3");
var arrTemp = this.jzDataFixedPrice; // id 浠锋牸鏀跨瓥
this.updateIdStr("1");
var arrProductTemp = this.jzDataProduct; // PromotionId 浜у搧鏄庣粏
var arrTemp2 = this.jzDataDefault; //寰呴�変骇鍝�
if (category == '浠锋牸鏀跨瓥') {
- arrTemp.forEach(item => { // item浠锋牸鏀跨瓥
+ arrTemp.forEach(item => {
if (id == item.Id) {
item.Total = item.Counts * item.Price_CNY__c;
item.sumNoDiscountTotal = item.sumNoDiscount * item.Counts;
- //璁$畻淇冮攢鎬讳环&& item.HeTongTotal == undefined
if (item.Price_CNY__c != undefined) {
if (item.determine != '鏀硅繃') {
if (item.if_Contain_Nod__c) {
@@ -2473,19 +2357,16 @@
}
}
}
- //璁$畻閫夋嫨淇冮攢鏀跨瓥鐨勭粡閿�鍟嗗崟浠峰拰灏忚
var PromotionHeadRecordId = item.recordTypeName__c;
- if (PromotionHeadRecordId == "Promotion") { //淇冮攢鏂规
+ if (PromotionHeadRecordId == "Promotion") {
arrProductTemp = ComputeDataPromotionLogic(this.newArrsTemp3,this.newArrsTemp4,this.jzDataDefaultCopyQuantityList,this.jzDataDefaultCopy,this.QuoteData,arrProductTemp,item,arrTemp2,this.jzDataDefault);
this.newArrsTemp3 = newArrsTemp3Exp;
this.newArrsTemp4 = newArrsTemp4Exp;
this.jzDataDefault = jzDataDefaultExp;
this.jzDataDefaultCopy = jzDataDefaultCopyExp;
this.jzDataProduct = arrProductTemp;
- //鍚堝悓浠锋牸姹囨��
this.ContractPriceCompute();
- } else if (PromotionHeadRecordId == "NormalProduct") { //涓�鑸骇鍝�
- //todu3
+ } else if (PromotionHeadRecordId == "NormalProduct") {
arrProductTemp = ComputeDataNormalProductLogic(this.newArrsTemp3,this.newArrsTemp4,this.jzDataDefaultCopyQuantityList,this.jzDataDefaultCopy,this.QuoteData,arrProductTemp,item,arrTemp2,this.jzDataDefault);
this.newArrsTemp3 = newArrsTemp3Exp;
this.newArrsTemp4 = newArrsTemp4Exp;
@@ -2506,11 +2387,10 @@
this.jzDataProduct = [].concat(ReplacementUnitPriceLogic(arr, ifTrade));//20230214
this.ContractPriceCompute();
}
- //淇濆瓨鏈�澶ф鏁�
- savecount(idStr) { //idStr 閫変腑鐨勬暟鎹甀D
+ savecount(idStr) {
this.jzDataFixedPrice = savecountLogic(this.jzDataFixedPrice,idStr);
}
- ChangeNumZeroTrueData = []
+ ChangeNumZeroTrueData = [];
ChangeNumZeroTrue() {
this.ChangeNumZeroTrueData = [].concat(this.jzDataDefault);
var newJzDataDefault = this.ChangeNumZeroTrueData.filter(item => {
@@ -2522,26 +2402,20 @@
})
this.ChangeNumZeroTrueData = newJzDataDefault;
}
- //鐢ㄤ簬濉厖娆℃暟
CompareFullData = []
AddNums(ListName, Asset_Model_No__c, addNums, Id) {
this.CompareFullData = AddNumsLogic(ListName, Asset_Model_No__c, addNums, Id,this.CompareFullData);
}
- //褰掑苟鐩稿悓浠锋牸鏀跨瓥鏂规鐨勪骇鍝�
ConsolidationProgramProducts(arrSchemes) {
var jzdataList = [].concat(this.jzDataProduct);
this.jzDataProduct = PriceConsolidation(arrSchemes, jzdataList);
}
- //淇冮攢鏂规鍒楄〃鏁版嵁
@track jzData = [];
- //淇冮攢鏂规鍒楄〃鍔犺浇鍔ㄥ浘鏍囪瘑
@track tableIsLoding = true;
- // 淇冮攢鏂规鍒楄〃鍒楅厤缃�
@track
initDataTable =initDataTable2;
jzdateflag=true;
IsLoading6 = false;
- //淇冮攢鏂规鍒楄〃缂栬緫鍒椾繚瀛�
savejzData(event){
var data = event.detail.rows;
for (var i = 0; i < this.jzData.length; i++) {
@@ -2559,27 +2433,20 @@
this.IsLoading6 = false;
}, 1000);
}
- //=========淇冮攢鏂规妯℃�佹 end============
- //***************浠锋牸鏀跨瓥 end**************
-
- //********鎶樻墸鏀跨瓥 start***********
- //閫夋嫨鐗圭害鎶樻墸鎵撳紑鎸夐挳
showModalSpecial(){
- this.QuoteData.forEach(qtd => {
+ this.QuoteData.forEach(qtd=>{
if (!qtd.Opportunity.IsAuthorized__c) {
this.Alert("璇ヨ浠蜂笉鏄壒绾︾粡閿�鍟嗘巿鏉�",'error');
} else {
- this.ShowSpecial = true;
+ this.ShowSpecial=true;
}
});
}
- //閫夋嫨涓�鑸姌鎵f墦寮�鎸夐挳
showModalCommonly(){
- this.ShowCommonly = true
+ this.ShowCommonly=true;
}
- //鎶樻墸鏀跨瓥鍒犻櫎鎸夐挳浜嬩欢
delectTableDiscount(){
- let ids = [];
+ let ids=[];
for (var j = 0; j < this.SelectedFnDataDiscount.length; j++) {
ids.push(this.SelectedFnDataDiscount[j].Id);
}
@@ -2587,48 +2454,40 @@
this.delectTableDiscountTemp();
this.ContractPriceCompute();
}
- DeleteSchemeMatching(ids, TypeName) {
- var CompareFullDataTemp = [];
- ids.forEach(id => {
- this.jzDataProduct = DeleteSchemeMatchingLogic(id,TypeName,CompareFullDataTemp,this.CompareFullData,this.jzDataFixedPrice,this.jzDataDiscount,this.jzDataProduct,this.jzDataDefault,this.jzDataDefaultNotChange);
- CompareFullDataTemp = CompareFullDataTempExp;
- this.jzDataFixedPrice = jzDataFixedPriceExp;
- this.jzDataDiscount = jzDataDiscountExp;
- this.jzDataDefault = jzDataDefaultExp;
- this.jzDataDefaultNotChange = jzDataDefaultNotChangeExp;
- //鍚堝悓浠锋牸姹囨��
+ DeleteSchemeMatching(ids,TypeName) {
+ var CompareFullDataTemp=[];
+ ids.forEach(id =>{
+ this.jzDataProduct=DeleteSchemeMatchingLogic(id,TypeName,CompareFullDataTemp,this.CompareFullData,this.jzDataFixedPrice,this.jzDataDiscount,this.jzDataProduct,this.jzDataDefault,this.jzDataDefaultNotChange);
+ CompareFullDataTemp=CompareFullDataTempExp;
+ this.jzDataFixedPrice=jzDataFixedPriceExp;
+ this.jzDataDiscount=jzDataDiscountExp;
+ this.jzDataDefault=jzDataDefaultExp;
+ this.jzDataDefaultNotChange=jzDataDefaultNotChangeExp;
this.ContractPriceCompute();
});
- this.CompareFullData = CompareFullDataTemp;
+ this.CompareFullData=CompareFullDataTemp;
}
- //鎶樻墸鏀跨瓥閫変腑鍒楄〃鏁版嵁
- @track SelectedFnDataDiscount = []
- //鎶樻墸鏀跨瓥閫夋嫨浜嬩欢
+ @track SelectedFnDataDiscount=[]
SelectedFnDiscount(event) {
- let arr = event.detail.rows;
- this.SelectedFnDataDiscount = arr;
+ let arr=event.detail.rows;
+ this.SelectedFnDataDiscount=arr;
}
- //鎶樻墸鏀跨瓥鍒楄〃鏁版嵁
- @track jzDataDiscount = [];
- //鎶樻墸鏀跨瓥鍒楄〃鍔犺浇鍔ㄥ浘鏍囪瘑
- @track tableIsLodingDiscount = true;
- //鎶樻墸鏀跨瓥鍒楄〃鍒楅厤缃�
+ @track jzDataDiscount=[];
+ @track tableIsLodingDiscount=true;
@track
- initDataTableDiscount = initDataTableDiscount2;
- //鎶樻墸鏀跨瓥鍒楄〃鍒楀姞杞芥柟娉�
+ initDataTableDiscount=initDataTableDiscount2;
getTableDataDiscount(event) {
- this.tableIsLodingDiscount = false;
+ this.tableIsLodingDiscount=false;
}
@track
- Tongzhishow = false; //鎻愮ず鏄剧ず鐨勬爣璇�
- SaveShowText = "鎿嶄綔鎴愬姛"; //鎻愮ず妗嗙殑鏂囨湰
- TongzhiIcon = 'standard:account' //鎻愮ず妗嗙殑鍥炬爣
- IsLeftStyle = "" //鎻愮ず妗嗙殑鏍峰紡
- BgColorStyle = ""
- //寮规鎻愮ず content 鍐呭 error 鏄惁鏄敊璇彁绀烘 left 鏄惁灞呭乏
- Alert(msg,type) {
- if(type == 'success'){
- const event = new ShowToastEvent({
+ Tongzhishow=false; //鎻愮ず鏄剧ず鐨勬爣璇�
+ SaveShowText="鎿嶄綔鎴愬姛"; //鎻愮ず妗嗙殑鏂囨湰
+ TongzhiIcon='standard:account' //鎻愮ず妗嗙殑鍥炬爣
+ IsLeftStyle="" //鎻愮ず妗嗙殑鏍峰紡
+ BgColorStyle=""
+ Alert(msg,type){
+ if(type=='success'){
+ const event=new ShowToastEvent({
message: msg,
variant: type,
});
@@ -2642,55 +2501,48 @@
this.dispatchEvent(event);
}
}
- //鎶樻墸鏀跨瓥缂栬緫鍒椾繚瀛樻柟娉�
- handleSaveDiscount(event) {
- this.jzDataDiscount = handleSaveDiscountLogic(this.jzDataDiscount,this.jzDataProduct,event);
- var boolean = booleanExp;
- var boolean2 = boolean2Exp;
- var boolean3 = boolean3Exp;
- let newData = newDataExp;
- let newData2 = newData2Exp;
- let newData3 = newData3Exp;
- let editnewDate = editnewDateExp;
- var GuaranteeDiscount__cZuiXiao = GuaranteeDiscount__cZuiXiaoExp;
- var NormalDiscount__cZuiXiao = NormalDiscount__cZuiXiaoExp;
+ handleSaveDiscount(event){
+ this.jzDataDiscount=handleSaveDiscountLogic(this.jzDataDiscount,this.jzDataProduct,event);
+ var boolean=booleanExp;
+ var boolean2=boolean2Exp;
+ var boolean3=boolean3Exp;
+ let newData=newDataExp;
+ let newData2=newData2Exp;
+ let newData3=newData3Exp;
+ let editnewDate=editnewDateExp;
+ var GuaranteeDiscount__cZuiXiao=GuaranteeDiscount__cZuiXiaoExp;
+ var NormalDiscount__cZuiXiao=NormalDiscount__cZuiXiaoExp;
this.jzDataProduct = jzDataProductExp;
- //haha2
- if (boolean == 0) {
- this.jzDataDiscount = newData;
- var newArrs = [].concat(editnewDate);//20230214
- newArrs.forEach(item => {
- //鍚堝苟鎶樻墸鏀跨瓥閲嶅鏂规
+ if (boolean==0){
+ this.jzDataDiscount=newData;
+ var newArrs=[].concat(editnewDate);//20230214
+ newArrs.forEach(item =>{
this.ConsolidatedDiscountPolicy(this.jzDataDiscount);
this.ComputeDiscount(item.Id, item.NormalDiscount__c_Input, item.GuaranteeDiscount__c_Input, item.Category__c, item.JxsType);
});
this.jzDataProduct = this.newArrsTemp2.concat(this.newArrsTemp);//20230213
- //鍚堝悓浠锋牸姹囨��
this.ContractPriceCompute();
this.Alert("鏁版嵁淇敼鎴愬姛", 'success');
- } else if (boolean == 1) {
+ } else if (boolean==1){
this.Alert("淇敼閿欒锛屽璞″搧鎶樻墸涓嶅緱灏忎簬瀵硅薄鍝佹渶浣庢姌鎵�:"+GuaranteeDiscount__cZuiXiao+"%",'error');
- } else if (boolean == 2) {
+ } else if (boolean==2){
this.Alert("淇敼閿欒锛岄潪瀵硅薄鍝佹姌鎵d笉寰楀皬浜庨潪瀵硅薄鍝佹渶浣庢姌鎵�:"+NormalDiscount__cZuiXiao+"%",'error');
- } else if (boolean == 3) {
+ } else if (boolean==3){
this.Alert("淇敼閿欒锛屼竴鑸姌鎵f病鏈夊璞″搧鎶樻墸",'error');
- } else if (boolean == 5) {
+ } else if (boolean==5){
this.Alert("闈炲璞″搧鎶樻墸涓嶅彲浠ヤ负绌烘垨灏忎簬0",'error');
- } else if (boolean == 4) {
+ } else if (boolean==4){
this.jzDataDiscount = newData;
var ffgg=0;
if(boolean3){
- newData2.forEach(HeTo => {
- //鏍规嵁鍚堝悓浠锋牸璁$畻涓�鑸姌鎵�
+ newData2.forEach(HeTo=>{
HeTo = this.ComouteProductDiscount(HeTo.Id,HeTo.Category__c,HeTo.GuaranteeDiscount__c_Input, HeTo.NormalDiscount__c_Input, HeTo.GuaranteeDiscount_H_Money__c,HeTo.NormalDiscount_H_Money__c, HeTo);
if(HeTo==1||HeTo==2||HeTo==12||HeTo==3){
ffgg=HeTo;
return ;
}
- //鍚堝苟鎶樻墸鏀跨瓥閲嶅鏂规
- let jzDataDiscountx = [].concat(this.jzDataDiscount);//20230214
+ let jzDataDiscountx=[].concat(this.jzDataDiscount);//20230214
this.ConsolidatedDiscountPolicy(jzDataDiscountx);
- //涓�鑸姌鎵f洿鏀硅繃鍚堝悓浠锋牸璁$畻
this.updateCommonlyDiscountLogic(HeTo.Id,HeTo.JxsType,HeTo.GuaranteeDiscount__c_Input,HeTo.NormalDiscount__c_Input,HeTo.Category__c,this.jzDataDiscount);
});
}
@@ -2717,7 +2569,6 @@
this.Alert("鏁版嵁淇敼鎴愬姛", 'success');
}
}
- //鍒锋柊
this.jzshows2 = false;
setTimeout(() => {
this.jzshows2 = true;
@@ -2725,9 +2576,7 @@
}
newArrsTemp = [];
newArrsTemp2 = [];
- //璁$畻涓�鑸姌鎵i潪瀵硅薄鍝佹姌鎵�
ComouteProductDiscount(Id,Category__c,GuaranteeDiscount__c_Input, NormalDiscount__c_Input,GuaranteeDiscount_H_Money__c, NormalDiscount_H_Money__c, item) {
- //todu12
this.updateIdStr("2");
this.updateIdStr("1");
var reslut=ReverseCalculationModifyDiscountLogic(this.jzDataDiscount,this.jzDataProduct,Id,Category__c,GuaranteeDiscount__c_Input, NormalDiscount__c_Input,GuaranteeDiscount_H_Money__c, NormalDiscount_H_Money__c, item);
@@ -2735,14 +2584,12 @@
this.jzDataProduct=[].concat(arrProductTempsss);//20230214
return reslut;
}
- //涓�鑸姌鎵f洿鏀硅繃鍚堝悓浠锋牸璁$畻
updateCommonlyDiscountLogic(Id,JxsType,GuaranteeDiscount__c_Input,NormalDiscount__c_Input,Category__c,jzDataDiscount) {
//todu13
this.updateIdStr("1");
this.jzDataProduct=updateCDLogic(Id,JxsType,GuaranteeDiscount__c_Input,NormalDiscount__c_Input,Category__c,jzDataDiscount,this.jzDataProduct);
this.GeneralDiscountContractSummary();
}
- //鏇存敼涓�鑸姌鎵e悎鍚屼环鏍艰绠楀悎鍚屾�讳环
GeneralDiscountContractSummary(){
this.ContractPrice = 0;
var sum = this.ContractPrice;
@@ -2750,13 +2597,9 @@
sum=GeneralDiscountContractSummaryLogic(sum,this.jzDataDiscount,this.jzDataFixedPrice);
this.ContractPrice = sum;
}
- //鎶樻墸鏀跨瓥鍒楄〃灞曠ず鏍囪瘑
jzshows2 = true;
- ///鐗圭害鎶樻墸寰呴�夋柟妗堝垪琛ㄩ�夋嫨鏁版嵁
@track SelectedFnDataSpecial = [];
- //鐗圭害鎶樻墸妯℃�佹閿欒鎻愮ず寮�鍏�
ShowSpecialIsError = false;
- //鐗圭害鎶樻墸寰呴�夋柟妗堝垪琛ㄩ�変腑鏂规硶
SelectedFnSpecial(event) {
let arr = event.detail.rows;
if (event.detail.rows.length > 1) {
@@ -2773,7 +2616,6 @@
tempObject.CompareId = GetUUID();
this.SelectedFnDataSpecial = [tempObject];
}
- //鐗圭害鎶樻墸寰呴�夋柟妗堝垪琛ㄥ姞杞芥柟娉�
getTableDataSpecial(event) {
let listQuery = event.detail.listQuery;
var Agency1__c = this.QuoteData[0].Agency1__c;
@@ -2793,7 +2635,7 @@
if (ga.Agency__r != undefined) {
var arr = [];
this.jzDataSpecial.forEach(jzdsc => {
- if (ga.Agency__c == jzdsc.Agency__c) {
+ if (ga.Agency__c==jzdsc.Agency__c) {
jzdsc.Agency__Name = ga.Agency__r.Name;
arr.push(jzdsc);
} else {
@@ -2807,28 +2649,20 @@
this.tableIsLodingSpecial = false;
})
}
- //鐗圭害鎶樻墸寰呴�夋柟妗堝垪琛ㄥ垪閰嶇疆
@track
initDataTableSpecial = initDataTableSpecial2;
- //鐗圭害鎶樻墸寰呴�夋柟妗堝垪琛ㄦ暟鎹�
@track jzDataSpecial = [];
- //鐗圭害鎶樻墸寰呴�夋柟妗堝垪琛ㄥ姞杞藉姩鍥炬爣璇�
@track tableIsLodingSpecial = true;
- //鐗圭害鎶樻墸寰呴�変骇鍝佸垪琛ㄩ�夋嫨鏁版嵁
@track SelectedOtherDataArr = [];
- //鐗圭害鎶樻墸寰呴�変骇鍝佸垪琛ㄩ�変腑鏂规硶
SelectedFnOtherData(event) {
let arr = event.detail.rows;
this.SelectedOtherDataArr = arr;
}
- //鐗圭害鎶樻墸寰呴�変骇鍝佸垪琛ㄥ垪閰嶇疆
@track
initDataTableOtherData = initDataTableOtherData2;
@track jzDataOtherData = [];
@track tableIsLodingOtherData = true;
- //鐗圭害鎶樻墸妯″紑鍏�
@track ShowSpecial;
- //鐗圭害鎶樻墸寰呴�変骇鍝佸垪琛ㄥ姞杞芥柟娉�
getTableDataOtherData(event) {
if (!this.IsLoadingFlag1) {
return
@@ -2846,13 +2680,9 @@
this.jzDataOtherData = jzDataOtherDataTemp;
this.tableIsLodingOtherData = false;
}
- //鐗圭害鎶樻墸寰呴�変骇鍝佸垪琛ㄥ鍔犺浇鍔ㄥ浘鏍囪瘑
IsLoading5 = false;
- //鐗圭害鎶樻墸寰呴�変骇鍝佸睍绀烘爣璇�
jzshows5 = true;
- //
IsLoadingFlag1 = true;
- //鐗圭害鎶樻墸寰呴�変骇鍝佺紪杈戝垪淇濆瓨鏂规硶
SaveSpecialDiscount(event) {
var data = event.detail.rows;
let newData = [];
@@ -2863,11 +2693,10 @@
var flag = false;
for (var j = 0; j < data.length; j++) {
var id = data[j].Id;
- if (this.jzDataOtherData[i].Id == id) {
+ if (this.jzDataOtherData[i].Id==id) {
editData = {
SplitQuantity: ''
};
- //鎷嗗垎娆℃暟
editData.SplitQuantity = data[j].SplitQuantity;
flag = true;
}
@@ -2893,19 +2722,18 @@
newArrs.forEach(item => {
if (item.Quantity < item.SplitQuantity) {
boolean = 2;
- } else if (item.SplitQuantity == 0 || item.SplitQuantity == '') {
+ } else if (item.SplitQuantity==0 || item.SplitQuantity=='') {
boolean = 3;
}
});
- if (boolean == 1) {
+ if (boolean==1) {
this.jzDataOtherData = newData;
this.ShowSpecialIsError = false;
- } else if (boolean == 2) {
+ } else if (boolean==2) {
this.errorTiShi("淇敼閿欒锛屼娇鐢ㄦ暟閲忎笉寰楀ぇ浜庢暟閲�");
- } else if (boolean == 3) {
+ } else if (boolean==3) {
this.errorTiShi("淇敼閿欒锛屼娇鐢ㄦ暟閲忎笉寰椾负0鎴栦负绌�");
}
-
this.jzshows5 = false;
this.IsLoading5 = true;
this.IsLoadingFlag1 = false;
@@ -2918,20 +2746,17 @@
this.IsLoadingFlag1 = true;
}, 2000);
}
- //鐗圭害閿欒鎻愮ず
errorTiShi(str){
this.ShowSpecialIsError = true;
this.ShowSpecial = true;
this.ShowSpecialError = str;
}
- //鐗圭害鎶樻墸妯℃�佹鍙栨秷鎸夐挳鏂规硶
cancelSpecial() {
this.ShowSpecial = false
this.ShowSpecialIsError = false;
this.SelectedFnDataSpecial = [];
this.SelectedOtherDataArr = [];
}
- //鐗圭害鎶樻墸妯℃�佹淇濆瓨鎸夐挳鏂规硶
SavesSpecial() {
this.ShowSpecialIsError = false;
this.ShowSpecial = false;
@@ -2939,11 +2764,11 @@
...{},
...this.SelectedFnDataSpecial[0]
};
- if (this.SelectedOtherDataArr.length == 0 && this.SelectedFnDataSpecial.length != 0) {
+ if (this.SelectedOtherDataArr.length==0 && this.SelectedFnDataSpecial.length != 0) {
this.errorTiShi("璇烽�夋嫨鐗圭害鎶樻墸浜у搧锛�");
- } else if (this.SelectedFnDataSpecial.length == 0 && this.SelectedOtherDataArr.length != 0) {
+ } else if (this.SelectedFnDataSpecial.length==0 && this.SelectedOtherDataArr.length != 0) {
this.errorTiShi("璇烽�夋嫨鐗圭害鎶樻墸鏂规锛�");
- } else if (this.SelectedFnDataSpecial.length == 0 && this.SelectedOtherDataArr.length == 0) {
+ } else if (this.SelectedFnDataSpecial.length==0 && this.SelectedOtherDataArr.length==0) {
this.errorTiShi("璇烽�夋嫨鐗圭害鎶樻墸鏂规鍜屼骇鍝侊紒");
} else {
ItempTempData.itemss = this.SelectedOtherDataArr;
@@ -2960,42 +2785,40 @@
this.SelectedOtherDataArr = [];
}
}
- //璁$畻鎶樻墸鏀跨瓥
ComputeDiscount(id, NormalDiscount__c_Input, GuaranteeDiscount__c_Input, Category__c, JxsType) {
this.updateIdStr("1");
var arrProductTemp = this.jzDataProduct;
this.updateIdStr("2");
var arrTemp1 = this.jzDataDiscount;
arrTemp1.forEach(item => {
- if (JxsType == '鐗圭害鎶樻墸') {
- if (item.JxsType == '鐗圭害鎶樻墸') {
- if (id == item.Id) {
+ if (JxsType=='鐗圭害鎶樻墸') {
+ if (item.JxsType=='鐗圭害鎶樻墸') {
+ if (id==item.Id) {
if (item.iftrue != "鏀硅繃" &&
- item.GuaranteeDiscount__c_Input == undefined &&
- item.NormalDiscount__c_Input == undefined) {
+ item.GuaranteeDiscount__c_Input==undefined &&
+ item.NormalDiscount__c_Input==undefined) {
item.GuaranteeDiscount__c_Input = item.GuaranteeDiscount__c;
item.NormalDiscount__c_Input = item.NormalDiscount__c;
}
- if (NormalDiscount__c_Input == item.NormalDiscount__c_Input &&
- GuaranteeDiscount__c_Input == item.GuaranteeDiscount__c_Input) {
+ if (NormalDiscount__c_Input==item.NormalDiscount__c_Input &&
+ GuaranteeDiscount__c_Input==item.GuaranteeDiscount__c_Input) {
arrProductTemp = ComputeDiscountAuthorizerLogic(this.newArrsTemp,this.newArrsTemp2,item,arrProductTemp);
this.newArrsTemp = newArrsTempExp;
this.newArrsTemp2 = newArrsTemp2Exp;
this.jzDataProduct = arrProductTemp;
- //鍚堝悓浠锋牸姹囨��
this.ContractPriceCompute();
}
}
}
- } else if (JxsType == '涓�鑸姌鎵�') {
- if (item.JxsType == '涓�鑸姌鎵�') {
- if (NormalDiscount__c_Input == item.NormalDiscount__c_Input &&
- Category__c == item.Category__c) {
+ } else if (JxsType=='涓�鑸姌鎵�') {
+ if (item.JxsType=='涓�鑸姌鎵�') {
+ if (NormalDiscount__c_Input==item.NormalDiscount__c_Input &&
+ Category__c==item.Category__c) {
this.newArrsTemp = [];
this.newArrsTemp2 = [];
arrProductTemp.forEach(itemss => {
- if (itemss.NormalDiscount__c_Input == item.NormalDiscount__c_Input &&
- itemss.Category__c == item.Category__c) {
+ if (itemss.NormalDiscount__c_Input==item.NormalDiscount__c_Input &&
+ itemss.Category__c==item.Category__c) {
itemss = commonlyDiscountLogic(itemss, item); //涓�鑸姌鎵h绠楅�昏緫
this.newArrsTemp.push(itemss);
} else if (itemss.Category__c != item.Category__c ||
@@ -3004,7 +2827,6 @@
}
});
this.jzDataProduct = arrProductTemp;
- //鍚堝悓浠锋牸姹囨��
this.ContractPriceCompute();
}
}
@@ -3012,50 +2834,39 @@
});
this.jzDataDiscount = [].concat(arrTemp1);
}
- //鎶樻墸鏀跨瓥鍖归厤瑙勫垯
SpecialSavesChange(SaveName, SelectedData, IdStr, CompareId) {
var newDicountData = [];
newDicountData=SpecialSavesChangePartLogic(this.jzDataDefault,SaveName, SelectedData, IdStr, CompareId,0,newDicountData,this.jzDataDiscount);
this.jzDataDefault = NewDefaultDatass;
this.jzDataProduct =this.jzDataProduct.concat(AddProductDatass);
- //鍚堝悓浠锋牸姹囨��
this.ContractPriceCompute();
this.jzDataDiscount = newDicountData;
}
- //鍚堝苟鎶樻墸鏀跨瓥閲嶅鏂规
ConsolidatedDiscountPolicy(SchemeSet) {
var arr = [];
arr = ConsolidatedDiscountPolicyLogic(SchemeSet, arr);
this.jzDataDiscount = [].concat(arr);
this.ConsolidatedDiscountDetails(arr);
}
- //鍚堝苟鎶樻墸鏀跨瓥浜у搧鏄庣粏
ConsolidatedDiscountDetails(arrSchemes) {
var jzdataList = [].concat(this.jzDataProduct);
this.jzDataProduct = ConsolidatedDiscountDetailsLogic(arrSchemes, jzdataList);
}
- //==========鐗圭害鎶樻墸妯℃�佹 end=============
- //=========涓�鑸姌鎵fā鎬佹 start===========
- //涓�鑸姌鎵fā鎬佹寮�鍏�
@track ShowCommonly;
- //涓�鑸姌鎵e緟閫変骇鍝佸垪琛ㄥ鍔犺浇鍔ㄥ浘鏍囪瘑
IsLoading4 = false;
- //涓�鑸姌鎵e緟閫変骇鍝佸睍绀烘爣璇�
jzshows4 = true;
- //
IsLoadingFlag = true;
- //涓�鑸姌鎵e緟閫変骇鍝佺紪杈戝垪淇濆瓨鏂规硶
SaveGeneralDiscount(event) {
var data = event.detail.rows;
let newData = SaveGeneralDiscountLogic(data,this.jzDataCommonly);
var boolean = booleanExp;
- if (boolean == 1) {
+ if (boolean==1) {
this.jzDataCommonly = newData;
this.ShowCommonlyIsError = false;
- } else if (boolean == 2) {
+ } else if (boolean==2) {
this.ShowCommonlyIsError = true;
this.ShowCommonlyError = "淇敼閿欒锛屼娇鐢ㄦ暟閲忎笉寰楀ぇ浜庢暟閲�";
- } else if (boolean == 3) {
+ } else if (boolean==3) {
this.ShowCommonlyIsError = true;
this.ShowCommonlyError = "淇敼閿欒锛屼娇鐢ㄦ暟閲忎笉寰椾负0鎴栦负绌�";
}
@@ -3071,7 +2882,6 @@
this.IsLoadingFlag = true;
}, 2000);
}
- //涓�鑸姌鎵fā鎬佹鍙栨秷鎸夐挳鏂规硶
cancelCommonly() {
this.ShowCommonly = false;
this.ShowCommonlyIsError = false;
@@ -3079,14 +2889,10 @@
this.SaveLb = '';
this.SaveZk = '';
}
- //涓�鑸姌鎵e緟閫変骇鍝佸垪琛ㄥ垪閰嶇疆
@track
initDataTableCommonly = initDataTableCommonly2;
- //涓�鑸姌鎵e緟閫変骇鍝佸垪琛ㄦ暟鎹�
@track jzDataCommonly = [];
- //涓�鑸姌鎵e緟閫変骇鍝佸垪琛ㄥ姞杞藉姩鍥炬爣璇�
@track tableIsLodingCommonly = true;
- //涓�鑸姌鎵e緟閫夋柟妗堝垪琛ㄥ姞杞芥柟娉�
getTableDataCommonly(event) {
if (!this.IsLoadingFlag) {
return
@@ -3095,40 +2901,29 @@
this.jzDataCommonly = getTableDataCommonlyLogic(this.jzDataCommonly);
this.tableIsLodingCommonly = false;
}
- //涓�鑸姌鎵e緟閫変骇鍝佸垪琛ㄩ�夋嫨鏁版嵁
SelectedFnCommonlyData = [];
- //涓�鑸姌鎵e緟閫変骇鍝佸垪琛ㄩ�変腑鏂规硶
SelectedFnCommonly(event) {
let arr = event.detail.rows;
this.SelectedFnCommonlyData = SelectedFnCommonlyLogic(arr);
}
- //浜у搧绯诲垪鏁版嵁
SaveLb = '';
- //浣跨敤鎶樻墸鏁版嵁
SaveZk = '';
- //浜у搧绯诲垪鏂规硶
handleChangeLb(event) {
this.SaveLb = event.target.value;
}
- //浣跨敤鎶樻墸鏂规硶
handleChangeZk(event) {
if (event.target.value !== '') {
event.target.value = parseFloat(event.target.value) + "%";
}
this.SaveZk = event.target.value;
}
- //涓�鑸姌鎵fā鎬佹閿欒鎻愮ず鏂规硶
errorTiShiYi(str){
this.ShowCommonlyIsError = true;
this.ShowCommonlyError = str;
}
- //涓�鑸姌鎵fā鎬佹閿欒鎻愮ず榛樿鍐呭
ShowCommonlyError = "璇烽�夋嫨涓�鑸骇鍝侊紒";
- //涓�鑸姌鎵fā鎬佹閿欒鎻愮ず寮�鍏�
ShowCommonlyIsError = false;
- //涓�鑸姌鎵fā鎬佹鍙栨秷鎸夐挳鏂规硶
cancelSaveCommonly() {
- //澶勭悊鏁版嵁
var arr = this.SelectedFnCommonlyData;
this.ShowCommonlyIsError = false;
if (this.SelectedFnCommonlyData.length != 0) {
@@ -3138,12 +2933,12 @@
ItempTempData.Name = '涓�鑸姌鎵�';
ItempTempData.JxsType = "涓�鑸姌鎵�";
ItempTempData.itemss = arr;
- if (this.SaveLb == '' || this.SaveZk == '') {
- if (this.SaveLb == '' && this.SaveZk != '') {
+ if (this.SaveLb=='' || this.SaveZk=='') {
+ if (this.SaveLb=='' && this.SaveZk != '') {
this.errorTiShiYi("璇烽�夋嫨浜у搧绫诲埆锛�");
- } else if (this.SaveZk == '' && this.SaveLb != '') {
+ } else if (this.SaveZk=='' && this.SaveLb != '') {
this.errorTiShiYi("璇疯緭鍏ヤ娇鐢ㄦ姌鎵o紒");
- } else if (this.SaveZk == '' && this.SaveLb == '') {
+ } else if (this.SaveZk=='' && this.SaveLb=='') {
this.errorTiShiYi("璇疯緭鍏ヤ娇鐢ㄦ姌鎵e拰浜у搧绫诲埆锛�");
}
} else {
@@ -3157,26 +2952,19 @@
this.cancelCommonly();
this.Alert("涓�鑸姌鎵i�夋嫨瀹屾垚", 'success');
this.ConsolidatedDiscountPolicy(this.jzDataDiscount);
- //璁$畻鎶樻墸鏀跨瓥浠锋牸
this.ComputeDiscount(ItempTempData.Id, ItempTempData.NormalDiscount__c_Input, ItempTempData.GuaranteeDiscount__c, ItempTempData.Category__c, ItempTempData.JxsType);
}
} else {
this.errorTiShiYi("璇烽�夋嫨涓�鑸骇鍝侊紒");
}
}
- //灏嗕骇鍝佷笌鏂规鍖归厤
UpdateDiscountData(arrs) {
- if (this.jzDataDiscount == null || this.jzDataDiscount.length <= 0) {
+ if (this.jzDataDiscount==null || this.jzDataDiscount.length <= 0) {
this.jzDataDiscount = arrs;
} else {
this.jzDataDiscount = this.jzDataDiscount.concat(arrs);
}
}
- //=========涓�鑸姌鎵fā鎬佹 end=========
- //*********鎶樻墸鏀跨瓥 end*********
-
- //************浜у搧鏄庣粏 start***********
- //浜у搧鏄庣粏鍒犻櫎鏂规硶
delectTableProduct(){
this.DeleteIsChangesFnSingle(this.SelectedFnProductData);
}
@@ -3185,7 +2973,7 @@
list.forEach(item => {
num++;
var falg = true;
- if (item.TypeName == "浠锋牸鏀跨瓥") {
+ if (item.TypeName=="浠锋牸鏀跨瓥") {
this.DeleteIsChangelogic(item, item.TypeName, num, list);
var TempItem = DeleteIsChangesFnjiage(this.jzDataFixedPrice,this.jzDataProduct,falg,item);
falg = falgExp;
@@ -3193,7 +2981,7 @@
this.SelectedFnDataFixedPrice.push(TempItem);
this.deleteFixedPriceTemp();
}
- } else if (item.TypeName == "鎶樻墸鏀跨瓥") {
+ } else if (item.TypeName=="鎶樻墸鏀跨瓥") {
this.DeleteIsChangelogic(item, item.TypeName, num, list);
var TempItemTOName = DeleteIsChangesFnzhekou(this.jzDataDiscount,this.jzDataProduct,falg,item);
falg = falgExp;
@@ -3210,40 +2998,30 @@
this.jzDataProduct = jzDataProductExp;
this.jzDataDefault = jzDataDefaultExp;
this.jzDataDefaultCopy = jzDataDefaultCopyExp;
- if(boofag == 1){
+ if(boofag==1){
this.Alert("淇冮攢鏂规鍐呬骇鍝佸瀷鍙凤紝鏁伴噺鍥哄畾锛屼笉鍙垹闄ゆ槑缁�",'error');
- }else if(boofag == 2){
+ }else if(boofag==2){
this.Alert("璇ヤ骇鍝佷负涓�鑸骇鍝侊紝涓嶅彲鍒犻櫎鏄庣粏",'error');
}
- //鍚堝悓浠锋牸姹囨��
this.ContractPriceCompute();
}
delectTableDiscountTemp() {
this.jzDataDiscount = delectTableDiscountTempLogic(this.SelectedFnDataDiscount,this.jzDataDiscount);
this.SelectedFnDataDiscount = [];
}
- //浜у搧鏄庣粏鍒楄〃鏁版嵁鍔犺浇鏂规硶
getTableDataProduct(event) {
this.tableIsLodingProduct = false;
}
- //浜у搧鏄庣粏閫変腑鍒楄〃鏁版嵁
@track SelectedFnProductData = [];
- //浜у搧鏄庣粏閫変腑鍒楄〃鏂规硶
SelectedFnProduct(event) {
let arr = event.detail.rows;
this.SelectedFnProductData = arr;
}
- //浜у搧鏄庣粏鍒楄〃鍒楅厤缃�
@track
initDataTableProduct = initDataTableProduct2;
- //浜у搧鏄庣粏鍒楄〃鏁版嵁
@track jzDataProduct = [];
- //浜у搧鏄庣粏鍒楄〃鍔犺浇鍔ㄥ浘鏍囪瘑
@track tableIsLodingProduct = true;
- //浜у搧鏄庣粏鍒楄〃灞曠ず鏍囪瘑
jzshows= true;
- //*********浜у搧鏄庣粏 end**********
- //鎵撳嵃瀹㈡埛鍚嶇О start
selection_hp = '';
options_hp = [];
options_hpflg = true;
@@ -3265,7 +3043,6 @@
PrintCustomerNamehandleChange(event) {
this.selection_hp = event.detail.value;
}
- // cjw start
a(){
var jzDataToBeproduct1=this.jzDataToBeproduct;
var selectjzDataTableToBeproduct1 = this.selectjzDataTableToBeproduct;
@@ -3285,5 +3062,4 @@
return false;
}
}
- // cjw end
}
\ No newline at end of file
--
Gitblit v1.9.1