From ddb0231ef7c5cf2bad9d3f1afc2f733674ad38a5 Mon Sep 17 00:00:00 2001
From: unknown <sunxia@prec-tech.com>
Date: 星期四, 24 八月 2023 14:50:51 +0800
Subject: [PATCH] 再修理按钮
---
force-app/main/default/lwc/lexOSHAccept/lexOSHAccept.js | 80 +++++++
force-app/main/default/lwc/lexnewMBC/lexnewMBC.html | 3
force-app/main/default/lwc/lexRCconfirm/lexRCconfirm.html | 3
force-app/main/default/lwc/lexOSHAccept/lexOSHAccept.html | 3
force-app/main/default/lwc/lexOSHFollowEnd/lexOSHFollowEnd.html | 3
force-app/main/default/lwc/lexOCSMFollowEnd/lexOCSMFollowEnd.js-meta.xml | 11 +
force-app/main/default/lwc/lexPDFRepairAgainOCSM/lexPDFRepairAgainOCSM.html | 3
force-app/main/default/lwc/lexPDFRepairAgainRC/lexPDFRepairAgainRC.js | 33 +++
force-app/main/default/lwc/lexRCconfirm/lexRCconfirm.js-meta.xml | 11 +
force-app/main/default/lwc/lexnewMBC/lexnewMBC.js | 55 +++++
force-app/main/default/lwc/lexPDFRepairAgainRC/lexPDFRepairAgainRC.html | 3
force-app/main/default/lwc/lexPDFRepairAgainOSH/lexPDFRepairAgainOSH.html | 3
force-app/main/default/lwc/lexPDFRepairAgainOCSM/lexPDFRepairAgainOCSM.js | 36 +++
force-app/main/default/lwc/lexPDFRepairAgainOCSM/lexPDFRepairAgainOCSM.js-meta.xml | 11 +
force-app/main/default/lwc/lexOSHFollowEnd/lexOSHFollowEnd.js-meta.xml | 11 +
force-app/main/default/lwc/lexPDFRepairAgainOSH/lexPDFRepairAgainOSH.js-meta.xml | 11 +
force-app/main/default/lwc/lexnewMBC/lexnewMBC.js-meta.xml | 11 +
force-app/main/default/lwc/lexOCSMFollowEnd/lexOCSMFollowEnd.html | 3
force-app/main/default/lwc/lexOSHAccept/lexOSHAccept.js-meta.xml | 11 +
force-app/main/default/lwc/lexOSHFollowEnd/lexOSHFollowEnd.js | 112 ++++++++++
force-app/main/default/lwc/lexPDFRepairAgainOSH/lexPDFRepairAgainOSH.js | 34 +++
force-app/main/default/lwc/lexOCSMFollowEnd/lexOCSMFollowEnd.js | 84 +++++++
force-app/main/default/lwc/lexRCconfirm/lexRCconfirm.js | 78 +++++++
force-app/main/default/lwc/lexPDFRepairAgainRC/lexPDFRepairAgainRC.js-meta.xml | 11 +
24 files changed, 624 insertions(+), 0 deletions(-)
diff --git a/force-app/main/default/lwc/lexOCSMFollowEnd/lexOCSMFollowEnd.html b/force-app/main/default/lwc/lexOCSMFollowEnd/lexOCSMFollowEnd.html
new file mode 100644
index 0000000..af9fa97
--- /dev/null
+++ b/force-app/main/default/lwc/lexOCSMFollowEnd/lexOCSMFollowEnd.html
@@ -0,0 +1,3 @@
+<template>
+
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOCSMFollowEnd/lexOCSMFollowEnd.js b/force-app/main/default/lwc/lexOCSMFollowEnd/lexOCSMFollowEnd.js
new file mode 100644
index 0000000..a1f6159
--- /dev/null
+++ b/force-app/main/default/lwc/lexOCSMFollowEnd/lexOCSMFollowEnd.js
@@ -0,0 +1,84 @@
+import { LightningElement, track, wire, api } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { updateRecord } from 'lightning/uiRecordApi';
+import init from '@salesforce/apex/lexRepairAgainAnController.init';
+import updateStatus from '@salesforce/apex/lexRepairAgainAnController.updateStatus';
+
+export default class lexOCSMFollowEnd extends LightningElement {
+ @api recordId;
+ IsLoading = true;
+
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+
+ if (currentPageReference) {
+ const urlValue = currentPageReference.state.recordId;
+ if (urlValue) {
+ let str = `${urlValue}`;
+ console.log("str");
+ console.log(str);
+ this.recordId = str;
+ }
+ }
+ }
+
+ connectedCallback () {
+ init({
+ recordId: this.recordId
+ }).then(res=>{
+ if(res){
+ console.log('res==='+ JSON.stringify(res));
+ this.IsLoading = false;
+ console.log(res);
+ if(res.repairAgainStatus == '鍙栨秷'){
+ this.showToast('鍙栨秷鍚庣殑鍐嶄慨鐞嗚繑鍝佸垎鏋愪笉鍏佽鍐嶆彁浜わ紝濡傛灉闇�瑕佹彁浜よ鐐瑰嚮\"澶嶅埗\"鎸夐挳閲嶆柊鐢熸垚涓�涓啀淇悊杩斿搧鍒嗘瀽','warning');
+ return;
+ }
+ if(res.repairAgainStatus != 'OSH濉啓瀹屾瘯'){
+ this.showToast('宸茬粡鎻愪氦','warning');
+ return;
+ }
+ if(res.actionOCM == '' || res.technicalResponsibility == '' || res.oCMConfirmer == ''||res.actionOCM == null || res.technicalResponsibility == null || res.oCMConfirmer == null){
+ this.showToast('銆愬鎴峰搴旓紙OCSM锛夈�戞垨銆愭妧鏈媴褰撱�戞垨銆怬CSM纭鑰呫�戜负绌烘椂涓嶈兘鎻愪氦鐢宠','warning');
+ return;
+ }
+
+ updateStatus({
+ recordId: this.recordId,
+ updateStatus: '宸叉彁浜�'
+ }).then(res=>{
+ if(res == 'SUCCESS'){
+ this.showToast('鎻愪氦鎴愬姛','success');
+ return;
+ }else if(res == 'ERROR'){
+ this.showToast('鎻愪氦澶辫触','error');
+ return;
+ }
+ }).catch(err=>{
+ console.log('updateStatus===='+err);
+ })
+ }else{
+ this.showToast('鏈煡鍒版暟鎹�','warning');
+ }
+ })
+ }
+
+ showToast(msg,type) {
+ const event = new ShowToastEvent({
+ message: msg,
+ variant: type
+ });
+ if(type == 'success'){
+ this.updateRecordView(this.recordId);
+ }
+ this.dispatchEvent(event);
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+
+ updateRecordView(recordId) {
+ updateRecord({fields: { Id: recordId }});
+ }
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOCSMFollowEnd/lexOCSMFollowEnd.js-meta.xml b/force-app/main/default/lwc/lexOCSMFollowEnd/lexOCSMFollowEnd.js-meta.xml
new file mode 100644
index 0000000..7ab105e
--- /dev/null
+++ b/force-app/main/default/lwc/lexOCSMFollowEnd/lexOCSMFollowEnd.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexOCSMFollowEnd">
+ <apiVersion>54.0</apiVersion>
+ <isExposed>true</isExposed>
+ <targets>
+ <target>lightning__RecordPage</target>
+ <target>lightning__AppPage</target>
+ <target>lightning__HomePage</target>
+ <target>lightning__RecordAction</target>
+ </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOSHAccept/lexOSHAccept.html b/force-app/main/default/lwc/lexOSHAccept/lexOSHAccept.html
new file mode 100644
index 0000000..af9fa97
--- /dev/null
+++ b/force-app/main/default/lwc/lexOSHAccept/lexOSHAccept.html
@@ -0,0 +1,3 @@
+<template>
+
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOSHAccept/lexOSHAccept.js b/force-app/main/default/lwc/lexOSHAccept/lexOSHAccept.js
new file mode 100644
index 0000000..2f1418d
--- /dev/null
+++ b/force-app/main/default/lwc/lexOSHAccept/lexOSHAccept.js
@@ -0,0 +1,80 @@
+import { LightningElement, track, wire, api } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { updateRecord } from 'lightning/uiRecordApi';
+
+import init from '@salesforce/apex/lexRepairAgainAnController.init';
+import updateRepairAgainStatus from '@salesforce/apex/lexRepairAgainAnController.updateRepairAgainStatus';
+//鍝佷繚鍙楃悊
+export default class lexOSHAccept extends LightningElement {
+ @api recordId;
+ IsLoading = true;
+
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+
+ if (currentPageReference) {
+ const urlValue = currentPageReference.state.recordId;
+ if (urlValue) {
+ let str = `${urlValue}`;
+ console.log("str");
+ console.log(str);
+ this.recordId = str;
+ }
+ }
+ }
+
+ connectedCallback () {
+ init({
+ recordId: this.recordId
+ }).then(res=>{
+ if(res){
+ console.log(res);
+ this.IsLoading = false;
+ if(res.repairAgainStatus == '鍙栨秷'){
+ this.showToast('鍙栨秷鍚庣殑鍐嶄慨鐞嗚繑鍝佸垎鏋愪笉鍏佽鍐嶆彁浜わ紝濡傛灉闇�瑕佹彁浜よ鐐瑰嚮\"澶嶅埗\"鎸夐挳閲嶆柊鐢熸垚涓�涓啀淇悊杩斿搧鍒嗘瀽','warning');
+ return;
+ }
+ if(res.repairAgainStatus != 'RC濉啓瀹屾瘯'){
+ this.showToast('宸茬粡鎻愪氦','warning');
+ return;
+ }
+
+ updateRepairAgainStatus({
+ recordId: this.recordId,
+ updateStatus: 'OSH鍙楃悊'
+ }).then(result=>{
+ if(result == 'SUCCESS'){
+ this.showToast('鎻愪氦鎴愬姛','success');
+ return;
+ }else if(result == 'ERROR'){
+ this.showToast('鎻愪氦澶辫触','error');
+ return;
+ }
+ }).catch(err=>{
+ console.log('updateStatus===='+err);
+ })
+ }else{
+ this.showToast('鏈煡鍒版暟鎹�','warning');
+ }
+ })
+ }
+
+
+ showToast(msg,type) {
+ const event = new ShowToastEvent({
+ message: msg,
+ variant: type
+ });
+ if(type == 'success'){
+ this.updateRecordView(this.recordId);
+ }
+ this.dispatchEvent(event);
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+
+ updateRecordView(recordId) {
+ updateRecord({fields: { Id: recordId }});
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOSHAccept/lexOSHAccept.js-meta.xml b/force-app/main/default/lwc/lexOSHAccept/lexOSHAccept.js-meta.xml
new file mode 100644
index 0000000..ee89ac8
--- /dev/null
+++ b/force-app/main/default/lwc/lexOSHAccept/lexOSHAccept.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexOSHAccept">
+ <apiVersion>54.0</apiVersion>
+ <isExposed>true</isExposed>
+ <targets>
+ <target>lightning__RecordPage</target>
+ <target>lightning__AppPage</target>
+ <target>lightning__HomePage</target>
+ <target>lightning__RecordAction</target>
+ </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOSHFollowEnd/lexOSHFollowEnd.html b/force-app/main/default/lwc/lexOSHFollowEnd/lexOSHFollowEnd.html
new file mode 100644
index 0000000..af9fa97
--- /dev/null
+++ b/force-app/main/default/lwc/lexOSHFollowEnd/lexOSHFollowEnd.html
@@ -0,0 +1,3 @@
+<template>
+
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOSHFollowEnd/lexOSHFollowEnd.js b/force-app/main/default/lwc/lexOSHFollowEnd/lexOSHFollowEnd.js
new file mode 100644
index 0000000..2953e79
--- /dev/null
+++ b/force-app/main/default/lwc/lexOSHFollowEnd/lexOSHFollowEnd.js
@@ -0,0 +1,112 @@
+import { LightningElement, track, wire, api } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { updateRecord } from 'lightning/uiRecordApi';
+
+import init from '@salesforce/apex/lexRepairAgainAnController.init';
+import updateRepairAgainAnApproveStatus from '@salesforce/apex/lexRepairAgainAnController.updateRepairAgainAnApproveStatus';
+import updateRepairAgainAnApproveStatus2 from '@salesforce/apex/lexRepairAgainAnController.updateRepairAgainAnApproveStatus2';
+//鍝佷繚鎻愪氦瀹℃壒
+export default class lexOSHFollowEnd extends LightningElement {
+ @api recordId;
+ IsLoading = true;
+
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+ if (currentPageReference) {
+ const urlValue = currentPageReference.state.recordId;
+ if (urlValue) {
+ let str = `${urlValue}`;
+ console.log("str");
+ console.log(str);
+ this.recordId = str;
+ }
+ }
+ }
+
+ connectedCallback () {
+ init({
+ recordId: this.recordId
+ }).then(res=>{
+ if(res){
+ console.log('res==='+ JSON.stringify(res));
+ this.IsLoading = false;
+ // if(res.RepairAgain_Status__c == '鍙栨秷'){
+ if(res.repairAgainStatus == '鍙栨秷'){
+ this.showToast('鍙栨秷鍚庣殑鍐嶄慨鐞嗚繑鍝佸垎鏋愪笉鍏佽鍐嶆彁浜わ紝濡傛灉闇�瑕佹彁浜よ鐐瑰嚮\"澶嶅埗\"鎸夐挳閲嶆柊鐢熸垚涓�涓啀淇悊杩斿搧鍒嗘瀽','warning');
+ return;
+ }
+ if(res.repairAgainStatus != 'OSH鍙楃悊'){
+ this.showToast('璇峰厛杩涜OSH鍙楃悊!');
+ return;
+ }
+
+ console.log('res.repairAgainAnApproveStatus==='+res.repairAgainAnApproveStatus);
+ //涓�娆″鎵�
+ if(res.repairAgainAnApproveStatus == '' || res.repairAgainAnApproveStatus === undefined || res.repairAgainAnApproveStatus != '鎵瑰噯'){
+ if(res.judgementOSH == '' || res.judgementOSH == undefined || res.analysisOSH == '' || res.analysisOSH == undefined || res.analysisReasonOSH == '' || res.analysisReasonOSH == undefined || res.actionOSH == '' || res.actionOSH == undefined){
+ this.showToast('銆愮粨璁猴紙OSH锛夈�戞垨銆愭妧鏈娴嬪垎鏋愶紙OSH鍖荤枟鍝佽川淇濋殰閮ㄥ~鍐欙級銆戞垨銆愭妧鏈娴嬪垎鏋愬師鍥犮�戞垨銆愭妧鏈搴斻�戜负绌烘椂涓嶈兘鎻愪氦鐢宠','warning');
+ return;
+ }
+
+ updateRepairAgainAnApproveStatus({
+ recordId: this.recordId,
+ updateStatus:'宸叉彁浜�'
+ }).then(result=>{
+ if(result == 'SUCCESS'){
+ this.showToast('鎻愪氦鎴愬姛','success');
+ return;
+ }
+ if(result == 'ERROR'){
+ this.showToast('鎻愪氦澶辫触','error');
+ return;
+ }
+ }).catch(error=>{
+ console.log('updateRepairAgainAnApproveStatus'+error);
+ })
+ }
+
+ //浜屾瀹℃壒
+ if(res.repairAgainAnApproveStatus == '鎵瑰噯'){
+ if(res.judgementOSH2 == '' || res.analysisOSH2 == '' || res.analysisReasonOSH2 == '' || res.actionOSH2 == ''){
+ this.showToast('銆愮粨璁猴紙OSH锛�(浜屾)銆戞垨銆愭妧鏈娴嬪垎鏋愶紙OSH鍖荤枟鍝佽川淇濋殰閮ㄥ~鍐欙級(浜屾锛�)銆戞垨銆愭妧鏈娴嬪垎鏋愬師鍥�(浜屾)銆戞垨銆愭妧鏈搴�(浜屾)銆戜负绌烘椂涓嶈兘鎻愪氦鐢宠','warning');
+ return;
+ }
+
+ updateRepairAgainAnApproveStatus2({
+ recordId: this.recordId,
+ judgementOSH2: res.judgementOSH2,
+ }).then(result=>{
+ if(result == 'SUCCESS'){
+ this.showToast('鎻愪氦鎴愬姛','success');
+ return;
+ }
+ if(result == 'ERROR'){
+ this.showToast('鎻愪氦澶辫触','error');
+ return;
+ }
+ })
+ }
+ }else{
+ this.showToast('鏈煡鍒版暟鎹�','warning');
+ }
+ })
+ }
+
+ showToast(msg,type) {
+ const event = new ShowToastEvent({
+ message: msg,
+ variant: type
+ });
+ if(type == 'success'){
+ this.updateRecordView(this.recordId);
+ }
+ this.dispatchEvent(event);
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+
+ updateRecordView(recordId) {
+ updateRecord({fields: { Id: recordId }});
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOSHFollowEnd/lexOSHFollowEnd.js-meta.xml b/force-app/main/default/lwc/lexOSHFollowEnd/lexOSHFollowEnd.js-meta.xml
new file mode 100644
index 0000000..82d7f8b
--- /dev/null
+++ b/force-app/main/default/lwc/lexOSHFollowEnd/lexOSHFollowEnd.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexOSHFollowEnd">
+ <apiVersion>54.0</apiVersion>
+ <isExposed>true</isExposed>
+ <targets>
+ <target>lightning__RecordPage</target>
+ <target>lightning__AppPage</target>
+ <target>lightning__HomePage</target>
+ <target>lightning__RecordAction</target>
+ </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexPDFRepairAgainOCSM/lexPDFRepairAgainOCSM.html b/force-app/main/default/lwc/lexPDFRepairAgainOCSM/lexPDFRepairAgainOCSM.html
new file mode 100644
index 0000000..af9fa97
--- /dev/null
+++ b/force-app/main/default/lwc/lexPDFRepairAgainOCSM/lexPDFRepairAgainOCSM.html
@@ -0,0 +1,3 @@
+<template>
+
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexPDFRepairAgainOCSM/lexPDFRepairAgainOCSM.js b/force-app/main/default/lwc/lexPDFRepairAgainOCSM/lexPDFRepairAgainOCSM.js
new file mode 100644
index 0000000..15f0015
--- /dev/null
+++ b/force-app/main/default/lwc/lexPDFRepairAgainOCSM/lexPDFRepairAgainOCSM.js
@@ -0,0 +1,36 @@
+import { LightningElement, track, wire, api } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+export default class lexPDFRepairAgainOCSM extends LightningElement {
+ @api recordId;
+ IsLoading = true;
+
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+
+ if (currentPageReference) {
+ const urlValue = currentPageReference.state.recordId;
+ if (urlValue) {
+ let str = `${urlValue}`;
+ console.log("str");
+ console.log(str);
+ this.recordId = str;
+ }
+ }
+ }
+
+ connectedCallback () {
+
+ console.log("ggg333");
+
+ this.openPDF().then(res=>{
+ this.IsLoading = false;
+ this.dispatchEvent(new CloseActionScreenEvent());
+ })
+ }
+ async openPDF(){
+ window.open('/apex/RepairAgainAnPDF?id='+ this.recordId +'&status=3', 'RepairAgainAnPDF');
+ }
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexPDFRepairAgainOCSM/lexPDFRepairAgainOCSM.js-meta.xml b/force-app/main/default/lwc/lexPDFRepairAgainOCSM/lexPDFRepairAgainOCSM.js-meta.xml
new file mode 100644
index 0000000..b5e9f13
--- /dev/null
+++ b/force-app/main/default/lwc/lexPDFRepairAgainOCSM/lexPDFRepairAgainOCSM.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexPDFRepairAgainOCSM">
+ <apiVersion>54.0</apiVersion>
+ <isExposed>true</isExposed>
+ <targets>
+ <target>lightning__RecordPage</target>
+ <target>lightning__AppPage</target>
+ <target>lightning__HomePage</target>
+ <target>lightning__RecordAction</target>
+ </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexPDFRepairAgainOSH/lexPDFRepairAgainOSH.html b/force-app/main/default/lwc/lexPDFRepairAgainOSH/lexPDFRepairAgainOSH.html
new file mode 100644
index 0000000..af9fa97
--- /dev/null
+++ b/force-app/main/default/lwc/lexPDFRepairAgainOSH/lexPDFRepairAgainOSH.html
@@ -0,0 +1,3 @@
+<template>
+
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexPDFRepairAgainOSH/lexPDFRepairAgainOSH.js b/force-app/main/default/lwc/lexPDFRepairAgainOSH/lexPDFRepairAgainOSH.js
new file mode 100644
index 0000000..4bce1d1
--- /dev/null
+++ b/force-app/main/default/lwc/lexPDFRepairAgainOSH/lexPDFRepairAgainOSH.js
@@ -0,0 +1,34 @@
+import { LightningElement, track, wire, api } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+
+export default class lexPDFRepairAgainOSH extends LightningElement {
+ @api recordId;
+ IsLoading = true;
+
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+
+ if (currentPageReference) {
+ const urlValue = currentPageReference.state.recordId;
+ if (urlValue) {
+ let str = `${urlValue}`;
+ console.log("str");
+ console.log(str);
+ this.recordId = str;
+ }
+ }
+ }
+
+ connectedCallback () {
+ console.log("ggg222");
+ this.openPDF().then(res=>{
+ this.IsLoading = false;
+ this.dispatchEvent(new CloseActionScreenEvent());
+ })
+ }
+
+ async openPDF(){
+ window.open('/apex/RepairAgainAnPDF?id='+ this.recordId +'&status=2', 'RepairAgainAnPDF');
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexPDFRepairAgainOSH/lexPDFRepairAgainOSH.js-meta.xml b/force-app/main/default/lwc/lexPDFRepairAgainOSH/lexPDFRepairAgainOSH.js-meta.xml
new file mode 100644
index 0000000..235feea
--- /dev/null
+++ b/force-app/main/default/lwc/lexPDFRepairAgainOSH/lexPDFRepairAgainOSH.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexPDFRepairAgainOSH">
+ <apiVersion>54.0</apiVersion>
+ <isExposed>true</isExposed>
+ <targets>
+ <target>lightning__RecordPage</target>
+ <target>lightning__AppPage</target>
+ <target>lightning__HomePage</target>
+ <target>lightning__RecordAction</target>
+ </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexPDFRepairAgainRC/lexPDFRepairAgainRC.html b/force-app/main/default/lwc/lexPDFRepairAgainRC/lexPDFRepairAgainRC.html
new file mode 100644
index 0000000..af9fa97
--- /dev/null
+++ b/force-app/main/default/lwc/lexPDFRepairAgainRC/lexPDFRepairAgainRC.html
@@ -0,0 +1,3 @@
+<template>
+
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexPDFRepairAgainRC/lexPDFRepairAgainRC.js b/force-app/main/default/lwc/lexPDFRepairAgainRC/lexPDFRepairAgainRC.js
new file mode 100644
index 0000000..f7a98ea
--- /dev/null
+++ b/force-app/main/default/lwc/lexPDFRepairAgainRC/lexPDFRepairAgainRC.js
@@ -0,0 +1,33 @@
+import { LightningElement, track, wire, api } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+
+export default class lexPDFRepairAgainRC extends LightningElement {
+ @api recordId;
+ IsLoading = true;
+
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+
+ if (currentPageReference) {
+ const urlValue = currentPageReference.state.recordId;
+ if (urlValue) {
+ let str = `${urlValue}`;
+ console.log("str");
+ console.log(str);
+ this.recordId = str;
+ }
+ }
+ }
+
+ connectedCallback () {
+ console.log("ggg111");
+ this.openPDF().then(res=>{
+ this.IsLoading = false;
+ this.dispatchEvent(new CloseActionScreenEvent());
+ })
+ }
+ async openPDF(){
+ window.open('/apex/RepairAgainAnPDF?id='+ this.recordId +'&status=1', 'RepairAgainAnPDF');
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexPDFRepairAgainRC/lexPDFRepairAgainRC.js-meta.xml b/force-app/main/default/lwc/lexPDFRepairAgainRC/lexPDFRepairAgainRC.js-meta.xml
new file mode 100644
index 0000000..44cfd55
--- /dev/null
+++ b/force-app/main/default/lwc/lexPDFRepairAgainRC/lexPDFRepairAgainRC.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexPDFRepairAgainRC">
+ <apiVersion>54.0</apiVersion>
+ <isExposed>true</isExposed>
+ <targets>
+ <target>lightning__RecordPage</target>
+ <target>lightning__AppPage</target>
+ <target>lightning__HomePage</target>
+ <target>lightning__RecordAction</target>
+ </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRCconfirm/lexRCconfirm.html b/force-app/main/default/lwc/lexRCconfirm/lexRCconfirm.html
new file mode 100644
index 0000000..af9fa97
--- /dev/null
+++ b/force-app/main/default/lwc/lexRCconfirm/lexRCconfirm.html
@@ -0,0 +1,3 @@
+<template>
+
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRCconfirm/lexRCconfirm.js b/force-app/main/default/lwc/lexRCconfirm/lexRCconfirm.js
new file mode 100644
index 0000000..cef55b3
--- /dev/null
+++ b/force-app/main/default/lwc/lexRCconfirm/lexRCconfirm.js
@@ -0,0 +1,78 @@
+import { LightningElement, track, wire, api } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { updateRecord } from 'lightning/uiRecordApi';
+import LightningConfirm from 'lightning/confirm';
+import updateRepairAgainStatus from '@salesforce/apex/lexRepairAgainAnController.updateRepairAgainStatus';
+//RC纭
+export default class lexRCconfirm extends LightningElement {
+ @api recordId;
+ IsLoading = true;
+
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+
+ if (currentPageReference) {
+ try{
+ const urlValue = currentPageReference.state.recordId;
+ if (urlValue) {
+ let str = `${urlValue}`;
+ console.log("str2");
+ console.log(str);
+ this.recordId = str;
+ console.log("dd");
+ }
+ }catch(e){
+ console.log(e);
+ }
+
+ }
+ }
+
+ connectedCallback () {
+ this.IsLoading = false;
+ LightningConfirm.open({
+ message: "RC纭鍚庢棤娉曟挙鍥烇紝鏄惁纭锛�",
+ variant: 'headerless',
+ label: '鎻愮ず淇℃伅',
+ // setting theme would have no effect
+ }).then(submit=>{
+ console.log("ttt:"+submit);
+ if(!submit){
+ this.dispatchEvent(new CloseActionScreenEvent());
+ return;
+ }else{
+ updateRepairAgainStatus({
+ recordId: this.recordId,
+ updateStatus: 'OSH濉啓瀹屾瘯'
+ }).then(res=>{
+ if(res == 'SUCCESS'){
+ this.showToast('鎻愪氦鎴愬姛','success');
+ return;
+ }
+ if(res == 'ERROR'){
+ this.showToast('鎻愪氦澶辫触','error');
+ return;
+ }
+ })
+ }
+ })
+ }
+
+ showToast(msg,type) {
+ const event = new ShowToastEvent({
+ message: msg,
+ variant: type
+ });
+ if(type == 'success'){
+ this.updateRecordView(this.recordId);
+ }
+ this.dispatchEvent(event);
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+
+ updateRecordView(recordId) {
+ updateRecord({fields: { Id: recordId }});
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRCconfirm/lexRCconfirm.js-meta.xml b/force-app/main/default/lwc/lexRCconfirm/lexRCconfirm.js-meta.xml
new file mode 100644
index 0000000..5274762
--- /dev/null
+++ b/force-app/main/default/lwc/lexRCconfirm/lexRCconfirm.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexRCconfirm">
+ <apiVersion>54.0</apiVersion>
+ <isExposed>true</isExposed>
+ <targets>
+ <target>lightning__RecordPage</target>
+ <target>lightning__AppPage</target>
+ <target>lightning__HomePage</target>
+ <target>lightning__RecordAction</target>
+ </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexnewMBC/lexnewMBC.html b/force-app/main/default/lwc/lexnewMBC/lexnewMBC.html
new file mode 100644
index 0000000..af9fa97
--- /dev/null
+++ b/force-app/main/default/lwc/lexnewMBC/lexnewMBC.html
@@ -0,0 +1,3 @@
+<template>
+
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexnewMBC/lexnewMBC.js b/force-app/main/default/lwc/lexnewMBC/lexnewMBC.js
new file mode 100644
index 0000000..5c59904
--- /dev/null
+++ b/force-app/main/default/lwc/lexnewMBC/lexnewMBC.js
@@ -0,0 +1,55 @@
+import { LightningElement, track, wire, api } from 'lwc';
+import { CurrentPageReference } from 'lightning/navigation';
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { CloseActionScreenEvent } from 'lightning/actions';
+
+import init from '@salesforce/apex/lexRepairAgainAnController.init';
+export default class lexnewMBC extends NavigationMixin(LightningElement) {
+ @api recordId;
+
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+ if (currentPageReference) {
+ const urlValue = currentPageReference.state.recordId;
+ if (urlValue) {
+ let str = `${urlValue}`;
+ this.recordId = str;
+ }
+ }
+ }
+
+ connectedCallback(){
+ init({
+ recordId: this.recordId
+ }).then(res=>{
+ if(res){
+ this.showNewObject(res.repairAgainAnName);
+ }
+ })
+ }
+
+ showNewObject(name){
+ console.log('showNewObject==');
+ const defaultFieldValues = encodeDefaultFieldValues({
+ Name: '*',
+ RepairAgainAn_request_name__c: this.recordId,
+ RepairAgainAn_M_BC_management_code__c: name
+ });
+
+ this[NavigationMixin.Navigate]({
+ type: 'standard__objectPage',
+ attributes: {
+ objectApiName: 'RepairAgainAn_M_BC__c',
+ actionName: 'new',
+ RecordType:''
+ },
+ state: {
+ nooverride: '1',
+ defaultFieldValues: defaultFieldValues
+ }
+ })
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexnewMBC/lexnewMBC.js-meta.xml b/force-app/main/default/lwc/lexnewMBC/lexnewMBC.js-meta.xml
new file mode 100644
index 0000000..98945b3
--- /dev/null
+++ b/force-app/main/default/lwc/lexnewMBC/lexnewMBC.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexnewMBC">
+ <apiVersion>54.0</apiVersion>
+ <isExposed>true</isExposed>
+ <targets>
+ <target>lightning__RecordPage</target>
+ <target>lightning__AppPage</target>
+ <target>lightning__HomePage</target>
+ <target>lightning__RecordAction</target>
+ </targets>
+</LightningComponentBundle>
\ No newline at end of file
--
Gitblit v1.9.1