LiJinHuan
2023-07-06 e69ad8a253c04834488b00c2b1be138c583e40b5
调拨新建重写新建默认No.的值 *
1个文件已修改
7个文件已添加
151 ■■■■ 已修改文件
force-app/main/default/aura/TransferApplyNew/TransferApplyNew.cmp 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/TransferApplyNew/TransferApplyNew.cmp-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/TransferApplyNew/TransferApplyNewController.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexRentalApplyFaultReportController.cls 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTransferApplyNew/__tests__/lexTransferApplyNew.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.html 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.js 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.js-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/TransferApplyNew/TransferApplyNew.cmp
New file
@@ -0,0 +1,33 @@
<!--
 * @Description:
 * @Author: [lijinhuan]
 * @Date: 2023-04-26 17:25:35
 * @LastEditors: [lijinhuan]
 * @LastEditTime: 2023-07-03 16:17:03
-->
<aura:component
    implements="lightning:actionOverride,lightning:isUrlAddressable,force:lightningQuickAction,force:hasRecordId"
    access="global">
        <aura:html tag="style">
            .slds-modal__container{
            max-width: 65rem !important;
            width:100% !important;
            }
            .cuf-content {
            padding: 0 0rem !important;
            }
            .slds-p-around--medium {
            padding: 0rem !important;
            }
            .slds-modal__content{
            overflow-y:auto !important;
            height:unset !important;
            max-height:unset !important;
            min-height:8rem;
            }
            .slds-tile_board{
            padding:20px 40px;
            }
        </aura:html>
    <c:lexTransferApplyNew />
</aura:component>
force-app/main/default/aura/TransferApplyNew/TransferApplyNew.cmp-meta.xml
New file
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>56.0</apiVersion>
    <description>A Lightning Component Bundle</description>
</AuraDefinitionBundle>
force-app/main/default/aura/TransferApplyNew/TransferApplyNewController.js
New file
@@ -0,0 +1,5 @@
({
    myAction : function(component, event, helper) {
    }
})
force-app/main/default/classes/lexRentalApplyFaultReportController.cls
@@ -3,7 +3,7 @@
 * @Author: [lijinhuan]
 * @Date: 2023-06-25 20:04:41
 * @LastEditors: [lijinhuan]
 * @LastEditTime: 2023-07-06 15:50:03
 * @LastEditTime: 2023-07-06 17:22:39
 */
public without sharing class lexRentalApplyFaultReportController {
    @AuraEnabled
@@ -39,24 +39,26 @@
            //查当前明细下有多少故障报告
            // 0 没有报告
            // Id 有 最新一条为草案中
            // 2 有很多条
            Map<String,String> sIdMap = New Map<String,String>();
            for(Rental_Apply_Fault__c raf : [SELECT Id ,status__c ,Rental_Apply_Equipment_Set_Detail__c from Rental_Apply_Fault__c where Rental_Apply_Equipment_Set_Detail__c in :eIds Order By CreatedDate DESC]){
                if(!sIdMap.containsKey(raf.Rental_Apply_Equipment_Set_Detail__c)){
                    sIdMap.put(raf.Rental_Apply_Equipment_Set_Detail__c,raf.Id);
            // 2 有很多条 没有这个场景
            if(eIds.size() > 0){
                Map<String,String> sIdMap = New Map<String,String>();
                for(Rental_Apply_Fault__c raf : [SELECT Id ,status__c ,Rental_Apply_Equipment_Set_Detail__c from Rental_Apply_Fault__c where Rental_Apply_Equipment_Set_Detail__c in :eIds Order By CreatedDate DESC]){
                    if(!sIdMap.containsKey(raf.Rental_Apply_Equipment_Set_Detail__c)){
                        sIdMap.put(raf.Rental_Apply_Equipment_Set_Detail__c,raf.Id);
                    }
                }
            }
            for(Rental_Apply_Equipment_Set_Detail__c rae : eList){
                RetObject temp = new RetObject();
                temp.rae = rae;
                if(sIdMap.containsKey(rae.Id)){
                    temp.faultId = sIdMap.get(rae.Id) ;
                }else{
                    temp.faultId = '';
                for(Rental_Apply_Equipment_Set_Detail__c rae : eList){
                    RetObject temp = new RetObject();
                    temp.rae = rae;
                    if(sIdMap.containsKey(rae.Id)){
                        temp.faultId = sIdMap.get(rae.Id) ;
                    }else{
                        temp.faultId = '';
                    }
                    retObjectList.add(temp);
                }
                retObjectList.add(temp);
                return retObjectList;
            }
            return retObjectList;
        }
        catch (Exception e) {
            System.debug('*******lexRentalApplyFaultReportController******'+e.getMessage());
force-app/main/default/lwc/lexTransferApplyNew/__tests__/lexTransferApplyNew.test.js
New file
@@ -0,0 +1,25 @@
import { createElement } from 'lwc';
import LexTransferApplyNew from 'c/lexTransferApplyNew';
describe('c-lex-transfer-apply-new', () => {
    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-transfer-apply-new', {
            is: LexTransferApplyNew
        });
        // Act
        document.body.appendChild(element);
        // Assert
        // const div = element.shadowRoot.querySelector('div');
        expect(1).toBe(1);
    });
});
force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.html
New file
@@ -0,0 +1,3 @@
<template>
</template>
force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.js
New file
@@ -0,0 +1,41 @@
/*
 * @Description: 新建调拨重写 No. 默认*
 * @Author: [lijinhuan]
 * @Date: 2023-07-03 15:55:28
 * @LastEditors: [lijinhuan]
 * @LastEditTime: 2023-07-06 18:05:15
 */
import { LightningElement,wire } from 'lwc';
import { CurrentPageReference,NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
export default class LexTransferApplyNew extends NavigationMixin(LightningElement) {
    recordTypeId;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
        if (currentPageReference) {
            const urlValue = currentPageReference.state.recordTypeId;
            if (urlValue) {
                let str = `${urlValue}`;
                this.recordTypeId = str;
                let defaultFieldValues = {};
                defaultFieldValues['Name'] = '*';
                this[NavigationMixin.Navigate]({
                    type: 'standard__objectPage',
                    attributes: {
                        objectApiName: 'TransferApply__c',
                        actionName: 'new'
                    },
                    state: {
                        nooverride: '1',
                        defaultFieldValues: encodeDefaultFieldValues(defaultFieldValues),
                        recordTypeId: this.recordTypeId,
                        useRecordTypeCheck: 1,
                        navigationLocation: 'LIST_VIEW',
                        backgroundContext: '/lightning/o/TransferApply__c/list?filterName=Recent&0.source=alohaHeader'
                    }
                });
            }
        }
    }
}
force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.js-meta.xml
New file
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>57.0</apiVersion>
    <isExposed>false</isExposed>
</LightningComponentBundle>