From eb179da9323a4ef85b6146660d0384f11e8f6696 Mon Sep 17 00:00:00 2001
From: denny chen <chenbangcai@prec-tech.com>
Date: 星期一, 24 四月 2023 14:04:09 +0800
Subject: [PATCH] 页面描述(删除修理)-对象(修理)

---
 force-app/main/default/lwc/lexCustomDeleteLWC/lexCustomDeleteLWC.html            |    2 
 force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAuraRenderer.js   |    5 
 force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.auradoc      |    6 
 force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.cmp-meta.xml |    5 
 force-app/main/default/lwc/lexCustomDeleteLWC/lexCustomDeleteLWC.js-meta.xml     |    5 
 force-app/main/default/classes/ControllerUtil.cls                                |    3 
 force-app/main/default/classes/lexCustomDeleteController.cls                     |   48 +++
 force-app/main/default/aura/lexCustomDeleteAura/lexCustomDeleteAura.cmp          |    9 
 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.css          |    2 
 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 
 17 files changed, 922 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/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/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/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

--
Gitblit v1.9.1