From eec4be64ceb2a97a09003c87204a6750b5f1e480 Mon Sep 17 00:00:00 2001
From: unknown <sunxia@prec-tech.com>
Date: 星期四, 06 七月 2023 13:54:21 +0800
Subject: [PATCH] 分配

---
 force-app/main/default/lwc/lexConsumSelect/lexConsumSelect.html        |    3 +
 force-app/main/default/lwc/lexConsumSelect/lexConsumSelect.js          |   54 +++++++++++++++++++++++++++
 force-app/main/default/lwc/lexConsumSelect/lexConsumSelect.js-meta.xml |   18 +++++++++
 3 files changed, 75 insertions(+), 0 deletions(-)

diff --git a/force-app/main/default/lwc/lexConsumSelect/lexConsumSelect.html b/force-app/main/default/lwc/lexConsumSelect/lexConsumSelect.html
new file mode 100644
index 0000000..af9fa97
--- /dev/null
+++ b/force-app/main/default/lwc/lexConsumSelect/lexConsumSelect.html
@@ -0,0 +1,3 @@
+<template>
+
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConsumSelect/lexConsumSelect.js b/force-app/main/default/lwc/lexConsumSelect/lexConsumSelect.js
new file mode 100644
index 0000000..f846a8d
--- /dev/null
+++ b/force-app/main/default/lwc/lexConsumSelect/lexConsumSelect.js
@@ -0,0 +1,54 @@
+import { LightningElement, track, wire, api } from 'lwc';
+import { CurrentPageReference,NavigationMixin } from 'lightning/navigation';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { CloseActionScreenEvent } from 'lightning/actions';
+
+import init from '@salesforce/apex/lexConsumApplyController.init';
+import getSet from '@salesforce/apex/lexConsumApplyController.getSet';
+export default class lexConsumSelect extends LightningElement {
+	@api recordId;
+	@api consumApplySetIds;
+    IsLoading=true;
+    IsDisplay=true;
+    //鎻愮ず淇℃伅
+    msg;
+
+	connectedCallback(){
+		this.IsLoading=false;
+		init({
+			recordId: this.recordId
+		}).then(res=>{
+			this.IsDisplay = false;
+			if(res.yiLoanerArranged > 0){
+				this.IsDisplay = true;
+				this.msg = '鍑哄簱涔嬪悗涓嶈兘鐐瑰嚮鍒嗛厤鎸夐挳,濡傛灉鏈夐渶瑕佸垎閰嶇殑鏄庣粏璇峰垎鍗曞悗缁х画鎿嶄綔';
+				return;
+			}else if(this.consumApplySetIds.length<1){
+				this.IsDisplay = true;
+				this.msg = '璇烽�夋嫨鑰楁潗澶囧搧涓�瑙�';
+				return;
+			}else if(this.consumApplySetIds.length>1){
+				this.IsDisplay = true;
+				this.msg = '璇烽�夋嫨涓�鏉¤�楁潗澶囧搧涓�瑙�';
+				return;
+			}else{
+				getSet({
+					setId: this.consumApplySetIds[0]
+				}).then(res=>{
+					if(res.Zan_Ding_Fen_Pei_Shu__c > 0){
+						this.IsDisplay = true;
+						this.msg = '璇峰湪榛樿鍒嗛厤鍚庡啀鍋氬垎閰嶆搷浣溿��';
+						return;
+					}else{
+						window.open("/apex/ConsumSelect?recid=" + this.consumApplySetIds[0], "_top"); 
+					}
+				})
+			}
+		})
+	}
+
+	closeAction() {
+        //杩斿洖褰撳墠鐨勫鍝佺敵璇�
+		window.open("/"+this.recordId,'_self');
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConsumSelect/lexConsumSelect.js-meta.xml b/force-app/main/default/lwc/lexConsumSelect/lexConsumSelect.js-meta.xml
new file mode 100644
index 0000000..171c81d
--- /dev/null
+++ b/force-app/main/default/lwc/lexConsumSelect/lexConsumSelect.js-meta.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexConsumSelect">
+    <apiVersion>51.0</apiVersion>
+    <isExposed>true</isExposed>
+    <targets>
+        <target>lightning__AppPage</target>
+        <target>lightning__RecordPage</target>
+        <target>lightning__HomePage</target>
+        <target>lightning__RecordAction</target>
+        <target>lightning__FlowScreen</target>
+    </targets>
+    <targetConfigs>
+        <targetConfig targets="lightning__FlowScreen">
+            <property name="recordId" type="String" label="recordId"/>
+            <property name="consumApplySetIds" type="String[]" label="consumApplySetIds"/>
+        </targetConfig>
+    </targetConfigs>
+</LightningComponentBundle>
\ No newline at end of file

--
Gitblit v1.9.1