From d7ac8beb8661d04356647196f6555c2eeed9055e Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期一, 24 四月 2023 17:39:31 +0800
Subject: [PATCH] Merge branch 'LEX_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_dev
---
force-app/main/default/classes/lexBatchSelectRepairLWCController.cls | 295 ++++++
force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.js-meta.xml | 11
force-app/main/default/lwc/lexCustomDeleteLWC/lexCustomDeleteLWC.html | 2
force-app/main/default/aura/lexNewRepairAura/lexNewRepairAuraHelper.js | 20
force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAuraRenderer.js | 5
force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.auradoc | 6
force-app/main/default/aura/lexNewRepairAura/lexNewRepairAuraController.js | 106 ++
force-app/main/default/lwc/lexCustomDeleteLWC/lexCustomDeleteLWC.js-meta.xml | 5
force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.js | 171 +++
force-app/main/default/classes/ControllerUtil.cls | 3
force-app/main/default/classes/lexCustomDeleteController.cls | 48 +
force-app/main/default/lwc/lexBatchSelectRepairLWC/lexBatchSelectRepairLWC.html | 107 ++
force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.cmp | 9
force-app/main/default/classes/lexNewRepairAuraController.cls-meta.xml | 5
force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.css | 2
force-app/main/default/lwc/lexBatchSelectRepairLWC/lexBatchSelectRepairLWC.js-meta.xml | 11
force-app/main/default/classes/lexNewRepairAuraController.cls | 438 +++++++++
force-app/main/default/classes/lexBatchSelectRepairLWCController.cls-meta.xml | 5
force-app/main/default/lwc/lexBatchSelectRepairLWC/lexBatchSelectRepairLWC.css | 9
force-app/main/default/aura/lexNewRepairAura/lexNewRepairAura.cmp | 78 +
force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.css | 12
force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.html | 93 +
force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.cmp-meta.xml | 5
force-app/main/default/lwc/lexBatchSelectRepairLWC/lexBatchSelectRepairLWC.js | 576 ++++++++++++
force-app/main/default/aura/lexNewRepairAura/lexNewRepairAura.cmp-meta.xml | 5
force-app/main/default/lwc/lexCustomDeleteLWC/lexCustomDeleteLWC.js | 144 +++
force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.design | 3
force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAuraController.js | 10
force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.svg | 7
force-app/main/default/classes/lexCustomDeleteController.cls-meta.xml | 5
force-app/main/default/classes/TaskFeedbackController.cls | 659 +++++++++++++
force-app/main/default/classes/TaskFeedbackController.cls-meta.xml | 5
force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAuraHelper.js | 5
33 files changed, 2,864 insertions(+), 1 deletions(-)
diff --git a/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.auradoc b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.auradoc
new file mode 100644
index 0000000..d0d6eb5
--- /dev/null
+++ b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.auradoc
@@ -0,0 +1,6 @@
+<aura:documentation>
+ <aura:description>Documentation</aura:description>
+ <aura:example name="ExampleName" ref="exampleComponentName" label="Label">
+ Example Description
+ </aura:example>
+</aura:documentation>
\ No newline at end of file
diff --git a/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.cmp b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.cmp
new file mode 100644
index 0000000..8d7b5b6
--- /dev/null
+++ b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.cmp
@@ -0,0 +1,9 @@
+<!-- <aura:component implements="force:lightningQuickAction,lightning:isUrlAddressable,flexipage:availableForRecordHome,force:hasRecordId" controller=""> -->
+<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:isUrlAddressable" >
+ <aura:attribute name="recordId" type="String" />
+ <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
+ <div class="exampleHolder">
+ <!-- onpartevent="{!c.closeModal}" -->
+ <c:lexCustomDeleteLWC recordId="{!v.recordId}" />
+ </div>
+</aura:component>
\ No newline at end of file
diff --git a/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.cmp-meta.xml b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.cmp-meta.xml
new file mode 100644
index 0000000..838df43
--- /dev/null
+++ b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.cmp-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>56.0</apiVersion>
+ <description>A Lightning Component Bundle</description>
+</AuraDefinitionBundle>
diff --git a/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.css b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.css
new file mode 100644
index 0000000..a5839d4
--- /dev/null
+++ b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.css
@@ -0,0 +1,2 @@
+.THIS {
+}
\ No newline at end of file
diff --git a/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.design b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.design
new file mode 100644
index 0000000..d247163
--- /dev/null
+++ b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.design
@@ -0,0 +1,3 @@
+<design:component >
+
+</design:component>
\ No newline at end of file
diff --git a/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.svg b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.svg
new file mode 100644
index 0000000..e201ae9
--- /dev/null
+++ b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E" />
+ <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF" />
+ </g>
+</svg>
\ No newline at end of file
diff --git a/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAuraController.js b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAuraController.js
new file mode 100644
index 0000000..4f77854
--- /dev/null
+++ b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAuraController.js
@@ -0,0 +1,10 @@
+({
+ doInit: function(component, event, helper) {
+ var val=component.get('v.recordId');
+ $A.get("e.force:closeQuickAction").fire();
+ console.log('val',val);
+ },
+ closeModal : function(component,event,helper) {
+ $A.get("e.force:closeQuickAction").fire();
+ }
+})
\ No newline at end of file
diff --git a/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAuraHelper.js b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAuraHelper.js
new file mode 100644
index 0000000..ba7f386
--- /dev/null
+++ b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAuraHelper.js
@@ -0,0 +1,5 @@
+({
+ helperMethod : function() {
+
+ }
+})
\ No newline at end of file
diff --git a/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAuraRenderer.js b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAuraRenderer.js
new file mode 100644
index 0000000..f1f0c75
--- /dev/null
+++ b/force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAuraRenderer.js
@@ -0,0 +1,5 @@
+({
+
+// Your renderer method overrides go here
+
+})
\ No newline at end of file
diff --git a/force-app/main/default/aura/lexNewRepairAura/lexNewRepairAura.cmp b/force-app/main/default/aura/lexNewRepairAura/lexNewRepairAura.cmp
new file mode 100644
index 0000000..7ecbcbb
--- /dev/null
+++ b/force-app/main/default/aura/lexNewRepairAura/lexNewRepairAura.cmp
@@ -0,0 +1,78 @@
+<!--
+ 2023/04/14 鏂板缓锛堜慨鐞嗭級
+-->
+<aura:component implements="flexipage:availableForRecordHome,force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:actionOverride,lightning:isUrlAddressable" access="global" controller="lexNewRepairAuraController">
+ <aura:attribute name="urlStr" type="String"/>
+ <aura:attribute name="recordId" type="String"/>
+ <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
+ <lightning:notificationsLibrary aura:id="notifLib"/>
+ <!-- <aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" >
+ <aura:attribute name="fields" type="String[]" default="['Name','AnnualRevenue','Industry']" />
+ <aura:attribute name="recordId" type="String"/>
+ <lightning:notificationsLibrary aura:id="notifLib"/>
+
+ <lightning:recordForm
+ objectApiName="Account"
+ fields="{!v.fields}"
+ onsuccess="{!c.handleSuccess}" />
+</aura:component> -->
+
+ <!-- <aura:attribute name = "recordId" type = "Id" default = ""/>
+ <aura:attribute name="title" type="string"/>
+ <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
+ <aura:attribute name="layout" type="LayoutDescriberHelper.LayoutWrapper"/>
+ <aura:attribute name="record_data" type="Map"/>
+ <aura:attribute name="section_names" type="List"/>
+ <aura:attribute name="showSpinner" type="Boolean" default = "False"/>
+ <aura:attribute name="staticResource" type="Map"/>
+ <aura:attribute name="pi_fields_map" type="Map"/>
+ <aura:attribute name="isClone" type="Boolean" default = "False"/>
+ <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" />
+ <ltng:require scripts="{! $Resource.jquery183minjs }" />
+ <aura:registerEvent name="NewAgencyContactEvent" type="c:NewAgencyContactEvent"/> -->
+
+ <div class="{! v.container_class}">
+ <!-- header -->
+ <header class="slds-modal__header">
+ <!-- <h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate"> -->
+ <div class="ptBody">
+ <div class="content" style="font-size: 18px;font-weight: bold;">
+ <img src="/img/s.gif" alt="淇悊" class="pageTitleIcon" title="淇悊" />
+ <span class="pageType">淇悊缂栬緫
+ <span class="titleSeparatingColon">:</span>
+ </span>
+ <span class="pageDescription">鏂板缓淇悊</span>
+ <div class="blank"> </div>
+ </div>
+ <!-- <div class="links">
+ <a href="javascript:openPopupFocusEscapePounds(%27https://help.salesforce.com/apex/htdoor?loc=help&target=repairs_edit.htm&section=repairs&language=zh_CN&release=234.18.8&instance=CS117&showSplash=true%27, %27Help%27, 700, 600, %27width=700,height=600,resizable=yes,toolbar=yes,status=no,scrollbars=yes,menubar=yes,directories=no,location=no,dependant=no%27, false, false);"
+ title="姝ら〉闈㈢殑甯姪 锛堟柊绐楀彛锛�">
+ <span class="helpLink">姝ら〉闈㈢殑甯姪</span>
+ <img src="/img/s.gif" alt="" class="helpIcon" />
+ </a>
+ </div> -->
+ </div>
+ <div class="ptBreadcrumb"></div>
+ <!-- </h2> -->
+ </header>
+
+ <div class="slds-modal__content slds-p-around_medium">
+ <!-- <aura:iteration items="1,2,3,4,5" var="item">
+ {!item}
+ </aura:iteration> -->
+ <!-- <lightning:recordEditForm recordId="{!v.recordId}"
+ objectApiName="Repair__c">
+ <lightning:messages />
+ <div class="slds-col slds-size_1-of-2">
+ Your lightning:inputField components here
+ <lightning:inputField fieldName="Source_QIS__c" />
+ </div>
+ <lightning:button class="slds-m-top_small" type="submit" label="Create new" />
+ </lightning:recordEditForm> -->
+ <c:lexNewRepairLWC recordId="{!v.recordId}" urlStr="{!v.urlStr}" />
+ </div>
+ </div>
+ <!-- <div class="exampleHolder">
+ <c:newRepairLWC recordId="{!v.recordId}"/>
+ </div> -->
+</aura:component>
\ No newline at end of file
diff --git a/force-app/main/default/aura/lexNewRepairAura/lexNewRepairAura.cmp-meta.xml b/force-app/main/default/aura/lexNewRepairAura/lexNewRepairAura.cmp-meta.xml
new file mode 100644
index 0000000..632b900
--- /dev/null
+++ b/force-app/main/default/aura/lexNewRepairAura/lexNewRepairAura.cmp-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>54.0</apiVersion>
+ <description>A Lightning Component Bundle</description>
+</AuraDefinitionBundle>
diff --git a/force-app/main/default/aura/lexNewRepairAura/lexNewRepairAuraController.js b/force-app/main/default/aura/lexNewRepairAura/lexNewRepairAuraController.js
new file mode 100644
index 0000000..135ffaa
--- /dev/null
+++ b/force-app/main/default/aura/lexNewRepairAura/lexNewRepairAuraController.js
@@ -0,0 +1,106 @@
+({
+ doInit1 : function(component, event, helper) {
+ let rid = component.get('v.recordId');
+ console.log(rid);
+ let pid = window.location.href.replace("https://","").split("/");
+ pid = pid[pid.length-1].replace("new?","");
+ let jsonobj = {};
+ console.log(pid);
+ pid.split("&").forEach(function(v){
+
+ console.log(v);
+ let param = v.split("=");
+ jsonobj[param[0]] = param[1];
+ });
+ let urlStr = JSON.stringify(jsonobj);
+ console.log(urlStr);
+ // if (rid) {}
+ /*let pid = null;
+ if(!rid){
+ pid = window.location.href.replace("https://","").split("/")[4];
+ }
+ let isClone = component.get('v.isClone');
+ if(!rid || isClone){
+ component.set('v.title',$A.get("$Label.c.New")+'.瀹㈡埛浜哄憳');
+ }else{
+ component.set('v.title',$A.get("$Label.c.Edit")+'.瀹㈡埛浜哄憳');
+ }
+
+ let record_type_id = null;
+ let pageref = component.get("v.pageReference")
+ if(!record_type_id && pageref){
+ record_type_id = pageref.state.recordTypeId
+ }
+ component.set("v.showSpinner", true);*/
+ helper.CallBackAction(component,'init',{
+ recordId : rid,
+ urlStr : urlStr
+ },function(data){
+ console.log("data");
+ console.log(data);
+ });
+ },
+ doInit : function(component, event, helper) {
+ let rid = component.get('v.recordId');
+ // console.log(rid);
+ let pid = window.location.href.replace("https://","").split("/");
+ pid = pid[pid.length-1].replace("new?","");
+ let jsonobj = {};
+ // console.log(pid);
+ pid.split("&").forEach(function(v){
+
+ // console.log(v);
+ let param = v.split("=");
+ jsonobj[param[0]] = param[1];
+ });
+ let urlStr = JSON.stringify(jsonobj);
+ // console.log(urlStr);
+ component.set('v.urlStr',urlStr);
+ // create a one-time use instance of the serverEcho action
+ // in the server-side controller
+ /*var action = component.get("c.init");
+ action.setParams({
+ recordId : rid,
+ urlStr : urlStr
+ });
+
+ // Create a callback that is executed after
+ // the server-side action returns
+ action.setCallback(this, function(response) {
+ console.log("response");
+ console.log(response);
+ // var state = response.getState();
+ if (state === "SUCCESS") {
+ // Alert the user with the value returned
+ // from the server
+ alert("From server: " + response.getReturnValue());
+
+ // You would typically fire a event here to trigger
+ // client-side notification that the server-side
+ // action is complete
+ }
+ else if (state === "INCOMPLETE") {
+ // do something
+ }
+ else if (state === "ERROR") {
+ var errors = response.getError();
+ if (errors) {
+ if (errors[0] && errors[0].message) {
+ console.log("Error message: " +
+ errors[0].message);
+ }
+ } else {
+ console.log("Unknown error");
+ }
+ }
+ });
+
+ // optionally set storable, abortable, background flag here
+
+ // A client-side action could cause multiple events,
+ // which could trigger other events and
+ // other server-side action calls.
+ // $A.enqueueAction adds the server-side action to the queue.
+ $A.enqueueAction(action);*/
+ }
+})
\ No newline at end of file
diff --git a/force-app/main/default/aura/lexNewRepairAura/lexNewRepairAuraHelper.js b/force-app/main/default/aura/lexNewRepairAura/lexNewRepairAuraHelper.js
new file mode 100644
index 0000000..f1ab449
--- /dev/null
+++ b/force-app/main/default/aura/lexNewRepairAura/lexNewRepairAuraHelper.js
@@ -0,0 +1,20 @@
+({
+ CallBackAction : function(component,action_name,para,callback) {
+ var action = component.get("c." + action_name.trimStart().replace("c.",""));
+ if(para){
+ action.setParams(para);
+ }
+ if(callback){
+ action.setCallback(this,function(data){
+ callback(data);
+ });
+ }
+
+ $A.enqueueAction(action);
+ },
+ ShowToast : function(paras){
+ var toastEvent = $A.get("e.force:showToast");
+ toastEvent.setParams(paras);
+ toastEvent.fire();
+ }
+})
\ No newline at end of file
diff --git a/force-app/main/default/classes/ControllerUtil.cls b/force-app/main/default/classes/ControllerUtil.cls
index e422a7a..043eb10 100644
--- a/force-app/main/default/classes/ControllerUtil.cls
+++ b/force-app/main/default/classes/ControllerUtil.cls
@@ -4951,6 +4951,7 @@
insert log;
}
+ @AuraEnabled
WebService static String deleteRepair(String rid) {
try {
Repair__c r = new Repair__c(Id = rid);
@@ -5551,7 +5552,7 @@
insert log;
}
-
+ @AuraEnabled
WebService static String setSObjectShare(String sobjectName, String rowCause, String parentId, List<String> userAccess, String ownerId) {
try {
List<SObject> sObjList = new List<SObject>();
diff --git a/force-app/main/default/classes/TaskFeedbackController.cls b/force-app/main/default/classes/TaskFeedbackController.cls
new file mode 100644
index 0000000..aaa9718
--- /dev/null
+++ b/force-app/main/default/classes/TaskFeedbackController.cls
@@ -0,0 +1,659 @@
+public without sharing class TaskFeedbackController {
+
+ // 鍒濆鏂规硶锛岃幏鍙栧綋鍓嶆墍鏈変换鍔★紝鍖呮嫭褰撳墠鐢ㄦ埛鍜屽綋鍓嶇敤鎴蜂笅灞炵殑浠诲姟
+ @AuraEnabled
+ public static Task getFeedbackTask(string myTaskName, string myTaskType, string myTaskStatus, string myAccountID, Date myStartDate, Date myEndDate, String myTaskDifferent, //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 start
+ string subTaskName, string subTaskType, string subSFDCPosition, string subTaskStatus, string subAccountID, Date subStartDate, Date subEndDate,String subTaskDifferent) {
+ ID myUserID = UserInfo.getUserId();
+ // 妫�绱㈠嚭鏉ュ綋鍓嶇敤鎴风殑浠诲姟
+
+
+
+ list<TaskWrapper> myTasks = TasksBuild( new list<ID> {myUserID},
+ myTaskName, myTaskType, '' ,
+ myTaskStatus, myAccountID,
+ myStartDate,
+ myEndDate ,myTaskDifferent); //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 start
+
+
+ // 涓嬪睘鐨処D set
+ list<id> subUserIDlist = new list<id>();
+ // 妫�绱㈠綋鍓嶇敤鎴锋槸缁忕悊銆侀儴闀裤�佹�荤洃绛夌瓑鐨勪笅灞�
+ for (user tempUser :
+ [select id
+ from user
+ where managerid = : myUserID
+ or JingliApprovalManager__c = : myUserID
+ or SalesManager__c = : myUserID
+ or JingliEquipmentManager__c = : myUserID
+ or BuchangApprovalManagerSales__c = : myUserID
+ or BuchangApprovalManager__c = : myUserID
+ or Buzhang_Equipment_Manager__c = : myUserID
+ or ZongjianApprovalManager__c = : myUserID
+ or TongkuoZongjian__c = : myUserID
+ ]) {
+ subUserIDlist.add(tempUser.id);
+ }
+ // 妫�绱㈠嚭鏉ヤ笅灞炵敤鎴风殑浠诲姟
+ list<TaskWrapper> subTasks = TasksBuild( subUserIDlist,
+ subTaskName, subTaskType, '', '', subAccountID, subStartDate, subEndDate ,subTaskDifferent); //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 start
+
+ Task allTask = new Task(myTasks, subTasks );
+ return allTask;
+ }
+ // 纭鎴栬�呭欢鏈�
+ @AuraEnabled
+ public static string confirmOrDelay(boolean isDelay, string delayReason, string delayReasonOther, string taskID,Boolean IsGeneratePlan,Date ActivityDate) {
+ //2021-07-30 mzy SWAG-C5DAX8 update start
+ UserResult u = UserInfo_Owner();
+ //2021-07-30 mzy SWAG-C5DAX8 update end
+ try {
+ Task__c tempTask = new Task__c();
+ tempTask.id = taskID;
+ tempTask.isDelay__c = isDelay;
+ tempTask.delayReason__c = delayReason;
+ tempTask.delayReasonOther__c = delayReasonOther;
+ //2021-07-30 mzy SWAG-C5DAX8 update start
+ if(u.Job_Category!=null&&u.Job_Category.equals('閿�鍞湇鍔�')){
+ tempTask.delayReasonSelectFSE__c = delayReason;
+ }else {
+ tempTask.delayReasonSelect__c = delayReason;
+ }
+ //2021-07-30 mzy SWAG-C5DAX8 update end
+ //2021-10-20 mzy 浠诲姟绠$悊鏀瑰杽 start
+ if(IsGeneratePlan == false){
+ //涓嶇敓鎴愯鍒�
+ tempTask.taskStatus__c = '02 鎺ュ彈';
+ tempTask.GeneratePlan__c = IsGeneratePlan;
+ tempTask.ConfirmDate__c = Date.today();
+ tempTask.Activity_Date__c = ActivityDate;
+ }
+ //2021-10-20 mzy 浠诲姟绠$悊鏀瑰杽 end
+
+ update tempTask;
+ //鎴愬姛杩斿洖鏇存柊鎴愬姛
+ return 'Success';
+ } catch (exception e) {
+ //鍚﹀垯杩斿洖閿欒淇℃伅
+ return e.getMessage();
+ }
+ }
+
+ //鍚堝苟浠诲姟
+ @AuraEnabled
+ public static string mergeTask(List<String> taskIdList) {
+
+ try {
+ //BatchIF_Log__c iflog = new BatchIF_Log__c();
+ //iflog.Type__c = 'TestTaskManage';
+ //iflog.Log__c = taskIdList.get(0)+'===='+taskIdList.get(1);
+ //iflog.Log__c = '杩涘叆浜唌ergeTask鏂规硶';
+ //insert iflog;
+ List<Task__c> taskList = [select id,mergeTaskMain__c,CreateDate__c,Name,Assignment_Date__c,taskType__c,RelatedInformation_Text__c from task__c where id in :taskIdList];
+ Task__c mainTask = [select id,mergeTaskMain__c,CreateDate__c,Name,Assignment_Date__c,taskType__c,RelatedInformation_Text__c from task__c where id in :taskIdList order by CreateDate__c desc limit 1];
+ List<Task__c> subTaskList = [select id,mergeTaskMain__c,CreateDate__c,Name,Assignment_Date__c,taskType__c,RelatedInformation_Text__c from task__c where mergeTaskMain__c in :taskIdList ];
+ List<Task__c> updateList = new List<Task__c>();
+ List<Task__c> deleteList = new List<Task__c>();
+
+ for(Task__c tsk : taskList){
+ if(tsk.id != mainTask.id ){
+ if(tsk.Assignment_Date__c != null && tsk.Assignment_Date__c != mainTask.Assignment_Date__c && tsk.taskType__c == mainTask.taskType__c &&tsk.Name == mainTask.Name && tsk.RelatedInformation_Text__c == mainTask.RelatedInformation_Text__c ){
+ deleteList.add(tsk);
+
+ }else if(tsk.Assignment_Date__c != null && tsk.Assignment_Date__c == mainTask.Assignment_Date__c && tsk.Name != mainTask.Name){
+ tsk.mergeTaskMain__c = mainTask.Id;
+ updateList.add(tsk);
+ }else{
+ return tsk.Name + ' 涓� ' + mainTask.Name + ' 涓嶇鍚堝悎骞舵潯浠�!璇烽�夋嫨鍒嗛厤鏃堕棿涓嶅悓锛屼换鍔″悕绉般�佺被鍨嬨�佺浉鍏充俊鎭浉鍚岀殑浠诲姟杩涜鍚堝苟锛屾垨鑰呴�夋嫨鍒嗛厤鏃堕棿鐩稿悓锛屽叾浣欎俊鎭笉鍚岀殑浠诲姟杩涜鍚堝苟锛�';
+ }
+
+ }
+
+ }
+
+ if(subTaskList != null && subTaskList.size() > 0){
+ for(Task__c subTask : subTaskList){
+ subTask.mergeTaskMain__c = mainTask.Id;
+ }
+ update subTaskList;
+ }
+ if(updateList != null && updateList.size() > 0){
+ update updateList;
+ }
+ if(deleteList != null && deleteList.size() > 0){
+ delete deleteList;
+ }
+ return 'Success';
+ } catch (exception e) {
+ //鍚﹀垯杩斿洖閿欒淇℃伅
+ return e.getMessage();
+ }
+ }
+
+ //2021-10-28 yjk 鏍规嵁浠诲姟id鑾峰彇璇环id
+ @AuraEnabled
+ public static string checkEnquiryController(String taskId) {
+ try {
+ List<task__c> tskList = [select id, OpportunityId__c from task__c where id = :taskId];
+ if(tskList.size() != 1){
+ return 'error';
+ }
+ if(tskList.get(0).OpportunityId__c == null ){
+ return 'no';
+ }
+
+ return tskList.get(0).OpportunityId__c;
+ } catch (exception e) {
+ //鍚﹀垯杩斿洖閿欒淇℃伅
+ return 'error';
+ }
+ }
+
+ //閲嶆柊鍒嗛厤浠诲姟
+ @AuraEnabled
+ public static UserResult resetAssignee(string assigneeID, string taskID) {
+ UserResult result = new UserResult();
+ Savepoint sp = Database.setSavepoint();
+ try {
+ Task__c tempTask = new Task__c();
+ tempTask.id = taskID;
+ tempTask.assignee__c = assigneeID;
+ tempTask.ownerid = assigneeID;
+ tempTask.Assignment_Date__c = Date.today();
+ update tempTask;
+ User tempUser =
+ [select id, alias from user where id = : assigneeID ];
+ result.assigneeID = assigneeID;
+ result.assigneeName = tempUser.alias;
+
+ } catch (exception e) {
+ Database.rollback(sp);
+ result.result = e.getMessage();
+ }
+ return result;
+ }
+ //20210105 CHAN-BWX3YU you start
+ //閲嶆柊鍒嗛厤浠诲姟
+ @AuraEnabled
+ public static UserResult resetAssignee_Owner(string assigneeID, string taskID) {
+ UserResult result = new UserResult();
+ Savepoint sp = Database.setSavepoint();
+ try {
+ // Task__Share tasksha = new Task__Share(UserOrGroupId=assigneeID, AccessLevel='Edit', ParentId = taskID,RowCause = 'Manual');
+ //insert tasksha;
+ system.debug('==taskID==='+taskID+'==assigneeID=='+assigneeID);
+
+ Task__c tempTask = new Task__c();
+ tempTask.id = taskID;
+ tempTask.assignee__c = assigneeID;
+ tempTask.ownerid = assigneeID;
+ tempTask.Assignment_Date__c = Date.today();
+ update tempTask;
+ User tempUser =
+ [select id, alias from user where id = : assigneeID ];
+ result.assigneeID = assigneeID;
+ result.assigneeName = tempUser.alias;
+
+ } catch (exception e) {
+ Database.rollback(sp);
+ result.result = e.getMessage();
+ }
+ return result;
+ }
+ //鑾峰彇褰撳墠鐧诲綍浜虹殑 鐪佷唤 鍜� 鑱岀
+ @AuraEnabled
+ public static UserResult UserInfo_Owner() {
+ UserResult result = new UserResult();
+ ID myUserID = UserInfo.getUserId();
+
+ try {
+ User tempUser =
+ [select id,Province__c,Job_Category__c from user where id = : myUserID ];
+ result.Job_Category = tempUser.Job_Category__c;
+ result.ProvinceName = tempUser.Province__c;
+ } catch (exception e) {
+
+ result.result = e.getMessage();
+ }
+ return result;
+ }
+ //20210105 CHAN-BWX3YU you end
+ // 鑾峰彇褰撳墠鐢ㄦ埛鐨勪换鍔�
+ @AuraEnabled
+ public static Task getMyTask(string myTaskName, string myTaskType,
+ string myTaskStatus, string myAccountID,
+ Date myStartDate, Date myEndDate,
+ //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 start
+ String myTaskDifferent
+ //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 end
+ ) {
+ ID myUserID = UserInfo.getUserId();
+
+ //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 update start
+ list<TaskWrapper> myTasks = TasksBuild( new list<ID> {myUserID},
+ myTaskName, myTaskType, '' , myTaskStatus, myAccountID, myStartDate, myEndDate, myTaskDifferent );
+ //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 update end
+ Task allTask = new Task(myTasks, null );
+ return allTask;
+ }
+ //鑾峰彇褰撳墠鐢ㄦ埛涓嬪睘鐨勪换鍔�
+ @AuraEnabled
+ public static Task getSubTask(string subTaskName, string subTaskType,
+ string subSFDCPosition , string subTaskStatus,
+ string subAccountID,
+ Date subStartDate, Date subEndDate ,
+ //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 start
+ String subTaskDifferent
+ //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 end
+ ) {
+ ID myUserID = UserInfo.getUserId();
+ list<id> subUserIDlist = new list<id>();
+ for (user tempUser :
+ [select id
+ from user
+ where managerid = : myUserID
+ or JingliApprovalManager__c = : myUserID
+ or SalesManager__c = : myUserID
+ or JingliEquipmentManager__c = : myUserID
+ or BuchangApprovalManagerSales__c = : myUserID
+ or BuchangApprovalManager__c = : myUserID
+ or Buzhang_Equipment_Manager__c = : myUserID
+ or ZongjianApprovalManager__c = : myUserID
+ or TongkuoZongjian__c = : myUserID
+ ]) {
+ subUserIDlist.add(tempUser.id);
+ }
+ //system.debug('subUserIDlist:'+subUserIDlist);
+ //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 update start
+ list<TaskWrapper> subTasks = TasksBuild( subUserIDlist,
+ subTaskName, subTaskType, subSFDCPosition, subTaskStatus, subAccountID, subStartDate, subEndDate , subTaskDifferent );
+ //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 update end
+ Task allTask = new Task(null, subTasks );
+ return allTask;
+ }
+ // 鍙栨秷浠诲姟
+ @AuraEnabled
+ public static string cancel(string taskID, string cancelReason, string cancelReasonOther) {
+ //2021-07-30 mzy SWAG-C5DAX8 update start
+ UserResult u = UserInfo_Owner();
+ //2021-07-30 mzy SWAG-C5DAX8 update end
+
+ try {
+ Task__c tempTask = new Task__c();
+ tempTask.id = taskID;
+ tempTask.cancelReason__c = cancelReason;
+ tempTask.cancelReasonOther__c = cancelReasonOther;
+ tempTask.taskStatus__c = '04 鍙栨秷';
+ tempTask.cancelDate__c = date.today();
+ //2021-07-30 mzy SWAG-C5DAX8 update start
+ if(u.Job_Category!=null&&u.Job_Category.equals('閿�鍞湇鍔�')){
+ tempTask.cancelReasonSelectFSE__c = cancelReason;
+ }else {
+ tempTask.cancelReasonSelect__c = cancelReason;
+ }
+ //2021-07-30 mzy SWAG-C5DAX8 update end
+
+ update tempTask;
+ return 'Success';
+ } catch (exception e) {
+ return e.getMessage();
+ }
+ }
+
+ // 鍙栨秷浠诲姟
+ @AuraEnabled
+ public static string feedback(string feedbackContent, string taskId) {
+ try {
+ Task__c tempTask = [select id , taskType__c,taskStatus__c,FeedbackDescription__c,NeedActivity__c,GeneratePlan__c from task__c where id = :taskId];
+ tempTask.id = taskId;
+ tempTask.FeedbackDescription__c = feedbackContent;
+ if('鍏朵粬'.equals(tempTask.taskType__c) ){
+ tempTask.taskStatus__c = '03 瀹屾垚';
+ }
+ update tempTask;
+ return 'Success';
+ } catch (exception e) {
+ return e.getMessage();
+ }
+ }
+
+ // 鏋勫缓浠诲姟闆嗗悎
+ public static list<TaskWrapper> TasksBuild( list<ID> userIDList, string TaskName,
+ string taskType, string SFDCPosition ,
+ string TaskStatus, string AccountID,
+ Date startDate, Date endDate,String TaskDifferent) {// 2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 start
+ list<TaskWrapper> myTasks = new list<TaskWrapper>();
+
+ // 鎷煎嚭鏉ヤ换鍔℃绱㈡潯浠�
+ String query = 'select id, name, account__c, account__r.name,' +
+ 'CreateDate__c,assignee__c , assignee__r.alias, ' +
+ //2021-03-29 WLIG-BZK59N mzy start
+ 'RelatedInformation_ID__c,RelatedInformation_Text__c,'+
+ //2021-03-29 WLIG-BZK59N mzy end
+ //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 start
+ 'TaskDifferent__c,'+
+ //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 end
+ 'FeedbackDescription__c ,'+
+ 'taskStatus__c,taskType__c,Assignment_Date__c from task__c where assignee__c in :userIDList and mergeTaskMain__c = null '+
+ ' and NeedFeedback__c = true and (taskStatus__c = \'02 鎺ュ彈\' or taskStatus__c = \'03 瀹屾垚\')' ;
+ //浠诲姟鍚嶇О
+ if (string.isNotBlank(TaskName)) {
+ query += ' and Name like \'%' + String.escapeSingleQuotes(TaskName.trim()) + '%\'';
+ }
+ //浠诲姟绫诲瀷
+ if (string.isNotBlank(taskType)) {
+ query += ' and taskType__c = \'' + String.escapeSingleQuotes(taskType) + '\'';
+ }
+ // SFDC鑱岀
+ if (string.isNotBlank(SFDCPosition)) {
+ query += ' and assignee__r.SFDCPosition_C__c = \'' + String.escapeSingleQuotes(SFDCPosition) + '\'';
+ }
+ // 鎵�灞炲鎴�
+ if (string.isNotBlank(AccountID)) {
+ query += ' and account__c = \'' + String.escapeSingleQuotes(AccountID) + '\'';
+ }
+ //浠诲姟鐘舵��
+ if (string.isNotBlank(TaskStatus)) {
+ query += ' and taskStatus__c = \'' + String.escapeSingleQuotes(TaskStatus) + '\'';
+ }
+ //鍒涘缓鏃ユ湡鐨勮捣濮嬫棩鏈�
+ if (startDate != null) {
+ query += ' and CreateDate__c >= ' + startDate.format().replace('/', '-') ;
+ }
+ //鍒涘缓鏃ユ湡鐨勭粨鏉熸棩鏈�
+ if (endDate != null) {
+ query += ' and CreateDate__c <= ' + endDate.format().replace('/', '-') ;
+ }
+ //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 start
+ //浠诲姟鍖哄垎
+ if(string.isNotBlank(TaskDifferent)){
+ query += ' and TaskDifferent__c =\''+ String.escapeSingleQuotes(TaskDifferent) +'\'';
+ }
+ //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 end
+
+ //2021-04-19 mzy WLIG-C25DW4 浠诲姟涓�瑙堣〃鏄剧ず閫昏緫 浠诲姟绠$悊琛ㄨ鎸夊鎴枫�佷换鍔$被鍨嬪拰鐩稿叧淇℃伅鎺掑簭銆� start
+ query += ' order by account__c ,taskType__c,RelatedInformation_ID__c';
+ //2021-04-19 mzy WLIG-C25DW4 浠诲姟涓�瑙堣〃鏄剧ず閫昏緫 浠诲姟绠$悊琛ㄨ鎸夊鎴枫�佷换鍔$被鍨嬪拰鐩稿叧淇℃伅鎺掑簭銆� end
+
+ // 妫�绱㈡垚鍔熷悗鏋勫缓浠诲姟wrapper
+ for ( Task__c tempTask : Database.query(query) ) {
+
+ if(tempTask.FeedbackDescription__c != null && !''.equals(tempTask.FeedbackDescription__c)){
+ continue;
+ }
+ TaskWrapper tempTaskWrapper = new TaskWrapper();
+ tempTaskWrapper.Id = tempTask.id;
+ tempTaskWrapper.taskId = '/' + tempTask.id;
+ //2021-11-25 yjk 浠诲姟绠$悊鏀瑰杽 start
+ //浠诲姟鍚嶇О鍙樉绀� 鍚嶇О涓嶆樉绀哄鎴峰悕
+ if(String.isNotBlank(tempTask.Name)){
+ String tempTaskName = tempTask.Name;
+ if(tempTaskName.contains(':')){
+ tempTaskWrapper.taskName = tempTaskName.split(':')[0];
+ //}else if(tempTaskName.contains('(')){
+ // tempTaskWrapper.taskName = tempTaskName.split('(')[0];
+ }else {
+ tempTaskWrapper.taskName = tempTaskName;
+ }
+ }
+ //tempTaskWrapper.taskName = tempTask.Name;
+ //2021-11-25 yjk 浠诲姟绠$悊鏀瑰杽 end
+
+ tempTaskWrapper.taskAccountID = '/' + tempTask.account__c;
+ tempTaskWrapper.taskAccountName = tempTask.account__r.name;
+ tempTaskWrapper.taskType = tempTask.taskType__c;
+ tempTaskWrapper.taskStatus = tempTask.taskStatus__c;
+ tempTaskWrapper.taskCreateddate = tempTask.CreateDate__c;
+ tempTaskWrapper.taskAssigneeName = tempTask.assignee__r.alias;
+ tempTaskWrapper.taskAssigneeUrl = '/' + tempTask.assignee__c;
+ tempTaskWrapper.taskAssigneeID = tempTask.assignee__c;
+ //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 start
+ tempTaskWrapper.taskDifferent = tempTask.TaskDifferent__c;
+ //2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 end
+ //2021-03-29 WLIG-BZK59N mzy start
+ if(tempTask.RelatedInformation_Text__c != null && tempTask.RelatedInformation_ID__c != null){
+ //澶氬勾淇� 鍜� 璇环
+ tempTaskWrapper.taskRelatedInformation = tempTask.RelatedInformation_Text__c;
+ tempTaskWrapper.taskRelatedInformationID = '/'+tempTask.RelatedInformation_ID__c;
+ }else if(tempTask.RelatedInformation_Text__c != null&&String.isBlank(String.valueOf(tempTask.RelatedInformation_ID__c))==true){
+ //OPD浠诲姟
+ tempTaskWrapper.taskRelatedInformation = tempTask.RelatedInformation_Text__c;
+ tempTaskWrapper.taskRelatedInformationID = '/apex/taskManage?id='+String.ValueOf(UserInfo.getUserId()).substring(0,15)+'#';
+ }
+ //tempTaskWrapper.taskRelatedInformation = tempTask.RelatedInformation_Text__c;
+ //tempTaskWrapper.taskRelatedInformationID = tempTask.RelatedInformation_ID__c==null?'/':'/'+tempTask.RelatedInformation_ID__c;
+ //2021-03-29 WLIG-BZK59N mzy end
+ tempTaskWrapper.cancelButtonisDisabled = false;
+ tempTaskWrapper.confirmButtonisDisabled = false;
+ tempTaskWrapper.delayButtonisDisabled = false;
+ tempTaskWrapper.assignButtonisDisabled = false;
+ //20210111 CHAN-BWX3YU you start
+ tempTaskWrapper.assignButtonisDisabled_Owner = false;
+
+ Date d2 = date.today().addDays(-2);
+ Date createdate1= date.newinstance(tempTask.CreateDate__c.year(), tempTask.CreateDate__c.month(), tempTask.CreateDate__c.day());
+ system.debug('鍒嗛厤鏃堕棿'+tempTask.Assignment_Date__c+'==d2=='+d2);
+ //20210111 CHAN-BWX3YU you end
+
+ if (tempTask.taskStatus__c != null && !tempTask.taskStatus__c.equals('01 鍒嗛厤')) {
+ tempTaskWrapper.cancelButtonisDisabled = true;
+ tempTaskWrapper.confirmButtonisDisabled = true;
+ tempTaskWrapper.delayButtonisDisabled = true;
+ tempTaskWrapper.assignButtonisDisabled = true;
+ //20210105 CHAN-BWX3YU you start
+ tempTaskWrapper.assignButtonisDisabled_Owner = true;
+ //20210105 CHAN-BWX3YU you end
+ }
+ //20210618 SWAG-C434H9 zh start
+ // if((tempTask.Assignment_Date__c!= null && tempTask.Assignment_Date__c >=d2) || (tempTask.Assignment_Date__c== null && createdate1>=d2 )){
+ if(tempTask.Assignment_Date__c!= null && tempTask.Assignment_Date__c >=d2){
+ //20210618 SWAG-C434H9 zh end
+ //20210113 CHAN-BWX3YU you start
+ tempTaskWrapper.assignButtonisDisabled_Owner = true;
+ tempTaskWrapper.assignButtonisDisabled = true;
+ //20210113 CHAN-BWX3YU you end
+ }
+ //2021-10-08 mzy 浠诲姟绠$悊鏀瑰杽 start
+ //涓婄骇鍒嗛厤鐨勪换鍔″彧鍏佽 鎺ュ彈 ,涓嶅厑璁� 寤舵湡/鍙栨秷
+ if(tempTask.TaskDifferent__c != null && tempTask.TaskDifferent__c.equals('涓婄骇鍒嗛厤浠诲姟')){
+ tempTaskWrapper.cancelButtonisDisabled = true;
+ tempTaskWrapper.delayButtonisDisabled = true;
+ tempTaskWrapper.assignButtonisDisabled_Owner = true;
+ }
+ //2021-10-08 mzy 浠诲姟绠$悊鏀瑰杽 end
+ myTasks.add(tempTaskWrapper);
+ }
+ return myTasks;
+ }
+ // 鑾峰彇鍚勭閫夐」鍒楄〃鐨勯�夐」鍊�
+ @AuraEnabled
+ public static map<string, list<pickerWrapper>> getpickerField() {
+ map<string, list<pickerWrapper>> pickerFields = new map<string, list<pickerWrapper>>();
+
+ // 浠诲姟绫诲瀷閫夐」鍊艰幏鍙�
+ list<pickerWrapper> taskTypeOptions = new list<pickerWrapper>();
+ Map<String, Schema.RecordTypeInfo> taskTypeNameMap =
+ Schema.SObjectType.Task__c.getRecordTypeInfosByName();
+ set<string> taskTypeNameSet = taskTypeNameMap.keySet();
+ for (string tempStr : taskTypeNameSet) {
+ if (!tempStr.equals('涓荤被鍨�')) {
+ pickerWrapper temppickerWrapper =
+ new pickerWrapper(tempStr, tempStr);
+ taskTypeOptions.add(temppickerWrapper);
+ }
+ }
+ pickerWrapper pickerWrapper =
+ new pickerWrapper('鎵�鏈�', '');
+ taskTypeOptions.add(pickerWrapper);
+ pickerFields.put('taskTypeOptions', taskTypeOptions);
+ // 浠诲姟鐘舵�侀�夐」鍊艰幏鍙�
+ list<pickerWrapper> taskStatusOptions = new list<pickerWrapper>();
+ Schema.DescribeFieldResult taskStatusfieldResult = Task__c.taskStatus__c.getDescribe();
+ List<Schema.PicklistEntry> taskStatusple = taskStatusfieldResult.getPicklistValues();
+ for ( Schema.PicklistEntry pickListVal : taskStatusple) {
+ pickerWrapper temppickerWrapper =
+ new pickerWrapper(pickListVal.getLabel(), pickListVal.getValue());
+ taskStatusOptions.add(temppickerWrapper);
+ }
+ pickerFields.put('taskStatusOptions', taskStatusOptions);
+ // 2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 start
+ // 浠诲姟鍖哄垎閫夐」鍊艰幏鍙�
+ list<pickerWrapper> taskDifferentOptions = new list<pickerWrapper>();
+ Schema.DescribeFieldResult taskDifferentfieldResult = Task__c.taskDifferent__c.getDescribe();
+ List<Schema.PicklistEntry> taskDifferentple = taskDifferentfieldResult.getPicklistValues();
+ for ( Schema.PicklistEntry pickListVal : taskDifferentple) {
+ pickerWrapper temppickerWrapper =
+ new pickerWrapper(pickListVal.getLabel(), pickListVal.getValue());
+ taskDifferentOptions.add(temppickerWrapper);
+ }
+ pickerWrapper taskDifferentWrapper =
+ new pickerWrapper('鎵�鏈�', '');
+ taskDifferentOptions.add(taskDifferentWrapper);
+ pickerFields.put('taskDifferentOptions', taskDifferentOptions);
+ // 2021-09-28 mzy 浠诲姟绠$悊鏀瑰杽 end
+ // SFDC 鑱岀閫夐」鍊艰幏鍙�
+ list<pickerWrapper> SFDCPositionOptions = new list<pickerWrapper>();
+ Schema.DescribeFieldResult SFDCPositionfieldResult = user.SFDCPosition_C__c.getDescribe();
+ List<Schema.PicklistEntry> SFDCPositionple = SFDCPositionfieldResult.getPicklistValues();
+ for ( Schema.PicklistEntry pickListVal : SFDCPositionple) {
+ pickerWrapper temppickerWrapper =
+ new pickerWrapper(pickListVal.getLabel(), pickListVal.getValue());
+ SFDCPositionOptions.add(temppickerWrapper);
+ }
+ pickerFields.put('SFDCPositionOptions', SFDCPositionOptions);
+ // 褰撳墠鐢ㄦ埛鑱岀鑾峰彇
+ User curentUser =
+ [select id , Job_Category__c
+ from User
+ where id = : UserInfo.getUserId()];
+ // 鍙栨秷鐞嗙敱閫夐」鍊艰幏鍙�
+ list<pickerWrapper> cancelReasonOptions = new list<pickerWrapper>();
+ Schema.DescribeFieldResult cancelReasonfieldResult;
+ if (curentUser.Job_Category__c != null && curentUser.Job_Category__c.equals('閿�鍞湇鍔�')) {
+ cancelReasonfieldResult = Task__c.cancelReasonSelectFSE__c.getDescribe();
+
+ } else {
+ cancelReasonfieldResult = Task__c.cancelReasonSelect__c.getDescribe();
+ }
+ List<Schema.PicklistEntry> cancelReasonple = cancelReasonfieldResult.getPicklistValues();
+ for ( Schema.PicklistEntry pickListVal : cancelReasonple) {
+ pickerWrapper temppickerWrapper =
+ new pickerWrapper(pickListVal.getLabel(), pickListVal.getValue());
+ cancelReasonOptions.add(temppickerWrapper);
+ }
+ pickerFields.put('cancelReasonOptions', cancelReasonOptions);
+
+ // 寤舵湡鐞嗙敱閫夐」鍊艰幏鍙�
+ list<pickerWrapper> delayReasonOptions = new list<pickerWrapper>();
+ Schema.DescribeFieldResult delayReasonfieldResult;
+ if (curentUser.Job_Category__c != null && curentUser.Job_Category__c.equals('閿�鍞湇鍔�')) {
+ delayReasonfieldResult = Task__c.delayReasonSelectFSE__c.getDescribe();
+
+ } else {
+ delayReasonfieldResult = Task__c.delayReasonSelect__c.getDescribe();
+ }
+ List<Schema.PicklistEntry> delayReasonple = delayReasonfieldResult.getPicklistValues();
+ for ( Schema.PicklistEntry pickListVal : delayReasonple) {
+ pickerWrapper temppickerWrapper =
+ new pickerWrapper(pickListVal.getLabel(), pickListVal.getValue());
+ delayReasonOptions.add(temppickerWrapper);
+ }
+ pickerFields.put('delayReasonOptions', delayReasonOptions);
+
+ return pickerFields;
+ }
+
+ //2021-11-17 mzy 浠诲姟绠$悊鏀瑰杽 satrt
+ //鏌ヨ宸插弽棣堢殑浠诲姟
+ @AuraEnabled
+ public static List<Task__c> getOverFeedbackTask(){
+ List<Task__c> OverFeedbackTaskList = new List<Task__c> ();
+ OverFeedbackTaskList = [SELECT Id FROM Task__c WHERE IsAssignmenter__c = true And TaskDifferent__c = '涓婄骇鍒嗛厤浠诲姟' And OverFeedback__c = true];
+
+ return OverFeedbackTaskList;
+ }
+ //2021-11-17 mzy 浠诲姟绠$悊鏀瑰杽 end
+
+ public class Task {
+ @AuraEnabled
+ public list<TaskWrapper> myTasks;
+ @AuraEnabled
+ public list<TaskWrapper> subTasks;
+
+ public Task(list<TaskWrapper> myTasks, list<TaskWrapper> subTasks) {
+ this.myTasks = myTasks;
+ this.subTasks = subTasks;
+ }
+ }
+ public class TaskWrapper {
+ @AuraEnabled
+ public String id;
+ @AuraEnabled
+ public String taskId;
+ @AuraEnabled
+ public String taskName;
+ @AuraEnabled
+ public String taskAccountID;
+ @AuraEnabled
+ public String taskAccountName;
+ @AuraEnabled
+ public String taskAssigneeID;
+ @AuraEnabled
+ public String taskAssigneeUrl;
+ @AuraEnabled
+ public String taskAssigneeName;
+ @AuraEnabled
+ public String taskType;
+ @AuraEnabled
+ public String taskStatus;
+ @AuraEnabled
+ public Date taskCreateddate;
+ @AuraEnabled
+ public Boolean cancelButtonisDisabled;
+ @AuraEnabled
+ public Boolean confirmButtonisDisabled;
+ @AuraEnabled
+ public Boolean delayButtonisDisabled;
+ @AuraEnabled
+ public Boolean assignButtonisDisabled;
+ //20210104 CHAN-BWX3YU you
+ @AuraEnabled
+ public Boolean assignButtonisDisabled_Owner;
+ //2021-03-29 WLIG-BZK59N mzy
+ @AuraEnabled
+ public String taskRelatedInformation;
+ @AuraEnabled
+ public String taskRelatedInformationID;
+ //2021-09-28 浠诲姟绠$悊鏀瑰杽 mzy
+ @AuraEnabled
+ public String taskDifferent;
+ }
+ public class pickerWrapper {
+ @AuraEnabled
+ public string label;
+ @AuraEnabled
+ public string value;
+ public pickerWrapper(string label, string value) {
+ this.label = label;
+ this.value = value;
+ }
+
+ }
+ public class UserResult {
+ @AuraEnabled
+ public string assigneeName;
+ @AuraEnabled
+ public string assigneeID;
+ @AuraEnabled
+ public string result;
+ public UserResult( ) {
+ result = 'Success';
+ }
+ //20210105 CHAN-BWX3YU you start
+ @AuraEnabled
+ public string Job_Category;
+ @AuraEnabled
+ public string ProvinceName;
+ //20210105 CHAN-BWX3YU you end
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/TaskFeedbackController.cls-meta.xml b/force-app/main/default/classes/TaskFeedbackController.cls-meta.xml
new file mode 100644
index 0000000..f3bac1f
--- /dev/null
+++ b/force-app/main/default/classes/TaskFeedbackController.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>41.0</apiVersion>
+ <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/lexBatchSelectRepairLWCController.cls b/force-app/main/default/classes/lexBatchSelectRepairLWCController.cls
new file mode 100644
index 0000000..26d7565
--- /dev/null
+++ b/force-app/main/default/classes/lexBatchSelectRepairLWCController.cls
@@ -0,0 +1,295 @@
+/**
+ * 2023-04-07
+ * 鎵归噺閫夋嫨淇悊LWC澶勭悊
+ */
+public with sharing class lexBatchSelectRepairLWCController {
+
+ public static List<Repair__c> RepairList;
+ public static List<RepairData> RAInfoList;
+ public static List<String> repairIdList;
+ // public static String pdfURL;
+
+ //鏌ヨRepair鏁版嵁
+ @AuraEnabled
+ public static ReturnData search(String json) {
+
+ //2023/04/07 LWC
+ ReturnData returnData = new ReturnData();
+ RetrievalData RevalInfo = (RetrievalData)System.JSON.deserialize(json,RetrievalData.class);
+ System.debug(LoggingLevel.INFO, '*** RevalInfo: ' + RevalInfo);
+
+ //pageController 閫昏緫
+ RepairList = new List<Repair__c>();
+ RAInfoList = new List<RepairData>();
+ if(String.isBlank(RevalInfo.Status1) && String.isBlank(RevalInfo.Status2) && String.isBlank(RevalInfo.RepairName) && String.isBlank(RevalInfo.SAPRepairNo)
+ && String.isBlank(RevalInfo.SerialNumber) && String.isBlank(RevalInfo.repair.Incharge_Staff__c) && String.isBlank(RevalInfo.onSiteRepair)
+ && String.isBlank(String.valueOf(RevalInfo.repair.Aware_date__c)) && String.isBlank(String.valueOf(RevalInfo.repair.Aware_date2__c)) && String.isBlank(RevalInfo.workLocationSelect)
+ && String.isBlank(RevalInfo.State_Hospital)){
+ // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '璇疯嚦灏戞坊鍔犱竴涓绱㈡潯浠�!'));
+ return null;
+ }
+ // 2023/04/10 add 鍨嬪彿锛屼慨鐞嗗鎵樿�� 鍚嶇О
+ String sql = 'select Id, Name, SAP_Service_Repair_No__c, Status1__c, Status2__c, Delivered_Product__c, SerialNumber__c, Delivered_Product__r.Name,Incharge_Staff__r.Name,';
+ sql += 'HP_Name__c, State_Hospital__c, Incharge_Staff__c, FSE_ApplyForRepair_Day__c, work_location_select__c, On_site_repair__c,';
+ sql += 'Number_of_EffectiveContract__c, NewProductGuaranteeObject__c from Repair__c where Id != null ';
+ if(String.isNotBlank(RevalInfo.Status2)){
+ sql += ' and Status2__c = \'' + RevalInfo.Status2 + '\'';
+ }
+ if(String.isNotBlank(RevalInfo.Status1)){
+ sql += ' and Status1__c = \'' + RevalInfo.Status1 + '\'';
+ }
+ if(String.isNotBlank(RevalInfo.HospitalName)){
+
+ sql += ' and HP_Name__c like \'%' + RevalInfo.HospitalName.trim() + '%\'';
+ }
+ if(String.isNotBlank(RevalInfo.RepairName)){
+ System.debug(LoggingLevel.INFO, '***RevalInfo.RepairName.contains(): ' + RevalInfo.RepairName.contains(' '));
+ String splitStr = null;
+ if(RevalInfo.RepairName.contains(' ')){
+ splitStr = ' ';
+ }else if(RevalInfo.RepairName.contains(',')){
+ splitStr = ',';
+ }
+ if(splitStr != null && RevalInfo.RepairName.contains(splitStr)){
+ sql += ' and (';
+ list <String> nameList = RevalInfo.RepairName.split(splitStr);
+ for(String name: nameList){
+ sql += 'Name like \'%' + name + '%\' or ';
+ }
+ sql = sql.removeEnd('or ');
+ sql += ')';
+ }else{
+ sql += ' and Name like \'%' + RevalInfo.RepairName.trim() + '%\'';
+ }
+ System.debug(LoggingLevel.INFO, '*** sql: ' + sql);
+ }
+ if(String.isNotBlank(RevalInfo.SAPRepairNo)){
+ System.debug(LoggingLevel.INFO, '***RevalInfo.SAPRepairNo.contains(): ' + RevalInfo.SAPRepairNo.contains(' '));
+ String splitStr = null;
+ if(RevalInfo.SAPRepairNo.contains(' ')){
+ splitStr = ' ';
+ }else if(RevalInfo.SAPRepairNo.contains(',')){
+ splitStr = ',';
+ }
+ if(splitStr != null && RevalInfo.SAPRepairNo.contains(splitStr)){
+ sql += ' and (';
+
+ list <String> noList = RevalInfo.SAPRepairNo.split(splitStr);
+ for(String no: noList){
+ sql += 'SAP_Service_Repair_No__c like \'%' + no + '%\' or ';
+ }
+ sql = sql.removeEnd('or ');
+ sql += ')';
+ }else{
+ sql += ' and SAP_Service_Repair_No__c like \'%' + RevalInfo.SAPRepairNo.trim() + '%\'';
+ }
+ System.debug(LoggingLevel.INFO, '*** sql: ' + sql);
+ }
+ if(String.isNotBlank(RevalInfo.SerialNumber)){
+ List<String> SerialNumberList = new List<String>();
+ if(RevalInfo.SerialNumber.indexOf(',') != -1){
+ SerialNumberList = RevalInfo.SerialNumber.split(',');
+ }
+ System.debug('SerialNumberList1:' + SerialNumberList);
+ // 鏀寔妯$硦鏌ヨ澶氫釜锛屾枃鏈杈撳叆鐢ㄨ嫳鏂囧崐瑙掗�楀彿鍒嗛殧
+ if(SerialNumberList.size() > 0){
+ sql += ' and (SerialNumber__c like \'%';
+ Integer i = 0;
+ for(String SerialNumber : SerialNumberList){
+ if(i == 0){
+ sql += SerialNumber.trim() + '%\'';
+ }else{
+ sql += 'or SerialNumber__c like \'%' + SerialNumber.trim() + '%\'';
+ }
+ i++;
+ }
+ sql += ')';
+ } else{
+ sql += ' and SerialNumber__c like \'%' + RevalInfo.SerialNumber.trim() + '%\'';
+ }
+ }
+ if(String.isNotBlank(RevalInfo.repair.Incharge_Staff__c)){
+ sql += ' and Incharge_Staff__c = \'' + RevalInfo.repair.Incharge_Staff__c + '\'';
+ }
+ if(String.isNotBlank(String.valueof(RevalInfo.repair.Aware_date__c))&&String.isNotBlank(String.valueof(RevalInfo.repair.Aware_date2__c))){
+ String day = String.valueof(RevalInfo.repair.Aware_date__c);
+ String day2 = String.valueof(RevalInfo.repair.Aware_date2__c);
+ day = day.substring(0,10);
+ day2 = day2.substring(0,10);
+ sql += ' and FSE_ApplyForRepair_Day__c >= ' + day + 'and FSE_ApplyForRepair_Day__c <=' +day2;
+ }
+ if(String.isNotBlank(RevalInfo.onSiteRepair)){
+ sql += ' and On_site_repair__c = \'' + RevalInfo.onSiteRepair + '\'';
+ }
+ if(String.isNotBlank(RevalInfo.workLocationSelect)){
+ List<String> workLocationSelectList = new List<String>();
+ if(RevalInfo.workLocationSelect.indexOf(',') != -1){
+ workLocationSelectList = RevalInfo.workLocationSelect.split(',');
+ }
+ System.debug('workLocationSelectList1:' + workLocationSelectList);
+ if(workLocationSelectList.size() > 0){
+ sql += ' and (work_location_select__c like \'%';
+ Integer i = 0;
+ for(String workLocationSelect : workLocationSelectList){
+ if(i == 0){
+ sql += workLocationSelect.trim() + '%\'';
+ }else{
+ sql += 'or work_location_select__c like \'%' + workLocationSelect.trim() + '%\'';
+ }
+ i++;
+ }
+ sql += ')';
+ } else{
+ sql += ' and work_location_select__c like \'%' + RevalInfo.workLocationSelect.trim() + '%\'';
+ }
+ }
+ if(String.isNotBlank(RevalInfo.State_Hospital)){
+ sql += ' and State_Hospital__c like \'%' + RevalInfo.State_Hospital.trim() + '%\'';
+ }
+ sql += 'and Status1__c not in(\'0.鍒犻櫎\',\'0.鍙栨秷\') limit 200';
+ System.debug('sql1LWC:' + sql);
+ if(String.isNotBlank(sql)){
+ RepairList = Database.query(sql);
+ }
+ if(RepairList.size() == 200){
+ // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '妫�绱㈡暟鎹お澶�,璇风缉灏忔绱㈣寖鍥达紒'));
+ //2023/04/07 returnData
+ returnData.status = '妫�绱㈡暟鎹お澶�,璇风缉灏忔绱㈣寖鍥达紒';
+ }
+ if(RepairList.size() <= 0){
+ // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '娌℃绱㈠埌浠讳綍淇悊'));
+ //2023/04/07 returnData
+ returnData.status = '娌℃绱㈠埌浠讳綍淇悊';
+ return returnData;
+ }
+ for(Repair__c ra : RepairList){
+ RepairData raData = new RepairData(ra);
+ RAInfoList.add(raData);
+ }
+ // return RAInfoList;
+
+ returnData.repairData = RAInfoList;
+ System.debug(LoggingLevel.INFO, '*** returnData: ' + returnData);
+ return returnData;
+ }
+
+ //鎵撳嵃PDF
+ @AuraEnabled
+ public static String showPDF(String json) {
+ System.debug(LoggingLevel.INFO, '*** joinshoPDF: ');
+ List<Repair__c> RepairList = (List<Repair__c>)System.JSON.deserialize(json,List<Repair__c>.class);
+
+ if(RepairList == null || RepairList.isEmpty()){
+ return '璇峰厛妫�绱慨鐞�';
+ }
+ repairIdList = new List<String>();
+ for(Repair__c rd : RepairList) {
+ System.debug(LoggingLevel.INFO, '*** rd: ' + rd);
+ repairIdList.add(rd.Id);
+ }
+ // RepairList = new List<Repair__c>();
+ String url = '=';
+ /*System.debug('RAInfoList:' + RAInfoList);
+ if(RAInfoList == null || RAInfoList.isEmpty()){
+ // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '璇峰厛妫�绱慨鐞�'));
+ return '璇峰厛妫�绱慨鐞�';
+ }*/
+ /*for(RepairData rd : RAInfoList) {
+ System.debug(LoggingLevel.INFO, '*** rd: ' + rd);
+ //閫変腑鐨剅epair
+ if(rd.IFCheck){
+ repairIdList.add(rd.repair.Id);
+ RepairList.add(rd.repair);
+ }
+ }*/
+ System.debug(LoggingLevel.INFO, '***repairIdList : ' + repairIdList);
+ System.debug(LoggingLevel.INFO, '***RepairList : ' + RepairList);
+ if(repairIdList.size() > 0){
+ if(repairIdList.size() <= 50){
+ if(RepairList.size() > 0){
+ System.debug(LoggingLevel.INFO, '*** if size>0 generateAttachment: ');
+ generateAttachment(RepairList);
+ }
+ for(String Id : repairIdList){
+ url += Id + '=';
+ }
+ url = url.substring(0, url.lastIndexOf('='));
+ // PageReference pageRef = new PageReference('/apex/MaintenanceCommissionPDF?id' + url);
+ // pageRef.setRedirect(true);
+ // return pageRef;
+ String pdfURL = '';
+ if(isSandbox()){
+ pdfURL = 'https://ocsm--stagefull--c.visualforce.com/apex/MaintenanceCommissionPDF?id' + url;
+ } else{
+ pdfURL = 'https://ocsm.my.salesforce.com/apex/MaintenanceCommissionPDF?id' + url;
+ }
+ return pdfURL;
+ } else{
+ // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '澶氬崟鎵撳嵃鏈�澶ф暟閲忎负50,璇烽�夋嫨灏戜簬50涓慨鐞嗭紒'));
+ return '澶氬崟鎵撳嵃鏈�澶ф暟閲忎负50,璇烽�夋嫨灏戜簬50涓慨鐞嗭紒';
+ }
+ } else{
+ // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '璇疯嚦灏戦�夋嫨涓�涓慨鐞�'));
+ return '璇疯嚦灏戦�夋嫨涓�涓慨鐞�';
+ }
+ }
+
+ // 鐢熸垚pdf娣诲姞鍒板搴旂殑淇悊涓�
+ public static PageReference generateAttachment(List<Repair__c> repList){
+ System.debug(LoggingLevel.INFO, '*** generateAttachment: ');
+ BatchSelectRepairPDFDelete pdf = new BatchSelectRepairPDFDelete();
+ pdf.deletePDF(repList);
+ pdf.createPDF(repList);
+ return null;
+ }
+
+ // 鍒ゆ柇鏄惁鏄祴璇曠幆澧�
+ public static Boolean isSandbox() {
+ return [SELECT IsSandbox FROM Organization LIMIT 1].IsSandbox;
+ }
+
+ public class RetrievalData {
+ @AuraEnabled
+ public String Status1;
+ @AuraEnabled
+ public String Status2;
+ @AuraEnabled
+ public String RepairName;
+ @AuraEnabled
+ public String SAPRepairNo;
+ @AuraEnabled
+ public String SerialNumber;
+ @AuraEnabled
+ public String onSiteRepair;
+ @AuraEnabled
+ public String workLocationSelect;
+ @AuraEnabled
+ public String State_Hospital;
+ @AuraEnabled
+ public String HospitalName;
+ @AuraEnabled
+ public Repair__c repair;
+
+ public RetrievalData(){
+ repair = new Repair__c();
+ }
+ }
+
+ public class RepairData {
+ @AuraEnabled
+ public Boolean IFCheck;
+ @AuraEnabled
+ public Repair__c repair;
+ public RepairData(Repair__c RepairInfo){
+ IFCheck = null;
+ repair = RepairInfo;
+ }
+ }
+ //2023/04/07 杩斿洖鏌ヨ缁撴灉鍜岀姸鎬�
+ public class ReturnData {
+ @AuraEnabled
+ public String status;
+ @AuraEnabled
+ public List<RepairData> repairData;
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexBatchSelectRepairLWCController.cls-meta.xml b/force-app/main/default/classes/lexBatchSelectRepairLWCController.cls-meta.xml
new file mode 100644
index 0000000..dd61d1f
--- /dev/null
+++ b/force-app/main/default/classes/lexBatchSelectRepairLWCController.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>52.0</apiVersion>
+ <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/lexCustomDeleteController.cls b/force-app/main/default/classes/lexCustomDeleteController.cls
new file mode 100644
index 0000000..dfc4ebd
--- /dev/null
+++ b/force-app/main/default/classes/lexCustomDeleteController.cls
@@ -0,0 +1,48 @@
+public with sharing class lexCustomDeleteController {
+ @AuraEnabled
+ public static InitData initForCustomDelete(String recordId){
+ InitData res=new initData();
+ try {
+ Repair__c repair=[Select Id,Status__c,FSE_ApplyForRepair_time__c,SAP_Transfer_time__c,CreatedById,Repair_Ordered_Date__c,Acc_OwnerId__c,FSE_ownerid__c FROM Repair__c WHERE Id=:recordId limit 1];
+ res.Id=repair.Id;
+ res.Status=repair.Status__c;
+ res.FSEApplyForRepairtime=repair.FSE_ApplyForRepair_time__c;
+ res.SAP=repair.SAP_Transfer_time__c;
+ res.cre=repair.CreatedById;
+ res.Rep=repair.Repair_Ordered_Date__c;
+ res.acc=repair.Acc_OwnerId__c;
+ res.FSEownerId=repair.FSE_ownerid__c;
+ // User user=[Select Id FROM User WHERE Repair__r.CreatedById=:res.cre limit 1];
+ // res.UserId=repair.User__r.Id;
+ System.debug(LoggingLevel.INFO,'***res:'+res);
+ } catch (Exception e) {
+ System.debug(LoggingLevel.INFO,'***e:'+e);
+ }
+ return res;
+ }
+
+
+ public class InitData{
+ @AuraEnabled
+ public String Id;
+ @AuraEnabled
+ public String Status;
+ @AuraEnabled
+ public Datetime SAP;
+ @AuraEnabled
+ public Datetime FSEApplyForRepairtime;
+ @AuraEnabled
+ public String cre;
+ @AuraEnabled
+ public Date Rep;
+ @AuraEnabled
+ public String acc;
+ @AuraEnabled
+ public String FSEownerId;
+ @AuraEnabled
+ public String UserId;
+ @AuraEnabled
+ public String ApiSessionId;
+
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexCustomDeleteController.cls-meta.xml b/force-app/main/default/classes/lexCustomDeleteController.cls-meta.xml
new file mode 100644
index 0000000..fbbad0a
--- /dev/null
+++ b/force-app/main/default/classes/lexCustomDeleteController.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>56.0</apiVersion>
+ <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/lexNewRepairAuraController.cls b/force-app/main/default/classes/lexNewRepairAuraController.cls
new file mode 100644
index 0000000..e8e1279
--- /dev/null
+++ b/force-app/main/default/classes/lexNewRepairAuraController.cls
@@ -0,0 +1,438 @@
+/**
+ * 2023-04-14
+ * Lightning new Repair
+ */
+public with sharing class lexNewRepairAuraController {
+ public static String sobjectTypeValue = 'Repair__c';
+ //鏌ヨRepair鏁版嵁 淇悊瀵硅薄鐨刵ew鍜寀pdate
+ @AuraEnabled
+ public static ReturnData init(String recordId,String urlStr) {
+ ReturnData res = new ReturnData();
+ String sobjectId = [SELECT CustomObjectId,CustomObjectName FROM CustomObjectUserLicenseMetrics where CustomObjectName ='Repair' limit 1].CustomObjectId;
+ String Input_Required_Field_Msg = Label.Input_Required_Field_Msg;
+ String PIPL_Name_Label = Label.PIPL_Name_Label;
+ String PIPL_Input_Account_Error_Msg = label.PIPL_Input_Account_Error_Msg;
+ Map<string,string> mso = (Map<string,string>)JSON.deserialize(urlStr, Map<string,string>.class);
+ system.debug('mso='+mso);
+ if (recordId != null) {
+ res.recordTypeId = [SELECT Id,RecordTypeId FROM Repair__c WHERE Id = :recordId].RecordTypeId;
+ res.status = true;
+ }
+ String RepairSubOrderAWSDataId;
+ // AssignValueFromUrl(mso,controller.getRecord());
+ //閫氳繃id鏌� 闂
+ //PIPL zhj 2022-11-11 start
+ //浠庢姤淇瓙鍗曡繃鏉�00N10000009H1rR
+ if (mso.containsKey('CF00N10000009H1rR_lkid')) {
+ String repairSubOrderId = mso.get('CF00N10000009H1rR_lkid');
+ System.debug('repairSubOrderId = ' + repairSubOrderId);
+ //鏌ヨAWSDataId
+ List<RepairSubOrder__c> rso = [select AWS_Data_Id__c from RepairSubOrder__c where Id=:repairSubOrderId];
+ if(rso.size() > 0){
+ //todo 浠庢姤淇瓙鍗曡繃鏉ワ紝闇�瑕佽В瀵嗘姤淇汉 lwc鏄惁闇�瑕佽繘琛岃В瀵嗗鐞嗭紵
+ RepairSubOrderAWSDataId = rso[0].AWS_Data_Id__c;
+ res.AWS_Data_Id = rso[0].AWS_Data_Id__c;
+ res.status = true;
+ }
+ }
+ //PIPL zhj 2022-11-11 end
+ List<Repair__c> rc = new List<Repair__c>();
+ system.debug('retURL=' + mso.containsKey('retURL'));
+ if (mso.containsKey('retURL')) {
+ String RepairId = mso.get('retURL').substring(1);
+ System.debug('RepairId = ' + RepairId);
+ rc = [select Hospital__c,Department_Class__c,Account__c,Dealer__c,Incharge_Staff_Contact__c,Incharge_Staff__c, RepairSubOrder__c,On_Call_ID__c,QIS_ID__c, InsReport__c,Rental_Apply_Equipment_Set_Detail__c from Repair__c where id =:RepairId ];
+ System.debug('rc = ' + rc);
+ if(rc.size() > 0){
+ //宸叉湁鏁版嵁璧嬪��
+ //鍖婚櫌
+ res.Hospital = rc[0].Hospital__c;
+ //鎴樼暐绉戝鍒嗙被
+ res.Department_Class = rc[0].Department_Class__c;
+ //绉戝
+ res.Account = rc[0].Account__c;
+ //缁忛攢鍟嗗悕
+ res.Dealer = rc[0].Dealer__c;
+ //淇悊濮旀墭鑰咃紙鍛樺伐锛�
+ res.Incharge_Staff_Contact = rc[0].Incharge_Staff_Contact__c;
+ //淇悊濮旀墭鑰�(FSE)
+ res.Incharge_Staff = rc[0].Incharge_Staff__c;
+ //鎶ヤ慨瀛愬崟RepairSubOrder__c
+ res.RepairSubOrder = rc[0].RepairSubOrder__c;
+ //鏌ヨAWSDataId
+ List<RepairSubOrder__c> rso = [select AWS_Data_Id__c from RepairSubOrder__c where Id=:rc[0].RepairSubOrder__c];
+ if(rso.size() > 0){
+ RepairSubOrderAWSDataId = rso[0].AWS_Data_Id__c;
+ res.AWS_Data_Id = rso[0].AWS_Data_Id__c;
+ }
+ //On-Call鍙风爜On_Call_ID__c
+ res.On_Call_ID = rc[0].On_Call_ID__c;
+ //QIS鍙风爜QIS_ID__c
+ res.QIS_ID = rc[0].QIS_ID__c;
+ //鐐规鎶ュ憡涔nsReport__c
+ res.InsReport = rc[0].InsReport__c;
+ //鍊熷嚭澶囧搧閰嶅涓�瑙堟槑缁哛ental_Apply_Equipment_Set_Detail__c
+ res.Rental_Apply_Equipment_Set_Detail = rc[0].Rental_Apply_Equipment_Set_Detail__c;
+
+ res.status = true;
+ }
+
+ }
+ //2023/04/23 lwc鐨勪繚瀛樺苟鏂板缓 淇濆瓨鍚庡埛鏂伴〉闈�
+ // PIHelper.PIIntegration piIntegration = PIHelper.getPIIntegrationInfo('Repair__c');
+ // PIHelper.PIIntegration piIntegrationAddress = PIHelper.getPIIntegrationInfo('Address__c');
+ // PIHelper.PIIntegration piIntegrationContact = PIHelper.getPIIntegrationInfo('Contact');
+ // PIHelper.PIIntegration piIntegrationRepairSubOrder = PIHelper.getPIIntegrationInfo('RepairSubOrder__c');
+ // String staticResource = JSON.serialize(piIntegration);
+ // //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
+ // String staticResourceV2 = JSON.serialize(PIHelper.getPIIntegrationInfo('Repair__cV2'));
+ // //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
+ // String staticResourceAddress = JSON.serialize(piIntegrationAddress);
+ // String staticResourceContact = JSON.serialize(piIntegrationContact);
+ // String staticResourceRepairSubOrder = JSON.serialize(piIntegrationRepairSubOrder);
+ // List<String> encryptedAPIList = piIntegration.PIFields;
+ // String sobjectPrefix = piIntegration.sobjectPrefix;
+
+ //save and new url page澶勪繚瀛樺苟鏂板缓璺宠浆鍦板潃锛歯ew?recordTypeId=01210000000QmS9&additionalParams=retURL%3D%252Fa0J%252Fo%26&count=1
+ // String newUrl = '/setup/ui/recordtypeselect.jsp?ent=' + sobjectId + '&retURL=/' + sobjectPrefix + '/o&save_new_url=/' + sobjectPrefix + '/e?retURL=%2F' + sobjectPrefix + '%2Fo';
+ // res.newUrl = newUrl;
+
+ return res;
+ }
+
+ public static String getAllFieldNames(String objName){
+ Map <String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
+ List<Schema.sObjectField> fields = schemaMap.get(objName).getDescribe().fields.getMap().values();
+
+ String fieldString = '';
+ for( Schema.sObjectField field : fields ){
+ fieldString += field + ',';
+ }
+ fieldString = fieldString.removeEnd(',');
+
+ return fieldString;
+ }
+
+ // @AuraEnabled
+ public static List <LayoutDescriberHelper.LayoutSection > init1(String recordId,String urlStr) {
+ String sobjectId = [SELECT CustomObjectId,CustomObjectName FROM CustomObjectUserLicenseMetrics where CustomObjectName ='Repair' limit 1].CustomObjectId;
+ Boolean isNewMode = true;
+ String Input_Required_Field_Msg = Label.Input_Required_Field_Msg;
+ String PIPL_Name_Label = Label.PIPL_Name_Label;
+ String PIPL_Input_Account_Error_Msg = label.PIPL_Input_Account_Error_Msg;
+ String rtTypeId;
+ // String sobjecttypeForFrontEnd = sobjectTypeValue;
+ //鑾峰彇鎵�鏈夊瓧娈�
+ // List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Repair__c').getDescribe().fields.getMap().keyset());
+ // Add fields to controller. This is to avoid the SOQL error in visualforce page
+ // if(!Test.isRunningTest()){
+ // controller.addFields(fieldList);
+ // }
+ // SObject obj = controller.getRecord();
+ if(recordId == ''){
+ //鏇存柊 椤甸潰鍒ゆ柇
+ // isNewMode = false;
+ Repair__c repairData = [select Id,RecordTypeId,AWS_Data_Id__c,Address_AWS_Data_Id__c,Contact_AWS_Data_Id__c,Address_Contacts_Encrypt__c,Address_Contacts_Name_Encrypt__c,Address_Telephone_Encrypt__c,Address_ZipCode_Encrypt__c,Detailed_Address_Encrypt__c from Repair__c where id =: recordId];
+ rtTypeId = repairData.RecordTypeId;
+ String AWSDataId = repairData.AWS_Data_Id__c;
+ String DecryptAWSDataId = String.valueOf(repairData.Address_AWS_Data_Id__c);
+ String ContactAWSDataId = String.valueOf(repairData.Contact_AWS_Data_Id__c);
+ }else{
+ //get url 鍙傛暟
+ // Map<string,string> mso = ApexPages.currentPage().getParameters();
+ Map<string,string> mso = (Map<string,string>)JSON.deserialize(urlStr, Map<string,string>.class);
+ system.debug('mso='+mso);
+ // AssignValueFromUrl(mso,controller.getRecord());
+ //閫氳繃id鏌� 闂
+ //PIPL zhj 2022-11-11 start
+ //浠庢姤淇瓙鍗曡繃鏉�00N10000009H1rR
+ if (mso.containsKey('CF00N10000009H1rR_lkid')) {
+ String repairSubOrderId = mso.get('CF00N10000009H1rR_lkid');
+ System.debug('repairSubOrderId = ' + repairSubOrderId);
+ //鏌ヨAWSDataId
+ List<RepairSubOrder__c> rso = [select AWS_Data_Id__c from RepairSubOrder__c where Id=:repairSubOrderId];
+ if(rso.size() > 0){
+ String RepairSubOrderAWSDataId = rso[0].AWS_Data_Id__c;
+ }
+ }
+ //PIPL zhj 2022-11-11 end
+ List<Repair__c> rc = new List<Repair__c>();
+ system.debug('retURL=' + mso.containsKey('retURL'));
+ if (mso.containsKey('retURL')) {
+ String RepairId = mso.get('retURL').substring(1);
+ System.debug('RepairId = ' + RepairId);
+ rc = [select Hospital__c,Department_Class__c,Account__c,Dealer__c,Incharge_Staff_Contact__c,Incharge_Staff__c, RepairSubOrder__c,On_Call_ID__c,QIS_ID__c, InsReport__c,Rental_Apply_Equipment_Set_Detail__c from Repair__c where id =:RepairId ];
+ System.debug('rc = ' + rc);
+ if(rc.size() > 0){
+ //宸叉湁鏁版嵁璧嬪�� defaultValue
+ /*//鍖婚櫌
+ controller.getRecord().put('Hospital__c',rc[0].Hospital__c);
+ //鎴樼暐绉戝鍒嗙被
+ controller.getRecord().put('Department_Class__c',rc[0].Department_Class__c);
+ //绉戝
+ controller.getRecord().put('Account__c',rc[0].Account__c);
+ //缁忛攢鍟嗗悕
+ controller.getRecord().put('Dealer__c',rc[0].Dealer__c);
+ //淇悊濮旀墭鑰咃紙鍛樺伐锛�
+ controller.getRecord().put('Incharge_Staff_Contact__c',rc[0].Incharge_Staff_Contact__c);
+ //淇悊濮旀墭鑰�(FSE)
+ controller.getRecord().put('Incharge_Staff__c',rc[0].Incharge_Staff__c);
+ //鎶ヤ慨瀛愬崟RepairSubOrder__c
+ controller.getRecord().put('RepairSubOrder__c',rc[0].RepairSubOrder__c);
+ //鏌ヨAWSDataId
+ List<RepairSubOrder__c> rso = [select AWS_Data_Id__c from RepairSubOrder__c where Id=:rc[0].RepairSubOrder__c];
+ if(rso.size() > 0){
+ RepairSubOrderAWSDataId = rso[0].AWS_Data_Id__c;
+ }
+ //On-Call鍙风爜On_Call_ID__c
+ controller.getRecord().put('On_Call_ID__c',rc[0].On_Call_ID__c);
+ //QIS鍙风爜QIS_ID__c
+ controller.getRecord().put('QIS_ID__c',rc[0].QIS_ID__c);
+ //鐐规鎶ュ憡涔nsReport__c
+ controller.getRecord().put('InsReport__c',rc[0].InsReport__c);
+ //鍊熷嚭澶囧搧閰嶅涓�瑙堟槑缁哛ental_Apply_Equipment_Set_Detail__c
+ controller.getRecord().put('Rental_Apply_Equipment_Set_Detail__c',rc[0].Rental_Apply_Equipment_Set_Detail__c);*/
+ }
+
+ }
+
+ // rtTypeId = ApexPages.currentPage().getParameters().get('RecordType');
+ rtTypeId = mso.get('RecordType');
+ if(String.isBlank(rtTypeId)||String.isEmpty(rtTypeId)){
+ List<RecordType> rtList = new List<RecordType>([select Id,DeveloperName from RecordType where SobjectType ='Repair__c' and DeveloperName ='Repair']);
+ rtTypeId = rtList[0].Id;
+ }
+ }
+ LayoutDescriberHelper.LayoutWrapper LayoutWrapperValue = LayoutDescriberHelper.describeSectionWithFieldsWrapper(rtTypeId, 'Repair__c','classic');
+ List <LayoutDescriberHelper.LayoutSection > layoutSections = LayoutWrapperValue.layoutSections;
+ String layoutSectionsStr = JSON.serialize(layoutSections); //for dynamic add readonly attribute
+ List<String> requiredFieldAPIList = LayoutWrapperValue.requiredFieldAPIList;
+ Map<String,String> fieldAPIToLabelMap = LayoutWrapperValue.fieldAPIToLabelMap;
+ String requiredFieldAPIListStr = JSON.serialize(requiredFieldAPIList);
+ String fieldAPIToLabelMapStr = JSON.serialize(fieldAPIToLabelMap);
+ PIHelper.PIIntegration piIntegration = PIHelper.getPIIntegrationInfo('Repair__c');
+ PIHelper.PIIntegration piIntegrationAddress = PIHelper.getPIIntegrationInfo('Address__c');
+ PIHelper.PIIntegration piIntegrationContact = PIHelper.getPIIntegrationInfo('Contact');
+ PIHelper.PIIntegration piIntegrationRepairSubOrder = PIHelper.getPIIntegrationInfo('RepairSubOrder__c');
+ String staticResource = JSON.serialize(piIntegration);
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
+ String staticResourceV2 = JSON.serialize(PIHelper.getPIIntegrationInfo('Repair__cV2'));
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
+ String staticResourceAddress = JSON.serialize(piIntegrationAddress);
+ String staticResourceContact = JSON.serialize(piIntegrationContact);
+ String staticResourceRepairSubOrder = JSON.serialize(piIntegrationRepairSubOrder);
+ List<String> encryptedAPIList = piIntegration.PIFields;
+ String sobjectPrefix = piIntegration.sobjectPrefix;
+ //鑾峰彇lookup瀛楁
+ List<String> VLookUpFields = new List<String>();
+ for (LayoutDescriberHelper.LayoutSection ls : layoutSections) {
+ for (LayoutDescriberHelper.LayoutField lf : ls.layoutFields) {
+ if (lf.fieldAPI != '' && lf.fieldType == 'reference') {
+ VLookUpFields.add(lf.fieldAPI);
+ }
+ }
+ }
+ String VLookUpFieldsJson = Json.serialize(VLookUpFields);
+ System.debug(LoggingLevel.INFO, '*** layoutSectionsLWC: ' + layoutSections);
+ return layoutSections;
+ }
+
+ // 浠巙rl鍙傛暟璧嬪�煎埌褰撳墠椤甸潰
+ public static void AssignValueFromUrl(Map<string,string> mso, sobject sobj){
+
+ String sobject_name = sobj.getSObjectType().getDescribe().getName();
+ Map<string,object> temp = new Map<string,object>();
+ Map<string,FieldDefinition> fdm = new Map<string,FieldDefinition>();
+ List<FieldDefinition> fds = [SELECT Id, DurableId, QualifiedApiName,ValueTypeId , EntityDefinitionId, NamespacePrefix,EntityDefinition.NamespacePrefix, DeveloperName, MasterLabel, Label FROM FieldDefinition where EntityDefinition.QualifiedApiName = :sobject_name];
+ for(FieldDefinition fd : fds){
+ //system.debug(fd.DurableId);
+ fdm.put(fd.DurableId.split('\\.')[1],fd);
+ }
+
+ for(string key : mso.keySet()){
+ if (key.toLowerCase() == 'id') {
+ System.debug('skip id assign');
+ continue;
+ }
+ string new_key = key;
+ system.debug('new_key='+new_key);
+ if(new_key.contains('_lkid')){
+ new_key = new_key.replace('_lkid', '');
+ new_key = new_key.substring(2);
+ }else{
+ if(temp.containsKey(new_key)){
+ continue;
+ }
+ }
+
+ system.debug('now new_key='+new_key);
+ if(fdm.containsKey(new_key)){
+ system.debug('fdm.get(new_key)='+fdm.get(new_key));
+ string val_str = mso.get(key);
+ system.debug('val_str='+val_str);
+ /*鏃犻渶鍋歞ecode锛宻f鍐呴儴宸茬粡鍋氬ソ
+ try{
+ val_str = EncodingUtil.urlDecode(mso.get(key),'UTF-8');
+ }catch(Exception e){
+ continue;
+ system.debug('Exception from get Key:'+e.getMessage());
+ system.debug(e.getStackTraceString());
+ } */
+ object val = null;
+ string type_id = fdm.get(new_key).ValueTypeId;
+ // address, boolean, date, datetime, double, id, location, string, time
+ if(string.isBlank(val_str)){
+ val = null;
+ }else if(type_id == 'boolean'){
+ if(val_str == '1'){
+ val = true;
+ }else{
+ val = boolean.valueOf(val_str);
+ }
+ }else if(type_id == 'date'){
+ //
+ try{
+ val = date.parse(val_str);
+ }catch(Exception e){
+ system.debug('val_str='+val_str);
+ system.debug(e.getMessage());
+ system.debug(e.getStackTraceString());
+ try{
+ val = date.valueOf(val_str);
+ }catch(Exception ee){
+ system.debug('val_str='+val_str);
+ system.debug(ee.getMessage());
+ system.debug(ee.getStackTraceString());
+ continue;
+ }
+ }
+ }else if(type_id == 'datetime'){
+ //
+ try{
+ val = datetime.parse(val_str);
+ }catch(Exception e){
+ system.debug('val_str='+val_str);
+ system.debug(e.getMessage());
+ system.debug(e.getStackTraceString());
+ try{
+ val = datetime.valueOf(val_str);
+ }catch(Exception ee){
+ system.debug('val_str='+val_str);
+ system.debug(ee.getMessage());
+ system.debug(ee.getStackTraceString());
+ continue;
+ }
+ }
+ }else if(type_id == 'double' || type_id == 'number'){
+ try{
+ val = decimal.valueOf(val_str.replace(',', ''));
+ }catch(Exception ee){
+ system.debug('val_str='+val_str);
+ system.debug(ee.getMessage());
+ system.debug(ee.getStackTraceString());
+ continue;
+ }
+
+ }else if(type_id == 'id' || type_id == 'string'){
+ val = val_str;
+ }else{
+ system.debug('type_id='+type_id+' is not support to convert');
+ continue;
+ }
+ temp.put(fdm.get(new_key).QualifiedApiName,val);
+ }else{
+ system.debug(key+' is not in fdm');
+ }
+ }
+
+ for(string key : temp.keySet()){
+ system.debug('assign '+key+'='+temp.get(key));
+ try{
+ sobj.put(key, temp.get(key));
+ }catch(Exception e){
+ system.debug(e.getMessage());
+ system.debug(e.getStackTraceString());
+ }
+ }
+ }
+
+ public class RetrievalData {
+ @AuraEnabled
+ public String Status1;
+ @AuraEnabled
+ public String Status2;
+ @AuraEnabled
+ public String RepairName;
+ @AuraEnabled
+ public String SAPRepairNo;
+ @AuraEnabled
+ public String SerialNumber;
+ @AuraEnabled
+ public String onSiteRepair;
+ @AuraEnabled
+ public String workLocationSelect;
+ @AuraEnabled
+ public String State_Hospital;
+ @AuraEnabled
+ public String HospitalName;
+ @AuraEnabled
+ public Repair__c repair;
+
+ public RetrievalData(){
+ repair = new Repair__c();
+ }
+ }
+
+ public class RepairData {
+ @AuraEnabled
+ public Boolean IFCheck;
+ @AuraEnabled
+ public Repair__c repair;
+ public RepairData(Repair__c RepairInfo){
+ IFCheck = null;
+ repair = RepairInfo;
+ }
+ }
+ //2023/04/18 杩斿洖鏌ヨ缁撴灉鍜岀姸鎬�
+ public class ReturnData {
+ //鍒ゆ柇鏄惁鏈塕epair鐨勯粯璁ゅ��
+ @AuraEnabled
+ public Boolean status;
+ // @AuraEnabled
+ // public Repair__c repair;
+ //todo 鎶ヤ慨浜�
+ @AuraEnabled
+ public String AWS_Data_Id;
+ //鍖婚櫌
+ @AuraEnabled
+ public String Hospital;
+ @AuraEnabled
+ public String Department_Class;
+ @AuraEnabled
+ public String Account;
+ @AuraEnabled
+ public String Dealer;
+ @AuraEnabled
+ public String Incharge_Staff_Contact;
+ @AuraEnabled
+ public String Incharge_Staff;
+ @AuraEnabled
+ public String RepairSubOrder;
+ @AuraEnabled
+ public String On_Call_ID;
+ @AuraEnabled
+ public String QIS_ID;
+ @AuraEnabled
+ public String InsReport;
+ @AuraEnabled
+ public String Rental_Apply_Equipment_Set_Detail;
+ @AuraEnabled
+ public String recordTypeId;
+ // @AuraEnabled
+ // public String newUrl;
+
+ public ReturnData(){
+ this.status = false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexNewRepairAuraController.cls-meta.xml b/force-app/main/default/classes/lexNewRepairAuraController.cls-meta.xml
new file mode 100644
index 0000000..40d6793
--- /dev/null
+++ b/force-app/main/default/classes/lexNewRepairAuraController.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>54.0</apiVersion>
+ <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/lwc/lexBatchSelectRepairLWC/lexBatchSelectRepairLWC.css b/force-app/main/default/lwc/lexBatchSelectRepairLWC/lexBatchSelectRepairLWC.css
new file mode 100644
index 0000000..fa4ac70
--- /dev/null
+++ b/force-app/main/default/lwc/lexBatchSelectRepairLWC/lexBatchSelectRepairLWC.css
@@ -0,0 +1,9 @@
+.Narrow{
+ padding: 20px;
+}
+.searchField,.searchField .input-text{
+ /*display: flex;*/
+}
+.searchField .slds-combobox_container{
+ width: 160px !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexBatchSelectRepairLWC/lexBatchSelectRepairLWC.html b/force-app/main/default/lwc/lexBatchSelectRepairLWC/lexBatchSelectRepairLWC.html
new file mode 100644
index 0000000..07ec8af
--- /dev/null
+++ b/force-app/main/default/lwc/lexBatchSelectRepairLWC/lexBatchSelectRepairLWC.html
@@ -0,0 +1,107 @@
+<template>
+ <!-- <div class="slds-box slds-theme--default">
+ Click on the link Below to Export data as csv/xls.
+ <p class="slds-m-top--large">
+ <a onclick={exportContactData}>Export Contact Data</a>
+ <lightning-button variant="brand" label="Export Contact data" title="Export Contact Data" onclick={exportContactData}></lightning-button>
+ </p>
+ </div> -->
+ <lightning-card variant="Narrow">
+ <div style="padding: 0 20px">
+ <div>
+ <div style="padding: 10px 3px;border-bottom: 1px solid;font: 16px;font-size: blod;">妫�绱㈠垪</div>
+ <div style="margin-top: 5px">
+ <lightning-layout>
+ <!-- cancelPaddingLeft -->
+ <lightning-layout-item flexibility="auto" padding="around-small">
+ <lightning-combobox name="progress" label="鐘舵��1" value={searchObj.Status1} options={status1Options}
+ onchange={handleStatus1Change} class="searchField"></lightning-combobox>
+ </lightning-layout-item>
+ <lightning-layout-item flexibility="auto" padding="around-small">
+ <lightning-combobox
+ name="progress" label="鐘舵��2" value={searchObj.Status2} options={status2Options} onchange={handleStatus2Change}
+ class="searchField"></lightning-combobox>
+ </lightning-layout-item>
+ <lightning-layout-item flexibility="auto" padding="around-small">
+ <lightning-combobox
+ name="progress" label="鏈嶅姟鏂瑰紡" value={searchObj.onSiteRepair} options={siteRepairItems} onchange={handleSiteChange}
+ class="searchField"></lightning-combobox>
+ </lightning-layout-item>
+ </lightning-layout>
+ <lightning-layout>
+ <lightning-layout-item size="4" padding="horizontal-small">
+ <lightning-input value={searchObj.RepairName} type="text" label="RS淇悊鍗曞彿" class="searchField" onchange={handleRepairNameChange}></lightning-input>
+ </lightning-layout-item>
+ <lightning-layout-item size="4" padding="horizontal-small">
+ <lightning-input value={searchObj.SAPRepairNo} type="text" label="SAP淇悊鍗曞彿" class="searchField" onchange={handleSAPRepairNoChange}></lightning-input>
+ </lightning-layout-item>
+ <lightning-layout-item size="4" padding="horizontal-small">
+ <lightning-input value={searchObj.workLocationSelect} type="text" label="缁翠慨涓績" class="searchField" onchange={handleWorkLocationChange}></lightning-input>
+ </lightning-layout-item>
+ </lightning-layout>
+ <lightning-layout>
+ <lightning-layout-item size="4" padding="horizontal-small">
+ <lightning-input value={searchObj.SerialNumber} type="text" label="鏈鸿韩缂栫爜" class="searchField" onchange={handleSerialNumberChange}></lightning-input>
+ </lightning-layout-item>
+ <lightning-layout-item size="4" padding="horizontal-small">
+ <lightning-input value={searchObj.State_Hospital} type="text" label="鐪佷唤" class="searchField" onchange={handleStateHospitalChange}></lightning-input>
+ </lightning-layout-item>
+ <lightning-layout-item size="4" padding="horizontal-small">
+ <lightning-input value={searchObj.HospitalName} type="text" label="鍖婚櫌鍚嶇О" class="searchField" onchange={handleHospitalChange}></lightning-input>
+ </lightning-layout-item>
+ </lightning-layout>
+ <lightning-layout>
+ <lightning-layout-item size="2" padding="horizontal-small">
+ <lightning-input type="date" label="FSE鐢宠鏃�(寮�濮�)" value={repair.Aware_date__c} onchange={handleAwareDateDStart}></lightning-input>
+ </lightning-layout-item>
+ <!-- cancelPaddingLeft -->
+ <lightning-layout-item size="2" padding="horizontal-small">
+ <!-- variant="label-hidden" -->
+ <lightning-input type="date" label="FSE鐢宠鏃�(缁撴潫)" value={repair.Aware_date2__c} onchange={handleAwareDateDEnd}></lightning-input>
+ </lightning-layout-item>
+ <lightning-layout-item size="4" padding="horizontal-small">
+ <!-- record-id={recordId} 淇悊濮旀墭鑰� Incharge_Staff__c-->
+ <!-- <lightning-record-edit-form
+ object-api-name={objectApiName}
+ record-id=''
+ >
+ <lightning-input-field field-name={nameField} onclick={handleInchargeStaffChange}> </lightning-input-field>
+ </lightning-record-edit-form> -->
+ <lightning-record-edit-form
+ object-api-name='Repair__c'
+ record-id=''
+ >
+ <lightning-input-field field-name='Incharge_Staff__c' onclick={handleInchargeStaffChange}> </lightning-input-field>
+ </lightning-record-edit-form>
+ </lightning-layout-item>
+ </lightning-layout>
+ <lightning-layout>
+ <lightning-layout-item flexibility="auto" padding="around-small">
+ <lightning-button label="妫�绱�" onclick={searchRepair}></lightning-button>
+ </lightning-layout-item>
+ </lightning-layout>
+ </div>
+ </div>
+ <div>
+ <div style="padding: 10px 5px;border-bottom: 1px solid">璇︾粏淇℃伅</div>
+ <div style="padding: 10px 0;">
+ <lightning-button label="鎵撳嵃PDF" onclick={skipPage}></lightning-button>
+
+ <lightning-button label="瀵煎嚭Excel" onclick={exportContactData}></lightning-button>
+ <!-- <lightning-button label="瀵煎嚭Excel" onclick={downloadCSVFile}></lightning-button> -->
+ </div>
+ <div>
+ <lightning-datatable
+ key-field="id"
+ data={data}
+ columns={columns}
+ onrowselection={getSelectedRows}
+ onrowaction={handleRowAction}>
+
+ </lightning-datatable>
+ </div>
+ </div>
+ </div>
+ </lightning-card>
+
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexBatchSelectRepairLWC/lexBatchSelectRepairLWC.js b/force-app/main/default/lwc/lexBatchSelectRepairLWC/lexBatchSelectRepairLWC.js
new file mode 100644
index 0000000..d1a1131
--- /dev/null
+++ b/force-app/main/default/lwc/lexBatchSelectRepairLWC/lexBatchSelectRepairLWC.js
@@ -0,0 +1,576 @@
+import { LightningElement,wire,track,api} from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { NavigationMixin } from 'lightning/navigation';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+
+import NAME_FIELD from '@salesforce/schema/Repair__c.Incharge_Staff__c';
+import MY_CUSTOM_OBJECT from '@salesforce/schema/Repair__c';
+
+import search from '@salesforce/apex/lexBatchSelectRepairLWCController.search';
+import showPDF from '@salesforce/apex/lexBatchSelectRepairLWCController.showPDF';
+
+/*
+const actions = [
+ { label: 'Show details', name: 'show_details' },
+ { label: 'Delete', name: 'delete' },
+ ];*/
+
+const columns = [
+ { label: '鐘舵��1', fieldName: 'Status1__c'},
+ { label: '鐘舵��2', fieldName: 'Status2__c' },
+ { label: 'RS淇悊鍗曞彿', fieldName: 'Name' },
+ { label: 'SAP淇悊鍗曞彿', fieldName: 'SAP_Service_Repair_No__c' },
+ // { label: '鍨嬪彿', fieldName: 'deliveredProductName' },
+ { label: '鍨嬪彿', fieldName: 'deliveredProductUrl',type:'url',
+ typeAttributes:{
+ label:{
+ fieldName:'deliveredProductName'
+ },
+ target:'_balank'
+ }
+ },
+ { label: '鏈鸿韩缂栧彿', fieldName: 'SerialNumber__c' },
+ { label: '鍖婚櫌鍚嶇О', fieldName: 'HP_Name__c' },
+ { label: '鐪佷唤', fieldName: 'State_Hospital__c' },
+ // { label: '淇悊濮旀墭鑰�', fieldName: 'Incharge_Staff_Name' },
+ { label: '淇悊濮旀墭鑰�', fieldName: 'inchargeStaffUrl',type:'url',
+ typeAttributes:{
+ label:{
+ fieldName:'inchargeStaffName'
+ },
+ target:'_balank'
+ }
+ },
+ { label: 'FSE鐢宠鏃ユ湡', fieldName: 'FSE_ApplyForRepair_Day__c' },
+ { label: '缁翠慨涓績', fieldName: 'work_location_select__c' },
+ { label: '鏈嶅姟鏂瑰紡', fieldName: 'On_site_repair__c' },
+ { label: '鏈夋棤缁翠慨鍚堝悓瀵硅薄', fieldName: 'Number_of_EffectiveContract__c' },
+ { label: '鏃犲伩鍖哄埆鏍囧織', fieldName: 'NewProductGuaranteeObject__c' }
+ /* {
+ type: 'action',
+ typeAttributes: { rowActions: actions },
+ },*/
+ ];
+
+export default class lexBatchSelectRepairLWC extends LightningElement {
+ // Expose a field to make it available in the template
+ nameField = NAME_FIELD;
+
+ // Flexipage provides recordId and objectApiName
+ @api recordId;
+ @api objectApiName;
+
+ data = [];
+ columns = columns;
+
+ //鐘舵��1
+ status1Options = [{ label: '--鏃�--', value: '' },
+ { label: '0.鐢宠瀹屾瘯', value: '0.鐢宠瀹屾瘯' },
+ { label: '2.缁翠慨鎶ヤ环闃舵', value: '2.缁翠慨鎶ヤ环闃舵' },
+ { label: '3.缁翠慨闃舵', value: '3.缁翠慨闃舵' },
+ { label: '4.淇悊鍝佽繑閫侀樁娈�', value: '4.淇悊鍝佽繑閫侀樁娈�' },
+ { label: '5.瀹屾瘯', value: '5.瀹屾瘯' },
+ { label: '0.鍒犻櫎', value: '0.鍒犻櫎' },
+ { label: '0.鍙栨秷', value: '0.鍙栨秷' }];
+ //鐘舵��2
+ status2Options = [{label:'00.鐢宠瀹屾瘯', value:'00.鐢宠瀹屾瘯'},
+ {label:'01.鍒嗗叕鍙稿彈鐞嗗畬姣�', value:'01.鍒嗗叕鍙稿彈鐞嗗畬姣�'},
+ {label:'02.RC鍙楃悊瀹屾瘯', value:'02.RC鍙楃悊瀹屾瘯'},
+ {label:'03.鎶ヤ环妫�鏌ョ粨鏉�', value:'03.鎶ヤ环妫�鏌ョ粨鏉�'},
+ {label:'04.鎶ヤ环璺熻繘涓�', value:'04.鎶ヤ环璺熻繘涓�'},
+ {label:'05.鎶ヤ环鍚屾剰瀹屽', value:'05.鎶ヤ环鍚屾剰瀹屽'},
+ {label:'06.闆朵欢榻愬', value:'06.闆朵欢榻愬'},
+ {label:'07.淇悊闁嬪', value:'07.淇悊闁嬪'},
+ {label:'08.淇悊棰勮瀹屾垚', value:'08.淇悊棰勮瀹屾垚'},
+ {label:'09.淇悊瀹屾垚', value:'09.淇悊瀹屾垚'},
+ {label:'10.鏈�缁堟鏌ュ畬鎴�', value:'10.鏈�缁堟鏌ュ畬鎴�'},
+ {label:'11.RC淇悊鍝佸凡杩旈��', value:'11.RC淇悊鍝佸凡杩旈��'},
+ {label:'12.鍙戠エ宸插彂閫�', value:'12.鍙戠エ宸插彂閫�'},
+ {label:'13.宸茶繑閫佸埌鐢ㄦ埛', value:'13.宸茶繑閫佸埌鐢ㄦ埛'},
+ {label:'14.鏀跺埌楠屾敹鍗�', value:'14.鏀跺埌楠屾敹鍗�'},
+ {label:'15.楠屾敹鍗曠鏀跺鏍搁�氳繃', value:'15.楠屾敹鍗曠鏀跺鏍搁�氳繃'},
+ {label:'16.閮ㄥ垎浠樻', value:'16.閮ㄥ垎浠樻'},
+ {label:'16.瀹屾瘯', value:'16.瀹屾瘯'},
+ {label:'17.浠樻瀹屾瘯', value:'17.浠樻瀹屾瘯'},
+ {label:'00.鍙栨秷', value:'00.鍙栨秷'},
+ {label:'00.鍒犻櫎', value:'00.鍒犻櫎'},
+ {label:'00.鍏抽棴', value:'00.鍏抽棴'}];
+ //鏈嶅姟鏂瑰紡
+ siteRepairItems = [{label:'--鏃�--',value:''},
+ {label:'RC淇悊',value:'RC淇悊'},
+ {label:'鐩撮�丼ORC淇悊',value:'鐩撮�丼ORC淇悊'},
+ {label:'鐩撮�丱GZ淇悊',value:'鐩撮�丱GZ淇悊'},
+ {label:'鍔炰簨澶勪慨鐞�',value:'鍔炰簨澶勪慨鐞�'},
+ {label:'鐜板満淇悊',value:'鐜板満淇悊'}];
+
+ searchObj = {};
+ repair = {};
+ selectedRepairs;
+
+ /* @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+ console.log(111);
+ console.log(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(this.recordId);
+ }
+ //鐘舵��1
+ handleStatus1Change(event){
+ /*console.log(event);
+ console.log(event.detail);*/
+ this.searchObj.Status1 = event.detail.value;
+ // console.log(JSON.stringify(this.searchObj));
+ }
+ //鐘舵��2
+ handleStatus2Change(event){
+ this.searchObj.Status2 = event.detail.value;
+ // console.log(this.searchObj);
+ }
+ //鏈嶅姟鏂瑰紡
+ handleSiteChange(event){
+ this.searchObj.onSiteRepair = event.detail.value;
+ // console.log(this.searchObj);
+ }
+ //RS淇悊鍗曞彿 RepairName
+ handleRepairNameChange(event){
+ this.searchObj.RepairName = event.detail.value;
+ // console.log(this.searchObj);
+ }
+ //SAP淇悊鍗曞彿 SAPRepairNo
+ handleSAPRepairNoChange(event){
+ this.searchObj.SAPRepairNo = event.detail.value;
+ // console.log(this.searchObj);
+ }
+ //缁翠慨涓績 workLocationSelect
+ handleWorkLocationChange(event){
+ this.searchObj.workLocationSelect = event.detail.value;
+ }
+ //鏈鸿韩缂栫爜 SerialNumber
+ handleSerialNumberChange(event){
+ this.searchObj.SerialNumber = event.detail.value;
+ }
+ // 鐪佷唤 State_Hospital
+ handleStateHospitalChange(event){
+ this.searchObj.State_Hospital = event.detail.value;
+ }
+ //鍖婚櫌鍚嶇О HospitalName
+ handleHospitalChange(event){
+ this.searchObj.HospitalName = event.detail.value;
+ }
+ //FSE鐢宠鏃� repair.Aware_date__c
+ handleAwareDateDStart(event){
+ this.repair.Aware_date__c = event.detail.value;
+ console.log(this.repair.Aware_date__c);
+ }
+ // repair.Aware_date2__c
+ handleAwareDateDEnd(event){
+ this.repair.Aware_date2__c = event.detail.value;
+ // console.log(this.repair.Aware_date2__c);
+ }
+ // 淇悊濮旀墭鑰� repair.Incharge_Staff__c
+ handleInchargeStaffChange(event){
+ this.repair.Incharge_Staff__c = event.detail.value;
+ // console.log(this.repair.Aware_date2__c);
+ }
+
+ //妫�绱�
+ searchRepair(event) {
+ console.log(this.repair.Aware_date__c);
+ if (JSON.stringify(this.repair) != "{}") {
+ console.log('this.repair');
+ this.searchObj.repair = this.repair;
+ // fse 鏃堕棿鏉′欢
+ /*if (!(this.repair.Aware_date__c != null && this.repair.Aware_date2__c != null) || this.repair.Aware_date__c > this.repair.Aware_date2__c) {
+ const event = new ShowToastEvent({
+ title: 'error',
+ message: 'FSE鐢宠鏃ヨ緭鍏ユ湁璇�',
+ variant:'error',
+ });
+ this.dispatchEvent(event);
+ return;
+ }*/
+ }
+ let jsonStr = JSON.stringify(this.searchObj);
+ if (jsonStr === "{}") {
+ const event = new ShowToastEvent({
+ title: 'error',
+ message: '璇疯嚦灏戞坊鍔犱竴涓绱㈡潯浠�!',
+ variant:'error',
+ });
+ this.dispatchEvent(event);
+ }else{
+ console.log(jsonStr);
+ search({
+ json: jsonStr
+ }).then(result => {
+ console.log(result.repairData);
+ console.log('length:'+result.repairData.length);
+ if (result.repairData.length == 0 || result.repairData.length == 200) {
+ const event = new ShowToastEvent({
+ title: 'warning',
+ message: result.status,
+ variant:'warning',
+ });
+ this.dispatchEvent(event);
+ }
+ let returnArr = [];
+ result.repairData.forEach(function(v){
+ let objRepair = v.repair;
+ //娣诲姞淇悊濮旀墭鑰呭拰鍨嬪彿鍚嶇О
+ objRepair.deliveredProductName = objRepair.Delivered_Product__r.Name;
+ objRepair.deliveredProductUrl = "/"+objRepair.Delivered_Product__c;
+ objRepair.inchargeStaffName = objRepair.Incharge_Staff__r.Name;
+ objRepair.inchargeStaffUrl = "/"+objRepair.Incharge_Staff__c;
+ // console.log(objRepair);
+ returnArr.push(objRepair);
+ });
+ /*console.log('arr');
+ console.log(arr);
+ console.log(arr.length);*/
+ this.data = returnArr;
+ // console.log(this.data);
+ }).catch(error => {
+ console.log("error");
+ console.log(error);
+ }).finally(() => {
+
+ });
+ }
+
+
+ }
+ //瀵煎嚭涓篍xcel 鐢籺able
+ exportContactData(){
+ // Prepare a html table
+ let doc = '<table>';
+ // Add styles for the table
+ doc += '<style>';
+ doc += 'table, th, td {';
+ doc += ' border: 1px solid black;';
+ doc += ' border-collapse: collapse;';
+ doc += '}';
+ doc += '</style>';
+ // Add all the Table Headers
+ doc += '<tr>';
+ this.columns.forEach(element => {
+ doc += '<th>'+ element.label +'</th>'
+ });
+ doc += '</tr>';
+ // Add the data rows
+ let fieldNameArr =[];
+ this.columns.forEach(function(v){
+ if (v['typeAttributes']) {
+ fieldNameArr.push(v['typeAttributes'].label.fieldName);
+ }else{
+ fieldNameArr.push(v.fieldName);
+ }
+ });
+ console.log(fieldNameArr);
+ fieldNameArr.forEach(v=>{
+ console.log(v);
+ // console.log(this.data[0].v);
+ })
+ this.data.forEach(record => {
+ doc += '<tr>';
+ if (record.Status1__c != null) {
+ doc += '<th>'+record.Status1__c+'</th>';
+ }else{
+ doc += '<th></th>'
+ }
+ if (record.Status2__c != null) {
+ doc += '<th>'+record.Status2__c+'</th>';
+ }else{
+ doc += '<th></th>'
+ }
+ if (record.Name != null) {
+ doc += '<th>'+record.Name+'</th>';
+ }else{
+ doc += '<th></th>'
+ }
+ if (record.SAP_Service_Repair_No__c != null) {
+ doc += '<th>'+record.SAP_Service_Repair_No__c+'</th>';
+ }else{
+ doc += '<th></th>'
+ }
+ if (record.deliveredProductName != null) {
+ doc += '<th>'+record.deliveredProductName+'</th>';
+ }else{
+ doc += '<th></th>'
+ }
+ if (record.SerialNumber__c != null) {
+ doc += '<th>'+record.SerialNumber__c+'</th>';
+ }else{
+ doc += '<th></th>'
+ }
+ if (record.HP_Name__c != null) {
+ doc += '<th>'+record.HP_Name__c+'</th>';
+ }else{
+ doc += '<th></th>'
+ }
+ if (record.State_Hospital__c != null) {
+ doc += '<th>'+record.State_Hospital__c+'</th>';
+ }else{
+ doc += '<th></th>'
+ }
+ if (record.inchargeStaffName != null) {
+ doc += '<th>'+record.inchargeStaffName+'</th>';
+ }else{
+ doc += '<th></th>'
+ }
+ if (record.FSE_ApplyForRepair_Day__c != null) {
+ doc += '<th>'+record.FSE_ApplyForRepair_Day__c+'</th>';
+ }else{
+ doc += '<th></th>'
+ }
+ if (record.work_location_select__c != null) {
+ doc += '<th>'+record.work_location_select__c+'</th>';
+ }else{
+ doc += '<th></th>'
+ }
+ if (record.On_site_repair__c != null) {
+ doc += '<th>'+record.On_site_repair__c+'</th>';
+ }else{
+ doc += '<th></th>'
+ }
+ if (record.Number_of_EffectiveContract__c != null) {
+ doc += '<th>'+record.Number_of_EffectiveContract__c+'</th>';
+ }else{
+ doc += '<th></th>'
+ }
+ if (record.NewProductGuaranteeObject__c != null) {
+ doc += '<th>'+record.NewProductGuaranteeObject__c+'</th>';
+ }else{
+ doc += '<th></th>'
+ }
+ // fieldNameArr.forEach(fieldName =>{
+ // doc += '<th>'+record.fieldName+'</th>';
+ // });
+ doc += '</tr>';
+ });
+ doc += '</table>';
+ var element = 'data:application/vnd.ms-excel,' + encodeURIComponent(doc);
+ let downloadElement = document.createElement('a');
+ downloadElement.href = element;
+ downloadElement.target = '_self';
+ // use .csv as extension on below line if you want to export data as csv
+ downloadElement.download = '淇悊鏄庣粏琛�.xls';
+ document.body.appendChild(downloadElement);
+ downloadElement.click();
+ }
+
+ // this method validates the data and creates the csv file to download this.data鐨勬墍鏈夊瓧娈�
+ downloadCSVFile1() {
+ console.log("downloadCSVFile1");
+ let rowEnd = '\n';
+ let csvString = '';
+ // this set elminates the duplicates if have any duplicate keys
+ let rowData = new Set();
+ let columnsData = new Set();
+ let columnsLabelData = new Set();
+
+ // getting keys from data
+ this.data.forEach(function (record) {
+ Object.keys(record).forEach(function (key) {
+ rowData.add(key);
+ });
+ });
+ console.log(rowData);
+
+ // Array.from() method returns an Array object from any object with a length property or an iterable object.
+ rowData = Array.from(rowData);
+ console.log(rowData);
+
+ // splitting using ','
+ csvString += rowData.join(',');
+ csvString += rowEnd;
+ console.log(csvString);
+ this.columns.forEach(function(v){
+ columnsLabelData.add(v.label);
+ if (v['typeAttributes']) {
+ columnsData.add(v['typeAttributes'].label.fieldName);
+ }else{
+ columnsData.add(v.fieldName);
+ }
+ });
+ console.log("columnsData");
+ console.log(columnsLabelData);
+ console.log(columnsData);
+ console.log(rowData[1]);
+ console.log(Array.from(columnsData));
+ console.log(Array.from(columnsData).hasOwnProperty(rowData[1]));
+ console.log(this.data[0].Name);
+ console.log(this.data[0][rowData[1]]);
+ // main for loop to get the data based on key value
+ for(let i=0; i < this.data.length; i++){
+ let colValue = 0;
+
+ // validating keys in data
+ for(let key in rowData) {
+ if(rowData.hasOwnProperty(key)) {
+ // Key value
+ // Ex: Id, Name
+ let rowKey = rowData[key];
+ // add , after every value except the first.
+ if(colValue > 0){
+ csvString += ',';
+ }
+ // If the column is undefined, it as blank in the CSV file.
+ let value = this.data[i][rowKey] === undefined ? '' : this.data[i][rowKey];
+ csvString += '"'+ value +'"';
+ colValue++;
+ }
+ }
+ csvString += rowEnd;
+ }
+
+ // Creating anchor element to download
+ let downloadElement = document.createElement('a');
+
+ // This encodeURI encodes special characters, except: , / ? : @ & = + $ # (Use encodeURIComponent() to encode these characters).
+ downloadElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(csvString);
+ downloadElement.target = '_self';
+ // CSV File Name
+ downloadElement.download = 'Account Data.csv';
+ // below statement is required if you are using firefox browser
+ document.body.appendChild(downloadElement);
+ // click() Javascript function to download CSV file
+ downloadElement.click();
+ }
+ //瀵煎嚭涓篍xcel
+ downloadCSVFile() {
+ console.log("downloadCSVFile");
+ let rowEnd = '\n';
+ let csvString = '';
+ // this set elminates the duplicates if have any duplicate keys
+ //琛ㄦ牸鏍囬
+ let columnsData = new Set();
+ //琛ㄦ牸瀛楁
+ let rowData = new Set();
+
+ // getting keys from data
+ this.columns.forEach(function(v){
+ columnsData.add(v.label);
+ if (v['typeAttributes']) {
+ rowData.add(v['typeAttributes'].label.fieldName);
+ }else{
+ rowData.add(v.fieldName);
+ }
+ });
+ console.log(columnsData);
+ console.log(rowData);
+ // Array.from() method returns an Array object from any object with a length property or an iterable object.
+ rowData = Array.from(rowData);
+ columnsData = Array.from(columnsData);
+ // getting keys from data
+ /* console.log("rowData");
+ rowData.forEach(function(v){
+ console.log(v);
+ });
+ console.log("columnsData");
+ columnsData.forEach(function(v){
+ console.log(v);
+ }); */
+
+ // splitting using ','
+ csvString += columnsData.join(',');
+ csvString += rowEnd;
+ // console.log(csvString);
+ // main for loop to get the data based on key value
+ for(let i=0; i < this.data.length; i++){
+ let colValue = 0;
+
+ // validating keys in data
+ for(let key in rowData) {
+ if(rowData.hasOwnProperty(key)) {//del
+ // Key value
+ // Ex: Id, Name
+ let rowKey = rowData[key];
+ // add , after every value except the first.
+ if(colValue > 0){
+ csvString += ',';
+ }
+ // If the column is undefined, it as blank in the CSV file.
+ let value = this.data[i][rowKey] === undefined ? '' : this.data[i][rowKey];
+ csvString += '"'+ value +'"';
+ colValue++;
+ }
+ }
+ csvString += rowEnd;
+ }
+
+ // Creating anchor element to download
+ let downloadElement = document.createElement('a');
+
+ // This encodeURI encodes special characters, except: , / ? : @ & = + $ # (Use encodeURIComponent() to encode these characters).
+ downloadElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(csvString);
+ downloadElement.target = '_self';
+ // CSV File Name
+ downloadElement.download = '淇悊鏄庣粏琛�.csv';
+ // below statement is required if you are using firefox browser
+ document.body.appendChild(downloadElement);
+ // click() Javascript function to download CSV file
+ downloadElement.click();
+ }
+ //鑾峰彇閫変腑Repair
+ getSelectedRows(event) {
+ const selectedRows = event.detail.selectedRows;
+ console.log(selectedRows);
+ //Repair__c selectedRepairs
+ // Display that fieldName of the selected rows
+ let selectedRepairsArr = [];
+ for (let i = 0; i < selectedRows.length; i++) {
+ selectedRepairsArr.push(selectedRows[i]);
+ }
+ this.selectedRepairs = selectedRepairsArr;
+ }
+
+ //璺宠浆鍒皃df椤甸潰
+ skipPage() {
+ console.log("selectedRows");
+ // console.log(jsonStr);
+ if (this.selectedRepairs.length <= 0 ) {
+ const event = new ShowToastEvent({
+ title: 'error',
+ message: '璇疯嚦灏戦�夋嫨涓�涓慨鐞�',
+ variant:'error',
+ });
+ this.dispatchEvent(event);
+ return;
+ }
+ let jsonStr = JSON.stringify(this.selectedRepairs);
+ showPDF({
+ json: jsonStr
+ }).then(result => {
+ console.log(result);
+ if (result.indexOf("https://ocsm") != -1) {
+ window.open(result, "缁翠慨濮旀墭涔DF", "");
+ }else{
+ const event = new ShowToastEvent({
+ title: 'error',
+ message: result,
+ variant:'error',
+ });
+ this.dispatchEvent(event);
+ }
+ }).catch(error => {
+ console.log("error");
+ console.log(error);
+ }).finally(() => {
+
+ });
+ }
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexBatchSelectRepairLWC/lexBatchSelectRepairLWC.js-meta.xml b/force-app/main/default/lwc/lexBatchSelectRepairLWC/lexBatchSelectRepairLWC.js-meta.xml
new file mode 100644
index 0000000..2b7649d
--- /dev/null
+++ b/force-app/main/default/lwc/lexBatchSelectRepairLWC/lexBatchSelectRepairLWC.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+ <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/lexCustomDeleteLWC/lexCustomDeleteLWC.html b/force-app/main/default/lwc/lexCustomDeleteLWC/lexCustomDeleteLWC.html
new file mode 100644
index 0000000..ba53413
--- /dev/null
+++ b/force-app/main/default/lwc/lexCustomDeleteLWC/lexCustomDeleteLWC.html
@@ -0,0 +1,2 @@
+<template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomDeleteLWC/lexCustomDeleteLWC.js b/force-app/main/default/lwc/lexCustomDeleteLWC/lexCustomDeleteLWC.js
new file mode 100644
index 0000000..86678f3
--- /dev/null
+++ b/force-app/main/default/lwc/lexCustomDeleteLWC/lexCustomDeleteLWC.js
@@ -0,0 +1,144 @@
+import { LightningElement, api, track, wire } from 'lwc';
+import init from '@salesforce/apex/lexCustomDeleteController.initForCustomDelete';
+import {CurrentPageReference} from 'lightning/navigation'
+import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import deleteRepair from '@salesforce/apex/ControllerUtil.deleteRepair';
+
+export default class lexCustomDeleteLWC extends LightningElement {
+
+
+ @api recordId;
+ @api message;
+
+ @track Status ;
+ @track FSE ;
+ @track SAP;
+ @track cre ;
+ @track Rep ;
+ @track acc ;
+ @track fSE ;
+ @track id;
+ @track rtn;
+
+
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference){
+ console.log(111);
+ console.log(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(this.recordId);
+ init({
+ recordId:this.recordId
+ }).then(result=>{
+ console.log(result);
+ if(result!=null){
+ this.FSE=result.FSEApplyForRepairtime;
+ this.Rep=result.Rep;
+ this.SAP=result.SAP;
+ this.Status=result.Status;
+ this.acc=result.acc;
+ this.id=result.Id;
+ this.cre=result.cre;
+ this.fSE=result.FSEownerId;
+ console.log("end");
+ this.handleDeleteAction();
+ console.log("end2");
+
+ }
+ })
+ }
+
+ handleDeleteAction(){
+ if (this.Status != null && this.Status.length > 0) {
+ if (this.Status != "鑽夋涓�"&& this.Status != "1.鍙楃悊瀹屾瘯(SAP寰呭彂閫�)"&& this.Status != "4.淇悊鍝佽繑閫侀樁娈�") {
+ this.message = "涓嶆槸鑽夋涓�,涓嶈兘鍒犻櫎";
+ const event = new ShowToastEvent({
+ title: 'error',
+ variant:'error',
+ message:
+ this.message,
+ });
+ this.dispatchEvent(event);
+ }
+ else if (this.Status == "0.鐢宠瀹屾瘯"&& (this.FSE != "")) {
+ message = "FSE宸茬粡鐢宠锛屼笉鑳藉垹闄�";
+ console.log('***action4');
+
+ const event = new ShowToastEvent({
+ title: 'warning',
+ message:
+ this.message,
+ });
+ this.dispatchEvent(event);
+ }
+ else if (this.Status == "4.淇悊鍝佽繑閫侀樁娈�"&& (this.SAP != "" || this.Rep!= "")){
+ message = "宸茬粡鍙戦�佽繃SAP锛屼笉鑳藉垹闄�";
+ const event = new ShowToastEvent({
+ title: 'warning',
+ message:
+ this.message,
+ });
+ this.dispatchEvent(event);
+ }
+ else if (UserInfo_Owner.Id.substring(0,15) != this.cre.substring(0,15) && UserInfo_Owner.Id.substring(0,15) != this.acc.substring(0,15)&& UserInfo_Owner.Id.substring(0,15) != this.fSE.substring(0,15)) {
+ message = "涓嶆槸鎵�鏈変汉銆佸垱寤轰汉鎴朏SE涓昏礋璐d汉锛屼笉鑳藉垹闄�";
+ const event = new ShowToastEvent({
+ title: 'warning',
+ message:
+ this.message,
+ });
+ this.dispatchEvent(event);
+ }
+ else {
+
+ // sforce.connection.sessionId = '{!$Api.Session_ID}';
+ // var rtn=sforce.apex.execute("ControllerUtil","deleteRepair",{rid:this.id});
+ deleteRepair({
+ rid:this.id
+ }).then(result=>{
+ console.log(result);
+ if(result!=null){
+ this.rtn=result;
+ }
+ })
+
+ if (this.rtn == "OK") {
+ reload();
+ } else {
+ alert(this.rtn);
+
+ }
+ }
+ }
+
+ function reload(){
+ var str="";
+ if(getParam('retURL')!==null){
+ str +=getParam('retURL');
+ }
+ window.open(str,'_self');
+ }
+
+ function getParam(paramName) {
+ paramValue = "", isFound = !1;
+ if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) {
+ arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&"), i = 0;
+ while (i < arrSource.length && !isFound) arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++
+ }
+ return paramValue == "" && (paramValue = null), paramValue
+}
+
+}
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomDeleteLWC/lexCustomDeleteLWC.js-meta.xml b/force-app/main/default/lwc/lexCustomDeleteLWC/lexCustomDeleteLWC.js-meta.xml
new file mode 100644
index 0000000..7731813
--- /dev/null
+++ b/force-app/main/default/lwc/lexCustomDeleteLWC/lexCustomDeleteLWC.js-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="customDelete">
+ <apiVersion>56.0</apiVersion>
+ <isExposed>true</isExposed>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.css b/force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.css
new file mode 100644
index 0000000..adaad9f
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.css
@@ -0,0 +1,12 @@
+.exampleHolder{
+ position: relative;
+ top: 0;
+ width: 0;
+ left: 0;
+ right: 0;
+ margin: 0 auto;
+}
+.repairTitle{
+ --slds-c-accordion-heading-font-size: 1.05rem;
+ --slds-c-accordion-summary-color-background:#f3f3f3;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.html b/force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.html
new file mode 100644
index 0000000..71e2e87
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.html
@@ -0,0 +1,93 @@
+<template>
+ <div class="exampleHolder" if:true={isLoading}>
+ <lightning-spinner alternative-text="Loading" size="small"></lightning-spinner>
+ </div>
+ <div class="newRepair">
+ <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-2">
+ <!-- onsectiontoggle={handleSectionToggle} -->
+ <lightning-accordion allow-multiple-sections-open="true"
+ active-section-name={activeSections}>
+ <!-- Repair__c -->
+ <lightning-record-edit-form onload={handleRecordEditFormLoad} onsubmit={handleSubmit} onsuccess={handleSucess} onerror={handleError} object-api-name='{objectName}' record-type-id={recordTypeId} record-id={recordIdStr}>
+ <lightning-messages></lightning-messages>
+ <template if:true={uiPageLayoutView}>
+ <lightning-layout multiple-rows="true">
+ <lightning-layout-item size="12">
+ <!-- active-section-name={activeSections} -->
+
+ <template for:each={uiPageLayoutView.sections} for:item="section">
+ <lightning-accordion-section name={section.id} key={section.id} label={section.heading} class="repairTitle">
+ <lightning-layout multiple-rows="true" style="margin-top: 10px;">
+ <template for:each={section.layoutRows} for:item="layoutRow">
+ <template for:each={layoutRow.layoutItems} for:item="layoutItem">
+ <template for:each={layoutItem.layoutComponents} for:item="layoutComponent">
+ <lightning-layout-item key={layoutComponent.apiName} size="6" padding="horizontal-small">
+ <template if:true={layoutItem.editableForNew}>
+ <lightning-input-field data-fieldname={layoutComponent.apiName}
+ field-name={layoutComponent.apiName} name={layoutComponent.apiName} required={layoutItem.required}>
+ </lightning-input-field>
+ </template>
+ <!-- <template if:false={layoutItem.editableForNew}> -->
+ <!-- 淇悊鍙椾粯鐣彿 -->
+ <!-- <template if:true={layoutComponent.apiName}>
+ <lightning-output-field field-name={layoutComponent.apiName}>
+ </lightning-output-field>
+ </template> -->
+ <!-- </template> -->
+ </lightning-layout-item>
+ </template>
+ </template>
+ </template>
+ </lightning-layout>
+ </lightning-accordion-section>
+ </template>
+ </lightning-layout-item>
+ </lightning-layout>
+ </template>
+ <lightning-messages></lightning-messages>
+ <div class="" style="text-align: center;">
+ <lightning-button
+ label="鍙栨秷"
+ onclick={handleCancel}
+ ></lightning-button>
+ <lightning-button
+ type="submit"
+ name="save"
+ label="淇濆瓨"
+ style="margin-left: 10px;"
+ ></lightning-button>
+ <lightning-button if:true={hasRecordId}
+ name="saveAndNew"
+ type="submit"
+ label="淇濆瓨骞舵柊寤�"
+ onclick={handleSubmitAndNew}
+ style="margin-left: 10px;"
+ ></lightning-button>
+ </div>
+ </lightning-record-edit-form>
+ </lightning-accordion>
+ </div>
+ <!-- <div class="footer-background-class">
+ <div class="slds-align_absolute-center slds-p-around_xx-small">
+ <lightning-button class="slds-m-around_xx-small"
+ title="Cancel" label="Cancel"
+ onclick={closeNewObjectModal}>
+ </lightning-button>
+ <lightning-button variant="brand" title="Save"
+ onclick={submitRecordForm} name="Save" label="Save">
+ </lightning-button>
+ </div>
+ </div> -->
+ </div>
+<!-- a0J0l00000Ep9XHEAZ -->
+<!-- <lightning-record-edit-form record-id="" object-api-name='{objectName}'>
+ <lightning-input-field field-name="Delivered_Product__c"> </lightning-input-field>
+ <lightning-button
+ class="slds-m-top_small"
+ variant="brand"
+ type="submit"
+ label="Update"
+ >
+ </lightning-button>
+</lightning-record-edit-form> -->
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.js b/force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.js
new file mode 100644
index 0000000..cfe8142
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.js
@@ -0,0 +1,171 @@
+import { LightningElement,wire,track,api} from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { NavigationMixin } from 'lightning/navigation';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+
+import init from '@salesforce/apex/lexNewRepairAuraController.init';
+
+export default class lexNewRepairLWC extends NavigationMixin(LightningElement) {
+
+ // Flexipage provides recordId
+ @api recordId;
+ // @api recordId;
+ @api urlStr;
+ @api objectApiName;
+
+ /* @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+ console.log(111);
+ console.log(currentPageReference);
+
+ if (currentPageReference) {
+ const urlValue = currentPageReference.state.recordId;
+ if (urlValue) {
+ let str = `${urlValue}`;
+ console.log("str");
+ console.log(str);
+ this.recordId = str;
+ }
+ }
+ }*/
+
+ objectName = 'Repair__c';
+ uiPageLayoutView;
+ isNewMode;
+ //灞炴�ч粯璁ゅ��
+ defaultValue = {};
+ isLoading = true;
+ activeSections;
+ isSaveAndNew = false;
+ //鏇存柊鎿嶄綔鏃� 涓嶆樉绀轰繚瀛樻柊寤�
+ hasRecordId = false;
+ recordIdStr;
+ recordTypeId = '';
+
+ connectedCallback(){
+ console.log(this.recordId);
+ console.log(JSON.parse(this.urlStr));
+ if (!this.recordId) {
+ this.hasRecordId = true;
+ // urlStr 浼犲弬澶勭悊
+ let urlObj = JSON.parse(this.urlStr);
+ if (urlObj.hasOwnProperty("CF00N10000009H1rR_lkid") || urlObj.hasOwnProperty("retURL") ) {
+ console.log('urlObj.hasOwnProperty:',urlObj);
+ // init 鍚慍ontroller鍙戦�佽姹傝幏鍙栨暟鎹�
+ init({
+ recordId : this.recordId,urlStr : this.urlStr
+ }).then(result => {
+ console.log("result");
+ console.log(result);
+ this.defaultValue = result;
+ //杩斿洖缁撴灉璧嬪��
+ if (result.status) {
+ this.recordTypeId = result.recordTypeId;
+ }
+ }).catch(error => {
+ console.log("error");
+ console.log(error);
+ }).finally(() => {
+ });
+ }
+ }
+ }
+ //鑾峰彇Layout瀛楁
+ handleRecordEditFormLoad(event) {
+ if (event.detail.layout == undefined) {
+ return;
+ }
+ console.log('Layout => ', JSON.stringify(event.detail.layout));
+ this.uiPageLayoutView = event.detail.layout;
+ console.log('Layout1 => ',this.uiPageLayoutView);
+
+ //椤甸潰鍐呭鍒濆鍖� del
+ //to del ! err: Delivered_Product 02i10000004tNXIAA2 Hospital 0011000001g11rDAAQ
+ // this.defaultValue['Delivered_Product'] = '02i10000004tMKgAAM';
+ // // this.defaultValue['Delivered_Product'] = '02i10000004tNXIAA2';
+ // this.defaultValue['Account'] = '0011000001g11rDAAQ';
+ // this.defaultValue['SalesOfficeCode_selection'] = '鍖椾含';
+ // this.defaultValue['On_site_repair'] = 'RC淇悊';
+ // this.defaultValue['Repair_Detail'] = 'testLwcSaveAndNew';
+ // this.defaultValue['Hospital'] = '0011000001g0R8vAAE';
+ // // this.defaultValue['Hospital'] = '0011000001g11rDAAQ';
+ // // 0011000000V9SG5AAN
+ // this.defaultValue['work_location_select'] = '鍖椾含鍔炰簨澶�';
+
+ const inputFields = this.template.querySelectorAll('lightning-input-field');
+ if (inputFields) {
+ inputFields.forEach(field => {
+ let fieldName = field.name.replace("__c","");
+ if (this.defaultValue.hasOwnProperty(fieldName)) {
+ field.value= this.defaultValue[fieldName];
+ }
+ });
+ }
+
+ let checkedSections = new Set();
+ if (this.uiPageLayoutView.sections.length > 0) {
+ for(const tabs of this.uiPageLayoutView.sections){
+ checkedSections.add(tabs.id);
+ }
+ this.activeSections = Array.from(checkedSections);
+ }
+ this.isLoading = false;
+ this.recordIdStr = this.recordId;
+
+ }
+ //淇濆瓨 淇濆瓨鏂板缓鎻愪氦浜嬩欢
+ handleSubmit(event){
+ this.isLoading = true;
+ console.log("handleSubmit");
+ event.preventDefault(); // stop the form from submitting
+ const fields = event.detail.fields;
+ /*console.log("fields");
+ console.log(fields);*/
+ this.template.querySelector('lightning-record-edit-form').submit(fields);
+ // console.log("success");
+ }
+ handleSubmitAndNew(event){
+ this.isSaveAndNew = true;
+ }
+ //鎴愬姛鍚庤烦杞�
+ handleSucess(event){
+ // console.log("handleSucess");
+ const updatedRecord = event.detail.id;
+ console.log('onsuccess: ', updatedRecord);
+ if (this.isSaveAndNew) {
+ // console.log("isSaveAndNew");
+ window.location.reload();
+ }else if (event.detail.id) {
+ // console.log("NavigationMixin");
+ this[NavigationMixin.Navigate]({
+ type:'standard__recordPage',
+ attributes:{
+ recordId:updatedRecord,
+ objectApiName:this.objectName,
+ actionName:'view'
+ }
+ });
+ }
+ this.isLoading = false;
+ }
+ //瀵硅薄楠岃瘉锛屽睘鎬ч獙璇�
+ handleError(event) {
+ console.log("handleError event");
+ console.log(JSON.stringify(event.detail));
+ }
+ handleCancel(event) {
+ window.location.href = "https://ocsm--partial.sandbox.lightning.force.com/lightning/o/Repair__c/list?filterName=Recent&0.source=alohaHeader";
+ }
+
+
+ showToast(theTitle, theMessage, theVariant) {
+ const event = new ShowToastEvent({
+ title: theTitle,
+ message: theMessage,
+ variant: theVariant
+ });
+ this.dispatchEvent(event);
+ }
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.js-meta.xml b/force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.js-meta.xml
new file mode 100644
index 0000000..2b7649d
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+ <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