From b04241c455dfc6d01265ba9cc7ed42abd27a3015 Mon Sep 17 00:00:00 2001
From: unknown <sunxia@prec-tech.com>
Date: 星期二, 18 四月 2023 16:39:56 +0800
Subject: [PATCH] 现场统一收货

---
 force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.js          |   33 +++++++++++
 force-app/main/default/classes/AllReceivedFseController.cls-meta.xml             |    5 +
 force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.css         |   22 +++++++
 force-app/main/default/classes/AllReceivedFseController.cls                      |   48 ++++++++++++++++
 force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.html        |    5 +
 force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.js-meta.xml |   11 +++
 6 files changed, 124 insertions(+), 0 deletions(-)

diff --git a/force-app/main/default/classes/AllReceivedFseController.cls b/force-app/main/default/classes/AllReceivedFseController.cls
new file mode 100644
index 0000000..9d19029
--- /dev/null
+++ b/force-app/main/default/classes/AllReceivedFseController.cls
@@ -0,0 +1,48 @@
+public with sharing class AllReceivedFseController {
+    public AllReceivedFseController() {
+        
+    }
+
+    @AuraEnabled
+    public static InitData init(String recordId){
+        InitData res = new InitData();
+        Rental_Apply__c ra = [SELECT Id, Loaner_received_ng_num__c from Rental_Apply__c where Id = :recordId];
+        res.Id = ra.Id;
+        res.LoanerReceivedNgNum = Integer.valueOf(ra.Loaner_received_ng_num__c);
+
+        return res;
+    }
+
+    @AuraEnabled
+    public static String getRaeSet(String recordId){
+        List<Rental_Apply_Equipment_Set__c> raeList = [SELECT Id, RAES_Status__c, Loaner_received_time__c from Rental_Apply_Equipment_Set__c WHERE Rental_Apply__c = :recordId];
+        List<Rental_Apply_Equipment_Set__c> updateList = new List<Rental_Apply_Equipment_Set__c>();
+        for(Integer i=0; i<raeList.size(); i++){
+            if(raeList[i].Loaner_received_time__c == null && raeList[i].RAES_Status__c == '宸插嚭搴�'){
+                Rental_Apply_Equipment_Set__c tempRAE = new Rental_Apply_Equipment_Set__c();
+                tempRAE.Id = raeList[i].Id;
+                tempRAE.Received_Confirm__c = 'OK';
+                updateList.add(tempRAE);
+            }
+        }
+
+        if(updateList.size()>0){
+            try {
+                update updateList;
+                return 'SUCCESS';
+            }
+            catch (Exception e) {
+                return e.getMessage();
+            }            
+        }
+
+        return '涓嶅瓨鍦ㄦ洿鏂版槑缁�';
+    }
+
+    public Class InitData{
+        @AuraEnabled
+        public String Id;
+        @AuraEnabled
+        public Integer LoanerReceivedNgNum;
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/AllReceivedFseController.cls-meta.xml b/force-app/main/default/classes/AllReceivedFseController.cls-meta.xml
new file mode 100644
index 0000000..9662499
--- /dev/null
+++ b/force-app/main/default/classes/AllReceivedFseController.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>50.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.css b/force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.css
new file mode 100644
index 0000000..635bc6c
--- /dev/null
+++ b/force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.css
@@ -0,0 +1,22 @@
+.outerBorderCss{
+    border: 1px solid #D4D4D4;
+    border-radius : 5px;
+    border-top : 3px solid #565959;
+}
+.borderCss{
+    border: 1px solid #D4D4D4;
+    border-radius : 5px;
+    margin-bottom : 7px;
+    border-top : 3px solid #565959;
+}
+.headerDorderCss{
+    border-top: 1px solid #565959;
+    border-bottom: 1px solid #D4D4D4;
+    padding:3px;
+}
+.centerCss{
+    text-align: center;
+}
+.centerCss .left{
+    margin-left: 100px;
+}/* sample css file */
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.html b/force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.html
new file mode 100644
index 0000000..49a10f7
--- /dev/null
+++ b/force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.html
@@ -0,0 +1,5 @@
+<template>
+    <div class="sisToOPDHolder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.js b/force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.js
new file mode 100644
index 0000000..4145e2e
--- /dev/null
+++ b/force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.js
@@ -0,0 +1,33 @@
+import { LightningElement, track, wire, api } from 'lwc';
+import { CurrentPageReference,NavigationMixin } from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+
+import init from '@salesforce/apex/MainFixtureSelectButtonController.init';
+export default class lexMainFixtureSelect extends LightningElement {
+	@api recordId;
+	IsLoading = true;
+
+	@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=>{
+			window.open("/apex/MainFixtureSelect?pt_recid=" + res, "_top");
+			this.dispatchEvent(new CloseActionScreenEvent());
+		}).catch(err=>{
+			console.log(err);
+			this.dispatchEvent(new CloseActionScreenEvent());
+		})
+	}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.js-meta.xml b/force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.js-meta.xml
new file mode 100644
index 0000000..74849f3
--- /dev/null
+++ b/force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexOCMSubmit">
+    <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