From a541906d9d6510d493292fae704fe80cc5e8d0ce Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@prec-tech.com>
Date: 星期二, 20 六月 2023 17:43:37 +0800
Subject: [PATCH] 注残 QIS 修改
---
force-app/main/default/lwc/lexNewSparePartsLoanApplication/lexNewSparePartsLoanApplication.js | 137 +++++++++++++++++++++------------------------
force-app/main/default/lwc/lexEquipmentRentalApply_FromQIS2/lexEquipmentRentalApply_FromQIS2.html | 1
force-app/main/default/lwc/lexEquipmentRentalApply_FromQIS2/lexEquipmentRentalApply_FromQIS2.js | 22 ++++---
force-app/main/default/lwc/lexEquipmentRentalApply_FromSA/lexEquipmentRentalApply_FromSA.js | 5 +
4 files changed, 81 insertions(+), 84 deletions(-)
diff --git a/force-app/main/default/lwc/lexEquipmentRentalApply_FromQIS2/lexEquipmentRentalApply_FromQIS2.html b/force-app/main/default/lwc/lexEquipmentRentalApply_FromQIS2/lexEquipmentRentalApply_FromQIS2.html
index ae58c6c..894569c 100644
--- a/force-app/main/default/lwc/lexEquipmentRentalApply_FromQIS2/lexEquipmentRentalApply_FromQIS2.html
+++ b/force-app/main/default/lwc/lexEquipmentRentalApply_FromQIS2/lexEquipmentRentalApply_FromQIS2.html
@@ -1,5 +1,6 @@
<template>
<div class="dispatchOCSMQARAHolder" if:true={IsLoading}>
<lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
</div>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexEquipmentRentalApply_FromQIS2/lexEquipmentRentalApply_FromQIS2.js b/force-app/main/default/lwc/lexEquipmentRentalApply_FromQIS2/lexEquipmentRentalApply_FromQIS2.js
index 7f74e42..eaf7afa 100644
--- a/force-app/main/default/lwc/lexEquipmentRentalApply_FromQIS2/lexEquipmentRentalApply_FromQIS2.js
+++ b/force-app/main/default/lwc/lexEquipmentRentalApply_FromQIS2/lexEquipmentRentalApply_FromQIS2.js
@@ -1,8 +1,8 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference, NavigationMixin} from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
-import init from '@salesforce/apex/LexEquipmentRentalApply_FromQISCtl.rentalApp';
-import rentalApp from '@salesforce/apex/LexEquipmentRentalApply_FromQISCtl.init';
+import rentalApp from '@salesforce/apex/LexEquipmentRentalApply_FromQISCtl.rentalApp';
+import init from '@salesforce/apex/LexEquipmentRentalApply_FromQISCtl.init';
import UserInfo_Owner from '@salesforce/apex/LexEquipmentRentalApply_FromQISCtl.UserInfo_Owner';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
@@ -33,7 +33,7 @@
rentalApp({
recordId: this.recordId
}).then(result => {
- console.log('rentalApp============' + result);
+ console.log('rentalApp============',result);
if(result.lenth > 0){
const evt = new ShowToastEvent({
title : 'Error',
@@ -47,22 +47,23 @@
recordId: this.recordId
}).then(result => {
this.IsLoading = false;
-
+ console.log('init============',result);
if (result != null) {
if(result.nextAction=='閫佸洖'){
- this.showToast('QIS瀵瑰簲鏂规硶涓衡�滈�佸洖鈥濓紝涓嶈兘鐢宠','warning');
+ this.showToast('QIS瀵瑰簲鏂规硶涓衡�滈�佸洖鈥濓紝涓嶈兘鐢宠','error');
return;
}
if(result.qISStatus=='鑽夋涓�'){
- this.showToast('QIS鐘舵�佷负鑽夋涓紝涓嶈兘鐢宠','warning');
+ // this.msg = 'QIS鐘舵�佷负鑽夋涓紝涓嶈兘鐢宠';
+ this.showToast('QIS鐘舵�佷负鑽夋涓紝涓嶈兘鐢宠','error');
return;
}
if(result.qISStatus=='FSE濉啓瀹屾瘯'){
- this.showToast('QIS鐘舵�佷负FSE濉啓瀹屾瘯锛屼笉鑳界敵璇�','warning');
+ this.showToast('QIS鐘舵�佷负FSE濉啓瀹屾瘯锛屼笉鑳界敵璇�','error');
return;
}
if(result.qISStatus=='鍙栨秷'){
- this.showToast('QIS鐘舵�佷负鍙栨秷锛屼笉鑳界敵璇�','warning');
+ this.showToast('QIS鐘舵�佷负鍙栨秷锛屼笉鑳界敵璇�','error');
return;
}
// if('{!$User.isFormal_Stuff__c}'=='true'){
@@ -73,7 +74,7 @@
// }
UserInfo_Owner({}).then(res=>{
if(res.isFormalStuff == 'true'){
- this.showToast('璇曠敤鏈熷唴锛屼笉鑳界敵璇�','warning');
+ this.showToast('璇曠敤鏈熷唴锛屼笉鑳界敵璇�','error');
return;
}else{
const defaultValues = encodeDefaultFieldValues({
@@ -122,11 +123,12 @@
showToast(message, type) {
const evt = new ShowToastEvent({
- title: '',
+ title: 'Error',
message: message,
variant: type
});
this.dispatchEvent(evt);
+ this.dispatchEvent(new CloseActionScreenEvent());
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexEquipmentRentalApply_FromSA/lexEquipmentRentalApply_FromSA.js b/force-app/main/default/lwc/lexEquipmentRentalApply_FromSA/lexEquipmentRentalApply_FromSA.js
index 7b0a7bb..5512f33 100644
--- a/force-app/main/default/lwc/lexEquipmentRentalApply_FromSA/lexEquipmentRentalApply_FromSA.js
+++ b/force-app/main/default/lwc/lexEquipmentRentalApply_FromSA/lexEquipmentRentalApply_FromSA.js
@@ -85,7 +85,7 @@
console.log(error);
})
}else{
- this.showToast(res,'warning');
+ this.showToast(res,'error');
return;
}
})
@@ -94,10 +94,11 @@
showToast(message, type) {
const evt = new ShowToastEvent({
- title: '',
+ title: 'Error',
message: message,
variant: type
});
this.dispatchEvent(evt);
+ this.dispatchEvent(new CloseActionScreenEvent());
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewSparePartsLoanApplication/lexNewSparePartsLoanApplication.js b/force-app/main/default/lwc/lexNewSparePartsLoanApplication/lexNewSparePartsLoanApplication.js
index e91789b..c28718a 100644
--- a/force-app/main/default/lwc/lexNewSparePartsLoanApplication/lexNewSparePartsLoanApplication.js
+++ b/force-app/main/default/lwc/lexNewSparePartsLoanApplication/lexNewSparePartsLoanApplication.js
@@ -7,8 +7,9 @@
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
// 鏂板缓澶囧搧鍊熷嚭鐢宠 opd璁″垝
-export default class LexNewSparePartsLoanApplication extends LightningElement {
+export default class LexNewSparePartsLoanApplication extends NavigationMixin(LightningElement) {
@api recordId;
+ defaultValues1;
IsLoading = true;
@wire(CurrentPageReference)
@@ -34,73 +35,72 @@
}).then(result => {
this.IsLoading = false;
if (result != null) {
-
+ console.log("-------result--------------",JSON.stringify(result))
if (result.opdStayOrNot == '宸茬鑱�') {
- this.showToast('鎵�鏈変汉宸茬粡绂昏亴锛岃鑱旂郴绯荤粺绠$悊鍛樹慨鏀规墍鏈変汉銆�','warning');
+ this.showToast('鎵�鏈変汉宸茬粡绂昏亴锛岃鑱旂郴绯荤粺绠$悊鍛樹慨鏀规墍鏈変汉銆�','error');
return;
}
if (result.opdIFApproved == true && result.opdApprovedNo == ''){
- this.showToast('闇�瑕佸喅瑁佹椂锛屽喅瑁佺紪鐮佷笉鑳戒负绌�','warning');
+ this.showToast('闇�瑕佸喅瑁佹椂锛屽喅瑁佺紪鐮佷笉鑳戒负绌�','error');
return;
}
if (result.opdIFApproved == true && result.opdApprovedNo != '' && result.opdStatusProcessState.indexOf(result.opdApprovedStatus)!= -1 && result.opdApprovedStatus != '鑽夌' ){
- this.showToast('宸茬敵璇峰喅瑁佷絾鍐宠鐘舵�佷笉绗﹀悎鏉′欢','warning');
+ this.showToast('宸茬敵璇峰喅瑁佷絾鍐宠鐘舵�佷笉绗﹀悎鏉′欢','error');
return;
}
var HaveValue = "{!OPDPlan__c.Rental_Apply2__c}";
-
if (result.opdRentalApply2 != '' && result.opdType != '瀛︿細') {
- this.showToast('涓�涓狾PD璁″垝鍙彲鍏宠仈鍒涘缓涓�涓鍝佺敵璇峰崟','warning');
- return;
+ this.showToast('涓�涓狾PD璁″垝鍙彲鍏宠仈鍒涘缓涓�涓鍝佺敵璇峰崟','error');
+ return;
}
if (result.opdStatus != '璁″垝涓�') {
- this.showToast('OPD璁″垝鐨勭姸鎬佷笉鏄鍒掍腑锛屼笉鑳芥柊寤哄鍝佸�熷嚭鐢宠','warning');
+ this.showToast('OPD璁″垝鐨勭姸鎬佷笉鏄鍒掍腑锛屼笉鑳芥柊寤哄鍝佸�熷嚭鐢宠','error');
return;
}
UserInfo_Owner({}).then(res=>{
+ console.log("-------UserInfo_Owner------------",res);
if(res.isFormalStuff == 'true'){
- this.showToast('璇曠敤鏈熷唴锛屼笉鑳界敵璇�','warning');
+ this.showToast('璇曠敤鏈熷唴锛屼笉鑳界敵璇�','error');
return;
}
+ console.log("-------UserInfo_Owner---1111---------",result);
if (result.opdType == '瀛︿細' && result.opdCampaignId != '') {
+ console.log("-------UserInfo_Owner---2222---------");
if (result.opdRentalApplyFlag < 7) {
- this.showToast("鐢宠鎻愪氦蹇呴』鍦�7澶╋紙鍚級浠ヤ笂鎵嶅彲浠�",'warning');
+ this.showToast("鐢宠鎻愪氦蹇呴』鍦�7澶╋紙鍚級浠ヤ笂鎵嶅彲浠�",'error');
return;
}
var ups = res.userProvince.slice(0, 2);
if (result.opdCampaignTypeId != '01210000000R26P' && res.userJobCategory == '閿�鍞湇鍔�' ) {
- this.showToast('FSE涓嶈兘鐢宠璇ュ浼氱被鍨嬪鍝�','warning');
+ this.showToast('FSE涓嶈兘鐢宠璇ュ浼氱被鍨嬪鍝�','error');
return;
} else if ((res.userJobCategory == '閿�鍞湇鍔�' || res.userJobCategory == '鏀彺') && result.opdCampaignTypeId == '01210000000R26P' && result.opdInternalinchargeprovince.indexOf(ups) == -1) {
- this.showToast("涓嶧SE鎵�鍦ㄧ渷涓�鑷达紝鎵嶅彲浣跨敤澶囧搧",'warning');
+ this.showToast("涓嶧SE鎵�鍦ㄧ渷涓�鑷达紝鎵嶅彲浣跨敤澶囧搧",'error');
return;
} else if (result.opdCampaignStatus == '宸茬粨鏉�') {
- this.showToast("宸茬粨鏉燂紝涓嶈兘鐢宠",'warning');
+ this.showToast("宸茬粨鏉燂紝涓嶈兘鐢宠",'error');
return;
} else if (result.opdCampaignStatus == '宸叉彁浜ゆ姤鍛�') {
- this.showToast("宸叉彁浜ゆ姤鍛婏紝涓嶈兘鐢宠",'warning');
+ this.showToast("宸叉彁浜ゆ姤鍛婏紝涓嶈兘鐢宠",'error');
return;
} else if (result.opdCampaignStatus == '鍙栨秷鐢宠涓�') {
- this.showToast("鍙栨秷鐢宠涓紝涓嶈兘鐢宠",'warning');
+ this.showToast("鍙栨秷鐢宠涓紝涓嶈兘鐢宠",'error');
return;
} else if (result.opdCampaignStatus == '鍙栨秷') {
- this.showToast("宸茬粡鍙栨秷锛屼笉鑳界敵璇�",'warning');
+ this.showToast("宸茬粡鍙栨秷锛屼笉鑳界敵璇�",'error');
return;
}
}
-
if (result.opdOriginalOpdPlan == '') {
- const defaultValues = null;
if (result.opdOriginalOpdPlanApplication == '') {
-
if (result.opdType == '瀛︿細' && result.opdCampaignId != '') {
// var purposeStr = '&00N10000003Msk0=浜у搧璇曠敤' +
// '&00N10000003Msk5=瀛︿細灞曚細' +
// '&CF00N10000003Mp2q_lkid={!URLENCODE(OPDPlan__c.CampaignId__c)}' +
// '&CF00N10000003Mp2q={!URLENCODE(OPDPlan__c.CampaignName__c)}';
- defaultValues = encodeDefaultFieldValues({
+ const defaultValues = encodeDefaultFieldValues({
// OPDPlan__c:this.recordId,
Demo_purpose1__c:'浜у搧璇曠敤',
demo_purpose2__c:'瀛︿細灞曚細',
@@ -118,35 +118,41 @@
Approved_State_Create__c:result.ApprovedStatus,
ApprovedNo_Create__c:result.opdApprovedNo
});
+ this.navigateEvents(defaultValues);
} else if (result.opdOpportunityId != '') {
// var purposeStr = '&00N10000003Msk0=浜у搧璇曠敤' +
// '&00N10000003Msk5=璇曠敤锛堟湁璇环锛�' +
// '&CF00N10000003O3VB_lkid={!OPDPlan__c.Related_Opportunity1_IDId__c}' +
// '&CF00N10000003O3VB={!HTMLENCODE(OPDPlan__c.Related_Opportunity1_Name__c)}';
- defaultValues = encodeDefaultFieldValues({
+ console.log("--------defaultValues------")
+ const defaultValues = encodeDefaultFieldValues({
// OPDPlan__c:this.recordId,
Demo_purpose1__c:'浜у搧璇曠敤',
demo_purpose2__c:'璇曠敤锛堟湁璇环锛�',
Follow_UP_Opp__c:result.opdRelatedOpportunity1Name,
Account__c:result.opdAccountLaboratory,
- Strategic_dept__c:result.opdOCMcategoryName,
- Hospital__c:result.opdHospitalName,
- OPDPlan__c:opdName,
- Person_In_Charge__c:res.lastName + res.firstName,
- applyUser__c:res.lastName + res.firstName,
- Loaner_received_staff__c:res.lastName + res.firstName,
- IsJump__c:result.opdIsJump,
- JumpCause__c:result.opdJumpCause,
- Name:'*',
- Approved_State_Create__c:result.ApprovedStatus,
- ApprovedNo_Create__c:result.opdApprovedNo
+ // Strategic_dept__c:result.opdOCMcategoryName,
+ // Hospital__c:result.opdHospitalName,
+ // OPDPlan__c:opdName,
+ // Person_In_Charge__c:res.lastName + res.firstName,
+ // applyUser__c:res.lastName + res.firstName,
+ // Loaner_received_staff__c:res.lastName + res.firstName,
+ // IsJump__c:result.opdIsJump,
+ // JumpCause__c:result.opdJumpCause,
+ // Name:'*',
+ // Approved_State_Create__c:result.ApprovedStatus,
+ // ApprovedNo_Create__c:result.opdApprovedNo
});
+ console.log("--------defaultValues---1111---",defaultValues);
+
+ this.navigateEvents(defaultValues);
} else {
+ console.log("-------UserInfo_Owner---77777---------");
// var purposeStr = '&00N10000003Msk0=浜у搧璇曠敤' +
// '&00N10000003Msk5=璇曠敤锛堟棤璇环锛�' +
// '&00N100000098amW={!OPDPlan__c.NoOpp_Reason__c}';
- defaultValues = encodeDefaultFieldValues({
+ const defaultValues = encodeDefaultFieldValues({
// OPDPlan__c:this.recordId,
Demo_purpose1__c:'浜у搧璇曠敤',
demo_purpose2__c:'璇曠敤锛堟湁璇环锛�',
@@ -165,6 +171,7 @@
Approved_State_Create__c:result.ApprovedStatus,
ApprovedNo_Create__c:result.opdApprovedNo
});
+ this.navigateEvents(defaultValues);
}
// var urlStr = '&CF00N10000003Mp2R={!HTMLENCODE(OPDPlan__c.Account_Laboratory__c)}' +
@@ -181,20 +188,9 @@
// '&00N10000009HBWg= {!OPDPlan__c.Approved_Status__c} ' +
// '&00N10000009HBXK= {!OPDPlan__c.Approved_No__c} '; //// 20220211 sx add 澶囧搧鍊熷嚭鐢宠-鍐宠鎺у埗 No.2
// window.open('/a0t/e?retURL=%2F{!OPDPlan__c.Id}' + purposeStr + urlStr );
-
- this[NavigationMixin.Navigate]({
- type: 'standard__objectPage',
- attributes: {
- objectApiName: 'Rental_Apply__c',
- actionName: 'new'
- },
- state:{
- defaultFieldValues: this.defaultValues,
-
- }
- })
+
} else {
- defaultValues = encodeDefaultFieldValues({
+ const defaultValues = encodeDefaultFieldValues({
// OPDPlan__c:this.recordId,
Cancel_Reason__c:'',
Loaner_cancel_reason__c:'',
@@ -211,24 +207,14 @@
Old_Rental_Apply__c:'',
Split_Apply_Reason__c:''
});
-
- this[NavigationMixin.Navigate]({
- type: 'standard__objectPage',
- attributes: {
- objectApiName: 'Rental_Apply__c',
- actionName: 'new'
- },
- state:{
- defaultFieldValues: this.defaultValues,
-
- }
- })
+ this.navigateEvents(defaultValues);
// var url = "/{!OPDPlan__c.originalOpdRentalApply__c}/e?newclone=1&retURL=%2F{!OPDPlan__c.originalOpdRentalApply__c}&common.udd.actions.ActionsUtilORIG_URI=%2F{!OPDPlan__c.RentalApplyId__c}%2Fe&cloneli=1&00N10000007MNF8=&00N100000098uKJ=&00N10000004oFTC=&00N10000003O1JF=&00N10000003O1JK=&00N10000006pvpZ=&00N10000003O1JU=&00N10000006gY9x=&00N10000003Mp2H=鑽夋涓�&CF00N10000009EKKp_lkid={!OPDPlan__c.RentalApplyId__c}&CF00N10000009EKKp={!OPDPlan__c.RentalApplyName__c}&CF00N10000008ps61={!OPDPlan__c.Name}&CF00N10000008ps61_lkid={!OPDPlan__c.Id}&CF00N10000008poFM=&CF00N10000008poFM_lkid=&CF00N10000005HzRq=&CF00N10000005HzRq_lkid=&00N10000007oQKh=";
// window.open(url);
}
}else {
- defaultValues = encodeDefaultFieldValues({
+ console.log("-------UserInfo_Owner---00000--else-------");
+ const defaultValues = encodeDefaultFieldValues({
// OPDPlan__c:this.recordId,
Cancel_Reason__c:'',
Loaner_cancel_reason__c:'',
@@ -244,18 +230,9 @@
Old_Rental_Apply__c:'',
Split_Apply_Reason__c:''
});
+ console.log("-------UserInfo_Owner---00000--else-------" + defaultValues);
- this[NavigationMixin.Navigate]({
- type: 'standard__objectPage',
- attributes: {
- objectApiName: 'Rental_Apply__c',
- actionName: 'new'
- },
- state:{
- defaultFieldValues: this.defaultValues,
-
- }
- })
+ this.navigateEvents(defaultValues);
// var url = "/{!OPDPlan__c.RentalApplyId__c}/e?newclone=1&retURL=%2F{!OPDPlan__c.RentalApplyId__c}&common.udd.actions.ActionsUtilORIG_URI=%2F{!OPDPlan__c.RentalApplyId__c}%2Fe&cloneli=1&00N10000007MNF8=&00N100000098uKJ=&00N10000004oFTC=&00N10000003Ntz7=&00N10000008rG1M=&00N10000005HzRw=&00N10000003Mp2H=鑽夋涓�&CF00N10000009EKKp_lkid={!OPDPlan__c.RentalApplyId__c}&CF00N10000009EKKp={!OPDPlan__c.RentalApplyName__c}&CF00N10000008ps61={!OPDPlan__c.Name}&CF00N10000008ps61_lkid={!OPDPlan__c.Id}&CF00N10000008poFM=&CF00N10000008poFM_lkid=&CF00N10000005HzRq=&CF00N10000005HzRq_lkid=&00N10000007oQKh=";
// window.open(url);
@@ -273,10 +250,26 @@
showToast(message, type) {
const evt = new ShowToastEvent({
- title: '',
+ title: 'Error',
message: message,
variant: type
});
this.dispatchEvent(evt);
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+
+ navigateEvents(defaultValues){
+ console.log("--------navigateEvents------",defaultValues)
+ this[NavigationMixin.Navigate]({
+ type: 'standard__objectPage',
+ attributes: {
+ objectApiName: 'Rental_Apply__c',
+ actionName: 'new'
+ },
+ state:{
+ defaultFieldValues: defaultValues
+
+ }
+ })
}
}
\ No newline at end of file
--
Gitblit v1.9.1