From ca743be68ec263a6d9d6c70410f894ed2bb1d293 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@prec-tech.com>
Date: 星期一, 31 七月 2023 15:29:03 +0800
Subject: [PATCH] 耗材申请按钮
---
force-app/main/default/lwc/lexConsumApply_FromOPDPlan/lexConsumApply_FromOPDPlan.js | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/force-app/main/default/lwc/lexConsumApply_FromOPDPlan/lexConsumApply_FromOPDPlan.js b/force-app/main/default/lwc/lexConsumApply_FromOPDPlan/lexConsumApply_FromOPDPlan.js
index 7e07b03..8966bf5 100644
--- a/force-app/main/default/lwc/lexConsumApply_FromOPDPlan/lexConsumApply_FromOPDPlan.js
+++ b/force-app/main/default/lwc/lexConsumApply_FromOPDPlan/lexConsumApply_FromOPDPlan.js
@@ -7,7 +7,8 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
-export default class LexConsumApply_FromOPDPlan extends LightningElement {
+// 鏂板缓鑰楁潗鐢宠(OPD璁″垝)
+export default class LexConsumApply_FromOPDPlan extends NavigationMixin(LightningElement) {
@api recordId;
IsLoading = true;
@@ -33,8 +34,9 @@
recordId: this.recordId
}).then(result=>{
UserInfo_Owner({}).then(res=>{
- if(res.isFormalStuff == 'true'){
- this.showToast('璇曠敤鏈熷唴锛屼笉鑳界敵璇�','warning');
+ console.log("-----UserInfo_Owner--",res)
+ if(res.isFormalStuff){
+ this.showToast('璇曠敤鏈熷唴锛屼笉鑳界敵璇�','error');
return;
}else{
@@ -57,10 +59,10 @@
Account__c:result.accountLab,
Name:'*',
demo_purpose2__c:'OPD璇曠敤',
- Person_In_Charge__c:res.lastName + res.firstName,
- applyUser__c:res.lastName + res.firstName
+ Person_In_Charge__c:res.id,
+ applyUser__c:res.id
});
-
+ console.log("defaultValues====> ",defaultValues);
this[NavigationMixin.Navigate]({
type: 'standard__objectPage',
attributes: {
@@ -68,19 +70,18 @@
actionName: 'new'
},
state:{
- defaultFieldValues: this.defaultValues
+ defaultFieldValues: defaultValues
}
- })
+ });
}
})
.catch(error => {
- console.log("error");
- console.log(error);
+ console.log("error ---> ",error);
})
})
.catch(error => {
- console.log("error");
+ console.log("error----");
console.log(error);
}).finally(() => {
this.dispatchEvent(new CloseActionScreenEvent());
@@ -94,6 +95,7 @@
variant: type
});
this.dispatchEvent(evt);
+ this.dispatchEvent(new CloseActionScreenEvent());
}
}
\ No newline at end of file
--
Gitblit v1.9.1