Merge branch 'LEX_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_dev
| | |
| | | public static InitData initSubmitButton (String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | // Request_tedner_doc__c report = [SELECT OwnerId,Id,Product_discription__c,Status__c FROM Request_tedner_doc__c WHERE Id = :recordId LIMIT 1]; |
| | | Request_tedner_doc__c report = [SELECT OwnerId,Id FROM Request_tedner_doc__c WHERE Id = :recordId LIMIT 1]; |
| | | res.OwnerId = report.OwnerId; |
| | | res.Id = report.Id; |
| | |
| | | //授权申请的提交按钮 |
| | | @AuraEnabled |
| | | public static String submit(String recordId) { |
| | | String messageText = ''; |
| | | try { |
| | | // Request_tedner_doc__c rac = [SELECT Id,Status__c,Submit_check_flag__c,RecordTypeId,Submit_time__c,Request_target__c,Document_format__c,Bid_distributor__c,Product_discription__c,Tedner_date__c,Tender_active_day__c,tender_inactive_date__c,Tender_request_reason__c FROM Request_tedner_doc__c WHERE Id = :recordId LIMIT 1]; |
| | | Request_tedner_doc__c rac = [SELECT Id,Status__c,Submit_check_flag__c,RecordTypeId,Submit_time__c FROM Request_tedner_doc__c WHERE Id = :recordId LIMIT 1]; |
| | | rac.Status__c = '已提交'; |
| | | rac.RecordTypeId = '01210000000RNXn'; |
| | | rac.Status__c = LightingButtonConstant.STATUS_Application_Submitted; |
| | | rac.RecordTypeId = rac.RecordTypeId = Schema.SObjectType.Request_tedner_doc__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_Application + LightingButtonConstant.STATUS_Application_Submitted).getRecordTypeId(); |
| | | rac.Submit_check_flag__c = true; |
| | | rac.Submit_time__c = Datetime.now(); |
| | | update rac; |
| | | return '1'; |
| | | messageText = '1'; |
| | | return messageText; |
| | | } catch (Exception ex) { |
| | | System.debug(LoggingLevel.INFO, '*** xu: ' + ex); |
| | | return ex.getMessage(); |
| | | // return ex.getMessage().split(',')[1]; |
| | | } finally { |
| | | |
| | | messageText = ex.getMessage(); |
| | | return messageText; |
| | | } |
| | | } |
| | | |
| | | //授权申请的取消提交按钮 |
| | | @AuraEnabled |
| | | public static String submitCancel(String recordId) { |
| | | String messageText = ''; |
| | | try { |
| | | Request_tedner_doc__c report = [SELECT Id,Status__c,Submit_check_flag__c,RecordTypeId,Submit_time__c FROM Request_tedner_doc__c WHERE Id = :recordId LIMIT 1]; |
| | | report.Status__c = '草案中'; |
| | | report.RecordTypeId = '01210000000RNXi'; |
| | | report.Status__c = LightingButtonConstant.STATUS_Application_CancelSubmit; |
| | | report.RecordTypeId = Schema.SObjectType.Request_tedner_doc__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_Application).getRecordTypeId(); |
| | | report.Submit_check_flag__c = false; |
| | | report.Submit_time__c = null; |
| | | update report; |
| | | return '1'; |
| | | messageText = '1'; |
| | | return messageText; |
| | | } catch (Exception ex) { |
| | | System.debug(LoggingLevel.INFO, '*** cancelXu: ' + ex); |
| | | return ex.getMessage(); |
| | | } finally { |
| | | |
| | | messageText = ex.getMessage(); |
| | | return messageText; |
| | | } |
| | | } |
| | | |
| | | //获取当前登录人的 id |
| | | @AuraEnabled |
| | | public static UserResult UserInfo_Owner() { |
| | | public static UserResult userInfo_Owner() { |
| | | UserResult result = new UserResult(); |
| | | ID myUserID = UserInfo.getUserId(); |
| | | |
| | | try { |
| | | User tempUser = |
| | | [select id from user where id = : myUserID ]; |
| | | User tempUser = [select id from user where id = : myUserID ]; |
| | | result.id = tempUser.id; |
| | | } catch (exception e) { |
| | | |
| | | result.result = e.getMessage(); |
| | | } |
| | | return result; |
| | |
| | | } |
| | | @AuraEnabled |
| | | public string id; |
| | | //20210105 CHAN-BWX3YU you end |
| | | } |
| | | } |
| | | |
| | | // if("{!Request_tedner_doc__c.OwnerId}" == "{!$User.Id}") { |
| | | // var rac = new sforce.SObject("Request_tedner_doc__c"); |
| | | // rac.Id = "{!Request_tedner_doc__c.Id}"; |
| | | // rac.Status__c = "已提交"; |
| | | // rac.Submit_check_flag__c = "true"; |
| | | // rac.RecordTypeId = "01210000000RNXn"; |
| | | // var serverTimestamp = sforce.connection.getServerTimestamp(); |
| | | // rac.Submit_time__c = serverTimestamp.timestamp; |
| | | } |
| | |
| | | global without sharing class LightingButtonConstant { |
| | | //授权申请的状态‘已提交’ |
| | | public static final String STATUS_Application_Submitted = '已提交'; |
| | | //授权申请的状态‘草案中’ |
| | | public static final String STATUS_Application_CancelSubmit= '草案中'; |
| | | //授权申请的记录类型名‘授权申请’ |
| | | public static final String RECORD_TYPE_NAME_Application = '授权申请'; |
| | | //周报月报的状态‘草案中’ |
| | | public static final String STATUS_DRAFT = '草案中'; |
| | | //报告书的状态‘完毕’ |
| | |
| | | } |
| | | return re; |
| | | } |
| | | //OCSM不要报告 |
| | | @AuraEnabled |
| | | public static InitData initForlexOCSMNoToReportLightingButton (String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | QIS_Report__c report = [SELECT id ,OCSMAdministrativeReportNumber__c,OCSMAdministrativeReportDate__c,Aware_date__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | res.Id = report.Id; |
| | | res.oCSMAdministrativeReportNumber = report.OCSMAdministrativeReportNumber__c; |
| | | res.oCSMAdministrativeReportDate = report.OCSMAdministrativeReportDate__c; |
| | | res.Awaredate = report.Aware_date__c; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | @AuraEnabled |
| | | public static String updateQisForlexOCSMNoToReportLighting (String recordId){ |
| | | String re = '成功'; |
| | | QIS_Report__c report = [SELECT id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | try{ |
| | | QIS_Report__c rac = new QIS_Report__c(); |
| | | rac.id = recordId; |
| | | rac.OCSMAdministrativeReportStatus__c = '无需报告'; |
| | | update rac; |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | re = e.getMessage(); |
| | | } |
| | | return re; |
| | | } |
| | | //OCSM要报告 |
| | | @AuraEnabled |
| | | public static InitData initForlexOCSMToReportLightingButton (String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | QIS_Report__c report = [SELECT id ,OCSMAdministrativeReportStatus__c,Aware_date__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | res.Id = report.Id; |
| | | res.oCSMAdministrativeReportStatus = report.OCSMAdministrativeReportStatus__c; |
| | | res.Awaredate = report.Aware_date__c; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static String updateQisForlexOCSMToReportLighting (String recordId){ |
| | | String re = '成功'; |
| | | QIS_Report__c report = [SELECT id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | try{ |
| | | QIS_Report__c rac = new QIS_Report__c(); |
| | | rac.id = recordId; |
| | | rac.OCSMAdministrativeReportStatus__c = '待报告'; |
| | | update rac; |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | re = e.getMessage(); |
| | | } |
| | | return re; |
| | | } |
| | | |
| | | //发送QIS到SPO |
| | | @AuraEnabled |
| | | public static InitData initForlexSendQISButton (String recordId){ |
| | | InitData res = new initData(); |
| | | ID myUserID = UserInfo.getUserId(); |
| | | User userinfo = [SELECT id,Profile.name FROM User WHERE Id = :myUserID LIMIT 1]; |
| | | try{ |
| | | QIS_Report__c report = [SELECT id ,RecordTypeId,IsSendQIS__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | RecordType rec = [SELECT id,name FROM RecordType where Id = :report.RecordTypeId]; |
| | | res.Id = report.Id; |
| | | res.qisRecordTypeId = report.RecordTypeId; |
| | | res.qisRecordName = rec.name; |
| | | res.profileName = userinfo.Profile.name; |
| | | res.IsSendQIS = report.IsSendQIS__c; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static String updateQisForSendQIS (String recordId){ |
| | | String re = '成功'; |
| | | QIS_Report__c report = [SELECT Id,Name,IsSendQIS__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | if(report == null ){ |
| | | return '没有QIS:' + recordId + '的数据。'; |
| | | } |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try{ |
| | | |
| | | QIS_Report__c rac = new QIS_Report__c(); |
| | | rac.id = recordId; |
| | | rac.IsSendQIS__c = true; |
| | | update rac; |
| | | }catch(Exception e){ |
| | | Database.rollback(sp); |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | re = e.getMessage(); |
| | | } |
| | | return re; |
| | | } |
| | | // OCSM服务本部收到实物 |
| | | @AuraEnabled |
| | | public static InitData initForlexRCRecievedButton (String recordId){ |
| | | InitData res = new initData(); |
| | | ID myUserID = UserInfo.getUserId(); |
| | | User userinfo = [SELECT id,Profile.name FROM User WHERE Id = :myUserID LIMIT 1]; |
| | | try{ |
| | | QIS_Report__c report = [SELECT id ,isAE_Profile__c,QIS_Status__c,isPAE_Profile__c,is_CNBuy__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | res.Id = report.Id; |
| | | res.isAEProfile = report.isAE_Profile__c; |
| | | res.isPAEProfile = report.isPAE_Profile__c; |
| | | res.QIStatus = report.QIS_Status__c; |
| | | res.isCNBuy = report.is_CNBuy__c; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static String updateQisForRCRecieved (String recordId){ |
| | | String re = '成功'; |
| | | ID myUserID = UserInfo.getUserId(); |
| | | User userinfo = [SELECT id,Alias,BuchangApprovalManagerSales__c,JingliApprovalManager__c, BuchangApprovalManager__c, ZongjianApprovalManager__c FROM User WHERE Id = :myUserID LIMIT 1]; |
| | | |
| | | try{ |
| | | QIS_Report__c rac = new QIS_Report__c(); |
| | | rac.id = recordId; |
| | | |
| | | rac.QIS_Status__c = 'RC检测中'; |
| | | rac.OCM_RC_RecievedDate__c = Date.today(); |
| | | rac.RC__c = myUserID; |
| | | rac.RC_Receive_staff__c = userinfo.Alias; |
| | | |
| | | if (userinfo != null && userinfo.BuchangApprovalManagerSales__c!= null) { |
| | | rac.RC_Manager__c = userinfo.BuchangApprovalManagerSales__c; |
| | | } else { |
| | | rac.RC_Manager__c = myUserID; |
| | | } |
| | | update rac; |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | re = e.getMessage(); |
| | | } |
| | | return re; |
| | | } |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| New file |
| | |
| | | global class TenderWebService { |
| | | public TenderWebService() { |
| | | |
| | | } |
| | | @AuraEnabled |
| | | //招投标反逻辑删除 |
| | | WebService static String ContraryLogicalDel(String DTenId) { |
| | | Tender_information__c DTenInfo = [Select Id, InfoId__c, Logical_delete__c, ProjectId__c, Retain_Tender__c From Tender_information__c Where id = : DTenId]; |
| | | // 更新删除招投标 |
| | | List<Tender_information__c> updateTenInfoList = new List<Tender_information__c>(); |
| | | // 更新保留招投标 |
| | | // List<Tender_information__c> updateBTenList = new List<Tender_information__c>(); |
| | | if (String.isNotBlank(DTenInfo.Retain_Tender__c)) { |
| | | // System.debug('11111111' + TenInfo.Retain_Tender__c); |
| | | //要保留的招投标 |
| | | Tender_information__c BTen = [select Id, InfoId__c From Tender_information__c |
| | | Where Id = : DTenInfo.Retain_Tender__c]; |
| | | |
| | | // 删除招投标关联的询价 |
| | | // List<Tender_Opportunity_Link__c> DTenLinkList = [select Opportunity__c |
| | | // from Tender_Opportunity_Link__c |
| | | // where Tender_information__c = :DTenId and IsRelated__c = true]; |
| | | // System.debug('---------2---------' + DTenLinkList); |
| | | // Set<Id> DTenLinkOppIdSet = new Set<Id>(); |
| | | // if (DTenLinkList.size() > 0) { |
| | | // for (Tender_Opportunity_Link__c DTenlink : DTenLinkList) { |
| | | // DTenLinkOppIdSet.add(DTenlink.Opportunity__c); |
| | | // } |
| | | // System.debug('---------3---------' + DTenLinkOppIdSet); |
| | | // // 删除项目关联并且与保留项目关联的询价关联信息 |
| | | // List<Tender_Opportunity_Link__c> DelD_BTenLinkList = [select id, Opportunity__c, Tender_information__c |
| | | // from Tender_Opportunity_Link__c |
| | | // where Tender_information__c = :BTen.Id and Opportunity__c in : DTenLinkOppIdSet]; |
| | | // System.debug('---------1---------' + DelD_BTenLinkList); |
| | | // if (DelD_BTenLinkList.size() > 0) { |
| | | // Delete DelD_BTenLinkList; |
| | | // } |
| | | // } |
| | | |
| | | // 保留项目通过软删除逻辑关联来的询价 |
| | | List<Tender_Opportunity_Link__c> DelD_BTenLinkList = [select id, Opportunity__c, Tender_information__c |
| | | from Tender_Opportunity_Link__c |
| | | where Tender_information__c = :BTen.Id and IsRelated__c = true]; |
| | | // 判断link是否为空 |
| | | if (DelD_BTenLinkList != null && DelD_BTenLinkList.size() > 0) { |
| | | // 逻辑有大坑 暂时只把打标记的删掉 不做回写的操作了 |
| | | // List<Tender_Opportunity_Link__c> add_list = new List<Tender_Opportunity_Link__c>(); |
| | | // for (Tender_Opportunity_Link__c link : DelD_BTenLinkList) { |
| | | // Tender_Opportunity_Link__c add_link = new Tender_Opportunity_Link__c(); |
| | | // add_link.Tender_information__c = DTenInfo.Id; |
| | | // add_link.Opportunity__c = link.Opportunity__c; |
| | | // add_link.Tender_Opportunity_Uniq__c = DTenInfo.Id + '' + link.Opportunity__c; |
| | | // add_link.IsRelated__c = false; |
| | | // add_list.add(add_link); |
| | | // } |
| | | // 删掉保留项目上的关联询价 |
| | | delete DelD_BTenLinkList; |
| | | // 删除项目上的关联加回来 |
| | | // if (add_list.size() > 0) { |
| | | // insert add_list; |
| | | // } |
| | | } |
| | | |
| | | // 互换保留招投标与删除招投标的信息Id |
| | | DTenInfo.Retain_Tender__c = BTen.Id; |
| | | String BTenInfo = BTen.InfoId__c; |
| | | BTen.InfoId__c = DTenInfo.InfoId__c;//保留招投标的信息Id赋给删除招投标的信息Id |
| | | DTenInfo.InfoId__c = BTenInfo;//删除招投标的信息Id赋给保留招投标的信息Id |
| | | // 点击保存后 删除招投标上的逻辑删除字段变为true |
| | | DTenInfo.Logical_delete__c = false; |
| | | // update TenInfo; |
| | | // 一起更新就行了 |
| | | updateTenInfoList.add(DTenInfo); |
| | | updateTenInfoList.add(BTen); |
| | | update updateTenInfoList; |
| | | |
| | | // updateBTenList.add(BTen); |
| | | // update updateBTenList; |
| | | |
| | | } |
| | | return 'OK'; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>45.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | public class TenderingButtonController { |
| | | @AuraEnabled |
| | | public static InitData initTenderingController(String recordId) { |
| | | InitData res = new initData(); |
| | | try{ |
| | | Tender_information__c report = [SELECT OpportunityNum__c,OwnerId,Id,status__c,Name,IsRelateProject__c FROM Tender_information__c WHERE Id = :recordId LIMIT 1]; |
| | | res.OwnerId = report.OwnerId; |
| | | res.Id = report.Id; |
| | | res.status = report.status__c; |
| | | res.name = report.Name; |
| | | res.opportunityNum = String.valueOf(report.OpportunityNum__c); |
| | | res.isRelateProject = report.IsRelateProject__c; |
| | | res.profileId = UserInfo.getProfileId(); |
| | | res.Environment_Url = System.Label.Environment_Url; |
| | | System.debug(LoggingLevel.INFO, '*** xu: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** xu: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | // 招标项目失单 TenderOpportunityLink |
| | | // 调用该接口var sql = "select id from Tender_Opportunity_Link__c where Tender_information__c='" + '{!Tender_information__c.Id}'+ "'"; |
| | | @AuraEnabled |
| | | public static List<Tender_Opportunity_Link__c> sqlResult (String id) { |
| | | try { |
| | | List<Tender_Opportunity_Link__c> TenderOpportunityLink = [SELECT id FROM Tender_Opportunity_Link__c WHERE Tender_information__c = :id]; |
| | | System.debug(LoggingLevel.INFO, '*** xu1: ' + TenderOpportunityLink); |
| | | return TenderOpportunityLink; |
| | | } catch (exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** xu1111111: ' + e); |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| | | @AuraEnabled |
| | | public String OwnerId; |
| | | @AuraEnabled |
| | | public String status; |
| | | @AuraEnabled |
| | | public String name; |
| | | @AuraEnabled |
| | | public String opportunityNum; |
| | | @AuraEnabled |
| | | public String isRelateProject; |
| | | @AuraEnabled |
| | | public String profileId; |
| | | @AuraEnabled |
| | | public String Environment_Url; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | | </ApexClass> |
| New file |
| | |
| | | public with sharing class otherButtonSpotInspectionReportCtl { |
| | | public otherButtonSpotInspectionReportCtl() { |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static InitData init(String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | Inspection_Report__c report = [SELECT Id,RecordTypeId FROM Inspection_Report__c WHERE Id =: recordId LIMIT 1]; |
| | | System.debug(LoggingLevel.INFO, '*** opp: ' + report); |
| | | res.Id = report.Id; |
| | | res.RecordTypeId = report.RecordTypeId; |
| | | |
| | | 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 RecordTypeId; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexASRCEditorRepair from 'c/lexASRCEditorRepair'; |
| | | |
| | | describe('c-lex-asrc-editor-repair', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-asrc-editor-repair', { |
| | | is: LexASRCEditorRepair |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import selectPAEDecisionRecord from '@salesforce/apex/otherButtonRepairController.selectPAEDecisionRecord'; |
| | | |
| | | export default class LexASRCEditorRepair extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | RecordTypeId; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeId = result.RecordTypeId; |
| | | |
| | | this.ASRCEditor(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // Intake universal code编辑 |
| | | ASRCEditor() { |
| | | var RecordTypeId = "ASRCDecision"; |
| | | var RepairId = this.Id; |
| | | var url = ''; |
| | | selectPAEDecisionRecord({ |
| | | recordId: RepairId, |
| | | recordTypeId: RecordTypeId |
| | | }).then(result => { |
| | | if (result != null) { |
| | | if (result.length > 0) { |
| | | url = "/apex/PAEDecisionRecord?Id=" + result[0].Id + "&RepairId=" + RepairId + "&RecordTypeIds=" + RecordTypeId; |
| | | } else { |
| | | url = "/apex/PAEDecisionRecord?RepairId=" + RepairId + "&RecordTypeIds=" + RecordTypeId; |
| | | } |
| | | window.open(url, '_self'); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <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> |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import init from '@salesforce/apex/ApplicationButtonController.initSubmitButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import submitCancel from '@salesforce/apex/ApplicationButtonController.submitCancel'; |
| | | import UserInfo_Owner from '@salesforce/apex/ApplicationButtonController.UserInfo_Owner'; |
| | | export default class Submit extends LightningElement { |
| | | import userInfo_Owner from '@salesforce/apex/ApplicationButtonController.userInfo_Owner'; |
| | | export default class lexApplicationCancelSubmit extends LightningElement { |
| | | @api recordId;//OwnerId |
| | | ownerId; |
| | | monthlyReportId; |
| | |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str:"+str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.ownerId = result.OwnerId; |
| | | this.monthlyReportId = result.Id; |
| | | this.cancelSubmit(); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"+error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | //授权申请 取消提交 |
| | | cancelSubmit(){ |
| | | UserInfo_Owner({}).then(result=>{ |
| | | console.log(result,'获取当前登陆人id') |
| | | //'获取当前登陆人id' |
| | | userInfo_Owner({}).then(result=>{ |
| | | if(this.ownerId == result.id){ |
| | | submitCancel({ |
| | | recordId: this.recordId |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | updateRecordView() { |
| | | updateRecord({fields: { Id: this.recordId }}); |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import init from '@salesforce/apex/ApplicationButtonController.initSubmitButton'; |
| | | import UserInfo_Owner from '@salesforce/apex/ApplicationButtonController.UserInfo_Owner'; |
| | | import userInfo_Owner from '@salesforce/apex/ApplicationButtonController.userInfo_Owner'; |
| | | import submit from '@salesforce/apex/ApplicationButtonController.submit'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class Submit extends LightningElement { |
| | | export default class lexApplicationSubmitButton extends LightningElement { |
| | | @api recordId;//OwnerId |
| | | ownerId;//所有人id |
| | | id;//返回值的id |
| | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(currentPageReference,'666666666666'); |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str:"+str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result,"请求成功了吗") |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.ownerId = result.OwnerId; |
| | | this.id = result.Id; |
| | | this.Submit(); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"+error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | Submit(){ |
| | | this.arrMessage = []; |
| | | //获取获取当前登陆人 |
| | | UserInfo_Owner({}).then(result=>{ |
| | | console.log(result,'获取当前登陆人id') |
| | | userInfo_Owner({}).then(result=>{ |
| | | if(this.ownerId == result.id){ |
| | | submit({ |
| | | recordId: this.recordId |
| | |
| | | } |
| | | messageage += this.arrMessage[i+1]; |
| | | } |
| | | // if(requst.split(',')[1].slice(-1) == '式'){ |
| | | // messageage = requst.split(',')[1] + "," + requst.split(',')[2] + "," + requst.split(',')[3] + "," + requst.split(',')[4] + "," + requst.split(',')[5] + "," + requst.split(',')[6]; |
| | | // }else{ |
| | | // messageage = requst.split(',')[1]; |
| | | // } |
| | | this.showToast(messageage,"error"); |
| | | } |
| | | }) |
| | |
| | | }) |
| | | } |
| | | |
| | | |
| | | updateRecordView() { |
| | | updateRecord({fields: { Id: this.recordId }}); |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | console.log(msg,type); |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | console.log('走到这里了吗'); |
| | | if(type == 'success'){ |
| | | this.updateRecordView(); |
| | | } |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexCopyPIInspectionReport from 'c/lexCopyPIInspectionReport'; |
| | | |
| | | describe('c-lex-copy-pi-inspection-report', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-copy-pi-inspection-report', { |
| | | is: LexCopyPIInspectionReport |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexCreateReportMaintenanceContract from 'c/lexCreateReportMaintenanceContract'; |
| | | |
| | | describe('c-lex-create-report-maintenance-contract', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-create-report-maintenance-contract', { |
| | | is: LexCreateReportMaintenanceContract |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexCustomNewCopy2 from 'c/lexCustomNewCopy2'; |
| | | |
| | | describe('c-lex-custom-new-copy2', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-custom-new-copy2', { |
| | | is: LexCustomNewCopy2 |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexCustomNewCopy2 extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | notRenewC; |
| | | Name; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.notRenewC = result.notRenewC; |
| | | this.Name = result.Name; |
| | | |
| | | this.CustomNewCopy2(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 继续新服务合同 |
| | | CustomNewCopy2() { |
| | | if (this.notRenewC) { |
| | | this.ShowToastEvent("请联系服务商品部!", "error"); |
| | | // alert("请联系服务商品部!"); |
| | | } else { |
| | | window.open("/" + this.Id + "/e?clone=1&Name=&00N10000002Dx5D=&00N10000002Dx5S=%e5%bc%95%e5%90%88%e4%b8%ad&00NO00000010sDc=&CF00NO00000010hyI=&CF00NO00000010hyI_lkid=&CF00NO00000010hyX=&CF00NO00000010hyX_lkid=&CF00NO00000010hyN=&CF00NO00000010hyN_lkid=&RecordType=01210000000gTYq&00N10000002pmOp=&00N10000006gZDd=&00N10000006gZDe=&00NO00000010hy4=&00N10000002Dx4j=&00N10000002Dx4m=&00N10000002Dx4w=&00N10000002Dx4k=&00N10000002Dx5J=&00N10000002Dx5M=&00N10000002Dx4i=&00N10000002Dx4h=&00N10000002Dx5K=&00N10000003OXdT=&00N100000048zfn=&00N10000002FMsq=&00N10000003OlGF=&00N10000002Dx4r=&00N100000047AY1=&00N100000047AYB=&00N100000047AY6=&00N10000003PCeB=&00N10000005HBNe=&00N10000006plAl=&00N10000002Dx5C=&retURL=%2F" + this.Id + "&saveURL=%2Fapex/SaveMaintenanceByCopy?mid=" + this.Id + "&CF00N100000048Paw=" + this.Name + "&CF00N100000048Paw_lkid=" + this.Id, "_blank"); |
| | | } |
| | | } |
| | | |
| | | // 弹窗 |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <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> |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexInsPageBtn from 'c/lexInsPageBtn'; |
| | | |
| | | describe('c-lex-ins-page-btn', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-ins-page-btn', { |
| | | is: LexInsPageBtn |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexMailMessege from 'c/lexMailMessege'; |
| | | |
| | | describe('c-lex-mail-messege', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-mail-messege', { |
| | | is: LexMailMessege |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | export default class LexMailMessege extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id;; |
| | | InchargeStaffEmailC; |
| | | Name; |
| | | HPNameC; |
| | | DeliveredProductC; |
| | | RepairProductSerialNoC; |
| | | ServiceRepairNoC; |
| | | RepairFirstestimatedDateC; |
| | | RepairEstimatedDateC; |
| | | RCInformationC; |
| | | userEmail; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.InchargeStaffEmailC = result.InchargeStaffEmailC; |
| | | this.Name = result.Name; |
| | | this.HPNameC = result.HPNameC; |
| | | this.DeliveredProductC = result.DeliveredProductC; |
| | | this.RepairProductSerialNoC = result.RepairProductSerialNoC; |
| | | this.ServiceRepairNoC = result.ServiceRepairNoC; |
| | | this.RepairFirstestimatedDateC = result.RepairFirstestimatedDateC; |
| | | this.RepairEstimatedDateC = result.RepairEstimatedDateC; |
| | | this.RCInformationC = result.RCInformationC; |
| | | this.userEmail = result.userEmail; |
| | | |
| | | this.mailMessege(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 报价附件更新的邮件通知 |
| | | mailMessege() { |
| | | var Link = "https://ocsm--partial.sandbox.my.salesforce.com/" + this.Id; |
| | | console.log(Link); |
| | | |
| | | location.href = 'mailto:' + this.InchargeStaffEmailC + |
| | | '?bcc=' + this.userEmail + |
| | | '&subject=【报价附件更新通知:' + this.Name + '】' + this.HPNameC + this.DeliveredProductC + this.RepairProductSerialNoC + this.ServiceRepairNoC + |
| | | '&body=先生/女士%0D%0A' + |
| | | '%0D%0A' + |
| | | '关于主题的修理,修理报价的附件更新好了%0D%0A' + |
| | | '请确认并跟进一下%0D%0A' + |
| | | '%0D%0A' + |
| | | '初次报价日:' + this.RepairFirstestimatedDateC + '%0D%0A' + |
| | | '此次报价日:' + this.RepairEstimatedDateC + '%0D%0A' + |
| | | '%0D%0A' + |
| | | 'RC联络事项:' + this.RCInformationC + '%0D%0A' + |
| | | '%0D%0A' + Link + ''; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <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> |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexOCSMNoToReportRepair from 'c/lexOCSMNoToReportRepair'; |
| | | |
| | | describe('c-lex-ocsm-no-to-report-repair', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-ocsm-no-to-report-repair', { |
| | | is: LexOCSMNoToReportRepair |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import updateRepair from '@salesforce/apex/otherButtonRepairController.updateRepair'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexOCSMNoToReportRepair extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id;; |
| | | OCSMAdministrativeReportNumberC; |
| | | OCSMAdministrativeReportDateC; |
| | | AwareDateC; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.OCSMAdministrativeReportNumberC = result.OCSMAdministrativeReportNumberC; |
| | | this.OCSMAdministrativeReportDateC = result.OCSMAdministrativeReportDateC; |
| | | this.AwareDateC = result.AwareDateC; |
| | | |
| | | this.OCSMNoToReport(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // OCSM不要报告 |
| | | OCSMNoToReport() { |
| | | if (!confirm("不要报告后无法撤回,是否继续?")) { |
| | | return; |
| | | } |
| | | |
| | | if (this.OCSMAdministrativeReportNumberC != undefined || |
| | | this.OCSMAdministrativeReportDateC != undefined) { |
| | | this.ShowToastEvent("已经报告的QIS,不可以点击OCSM不要报告。", "error") |
| | | // alert("已经报告的QIS,不可以点击OCSM不要报告。"); |
| | | return; |
| | | } |
| | | |
| | | if (this.AwareDateC != undefined) { |
| | | updateRepair({ |
| | | recordId: this.Id |
| | | }).catch(error => { |
| | | if (error.body.pageErrors.length > 0) { |
| | | var errmsg = error.body.pageErrors[0].message.toString(); |
| | | this.ShowToastEvent(errmsg.join("\n"), "error") |
| | | // alert(errmsg.join("\n")); |
| | | return; |
| | | } |
| | | }) |
| | | window.location.reload(); |
| | | } else { |
| | | this.ShowToastEvent("没有AwareDate或已经OCSM行政报告,请确认。", "error") |
| | | // alert("没有AwareDate或已经OCSM行政报告,请确认。"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | // 弹窗 |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <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> |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexOCSMToReportRepair from 'c/lexOCSMToReportRepair'; |
| | | |
| | | describe('c-lex-ocsm-to-report-repair', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-ocsm-to-report-repair', { |
| | | is: LexOCSMToReportRepair |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import updateRepair from '@salesforce/apex/otherButtonRepairController.updateRepair'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | |
| | | export default class LexOCSMToReportRepair extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | AwareDateC; |
| | | OCSMAdministrativeReportStatusC; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.AwareDateC = result.AwareDateC; |
| | | this.OCSMAdministrativeReportStatusC = result.OCSMAdministrativeReportStatusC; |
| | | |
| | | this.OCSMToReport(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // OCSM要报告 |
| | | OCSMToReport() { |
| | | if (!confirm("报告后无法撤回,是否继续?")) { |
| | | return; |
| | | } |
| | | if (this.OCSMAdministrativeReportStatusC == undefined && this.AwareDateC != undefined) { |
| | | updateRepair({ |
| | | recordId: this.Id |
| | | }).catch(error => { |
| | | if (error.body.pageErrors.length > 0) { |
| | | // alert(messages.join("\n")); |
| | | var errmsg = error.body.pageErrors[0].message.toString(); |
| | | this.ShowToastEvent(errmsg.join("\n"), "error") |
| | | return; |
| | | } |
| | | }) |
| | | window.location.reload(); |
| | | } else { |
| | | this.ShowToastEvent("没有AwareDate或已经OCSM行政报告,请确认。", "error") |
| | | return; |
| | | } |
| | | } |
| | | |
| | | // 弹窗 |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <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> |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexPDFMaintenanceCommission from 'c/lexPDFMaintenanceCommission'; |
| | | |
| | | describe('c-lex-pdf-maintenance-commission', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-pdf-maintenance-commission', { |
| | | is: LexPDFMaintenanceCommission |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | export default class LexPDFMaintenanceCommission extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id;; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | |
| | | this.PDFMaintenanceCommission(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 打印维修委托书 |
| | | PDFMaintenanceCommission() { |
| | | window.open('/apex/MaintenanceCommissionPDF?id=' + this.Id, 'MaintenanceCommissionPDF'); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <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> |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexPreContractSubmit from 'c/lexPreContractSubmit'; |
| | | |
| | | describe('c-lex-pre-contract-submit', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-pre-contract-submit', { |
| | | is: LexPreContractSubmit |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexProductRepairQuoteRepair from 'c/lexProductRepairQuoteRepair'; |
| | | |
| | | describe('c-lex-product-repair-quote-repair', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-product-repair-quote-repair', { |
| | | is: LexProductRepairQuoteRepair |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import selectAssetID from '@salesforce/apex/otherButtonRepairController.selectAssetID'; |
| | | |
| | | export default class LexProductRepairQuoteRepair extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | RecordTypeId; |
| | | AssetOwnerC; |
| | | DeliveredProductC; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeId = result.RecordTypeId; |
| | | |
| | | this.ProductRepairQuoteRepair(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 修理报价预估 |
| | | ProductRepairQuoteRepair() { |
| | | selectAssetID({ |
| | | recordId: this.Id |
| | | }).then(result => { |
| | | this.DeliveredProductC = result; |
| | | window.open('/apex/ProductRepairQuote?productid=' + this.DeliveredProductC + '&flag=asset', '', 'height=250, width=500, top=300, left=350,location=no') |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <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> |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexQuarterlyReport from 'c/lexQuarterlyReport'; |
| | | |
| | | describe('c-lex-quarterly-report', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-quarterly-report', { |
| | | is: LexQuarterlyReport |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | |
| | | export default class LexQuarterlyReport extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | RecordTypeDeveloperNameC; |
| | | EstimateTargetC; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeDeveloperNameC = result.RecordTypeDeveloperNameC; |
| | | this.EstimateTargetC = result.EstimateTargetC; |
| | | |
| | | |
| | | this.QuarterlyReport(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 制作季报 |
| | | QuarterlyReport() { |
| | | var MaintenanceContractId = this.Id; |
| | | var RecordTypeName = this.RecordTypeDeveloperNameC; |
| | | var EstimateTarget = this.EstimateTargetC; |
| | | var url = ''; |
| | | if (EstimateTarget == "经销商" && (RecordTypeName == "NewMaintenance_Contract" || RecordTypeName == "VM_Contract")) { |
| | | url = "/apex/MoreMaintenanceContractPop?Id=" + MaintenanceContractId + "&RecordTypeName=" + RecordTypeName; |
| | | } else { |
| | | url = "http://powerbi.olympus.com.cn/Home/Login"; |
| | | } |
| | | window.open(url, '_bank'); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <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> |
| New file |
| | |
| | | .outerBorderCss{ |
| | | border: 1px solid #D4D4D4; |
| | | border-radius : 5px; |
| | | border-top : 3px solid #565959; |
| | | } |
| | | .borderCss{ |
| | | border: 1px solid #D4D4D4; |
| | | border-radius : 5px; |
| | | margin-bottom : 7px; |
| | | border-top : 3px solid #565959; |
| | | } |
| | | .headerDorderCss{ |
| | | border-top: 1px solid #565959; |
| | | border-bottom: 1px solid #D4D4D4; |
| | | padding:3px; |
| | | } |
| | | .centerCss{ |
| | | text-align: center; |
| | | } |
| | | .centerCss .left{ |
| | | margin-left: 100px; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="sisToOPDHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | 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/QISReportController.initForRCCDScompleteButton'; |
| | | import updateQis from '@salesforce/apex/QISReportController.updateQisForRCCDScomplete'; |
| | | import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | |
| | | export default class lexRCCDScomplete extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | qisReportId; |
| | | cdsdate; |
| | | QIStatus; |
| | | err; |
| | | |
| | | @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 () { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | this.IsLoading = false; |
| | | this.qisReportId = result.Id; |
| | | this.cdsdate = result.cdsdate; |
| | | this.QIStatus = result.qIStatus; |
| | | if (this.QIStatus == 'RC检测申请') { |
| | | const evt = new ShowToastEvent({ |
| | | title : '需要先点击[OCM服务本部收到实物]', |
| | | message: '', |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.cdsdate != null) { |
| | | const evt = new ShowToastEvent({ |
| | | title : 'OCM服务本部CDS已经完毕', |
| | | message: '', |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | this.updateQisSubmit(); |
| | | }).catch(error => { |
| | | console.log('error='+error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | |
| | | updateQisSubmit(){ |
| | | updateQis({ |
| | | recordId: this.recordId |
| | | }).then(result =>{ |
| | | console.log('result'+result); |
| | | this.err = result; |
| | | if (result!='成功') { |
| | | const evt = new ShowToastEvent({ |
| | | title : '更新失败', |
| | | message: this.err, |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | this.updateRecordView(this.recordId); |
| | | }).catch(error => { |
| | | console.log('error='+error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexRCCDScomplete"> |
| | | <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> |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexSendRepairsToEtQ from 'c/lexSendRepairsToEtQ'; |
| | | |
| | | describe('c-lex-send-repairs-to-et-q', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-send-repairs-to-et-q', { |
| | | is: LexSendRepairsToEtQ |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import selectRecords from '@salesforce/apex/otherButtonRepairController.selectRecords'; |
| | | import sendToETQ from '@salesforce/apex/otherButtonRepairController.sendToETQ'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexSendRepairsToEtQ extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id;; |
| | | PAEDetermineC; |
| | | ETQUPLOADSTATUSC; |
| | | AEDetermineResultC; |
| | | PAEDetermineACC; |
| | | RepairInspectionDateC; |
| | | ContainUseRSAC; |
| | | userID; |
| | | profileId; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.PAEDetermineC = result.PAEDetermineC; |
| | | this.ETQUPLOADSTATUSC = result.ETQUPLOADSTATUSC; |
| | | this.AEDetermineResultC = result.AEDetermineResultC; |
| | | this.PAEDetermineACC = result.PAEDetermineACC; |
| | | this.RepairInspectionDateC = result.RepairInspectionDateC; |
| | | this.ContainUseRSAC = result.ContainUseRSAC; |
| | | this.userID = result.userID; |
| | | this.profileId = result.profileId; |
| | | |
| | | this.myDate(); |
| | | this.myReload(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 根据日期构建MessageGroupNumber |
| | | myDate() { |
| | | let messageNumber = ''; |
| | | let today = new Date(); |
| | | messageNumber = today.getFullYear() + '' + (today.getMonth() + 1) + '' + today.getDate() + '' + today.getHours() + '' + |
| | | today.getMinutes() + '' + today.getSeconds(); |
| | | return messageNumber; |
| | | } |
| | | |
| | | // 按钮点击后触发,判断是否发送过ETQ,如果发送过给出提示并灰掉按钮 |
| | | // 如果没有发送过调用发送方法 |
| | | myReload() { |
| | | selectRecords({ |
| | | recordId: this.Id |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.AsyncData__c == 'true' && result.ETQ_UPLOAD_STATUS__c != '3' || result.Complaint_Number__c != null) { |
| | | var btns = document.getElementsByName("sendrepairstoetq"); |
| | | for (var i = 0; i < btns.length; i++) { |
| | | btns[i].disabled = true; |
| | | btns[i].className = 'btnDisabled'; |
| | | } |
| | | this.ShowToastEvent('该修理之前已经发送过了', "error"); |
| | | // alert('该修理之前已经发送过了') |
| | | } else { |
| | | this.SendRepairsToEtQ(); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 发送ETQ |
| | | SendRepairsToEtQ() { |
| | | console.log(this.userID); |
| | | console.log(this.profileId); |
| | | |
| | | var uid = this.userID; |
| | | if (this.profileId != "00e10000000xnoO" && this.profileId != "00e10000000hl7w" && this.profileId != '00e10000000Y3o5') { |
| | | this.ShowToastEvent("您没有发送修理到EtQ的权限。", "error"); |
| | | // alert("您没有发送修理到EtQ的权限。"); |
| | | return; |
| | | } |
| | | var statu = ''; |
| | | if (this.PAEDetermineC == undefined) { |
| | | this.ShowToastEvent("OCSM QARA的PAE判定是空的时候,不可以发送到EtQ。", "error"); |
| | | // alert("OCSM QARA的PAE判定是空的时候,不可以发送到EtQ。"); |
| | | return; |
| | | } |
| | | if (this.ETQUPLOADSTATUSC == "3") { |
| | | if (!confirm("是否清空EtQ同步状态,重新同步数据?")) { |
| | | return; |
| | | } |
| | | } |
| | | if (this.PAEDetermineC == "nonPAE" && this.AEDetermineResultC == "nonAE" && this.PAEDetermineACC == "nonPAE" && uid != "005100000068zJ6") { |
| | | this.ShowToastEvent("Close Complait的时候,不可以发送到EtQ", "error"); |
| | | // alert("Close Complait的时候,不可以发送到EtQ"); |
| | | return; |
| | | } |
| | | if (this.PAEDetermineC != undefined && this.AEDetermineResultC != undefined && this.PAEDetermineACC == undefined) { |
| | | statu = "R1"; |
| | | } else if ((this.AEDetermineResultC != undefined && this.PAEDetermineC != undefined && this.PAEDetermineACC != undefined) && |
| | | !(this.PAEDetermineC == "nonPAE" && this.AEDetermineResultC == "nonAE" && this.PAEDetermineACC == "nonPAE")) { |
| | | statu = "R2"; |
| | | if (this.RepairInspectionDateC == "") { |
| | | this.ShowToastEvent("5.修理检测日是空的时候,不可以发送到EtQ。", "error"); |
| | | // alert("5.修理检测日是空的时候,不可以发送到EtQ。"); |
| | | return; |
| | | } |
| | | if (this.ContainUseRSAC == 1) { |
| | | this.ShowToastEvent("Final universal code为空,或者包含UseRSA,请确认。", "error"); |
| | | // alert("Final universal code为空,或者包含UseRSA,请确认。"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | var result; |
| | | try { |
| | | var repairids = new Array() |
| | | repairids[0] = this.Id; |
| | | |
| | | var statuArr = new Array(); |
| | | statuArr.push(statu); |
| | | |
| | | sendToETQ({ |
| | | iflog_Id: "", |
| | | rowDataSFDC: "", |
| | | repairIds: repairids, |
| | | statu: statuArr[0] |
| | | }).then(result => { |
| | | this.ShowToastEvent(result, "error"); |
| | | // alert(result); |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | |
| | | var btns = document.getElementsByName("sendrepairstoetq"); |
| | | for (var i = 0; i < btns.length; i++) { |
| | | btns[i].disabled = true; |
| | | btns[i].className = 'btnDisabled'; |
| | | } |
| | | location.reload(); |
| | | } catch (error) { |
| | | this.ShowToastEvent("发送修理到EtQ失败" + error.faultstring + ' code:' + error.faultcode, "error"); |
| | | // alert("发送修理到EtQ失败" + error.faultstring + ' code:' + error.faultcode); |
| | | } |
| | | } |
| | | |
| | | // 弹窗 |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <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> |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexSubmitForApproval from 'c/lexSubmitForApproval'; |
| | | |
| | | describe('c-lex-submit-for-approval', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-submit-for-approval', { |
| | | is: LexSubmitForApproval |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <div class="AntiLogicButton" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/TenderingButtonController.initTenderingController'; |
| | | import ContraryLogicalDel from '@salesforce/apex/TenderWebService.ContraryLogicalDel'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class LexTenderingAntiLogicButton extends LightningElement { |
| | | @api recordId;//当前这条数据的id |
| | | id;//返回值的id Tender_information__c招标项目的id |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | this.IsLoading = false; |
| | | this.id = result.Id; |
| | | this.AntiLogicButton(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }) |
| | | } |
| | | |
| | | //招标项目反逻辑删除 |
| | | AntiLogicButton(){ |
| | | ContraryLogicalDel({DTenId : this.id}).then(result =>{ |
| | | if(result == 'OK'){ |
| | | this.showToast("反逻辑删除成功","success"); |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }) |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| New file |
| | |
| | | <?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> |
| New file |
| | |
| | | <template> |
| | | <div class="AttachmentButton" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/TenderingButtonController.initTenderingController'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class lexTenderingAttachmentButton extends LightningElement { |
| | | @api recordId;//当前这条数据的id |
| | | id;//返回值的id Tender_information__c招标项目的id |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | this.IsLoading = false; |
| | | this.id = result.Id; |
| | | this.AttachmentButton(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }) |
| | | } |
| | | |
| | | //招标项目查看附件 |
| | | AttachmentButton(){ |
| | | window.open(`/apex/TenderInformationUploadPdf?id=${this.id}`); |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?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> |
| New file |
| | |
| | | <template> |
| | | <div class="HospitalButton" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/TenderingButtonController.initTenderingController'; |
| | | export default class lexTenderingHospitalButton extends LightningElement { |
| | | @api recordId;//当前这条数据的id |
| | | id;//返回值的id Tender_information__c招标项目的id |
| | | name;//招标项目名 |
| | | Environment_Url;//新建医院地址 |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | this.IsLoading = false; |
| | | this.id = result.Id; |
| | | this.name = result.name; |
| | | this.Environment_Url = result.Environment_Url; |
| | | this.HospitalButton(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }).catch(() => { |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | //招标项目新建医院 |
| | | HospitalButton(){ |
| | | var url = this.Environment_Url+'001/e?CF00N10000009I0o7='+encodeURIComponent(this.name) |
| | | +'&CF00N10000009I0o7_lkid='+encodeURIComponent(this.id) |
| | | +'&00N10000009HFQT='+encodeURIComponent('招标项目') |
| | | +'&RecordType=01210000000QemG' |
| | | +'&retURL='+ encodeURIComponent(this.id); |
| | | window.location.href = url; |
| | | } |
| | | } |
| New file |
| | |
| | | <?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> |
| New file |
| | |
| | | <template> |
| | | <div class="LogicButton" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/TenderingButtonController.initTenderingController'; |
| | | export default class lexTenderingLogicButton extends LightningElement { |
| | | @api recordId;//当前这条数据的id |
| | | id;//返回值的id Tender_information__c招标项目的id |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.id = result.Id; |
| | | this.LogicButton(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //招标项目逻辑删除 |
| | | LogicButton(){ |
| | | window.open (`/apex/TenderDeletePagelwc?id=${this.id}`, '', 'height=350, width=600, top=200, left=350'); |
| | | } |
| | | } |
| New file |
| | |
| | | <?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> |
| New file |
| | |
| | | <template> |
| | | <div class="LostButton" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/TenderingButtonController.initTenderingController'; |
| | | import sqlResult from '@salesforce/apex/TenderingButtonController.sqlResult'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class lexTenderingLostButton extends LightningElement { |
| | | @api recordId;//当前这条数据的id |
| | | id;//返回值的id Tender_information__c招标项目的id |
| | | status;//状态 |
| | | profileId;//profileId id |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | this.IsLoading = false; |
| | | this.id = result.Id; |
| | | this.status = result.status; |
| | | this.profileId = result.profileId.slice(0,15); |
| | | this.LoseButton(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }) |
| | | } |
| | | |
| | | //招标项目失单 |
| | | LoseButton(){ |
| | | sqlResult({id: this.id}).then(result=>{ |
| | | //简档权限 2S1_销售医院担当 2S4_销售管理者 系统管理员 |
| | | if (this.profileId != '00e10000000xnp2' && this.profileId != '00e10000000xnpH' && this.profileId != '00e10000000Y3o5') { |
| | | this.showToast("您没有权限,无法创建询价提交失单。","error"); |
| | | return; |
| | | } |
| | | // 判断内部确认状态 |
| | | if(this.status == '01.待确认'|| this.status == '02.不相关'){ |
| | | this.showToast("状态为待确认或不相关,不可以做失单。","error"); |
| | | return; |
| | | } |
| | | // 判断是否需要新建询价 |
| | | if(this.status == '05.询价中'|| this.status == '06.成交' || this.status == '07.部分成交' || this.status == '08.失单' || result.length > 0){ |
| | | if(confirm('此项目已关联询价,请确实是否新建询价提交失单。')) { |
| | | |
| | | }else{ |
| | | return; |
| | | } |
| | | } |
| | | window.open(`/apex/TenderLostPage?id=${this.id}`,'','height=500,width=800,top=200,left=250,location=no'); |
| | | }) |
| | | } |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| New file |
| | |
| | | <?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> |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexUploadToRecognitionModel from 'c/lexUploadToRecognitionModel'; |
| | | |
| | | describe('c-lex-upload-to-recognition-model', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-upload-to-recognition-model', { |
| | | is: LexUploadToRecognitionModel |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | import updateColunm from '@salesforce/apex/MaintenanceContractSetColunmWebService.updateColunm'; |
| | | import up2sap from '@salesforce/apex/MaintenanceContractWebService.up2sap'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexUploadToRecognitionModel extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | ContractQuotationOrNotC; |
| | | oldIsRecognitionModelC; |
| | | MaintenanceContractNoC; |
| | | uploadToRMTimeC; |
| | | uploadToSapTimeC; |
| | | PaymentPlanSumFirstC; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.ContractQuotationOrNotC = result.ContractQuotationOrNotC; |
| | | this.oldIsRecognitionModelC = result.oldIsRecognitionModelC; |
| | | this.MaintenanceContractNoC = result.MaintenanceContractNoC; |
| | | this.uploadToSapTimeC = result.uploadToSapTimeC; |
| | | this.uploadToRMTimeC = result.uploadToRMTimeC; |
| | | this.PaymentPlanSumFirstC = result.PaymentPlanSumFirstC; |
| | | |
| | | this.uploadToRecognitionModel(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 上传认款合同 |
| | | uploadToRecognitionModel() { |
| | | if (this.ContractQuotationOrNotC == '还没做报价') { |
| | | this.ShowToastEvent("您还没有做合同报价,不能上传认款合同。", "error") |
| | | // alert("您还没有做合同报价,不能上传认款合同。"); |
| | | } else if (this.MaintenanceContractNoC == undefined) { |
| | | this.ShowToastEvent('合同号码为空,不能上传认款合同。', "error") |
| | | // alert('合同号码为空,不能上传认款合同。'); |
| | | } else if (this.uploadToSapTimeC != undefined) { |
| | | this.ShowToastEvent('已经上传SAP,不能再次上传认款合同。', "error") |
| | | // alert('已经上传SAP,不能再次上传认款合同。'); |
| | | } else if (this.uploadToRMTimeC != undefined) { |
| | | this.ShowToastEvent('已经上传认款合同,不能再次上传认款合同。', "error") |
| | | // alert('已经上传认款合同,不能再次上传认款合同。'); |
| | | } else { |
| | | if (!this.oldIsRecognitionModelC) { |
| | | this.ShowToastEvent('经销商为空或经销商不是先款对象,不需要上传认款合同。', "error") |
| | | // alert('经销商为空或经销商不是先款对象,不需要上传认款合同。'); |
| | | } else if (this.PaymentPlanSumFirstC == undefined) { |
| | | this.ShowToastEvent('第一次计划付款金额不能为空。', "error") |
| | | // alert('第一次计划付款金额不能为空。'); |
| | | } else { |
| | | if (!confirm('请确认是否要上传认款合同。')) { |
| | | return; |
| | | } |
| | | |
| | | updateColunm({ |
| | | mcid: this.Id |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != '1') { |
| | | this.ShowToastEvent('上传认款合同失败,因为 来年合同相关信息修改失败', "error") |
| | | // alert('上传认款合同失败,因为 来年合同相关信息修改失败'); |
| | | location.href = "/" + this.Id; |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | |
| | | up2sap({ |
| | | mcid: this.Id |
| | | }).then(rtn => { |
| | | console.log(rtn); |
| | | if (rtn == '1') { |
| | | this.ShowToastEvent("上传认款合同成功", "success") |
| | | // alert("上传认款合同成功"); |
| | | location.href = "/" + this.Id; |
| | | } else { |
| | | this.ShowToastEvent(rtn, "error") |
| | | // alert(rtn); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 弹窗 |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <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> |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexUploadToSap from 'c/lexUploadToSap'; |
| | | |
| | | describe('c-lex-upload-to-sap', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-upload-to-sap', { |
| | | is: LexUploadToSap |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexYanshoudanRequest from 'c/lexYanshoudanRequest'; |
| | | |
| | | describe('c-lex-yanshoudan-request', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-yanshoudan-request', { |
| | | is: LexYanshoudanRequest |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import updateYanshoudan from '@salesforce/apex/otherButtonRepairController.updateYanshoudan'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexYanshoudanRequest extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | |
| | | this.YanshoudanRequest(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 验收单回收申请 |
| | | YanshoudanRequest() { |
| | | updateYanshoudan({ |
| | | recordId: this.Id |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var indexs = result.indexOf(": ") |
| | | var resolves = result.substring(indexs + 1, result.length); |
| | | alert(resolves); |
| | | } |
| | | location.reload(); |
| | | }) |
| | | } |
| | | |
| | | // 弹窗 |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <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> |