Merge branch 'LEXCommunityLiJun' into LEXUpgrade2023-Deloitte
275个文件已修改
10个文件已删除
476个文件已添加
| | |
| | | # Local environment variables |
| | | .env |
| | | .vim-force.com/session.properties |
| | | .sf/config.json |
| New file |
| | |
| | | ref: refs/heads/main |
| New file |
| | |
| | | [core] |
| | | repositoryformatversion = 0 |
| | | filemode = false |
| | | bare = false |
| | | logallrefupdates = true |
| | | symlinks = false |
| | | ignorecase = true |
| New file |
| | |
| | | ref: refs/heads/main |
| New file |
| | |
| | | [core] |
| | | repositoryformatversion = 0 |
| | | filemode = false |
| | | bare = false |
| | | logallrefupdates = true |
| | | symlinks = false |
| | | ignorecase = true |
| New file |
| | |
| | | ref: refs/heads/main |
| New file |
| | |
| | | [core] |
| | | repositoryformatversion = 0 |
| | | filemode = false |
| | | bare = false |
| | | logallrefupdates = true |
| | | symlinks = false |
| | | ignorecase = true |
| | |
| | | "**/.sfdx": true |
| | | }, |
| | | "salesforcedx-vscode-core.show-cli-success-msg": false, |
| | | "open-in-browser.default": "{\"opn-in-browser.default\":\"Microsoft Edge\"}", |
| | | "salesforcedx-vscode-apex.java.home": "C:\\Users\\buli\\Documents\\Software\\JDK\\jdk19\\bin" |
| | | "salesforcedx-vscode-apex.java.home": "C:\\Users\\buli\\Documents\\Software\\JDK11\\", |
| | | "open-in-browser.default": "{\"opn-in-browser.default\":\"Microsoft Edge\"}" |
| | | } |
| | |
| | | <aura:component controller="CreateTargetCmp" implements="forceCommunity:availableForAllPageTypes,force:hasRecordId" access="global" > |
| | | <aura:component |
| | | controller="CreateTargetCmp" |
| | | implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" |
| | | access="global" |
| | | > |
| | | <aura:handler name="init" value="{!this}" action="{!c.doInit}"/> |
| | | <aura:attribute name="recordId" type="Id" /> |
| | | <aura:attribute name="hospital" type="string" default=""/> |
| | |
| | | <aura:attribute name="OTHAmount" type="string" default="0.00"/> |
| | | <aura:attribute name="OCMTerm" type="string" default=""/> |
| | | <aura:attribute name="button_text" type="string" default="新建"/> |
| | | <aura:handler name="change" value="{!v.record.Agency_Hospital__c}" action="{!c.hosChange}"/> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.record.Agency_Hospital__c}" |
| | | action="{!c.hosChange}" |
| | | /> |
| | | <aura:attribute name="hospitalList" type="sobject[]" /> |
| | | <aura:attribute name="record" type="Agency_Opportunity__c" default="{'sobjectType':'Agency_Opportunity__c'}"/> |
| | | <aura:handler name="change" value="{!v.recordET.Product_Category1__c}" action="{!c.productcategoryETChange1}"/> |
| | | <aura:handler name="change" value="{!v.recordET.Product_Category2__c}" action="{!c.productcategoryETChange2}"/> |
| | | <aura:handler name="change" value="{!v.recordET.Product_Category3__c}" action="{!c.productcategoryETChange3}"/> |
| | | <aura:attribute |
| | | name="record" |
| | | type="Agency_Opportunity__c" |
| | | default="{'sobjectType':'Agency_Opportunity__c'}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordET.Product_Category1__c}" |
| | | action="{!c.productcategoryETChange1}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordET.Product_Category2__c}" |
| | | action="{!c.productcategoryETChange2}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordET.Product_Category3__c}" |
| | | action="{!c.productcategoryETChange3}" |
| | | /> |
| | | |
| | | |
| | | <aura:handler name="change" value="{!v.recordBF.Product_Category1__c}" action="{!c.productcategoryBFChange1}"/> |
| | | <aura:handler name="change" value="{!v.recordBF.Product_Category2__c}" action="{!c.productcategoryBFChange2}"/> |
| | | <aura:handler name="change" value="{!v.recordBF.Product_Category3__c}" action="{!c.productcategoryBFChange3}"/> |
| | | <aura:handler name="change" value="{!v.recordGS.Product_Category1__c}" action="{!c.productcategoryGSChange1}"/> |
| | | <aura:handler name="change" value="{!v.recordGS.Product_Category2__c}" action="{!c.productcategoryGSChange2}"/> |
| | | <aura:handler name="change" value="{!v.recordGS.Product_Category3__c}" action="{!c.productcategoryGSChange3}"/> |
| | | <aura:handler name="change" value="{!v.recordURO.Product_Category1__c}" action="{!c.productcategoryUROChange1}"/> |
| | | <aura:handler name="change" value="{!v.recordURO.Product_Category2__c}" action="{!c.productcategoryUROChange2}"/> |
| | | <aura:handler name="change" value="{!v.recordURO.Product_Category3__c}" action="{!c.productcategoryUROChange3}"/> |
| | | <aura:handler name="change" value="{!v.recordGYN.Product_Category1__c}" action="{!c.productcategoryGYNChange1}"/> |
| | | <aura:handler name="change" value="{!v.recordGYN.Product_Category2__c}" action="{!c.productcategoryGYNChange2}"/> |
| | | <aura:handler name="change" value="{!v.recordGYN.Product_Category3__c}" action="{!c.productcategoryGYNChange3}"/> |
| | | <aura:handler name="change" value="{!v.recordENT.Product_Category1__c}" action="{!c.productcategoryENTChange1}"/> |
| | | <aura:handler name="change" value="{!v.recordENT.Product_Category2__c}" action="{!c.productcategoryENTChange2}"/> |
| | | <aura:handler name="change" value="{!v.recordENT.Product_Category3__c}" action="{!c.productcategoryENTChange3}"/> |
| | | <aura:handler name="change" value="{!v.recordOTH.Product_Category1__c}" action="{!c.productcategoryOTHChange1}"/> |
| | | <aura:handler name="change" value="{!v.recordOTH.Product_Category2__c}" action="{!c.productcategoryOTHChange2}"/> |
| | | <aura:handler name="change" value="{!v.recordOTH.Product_Category3__c}" action="{!c.productcategoryOTHChange3}"/> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordBF.Product_Category1__c}" |
| | | action="{!c.productcategoryBFChange1}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordBF.Product_Category2__c}" |
| | | action="{!c.productcategoryBFChange2}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordBF.Product_Category3__c}" |
| | | action="{!c.productcategoryBFChange3}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordGS.Product_Category1__c}" |
| | | action="{!c.productcategoryGSChange1}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordGS.Product_Category2__c}" |
| | | action="{!c.productcategoryGSChange2}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordGS.Product_Category3__c}" |
| | | action="{!c.productcategoryGSChange3}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordURO.Product_Category1__c}" |
| | | action="{!c.productcategoryUROChange1}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordURO.Product_Category2__c}" |
| | | action="{!c.productcategoryUROChange2}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordURO.Product_Category3__c}" |
| | | action="{!c.productcategoryUROChange3}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordGYN.Product_Category1__c}" |
| | | action="{!c.productcategoryGYNChange1}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordGYN.Product_Category2__c}" |
| | | action="{!c.productcategoryGYNChange2}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordGYN.Product_Category3__c}" |
| | | action="{!c.productcategoryGYNChange3}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordENT.Product_Category1__c}" |
| | | action="{!c.productcategoryENTChange1}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordENT.Product_Category2__c}" |
| | | action="{!c.productcategoryENTChange2}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordENT.Product_Category3__c}" |
| | | action="{!c.productcategoryENTChange3}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordOTH.Product_Category1__c}" |
| | | action="{!c.productcategoryOTHChange1}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordOTH.Product_Category2__c}" |
| | | action="{!c.productcategoryOTHChange2}" |
| | | /> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.recordOTH.Product_Category3__c}" |
| | | action="{!c.productcategoryOTHChange3}" |
| | | /> |
| | | <div class="button_area"> |
| | | <ui:button label="{!v.button_text}" press="{!c.toggle_report}"/> |
| | | </div> |
| | | <div aura:id="modal_window" role="dialog" tabindex="-1" class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget"> |
| | | <div |
| | | aura:id="modal_window" |
| | | role="dialog" |
| | | tabindex="-1" |
| | | class="disp_none slds-modal slds-fade-in-open slds-modal--large" |
| | | aria-labelledby="headerTarget" |
| | | > |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal__header"> |
| | | <button class="slds-button slds-modal__close slds-button--icon-inverse" title="Close" onclick="{!c.toggle_report}"> |
| | | <lightning:icon class="close_icn" iconName="utility:close" size="medium" alternativeText="Indicates approval"/> |
| | | <button |
| | | class="slds-button slds-modal__close slds-button--icon-inverse" |
| | | title="Close" |
| | | onclick="{!c.toggle_report}" |
| | | > |
| | | <lightning:icon |
| | | iconName="utility:close" |
| | | size="medium" |
| | | alternative-text="close" |
| | | variant="inverse" |
| | | /> |
| | | <span class="slds-assistive-text">Close</span> |
| | | </button> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium">目标({!v.OCMTerm})</h2> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium"> |
| | | 目标({!v.OCMTerm}) |
| | | </h2> |
| | | </div> |
| | | <div class="slds-modal__content slds-grow slds-p-around--medium"> |
| | | <div class="slds-box slds-theme--shade "> |
| | | <fieldset class="slds-form--compound"> |
| | | <div class="slds-form-element__group"> |
| | | <div class="slds-form-element__row"> |
| | | <div class="slds-form-element slds-size--1-of-2"> |
| | | <label class="slds-form-element__label" for="input-hos">医院</label> |
| | | <force:inputField value="{!v.record.Agency_Hospital__c}" aura:id="input-hos"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-2" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >医院</label |
| | | > |
| | | <!-- <force:inputField value="{!v.record.Agency_Hospital__c}" aura:id="input-hos"/> --> |
| | | <lightning:recordEditForm |
| | | objectApiName="Agency_Opportunity__c" |
| | | > |
| | | <lightning:inputField |
| | | variant="label-hidden" |
| | | fieldName="Agency_Hospital__c" |
| | | value="{!v.record.Agency_Hospital__c}" |
| | | aura:id="input-hos" |
| | | /> |
| | | </lightning:recordEditForm> |
| | | </div> |
| | | </div> |
| | | <!-- <h4 class="slds-section__title">访问目标</h4> |
| | |
| | | </div> --> |
| | | <h4 class="slds-section__title">产品目标</h4> |
| | | <div class="slds-form-element__row"> |
| | | <div class="slds-size--1-of-7 slds-grid--align-center"> |
| | | <div style="margin-top: 32px;">消化科</div> |
| | | <div |
| | | class="slds-size--1-of-7 slds-grid--align-center" |
| | | > |
| | | <div style="margin-top: 32px">消化科</div> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分1</label> |
| | | <ui:inputSelect aura:id="select_GI1" class="slds-select" change="{!c.productcategoryGIChange1}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分1</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_GI1" |
| | | class="slds-select" |
| | | change="{!c.productcategoryGIChange1}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_GI4_1" class="slds-select"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GI4_1" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分2</label> |
| | | <ui:inputSelect aura:id="select_GI2" class="slds-select" change="{!c.productcategoryGIChange2}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分2</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_GI2" |
| | | class="slds-select" |
| | | change="{!c.productcategoryGIChange2}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_GI4_2" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GI4_2" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分3</label> |
| | | <ui:inputSelect aura:id="select_GI3" class="slds-select" change="{!c.productcategoryGIChange3}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分3</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_GI3" |
| | | class="slds-select" |
| | | change="{!c.productcategoryGIChange3}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_GI4_3" class="slds-select"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GI4_3" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="slds-form-element__row"> |
| | | <div class="slds-size--1-of-7 slds-grid--align-center"> |
| | | <div style="margin-top: 32px;">ET耗材</div> |
| | | <div |
| | | class="slds-size--1-of-7 slds-grid--align-center" |
| | | > |
| | | <div style="margin-top: 32px">ET耗材</div> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分1</label> |
| | | <ui:inputSelect aura:id="select_ET1" class="slds-select" change="{!c.productcategoryETChange1}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分1</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_ET1" |
| | | class="slds-select" |
| | | change="{!c.productcategoryETChange1}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_ET4_1" class="slds-select"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_ET4_1" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分2</label> |
| | | <ui:inputSelect aura:id="select_ET2" class="slds-select" change="{!c.productcategoryETChange2}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分2</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_ET2" |
| | | class="slds-select" |
| | | change="{!c.productcategoryETChange2}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_ET4_2" class="slds-select"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_ET4_2" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分3</label> |
| | | <ui:inputSelect aura:id="select_ET3" class="slds-select" change="{!c.productcategoryETChange3}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分3</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_ET3" |
| | | class="slds-select" |
| | | change="{!c.productcategoryETChange3}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_ET4_3" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_ET4_3" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="slds-form-element__row"> |
| | | <div class="slds-size--1-of-7 slds-grid--align-center"> |
| | | <div style="margin-top: 32px;">呼吸科</div> |
| | | <div |
| | | class="slds-size--1-of-7 slds-grid--align-center" |
| | | > |
| | | <div style="margin-top: 32px">呼吸科</div> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分1</label> |
| | | <ui:inputSelect aura:id="select_BF1" class="slds-select" change="{!c.productcategoryBFChange1}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分1</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_BF1" |
| | | class="slds-select" |
| | | change="{!c.productcategoryBFChange1}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_BF4_1" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_BF4_1" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分2</label> |
| | | <ui:inputSelect aura:id="select_BF2" class="slds-select" change="{!c.productcategoryBFChange2}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分2</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_BF2" |
| | | class="slds-select" |
| | | change="{!c.productcategoryBFChange2}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_BF4_2" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_BF4_2" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分3</label> |
| | | <ui:inputSelect aura:id="select_BF3" class="slds-select" change="{!c.productcategoryBFChange3}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分3</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_BF3" |
| | | class="slds-select" |
| | | change="{!c.productcategoryBFChange3}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_BF4_3" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_BF4_3" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="slds-form-element__row"> |
| | | <div class="slds-size--1-of-7 slds-grid--align-center"> |
| | | <div style="margin-top: 32px;">普外科</div> |
| | | <div |
| | | class="slds-size--1-of-7 slds-grid--align-center" |
| | | > |
| | | <div style="margin-top: 32px">普外科</div> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分1</label> |
| | | <ui:inputSelect aura:id="select_GS1" class="slds-select" change="{!c.productcategoryGSChange1}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分1</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_GS1" |
| | | class="slds-select" |
| | | change="{!c.productcategoryGSChange1}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_GS4_1" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GS4_1" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分2</label> |
| | | <ui:inputSelect aura:id="select_GS2" class="slds-select" change="{!c.productcategoryGSChange2}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分2</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_GS2" |
| | | class="slds-select" |
| | | change="{!c.productcategoryGSChange2}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_GS4_2" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GS4_2" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分3</label> |
| | | <ui:inputSelect aura:id="select_GS3" class="slds-select" change="{!c.productcategoryGSChange3}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分3</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_GS3" |
| | | class="slds-select" |
| | | change="{!c.productcategoryGSChange3}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_GS4_3" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GS4_3" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="slds-form-element__row"> |
| | | <div class="slds-size--1-of-7 slds-grid--align-center"> |
| | | <div style="margin-top: 32px;">泌尿科</div> |
| | | <div |
| | | class="slds-size--1-of-7 slds-grid--align-center" |
| | | > |
| | | <div style="margin-top: 32px">泌尿科</div> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分1</label> |
| | | <ui:inputSelect aura:id="select_URO1" class="slds-select" change="{!c.productcategoryUROChange1}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分1</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_URO1" |
| | | class="slds-select" |
| | | change="{!c.productcategoryUROChange1}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_URO4_1" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_URO4_1" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分2</label> |
| | | <ui:inputSelect aura:id="select_URO2" class="slds-select" change="{!c.productcategoryUROChange2}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分2</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_URO2" |
| | | class="slds-select" |
| | | change="{!c.productcategoryUROChange2}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_URO4_2" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_URO4_2" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分3</label> |
| | | <ui:inputSelect aura:id="select_URO3" class="slds-select" change="{!c.productcategoryUROChange3}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分3</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_URO3" |
| | | class="slds-select" |
| | | change="{!c.productcategoryUROChange3}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_URO4_3" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_URO4_3" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="slds-form-element__row"> |
| | | <div class="slds-size--1-of-7 slds-grid--align-center"> |
| | | <div style="margin-top: 32px;">妇科</div> |
| | | <div |
| | | class="slds-size--1-of-7 slds-grid--align-center" |
| | | > |
| | | <div style="margin-top: 32px">妇科</div> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分1</label> |
| | | <ui:inputSelect aura:id="select_GYN1" class="slds-select" change="{!c.productcategoryGYNChange1}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分1</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_GYN1" |
| | | class="slds-select" |
| | | change="{!c.productcategoryGYNChange1}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_GYN4_1" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GYN4_1" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分2</label> |
| | | <ui:inputSelect aura:id="select_GYN2" class="slds-select" change="{!c.productcategoryGYNChange2}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分2</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_GYN2" |
| | | class="slds-select" |
| | | change="{!c.productcategoryGYNChange2}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_GYN4_2" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GYN4_2" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分3</label> |
| | | <ui:inputSelect aura:id="select_GYN3" class="slds-select" change="{!c.productcategoryGYNChange3}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分3</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_GYN3" |
| | | class="slds-select" |
| | | change="{!c.productcategoryGYNChange3}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_GYN4_3" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GYN4_3" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="slds-form-element__row"> |
| | | <div class="slds-size--1-of-7 slds-grid--align-center"> |
| | | <div style="margin-top: 32px;">耳鼻喉科</div> |
| | | <div |
| | | class="slds-size--1-of-7 slds-grid--align-center" |
| | | > |
| | | <div style="margin-top: 32px">耳鼻喉科</div> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分1</label> |
| | | <ui:inputSelect aura:id="select_ENT1" class="slds-select" change="{!c.productcategoryENTChange1}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分1</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_ENT1" |
| | | class="slds-select" |
| | | change="{!c.productcategoryENTChange1}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_ENT4_1" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_ENT4_1" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分2</label> |
| | | <ui:inputSelect aura:id="select_ENT2" class="slds-select" change="{!c.productcategoryENTChange2}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分2</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_ENT2" |
| | | class="slds-select" |
| | | change="{!c.productcategoryENTChange2}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_ENT4_2" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_ENT4_2" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分3</label> |
| | | <ui:inputSelect aura:id="select_ENT3" class="slds-select" change="{!c.productcategoryENTChange3}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分3</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_ENT3" |
| | | class="slds-select" |
| | | change="{!c.productcategoryENTChange3}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_ENT4_3" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_ENT4_3" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="slds-form-element__row"> |
| | | <div class="slds-size--1-of-7 slds-grid--align-center"> |
| | | <div style="margin-top: 32px;">其他</div> |
| | | <div |
| | | class="slds-size--1-of-7 slds-grid--align-center" |
| | | > |
| | | <div style="margin-top: 32px">其他</div> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分1</label> |
| | | <ui:inputSelect aura:id="select_OTH1" class="slds-select" change="{!c.productcategoryOTHChange1}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分1</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_OTH1" |
| | | class="slds-select" |
| | | change="{!c.productcategoryOTHChange1}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_OTH4_1" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_OTH4_1" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分2</label> |
| | | <ui:inputSelect aura:id="select_OTH2" class="slds-select" change="{!c.productcategoryOTHChange2}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分2</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_OTH2" |
| | | class="slds-select" |
| | | change="{!c.productcategoryOTHChange2}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_OTH4_2" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_OTH4_2" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">产品区分3</label> |
| | | <ui:inputSelect aura:id="select_OTH3" class="slds-select" change="{!c.productcategoryOTHChange3}"/> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >产品区分3</label |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_OTH3" |
| | | class="slds-select" |
| | | change="{!c.productcategoryOTHChange3}" |
| | | /> |
| | | </div> |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos">金额目标(不含税)</label> |
| | | <ui:inputText aura:id="select_OTH4_3" class="slds-select" /> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_OTH4_3" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | <div class="slds-modal__footer slds-grid slds-grid--align-spread"> |
| | | <div class="slds-order--1" /> |
| | | <ui:button aura:id="save_button" label="保存" class="slds-button slds-button--brand slds-order--2" press="{!c.createTarget}"/> |
| | | <ui:button |
| | | aura:id="save_button" |
| | | label="保存" |
| | | class="slds-button slds-button--brand slds-order--2" |
| | | press="{!c.createTarget}" |
| | | /> |
| | | <div class="slds-order--3" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div aura:id="modal_bg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | <div |
| | | aura:id="modal_bg" |
| | | class="disp_none slds-backdrop slds-backdrop--open" |
| | | ></div> |
| | | </aura:component> |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>39.0</apiVersion> |
| | | <apiVersion>42.0</apiVersion> |
| | | <description>A Lightning Component Bundle</description> |
| | | </AuraDefinitionBundle> |
| | |
| | | .THIS.disp_none { |
| | | display: none; |
| | | } |
| | | .THIS select { |
| | | --lwc-lineHeightButton: 36px; |
| | | --lwc-heightInput: 36px; |
| | | min-height: 0px !important; |
| | | height: 36px !important; |
| | | } |
| | |
| | | ({ |
| | | doinit : function(component, event, helper) { |
| | | component.set("v.OCMTerm", this.getOCMTerm()); |
| | | if (component.get("v.recordId")) { |
| | | component.set("v.button_text", "编辑"); |
| | | var recordId = component.get("v.recordId"); |
| | | var action = component.get("c.getHospital"); |
| | | action.setParams({"recordId": recordId}); |
| | | component.set('v.OCMTerm', this.getOCMTerm()); |
| | | if (component.get('v.recordId')) { |
| | | component.set('v.button_text', '编辑'); |
| | | var recordId = component.get('v.recordId'); |
| | | var action = component.get('c.getHospital'); |
| | | action.setParams({ recordId: recordId }); |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | if(state === "SUCCESS") { |
| | | console.log('state1:' + state); |
| | | if (state === 'SUCCESS') { |
| | | var ah = response.getReturnValue(); |
| | | var select_ah = ah.Id; |
| | | var select_ah_name = ah.Name; |
| | | |
| | | component.set('v.record.Agency_Hospital__c', select_ah); |
| | | // component.set('v.record.Agency_Hospital__c', select_ah); |
| | | //add by Deloitte 2023-6-8 |
| | | let agency = component.get('v.record'); |
| | | agency.Agency_Hospital__c = select_ah; |
| | | // component.set("v.record", agency); |
| | | // alert(JSON.stringify(component.find('input-hos').get("v.body")[0].get('v.values'))); |
| | | if ($A.get("$Browser.formFactor") == 'DESKTOP') { |
| | | var values = [{ |
| | | if ($A.get('$Browser.formFactor') == 'DESKTOP') { |
| | | console.log('flag1'); |
| | | var values = [ |
| | | { |
| | | type: 'Agency_Hospital_Link__c', |
| | | id: select_ah, |
| | | label: select_ah_name, |
| | |
| | | backgroundColor:'dc71d1', |
| | | alt:'Agency_Hospital_Link__c' |
| | | } |
| | | }]; |
| | | component.find('input-hos').get("v.body")[0].set('v.values', values); |
| | | } else { |
| | | component.find('input-hos').get("v.body")[0].set('v.selectedLabel', select_ah_name); |
| | | } |
| | | |
| | | } else if (state === "ERROR") { |
| | | ]; |
| | | // component.find('input-hos').get("v.body")[0].set('v.values', values); |
| | | //add by Deloitte 2023-6-8 |
| | | if ( |
| | | component.find('input-hos').get('v.body') && |
| | | component.find('input-hos').get('v.body').length > 0 |
| | | ) { |
| | | component |
| | | .find('input-hos') |
| | | .get('v.body')[0] |
| | | .set('v.values', values); |
| | | } |
| | | } else { |
| | | // component.find('input-hos').get("v.body")[0].set('v.selectedLabel', select_ah_name); |
| | | //add by Deloitte 2023-6-8 |
| | | if ( |
| | | component.find('input-hos').get('v.body') && |
| | | component.find('input-hos').get('v.body').length > 0 |
| | | ) { |
| | | component |
| | | .find('input-hos') |
| | | .get('v.body')[0] |
| | | .set('v.selectedLabel', select_ah_name); |
| | | } |
| | | } |
| | | } else if (state === 'ERROR') { |
| | | var errors = response.getError(); |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | toastEvent.setParams({ |
| | | "title": "错误", |
| | | "type":"error", |
| | | "message": errors[0].message |
| | | title: '错误', |
| | | type: 'error', |
| | | message: errors[0].message |
| | | }); |
| | | toastEvent.fire(); |
| | | |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | |
| | | var action = component.get("c.getProductList"); |
| | | var action = component.get('c.getProductList'); |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | if(state === "SUCCESS") { |
| | | console.log('state2:' + state); |
| | | if (state === 'SUCCESS') { |
| | | var opts = response.getReturnValue(); |
| | | // alert(JSON.stringify(opts["GI"])); |
| | | component.find("select_GI1").set("v.options", JSON.parse(JSON.stringify(opts["GI"]))); |
| | | component.find("select_GI2").set("v.options", JSON.parse(JSON.stringify(opts["GI"]))); |
| | | component.find("select_GI3").set("v.options", JSON.parse(JSON.stringify(opts["GI"]))); |
| | | component |
| | | .find('select_GI1') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['GI']))); |
| | | component |
| | | .find('select_GI2') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['GI']))); |
| | | component |
| | | .find('select_GI3') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['GI']))); |
| | | |
| | | component.find("select_GS1").set("v.options", JSON.parse(JSON.stringify(opts["GS"]))); |
| | | component.find("select_GS2").set("v.options", JSON.parse(JSON.stringify(opts["GS"]))); |
| | | component.find("select_GS3").set("v.options", JSON.parse(JSON.stringify(opts["GS"]))); |
| | | component |
| | | .find('select_GS1') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['GS']))); |
| | | component |
| | | .find('select_GS2') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['GS']))); |
| | | component |
| | | .find('select_GS3') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['GS']))); |
| | | |
| | | component.find("select_GYN1").set("v.options", JSON.parse(JSON.stringify(opts["GYN"]))); |
| | | component.find("select_GYN2").set("v.options", JSON.parse(JSON.stringify(opts["GYN"]))); |
| | | component.find("select_GYN3").set("v.options", JSON.parse(JSON.stringify(opts["GYN"]))); |
| | | component |
| | | .find('select_GYN1') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['GYN']))); |
| | | component |
| | | .find('select_GYN2') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['GYN']))); |
| | | component |
| | | .find('select_GYN3') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['GYN']))); |
| | | |
| | | component.find("select_URO1").set("v.options", JSON.parse(JSON.stringify(opts["URO"]))); |
| | | component.find("select_URO2").set("v.options", JSON.parse(JSON.stringify(opts["URO"]))); |
| | | component.find("select_URO3").set("v.options", JSON.parse(JSON.stringify(opts["URO"]))); |
| | | component |
| | | .find('select_URO1') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['URO']))); |
| | | component |
| | | .find('select_URO2') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['URO']))); |
| | | component |
| | | .find('select_URO3') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['URO']))); |
| | | |
| | | component.find("select_ENT1").set("v.options", JSON.parse(JSON.stringify(opts["ENT"]))); |
| | | component.find("select_ENT2").set("v.options", JSON.parse(JSON.stringify(opts["ENT"]))); |
| | | component.find("select_ENT3").set("v.options", JSON.parse(JSON.stringify(opts["ENT"]))); |
| | | component |
| | | .find('select_ENT1') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['ENT']))); |
| | | component |
| | | .find('select_ENT2') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['ENT']))); |
| | | component |
| | | .find('select_ENT3') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['ENT']))); |
| | | |
| | | component.find("select_OTH1").set("v.options", JSON.parse(JSON.stringify(opts["OTH"]))); |
| | | component.find("select_OTH2").set("v.options", JSON.parse(JSON.stringify(opts["OTH"]))); |
| | | component.find("select_OTH3").set("v.options", JSON.parse(JSON.stringify(opts["OTH"]))); |
| | | component |
| | | .find('select_OTH1') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['OTH']))); |
| | | component |
| | | .find('select_OTH2') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['OTH']))); |
| | | component |
| | | .find('select_OTH3') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['OTH']))); |
| | | |
| | | component.find("select_ET1").set("v.options", JSON.parse(JSON.stringify(opts["ET"]))); |
| | | component.find("select_ET2").set("v.options", JSON.parse(JSON.stringify(opts["ET"]))); |
| | | component.find("select_ET3").set("v.options", JSON.parse(JSON.stringify(opts["ET"]))); |
| | | component |
| | | .find('select_ET1') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['ET']))); |
| | | component |
| | | .find('select_ET2') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['ET']))); |
| | | component |
| | | .find('select_ET3') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['ET']))); |
| | | |
| | | component.find("select_BF1").set("v.options", JSON.parse(JSON.stringify(opts["BF"]))); |
| | | component.find("select_BF2").set("v.options", JSON.parse(JSON.stringify(opts["BF"]))); |
| | | component.find("select_BF3").set("v.options", JSON.parse(JSON.stringify(opts["BF"]))); |
| | | } else if (state === "ERROR") { |
| | | component |
| | | .find('select_BF1') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['BF']))); |
| | | component |
| | | .find('select_BF2') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['BF']))); |
| | | component |
| | | .find('select_BF3') |
| | | .set('v.options', JSON.parse(JSON.stringify(opts['BF']))); |
| | | } else if (state === 'ERROR') { |
| | | var errors = response.getError(); |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | toastEvent.setParams({ |
| | | "title": "错误", |
| | | "type":"error", |
| | | "message": errors[0].message |
| | | title: '错误', |
| | | type: 'error', |
| | | message: errors[0].message |
| | | }); |
| | | toastEvent.fire(); |
| | | |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | $A.util.toggleClass(modal_window, 'disp_none'); |
| | | $A.util.toggleClass(modal_bg, 'disp_none'); |
| | | |
| | | if ($A.util.hasClass(modal_window, 'disp_none') && !component.get("v.recordId")) { |
| | | if ( |
| | | $A.util.hasClass(modal_window, 'disp_none') && |
| | | !component.get('v.recordId') |
| | | ) { |
| | | $A.get('e.force:refreshView').fire(); |
| | | } |
| | | }, |
| | |
| | | var pcId2 = component.find(o2Id).get('v.value'); |
| | | var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined; |
| | | var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined; |
| | | var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined; |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | var p0bool = |
| | | product_category_id != '' && |
| | | product_category_id != null && |
| | | product_category_id != undefined; |
| | | if ( |
| | | (p1bool && p0bool && product_category_id == pcId1) || |
| | | (p2bool && p0bool && product_category_id == pcId2) |
| | | ) { |
| | | this.warning('不能选择同样的产品区分'); |
| | | component.find(myId).set('v.value',''); |
| | | } |
| | | }, |
| | | |
| | | selectHos : function(component, event, helper) { |
| | | |
| | | var accid = component.get("v.record.Agency_Hospital__c"); |
| | | var action = component.get("c.getDeptAmount"); |
| | | action.setParams({ "hospitalId" : accid }); |
| | | var accid = component.get('v.record.Agency_Hospital__c'); |
| | | var action = component.get('c.getDeptAmount'); |
| | | action.setParams({ hospitalId: accid }); |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | if (state === 'SUCCESS') { |
| | | var amountMap = response.getReturnValue(); |
| | | var GIProduct_Category1 = ''; |
| | | var GIProduct_Category2 = ''; |
| | |
| | | if (amountMap.GI.length > 0) { |
| | | GIProduct_Category1 = amountMap.GI[0].Product_Category__c; |
| | | if (amountMap.GI.length > 1) { |
| | | GIProduct_Category2 = amountMap.GI[1].Product_Category__c; |
| | | GIProduct_Category2 = |
| | | amountMap.GI[1].Product_Category__c; |
| | | } |
| | | if (amountMap.GI.length > 2) { |
| | | GIProduct_Category3 = amountMap.GI[2].Product_Category__c; |
| | | GIProduct_Category3 = |
| | | amountMap.GI[2].Product_Category__c; |
| | | } |
| | | GIAim_Price__c1 = amountMap.GI[0].Aim_Price__c; |
| | | GIAim_Price__c2 = amountMap.GI[1].Aim_Price__c; |
| | | GIAim_Price__c3 = amountMap.GI[2].Aim_Price__c; |
| | | console.warn(GIAim_Price__c1+"-"+GIAim_Price__c2+"-"+GIAim_Price__c3); |
| | | |
| | | console.warn( |
| | | GIAim_Price__c1 + |
| | | '-' + |
| | | GIAim_Price__c2 + |
| | | '-' + |
| | | GIAim_Price__c3 |
| | | ); |
| | | } |
| | | component.find('select_GI1').set('v.value',GIProduct_Category1); |
| | | component.find('select_GI2').set('v.value',GIProduct_Category2); |
| | | component.find('select_GI3').set('v.value',GIProduct_Category3); |
| | | component |
| | | .find('select_GI1') |
| | | .set('v.value', GIProduct_Category1); |
| | | component |
| | | .find('select_GI2') |
| | | .set('v.value', GIProduct_Category2); |
| | | component |
| | | .find('select_GI3') |
| | | .set('v.value', GIProduct_Category3); |
| | | component.find('select_GI4_1').set('v.value',GIAim_Price__c1); |
| | | component.find('select_GI4_2').set('v.value',GIAim_Price__c2); |
| | | component.find('select_GI4_3').set('v.value',GIAim_Price__c3); |
| | | |
| | | |
| | | var ETProduct_Category1 = ''; |
| | | var ETProduct_Category2 = ''; |
| | |
| | | if (amountMap.ET.length > 0) { |
| | | ETProduct_Category1 = amountMap.ET[0].Product_Category__c; |
| | | if (amountMap.ET.length > 1) { |
| | | ETProduct_Category2 = amountMap.ET[1].Product_Category__c; |
| | | ETProduct_Category2 = |
| | | amountMap.ET[1].Product_Category__c; |
| | | } |
| | | if (amountMap.ET.length > 2) { |
| | | ETProduct_Category3 = amountMap.ET[2].Product_Category__c; |
| | | ETProduct_Category3 = |
| | | amountMap.ET[2].Product_Category__c; |
| | | } |
| | | ETAim_Price__c1 = amountMap.ET[0].Aim_Price__c; |
| | | ETAim_Price__c2 = amountMap.ET[1].Aim_Price__c; |
| | | ETAim_Price__c3 = amountMap.ET[2].Aim_Price__c; |
| | | } |
| | | component.find('select_ET1').set('v.value',ETProduct_Category1); |
| | | component.find('select_ET2').set('v.value',ETProduct_Category2); |
| | | component.find('select_ET3').set('v.value',ETProduct_Category3); |
| | | component |
| | | .find('select_ET1') |
| | | .set('v.value', ETProduct_Category1); |
| | | component |
| | | .find('select_ET2') |
| | | .set('v.value', ETProduct_Category2); |
| | | component |
| | | .find('select_ET3') |
| | | .set('v.value', ETProduct_Category3); |
| | | component.find('select_ET4_1').set('v.value',ETAim_Price__c1); |
| | | component.find('select_ET4_2').set('v.value',ETAim_Price__c2); |
| | | component.find('select_ET4_3').set('v.value',ETAim_Price__c3); |
| | | |
| | | |
| | | var BFProduct_Category1 = ''; |
| | | var BFProduct_Category2 = ''; |
| | |
| | | if (amountMap.BF.length > 0) { |
| | | BFProduct_Category1 = amountMap.BF[0].Product_Category__c; |
| | | if (amountMap.BF.length > 1) { |
| | | BFProduct_Category2 = amountMap.BF[1].Product_Category__c; |
| | | BFProduct_Category2 = |
| | | amountMap.BF[1].Product_Category__c; |
| | | } |
| | | if (amountMap.BF.length > 2) { |
| | | BFProduct_Category3 = amountMap.BF[2].Product_Category__c; |
| | | BFProduct_Category3 = |
| | | amountMap.BF[2].Product_Category__c; |
| | | } |
| | | BFAim_Price__c1 = amountMap.BF[0].Aim_Price__c; |
| | | BFAim_Price__c2 = amountMap.BF[1].Aim_Price__c; |
| | | BFAim_Price__c3 = amountMap.BF[2].Aim_Price__c; |
| | | } |
| | | component.find('select_BF1').set('v.value',BFProduct_Category1); |
| | | component.find('select_BF2').set('v.value',BFProduct_Category2); |
| | | component.find('select_BF3').set('v.value',BFProduct_Category3); |
| | | component |
| | | .find('select_BF1') |
| | | .set('v.value', BFProduct_Category1); |
| | | component |
| | | .find('select_BF2') |
| | | .set('v.value', BFProduct_Category2); |
| | | component |
| | | .find('select_BF3') |
| | | .set('v.value', BFProduct_Category3); |
| | | component.find('select_BF4_1').set('v.value',BFAim_Price__c1); |
| | | component.find('select_BF4_2').set('v.value',BFAim_Price__c2); |
| | | component.find('select_BF4_3').set('v.value',BFAim_Price__c3); |
| | | |
| | | |
| | | var OTHProduct_Category1 = ''; |
| | | var OTHProduct_Category2 = ''; |
| | |
| | | var OTHAim_Price__c2 = ''; |
| | | var OTHAim_Price__c3 = ''; |
| | | if (amountMap.OTH.length > 0) { |
| | | |
| | | OTHProduct_Category1 = amountMap.OTH[0].Product_Category__c; |
| | | if (amountMap.OTH.length > 1) { |
| | | OTHProduct_Category2 = amountMap.OTH[1].Product_Category__c; |
| | | OTHProduct_Category2 = |
| | | amountMap.OTH[1].Product_Category__c; |
| | | } |
| | | if (amountMap.OTH.length > 2) { |
| | | OTHProduct_Category3 = amountMap.OTH[2].Product_Category__c; |
| | | OTHProduct_Category3 = |
| | | amountMap.OTH[2].Product_Category__c; |
| | | } |
| | | OTHAim_Price__c1 = amountMap.OTH[0].Aim_Price__c; |
| | | OTHAim_Price__c2 = amountMap.OTH[1].Aim_Price__c; |
| | | OTHAim_Price__c3 = amountMap.OTH[2].Aim_Price__c; |
| | | } |
| | | component.find('select_OTH1').set('v.value',OTHProduct_Category1); |
| | | component.find('select_OTH2').set('v.value',OTHProduct_Category2); |
| | | component.find('select_OTH3').set('v.value',OTHProduct_Category3); |
| | | component.find('select_OTH4_1').set('v.value',OTHAim_Price__c1); |
| | | component.find('select_OTH4_2').set('v.value',OTHAim_Price__c2); |
| | | component.find('select_OTH4_3').set('v.value',OTHAim_Price__c3); |
| | | component |
| | | .find('select_OTH1') |
| | | .set('v.value', OTHProduct_Category1); |
| | | component |
| | | .find('select_OTH2') |
| | | .set('v.value', OTHProduct_Category2); |
| | | component |
| | | .find('select_OTH3') |
| | | .set('v.value', OTHProduct_Category3); |
| | | component |
| | | .find('select_OTH4_1') |
| | | .set('v.value', OTHAim_Price__c1); |
| | | component |
| | | .find('select_OTH4_2') |
| | | .set('v.value', OTHAim_Price__c2); |
| | | component |
| | | .find('select_OTH4_3') |
| | | .set('v.value', OTHAim_Price__c3); |
| | | |
| | | var GSProduct_Category1 = ''; |
| | | var GSProduct_Category2 = ''; |
| | |
| | | if (amountMap.GS.length > 0) { |
| | | GSProduct_Category1 = amountMap.GS[0].Product_Category__c; |
| | | if (amountMap.GS.length > 1) { |
| | | GSProduct_Category2 = amountMap.GS[1].Product_Category__c; |
| | | GSProduct_Category2 = |
| | | amountMap.GS[1].Product_Category__c; |
| | | } |
| | | if (amountMap.GS.length > 2) { |
| | | GSProduct_Category3 = amountMap.GS[2].Product_Category__c; |
| | | GSProduct_Category3 = |
| | | amountMap.GS[2].Product_Category__c; |
| | | } |
| | | GSPAim_Price__c1 = amountMap.GS[0].Aim_Price__c; |
| | | GSPAim_Price__c2 = amountMap.GS[1].Aim_Price__c; |
| | | GSPAim_Price__c3= amountMap.GS[2].Aim_Price__c; |
| | | } |
| | | component.find('select_GS1').set('v.value',GSProduct_Category1); |
| | | component.find('select_GS2').set('v.value',GSProduct_Category2); |
| | | component.find('select_GS3').set('v.value',GSProduct_Category3); |
| | | component |
| | | .find('select_GS1') |
| | | .set('v.value', GSProduct_Category1); |
| | | component |
| | | .find('select_GS2') |
| | | .set('v.value', GSProduct_Category2); |
| | | component |
| | | .find('select_GS3') |
| | | .set('v.value', GSProduct_Category3); |
| | | component.find('select_GS4_1').set('v.value',GSPAim_Price__c1); |
| | | component.find('select_GS4_2').set('v.value',GSPAim_Price__c2); |
| | | component.find('select_GS4_3').set('v.value',GSPAim_Price__c3); |
| | |
| | | var UROAim_Price__c2 = ''; |
| | | var UROAim_Price__c3 = ''; |
| | | if (amountMap.URO.length > 0) { |
| | | |
| | | UROProduct_Category1 = amountMap.URO[0].Product_Category__c; |
| | | if (amountMap.URO.length > 1) { |
| | | UROProduct_Category2 = amountMap.URO[1].Product_Category__c; |
| | | UROProduct_Category2 = |
| | | amountMap.URO[1].Product_Category__c; |
| | | } |
| | | if (amountMap.URO.length > 2) { |
| | | UROProduct_Category3 = amountMap.URO[2].Product_Category__c; |
| | | UROProduct_Category3 = |
| | | amountMap.URO[2].Product_Category__c; |
| | | } |
| | | UROAim_Price__c1 = amountMap.URO[0].Aim_Price__c; |
| | | UROAim_Price__c2 = amountMap.URO[1].Aim_Price__c; |
| | | UROAim_Price__c3 = amountMap.URO[2].Aim_Price__c; |
| | | } |
| | | component.find('select_URO1').set('v.value',UROProduct_Category1); |
| | | component.find('select_URO2').set('v.value',UROProduct_Category2); |
| | | component.find('select_URO3').set('v.value',UROProduct_Category3); |
| | | component.find('select_URO4_1').set('v.value',UROAim_Price__c1); |
| | | component.find('select_URO4_2').set('v.value',UROAim_Price__c2); |
| | | component.find('select_URO4_3').set('v.value',UROAim_Price__c3); |
| | | |
| | | component |
| | | .find('select_URO1') |
| | | .set('v.value', UROProduct_Category1); |
| | | component |
| | | .find('select_URO2') |
| | | .set('v.value', UROProduct_Category2); |
| | | component |
| | | .find('select_URO3') |
| | | .set('v.value', UROProduct_Category3); |
| | | component |
| | | .find('select_URO4_1') |
| | | .set('v.value', UROAim_Price__c1); |
| | | component |
| | | .find('select_URO4_2') |
| | | .set('v.value', UROAim_Price__c2); |
| | | component |
| | | .find('select_URO4_3') |
| | | .set('v.value', UROAim_Price__c3); |
| | | |
| | | var GYNProduct_Category1 = ''; |
| | | var GYNProduct_Category2 = ''; |
| | |
| | | var GYNAim_Price__c2 = ''; |
| | | var GYNAim_Price__c3 = ''; |
| | | if (amountMap.GYN.length > 0) { |
| | | |
| | | GYNProduct_Category1 = amountMap.GYN[0].Product_Category__c; |
| | | if (amountMap.GYN.length > 1) { |
| | | GYNProduct_Category2 = amountMap.GYN[1].Product_Category__c; |
| | | GYNProduct_Category2 = |
| | | amountMap.GYN[1].Product_Category__c; |
| | | } |
| | | if (amountMap.GYN.length > 2) { |
| | | GYNProduct_Category3 = amountMap.GYN[2].Product_Category__c; |
| | | GYNProduct_Category3 = |
| | | amountMap.GYN[2].Product_Category__c; |
| | | } |
| | | GYNAim_Price__c1= amountMap.GYN[0].Aim_Price__c; |
| | | GYNAim_Price__c2 = amountMap.GYN[1].Aim_Price__c; |
| | | GYNAim_Price__c3 = amountMap.GYN[2].Aim_Price__c; |
| | | } |
| | | component.find('select_GYN1').set('v.value',GYNProduct_Category1); |
| | | component.find('select_GYN2').set('v.value',GYNProduct_Category2); |
| | | component.find('select_GYN3').set('v.value',GYNProduct_Category3); |
| | | component.find('select_GYN4_1').set('v.value',GYNAim_Price__c1); |
| | | component.find('select_GYN4_2').set('v.value',GYNAim_Price__c2); |
| | | component.find('select_GYN4_3').set('v.value',GYNAim_Price__c3); |
| | | |
| | | component |
| | | .find('select_GYN1') |
| | | .set('v.value', GYNProduct_Category1); |
| | | component |
| | | .find('select_GYN2') |
| | | .set('v.value', GYNProduct_Category2); |
| | | component |
| | | .find('select_GYN3') |
| | | .set('v.value', GYNProduct_Category3); |
| | | component |
| | | .find('select_GYN4_1') |
| | | .set('v.value', GYNAim_Price__c1); |
| | | component |
| | | .find('select_GYN4_2') |
| | | .set('v.value', GYNAim_Price__c2); |
| | | component |
| | | .find('select_GYN4_3') |
| | | .set('v.value', GYNAim_Price__c3); |
| | | |
| | | var ENTProduct_Category1 = ''; |
| | | var ENTProduct_Category2 = ''; |
| | |
| | | var ENTAim_Price__c2 = ''; |
| | | var ENTAim_Price__c3 = ''; |
| | | if (amountMap.ENT.length > 0) { |
| | | |
| | | ENTProduct_Category1 = amountMap.ENT[0].Product_Category__c; |
| | | if (amountMap.ENT.length > 1) { |
| | | ENTProduct_Category2 = amountMap.ENT[1].Product_Category__c; |
| | | ENTProduct_Category2 = |
| | | amountMap.ENT[1].Product_Category__c; |
| | | } |
| | | if (amountMap.ENT.length > 2) { |
| | | ENTProduct_Category3 = amountMap.ENT[2].Product_Category__c; |
| | | ENTProduct_Category3 = |
| | | amountMap.ENT[2].Product_Category__c; |
| | | } |
| | | ENTAim_Price__c1 = amountMap.ENT[0].Aim_Price__c; |
| | | ENTAim_Price__c2 = amountMap.ENT[1].Aim_Price__c; |
| | | ENTAim_Price__c3 = amountMap.ENT[2].Aim_Price__c; |
| | | } |
| | | component.find('select_ENT1').set('v.value',ENTProduct_Category1); |
| | | component.find('select_ENT2').set('v.value',ENTProduct_Category2); |
| | | component.find('select_ENT3').set('v.value',ENTProduct_Category3); |
| | | component.find('select_ENT4_1').set('v.value',ENTAim_Price__c1); |
| | | component.find('select_ENT4_2').set('v.value',ENTAim_Price__c2); |
| | | component.find('select_ENT4_3').set('v.value',ENTAim_Price__c3); |
| | | |
| | | component |
| | | .find('select_ENT1') |
| | | .set('v.value', ENTProduct_Category1); |
| | | component |
| | | .find('select_ENT2') |
| | | .set('v.value', ENTProduct_Category2); |
| | | component |
| | | .find('select_ENT3') |
| | | .set('v.value', ENTProduct_Category3); |
| | | component |
| | | .find('select_ENT4_1') |
| | | .set('v.value', ENTAim_Price__c1); |
| | | component |
| | | .find('select_ENT4_2') |
| | | .set('v.value', ENTAim_Price__c2); |
| | | component |
| | | .find('select_ENT4_3') |
| | | .set('v.value', ENTAim_Price__c3); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | console.log(JSON.stringify(component.find('input-hos').get("v.body")[0].get('v'))); |
| | | console.log( |
| | | JSON.stringify( |
| | | component.find('input-hos').get('v.body')[0].get('v') |
| | | ) |
| | | ); |
| | | }, |
| | | |
| | | getOCMTerm : function() { |
| | |
| | | }, |
| | | |
| | | createTarget : function(component, event, helper) { |
| | | var action = component.get("c.createSFTarget"); |
| | | var action = component.get('c.createSFTarget'); |
| | | // alert(component.get("v.GIAmount")); |
| | | |
| | | |
| | | |
| | | var p1_1 = component.find('select_GI4_1').get('v.value') ; |
| | | var p1_2 = component.find('select_GI4_2').get('v.value') ; |
| | | var p1_3 = component.find('select_GI4_3').get('v.value') ; |
| | | |
| | | if (p1_1 == undefined || p1_1 == "") { |
| | | if (p1_1 == undefined || p1_1 == '') { |
| | | p1_1 = 0; |
| | | } |
| | | if (p1_2 == undefined || p1_2 == "") { |
| | | if (p1_2 == undefined || p1_2 == '') { |
| | | p1_2 = 0; |
| | | } |
| | | if (p1_3 == undefined || p1_3 == "") { |
| | | if (p1_3 == undefined || p1_3 == '') { |
| | | p1_3 = 0; |
| | | } |
| | | console.warn(p1_1+"-"+p1_2+"-"+p1_3); |
| | | console.warn(p1_1 + '-' + p1_2 + '-' + p1_3); |
| | | |
| | | var p2_1 = component.find('select_ET4_1').get('v.value') ; |
| | | var p2_2 = component.find('select_ET4_2').get('v.value') ; |
| | | var p2_3 = component.find('select_ET4_3').get('v.value') ; |
| | | if (p2_1 == undefined || p2_1 == "") { |
| | | if (p2_1 == undefined || p2_1 == '') { |
| | | p2_1 = 0; |
| | | } |
| | | if (p2_2 == undefined || p2_2 == "") { |
| | | if (p2_2 == undefined || p2_2 == '') { |
| | | p2_2 = 0; |
| | | } |
| | | if (p2_3 == undefined || p2_3 == "") { |
| | | if (p2_3 == undefined || p2_3 == '') { |
| | | p2_3 = 0; |
| | | } |
| | | |
| | | |
| | | var p3_1 = component.find('select_BF4_1').get('v.value') ; |
| | | var p3_2 = component.find('select_BF4_2').get('v.value') ; |
| | | var p3_3 = component.find('select_BF4_3').get('v.value') ; |
| | | if (p3_1 == undefined || p3_1 == "") { |
| | | if (p3_1 == undefined || p3_1 == '') { |
| | | p3_1 = 0; |
| | | } |
| | | if (p3_2 == undefined || p3_2 == "") { |
| | | if (p3_2 == undefined || p3_2 == '') { |
| | | p3_2 = 0; |
| | | } |
| | | if (p3_3 == undefined || p3_3 == "") { |
| | | if (p3_3 == undefined || p3_3 == '') { |
| | | p3_3 = 0; |
| | | } |
| | | |
| | | |
| | | |
| | | var p4_1 = component.find('select_OTH4_1').get('v.value') ; |
| | | var p4_2 = component.find('select_OTH4_2').get('v.value') ; |
| | | var p4_3 = component.find('select_OTH4_3').get('v.value') ; |
| | | if (p4_1 == undefined || p4_1 == "") { |
| | | if (p4_1 == undefined || p4_1 == '') { |
| | | p4_1 = 0; |
| | | } |
| | | if (p4_2 == undefined || p4_2 == "") { |
| | | if (p4_2 == undefined || p4_2 == '') { |
| | | p4_2 = 0; |
| | | } |
| | | if (p4_3 == undefined || p4_3 == "") { |
| | | if (p4_3 == undefined || p4_3 == '') { |
| | | p4_3 = 0; |
| | | } |
| | | |
| | | |
| | | |
| | | var p5_1 = component.find('select_GS4_1').get('v.value') ; |
| | | var p5_2 = component.find('select_GS4_2').get('v.value') ; |
| | | var p5_3 = component.find('select_GS4_3').get('v.value') ; |
| | | if (p5_1 == undefined || p5_1 == "") { |
| | | if (p5_1 == undefined || p5_1 == '') { |
| | | p5_1 = 0; |
| | | } |
| | | if (p5_2 == undefined || p5_2 == "") { |
| | | if (p5_2 == undefined || p5_2 == '') { |
| | | p5_2 = 0; |
| | | } |
| | | if (p5_3 == undefined || p5_3 == "") { |
| | | if (p5_3 == undefined || p5_3 == '') { |
| | | p5_3 = 0; |
| | | } |
| | | |
| | | |
| | | |
| | | var p6_1 = component.find('select_URO4_1').get('v.value') ; |
| | | var p6_2 = component.find('select_URO4_2').get('v.value') ; |
| | | var p6_3 = component.find('select_URO4_3').get('v.value') ; |
| | | if (p6_1 == undefined || p6_1 == "") { |
| | | if (p6_1 == undefined || p6_1 == '') { |
| | | p6_1 = 0; |
| | | } |
| | | if (p6_2 == undefined || p6_2 == "") { |
| | | if (p6_2 == undefined || p6_2 == '') { |
| | | p6_2 = 0; |
| | | } |
| | | if (p6_3 == undefined || p6_3 == "") { |
| | | if (p6_3 == undefined || p6_3 == '') { |
| | | p6_3 = 0; |
| | | } |
| | | |
| | | var p7_1 = component.find('select_GYN4_1').get('v.value') ; |
| | | var p7_2 = component.find('select_GYN4_2').get('v.value') ; |
| | | var p7_3 = component.find('select_GYN4_3').get('v.value') ; |
| | | if (p7_1 == undefined || p7_1 == "") { |
| | | if (p7_1 == undefined || p7_1 == '') { |
| | | p7_1 = 0; |
| | | } |
| | | if (p7_2 == undefined || p7_2 == "") { |
| | | if (p7_2 == undefined || p7_2 == '') { |
| | | p7_2 = 0; |
| | | } |
| | | if (p7_3 == undefined || p7_3 == "") { |
| | | if (p7_3 == undefined || p7_3 == '') { |
| | | p7_3 = 0; |
| | | } |
| | | |
| | | |
| | | |
| | | var p8_1 = component.find('select_ENT4_1').get('v.value') ; |
| | | var p8_2 = component.find('select_ENT4_2').get('v.value') ; |
| | | var p8_3 = component.find('select_ENT4_3').get('v.value') ; |
| | | if (p8_1 == undefined || p8_1 == "") { |
| | | if (p8_1 == undefined || p8_1 == '') { |
| | | p8_1 = 0; |
| | | } |
| | | if (p8_2 == undefined || p8_2 == "") { |
| | | if (p8_2 == undefined || p8_2 == '') { |
| | | p8_2 = 0; |
| | | } |
| | | if (p8_3 == undefined || p8_3 == "") { |
| | | if (p8_3 == undefined || p8_3 == '') { |
| | | p8_3 = 0; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | action.setParams({ |
| | | "hospitalId" : component.get("v.record.Agency_Hospital__c"), |
| | | "GIProduct" : [component.find('select_GI1').get('v.value'),component.find('select_GI2').get('v.value'),component.find('select_GI3').get('v.value'),p1_1,p1_2,p1_3], |
| | | "ETProduct" : [component.find('select_ET1').get('v.value'),component.find('select_ET2').get('v.value'),component.find('select_ET3').get('v.value'),p2_1, p2_2,p2_3 ], |
| | | "BFProduct" : [component.find('select_BF1').get('v.value'),component.find('select_BF2').get('v.value'),component.find('select_BF3').get('v.value'),p3_1 ,p3_2 ,p3_3 ], |
| | | "OTHProduct" : [component.find('select_OTH1').get('v.value'),component.find('select_OTH2').get('v.value'),component.find('select_OTH3').get('v.value'),p4_1,p4_2 ,p4_3], |
| | | "GSProduct" : [component.find('select_GS1').get('v.value'),component.find('select_GS2').get('v.value'),component.find('select_GS3').get('v.value'),p5_1,p5_2,p5_3], |
| | | "UROProduct" : [component.find('select_URO1').get('v.value'),component.find('select_URO2').get('v.value'),component.find('select_URO3').get('v.value'),p6_1,p6_2 ,p6_2 ], |
| | | "GYNProduct" : [component.find('select_GYN1').get('v.value'),component.find('select_GYN2').get('v.value'),component.find('select_GYN3').get('v.value'),p7_1,p7_2 ,p7_3 ], |
| | | "ENTProduct" : [component.find('select_ENT1').get('v.value'),component.find('select_ENT2').get('v.value'),component.find('select_ENT3').get('v.value'),p8_1 ,p8_2 ,p8_3], |
| | | "OCMTerm" : component.get("v.OCMTerm") |
| | | hospitalId: component.get('v.record.Agency_Hospital__c'), |
| | | GIProduct: [ |
| | | component.find('select_GI1').get('v.value'), |
| | | component.find('select_GI2').get('v.value'), |
| | | component.find('select_GI3').get('v.value'), |
| | | p1_1, |
| | | p1_2, |
| | | p1_3 |
| | | ], |
| | | ETProduct: [ |
| | | component.find('select_ET1').get('v.value'), |
| | | component.find('select_ET2').get('v.value'), |
| | | component.find('select_ET3').get('v.value'), |
| | | p2_1, |
| | | p2_2, |
| | | p2_3 |
| | | ], |
| | | BFProduct: [ |
| | | component.find('select_BF1').get('v.value'), |
| | | component.find('select_BF2').get('v.value'), |
| | | component.find('select_BF3').get('v.value'), |
| | | p3_1, |
| | | p3_2, |
| | | p3_3 |
| | | ], |
| | | OTHProduct: [ |
| | | component.find('select_OTH1').get('v.value'), |
| | | component.find('select_OTH2').get('v.value'), |
| | | component.find('select_OTH3').get('v.value'), |
| | | p4_1, |
| | | p4_2, |
| | | p4_3 |
| | | ], |
| | | GSProduct: [ |
| | | component.find('select_GS1').get('v.value'), |
| | | component.find('select_GS2').get('v.value'), |
| | | component.find('select_GS3').get('v.value'), |
| | | p5_1, |
| | | p5_2, |
| | | p5_3 |
| | | ], |
| | | UROProduct: [ |
| | | component.find('select_URO1').get('v.value'), |
| | | component.find('select_URO2').get('v.value'), |
| | | component.find('select_URO3').get('v.value'), |
| | | p6_1, |
| | | p6_2, |
| | | p6_2 |
| | | ], |
| | | GYNProduct: [ |
| | | component.find('select_GYN1').get('v.value'), |
| | | component.find('select_GYN2').get('v.value'), |
| | | component.find('select_GYN3').get('v.value'), |
| | | p7_1, |
| | | p7_2, |
| | | p7_3 |
| | | ], |
| | | ENTProduct: [ |
| | | component.find('select_ENT1').get('v.value'), |
| | | component.find('select_ENT2').get('v.value'), |
| | | component.find('select_ENT3').get('v.value'), |
| | | p8_1, |
| | | p8_2, |
| | | p8_3 |
| | | ], |
| | | OCMTerm: component.get('v.OCMTerm') |
| | | }); |
| | | action.setCallback(this, function(response) { |
| | | console.warn(response); |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | if (state === 'SUCCESS') { |
| | | var modal_window = component.find('modal_window'); |
| | | var modal_bg = component.find('modal_bg'); |
| | | $A.util.toggleClass(modal_window, 'disp_none'); |
| | | $A.util.toggleClass(modal_bg, 'disp_none'); |
| | | |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | toastEvent.setParams({ |
| | | "title": "成功", |
| | | "type":"success", |
| | | "message": "保存成功" |
| | | title: '成功', |
| | | type: 'success', |
| | | message: '保存成功' |
| | | }); |
| | | toastEvent.fire(); |
| | | |
| | | $A.get('e.force:refreshView').fire(); |
| | | } else if (state === "INCOMPLETE") { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | } else if (state === 'INCOMPLETE') { |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | toastEvent.setParams({ |
| | | "title": "未完成!", |
| | | "type":"error", |
| | | "message": "未完成" |
| | | title: '未完成!', |
| | | type: 'error', |
| | | message: '未完成' |
| | | }); |
| | | toastEvent.fire(); |
| | | } else if (state === "ERROR") { |
| | | } else if (state === 'ERROR') { |
| | | var errors = response.getError(); |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | toastEvent.setParams({ |
| | | "title": "错误", |
| | | "type":"error", |
| | | "message": errors[0].message |
| | | title: '错误', |
| | | type: 'error', |
| | | message: errors[0].message |
| | | }); |
| | | toastEvent.fire(); |
| | | |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | warning : function(message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | toastEvent.setParams({ |
| | | "title": "警告!", |
| | | "message": message, |
| | | "type":"warning", |
| | | "duration" : "10000" |
| | | title: '警告!', |
| | | message: message, |
| | | type: 'warning', |
| | | duration: '10000' |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | |
| | | error : function(message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | toastEvent.setParams({ |
| | | "title": "错误!", |
| | | "message": message, |
| | | "type":"error", |
| | | "duration" : "10000" |
| | | title: '错误!', |
| | | message: message, |
| | | type: 'error', |
| | | duration: '10000' |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | |
| | | }) |
| | | } |
| | | }); |
| | |
| | | <!-- |
| | | * @Author: Thhto 997058689@qq.com |
| | | * @Date: 2022-07-08 10:47:25 |
| | | * @LastEditors: Thhto 997058689@qq.com |
| | | * @LastEditTime: 2023-02-03 15:25:46 |
| | | * @FilePath: \ceshihuanj\force-app\main\default\aura\DealerPersonnelInformationImport\DealerPersonnelInformationImport.cmp |
| | | * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE |
| | | --> |
| | | <aura:component controller="DealerPersonnelController" |
| | | <aura:component |
| | | controller="DealerPersonnelController" |
| | | implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" |
| | | access="global"> |
| | | access="global" |
| | | > |
| | | <!-- 批量添加周报 start--> |
| | | <!-- <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> --> |
| | | <aura:attribute name="reports_date" type="List" /> |
| | | <aura:attribute name="errorMessage" type="String" /> |
| | | <aura:attribute name="TableContent" type="String" description=" Show the Result class" /> |
| | | <aura:attribute name="TableContent2" type="String" description=" Show the Result class" /> |
| | | <aura:attribute name="TargetFileName" type="String" description="Name of the file" /> |
| | | <aura:attribute |
| | | name="TableContent" |
| | | type="String" |
| | | description=" Show the Result class" |
| | | /> |
| | | <aura:attribute |
| | | name="TableContent2" |
| | | type="String" |
| | | description=" Show the Result class" |
| | | /> |
| | | <aura:attribute |
| | | name="TargetFileName" |
| | | type="String" |
| | | description="Name of the file" |
| | | /> |
| | | <aura:attribute name="tableheaders" type="Object[]" /> |
| | | <aura:attribute name="fileContentData" type="String" /> |
| | | <aura:attribute name="filename" type="String" /> |
| | |
| | | <aura:attribute name="IsEventDefault" type="Boolean" default="true" /> |
| | | <aura:attribute name="login" type="Boolean" default="false" /> |
| | | <aura:attribute name="successMessage" type="String" /> |
| | | <!-- start DTT-zhj 增加错误信息table 2023-05-16--> |
| | | <aura:attribute name="errorData" type="Object" /> |
| | | <aura:attribute name="errorColumns" type="List" /> |
| | | <!-- show Error information --> |
| | | <aura:attribute name="showErrorInfo" type="Boolean" default="false" /> |
| | | <!-- end DTT-zhj 增加错误信息table 2023-05-16--> |
| | | |
| | | <!-- 批量添加周报 end--> |
| | | <aura:renderIf isTrue="{!v.login}"> |
| | | <div class="slds-spinner_container height100vh"> |
| | | <div class="slds-spinner--brand slds-spinner slds-spinner--medium" role="alert"> |
| | | <div |
| | | class="slds-spinner--brand slds-spinner slds-spinner--medium" |
| | | role="alert" |
| | | > |
| | | <span class="slds-assistive-text">Loading</span> |
| | | <div class="slds-spinner__dot-a"></div> |
| | | <div class="slds-spinner__dot-b"></div> |
| | |
| | | </div> |
| | | </aura:renderIf> |
| | | <!-- 批量添加周报 start--> |
| | | <div class="slds-modal slds-fade-in-open slds-hide" aura:id="errorDiv" style="z-index: 10001"> |
| | | <!-- <ui:inputText aura:id="articleURL" /> --> |
| | | <div class="demo-only" style="height: 8rem;"> |
| | | <div |
| | | class="slds-modal slds-fade-in-open slds-hide" |
| | | aura:id="errorDiv" |
| | | style="z-index: 10001" |
| | | > |
| | | <ui:inputText aura:id="articleURL" /> |
| | | <div class="demo-only" style="height: 8rem"> |
| | | <div class="slds-notify_container slds-is-relative"> |
| | | <div class="slds-notify slds-notify_toast slds-theme_error" role="status"> |
| | | <div |
| | | class="slds-notify slds-notify_toast slds-theme_error" |
| | | role="status" |
| | | > |
| | | <div class=" slds-m-left_xx-large"> |
| | | <div |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"> |
| | | <lightning:icon alternativeText="error" iconName="utility:error" size="small" |
| | | class="buttonColor slds-m-right_small" /> |
| | | <!-- DB202301262139 SFDC经销商人员导入功能改进 start --> |
| | | <!-- <h2 class="slds-text-heading_small ">{!v.errorMessage}</h2> --> |
| | | <pre class="slds-text-heading_small ">{!v.errorMessage}</pre> |
| | | <!-- DB202301262139 SFDC经销商人员导入功能改进 end --> |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large" |
| | | > |
| | | <lightning:icon |
| | | alternativeText="error" |
| | | iconName="utility:error" |
| | | size="small" |
| | | class="buttonColor slds-m-right_small" |
| | | /> |
| | | <h2 class="slds-text-heading_small"> |
| | | {!v.errorMessage} |
| | | </h2> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv01"> |
| | | <!-- <ui:inputText aura:id="articleURL" /> --> |
| | | <div class="demo-only" style="height: 8rem;"> |
| | | <ui:inputText aura:id="articleURL" /> |
| | | <div class="demo-only" style="height: 8rem"> |
| | | <div class="slds-notify_container slds-is-relative"> |
| | | <div class="slds-notify slds-notify_toast slds-theme_success" role="alert"> |
| | | <div |
| | | class="slds-notify slds-notify_toast slds-theme_success" |
| | | role="alert" |
| | | > |
| | | <div class=" slds-m-left_xx-large"> |
| | | <div |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"> |
| | | <lightning:icon alternativeText="Success" iconName="utility:success" size="small" |
| | | class="buttonColor slds-m-right_small" /> |
| | | <h2 class="slds-text-heading_small ">{!v.successMessage}</h2> |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large" |
| | | > |
| | | <lightning:icon |
| | | alternativeText="Success" |
| | | iconName="utility:success" |
| | | size="small" |
| | | class="buttonColor slds-m-right_small" |
| | | /> |
| | | <h2 class="slds-text-heading_small"> |
| | | {!v.successMessage} |
| | | </h2> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div > |
| | | <div class="slds-modal__header "> |
| | | <h4 id="headerTarget" class="slds-float--left"></h4> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium">客户人员批量导入</h2> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium"> |
| | | 客户人员批量导入 |
| | | </h2> |
| | | </div> |
| | | <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium "> |
| | | <div |
| | | class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium" |
| | | > |
| | | <aura:if isTrue="{!v.showMain}"> |
| | | <div> |
| | | <center> |
| | | <lightning:input type="file" class="file" uara:id="file" onchange="{!c.CreateRecord}" /> |
| | | <lightning:input |
| | | type="file" |
| | | class="file" |
| | | uara:id="file" |
| | | onchange="{!c.CreateRecord}" |
| | | /> |
| | | </center> |
| | | </div> |
| | | <aura:set attribute="else"> |
| | | <ui:outputRichText class="uiOutputRichText slds-m--around-large" value="{!v.TableContent}" /> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button aura:id="save_con" label="保存" variant="brand" onclick="{!c.processFileContent}" disabled="false" /> |
| | | <lightning:button label="取消" variant="brand" onclick="{!c.cancel}" /> |
| | | <ui:outputRichText |
| | | class="uiOutputRichText slds-m--around-large" |
| | | value="{!v.TableContent}" |
| | | /> |
| | | <div |
| | | class="slds-p-around--large slds-align--absolute-center" |
| | | > |
| | | <lightning:button |
| | | label="保存" |
| | | variant="brand" |
| | | onclick="{!c.processFileContent}" |
| | | /> |
| | | <lightning:button |
| | | label="取消" |
| | | variant="brand" |
| | | onclick="{!c.cancel}" |
| | | /> |
| | | </div> |
| | | |
| | | <aura:if isTrue="{!v.showErrorInfo}"> |
| | | <div |
| | | class="slds-p-around--large slds-align--absolute-center" |
| | | > |
| | | <lightning:button |
| | | label="导出错误信息" |
| | | variant="brand" |
| | | onclick="{!c.exportErrorInfo}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-p-around--large slds-align--absolute-center" |
| | | > |
| | | <div style="height: 300px; overflow-x: scroll"> |
| | | <lightning:datatable |
| | | keyField="id" |
| | | data="{! v.errorData }" |
| | | columns="{! v.errorColumns }" |
| | | hideCheckboxColumn="true" |
| | | minColumnWidth="120" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </aura:if> |
| | | </aura:set> |
| | | </aura:if> |
| | | </div> |
| | | |
| | | </div> |
| | | <!-- 批量添加周报 end--> |
| | | |
| | | </aura:component> |
| | |
| | | ({ |
| | | CreateRecord : function(component, event, helper){ |
| | | var files = event.getSource().get("v.files"); |
| | | var files = event.getSource().get('v.files'); |
| | | helper.readFile(component,helper,files[0]); |
| | | }, |
| | | processFileContent : function(component,event,helper){ |
| | | component.set('v.showErrorInfo', false); |
| | | helper.saveRecords(component,event,helper); |
| | | }, |
| | | cancel : function(component,event,helper){ |
| | | component.set("v.showMain",true); |
| | | component.set('v.showMain', true); |
| | | }, |
| | | exportErrorInfo: function (component, event, helper) { |
| | | console.log('enter exportErrorInfo'); |
| | | helper.exportErrorInfoHelper(component); |
| | | } |
| | | }) |
| | | }); |
| | |
| | | ({ |
| | | readFile: function (component, helper, file) { |
| | | debugger |
| | | if (!file) return; |
| | | if (!file.name.match(/\.(csv||CSV)$/)) { |
| | | return alert('only support csv files'); |
| | |
| | | break; // noop |
| | | default: |
| | | alert('An error occurred reading this file.'); |
| | | }; |
| | | } |
| | | }; |
| | | reader.onabort = function (e) { |
| | | alert('File read cancelled'); |
| | | }; |
| | | reader.onloadstart = function (e) { |
| | | var output = '<ui type=\"disc\"><li><strong>' + file.name + '</strong> (' + file.type + ')- ' + file.size + 'bytes, last modified: ' + file.lastModifiedDate.toLocaleDateString() + '</li></ui>'; |
| | | component.set("v.filename", file.name); |
| | | component.set("v.TargetFileName", output); |
| | | var output = |
| | | '<ui type="disc"><li><strong>' + |
| | | file.name + |
| | | '</strong> (' + |
| | | file.type + |
| | | ')- ' + |
| | | file.size + |
| | | 'bytes, last modified: ' + |
| | | file.lastModifiedDate.toLocaleDateString() + |
| | | '</li></ui>'; |
| | | component.set('v.filename', file.name); |
| | | component.set('v.TargetFileName', output); |
| | | }; |
| | | reader.onload = function (e) { |
| | | var data = e.target.result; |
| | | // data.replace(/\n/,"") |
| | | var allTextLines11 = data.split(/\r/); |
| | | var s = allTextLines11.toString(); |
| | | component.set("v.fileContentData", s); |
| | | console.log("file dataqqq" + JSON.stringify(s)); |
| | | component.set('v.fileContentData', s); |
| | | console.log('file dataqqq' + JSON.stringify(s)); |
| | | var allTextLines = data.split(/\r\n|\n/); |
| | | var dataRows = allTextLines.length - 1; |
| | | var headers = allTextLines[0].split(','); |
| | | var numOfRows = component.get("v.NumOfRecords"); |
| | | if (dataRows > numOfRows + 1 || dataRows == 1 || dataRows == 0) { |
| | | alert("File Rows between 1 to " + numOfRows + " ."); |
| | | component.set("v.showMain", true); |
| | | } |
| | | else { |
| | | var numOfRows = component.get('v.NumOfRecords'); |
| | | if ( |
| | | dataRows > numOfRows + 1 || |
| | | dataRows == 1 || |
| | | dataRows == 0 |
| | | ) { |
| | | alert('File Rows between 1 to ' + numOfRows + ' .'); |
| | | component.set('v.showMain', true); |
| | | } else { |
| | | var lines = []; |
| | | var filecontentdata; |
| | | var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">"; |
| | | content += "<thead><tr class=\"slds-text-title--caps\">"; |
| | | content += '<th scope=\"col"\>' + '行号' + '</th>'; |
| | | var content = |
| | | '<table class="table slds-table slds-table--bordered slds-table--cell-buffer">'; |
| | | content += '<thead><tr class="slds-text-title--caps">'; |
| | | content += '<th scope="col">' + '行号' + '</th>'; |
| | | for (i = 0; i < headers.length; i++) { |
| | | content += '<th scope=\"col"\>' + headers[i] + '</th>'; |
| | | content += '<th scope="col">' + headers[i] + '</th>'; |
| | | } |
| | | content += "</tr></thead>"; |
| | | content += '</tr></thead>'; |
| | | for (var i = 1; i < allTextLines.length; i++) { |
| | | filecontentdata = allTextLines[i].split(','); |
| | | if (filecontentdata[0] != '') { |
| | | content += "<tr>"; |
| | | content += "<td>" + i + "</td>"; |
| | | content += '<tr>'; |
| | | content += '<td>' + i + '</td>'; |
| | | for (var j = 0; j < filecontentdata.length; j++) { |
| | | content += '<td>' + filecontentdata[j] + '</td>'; |
| | | content += |
| | | '<td>' + filecontentdata[j] + '</td>'; |
| | | } |
| | | content += "</tr>"; |
| | | content += '</tr>'; |
| | | } |
| | | } |
| | | content += "</table>"; |
| | | content += '</table>'; |
| | | console.log(content); |
| | | component.set("v.TableContent", content); |
| | | component.set("v.showMain", false); |
| | | component.set('v.TableContent', content); |
| | | component.set('v.showMain', false); |
| | | } |
| | | } |
| | | }; |
| | | reader.readAsText(file, 'gb2312'); |
| | | |
| | | } |
| | | var reader = new FileReader(); |
| | | reader.onloadend = function () { |
| | | }; |
| | | reader.onloadend = function () {}; |
| | | reader.readAsDataURL(file); |
| | | }, |
| | | saveRecords: function (component, event, helper) { |
| | | debugger |
| | | component.set('v.login', true); |
| | | var action = component.get("c.processData"); |
| | | var action = component.get('c.processData'); |
| | | var fieldsList = ['Name', 'Phone', 'AccountNumber']; //Please write your code dynamic fields |
| | | action.setParams({ |
| | | fileData: component.get("v.fileContentData"), |
| | | fileData: component.get('v.fileContentData'), |
| | | sobjectName: 'Account', //Any object |
| | | fields: fieldsList |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | if (state === 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | var res1 = ''; |
| | | debugger; |
| | | if (res != 'success') { |
| | | var ress = res.split('='); |
| | | console.log(ress); |
| | | let errorDatas = []; |
| | | let errorDataRow = []; |
| | | debugger; |
| | | for (var i = 0; i < ress.length; i++) { |
| | | res1 += ress[i].substr(7) + '\n'; |
| | | if (ress[i] != '') { |
| | | let errorData = {}; |
| | | let index = errorDataRow.indexOf( |
| | | ress[i].substr(7).substring(1, 2) |
| | | ); |
| | | if (index == -1) { |
| | | errorData.errorRow = ress[i] |
| | | .substr(7) |
| | | .substring(1, 2); |
| | | errorDataRow.push(errorData.errorRow); |
| | | errorData.errorInfo = ress[i] |
| | | .substr(7) |
| | | .substring(6); |
| | | errorDatas.push(errorData); |
| | | } else { |
| | | errorDatas[index].errorInfo += |
| | | '; ' + ress[i].substr(7).substring(6); |
| | | } |
| | | console.log("==" + res1); |
| | | } |
| | | } |
| | | var fileContentData = component |
| | | .get('v.fileContentData') |
| | | .split('\n'); |
| | | let errorColumns = [ |
| | | { |
| | | label: '错误行', |
| | | fieldName: 'errorRow', |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | initialWidth: 50 |
| | | }, |
| | | { |
| | | label: '错误信息', |
| | | fieldName: 'errorInfo', |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | initialWidth: 300, |
| | | wrapText: true |
| | | } |
| | | ]; |
| | | for ( |
| | | var i = 0; |
| | | i < fileContentData[0].split(',').length - 1; |
| | | i++ |
| | | ) { |
| | | errorColumns.push({ |
| | | label: fileContentData[0].split(',')[i], |
| | | fieldName: 'field' + i, |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | wrapText: true |
| | | }); |
| | | } |
| | | |
| | | for (var i = 0; i < errorDatas.length; i++) { |
| | | let data = fileContentData[errorDatas[i].errorRow]; |
| | | console.log('data = ' + JSON.stringify(data)); |
| | | for (var j = 0; j < data.split(',').length; j++) { |
| | | let label = 'field' + j; |
| | | errorDatas[i][label] = data.split(',')[j]; |
| | | } |
| | | } |
| | | console.log('errorDatas = ' + JSON.stringify(errorDatas)); |
| | | |
| | | component.set('v.errorColumns', errorColumns); |
| | | component.set('v.errorData', errorDatas); |
| | | component.set('v.showErrorInfo', true); |
| | | |
| | | console.log('==' + res1); |
| | | // this.error( "请修改后重新上传"); |
| | | component.set('v.errorMessage', res1 + "请修改后重新上传"); |
| | | component.set('v.errorMessage', res1 + '请修改后重新上传'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | component.find('save_con').set('v.disabled', true); |
| | | } else { |
| | | // this.success('导入成功'); |
| | | component.set('v.successMessage', '导入成功'); |
| | | this.showSuccessToast01(component); |
| | | component.set("v.showMain", true); |
| | | component.set('v.login', false); |
| | | component.find('save_con').set('v.disabled', false); |
| | | } |
| | | } |
| | | else if (state === "INCOMPLETE") { |
| | | component.set('v.showMain', true); |
| | | component.set('v.login', false); |
| | | } |
| | | else if (state === "ERROR") { |
| | | } else if (state === 'INCOMPLETE') { |
| | | component.set('v.login', false); |
| | | } else if (state === 'ERROR') { |
| | | var errors = response.getError(); |
| | | if (errors) { |
| | | if (errors[0] && errors[0].message) { |
| | | console.log("Error message: " + |
| | | errors[0].message); |
| | | console.log('Error message: ' + errors[0].message); |
| | | let errorDatas = [ |
| | | { |
| | | errorRow: '1', |
| | | errorInfo: errors[0].message |
| | | } |
| | | ]; |
| | | let errorColumns = [ |
| | | { |
| | | label: '错误行', |
| | | fieldName: 'errorRow', |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | initialWidth: 50 |
| | | }, |
| | | { |
| | | label: '错误信息', |
| | | fieldName: 'errorInfo', |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | initialWidth: 300, |
| | | wrapText: true |
| | | } |
| | | ]; |
| | | component.set('v.errorData', errorDatas); |
| | | component.set('v.errorColumns', errorColumns); |
| | | component.set('v.showErrorInfo', true); |
| | | component.set('v.login', false); |
| | | } |
| | | } else { |
| | | console.log("Unknown error"); |
| | | console.log('Unknown error'); |
| | | component.set('v.login', false); |
| | | } |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | |
| | | }, |
| | | //弹出 成功提示 |
| | | showSuccessToast01: function (component) { |
| | | $A.util.removeClass(component.find('successDiv01'), 'slds-hide'); |
| | | window.setTimeout($A.getCallback(function () { |
| | | window.setTimeout( |
| | | $A.getCallback(function () { |
| | | $A.util.addClass(component.find('successDiv01'), 'slds-hide'); |
| | | }), |
| | | 3000 |
| | |
| | | //弹出 错误提示 |
| | | showErrorToast: function (component) { |
| | | $A.util.removeClass(component.find('errorDiv'), 'slds-hide'); |
| | | window.setTimeout($A.getCallback(function () { |
| | | window.setTimeout( |
| | | $A.getCallback(function () { |
| | | $A.util.addClass(component.find('errorDiv'), 'slds-hide'); |
| | | }), |
| | | 7000 |
| | | 4000 |
| | | ); |
| | | }, |
| | | success : function(message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | toastEvent.setParams({ |
| | | "title" : "成功!", |
| | | "message" : message, |
| | | "duration" : "5000" |
| | | title: '成功!', |
| | | message: message, |
| | | duration: '5000' |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | |
| | | warning : function(message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | toastEvent.setParams({ |
| | | "title": "警告!", |
| | | "message": message, |
| | | "duration" : "10000" |
| | | title: '警告!', |
| | | message: message, |
| | | duration: '10000' |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | |
| | | error : function(message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | toastEvent.setParams({ |
| | | "title": "错误!", |
| | | "message": message, |
| | | "duration" : "sticky" |
| | | title: '错误!', |
| | | message: message, |
| | | duration: 'sticky' |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | }) |
| | | //zhj 导出错误信息 2023-05-16 start |
| | | exportErrorInfoHelper: function (component) { |
| | | var errorData = component.get('v.errorData'); |
| | | var errorColumns = component.get('v.errorColumns'); |
| | | |
| | | var datas = []; |
| | | let errorColumnsArray = []; |
| | | for (var i in errorColumns) { |
| | | errorColumnsArray.push(errorColumns[i].label); |
| | | } |
| | | datas.push(errorColumnsArray); |
| | | //datas.push(errorColumns); |
| | | |
| | | for (var i in errorData) { |
| | | let data = []; |
| | | data.push(errorData[i].errorRow); |
| | | data.push(errorData[i].errorInfo); |
| | | for (var j = 0; j < Object.keys(errorData[i]).length - 2; j++) { |
| | | data.push(errorData[i]['field' + j]); |
| | | } |
| | | datas.push(data); |
| | | } |
| | | |
| | | console.log('datas = ' + JSON.stringify(datas)); |
| | | var csv = this.convertToCSV(component, datas); |
| | | console.log('csv = ' + JSON.stringify(csv)); |
| | | this.downloadCSV(component, csv); |
| | | }, |
| | | |
| | | convertToCSV: function (component, data) { |
| | | console.log('enter convertToCSV'); |
| | | console.log('data = ' + data); |
| | | var csv = ''; |
| | | for (var i = 0; i < data.length; i++) { |
| | | var row = data[i]; |
| | | console.log('row = ' + JSON.stringify(row)); |
| | | for (var j = 0; j < row.length; j++) { |
| | | var val = ''; |
| | | val = row[j] === null ? '' : row[j].toString(); |
| | | console.log('val = ' + val); |
| | | if ( |
| | | val.indexOf(',') !== -1 || |
| | | val.indexOf('"') !== -1 || |
| | | val.indexOf('\n') !== -1 |
| | | ) { |
| | | //val = '"' + val.replace(/"/g,'""') + '"'; |
| | | } |
| | | if (j > 0) { |
| | | csv += ','; |
| | | } |
| | | csv += val; |
| | | } |
| | | csv += '\n'; |
| | | } |
| | | return csv; |
| | | }, |
| | | |
| | | downloadCSV: function (component, csv) { |
| | | var link = document.createElement('a'); |
| | | // 设置字符集和文件头 |
| | | let bom = '\uFEFF'; |
| | | link.href = |
| | | 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv); |
| | | link.download = 'data.csv'; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | } |
| | | //zhj 导出错误信息 2023-05-16 end |
| | | }); |
| New file |
| | |
| | | <aura:documentation> |
| | | <aura:description>Documentation</aura:description> |
| | | <aura:example name="ExampleName" ref="exampleComponentName" label="Label"> |
| | | Example Description |
| | | </aura:example> |
| | | </aura:documentation> |
| New file |
| | |
| | | <aura:component |
| | | implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickActionWithoutHeader,lightning:actionOverride" |
| | | 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:lexNewAndEditContactPIPL |
| | | onclose="{!c.closeModal}" |
| | | onrefresh="{!c.refreshView}" |
| | | recordId="{!v.recordId}" |
| | | /> |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>57.0</apiVersion> |
| | | <description>A Lightning Component Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | <design:component > |
| | | |
| | | </design:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no" ?> |
| | | <svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| | | <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> |
| | | <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E" /> |
| | | <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF" /> |
| | | </g> |
| | | </svg> |
| New file |
| | |
| | | ({ |
| | | closeModal: function (cmp, event, helper) { |
| | | $A.get('e.force:closeQuickAction').fire(); |
| | | }, |
| | | |
| | | refreshView: function (cmp, event, helper) { |
| | | $A.get('e.force:refreshView').fire(); |
| | | } |
| | | }); |
| New file |
| | |
| | | ({ |
| | | helperMethod: function () {} |
| | | }); |
| New file |
| | |
| | | ({ |
| | | // Your renderer method overrides go here |
| | | }); |
| New file |
| | |
| | | <aura:documentation> |
| | | <aura:description>Documentation</aura:description> |
| | | <aura:example name="ExampleName" ref="exampleComponentName" label="Label"> |
| | | Example Description |
| | | </aura:example> |
| | | </aura:documentation> |
| New file |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 07-08-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <aura:component |
| | | implements="force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:actionOverride,lightning:isUrlAddressable" |
| | | access="global" |
| | | controller="NewAgencyOpportunityController" |
| | | > |
| | | <aura:attribute name="recordId" type="Id" default="" /> |
| | | <aura:attribute name="recordTypeId" type="Id" default="" /> |
| | | <aura:attribute name="ac_name" type="string" /> |
| | | <aura:attribute name="title" type="string" /> |
| | | <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> |
| | | <aura:attribute name="layout" type="LayoutDescriberHelper.LayoutWrapper" /> |
| | | <aura:attribute name="record_data" type="Map" /> |
| | | <aura:attribute name="section_names" type="List" /> |
| | | <aura:attribute name="showSpinner" type="Boolean" default="False" /> |
| | | <aura:attribute name="showSpinner2" type="Boolean" default="False" /> |
| | | <aura:attribute name="staticResource" type="Map" /> |
| | | <aura:attribute name="pi_fields_map" type="Map" /> |
| | | <aura:attribute name="isClone" type="Boolean" default="False" /> |
| | | <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" /> |
| | | <ltng:require scripts="{! $Resource.jquery183minjs }" /> |
| | | <aura:attribute name="isModalOpen" type="boolean" default="false" /> |
| | | <aura:attribute name="searchKeyWord" type="string" default="" /> |
| | | <aura:attribute name="contactAWSIds" type="List" /> |
| | | <aura:attribute name="login" type="Boolean" default="false" /> |
| | | <aura:attribute name="show" type="Boolean" default="false" /> |
| | | <aura:attribute |
| | | name="showNewAgencyContact" |
| | | type="Boolean" |
| | | default="false" |
| | | /> |
| | | <aura:handler |
| | | name="NewAgencyContactEvent" |
| | | event="c:NewAgencyContactEvent" |
| | | action="{!c.closeAgencyContact}" |
| | | /> |
| | | |
| | | <div class="{! v.container_class}"> |
| | | <!-- header --> |
| | | <header class="slds-modal__header"> |
| | | <h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate"> |
| | | {!v.title} |
| | | </h2> |
| | | </header> |
| | | |
| | | <div class="slds-modal__content slds-p-around_medium"> |
| | | <aura:if isTrue="{!v.showSpinner}"> |
| | | <lightning:spinner alternativeText="Loading" size="medium" /> |
| | | </aura:if> |
| | | <lightning:recordEditForm objectApiName="Agency_Opportunity__c"> |
| | | <lightning:accordion |
| | | activeSectionName="{! v.section_names }" |
| | | allowMultipleSectionsOpen="true" |
| | | class="greyyyy" |
| | | > |
| | | <aura:iteration items="{!v.layout}" var="section"> |
| | | <aura:if isTrue="{! section.editHeading }"> |
| | | <lightning:accordionSection |
| | | name="{! section.label }" |
| | | label="经销商询价信息" |
| | | > |
| | | <aura:iteration |
| | | items="{! section.layoutColumns}" |
| | | var="col" |
| | | > |
| | | <aura:iteration |
| | | items="{! col.layoutItems}" |
| | | var="field" |
| | | > |
| | | <aura:if |
| | | isTrue="{!and(field.behavior != 'Readonly', field.field != 'Agency_Contact__c')}" |
| | | > |
| | | <lightning:inputField |
| | | required="{! field.behavior == 'Required' }" |
| | | aura:id="field" |
| | | fieldName="{! field.field}" |
| | | value="{! field.value}" |
| | | /> |
| | | </aura:if> |
| | | <aura:if |
| | | isTrue="{!field.field == 'Agency_Contact__c' }" |
| | | > |
| | | <lightning:layout> |
| | | <lightning:layoutItem size="12"> |
| | | <lightning:input |
| | | required="{! field.behavior == 'Required' }" |
| | | label="客户人员" |
| | | value="{! field.value}" |
| | | variant="label-inline" |
| | | style=" |
| | | margin-left: 0cm; |
| | | display: none; |
| | | " |
| | | onclick="{! c.openModel }" |
| | | /> |
| | | <lightning:input |
| | | required="{! field.behavior == 'Required' }" |
| | | label="客户人员" |
| | | value="{! v.ac_name}" |
| | | variant="label-inline" |
| | | style="margin-left: 0cm" |
| | | onclick="{! c.openModel }" |
| | | /> |
| | | </lightning:layoutItem> |
| | | </lightning:layout> |
| | | </aura:if> |
| | | </aura:iteration> |
| | | </aura:iteration> |
| | | </lightning:accordionSection> |
| | | </aura:if> |
| | | </aura:iteration> |
| | | </lightning:accordion> |
| | | </lightning:recordEditForm> |
| | | |
| | | <div style="text-align: center; margin: 5px"> |
| | | <lightning:button |
| | | class="slds-button slds-button_neutral" |
| | | label="取消" |
| | | onclick="{! c.cancelClick }" |
| | | /> |
| | | <lightning:button |
| | | class="slds-button slds-button_brand" |
| | | variant="brand" |
| | | label="保存" |
| | | onclick="{! c.saveClick }" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <aura:if isTrue="{!v.isModalOpen}"> |
| | | <!-- Modal/Popup Box starts here--> |
| | | <section |
| | | role="dialog" |
| | | tabindex="-1" |
| | | aria-labelledby="modal-heading-01" |
| | | aria-modal="true" |
| | | aria-describedby="modal-content-id-1" |
| | | class="slds-modal slds-fade-in-open" |
| | | > |
| | | <aura:renderIf isTrue="{!v.login}"> |
| | | <div class="slds-spinner_container height100vh"> |
| | | <div |
| | | class="slds-spinner--brand slds-spinner slds-spinner--medium" |
| | | role="alert" |
| | | > |
| | | <span id="aa" class="slds-assistive-text" |
| | | >Loading</span |
| | | > |
| | | <div class="slds-spinner__dot-a"></div> |
| | | <div class="slds-spinner__dot-b"></div> |
| | | </div> |
| | | </div> |
| | | </aura:renderIf> |
| | | |
| | | <div class="slds-modal__container"> |
| | | <!-- Modal/Popup Box Header Starts here--> |
| | | <header class="slds-modal__header"> |
| | | <lightning:buttonIcon |
| | | iconName="utility:close" |
| | | onclick="{! c.closeModel }" |
| | | alternativeText="close" |
| | | variant="bare-inverse" |
| | | class="slds-modal__close" |
| | | /> |
| | | <h2 |
| | | id="modal-heading-01" |
| | | class="slds-text-heading_medium slds-hyphenate" |
| | | > |
| | | 搜索客户人员 |
| | | </h2> |
| | | </header> |
| | | |
| | | <!--Modal Body Start here--> |
| | | <div |
| | | class="slds-modal__content slds-p-around_medium modal-body" |
| | | id="modal-content-id-1" |
| | | > |
| | | <lightning:layout> |
| | | <lightning:layoutItem size="7"> |
| | | <ui:inputText |
| | | label="请输入客户姓名" |
| | | class="field" |
| | | value="{!v.searchKeyWord}" |
| | | /> |
| | | </lightning:layoutItem> |
| | | <lightning:layoutItem size="2" class="searchButton"> |
| | | <ui:button |
| | | aura:id="button" |
| | | buttonTitle="Click to see agency contact" |
| | | class="button" |
| | | label="搜索" |
| | | press="{!c.searchAgencyContact}" |
| | | disabled="false" |
| | | /> |
| | | </lightning:layoutItem> |
| | | <lightning:layoutItem size="3" class="searchButton"> |
| | | <ui:button |
| | | aura:id="newAgencyContact" |
| | | buttonTitle="Click to see agency contact" |
| | | class="newAgencyContact" |
| | | label="新建.客户人员" |
| | | disabled="false" |
| | | press="{!c.showNewAgency}" |
| | | /> |
| | | </lightning:layoutItem> |
| | | </lightning:layout> |
| | | <div id="QueryResult" style="margin-top: 20px"></div> |
| | | </div> |
| | | |
| | | <aura:if isTrue="{!v.showNewAgencyContact}"> |
| | | <section |
| | | role="dialog" |
| | | tabindex="-1" |
| | | aria-modal="true" |
| | | aria-labelledby="modal-heading-01" |
| | | class="slds-modal slds-fade-in-open" |
| | | aura:id="NewAgencyContact" |
| | | id="NewAgencyContact" |
| | | > |
| | | <c:NewAgencyContact2 /> |
| | | </section> |
| | | </aura:if> |
| | | </div> |
| | | </section> |
| | | <div class="slds-backdrop slds-backdrop_open"></div> |
| | | </aura:if> |
| | | </div> |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <description>A Lightning Component Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | .THIS { |
| | | } |
| | | |
| | | .THIS .name { |
| | | margin-right: 0.5cm; |
| | | } |
| | | |
| | | .THIS .wh { |
| | | width: 670px; |
| | | height: 500px; |
| | | } |
| | | |
| | | .THIS .slds-modal__container { |
| | | max-width: 70rem !important; |
| | | width: 90% !important; |
| | | } |
| | | |
| | | .THIS .modal-body { |
| | | height: 500px !important; |
| | | max-height: 500px !important; |
| | | } |
| | | |
| | | .THIS table { |
| | | border-collapse: collapse; |
| | | border-spacing: 0; |
| | | width: 98%; |
| | | margin-left: 5px; |
| | | /* border: 1px solid #000000; */ |
| | | text-align: center; |
| | | } |
| | | .THIS tr { |
| | | /* border: 1px solid #000000; */ |
| | | text-align: center; |
| | | } |
| | | .THIS td { |
| | | /* border: 1px solid #000000; */ |
| | | text-align: center; |
| | | } |
| | | |
| | | .THIS th { |
| | | /* border: 1px solid #000000; */ |
| | | text-align: center; |
| | | } |
| | | |
| | | .THIS.backgroundInverse { |
| | | position: relative; |
| | | background-color: #16325c; |
| | | height: 80px; |
| | | } |
| | | |
| | | .THIS.exampleHolder { |
| | | position: relative; |
| | | display: inline-block; |
| | | margin-left: 15px; |
| | | width: 55px; |
| | | vertical-align: middle; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | .THIS .searchButton { |
| | | margin-top: 20px; |
| | | margin-left: 20px; |
| | | } |
| | | |
| | | .THIS .slds-spinner_container { |
| | | position: revert; |
| | | } |
| New file |
| | |
| | | ({ |
| | | doInit: function (component, event, helper) { |
| | | let rid = component.get('v.recordId'); |
| | | let pid = null; |
| | | if (!rid) { |
| | | pid = window.location.href.replace('https://', '').split('/')[4]; |
| | | } |
| | | |
| | | let record_type_id = ''; |
| | | let pageref = component.get('v.pageReference'); |
| | | if (!record_type_id && pageref) { |
| | | record_type_id = pageref.state.recordTypeId |
| | | ? pageref.state.recordTypeId |
| | | : ''; |
| | | } |
| | | |
| | | let isClone = component.get('v.isClone'); |
| | | if (!rid || isClone) { |
| | | component.set('v.title', $A.get('$Label.c.New') + '经销商询价'); |
| | | component.set('v.recordTypeId', record_type_id); |
| | | } else { |
| | | component.set('v.title', $A.get('$Label.c.Edit') + '经销商询价'); |
| | | } |
| | | console.log('rid: ' + rid); |
| | | console.log('pid: ' + pid); |
| | | console.log('record_type_id: ' + record_type_id); |
| | | component.set('v.showSpinner', true); |
| | | helper.CallBackAction( |
| | | component, |
| | | 'Init', |
| | | { |
| | | rid: rid, |
| | | pid: pid, |
| | | //rid : component.get('v.recordId'), |
| | | record_type_id: record_type_id |
| | | }, |
| | | function (data) { |
| | | console.log('data: ' + data); |
| | | var rv = data.getReturnValue(); |
| | | console.log('rv:' + rv); |
| | | console.log('rv.Data:' + rv.Data); |
| | | console.log('rv.IsSuccess:' + rv.IsSuccess); |
| | | if (data.getState() == 'SUCCESS') { |
| | | if (rv.IsSuccess) { |
| | | debugger; |
| | | let layout = JSON.parse(rv.Data.layout); |
| | | debugger; |
| | | let fields = rv.Data.fields; |
| | | debugger; |
| | | let staticResource = JSON.parse(rv.Data.staticResource); |
| | | debugger; |
| | | let section_names = layout.map((s) => s.label); |
| | | debugger; |
| | | // let awsData = rv.Data.awsDataIds; |
| | | // section_names = layout.map(s=>s.label); |
| | | component.set('v.section_names', section_names); |
| | | component.set('v.layout', layout); |
| | | component.set('v.fields', fields); |
| | | component.set('v.staticResource', staticResource); |
| | | debugger; |
| | | let m = {}; |
| | | for (let f of staticResource.PIDetails) { |
| | | m[f.SF_Field_API_Name__c] = f; |
| | | } |
| | | component.set('v.pi_fields_map', m); |
| | | if (rv.Data && rv.Data.data) { |
| | | debugger; |
| | | console.log('rv.Data.data = ' + rv.Data.data); |
| | | for (let s of layout) { |
| | | for (let c of s.layoutColumns) { |
| | | for (let item of c.layoutItems) { |
| | | if ( |
| | | rv.Data.data.hasOwnProperty( |
| | | item.field |
| | | ) |
| | | ) { |
| | | item.value = |
| | | rv.Data.data[item.field]; |
| | | } |
| | | if (fields.hasOwnProperty(item.field)) { |
| | | item.fi = fields[item.field]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // component.set('v.layout',layout); |
| | | component.set('v.record_data', rv.Data.data); |
| | | if (rv.Data.data.Agency_Contact__r) { |
| | | if ( |
| | | rv.Data.data.Agency_Contact__r |
| | | .AWS_Data_Id__c |
| | | ) { |
| | | helper.AwsGet( |
| | | staticResource.queryUrl, |
| | | { |
| | | dataId: rv.Data.data |
| | | .Agency_Contact__r |
| | | .AWS_Data_Id__c |
| | | }, |
| | | function (data) { |
| | | console.log('data = ' + data); |
| | | if (data.object) { |
| | | component.set( |
| | | 'v.ac_name', |
| | | data.object.name |
| | | ); |
| | | } |
| | | }, |
| | | staticResource.token |
| | | ); |
| | | } |
| | | } |
| | | // }, staticResource.token); |
| | | } else { |
| | | debugger; |
| | | console.log('rv.Data.data = ' + rv.Data.data); |
| | | console.log('layout = ' + layout); |
| | | for (let s of layout) { |
| | | for (let c of s.layoutColumns) { |
| | | for (let item of c.layoutItems) { |
| | | if ( |
| | | rv.Data && |
| | | fields.hasOwnProperty(item.field) && |
| | | fields[item.field].References && |
| | | fields[item.field].References.map( |
| | | (m) => m.value |
| | | ).indexOf(rv.Data.pidType) > -1 |
| | | ) { |
| | | item.value = pid; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | debugger; |
| | | // component.set('v.layout',layout); |
| | | } |
| | | // component.set('v.fields',fields); |
| | | // component.set('v.staticResource',staticResource); |
| | | component.set('v.showSpinner', false); |
| | | } else { |
| | | component.set('v.showSpinner', false); |
| | | helper.ShowToast({ |
| | | message: rv.Message, |
| | | type: 'error' |
| | | }); |
| | | } |
| | | } else { |
| | | component.set('v.showSpinner', false); |
| | | helper.ShowToast({ |
| | | message: 'Init error', |
| | | type: 'error' |
| | | }); |
| | | } |
| | | } |
| | | ); |
| | | }, |
| | | saveClick: function (component, event, helper) { |
| | | let staticResource = component.get('v.staticResource'); |
| | | let record_id = component.get('v.recordId'); |
| | | let record_type_id = component.get('v.recordTypeId'); |
| | | |
| | | let isClone = component.get('v.isClone'); |
| | | let url = staticResource.newUrl; |
| | | let payloadPi = {}; |
| | | if (record_id && !isClone) { |
| | | url = staticResource.updateUrl; |
| | | payloadPi['dataId'] = component.get('v.record_data').AWS_Data_Id__c; |
| | | } |
| | | let layout = component.get('v.layout'); |
| | | |
| | | let pi_fields_map = component.get('v.pi_fields_map'); |
| | | |
| | | for (let s of layout) { |
| | | for (let c of s.layoutColumns) { |
| | | for (let item of c.layoutItems) { |
| | | if (pi_fields_map.hasOwnProperty(item.field)) { |
| | | payloadPi[pi_fields_map[item.field].AWS_Field_API__c] = |
| | | item.value; |
| | | } |
| | | |
| | | if (item.behavior == 'Required' && !item.value) { |
| | | let fs = component.find('field'); |
| | | for (let fi in fs) { |
| | | let f = fs[fi]; |
| | | if (!f.get('v.value')) { |
| | | f.reset(); |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | component.set('v.showSpinner', true); |
| | | debugger; |
| | | let data = {}; |
| | | if (record_id && !isClone) { |
| | | data.Id = record_id; |
| | | } |
| | | for (let s of layout) { |
| | | for (let c of s.layoutColumns) { |
| | | for (let item of c.layoutItems) { |
| | | if (item.field && item.behavior != 'Readonly') { |
| | | data[item.field] = item.value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | let x = 1; |
| | | helper.CallBackAction( |
| | | component, |
| | | 'Save', |
| | | { |
| | | data: data, |
| | | transId: '1', |
| | | recordTypeId: record_type_id |
| | | }, |
| | | function (data) { |
| | | component.set('v.showSpinner', false); |
| | | if (data.getState() == 'SUCCESS') { |
| | | var rv = data.getReturnValue(); |
| | | console.log(rv); |
| | | var sfId = null; |
| | | if (rv.IsSuccess) { |
| | | sfId = rv.Data.recordId; |
| | | helper.ShowToast({ |
| | | message: '成功', |
| | | type: 'success' |
| | | }); |
| | | if (record_id) { |
| | | $A.get('e.force:closeQuickAction').fire(); |
| | | $A.get('e.force:refreshView').fire(); |
| | | } else { |
| | | var sObjectEvent = $A.get( |
| | | 'e.force:navigateToSObject' |
| | | ); |
| | | sObjectEvent.setParams({ |
| | | recordId: sfId |
| | | }); |
| | | sObjectEvent.fire(); |
| | | } |
| | | } else { |
| | | helper.ShowToast({ |
| | | message: rv.Message, |
| | | type: 'error' |
| | | }); |
| | | } |
| | | } else { |
| | | helper.ShowToast({ |
| | | message: 'Init error', |
| | | type: 'error' |
| | | }); |
| | | } |
| | | } |
| | | ); |
| | | }, |
| | | cancelClick: function (component, event, helper) { |
| | | $A.get('e.force:closeQuickAction').fire(); |
| | | //component.set("v.showNewAgencyContact", false); |
| | | }, |
| | | searchAgencyContact: function (component, event, helper) { |
| | | component.find('button').set('v.disabled', true); |
| | | helper.resetTable(); |
| | | helper.preparePayloadForSearchAgencyContact(component, event, helper); |
| | | }, |
| | | initContactTable: function (component, event, helper) { |
| | | let cols = ['Name', 'AgencyHospital', 'DoctorDivision1', 'Type']; |
| | | let contactInfoList = []; |
| | | let awsDataIds = []; |
| | | let data = component.get('v.result'); |
| | | if (data.object) { |
| | | for (var i = 0; i < data.object.length; i++) { |
| | | if (data.object[i].dataId) { |
| | | let contactInfo = new Object(); |
| | | //需要修改 |
| | | contactInfo.Name = data.object[i].name; |
| | | contactInfo.DoctorDivision1 = |
| | | data.object[i].doctorDivision1; |
| | | contactInfo.AWSDataId = data.object[i].dataId; |
| | | contactInfo.Type = data.object[i].type; |
| | | contactInfo.pi = true; |
| | | awsDataIds.push(contactInfo.AWSDataId); |
| | | contactInfo.sfRecordId = ''; |
| | | contactInfoList.push(contactInfo); |
| | | } |
| | | } |
| | | } |
| | | let AWSIdToSFIdMapValue = {}; |
| | | }, |
| | | openModel: function (component, event, helper) { |
| | | let layout = component.get('v.layout'); |
| | | for (let s of layout) { |
| | | for (let c of s.layoutColumns) { |
| | | for (let item of c.layoutItems) { |
| | | if (item.field == 'Agency_Hospital__c' && !item.value) { |
| | | console.log('item.value = ' + item.value); |
| | | helper.ShowToast({ |
| | | message: '请先选择经销商医院', |
| | | type: 'warning' |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // Set isModalOpen true |
| | | component.set('v.isModalOpen', true); |
| | | component.find('button').set('v.disabled', true); |
| | | helper.preparePayloadForSearchAgencyContact(component, event, helper); |
| | | }, |
| | | |
| | | closeModel: function (component, event, helper) { |
| | | // Set isModalOpen false |
| | | component.set('v.isModalOpen', false); |
| | | }, |
| | | |
| | | saveDetails: function (component, event, helper) { |
| | | //do something |
| | | component.set('v.isModalOpen', false); |
| | | }, |
| | | |
| | | showNewAgency: function (component, event, helper) { |
| | | //do something |
| | | component.set('v.showNewAgencyContact', true); |
| | | }, |
| | | closeAgencyContact: function (component, event, helper) { |
| | | var message = event.getParam('showNewAgencyContact'); |
| | | component.set('v.showNewAgencyContact', message); |
| | | component.find('button').set('v.disabled', true); |
| | | helper.resetTable(); |
| | | helper.preparePayloadForSearchAgencyContact(component, event, helper); |
| | | } |
| | | }); |
| New file |
| | |
| | | ({ |
| | | CallBackAction: function (component, action_name, para, callback) { |
| | | var action = component.get( |
| | | 'c.' + action_name.trimStart().replace('c.', '') |
| | | ); |
| | | if (para) { |
| | | action.setParams(para); |
| | | } |
| | | if (callback) { |
| | | action.setCallback(this, function (data) { |
| | | callback(data); |
| | | }); |
| | | } |
| | | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | ShowToast: function (paras) { |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | toastEvent.setParams(paras); |
| | | toastEvent.fire(); |
| | | }, |
| | | AwsPost: function (postURL, data, callback, token) { |
| | | let payloadForNewPI = ''; |
| | | if (typeof data == 'string') { |
| | | payloadForNewPI = data; |
| | | } else { |
| | | payloadForNewPI = JSON.stringify(data); |
| | | } |
| | | |
| | | AWSService.post( |
| | | postURL, |
| | | payloadForNewPI, |
| | | function (result) { |
| | | //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus); |
| | | if (callback) callback(result); |
| | | }, |
| | | token |
| | | ); |
| | | }, |
| | | AwsGet: function (url, data, callback, token) { |
| | | if (typeof data == 'string') { |
| | | url += data; |
| | | } else { |
| | | let i = 0; |
| | | for (let p in data) { |
| | | url += i++ ? '&' : '?'; |
| | | url += p + '=' + data[p]; |
| | | } |
| | | } |
| | | |
| | | AWSService.get( |
| | | url, |
| | | function (result) { |
| | | //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus); |
| | | if (callback) callback(result); |
| | | }, |
| | | token |
| | | ); |
| | | }, |
| | | refreshTable: function ( |
| | | component, |
| | | event, |
| | | helper, |
| | | cols, |
| | | contactInfoList, |
| | | contactsInfo |
| | | ) { |
| | | let that = this; |
| | | let myTableDiv = document.getElementById('QueryResult'); |
| | | let table = document.createElement('TABLE'); |
| | | table.border = '1'; |
| | | table.id = 'table'; |
| | | table.setAttribute( |
| | | 'class', |
| | | 'slds-table slds-table_cell-buffer slds-table_bordered' |
| | | ); |
| | | let tableBody = document.createElement('TBODY'); |
| | | table.appendChild(tableBody); |
| | | let headerTR = document.createElement('TR'); |
| | | headerTR.setAttribute('class', 'slds-line-height_reset'); |
| | | let colsHeader = ['姓名', '医院', '医生区分(职务)', '分类']; |
| | | tableBody.appendChild(headerTR); |
| | | for (let i = 0; i < colsHeader.length; i++) { |
| | | let td = document.createElement('TH'); |
| | | td.width = '75'; |
| | | td.setAttribute('class', 'slds-truncate slds-border_right'); |
| | | td.appendChild(document.createTextNode(colsHeader[i])); |
| | | headerTR.appendChild(td); |
| | | } |
| | | //3. Init the AWS data |
| | | for (let i = 0; i < contactInfoList.length; i++) { |
| | | let tr = document.createElement('TR'); |
| | | tableBody.appendChild(tr); |
| | | let contactInfoTemp = contactInfoList[i]; |
| | | for (let j = 0; j < cols.length; j++) { |
| | | let td = document.createElement('TD'); |
| | | td.width = '75'; |
| | | if (contactInfoTemp.pi) { |
| | | if ( |
| | | !contactsInfo.hasOwnProperty(contactInfoTemp.AWSDataId) |
| | | ) { |
| | | continue; |
| | | } |
| | | if (j == 0 && contactsInfo[contactInfoTemp.AWSDataId]) { |
| | | td.id = contactsInfo[contactInfoTemp.AWSDataId].Id; |
| | | } |
| | | } else { |
| | | td.id = contactInfoTemp.sfRecordId; |
| | | } |
| | | td.appendChild( |
| | | document.createTextNode( |
| | | contactInfoTemp[cols[j]] != null |
| | | ? contactInfoTemp[cols[j]] |
| | | : '' |
| | | ) |
| | | ); |
| | | if (cols[j] == 'Name') { |
| | | td.addEventListener('click', function (obj) { |
| | | that.redirectToParentPage( |
| | | component, |
| | | event, |
| | | helper, |
| | | obj |
| | | ); |
| | | }); |
| | | } |
| | | tr.appendChild(td); |
| | | } |
| | | } |
| | | myTableDiv.appendChild(table); |
| | | component.find('button').set('v.disabled', false); |
| | | }, |
| | | redirectToParentPage: function (component, event, helper, obj) { |
| | | let agencyContactName = obj.currentTarget.innerText; |
| | | let id = obj.currentTarget.id; |
| | | component.set('v.ac_name', agencyContactName); |
| | | let layout = component.get('v.layout'); |
| | | for (let s of layout) { |
| | | for (let c of s.layoutColumns) { |
| | | for (let item of c.layoutItems) { |
| | | if (item.field == 'Agency_Contact__c') { |
| | | item.value = id; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | component.set('v.isModalOpen', false); |
| | | }, |
| | | resetTable: function () { |
| | | let queryResult = document.getElementById('QueryResult'); |
| | | let table = document.getElementsByTagName('table'); |
| | | debugger; |
| | | console.log('table:' + table); |
| | | debugger; |
| | | if (table.length > 1) { |
| | | for (var i = 1; i < table.length; i++) { |
| | | queryResult.removeChild(table[i]); |
| | | } |
| | | } |
| | | }, |
| | | preparePayloadForSearchAgencyContact: function (component, event, helper) { |
| | | let that = this; |
| | | let agencyHospitalId = ''; |
| | | let accountId = ''; |
| | | let layout = component.get('v.layout'); |
| | | for (let s of layout) { |
| | | for (let c of s.layoutColumns) { |
| | | for (let item of c.layoutItems) { |
| | | if (item.field == 'Agency_Hospital__c') { |
| | | agencyHospitalId = item.value; |
| | | } |
| | | if (item.field == 'Account_Opp__c') { |
| | | accountId = item.value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | var action = component.get('c.getAWSDataIds'); |
| | | action.setParams({ |
| | | agencyHospitalId: agencyHospitalId, |
| | | accountId: accountId |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var rv = response.getReturnValue(); |
| | | if (rv.Data.length == 0) { |
| | | component.find('button').set('v.disabled', false); |
| | | helper.ShowToast({ |
| | | message: '该经销商医院下面没有客户人员', |
| | | type: 'warning' |
| | | }); |
| | | return; |
| | | } |
| | | let searchPayload = new Object(); |
| | | let searchAgencyContactName = component.get('v.searchKeyWord'); |
| | | searchPayload.dataIds = rv.Data; |
| | | searchPayload.name = searchAgencyContactName; |
| | | component.set('v.contactAWSIds', rv.Data); |
| | | let staticResource = component.get('v.staticResource'); |
| | | let url = staticResource.searchUrl; |
| | | let token = staticResource.token; |
| | | this.AwsPost( |
| | | url, |
| | | searchPayload, |
| | | function (data) { |
| | | if (data.success) { |
| | | let cols = [ |
| | | 'Name', |
| | | 'AgencyHospital', |
| | | 'DoctorDivision1', |
| | | 'Type' |
| | | ]; |
| | | let contactInfoList = []; |
| | | let awsDataIds = []; |
| | | if (data.object.length == 0) { |
| | | component |
| | | .find('button') |
| | | .set('v.disabled', false); |
| | | that.ShowToast({ |
| | | message: '没有查询到该客户人员', |
| | | type: 'warning' |
| | | }); |
| | | return; |
| | | } |
| | | for (var i = 0; i < data.object.length; i++) { |
| | | if (data.object[i].dataId) { |
| | | let contactInfo = new Object(); |
| | | //需要修改 |
| | | contactInfo.Name = data.object[i].name; |
| | | contactInfo.AgencyHospital = ''; |
| | | contactInfo.DoctorDivision1 = |
| | | data.object[i].doctorDivision1; |
| | | contactInfo.AWSDataId = |
| | | data.object[i].dataId; |
| | | contactInfo.Type = data.object[i].type; |
| | | contactInfo.pi = true; |
| | | awsDataIds.push(contactInfo.AWSDataId); |
| | | contactInfo.sfRecordId = ''; |
| | | contactInfoList.push(contactInfo); |
| | | } |
| | | } |
| | | //let AWSIdToSFIdMapValue = {}; |
| | | var searchAgencyContacts = component.get( |
| | | 'c.searchAgencyContacts' |
| | | ); |
| | | searchAgencyContacts.setParams({ |
| | | awsAgencyContactIds: JSON.stringify(awsDataIds), |
| | | agencyHospitalId: agencyHospitalId, |
| | | accountId: accountId |
| | | }); |
| | | searchAgencyContacts.setCallback( |
| | | this, |
| | | function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var rv = response.getReturnValue(); |
| | | if (rv.IsSuccess) { |
| | | let contactsInfo = ''; |
| | | if (rv.Data) { |
| | | contactsInfo = JSON.parse( |
| | | rv.Data.replace( |
| | | /("\;)/g, |
| | | '"' |
| | | ) |
| | | ); |
| | | if ( |
| | | Object.keys(contactsInfo) |
| | | .length > 0 |
| | | ) { |
| | | for ( |
| | | let i = 0; |
| | | i < |
| | | contactInfoList.length; |
| | | i++ |
| | | ) { |
| | | let contactFromSF = |
| | | contactsInfo[ |
| | | contactInfoList[ |
| | | i |
| | | ]['AWSDataId'] |
| | | ]; |
| | | if (contactFromSF) { |
| | | contactInfoList[ |
| | | i |
| | | ].sfRecordId = |
| | | contactFromSF[ |
| | | 'Id' |
| | | ]; |
| | | if ( |
| | | contactFromSF[ |
| | | 'Agency_Hospital__r' |
| | | ] |
| | | ) { |
| | | contactInfoList[ |
| | | i |
| | | ].AgencyHospital = |
| | | contactFromSF[ |
| | | 'Agency_Hospital__r' |
| | | ]['Name']; |
| | | } |
| | | if ( |
| | | contactFromSF[ |
| | | 'Department_Class__r' |
| | | ] |
| | | ) { |
| | | contactInfoList[ |
| | | i |
| | | ].AgencyHospital = |
| | | contactFromSF[ |
| | | 'Department_Class__r' |
| | | ]['Parent'][ |
| | | 'Name' |
| | | ]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | that.refreshTable( |
| | | component, |
| | | event, |
| | | helper, |
| | | cols, |
| | | contactInfoList, |
| | | contactsInfo |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | ); |
| | | $A.enqueueAction(searchAgencyContacts); |
| | | } |
| | | }, |
| | | token |
| | | ); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | }); |
| New file |
| | |
| | | ({ |
| | | // Your renderer method overrides go here |
| | | }); |
| | |
| | | <aura:attribute name="doclist" type="List" /> |
| | | <aura:attribute name="docmap" type="Map" /> |
| | | <aura:attribute name="login" type="Boolean" default="false" /> |
| | | <aura:attribute name="loginEdit" type="Boolean" default="false" /> |
| | | <aura:attribute |
| | | name="modal_import_spinner" |
| | | type="Boolean" |
| | | default="false" |
| | | /> |
| | | <aura:attribute name="loadOpp" type="Boolean" default="false" /> |
| | | <aura:attribute name="reportPageData" type="Map" /> |
| | | <aura:attribute name="selectbody" type="String" /> |
| | |
| | | <aura:attribute name="showMain" type="Boolean" default="true" /> |
| | | <aura:attribute name="IsEventDefault" type="Boolean" default="true" /> |
| | | <!-- start DTT-zhj 增加错误信息table 2023-05-16--> |
| | | <!-- Imports --> |
| | | <!-- <aura:import library="lightningcomponentdemo:mockdataFaker" property="mockdataLibrary"/> --> |
| | | <!-- attributes --> |
| | | <aura:attribute name="errorData" type="Object" /> |
| | | <aura:attribute name="errorColumns" type="List" /> |
| | | <!-- show Error information --> |
| | |
| | | <!-- 批量添加日报 end--> |
| | | <!--ロード中...--> |
| | | <aura:renderIf isTrue="{!v.login}"> |
| | | <div class="slds-spinner_container height100vh"> |
| | | <aura:renderIf isTrue="{!!v.loginEdit}"> |
| | | <!-- <div class="slds-spinner_container"> |
| | | <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand"> |
| | | <span class="slds-assistive-text">Loading</span> |
| | | <div class="slds-spinner__dot-a"></div> |
| | | <div class="slds-spinner__dot-b"></div> |
| | | </div> |
| | | </div> --> |
| | | <div |
| | | class="slds-spinner--brand slds-spinner slds-spinner--medium" |
| | | role="alert" |
| | | class="slds-spinner_container" |
| | | id="spinner" |
| | | style="position: fixed; top: 123px" |
| | | > |
| | | <div |
| | | role="status" |
| | | class="slds-spinner slds-spinner_medium slds-spinner_brand" |
| | | > |
| | | <span class="slds-assistive-text">Loading</span> |
| | | <div class="slds-spinner__dot-a"></div> |
| | |
| | | </div> |
| | | </div> |
| | | </aura:renderIf> |
| | | <div aura:id="report" id="report" class="contents_wrapper"> |
| | | </aura:renderIf> |
| | | <div aura:id="report" id="report"> |
| | | <div class="slds-grid slds-wrap slds-grid--pull-padded"> |
| | | <div style="width: 200px"></div> |
| | | <div style="width: 150px"></div> |
| | | <div |
| | | class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12" |
| | | class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12 fontSize" |
| | | > |
| | | 周 |
| | | </div> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 fontSize" |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_date" |
| | |
| | | class="tr slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12" |
| | | style="display: contents" |
| | | > |
| | | <ui:button aura:id="new_button" label="新建" press="{!c.new_report}" /> |
| | | <ui:button |
| | | aura:id="new_button" |
| | | label="新建" |
| | | press="{!c.new_report}" |
| | | class="buttonFontSize" |
| | | /> |
| | | </div> |
| | | <div |
| | | style="width: 350px" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12" |
| | | style="width: 400px" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--4-of-12 slds-large-size--4-of-12" |
| | | > |
| | | <ui:button |
| | | aura:id="copy_button" |
| | | label="复制" |
| | | press="{!c.copy_button}" |
| | | disabled="true" |
| | | class="buttonFontSize" |
| | | /> |
| | | <ui:button |
| | | aura:id="delete_button" |
| | | label="删除" |
| | | press="{!c.delete_button}" |
| | | disabled="true" |
| | | class="buttonFontSize" |
| | | /> |
| | | <ui:button aura:id="import" label="导入" press="{!c.import}" /> |
| | | <ui:button |
| | | aura:id="import" |
| | | label="导入" |
| | | press="{!c.import}" |
| | | class="buttonFontSize" |
| | | /> |
| | | <ui:button |
| | | aura:id="export" |
| | | label="导出" |
| | | press="{!c.export_condition}" |
| | | class="buttonFontSize" |
| | | /> |
| | | <ui:button |
| | | aura:id="returnbutton" |
| | | label="返回" |
| | | press="{!c.return_main_page}" |
| | | /> |
| | | <!-- <ui:button aura:id="returnbutton" label="返回" press="{!c.return_main_page}" /> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <thead> |
| | | <tr class="slds-line-height--reset"> |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | class="table_header slds-text-title--caps fontSize" |
| | | style="width: 250px" |
| | | ></th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | > |
| | | <span class="slds-truncate" title="Name" |
| | | >日报编号</span |
| | | > |
| | | </th> |
| | | <th class="table_header slds-text-title--caps fontSize"> |
| | | <span class="slds-truncate" title="Name" |
| | | >{!v.fieldsmap.Person_In_Charge2__c}</span |
| | | > |
| | | <!-- {!v.fieldsmap.Person_In_Charge2__c} 担当--> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps" style="width: 250px"> |
| | | <th |
| | | class="table_header slds-text-title--caps fontSize" |
| | | style="width: 250px" |
| | | > |
| | | <span class="slds-truncate" title="Name">医院</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <th class="table_header slds-text-title--caps fontSize"> |
| | | <span class="slds-truncate" title="Name" |
| | | >{!v.fieldsmap.Department_Cateogy__c}</span |
| | | > |
| | | <!-- {!v.fieldsmap.Department_Cateogy__c} 科室--> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">拜访人</span> |
| | | <th class="table_header slds-text-title--caps fontSize"> |
| | | <span class="slds-truncate" title="Name" |
| | | >拜访人</span |
| | | > |
| | | <!-- {!v.fieldsmap.doctor2__c} 拜访人 --> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <th class="table_header slds-text-title--caps fontSize"> |
| | | <span class="slds-truncate" title="Name" |
| | | >{!v.fieldsmap.DealerPersonnel__c}</span |
| | | > |
| | | <!-- {!v.fieldsmap.visitor_title__c} 职位--> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <th class="table_header slds-text-title--caps fontSize"> |
| | | <span class="slds-truncate" title="Name" |
| | | >{!v.fieldsmap.WorkMark__c}</span |
| | | > |
| | |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <aura:iteration items="{!v.reports}" var="item" indexVar="index"> |
| | | <aura:iteration |
| | | items="{!v.reports}" |
| | | var="item" |
| | | indexVar="index" |
| | | > |
| | | <tr class="slds-hint-parent"> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <td role="gridcell" class="slds-cell-edit fontSize"> |
| | | <ui:inputRadio |
| | | class="report_radio" |
| | | name="report_radio" |
| | |
| | | onclick="{!c.edit_button}" |
| | | /> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <td role="gridcell" class="slds-cell-edit fontSize"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span |
| | | class="slds-truncate" |
| | |
| | | > |
| | | </span> |
| | | </td> |
| | | <th scope="row" tabindex="0" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <td |
| | | scope="row" |
| | | tabindex="0" |
| | | class="slds-cell-edit fontSize" |
| | | > |
| | | <div |
| | | class="slds-grid slds-grid--align-spread" |
| | | style="word-wrap: break-word" |
| | | > |
| | | {!item.Agency_Hospital__r.Name} |
| | | </span> |
| | | </th> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | </div> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit fontSize"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span |
| | | class="slds-truncate" |
| | |
| | | > |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <td role="gridcell" class="slds-cell-edit fontSize"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.doctor2__r.Name}"> |
| | | <span class="encrypt">{!item.doctor2__r.Name}</span> |
| | | <span class="decrypt">{!item.doctor2__r.awsdata.name}</span> |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.doctor2__r.Name}" |
| | | > |
| | | <span class="encrypt" |
| | | >{!item.doctor2__r.Name}</span |
| | | > |
| | | <span class="decrypt" |
| | | >{!item.doctor2__r.awsdata.name}</span |
| | | > |
| | | </span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <td role="gridcell" class="slds-cell-edit fontSize"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span |
| | | class="slds-truncate" |
| | |
| | | > |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <td role="gridcell" class="slds-cell-edit fontSize"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.WorkMark__c}"> |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.WorkMark__c}" |
| | | > |
| | | <lightning:input |
| | | type="checkbox" |
| | | checked="{!item.WorkMark__c}" |
| | |
| | | class="disp_none slds-modal slds-fade-in-open slds-modal--large" |
| | | aria-labelledby="headerTarget" |
| | | > |
| | | <div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv01"> |
| | | <aura:renderIf isTrue="{!v.modal_import_spinner}"> |
| | | <lightning:spinner alternativeText="Loading" size="medium" /> |
| | | </aura:renderIf> |
| | | <div |
| | | class="slds-modal slds-fade-in-open slds-hide" |
| | | aura:id="successDiv01" |
| | | > |
| | | <!-- <ui:inputText aura:id="articleURL" /> --> |
| | | <div class="demo-only" style="height: 8rem"> |
| | | <div class="slds-notify_container slds-is-relative"> |
| | |
| | | size="small" |
| | | class="buttonColor slds-m-right_small" |
| | | /> |
| | | <h2 class="slds-text-heading_small">{!v.successMessage}</h2> |
| | | <h2 class="slds-text-heading_small"> |
| | | {!v.successMessage} |
| | | </h2> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div |
| | | class="slds-modal slds-fade-in-open slds-hide" |
| | | aura:id="errorDiv01" |
| | | style="z-index: 10001" |
| | | > |
| | | <!-- <ui:inputText aura:id="articleURL" /> --> |
| | | <div class="demo-only" style="height: 8rem"> |
| | | <!-- <div class="slds-modal slds-fade-in-open slds-hide" aura:id="errorDiv01" style="z-index: 10001"> |
| | | <div class="demo-only" style="height: 8rem;"> |
| | | <div class="slds-notify_container slds-is-relative"> |
| | | <div |
| | | class="slds-notify slds-notify_toast slds-theme_error" |
| | | role="status" |
| | | > |
| | | <div class="slds-notify slds-notify_toast slds-theme_error" role="status"> |
| | | <div class="slds-m-left_xx-large"> |
| | | <div |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large" |
| | | > |
| | | <lightning:icon |
| | | alternativeText="error" |
| | | iconName="utility:error" |
| | | size="small" |
| | | class="buttonColor slds-m-right_small" |
| | | /> |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"> |
| | | <lightning:icon alternativeText="error" iconName="utility:error" size="small" |
| | | class="buttonColor slds-m-right_small" /> |
| | | <h2 class="slds-text-heading_small">{!v.errorMessage}</h2> |
| | | <lightning:icon alternativeText="Close" iconName="utility:close" size="small" |
| | | onclick="{!c.closeErrorDiv}" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal__header"> |
| | | <h4 id="headerTarget" class="slds-float--left"></h4> |
| | |
| | | <ui:button |
| | | aura:id="close_button" |
| | | label="关闭" |
| | | class="close_button slds-button slds-button--neutral slds-order--1" |
| | | class="close_button slds-button slds-button--neutral slds-order--1 buttonFontSize" |
| | | press="{!c.close_import}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium" |
| | | class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium fontSize" |
| | | > |
| | | <aura:if isTrue="{!v.showMain}"> |
| | | <div> |
| | |
| | | </div> |
| | | <aura:set attribute="else"> |
| | | <ui:outputRichText |
| | | class="uiOutputRichText slds-m--around-large" |
| | | class="uiOutputRichText slds-m--around-large fontSize" |
| | | value="{!v.TableContent}" |
| | | /> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <div |
| | | class="slds-p-around--large slds-align--absolute-center" |
| | | > |
| | | <lightning:button |
| | | label="保存" |
| | | variant="brand" |
| | | onclick="{!c.processFileContent}" |
| | | class="buttonFontSize" |
| | | /> |
| | | <lightning:button |
| | | label="取消" |
| | | variant="brand" |
| | | onclick="{!c.cancel}" |
| | | class="buttonFontSize" |
| | | /> |
| | | </div> |
| | | <aura:if isTrue="{!v.showErrorInfo}"> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <div |
| | | class="slds-p-around--large slds-align--absolute-center" |
| | | > |
| | | <lightning:button |
| | | label="导出错误信息" |
| | | variant="brand" |
| | | onclick="{!c.exportErrorInfo}" |
| | | /> |
| | | </div> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <div style="height: 300px"> |
| | | <div |
| | | class="slds-p-around--large slds-align--absolute-center" |
| | | > |
| | | <div style="height: 300px; overflow-x: scroll"> |
| | | <lightning:datatable |
| | | keyField="id" |
| | | data="{! v.errorData }" |
| | |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4" |
| | | ></div> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <div |
| | | class="slds-p-around--large slds-align--absolute-center" |
| | | > |
| | | <lightning:button |
| | | label="确认" |
| | | variant="brand" |
| | |
| | | class="uiOutputRichText slds-m--around-large" |
| | | value="{!v.TableContent2}" |
| | | /> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <div |
| | | class="slds-p-around--large slds-align--absolute-center" |
| | | > |
| | | <lightning:button |
| | | label="确认" |
| | | variant="brand" |
| | |
| | | aria-labelledby="headerTarget" |
| | | > |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv"> |
| | | <div |
| | | class="slds-modal slds-fade-in-open slds-hide" |
| | | aura:id="successDiv" |
| | | > |
| | | <!-- <ui:inputText aura:id="articleURL" /> --> |
| | | <div class="demo-only" style="height: 8rem"> |
| | | <div class="slds-notify_container slds-is-relative"> |
| | |
| | | size="small" |
| | | class="buttonColor slds-m-right_small" |
| | | /> |
| | | <h2 class="slds-text-heading_small">{!v.successMessage}</h2> |
| | | <h2 class="slds-text-heading_small"> |
| | | {!v.successMessage} |
| | | </h2> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | size="small" |
| | | class="buttonColor slds-m-right_small" |
| | | /> |
| | | <h2 class="slds-text-heading_small">{!v.errorMessage}</h2> |
| | | <h2 class="slds-text-heading_small"> |
| | | {!v.errorMessage} |
| | | </h2> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div |
| | | class="slds-modal__content slds-grow slds-p-around--medium" |
| | | style="position: relative" |
| | | > |
| | | <aura:renderIf isTrue="{!v.loginEdit}"> |
| | | <lightning:spinner |
| | | alternativeText="Loading" |
| | | size="medium" |
| | | style="width: 100%; height: 100%" |
| | | /> |
| | | </aura:renderIf> |
| | | <div class="slds-modal__header"> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium"> |
| | | 日报({!v.selected_date} {!v.selected_agency_person}) |
| | |
| | | press="{!c.toggle_report}" |
| | | /> |
| | | </div> |
| | | <div class="slds-modal__content slds-grow slds-p-around--medium"> |
| | | <div class="slds-box slds-theme--shade"> |
| | | <div class="slds-grid slds-wrap slds-grid--pull-padded"> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7" |
| | | > |
| | | 活动日 |
| | | <lightning:input |
| | |
| | | <!-- 医院 --> |
| | | <div |
| | | aura:id="hospital_list" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7" |
| | | data-select="single" |
| | | > |
| | | <!-- label="医院" --> |
| | |
| | | /> |
| | | <div class="slds-lookup__menu" id="lookup-66"> |
| | | <ul class="slds-lookup__list" role="listbox"> |
| | | <aura:iteration var="hospital" items="{!v.hospitalList}"> |
| | | <aura:iteration |
| | | var="hospital" |
| | | items="{!v.hospitalList}" |
| | | > |
| | | <li |
| | | role="presentation" |
| | | onclick="{!c.selectHos}" |
| | |
| | | role="option" |
| | | > |
| | | <div class="slds-media__body"> |
| | | <div class="slds-lookup__result-text"> |
| | | <div |
| | | class="slds-lookup__result-text" |
| | | > |
| | | {!hospital.Hospital_Name_readonly__c} |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | <!-- 科室分类 --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7" |
| | | > |
| | | {!v.fieldsmap.Department_Cateogy__c} |
| | | <!-- <ui:inputText aura:id="select_department" class="slds-select" |
| | |
| | | </div> |
| | | <!-- 经销商人员 change="{!c.select_DealerPersonnel}" --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7" |
| | | style="width: 145px" |
| | | > |
| | | {!v.fieldsmap.DealerPersonnel__c} |
| | |
| | | </div> |
| | | <!-- 活动区分 --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7" |
| | | > |
| | | {!v.fieldsmap.WorkRecord__c} |
| | | <ui:inputSelect |
| | |
| | | </div> |
| | | <!-- 拜访人 {!v.fieldsmap.doctor2__c}--> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7" |
| | | style="width: 145px" |
| | | > |
| | | 拜访人 |
| | |
| | | <!-- <p hidden="hidden"> --> |
| | | |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-12" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7" |
| | | > |
| | | <br /> |
| | | <ui:button |
| | |
| | | <hr /> |
| | | <!-- 产品分类(第三分类) change="{!c.select_ProductClassification}" --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5" |
| | | > |
| | | 产品分类(第三分类) |
| | | <ui:inputSelect |
| | |
| | | <!-- 使用产品1(产品型号) UseProduct1__c --> |
| | | <div |
| | | aura:id="UseProduct1_List" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5" |
| | | data-select="single" |
| | | > |
| | | <!-- label="使用产品1(产品型号)" --> |
| | |
| | | role="option" |
| | | > |
| | | <div class="slds-media__body"> |
| | | <div class="slds-lookup__result-text"> |
| | | <div |
| | | class="slds-lookup__result-text" |
| | | > |
| | | {!UseProduct1.Asset_Model_No__c} |
| | | </div> |
| | | </div> |
| | |
| | | <!-- 使用产品2 UseProduct2__c --> |
| | | <div |
| | | aura:id="UseProduct2_List" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5" |
| | | data-select="single" |
| | | > |
| | | <!-- label="使用产品2" --> |
| | |
| | | role="option" |
| | | > |
| | | <div class="slds-media__body"> |
| | | <div class="slds-lookup__result-text"> |
| | | <div |
| | | class="slds-lookup__result-text" |
| | | > |
| | | {!UseProduct2.Asset_Model_No__c} |
| | | </div> |
| | | </div> |
| | |
| | | <!-- 使用产品3 UseProduct3__c --> |
| | | <div |
| | | aura:id="UseProduct3_List" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5" |
| | | data-select="single" |
| | | > |
| | | <!-- label="使用产品3" --> |
| | |
| | | role="option" |
| | | > |
| | | <div class="slds-media__body"> |
| | | <div class="slds-lookup__result-text"> |
| | | <div |
| | | class="slds-lookup__result-text" |
| | | > |
| | | {!UseProduct3.Asset_Model_No__c} |
| | | </div> |
| | | </div> |
| | |
| | | <!-- 效果/进度 EffectProgress__c--> |
| | | <div |
| | | aura:id="product_category_select1" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5" |
| | | > |
| | | {!v.fieldsmap.EffectProgress__c} |
| | | <ui:inputSelect |
| | |
| | | <hr /> |
| | | <!-- 产品1同类耗材科室月使用量 ConsumptionOfConsumables__c--> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5" |
| | | > |
| | | {!v.fieldsmap.ConsumptionOfConsumables__c} |
| | | <!-- <ui:inputText aura:id="select_ConsumptionOfConsumables" class="slds-select" |
| | |
| | | <!-- 支援需求 WorkMark__c--> |
| | | <div style="padding-left: 12px"> |
| | | {!v.fieldsmap.WorkMark__c} |
| | | <lightning:input type="checkbox" aura:id="select_WorkMark" /> |
| | | <lightning:input |
| | | type="checkbox" |
| | | aura:id="select_WorkMark" |
| | | /> |
| | | </div> |
| | | <div |
| | | aura:id="input-opportunity-stage" |
| | | class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12" |
| | | > |
| | | {!v.fieldsmap.StageName__c} |
| | | <ui:inputSelect aura:id="select_stageName" class="slds-select" /> |
| | | <ui:inputSelect |
| | | aura:id="select_stageName" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <div |
| | | aura:id="input-opportunity-amount1" |
| | |
| | | > |
| | | {!v.fieldsmap.Amount__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> 医院采购预算(不含税,元)--> |
| | | <lightning:inputField value="{!v.oppdata.Amount__c}" class="" /> |
| | | <lightning:inputField |
| | | value="{!v.oppdata.Amount__c}" |
| | | class="" |
| | | /> |
| | | </div> |
| | | <div |
| | | aura:id="input-opportunity-amount2" |
| | |
| | | </div> |
| | | <aura:renderIf isTrue="{!v.reports_now_count > 0}"> |
| | | <div class="mt40 slds-box slds-theme--shade"> |
| | | <div class="slds-table--edit_container slds-is-relative"> |
| | | <div |
| | | class="slds-table--edit_container slds-is-relative" |
| | | > |
| | | <table |
| | | class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus" |
| | | role="grid" |
| | | > |
| | | <thead> |
| | | <tr class="slds-line-height--reset"> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name"></span> |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="Name" |
| | | ></span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">医院</span> |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="Name" |
| | | >医院</span |
| | | > |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name" |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="Name" |
| | | >{!v.fieldsmap.Department_Cateogy__c}</span |
| | | > |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name" |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="Name" |
| | | >{!v.fieldsmap.doctor2__c}</span |
| | | > |
| | | <!-- 客户人员 --> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name" |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="Name" |
| | | >{!v.fieldsmap.visitor_title__c}</span |
| | | > |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name" |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="Name" |
| | | >{!v.fieldsmap.WorkRecord__c}</span |
| | | > |
| | | </th> |
| | |
| | | var="item" |
| | | indexVar="index" |
| | | > |
| | | <tr aura:id="modal_data_list_tr" class="slds-hint-parent"> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <tr |
| | | aura:id="modal_data_list_tr" |
| | | class="slds-hint-parent" |
| | | > |
| | | <td |
| | | role="gridcell" |
| | | class="slds-cell-edit" |
| | | > |
| | | <span |
| | | class="slds-grid slds-grid--align-spread" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.Department_Cateogy_text__c}" |
| | |
| | | > |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <td |
| | | role="gridcell" |
| | | class="slds-cell-edit" |
| | | > |
| | | <span |
| | | class="slds-grid slds-grid--align-spread" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.Agency_Hospital__r.Name}" |
| | |
| | | > |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <td |
| | | role="gridcell" |
| | | class="slds-cell-edit" |
| | | > |
| | | <span |
| | | class="slds-grid slds-grid--align-spread" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.Department_Cateogy_text__c}" |
| | |
| | | > |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <td |
| | | role="gridcell" |
| | | class="slds-cell-edit" |
| | | > |
| | | <span |
| | | class="slds-grid slds-grid--align-spread" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.doctor2__r.Name}" |
| | |
| | | > |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <td |
| | | role="gridcell" |
| | | class="slds-cell-edit" |
| | | > |
| | | <span |
| | | class="slds-grid slds-grid--align-spread" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.visitor_title__c}" |
| | |
| | | > |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <td |
| | | role="gridcell" |
| | | class="slds-cell-edit" |
| | | > |
| | | <span |
| | | class="slds-grid slds-grid--align-spread" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.WorkRecord__c}" |
| | |
| | | > |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal__header"> |
| | | <h2 id="headertest" class="slds-text-heading--medium">新建.拜访人</h2> |
| | | <h2 id="headertest" class="slds-text-heading--medium"> |
| | | 新建.拜访人 |
| | | </h2> |
| | | </div> |
| | | <div class="slds-modal__content slds-p-around--medium"> |
| | | <lightning:recordEditForm |
| | |
| | | @import 'c/lexCssUtility'; |
| | | |
| | | .THIS .bcolor { |
| | | color: #333; |
| | | } |
| | | |
| | | .THIS.height100vh { |
| | | height: 100vh; |
| | | } |
| | | |
| | | .THIS.contents_wrapper { |
| | | padding-top: 50px; |
| | | } |
| | | |
| | | .THIS .mt5 { |
| | | margin-top: 5px; |
| | | } |
| | | |
| | | .THIS .mt40 { |
| | | margin-top: 40px; |
| | | } |
| | | |
| | | .THIS .edit_button { |
| | | float: right; |
| | | margin: -1.5em 0.5em 0 0; |
| | | border: 0; |
| | | } |
| | | |
| | | .THIS .no_data_area { |
| | | text-align: center; |
| | | margin: .5em 0; |
| | | margin: 0.5em 0; |
| | | } |
| | | |
| | | .THIS.report_list_area { |
| | | margin: 40px 0 20px 100px; |
| | | height: 60vh; |
| | | overflow-y: scroll; |
| | | } |
| | | |
| | | .THIS .report_radio { |
| | | float: left; |
| | | } |
| | | |
| | | .THIS .table_header { |
| | | width: 9.4rem; |
| | | height: 2em; |
| | | } |
| | | |
| | | .THIS.disp_none { |
| | | display: none; |
| | | } |
| | | |
| | | .THIS .disp_none { |
| | | display: none; |
| | | } |
| | | |
| | | .THIS .tr { |
| | | text-align: right; |
| | | } |
| | | |
| | | .THIS .close_button { |
| | | float: right; |
| | | margin-top: -2em; |
| | | } |
| | | |
| | | .THIS .close_icn svg { |
| | | fill: #fefefe; |
| | | } |
| | | |
| | | .THIS .slds-progress__marker { |
| | | cursor: default; |
| | | } |
| | | |
| | | .THIS .progress_0 { |
| | | width: 0%; |
| | | } |
| | | |
| | | .THIS .progress_100 { |
| | | width: 100%; |
| | | } |
| | | |
| | | .THIS .new_btn_area { |
| | | text-align: center; |
| | | margin-top: 22px; |
| | | } |
| | | |
| | | .THIS .new_btn { |
| | | width: 100%; |
| | | } |
| | | |
| | | .THIS .save_button_area { |
| | | margin: 1em 0; |
| | | text-align: right; |
| | | } |
| | | |
| | | .THIS .save_button { |
| | | background-color: #ffa500; |
| | | border: 1px solid #ff8c00; |
| | | } |
| | | |
| | | .THIS .report_data_header { |
| | | border-bottom: 2px solid #ccc; |
| | | } |
| | | |
| | | .THIS .report_data_area { |
| | | border-bottom: 1px solid #ccc; |
| | | } |
| | | |
| | | .THIS.fade { |
| | | transition: 5s opacity linear; |
| | | } |
| | | |
| | | .THIS.animation_off { |
| | | opacity: 0; |
| | | } |
| | | |
| | | .THIS.animation_on { |
| | | opacity: 1; |
| | | } |
| | | |
| | | .THIS .fade { |
| | | transition: 5s opacity linear; |
| | | } |
| | | |
| | | .THIS .animation_off { |
| | | opacity: 0; |
| | | } |
| | | |
| | | .THIS .animation_on { |
| | | opacity: 1; |
| | | } |
| | | |
| | | .THIS .divbotuser{ |
| | | width:fit-content; |
| | | } |
| | |
| | | display: none; |
| | | } |
| | | |
| | | .THIS .slds-input:focus, .THIS .slds-input:active { |
| | | .THIS .slds-input:focus, |
| | | .THIS .slds-input:active { |
| | | border-color: rgb(216, 221, 230); |
| | | box-shadow: none; |
| | | } |
| | |
| | | .THIS .customRequired{ |
| | | font-weight: 400; |
| | | } |
| | | |
| | | .THIS .customRequired:before{ |
| | | content: "*"; |
| | | content: '*'; |
| | | margin: 0 0.125rem 0 0.125rem; |
| | | color: rgb(194, 57, 52); |
| | | float: left; |
| | | } |
| | | |
| | | .THIS .none{ |
| | | display:none; |
| | | } |
| | |
| | | .THIS tr:hover .encrypt{ |
| | | display: none; |
| | | } |
| | | |
| | | .THIS tr:hover .encrypt { |
| | | display: none; |
| | | } |
| | | |
| | | .THIS .buttonFontSize { |
| | | font-size: 18px; |
| | | min-width: 80px; |
| | | max-width: 110px; |
| | | } |
| | | |
| | | .THIS .fontSize { |
| | | font-size: 18px; |
| | | } |
| | | |
| | | .THIS thead th { |
| | | font-size: 18px; |
| | | } |
| | | |
| | | .THIS table { |
| | | table-layout: fixed; |
| | | } |
| | | .THIS td { |
| | | white-space: normal; |
| | | overflow-wrap: break-word; |
| | | } |
| | |
| | | ({ |
| | | doInit: function (component, event, helper) { |
| | | helper.doinit(component, event, helper); |
| | | component.set("v.errorColumns", [ |
| | | { |
| | | label: "错误行", |
| | | fieldName: "errorRow", |
| | | type: "text", |
| | | hideDefaultActions: true, |
| | | initialWidth: 100 |
| | | }, |
| | | { |
| | | label: "错误信息", |
| | | fieldName: "errorInfo", |
| | | type: "text", |
| | | hideDefaultActions: true |
| | | } |
| | | ]); |
| | | }, |
| | | |
| | | createAopp: function (component, event, helper) { |
| | | var addRecordEvent = $A.get("e.force:createRecord"); |
| | | var addRecordEvent = $A.get('e.force:createRecord'); |
| | | addRecordEvent.setParams({ |
| | | entityApiName: "Agency_Opportunity__c", |
| | | recordTypeId: "012100000006KW7" |
| | | entityApiName: 'Agency_Opportunity__c', |
| | | recordTypeId: '012100000006KW7' |
| | | }); |
| | | addRecordEvent.fire(); |
| | | }, |
| | | |
| | | new_report: function (component, event, helper) { |
| | | component.find("save_button").set("v.label", "保存并新建"); |
| | | component.find('save_button').set('v.label', '保存并新建'); |
| | | helper.new_report(component, event, helper); |
| | | }, |
| | | |
| | | copy_button: function (component, event, helper) { |
| | | component.find("save_button").set("v.label", "保存并新建"); |
| | | component.find('save_button').set('v.label', '保存并新建'); |
| | | helper.copy_button(component, event, helper); |
| | | }, |
| | | delete_button: function (component, event, helper) { |
| | |
| | | }, |
| | | |
| | | edit_button: function (component, event, helper) { |
| | | component.find("save_button").set("v.label", "保存"); |
| | | component.find('save_button').set('v.label', '保存'); |
| | | helper.edit_button(component, event, helper); |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | showRequiredFields: function (component, event, helper) { |
| | | $A.util.removeClass(component.find("newOpportunityField"), "none"); |
| | | $A.util.removeClass(component.find("newOpportunityField"), "none"); |
| | | $A.util.removeClass(component.find('newOpportunityField'), 'none'); |
| | | $A.util.removeClass(component.find('newOpportunityField'), 'none'); |
| | | }, |
| | | |
| | | handleSuccess: function (component, event, helper) { |
| | |
| | | handleSubmit: function (component, event, helper) { |
| | | event.preventDefault(); // stop form submission |
| | | var showValidationError = false; |
| | | var fields = component.find("newOpportunityField"); |
| | | var vaildationFailReason = ""; |
| | | var fields = component.find('newOpportunityField'); |
| | | var vaildationFailReason = ''; |
| | | let agencyReport = Object.create(null); |
| | | fields.forEach(function (field) { |
| | | if ( |
| | | field.get("v.fieldName") === "Type__c" && |
| | | $A.util.isEmpty(field.get("v.value")) |
| | | field.get('v.fieldName') === 'Type__c' && |
| | | $A.util.isEmpty(field.get('v.value')) |
| | | ) { |
| | | showValidationError = true; |
| | | vaildationFailReason = "分类不能为空!"; |
| | | vaildationFailReason = '分类不能为空!'; |
| | | } else if ( |
| | | field.get("v.fieldName") === "Doctor_Division1__c" && |
| | | $A.util.isEmpty(field.get("v.value")) |
| | | field.get('v.fieldName') === 'Doctor_Division1__c' && |
| | | $A.util.isEmpty(field.get('v.value')) |
| | | ) { |
| | | showValidationError = true; |
| | | if (vaildationFailReason != "") { |
| | | vaildationFailReason += "医生区分(职务)不能为空!"; |
| | | if (vaildationFailReason != '') { |
| | | vaildationFailReason += '医生区分(职务)不能为空!'; |
| | | } else { |
| | | vaildationFailReason = "医生区分(职务)不能为空!"; |
| | | vaildationFailReason = '医生区分(职务)不能为空!'; |
| | | } |
| | | } |
| | | //SWAG-CF58C3 fy start |
| | | if (field.get("v.fieldName") === "Name") { |
| | | agencyReport["name"] = field.get("v.value"); |
| | | } else if (field.get("v.fieldName") === "Type__c") { |
| | | agencyReport["type"] = field.get("v.value"); |
| | | } else if (field.get("v.fieldName") === "Doctor_Division1__c") { |
| | | agencyReport["doctorDivision1"] = field.get("v.value"); |
| | | if (field.get('v.fieldName') === 'Name') { |
| | | agencyReport['name'] = field.get('v.value'); |
| | | } else if (field.get('v.fieldName') === 'Type__c') { |
| | | agencyReport['type'] = field.get('v.value'); |
| | | } else if (field.get('v.fieldName') === 'Doctor_Division1__c') { |
| | | agencyReport['doctorDivision1'] = field.get('v.value'); |
| | | } |
| | | //SWAG-CF58C3 fy end |
| | | }); |
| | | if (!showValidationError) { |
| | | //SWAG-CF58C3 fy start |
| | | var agencyHospitalid = component.get("v.hospitalLinkId"); |
| | | var agencyHospitalid = component.get('v.hospitalLinkId'); |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | debugger; |
| | | let hospitalName = ""; |
| | | let hospitalName = ''; |
| | | //调用后端searchAgencyDataId方法查询出医院下面所有客户人员dataid |
| | | helper.CallBackAction( |
| | | component, |
| | | "searchAgencyDataId", |
| | | 'searchAgencyDataId', |
| | | { |
| | | hospitalId: agencyHospitalid |
| | | }, |
| | | function (data) { |
| | | if (data.getState() == "SUCCESS") { |
| | | if (data.getState() == 'SUCCESS') { |
| | | var data = data.getReturnValue(); |
| | | if (data.IsSuccess == true) { |
| | | let agencyContactIds = ""; |
| | | if (data.Message == "" && data.Data && data.Data.length > 0) { |
| | | hospitalName = data.Data[0].Agency_Hospital__r.Name; |
| | | let agencyContactIds = ''; |
| | | if ( |
| | | data.Message == '' && |
| | | data.Data && |
| | | data.Data.length > 0 |
| | | ) { |
| | | hospitalName = |
| | | data.Data[0].Agency_Hospital__r.Name; |
| | | for (var i = 0; i < data.Data.length; i++) { |
| | | if (data.Data[i].AWS_Data_Id__c) |
| | | agencyContactIds += "," + data.Data[i].AWS_Data_Id__c; |
| | | agencyContactIds += |
| | | ',' + data.Data[i].AWS_Data_Id__c; |
| | | } |
| | | agencyContactIds = agencyContactIds.substring(1); |
| | | agencyReport["agencyContactIds"] = agencyContactIds; |
| | | agencyContactIds = |
| | | agencyContactIds.substring(1); |
| | | agencyReport['agencyContactIds'] = |
| | | agencyContactIds; |
| | | } else { |
| | | agencyReport["agencyContactIds"] = agencyContactIds; |
| | | agencyReport['agencyContactIds'] = |
| | | agencyContactIds; |
| | | } |
| | | var arr = new Array(); |
| | | arr.push(agencyReport); |
| | | var requestData = JSON.stringify(arr); |
| | | // helper.set_aws_url(component,data,agencyHospitalid); |
| | | |
| | | var token = component.get("v.AWStoken"); |
| | | var newUrl = component.get("v.AWSinsert") + "V2"; |
| | | var token = component.get('v.AWStoken'); |
| | | var newUrl = component.get('v.AWSinsert') + 'V2'; |
| | | |
| | | component.set("v.login", true); |
| | | component.set('v.login', true); |
| | | helper.insert_agencycontact( |
| | | component, |
| | | token, |
| | |
| | | } else { |
| | | helper.ShowToast({ |
| | | message: data.message, |
| | | type: "error" |
| | | type: 'error' |
| | | }); |
| | | } |
| | | } else { |
| | | helper.ShowToast({ |
| | | message: "searchAgency失败", |
| | | type: "error" |
| | | message: 'searchAgency失败', |
| | | type: 'error' |
| | | }); |
| | | } |
| | | } |
| | |
| | | //SWAG-CF58C3 fy end |
| | | // helper.newlyBuild(component, event, helper); |
| | | } else { |
| | | component.find("OppMessage").setError(vaildationFailReason); |
| | | component.find('OppMessage').setError(vaildationFailReason); |
| | | } |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | yes_button: function (component, event, helper) { |
| | | component.set("v.confirm_status", 1); |
| | | component.set('v.confirm_status', 1); |
| | | helper.close_confirm( |
| | | component, |
| | | component.get("v.modal_confirm_title"), |
| | | component.get("v.modal_confirm_text") |
| | | component.get('v.modal_confirm_title'), |
| | | component.get('v.modal_confirm_text') |
| | | ); |
| | | }, |
| | | |
| | | no_button: function (component, event, helper) { |
| | | component.set("v.confirm_status", 2); |
| | | component.set('v.confirm_status', 2); |
| | | helper.close_confirm( |
| | | component, |
| | | component.get("v.modal_confirm_title"), |
| | | component.get("v.modal_confirm_text") |
| | | component.get('v.modal_confirm_title'), |
| | | component.get('v.modal_confirm_text') |
| | | ); |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | hosChange: function (component, event, helper) { |
| | | var hospital_name = event.getParam("value"); |
| | | var hospital_nameld = component.get("v.UseProduct1s"); |
| | | var hospital_name = event.getParam('value'); |
| | | var hospital_nameld = component.get('v.UseProduct1s'); |
| | | if (hospital_name.match(/(\S+\s)+/)) { |
| | | if (hospital_nameld != hospital_name) { |
| | | helper.searchHos(component, event, helper); |
| | | } |
| | | } else { |
| | | if (hospital_name == "") { |
| | | if (hospital_name == '') { |
| | | helper.hideSearchs(component, event, helper); |
| | | } else { |
| | | helper.hideSearch(component, event, helper); |
| | |
| | | }, |
| | | //使用产品1 |
| | | UseProduct1Change: function (component, event, helper) { |
| | | var UseProduct1Name = event.getParam("value"); |
| | | var UseProduct1Nameold = component.get("v.UseProduct1s"); |
| | | var UseProduct1Name = event.getParam('value'); |
| | | var UseProduct1Nameold = component.get('v.UseProduct1s'); |
| | | debugger; |
| | | if (UseProduct1Name.match(/(\S+\s)+/)) { |
| | | if (UseProduct1Name != UseProduct1Nameold) { |
| | | helper.searchUseProduct1(component, event, helper); |
| | | } |
| | | } else { |
| | | if (UseProduct1Name == "") { |
| | | if (UseProduct1Name == '') { |
| | | helper.hideSearchUseProduct1s(component, event, helper); |
| | | } else { |
| | | helper.hideSearchUseProduct1(component, event, helper); |
| | |
| | | }, |
| | | //使用产品2 |
| | | UseProduct2Change: function (component, event, helper) { |
| | | var UseProduct2Name = event.getParam("value"); |
| | | var UseProduct2Nameold = component.get("v.UseProduct2s"); |
| | | var UseProduct2Name = event.getParam('value'); |
| | | var UseProduct2Nameold = component.get('v.UseProduct2s'); |
| | | if (UseProduct2Name.match(/(\S+\s)+/)) { |
| | | if (UseProduct2Name != UseProduct2Nameold) { |
| | | helper.searchUseProduct2(component, event, helper); |
| | | } |
| | | } else { |
| | | if (UseProduct2Name == "") { |
| | | if (UseProduct2Name == '') { |
| | | helper.hideSearchUseProduct2s(component, event, helper); |
| | | } else { |
| | | helper.hideSearchUseProduct2(component, event, helper); |
| | |
| | | }, |
| | | //使用产品3 |
| | | UseProduct3Change: function (component, event, helper) { |
| | | var UseProduct3Name = event.getParam("value"); |
| | | var UseProduct3Nameold = component.get("v.UseProduct3s"); |
| | | var UseProduct3Name = event.getParam('value'); |
| | | var UseProduct3Nameold = component.get('v.UseProduct3s'); |
| | | if (UseProduct3Name.match(/(\S+\s)+/)) { |
| | | if (UseProduct3Name != UseProduct3Nameold) { |
| | | helper.searchUseProduct3(component, event, helper); |
| | | } |
| | | } else { |
| | | if (UseProduct3Name == "") { |
| | | if (UseProduct3Name == '') { |
| | | helper.hideSearchUseProduct3s(component, event, helper); |
| | | } else { |
| | | helper.hideSearchUseProduct3(component, event, helper); |
| | |
| | | onDrop: function (component, event, helper) { |
| | | event.stopPropagation(); |
| | | event.preventDefault(); |
| | | event.dataTransfer.dropEffect = "copy"; |
| | | event.dataTransfer.dropEffect = 'copy'; |
| | | var files = event.dataTransfer.files; |
| | | helper.readFile(component, helper, files[0]); |
| | | }, |
| | | CreateRecord: function (component, event, helper) { |
| | | var files = event.getSource().get("v.files"); |
| | | var files = event.getSource().get('v.files'); |
| | | helper.readFile(component, helper, files[0]); |
| | | component.set('v.showErrorInfo', false); |
| | | }, |
| | | |
| | | processFileContent: function (component, event, helper) { |
| | | helper.saveRecords(component, event, helper); |
| | | component.set("v.showErrorInfo", false); |
| | | component.set('v.showErrorInfo', false); |
| | | }, |
| | | |
| | | cancel: function (component, event, helper) { |
| | | component.set("v.showMain", true); |
| | | component.set('v.showMain', true); |
| | | }, |
| | | |
| | | import: function (component, event, helper) { |
| | | helper.showImport(component); |
| | | }, |
| | | exportDate: function (component, event, helper) { |
| | | var stockData = component.get("v.reports_date"); |
| | | console.log("导出数据" + stockData); |
| | | var stockData = component.get('v.reports_date'); |
| | | console.log('导出数据' + stockData); |
| | | var csv = helper.convertArrayOfObjectsToCSV(component, stockData); |
| | | if (csv == null) { |
| | | return; |
| | | } |
| | | |
| | | var universalBOM = "\uFEFF"; |
| | | var hiddenElement = document.createElement("a"); |
| | | var universalBOM = '\uFEFF'; |
| | | var hiddenElement = document.createElement('a'); |
| | | hiddenElement.href = |
| | | "data:text/csv;charset=utf-8," + encodeURI(universalBOM + csv); |
| | | hiddenElement.target = "_self"; // |
| | | hiddenElement.download = "ExportData.csv"; // CSV file Name* you can change it.[only name not .csv] |
| | | 'data:text/csv;charset=utf-8,' + encodeURI(universalBOM + csv); |
| | | hiddenElement.target = '_self'; // |
| | | hiddenElement.download = 'ExportData.csv'; // CSV file Name* you can change it.[only name not .csv] |
| | | document.body.appendChild(hiddenElement); // Required for FireFox browser |
| | | hiddenElement.click(); // using click() js function to download csv file |
| | | }, |
| | |
| | | helper.select_repores_date(component, event, helper); |
| | | }, |
| | | export: function (component, event, helper) { |
| | | console.log("进入export"); |
| | | var stockData = component.get("v.reports_date"); |
| | | console.log("查出的数据" + stockData); |
| | | console.log('进入export'); |
| | | var stockData = component.get('v.reports_date'); |
| | | console.log('查出的数据' + stockData); |
| | | }, |
| | | close_import: function (component, event, helper) { |
| | | component.set("v.showMain", true); |
| | | component.set('v.showMain', true); |
| | | helper.close_import(component); |
| | | }, |
| | | close_export: function (component, event, helper) { |
| | | component.set("v.showMain", true); |
| | | component.set('v.showMain', true); |
| | | helper.close_export(component); |
| | | }, |
| | | select_ConsumptionOfConsumables: function (component, event, helper) { |
| | |
| | | helper.selectpurposetype(component, event, helper); |
| | | }, |
| | | return_main_page: function (component, event, helper) { |
| | | window.open("/customer/", "_self"); |
| | | window.open('/customer/', '_self'); |
| | | }, |
| | | exportErrorInfo: function (component, event, helper) { |
| | | helper.exportErrorInfoHelper(component); |
| | | }, |
| | | closeErrorDiv: function (component, event, helper) { |
| | | var errorDiv01 = component.find('errorDiv01'); |
| | | $A.util.addClass(errorDiv01, 'slds-hide'); |
| | | } |
| | | }); |
| New file |
| | |
| | | <aura:documentation> |
| | | <aura:description>Documentation</aura:description> |
| | | <aura:example name="ExampleName" ref="exampleComponentName" label="Label"> |
| | | Example Description |
| | | </aura:example> |
| | | </aura:documentation> |
| New file |
| | |
| | | <aura:component |
| | | implements="force:appHostable,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" |
| | | access="global" |
| | | > |
| | | <aura:attribute |
| | | name="data" |
| | | type="Agency_Report__c" |
| | | default="{'sobjectType':'Agency_Report__c','Report_Date__c':null}" |
| | | /> |
| | | |
| | | reportdata |
| | | <force:inputField |
| | | value="{!v.data.Report_Date__c}" |
| | | aura:id="input-report-date" |
| | | /> |
| | | <aura:attribute |
| | | name="contact" |
| | | type="Contact" |
| | | default="{ 'sobjectType': 'Contact' }" |
| | | /> |
| | | <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> |
| | | Firstname |
| | | <force:inputField aura:id="firstname" value="{!v.contact.FirstName}" /> |
| | | <force:inputField aura:id="lastname" value="{!v.contact.LastName}" /> |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>42.0</apiVersion> |
| | | <description>A Lightning Component Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | <design:component > |
| | | |
| | | </design:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no" ?> |
| | | <svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| | | <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> |
| | | <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E" /> |
| | | <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF" /> |
| | | </g> |
| | | </svg> |
| New file |
| | |
| | | ({ |
| | | doInit: function (component, event, helper) { |
| | | console.log('Test'); |
| | | } |
| | | }); |
| New file |
| | |
| | | ({ |
| | | helperMethod: function () {} |
| | | }); |
| New file |
| | |
| | | ({ |
| | | // Your renderer method overrides go here |
| | | }); |
| | |
| | | <aura:component controller="WeeklyReportCmp" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" access="global" > |
| | | <aura:component |
| | | controller="WeeklyReportCmp" |
| | | implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" |
| | | access="global" |
| | | > |
| | | <ltng:require styles="{!$Resource.multilineToastCSS}" /> |
| | | <aura:handler name="init" value="{!this}" action="{!c.doInit}"/> |
| | | <aura:handler event="c:strike_evt" action="{!c.createAopp}" name="strike_evt_addNewRecord"/> |
| | | <aura:attribute name="data" type="Agency_Report__c" default="{sobjectType:'Agency_Report__c'}"/> |
| | | <aura:attribute name="oppdata" type="Agency_Opportunity__c" default="{sobjectType:'Agency_Opportunity__c'}"/> |
| | | <aura:attribute name="acondata" type="Agency_Contact__c" default="{sobjectType:'Agency_Contact__c'}"/> |
| | | <aura:handler |
| | | event="c:strike_evt" |
| | | action="{!c.createAopp}" |
| | | name="strike_evt_addNewRecord" |
| | | /> |
| | | <aura:attribute |
| | | name="data" |
| | | type="Agency_Report__c" |
| | | default="{sobjectType:'Agency_Report__c'}" |
| | | /> |
| | | <aura:attribute |
| | | name="oppdata" |
| | | type="Agency_Opportunity__c" |
| | | default="{sobjectType:'Agency_Opportunity__c'}" |
| | | /> |
| | | <aura:attribute |
| | | name="acondata" |
| | | type="Agency_Contact__c" |
| | | default="{sobjectType:'Agency_Contact__c'}" |
| | | /> |
| | | <!-- <aura:attribute name="oppdata_old" type="Agency_Opportunity__c" default="{sobjectType:'Agency_Opportunity__c'}"/> --> |
| | | <aura:attribute name="Close_Forecasted_Date__c_o" type="Date"/> |
| | | <aura:attribute name="Amount__c_o" type="String"/> |
| | |
| | | <aura:attribute name="doclist" type="List"/> |
| | | <aura:attribute name="docmap" type="Map"/> |
| | | <aura:attribute name="login" type="Boolean" default="false"/> |
| | | <aura:attribute name="loginEdit" type="Boolean" default="false" /> |
| | | <aura:attribute name="loadOpp" type="Boolean" default="false"/> |
| | | <aura:attribute name="reportPageData" type="Map"/> |
| | | <aura:attribute name="selectbody" type="String"/> |
| | |
| | | <aura:attribute name="doctor_list" type="Map"/> |
| | | <aura:attribute name="doctor_title" type="String"/> |
| | | <aura:attribute name="opportunity_list" type="Map"/> |
| | | <aura:handler name="change" value="{!v.data.Opportunity__c}" action="{!c.opportunityChange}"/> |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.data.Opportunity__c}" |
| | | action="{!c.opportunityChange}" |
| | | /> |
| | | <aura:attribute name="edit_copy_select_report_id" type="String"/> |
| | | <aura:attribute name="create_agency_report_id" type="String"/> |
| | | <aura:attribute name="reports" type="List"/> |
| | |
| | | <aura:handler name="change" value="{!v.data.Product_Category2__c}" action="{!c.productcategoryChange2}"/> |
| | | <aura:handler name="change" value="{!v.data.Product_Category3__c}" action="{!c.productcategoryChange3}"/> --> |
| | | <!-- <aura:handler name="change" value="{!v.oppdata.StageName__c}" action="{!c.stageNameChange}"/> --> |
| | | <aura:attribute name="update_select_report_data_id" type="String" default=""/> |
| | | <aura:attribute |
| | | name="update_select_report_data_id" |
| | | type="String" |
| | | default="" |
| | | /> |
| | | |
| | | <!-- 批量添加周报 start--> |
| | | <aura:attribute name="reports_date" type="List" /> |
| | | <!-- <aura:attribute name="reports_date1" type="Date" /> |
| | | <aura:attribute name="reports_date2" type="Date" /> --> |
| | | <aura:attribute name="TableContent" type="String" description=" Show the Result class"/> |
| | | <aura:attribute name="TableContent2" type="String" description=" Show the Result class"/> |
| | | <aura:attribute name="TargetFileName" type="String" description="Name of the file"/> |
| | | <aura:attribute |
| | | name="TableContent" |
| | | type="String" |
| | | description=" Show the Result class" |
| | | /> |
| | | <aura:attribute |
| | | name="TableContent2" |
| | | type="String" |
| | | description=" Show the Result class" |
| | | /> |
| | | <aura:attribute |
| | | name="TargetFileName" |
| | | type="String" |
| | | description="Name of the file" |
| | | /> |
| | | <aura:attribute name="tableheaders" type="Object[]" /> |
| | | <aura:attribute name="fileContentData" type="String"/> |
| | | <aura:attribute name="filename" type="String"/> |
| | |
| | | <aura:attribute name="contactawsurl" type="Map"/> |
| | | <aura:attribute name="allselectlistAgencyPerson" type="Map"/> |
| | | <!-- PIPL update Yin Mingjie 21/02/2022 end --> |
| | | |
| | | <!-- start DTT-zhj 增加错误信息table 2023-05-16--> |
| | | <aura:attribute name="errorData" type="Object" /> |
| | | <aura:attribute name="errorColumns" type="List" /> |
| | | <!-- show Error information --> |
| | | <aura:attribute name="showErrorInfo" type="Boolean" default="false" /> |
| | | <!-- end DTT-zhj 增加错误信息table 2023-05-16--> |
| | | |
| | | <!-- 批量添加周报 end--> |
| | | <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" /> |
| | | <ltng:require scripts="{! $Resource.jquery183minjs }" /> |
| | | |
| | | <!--ロード中...--> |
| | | <aura:renderIf isTrue="{!v.login}"> |
| | | <div class="slds-spinner_container height100vh"> |
| | | <div class="slds-spinner--brand slds-spinner slds-spinner--medium" role="alert"> |
| | | <aura:renderIf isTrue="{!!v.loginEdit}"> |
| | | <!-- add by Deloitte-Link 2023-6-19 --> |
| | | <div class="weeklyReportSpinner"> |
| | | <div class="slds-spinner_container"> |
| | | <div |
| | | class="slds-spinner--brand slds-spinner slds-spinner--medium" |
| | | role="alert" |
| | | > |
| | | <span id="aa" class="slds-assistive-text">Loading</span> |
| | | <div class="slds-spinner__dot-a"></div> |
| | | <div class="slds-spinner__dot-b"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </aura:renderIf> |
| | | </aura:renderIf> |
| | | |
| | | <div aura:id="report" id="report" class="contents_wrapper"> |
| | | <div class="slds-grid slds-wrap slds-grid--pull-padded"> |
| | | <div class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12"> |
| | | <div |
| | | class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12" |
| | | > |
| | | 周 |
| | | </div> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"> |
| | | <ui:inputSelect aura:id="select_date" class="slds-select" change="{!c.select_date_change}"/> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12" |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_date" |
| | | class="slds-select" |
| | | change="{!c.select_date_change}" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- 代理店担当者 --> |
| | | <div class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12"> |
| | | <div |
| | | class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12" |
| | | > |
| | | {!v.fieldsmap.Person_In_Charge2__c} |
| | | </div> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"> |
| | | <ui:inputSelect aura:id="select_agency_person" class="slds-select agency_person_select" change="{!c.select_agency_change}"/> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12" |
| | | > |
| | | <ui:inputSelect |
| | | aura:id="select_agency_person" |
| | | class="slds-select agency_person_select" |
| | | change="{!c.select_agency_change}" |
| | | /> |
| | | </div> |
| | | <div class="tr slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"> |
| | | <ui:button aura:id="new_button" label="新建" press="{!c.new_report}" disabled="true"/> |
| | | <div |
| | | class="tr slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12" |
| | | > |
| | | <ui:button |
| | | aura:id="new_button" |
| | | label="新建" |
| | | press="{!c.new_report}" |
| | | disabled="true" |
| | | /> |
| | | </div> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"> |
| | | <ui:button aura:id="copy_button" label="复制" press="{!c.copy_button}" disabled="true"/> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12" |
| | | > |
| | | <ui:button |
| | | aura:id="copy_button" |
| | | label="复制" |
| | | press="{!c.copy_button}" |
| | | disabled="true" |
| | | /> |
| | | <!-- <ui:button aura:id="import" label="导入" press="{!c.import}" /> --> |
| | | <ui:button aura:id="import" label="导入" press="{!c.import}" /> |
| | | |
| | | <!-- <input type="file" class="file" aura:id="file" onchange="{!c.CreateRecord}" style="position:absolute;filter:alpha(opacity=0);" size="1" hidden="true" /> --> |
| | | <!-- <ui:button aura:id="import" label="导出" press="{!c.export}"/> --> |
| | | <ui:button aura:id="export" label="导出" press="{!c.export_condition}"/> |
| | | <ui:button |
| | | aura:id="export" |
| | | label="导出" |
| | | press="{!c.export_condition}" |
| | | /> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div aura:id="report_list" class="report_list_area"> |
| | | <div class="slds-table--edit_container slds-is-relative"> |
| | | <table class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus" role="grid" style="width:66.75rem;"> |
| | | <table |
| | | class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus" |
| | | role="grid" |
| | | style="width: 66.75rem" |
| | | > |
| | | <thead> |
| | | <tr class="slds-line-height--reset"> |
| | | <th class="table_header slds-text-title--caps"> |
| | | |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | style="width: 250px; font-size: 13px" |
| | | > |
| | | <span class="slds-truncate" title="Name" |
| | | >周报编号</span |
| | | > |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.Person_In_Charge2__c}</span> |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | style="width: 100px; font-size: 13px" |
| | | > |
| | | <span class="slds-truncate" title="Name" |
| | | >{!v.fieldsmap.Person_In_Charge2__c}</span |
| | | > |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | style="width: 250px; font-size: 13px" |
| | | > |
| | | <span class="slds-truncate" title="Name">医院</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.Department_Cateogy__c}</span> |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | style="width: 100px; font-size: 13px" |
| | | > |
| | | <span class="slds-truncate" title="Name" |
| | | >{!v.fieldsmap.Department_Cateogy__c}</span |
| | | > |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | style="width: 100px; font-size: 13px" |
| | | > |
| | | <!-- PIPL update Yin Mingjie 21/02/2022 start |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.doctor2__r}</span> |
| | | PIPL update Yin Mingjie 21/02/2022 end--> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.Agency_Contact__c}</span> |
| | | |
| | | <span |
| | | class="slds-truncate" |
| | | title="Name" |
| | | style="width: 100px; font-size: 13px" |
| | | >{!v.fieldsmap.Agency_Contact__c}</span |
| | | > |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.visitor_title__c}</span> |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | style="width: 100px; font-size: 13px" |
| | | > |
| | | <span class="slds-truncate" title="Name" |
| | | >{!v.fieldsmap.visitor_title__c}</span |
| | | > |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.Purpose_Type__c}</span> |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | style="width: 100px; font-size: 13px" |
| | | > |
| | | <span class="slds-truncate" title="Name" |
| | | >{!v.fieldsmap.Purpose_Type__c}</span |
| | | > |
| | | </th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <aura:iteration items="{!v.reports}" var="item" indexVar="index"> |
| | | <aura:iteration |
| | | items="{!v.reports}" |
| | | var="item" |
| | | indexVar="index" |
| | | > |
| | | <tr class="slds-hint-parent"> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <ui:inputRadio class="report_radio" name="report_radio" label="{!item.Name}" change="{!c.change_report_radio}"/> |
| | | <lightning:buttonIcon class="edit_button" iconName="utility:edit" size="small" alternativeText="edit" value="{!index}" onclick="{!c.edit_button}"/> |
| | | <ui:inputRadio |
| | | class="report_radio" |
| | | name="report_radio" |
| | | label="{!item.Name}" |
| | | change="{!c.change_report_radio}" |
| | | /> |
| | | <lightning:buttonIcon |
| | | class="edit_button" |
| | | iconName="utility:edit" |
| | | size="small" |
| | | alternativeText="edit" |
| | | value="{!index}" |
| | | onclick="{!c.edit_button}" |
| | | /> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.Person_In_Charge2__r.Name}"> |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.Person_In_Charge2__r.Name}" |
| | | > |
| | | {!item.Person_In_Charge2__r.Name} |
| | | <!-- <span class="decrypt">{!item.Person_In_Charge2__r.awsdata.lastName}</span> --> |
| | | </span> |
| | |
| | | </th> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.Department_Cateogy__c}">{!item.Department_Cateogy__c}</span> |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.Department_Cateogy__c}" |
| | | >{!item.Department_Cateogy__c}</span |
| | | > |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.doctor2__r.Name}"> |
| | | <span class="encrypt">{!item.doctor2__r.Name}</span> |
| | | <span class="decrypt">{!item.doctor2__r.awsdata.name}</span> |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.doctor2__r.Name}" |
| | | > |
| | | <span class="encrypt" |
| | | >{!item.doctor2__r.Name}</span |
| | | > |
| | | <span class="decrypt" |
| | | >{!item.doctor2__r.awsdata.name}</span |
| | | > |
| | | </span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.visitor_title__c}"> |
| | | <span class="encrypt">{!item.visitor_title__c}</span> |
| | | <span class="decrypt">{!item.doctor2__r.awsdata.doctorDivision1}</span> |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.visitor_title__c}" |
| | | > |
| | | <span class="encrypt" |
| | | >{!item.visitor_title__c}</span |
| | | > |
| | | <span class="decrypt" |
| | | >{!item.doctor2__r.awsdata.doctorDivision1}</span |
| | | > |
| | | </span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.Purpose_Type__c}">{!item.Purpose_Type__c}</span> |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.Purpose_Type__c}" |
| | | >{!item.Purpose_Type__c}</span |
| | | > |
| | | </span> |
| | | </td> |
| | | </tr> |
| | |
| | | </div> |
| | | <aura:renderIf isTrue="{!v.report_count > 0}"> |
| | | <aura:set attribute="else"> |
| | | <div class="no_data_area"> |
| | | {!v.list_message} |
| | | </div> |
| | | <div class="no_data_area">{!v.list_message}</div> |
| | | </aura:set> |
| | | </aura:renderIf> |
| | | </div> |
| | | |
| | | <!-- <ui:button aura:id="test_button" label="test" class="fade animation_on" press="{!c.test}"/>--> |
| | | <!-- 批量添加周报 start--> |
| | | <div aura:id="modal_import" role="dialog" tabindex="-1" class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget"> |
| | | <div |
| | | aura:id="modal_import" |
| | | role="dialog" |
| | | tabindex="-1" |
| | | class="disp_none slds-modal slds-fade-in-open slds-modal--large" |
| | | aria-labelledby="headerTarget" |
| | | > |
| | | <div class="slds-modal__container "> |
| | | <aura:renderIf isTrue="{!v.loginEdit}"> |
| | | <lightning:spinner |
| | | alternativeText="Loading" |
| | | size="medium" |
| | | style="width: 100%; height: 80%; top: 50px" |
| | | /> |
| | | </aura:renderIf> |
| | | <div class="slds-modal__header "> |
| | | <h4 id="headerTarget" class="slds-float--left"></h4> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium">周报批量导入</h2> |
| | | <ui:button aura:id="close_button" label="关闭" class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.close_import}"/> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium"> |
| | | 周报批量导入 |
| | | </h2> |
| | | <ui:button |
| | | aura:id="close_button" |
| | | label="关闭" |
| | | class="close_button slds-button slds-button--neutral slds-order--1" |
| | | press="{!c.close_import}" |
| | | /> |
| | | </div> |
| | | <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium " > |
| | | <div |
| | | class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium" |
| | | > |
| | | <aura:if isTrue="{!v.showMain}"> |
| | | <div> |
| | | <!-- <input type="file" class="file" aura:id="file" onchange="{!c.CreateRecord}" value="导入" /> --> |
| | | <lightning:input type="file" class="file" uara:id="file" onchange="{!c.CreateRecord}" /> |
| | | <lightning:input |
| | | type="file" |
| | | class="file" |
| | | uara:id="file" |
| | | onchange="{!c.CreateRecord}" |
| | | /> |
| | | <!-- <ui:button label="Create Accounts" press="{!c.CreateRecord}"/> --> |
| | | </div> |
| | | <aura:set attribute="else"> |
| | | <!-- <ui:outputRichText class="uiOutputRichText slds-m-around-large" value="{!v.TargetFileName}"/> --> |
| | | <ui:outputRichText class="uiOutputRichText slds-m--around-large" value="{!v.TableContent}"/> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button label="保存" variant="brand" onclick="{!c.processFileContent}" |
| | | <ui:outputRichText |
| | | class="uiOutputRichText slds-m--around-large" |
| | | value="{!v.TableContent}" |
| | | /> |
| | | <lightning:button label="取消" variant="brand" |
| | | onclick="{!c.cancel}" /> |
| | | <div |
| | | class="slds-p-around--large slds-align--absolute-center" |
| | | > |
| | | <lightning:button |
| | | label="保存" |
| | | variant="brand" |
| | | onclick="{!c.processFileContent}" |
| | | /> |
| | | <lightning:button |
| | | label="取消" |
| | | variant="brand" |
| | | onclick="{!c.cancel}" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- start DTT-zhj 增加错误信息table 2023-05-16--> |
| | | <aura:if isTrue="{!v.showErrorInfo}"> |
| | | <div |
| | | class="slds-p-around--large slds-align--absolute-center" |
| | | > |
| | | <lightning:button |
| | | label="导出错误信息" |
| | | variant="brand" |
| | | onclick="{!c.exportErrorInfo}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-p-around--large slds-align--absolute-center" |
| | | > |
| | | <div style="height: 300px; overflow-x: scroll"> |
| | | <lightning:datatable |
| | | keyField="id" |
| | | data="{! v.errorData }" |
| | | columns="{! v.errorColumns }" |
| | | hideCheckboxColumn="true" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </aura:if> |
| | | <!-- start DTT-zhj 增加错误信息table 2023-05-16--> |
| | | </aura:set> |
| | | </aura:if> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div aura:id="modal_importbg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | <div |
| | | aura:id="modal_importbg" |
| | | class="disp_none slds-backdrop slds-backdrop--open" |
| | | ></div> |
| | | <!-- 批量添加周报 end--> |
| | | |
| | | <!-- 批量导出周报 start--> |
| | | <div aura:id="modal_export" role="dialog" tabindex="-1" class="disp_none slds-modal slds-fade-in-open slds-modal--large" > |
| | | <div |
| | | aura:id="modal_export" |
| | | role="dialog" |
| | | tabindex="-1" |
| | | class="disp_none slds-modal slds-fade-in-open slds-modal--large" |
| | | > |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal__header"> |
| | | <h4 id="headerTarget" class="slds-float--left"></h4> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium">周报批量导出</h2> |
| | | <ui:button aura:id="close_button" label="关闭" class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.close_export}"/> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium"> |
| | | 周报批量导出 |
| | | </h2> |
| | | <ui:button |
| | | aura:id="close_button" |
| | | label="关闭" |
| | | class="close_button slds-button slds-button--neutral slds-order--1" |
| | | press="{!c.close_export}" |
| | | /> |
| | | </div> |
| | | <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium"> |
| | | <div |
| | | class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium" |
| | | > |
| | | <aura:if isTrue="{!v.showMain}"> |
| | | <div class="slds-grid slds-wrap slds-grid--pull-padded" > |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"> |
| | | </div> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4" |
| | | ></div> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4" |
| | | > |
| | | 活动日开始日期 |
| | | |
| | | <lightning:input type="Date" class="slds-input slds-input_bare " aura:id="input-report-date1" /> |
| | | </div> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"> |
| | | 活动日结束日期 |
| | | <lightning:input type="Date" class="slds-input slds-input_bare " aura:id="input-report-date2" /> |
| | | </div> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"> |
| | | </div> |
| | | |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button label="确认" variant="brand" onclick="{!c.select_repores_date}" |
| | | <lightning:input |
| | | type="Date" |
| | | class="slds-input slds-input_bare" |
| | | aura:id="input-report-date1" |
| | | /> |
| | | <lightning:button label="取消" variant="brand" |
| | | onclick="{!c.close_export}" /> |
| | | </div> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4" |
| | | > |
| | | 活动日结束日期 |
| | | <lightning:input |
| | | type="Date" |
| | | class="slds-input slds-input_bare" |
| | | aura:id="input-report-date2" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4" |
| | | ></div> |
| | | |
| | | <div |
| | | class="slds-p-around--large slds-align--absolute-center" |
| | | > |
| | | <lightning:button |
| | | label="确认" |
| | | variant="brand" |
| | | onclick="{!c.select_repores_date}" |
| | | /> |
| | | <lightning:button |
| | | label="取消" |
| | | variant="brand" |
| | | onclick="{!c.close_export}" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <!-- <div> |
| | |
| | | onclick="{!c.close_export}" /> |
| | | </div> --> |
| | | <aura:set attribute="else"> |
| | | <ui:outputRichText class="uiOutputRichText slds-m--around-large" value="{!v.TableContent2}"/> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button label="确认" variant="brand" onclick="{!c.exportDate}" |
| | | <ui:outputRichText |
| | | class="uiOutputRichText slds-m--around-large" |
| | | value="{!v.TableContent2}" |
| | | /> |
| | | <lightning:button label="取消" variant="brand" |
| | | onclick="{!c.close_export}" /> |
| | | <div |
| | | class="slds-p-around--large slds-align--absolute-center" |
| | | > |
| | | <lightning:button |
| | | label="确认" |
| | | variant="brand" |
| | | onclick="{!c.exportDate}" |
| | | /> |
| | | <lightning:button |
| | | label="取消" |
| | | variant="brand" |
| | | onclick="{!c.close_export}" |
| | | /> |
| | | </div> |
| | | |
| | | </aura:set> |
| | | </aura:if> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div aura:id="modal_exportbg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | <div |
| | | aura:id="modal_exportbg" |
| | | class="disp_none slds-backdrop slds-backdrop--open" |
| | | ></div> |
| | | <!-- 批量导出周报 end--> |
| | | |
| | | <div aura:id="modal_window" role="dialog" tabindex="-1" class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget"> |
| | | <div |
| | | aura:id="modal_window" |
| | | role="dialog" |
| | | tabindex="-1" |
| | | class="disp_none slds-modal slds-fade-in-open slds-modal--large" |
| | | aria-labelledby="headerTarget" |
| | | > |
| | | <div class="slds-modal__container"> |
| | | <aura:renderIf isTrue="{!v.loginEdit}"> |
| | | <lightning:spinner |
| | | alternativeText="Loading" |
| | | size="medium" |
| | | style="width: 100%; height: 80%; top: 50px" |
| | | /> |
| | | </aura:renderIf> |
| | | <div class="slds-modal__header"> |
| | | <h4 id="headerTarget" class="slds-float--left">{!v.dialog_type}</h4> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium">周报({!v.selected_date} {!v.selected_agency_person})</h2> |
| | | <ui:button aura:id="close_button" label="关闭" class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.toggle_report}"/> |
| | | <h4 id="headerTarget" class="slds-float--left"></h4> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium"> |
| | | 周报({!v.selected_date} {!v.selected_agency_person}) |
| | | </h2> |
| | | <ui:button |
| | | aura:id="close_button" |
| | | label="关闭" |
| | | class="close_button slds-button slds-button--neutral slds-order--1" |
| | | press="{!c.toggle_report}" |
| | | /> |
| | | </div> |
| | | <div class="slds-modal__content slds-grow slds-p-around--medium"> |
| | | <div class="slds-box slds-theme--shade"> |
| | | <div class="slds-grid slds-wrap slds-grid--pull-padded" > |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6 marginTop" |
| | | > |
| | | 活动日 |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> --> |
| | | <force:inputField value="{!v.data.Report_Date__c}" aura:id="input-report-date"/> |
| | | <!-- <force:inputField value="{!v.data.Report_Date__c}" aura:id="input-report-date"/> --> |
| | | <lightning:input |
| | | type="date" |
| | | value="{!v.data.Report_Date__c}" |
| | | aura:id="input-report-date" |
| | | variant="label-hidden" |
| | | /> |
| | | </div> |
| | | <!-- 医院 --> |
| | | <div aura:id="hospital_list" class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5" data-select="single"> |
| | | <ui:inputText aura:id="hospital_input_text" label="医院" class="field" value="{!v.hospital}" updateOn="keyup"/> |
| | | <div |
| | | aura:id="hospital_list" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5 marginTop" |
| | | data-select="single" |
| | | > |
| | | <!-- <ui:inputText aura:id="hospital_input_text" label="医院" class="field" value="{!v.hospital}" updateOn="keyup"/> --> |
| | | 医院 |
| | | <lightning:input |
| | | aura:id="hospital_input_text" |
| | | class="field" |
| | | value="{!v.hospital}" |
| | | variant="label-hidden" |
| | | updateOn="keyup" |
| | | /> |
| | | <div class="slds-lookup__menu" id="lookup-66"> |
| | | <ul class="slds-lookup__list" role="listbox"> |
| | | <aura:iteration var="hospital" items="{!v.hospitalList}"> |
| | | <li role="presentation" onclick="{!c.selectHos}" data-accName="{!hospital.Hospital_Name_readonly__c}" data-accId="{!hospital.Hospital__c}"> |
| | | <span class="slds-lookup__item-action slds-media" id="lookup-option-498" role="option"> |
| | | <aura:iteration |
| | | var="hospital" |
| | | items="{!v.hospitalList}" |
| | | > |
| | | <li |
| | | role="presentation" |
| | | onclick="{!c.selectHos}" |
| | | data-accName="{!hospital.Hospital_Name_readonly__c}" |
| | | data-accId="{!hospital.Hospital__c}" |
| | | > |
| | | <span |
| | | class="slds-lookup__item-action slds-media" |
| | | id="lookup-option-498" |
| | | role="option" |
| | | > |
| | | <div class="slds-media__body"> |
| | | <div class="slds-lookup__result-text">{!hospital.Hospital_Name_readonly__c}</div> |
| | | <div |
| | | class="slds-lookup__result-text" |
| | | > |
| | | {!hospital.Hospital_Name_readonly__c} |
| | | </div> |
| | | </div> |
| | | </span> |
| | | </li> |
| | |
| | | </div> |
| | | |
| | | <!-- 科室分类 --> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8"> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8 marginTop" |
| | | > |
| | | {!v.fieldsmap.Department_Cateogy__c} |
| | | <ui:inputSelect aura:id="select_department" class="slds-select" change="{!c.select_department}"/> |
| | | <ui:inputSelect |
| | | aura:id="select_department" |
| | | class="slds-select" |
| | | change="{!c.select_department}" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- 先生 --> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8"> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8 marginTop" |
| | | > |
| | | {!v.fieldsmap.doctor2__c} |
| | | <ui:inputSelect aura:id="select_doctor" class="slds-select" change="{!c.doctor_change}"/> |
| | | <ui:inputSelect |
| | | aura:id="select_doctor" |
| | | class="slds-select" |
| | | change="{!c.doctor_change}" |
| | | /> |
| | | </div> |
| | | |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-12"> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-12 marginTop" |
| | | > |
| | | <br/> |
| | | <ui:button label="新建" class="slds-button" press="{!c.createCon}" disabled="true" aura:id="new_con"/> |
| | | <ui:button |
| | | label="新建" |
| | | class="slds-button" |
| | | press="{!c.createCon}" |
| | | disabled="true" |
| | | aura:id="new_con" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- 职位 --> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8"> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8 marginTop" |
| | | > |
| | | {!v.fieldsmap.visitor_title__c} |
| | | <div>{!v.doctor_title}</div> |
| | | </div> |
| | | <!-- 活动区分 --> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6 marginTop" |
| | | > |
| | | {!v.fieldsmap.Purpose_Type__c} |
| | | <ui:inputSelect aura:id="select_purpose_type" class="slds-select" change="{!c.select_purpose_type}"/> |
| | | <ui:inputSelect |
| | | aura:id="select_purpose_type" |
| | | class="slds-select" |
| | | change="{!c.select_purpose_type}" |
| | | /> |
| | | </div> |
| | | <!-- 询价 --> |
| | | <div aura:id="input-opportunity-opp" class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--4-of-12 slds-large-size--4-of-12"> |
| | | <div |
| | | aura:id="input-opportunity-opp" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--4-of-12 slds-large-size--4-of-12 marginTop" |
| | | > |
| | | {!v.fieldsmap.Opportunity__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> --> |
| | | <!-- <force:inputField value="{!v.data.Opportunity__c}" aura:id="input-opportunity"/> --> |
| | | <c:strike_lookup label="" |
| | | <c:strike_lookup |
| | | label="" |
| | | object="Agency_Opportunity__c" |
| | | searchField="Name" |
| | | placeholder="搜索经销商询价..." |
| | |
| | | showRecentRecords ="true" |
| | | value="{!v.data.Opportunity__c}" |
| | | filter="{!v.opportunity_cfilter}" |
| | | subTitleFormat="{0}+{1}+{2}"/> |
| | | subTitleFormat="{0}+{1}+{2}" |
| | | /> |
| | | </div> |
| | | <div aura:id="input-opportunity-blank" class="lds-p-horizontal--small slds-size--1-of-1 slds-medium-size--8-of-12 slds-large-size--8-of-12"> |
| | | </div> |
| | | <div aura:id="input-opportunity-stage" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"> |
| | | <div |
| | | aura:id="input-opportunity-blank" |
| | | class="lds-p-horizontal--small slds-size--1-of-1 slds-medium-size--8-of-12 slds-large-size--8-of-12 marginTop" |
| | | ></div> |
| | | <div |
| | | aura:id="input-opportunity-stage" |
| | | class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12 marginTop" |
| | | > |
| | | {!v.fieldsmap.StageName__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> --> |
| | | <ui:inputSelect aura:id="select_stageName" class="slds-select"/> |
| | | <ui:inputSelect |
| | | aura:id="select_stageName" |
| | | class="slds-select" |
| | | /> |
| | | <!-- <force:inputField value="{!v.oppdata.StageName__c}" aura:id="input-oppstage" /> --> |
| | | </div> |
| | | <div aura:id="input-opportunity-amount1" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"> |
| | | <div |
| | | aura:id="input-opportunity-amount1" |
| | | class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12 marginTop" |
| | | > |
| | | {!v.fieldsmap.Amount__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> --> |
| | | <force:inputField value="{!v.oppdata.Amount__c}" class=""/> |
| | | <force:inputField |
| | | value="{!v.oppdata.Amount__c}" |
| | | class="" |
| | | /> |
| | | </div> |
| | | <div aura:id="input-opportunity-amount2" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"> |
| | | <div |
| | | aura:id="input-opportunity-amount2" |
| | | class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12 marginTop" |
| | | > |
| | | {!v.fieldsmap.OCMSale_Price__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> --> |
| | | <force:inputField value="{!v.oppdata.OCMSale_Price__c}" class=""/> |
| | | <force:inputField |
| | | value="{!v.oppdata.OCMSale_Price__c}" |
| | | class="" |
| | | /> |
| | | </div> |
| | | <div aura:id="input-opportunity-date" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"> |
| | | <div |
| | | aura:id="input-opportunity-date" |
| | | class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12 marginTop" |
| | | > |
| | | {!v.fieldsmap.Close_Forecasted_Date__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> --> |
| | | <force:inputField value="{!v.oppdata.Close_Forecasted_Date__c}" class=""/> |
| | | <force:inputField |
| | | value="{!v.oppdata.Close_Forecasted_Date__c}" |
| | | class="" |
| | | /> |
| | | </div> |
| | | <!-- 製品分類 --> |
| | | <div aura:id="product_category_select1" class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"> |
| | | <div |
| | | aura:id="product_category_select1" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 marginTop" |
| | | > |
| | | {!v.fieldsmap.Product_Category1__c} |
| | | <!-- <force:inputField value="{!v.data.Product_Category1__c}" aura:id="input-product-category1"/> --> |
| | | <ui:inputSelect aura:id="select_Product1" class="slds-select" change="{!c.productcategoryChange1}"/> |
| | | <ui:inputSelect |
| | | aura:id="select_Product1" |
| | | class="slds-select" |
| | | change="{!c.productcategoryChange1}" |
| | | /> |
| | | </div> |
| | | <div aura:id="product_category_select2" class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"> |
| | | <div |
| | | aura:id="product_category_select2" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 marginTop" |
| | | > |
| | | {!v.fieldsmap.Product_Category2__c} |
| | | <!-- <force:inputField value="{!v.data.Product_Category2__c}" aura:id="input-product-category2"/> --> |
| | | <ui:inputSelect aura:id="select_Product2" class="slds-select" change="{!c.productcategoryChange2}"/> |
| | | <ui:inputSelect |
| | | aura:id="select_Product2" |
| | | class="slds-select" |
| | | change="{!c.productcategoryChange2}" |
| | | /> |
| | | </div> |
| | | <div aura:id="product_category_select3" class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"> |
| | | <div |
| | | aura:id="product_category_select3" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 marginTop" |
| | | > |
| | | {!v.fieldsmap.Product_Category3__c} |
| | | <!-- <force:inputField value="{!v.data.Product_Category3__c}" aura:id="input-product-category3"/> --> |
| | | <ui:inputSelect aura:id="select_Product3" class="slds-select" change="{!c.productcategoryChange3}"/> |
| | | <ui:inputSelect |
| | | aura:id="select_Product3" |
| | | class="slds-select" |
| | | change="{!c.productcategoryChange3}" |
| | | /> |
| | | </div> |
| | | <!--SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start--> |
| | | <!-- 支援需求 change="{!c.SupportNeeds__c}"--> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6 marginTop" |
| | | > |
| | | {!v.fieldsmap.SupportNeeds__c} |
| | | <ui:inputSelect aura:id="SupportNeeds__c" class="slds-select" /> |
| | | <ui:inputSelect |
| | | aura:id="SupportNeeds__c" |
| | | class="slds-select" |
| | | /> |
| | | </div> |
| | | <!--SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end--> |
| | | <div aura:id="result" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"> |
| | | <div |
| | | aura:id="result" |
| | | class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 marginTop" |
| | | > |
| | | {!v.fieldsmap.Result__c} |
| | | <ui:inputSelect aura:id="select_result" class="slds-select"/> |
| | | <ui:inputSelect |
| | | aura:id="select_result" |
| | | class="slds-select" |
| | | /> |
| | | <!-- <ui:inputText label="结果" class="bcolor" value="{!v.result}"/> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="save_button_area"> |
| | | <ui:button aura:id="save_button" label="保存并新建" class="save_button slds-button slds-button--brand slds-order--3" press="{!c.save_report}"/> |
| | | <ui:button |
| | | aura:id="save_button" |
| | | label="保存并新建" |
| | | class="save_button slds-button slds-button--brand slds-order--3" |
| | | press="{!c.save_report}" |
| | | /> |
| | | </div> |
| | | |
| | | <aura:renderIf isTrue="{!v.reports_now_count > 0}"> |
| | | <div class="mt40 slds-box slds-theme--shade"> |
| | | <div class="slds-table--edit_container slds-is-relative"> |
| | | <table class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus" role="grid"> |
| | | <div |
| | | class="slds-table--edit_container slds-is-relative" |
| | | > |
| | | <table |
| | | class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus" |
| | | role="grid" |
| | | > |
| | | <thead> |
| | | <tr class="slds-line-height--reset"> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name"></span> |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="Name" |
| | | ></span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">医院</span> |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="Name" |
| | | >医院</span |
| | | > |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.Department_Cateogy__c}</span> |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="Name" |
| | | >{!v.fieldsmap.Department_Cateogy__c}</span |
| | | > |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.doctor2__c}</span> |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="Name" |
| | | >{!v.fieldsmap.doctor2__c}</span |
| | | > |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.visitor_title__c}</span> |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="Name" |
| | | >{!v.fieldsmap.visitor_title__c}</span |
| | | > |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.Purpose_Type__c}</span> |
| | | <th |
| | | class="table_header slds-text-title--caps" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="Name" |
| | | >{!v.fieldsmap.Purpose_Type__c}</span |
| | | > |
| | | </th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <aura:iteration items="{!v.reports_now}" var="item" indexVar="index"> |
| | | <tr aura:id="modal_data_list_tr" class="slds-hint-parent"> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.Department_Cateogy__c}">{!item.Name}</span> |
| | | <aura:iteration |
| | | items="{!v.reports_now}" |
| | | var="item" |
| | | indexVar="index" |
| | | > |
| | | <tr |
| | | aura:id="modal_data_list_tr" |
| | | class="slds-hint-parent" |
| | | > |
| | | <td |
| | | role="gridcell" |
| | | class="slds-cell-edit" |
| | | > |
| | | <span |
| | | class="slds-grid slds-grid--align-spread" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.Department_Cateogy__c}" |
| | | >{!item.Name}</span |
| | | > |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.Agency_Hospital__r.Name}">{!item.Agency_Hospital__r.Name}</span> |
| | | <td |
| | | role="gridcell" |
| | | class="slds-cell-edit" |
| | | > |
| | | <span |
| | | class="slds-grid slds-grid--align-spread" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.Agency_Hospital__r.Name}" |
| | | >{!item.Agency_Hospital__r.Name}</span |
| | | > |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.Department_Cateogy__c}">{!item.Department_Cateogy__c}</span> |
| | | <td |
| | | role="gridcell" |
| | | class="slds-cell-edit" |
| | | > |
| | | <span |
| | | class="slds-grid slds-grid--align-spread" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.Department_Cateogy__c}" |
| | | >{!item.Department_Cateogy__c}</span |
| | | > |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.doctor2__r.Name}"> |
| | | <span class="encrypt">{!item.doctor2__r.Name}</span> |
| | | <span class="decrypt">{!item.doctor2NameOrigin}</span> |
| | | <td |
| | | role="gridcell" |
| | | class="slds-cell-edit" |
| | | > |
| | | <span |
| | | class="slds-grid slds-grid--align-spread" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.doctor2__r.Name}" |
| | | > |
| | | <span class="encrypt" |
| | | >{!item.doctor2__r.Name}</span |
| | | > |
| | | <span class="decrypt" |
| | | >{!item.doctor2NameOrigin}</span |
| | | > |
| | | </span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.visitor_title__c}"> |
| | | <span class="encrypt">{!item.visitor_title__c}</span> |
| | | <span class="decrypt">{!item.visitorTitleOrigin}</span> |
| | | <td |
| | | role="gridcell" |
| | | class="slds-cell-edit" |
| | | > |
| | | <span |
| | | class="slds-grid slds-grid--align-spread" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.visitor_title__c}" |
| | | > |
| | | <span class="encrypt" |
| | | >{!item.visitor_title__c}</span |
| | | > |
| | | <span class="decrypt" |
| | | >{!item.visitorTitleOrigin}</span |
| | | > |
| | | </span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.Purpose_Type__c}">{!item.Purpose_Type__c}</span> |
| | | <td |
| | | role="gridcell" |
| | | class="slds-cell-edit" |
| | | > |
| | | <span |
| | | class="slds-grid slds-grid--align-spread" |
| | | > |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.Purpose_Type__c}" |
| | | >{!item.Purpose_Type__c}</span |
| | | > |
| | | </span> |
| | | </td> |
| | | </tr> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div aura:id="modal_bg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | <div |
| | | aura:id="modal_bg" |
| | | class="disp_none slds-backdrop slds-backdrop--open" |
| | | ></div> |
| | | |
| | | <div aura:id="modal_confirm" role="dialog" tabindex="-2" aria-labelledby="header43" class="disp_none slds-modal slds-fade-in-open"> |
| | | <div |
| | | aura:id="modal_confirm" |
| | | role="dialog" |
| | | tabindex="-2" |
| | | aria-labelledby="header43" |
| | | class="disp_none slds-modal slds-fade-in-open" |
| | | > |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal__header"> |
| | | <h2 id="header43" class="slds-text-heading--medium">{!v.modal_confirm_title}</h2> |
| | | <h2 id="header43" class="slds-text-heading--medium"> |
| | | {!v.modal_confirm_title} |
| | | </h2> |
| | | </div> |
| | | <div class="slds-modal__content slds-p-around--medium"> |
| | | <p>{!v.modal_confirm_text}</p> |
| | | </div> |
| | | <div class="slds-modal__footer"> |
| | | <ui:button label="是" class="slds-button slds-button--brand" press="{!c.yes_button}"/> |
| | | <ui:button label="否" class="slds-button slds-button--neutral" press="{!c.no_button}" /> |
| | | <ui:button |
| | | label="是" |
| | | class="slds-button slds-button--brand" |
| | | press="{!c.yes_button}" |
| | | /> |
| | | <ui:button |
| | | label="否" |
| | | class="slds-button slds-button--neutral" |
| | | press="{!c.no_button}" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div aura:id="modal_confirm_bg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | <div |
| | | aura:id="modal_confirm_bg" |
| | | class="disp_none slds-backdrop slds-backdrop--open" |
| | | ></div> |
| | | |
| | | <div aura:id="modal_newAC" role="dialog" tabindex="-3" aria-labelledby="headertest" class="disp_none slds-modal slds-fade-in-open"> |
| | | <div |
| | | aura:id="modal_newAC" |
| | | role="dialog" |
| | | tabindex="-3" |
| | | aria-labelledby="headertest" |
| | | class="disp_none slds-modal slds-fade-in-open" |
| | | > |
| | | <div class="slds-modal__container"> |
| | | <aura:renderIf isTrue="{!v.loginEdit}"> |
| | | <lightning:spinner |
| | | alternativeText="Loading" |
| | | size="medium" |
| | | style="width: 100%; height: 80%; top: 50px" |
| | | /> |
| | | </aura:renderIf> |
| | | <div class="slds-modal__header"> |
| | | <h2 id="headertest" class="slds-text-heading--medium">新建.客户人员</h2> |
| | | <h2 id="headertest" class="slds-text-heading--medium"> |
| | | 新建.客户人员 |
| | | </h2> |
| | | </div> |
| | | <div class="slds-modal__content slds-p-around--medium"> |
| | | <lightning:recordEditForm aura:id="recordEditForm" objectApiName="Agency_Contact__c" onsuccess="{!c.handleSuccess}" onload="{!c.showRequiredFields}" onsubmit="{!c.handleSubmit}"> |
| | | <lightning:recordEditForm |
| | | aura:id="recordEditForm" |
| | | objectApiName="Agency_Contact__c" |
| | | onsuccess="{!c.handleSuccess}" |
| | | onload="{!c.showRequiredFields}" |
| | | onsubmit="{!c.handleSubmit}" |
| | | > |
| | | <lightning:messages aura:id="OppMessage" /> |
| | | <!-- onload="{!c.showRequiredFields}" --> |
| | | <aura:renderIf isTrue="{!v.truthy}"> |
| | | <lightning:inputField fieldName="Name" aura:id="newOpportunityField" /> |
| | | <lightning:inputField fieldName="Type__c" aura:id="newOpportunityField" /> |
| | | <lightning:inputField fieldName="Doctor_Division1__c" aura:id="newOpportunityField" /> |
| | | <lightning:inputField |
| | | fieldName="Name" |
| | | aura:id="newOpportunityField" |
| | | /> |
| | | <lightning:inputField |
| | | fieldName="Type__c" |
| | | aura:id="newOpportunityField" |
| | | /> |
| | | <lightning:inputField |
| | | fieldName="Doctor_Division1__c" |
| | | aura:id="newOpportunityField" |
| | | /> |
| | | <!-- <lightning:inputField class="customRequired none" aura:id="Input_type__c" fieldName="Type__c"/> |
| | | <lightning:inputField class="customRequired none" aura:id="Input_Doctor_Division1__c" fieldName="Doctor_Division1__c"/> --> |
| | | </aura:renderIf> |
| | |
| | | <br/> |
| | | <br/> |
| | | <div class="save_button_area"> |
| | | <lightning:button class="slds-m-top_small" type="button" label="取消" onclick="{!c.createCancel}"/> |
| | | <lightning:button class="slds-m-top_small" type="submit" label="保存" /> |
| | | <lightning:button |
| | | class="slds-m-top_small" |
| | | type="button" |
| | | label="取消" |
| | | onclick="{!c.createCancel}" |
| | | /> |
| | | <lightning:button |
| | | class="slds-m-top_small" |
| | | type="submit" |
| | | label="新建" |
| | | /> |
| | | </div> |
| | | </lightning:recordEditForm> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </aura:component> |
| | |
| | | .THIS.height100vh { |
| | | height: 100vh; |
| | | } |
| | | .THIS.contents_wrapper { |
| | | /* .THIS.contents_wrapper { |
| | | padding-top: 50px; |
| | | } |
| | | width: 105%; |
| | | } */ |
| | | .THIS .mt5 { |
| | | margin-top: 5px; |
| | | } |
| | |
| | | } |
| | | .THIS .no_data_area { |
| | | text-align: center; |
| | | margin: .5em 0; |
| | | margin: 0.5em 0; |
| | | } |
| | | .THIS.report_list_area { |
| | | margin: 40px 0 20px 100px; |
| | | margin: 40px 0 20px 0px; |
| | | height: 60vh; |
| | | overflow-y: scroll; |
| | | } |
| | |
| | | display: none; |
| | | } |
| | | |
| | | .THIS .slds-input:focus, .THIS .slds-input:active { |
| | | .THIS .slds-input:focus, |
| | | .THIS .slds-input:active { |
| | | border-color: rgb(216, 221, 230); |
| | | box-shadow: none; |
| | | } |
| | |
| | | font-weight: 400; |
| | | } |
| | | .THIS .customRequired:before{ |
| | | content: "*"; |
| | | content: '*'; |
| | | margin: 0 0.125rem 0 0.125rem; |
| | | color: rgb(194, 57, 52); |
| | | float: left; |
| | |
| | | .THIS tr:hover .encrypt{ |
| | | display: none; |
| | | } |
| | | |
| | | /* add by Deloitte-Link 2023-6-19 start*/ |
| | | .THIS .weeklyReportSpinner { |
| | | top: 100px; |
| | | } |
| | | |
| | | .THIS .weeklyReportSpinnerEdit { |
| | | top: 50px; |
| | | } |
| | | |
| | | .THIS .slds-spinner_container { |
| | | position: absolute; |
| | | top: 100px; |
| | | } |
| | | |
| | | .THIS .slds-spinner_containerEdit { |
| | | position: absolute; |
| | | top: 50px; |
| | | } |
| | | |
| | | .THIS .marginTop { |
| | | margin-top: 10px; |
| | | } |
| | | .THIS .custom-input .uiInput { |
| | | height: 2rem; |
| | | } |
| | | /* add by Deloitte-Link 2023-6-19 end*/ |
| | |
| | | ({ |
| | | doInit : function(component, event, helper) { |
| | | console.log('zhj 新方案'); |
| | | if (window.location.href.endsWith("weekly-report")) { |
| | | console.log('zhj 新方案weeklyReport'); |
| | | if (window.location.href.endsWith('weekly-report')) { |
| | | helper.doinit(component, event, helper); |
| | | } else { |
| | | helper.hideCmp(component, event, helper); |
| | | } |
| | | component.set('v.showErrorInfo', false); |
| | | }, |
| | | |
| | | createAopp : function(component, event, helper) { |
| | |
| | | recordTypeId: '012100000006KW7' |
| | | }); |
| | | addRecordEvent.fire(); |
| | | component.set('v.showErrorInfo', false); |
| | | }, |
| | | |
| | | new_report : function(component, event, helper) { |
| | | component.find('save_button').set('v.label', '保存并新建'); |
| | | component.set('v.data.Report_Date__c', ''); |
| | | helper.new_report(component, event, helper); |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | showRequiredFields: function(component, event, helper){ |
| | | $A.util.removeClass(component.find("newOpportunityField"), "none"); |
| | | $A.util.removeClass(component.find("newOpportunityField"), "none"); |
| | | $A.util.removeClass(component.find('newOpportunityField'), 'none'); |
| | | $A.util.removeClass(component.find('newOpportunityField'), 'none'); |
| | | }, |
| | | |
| | | handleSuccess : function(component, event, helper) { |
| | |
| | | // vivek 添加验证 start |
| | | // helper.handleFormSubmit(component); |
| | | var showValidationError = false; |
| | | var fields = component.find("newOpportunityField"); |
| | | var fields = component.find('newOpportunityField'); |
| | | var vaildationFailReason = ''; |
| | | // var vaildationFailReason2 = ''; |
| | | // var currentDate = new Date().toJSON().slice(0,10); |
| | |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | |
| | | fields.forEach(function (field) { |
| | | if(field.get("v.fieldName") === 'Type__c' && $A.util.isEmpty(field.get("v.value"))){ |
| | | if ( |
| | | field.get('v.fieldName') === 'Type__c' && |
| | | $A.util.isEmpty(field.get('v.value')) |
| | | ) { |
| | | showValidationError = true; |
| | | vaildationFailReason = "分类不能为空!"; |
| | | }else if(field.get("v.fieldName") === 'Doctor_Division1__c' && $A.util.isEmpty(field.get("v.value"))){ |
| | | vaildationFailReason = '分类不能为空!'; |
| | | } else if ( |
| | | field.get('v.fieldName') === 'Doctor_Division1__c' && |
| | | $A.util.isEmpty(field.get('v.value')) |
| | | ) { |
| | | showValidationError = true; |
| | | if(vaildationFailReason != ''){ |
| | | vaildationFailReason += "医生区分(职务)不能为空!"; |
| | | vaildationFailReason += '医生区分(职务)不能为空!'; |
| | | }else{ |
| | | vaildationFailReason = "医生区分(职务)不能为空!"; |
| | | vaildationFailReason = '医生区分(职务)不能为空!'; |
| | | } |
| | | |
| | | } |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | if(field.get("v.fieldName") === 'Name'){ |
| | | agencyReport['name'] = field.get("v.value"); |
| | | }else if(field.get("v.fieldName") === 'Type__c'){ |
| | | agencyReport['type'] = field.get("v.value"); |
| | | }else if(field.get("v.fieldName") === 'Doctor_Division1__c'){ |
| | | agencyReport['doctorDivision1'] = field.get("v.value"); |
| | | if (field.get('v.fieldName') === 'Name') { |
| | | agencyReport['name'] = field.get('v.value'); |
| | | } else if (field.get('v.fieldName') === 'Type__c') { |
| | | agencyReport['type'] = field.get('v.value'); |
| | | } else if (field.get('v.fieldName') === 'Doctor_Division1__c') { |
| | | agencyReport['doctorDivision1'] = field.get('v.value'); |
| | | } |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | }); |
| | |
| | | |
| | | var agencyHospitalid = component.get('v.hospitalLinkId'); |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | debugger |
| | | debugger; |
| | | let hospitalName = ''; |
| | | //调用后端searchAgencyDataId方法查询出医院下面所有客户人员dataid |
| | | helper.CallBackAction(component,'searchAgencyDataId',{ |
| | | helper.CallBackAction( |
| | | component, |
| | | 'searchAgencyDataId', |
| | | { |
| | | hospitalId : agencyHospitalid |
| | | },function(data){ |
| | | if(data.getState() == "SUCCESS"){ |
| | | }, |
| | | function (data) { |
| | | if (data.getState() == 'SUCCESS') { |
| | | var data = data.getReturnValue(); |
| | | if(data.IsSuccess == true){ |
| | | let agencyContactIds = '' |
| | | if(data.Message == '' && data.Data && data.Data.length > 0){ |
| | | hospitalName = data.Data[0].Agency_Hospital__r.Name; |
| | | let agencyContactIds = ''; |
| | | if ( |
| | | data.Message == '' && |
| | | data.Data && |
| | | data.Data.length > 0 |
| | | ) { |
| | | hospitalName = |
| | | data.Data[0].Agency_Hospital__r.Name; |
| | | for(var i=0;i<data.Data.length;i++){ |
| | | if(data.Data[i].AWS_Data_Id__c) |
| | | agencyContactIds += ','+data.Data[i].AWS_Data_Id__c; |
| | | agencyContactIds += |
| | | ',' + data.Data[i].AWS_Data_Id__c; |
| | | } |
| | | agencyContactIds = agencyContactIds.substring(1); |
| | | agencyReport['agencyContactIds'] = agencyContactIds; |
| | | agencyContactIds = |
| | | agencyContactIds.substring(1); |
| | | agencyReport['agencyContactIds'] = |
| | | agencyContactIds; |
| | | }else{ |
| | | agencyReport['agencyContactIds'] = agencyContactIds; |
| | | agencyReport['agencyContactIds'] = |
| | | agencyContactIds; |
| | | } |
| | | var arr = new Array(); |
| | | arr.push(agencyReport); |
| | |
| | | var token = component.get('v.AWStoken'); |
| | | var newUrl = component.get('v.AWSinsert') + 'V2'; |
| | | |
| | | component.set('v.login',true); |
| | | helper.insert_agencycontact(component,token,newUrl,requestData,agencyHospitalid,helper,hospitalName); |
| | | component.set('v.loginEdit', true); |
| | | helper.insert_agencycontact( |
| | | component, |
| | | token, |
| | | newUrl, |
| | | requestData, |
| | | agencyHospitalid, |
| | | helper, |
| | | hospitalName |
| | | ); |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : data.message, |
| | | "type" : "error" |
| | | message: data.message, |
| | | type: 'error' |
| | | }); |
| | | } |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : 'searchAgency失败', |
| | | "type" : "error" |
| | | message: 'searchAgency失败', |
| | | type: 'error' |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | ); |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | // var arr = new Array(); |
| | | // arr.push(agencyReport); |
| | |
| | | |
| | | yes_button : function(component, event, helper) { |
| | | component.set('v.confirm_status', 1); |
| | | helper.close_confirm(component, component.get('v.modal_confirm_title'), component.get('v.modal_confirm_text')); |
| | | helper.close_confirm( |
| | | component, |
| | | component.get('v.modal_confirm_title'), |
| | | component.get('v.modal_confirm_text') |
| | | ); |
| | | }, |
| | | |
| | | no_button : function(component, event, helper) { |
| | | component.set('v.confirm_status', 2); |
| | | helper.close_confirm(component, component.get('v.modal_confirm_title'), component.get('v.modal_confirm_text')); |
| | | helper.close_confirm( |
| | | component, |
| | | component.get('v.modal_confirm_title'), |
| | | component.get('v.modal_confirm_text') |
| | | ); |
| | | }, |
| | | |
| | | toggle_report : function(component, event, helper) { |
| | |
| | | }, |
| | | |
| | | hosChange : function(component, event, helper) { |
| | | var hospital_name = event.getParam("value"); |
| | | var hospital_name = event.getParam('value'); |
| | | if (hospital_name.match(/(\S+\s)+/)) { |
| | | helper.searchHos(component, event, helper); |
| | | } else { |
| | |
| | | helper.readFile(component,helper,files[0]); |
| | | }, |
| | | CreateRecord : function(component, event, helper){ |
| | | var files = event.getSource().get("v.files"); |
| | | var files = event.getSource().get('v.files'); |
| | | // var fileInput = component.find("file").getElement(); |
| | | // var file = fileInput.files[0]; |
| | | helper.readFile(component,helper,files[0]); |
| | | component.set('v.showErrorInfo', false); |
| | | }, |
| | | |
| | | processFileContent : function(component,event,helper){ |
| | | helper.saveRecords(component,event,helper); |
| | | component.set('v.showErrorInfo', false); |
| | | }, |
| | | |
| | | cancel : function(component,event,helper){ |
| | | component.set("v.showMain",true); |
| | | component.set('v.showMain', true); |
| | | }, |
| | | |
| | | import : function(component,event,helper){ |
| | |
| | | helper.showImport(component); |
| | | }, |
| | | exportDate : function(component,event,helper){ |
| | | var stockData = component.get("v.reports_date"); |
| | | var stockData = component.get('v.reports_date'); |
| | | console.log('导出数据'+stockData); |
| | | var csv = helper.convertArrayOfObjectsToCSV(component,stockData); |
| | | if (csv == null){return;} |
| | | if (csv == null) { |
| | | return; |
| | | } |
| | | |
| | | // ####--code for create a temp. <a> html tag [link tag] for download the CSV file--#### |
| | | var universalBOM = "\uFEFF"; |
| | | var universalBOM = '\uFEFF'; |
| | | var hiddenElement = document.createElement('a'); |
| | | hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(universalBOM+csv); |
| | | hiddenElement.href = |
| | | 'data:text/csv;charset=utf-8,' + encodeURI(universalBOM + csv); |
| | | hiddenElement.target = '_self'; // |
| | | hiddenElement.download = 'ExportData.csv'; // CSV file Name* you can change it.[only name not .csv] |
| | | document.body.appendChild(hiddenElement); // Required for FireFox browser |
| | | hiddenElement.click(); // using click() js function to download csv file |
| | | // helper.showExport(component); |
| | | |
| | | }, |
| | | |
| | | export_condition : function(component,event,helper){ |
| | |
| | | }, |
| | | export : function(component,event,helper){ |
| | | console.log('进入export'); |
| | | var stockData = component.get("v.reports_date"); |
| | | var stockData = component.get('v.reports_date'); |
| | | console.log('查出的数据'+stockData); |
| | | // helper.showExportDate(component,stockData); |
| | | // helper.showExport(component); |
| | | }, |
| | | close_import : function(component,event,helper){ |
| | | component.set("v.showMain",true); |
| | | component.set('v.showMain', true); |
| | | helper.close_import(component); |
| | | }, |
| | | close_export : function(component,event,helper){ |
| | | component.set("v.showMain",true); |
| | | component.set('v.showMain', true); |
| | | helper.close_export(component); |
| | | }, |
| | | exportErrorInfo: function (component, event, helper) { |
| | | helper.exportErrorInfoHelper(component); |
| | | } |
| | | }) |
| | | }); |
| | |
| | | component.set('v.allselectlist',res.allselectlist); |
| | | component.set('v.doclist',res.doclist); |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c)); |
| | | component |
| | | .find('select_agency_person') |
| | | .set( |
| | | 'v.options', |
| | | this.conv_selected(res.allselectlist.AgencyPerson__c) |
| | | ); |
| | | // this.search_contact(component, event, helper,res.allselectlist.AgencyPerson__c); |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | component.find('select_department').set('v.options', this.conv_selected(res.allselectlist.Department_Cateogy__c)); |
| | | component.find('select_purpose_type').set('v.options', this.conv_selected(res.allselectlist.Purpose_Type__c)); |
| | | component.find('select_result').set('v.options', this.conv_selected(res.allselectlist.Result__c)); |
| | | component.find('select_stageName').set('v.options', this.conv_selected(res.allselectlist.StageName__c)); |
| | | component |
| | | .find('select_department') |
| | | .set( |
| | | 'v.options', |
| | | this.conv_selected( |
| | | res.allselectlist.Department_Cateogy__c |
| | | ) |
| | | ); |
| | | component |
| | | .find('select_purpose_type') |
| | | .set( |
| | | 'v.options', |
| | | this.conv_selected(res.allselectlist.Purpose_Type__c) |
| | | ); |
| | | component |
| | | .find('select_result') |
| | | .set( |
| | | 'v.options', |
| | | this.conv_selected(res.allselectlist.Result__c) |
| | | ); |
| | | component |
| | | .find('select_stageName') |
| | | .set( |
| | | 'v.options', |
| | | this.conv_selected(res.allselectlist.StageName__c) |
| | | ); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | component.find('SupportNeeds__c').set('v.options', this.conv_selected(res.allselectlist.SupportNeeds__c)); |
| | | component |
| | | .find('SupportNeeds__c') |
| | | .set( |
| | | 'v.options', |
| | | this.conv_selected(res.allselectlist.SupportNeeds__c) |
| | | ); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | component.set('v.selected_agency_person', res.allselectlist.AgencyPerson__c[0].label); |
| | | component.set( |
| | | 'v.selected_agency_person', |
| | | res.allselectlist.AgencyPerson__c[0].label |
| | | ); |
| | | component.set('v.dialog_type', '新建'); |
| | | component.set('v.awsurl', res.awsurl);// 20220222 PI改造 by Bright |
| | | component.set('v.contactawsurl', res.contactawsurl);// 20220222 PI改造 by Bright |
| | | |
| | | this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value')); |
| | | this.get_reports( |
| | | component, |
| | | event, |
| | | helper, |
| | | component.find('select_date').get('v.value'), |
| | | component.find('select_agency_person').get('v.value') |
| | | ); |
| | | |
| | | component.set('v.login',false); |
| | | } |
| | | else{ |
| | | } else { |
| | | this.error('doinit failed.'); |
| | | component.set('v.login',false); |
| | | } |
| | |
| | | this.search_contact_url(component, 'Contact', (result)=>{ |
| | | var token = result.token; |
| | | var searchUrl = result.searchUrl; |
| | | this.search_core(token,searchUrl,payload,(result)=>{ |
| | | this.search_core( |
| | | token, |
| | | searchUrl, |
| | | payload, |
| | | (result) => { |
| | | if(result.status == '0'){ |
| | | if(result.object != null){ |
| | | this.to_contact_list(result,contactData,component); |
| | | this.to_contact_list( |
| | | result, |
| | | contactData, |
| | | component |
| | | ); |
| | | }else{ |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }else{ |
| | | this.error('AWS search status1 : ' + result.status); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | },component); |
| | | |
| | | }, |
| | | component |
| | | ); |
| | | }); |
| | | }, |
| | | |
| | |
| | | } |
| | | component.find('select_agency_person').set('v.options',res); |
| | | component.set('v.allselectlistAgencyPerson',res); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | }, |
| | | |
| | | search_contact_url : function(component, sobject, callback) { |
| | | var action = component.get('c.getAwsurl'); |
| | | action.setParams({ |
| | | "sobj" : sobject, |
| | | sobj: sobject |
| | | }); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | var result = response.getReturnValue(); |
| | | if(callback)callback(result); |
| | | } |
| | | else{ |
| | | } else { |
| | | this.error('AWS url/token error.'); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | |
| | | select_department : function(component, event, helper) { |
| | | var dc = component.find("select_department").get("v.value"); |
| | | var dc = component.find('select_department').get('v.value'); |
| | | dc = dc ? '%'+dc+'%' : ''; |
| | | var purpose_type = component.find("select_purpose_type").get("v.value"); |
| | | var purpose_type = component.find('select_purpose_type').get('v.value'); |
| | | if (purpose_type) { |
| | | if (purpose_type.substr(-3) == 'OPD') { |
| | | purpose_type = 'OPD'; |
| | |
| | | } |
| | | } |
| | | if (dc != '' || purpose_type != '') { |
| | | |
| | | var action = component.get('c.getProductList'); |
| | | action.setParams({ |
| | | "dc" : dc, |
| | | "opdsis" : purpose_type, |
| | | dc: dc, |
| | | opdsis: purpose_type |
| | | }); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | |
| | | var res = response.getReturnValue(); |
| | | component.find('select_Product1').set("v.options", JSON.parse(JSON.stringify(res))); |
| | | component.find('select_Product2').set("v.options", JSON.parse(JSON.stringify(res))); |
| | | component.find('select_Product3').set("v.options", JSON.parse(JSON.stringify(res))); |
| | | } |
| | | else{ |
| | | component |
| | | .find('select_Product1') |
| | | .set('v.options', JSON.parse(JSON.stringify(res))); |
| | | component |
| | | .find('select_Product2') |
| | | .set('v.options', JSON.parse(JSON.stringify(res))); |
| | | component |
| | | .find('select_Product3') |
| | | .set('v.options', JSON.parse(JSON.stringify(res))); |
| | | } else { |
| | | this.error('getProductList failed.'); |
| | | } |
| | | }); |
| | |
| | | |
| | | var action = component.get('c.getReports'); |
| | | action.setParams({ |
| | | "date_str" : date_str, |
| | | "person_str" : person_str, |
| | | date_str: date_str, |
| | | person_str: person_str |
| | | }); |
| | | |
| | | component.set('v.login',true); |
| | |
| | | dataIds.push(rep.doctor2__r.AWS_Data_Id__c); |
| | | } |
| | | |
| | | if (rep.Person_In_Charge2__r && rep.Person_In_Charge2__r.AWS_Data_Id__c) { |
| | | if ( |
| | | rep.Person_In_Charge2__r && |
| | | rep.Person_In_Charge2__r.AWS_Data_Id__c |
| | | ) { |
| | | dataIds1.push(rep.Person_In_Charge2__r.AWS_Data_Id__c); |
| | | } |
| | | } |
| | |
| | | Foo = function(){ |
| | | if(b && b1){ |
| | | for (const rep of res.reports) { |
| | | if (rep.doctor2__r && rep.doctor2__r.AWS_Data_Id__c && mm.hasOwnProperty(rep.doctor2__r.AWS_Data_Id__c)) { |
| | | rep.doctor2__r.awsdata = mm[rep.doctor2__r.AWS_Data_Id__c]; |
| | | if ( |
| | | rep.doctor2__r && |
| | | rep.doctor2__r.AWS_Data_Id__c && |
| | | mm.hasOwnProperty(rep.doctor2__r.AWS_Data_Id__c) |
| | | ) { |
| | | rep.doctor2__r.awsdata = |
| | | mm[rep.doctor2__r.AWS_Data_Id__c]; |
| | | } |
| | | if (rep.Person_In_Charge2__r && rep.Person_In_Charge2__r.AWS_Data_Id__c && mm.hasOwnProperty(rep.Person_In_Charge2__r.AWS_Data_Id__c)) { |
| | | rep.Person_In_Charge2__r.awsdata = mm[rep.Person_In_Charge2__r.AWS_Data_Id__c]; |
| | | if ( |
| | | rep.Person_In_Charge2__r && |
| | | rep.Person_In_Charge2__r.AWS_Data_Id__c && |
| | | mm.hasOwnProperty( |
| | | rep.Person_In_Charge2__r.AWS_Data_Id__c |
| | | ) |
| | | ) { |
| | | rep.Person_In_Charge2__r.awsdata = |
| | | mm[rep.Person_In_Charge2__r.AWS_Data_Id__c]; |
| | | } |
| | | } |
| | | |
| | | $A.getCallback(()=>component.set('v.reports', res.reports))(); |
| | | $A.getCallback(() => |
| | | component.set('v.reports', res.reports) |
| | | )(); |
| | | }else{ |
| | | console.log('b='+b + ',b1='+b1+',continue'); |
| | | setTimeout(Foo,100); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | if(dataIds.length > 0){ |
| | | let awsurl = component.get('v.awsurl'); |
| | | helper.search_core(awsurl.token,awsurl.searchUrl,JSON.stringify({ |
| | | "dataIds":dataIds |
| | | }),(result)=>{ |
| | | helper.search_core( |
| | | awsurl.token, |
| | | awsurl.searchUrl, |
| | | JSON.stringify({ |
| | | dataIds: dataIds |
| | | }), |
| | | (result) => { |
| | | if(result.status == '0'){ |
| | | |
| | | for (const m of result.object) { |
| | | mm[m.dataId] = m; |
| | | } |
| | | b = true; |
| | | Foo(); |
| | | }else{ |
| | | this.error('请重新刷新一下页面。'); |
| | | //this.error('AWS search status2 : ' + result.status); |
| | | this.success('请重新刷新页面进行解密'); |
| | | } |
| | | },component); |
| | | }, |
| | | component |
| | | ); |
| | | }else{ |
| | | b = true; |
| | | } |
| | | |
| | | |
| | | |
| | | if(dataIds1.length > 0){ |
| | | let contactawsurl = component.get('v.contactawsurl'); |
| | | helper.search_core(contactawsurl.token,contactawsurl.searchUrl,JSON.stringify({ |
| | | "dataIds":dataIds1 |
| | | }),(result)=>{ |
| | | helper.search_core( |
| | | contactawsurl.token, |
| | | contactawsurl.searchUrl, |
| | | JSON.stringify({ |
| | | dataIds: dataIds1 |
| | | }), |
| | | (result) => { |
| | | if(result.status == '0'){ |
| | | |
| | | for (const m of result.object) { |
| | | mm[m.dataId] = m; |
| | | } |
| | | b1 = true; |
| | | Foo(); |
| | | }else{ |
| | | this.error('AWS search status3 : ' + result.status); |
| | | this.error( |
| | | 'AWS search status3 : ' + result.status |
| | | ); |
| | | } |
| | | },component); |
| | | }, |
| | | component |
| | | ); |
| | | }else{ |
| | | b1 = true; |
| | | } |
| | |
| | | // 更新保存後のselect_data用 |
| | | var report_id = component.get('v.update_select_report_data_id'); |
| | | |
| | | if (report_id != "") { |
| | | if (report_id != '') { |
| | | for (i = 0; i < res.reports.length; i++) { |
| | | if (res.reports[i]['Id'] == report_id) { |
| | | component.set('v.select_report_data', res.reports[i]); |
| | | component.set( |
| | | 'v.select_report_data', |
| | | res.reports[i] |
| | | ); |
| | | break; |
| | | } |
| | | } |
| | |
| | | component.set('v.list_message', 'no_data'); |
| | | } |
| | | component.set('v.login',false); |
| | | } |
| | | else{ |
| | | } else { |
| | | this.error('get_reports failed.'); |
| | | component.set('v.login',false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | get_reports_edit: function ( |
| | | component, |
| | | event, |
| | | helper, |
| | | date_str, |
| | | person_str |
| | | ) { |
| | | if (!date_str) { |
| | | return false; |
| | | } |
| | | |
| | | date_str = this.get_date_string(date_str); |
| | | |
| | | var action = component.get('c.getReports'); |
| | | action.setParams({ |
| | | date_str: date_str, |
| | | person_str: person_str |
| | | }); |
| | | |
| | | component.set('v.loginEdit', true); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | component.set('v.reports', res.reports); |
| | | |
| | | // 20220222 PI改造 by Bright--start |
| | | let dataIds = []; |
| | | let dataIds1 = []; |
| | | let mm = {}; |
| | | let b = false; |
| | | let b1 = false; |
| | | for (const rep of res.reports) { |
| | | if (rep.doctor2__r && rep.doctor2__r.AWS_Data_Id__c) { |
| | | dataIds.push(rep.doctor2__r.AWS_Data_Id__c); |
| | | } |
| | | |
| | | if ( |
| | | rep.Person_In_Charge2__r && |
| | | rep.Person_In_Charge2__r.AWS_Data_Id__c |
| | | ) { |
| | | dataIds1.push(rep.Person_In_Charge2__r.AWS_Data_Id__c); |
| | | } |
| | | } |
| | | let Foo = null; |
| | | Foo = function () { |
| | | if (b && b1) { |
| | | for (const rep of res.reports) { |
| | | if ( |
| | | rep.doctor2__r && |
| | | rep.doctor2__r.AWS_Data_Id__c && |
| | | mm.hasOwnProperty(rep.doctor2__r.AWS_Data_Id__c) |
| | | ) { |
| | | rep.doctor2__r.awsdata = |
| | | mm[rep.doctor2__r.AWS_Data_Id__c]; |
| | | } |
| | | if ( |
| | | rep.Person_In_Charge2__r && |
| | | rep.Person_In_Charge2__r.AWS_Data_Id__c && |
| | | mm.hasOwnProperty( |
| | | rep.Person_In_Charge2__r.AWS_Data_Id__c |
| | | ) |
| | | ) { |
| | | rep.Person_In_Charge2__r.awsdata = |
| | | mm[rep.Person_In_Charge2__r.AWS_Data_Id__c]; |
| | | } |
| | | } |
| | | |
| | | $A.getCallback(() => |
| | | component.set('v.reports', res.reports) |
| | | )(); |
| | | } else { |
| | | console.log('b=' + b + ',b1=' + b1 + ',continue'); |
| | | setTimeout(Foo, 100); |
| | | } |
| | | }; |
| | | |
| | | if (dataIds.length > 0) { |
| | | let awsurl = component.get('v.awsurl'); |
| | | helper.search_core( |
| | | awsurl.token, |
| | | awsurl.searchUrl, |
| | | JSON.stringify({ |
| | | dataIds: dataIds |
| | | }), |
| | | (result) => { |
| | | if (result.status == '0') { |
| | | for (const m of result.object) { |
| | | mm[m.dataId] = m; |
| | | } |
| | | b = true; |
| | | Foo(); |
| | | } else { |
| | | //this.error('AWS search status2 : ' + result.status); |
| | | this.success('请重新刷新页面进行解密'); |
| | | } |
| | | }, |
| | | component |
| | | ); |
| | | } else { |
| | | b = true; |
| | | } |
| | | |
| | | if (dataIds1.length > 0) { |
| | | let contactawsurl = component.get('v.contactawsurl'); |
| | | helper.search_core( |
| | | contactawsurl.token, |
| | | contactawsurl.searchUrl, |
| | | JSON.stringify({ |
| | | dataIds: dataIds1 |
| | | }), |
| | | (result) => { |
| | | if (result.status == '0') { |
| | | for (const m of result.object) { |
| | | mm[m.dataId] = m; |
| | | } |
| | | b1 = true; |
| | | Foo(); |
| | | } else { |
| | | this.error( |
| | | 'AWS search status3 : ' + result.status |
| | | ); |
| | | } |
| | | }, |
| | | component |
| | | ); |
| | | } else { |
| | | b1 = true; |
| | | } |
| | | // 20220222 PI改造 by Bright--end |
| | | |
| | | component.set('v.report_count', res.reports.length); |
| | | |
| | | // 更新保存後のselect_data用 |
| | | var report_id = component.get('v.update_select_report_data_id'); |
| | | |
| | | if (report_id != '') { |
| | | for (i = 0; i < res.reports.length; i++) { |
| | | if (res.reports[i]['Id'] == report_id) { |
| | | component.set( |
| | | 'v.select_report_data', |
| | | res.reports[i] |
| | | ); |
| | | break; |
| | | } |
| | | } |
| | | component.set('v.update_select_report_data_id', ''); |
| | | } |
| | | |
| | | if (res.reports.length > 0) { |
| | | component.set('v.list_message', ''); |
| | | } else { |
| | | component.set('v.list_message', 'no_data'); |
| | | } |
| | | component.set('v.loginEdit', false); |
| | | } else { |
| | | this.error('get_reports failed.'); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | select_date_change : function(component, event, helper) { |
| | | this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value')); |
| | | this.get_reports( |
| | | component, |
| | | event, |
| | | helper, |
| | | component.find('select_date').get('v.value'), |
| | | component.find('select_agency_person').get('v.value') |
| | | ); |
| | | this.new_button_disabled(component, event, helper); |
| | | |
| | | component.set('v.select_report_data_radio', ''); |
| | |
| | | }, |
| | | |
| | | select_agency_change : function(component, event, helper) { |
| | | var select_value = component.find('select_agency_person').get('v.value'); |
| | | var select_value = component |
| | | .find('select_agency_person') |
| | | .get('v.value'); |
| | | var new_label = this.get_agency_person_name(component, select_value); |
| | | component.set('v.selected_agency_person', new_label); |
| | | |
| | | this.get_reports(component, event, helper, component.find('select_date').get('v.value'), select_value); |
| | | this.get_reports( |
| | | component, |
| | | event, |
| | | helper, |
| | | component.find('select_date').get('v.value'), |
| | | select_value |
| | | ); |
| | | this.new_button_disabled(component, event, helper); |
| | | |
| | | component.set('v.select_report_data_radio', ''); |
| | |
| | | |
| | | new_button_disabled : function(component, event, helper) { |
| | | var select_date = component.find('select_date').get('v.value'); |
| | | var select_agency = component.find('select_agency_person').get('v.value'); |
| | | var select_agency = component |
| | | .find('select_agency_person') |
| | | .get('v.value'); |
| | | if (select_date && select_agency) { |
| | | component.find('new_button').set('v.disabled', false); |
| | | } else { |
| | |
| | | // OPEN |
| | | $A.util.removeClass(modal_window, 'disp_none'); |
| | | $A.util.removeClass(modal_bg, 'disp_none'); |
| | | |
| | | if (component.get('v.mode') == 'edit' || component.get('v.mode') == 'copy') { |
| | | component.set('v.loginEdit', true); |
| | | if ( |
| | | component.get('v.mode') == 'edit' || |
| | | component.get('v.mode') == 'copy' |
| | | ) { |
| | | var select_data = ''; |
| | | if (component.get('v.mode') == 'edit') { |
| | | select_data = component.get('v.select_report_data'); |
| | |
| | | var reports = component.get('v.reports'); |
| | | var Agency_Hospital_text = ''; |
| | | var Agency_Hospital_parent_id = ''; |
| | | debugger |
| | | debugger; |
| | | // 医院名 |
| | | if (select_data['Agency_Hospital__c'] != '') { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i]['Agency_Hospital__c'] == select_data['Agency_Hospital__c']) { |
| | | Agency_Hospital_text = reports[i]['Agency_Hospital__r']['Name']; |
| | | Agency_Hospital_parent_id = reports[i]['Agency_Hospital__r']['Hospital__c']; |
| | | if ( |
| | | reports[i]['Agency_Hospital__c'] == |
| | | select_data['Agency_Hospital__c'] |
| | | ) { |
| | | Agency_Hospital_text = |
| | | reports[i]['Agency_Hospital__r']['Name']; |
| | | Agency_Hospital_parent_id = |
| | | reports[i]['Agency_Hospital__r']['Hospital__c']; |
| | | } |
| | | } |
| | | component.set('v.hospital', Agency_Hospital_text); |
| | | component.set('v.hospitalId', Agency_Hospital_parent_id); |
| | | component.set('v.hospitalLinkId', select_data['Agency_Hospital__c']); |
| | | component.set( |
| | | 'v.hospitalLinkId', |
| | | select_data['Agency_Hospital__c'] |
| | | ); |
| | | component.find('new_con').set('v.disabled', false); |
| | | } |
| | | |
| | | // 科室 |
| | | if (select_data['Department_Cateogy__c'] != '') { |
| | | this.set_selected(component, 'select_department', select_data['Department_Cateogy__c']); |
| | | this.set_selected( |
| | | component, |
| | | 'select_department', |
| | | select_data['Department_Cateogy__c'] |
| | | ); |
| | | } |
| | | // 拜访人 |
| | | component.set('v.default_select_doctor_id', select_data['doctor2__c']); |
| | | component.set( |
| | | 'v.default_select_doctor_id', |
| | | select_data['doctor2__c'] |
| | | ); |
| | | this.set_doctor_list(component); |
| | | |
| | | // 活动区分 |
| | | if (select_data['Purpose_Type__c'] != '') { |
| | | this.set_selected(component, 'select_purpose_type', select_data['Purpose_Type__c']); |
| | | this.set_selected( |
| | | component, |
| | | 'select_purpose_type', |
| | | select_data['Purpose_Type__c'] |
| | | ); |
| | | this.select_purpose_type(component); |
| | | } |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // 支援需求 |
| | | if (select_data['SupportNeeds__c'] != '') { |
| | | this.set_selected(component, 'SupportNeeds__c', select_data['SupportNeeds__c']); |
| | | this.set_selected( |
| | | component, |
| | | 'SupportNeeds__c', |
| | | select_data['SupportNeeds__c'] |
| | | ); |
| | | } |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | // 結果 |
| | | if (select_data['Result__c'] != '' && typeof select_data['Result__c'] !== "undefined") { |
| | | component.find('select_result').set('v.value', select_data['Result__c']); |
| | | if ( |
| | | select_data['Result__c'] != '' && |
| | | typeof select_data['Result__c'] !== 'undefined' |
| | | ) { |
| | | component |
| | | .find('select_result') |
| | | .set('v.value', select_data['Result__c']); |
| | | } |
| | | |
| | | // 询价 |
| | | var report_id = component.get('v.edit_copy_select_report_id'); |
| | | if (report_id != "") { |
| | | if (report_id != '') { |
| | | var select_opp = ''; |
| | | var select_product_category1 = ''; |
| | | var select_product_category2 = ''; |
| | |
| | | var reportDate; |
| | | var i = 0; |
| | | for (i = 0; i < reports.length; i++) { |
| | | if (report_id == reports[i]["Id"]) { |
| | | select_opp = reports[i]["Opportunity__c"]; |
| | | select_product_category1 = reports[i]["Product_Category1__c"]; |
| | | select_product_category2 = reports[i]["Product_Category2__c"]; |
| | | select_product_category3 = reports[i]["Product_Category3__c"]; |
| | | reportDate = reports[i]["Report_Date__c"]; |
| | | if (report_id == reports[i]['Id']) { |
| | | select_opp = reports[i]['Opportunity__c']; |
| | | select_product_category1 = |
| | | reports[i]['Product_Category1__c']; |
| | | select_product_category2 = |
| | | reports[i]['Product_Category2__c']; |
| | | select_product_category3 = |
| | | reports[i]['Product_Category3__c']; |
| | | reportDate = reports[i]['Report_Date__c']; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | // 询价 |
| | | if (select_opp != null && select_opp != '') { |
| | | var select_opp_name = component.get('v.reports')[i].OppName__c; |
| | | var select_opp_name = |
| | | component.get('v.reports')[i].OppName__c; |
| | | component.set('v.data.Opportunity__c', select_opp); |
| | | if ($A.get("$Browser.formFactor") == 'DESKTOP') { |
| | | var values = [{ |
| | | if ($A.get('$Browser.formFactor') == 'DESKTOP') { |
| | | var values = [ |
| | | { |
| | | type: 'Agency_Opportunity__c', |
| | | id: select_opp, |
| | | label: select_opp_name, |
| | |
| | | backgroundColor:'dc71d1', |
| | | alt:'Agency_Opportunity__c' |
| | | } |
| | | }]; |
| | | } |
| | | ]; |
| | | component.set('v.data.Opportunity__c', select_opp); |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.values', values); |
| | | } else { |
| | | component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', select_opp_name); |
| | | component |
| | | .find('input-opportunity') |
| | | .get('v.body')[0] |
| | | .set('v.selectedLabel', select_opp_name); |
| | | } |
| | | } |
| | | |
| | | // 产品区分 |
| | | if (select_product_category1 != null && select_product_category1 != '') { |
| | | component.find('select_Product1').set('v.value', select_product_category1); |
| | | if ( |
| | | select_product_category1 != null && |
| | | select_product_category1 != '' |
| | | ) { |
| | | component |
| | | .find('select_Product1') |
| | | .set('v.value', select_product_category1); |
| | | } |
| | | if (select_product_category2 != null && select_product_category2 != '') { |
| | | component.find('select_Product2').set('v.value', select_product_category2); |
| | | if ( |
| | | select_product_category2 != null && |
| | | select_product_category2 != '' |
| | | ) { |
| | | component |
| | | .find('select_Product2') |
| | | .set('v.value', select_product_category2); |
| | | } |
| | | if (select_product_category3 != null && select_product_category3 != '') { |
| | | component.find('select_Product3').set('v.value', select_product_category3); |
| | | if ( |
| | | select_product_category3 != null && |
| | | select_product_category3 != '' |
| | | ) { |
| | | component |
| | | .find('select_Product3') |
| | | .set('v.value', select_product_category3); |
| | | } |
| | | |
| | | if (reportDate != null) { |
| | | console.log('reportDate = ' + reportDate); |
| | | component.set('v.data.Report_Date__c', reportDate); |
| | | } |
| | | |
| | | component.set('v.edit_copy_select_report_id', ""); |
| | | component.set('v.edit_copy_select_report_id', ''); |
| | | } |
| | | } |
| | | setTimeout(function () { |
| | | component.set('v.loginEdit', false); |
| | | }, 1000); |
| | | } else { |
| | | // CLOSE |
| | | |
| | | var select_report_data = component.get('v.select_report_data'); |
| | | var Report_Date__c = component.get('v.data.Report_Date__c'); |
| | | var Agency_Hospital__c = component.get('v.hospitalLinkId'); |
| | | var Department_Cateogy__c = component.find('select_department').get('v.value'); |
| | | var Department_Cateogy__c = component |
| | | .find('select_department') |
| | | .get('v.value'); |
| | | var doctor2__c = component.find('select_doctor').get('v.value'); |
| | | var Purpose_Type__c = component.find('select_purpose_type').get('v.value'); |
| | | var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value'); |
| | | var Purpose_Type__c = component |
| | | .find('select_purpose_type') |
| | | .get('v.value'); |
| | | var SupportNeeds__c = component |
| | | .find('SupportNeeds__c') |
| | | .get('v.value'); |
| | | var Opportunity__c = component.get('v.data.Opportunity__c'); |
| | | var Product_Category1__c = component.find('select_Product1').get('v.value'); |
| | | var Product_Category2__c = component.find('select_Product2').get('v.value'); |
| | | var Product_Category3__c = component.find('select_Product3').get('v.value'); |
| | | var Product_Category1__c = component |
| | | .find('select_Product1') |
| | | .get('v.value'); |
| | | var Product_Category2__c = component |
| | | .find('select_Product2') |
| | | .get('v.value'); |
| | | var Product_Category3__c = component |
| | | .find('select_Product3') |
| | | .get('v.value'); |
| | | var Result__c = component.find('select_result').get('v.value'); |
| | | |
| | | if (select_report_data !== null) { |
| | | if (typeof select_report_data['Opportunity__c'] === "undefined") { |
| | | select_report_data['Opportunity__c'] = ""; |
| | | if ( |
| | | typeof select_report_data['Opportunity__c'] === 'undefined' |
| | | ) { |
| | | select_report_data['Opportunity__c'] = ''; |
| | | } |
| | | if (typeof select_report_data['Product_Category1__c'] === "undefined") { |
| | | select_report_data['Product_Category1__c'] = ""; |
| | | if ( |
| | | typeof select_report_data['Product_Category1__c'] === |
| | | 'undefined' |
| | | ) { |
| | | select_report_data['Product_Category1__c'] = ''; |
| | | } |
| | | if (typeof select_report_data['Product_Category2__c'] === "undefined") { |
| | | select_report_data['Product_Category2__c'] = ""; |
| | | if ( |
| | | typeof select_report_data['Product_Category2__c'] === |
| | | 'undefined' |
| | | ) { |
| | | select_report_data['Product_Category2__c'] = ''; |
| | | } |
| | | if (typeof select_report_data['Product_Category3__c'] === "undefined") { |
| | | select_report_data['Product_Category3__c'] = ""; |
| | | if ( |
| | | typeof select_report_data['Product_Category3__c'] === |
| | | 'undefined' |
| | | ) { |
| | | select_report_data['Product_Category3__c'] = ''; |
| | | } |
| | | if (typeof select_report_data['Result__c'] === "undefined") { |
| | | select_report_data['Result__c'] = ""; |
| | | if (typeof select_report_data['Result__c'] === 'undefined') { |
| | | select_report_data['Result__c'] = ''; |
| | | } |
| | | } |
| | | |
| | | if (component.get('v.mode') == 'new') { |
| | | var confirm_title = '警告!' |
| | | var confirm_title = '警告!'; |
| | | var confirm_text = '放弃新建周报?'; |
| | | |
| | | if (!Report_Date__c && |
| | | if ( |
| | | !Report_Date__c && |
| | | !Agency_Hospital__c && |
| | | !Department_Cateogy__c && |
| | | !doctor2__c && |
| | |
| | | !Product_Category1__c && |
| | | !Product_Category2__c && |
| | | !Product_Category3__c && |
| | | !Result__c) |
| | | { |
| | | !Result__c |
| | | ) { |
| | | this.allclear(component); |
| | | $A.util.addClass(modal_window, 'disp_none'); |
| | | $A.util.addClass(modal_bg, 'disp_none'); |
| | |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } else if (component.get('v.mode') == 'copy') { |
| | | var confirm_title = '警告!' |
| | | var confirm_title = '警告!'; |
| | | var confirm_text = '放弃新建周报?'; |
| | | |
| | | if (select_report_data['Report_Date__c'] == Report_Date__c && |
| | | select_report_data['Agency_Hospital__c'] == Agency_Hospital__c && |
| | | select_report_data['Department_Cateogy__c'] == Department_Cateogy__c && |
| | | if ( |
| | | select_report_data['Report_Date__c'] == Report_Date__c && |
| | | select_report_data['Agency_Hospital__c'] == |
| | | Agency_Hospital__c && |
| | | select_report_data['Department_Cateogy__c'] == |
| | | Department_Cateogy__c && |
| | | select_report_data['doctor2__c'] == doctor2__c && |
| | | select_report_data['Purpose_Type__c'] == Purpose_Type__c && |
| | | select_report_data['SupportNeeds__c'] == SupportNeeds__c &&//WAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 |
| | | select_report_data['Opportunity__c'] == Opportunity__c && |
| | | select_report_data['Product_Category1__c'] == Product_Category1__c && |
| | | select_report_data['Product_Category2__c'] == Product_Category2__c && |
| | | select_report_data['Product_Category3__c'] == Product_Category3__c && |
| | | select_report_data['Result__c'] == Result__c) |
| | | { |
| | | select_report_data['Product_Category1__c'] == |
| | | Product_Category1__c && |
| | | select_report_data['Product_Category2__c'] == |
| | | Product_Category2__c && |
| | | select_report_data['Product_Category3__c'] == |
| | | Product_Category3__c && |
| | | select_report_data['Result__c'] == Result__c |
| | | ) { |
| | | this.allclear(component); |
| | | $A.util.addClass(modal_window, 'disp_none'); |
| | | $A.util.addClass(modal_bg, 'disp_none'); |
| | |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } else if (component.get('v.mode') == 'edit') { |
| | | var confirm_title = '警告!' |
| | | var confirm_title = '警告!'; |
| | | var confirm_text = '放弃编辑周报?'; |
| | | |
| | | if (select_report_data['Report_Date__c'] == Report_Date__c && |
| | | select_report_data['Agency_Hospital__c'] == Agency_Hospital__c && |
| | | select_report_data['Department_Cateogy__c'] == Department_Cateogy__c && |
| | | if ( |
| | | select_report_data['Report_Date__c'] == Report_Date__c && |
| | | select_report_data['Agency_Hospital__c'] == |
| | | Agency_Hospital__c && |
| | | select_report_data['Department_Cateogy__c'] == |
| | | Department_Cateogy__c && |
| | | select_report_data['doctor2__c'] == doctor2__c && |
| | | select_report_data['Purpose_Type__c'] == Purpose_Type__c && |
| | | select_report_data['SupportNeeds__c'] == SupportNeeds__c &&//WAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 |
| | | select_report_data['Opportunity__c'] == Opportunity__c && |
| | | select_report_data['Product_Category1__c'] == Product_Category1__c && |
| | | select_report_data['Product_Category2__c'] == Product_Category2__c && |
| | | select_report_data['Product_Category3__c'] == Product_Category3__c && |
| | | select_report_data['Result__c'] == Result__c) |
| | | { |
| | | select_report_data['Product_Category1__c'] == |
| | | Product_Category1__c && |
| | | select_report_data['Product_Category2__c'] == |
| | | Product_Category2__c && |
| | | select_report_data['Product_Category3__c'] == |
| | | Product_Category3__c && |
| | | select_report_data['Result__c'] == Result__c |
| | | ) { |
| | | this.allclear(component); |
| | | $A.util.addClass(modal_window, 'disp_none'); |
| | | $A.util.addClass(modal_bg, 'disp_none'); |
| | |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } |
| | | |
| | | } |
| | | }, |
| | | |
| | |
| | | $A.util.addClass(modal_confirm_bg, 'disp_none'); |
| | | component.set('v.mode', ''); |
| | | this.allclear(component); |
| | | component.set('v.reports_now', ""); |
| | | component.set('v.reports_now', ''); |
| | | component.set('v.reports_now_count', 0); |
| | | component.set('v.confirm_status', 0); |
| | | } else if (confirm_status == 2) { |
| | |
| | | component.set('v.mode', 'new'); |
| | | component.set('v.dialog_type', '新建'); |
| | | var select_date = component.find('select_date').get('v.value'); |
| | | var select_agency = component.find('select_agency_person').get('v.value'); |
| | | var select_agency = component |
| | | .find('select_agency_person') |
| | | .get('v.value'); |
| | | component.set('v.selected_date', select_date); |
| | | var name = component.get('v.selected_agency_person'); |
| | | var ret = this.create_report_header(component, name, select_agency, select_date); |
| | | var ret = this.create_report_header( |
| | | component, |
| | | name, |
| | | select_agency, |
| | | select_date |
| | | ); |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | this.set_aws_url(component,'Agency_Contact__c') |
| | | this.set_aws_url(component, 'Agency_Contact__c'); |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | }, |
| | | |
| | |
| | | component.set('v.loadOpp', true); |
| | | // 週 |
| | | var now = new Date(); |
| | | var start_day = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() + 1)); |
| | | var select_date = start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate(); |
| | | var start_day = new Date( |
| | | now.getFullYear(), |
| | | now.getMonth(), |
| | | now.getDate() - now.getDay() + 1 |
| | | ); |
| | | var select_date = |
| | | start_day.getFullYear() + |
| | | '/' + |
| | | (start_day.getMonth() + 1) + |
| | | '/' + |
| | | start_day.getDate(); |
| | | this.set_selected(component, 'select_date', select_date); |
| | | component.set('v.selected_date', select_date); |
| | | |
| | |
| | | component.set('v.edit_copy_select_report_id', select_report_data['Id']); |
| | | component.set('v.select_report_data', select_report_data); |
| | | |
| | | var ret = this.create_report_header(component, name, select_agency, select_date); |
| | | var ret = this.create_report_header( |
| | | component, |
| | | name, |
| | | select_agency, |
| | | select_date |
| | | ); |
| | | }, |
| | | |
| | | change_report_radio : function(component, event, helper) { |
| | |
| | | }, |
| | | |
| | | edit_button : function(component, event, helper) { |
| | | component.set('v.login', true); |
| | | this.allclear(component); |
| | | component.set('v.loadOpp', true); |
| | | var index = event.getSource().get('v.value'); |
| | | component.set('v.select_report_data', component.get('v.reports')[index]); |
| | | component.set( |
| | | 'v.select_report_data', |
| | | component.get('v.reports')[index] |
| | | ); |
| | | component.set('v.mode', 'edit'); |
| | | component.set('v.dialog_type', '编辑'); |
| | | |
| | | var select_date = component.get('v.reports')[index].Submit_date__c; |
| | | var select_agency = component.get('v.reports')[index].Person_In_Charge2__c; |
| | | var select_agency = |
| | | component.get('v.reports')[index].Person_In_Charge2__c; |
| | | var text_tmp = select_date.split('-'); |
| | | var select_date_text = text_tmp[0] + '/' + Number(text_tmp[1]) + '/' + Number(text_tmp[2]); |
| | | var select_date_text = |
| | | text_tmp[0] + '/' + Number(text_tmp[1]) + '/' + Number(text_tmp[2]); |
| | | component.set('v.selected_date', select_date_text); |
| | | var name = component.get('v.reports')[index].Person_In_Charge2__r.Name; |
| | | |
| | |
| | | var new_label = this.get_agency_person_name(component, select_agency); |
| | | component.set('v.selected_agency_person', new_label); |
| | | |
| | | component.set('v.edit_copy_select_report_id', component.get('v.reports')[index].Id); |
| | | component.set( |
| | | 'v.edit_copy_select_report_id', |
| | | component.get('v.reports')[index].Id |
| | | ); |
| | | |
| | | var ret = this.create_report_header(component, name, select_agency, select_date); |
| | | var ret = this.create_report_header( |
| | | component, |
| | | name, |
| | | select_agency, |
| | | select_date |
| | | ); |
| | | }, |
| | | |
| | | save_report : function(component, event, helper) { |
| | | |
| | | // 20220222 PI改造 by Bright--start |
| | | let doctor2Name = ''; |
| | | let visitortitle = ''; |
| | |
| | | } |
| | | // 20220222 PI改造 by Bright--end |
| | | |
| | | |
| | | component.find('save_button').set('v.disabled', true); |
| | | |
| | | var Report_Date__c = component.get('v.data.Report_Date__c'); |
| | | // alert('Report_Date__c'+Report_Date__c); |
| | | var Person_In_Charge2__c = ""; |
| | | var Submit_date__c = ""; |
| | | var Person_In_Charge2__c = ''; |
| | | var Submit_date__c = ''; |
| | | if (component.get('v.mode') == 'edit') { |
| | | // 周 Submit_date__c |
| | | Submit_date__c = component.get('v.select_report_data').Submit_date__c; |
| | | Submit_date__c = component.get( |
| | | 'v.select_report_data' |
| | | ).Submit_date__c; |
| | | // alert('Submit_date__c'+Submit_date__c); |
| | | |
| | | |
| | | // 担当 Person_In_Charge2__c |
| | | Person_In_Charge2__c = component.get('v.select_report_data').Person_In_Charge2__c; |
| | | Person_In_Charge2__c = component.get( |
| | | 'v.select_report_data' |
| | | ).Person_In_Charge2__c; |
| | | } else { |
| | | // 周 Submit_date__c |
| | | Submit_date__c = this.get_date_string(component.find('select_date').get('v.value')); |
| | | Submit_date__c = this.get_date_string( |
| | | component.find('select_date').get('v.value') |
| | | ); |
| | | // alert('Submit_date__c'+Submit_date__c); |
| | | |
| | | // 担当 Person_In_Charge2__c |
| | | Person_In_Charge2__c = component.find('select_agency_person').get('v.value'); |
| | | Person_In_Charge2__c = component |
| | | .find('select_agency_person') |
| | | .get('v.value'); |
| | | } |
| | | // Agency_Report_Header__c |
| | | var Agency_Report_Header__c = component.get('v.agency_report_header_id'); |
| | | var Agency_Report_Header__c = component.get( |
| | | 'v.agency_report_header_id' |
| | | ); |
| | | |
| | | // 医院 Agency_Hospital__c (Agency_Hospital_Link__c) |
| | | var Agency_Hospital__c = component.get('v.hospitalLinkId'); |
| | | |
| | | // 科室 Department_Cateogy__c |
| | | var Department_Cateogy__c = component.find('select_department').get('v.value'); |
| | | var Department_Cateogy__c = component |
| | | .find('select_department') |
| | | .get('v.value'); |
| | | |
| | | // 拜访人 doctor2__c |
| | | var doctor2__c = component.find('select_doctor').get('v.value'); |
| | | |
| | | // 活动区分 Purpose_Type__c |
| | | var Purpose_Type__c = component.find('select_purpose_type').get('v.value'); |
| | | var Purpose_Type__c = component |
| | | .find('select_purpose_type') |
| | | .get('v.value'); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // 支援需求 SupportNeeds__c |
| | | var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value'); |
| | |
| | | var Opportunity__c = component.get('v.data.Opportunity__c'); |
| | | |
| | | var StageName__c = component.find('select_stageName').get('v.value'); |
| | | var Amount__c = component.get('v.oppdata.Amount__c') != null ? component.get('v.oppdata.Amount__c').toString() : ''; |
| | | var OCMSale_Price__c = component.get('v.oppdata.OCMSale_Price__c') != null ? component.get('v.oppdata.OCMSale_Price__c').toString() : ''; |
| | | var Close_Forecasted_Date__c = component.get('v.oppdata.Close_Forecasted_Date__c'); |
| | | var Amount__c = |
| | | component.get('v.oppdata.Amount__c') != null |
| | | ? component.get('v.oppdata.Amount__c').toString() |
| | | : ''; |
| | | var OCMSale_Price__c = |
| | | component.get('v.oppdata.OCMSale_Price__c') != null |
| | | ? component.get('v.oppdata.OCMSale_Price__c').toString() |
| | | : ''; |
| | | var Close_Forecasted_Date__c = component.get( |
| | | 'v.oppdata.Close_Forecasted_Date__c' |
| | | ); |
| | | |
| | | var StageName__c_o = component.get('v.StageName__c_o'); |
| | | var Amount__c_o = component.get('v.Amount__c_o'); |
| | | var OCMSale_Price__c_o = component.get('v.OCMSale_Price__c_o'); |
| | | var Close_Forecasted_Date__c_o = component.get('v.Close_Forecasted_Date__c_o'); |
| | | var Close_Forecasted_Date__c_o = component.get( |
| | | 'v.Close_Forecasted_Date__c_o' |
| | | ); |
| | | if (StageName__c_o == undefined) StageName__c_o = ''; |
| | | if (Amount__c_o == undefined) Amount__c_o = ''; |
| | | if (OCMSale_Price__c_o == undefined) OCMSale_Price__c_o = ''; |
| | | if (Close_Forecasted_Date__c_o == undefined) Close_Forecasted_Date__c_o = ''; |
| | | if (StageName__c == StageName__c_o && OCMSale_Price__c_o == OCMSale_Price__c && Amount__c == Amount__c_o && Close_Forecasted_Date__c == Close_Forecasted_Date__c_o) { |
| | | if (Close_Forecasted_Date__c_o == undefined) |
| | | Close_Forecasted_Date__c_o = ''; |
| | | if ( |
| | | StageName__c == StageName__c_o && |
| | | OCMSale_Price__c_o == OCMSale_Price__c && |
| | | Amount__c == Amount__c_o && |
| | | Close_Forecasted_Date__c == Close_Forecasted_Date__c_o |
| | | ) { |
| | | StageName__c = ''; |
| | | Amount__c = ''; |
| | | OCMSale_Price__c = ''; |
| | |
| | | } |
| | | |
| | | // 产品区分 Product_Category__c (ProductTypes__c) |
| | | var Product_Category1__c = component.find('select_Product1').get('v.value'); |
| | | var Product_Category2__c = component.find('select_Product2').get('v.value'); |
| | | var Product_Category3__c = component.find('select_Product3').get('v.value'); |
| | | var Product_Category1__c = component |
| | | .find('select_Product1') |
| | | .get('v.value'); |
| | | var Product_Category2__c = component |
| | | .find('select_Product2') |
| | | .get('v.value'); |
| | | var Product_Category3__c = component |
| | | .find('select_Product3') |
| | | .get('v.value'); |
| | | |
| | | // 結果 Result__c |
| | | var Result__c = component.find('select_result').get('v.value'); |
| | | |
| | | // バリデーション |
| | | var error = []; |
| | | if (!Report_Date__c) { error.push("活动日 不存在"); } |
| | | if (!Submit_date__c) { error.push("周 不存在"); } |
| | | if (!Report_Date__c) { |
| | | error.push('活动日 不存在'); |
| | | } |
| | | if (!Submit_date__c) { |
| | | error.push('周 不存在'); |
| | | } |
| | | var rDate = new Date(Report_Date__c); |
| | | var sDate = new Date(Submit_date__c); |
| | | sDate.setDate(sDate.getDate() - 1); |
| | | if (rDate < sDate) {error.push('活动日必须是本周!'); } |
| | | if (rDate < sDate) { |
| | | error.push('活动日必须是本周!'); |
| | | } |
| | | sDate.setDate(sDate.getDate() + 7); |
| | | if (rDate >= sDate) {error.push('活动日必须是本周!'); } |
| | | if (rDate >= sDate) { |
| | | error.push('活动日必须是本周!'); |
| | | } |
| | | |
| | | if (!Person_In_Charge2__c) { error.push("担当 不存在"); } |
| | | if (!Agency_Report_Header__c) { this.error("Report Header Id 不存在"); } |
| | | if (!Agency_Hospital__c) { error.push("医院 不存在"); } |
| | | if (!Department_Cateogy__c) { error.push("科室 不存在"); } |
| | | if (!doctor2__c) { error.push("拜访人 不存在"); } |
| | | if (!Purpose_Type__c) { error.push("活动区分 不存在"); } |
| | | if (!Person_In_Charge2__c) { |
| | | error.push('担当 不存在'); |
| | | } |
| | | if (!Agency_Report_Header__c) { |
| | | this.error('Report Header Id 不存在'); |
| | | } |
| | | if (!Agency_Hospital__c) { |
| | | error.push('医院 不存在'); |
| | | } |
| | | if (!Department_Cateogy__c) { |
| | | error.push('科室 不存在'); |
| | | } |
| | | if (!doctor2__c) { |
| | | error.push('拜访人 不存在'); |
| | | } |
| | | if (!Purpose_Type__c) { |
| | | error.push('活动区分 不存在'); |
| | | } |
| | | // if (!SupportNeeds__c) { error.push("支援需求 不存在"); } |
| | | if (!Opportunity__c) { Opportunity__c = ""; } |
| | | if (!Product_Category1__c) { error.push("产品区分1 不存在"); } |
| | | if (Purpose_Type__c && (Purpose_Type__c.substr(-3) == 'SIS' || Purpose_Type__c.substr(-3) == 'OPD')) { |
| | | if (!Result__c) { error.push("结果 不存在"); } |
| | | if (!Opportunity__c) { |
| | | Opportunity__c = ''; |
| | | } |
| | | if (!Product_Category1__c) { |
| | | error.push('产品区分1 不存在'); |
| | | } |
| | | if ( |
| | | Purpose_Type__c && |
| | | (Purpose_Type__c.substr(-3) == 'SIS' || |
| | | Purpose_Type__c.substr(-3) == 'OPD') |
| | | ) { |
| | | if (!Result__c) { |
| | | error.push('结果 不存在'); |
| | | } |
| | | } |
| | | for (var i = 0; i < error.length; i++) { |
| | | this.warning(error[i]); |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | // 保存処理 |
| | | component.set('v.login',true); |
| | | component.set('v.loginEdit', true); |
| | | if (component.get('v.mode') == 'edit') { |
| | | var Agency_Report__c = component.get('v.select_report_data').Id; |
| | | var action = component.get('c.editAgencyReport'); |
| | | debugger |
| | | debugger; |
| | | // alert("Purpose_Type:"+Purpose_Type__c+","+"SupportNeedsc:"+SupportNeeds__c); |
| | | action.setParams({ |
| | | "Agency_Report_Id" : Agency_Report__c, |
| | | "Department_Cateogy" : Department_Cateogy__c, |
| | | "Purpose_Type" : Purpose_Type__c, |
| | | Agency_Report_Id: Agency_Report__c, |
| | | Department_Cateogy: Department_Cateogy__c, |
| | | Purpose_Type: Purpose_Type__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | "SupportNeedsc" : SupportNeeds__c, |
| | | SupportNeedsc: SupportNeeds__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | "Agency_Report_Header" : Agency_Report_Header__c, |
| | | "Agency_Hospital" : Agency_Hospital__c, |
| | | "Person_In_Charge2" : Person_In_Charge2__c, |
| | | "doctor" : doctor2__c, |
| | | "Submit_date" : Submit_date__c, |
| | | "Product_Category1" : Product_Category1__c, |
| | | "Product_Category2" : Product_Category2__c, |
| | | "Product_Category3" : Product_Category3__c, |
| | | "Result" : Result__c, |
| | | "Opportunity" : Opportunity__c, |
| | | "StageName" : StageName__c, |
| | | "oppAmount" : Amount__c, |
| | | "oppOCMPrice" : OCMSale_Price__c, |
| | | "Close_Forecasted_Date" : Close_Forecasted_Date__c, |
| | | "Report_Date" : Report_Date__c, |
| | | Agency_Report_Header: Agency_Report_Header__c, |
| | | Agency_Hospital: Agency_Hospital__c, |
| | | Person_In_Charge2: Person_In_Charge2__c, |
| | | doctor: doctor2__c, |
| | | Submit_date: Submit_date__c, |
| | | Product_Category1: Product_Category1__c, |
| | | Product_Category2: Product_Category2__c, |
| | | Product_Category3: Product_Category3__c, |
| | | Result: Result__c, |
| | | Opportunity: Opportunity__c, |
| | | StageName: StageName__c, |
| | | oppAmount: Amount__c, |
| | | oppOCMPrice: OCMSale_Price__c, |
| | | Close_Forecasted_Date: Close_Forecasted_Date__c, |
| | | Report_Date: Report_Date__c |
| | | }); |
| | | |
| | | action.setCallback(this,function(response){ |
| | |
| | | var report_id = response.getReturnValue(); |
| | | component.set('v.create_agency_report_id', report_id); |
| | | |
| | | var select_agency_list = component.get('v.allselectlist').AgencyPerson__c; |
| | | var select_agency_list = |
| | | component.get('v.allselectlist').AgencyPerson__c; |
| | | for (var i = 0; i < select_agency_list.length; i++) { |
| | | if (select_agency_list[i].value == component.get('v.select_report_data').Person_In_Charge2__c) { |
| | | if ( |
| | | select_agency_list[i].value == |
| | | component.get('v.select_report_data') |
| | | .Person_In_Charge2__c |
| | | ) { |
| | | select_agency_list[i].selected = true; |
| | | } else { |
| | | select_agency_list[i].selected = false; |
| | | } |
| | | } |
| | | component.find('select_agency_person').set('v.options', select_agency_list); |
| | | component |
| | | .find('select_agency_person') |
| | | .set('v.options', select_agency_list); |
| | | |
| | | component.set('v.update_select_report_data_id', report_id); |
| | | this.get_reports(component, event, helper, component.get('v.select_report_data').Submit_date__c, component.get('v.select_report_data').Person_In_Charge2__c); |
| | | this.get_reports_edit( |
| | | component, |
| | | event, |
| | | helper, |
| | | component.get('v.select_report_data').Submit_date__c, |
| | | component.get('v.select_report_data') |
| | | .Person_In_Charge2__c |
| | | ); |
| | | |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login',false); |
| | | } |
| | | else{ |
| | | component.set('v.loginEdit', false); |
| | | } else { |
| | | // var error = response.getError(); |
| | | // alert(JSON.stringify(error)); |
| | | // alert(JSON.stringify(error[0].fieldErrors)); |
| | |
| | | // } |
| | | this.error('save_report failed.'); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | debugger; |
| | | // alert(SupportNeeds__c); |
| | | action.setParams({ |
| | | "Department_Cateogy" : Department_Cateogy__c, |
| | | "Purpose_Type" : Purpose_Type__c, |
| | | Department_Cateogy: Department_Cateogy__c, |
| | | Purpose_Type: Purpose_Type__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | "SupportNeedsc" : SupportNeeds__c, |
| | | SupportNeedsc: SupportNeeds__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | "Agency_Report_Header" : Agency_Report_Header__c, |
| | | "Agency_Hospital" : Agency_Hospital__c, |
| | | "Person_In_Charge2" : Person_In_Charge2__c, |
| | | "doctor" : doctor2__c, |
| | | "Submit_date" : Submit_date__c, |
| | | "Product_Category1" : Product_Category1__c, |
| | | "Product_Category2" : Product_Category2__c, |
| | | "Product_Category3" : Product_Category3__c, |
| | | "Result" : Result__c, |
| | | "Opportunity" : Opportunity__c, |
| | | "StageName" : StageName__c, |
| | | "oppAmount" : Amount__c, |
| | | "oppOCMPrice" : OCMSale_Price__c, |
| | | "Close_Forecasted_Date" : Close_Forecasted_Date__c, |
| | | "Report_Date" : Report_Date__c, |
| | | Agency_Report_Header: Agency_Report_Header__c, |
| | | Agency_Hospital: Agency_Hospital__c, |
| | | Person_In_Charge2: Person_In_Charge2__c, |
| | | doctor: doctor2__c, |
| | | Submit_date: Submit_date__c, |
| | | Product_Category1: Product_Category1__c, |
| | | Product_Category2: Product_Category2__c, |
| | | Product_Category3: Product_Category3__c, |
| | | Result: Result__c, |
| | | Opportunity: Opportunity__c, |
| | | StageName: StageName__c, |
| | | oppAmount: Amount__c, |
| | | oppOCMPrice: OCMSale_Price__c, |
| | | Close_Forecasted_Date: Close_Forecasted_Date__c, |
| | | Report_Date: Report_Date__c |
| | | }); |
| | | |
| | | action.setCallback(this,function(response){ |
| | |
| | | var report_id = response.getReturnValue(); |
| | | component.set('v.create_agency_report_id', report_id); |
| | | |
| | | this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value')); |
| | | this.get_reports_edit( |
| | | component, |
| | | event, |
| | | helper, |
| | | component.find('select_date').get('v.value'), |
| | | component.find('select_agency_person').get('v.value') |
| | | ); |
| | | |
| | | // モーダルウィンドウ内の一覧用 |
| | | var action2 = component.get('c.getReportsById'); |
| | | action2.setParams({ |
| | | "report_id" : report_id, |
| | | report_id: report_id |
| | | }); |
| | | action2.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | |
| | | var res = response.getReturnValue(); |
| | | var reports_now = component.get('v.reports_now'); |
| | | var reports_now_count = 0; |
| | | if (reports_now.length > 0 && reports_now != "") { |
| | | if (reports_now.length > 0 && reports_now != '') { |
| | | reports_now_count = reports_now.length; |
| | | } |
| | | |
| | |
| | | }); |
| | | |
| | | component.set('v.reports_now', reports_now); |
| | | component.set('v.reports_now_count', reports_now.length); |
| | | var data_list = component.find('modal_data_list_tr'); |
| | | component.set( |
| | | 'v.reports_now_count', |
| | | reports_now.length |
| | | ); |
| | | var data_list = |
| | | component.find('modal_data_list_tr'); |
| | | } |
| | | } |
| | | else{ |
| | | } else { |
| | | this.error('get_reports_now failed.'); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login',false); |
| | | component |
| | | .find('save_button') |
| | | .set('v.disabled', false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action2); |
| | | |
| | | this.allclear(component); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login',false); |
| | | } |
| | | else{ |
| | | component.set('v.loginEdit', false); |
| | | } else { |
| | | var error = response.getError(); |
| | | // alert(JSON.stringify(error)); |
| | | this.error('saveAgencyReport failed.'); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | component.find('new_con').set('v.disabled', true); |
| | | component.find('select_doctor').set('v.options', clear); |
| | | component.set('v.doctor_title', ''); |
| | | component.find('select_department').set('v.options', this.conv_selected(component.get('v.allselectlist.Department_Cateogy__c'))); |
| | | component.find('select_purpose_type').set('v.options', this.conv_selected(component.get('v.allselectlist.Purpose_Type__c'))); |
| | | component |
| | | .find('select_department') |
| | | .set( |
| | | 'v.options', |
| | | this.conv_selected( |
| | | component.get('v.allselectlist.Department_Cateogy__c') |
| | | ) |
| | | ); |
| | | component |
| | | .find('select_purpose_type') |
| | | .set( |
| | | 'v.options', |
| | | this.conv_selected( |
| | | component.get('v.allselectlist.Purpose_Type__c') |
| | | ) |
| | | ); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | component.find('SupportNeeds__c').set('v.options', this.conv_selected(component.get('v.allselectlist.SupportNeeds__c'))); |
| | | component |
| | | .find('SupportNeeds__c') |
| | | .set( |
| | | 'v.options', |
| | | this.conv_selected( |
| | | component.get('v.allselectlist.SupportNeeds__c') |
| | | ) |
| | | ); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | // ToDo需要测试手机上能运行不 |
| | | component.set('v.data.Opportunity__c', ''); |
| | | component.find('select_Product1').set('v.value',''); |
| | | component.find('select_Product2').set('v.value',''); |
| | | component.find('select_Product3').set('v.value',''); |
| | | console.log('reportDate = 空'); |
| | | component.set('v.data.Report_Date__c', ''); |
| | | component.set('v.oppdata.Close_Forecasted_Date__c', ''); |
| | | component.set('v.oppdata.Amount__c', ''); |
| | |
| | | component.set('v.Amount__c_o', ''); |
| | | component.set('v.OCMSale_Price__c_o', ''); |
| | | component.set('v.StageName__c_o', ''); |
| | | $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none'); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-stage'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-amount1'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-amount2'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.addClass(component.find('input-opportunity-date'), 'disp_none'); |
| | | $A.util.removeClass(component.find('input-opportunity-blank'), 'disp_none'); |
| | | $A.util.removeClass( |
| | | component.find('input-opportunity-blank'), |
| | | 'disp_none' |
| | | ); |
| | | // if ($A.get("$Browser.formFactor") == 'DESKTOP') { |
| | | // var values = []; |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.values', values); |
| | |
| | | var ret_obj = []; |
| | | var now = new Date(); |
| | | for (var i = 0; i < count; i++) { |
| | | var start_day = new Date( |
| | | now.getFullYear(), |
| | | now.getMonth(), |
| | | now.getDate() - now.getDay() + 1 - i * 7 |
| | | ); |
| | | var end_day = new Date( |
| | | now.getFullYear(), |
| | | now.getMonth(), |
| | | now.getDate() + (7 - now.getDay()) - i * 7 |
| | | ); |
| | | |
| | | var start_day = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() + 1 - (i * 7))); |
| | | var end_day = new Date(now.getFullYear(), now.getMonth(), now.getDate() + (7 - now.getDay()) - (i * 7)); |
| | | |
| | | var start_day_show = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() - (i * 7))); |
| | | var end_day_show = new Date(now.getFullYear(), now.getMonth(), now.getDate() + (6 - now.getDay()) - (i * 7)); |
| | | var date_text = start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate() + '~' + end_day.getFullYear() + '/' + (end_day.getMonth() + 1) + '/' + end_day.getDate(); |
| | | var start_day_show = new Date( |
| | | now.getFullYear(), |
| | | now.getMonth(), |
| | | now.getDate() - now.getDay() - i * 7 |
| | | ); |
| | | var end_day_show = new Date( |
| | | now.getFullYear(), |
| | | now.getMonth(), |
| | | now.getDate() + (6 - now.getDay()) - i * 7 |
| | | ); |
| | | var date_text = |
| | | start_day.getFullYear() + |
| | | '/' + |
| | | (start_day.getMonth() + 1) + |
| | | '/' + |
| | | start_day.getDate() + |
| | | '~' + |
| | | end_day.getFullYear() + |
| | | '/' + |
| | | (end_day.getMonth() + 1) + |
| | | '/' + |
| | | end_day.getDate(); |
| | | if (i == 0) { |
| | | ret_obj.push({ |
| | | selected : true, |
| | | value : start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate(), |
| | | label : start_day_show.getFullYear() + '/' + (start_day_show.getMonth() + 1) + '/' + start_day_show.getDate() + '~' + end_day_show.getFullYear() + '/' + (end_day_show.getMonth() + 1) + '/' + end_day_show.getDate(), |
| | | value: |
| | | start_day.getFullYear() + |
| | | '/' + |
| | | (start_day.getMonth() + 1) + |
| | | '/' + |
| | | start_day.getDate(), |
| | | label: |
| | | start_day_show.getFullYear() + |
| | | '/' + |
| | | (start_day_show.getMonth() + 1) + |
| | | '/' + |
| | | start_day_show.getDate() + |
| | | '~' + |
| | | end_day_show.getFullYear() + |
| | | '/' + |
| | | (end_day_show.getMonth() + 1) + |
| | | '/' + |
| | | end_day_show.getDate() |
| | | }); |
| | | } else { |
| | | ret_obj.push({ |
| | | selected : false, |
| | | value : start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate(), |
| | | label : start_day_show.getFullYear() + '/' + (start_day_show.getMonth() + 1) + '/' + start_day_show.getDate() + '~' + end_day_show.getFullYear() + '/' + (end_day_show.getMonth() + 1) + '/' + end_day_show.getDate(), |
| | | value: |
| | | start_day.getFullYear() + |
| | | '/' + |
| | | (start_day.getMonth() + 1) + |
| | | '/' + |
| | | start_day.getDate(), |
| | | label: |
| | | start_day_show.getFullYear() + |
| | | '/' + |
| | | (start_day_show.getMonth() + 1) + |
| | | '/' + |
| | | start_day_show.getDate() + |
| | | '~' + |
| | | end_day_show.getFullYear() + |
| | | '/' + |
| | | (end_day_show.getMonth() + 1) + |
| | | '/' + |
| | | end_day_show.getDate() |
| | | }); |
| | | } |
| | | } |
| | |
| | | var action = component.get('c.createReportHeader'); |
| | | |
| | | action.setParams({ |
| | | "name" : name, |
| | | "s_date" : s_date, |
| | | "s_agency" : s_agency, |
| | | "head_key" : head_key, |
| | | name: name, |
| | | s_date: s_date, |
| | | s_agency: s_agency, |
| | | head_key: head_key |
| | | }); |
| | | |
| | | component.set('v.login',true); |
| | |
| | | component.set('v.agency_report_header_id', res); |
| | | component.set('v.login',false); |
| | | this.toggle_report(component); |
| | | } |
| | | else{ |
| | | } else { |
| | | this.error('createReportHeader callback failed.'); |
| | | component.set('v.login',false); |
| | | } |
| | |
| | | }, |
| | | |
| | | create_header_input_key : function(agency_id, s_date) { |
| | | if (typeof(s_date) != 'string') { |
| | | if (typeof s_date != 'string') { |
| | | s_date = this.get_date_string(s_date); |
| | | if (s_date == false) { |
| | | this.error('get_date_string in create_header_input_key.') |
| | | this.error('get_date_string in create_header_input_key.'); |
| | | return false; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | s_date = s_date.replace(/-/g, ''); |
| | | var headkey = agency_id + ":" + s_date; |
| | | var headkey = agency_id + ':' + s_date; |
| | | |
| | | return headkey; |
| | | }, |
| | |
| | | |
| | | // create yyyy-mm-dd string |
| | | get_date_string : function(val) { |
| | | if (typeof(val) == 'string') { |
| | | if (typeof val == 'string') { |
| | | if (val.match(/^\d{4}\/\d{1,2}\/\d{1,2}$/)) { |
| | | val = val.replace(/[\/]/g, '-'); |
| | | var tmp = val.split('-'); |
| | |
| | | }, |
| | | |
| | | searchHos : function(component, event, helper) { |
| | | var hospital_name = event.getParam("value"); |
| | | var action = component.get("c.getHospitalList"); |
| | | var hospital_name = event.getParam('value'); |
| | | var action = component.get('c.getHospitalList'); |
| | | debugger; |
| | | action.setParams({"hospital_name": hospital_name}); |
| | | action.setParams({ hospital_name: hospital_name }); |
| | | |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | if(state === "SUCCESS") { |
| | | if (state === 'SUCCESS') { |
| | | var hospital_list = component.find('hospital_list'); |
| | | var hosList = response.getReturnValue(); |
| | | if (hosList.length > 0) { |
| | |
| | | } else { |
| | | $A.util.removeClass(hospital_list, 'slds-is-open'); |
| | | } |
| | | component.set("v.hospitalList", response.getReturnValue()); |
| | | component.set('v.hospitalList', response.getReturnValue()); |
| | | } else { |
| | | $A.util.removeClass(hospital_list, 'slds-is-open'); |
| | | } |
| | |
| | | }, |
| | | |
| | | selectHos : function(component, event, helper) { |
| | | debugger |
| | | debugger; |
| | | var hospital_list = component.find('hospital_list'); |
| | | $A.util.removeClass(hospital_list, 'slds-is-open'); |
| | | var accname = event.currentTarget.dataset.accname; |
| | |
| | | component.find('new_con').set('v.disabled', false); |
| | | } |
| | | } |
| | | component.set("v.hospital", accname); |
| | | component.set("v.hospitalId", accid); |
| | | component.set('v.hospital', accname); |
| | | component.set('v.hospitalId', accid); |
| | | this.set_doctor_list(component); |
| | | this.opportunityChange(component, event, helper); |
| | | }, |
| | | |
| | | select_purpose_type : function(component) { |
| | | var purpose_type = component.find('select_purpose_type').get('v.value'); |
| | | if (purpose_type != null && purpose_type != undefined && purpose_type.substr(-3) == 'OPD' || purpose_type.substr(-3) == 'SIS') { |
| | | if ( |
| | | (purpose_type != null && |
| | | purpose_type != undefined && |
| | | purpose_type.substr(-3) == 'OPD') || |
| | | purpose_type.substr(-3) == 'SIS' |
| | | ) { |
| | | var result = component.find('result'); |
| | | $A.util.removeClass(result, 'disp_none'); |
| | | } else { |
| | |
| | | var flg = false; |
| | | for (var i = 0; i < doctor_list.length; i++) { |
| | | if (doctor_list[i].value == doctor_value) { |
| | | component.set('v.doctor_title', doctor_list[i].Doctor_Division1__c); |
| | | component.set( |
| | | 'v.doctor_title', |
| | | doctor_list[i].Doctor_Division1__c |
| | | ); |
| | | flg = true; |
| | | break; |
| | | } |
| | |
| | | set_aws_url : function(component,sobject) { |
| | | var action = component.get('c.getAwsurl'); |
| | | action.setParams({ |
| | | "sobj" : sobject, |
| | | sobj: sobject |
| | | }); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | |
| | | component.set('v.AWSinsert',awsmap.newUrl); |
| | | component.set('v.AWSsearch',awsmap.searchUrl); |
| | | component.set('v.AWStransactionURL',awsmap.transactionURL); |
| | | } |
| | | else{ |
| | | } else { |
| | | this.error('AWS url/token error.'); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | insert_agencycontact : function(component,token,newUrl,payload,agencyHospitalid,helper,hospitalName) { |
| | | |
| | | insert_agencycontact: function ( |
| | | component, |
| | | token, |
| | | newUrl, |
| | | payload, |
| | | agencyHospitalid, |
| | | helper, |
| | | hospitalName |
| | | ) { |
| | | // AWSService.insert(newUrl,payload,function(result){ |
| | | // if(result.status == '0'){ |
| | | // $A.getCallback(function(){ |
| | |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | } |
| | | }).then((data) => { |
| | | }) |
| | | .then((data) => { |
| | | return data.json(); |
| | | }).then((result) => { |
| | | }) |
| | | .then((result) => { |
| | | if(result.status == '0'){ |
| | | $A.getCallback(function(){ |
| | | helper.to_agencycontact(component,result,agencyHospitalid); |
| | | helper.to_agencycontact( |
| | | component, |
| | | result, |
| | | agencyHospitalid |
| | | ); |
| | | })(); |
| | | }else{ |
| | | console.log('AWS status error:' + result) |
| | | component.set('v.login',false); |
| | | console.log('AWS status error:' + result); |
| | | component.set('v.loginEdit', false); |
| | | if(result.status == '129'){ |
| | | component.find('OppMessage').setError('该客户人员名字已存在,在'+hospitalName+'医院,请修改'); |
| | | component |
| | | .find('OppMessage') |
| | | .setError( |
| | | '该客户人员名字已存在,在' + |
| | | hospitalName + |
| | | '医院,请修改' |
| | | ); |
| | | }else{ |
| | | component.find('OppMessage').setError('AWS insert error.'); |
| | | component |
| | | .find('OppMessage') |
| | | .setError('AWS insert error.'); |
| | | } |
| | | } |
| | | }).catch(error => { |
| | | console.log('AWS insert error:' + error) |
| | | component.set('v.login',false); |
| | | }) |
| | | .catch((error) => { |
| | | console.log('AWS insert error:' + error); |
| | | component.set('v.loginEdit', false); |
| | | component.find('OppMessage').setError('AWS insert error.'); |
| | | }); |
| | | |
| | | }, |
| | | |
| | | to_agencycontact : function(component,result,agencyHospitalid) { |
| | | var action = component.get('c.saveAgencyContact'); |
| | | action.setParams({ |
| | | "name" : result.object[0].name, |
| | | name: result.object[0].name, |
| | | //"nameEncrypt" : result.object[0].nameEncrypt, |
| | | "type" : result.object[0].type, |
| | | type: result.object[0].type, |
| | | //"typeEncrypt" : result.object[0].typeEncrypt, |
| | | "doctorDivision1" : result.object[0].doctorDivision1, |
| | | doctorDivision1: result.object[0].doctorDivision1, |
| | | //"doctorDivision1Encrypt" : result.object[0].doctorDivision1Encrypt, |
| | | "agencyHospitalid" : agencyHospitalid, |
| | | "awsid" : result.object[0].dataId, |
| | | agencyHospitalid: agencyHospitalid, |
| | | awsid: result.object[0].dataId |
| | | }); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | |
| | | data['sfRecordId'] = ''; |
| | | data['txId'] = result.txId; |
| | | |
| | | this.to_confirm(component,token,confirmUrl,JSON.stringify(data)); |
| | | this.to_confirm( |
| | | component, |
| | | token, |
| | | confirmUrl, |
| | | JSON.stringify(data) |
| | | ); |
| | | }else if(acMap.errormsg != ''){ |
| | | this.error(acMap.errormsg); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | }else { |
| | | this.error('agency contact insert id error.'); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | } |
| | | else{ |
| | | } else { |
| | | this.error('agency contact insert error.'); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | } |
| | | }).then((data) => { |
| | | }) |
| | | .then((data) => { |
| | | return data.json(); |
| | | }).then((result) => { |
| | | if(result.status == '0' && result.hasOwnProperty('success') && result.success){ |
| | | }) |
| | | .then((result) => { |
| | | if ( |
| | | result.status == '0' && |
| | | result.hasOwnProperty('success') && |
| | | result.success |
| | | ) { |
| | | component.set('v.truthy', false); |
| | | var modal_newAC = component.find('modal_newAC') |
| | | var modal_newAC = component.find('modal_newAC'); |
| | | $A.util.addClass(modal_newAC, 'disp_none'); |
| | | this.success('.客户人员已创建。'); |
| | | this.set_doctor_list(component); |
| | | }else { |
| | | this.error('AWS confirm error.'); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }).catch(error => { |
| | | }) |
| | | .catch((error) => { |
| | | this.error('AWS confirm error.'); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | }); |
| | | }, |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | |
| | | set_doctor_list : function(component) { |
| | | var hospital_id = component.get('v.hospitalLinkId'); |
| | | if (hospital_id) { |
| | | component.set('v.login',true); |
| | | component.set('v.loginEdit', true); |
| | | var action = component.get('c.getDoctorList'); |
| | | action.setParams({ |
| | | "hospital_id" : hospital_id, |
| | | hospital_id: hospital_id |
| | | }); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | |
| | | component.set('v.login',false); |
| | | */ |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | } |
| | | else{ |
| | | } else { |
| | | this.error('set_doctor_list failed.'); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | |
| | | var dataArr = new Array(); |
| | | for (const key in retMap) { |
| | | if (key == 'sre') {continue;} |
| | | if (key == 'sre') { |
| | | continue; |
| | | } |
| | | dataArr.push(key); |
| | | } |
| | | if(dataArr.length == 0){ |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | this.warning('没有找到符合条件的客户人员'); |
| | | return; |
| | | } |
| | |
| | | this.search_agency_contact(token,searchUrl,data,retMap,component); |
| | | }, |
| | | |
| | | search_agency_contact : function(token,searchUrl,payload,retMap,component) { |
| | | this.search_core(token,searchUrl,payload,(result)=>{ |
| | | search_agency_contact: function ( |
| | | token, |
| | | searchUrl, |
| | | payload, |
| | | retMap, |
| | | component |
| | | ) { |
| | | this.search_core( |
| | | token, |
| | | searchUrl, |
| | | payload, |
| | | (result) => { |
| | | if(result.status == '0'){ |
| | | this.to_doctor_list(result,retMap,component); |
| | | }else{ |
| | | this.error('AWS search status4 : ' + result.status); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | },component); |
| | | }, |
| | | component |
| | | ); |
| | | // fetch(searchUrl, { |
| | | // method: 'POST', |
| | | // body: payload, |
| | |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | } |
| | | }).then((data) => { |
| | | }) |
| | | .then((data) => { |
| | | return data.json(); |
| | | }).then((result) => { |
| | | component.set('v.login',false); |
| | | }) |
| | | .then((result) => { |
| | | component.set('v.loginEdit', false); |
| | | if(callback)callback(result); |
| | | }).catch(error => { |
| | | }) |
| | | .catch((error) => { |
| | | console.log('error = ' + JSON.stringify(error)); |
| | | this.error('AWS search error.'); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | }); |
| | | }, |
| | | |
| | |
| | | |
| | | component.set('v.default_select_doctor_id', ''); |
| | | component.set('v.doctor_list', res); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | }, |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | |
| | |
| | | // }, |
| | | |
| | | opportunityChange : function(component, event, helper) { |
| | | debugger |
| | | debugger; |
| | | var opp_id = component.get('v.data.Opportunity__c'); |
| | | if (opp_id == '') { |
| | | $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-date'), 'disp_none'); |
| | | $A.util.removeClass(component.find('input-opportunity-blank'), 'disp_none'); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-stage'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-amount1'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-amount2'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-date'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.removeClass( |
| | | component.find('input-opportunity-blank'), |
| | | 'disp_none' |
| | | ); |
| | | } else if (opp_id == 'MALFORMED_ID') { |
| | | component.set('v.data.Opportunity__c', ''); |
| | | $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-date'), 'disp_none'); |
| | | $A.util.removeClass(component.find('input-opportunity-blank'), 'disp_none'); |
| | | } else if (opp_id != "") { |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-stage'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-amount1'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-amount2'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-date'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.removeClass( |
| | | component.find('input-opportunity-blank'), |
| | | 'disp_none' |
| | | ); |
| | | } else if (opp_id != '') { |
| | | var hospital_link_id = component.get('v.hospitalLinkId'); |
| | | if (hospital_link_id == '') { |
| | | this.warning('医院不存在'); |
| | | // ToDo需要测试手机上能运行不 |
| | | component.set('v.data.Opportunity__c', ''); |
| | | $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-date'), 'disp_none'); |
| | | $A.util.removeClass(component.find('input-opportunity-blank'), 'disp_none'); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-stage'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-amount1'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-amount2'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-date'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.removeClass( |
| | | component.find('input-opportunity-blank'), |
| | | 'disp_none' |
| | | ); |
| | | // if ($A.get("$Browser.formFactor") == 'DESKTOP') { |
| | | // var values = []; |
| | | // // component.find('input-opportunity').get("v.body")[0].set('v.values', values); |
| | |
| | | // } |
| | | return false; |
| | | } |
| | | var action = component.get('c.selectOpportunityByIdAndHospitalLinkId'); |
| | | var action = component.get( |
| | | 'c.selectOpportunityByIdAndHospitalLinkId' |
| | | ); |
| | | action.setParams({ |
| | | "opportunity_id" : opp_id, |
| | | "agency_hospital_link_id" : component.get('v.hospitalLinkId'), |
| | | opportunity_id: opp_id, |
| | | agency_hospital_link_id: component.get('v.hospitalLinkId') |
| | | }); |
| | | |
| | | component.set('v.login',true); |
| | | component.set('v.loginEdit', true); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | |
| | | } |
| | | // ToDo需要测试手机上能运行不 |
| | | component.set('v.data.Opportunity__c', ''); |
| | | $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-date'), 'disp_none'); |
| | | $A.util.removeClass(component.find('input-opportunity-blank'), 'disp_none'); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-stage'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-amount1'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-amount2'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-date'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.removeClass( |
| | | component.find('input-opportunity-blank'), |
| | | 'disp_none' |
| | | ); |
| | | // if ($A.get("$Browser.formFactor") == 'DESKTOP') { |
| | | // var values = []; |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.values', values); |
| | | // } else { |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', ''); |
| | | // } |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | return false; |
| | | } |
| | | //SWAG-CKH5M8 【委托】周报关联询价,可选择询价范围调整 fy start |
| | |
| | | else { |
| | | component.set('v.loadOpp', false); |
| | | component.set('v.oppdata',res[0]); |
| | | this.set_selected(component, 'select_stageName', res[0].StageName__c); |
| | | component.set('v.Close_Forecasted_Date__c_o', res[0].Close_Forecasted_Date__c); |
| | | this.set_selected( |
| | | component, |
| | | 'select_stageName', |
| | | res[0].StageName__c |
| | | ); |
| | | component.set( |
| | | 'v.Close_Forecasted_Date__c_o', |
| | | res[0].Close_Forecasted_Date__c |
| | | ); |
| | | component.set('v.Amount__c_o', res[0].Amount__c); |
| | | component.set('v.OCMSale_Price__c_o', res[0].OCMSale_Price__c); |
| | | component.set( |
| | | 'v.OCMSale_Price__c_o', |
| | | res[0].OCMSale_Price__c |
| | | ); |
| | | component.set('v.StageName__c_o', res[0].StageName__c); |
| | | |
| | | $A.util.removeClass(component.find('input-opportunity-stage'), 'disp_none'); |
| | | $A.util.removeClass(component.find('input-opportunity-amount1'), 'disp_none'); |
| | | $A.util.removeClass(component.find('input-opportunity-amount2'), 'disp_none'); |
| | | $A.util.removeClass(component.find('input-opportunity-date'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-blank'), 'disp_none'); |
| | | $A.util.removeClass( |
| | | component.find('input-opportunity-stage'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.removeClass( |
| | | component.find('input-opportunity-amount1'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.removeClass( |
| | | component.find('input-opportunity-amount2'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.removeClass( |
| | | component.find('input-opportunity-date'), |
| | | 'disp_none' |
| | | ); |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-blank'), |
| | | 'disp_none' |
| | | ); |
| | | } |
| | | |
| | | component.set('v.login',false); |
| | | } |
| | | else{ |
| | | this.error('selectOpportunityByIdAndHospitalLinkId failed.'); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | } else { |
| | | this.error( |
| | | 'selectOpportunityByIdAndHospitalLinkId failed.' |
| | | ); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | }, |
| | | |
| | | productcategoryChange1 : function(component, event, helper) { |
| | | var product_category_id = component.find('select_Product1').get('v.value'); |
| | | var product_category_id = component |
| | | .find('select_Product1') |
| | | .get('v.value'); |
| | | var pcId1 = component.find('select_Product2').get('v.value'); |
| | | var pcId2 = component.find('select_Product3').get('v.value'); |
| | | var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined; |
| | | var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined; |
| | | var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined; |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | var p0bool = |
| | | product_category_id != '' && |
| | | product_category_id != null && |
| | | product_category_id != undefined; |
| | | if ( |
| | | (p1bool && p0bool && product_category_id == pcId1) || |
| | | (p2bool && p0bool && product_category_id == pcId2) |
| | | ) { |
| | | this.warning('不能选择同样的产品区分'); |
| | | component.find('select_Product1').set('v.value',''); |
| | | } |
| | | }, |
| | | productcategoryChange2 : function(component, event, helper) { |
| | | var product_category_id = component.find('select_Product2').get('v.value'); |
| | | var product_category_id = component |
| | | .find('select_Product2') |
| | | .get('v.value'); |
| | | var pcId1 = component.find('select_Product1').get('v.value'); |
| | | var pcId2 = component.find('select_Product3').get('v.value'); |
| | | var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined; |
| | | var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined; |
| | | var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined; |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | var p0bool = |
| | | product_category_id != '' && |
| | | product_category_id != null && |
| | | product_category_id != undefined; |
| | | if ( |
| | | (p1bool && p0bool && product_category_id == pcId1) || |
| | | (p2bool && p0bool && product_category_id == pcId2) |
| | | ) { |
| | | this.warning('不能选择同样的产品区分'); |
| | | component.find('select_Product2').set('v.value',''); |
| | | } |
| | | }, |
| | | productcategoryChange3 : function(component, event, helper) { |
| | | var product_category_id = component.find('select_Product3').get('v.value'); |
| | | var product_category_id = component |
| | | .find('select_Product3') |
| | | .get('v.value'); |
| | | var pcId1 = component.find('select_Product1').get('v.value'); |
| | | var pcId2 = component.find('select_Product2').get('v.value'); |
| | | var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined; |
| | | var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined; |
| | | var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined; |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | var p0bool = |
| | | product_category_id != '' && |
| | | product_category_id != null && |
| | | product_category_id != undefined; |
| | | if ( |
| | | (p1bool && p0bool && product_category_id == pcId1) || |
| | | (p2bool && p0bool && product_category_id == pcId2) |
| | | ) { |
| | | this.warning('不能选择同样的产品区分'); |
| | | component.find('select_Product3').set('v.value',''); |
| | | } |
| | |
| | | }, |
| | | |
| | | success : function(message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | toastEvent.setParams({ |
| | | "title" : "成功!", |
| | | "message" : message, |
| | | "type" : "success", |
| | | "duration" : "5000" |
| | | title: '成功!', |
| | | message: message, |
| | | type: 'success', |
| | | duration: '5000' |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | |
| | | warning : function(message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | toastEvent.setParams({ |
| | | "title": "警告!", |
| | | "message": message, |
| | | "type":"warning", |
| | | "duration" : "10000" |
| | | title: '警告!', |
| | | message: message, |
| | | type: 'warning', |
| | | duration: '10000' |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | |
| | | error : function(message) { |
| | | // $('toastMessage.forceToastManager').css('white-space', 'pre-wrap'); |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | |
| | | toastEvent.setParams({ |
| | | "title": "错误!", |
| | | "message": message, |
| | | "type":"error", |
| | | "duration" : "sticky" |
| | | title: '错误!', |
| | | message: message, |
| | | type: 'error', |
| | | duration: 'sticky' |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | |
| | | createCon : function(component, event, helper) { |
| | | var modal_newAC = component.find('modal_newAC') |
| | | var modal_newAC = component.find('modal_newAC'); |
| | | $A.util.removeClass(modal_newAC, 'disp_none'); |
| | | component.set('v.truthy', true); |
| | | // var modal_newAC = component.find('modal_newAC') |
| | |
| | | // vivek end 添加验证 |
| | | |
| | | hideCmp : function(component, event, helper) { |
| | | var div1 = component.find('report') |
| | | var div2 = component.find('report_list') |
| | | var div1 = component.find('report'); |
| | | var div2 = component.find('report_list'); |
| | | $A.util.addClass(div1, 'disp_none'); |
| | | $A.util.addClass(div2, 'disp_none'); |
| | | }, |
| | |
| | | var displayValue = event.getParams().response.fields.Name.value; |
| | | event.setParams({}); |
| | | component.set('v.truthy', false); |
| | | var modal_newAC = component.find('modal_newAC') |
| | | var modal_newAC = component.find('modal_newAC'); |
| | | $A.util.addClass(modal_newAC, 'disp_none'); |
| | | this.success('.客户人员已创建。'); |
| | | this.set_doctor_list(component); |
| | |
| | | |
| | | createCancel : function(component, event, helper) { |
| | | component.set('v.truthy', false); |
| | | var modal_newAC = component.find('modal_newAC') |
| | | var modal_newAC = component.find('modal_newAC'); |
| | | $A.util.addClass(modal_newAC, 'disp_none'); |
| | | }, |
| | | setOpportunity_cfilter : function(component) { |
| | | debugger |
| | | debugger; |
| | | var hosId = component.get('v.hospitalId'); |
| | | var Department_Cateogy__c = component.find('select_department').get('v.value'); |
| | | var Department_Cateogy__c = component |
| | | .find('select_department') |
| | | .get('v.value'); |
| | | var opportunity_cfilter = ''; |
| | | if (hosId != '' && hosId != null) { |
| | | opportunity_cfilter = ' Agency_Hospital__r.Hospital__c=' + '\'' + hosId + '\''; |
| | | opportunity_cfilter = |
| | | ' Agency_Hospital__r.Hospital__c=' + "'" + hosId + "'"; |
| | | } |
| | | if (Department_Cateogy__c != '' && Department_Cateogy__c != null) { |
| | | if (opportunity_cfilter != '' && opportunity_cfilter != null) { |
| | | opportunity_cfilter += ' AND '; |
| | | } |
| | | opportunity_cfilter += 'Department_Cateogy__c=' + '\'' + Department_Cateogy__c + '\''; |
| | | opportunity_cfilter += |
| | | 'Department_Cateogy__c=' + "'" + Department_Cateogy__c + "'"; |
| | | } |
| | | component.set('v.opportunity_cfilter', opportunity_cfilter); |
| | | component.set('v.data.Opportunity__c', null); |
| | |
| | | if(!file.name.match(/\.(csv||CSV)$/)){ |
| | | return alert('only support csv files'); |
| | | }else{ |
| | | |
| | | reader = new FileReader(); |
| | | reader.onerror =function errorHandler(evt) { |
| | | switch(evt.target.error.code) { |
| | |
| | | break; // noop |
| | | default: |
| | | alert('An error occurred reading this file.'); |
| | | }; |
| | | } |
| | | }; |
| | | //reader.onprogress = updateProgress; |
| | | reader.onabort = function(e) { |
| | | alert('File read cancelled'); |
| | | }; |
| | | reader.onloadstart = function(e) { |
| | | |
| | | var output = '<ui type=\"disc\"><li><strong>'+file.name +'</strong> ('+file.type+')- '+file.size+'bytes, last modified: '+file.lastModifiedDate.toLocaleDateString()+'</li></ui>'; |
| | | component.set("v.filename",file.name); |
| | | component.set("v.TargetFileName",output); |
| | | |
| | | var output = |
| | | '<ui type="disc"><li><strong>' + |
| | | file.name + |
| | | '</strong> (' + |
| | | file.type + |
| | | ')- ' + |
| | | file.size + |
| | | 'bytes, last modified: ' + |
| | | file.lastModifiedDate.toLocaleDateString() + |
| | | '</li></ui>'; |
| | | component.set('v.filename', file.name); |
| | | component.set('v.TargetFileName', output); |
| | | }; |
| | | reader.onload = function(e) { |
| | | var data=e.target.result; |
| | | component.set("v.fileContentData",data); |
| | | console.log("file data"+JSON.stringify(data)); |
| | | component.set('v.fileContentData', data); |
| | | console.log('file data' + JSON.stringify(data)); |
| | | // console.log("file data"+encodeURI(JSON.stringify(data),"utf-8")); |
| | | var allTextLines = data.split(/\r\n|\n/); |
| | | var dataRows=allTextLines.length-1; |
| | |
| | | |
| | | // console.log("Rows length::"+dataRows); |
| | | |
| | | |
| | | var numOfRows=component.get("v.NumOfRecords"); |
| | | if(dataRows > numOfRows+1 || dataRows == 1 || dataRows== 0){ |
| | | |
| | | alert("File Rows between 1 to "+numOfRows+" ."); |
| | | component.set("v.showMain",true); |
| | | |
| | | } |
| | | else{ |
| | | var numOfRows = component.get('v.NumOfRecords'); |
| | | if ( |
| | | dataRows > numOfRows + 1 || |
| | | dataRows == 1 || |
| | | dataRows == 0 |
| | | ) { |
| | | alert('File Rows between 1 to ' + numOfRows + ' .'); |
| | | component.set('v.showMain', true); |
| | | } else { |
| | | var lines = []; |
| | | var filecontentdata; |
| | | var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">"; |
| | | content += "<thead><tr class=\"slds-text-title--caps\">"; |
| | | content += '<th scope=\"col"\>'+'行号'+'</th>'; |
| | | var content = |
| | | '<table class="table slds-table slds-table--bordered slds-table--cell-buffer">'; |
| | | content += '<thead><tr class="slds-text-title--caps">'; |
| | | content += '<th scope="col">' + '行号' + '</th>'; |
| | | for(i=0;i<headers.length; i++){ |
| | | content += '<th scope=\"col"\>'+headers[i]+'</th>'; |
| | | content += '<th scope="col">' + headers[i] + '</th>'; |
| | | } |
| | | content += "</tr></thead>"; |
| | | content += '</tr></thead>'; |
| | | for (var i=1; i<allTextLines.length; i++) { |
| | | filecontentdata = allTextLines[i].split(','); |
| | | if(filecontentdata[0]!=''){ |
| | | content +="<tr>"; |
| | | content +="<td>"+i+"</td>"; |
| | | content += '<tr>'; |
| | | content += '<td>' + i + '</td>'; |
| | | for(var j=0;j<filecontentdata.length;j++){ |
| | | content +='<td>'+filecontentdata[j]+'</td>'; |
| | | content += |
| | | '<td>' + filecontentdata[j] + '</td>'; |
| | | } |
| | | content +="</tr>"; |
| | | content += '</tr>'; |
| | | } |
| | | } |
| | | content += "</table>"; |
| | | content += '</table>'; |
| | | console.log(content); |
| | | component.set("v.TableContent",content); |
| | | component.set("v.showMain",false); |
| | | component.set('v.TableContent', content); |
| | | component.set('v.showMain', false); |
| | | } |
| | | } |
| | | }; |
| | | reader.readAsText(file,'gb2312'); |
| | | |
| | | } |
| | | var reader = new FileReader(); |
| | | reader.onloadend = function() { |
| | | |
| | | }; |
| | | reader.onloadend = function () {}; |
| | | reader.readAsDataURL(file); |
| | | }, |
| | | |
| | | saveRecords : function(component,event,helper){ |
| | | component.set('v.login',true); |
| | | debugger; |
| | | component.set('v.loginEdit', true); |
| | | //fy 导入 20220424 start |
| | | var action1 = component.get("c.processDataAWSId"); |
| | | var action1 = component.get('c.processDataAWSId'); |
| | | action1.setParams({ |
| | | fileData : component.get("v.fileContentData"), |
| | | fileData: component.get('v.fileContentData') |
| | | }); |
| | | debugger; |
| | | action1.setCallback(this, function(response) { |
| | | console.log('response = ' + JSON.stringify(response)); |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | if (state === 'SUCCESS') { |
| | | var ress = response.getReturnValue(); |
| | | console.log('ress = ' + JSON.stringify(ress)); |
| | | if(ress){ |
| | |
| | | console.log('res = ' + JSON.stringify(res)); |
| | | var dataArr = new Array(); |
| | | var dataMap = new Map(); |
| | | res.forEach(item => { |
| | | res.forEach((item) => { |
| | | if(item.AWS_Data_Id__c){ |
| | | dataArr.push(item.AWS_Data_Id__c); |
| | | //dataMap.set(item.AWS_Data_Id__c,item.Name_Encrypted__c); |
| | | dataMap.set(item.AWS_Data_Id__c,item.AWS_Data_Id__c); //zhj 新方案改造 2022-12-21 |
| | | dataMap.set( |
| | | item.AWS_Data_Id__c, |
| | | item.AWS_Data_Id__c |
| | | ); //zhj 新方案改造 2022-12-21 |
| | | } |
| | | }); |
| | | debugger |
| | | let obj= Object.create(null); |
| | | obj['dataIds'] = dataArr; |
| | | var payload = JSON.stringify(obj); |
| | | this.search_contact_url(component, 'Agency_Contact__c', (result)=>{ |
| | | console.log('payload zhj = ' + JSON.stringify(payload)); |
| | | |
| | | this.search_contact_url( |
| | | component, |
| | | 'Agency_Contact__c', |
| | | (result) => { |
| | | var token = result.token; |
| | | var searchUrl = result.searchUrl; |
| | | this.search_core(token,searchUrl,payload,(result)=>{ |
| | | this.search_core( |
| | | token, |
| | | searchUrl, |
| | | payload, |
| | | (result) => { |
| | | if(result.status == '0'){ |
| | | if(result.object != null&&result.object.length != 0){ |
| | | if ( |
| | | result.object != null && |
| | | result.object.length != 0 |
| | | ) { |
| | | // var resultjson = JSON.stringify(result.object); |
| | | // if(resultjson){ |
| | | // debugger |
| | |
| | | // component.set('v.login',true); |
| | | // this.ImportMethod(component,resultjson); |
| | | // } |
| | | component.set('v.login',true); |
| | | this.saveRecordsEditFile(component,dataMap,result.object,helper); |
| | | component.set( |
| | | 'v.loginEdit', |
| | | true |
| | | ); |
| | | this.saveRecordsEditFile( |
| | | component, |
| | | dataMap, |
| | | result.object, |
| | | helper |
| | | ); |
| | | }else{ |
| | | this.error('AWS search status5 ' ); |
| | | component.set('v.login',false); |
| | | this.error('AWS 查询数据为空 '); |
| | | component.set( |
| | | 'v.loginEdit', |
| | | false |
| | | ); |
| | | } |
| | | }else{ |
| | | this.error('AWS search status6 : ' + result.status); |
| | | component.set('v.login',false); |
| | | this.error( |
| | | 'AWS search status6 : ' + |
| | | result.status |
| | | ); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | },component); |
| | | }, |
| | | component |
| | | ); |
| | | // var resultjson =null; |
| | | // this.ImportMethod(component,resultjson); |
| | | |
| | | }); |
| | | } |
| | | ); |
| | | // var resultjson =null; |
| | | // this.ImportMethod(component,resultjson); |
| | | }else{ |
| | | this.error(valur[1]+'\n'+"请修改后重新上传"); |
| | | this.error(valur[1] + '\n' + '请修改后重新上传'); |
| | | } |
| | | } |
| | | } |
| | |
| | | // } |
| | | // }); |
| | | // $A.enqueueAction(action); |
| | | |
| | | },ImportMethod : function(component,fileStr){ |
| | | var actionss = component.get("c.processData"); |
| | | }, |
| | | isNumber: function (str) { |
| | | return /^\d+$/.test(str); |
| | | }, |
| | | ImportMethod: function (component, fileStr) { |
| | | debugger; |
| | | var actionss = component.get('c.processData'); |
| | | var selectDate = component.find('select_date').get('v.value'); |
| | | var fieldsList=['Name','Phone','AccountNumber']; //Please write your code dynamic |
| | | var sss=component.get("v.fileContentData"); |
| | | var sss = component.get('v.fileContentData'); |
| | | actionss.setParams({ |
| | | // fileData : component.get("v.fileContentData"), |
| | | fileData : fileStr, |
| | |
| | | actionss.setCallback(this, function(response) { |
| | | console.log('002'); |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | if (state === 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | var res1 = ''; |
| | | console.log("[[[[[["+res); |
| | | console.log('[[[[[[' + res); |
| | | if(res != 'success'){ |
| | | var ress = res.split('='); |
| | | console.log(ress); |
| | | let errorDatas = []; |
| | | let errorDataRow = []; |
| | | debugger; |
| | | var fileContentData = component |
| | | .get('v.fileContentData') |
| | | .split('\n'); |
| | | for (var i=0; i<ress.length; i++) { |
| | | res1 += ress[i].substr(7)+'\n'; |
| | | if (ress[i] != '') { |
| | | let errorData = {}; |
| | | if ( |
| | | !this.isNumber( |
| | | ress[i].substr(7).substring(1, 2) |
| | | ) |
| | | ) { |
| | | continue; |
| | | } |
| | | // $('.forceToastManager').css('white-space', 'pre-wrap'); |
| | | console.log("=="+res1); |
| | | this.error(res1+"请修改后重新上传"); |
| | | component.set('v.login',false); |
| | | let index = errorDataRow.indexOf( |
| | | ress[i].substr(7).substring(1, 2) |
| | | ); |
| | | if (index == -1) { |
| | | errorData.errorRow = ress[i] |
| | | .substr(7) |
| | | .substring(1, 2); |
| | | errorDataRow.push(errorData.errorRow); |
| | | errorData.errorInfo = ress[i] |
| | | .substr(7) |
| | | .substring(5) |
| | | .replace('=', ''); |
| | | if (errorData.errorInfo == '拜访人不存在') { |
| | | console.log( |
| | | 'errorData.errorRow = ' + |
| | | errorData.errorRow |
| | | ); |
| | | errorData.errorInfo = |
| | | '拜访人 ' + |
| | | fileContentData[ |
| | | errorData.errorRow |
| | | ].split(',')[4] + |
| | | '不存在'; |
| | | } |
| | | errorDatas.push(errorData); |
| | | }else{ |
| | | component.set("v.showMain",true); |
| | | this.success("导入成功"); |
| | | // alert('saved successfully'); |
| | | component.set('v.login',false); |
| | | if ( |
| | | ress[i].substr(7).substring(5) == |
| | | '拜访人不存在' |
| | | ) { |
| | | errorDatas[index].errorInfo += |
| | | '; ' + |
| | | '拜访人 ' + |
| | | fileContentData[ |
| | | errorDatas[index].errorRow |
| | | ].split(',')[4] + |
| | | '不存在'; |
| | | } else { |
| | | errorDatas[index].errorInfo += |
| | | '; ' + ress[i].substr(7).substring(5); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | let errorColumns = [ |
| | | { |
| | | label: '错误行', |
| | | fieldName: 'errorRow', |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | initialWidth: 100 |
| | | }, |
| | | { |
| | | label: '错误信息', |
| | | fieldName: 'errorInfo', |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | initialWidth: 300, |
| | | wrapText: true |
| | | } |
| | | ]; |
| | | for ( |
| | | var i = 0; |
| | | i < fileContentData[0].split(',').length; |
| | | i++ |
| | | ) { |
| | | errorColumns.push({ |
| | | label: fileContentData[0].split(',')[i], |
| | | fieldName: 'field' + i, |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | initialWidth: 120 |
| | | }); |
| | | } |
| | | |
| | | for (var i = 0; i < errorDatas.length; i++) { |
| | | let data = fileContentData[errorDatas[i].errorRow]; |
| | | console.log('data = ' + JSON.stringify(data)); |
| | | if (data) { |
| | | for (var j = 0; j < data.split(',').length; j++) { |
| | | let label = 'field' + j; |
| | | errorDatas[i][label] = data.split(',')[j]; |
| | | } |
| | | else if (state === "INCOMPLETE") { |
| | | } |
| | | } |
| | | component.set('v.errorColumns', errorColumns); |
| | | component.set('v.errorData', errorDatas); |
| | | component.set('v.showErrorInfo', true); |
| | | console.log('==' + res1); |
| | | this.error(res1 + '请修改后重新上传'); |
| | | component.set('v.loginEdit', false); |
| | | } else { |
| | | component.set('v.showMain', true); |
| | | this.success('导入成功'); |
| | | // alert('saved successfully'); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | } else if (state === 'INCOMPLETE') { |
| | | // do something |
| | | component.set('v.login',false); |
| | | } |
| | | else if (state === "ERROR") { |
| | | component.set('v.loginEdit', false); |
| | | } else if (state === 'ERROR') { |
| | | var errors = response.getError(); |
| | | if (errors) { |
| | | if (errors[0] && errors[0].message) { |
| | | console.log("Error message: " + |
| | | errors[0].message); |
| | | component.set('v.login',false); |
| | | console.log('Error message: ' + errors[0].message); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | } else { |
| | | console.log("Unknown error"); |
| | | component.set('v.login',false); |
| | | console.log('Unknown error'); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | } |
| | | }); |
| | | $A.enqueueAction(actionss); |
| | | },saveRecordsEditFile : function(component,dataMap,searchData,helper){ |
| | | }, |
| | | saveRecordsEditFile: function (component, dataMap, searchData, helper) { |
| | | var searchDataMap = new Map(); |
| | | for (var i = 0; i < searchData.length; i++) { |
| | | var sd = searchData[i]; |
| | | searchDataMap.set(sd.name.replace(' ',''),sd.dataId); |
| | | if (sd.name) searchDataMap.set(sd.name.replace(' ', ''), sd.dataId); |
| | | } |
| | | console.log('searchDataMap='+searchDataMap); |
| | | var error = ''; |
| | | var fileData = component.get("v.fileContentData"); |
| | | var fileData = component.get('v.fileContentData'); |
| | | var files = fileData.split('\n'); |
| | | |
| | | var fileStr = files[0]; |
| | |
| | | } |
| | | |
| | | if (error != '') { |
| | | console.log('zhj error = ' + error); |
| | | let errorArray = error.split('error1'); |
| | | let errorDatas = []; |
| | | let errorDataRow = []; |
| | | debugger; |
| | | var fileContentData = component |
| | | .get('v.fileContentData') |
| | | .split('\n'); |
| | | console.log('errorArray = ' + JSON.stringify(errorArray)); |
| | | for (var i in errorArray) { |
| | | if (errorArray[i] != '') { |
| | | let errorData = {}; |
| | | if (!this.isNumber(errorArray[i].trim().substring(1, 2))) { |
| | | continue; |
| | | } |
| | | let index = errorDataRow.indexOf( |
| | | errorArray[i].trim().substring(1, 2) |
| | | ); |
| | | if (index == -1) { |
| | | errorData.errorRow = errorArray[i] |
| | | .trim() |
| | | .substring(1, 2); |
| | | errorDataRow.push(errorData.errorRow); |
| | | errorData.errorInfo = errorArray[i] |
| | | .trim() |
| | | .substring(5, errorArray[i].trim().length) |
| | | .replace('=', ''); |
| | | if (errorData.errorInfo == '拜访人AWS不存在') { |
| | | errorData.errorInfo = |
| | | '拜访人 ' + |
| | | fileContentData[errorData.errorRow].split( |
| | | ',' |
| | | )[4] + |
| | | '不存在'; |
| | | } |
| | | errorDatas.push(errorData); |
| | | } else { |
| | | if ( |
| | | errorArray[i].trim().substring(5) == |
| | | '拜访人AWS不存在' |
| | | ) { |
| | | errorData[index].errorInfo = |
| | | '; ' + |
| | | '拜访人 ' + |
| | | fileContentData[ |
| | | errorDatas[index].errorRow |
| | | ].split(',')[4] + |
| | | '不存在'; |
| | | } else { |
| | | errorDatas[index].errorInfo += |
| | | '; ' + |
| | | errorArray[i] |
| | | .trim() |
| | | .substring(5, errorArray[i].trim().length); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | var fileContentData = component |
| | | .get('v.fileContentData') |
| | | .split('\n'); |
| | | let errorColumns = [ |
| | | { |
| | | label: '错误行', |
| | | fieldName: 'errorRow', |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | initialWidth: 100 |
| | | }, |
| | | { |
| | | label: '错误信息', |
| | | fieldName: 'errorInfo', |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | initialWidth: 300, |
| | | wrapText: true |
| | | } |
| | | ]; |
| | | for (var i = 0; i < fileContentData[0].split(',').length; i++) { |
| | | errorColumns.push({ |
| | | label: fileContentData[0].split(',')[i], |
| | | fieldName: 'field' + i, |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | initialWidth: 120 |
| | | }); |
| | | } |
| | | |
| | | for (var i = 0; i < errorDatas.length; i++) { |
| | | let data = fileContentData[errorDatas[i].errorRow]; |
| | | console.log('data = ' + JSON.stringify(data)); |
| | | for (var j = 0; j < data.split(',').length; j++) { |
| | | let label = 'field' + j; |
| | | errorDatas[i][label] = data.split(',')[j]; |
| | | } |
| | | } |
| | | console.log('errorDatas =' + JSON.stringify(errorDatas)); |
| | | component.set('v.errorColumns', errorColumns); |
| | | component.set('v.errorData', errorDatas); |
| | | component.set('v.showErrorInfo', true); |
| | | |
| | | console.log('error = ' + error); |
| | | component.set('v.errorMessage', error); |
| | | |
| | | this.error(error); |
| | | console.log('error='+error); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | return; |
| | | } |
| | | |
| | | console.log('fileStr='+fileStr); |
| | | $A.getCallback(function(){ |
| | | debugger |
| | | debugger; |
| | | helper.ImportMethod(component,fileStr); |
| | | })(); |
| | | |
| | | }, |
| | | convertArrayOfObjectsToCSV : function(component,objectRecords){ |
| | | var csvStringResult, counter, keys, columnDivider, lineDivider,thkeys; |
| | |
| | | columnDivider = ','; |
| | | lineDivider = '\n'; |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start ,'SupportNeeds__c' ,'支援需求' |
| | | keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c','SupportNeeds__c']; |
| | | thkeys = ['周','担当','活动日','医院','科室','拜访人','职位','产品区分1','产品区分2','产品区分3','活动区分','结果','支援需求'] |
| | | keys = [ |
| | | 'Submit_date__c', |
| | | 'Person_In_Charge2__c', |
| | | 'Report_Date__c', |
| | | 'Agency_Hospital__c', |
| | | 'Department_Cateogy__c', |
| | | 'doctor2__c', |
| | | 'visitor_title__c', |
| | | 'Product_Category1__c', |
| | | 'Product_Category2__c', |
| | | 'Product_Category3__c', |
| | | 'Purpose_Type__c', |
| | | 'Result__c', |
| | | 'SupportNeeds__c' |
| | | ]; |
| | | thkeys = [ |
| | | '周', |
| | | '担当', |
| | | '活动日', |
| | | '医院', |
| | | '科室', |
| | | '拜访人', |
| | | '职位', |
| | | '产品区分1', |
| | | '产品区分2', |
| | | '产品区分3', |
| | | '活动区分', |
| | | '结果', |
| | | '支援需求' |
| | | ]; |
| | | csvStringResult = ''; |
| | | csvStringResult += thkeys.join(columnDivider); |
| | | csvStringResult += lineDivider; |
| | | console.log("进入导出helper"); |
| | | console.log('进入导出helper'); |
| | | for(var i=0; i < objectRecords.length; i++){ |
| | | counter = 0; |
| | | for(var sTempkey in keys) { |
| | |
| | | if(counter > 0){ |
| | | csvStringResult += columnDivider; |
| | | } |
| | | if(typeof objectRecords[i][skey] === "undefined"){ |
| | | if (typeof objectRecords[i][skey] === 'undefined') { |
| | | csvStringResult += '"'+''+'"'; |
| | | continue; |
| | | } |
| | | if(skey == 'Person_In_Charge2__c'){ |
| | | csvStringResult += '"'+ objectRecords[i].Person_In_Charge2__r.Name+'"'; |
| | | csvStringResult += |
| | | '"' + objectRecords[i].Person_In_Charge2__r.Name + '"'; |
| | | }else if(skey == 'Agency_Hospital__c'){ |
| | | csvStringResult += '"'+ objectRecords[i].Agency_Hospital__r.Name+'"'; |
| | | csvStringResult += |
| | | '"' + objectRecords[i].Agency_Hospital__r.Name + '"'; |
| | | }else if(skey == 'doctor2__c'){ |
| | | csvStringResult += '"'+ objectRecords[i].doctor2__r.Name+'"'; |
| | | csvStringResult += |
| | | '"' + objectRecords[i].doctor2__r.Name + '"'; |
| | | }else if(skey == 'Product_Category1__c'){ |
| | | csvStringResult += '"'+ objectRecords[i].Product_Category1__r.Name+'"'; |
| | | csvStringResult += |
| | | '"' + objectRecords[i].Product_Category1__r.Name + '"'; |
| | | }else if(skey == 'Product_Category2__c'){ |
| | | csvStringResult += '"'+ objectRecords[i].Product_Category2__r.Name+'"'; |
| | | csvStringResult += |
| | | '"' + objectRecords[i].Product_Category2__r.Name + '"'; |
| | | }else if(skey == 'Product_Category3__c'){ |
| | | csvStringResult += '"'+ objectRecords[i].Product_Category3__r.Name+'"'; |
| | | } |
| | | else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | csvStringResult += '"'+ objectRecords[i].SupportNeeds__c+'"'; |
| | | } |
| | | else{ |
| | | csvStringResult += |
| | | '"' + objectRecords[i].Product_Category3__r.Name + '"'; |
| | | } else if (skey == 'SupportNeeds__c') { |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | csvStringResult += |
| | | '"' + objectRecords[i].SupportNeeds__c + '"'; |
| | | } else { |
| | | csvStringResult += '"'+ objectRecords[i][skey]+'"'; |
| | | } |
| | | counter++; |
| | | |
| | | } // inner for loop close |
| | | console.log("导出循环结束"); |
| | | console.log('导出循环结束'); |
| | | csvStringResult += lineDivider; |
| | | }// outer main for loop close |
| | | |
| | |
| | | }, |
| | | showExportDate : function(component,objectRecords){ |
| | | console.log('进入showexceportdate'+objectRecords);//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start ,'SupportNeeds__c' ,'支援需求' |
| | | var keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c','SupportNeeds__c']; |
| | | var headers = ['周','担当','活动日','医院','科室','拜访人','职位','产品区分1','产品区分2','产品区分3','活动区分','结果','支援需求'] |
| | | var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">"; |
| | | content += "<thead><tr class=\"slds-text-title--caps\">"; |
| | | var keys = [ |
| | | 'Submit_date__c', |
| | | 'Person_In_Charge2__c', |
| | | 'Report_Date__c', |
| | | 'Agency_Hospital__c', |
| | | 'Department_Cateogy__c', |
| | | 'doctor2__c', |
| | | 'visitor_title__c', |
| | | 'Product_Category1__c', |
| | | 'Product_Category2__c', |
| | | 'Product_Category3__c', |
| | | 'Purpose_Type__c', |
| | | 'Result__c', |
| | | 'SupportNeeds__c' |
| | | ]; |
| | | var headers = [ |
| | | '周', |
| | | '担当', |
| | | '活动日', |
| | | '医院', |
| | | '科室', |
| | | '拜访人', |
| | | '职位', |
| | | '产品区分1', |
| | | '产品区分2', |
| | | '产品区分3', |
| | | '活动区分', |
| | | '结果', |
| | | '支援需求' |
| | | ]; |
| | | var content = |
| | | '<table class="table slds-table slds-table--bordered slds-table--cell-buffer">'; |
| | | content += '<thead><tr class="slds-text-title--caps">'; |
| | | for(i=0;i<headers.length; i++){ |
| | | content += '<th scope=\"col"\>'+headers[i]+'</th>'; |
| | | content += '<th scope="col">' + headers[i] + '</th>'; |
| | | } |
| | | content += "</tr></thead>"; |
| | | content += '</tr></thead>'; |
| | | for(var i=0; i < objectRecords.length; i++){ |
| | | console.log('for'+content); |
| | | content += '<tr>'; |
| | |
| | | for(var sTempkey in keys) { |
| | | console.log('for1'+sTempkey); |
| | | var skey = keys[sTempkey]; |
| | | if(typeof objectRecords[i][skey] === "undefined"){ |
| | | if (typeof objectRecords[i][skey] === 'undefined') { |
| | | content += '<td>'+''+'</td>'; |
| | | continue; |
| | | } |
| | | console.log('for2'+objectRecords[i].Person_In_Charge2__r.Name); |
| | | console.log( |
| | | 'for2' + objectRecords[i].Person_In_Charge2__r.Name |
| | | ); |
| | | if(skey == 'Person_In_Charge2__c'){ |
| | | content += '<td>'+ objectRecords[i].Person_In_Charge2__r.Name+'</td>'; |
| | | content += |
| | | '<td>' + |
| | | objectRecords[i].Person_In_Charge2__r.Name + |
| | | '</td>'; |
| | | }else if(skey == 'Agency_Hospital__c'){ |
| | | content += '<td>'+ objectRecords[i].Agency_Hospital__r.Name+'</td>'; |
| | | content += |
| | | '<td>' + |
| | | objectRecords[i].Agency_Hospital__r.Name + |
| | | '</td>'; |
| | | }else if(skey == 'doctor2__c'){ |
| | | content += '<td>'+ objectRecords[i].doctor2__r.Name+'</td>'; |
| | | content += |
| | | '<td>' + objectRecords[i].doctor2__r.Name + '</td>'; |
| | | }else if(skey == 'Product_Category1__c'){ |
| | | content += '<td>'+ objectRecords[i].Product_Category1__r.Name+'</td>'; |
| | | content += |
| | | '<td>' + |
| | | objectRecords[i].Product_Category1__r.Name + |
| | | '</td>'; |
| | | }else if(skey == 'Product_Category2__c'){ |
| | | content += '<td>'+ objectRecords[i].Product_Category2__r.Name+'</td>'; |
| | | content += |
| | | '<td>' + |
| | | objectRecords[i].Product_Category2__r.Name + |
| | | '</td>'; |
| | | }else if(skey == 'Product_Category3__c'){ |
| | | content += '<td>'+ objectRecords[i].Product_Category3__r.Name+'</td>'; |
| | | } |
| | | else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | content += '<td>'+ objectRecords[i].SupportNeeds__c+'</td>'; |
| | | } |
| | | else{ |
| | | content += |
| | | '<td>' + |
| | | objectRecords[i].Product_Category3__r.Name + |
| | | '</td>'; |
| | | } else if (skey == 'SupportNeeds__c') { |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | content += |
| | | '<td>' + objectRecords[i].SupportNeeds__c + '</td>'; |
| | | } else { |
| | | content += '<td>'+ objectRecords[i][skey]+'</td>'; |
| | | } |
| | | } // inner for loop close |
| | | content += '</tr>' |
| | | content += '</tr>'; |
| | | }// outer main for loop close |
| | | content += '</table>'; |
| | | console.log("helper循环结束"+content); |
| | | component.set("v.TableContent2",content); |
| | | component.set("v.showMain",false); |
| | | console.log('helper循环结束' + content); |
| | | component.set('v.TableContent2', content); |
| | | component.set('v.showMain', false); |
| | | }, |
| | | |
| | | select_repores_date : function(component,event,helper){ |
| | | component.set('v.login',true); |
| | | component.set('v.loginEdit', true); |
| | | var reportsdate1 = component.find('input-report-date1').get('v.value'); |
| | | var reportsdate2 = component.find('input-report-date2').get('v.value'); |
| | | console.log('输入的开始日期'+reportsdate1+'输入的结束日期'+reportsdate2); |
| | | var action = component.get("c.getReportsByDate"); |
| | | console.log( |
| | | '输入的开始日期' + reportsdate1 + '输入的结束日期' + reportsdate2 |
| | | ); |
| | | var action = component.get('c.getReportsByDate'); |
| | | console.log('输入的开始日期1'); |
| | | action.setParams({ |
| | | date1 : reportsdate1, |
| | |
| | | console.log('输入的开始日期2'); |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | |
| | | if (state === 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | console.log('输入的开始日期3'+res); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | |
| | | // PI 改造 By Bright 20220328 |
| | | if(true){ |
| | | let awsids = []; |
| | | for (let ri in res) { |
| | | if(res[ri] && res[ri].doctor2__r && res[ri].doctor2__r.AWS_Data_Id__c){ |
| | | if ( |
| | | res[ri] && |
| | | res[ri].doctor2__r && |
| | | res[ri].doctor2__r.AWS_Data_Id__c |
| | | ) { |
| | | awsids.push(res[ri].doctor2__r.AWS_Data_Id__c); |
| | | } |
| | | } |
| | | if(awsids.length > 0){ |
| | | let awsurl = component.get('v.awsurl'); |
| | | |
| | | AWSService.search(awsurl.searchUrl,{ |
| | | AWSService.search( |
| | | awsurl.searchUrl, |
| | | { |
| | | dataIds:awsids |
| | | }, function(data){ |
| | | }, |
| | | function (data) { |
| | | if(data && data.object && data.object.length){ |
| | | let m = {}; |
| | | for(let di in data.object){ |
| | | if(data.object[di] && data.object[di].dataId){ |
| | | m[data.object[di].dataId] = data.object[di]; |
| | | if ( |
| | | data.object[di] && |
| | | data.object[di].dataId |
| | | ) { |
| | | m[data.object[di].dataId] = |
| | | data.object[di]; |
| | | } |
| | | } |
| | | |
| | | for(let ri in res){ |
| | | if(res[ri] && res[ri].doctor2__r && res[ri].doctor2__r.AWS_Data_Id__c && m.hasOwnProperty(res[ri].doctor2__r.AWS_Data_Id__c)){ |
| | | res[ri].doctor2__r.Name = m[res[ri].doctor2__r.AWS_Data_Id__c].name; |
| | | res[ri].visitor_title__c = m[res[ri].doctor2__r.AWS_Data_Id__c].doctorDivision1; |
| | | |
| | | if ( |
| | | res[ri] && |
| | | res[ri].doctor2__r && |
| | | res[ri].doctor2__r.AWS_Data_Id__c && |
| | | m.hasOwnProperty( |
| | | res[ri].doctor2__r |
| | | .AWS_Data_Id__c |
| | | ) |
| | | ) { |
| | | res[ri].doctor2__r.Name = |
| | | m[ |
| | | res[ |
| | | ri |
| | | ].doctor2__r.AWS_Data_Id__c |
| | | ].name; |
| | | res[ri].visitor_title__c = |
| | | m[ |
| | | res[ |
| | | ri |
| | | ].doctor2__r.AWS_Data_Id__c |
| | | ].doctorDivision1; |
| | | } |
| | | } |
| | | } |
| | | helper.showExportDate(component, res); |
| | | |
| | | component.set('v.login', false); |
| | | }, awsurl.token); |
| | | component.set('v.loginEdit', false); |
| | | }, |
| | | awsurl.token |
| | | ); |
| | | }else{ |
| | | helper.showExportDate(component, res); |
| | | } |
| | | } |
| | | |
| | | |
| | | component.set('v.reports_date', res); |
| | | |
| | | }else{ |
| | | alert('导出失败,请检查活动日'); |
| | | component.set('v.login',false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | |
| | | }, |
| | | |
| | | showImport : function(component){ |
| | |
| | | |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | CallBackAction : function(component,action_name,para,callback) { |
| | | var action = component.get("c." + action_name.trimStart().replace("c.","")); |
| | | var action = component.get( |
| | | 'c.' + action_name.trimStart().replace('c.', '') |
| | | ); |
| | | if(para){ |
| | | action.setParams(para); |
| | | } |
| | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | |
| | | //zhj 导出错误信息 2023-05-16 start |
| | | exportErrorInfoHelper: function (component) { |
| | | var errorData = component.get('v.errorData'); |
| | | var errorColumns = component.get('v.errorColumns'); |
| | | |
| | | var datas = []; |
| | | let errorColumnsArray = []; |
| | | for (var i in errorColumns) { |
| | | errorColumnsArray.push(errorColumns[i].label); |
| | | } |
| | | datas.push(errorColumnsArray); |
| | | //datas.push(errorColumns); |
| | | |
| | | for (var i in errorData) { |
| | | let data = []; |
| | | data.push(errorData[i].errorRow); |
| | | data.push(errorData[i].errorInfo); |
| | | for (var j = 0; j < Object.keys(errorData[i]).length - 2; j++) { |
| | | data.push(errorData[i]['field' + j]); |
| | | } |
| | | datas.push(data); |
| | | } |
| | | |
| | | console.log('datas = ' + JSON.stringify(datas)); |
| | | var csv = this.convertToCSV(component, datas); |
| | | console.log('csv = ' + JSON.stringify(csv)); |
| | | this.downloadCSV(component, csv); |
| | | }, |
| | | |
| | | convertToCSV: function (component, data) { |
| | | console.log('enter convertToCSV'); |
| | | console.log('data = ' + data); |
| | | var csv = ''; |
| | | for (var i = 0; i < data.length; i++) { |
| | | var row = data[i]; |
| | | console.log('row = ' + JSON.stringify(row)); |
| | | for (var j = 0; j < row.length; j++) { |
| | | var val = ''; |
| | | val = row[j] === null ? '' : row[j].toString(); |
| | | console.log('val = ' + val); |
| | | if ( |
| | | val.indexOf(',') !== -1 || |
| | | val.indexOf('"') !== -1 || |
| | | val.indexOf('\n') !== -1 |
| | | ) { |
| | | //val = '"' + val.replace(/"/g,'""') + '"'; |
| | | } |
| | | if (j > 0) { |
| | | csv += ','; |
| | | } |
| | | csv += val; |
| | | } |
| | | csv += '\n'; |
| | | } |
| | | return csv; |
| | | }, |
| | | |
| | | downloadCSV: function (component, csv) { |
| | | var link = document.createElement('a'); |
| | | // 设置字符集和文件头 |
| | | var bom = '\uFEFF'; |
| | | link.href = |
| | | 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv); |
| | | link.download = 'data.csv'; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | } |
| | | //zhj 导出错误信息 2023-05-16 end |
| | | |
| | | // searchAgencyContact : function(res) { |
| | | // var agencyContacts = []; |
| | |
| | | // var data = this.search(searchUrl,data,token); |
| | | // return data;searchUrl,requestSearchPayload,token |
| | | // }, |
| | | }) |
| | | }); |
| | |
| | | //超出定货数量的产品 |
| | | public List<String> cancellationProList = new List<String>(); |
| | | //错误信息 |
| | | public String alertMessage {set;get;} |
| | | public String alertMessage { get; set; } |
| | | public integer getinventorysize(){ |
| | | return consumableInventory.size(); |
| | | } |
| | |
| | | Map<String, Decimal> overOrderCunMap = new Map<String, Decimal>(); |
| | | //超出BARCODE和型号 |
| | | Map<String, List<String>> overOrderBARcodeCunMap = new Map<String, List<String>>(); |
| | | list<String> overOrderBARcodeTTTTTT = new list<String>(); |
| | | list<String> overOrderBARcodeTTTTTT = new List<String>(); |
| | | |
| | | //不符合的barcode和型号 |
| | | Map<String, List<String>> notEqualBARcodeCunMap = new Map<String, List<String>>(); |
| | | list<String> overOrderBARcodeSSSSSS = new list<String>(); |
| | | list<String> productList = new list<String>(); |
| | | list<String> notInlist = new list<String>(); |
| | | list<String> overOrderBARcodeSSSSSS = new List<String>(); |
| | | list<String> productList = new List<String>(); |
| | | list<String> notInlist = new List<String>(); |
| | | //不选择订单时保存订单ID、产品型号用 |
| | | //List<String> orderId = new List<String>(); |
| | | //List<String> prodName = new List<String>(); |
| | | //库存登录使用 |
| | | list<String> notInStorelist = new list<String>(); |
| | | list<String> exitBarCodeList = new list<String>(); |
| | | |
| | | list<String> notInStorelist = new List<String>(); |
| | | list<String> exitBarCodeList = new List<String>(); |
| | | |
| | | // Map<String, Consumable_order_details2__c> reallMap = new Map<String, Consumable_order_details2__c>(); |
| | | Map<String,String> HosErrorMap = new Map<String,String>(); |
| | |
| | | consumableorderdetails2Cancle = new List<Consumable_order_details2__c>(); |
| | | orderdetails2trMap = new Map<String,Consumable_order_details2__c>(); |
| | | detailsSummary = new List<ConsumableorderdetailsInfo>(); |
| | | saveFLGbln = FALSE; |
| | | saveFLGbln = false; |
| | | //overOrderBARcodeTTTTTT.add(''); |
| | | //add by rentx 20210602 CHAN-C3K4ZQ start |
| | | consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>(); |
| | |
| | | public void init() { |
| | | // String userId = '00510000007cthP'; |
| | | String userId = UserInfo.getUserId(); |
| | | List<user> Useracc = New List<user>(); |
| | | List<user> Useracc = new List<user>(); |
| | | Useracc = [SELECT accountid, Work_Location__c,UserPro_Type__c FROM user WHERE id =:userId]; |
| | | accountid = Useracc[0].accountid; |
| | | //--------AddStart-----XHL--------------20181008------------- |
| | |
| | | ReturnFLGbln = false; |
| | | } |
| | | if(ESetId != '' && ESetId !=null){ |
| | | List<Consumable_order__c> qs = New List<Consumable_order__c>(); |
| | | List<Consumable_order_details2__c> reSet1 = New List<Consumable_order_details2__c>(); |
| | | List<Consumable_Orderdetails__c> reSet = New List<Consumable_Orderdetails__c>(); |
| | | qs = [SELECT Id,Name,Order_status__c,Dealer_Info__c,Deliver_date__c,ReturnGs_Upload_Date__c, |
| | | Order_Reason__c,Order_date__c, |
| | | Contract_application_decision__c,Order_type__c,Total_num__c, |
| | | OrderNumber_arrived__c,Delivery_detail_count__c,OrderNumber_notarrive__c,orderPattern__c |
| | | List<Consumable_order__c> qs = new List<Consumable_order__c>(); |
| | | List<Consumable_order_details2__c> reSet1 = new List<Consumable_order_details2__c>(); |
| | | List<Consumable_Orderdetails__c> reSet = new List<Consumable_Orderdetails__c>(); |
| | | qs = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Order_status__c, |
| | | Dealer_Info__c, |
| | | Deliver_date__c, |
| | | ReturnGs_Upload_Date__c, |
| | | Order_Reason__c, |
| | | Order_date__c, |
| | | Contract_application_decision__c, |
| | | Order_type__c, |
| | | Total_num__c, |
| | | OrderNumber_arrived__c, |
| | | Delivery_detail_count__c, |
| | | OrderNumber_notarrive__c, |
| | | orderPattern__c |
| | | FROM Consumable_order__c |
| | | WHERE Id =:ESetId AND Order_Owner_WorkLocal__c =: userWorkLocation |
| | | AND Dealer_Info__c = :accountid]; |
| | | WHERE Id = :ESetId AND Order_Owner_WorkLocal__c = :userWorkLocation AND Dealer_Info__c = :accountid |
| | | ]; |
| | | if (qs.size()>0){ |
| | | coc = qs[0]; |
| | | orderCountAll = coc.Total_num__c; |
| | | orderCountNotarrive = coc.OrderNumber_notarrive__c; |
| | | } |
| | | //产品定货数量 |
| | | reSet = [SELECT Asset_Model_No__c, |
| | | Consumable_order__c, |
| | | Consumable_count__c |
| | | reSet = [ |
| | | SELECT Asset_Model_No__c, Consumable_order__c, Consumable_count__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Consumable_order__c = :ESetId AND Order_Owner_WorkLocal__c =: userWorkLocation]; |
| | | WHERE Consumable_order__c = :ESetId AND Order_Owner_WorkLocal__c = :userWorkLocation |
| | | ]; |
| | | for (Integer i = 0; i < reSet.size(); i++) { |
| | | productList.add(reSet[i].Asset_Model_No__c); |
| | | orderProductCunMap.put(reSet[i].Asset_Model_No__c,reSet[i].Consumable_count__c); |
| | |
| | | //overOrderCunMap.put(reSet[i].Asset_Model_No__c,0); |
| | | } |
| | | // |
| | | reSet1 = [SELECT Id, |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | |
| | | Rrturn_count__c, |
| | | ProductPacking_list_manual__c, |
| | | Report_Product_Approbation__c, |
| | | Report_Product_Expiration__c |
| | | Report_Product_Expiration__c, |
| | | //add by rentx 2020-10-14 start |
| | | ,ContractNo_text__c/*,ContractNo__c1*/ |
| | | ContractNo_text__c /*,ContractNo__c1*/, |
| | | // tcm start |
| | | ,Consumable_order_minor__r.ContractNo__c |
| | | Consumable_order_minor__r.ContractNo__c |
| | | // tcm end |
| | | //add by rentx 2020-10-14 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | WHERE |
| | | recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | AND Arrive_Owner_Work_Location__c = : userWorkLocation |
| | | AND Consumable_order_minor__c = :ESetId |
| | | AND Dealer_Arrive__c = true |
| | | AND Box_Piece__c != '个' ]; |
| | | AND Dealer_Arrive__c = TRUE |
| | | AND Box_Piece__c != '个' |
| | | ]; |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | // OrderAllMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c); |
| | | //init的时候不展示已经入库的明细 by rentx 20210617 CHAN-C3K4ZQ |
| | | // ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet1[i])); |
| | | //update by rentx 20210617 end CHAN-C3K4ZQ |
| | | if(orderProductArrivedCunMap.containsKey(reSet1[i].Asset_Model_No__c)){ |
| | | orderProductArrivedCunMap.put(reSet1[i].Asset_Model_No__c,orderProductArrivedCunMap.get(reSet1[i].Asset_Model_No__c)+1); |
| | | orderProductArrivedCunMap.put( |
| | | reSet1[i].Asset_Model_No__c, |
| | | orderProductArrivedCunMap.get(reSet1[i].Asset_Model_No__c) + 1 |
| | | ); |
| | | } |
| | | } |
| | | //add by rentx 20210602 start CHAN-C3K4ZQ |
| | |
| | | // 将页面或取得BarCode去掉重复的,转换成List |
| | | //========20160311======ADD_Start================================ |
| | | public List<String> ParseBarCode(String Code){ |
| | | String[] Cache = new String[]{}; |
| | | String[] Cache = new List<String>{}; |
| | | Cache = Code.split('\n'); |
| | | Set <String> Buff = new Set<String>(); |
| | | for(String A : Cache){ |
| | |
| | | barMcodeMap.put(B,tracingCode); |
| | | } |
| | | outPut.add(B); |
| | | }system.debug('barMcodeMap等于'+barMcodeMap); |
| | | } |
| | | system.debug('barMcodeMap等于' + barMcodeMap); |
| | | return outPut; |
| | | } |
| | | |
| | | |
| | | //========20160311======ADD_End================================== |
| | | //获取明细 |
| | | public void SearchPro() { |
| | | notInlist = new list<String>(); |
| | | notInlist = new List<String>(); |
| | | otherAgencyMap = new Map<String, String>(); |
| | | barMcodeMap = new Map<String, String>(); |
| | | consumableInventory = new List<ConsumableorderdetailsInfo>(); |
| | |
| | | BarCodeListP = new List<String>(); |
| | | BarCodeListP = ParseBarCode(barcode); |
| | | Consumable_order_details2__c p = new Consumable_order_details2__c(); |
| | | List<Consumable_order_details2__c> Ins = New List<Consumable_order_details2__c>(); |
| | | List<Consumable_order_details2__c> Ins = new List<Consumable_order_details2__c>(); |
| | | List<Consumable_order_details2__c> reSet = new List<Consumable_order_details2__c>(); |
| | | List<Consumable_order_details2__c> reSet1 = new List<Consumable_order_details2__c>(); |
| | | if(barcode == null || barcode.trim() ==''){ |
| | |
| | | return; |
| | | } |
| | | //对比全部库存中是否存在管理编码一样,barcode号不一样的产品 |
| | | reSet1 = [SELECT Id, Name,TracingCode__c,Bar_Code__c,Report_Product_Expiration__c |
| | | reSet1 = [ |
| | | SELECT Id, Name, TracingCode__c, Bar_Code__c, Report_Product_Expiration__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | AND Dealer_Shipment__c = false |
| | | AND Dealer_Saled__c = false |
| | | AND Lose_Flag__c = false |
| | | AND Dealer_Returned__c = false |
| | | AND Cancellation_Flag__c = false |
| | | AND TracingCode__c in :barMcodeMap.values() |
| | | AND Bar_Code__c not in :barMcodeMap.keySet() |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | | AND Dealer_Shipment__c = FALSE |
| | | AND Dealer_Saled__c = FALSE |
| | | AND Lose_Flag__c = FALSE |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Cancellation_Flag__c = FALSE |
| | | AND TracingCode__c IN :barMcodeMap.values() |
| | | AND Bar_Code__c NOT IN :barMcodeMap.keySet() |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | ORDER BY Name ]; |
| | | ORDER BY Name |
| | | ]; |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | |
| | | }else{ |
| | | for(String str : barMcodeMap.keySet()){ |
| | | if(barMcodeMap.get(str) == reSet1[i].TracingCode__c){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, str + ' 的管理编码已经存在于系统的库存中,请确认输入信息是否有误。')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | str + ' 的管理编码已经存在于系统的库存中,请确认输入信息是否有误。' |
| | | ) |
| | | ); |
| | | ErrorIdMap.put(str,str); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c); |
| | | } |
| | |
| | | } |
| | | } |
| | | //管理编码为空的产品 |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c,Box_Piece__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | TracingCode__c,Report_Product_Expiration__c |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_Product__r.Name__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Box_Piece__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | TracingCode__c, |
| | | Report_Product_Expiration__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Bar_Code__c in :BarCodeListP |
| | | WHERE |
| | | Bar_Code__c IN :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | //AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | AND (TracingCode__c = null |
| | | AND (TracingCode__c = NULL |
| | | OR TracingCode__c = '') |
| | | ORDER BY Name ]; |
| | | ORDER BY Name |
| | | ]; |
| | | |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | |
| | | if(EsetId == null || EsetId == ''){ |
| | | if(ArrType!='ReG'){ |
| | | //到货但产品类型与用户的类型不符 |
| | | reSet1 = [SELECT Id,Name,Intra_Trade_List_RMB__c,Asset_Model_No__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, |
| | | Consumable_Product__r.Name__c,Consumable_Product__r.Asset_Model_No__c, |
| | | Sterilization_limit__c,Deliver_date__c,Bar_Code__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c,Dealer_Arrive__c, |
| | | Guarantee_period_for_products__c,CFDA_Status__c, |
| | | ProductPacking_list_manual__c,Report_Product_Approbation__c, |
| | | Report_Product_Expiration__c,Box_Piece__c, Rrturn_count__c, |
| | | Product_Type__c |
| | | ,ContractNo_text__c/*,ContractNo__c1*/ |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Consumable_Product__r.Name__c, |
| | | Consumable_Product__r.Asset_Model_No__c, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | Dealer_Arrive__c, |
| | | Guarantee_period_for_products__c, |
| | | CFDA_Status__c, |
| | | ProductPacking_list_manual__c, |
| | | Report_Product_Approbation__c, |
| | | Report_Product_Expiration__c, |
| | | Box_Piece__c, |
| | | Rrturn_count__c, |
| | | Product_Type__c, |
| | | ContractNo_text__c /*,ContractNo__c1*/, |
| | | // tcm start |
| | | ,Consumable_order_minor__r.ContractNo__c |
| | | Consumable_order_minor__r.ContractNo__c |
| | | // tcm end |
| | | FROM Consumable_order_details2__c |
| | | WHERE Bar_Code__c in :BarCodeListP |
| | | AND ( not Product_Type__c like :userPro_Typestr) |
| | | WHERE |
| | | Bar_Code__c IN :BarCodeListP |
| | | AND (NOT Product_Type__c LIKE :userPro_Typestr) |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND ((Consumable_order_minor__c != null |
| | | AND ((Consumable_order_minor__c != NULL |
| | | AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation) |
| | | OR Consumable_order_minor__c = null) |
| | | ORDER BY Name ]; |
| | | OR Consumable_order_minor__c = NULL) |
| | | ORDER BY Name |
| | | ]; |
| | | |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | |
| | | } |
| | | } |
| | | //销售产品 |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c,Box_Piece__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c,OwnerId,Report_Product_Expiration__c |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_Product__r.Name__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Box_Piece__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | recordtypeid, |
| | | Consumable_order_minor__r.Arrive_Order__c, |
| | | OwnerId, |
| | | Report_Product_Expiration__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Saled__c = true |
| | | AND Dealer_Returned__c = false |
| | | AND Bar_Code__c in :BarCodeListP |
| | | WHERE |
| | | Dealer_Saled__c = TRUE |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Bar_Code__c IN :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND (Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | OR OwnerId = :System.Label.User_OlympusSystem) |
| | | ORDER BY Name ]; |
| | | ORDER BY Name |
| | | ]; |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | |
| | | } |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c); |
| | | |
| | | } |
| | | } |
| | | } |
| | | //出库产品 |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c,Box_Piece__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c,Report_Product_Expiration__c |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_Product__r.Name__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Box_Piece__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | recordtypeid, |
| | | Consumable_order_minor__r.Arrive_Order__c, |
| | | Report_Product_Expiration__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Shipment__c = true |
| | | AND Dealer_Returned__c = false |
| | | AND Bar_Code__c in :BarCodeListP |
| | | WHERE |
| | | Dealer_Shipment__c = TRUE |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Bar_Code__c IN :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | ORDER BY Name ]; |
| | | ORDER BY Name |
| | | ]; |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | |
| | | } |
| | | } |
| | | //已到货产品 |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c,Lose_Flag__c,Box_Piece__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c,Report_Product_Expiration__c |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_Product__r.Name__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Lose_Flag__c, |
| | | Box_Piece__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | recordtypeid, |
| | | Consumable_order_minor__r.Arrive_Order__c, |
| | | Report_Product_Expiration__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | AND Dealer_Returned__c = false |
| | | AND Bar_Code__c in :BarCodeListP |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Bar_Code__c IN :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | ORDER BY Name ]; |
| | | ORDER BY Name |
| | | ]; |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | |
| | | continue; |
| | | }else{ |
| | | String str = '该商品已经到货'; |
| | | if (reSet1[i].Lose_Flag__c == TRUE) { |
| | | if (reSet1[i].Lose_Flag__c == true) { |
| | | str = '该商品已经丢失'; |
| | | } |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str)); |
| | |
| | | } |
| | | |
| | | //已拆盒产品 |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c,Box_Piece__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c,Report_Product_Expiration__c |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_Product__r.Name__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Box_Piece__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | recordtypeid, |
| | | Consumable_order_minor__r.Arrive_Order__c, |
| | | Report_Product_Expiration__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | AND Bar_Code__c in :BarCodeListP |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | | AND Bar_Code__c IN :BarCodeListP |
| | | AND (Dealer_Info_text__c != :accountName |
| | | OR (Dealer_Info_text__c = :accountName |
| | | AND Arrive_Owner_Work_Location__c !=: userWorkLocation)) |
| | | AND Box_Piece__c = '个' |
| | | ORDER BY Name ]; |
| | | ORDER BY Name |
| | | ]; |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | |
| | | } |
| | | |
| | | // 经销商之间或者同一经销商不同工作地调货 |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,Asset_Model_No__c, Arrive_Owner_Work_Location__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,Box_Piece__c, |
| | | Deliver_date__c,Bar_Code__c,TracingCode__c, Dealer_Info_text__c, OwnerId, Lose_Flag__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c,SerialLotNo__c, Dealer_Arrive__c, |
| | | Consumable_Arrived_order__r.Dealer_Info__c, Consumable_Arrived_order__r.Dealer_Info__r.Name, |
| | | Intra_Trade_List_RMB__c, Dealer_Shipment__c, Dealer_Saled__c,Consumable_Product__r.Asset_Model_No__c |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_Product__r.Name__c, |
| | | Asset_Model_No__c, |
| | | Arrive_Owner_Work_Location__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Sterilization_limit__c, |
| | | Box_Piece__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | TracingCode__c, |
| | | Dealer_Info_text__c, |
| | | OwnerId, |
| | | Lose_Flag__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | recordtypeid, |
| | | Consumable_order_minor__r.Arrive_Order__c, |
| | | SerialLotNo__c, |
| | | Dealer_Arrive__c, |
| | | Consumable_Arrived_order__r.Dealer_Info__c, |
| | | Consumable_Arrived_order__r.Dealer_Info__r.Name, |
| | | Intra_Trade_List_RMB__c, |
| | | Dealer_Shipment__c, |
| | | Dealer_Saled__c, |
| | | Consumable_Product__r.Asset_Model_No__c, |
| | | // 更新借调信息 add by gzw 2020-0-415 start |
| | | ,SummonsForDirction_det__c,Transfer_Time__c,Frist_Transfer_Agency__c,Agency_Transfer__c |
| | | SummonsForDirction_det__c, |
| | | Transfer_Time__c, |
| | | Frist_Transfer_Agency__c, |
| | | Agency_Transfer__c, |
| | | // 更新借调信息 add by gzw 2020-0-415 start |
| | | // 首次入库经销商信息 add by gzw 2020-04-27 start |
| | | ,Agencyinfo_fromSAP__c,Frist_Storage_Agency__c |
| | | Agencyinfo_fromSAP__c, |
| | | Frist_Storage_Agency__c, |
| | | // 首次入库经销商信息 add by gzw 2020-04-27 end |
| | | |
| | | //add by rentx 2020-10-13 start 互相调货时,借入方记录SAP合同号 |
| | | ,ContractNo_text__c/*,ContractNo__c */ |
| | | ContractNo_text__c /*,ContractNo__c */, |
| | | // tcm start |
| | | ,Consumable_order_minor__r.ContractNo__c |
| | | Consumable_order_minor__r.ContractNo__c, |
| | | // tcm end |
| | | //add by rentx 2020-10-13 end |
| | | //add by rentx 2021-03-22 start |
| | | ,hospitalSpecialOffer__c |
| | | ,exchangeOutPattern__c |
| | | ,Report_Product_Expiration__c |
| | | hospitalSpecialOffer__c, |
| | | exchangeOutPattern__c, |
| | | Report_Product_Expiration__c |
| | | //add by rentx 2021-03-22 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = TRUE |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | | //AND Dealer_Shipment__c= false |
| | | //AND Dealer_Saled__c = FALSE |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Cancellation_Flag__c = FALSE |
| | | AND Bar_Code__c in :BarCodeListP |
| | | AND Bar_Code__c IN :BarCodeListP |
| | | //AND (Dealer_Shipment__c = FALSE |
| | | // OR (Dealer_Shipment__c = TRUE |
| | | // AND Consumable_Shipment_order__r.SummonsForDirction__c != '互相调货')) |
| | | AND (Dealer_Info_text__c != :accountName |
| | | OR (Dealer_Info_text__c = :accountName |
| | | AND Arrive_Owner_Work_Location__c != :userWorkLocation) |
| | | ) |
| | | AND Arrive_Owner_Work_Location__c != :userWorkLocation)) |
| | | // 更新借调信息 add by gzw 2020-0-415 start |
| | | order by Bar_Code__c, Transfer_Time__c desc |
| | | ORDER BY Bar_Code__c, Transfer_Time__c DESC |
| | | // 更新借调信息 add by gzw 2020-0-415 end |
| | | ]; |
| | | if(reSet1.size()>0){ |
| | |
| | | barcodedetList.add(String.valueOf(reSet1[i].Sterilization_limit__c)); |
| | | barcodedetList.add(reSet1[i].SerialLotNo__c); |
| | | barcodedetList.add(reSet1[i].TracingCode__c); |
| | | if (reSet1[i].Lose_Flag__c == false |
| | | if (reSet1[i].Lose_Flag__c == false) { |
| | | //&& reSet1[i].Dealer_Info_text__c == accountName |
| | | ) { |
| | | consumableorderdetails2Cancle.add(reSet1[i]); |
| | | } |
| | | // 更新借调信息 add by gzw 2020-0-415 start |
| | | if (reSet1[i].SummonsForDirction_det__c == '互相调货' && !orderdetails2trMap.containsKey(reSet1[i].Bar_Code__c)) { |
| | | if ( |
| | | reSet1[i].SummonsForDirction_det__c == '互相调货' && |
| | | !orderdetails2trMap.containsKey(reSet1[i].Bar_Code__c) |
| | | ) { |
| | | orderdetails2trMap.put(reSet1[i].Bar_Code__c, reSet1[i]); |
| | | } |
| | | // 更新借调信息 add by gzw 2020-0-415 end |
| | |
| | | codsIns.TracingCode__c = reSet1[i].TracingCode__c; |
| | | // 更新借调信息 add by gzw 2020-0-415 start |
| | | codsIns.Transfer_Time__c = reSet1[i].Transfer_Time__c == null? 1 : reSet1[i].Transfer_Time__c; |
| | | codsIns.Frist_Transfer_Agency__c = reSet1[i].Frist_Transfer_Agency__c == null ? reSet1[i].Dealer_Info_text__c : reSet1[i].Frist_Transfer_Agency__c; |
| | | codsIns.Frist_Transfer_Agency__c = reSet1[i].Frist_Transfer_Agency__c == null |
| | | ? reSet1[i].Dealer_Info_text__c |
| | | : reSet1[i].Frist_Transfer_Agency__c; |
| | | codsIns.Agency_Transfer__c = true; |
| | | // 更新借调信息 add by gzw 2020-0-415 end |
| | | |
| | |
| | | } |
| | | |
| | | //发错库 未到货 |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,Asset_Model_No__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c,TracingCode__c,Box_Piece__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c,SerialLotNo__c,Dealer_Arrive__c, |
| | | Dealer_Shipment__c, Dealer_Saled__c,Consumable_Product__r.Asset_Model_No__c |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_Product__r.Name__c, |
| | | Asset_Model_No__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | TracingCode__c, |
| | | Box_Piece__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | recordtypeid, |
| | | Consumable_order_minor__r.Arrive_Order__c, |
| | | SerialLotNo__c, |
| | | Dealer_Arrive__c, |
| | | Dealer_Shipment__c, |
| | | Dealer_Saled__c, |
| | | Consumable_Product__r.Asset_Model_No__c, |
| | | // 更新借调信息 add by gzw 2020-0-415 start |
| | | ,SummonsForDirction_det__c,Transfer_Time__c,Frist_Transfer_Agency__c,Agency_Transfer__c, |
| | | Dealer_Info_text__c,Intra_Trade_List_RMB__c |
| | | SummonsForDirction_det__c, |
| | | Transfer_Time__c, |
| | | Frist_Transfer_Agency__c, |
| | | Agency_Transfer__c, |
| | | Dealer_Info_text__c, |
| | | Intra_Trade_List_RMB__c, |
| | | // 更新借调信息 add by gzw 2020-0-415 start |
| | | // 首次入库经销商信息 add by gzw 2020-04-27 start |
| | | ,Agencyinfo_fromSAP__c,Frist_Storage_Agency__c |
| | | Agencyinfo_fromSAP__c, |
| | | Frist_Storage_Agency__c, |
| | | // 首次入库经销商信息 add by gzw 2020-04-27 end |
| | | //add by rentx 2020-10-13 start 互相调货时,借入方记录SAP合同号 |
| | | ,ContractNo_text__c/*,ContractNo__c*/ |
| | | ContractNo_text__c /*,ContractNo__c*/, |
| | | // tcm start |
| | | ,Consumable_order_minor__r.ContractNo__c |
| | | Consumable_order_minor__r.ContractNo__c, |
| | | // tcm end |
| | | //add by rentx 2020-10-13 end 互相调货时,借入方记录SAP合同号 |
| | | ,hospitalSpecialOffer__c |
| | | ,exchangeOutPattern__c |
| | | ,Lose_Flag__c,Report_Product_Expiration__c |
| | | hospitalSpecialOffer__c, |
| | | exchangeOutPattern__c, |
| | | Lose_Flag__c, |
| | | Report_Product_Expiration__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = FALSE |
| | | WHERE |
| | | Dealer_Arrive__c = FALSE |
| | | AND Dealer_Shipment__c= FALSE |
| | | AND Dealer_Saled__c = FALSE |
| | | //AND Cancellation_Flag__c = FALSE |
| | | AND Bar_Code__c in :BarCodeListP |
| | | AND Bar_Code__c IN :BarCodeListP |
| | | AND (Dealer_Info_text__c != :accountName |
| | | OR (Dealer_Info_text__c = :accountName |
| | | AND ((Consumable_order_minor__c != null |
| | | AND ((Consumable_order_minor__c != NULL |
| | | AND (Consumable_order_minor__r.Order_Owner_WorkLocal__c != :userWorkLocation |
| | | OR (Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation |
| | | AND Cancellation_Flag__c = TRUE))) |
| | | OR (Consumable_order_minor__c = null AND Cancellation_Flag__c = TRUE))) |
| | | ) |
| | | OR (Consumable_order_minor__c = NULL |
| | | AND Cancellation_Flag__c = TRUE)))) |
| | | // 更新借调信息 add by gzw 2020-0-415 start |
| | | order by Bar_Code__c, Transfer_Time__c desc |
| | | ORDER BY Bar_Code__c, Transfer_Time__c DESC |
| | | // 更新借调信息 add by gzw 2020-0-415 end |
| | | ]; |
| | | if(reSet1.size()>0){ |
| | |
| | | //} |
| | | // 发错库存时,自动取消 update by gzw 2020-04-15 start |
| | | // 更新借调信息 add by gzw 2020-0-415 start |
| | | if (reSet1[i].SummonsForDirction_det__c == '互相调货' && !orderdetails2trMap.containsKey(reSet1[i].Bar_Code__c)) { |
| | | |
| | | if ( |
| | | reSet1[i].SummonsForDirction_det__c == '互相调货' && |
| | | !orderdetails2trMap.containsKey(reSet1[i].Bar_Code__c) |
| | | ) { |
| | | orderdetails2trMap.put(reSet1[i].Bar_Code__c, reSet1[i]); |
| | | } |
| | | // 更新借调信息 add by gzw 2020-0-415 end |
| | |
| | | }else{ |
| | | //返品检查 |
| | | //到货但产品类型与用户的类型不符 |
| | | reSet1 = [SELECT Id,Name,Intra_Trade_List_RMB__c,Asset_Model_No__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, |
| | | Consumable_Product__r.Name__c,Consumable_Product__r.Asset_Model_No__c, |
| | | Sterilization_limit__c,Deliver_date__c,Bar_Code__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c,Dealer_Arrive__c, |
| | | Guarantee_period_for_products__c,CFDA_Status__c, |
| | | ProductPacking_list_manual__c,Report_Product_Approbation__c, |
| | | Report_Product_Expiration__c,Box_Piece__c, Rrturn_count__c, |
| | | Product_Type__c |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Consumable_Product__r.Name__c, |
| | | Consumable_Product__r.Asset_Model_No__c, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | Dealer_Arrive__c, |
| | | Guarantee_period_for_products__c, |
| | | CFDA_Status__c, |
| | | ProductPacking_list_manual__c, |
| | | Report_Product_Approbation__c, |
| | | Report_Product_Expiration__c, |
| | | Box_Piece__c, |
| | | Rrturn_count__c, |
| | | Product_Type__c, |
| | | //add by rentx 2020-10-14 start |
| | | ,ContractNo_text__c/*,ContractNo__c*/ |
| | | ContractNo_text__c /*,ContractNo__c*/, |
| | | // tcm start |
| | | ,Consumable_order_minor__r.ContractNo__c |
| | | Consumable_order_minor__r.ContractNo__c |
| | | // tcm end |
| | | //add by rentx 2020-10-14 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE Bar_Code__c in :BarCodeListP |
| | | AND ( not Product_Type__c like :userPro_Typestr) |
| | | WHERE |
| | | Bar_Code__c IN :BarCodeListP |
| | | AND (NOT Product_Type__c LIKE :userPro_Typestr) |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND ((Consumable_order_minor__c != null |
| | | AND ((Consumable_order_minor__c != NULL |
| | | AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation) |
| | | OR Consumable_order_minor__c = null) |
| | | ORDER BY Name ]; |
| | | OR Consumable_order_minor__c = NULL) |
| | | ORDER BY Name |
| | | ]; |
| | | |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | |
| | | } |
| | | } |
| | | } |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c,Box_Piece__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_Product__r.Name__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Box_Piece__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | recordtypeid, |
| | | Consumable_order_minor__r.Arrive_Order__c, |
| | | //add by rentx 2020-10-14 start |
| | | ,ContractNo_text__c/*,ContractNo__c*/ |
| | | ContractNo_text__c /*,ContractNo__c*/, |
| | | // tcm start |
| | | ,Consumable_order_minor__r.ContractNo__c |
| | | Consumable_order_minor__r.ContractNo__c, |
| | | // tcm end |
| | | ,Report_Product_Expiration__c |
| | | Report_Product_Expiration__c |
| | | //add by rentx 2020-10-14 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = FALSE |
| | | WHERE |
| | | Dealer_Arrive__c = FALSE |
| | | AND Dealer_Shipment__c= FALSE |
| | | AND Dealer_Saled__c = FALSE |
| | | AND Dealer_Returned__c = false |
| | | AND Bar_Code__c in :BarCodeListP |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Bar_Code__c IN :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | ORDER BY Name ];//没到货 |
| | | ORDER BY Name |
| | | ]; //没到货 |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | |
| | | } |
| | | } |
| | | } |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,ToDueDateDays__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c,Lose_Flag__c,Box_Piece__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_Product__r.Name__c, |
| | | ToDueDateDays__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Lose_Flag__c, |
| | | Box_Piece__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | recordtypeid, |
| | | Consumable_order_minor__r.Arrive_Order__c, |
| | | //add by rentx 2020-10-14 start |
| | | ,ContractNo_text__c/*,ContractNo__c*/ |
| | | ContractNo_text__c /*,ContractNo__c*/, |
| | | // tcm start |
| | | ,Consumable_order_minor__r.ContractNo__c |
| | | Consumable_order_minor__r.ContractNo__c, |
| | | // tcm end |
| | | , Report_Product_Expiration__c |
| | | Report_Product_Expiration__c |
| | | //add by rentx 2020-10-14 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | | AND Dealer_Shipment__c= FALSE |
| | | AND Dealer_Saled__c = FALSE |
| | | AND Bar_Code__c in :BarCodeListP |
| | | AND Dealer_Returned__c = false |
| | | AND Bar_Code__c IN :BarCodeListP |
| | | AND Dealer_Returned__c = FALSE |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 start |
| | | //AND Lose_Flag__c = FALSE |
| | | // AND Lose_Flag__c = FALSE |
| | |
| | | // Gzw 20201215修复,拆盒产品不判断 |
| | | AND Box_Piece__c = '盒' |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 end |
| | | ORDER BY Name ];//没出库,没销售,就是在库 |
| | | ORDER BY Name |
| | | ]; //没出库,没销售,就是在库 |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | | // 跳过已经处理的消耗品明细 |
| | | continue; |
| | | }else{ |
| | | |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 start |
| | | // String str = '该商品在库'; |
| | | // if (reSet1[i].Lose_Flag__c) { |
| | |
| | | str = '该商品在库';//没出库 ,没销售,没丢失就是在库。 |
| | | } |
| | | if(reSet1[i].Lose_Flag__c == true && reSet1[i].ToDueDateDays__c >= 0){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING, '产品'+reSet1[i].Consumable_Product__r.Name+'存在丢失记录'));//如果丢失产品就给提示。 |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.WARNING, |
| | | '产品' + reSet1[i].Consumable_Product__r.Name + '存在丢失记录' |
| | | ) |
| | | ); //如果丢失产品就给提示。 |
| | | } |
| | | if (reSet1[i].Lose_Flag__c == true && reSet1[i].ToDueDateDays__c < 0) { |
| | | str = '过期已销存产品,不允许返品'; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //到货正确信息 |
| | | reSet = [SELECT Id, |
| | | reSet = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | |
| | | TracingCode__c, |
| | | Agencyinfo_fromSAP__c, |
| | | Frist_Storage_Agency__c, |
| | | Dealer_Info_text__c |
| | | Dealer_Info_text__c, |
| | | //add by rentx 2020-10-14 start |
| | | ,ContractNo_text__c/*,ContractNo__c*/ |
| | | ContractNo_text__c /*,ContractNo__c*/, |
| | | // tcm start |
| | | ,Consumable_order_minor__r.ContractNo__c |
| | | Consumable_order_minor__r.ContractNo__c |
| | | // tcm end |
| | | //add by rentx 2020-10-14 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | AND Cancellation_Date__c = null |
| | | AND Dealer_Arrive__c = false |
| | | AND Product_Type__c like :userPro_Typestr |
| | | AND Bar_Code__c in :BarCodeListP |
| | | WHERE |
| | | recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | AND Cancellation_Date__c = NULL |
| | | AND Dealer_Arrive__c = FALSE |
| | | AND Product_Type__c LIKE :userPro_Typestr |
| | | AND Bar_Code__c IN :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND ((Consumable_order_minor__c != null |
| | | AND ((Consumable_order_minor__c != NULL |
| | | AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation) |
| | | OR Consumable_order_minor__c = null) |
| | | ORDER BY Name ]; |
| | | OR Consumable_order_minor__c = NULL) |
| | | ORDER BY Name |
| | | ]; |
| | | |
| | | if(reSet.size()>0){ |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'ErrorIdMap+++ '+ ErrorIdMap.keyset())); |
| | | Map<String,String> errorMap = new Map<String,String>(); |
| | | for (Integer i = 0; i < reSet.size(); i++) { |
| | | |
| | | if(ExistIdMap.containsKey(reSet[i].Bar_Code__c) || ErrorIdMap.containsKey(reSet[i].Bar_Code__c)){ |
| | | // 跳过已经处理的消耗品明细 |
| | | continue; |
| | |
| | | } |
| | | } |
| | | //barcode不一致,管理编码一致 |
| | | reSet = [SELECT Id, |
| | | reSet = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | |
| | | Report_Product_Expiration__c, |
| | | Box_Piece__c, |
| | | Rrturn_count__c, |
| | | TracingCode__c |
| | | ,Agencyinfo_fromSAP__c |
| | | ,Frist_Storage_Agency__c |
| | | TracingCode__c, |
| | | Agencyinfo_fromSAP__c, |
| | | Frist_Storage_Agency__c, |
| | | //add by rentx 2020-10-14 start |
| | | ,ContractNo_text__c/*,ContractNo__c */ |
| | | ContractNo_text__c /*,ContractNo__c */, |
| | | // tcm start |
| | | ,Consumable_order_minor__r.ContractNo__c |
| | | Consumable_order_minor__r.ContractNo__c |
| | | // tcm end |
| | | //add by rentx 2020-10-14 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | WHERE |
| | | recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | AND Dealer_Info_text__c = :accountName |
| | | //update by rentx 2021-01-04 start CHAN-BWX3XW |
| | | // AND Consumable_order_minor__c != null |
| | | // AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation |
| | | AND ((Consumable_order_minor__c != null AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation) OR Consumable_order_minor__c = null) |
| | | AND ((Consumable_order_minor__c != NULL |
| | | AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation) |
| | | OR Consumable_order_minor__c = NULL) |
| | | //update by rentx 2021-01-04 end CHAN-BWX3XW |
| | | AND Dealer_Arrive__c = false |
| | | AND Cancellation_Date__c = null |
| | | AND TracingCode__c in :barMcodeMap.values() |
| | | AND Bar_Code__c not in :barMcodeMap.keySet() |
| | | ORDER BY Name ]; |
| | | AND Dealer_Arrive__c = FALSE |
| | | AND Cancellation_Date__c = NULL |
| | | AND TracingCode__c IN :barMcodeMap.values() |
| | | AND Bar_Code__c NOT IN :barMcodeMap.keySet() |
| | | ORDER BY Name |
| | | ]; |
| | | |
| | | if(reSet.size()>0){ |
| | | for (Integer i = 0; i < reSet.size(); i++) { |
| | |
| | | if(reSet[i].Bar_Code__c != str && reSet[i].TracingCode__c == barMcodeMap.get(str)){ |
| | | // 20220815 ljh SWAG-CH65B7 start |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'此管理编码与实际发货BarCode不一致,请核对管理编码('+ str +')的入库及库存数据。')); |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'条形码为('+ str +')的入库数据与发货数据不一致')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.WARNING, '条形码为(' + str + ')的入库数据与发货数据不一致') |
| | | ); |
| | | // 20220815 ljh SWAG-CH65B7 end |
| | | } |
| | | if(barMcodeMap.get(str) == reSet[i].TracingCode__c){ |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // CHAN-BD43NK 关闭直接返品功能 追加 barcode不一致判断 |
| | | reSet1 = [SELECT Id,Name,TracingCode__c,Bar_Code__c,Sale_orderName__c,Report_Product_Expiration__c |
| | | reSet1 = [ |
| | | SELECT Id, Name, TracingCode__c, Bar_Code__c, Sale_orderName__c, Report_Product_Expiration__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | AND (Dealer_Shipment__c = true |
| | | OR Dealer_Saled__c = true) |
| | | AND TracingCode__c in :barMcodeMap.values() |
| | | AND Bar_Code__c not in :barMcodeMap.keySet() |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | | AND (Dealer_Shipment__c = TRUE |
| | | OR Dealer_Saled__c = TRUE) |
| | | AND TracingCode__c IN :barMcodeMap.values() |
| | | AND Bar_Code__c NOT IN :barMcodeMap.keySet() |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | ORDER BY Name ]; |
| | | ORDER BY Name |
| | | ]; |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | |
| | | }else{ |
| | | for(String str : barMcodeMap.keySet()){ |
| | | if(barMcodeMap.get(str) == reSet1[i].TracingCode__c){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'barcode' +str + '与出库单' + reSet1[i].Sale_orderName__c + ' 中的管理编码一致,但Barcode不同,请确认具体数据。')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'barcode' + |
| | | str + |
| | | '与出库单' + |
| | | reSet1[i].Sale_orderName__c + |
| | | ' 中的管理编码一致,但Barcode不同,请确认具体数据。' |
| | | ) |
| | | ); |
| | | ErrorIdMap.put(str,str); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c); |
| | | } |
| | |
| | | return; |
| | | } |
| | | }else{ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode号'+ notInlist + '不存在,无对应的出库单,请先操作产品入库。')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号' + notInlist + '不存在,无对应的出库单,请先操作产品入库。' |
| | | ) |
| | | ); |
| | | return; |
| | | } |
| | | } |
| | |
| | | if (HosErrorList.size() > 0) { |
| | | for (String str : HosErrorList) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode号:' + str + HosErrorMap.get(str)+'')); |
| | | |
| | | } |
| | | } |
| | | //add by rentx 2021-01-27 end |
| | | |
| | | }else{ |
| | | //已取消产品 |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c,Box_Piece__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c,Report_Product_Expiration__c |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_Product__r.Name__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Box_Piece__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | recordtypeid, |
| | | Consumable_order_minor__r.Arrive_Order__c, |
| | | Report_Product_Expiration__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = FALSE |
| | | WHERE |
| | | Dealer_Arrive__c = FALSE |
| | | AND Dealer_Shipment__c= FALSE |
| | | AND Dealer_Saled__c = FALSE |
| | | AND Dealer_Returned__c = false |
| | | AND Cancellation_Date__c != null |
| | | AND Bar_Code__c in :BarCodeListP |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Cancellation_Date__c != NULL |
| | | AND Bar_Code__c IN :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | ORDER BY Name ];//没到货 |
| | | ORDER BY Name |
| | | ]; //没到货 |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | |
| | | } |
| | | } |
| | | //已经销售 |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c,Box_Piece__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c,Report_Product_Expiration__c |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_Product__r.Name__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Box_Piece__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | recordtypeid, |
| | | Consumable_order_minor__r.Arrive_Order__c, |
| | | Report_Product_Expiration__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Saled__c = true |
| | | AND Dealer_Returned__c =false |
| | | WHERE |
| | | Dealer_Saled__c = TRUE |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Bar_Code__c in :BarCodeListP |
| | | AND Bar_Code__c IN :BarCodeListP |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | ORDER BY Name ]; |
| | | ORDER BY Name |
| | | ]; |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | |
| | | } |
| | | } |
| | | //已经出库产品 |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c,Box_Piece__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c,Report_Product_Expiration__c |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_Product__r.Name__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Box_Piece__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | recordtypeid, |
| | | Consumable_order_minor__r.Arrive_Order__c, |
| | | Report_Product_Expiration__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Shipment__c = true |
| | | AND Dealer_Returned__c =false |
| | | WHERE |
| | | Dealer_Shipment__c = TRUE |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | AND Bar_Code__c in :BarCodeListP |
| | | ORDER BY Name ]; |
| | | AND Bar_Code__c IN :BarCodeListP |
| | | ORDER BY Name |
| | | ]; |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | |
| | | } |
| | | } |
| | | //已经到货产品 |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c,Lose_Flag__c,Box_Piece__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c,Report_Product_Expiration__c |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_Product__r.Name__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Lose_Flag__c, |
| | | Box_Piece__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | recordtypeid, |
| | | Consumable_order_minor__r.Arrive_Order__c, |
| | | Report_Product_Expiration__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | AND Dealer_Returned__c =false |
| | | AND Bar_Code__c in :BarCodeListP |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Bar_Code__c IN :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | ORDER BY Name ]; |
| | | ORDER BY Name |
| | | ]; |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | |
| | | continue; |
| | | }else{ |
| | | String str = '该商品已经到货'; |
| | | if (reSet1[i].Lose_Flag__c == TRUE) { |
| | | if (reSet1[i].Lose_Flag__c == true) { |
| | | str = '该商品已经丢失'; |
| | | } |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str)); |
| | |
| | | } |
| | | } |
| | | //不属于本订单 |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c,Box_Piece__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c,Report_Product_Expiration__c |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_Product__r.Name__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Box_Piece__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | recordtypeid, |
| | | Consumable_order_minor__r.Arrive_Order__c, |
| | | Report_Product_Expiration__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Consumable_order_minor__c != :ESetId |
| | | AND Bar_Code__c in :BarCodeListP |
| | | WHERE Consumable_order_minor__c != :ESetId AND Bar_Code__c IN :BarCodeListP |
| | | //AND Dealer_Info_text__c = :accountName |
| | | ORDER BY Name ]; |
| | | ORDER BY Name |
| | | ]; |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | |
| | | } |
| | | } |
| | | //到货但产品类型与用户的类型不符 |
| | | reSet1 = [SELECT Id,Name,Intra_Trade_List_RMB__c,Asset_Model_No__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, |
| | | Consumable_Product__r.Name__c,Consumable_Product__r.Asset_Model_No__c, |
| | | Sterilization_limit__c,Deliver_date__c,Bar_Code__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c,Dealer_Arrive__c, |
| | | Guarantee_period_for_products__c,CFDA_Status__c, |
| | | ProductPacking_list_manual__c,Report_Product_Approbation__c, |
| | | Report_Product_Expiration__c,Box_Piece__c, Rrturn_count__c, |
| | | Product_Type__c |
| | | ,ContractNo_text__c/*,ContractNo__c*/ |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Consumable_Product__r.Name__c, |
| | | Consumable_Product__r.Asset_Model_No__c, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | Dealer_Arrive__c, |
| | | Guarantee_period_for_products__c, |
| | | CFDA_Status__c, |
| | | ProductPacking_list_manual__c, |
| | | Report_Product_Approbation__c, |
| | | Report_Product_Expiration__c, |
| | | Box_Piece__c, |
| | | Rrturn_count__c, |
| | | Product_Type__c, |
| | | ContractNo_text__c /*,ContractNo__c*/, |
| | | // tcm start |
| | | ,Consumable_order_minor__r.ContractNo__c |
| | | Consumable_order_minor__r.ContractNo__c |
| | | // tcm end |
| | | FROM Consumable_order_details2__c |
| | | WHERE recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | WHERE |
| | | recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND ( not Product_Type__c like :userPro_Typestr) |
| | | AND (NOT Product_Type__c LIKE :userPro_Typestr) |
| | | AND Consumable_order_minor__c = :ESetId |
| | | AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation |
| | | AND Dealer_Arrive__c = false |
| | | AND Cancellation_Date__c = null |
| | | AND Bar_Code__c in :BarCodeListP |
| | | ORDER BY Name ]; |
| | | AND Dealer_Arrive__c = FALSE |
| | | AND Cancellation_Date__c = NULL |
| | | AND Bar_Code__c IN :BarCodeListP |
| | | ORDER BY Name |
| | | ]; |
| | | if(reSet1.size()>0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | |
| | | } |
| | | |
| | | //到货正确信息 |
| | | reSet = [SELECT Id,Name,Intra_Trade_List_RMB__c,Asset_Model_No__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, |
| | | Consumable_Product__r.Name__c,Consumable_Product__r.Asset_Model_No__c, |
| | | Sterilization_limit__c,Deliver_date__c,Bar_Code__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c,Dealer_Arrive__c, |
| | | Guarantee_period_for_products__c,CFDA_Status__c, |
| | | ProductPacking_list_manual__c,Report_Product_Approbation__c, |
| | | Report_Product_Expiration__c,Box_Piece__c, Rrturn_count__c, |
| | | reSet = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Consumable_Product__r.Name__c, |
| | | Consumable_Product__r.Asset_Model_No__c, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | Dealer_Arrive__c, |
| | | Guarantee_period_for_products__c, |
| | | CFDA_Status__c, |
| | | ProductPacking_list_manual__c, |
| | | Report_Product_Approbation__c, |
| | | Report_Product_Expiration__c, |
| | | Box_Piece__c, |
| | | Rrturn_count__c, |
| | | TracingCode__c, |
| | | Agencyinfo_fromSAP__c, |
| | | Frist_Storage_Agency__c, |
| | | Dealer_Info_text__c |
| | | ,ContractNo_text__c/*,ContractNo__c*/ |
| | | Dealer_Info_text__c, |
| | | ContractNo_text__c /*,ContractNo__c*/, |
| | | // tcm start |
| | | ,Consumable_order_minor__r.ContractNo__c |
| | | Consumable_order_minor__r.ContractNo__c |
| | | // tcm end |
| | | FROM Consumable_order_details2__c |
| | | WHERE recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | WHERE |
| | | recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Product_Type__c like :userPro_Typestr |
| | | AND Product_Type__c LIKE :userPro_Typestr |
| | | AND Consumable_order_minor__c = :ESetId |
| | | AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation |
| | | AND Dealer_Arrive__c = false |
| | | AND Cancellation_Date__c = null |
| | | AND Bar_Code__c in :BarCodeListP |
| | | ORDER BY Name ]; |
| | | AND Dealer_Arrive__c = FALSE |
| | | AND Cancellation_Date__c = NULL |
| | | AND Bar_Code__c IN :BarCodeListP |
| | | ORDER BY Name |
| | | ]; |
| | | if(reSet.size()>0){ |
| | | Map<String,String> errorMap = new Map<String,String>(); |
| | | for (Integer i = 0; i < reSet.size(); i++) { |
| | |
| | | } |
| | | |
| | | //barcode不一致,管理编码一致 |
| | | reSet = [SELECT Id, |
| | | reSet = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | |
| | | ProductPacking_list_manual__c, |
| | | Report_Product_Approbation__c, |
| | | Report_Product_Expiration__c, |
| | | TracingCode__c |
| | | ,Agencyinfo_fromSAP__c |
| | | ,Frist_Storage_Agency__c |
| | | ,ContractNo_text__c/*,ContractNo__c*/ |
| | | TracingCode__c, |
| | | Agencyinfo_fromSAP__c, |
| | | Frist_Storage_Agency__c, |
| | | ContractNo_text__c /*,ContractNo__c*/, |
| | | // tcm start |
| | | ,Consumable_order_minor__r.ContractNo__c |
| | | Consumable_order_minor__r.ContractNo__c |
| | | // tcm end |
| | | FROM Consumable_order_details2__c |
| | | WHERE recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | AND Cancellation_Date__c = null |
| | | AND Dealer_Arrive__c = false |
| | | AND TracingCode__c in :barMcodeMap.values() |
| | | AND Bar_Code__c not in :barMcodeMap.keySet() |
| | | WHERE |
| | | recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | AND Cancellation_Date__c = NULL |
| | | AND Dealer_Arrive__c = FALSE |
| | | AND TracingCode__c IN :barMcodeMap.values() |
| | | AND Bar_Code__c NOT IN :barMcodeMap.keySet() |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND ((Consumable_order_minor__c != null |
| | | AND ((Consumable_order_minor__c != NULL |
| | | AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation) |
| | | OR Consumable_order_minor__c = null) |
| | | ORDER BY Name ]; |
| | | OR Consumable_order_minor__c = NULL) |
| | | ORDER BY Name |
| | | ]; |
| | | if(reSet.size()>0){ |
| | | for (Integer i = 0; i < reSet.size(); i++) { |
| | | if(ExistIdMap.containsKey(reSet[i].Bar_Code__c) || ErrorIdMap.containsKey(reSet[i].Bar_Code__c)){ |
| | |
| | | else if (coc!= null && coc.orderPattern__c == 'hospitalorder') { |
| | | HosErrorList.add(BarCodeListP[i]); |
| | | continue; |
| | | |
| | | } |
| | | //add by rentx 2021-01-27 end |
| | | else{ |
| | |
| | | if (HosErrorList.size() > 0) { |
| | | for (String str : HosErrorList) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode号:' + str +'是非医院特价产品')); |
| | | |
| | | } |
| | | } |
| | | //add by rentx 2021-01-27 end |
| | | |
| | | makeArrivedSummary(); |
| | | |
| | | |
| | | //add by rentx 20210602 start CHAN-C3K4ZQ |
| | | makeRecordsView(ConsumableorderdetailsRecordsdummy); |
| | | //add by rentx 20210602 end CHAN-C3K4ZQ |
| | | } |
| | | |
| | | |
| | | public void inventoryEntryNoESetId (List<String> barCodeList){ |
| | | //所有barcode解析到的Jancode |
| | |
| | | //生产日期 |
| | | List<String> janCode = new List<String>(); |
| | | if(barCodeList[i].length() < 16){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的位数不足16,不符合要求错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')的位数不足16,不符合要求错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | }else { |
| | | //if(barCodeList[i].substring(0,2) !='01'){ |
| | |
| | | try{ |
| | | Decimal test = Decimal.valueOf(janCodeMark); |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的janCode错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')的janCode错误!') |
| | | ); |
| | | continue; |
| | | } |
| | | } |
| | | if(barCodeList[i].length() >= 22){ |
| | | if(barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)!='250'){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')没有管理编码!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')没有管理编码!') |
| | | ); |
| | | continue; |
| | | } |
| | | if( barCodeList[i].substring(16,18) =='11'){ |
| | |
| | | productDateStr = '20' + barCodeList[i].substring(18,20) + '-' + barCodeList[i].substring(20,22) + '-01' ; |
| | | productionDate = Date.valueOf(productDateStr); |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')的生产日期' + productDateStr + '错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')的生产日期' + productDateStr + '错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | if(barCodeList[i].length() >=32){ |
| | | if( barCodeList[i].substring(24,26) =='17'){ |
| | | try{ |
| | | if(barCodeList[i].substring(30,32)=='00'){ |
| | | expirationDateStr = '20' + barCodeList[i].substring(26,28) + '-' + barCodeList[i].substring(28,30) + '-' + '01' ; |
| | | expirationDateStr = |
| | | '20' + |
| | | barCodeList[i].substring(26, 28) + |
| | | '-' + |
| | | barCodeList[i].substring(28, 30) + |
| | | '-' + |
| | | '01'; |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1); |
| | | }else{ |
| | | expirationDateStr = '20' + barCodeList[i].substring(26,28) + '-' + barCodeList[i].substring(28,30) + '-' +barCodeList[i].substring(30,32) ; |
| | | expirationDateStr = |
| | | '20' + |
| | | barCodeList[i].substring(26, 28) + |
| | | '-' + |
| | | barCodeList[i].substring(28, 30) + |
| | | '-' + |
| | | barCodeList[i].substring(30, 32); |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | } |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的滅菌有効期限' + expirationDateStr + '错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')的滅菌有効期限' + expirationDateStr + '错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | if(barCodeList[i].length() >= 42){ |
| | |
| | | }else if(barCodeList[i].substring(16,18) =='17'){ |
| | | try{ |
| | | if(barCodeList[i].substring(22,24)=='00'){ |
| | | expirationDateStr = '20' + barCodeList[i].substring(18,20) + '-' + barCodeList[i].substring(20,22) + '-01'; |
| | | expirationDateStr = |
| | | '20' + |
| | | barCodeList[i].substring(18, 20) + |
| | | '-' + |
| | | barCodeList[i].substring(20, 22) + |
| | | '-01'; |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品expirationDateStr' + expirationDateStr)); |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1); |
| | | }else{ |
| | | expirationDateStr = '20' + barCodeList[i].substring(18,20) + '-' + barCodeList[i].substring(20,22) + '-' +barCodeList[i].substring(22,24); |
| | | expirationDateStr = |
| | | '20' + |
| | | barCodeList[i].substring(18, 20) + |
| | | '-' + |
| | | barCodeList[i].substring(20, 22) + |
| | | '-' + |
| | | barCodeList[i].substring(22, 24); |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | } |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的滅菌有効期限' + expirationDateStr + '错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')的滅菌有効期限' + expirationDateStr + '错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | if(barCodeList[i].length() >= 34){ |
| | |
| | | serialNoorLotNo = barCodeList[i].substring(26,barCodeList[i].length() - 8) ; |
| | | } |
| | | } |
| | | |
| | | }else if(barCodeList[i].length() >= 26){ |
| | | if(barCodeList[i].substring(16,18) =='10' || barCodeList[i].substring(16,18) =='21'){ |
| | | serialNoorLotNo = barCodeList[i].substring(18,barCodeList[i].length() - 8) ; |
| | | } |
| | | } |
| | | } |
| | | if(barCodeList[i].length() >= 24 && barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)=='250'){ |
| | | if ( |
| | | barCodeList[i].length() >= 24 && |
| | | barCodeList[i].substring(barCodeList[i].length() - 8, barCodeList[i].length() - 5) == '250' |
| | | ) { |
| | | if(barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)=='250'){ |
| | | tracingCode = barCodeList[i].substring(barCodeList[i].length() - 5,barCodeList[i].length()); |
| | | Matcher n = Pattern.compile('[0-9]').matcher(tracingCode); |
| | | if(n.find()){ |
| | | String str = '管理编码不正确,请与管理员确认是否错误。'; |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')管理编码中有数字,请与管理员确认是否错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')管理编码中有数字,请与管理员确认是否错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | }else{ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的tracingCode错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')的tracingCode错误!') |
| | | ); |
| | | continue; |
| | | } |
| | | } |
| | |
| | | Integer jan12 = Integer.valueOf(janCodeMark.substring(11, 12)); |
| | | Integer jan13 = Integer.valueOf(janCodeMark.substring(12, 13)); |
| | | |
| | | Integer count12 = jan2 + jan3*3 + jan4 + jan5*3 + jan6 + jan7*3 + jan8 + jan9*3 + jan10 + jan11*3 +jan12 + jan13*3; |
| | | Integer count13 = jan1*3 + jan2 + jan3*3 + jan4 + jan5*3 + jan6 + jan7*3 + jan8 + jan9*3 + jan10 + jan11*3 +jan12 + jan13*3; |
| | | Integer count12 = |
| | | jan2 + |
| | | jan3 * 3 + |
| | | jan4 + |
| | | jan5 * 3 + |
| | | jan6 + |
| | | jan7 * 3 + |
| | | jan8 + |
| | | jan9 * 3 + |
| | | jan10 + |
| | | jan11 * 3 + |
| | | jan12 + |
| | | jan13 * 3; |
| | | Integer count13 = |
| | | jan1 * 3 + |
| | | jan2 + |
| | | jan3 * 3 + |
| | | jan4 + |
| | | jan5 * 3 + |
| | | jan6 + |
| | | jan7 * 3 + |
| | | jan8 + |
| | | jan9 * 3 + |
| | | jan10 + |
| | | jan11 * 3 + |
| | | jan12 + |
| | | jan13 * 3; |
| | | String frost12 = (String.valueOf(count12)).substring((String.valueOf(count12)).length()-1); |
| | | String frost13 = (String.valueOf(count13)).substring((String.valueOf(count13)).length()-1); |
| | | //减去12位个位 |
| | | frost12 = (String.valueOf(10 - Integer.valueOf(frost12))).substring((String.valueOf(10 - Integer.valueOf(frost12))).length()-1); |
| | | frost13 = (String.valueOf(10 - Integer.valueOf(frost13))).substring((String.valueOf(10 - Integer.valueOf(frost13))).length()-1); |
| | | frost12 = (String.valueOf(10 - Integer.valueOf(frost12))) |
| | | .substring((String.valueOf(10 - Integer.valueOf(frost12))).length() - 1); |
| | | frost13 = (String.valueOf(10 - Integer.valueOf(frost13))) |
| | | .substring((String.valueOf(10 - Integer.valueOf(frost13))).length() - 1); |
| | | janCode.add(janCodeMark.substring(1, 13) + frost12); |
| | | janCode.add(janCodeMark.substring(0, 13) + frost12); |
| | | janCode.add(janCodeMark.substring(1, 13) + frost13); |
| | |
| | | barcodeinfoMap.put(barCodeList[i], barcodedetList); |
| | | barCode01List.add(barCodeList[i]); |
| | | }else if(barCodeList[i].substring(0,3) =='241'){ |
| | | if(barCodeList[i].length() > 8 && barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)!='250'){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')没有管理编码!')); |
| | | if ( |
| | | barCodeList[i].length() > 8 && |
| | | barCodeList[i].substring(barCodeList[i].length() - 8, barCodeList[i].length() - 5) != '250' |
| | | ) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')没有管理编码!') |
| | | ); |
| | | continue; |
| | | } |
| | | List<String> otCodeList = new List<String>(); |
| | | Map<String,String> otCodeMap = new Map<String,String>(); |
| | | if(barCodeList[i].length() < 7){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的位数不足16,不符合要求错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')的位数不足16,不符合要求错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | }else if(barCodeList[i].length() == 11){ |
| | | String otCode4 = barCodeList[i].substring(3,7); |
| | |
| | | barOtcodeMap.put(barCodeList[i], otCodeMap); |
| | | barCode241List.add(barCodeList[i]); |
| | | }else{ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')不符合要求!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')不符合要求!') |
| | | ); |
| | | continue; |
| | | } |
| | | }else{ |
| | |
| | | //01通过检索产品是否存在 |
| | | //-----------XHL--------------UpdateSTART----------------20181010------ |
| | | if(alljanCodeList.size() > 0){ |
| | | List<Product2__c> product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c,Product2_Jancode__c, |
| | | Pro2_Dealer_ENG__c,Pro2_Dealer_Object__c |
| | | List<Product2__c> product2InStore = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Name__c, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | | OT_CODE__c, |
| | | Product2_Jancode__c, |
| | | Pro2_Dealer_ENG__c, |
| | | Pro2_Dealer_Object__c |
| | | FROM Product2__c |
| | | WHERE Product2_Jancode__c in :alljanCodeList |
| | | order by SFDA_Expiration_Date__c desc ] ; |
| | | WHERE Product2_Jancode__c IN :alljanCodeList |
| | | ORDER BY SFDA_Expiration_Date__c DESC |
| | | ]; |
| | | if(product2InStore.size() > 0){ |
| | | // CHAN-AVSAST |
| | | Map<String,String> rightBar = new Map<String,String>(); |
| | |
| | | for(Product2__c produ: product2InStore){ |
| | | if(barJancodeMap.get(bar).containsKey(produ.Product2_Jancode__c) && !rightBar.containsKey(bar)){ |
| | | cou ++; |
| | | if(EngFlag == TRUE && produ.Pro2_Dealer_ENG__c == TRUE){ |
| | | if (EngFlag == true && produ.Pro2_Dealer_ENG__c == true) { |
| | | consumableInventory.add(new ConsumableorderdetailsInfo(produ,barcodeinfoMap.get(bar))); |
| | | consumableInventoryUse.add(new ConsumableorderdetailsInfo(produ,barcodeinfoMap.get(bar))); |
| | | rightBar.put(bar, bar); |
| | | }else if(ETFlag == TRUE && produ.Pro2_Dealer_Object__c == TRUE){ |
| | | } else if (ETFlag == true && produ.Pro2_Dealer_Object__c == true) { |
| | | consumableInventory.add(new ConsumableorderdetailsInfo(produ,barcodeinfoMap.get(bar))); |
| | | consumableInventoryUse.add(new ConsumableorderdetailsInfo(produ,barcodeinfoMap.get(bar))); |
| | | rightBar.put(bar, bar); |
| | |
| | | errorMap.put(bar, bar); |
| | | } |
| | | } |
| | | |
| | | } |
| | | if(cou <= 0 ){ |
| | | notInStorelist.add(bar); |
| | | } |
| | | } |
| | | if(errorMap.size() > 0){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode号['+ errorMap.values() +']产品类型['+product_Type+']与用户类型['+userPro_Type+']不符')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号[' + errorMap.values() + ']产品类型[' + product_Type + ']与用户类型[' + userPro_Type + ']不符' |
| | | ) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | |
| | | if(allotCodeList.size() > 0){ |
| | | Map<String,String> errorMap = new Map<String,String>(); |
| | | Map<String,String> exitBarCodeMap = new Map<String,String>(); |
| | | List<Product2__c> product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c,Product2_Jancode__c, |
| | | Pro2_Dealer_ENG__c,Pro2_Dealer_Object__c |
| | | List<Product2__c> product2InStore = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Name__c, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | | OT_CODE__c, |
| | | Product2_Jancode__c, |
| | | Pro2_Dealer_ENG__c, |
| | | Pro2_Dealer_Object__c |
| | | FROM Product2__c |
| | | WHERE OT_CODE__c in :allotCodeList |
| | | AND (not Product_Type__c like :userPro_Typestr)] ; |
| | | WHERE OT_CODE__c IN :allotCodeList AND (NOT Product_Type__c LIKE :userPro_Typestr) |
| | | ]; |
| | | if(product2InStore.size() > 0){ |
| | | |
| | | for(Product2__c produ: product2InStore){ |
| | | for(String bar: barOtcodeMap.keySet() ){ |
| | | if(barOtcodeMap.get(bar).containsKey(produ.OT_CODE__c)){ |
| | |
| | | } |
| | | } |
| | | if(errorMap.size() > 0){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode号['+ errorMap.values() +']产品类型['+product_Type+']与用户['+userPro_Type+']类型不符')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号[' + errorMap.values() + ']产品类型[' + product_Type + ']与用户[' + userPro_Type + ']类型不符' |
| | | ) |
| | | ); |
| | | } |
| | | product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c,Product2_Jancode__c, |
| | | Pro2_Dealer_ENG__c,Pro2_Dealer_Object__c |
| | | product2InStore = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Name__c, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | | OT_CODE__c, |
| | | Product2_Jancode__c, |
| | | Pro2_Dealer_ENG__c, |
| | | Pro2_Dealer_Object__c |
| | | FROM Product2__c |
| | | WHERE OT_CODE__c in :allotCodeList |
| | | AND Product_Type__c like :userPro_Typestr] ; |
| | | WHERE OT_CODE__c IN :allotCodeList AND Product_Type__c LIKE :userPro_Typestr |
| | | ]; |
| | | |
| | | if(product2InStore.size() > 0){ |
| | | |
| | | for(Product2__c produ: product2InStore){ |
| | | for(String bar: barOtcodeMap.keySet() ){ |
| | | Date expirationDate = null ; |
| | |
| | | if(bar.length() >= oTcodeLength + 11){ |
| | | if( bar.substring(oTcodeLength + 3,oTcodeLength + 5) =='11'){ |
| | | try{ |
| | | productDateStr = '20' + bar.substring(oTcodeLength + 5,oTcodeLength + 7) + '-' + bar.substring(oTcodeLength + 7,oTcodeLength + 9) + '-01' ; |
| | | productDateStr = |
| | | '20' + |
| | | bar.substring(oTcodeLength + 5, oTcodeLength + 7) + |
| | | '-' + |
| | | bar.substring(oTcodeLength + 7, oTcodeLength + 9) + |
| | | '-01'; |
| | | productionDate = Date.valueOf(productDateStr); |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + bar + ')的生产日期' + productDateStr + '错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + bar + ')的生产日期' + productDateStr + '错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | if(bar.length() >=oTcodeLength + 3 + 16){ |
| | | if( bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='17'){ |
| | | try{ |
| | | if(bar.substring(oTcodeLength + 3 + 14,oTcodeLength + 3 + 16)=='00'){ |
| | | expirationDateStr = '20' + bar.substring(oTcodeLength + 3 + 10,oTcodeLength + 3 + 12) + '-' + bar.substring(oTcodeLength + 3 + 12,oTcodeLength + 3 + 14) + '-' + '01' ; |
| | | expirationDateStr = |
| | | '20' + |
| | | bar.substring(oTcodeLength + 3 + 10, oTcodeLength + 3 + 12) + |
| | | '-' + |
| | | bar.substring(oTcodeLength + 3 + 12, oTcodeLength + 3 + 14) + |
| | | '-' + |
| | | '01'; |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1); |
| | | }else{ |
| | | expirationDateStr = '20' + bar.substring(oTcodeLength + 3 + 10,oTcodeLength + 3 + 12) + '-' + bar.substring(oTcodeLength + 3 + 12,oTcodeLength + 3 + 14) + '-' +bar.substring(oTcodeLength + 3 + 14,oTcodeLength + 3 + 16) ; |
| | | expirationDateStr = |
| | | '20' + |
| | | bar.substring(oTcodeLength + 3 + 10, oTcodeLength + 3 + 12) + |
| | | '-' + |
| | | bar.substring(oTcodeLength + 3 + 12, oTcodeLength + 3 + 14) + |
| | | '-' + |
| | | bar.substring(oTcodeLength + 3 + 14, oTcodeLength + 3 + 16); |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | } |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')的滅菌有効期限' + expirationDateStr + '错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + bar + ')的滅菌有効期限' + expirationDateStr + '错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | if(bar.length() >= oTcodeLength + 3 + 25){ |
| | | if(bar.substring(oTcodeLength + 3 + 16,oTcodeLength + 3 + 18) =='10' || bar.substring(oTcodeLength + 3 + 16,oTcodeLength + 3 + 18) =='21'){ |
| | | if ( |
| | | bar.substring(oTcodeLength + 3 + 16, oTcodeLength + 3 + 18) == '10' || |
| | | bar.substring(oTcodeLength + 3 + 16, oTcodeLength + 3 + 18) == '21' |
| | | ) { |
| | | serialNoorLotNo = bar.substring(oTcodeLength + 3 + 18,bar.length() - 8) ; |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'serialNoorLotNo' + serialNoorLotNo)); |
| | | } |
| | | } |
| | | }else if(bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='10' || bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='21'){ |
| | | } else if ( |
| | | bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '10' || |
| | | bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '21' |
| | | ) { |
| | | serialNoorLotNo = bar.substring(oTcodeLength + 3 + 10,bar.length() - 8) ; |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'serialNoorLotNo' + serialNoorLotNo)); |
| | | } |
| | |
| | | }else if(bar.substring(oTcodeLength + 3,oTcodeLength + 5) =='17'){ |
| | | try{ |
| | | if(bar.substring(oTcodeLength + 3 + 6,oTcodeLength + 3 + 8)=='00'){ |
| | | expirationDateStr = '20' + bar.substring(oTcodeLength + 3 + 2,oTcodeLength + 3 + 4) + '-' + bar.substring(oTcodeLength + 3 + 4,oTcodeLength + 3 + 6) + '-01'; |
| | | expirationDateStr = |
| | | '20' + |
| | | bar.substring(oTcodeLength + 3 + 2, oTcodeLength + 3 + 4) + |
| | | '-' + |
| | | bar.substring(oTcodeLength + 3 + 4, oTcodeLength + 3 + 6) + |
| | | '-01'; |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1); |
| | | }else{ |
| | | expirationDateStr = '20' + bar.substring(oTcodeLength + 3 + 2,oTcodeLength + 3 + 4) + '-' + bar.substring(oTcodeLength + 3 + 4,oTcodeLength + 3 + 6) + '-' +bar.substring(oTcodeLength + 3 + 6,oTcodeLength + 3 + 8); |
| | | expirationDateStr = |
| | | '20' + |
| | | bar.substring(oTcodeLength + 3 + 2, oTcodeLength + 3 + 4) + |
| | | '-' + |
| | | bar.substring(oTcodeLength + 3 + 4, oTcodeLength + 3 + 6) + |
| | | '-' + |
| | | bar.substring(oTcodeLength + 3 + 6, oTcodeLength + 3 + 8); |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | } |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')的滅菌有効期限' + expirationDateStr + '错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + bar + ')的滅菌有効期限' + expirationDateStr + '错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | if(bar.length() >=oTcodeLength + 20){ |
| | | if(bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='10' || bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='21'){ |
| | | if ( |
| | | bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '10' || |
| | | bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '21' |
| | | ) { |
| | | serialNoorLotNo = bar.substring(oTcodeLength + 3 + 10,bar.length() - 8) ; |
| | | } |
| | | } |
| | | |
| | | }else if(bar.length() >= oTcodeLength + 12){ |
| | | if(bar.substring(oTcodeLength + 3,oTcodeLength + 5) =='10' || bar.substring(oTcodeLength + 3,oTcodeLength + 5) =='21'){ |
| | | if ( |
| | | bar.substring(oTcodeLength + 3, oTcodeLength + 5) == '10' || |
| | | bar.substring(oTcodeLength + 3, oTcodeLength + 5) == '21' |
| | | ) { |
| | | serialNoorLotNo = bar.substring(oTcodeLength + 3 + 2,bar.length() - 8) ; |
| | | } |
| | | } |
| | |
| | | Matcher n = Pattern.compile('[0-9]').matcher(tracingCode); |
| | | if(n.find()){ |
| | | String str = '管理编码不正确,请与管理员确认是否错误。'; |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')管理编码中有数字,请与管理员确认是否错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + bar + ')管理编码中有数字,请与管理员确认是否错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | }else{ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')的tracingCode错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + bar + ')的tracingCode错误!') |
| | | ); |
| | | continue; |
| | | } |
| | | } |
| | |
| | | barcodedetList.add(tracingCode); |
| | | consumableInventory.add(new ConsumableorderdetailsInfo(produ,barcodedetList)); |
| | | consumableInventoryUse.add(new ConsumableorderdetailsInfo(produ,barcodedetList)); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | for(String bartxt :barCode241List){ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | public void inventoryEntry (List<String> barCodeList){ |
| | | //所有barcode解析到的Jancode |
| | |
| | | notInStorelist.clear(); |
| | | notEqualBARcodeCunMap.clear(); |
| | | Map<String,String> orderdetailMap = new Map<String,String>(); |
| | | List<Consumable_Orderdetails__c> orderdetail = [SELECT Id, Name, Consumable_order__c, |
| | | Consumable_Product__c,Asset_Model_No__c |
| | | List<Consumable_Orderdetails__c> orderdetail = [ |
| | | SELECT Id, Name, Consumable_order__c, Consumable_Product__c, Asset_Model_No__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Consumable_order__r.Dealer_Info__c = :accountid |
| | | AND Consumable_order__c != null |
| | | WHERE |
| | | Consumable_order__r.Dealer_Info__c = :accountid |
| | | AND Consumable_order__c != NULL |
| | | AND Consumable_order__c = :ESetId |
| | | AND Order_Owner_WorkLocal__c = :userWorkLocation |
| | | ORDER BY Name ]; |
| | | ORDER BY Name |
| | | ]; |
| | | for(Integer i = 0; i < orderdetail.size(); i++){ |
| | | orderdetailMap.put(orderdetail[i].Consumable_Product__c, orderdetail[i].Consumable_Product__c); |
| | | } |
| | |
| | | //生产日期 |
| | | List<String> janCode = new List<String>(); |
| | | if(barCodeList[i].length() < 16){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的位数不足16,不符合要求错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')的位数不足16,不符合要求错误!') |
| | | ); |
| | | continue; |
| | | }else { |
| | | janCodeMark = barCodeList[i].substring(2,16); |
| | | try{ |
| | | Decimal test = Decimal.valueOf(janCodeMark); |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的janCode错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')的janCode错误!') |
| | | ); |
| | | continue; |
| | | } |
| | | } |
| | | if(barCodeList[i].length() >= 22){ |
| | | if(barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)!='250'){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')没有管理编码!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')没有管理编码!') |
| | | ); |
| | | continue; |
| | | } |
| | | if( barCodeList[i].substring(16,18) =='11'){ |
| | |
| | | productDateStr = '20' + barCodeList[i].substring(18,20) + '-' + barCodeList[i].substring(20,22) + '-01' ; |
| | | productionDate = Date.valueOf(productDateStr); |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')的生产日期' + productDateStr + '错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')的生产日期' + productDateStr + '错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | if(barCodeList[i].length() >=32){ |
| | | if( barCodeList[i].substring(24,26) =='17'){ |
| | | try{ |
| | | if(barCodeList[i].substring(30,32)=='00'){ |
| | | expirationDateStr = '20' + barCodeList[i].substring(26,28) + '-' + barCodeList[i].substring(28,30) + '-' + '01' ; |
| | | expirationDateStr = |
| | | '20' + |
| | | barCodeList[i].substring(26, 28) + |
| | | '-' + |
| | | barCodeList[i].substring(28, 30) + |
| | | '-' + |
| | | '01'; |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1); |
| | | }else{ |
| | | expirationDateStr = '20' + barCodeList[i].substring(26,28) + '-' + barCodeList[i].substring(28,30) + '-' +barCodeList[i].substring(30,32) ; |
| | | expirationDateStr = |
| | | '20' + |
| | | barCodeList[i].substring(26, 28) + |
| | | '-' + |
| | | barCodeList[i].substring(28, 30) + |
| | | '-' + |
| | | barCodeList[i].substring(30, 32); |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | } |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的滅菌有効期限' + expirationDateStr + '错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')的滅菌有効期限' + expirationDateStr + '错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | if(barCodeList[i].length() >= 42){ |
| | |
| | | }else if(barCodeList[i].substring(16,18) =='17'){ |
| | | try{ |
| | | if(barCodeList[i].substring(22,24)=='00'){ |
| | | expirationDateStr = '20' + barCodeList[i].substring(18,20) + '-' + barCodeList[i].substring(20,22) + '-01'; |
| | | expirationDateStr = |
| | | '20' + |
| | | barCodeList[i].substring(18, 20) + |
| | | '-' + |
| | | barCodeList[i].substring(20, 22) + |
| | | '-01'; |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品expirationDateStr' + expirationDateStr)); |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1); |
| | | }else{ |
| | | expirationDateStr = '20' + barCodeList[i].substring(18,20) + '-' + barCodeList[i].substring(20,22) + '-' +barCodeList[i].substring(22,24); |
| | | expirationDateStr = |
| | | '20' + |
| | | barCodeList[i].substring(18, 20) + |
| | | '-' + |
| | | barCodeList[i].substring(20, 22) + |
| | | '-' + |
| | | barCodeList[i].substring(22, 24); |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | } |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的滅菌有効期限' + expirationDateStr + '错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')的滅菌有効期限' + expirationDateStr + '错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | if(barCodeList[i].length() >= 34){ |
| | |
| | | serialNoorLotNo = barCodeList[i].substring(26,barCodeList[i].length() - 8) ; |
| | | } |
| | | } |
| | | |
| | | }else if(barCodeList[i].length() >= 26){ |
| | | if(barCodeList[i].substring(16,18) =='10' || barCodeList[i].substring(16,18) =='21'){ |
| | | serialNoorLotNo = barCodeList[i].substring(18,barCodeList[i].length() - 8) ; |
| | | } |
| | | } |
| | | } |
| | | if(barCodeList[i].length() >= 24 && barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)=='250'){ |
| | | if ( |
| | | barCodeList[i].length() >= 24 && |
| | | barCodeList[i].substring(barCodeList[i].length() - 8, barCodeList[i].length() - 5) == '250' |
| | | ) { |
| | | if(barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)=='250'){ |
| | | tracingCode = barCodeList[i].substring(barCodeList[i].length() - 5,barCodeList[i].length()); |
| | | Matcher n = Pattern.compile('[0-9]').matcher(tracingCode); |
| | | if(n.find()){ |
| | | String str = '管理编码不正确,请与管理员确认是否错误。'; |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')管理编码中有数字,请与管理员确认是否错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')管理编码中有数字,请与管理员确认是否错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | }else{ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的tracingCode错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')的tracingCode错误!') |
| | | ); |
| | | continue; |
| | | } |
| | | } |
| | |
| | | Integer jan11 = Integer.valueOf(janCodeMark.substring(10, 11)); |
| | | Integer jan12 = Integer.valueOf(janCodeMark.substring(11, 12)); |
| | | Integer jan13 = Integer.valueOf(janCodeMark.substring(12, 13)); |
| | | Integer count12 = jan2 + jan3*3 + jan4 + jan5*3 + jan6 + jan7*3 + jan8 + jan9*3 + jan10 + jan11*3 +jan12 + jan13*3; |
| | | Integer count12 = |
| | | jan2 + |
| | | jan3 * 3 + |
| | | jan4 + |
| | | jan5 * 3 + |
| | | jan6 + |
| | | jan7 * 3 + |
| | | jan8 + |
| | | jan9 * 3 + |
| | | jan10 + |
| | | jan11 * 3 + |
| | | jan12 + |
| | | jan13 * 3; |
| | | |
| | | Integer count13 = jan1*3 + jan2 + jan3*3 + jan4 + jan5*3 + jan6 + jan7*3 + jan8 + jan9*3 + jan10 + jan11*3 +jan12 + jan13*3; |
| | | Integer count13 = |
| | | jan1 * 3 + |
| | | jan2 + |
| | | jan3 * 3 + |
| | | jan4 + |
| | | jan5 * 3 + |
| | | jan6 + |
| | | jan7 * 3 + |
| | | jan8 + |
| | | jan9 * 3 + |
| | | jan10 + |
| | | jan11 * 3 + |
| | | jan12 + |
| | | jan13 * 3; |
| | | String frost12 = (String.valueOf(count12)).substring((String.valueOf(count12)).length()-1); |
| | | String frost13 = (String.valueOf(count13)).substring((String.valueOf(count13)).length()-1); |
| | | //减去12位个位4 |
| | | frost12 = (String.valueOf(10 - Integer.valueOf(frost12))).substring((String.valueOf(10 - Integer.valueOf(frost12))).length()-1); |
| | | frost13 = (String.valueOf(10 - Integer.valueOf(frost13))).substring((String.valueOf(10 - Integer.valueOf(frost13))).length()-1); |
| | | frost12 = (String.valueOf(10 - Integer.valueOf(frost12))) |
| | | .substring((String.valueOf(10 - Integer.valueOf(frost12))).length() - 1); |
| | | frost13 = (String.valueOf(10 - Integer.valueOf(frost13))) |
| | | .substring((String.valueOf(10 - Integer.valueOf(frost13))).length() - 1); |
| | | |
| | | janCode.add(janCodeMark.substring(1, 13) + frost12); |
| | | janCode.add(janCodeMark.substring(0, 13) + frost12); |
| | |
| | | barcodeinfoMap.put(barCodeList[i], barcodedetList); |
| | | barCode01List.add(barCodeList[i]); |
| | | }else if(barCodeList[i].substring(0,3) =='241'){ |
| | | if(barCodeList[i].length() > 8 && barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)!='250'){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')没有管理编码!')); |
| | | if ( |
| | | barCodeList[i].length() > 8 && |
| | | barCodeList[i].substring(barCodeList[i].length() - 8, barCodeList[i].length() - 5) != '250' |
| | | ) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')没有管理编码!') |
| | | ); |
| | | continue; |
| | | } |
| | | List<String> otCodeList = new List<String>(); |
| | | Map<String,String> otCodeMap = new Map<String,String>(); |
| | | if(barCodeList[i].length() < 7){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的位数不足16,不符合要求错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')的位数不足16,不符合要求错误!') |
| | | ); |
| | | continue; |
| | | }else if(barCodeList[i].length() == 11){ |
| | | String otCode4 = barCodeList[i].substring(3,7); |
| | |
| | | barOtcodeMap.put(barCodeList[i], otCodeMap); |
| | | barCode241List.add(barCodeList[i]); |
| | | }else{ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')没有janCode或OTcode,不符合要求!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')没有janCode或OTcode,不符合要求!') |
| | | ); |
| | | continue; |
| | | } |
| | | } |
| | |
| | | Map<String,String> rightBar = new Map<String,String>(); |
| | | if(alljanCodeList.size() > 0){ |
| | | Map<String,String> exitBarCodeMap = new Map<String,String>(); |
| | | List<Product2__c> product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c,Product2_Jancode__c, |
| | | Pro2_Dealer_ENG__c,Pro2_Dealer_Object__c, |
| | | List<Product2__c> product2InStore = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Name__c, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | | OT_CODE__c, |
| | | Product2_Jancode__c, |
| | | Pro2_Dealer_ENG__c, |
| | | Pro2_Dealer_Object__c, |
| | | Product_Type__c |
| | | FROM Product2__c |
| | | WHERE Product2_Jancode__c in :alljanCodeList |
| | | AND (not Product_Type__c like :userPro_Typestr) |
| | | order by SFDA_Expiration_Date__c desc ] ; |
| | | WHERE Product2_Jancode__c IN :alljanCodeList AND (NOT Product_Type__c LIKE :userPro_Typestr) |
| | | ORDER BY SFDA_Expiration_Date__c DESC |
| | | ]; |
| | | if(product2InStore.size() > 0){ |
| | | Map<String,String> errorMap = new Map<String,String>(); |
| | | for(Product2__c produ: product2InStore){ |
| | |
| | | exitBarCodeMap.put(bar,bar); |
| | | errorMap.put(bar, bar); |
| | | } |
| | | |
| | | } |
| | | } |
| | | if(errorMap.size() > 0){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode号['+ errorMap.values() +']产品类型['+product_Type+']与用户的类型['+userPro_Type+']不符')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号[' + errorMap.values() + ']产品类型[' + product_Type + ']与用户的类型[' + userPro_Type + ']不符' |
| | | ) |
| | | ); |
| | | } |
| | | } |
| | | product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c,Product2_Jancode__c, |
| | | Pro2_Dealer_ENG__c,Pro2_Dealer_Object__c, |
| | | product2InStore = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Name__c, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | | OT_CODE__c, |
| | | Product2_Jancode__c, |
| | | Pro2_Dealer_ENG__c, |
| | | Pro2_Dealer_Object__c, |
| | | Product_Type__c |
| | | FROM Product2__c |
| | | WHERE Product2_Jancode__c in :alljanCodeList |
| | | AND Product_Type__c like :userPro_Typestr |
| | | order by SFDA_Expiration_Date__c desc ] ; |
| | | WHERE Product2_Jancode__c IN :alljanCodeList AND Product_Type__c LIKE :userPro_Typestr |
| | | ORDER BY SFDA_Expiration_Date__c DESC |
| | | ]; |
| | | if(product2InStore.size() > 0){ |
| | | Map<String,String> errorMap = new Map<String,String>(); |
| | | for(Product2__c produ: product2InStore){ |
| | |
| | | }else{ |
| | | consumableInventory.add(new ConsumableorderdetailsInfo(produ,barcodeinfoMap.get(bar))); |
| | | rightBar.put(bar, bar); |
| | | list<String> overOrderBARcodeCunList = new list<String>(); |
| | | list<String> overOrderBARcodeCunList = new List<String>(); |
| | | if(notEqualBARcodeCunMap.containsKey(produ.Id)){ |
| | | overOrderBARcodeCunList = notEqualBARcodeCunMap.get(produ.Id).clone(); |
| | | overOrderBARcodeCunList.add(bar); |
| | |
| | | notEqualBARcodeCunMap.put(produ.Id,overOrderBARcodeCunList); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | notInStorelist.add(bartxt); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //241通过检索产品是否存在 |
| | | if(allotCodeList.size() > 0){ |
| | | Map<String,String> exitBarCodeMap = new Map<String,String>(); |
| | | Map<String,String> errorMap = new Map<String,String>(); |
| | | List<Product2__c> product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c, |
| | | Pro2_Dealer_Object__c,Pro2_Dealer_ENG__c |
| | | List<Product2__c> product2InStore = [ |
| | | SELECT Id, Name, Name__c, Intra_Trade_List_RMB__c, Asset_Model_No__c, OT_CODE__c, Pro2_Dealer_Object__c, Pro2_Dealer_ENG__c |
| | | FROM Product2__c |
| | | WHERE OT_CODE__c in :allotCodeList |
| | | AND (not Product_Type__c like :userPro_Typestr)] ; |
| | | WHERE OT_CODE__c IN :allotCodeList AND (NOT Product_Type__c LIKE :userPro_Typestr) |
| | | ]; |
| | | if(product2InStore.size() > 0){ |
| | | for(Product2__c produ: product2InStore){ |
| | | for(String bar: barOtcodeMap.keySet() ){ |
| | |
| | | } |
| | | } |
| | | if(errorMap.size() > 0){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode号['+ errorMap.values() +']产品类型['+product_Type+']与用户['+userPro_Type+']类型不符')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号[' + errorMap.values() + ']产品类型[' + product_Type + ']与用户[' + userPro_Type + ']类型不符' |
| | | ) |
| | | ); |
| | | } |
| | | product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c, |
| | | Pro2_Dealer_Object__c,Pro2_Dealer_ENG__c |
| | | product2InStore = [ |
| | | SELECT Id, Name, Name__c, Intra_Trade_List_RMB__c, Asset_Model_No__c, OT_CODE__c, Pro2_Dealer_Object__c, Pro2_Dealer_ENG__c |
| | | FROM Product2__c |
| | | WHERE OT_CODE__c in :allotCodeList |
| | | AND Product_Type__c like :userPro_Typestr] ; |
| | | WHERE OT_CODE__c IN :allotCodeList AND Product_Type__c LIKE :userPro_Typestr |
| | | ]; |
| | | |
| | | if(product2InStore.size() > 0){ |
| | | for(Product2__c produ: product2InStore){ |
| | |
| | | if(bar.length() >= oTcodeLength + 11){ |
| | | if( bar.substring(oTcodeLength + 3,oTcodeLength + 5) =='11'){ |
| | | try{ |
| | | productDateStr = '20' + bar.substring(oTcodeLength + 5,oTcodeLength + 7) + '-' + bar.substring(oTcodeLength + 7,oTcodeLength + 9) + '-01' ; |
| | | productDateStr = |
| | | '20' + |
| | | bar.substring(oTcodeLength + 5, oTcodeLength + 7) + |
| | | '-' + |
| | | bar.substring(oTcodeLength + 7, oTcodeLength + 9) + |
| | | '-01'; |
| | | productionDate = Date.valueOf(productDateStr); |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + bar + ')的生产日期' + productDateStr + '错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + bar + ')的生产日期' + productDateStr + '错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | if(bar.length() >=oTcodeLength + 3 + 16){ |
| | |
| | | if( bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='17'){ |
| | | try{ |
| | | if(bar.substring(oTcodeLength + 3 + 14,oTcodeLength + 3 + 16)=='00'){ |
| | | expirationDateStr = '20' + bar.substring(oTcodeLength + 3 + 10,oTcodeLength + 3 + 12) + '-' + bar.substring(oTcodeLength + 3 + 12,oTcodeLength + 3 + 14) + '-' + '01' ; |
| | | expirationDateStr = |
| | | '20' + |
| | | bar.substring(oTcodeLength + 3 + 10, oTcodeLength + 3 + 12) + |
| | | '-' + |
| | | bar.substring(oTcodeLength + 3 + 12, oTcodeLength + 3 + 14) + |
| | | '-' + |
| | | '01'; |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1); |
| | | }else{ |
| | | expirationDateStr = '20' + bar.substring(oTcodeLength + 3 + 10,oTcodeLength + 3 + 12) + '-' + bar.substring(oTcodeLength + 3 + 12,oTcodeLength + 3 + 14) + '-' +bar.substring(oTcodeLength + 3 + 14,oTcodeLength + 3 + 16) ; |
| | | expirationDateStr = |
| | | '20' + |
| | | bar.substring(oTcodeLength + 3 + 10, oTcodeLength + 3 + 12) + |
| | | '-' + |
| | | bar.substring(oTcodeLength + 3 + 12, oTcodeLength + 3 + 14) + |
| | | '-' + |
| | | bar.substring(oTcodeLength + 3 + 14, oTcodeLength + 3 + 16); |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | } |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')的滅菌有効期限' + expirationDateStr + '错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + bar + ')的滅菌有効期限' + expirationDateStr + '错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | if(bar.length() >= oTcodeLength + 3 + 25){ |
| | | if(bar.substring(oTcodeLength + 3 + 16,oTcodeLength + 3 + 18) =='10' || bar.substring(oTcodeLength + 3 + 16,oTcodeLength + 3 + 18) =='21'){ |
| | | if ( |
| | | bar.substring(oTcodeLength + 3 + 16, oTcodeLength + 3 + 18) == '10' || |
| | | bar.substring(oTcodeLength + 3 + 16, oTcodeLength + 3 + 18) == '21' |
| | | ) { |
| | | serialNoorLotNo = bar.substring(oTcodeLength + 3 + 18,bar.length() - 8) ; |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'serialNoorLotNo' + serialNoorLotNo)); |
| | | } |
| | | } |
| | | }else if(bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='10' || bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='21'){ |
| | | } else if ( |
| | | bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '10' || |
| | | bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '21' |
| | | ) { |
| | | serialNoorLotNo = bar.substring(oTcodeLength + 3 + 10,bar.length() - 8) ; |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'serialNoorLotNo' + serialNoorLotNo)); |
| | | } |
| | |
| | | }else if(bar.substring(oTcodeLength + 3,oTcodeLength + 5) =='17'){ |
| | | try{ |
| | | if(bar.substring(oTcodeLength + 3 + 6,oTcodeLength + 3 + 8)=='00'){ |
| | | expirationDateStr = '20' + bar.substring(oTcodeLength + 3 + 2,oTcodeLength + 3 + 4) + '-' + bar.substring(oTcodeLength + 3 + 4,oTcodeLength + 3 + 6) + '-01'; |
| | | expirationDateStr = |
| | | '20' + |
| | | bar.substring(oTcodeLength + 3 + 2, oTcodeLength + 3 + 4) + |
| | | '-' + |
| | | bar.substring(oTcodeLength + 3 + 4, oTcodeLength + 3 + 6) + |
| | | '-01'; |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1); |
| | | }else{ |
| | | expirationDateStr = '20' + bar.substring(oTcodeLength + 3 + 2,oTcodeLength + 3 + 4) + '-' + bar.substring(oTcodeLength + 3 + 4,oTcodeLength + 3 + 6) + '-' +bar.substring(oTcodeLength + 3 + 6,oTcodeLength + 3 + 8); |
| | | expirationDateStr = |
| | | '20' + |
| | | bar.substring(oTcodeLength + 3 + 2, oTcodeLength + 3 + 4) + |
| | | '-' + |
| | | bar.substring(oTcodeLength + 3 + 4, oTcodeLength + 3 + 6) + |
| | | '-' + |
| | | bar.substring(oTcodeLength + 3 + 6, oTcodeLength + 3 + 8); |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | } |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')的滅菌有効期限' + expirationDateStr + '错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + bar + ')的滅菌有効期限' + expirationDateStr + '错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | if(bar.length() >=oTcodeLength + 20){ |
| | | if(bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='10' || bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='21'){ |
| | | if ( |
| | | bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '10' || |
| | | bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '21' |
| | | ) { |
| | | serialNoorLotNo = bar.substring(oTcodeLength + 3 + 10,bar.length() - 8) ; |
| | | } |
| | | } |
| | | |
| | | }else if(bar.length() >= oTcodeLength + 12){ |
| | | if(bar.substring(oTcodeLength + 3,oTcodeLength + 5) =='10' || bar.substring(oTcodeLength + 3,oTcodeLength + 5) =='21'){ |
| | | if ( |
| | | bar.substring(oTcodeLength + 3, oTcodeLength + 5) == '10' || |
| | | bar.substring(oTcodeLength + 3, oTcodeLength + 5) == '21' |
| | | ) { |
| | | serialNoorLotNo = bar.substring(oTcodeLength + 3 + 2,bar.length() - 8) ; |
| | | } |
| | | } |
| | |
| | | Matcher n = Pattern.compile('[0-9]').matcher(tracingCode); |
| | | if(n.find()){ |
| | | String str = '管理编码不正确,请与管理员确认是否错误。'; |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')管理编码中有数字,请与管理员确认是否错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + bar + ')管理编码中有数字,请与管理员确认是否错误!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | }else{ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')的tracingCode错误!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + bar + ')的tracingCode错误!') |
| | | ); |
| | | continue; |
| | | } |
| | | } |
| | |
| | | consumableInventory.add(new ConsumableorderdetailsInfo(produ,barcodedetList)); |
| | | }else{ |
| | | consumableInventory.add(new ConsumableorderdetailsInfo(produ,barcodedetList)); |
| | | list<String> overOrderBARcodeCunList = new list<String>(); |
| | | list<String> overOrderBARcodeCunList = new List<String>(); |
| | | if(notEqualBARcodeCunMap.containsKey(produ.Id)){ |
| | | overOrderBARcodeCunList = notEqualBARcodeCunMap.get(produ.Id).clone(); |
| | | overOrderBARcodeCunList.add(bar); |
| | |
| | | notEqualBARcodeCunMap.put(produ.Id,overOrderBARcodeCunList); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | public String ConfimResult() { |
| | | list<String> overOrderproList = new list<String>(); |
| | | list<String> overOrderBARcodeCunList = new list<String>(); |
| | | list<String> overOrderBARcodeCunListTest = new list<String>(); |
| | | list<String> overOrderproList = new List<String>(); |
| | | list<String> overOrderBARcodeCunList = new List<String>(); |
| | | list<String> overOrderBARcodeCunListTest = new List<String>(); |
| | | //overOrderBARcodeCunMap.clear(); |
| | | for (ConsumableorderdetailsInfo ass : ConsumableorderdetailsRecords) { |
| | | if(orderWantArriveCunMap.get(ass.esd.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.esd.Asset_Model_No__c) > orderProductCunMap.get(ass.esd.Asset_Model_No__c)-1){ |
| | | if ( |
| | | orderWantArriveCunMap.get(ass.esd.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.esd.Asset_Model_No__c) > |
| | | orderProductCunMap.get(ass.esd.Asset_Model_No__c) - 1 |
| | | ) { |
| | | // 获取超过定货数量的消耗品信息 |
| | | overOrderBARcodeCunList = new list<String>(); |
| | | overOrderBARcodeCunList = new List<String>(); |
| | | overOrderBARcodeCunList = overOrderBARcodeCunMap.get(ass.esd.Asset_Model_No__c).clone(); |
| | | overOrderBARcodeCunList.add(ass.esd.Bar_Code__c); |
| | | overOrderBARcodeCunMap.put(ass.esd.Asset_Model_No__c,overOrderBARcodeCunList); |
| | | overOrderCunMap.put(ass.esd.Asset_Model_No__c,overOrderCunMap.get(ass.esd.Asset_Model_No__c)+1); |
| | | cancellationProList.add(ass.esd.Asset_Model_No__c); |
| | | }else if(orderWantArriveCunMap.get(ass.esd.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.esd.Asset_Model_No__c) == orderProductCunMap.get(ass.esd.Asset_Model_No__c)-1){ |
| | | } else if ( |
| | | orderWantArriveCunMap.get(ass.esd.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.esd.Asset_Model_No__c) == |
| | | orderProductCunMap.get(ass.esd.Asset_Model_No__c) - 1 |
| | | ) { |
| | | consumableorderdetailsRecordsUse.add(ass); |
| | | cancellationProList.add(ass.esd.Asset_Model_No__c); |
| | | }else{ |
| | |
| | | consumableInventoryUse.add(ass); |
| | | continue; |
| | | } |
| | | if(orderWantArriveCunMap.get(ass.Prod.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.Prod.Asset_Model_No__c) > orderProductCunMap.get(ass.Prod.Asset_Model_No__c)-1){ |
| | | |
| | | if ( |
| | | orderWantArriveCunMap.get(ass.Prod.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.Prod.Asset_Model_No__c) > |
| | | orderProductCunMap.get(ass.Prod.Asset_Model_No__c) - 1 |
| | | ) { |
| | | //取得原有list |
| | | overOrderBARcodeCunList = new list<String>(); |
| | | overOrderBARcodeCunList = new List<String>(); |
| | | overOrderBARcodeCunList = overOrderBARcodeCunMap.get(ass.Prod.Asset_Model_No__c).clone(); |
| | | //更新list |
| | | overOrderBARcodeCunList.add(ass.barCodeNo); |
| | |
| | | overOrderBARcodeCunMap.put(ass.Prod.Asset_Model_No__c,overOrderBARcodeCunList); |
| | | overOrderCunMap.put(ass.Prod.Asset_Model_No__c,overOrderCunMap.get(ass.Prod.Asset_Model_No__c)+1); |
| | | cancellationProList.add(ass.Prod.Asset_Model_No__c); |
| | | }else if(orderWantArriveCunMap.get(ass.Prod.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.Prod.Asset_Model_No__c) == orderProductCunMap.get(ass.Prod.Asset_Model_No__c)-1){ |
| | | |
| | | } else if ( |
| | | orderWantArriveCunMap.get(ass.Prod.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.Prod.Asset_Model_No__c) == |
| | | orderProductCunMap.get(ass.Prod.Asset_Model_No__c) - 1 |
| | | ) { |
| | | consumableInventoryUse.add(ass); |
| | | cancellationProList.add(ass.Prod.Asset_Model_No__c); |
| | | }else{ |
| | |
| | | }else{ |
| | | return ''; |
| | | } |
| | | |
| | | } |
| | | |
| | | public void confimResultWithoutOrder() { |
| | |
| | | } |
| | | |
| | | System.debug('======accountGroupMap'+accountGroupMap); |
| | | List<Consumable_order__c> orderList = [select Id, Name, Dealer_Info__r.Name, Order_Owner_WorkLocal__c from Consumable_order__c where id in : orderIdList]; |
| | | List<Consumable_order__c> orderList = [ |
| | | SELECT Id, Name, Dealer_Info__r.Name, Order_Owner_WorkLocal__c |
| | | FROM Consumable_order__c |
| | | WHERE id IN :orderIdList |
| | | ]; |
| | | |
| | | // 生成各经销商出库订单List |
| | | // List<Consumable_order__c> orderList = new List<Consumable_order__c> (); |
| | |
| | | List<Consumable_order_details2__c> prodPriceList = accountGroupMap.get(acc); |
| | | Map<Id, Integer> pNumMap = new Map<Id, Integer> (); |
| | | pNumMap = productMap.get(acc); |
| | | List<Consumable_orderdetails__c> insDetail1 = New List<Consumable_orderdetails__c>(); |
| | | List<Consumable_orderdetails__c> insDetail1 = new List<Consumable_orderdetails__c>(); |
| | | for (Id id : pNumMap.keySet()) { |
| | | Consumable_orderdetails__c ins = new Consumable_orderdetails__c(); |
| | | |
| | |
| | | } |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 end |
| | | |
| | | |
| | | // 经销商的不同工作地调货自动生成出库单 |
| | | public void addSaleOrderAuto (List<Consumable_order_details2__c> addList) { |
| | | Map<String, List<Consumable_order_details2__c>> accountGroupMap = new Map<String, List<Consumable_order_details2__c>>(); |
| | |
| | | autoOrder.RecordTypeid = System.Label.RT_ConOrder_Shipment; |
| | | autoOrder.Outbound_Date__c = Date.today(); |
| | | autoOrder.Order_date__c = Date.today(); |
| | | autoOrder.AutoShipment__c = TRUE; |
| | | autoOrder.AutoShipment__c = true; |
| | | orderList.add(autoOrder); |
| | | |
| | | List<Consumable_order_details2__c> prodPriceList = accountGroupMap.get(acc); |
| | | Map<Id, Integer> pNumMap = new Map<Id, Integer> (); |
| | | pNumMap = productMap.get(acc); |
| | | List<Consumable_orderdetails__c> insDetail1 = New List<Consumable_orderdetails__c>(); |
| | | List<Consumable_orderdetails__c> insDetail1 = new List<Consumable_orderdetails__c>(); |
| | | for (Id id : pNumMap.keySet()) { |
| | | Consumable_orderdetails__c ins = new Consumable_orderdetails__c(); |
| | | |
| | |
| | | } |
| | | |
| | | orderList = new List<Consumable_order__c> (); |
| | | orderList = [select Id, Name, Dealer_Info__r.Name, Order_Owner_WorkLocal__c from Consumable_order__c where id in : orderIdList]; |
| | | orderList = [SELECT Id, Name, Dealer_Info__r.Name, Order_Owner_WorkLocal__c FROM Consumable_order__c WHERE id IN :orderIdList]; |
| | | |
| | | // 设置明细1 和 明细2 的 订单ID |
| | | List<Consumable_orderdetails__c> insDetail1List = new List<Consumable_orderdetails__c> (); |
| | |
| | | } |
| | | |
| | | // 明细2 |
| | | List<Consumable_order_details2__c> d2list = accountGroupMap.get( |
| | | setId.Dealer_Info__r.Name + setId.Order_Owner_WorkLocal__c |
| | | ); |
| | | List<Consumable_order_details2__c> d2list = accountGroupMap.get(setId.Dealer_Info__r.Name + setId.Order_Owner_WorkLocal__c); |
| | | for (Consumable_order_details2__c dtl2 : d2list) { |
| | | dtl2.Send_Date__c = Date.today(); |
| | | dtl2.Consumable_Sale_order__c = null; |
| | |
| | | StaticParameter.ConsumableOrderTrigger = true; |
| | | //add by rentx 20210618 end CHAN-C3K4ZQ 跳过不必要的查询 |
| | | cancellationProList = new List<String>(); |
| | | List<Consumable_order_details2__c> ins = New List<Consumable_order_details2__c>(); |
| | | List<Consumable_order_details2__c> ins = new List<Consumable_order_details2__c>(); |
| | | String resultcheck = ''; |
| | | List<String> resultcheckWithoutOrder = new List<String>(); |
| | | Savepoint sp = Database.setSavepoint(); |
| | |
| | | if(resultcheck.length() > 0){ |
| | | for(String widget : overOrderBARcodeCunMap.keySet()) { |
| | | if(overOrderBARcodeCunMap.get(widget).size() >0){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '产品' + widget + '本次到货数量超过' + overOrderBARcodeCunMap.get(widget).size() +'个订货的数量。')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.INFO, |
| | | '产品' + widget + '本次到货数量超过' + overOrderBARcodeCunMap.get(widget).size() + '个订货的数量。' |
| | | ) |
| | | ); |
| | | for(String barcodeListTTT : (List<String>)overOrderBARcodeCunMap.get(widget)) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, barcodeListTTT)); |
| | | } |
| | |
| | | } |
| | | try{ |
| | | Consumable_order__c orderMain = new Consumable_order__c(); |
| | | List<Consumable_order_details2__c> orderdetails = New List<Consumable_order_details2__c>(); |
| | | List<Consumable_order_details2__c> orderdetails = new List<Consumable_order_details2__c>(); |
| | | //到货正确信息 |
| | | orderMain.Name = '*'; |
| | | orderMain.Order_status__c = '批准'; |
| | |
| | | if (orderdetails2trMap.containsKey(ass.esd.Bar_Code__c)) { |
| | | insDetails.Transfer_Time__c = ass.esd.Transfer_Time__c == null ? 1 : ass.esd.Transfer_Time__c; |
| | | insDetails.Agency_Transfer__c = true; |
| | | insDetails.Frist_Transfer_Agency__c = ass.esd.Frist_Transfer_Agency__c == null ? ass.esd.Dealer_Info_text__c : ass.esd.Frist_Transfer_Agency__c; |
| | | insDetails.Frist_Transfer_Agency__c = ass.esd.Frist_Transfer_Agency__c == null |
| | | ? ass.esd.Dealer_Info_text__c |
| | | : ass.esd.Frist_Transfer_Agency__c; |
| | | } |
| | | // 更新借调信息 add by gzw 2020-0-415 end |
| | | |
| | | // 追加首次入库经销商 add by gzw 2020-04-27 start |
| | | insDetails.Agencyinfo_fromSAP__c = ass.esd.Agencyinfo_fromSAP__c; |
| | | insDetails.Frist_Storage_Agency__c = ass.esd.Frist_Storage_Agency__c == null ? ass.esd.Dealer_Info_text__c : ass.esd.Frist_Storage_Agency__c; |
| | | insDetails.Frist_Storage_Agency__c = ass.esd.Frist_Storage_Agency__c == null |
| | | ? ass.esd.Dealer_Info_text__c |
| | | : ass.esd.Frist_Storage_Agency__c; |
| | | // 追加首次入库经销商 add by gzw 2020-04-27 end |
| | | arriveAmount += ass.esd.Intra_Trade_List_RMB__c; |
| | | orderdetails.add(insDetails); |
| | |
| | | if (orderdetails2trMap.containsKey(ass.esd.Bar_Code__c)) { |
| | | insAfterDel.Transfer_Time__c = ass.esd.Transfer_Time__c == null ? 1 : ass.esd.Transfer_Time__c; |
| | | insAfterDel.Agency_Transfer__c = true; |
| | | insAfterDel.Frist_Transfer_Agency__c = ass.esd.Frist_Transfer_Agency__c == null ? accountName : ass.esd.Frist_Transfer_Agency__c; |
| | | insAfterDel.Frist_Transfer_Agency__c = ass.esd.Frist_Transfer_Agency__c == null |
| | | ? accountName |
| | | : ass.esd.Frist_Transfer_Agency__c; |
| | | } |
| | | // 更新借调信息 add by gzw 2020-0-415 end |
| | | |
| | | // 追加首次入库经销商 add by gzw 2020-04-27 start |
| | | insAfterDel.Agencyinfo_fromSAP__c = ass.esd.Agencyinfo_fromSAP__c; |
| | | insAfterDel.Frist_Storage_Agency__c = ass.esd.Frist_Storage_Agency__c == null ? accountName : ass.esd.Frist_Storage_Agency__c; |
| | | insAfterDel.Frist_Storage_Agency__c = ass.esd.Frist_Storage_Agency__c == null |
| | | ? accountName |
| | | : ass.esd.Frist_Storage_Agency__c; |
| | | // 追加首次入库经销商 add by gzw 2020-04-27 end |
| | | arriveAmount += insAfterDel.Intra_Trade_List_RMB__c; |
| | | //add by rentx 2020-10-14 strat |
| | |
| | | i++; |
| | | |
| | | ins.add(insAfterDel); |
| | | |
| | | } |
| | | orderMain.Arrive_total_amount__c = arriveAmount; |
| | | update orderMain; |
| | |
| | | for(Consumable_order_details2__c Cod : consumableorderdetails2Cancle){ |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------3------')); |
| | | if (Cod.Dealer_Arrive__c) { |
| | | if (Cod.Dealer_Shipment__c == FALSE && Cod.Dealer_Saled__c == FALSE) { |
| | | if (Cod.Dealer_Shipment__c == false && Cod.Dealer_Saled__c == false) { |
| | | addSaleOrderList.add(Cod); |
| | | } |
| | | } else { |
| | |
| | | //超出到货数量产品取消日期更新 |
| | | List<Consumable_order_details2__c> needcanceldet = new List<Consumable_order_details2__c>(); |
| | | if(cancellationProList.size() > 0){ |
| | | needcanceldet = [SELECT Id, |
| | | Cancellation_Date__c |
| | | needcanceldet = [ |
| | | SELECT Id, Cancellation_Date__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Asset_Model_No__c in :cancellationProList |
| | | WHERE |
| | | Asset_Model_No__c IN :cancellationProList |
| | | AND Consumable_order_minor__c = :ESetId |
| | | AND Dealer_Arrive__c = FALSE |
| | | AND Cancellation_Date__c = null ]; |
| | | AND Cancellation_Date__c = NULL |
| | | ]; |
| | | if(needcanceldet.size() >0){ |
| | | for(Integer a = 0; a < needcanceldet.size(); a++){ |
| | | needcanceldet[a].Cancellation_Date__c = Date.today(); |
| | |
| | | ControllerUtil.updateOrderDetailsSatus(needcanceldet); |
| | | } |
| | | } |
| | | List<Consumable_order__c> qs = New List<Consumable_order__c>(); |
| | | qs = [SELECT Id,Name,Order_status__c,Dealer_Info__c,Deliver_date__c,ReturnGs_Upload_Date__c, |
| | | Order_Reason__c,Order_date__c, |
| | | Contract_application_decision__c,Order_type__c,Total_num__c, |
| | | OrderNumber_arrived__c,Delivery_detail_count__c,OrderNumber_notarrive__c |
| | | List<Consumable_order__c> qs = new List<Consumable_order__c>(); |
| | | qs = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Order_status__c, |
| | | Dealer_Info__c, |
| | | Deliver_date__c, |
| | | ReturnGs_Upload_Date__c, |
| | | Order_Reason__c, |
| | | Order_date__c, |
| | | Contract_application_decision__c, |
| | | Order_type__c, |
| | | Total_num__c, |
| | | OrderNumber_arrived__c, |
| | | Delivery_detail_count__c, |
| | | OrderNumber_notarrive__c |
| | | FROM Consumable_order__c |
| | | WHERE Id =:ESetId |
| | | AND Dealer_Info__c = :accountid]; |
| | | WHERE Id = :ESetId AND Dealer_Info__c = :accountid |
| | | ]; |
| | | if (qs.size()>0){ |
| | | coc = qs[0]; |
| | | } |
| | |
| | | for( String Str : GrListIn ){ |
| | | CheckBarcodeResult.put( str , 'UnFind'); |
| | | } |
| | | List<Consumable_order_details2__c> BarcodeRetrunResult = |
| | | [ SELECT Id,Name,Intra_Trade_List_RMB__c,Asset_Model_No__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, |
| | | Consumable_Product__r.Name__c,Consumable_Product__r.Asset_Model_No__c, |
| | | Sterilization_limit__c,Deliver_date__c,Bar_Code__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c,Dealer_Arrive__c, |
| | | Guarantee_period_for_products__c,CFDA_Status__c, |
| | | ProductPacking_list_manual__c,Report_Product_Approbation__c, |
| | | Report_Product_Expiration__c,Box_Piece__c, Rrturn_count__c, |
| | | Product_Type__c |
| | | List<Consumable_order_details2__c> BarcodeRetrunResult = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Consumable_Product__r.Name__c, |
| | | Consumable_Product__r.Asset_Model_No__c, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | Dealer_Arrive__c, |
| | | Guarantee_period_for_products__c, |
| | | CFDA_Status__c, |
| | | ProductPacking_list_manual__c, |
| | | Report_Product_Approbation__c, |
| | | Report_Product_Expiration__c, |
| | | Box_Piece__c, |
| | | Rrturn_count__c, |
| | | Product_Type__c, |
| | | //add by rentx 2020-10-14 start |
| | | ,ContractNo_text__c/*,ContractNo__c*/ |
| | | ContractNo_text__c /*,ContractNo__c*/, |
| | | // tcm start |
| | | ,Consumable_order_minor__r.ContractNo__c |
| | | Consumable_order_minor__r.ContractNo__c |
| | | // tcm end |
| | | //add by rentx 2020-10-14 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE ((Dealer_Arrive__c = true |
| | | AND( Dealer_Shipment__c = true |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | | AND (Dealer_Shipment__c = TRUE |
| | | //AND Consumable_Shipment_order__r.SummonsForDirction__c != '互相调货') |
| | | or Dealer_Saled__c = true |
| | | ) |
| | | )) |
| | | OR Dealer_Saled__c = TRUE) |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Bar_Code__c in :GrListIn |
| | | AND ( not Product_Type__c like :userPro_Typestr) |
| | | AND Dealer_Returned__c = false |
| | | AND Bar_Code__c IN :GrListIn |
| | | AND (NOT Product_Type__c LIKE :userPro_Typestr) |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | ORDER BY Box_Piece__c desc,Name ]; |
| | | ORDER BY Box_Piece__c DESC, Name |
| | | ]; |
| | | if(BarcodeRetrunResult.size()>0){ |
| | | for (Integer i = 0; i < BarcodeRetrunResult.size(); i++) { |
| | | if(ErrorIdMap.containsKey(BarcodeRetrunResult[i].Bar_Code__c) || ExistIdMap.containsKey(BarcodeRetrunResult[i].Bar_Code__c)){ |
| | | if ( |
| | | ErrorIdMap.containsKey(BarcodeRetrunResult[i].Bar_Code__c) || ExistIdMap.containsKey(BarcodeRetrunResult[i].Bar_Code__c) |
| | | ) { |
| | | // 跳过已经处理的消耗品明细 |
| | | continue; |
| | | }else{ |
| | |
| | | } |
| | | } |
| | | AllMap.putAll(ErrorIdMap); |
| | | BarcodeRetrunResult = |
| | | [ SELECT Id, |
| | | BarcodeRetrunResult = [ |
| | | SELECT |
| | | Id, |
| | | Consumable_order_minor__c, |
| | | Deliver_date__c, |
| | | Asset_Model_No__c, |
| | |
| | | Transfer_Time__c, |
| | | Frist_Transfer_Agency__c, |
| | | Arrive_Owner_Work_Location__c, |
| | | Agency_Transfer__c |
| | | Agency_Transfer__c, |
| | | //add by rentx 2020-10-14 start |
| | | ,ContractNo_text__c/*,ContractNo__c*/ |
| | | ContractNo_text__c /*,ContractNo__c*/, |
| | | // tcm start |
| | | ,Consumable_order_minor__r.ContractNo__c |
| | | Consumable_order_minor__r.ContractNo__c, |
| | | // tcm end |
| | | //add by rentx 2020-10-14 end |
| | | ,Report_Product_Expiration__c |
| | | ,Intra_Trade_List__c |
| | | Report_Product_Expiration__c, |
| | | Intra_Trade_List__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE ((Dealer_Arrive__c = true |
| | | AND( Dealer_Shipment__c = true |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | | AND (Dealer_Shipment__c = TRUE |
| | | //AND Consumable_Shipment_order__r.SummonsForDirction__c != '互相调货') |
| | | or Dealer_Saled__c = true |
| | | OR Dealer_Saled__c = TRUE |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 start |
| | | or (Dealer_Shipment__c = false and Dealer_Saled__c = false and Lose_Flag__c = true) |
| | | OR (Dealer_Shipment__c = FALSE |
| | | AND Dealer_Saled__c = FALSE |
| | | AND Lose_Flag__c = TRUE)) |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 end |
| | | ) |
| | | )) |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Bar_Code__c in :GrListIn |
| | | AND Product_Type__c like :userPro_Typestr |
| | | AND Dealer_Returned__c = false |
| | | AND Bar_Code__c IN :GrListIn |
| | | AND Product_Type__c LIKE :userPro_Typestr |
| | | AND Dealer_Returned__c = FALSE |
| | | AND (Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | OR OwnerId = :System.Label.User_OlympusSystem) |
| | | ORDER BY Box_Piece__c desc,Name ]; |
| | | ORDER BY Box_Piece__c DESC, Name |
| | | ]; |
| | | ShowGoodsofReturnList = new List<ConsumableorderdetailsInfo>(); |
| | | |
| | | //返品时istinct处理 |
| | |
| | | // 跳过已经处理的消耗品明细 |
| | | continue; |
| | | }else{ |
| | | |
| | | Matcher n = Pattern.compile('[0-9]').matcher(codc.TracingCode__c); |
| | | if(n.find()){ |
| | | String str = '管理编码中有数字,请与管理员确认是否错误。'; |
| | |
| | | public integer Getconsumableorderdetails2Nobox(){ |
| | | consumableorderdetails2Nobox = new List<Consumable_order_details2__c>(); |
| | | BarcodeCntMap.clear(); |
| | | consumableorderdetails2Nobox = |
| | | [ SELECT Id, |
| | | consumableorderdetails2Nobox = [ |
| | | SELECT |
| | | Id, |
| | | Consumable_order_minor__c, |
| | | Deliver_date__c, |
| | | Asset_Model_No__c, |
| | |
| | | Rrturn_count__c, |
| | | Dealer_Info_text__c, |
| | | Arrive_Owner_Work_Location__c, |
| | | Intra_Trade_List_RMB__c |
| | | Intra_Trade_List_RMB__c, |
| | | //add by rentx 2020-10-13 start 返品时 新数据记录SAP合同号 |
| | | ,ContractNo_text__c/*,ContractNo__c*/ |
| | | ContractNo_text__c /*,ContractNo__c*/, |
| | | // tcm start |
| | | ,Consumable_order_minor__r.ContractNo__c |
| | | Consumable_order_minor__r.ContractNo__c, |
| | | // tcm end |
| | | ,Report_Product_Expiration__c |
| | | Report_Product_Expiration__c, |
| | | //add by rentx 2020-10-13 end |
| | | ,Intra_Trade_List__c |
| | | Intra_Trade_List__c |
| | | //gzw 手动入库 默认产品单价 20230307 |
| | | FROM Consumable_order_details2__c |
| | | WHERE |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 start |
| | | // (Dealer_Shipment__c = true or Dealer_Saled__c = true) |
| | | (Dealer_Shipment__c = true or Dealer_Saled__c = true or (Dealer_Shipment__c = false and Dealer_Saled__c = false and Lose_Flag__c = true)) |
| | | (Dealer_Shipment__c = TRUE |
| | | OR Dealer_Saled__c = TRUE |
| | | OR (Dealer_Shipment__c = FALSE |
| | | AND Dealer_Saled__c = FALSE |
| | | AND Lose_Flag__c = TRUE)) |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 end |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Bar_Code__c in :noboxBarcodeList |
| | | AND Bar_Code__c IN :noboxBarcodeList |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | AND Dealer_Returned__c = false |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Box_Piece__c = '个' |
| | | ORDER BY Consumable_ZS_order__c,RemoveBox_No__c]; |
| | | ORDER BY Consumable_ZS_order__c, RemoveBox_No__c |
| | | ]; |
| | | |
| | | AggregateResult[] results = [SELECT Consumable_ZS_order__c,Bar_Code__c,count(Id) recordCount |
| | | AggregateResult[] results = [ |
| | | SELECT Consumable_ZS_order__c, Bar_Code__c, count(Id) recordCount |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 start |
| | | // AND (Dealer_Shipment__c= true OR Dealer_Saled__c = true) |
| | | AND (Dealer_Shipment__c= true OR Dealer_Saled__c = true or(Dealer_Shipment__c = false and Dealer_Saled__c = false and Lose_Flag__c = true)) |
| | | AND (Dealer_Shipment__c = TRUE |
| | | OR Dealer_Saled__c = TRUE |
| | | OR (Dealer_Shipment__c = FALSE |
| | | AND Dealer_Saled__c = FALSE |
| | | AND Lose_Flag__c = TRUE)) |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 end |
| | | AND Dealer_Returned__c = false |
| | | AND Bar_Code__c in :noboxBarcodeList |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Bar_Code__c IN :noboxBarcodeList |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | AND Box_Piece__c = '个' |
| | | AND Dealer_Info_text__c = :accountName |
| | | GROUP BY Consumable_ZS_order__c,Bar_Code__c]; |
| | | GROUP BY Consumable_ZS_order__c, Bar_Code__c |
| | | ]; |
| | | |
| | | for(AggregateResult ar: results){ |
| | | String key = '' + ar.get('Consumable_ZS_order__c') + ar.get('Bar_Code__c'); |
| | |
| | | for(Consumable_order_details2__c details2 : duplicates){ |
| | | Boolean found = false; |
| | | for(Consumable_order_details2__c result : distinctOrder){ |
| | | if(details2.Consumable_ZS_order__c == result.Consumable_ZS_order__c |
| | | && details2.Bar_Code__c == result.Bar_Code__c){ |
| | | if (details2.Consumable_ZS_order__c == result.Consumable_ZS_order__c && details2.Bar_Code__c == result.Bar_Code__c) { |
| | | found = true; |
| | | break; |
| | | } |
| | |
| | | if(!found){ |
| | | distinctOrder.add(details2); |
| | | |
| | | if(details2.Box_Piece__c == '个') noboxBarcodeList.add(details2.Bar_Code__c); |
| | | if (details2.Box_Piece__c == '个') |
| | | noboxBarcodeList.add(details2.Bar_Code__c); |
| | | } |
| | | } |
| | | return distinctOrder; |
| | |
| | | boolean hasLoseGoods = false; |
| | | try{ |
| | | if( ShowGoodsofReturnList.size() >0 || consumableInventory.size()>0 ){ |
| | | |
| | | Consumable_order__c Return_Order_Sheet = new Consumable_order__c(); |
| | | Return_Order_Sheet.Name ='*'; |
| | | Return_Order_Sheet.Order_status__c = '批准'; |
| | |
| | | Inventory_Order_Sheet.Order_ProType__c = userPro_Type; |
| | | insert Inventory_Order_Sheet; |
| | | inventory_Order_id = Inventory_Order_Sheet.id; |
| | | List<Consumable_order__c> consumable_order_Inv = [SELECT Name FROM Consumable_order__c WHERE id =:Inventory_Order_Sheet.id]; |
| | | List<Consumable_order__c> consumable_order_Inv = [ |
| | | SELECT Name |
| | | FROM Consumable_order__c |
| | | WHERE id = :Inventory_Order_Sheet.id |
| | | ]; |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 end |
| | | |
| | | List<Consumable_order_details2__c> codcList = new List<Consumable_order_details2__c>(); |
| | |
| | | List<Consumable_order_details2__c> codcorderdetList = new List<Consumable_order_details2__c>(); |
| | | //返品原因,返品数量检查 |
| | | for( ConsumableorderdetailsInfo codi : ShowGoodsofReturnList ){ |
| | | if (codi.esd.Box_Piece__c =='个' && ( |
| | | codi.esd.Rrturn_count__c == null || |
| | | if ( |
| | | codi.esd.Box_Piece__c == '个' && |
| | | (codi.esd.Rrturn_count__c == null || |
| | | String.valueof(codi.esd.Rrturn_count__c) =='' || |
| | | codi.esd.Rrturn_count__c <= 0)){ |
| | | codi.esd.Rrturn_count__c <= 0) |
| | | ) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | codi.esd.Return_reason__c.addError('请补充返品原因'); |
| | | return null; |
| | | } |
| | | |
| | | |
| | | if(codi.esd.Box_Piece__c=='个' && codi.esd.Rrturn_count__c > 0){ |
| | | String key = '' + codi.esd.Consumable_ZS_order__c + codi.esd.Bar_Code__c; |
| | |
| | | Consumable_order_details2__c codcorderdet = new Consumable_order_details2__c(); |
| | | |
| | | //单位=个 |
| | | if (codi.esd.Box_Piece__c =='个' && ( |
| | | codi.esd.Rrturn_count__c == null || |
| | | if ( |
| | | codi.esd.Box_Piece__c == '个' && |
| | | (codi.esd.Rrturn_count__c == null || |
| | | String.valueof(codi.esd.Rrturn_count__c) =='' || |
| | | codi.esd.Rrturn_count__c <= 0)){ |
| | | codi.esd.Rrturn_count__c <= 0) |
| | | ) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | |
| | | Integer cnt = 1; |
| | | for(Consumable_order_details2__c codctmp : consumableorderdetails2Nobox ){ |
| | | if(codctmp.Consumable_ZS_order__c == codi.esd.Consumable_ZS_order__c && codctmp.Bar_Code__c == codi.esd.Bar_Code__c){ |
| | | if ( |
| | | codctmp.Consumable_ZS_order__c == codi.esd.Consumable_ZS_order__c && |
| | | codctmp.Bar_Code__c == codi.esd.Bar_Code__c |
| | | ) { |
| | | Consumable_order_details2__c esd = codctmp; |
| | | // esd.Consumable_Return_order__c = Return_Order_Sheet.id; |
| | | esd.Return_reason__c = codi.esd.Return_reason__c; |
| | |
| | | // esd.Return_reason__c = codi.esd.Return_reason__c; |
| | | // esd.Return_date__c = Date.today(); |
| | | // esd.Consumable_Return_order__c = Return_Order_Sheet.id; |
| | | if(codi.esd.Dealer_Saled__c == false && codi.esd.Dealer_Shipment__c == false && codi.esd.Lose_Flag__c == true){ |
| | | if ( |
| | | codi.esd.Dealer_Saled__c == false && |
| | | codi.esd.Dealer_Shipment__c == false && |
| | | codi.esd.Lose_Flag__c == true |
| | | ) { |
| | | // esd.Lose_Flag__c = false; |
| | | esd.Consumable_Inventory_order__c = Inventory_Order_Sheet.id; |
| | | conOrderDetail2InList.add(esd); |
| | | hasLoseGoods = true; |
| | | } |
| | | else{ |
| | | } else { |
| | | // esd.Return_date__c = Date.today(); |
| | | esd.Consumable_Return_order__c = Return_Order_Sheet.id; |
| | | |
| | | } |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 end |
| | | esd.ReturnGs_Uploader_ID__c = UserInfo.getUserId(); |
| | |
| | | codcorderdet.TracingCode__c = codi.esd.TracingCode__c; |
| | | codcorderdet.Sterilization_limit__c = codi.esd.Sterilization_limit__c; |
| | | //gzw 手动入库 默认产品单价 20230307 |
| | | codcorderdet.Intra_Trade_List_RMB__c = (codi.esd.Intra_Trade_List_RMB__c == null || codi.esd.Intra_Trade_List_RMB__c == 0) ? codi.esd.Intra_Trade_List__c : codi.esd.Intra_Trade_List_RMB__c; |
| | | codcorderdet.Intra_Trade_List_RMB__c = (codi.esd.Intra_Trade_List_RMB__c == null || |
| | | codi.esd.Intra_Trade_List_RMB__c == 0) |
| | | ? codi.esd.Intra_Trade_List__c |
| | | : codi.esd.Intra_Trade_List_RMB__c; |
| | | codcorderdet.RemoveBox_No__c = codctmp.RemoveBox_No__c; |
| | | codcorderdet.RemoveBox_date__c = codctmp.RemoveBox_date__c; |
| | | codcorderdet.Box_Piece__c = codctmp.Box_Piece__c; |
| | |
| | | } |
| | | // tcm end |
| | | //add by rentx 2020-10-13 end 返品时新数据记录SAP合同号 |
| | | |
| | | |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 start |
| | | if(hasLoseGoods){ |
| | |
| | | |
| | | codcorderdet.Agencyinfo_fromSAP__c = codi.esd.Agencyinfo_fromSAP__c; |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------1------' + codi.esd.Frist_Storage_Agency__c)); |
| | | codcorderdet.Frist_Storage_Agency__c = codi.esd.Frist_Storage_Agency__c == null ? codi.esd.Dealer_Info_text__c : codi.esd.Frist_Storage_Agency__c; |
| | | codcorderdet.Frist_Storage_Agency__c = codi.esd.Frist_Storage_Agency__c == null |
| | | ? codi.esd.Dealer_Info_text__c |
| | | : codi.esd.Frist_Storage_Agency__c; |
| | | // 追加首次入库经销商 add by gzw 2020-04-27 end |
| | | codcorderdetList.add(codcorderdet); |
| | | codcList.add( esd ); |
| | | |
| | | cnt++; |
| | | if(cnt > codi.esd.Rrturn_count__c) break; |
| | | } |
| | | |
| | | if (cnt > codi.esd.Rrturn_count__c) |
| | | break; |
| | | } |
| | | } |
| | | else{ |
| | | } else { |
| | | hasReturnGoods = true; |
| | | //单位=盒 |
| | | //changeinvoiceInfo(codi.esd); |
| | |
| | | codi.esd.Consumable_Inventory_order__c = Inventory_Order_Sheet.id; |
| | | conOrderDetail2InList.add(codi.esd); |
| | | hasLoseGoods = true; |
| | | } |
| | | else{ |
| | | } else { |
| | | // codi.esd.Return_date__c = Date.today(); |
| | | codi.esd.Consumable_Return_order__c = Return_Order_Sheet.id; |
| | | |
| | | } |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 end |
| | | codi.esd.ReturnGs_Uploader_ID__c = UserInfo.getUserId(); |
| | |
| | | codcorderdet.TracingCode__c = codi.esd.TracingCode__c; |
| | | codcorderdet.Sterilization_limit__c = codi.esd.Sterilization_limit__c; |
| | | //gzw 手动入库 默认产品单价 20230307 |
| | | codcorderdet.Intra_Trade_List_RMB__c = (codi.esd.Intra_Trade_List_RMB__c == null || codi.esd.Intra_Trade_List_RMB__c == 0) ? codi.esd.Intra_Trade_List__c : codi.esd.Intra_Trade_List_RMB__c; |
| | | codcorderdet.Intra_Trade_List_RMB__c = (codi.esd.Intra_Trade_List_RMB__c == null || |
| | | codi.esd.Intra_Trade_List_RMB__c == 0) |
| | | ? codi.esd.Intra_Trade_List__c |
| | | : codi.esd.Intra_Trade_List_RMB__c; |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 start |
| | | if(hasLoseGoods){ |
| | | codcorderdet.loseInventory__c = true; |
| | |
| | | |
| | | codcorderdet.Agencyinfo_fromSAP__c = codi.esd.Agencyinfo_fromSAP__c; |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------2------' + codi.esd.Frist_Storage_Agency__c)); |
| | | codcorderdet.Frist_Storage_Agency__c = codi.esd.Frist_Storage_Agency__c == null ? codi.esd.Dealer_Info_text__c : codi.esd.Frist_Storage_Agency__c; |
| | | codcorderdet.Frist_Storage_Agency__c = codi.esd.Frist_Storage_Agency__c == null |
| | | ? codi.esd.Dealer_Info_text__c |
| | | : codi.esd.Frist_Storage_Agency__c; |
| | | // 追加首次入库经销商 add by gzw 2020-04-27 end |
| | | |
| | | //add by rentx 2020-10-13 start 返品时新数据记录SAP合同号 |
| | |
| | | retorddetail.Consumable_Return_order__c = Return_Order_Sheet.id; |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 end |
| | | |
| | | |
| | | retorddetail.Name = consumable_order_ret[0].Name + '-'+ str; |
| | | retorddetail.RecordTypeId = System.Label.RT_ConOrderDetail2_Return; |
| | | retorddetail.Intra_Trade_List_RMB__c = ass.Prod.Intra_Trade_List_RMB__c; |
| | |
| | | // return null; |
| | | } |
| | | // WYIN-BPE3T4 虚拟盘点单 update by vivek 2020-05-11 start |
| | | } |
| | | else{ |
| | | } else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'没有需要登录的返品')); |
| | | return null; |
| | | } |
| | | |
| | | }else{ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'没有需要登录的返品')); |
| | | return null; |
| | |
| | | if (e.Report_Product_Expiration__c != null) { |
| | | ReportProductExpirationDate = e.Report_Product_Expiration__c.format(); |
| | | } |
| | | |
| | | } |
| | | public ConsumableorderdetailsInfo(Consumable_order_details2__c e) { |
| | | canEdit = false; |
| | |
| | | if (e.Report_Product_Expiration__c != null) { |
| | | ReportProductExpirationDate = e.Report_Product_Expiration__c.format(); |
| | | } |
| | | |
| | | } |
| | | |
| | | public ConsumableorderdetailsInfo(Product2__c e,List<String> barinfoL) { |
| | |
| | | if (e.Report_Product_Expiration__c != null) { |
| | | ReportProductExpirationDate = e.Report_Product_Expiration__c.format(); |
| | | } |
| | | |
| | | } |
| | | public ConsumableorderdetailsInfo(Product2__c e) { |
| | | Prod = e; |
| | |
| | | @isTest |
| | | private class ArriveGoodsControllerTest { |
| | | @isTest |
| | | static void myUnitTest() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | | WHERE Name = '901_经销商社区普通权限_2重验证(ET)' |
| | | ]; |
| | | |
| | | Account myAccount2 = new Account( |
| | | name = 'Testaccount002', |
| | | Dealer_discount__c = 20, |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email = 'newuser@testorg.com', |
| | | EmailEncodingKey = 'UTF-8', |
| | | LastName = 'TestUser', |
| | | LanguageLocaleKey = 'zh_CN', |
| | | LocaleSidKey = 'zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey = 'Asia/Shanghai', |
| | | UserName = 'testUser@testorg.com', |
| | | UserPro_Type__c = 'ET' |
| | | ); |
| | | System.runAs(new User(Id = UserInfo.getUserId())) { |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | System.runAs(MyUser_Test) { |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | | ProductCode = 'Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | SFDA_Status__c = '有効', |
| | | JANCODE__c = '04953170200311', |
| | | Dealer_special_Object__c = true, |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod02 = new Product2( |
| | | Name = 'Test02', |
| | | ProductCode = 'Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | SFDA_Status__c = '有効', |
| | | JANCODE__c = '04953170200312', |
| | | Dealer_special_Object__c = true, |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = 'Test001', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro2 = new Product2__c( |
| | | Name = 'Pro002', |
| | | OT_CODE_Text__c = 'Test002', |
| | | Product2__c = prod02.Id |
| | | ); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | // Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Total_num__c = 3; |
| | | Order1.OrderNumber_arrived__c = 1; |
| | | Order1.Delivery_detail_count__c = 1; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 40; |
| | | insert Orderdet; |
| | | |
| | | //发货明细 |
| | | //到货正确信息 |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001002'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Test01'; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA'; |
| | | Orderdet1.TracingCode__c = 'BXJRA'; |
| | | |
| | | //取消产品 |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001003'; |
| | | Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Test01'; |
| | | //Orderdet2.Consumable_Arrived_order__c = Order1.Id; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB'; |
| | | Orderdet2.Cancellation_Date__c = Date.today(); |
| | | Orderdet2.TracingCode__c = 'BXJRB'; |
| | | //销售产品 |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(); |
| | | Orderdet3.Name = 'OCM_01_001004'; |
| | | Orderdet3.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet3.Consumable_Product__c = pro1.Id; |
| | | Orderdet3.Asset_Model_No__c = 'Test01'; |
| | | Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC'; |
| | | Orderdet3.Used_date__c = Date.today(); |
| | | Orderdet3.Arrive_date__c = Date.today(); |
| | | Orderdet3.TracingCode__c = 'BXJRC'; |
| | | //Orderdet3.Box_Piece__c = '盒'; |
| | | |
| | | //出库产品 |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001005'; |
| | | Orderdet4.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet4.Consumable_Product__c = pro1.Id; |
| | | Orderdet4.Asset_Model_No__c = 'Test01'; |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD'; |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | Orderdet4.Arrive_date__c = Date.today(); |
| | | Orderdet4.TracingCode__c = 'BXJRD'; |
| | | |
| | | //已到货产品 |
| | | Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c(); |
| | | Orderdet5.Name = 'OCM_01_001006'; |
| | | Orderdet5.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet5.Consumable_Product__c = pro1.Id; |
| | | Orderdet5.Asset_Model_No__c = 'Test01'; |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE'; |
| | | Orderdet5.Arrive_date__c = Date.today(); |
| | | Orderdet5.TracingCode__c = 'BXJRE'; |
| | | |
| | | //发货明细 |
| | | //管理编码包含数字 |
| | | Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c(); |
| | | Orderdet6.Name = 'OCM_01_001002'; |
| | | Orderdet6.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet6.Consumable_Product__c = pro1.Id; |
| | | Orderdet6.Asset_Model_No__c = 'Test01'; |
| | | Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BX123'; |
| | | Orderdet6.TracingCode__c = 'BX123'; |
| | | |
| | | //发错库 未到货 |
| | | Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c(); |
| | | Orderdets8.Name = 'OCM_01_001011'; |
| | | Orderdets8.Consumable_order_minor__c = Order1.Id; |
| | | Orderdets8.Consumable_Product__c = pro1.Id; |
| | | Orderdets8.Asset_Model_No__c = 'Test01'; |
| | | Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys'; |
| | | Orderdets8.Box_Piece__c = '盒'; |
| | | Orderdets8.TracingCode__c = 'BXsys'; |
| | | |
| | | insert new List<Consumable_order_details2__c>{ |
| | | Orderdet1, |
| | | Orderdet2, |
| | | Orderdet3, |
| | | Orderdet4, |
| | | Orderdet5, |
| | | Orderdet6, |
| | | Orderdets8 |
| | | }; |
| | | |
| | | List<Consumable_orderdetails__c> cod1 = [ |
| | | SELECT Id |
| | | FROM Consumable_orderdetails__c |
| | | WHERE Consumable_order__c = :Order1.Id |
| | | ]; |
| | | System.assertEquals(1, cod1.size()); |
| | | |
| | | PageReference page = new PageReference( |
| | | '/apex/ArriveGoods?Esetid=' + Order1.Id |
| | | ); |
| | | |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | | System.Test.startTest(); |
| | | Controller.init(); |
| | | //排序 |
| | | Controller.barcode = ''; |
| | | Controller.SearchPro(); |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXsys\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BX123'; |
| | | Controller.SearchPro(); |
| | | |
| | | // System.assertEquals(3, controller.ConsumableorderdetailsRecordsdummy.size()); //tcm |
| | | Controller.ArriveGoodsConfim(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | //选择等待入库,包括01 和241 |
| | | @isTest |
| | | static void arriveWithID() { |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = 'N3047730', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro2 = new Product2__c( |
| | | Name = 'Pro002', |
| | | OT_CODE_Text__c = 'N3047731', |
| | | Product2__c = prod02.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'N3047730', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'N3047731', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | //订单 |
| | | |
| | |
| | | |
| | | insert Orderdet1; |
| | | |
| | | PageReference page = new PageReference( |
| | | '/apex/ArriveGoods?ESetid=' + Order1.Id |
| | | ); |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ESetid=' + Order1.Id); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = 'Test01', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro2 = new Product2__c( |
| | | Name = 'Pro002', |
| | | OT_CODE_Text__c = 'N3047731', |
| | | Product2__c = prod02.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test01', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'N3047731', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr'); |
| | | System.Test.setCurrentPage(page); |
| | |
| | | List<Consumable_order_details2__c> ins = [ |
| | | SELECT Id, Name |
| | | FROM Consumable_order_details2__c |
| | | WHERE |
| | | Bar_Code__c IN ( |
| | | '01049531702003111115120017181000105ZK250BXJRF', |
| | | '241N30477311115120017181000105ZK250BXJRA' |
| | | ) |
| | | WHERE Bar_Code__c IN ('01049531702003111115120017181000105ZK250BXJRF', '241N30477311115120017181000105ZK250BXJRA') |
| | | ]; |
| | | // System.assertEquals(2, ins.size()); |
| | | System.Test.stopTest(); |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = 'Test001', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | insert new List<Product2__c>{ pro1 }; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount1; |
| | |
| | | Orderdet5.Box_Piece__c = '盒'; |
| | | Orderdet5.TracingCode__c = 'BXJRE'; |
| | | Orderdet5.SerialLotNo__c = '5ZK'; |
| | | insert new List<Consumable_order_details2__c>{ |
| | | Orderdet1, |
| | | Orderdet2, |
| | | Orderdet3, |
| | | Orderdet4, |
| | | Orderdet5 |
| | | }; |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5 }; |
| | | |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr'); |
| | |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BXsys'; |
| | | Controller.SearchPro(); |
| | | |
| | | System.assertEquals( |
| | | 'OCM_01_001002', |
| | | controller.ConsumableorderdetailsRecords[0].esd.Name |
| | | ); |
| | | System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name); |
| | | // System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size()); |
| | | System.Test.stopTest(); |
| | | } |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = 'Test001', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro2 = new Product2__c( |
| | | Name = 'Pro002', |
| | | OT_CODE_Text__c = 'Test002', |
| | | Product2__c = prod02.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount1; |
| | |
| | | Orderdet5.Box_Piece__c = '盒'; |
| | | Orderdet5.TracingCode__c = 'BXJRE'; |
| | | Orderdet5.SerialLotNo__c = '5ZK'; |
| | | insert new List<Consumable_order_details2__c>{ |
| | | Orderdet1, |
| | | Orderdet2, |
| | | Orderdet3, |
| | | Orderdet4, |
| | | Orderdet5 |
| | | }; |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5 }; |
| | | |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr'); |
| | |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BXsys'; |
| | | Controller.SearchPro(); |
| | | |
| | | System.assertEquals( |
| | | 'OCM_01_001002', |
| | | controller.ConsumableorderdetailsRecords[0].esd.Name |
| | | ); |
| | | System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name); |
| | | // System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size()); |
| | | System.Test.stopTest(); |
| | | } |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = 'Test001', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro2 = new Product2__c( |
| | | Name = 'Pro002', |
| | | OT_CODE_Text__c = 'Test002', |
| | | Product2__c = prod02.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | //订单 |
| | | |
| | |
| | | Orderdet6.Box_Piece__c = '个'; |
| | | Orderdet6.TracingCode__c = 'BXJRF'; |
| | | |
| | | insert new List<Consumable_order_details2__c>{ |
| | | Orderdet1, |
| | | Orderdet2, |
| | | Orderdet3, |
| | | Orderdet4, |
| | | Orderdet5, |
| | | Orderdet6 |
| | | }; |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6 }; |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG'); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = 'Test001', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro2 = new Product2__c( |
| | | Name = 'Pro002', |
| | | OT_CODE_Text__c = 'Test002', |
| | | Product2__c = prod02.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | |
| | | Orderdet5.Box_Piece__c = '个'; |
| | | Orderdet5.TracingCode__c = 'BXJRZ'; |
| | | Orderdet5.SerialLotNo__c = '5ZK'; |
| | | insert new List<Consumable_order_details2__c>{ |
| | | Orderdet3, |
| | | Orderdet4, |
| | | Orderdet5 |
| | | }; |
| | | insert new List<Consumable_order_details2__c>{ Orderdet3, Orderdet4, Orderdet5 }; |
| | | |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG'); |
| | | System.Test.setCurrentPage(page); |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = '2344', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro2 = new Product2__c( |
| | | Name = 'Pro002', |
| | | OT_CODE_Text__c = '82324', |
| | | Product2__c = prod02.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = '2344', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = '82324', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | //产品注册证 |
| | | Product_Register__c prc = new Product_Register__c( |
| | |
| | | // ); |
| | | //insert prcc; |
| | | //产品-产品注册证关系 prod01 |
| | | Product_Register_Link__c prlc = new Product_Register_Link__c( |
| | | Product2__c = prod01.Id, |
| | | Product_Register__c = prc.Id |
| | | ); |
| | | Product_Register_Link__c prlc = new Product_Register_Link__c(Product2__c = prod01.Id, Product_Register__c = prc.Id); |
| | | insert prlc; |
| | | //产品-产品注册证关系 prod02 |
| | | Product_Register_Link__c prlc2 = new Product_Register_Link__c( |
| | | Product2__c = prod02.Id, |
| | | Product_Register__c = prc.Id |
| | | ); |
| | | Product_Register_Link__c prlc2 = new Product_Register_Link__c(Product2__c = prod02.Id, Product_Register__c = prc.Id); |
| | | insert prlc2; |
| | | //订单 |
| | | |
| | |
| | | //List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id]; |
| | | //System.assertEquals('○', proList[0].Estimation_Entry_Possibility__c); |
| | | |
| | | insert new List<Consumable_order_details2__c>{ |
| | | Orderdet1, |
| | | Orderdet2, |
| | | Orderdet3, |
| | | Orderdet4 |
| | | }; |
| | | PageReference page = new PageReference( |
| | | '/apex/ArriveGoods?Esetid=' + Order1.Id |
| | | ); |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 }; |
| | | PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = 'Test001', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro2 = new Product2__c( |
| | | Name = 'Pro002', |
| | | OT_CODE_Text__c = 'Test002', |
| | | Product2__c = prod02.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | //产品注册证 |
| | | Product_Register__c prc = new Product_Register__c( |
| | |
| | | // ); |
| | | //insert prcc; |
| | | //产品-产品注册证关系 prod01 |
| | | Product_Register_Link__c prlc = new Product_Register_Link__c( |
| | | Product2__c = prod01.Id, |
| | | Product_Register__c = prc.Id |
| | | ); |
| | | Product_Register_Link__c prlc = new Product_Register_Link__c(Product2__c = prod01.Id, Product_Register__c = prc.Id); |
| | | insert prlc; |
| | | //产品-产品注册证关系 prod02 |
| | | Product_Register_Link__c prlc2 = new Product_Register_Link__c( |
| | | Product2__c = prod02.Id, |
| | | Product_Register__c = prc.Id |
| | | ); |
| | | Product_Register_Link__c prlc2 = new Product_Register_Link__c(Product2__c = prod02.Id, Product_Register__c = prc.Id); |
| | | insert prlc2; |
| | | //订单 |
| | | |
| | |
| | | lose1, |
| | | lose2 |
| | | }; |
| | | PageReference page = new PageReference( |
| | | '/apex/ArriveGoods?Esetid=' + Order1.Id |
| | | ); |
| | | PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = 'Test001', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro2 = new Product2__c( |
| | | Name = 'Pro002', |
| | | OT_CODE_Text__c = 'Test002', |
| | | Product2__c = prod02.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | //订单 |
| | | |
| | |
| | | Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BX333'; |
| | | Orderdet7.TracingCode__c = 'BXSYS'; |
| | | |
| | | insert new List<Consumable_order_details2__c>{ |
| | | Orderdet1, |
| | | Orderdet2, |
| | | Orderdet3, |
| | | Orderdet4, |
| | | Orderdet5, |
| | | Orderdet6, |
| | | Orderdet7 |
| | | }; |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdet7 }; |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG'); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = '2344', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro2 = new Product2__c( |
| | | Name = 'Pro002', |
| | | OT_CODE_Text__c = '8232', |
| | | Product2__c = prod02.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = '2344', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = '8232', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | |
| | | Controller.inventoryEntry(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '011234567890123411789012175678901234250BBBBM' |
| | | ); |
| | | list1.add(Controller.barcode = '011234567890123411789012175678901234250BBBBM'); |
| | | Controller.inventoryEntry(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '01123456789012340138901217aaa8001234250BBBBN' |
| | | ); |
| | | list1.add(Controller.barcode = '01123456789012340138901217aaa8001234250BBBBN'); |
| | | Controller.inventoryEntry(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '011234567890123456789012104567890250BBBBO' |
| | | ); |
| | | list1.add(Controller.barcode = '011234567890123456789012104567890250BBBBO'); |
| | | Controller.inventoryEntry(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '01123456789012341778910034567890250BBBBP' |
| | | ); |
| | | list1.add(Controller.barcode = '01123456789012341778910034567890250BBBBP'); |
| | | Controller.inventoryEntry(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '011234567890123417aa910034567890250BBBBQ' |
| | | ); |
| | | list1.add(Controller.barcode = '011234567890123417aa910034567890250BBBBQ'); |
| | | Controller.inventoryEntry(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '01123456789012341778911134567890250BBBBR' |
| | | ); |
| | | list1.add(Controller.barcode = '01123456789012341778911134567890250BBBBR'); |
| | | Controller.inventoryEntry(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '011234567890123417789121105678900000250BBBBS' |
| | | ); |
| | | list1.add(Controller.barcode = '011234567890123417789121105678900000250BBBBS'); |
| | | Controller.inventoryEntry(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '011234567890123410789121105678900000250BBBBT' |
| | | ); |
| | | list1.add(Controller.barcode = '011234567890123410789121105678900000250BBBBT'); |
| | | Controller.inventoryEntry(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '011234567890123411789012171a780012250BBBBU' |
| | | ); |
| | | list1.add(Controller.barcode = '011234567890123411789012171a780012250BBBBU'); |
| | | Controller.inventoryEntry(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '0112345678901234110890121012789000250BBBBV' |
| | | ); |
| | | list1.add(Controller.barcode = '0112345678901234110890121012789000250BBBBV'); |
| | | Controller.inventoryEntry(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '011234567890123417120506105678901234250BBBBW' |
| | | ); |
| | | list1.add(Controller.barcode = '011234567890123417120506105678901234250BBBBW'); |
| | | Controller.inventoryEntry(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '0112345678901234111202121712050212250BBBBX' |
| | | ); |
| | | list1.add(Controller.barcode = '0112345678901234111202121712050212250BBBBX'); |
| | | Controller.inventoryEntry(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '0112345678901234111202121712a50212250BBBBY' |
| | | ); |
| | | list1.add(Controller.barcode = '0112345678901234111202121712a50212250BBBBY'); |
| | | Controller.inventoryEntry(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '0112345678901234111202121012050212250BBBBZ' |
| | | ); |
| | | list1.add(Controller.barcode = '0112345678901234111202121012050212250BBBBZ'); |
| | | Controller.inventoryEntry(list1); |
| | | } |
| | | } |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = '2344', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro2 = new Product2__c( |
| | | Name = 'Pro002', |
| | | OT_CODE_Text__c = '82324', |
| | | Product2__c = prod02.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = '2344', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = '82324', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | //产品注册证 |
| | | Product_Register__c prc = new Product_Register__c( |
| | |
| | | // ); |
| | | //insert prcc; |
| | | //产品-产品注册证关系 prod01 |
| | | Product_Register_Link__c prlc = new Product_Register_Link__c( |
| | | Product2__c = prod01.Id, |
| | | Product_Register__c = prc.Id |
| | | ); |
| | | Product_Register_Link__c prlc = new Product_Register_Link__c(Product2__c = prod01.Id, Product_Register__c = prc.Id); |
| | | insert prlc; |
| | | //产品-产品注册证关系 prod02 |
| | | Product_Register_Link__c prlc2 = new Product_Register_Link__c( |
| | | Product2__c = prod02.Id, |
| | | Product_Register__c = prc.Id |
| | | ); |
| | | Product_Register_Link__c prlc2 = new Product_Register_Link__c(Product2__c = prod02.Id, Product_Register__c = prc.Id); |
| | | insert prlc2; |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG'); |
| | | System.Test.setCurrentPage(page); |
| | |
| | | //List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id]; |
| | | //System.assertEquals('○', proList[0].Estimation_Entry_Possibility__c); |
| | | List<Product2__c> product2InStore = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Name__c, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | | OT_CODE__c |
| | | SELECT Id, Name, Name__c, Intra_Trade_List_RMB__c, Asset_Model_No__c, OT_CODE__c |
| | | FROM Product2__c |
| | | WHERE |
| | | Estimation_Entry_Possibility__c = '○' |
| | | AND Pro2_Dealer_Object__c = TRUE |
| | | AND OT_CODE__c = 'test' |
| | | WHERE Estimation_Entry_Possibility__c = '○' AND Pro2_Dealer_Object__c = TRUE AND OT_CODE__c = 'test' |
| | | ]; |
| | | //System.assertEquals(1, product2InStore.size()); |
| | | list<String> list1 = new List<String>(); |
| | |
| | | Controller.inventoryEntryNoESetId(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '0111234101204120118901231712a4001234250BBBBR' |
| | | ); |
| | | list1.add(Controller.barcode = '0111234101204120118901231712a4001234250BBBBR'); |
| | | Controller.inventoryEntryNoESetId(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '011123410120412011890123171204011234250BBBBS' |
| | | ); |
| | | list1.add(Controller.barcode = '011123410120412011890123171204011234250BBBBS'); |
| | | Controller.inventoryEntryNoESetId(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '011test10120412011890123171a04011234250BBBBT' |
| | | ); |
| | | list1.add(Controller.barcode = '011test10120412011890123171a04011234250BBBBT'); |
| | | Controller.inventoryEntryNoESetId(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add( |
| | | Controller.barcode = '0111234101204120118901231012040112342222250BBBBU' |
| | | ); |
| | | list1.add(Controller.barcode = '0111234101204120118901231012040112342222250BBBBU'); |
| | | Controller.inventoryEntryNoESetId(list1); |
| | | |
| | | list1.clear(); |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = 'Test001', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | insert new List<Product2__c>{ pro1 }; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount1; |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = 'N3047730', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro2 = new Product2__c( |
| | | Name = 'Pro002', |
| | | OT_CODE_Text__c = 'N3047731', |
| | | Product2__c = prod02.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'N3047730', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'N3047731', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | //订单 |
| | | |
| | |
| | | Orderdet2.SerialLotNo__c = '5ZK'; |
| | | insert Orderdet2; |
| | | |
| | | PageReference page = new PageReference( |
| | | '/apex/ArriveGoods?ESetid=' + Order1.Id |
| | | ); |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ESetid=' + Order1.Id); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = 'Test001', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro2 = new Product2__c( |
| | | Name = 'Pro002', |
| | | OT_CODE_Text__c = 'Test002', |
| | | Product2__c = prod02.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | |
| | | Orderdet5.Box_Piece__c = '个'; |
| | | Orderdet5.TracingCode__c = 'BXJRZ'; |
| | | Orderdet5.SerialLotNo__c = '5ZK'; |
| | | insert new List<Consumable_order_details2__c>{ |
| | | Orderdet1, |
| | | Orderdet3, |
| | | Orderdet4, |
| | | Orderdet5 |
| | | }; |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet3, Orderdet4, Orderdet5 }; |
| | | |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG'); |
| | | System.Test.setCurrentPage(page); |
| | |
| | | //排序 |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRZ\n01049531702003111115120017181000105ZK250BXJRR'; |
| | | Controller.SearchPro(); |
| | | System.assertEquals( |
| | | 1, |
| | | controller.ConsumableorderdetailsRecordserror.size() |
| | | ); |
| | | System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size()); |
| | | // System.assertEquals(2, controller.ShowGoodsofReturnList.size()); |
| | | controller.ShowGoodsofReturnList[0].esd.Return_reason__c = '多发'; |
| | | // controller.ShowGoodsofReturnList[1].esd.Return_reason__c='多发'; |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = 'Test001', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | insert new List<Product2__c>{ pro1 }; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount1; |
| | |
| | | Orderdet5.Box_Piece__c = '盒'; |
| | | Orderdet5.TracingCode__c = 'BXJRE'; |
| | | Orderdet5.SerialLotNo__c = '5ZK'; |
| | | insert new List<Consumable_order_details2__c>{ |
| | | Orderdet1, |
| | | Orderdet2, |
| | | Orderdet3, |
| | | Orderdet4, |
| | | Orderdet5 |
| | | }; |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5 }; |
| | | |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr'); |
| | |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BXsys'; |
| | | Controller.SearchPro(); |
| | | |
| | | System.assertEquals( |
| | | 'OCM_01_001002', |
| | | controller.ConsumableorderdetailsRecords[0].esd.Name |
| | | ); |
| | | System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name); |
| | | // System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size()); |
| | | System.Test.stopTest(); |
| | | } |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = 'Test001', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | insert new List<Product2__c>{ pro1 }; |
| | | Account myAccount3 = new Account( |
| | | name = 'Testaccount003', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount3 = new Account(name = 'Testaccount003', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert myAccount3; |
| | | Consumable_order__c Order2 = new Consumable_order__c(); |
| | | Order2.Name = 'OCM_02_001'; |
| | |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account( |
| | | name = 'Testaccount001', |
| | | Dealer_discount__c = 30, |
| | | RecordTypeId = rectCo[0].Id |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount1.id |
| | | ); |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c( |
| | | Name = 'Pro001', |
| | | OT_CODE_Text__c = 'Test001', |
| | | Product2__c = prod01.Id |
| | | ); |
| | | Product2__c pro2 = new Product2__c( |
| | | Name = 'Pro002', |
| | | OT_CODE_Text__c = 'Test002', |
| | | Product2__c = prod02.Id |
| | | ); |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | //订单 |
| | | Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | |
| | | Orderdet7.Box_Piece__c = '个'; |
| | | Orderdet7.TracingCode__c = 'BXJQT'; |
| | | |
| | | insert new List<Consumable_order_details2__c>{ |
| | | Orderdet1, |
| | | Orderdet2, |
| | | Orderdet3, |
| | | Orderdet4, |
| | | Orderdet5, |
| | | Orderdet6, |
| | | Orderdet7 |
| | | }; |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdet7 }; |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG'); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | @isTest |
| | | static void makeRecordsVieweTest() { |
| | | Integer count = 1001; |
| | | List<ArriveGoodsController.ConsumableorderdetailsInfo> conList = new List<ArriveGoodsController.ConsumableorderdetailsInfo>(); |
| | | for (Integer i = 0; i < 1001; i++) { |
| | | conList.add(new ArriveGoodsController.ConsumableorderdetailsInfo()); |
| | | } |
| | | ArriveGoodsController arr = new ArriveGoodsController(); |
| | | arr.makeRecordsView(conList); |
| | | ArriveGoodsController arr1 = new ArriveGoodsController('', ''); |
| | | } |
| | | |
| | | @isTest |
| | | static void compareToTest() { |
| | | ArriveGoodsController.ConsumableorderdetailsInfo c1 = new ArriveGoodsController.ConsumableorderdetailsInfo(); |
| | | ArriveGoodsController.ConsumableorderdetailsInfo c2 = new ArriveGoodsController.ConsumableorderdetailsInfo(); |
| | | c1.compareTo(c2); |
| | | } |
| | | |
| | | @isTest |
| | | static void searchProTest1() { |
| | | List<RecordType> rectCo = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | | WHERE Name = '901_经销商社区普通权限_2重验证(ET)' |
| | | ]; |
| | | Account myAccount2 = new Account( |
| | | name = 'Testaccount002', |
| | | Dealer_discount__c = 20, |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email = 'newuser@testorg.com', |
| | | EmailEncodingKey = 'UTF-8', |
| | | LastName = 'TestUser', |
| | | LanguageLocaleKey = 'zh_CN', |
| | | LocaleSidKey = 'zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey = 'Asia/Shanghai', |
| | | UserName = 'testUser@testorg.com', |
| | | UserPro_Type__c = 'ET' |
| | | ); |
| | | System.runAs(new User(Id = UserInfo.getUserId())) { |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | System.runAs(MyUser_Test) { |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | | ProductCode = 'Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | SFDA_Status__c = '有効', |
| | | JANCODE__c = '04953170200311', |
| | | Dealer_special_Object__c = true, |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod02 = new Product2( |
| | | Name = 'Test02', |
| | | ProductCode = 'Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | SFDA_Status__c = '有効', |
| | | JANCODE__c = '04953170200312', |
| | | Dealer_special_Object__c = true, |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'N3047730', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'N3047731', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 4; |
| | | insert Orderdet; |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001001'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Test01'; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | Orderdet1.Cancellation_Date__c = null; |
| | | Orderdet1.TracingCode__c = 'BXJRF'; |
| | | Orderdet1.SerialLotNo__c = '5ZK'; |
| | | insert Orderdet1; |
| | | System.debug('Orderdet1:' + Orderdet1); |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001001'; |
| | | Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Test01'; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181234105ZK250BXJRF'; |
| | | Orderdet1.Cancellation_Date__c = null; |
| | | Orderdet2.TracingCode__c = 'BXJRF'; |
| | | Orderdet2.SerialLotNo__c = '5ZK'; |
| | | insert Orderdet2; |
| | | |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr'); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | System.Test.startTest(); |
| | | Controller.init(); |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | Controller.SearchPro(); |
| | | Controller.ArriveGoodsConfim(); |
| | | List<Consumable_order_details2__c> ins = [ |
| | | SELECT Id, Name |
| | | FROM Consumable_order_details2__c |
| | | ]; |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | @isTest |
| | | public class ArriveGoodsControllerTestV2 { |
| | | @isTest |
| | | static void myUnitTest() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | | WHERE Name = '901_经销商社区普通权限_2重验证(ET)' |
| | | ]; |
| | | |
| | | Account myAccount2 = new Account( |
| | | name = 'Testaccount002', |
| | | Dealer_discount__c = 20, |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email = 'newuser@testorg.com', |
| | | EmailEncodingKey = 'UTF-8', |
| | | LastName = 'TestUser', |
| | | LanguageLocaleKey = 'zh_CN', |
| | | LocaleSidKey = 'zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey = 'Asia/Shanghai', |
| | | UserName = 'testUser@testorg.com', |
| | | UserPro_Type__c = 'ET' |
| | | ); |
| | | System.runAs(new User(Id = UserInfo.getUserId())) { |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | System.runAs(MyUser_Test) { |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | | ProductCode = 'Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | SFDA_Status__c = '有効', |
| | | JANCODE__c = '04953170200311', |
| | | Dealer_special_Object__c = true, |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod02 = new Product2( |
| | | Name = 'Test02', |
| | | ProductCode = 'Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | SFDA_Status__c = '有効', |
| | | JANCODE__c = '04953170200312', |
| | | Dealer_special_Object__c = true, |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | // Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Total_num__c = 3; |
| | | Order1.OrderNumber_arrived__c = 1; |
| | | Order1.Delivery_detail_count__c = 1; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 40; |
| | | insert Orderdet; |
| | | |
| | | //发货明细 |
| | | //到货正确信息 |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001002'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Test01'; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA'; |
| | | Orderdet1.TracingCode__c = 'BXJRA'; |
| | | |
| | | //取消产品 |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001003'; |
| | | Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Test01'; |
| | | //Orderdet2.Consumable_Arrived_order__c = Order1.Id; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB'; |
| | | Orderdet2.Cancellation_Date__c = Date.today(); |
| | | Orderdet2.TracingCode__c = 'BXJRB'; |
| | | //销售产品 |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(); |
| | | Orderdet3.Name = 'OCM_01_001004'; |
| | | Orderdet3.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet3.Consumable_Product__c = pro1.Id; |
| | | Orderdet3.Asset_Model_No__c = 'Test01'; |
| | | Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC'; |
| | | Orderdet3.Used_date__c = Date.today(); |
| | | Orderdet3.Arrive_date__c = Date.today(); |
| | | Orderdet3.TracingCode__c = 'BXJRC'; |
| | | //Orderdet3.Box_Piece__c = '盒'; |
| | | |
| | | //出库产品 |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001005'; |
| | | Orderdet4.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet4.Consumable_Product__c = pro1.Id; |
| | | Orderdet4.Asset_Model_No__c = 'Test01'; |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD'; |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | Orderdet4.Arrive_date__c = Date.today(); |
| | | Orderdet4.TracingCode__c = 'BXJRD'; |
| | | |
| | | //已到货产品 |
| | | Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c(); |
| | | Orderdet5.Name = 'OCM_01_001006'; |
| | | Orderdet5.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet5.Consumable_Product__c = pro1.Id; |
| | | Orderdet5.Asset_Model_No__c = 'Test01'; |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE'; |
| | | Orderdet5.Arrive_date__c = Date.today(); |
| | | Orderdet5.TracingCode__c = 'BXJRE'; |
| | | |
| | | //发货明细 |
| | | //管理编码包含数字 |
| | | Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c(); |
| | | Orderdet6.Name = 'OCM_01_001002'; |
| | | Orderdet6.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet6.Consumable_Product__c = pro1.Id; |
| | | Orderdet6.Asset_Model_No__c = 'Test01'; |
| | | Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BX123'; |
| | | Orderdet6.TracingCode__c = 'BX123'; |
| | | |
| | | //发错库 未到货 |
| | | Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c(); |
| | | Orderdets8.Name = 'OCM_01_001011'; |
| | | Orderdets8.Consumable_order_minor__c = Order1.Id; |
| | | Orderdets8.Consumable_Product__c = pro1.Id; |
| | | Orderdets8.Asset_Model_No__c = 'Test01'; |
| | | Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys'; |
| | | Orderdets8.Box_Piece__c = '盒'; |
| | | Orderdets8.TracingCode__c = 'BXsys'; |
| | | |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdets8 }; |
| | | |
| | | List<Consumable_orderdetails__c> cod1 = [ |
| | | SELECT Id |
| | | FROM Consumable_orderdetails__c |
| | | WHERE Consumable_order__c = :Order1.Id |
| | | ]; |
| | | System.assertEquals(1, cod1.size()); |
| | | |
| | | PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id); |
| | | |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | | System.Test.startTest(); |
| | | Controller.init(); |
| | | //排序 |
| | | Controller.barcode = ''; |
| | | Controller.SearchPro(); |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXsys\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BX123'; |
| | | Controller.SearchPro(); |
| | | |
| | | // System.assertEquals(3, controller.ConsumableorderdetailsRecordsdummy.size()); //tcm |
| | | Controller.ArriveGoodsConfim(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>58.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | public without sharing class AssetHandler extends Oly_TriggerHandler { |
| | | |
| | | public static Map<String , List<Rental_Apply_Equipment_Set_Detail__c>> queueRaesdMap; |
| | | private Map<Id, Asset> newMap; |
| | | private Map<Id, Asset> oldMap; |
| | | private List<Asset> newList; |
| | | private List<Asset> oldList; |
| | | @TestVisible private static Set<String> testTargetDepts; |
| | | @TestVisible private static Id Account_Asset_Id; |
| | | private static final Map<String, Schema.RecordTypeInfo> DEVELOPERNAMEMAP = Schema.SObjectType.Asset.getRecordTypeInfosByDeveloperName(); // 20230306 ljh add |
| | | @TestVisible |
| | | private static Set<String> testTargetDepts; |
| | | @TestVisible |
| | | private static Id Account_Asset_Id; |
| | | public static Boolean disabled = false; |
| | | |
| | | public AssetHandler() { |
| | |
| | | this.oldMap = (Map<Id, Asset>) Trigger.oldMap; |
| | | this.newList = (List<Asset>) Trigger.new; |
| | | this.oldList = (List<Asset>) Trigger.old; |
| | | |
| | | Integer i = 0; |
| | | } |
| | | |
| | | protected override void beforeInsert() { |
| | |
| | | |
| | | //第一次不加变更的时候不知道第一次是多少 |
| | | updateChangeQuantityReason(); |
| | | |
| | | workflowCode(); |
| | | } |
| | | protected override void beforeUpdate() { |
| | | if(!disabled){ |
| | |
| | | |
| | | updateChangeQuantityReason(); |
| | | |
| | | // 20230309 gzw 优化 注释代码 |
| | | |
| | | // 虚拟维修保修合同保修开始结束日期更新 |
| | | updateMaintenance_Contract_Asset(); |
| | | // updateMaintenance_Contract_Asset(); |
| | | |
| | | // 20230309 gzw 优化 注释代码 |
| | | |
| | | updateRentalCount(); |
| | | } |
| | | |
| | | workflowCode(); |
| | | } |
| | | } |
| | | |
| | | protected override void afterInsert() { |
| | |
| | | updateMaintenance_Contract_Asset(); |
| | | } |
| | | } |
| | | |
| | | //20230309 sx 保有设备workflow代码化 start |
| | | private void workflowCode() { |
| | | /*List<Id> accIds = new List<Id>(); |
| | | List<Id> productIds = new List<Id>(); |
| | | List<Id> hospitalIds = new List<Id>(); |
| | | for(Asset nObj : newList) { |
| | | accIds.add(nObj.Account.Id); |
| | | productIds.add(nObj.Product2.Id); |
| | | hospitalIds.add(nObj.Hospital__c); |
| | | } |
| | | |
| | | //查找客户List |
| | | Map<Id, Account> accMap = new Map<Id, Account>([SELECT Id, Name, Management_Code__c from Account where Id in :accIds]); |
| | | Map<Id, Product2> productMap = new Map<Id, Product2>([SELECT Id, Name, RecordTypeId, RecordType.Name, Serial_Lot_No__c ,ProductCode from Product2 where Id in :productIds]); |
| | | Map<Id, Account> hosMap = new Map<Id, Account>([SELECT Id, Name, RecordType.Name from Account where id in :hospitalIds]); |
| | | |
| | | Map<Id, Account> acc_assMap = new Map<Id, Account>(); |
| | | Map<Id, Product2> pro_proMap = new Map<Id, Product2>(); |
| | | Map<Id, Account> hos_assMap = new Map<Id, Account>(); |
| | | for(Asset nObj : newList){ |
| | | if(accMap.containsKey(nObj.Account.Id)) { |
| | | acc_assMap.put(nObj.Id, accMap.get(nObj.Account.Id)); |
| | | } |
| | | if(productMap.containsKey(nObj.Product2.Id)) { |
| | | pro_proMap.put(nObj.Id, productMap.get(nObj.Product2.Id)); |
| | | } |
| | | if(hosMap.containsKey(nObj.Hospital__c)) { |
| | | hos_assMap.put(nObj.Id, hosMap.get(nObj.Id)); |
| | | } |
| | | }*/ |
| | | Date today = Date.today(); |
| | | |
| | | for (Asset nObj : newList) { |
| | | //保有设备HPID文本化 |
| | | nObj.Asset_Year_Txt__c = nObj.Asset_Year__c; |
| | | nObj.HP_ID_Text__c = nObj.HP_Id__c; |
| | | nObj.Gurantee_End_day1__c = nObj.Gurantee_End_day__c; |
| | | |
| | | //覆盖设备的可选对象文本化 |
| | | if (Trigger.isInsert || (Trigger.isUpdate && nObj.Posting_Date__c != oldMap.get(nObj.Id).Posting_Date__c)) { |
| | | if (String.isBlank(nObj.IF_Coverage_Target_Asset__c) || '0'.equals(nObj.IF_Coverage_Target_Asset__c)) { |
| | | nObj.IF_Coverage_Target_Asset__c = nObj.IF_Coverage_Target_Asset_FF__c + ''; |
| | | } |
| | | |
| | | if (nObj.IF_Coverage_Target_Asset_FF__c == 3 && nObj.FY23_Asset_Age__c == null) { |
| | | nObj.FY23_Asset_Age__c = 0; |
| | | } |
| | | } |
| | | |
| | | //市场对应录入时间自动录入 |
| | | if ( |
| | | (Trigger.isInsert && nObj.Market_Product_Category__c != null) || |
| | | (Trigger.isUpdate && |
| | | nObj.Market_Product_Category__c != oldMap.get(nObj.Id).Market_Product_Category__c && |
| | | nObj.Market_Product_Category__c != null) |
| | | ) { |
| | | nObj.Marketing_Input_Date__c = today; |
| | | } |
| | | |
| | | /*//待报废变更为使用中 |
| | | if(nObj.RecordType.Name == '备品' |
| | | && nObj.Manage_type__c == '个体管理' |
| | | && nObj.Quantity > 0 && nObj.Status == '待报废' |
| | | && ( (nObj.Abandoned_RealThing__c == null && nObj.Abandoned_Inventory__c == null) || (nObj.Abandoned_RealThing__c + nObj.Abandoned_Inventory__c) == 0) |
| | | && acc_assMap.get(nObj.Id).Management_Code__c != System.Label.Account_Asset_FJZ) { |
| | | nObj.Status = '使用中'; |
| | | nObj.Tobe_Discarded_Date__c = null; |
| | | }*/ |
| | | |
| | | /*//AssetMarkUpdate |
| | | if(Trigger.isUpdate && nObj.IF_Information_From__c == false && nObj.AssetMark__c == null) { |
| | | if(pro_proMap.containsKey(nObj.Id)){ |
| | | if(pro_proMap.get(nObj.Id).RecordType.Name == '竞品-主机' ) { |
| | | nObj.AssetMark__c = '竞品主机'; |
| | | }else if(pro_proMap.get(nObj.Id).RecordType.Name == '竞品-耗材') { |
| | | nObj.AssetMark__c = '竞品耗材'; |
| | | }else if(pro_proMap.get(nObj.Id).Serial_Lot_No__c == 'S/N tracing') { |
| | | nObj.AssetMark__c = '主机'; |
| | | } |
| | | } |
| | | else { |
| | | nObj.AssetMark__c = '耗材'; |
| | | } |
| | | }*/ |
| | | |
| | | /*//AssetName=ProductName |
| | | if(nObj.Name.equals('*') || (nObj.Product2.Id != null && nObj.Product2 != oldMap.get(nObj.Id).Product2)) { |
| | | nObj.Name = pro_proMap.get(nObj.Id).Name; |
| | | }*/ |
| | | |
| | | //AssetTextCopy |
| | | if (Trigger.isInsert || (Trigger.isUpdate && nObj.Product2 != oldMap.get(nObj.Id).Product2)) { |
| | | nObj.BSSCategory_Text__c = nObj.BSSCategory__c; |
| | | nObj.Brand_Name_Text__c = nObj.Brand_Name__c; |
| | | nObj.Category2_Text__c = nObj.Category2__c; |
| | | nObj.Category3_Text__c = nObj.Category3__c; |
| | | nObj.Category4_Text__c = nObj.Category4__c; |
| | | nObj.Category5_Text__c = nObj.Category5__c; |
| | | } |
| | | |
| | | //CIC安装状态确认日 |
| | | if (nObj.CIC_call_back_check__c && nObj.CIC_call_back_confirm_day__c == null) { |
| | | nObj.CIC_call_back_confirm_day__c = today; |
| | | } |
| | | |
| | | //Equipment_Last_confirmed_day |
| | | if ( |
| | | (Trigger.isInsert && |
| | | (nObj.Status != null || |
| | | nObj.Installation_Site__c != null || |
| | | nObj.Final_Examination_Date__c != null || |
| | | nObj.Hospital_Manage_Number__c != null)) || |
| | | (Trigger.isUpdate && |
| | | (nObj.Status != oldMap.get(nObj.Id).Status || |
| | | nObj.Installation_Site__c != oldMap.get(nObj.Id).Installation_Site__c || |
| | | nObj.Final_Examination_Date__c != oldMap.get(nObj.Id).Final_Examination_Date__c || |
| | | nObj.Hospital_Manage_Number__c != oldMap.get(nObj.Id).Hospital_Manage_Number__c)) |
| | | ) { |
| | | nObj.Equipment_Last_checking_day__c = today; |
| | | } |
| | | |
| | | /*//Product_Code+Serial_No |
| | | if(Trigger.isUpdate && nObj.IsCompetitorProduct == false && nObj.Manage_type__c != '数量管理' && nObj.AssetMark__c != '耗材' && nObj.Loaner_accsessary__c != true && nObj.unknow_serial_NO_product__c != false) { |
| | | if(nObj.Product2.Id == null) { |
| | | nObj.Product_Serial_No__c = nObj.Id; |
| | | }else { |
| | | nObj.Product_Serial_No__c = pro_proMap.get(nObj.Id).ProductCode + ' ' + nObj.SerialNumber; |
| | | if(nObj.Delete_Flag__c){ |
| | | nObj.Product_Serial_No__c += ':' + acc_assMap.get(nObj.Id).Management_Code__c; |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | //Product_Code+Serial_No Clear |
| | | if ( |
| | | (Trigger.isInsert && nObj.IsCompetitorProduct) || |
| | | (Trigger.isUpdate && |
| | | nObj.IsCompetitorProduct && |
| | | !oldMap.get(nObj.Id).IsCompetitorProduct) |
| | | ) { |
| | | nObj.Product_Serial_No__c = ''; |
| | | } |
| | | |
| | | /*//Product_Code+Serial_No+Salesdepartment |
| | | if(Trigger.isUpdate && nObj.IsCompetitorProduct == false && nObj.Manage_type__c == '数量管理' && nObj.AssetMark__c == '耗材' && nObj.Loaner_accsessary__c == true && nObj.unknow_serial_NO_product__c == false) { |
| | | if(nObj.Product2.Id == null) { |
| | | nObj.Product_Serial_No__c = nObj.Id; |
| | | }else { |
| | | nObj.Product_Serial_No__c = pro_proMap.get(nObj.Id).ProductCode + ' ' + nObj.SerialNumber + ':' + nObj.Salesdepartment__c.subString(0,nObj.Salesdepartment__c.indexOf(':')); |
| | | if(nObj.Delete_Flag__c){ |
| | | nObj.Product_Serial_No__c += ':' + acc_assMap.get(nObj.Id).Management_Code__c; |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | /*//Product_Code+Serial_No UnkownSerial |
| | | if(Trigger.isUpdate && nObj.unknow_serial_NO_product__c == true) { |
| | | nObj.SerialNumber = nObj.serial_past__c; |
| | | if(nObj.Product2.Id == null) { |
| | | nObj.Product_Serial_No__c = nObj.Id; |
| | | }else { |
| | | nObj.Product_Serial_No__c = pro_proMap.get(nObj.Id).ProductCode + ':' + nObj.serial_past__c; |
| | | if(nObj.Delete_Flag__c){ |
| | | nObj.Product_Serial_No__c += ':' + acc_assMap.get(nObj.Id).Management_Code__c; |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | //更新备品资产管理负责本部选项 |
| | | if ( |
| | | (Trigger.isInsert && nObj.Internal_demo_incharge_demo__c != null) || |
| | | (Trigger.isUpdate && nObj.Internal_demo_incharge_demo__c != oldMap.get(nObj.Id).Internal_demo_incharge_demo__c) |
| | | ) { |
| | | nObj.Internal_demo_incharge_demo_text__c = nObj.Internal_demo_incharge_demo__c; |
| | | } |
| | | |
| | | /*//自动更新资产所属(医院资产) |
| | | if(Trigger.isUpdate && nObj.RecordType.Name == '医院保有设备' && hos_assMap.containskey(nObj.Id) && hos_assMap.get(nObj.Id).RecordType.Name == '病院' && acc_assMap.get(nObj.Id).Id == '00110000015Bx0h' ) { |
| | | nObj.Asset_Owner__c = '医院资产'; |
| | | }*/ |
| | | |
| | | /*//自动更新资产所属(奥林巴斯) |
| | | if(nObj.RecordType.Name == '医院保有设备' || (acc_assMap.containskey(nObj.Id) && acc_assMap.get(nObj.Id).Id == '00110000015Bx0h')) { |
| | | nObj.Asset_Owner__c = '奥林巴斯'; |
| | | }*/ |
| | | |
| | | /*//自动更新资产所属(经销商资产) |
| | | if(nObj.RecordType.Name == '医院保有设备' && (acc_assMap.containskey(nObj.Id) && hos_assMap.get(nObj.Id).RecordType.Name == '販売店')) { |
| | | nObj.Asset_Owner__c = '经销商资产'; |
| | | }*/ |
| | | |
| | | //手动创建的耗材信息修改 |
| | | if (nObj.RecordTypeId == '01210000000kOPM' && nObj.Information_From__c == '手动输入' && nObj.AssetMark__c == '耗材') { |
| | | nObj.Guarantee_period_for_products__c = nObj.Posting_Date__c; |
| | | nObj.InstallDate = nObj.Posting_Date__c; |
| | | } |
| | | |
| | | //出货日自动赋值 |
| | | if (Trigger.isInsert && nObj.Information_From__c == '手动输入') { |
| | | nObj.Posting_Date__c = Date.newInstance(1900, 1, 1); |
| | | } |
| | | |
| | | //新逻辑保修期限对应 |
| | | if (nObj.New_logic_data__c) { |
| | | nObj.Guarantee_period_for_products__c = nObj.Guarantee_period_formula__c; |
| | | } |
| | | |
| | | //成本中心更新编码Update |
| | | if ( |
| | | (Trigger.isInsert && nObj.Internal_cost_center_cd__c != null) || |
| | | (Trigger.isUpdate && nObj.Internal_cost_center_cd__c != oldMap.get(nObj.Id).Internal_cost_center_cd__c) |
| | | ) { |
| | | nObj.Internal_demo_incharge_demo_text__c = nObj.Internal_cost_center_formula__c; |
| | | } |
| | | |
| | | //成本中心更新选项Update |
| | | if ( |
| | | (Trigger.isInsert && nObj.Internal_cost_center__c != null) || |
| | | (Trigger.isUpdate && nObj.Internal_cost_center__c != oldMap.get(nObj.Id).Internal_cost_center__c) |
| | | ) { |
| | | nObj.Internal_cost_center_text__c = nObj.Internal_cost_center__c; |
| | | } |
| | | |
| | | //待报废日登录 |
| | | if ( |
| | | Trigger.isUpdate && |
| | | nObj.Fixture_Status__c != oldMap.get(nObj.Id).Fixture_Status__c && |
| | | nObj.Fixture_Status__c != '废弃' && |
| | | (nObj.Abandoned_RealThing__c > 0 || |
| | | nObj.Abandoned_Inventory__c > 0) && |
| | | nObj.Manage_type__c == '个体管理' |
| | | ) { |
| | | nObj.Status = '待报废'; |
| | | nObj.Tobe_Discarded_Date__c = today; |
| | | } |
| | | |
| | | //退货转备品DEL置FALSE |
| | | if ( |
| | | Trigger.isUpdate && |
| | | ((nObj.RecordType != oldMap.get(nObj.Id).RecordType && nObj.RecordTypeId == '01210000000kOPR') || |
| | | (nObj.AccountId != oldMap.get(nObj.Id).AccountId && |
| | | nObj.AccountId == '0011000000VAiwz')) && |
| | | nObj.Delete_Flag__c |
| | | ) { |
| | | nObj.Delete_Flag__c = false; |
| | | } |
| | | |
| | | //追溯设备耗材Mark更新 |
| | | if ('追溯系统'.equals(nObj.Information_From__c) && String.isBlank(nObj.AssetMark__c)) { |
| | | nObj.AssetMark__c = '耗材'; |
| | | } |
| | | |
| | | //納入商品状態変更(使用中) |
| | | if ( |
| | | (Trigger.isInsert && nObj.Status == '使用中') || |
| | | (Trigger.isUpdate && |
| | | nObj.Status != oldMap.get(nObj.Id).Status && |
| | | nObj.Status == '使用中') |
| | | ) { |
| | | nObj.Status_Busy_Date__c = today; |
| | | } |
| | | |
| | | //納入商品状態変更(廃棄) |
| | | if ( |
| | | (Trigger.isInsert && nObj.Status == '廃棄') || |
| | | (Trigger.isUpdate && |
| | | nObj.Status != oldMap.get(nObj.Id).Status && |
| | | nObj.Status == '廃棄') |
| | | ) { |
| | | nObj.Discarded_Date__c = today; |
| | | nObj.Quantity = 0; |
| | | nObj.Abandoned_Inventory__c = null; |
| | | nObj.Abandoned_RealThing__c = null; |
| | | nObj.ChangeQuantityReason__c = '废弃'; |
| | | } |
| | | |
| | | //納入商品状態変更(不明) |
| | | if ( |
| | | (Trigger.isInsert && nObj.Status == '不明') || |
| | | (Trigger.isUpdate && |
| | | nObj.Status != oldMap.get(nObj.Id).Status && |
| | | nObj.Status == '不明') |
| | | ) { |
| | | nObj.Indistinctness_Date__c = today; |
| | | } |
| | | |
| | | //納入商品状態変更(未使用) |
| | | if ( |
| | | (Trigger.isInsert && nObj.Status == '未使用') || |
| | | (Trigger.isUpdate && |
| | | nObj.Status != oldMap.get(nObj.Id).Status && |
| | | nObj.Status == '未使用') |
| | | ) { |
| | | nObj.Unused_Date__c = today; |
| | | } |
| | | |
| | | /*//納品確認書の診療科コード_セット |
| | | if(!(nObj.Product2.Id != null && nObj.IsCompetitorProduct == false && nObj.InstallDate != null) && nObj.Install_Account_Code__c == null) { |
| | | nObj.Install_Account_Code__c = acc_assMap.get(nObj.Id).Management_Code__c; |
| | | nObj.Install_Account_Name__c = acc_assMap.get(nObj.Id).Name; |
| | | nObj.Install_Hospital_Name__c = hos_assMap.get(nObj.Id).Name; |
| | | nObj.Install_Hospital_code__c = hos_assMap.get(nObj.Id).Management_Code__c; |
| | | }*/ |
| | | |
| | | //病院管理番号変更日 |
| | | if ( |
| | | (Trigger.isInsert && nObj.Hospital_Manage_Number__c != null) || |
| | | (Trigger.isUpdate && nObj.Hospital_Manage_Number__c != oldMap.get(nObj.Id).Hospital_Manage_Number__c) |
| | | ) { |
| | | nObj.Hospital_Manage_Number_Change_Date__c = today; |
| | | } |
| | | |
| | | //更新-2次前点检日 |
| | | if (Trigger.isUpdate && nObj.Final_Examination_Date__c != oldMap.get(nObj.Id).Final_Examination_Date__c) { |
| | | nObj.X2_second_past_inspection__c = oldMap.get(nObj.Id).Final_Examination_Date__c; |
| | | } |
| | | |
| | | // 文本化 多年保修期至 |
| | | nObj.Extend_Gurantee_DateTo_Text__c = nObj.Extend_Gurantee_DateTo__c; |
| | | |
| | | // 保修天数工作流 |
| | | if ( |
| | | Trigger.isInsert || |
| | | (Trigger.isUpdate && |
| | | (nObj.Guarantee_period_for_products__c != oldMap.get(nObj.Id).Guarantee_period_for_products__c || |
| | | nObj.InstallDate__c != oldMap.get(nObj.Id).InstallDate__c || |
| | | nObj.ChangeWarrantyStartDate__c != oldMap.get(nObj.Id).ChangeWarrantyStartDate__c)) |
| | | ) { |
| | | nObj.GuaranteePeriod__c = nObj.guarantee_period__c; |
| | | } |
| | | |
| | | // 有安装日,更新状态到[使用中] |
| | | if ( |
| | | (Trigger.isInsert && nObj.InstallDate != null) || |
| | | (Trigger.isUpdate && |
| | | nObj.InstallDate != null && |
| | | nObj.InstallDate != oldMap.get(nObj.Id).InstallDate) |
| | | ) { |
| | | nObj.Status_Busy_Date__c = today; |
| | | nObj.Status = '使用中'; |
| | | } |
| | | |
| | | // 备品再退货转DEL置TRUE |
| | | if (nObj.AccountId == '00110000015Bx0h' && nObj.RecordTypeId == '01210000000kOPM' && !nObj.Delete_Flag__c) { |
| | | nObj.Delete_Flag__c = true; |
| | | } |
| | | |
| | | // 设定备品所属公司(上海)FromVBA |
| | | if ( |
| | | (Trigger.isInsert && nObj.CompanyCodeOfEquipment_txt__c == '5112') || |
| | | (Trigger.isUpdate && |
| | | nObj.CompanyCodeOfEquipment_txt__c != oldMap.get(nObj.Id).CompanyCodeOfEquipment_txt__c && |
| | | nObj.CompanyCodeOfEquipment_txt__c == '5112') |
| | | ) { |
| | | nObj.CompanyOfEquipment__c = '上海'; |
| | | } |
| | | |
| | | // 设定备品所属公司(沈阳)FromVBA |
| | | if ( |
| | | (Trigger.isInsert && nObj.CompanyCodeOfEquipment_txt__c == '5114') || |
| | | (Trigger.isUpdate && |
| | | nObj.CompanyCodeOfEquipment_txt__c != oldMap.get(nObj.Id).CompanyCodeOfEquipment_txt__c && |
| | | nObj.CompanyCodeOfEquipment_txt__c == '5114') |
| | | ) { |
| | | nObj.CompanyOfEquipment__c = '沈阳'; |
| | | } |
| | | |
| | | // 设定备品所属公司(北京)FromVBA |
| | | if ( |
| | | (Trigger.isInsert && nObj.CompanyCodeOfEquipment_txt__c == '5111') || |
| | | (Trigger.isUpdate && |
| | | nObj.CompanyCodeOfEquipment_txt__c != oldMap.get(nObj.Id).CompanyCodeOfEquipment_txt__c && |
| | | nObj.CompanyCodeOfEquipment_txt__c == '5111') |
| | | ) { |
| | | nObj.CompanyOfEquipment__c = '北京'; |
| | | } |
| | | |
| | | // 设定备品所属公司(广州)FromVBA |
| | | if ( |
| | | (Trigger.isInsert && nObj.CompanyCodeOfEquipment_txt__c == '5113') || |
| | | (Trigger.isUpdate && |
| | | nObj.CompanyCodeOfEquipment_txt__c != oldMap.get(nObj.Id).CompanyCodeOfEquipment_txt__c && |
| | | nObj.CompanyCodeOfEquipment_txt__c == '5113') |
| | | ) { |
| | | nObj.CompanyOfEquipment__c = '广州'; |
| | | } |
| | | } |
| | | } |
| | | //20230309 sx 保有设备workflow代码化 end |
| | | |
| | | // 借出明细更新借出_分配_数(Sys)和已借出数(Sys) |
| | | private void updateRentalCount() { |
| | | Set<Id> idSet = new Set<Id>(); |
| | | for(Id assId : this.newMap.keySet()) { |
| | | if(this.newMap.get(assId).AssetManageConfirm__c && |
| | | this.newMap.get(assId).Account_Management_Code__c != System.Label.Account_Asset_FJZ ) { |
| | | if ( |
| | | this.newMap.get(assId).AssetManageConfirm__c && |
| | | this.newMap.get(assId).Account_Management_Code__c != System.Label.Account_Asset_FJZ |
| | | ) { |
| | | idSet.add(assId); |
| | | this.newMap.get(assId).Out_of_wh_Sys__c = 0; |
| | | this.newMap.get(assId).Rental_Count_Sys__c = 0; |
| | | } |
| | | } |
| | | if(!idSet.isEmpty()) { |
| | | for (Rental_Apply_Equipment_Set_Detail__c raesd : [ |
| | | // 备品性能优化改修 20230312 by lc Start |
| | | List<AggregateResult> raesdTempList2 = [ |
| | | SELECT COUNT(Id) num, Asset__c |
| | | FROM Rental_Apply_Equipment_Set_Detail__c |
| | | //备品发货报错对应 20230413 by lc Start |
| | | //WHERE Detail_Finish__c = false |
| | | WHERE |
| | | Detail_Not_Finish_Text__c = TRUE |
| | | //备品发货报错对应 20230413 by lc End |
| | | AND Asset__c IN :idSet |
| | | AND Shippment_loaner_time2__c != NULL |
| | | GROUP BY Asset__c |
| | | ]; |
| | | if (raesdTempList2 != null && raesdTempList2.size() > 0) { |
| | | for (AggregateResult ar : raesdTempList2) { |
| | | String assetId = String.valueOf(ar.get('Asset__c')); |
| | | Integer tempNum = Integer.valueOf(ar.get('num')); |
| | | this.newMap.get(assetId).Rental_Count_Sys__c += tempNum; |
| | | } |
| | | } |
| | | |
| | | List<AggregateResult> raesdTempList1 = [ |
| | | SELECT COUNT(Id) num, Asset__c |
| | | FROM Rental_Apply_Equipment_Set_Detail__c |
| | | //备品发货报错对应 20230413 by lc Start |
| | | //WHERE Detail_Finish__c = false |
| | | WHERE |
| | | Detail_Not_Finish_Text__c = TRUE |
| | | //备品发货报错对应 20230413 by lc End |
| | | AND Asset__c IN :idSet |
| | | GROUP BY Asset__c |
| | | ]; |
| | | if (raesdTempList1 != null && raesdTempList1.size() > 0) { |
| | | for (AggregateResult ar : raesdTempList1) { |
| | | String assetId = String.valueOf(ar.get('Asset__c')); |
| | | Integer tempNum = Integer.valueOf(ar.get('num')); |
| | | this.newMap.get(assetId).Out_of_wh_Sys__c += tempNum; |
| | | idSet.remove(assetId); |
| | | } |
| | | } |
| | | |
| | | /*for (Rental_Apply_Equipment_Set_Detail__c raesd : [ |
| | | SELECT Id, Shippment_loaner_time2__c, Asset__c |
| | | FROM Rental_Apply_Equipment_Set_Detail__c |
| | | WHERE Detail_Finish__c = false |
| | |
| | | this.newMap.get(raesd.Asset__c).Rental_Count_Sys__c += 1; |
| | | } |
| | | idSet.remove(raesd.Asset__c); |
| | | } |
| | | }*/ |
| | | // 备品性能优化改修 20230312 by lc End |
| | | |
| | | if(!idSet.isEmpty()) { |
| | | // 没有字段可以完全准确地区分备品设备与耗材设备,只好把备品里没出现过的设备当成耗材来查 |
| | | for (Consum_Apply_Equipment_Set_Detail__c caesd : [ |
| | | SELECT Id, Shippment_loaner_time2__c, Asset__c |
| | | FROM Consum_Apply_Equipment_Set_Detail__c |
| | | WHERE Detail_Finish__c = false |
| | | AND Asset__c IN :idSet |
| | | WHERE Detail_Finish__c = FALSE AND Asset__c IN :idSet |
| | | ]) { |
| | | this.newMap.get(caesd.Asset__c).Out_of_wh_Sys__c += 1; |
| | | if(caesd.Shippment_loaner_time2__c != null) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | //多年保修 start |
| | |
| | | StaticParameter.EscapeMaintenanceContractAfterUpdateTrigger = true; |
| | | Set<id> AssetIDSet = new Set<id>(); |
| | | for(Asset tempAsset : newList){ |
| | | if(String.isNotBlank(tempAsset.warrantyType__c)){ |
| | | // 20230306 ljh update start |
| | | Id Shipment = DEVELOPERNAMEMAP.get('Shipment').getRecordTypeId(); |
| | | // if(String.isNotBlank(tempAsset.warrantyType__c)){ |
| | | if (String.isNotBlank(tempAsset.warrantyType__c) && Shipment != tempAsset.RecordTypeId) { |
| | | // 20230306 ljh update end |
| | | AssetIDSet.add(tempAsset.id); |
| | | } |
| | | } |
| | | if(AssetIDSet.size() > 0 ){ |
| | | list<Maintenance_Contract_Asset__c> MCAList = |
| | | [select id,startDateGurantee__c, |
| | | startDateGurantee_Text__c,endDateGurantee__c, |
| | | endDateGurantee_Text__c,Return_Flag__c,ChangeAcc_flag__c, |
| | | Maintenance_Price_Amount__c,Maintenance_Price_Amount_text__c, |
| | | GuaranteePrice_Amount__c,GuaranteePrice_Amount_text__c |
| | | from Maintenance_Contract_Asset__c |
| | | where Asset__c in : AssetIDSet |
| | | and Maintenance_Contract__r.RecordType.DeveloperName = 'VM_Contract' |
| | | list<Maintenance_Contract_Asset__c> MCAList = [ |
| | | SELECT |
| | | id, |
| | | startDateGurantee__c, |
| | | startDateGurantee_Text__c, |
| | | endDateGurantee__c, |
| | | endDateGurantee_Text__c, |
| | | Return_Flag__c, |
| | | ChangeAcc_flag__c, |
| | | Maintenance_Price_Amount__c, |
| | | Maintenance_Price_Amount_text__c, |
| | | GuaranteePrice_Amount__c, |
| | | GuaranteePrice_Amount_text__c |
| | | FROM Maintenance_Contract_Asset__c |
| | | WHERE Asset__c IN :AssetIDSet AND Maintenance_Contract__r.RecordType.DeveloperName = 'VM_Contract' |
| | | ]; |
| | | if(MCAList.size() > 0){ |
| | | list<Maintenance_Contract_Asset__c> UpdateMcaList = |
| | | new list<Maintenance_Contract_Asset__c> (); |
| | | list<Maintenance_Contract_Asset__c> UpdateMcaList = new List<Maintenance_Contract_Asset__c>(); |
| | | for(Maintenance_Contract_Asset__c tempMCA : MCAList ){ |
| | | if(tempMCA.startDateGurantee__c != tempMCA.startDateGurantee_Text__c |
| | | || tempMCA.endDateGurantee__c != tempMCA.endDateGurantee_Text__c |
| | | || tempMCA.Maintenance_Price_Amount__c != tempMCA.Maintenance_Price_Amount_Text__c |
| | | || tempMCA.GuaranteePrice_Amount__c != tempMCA.GuaranteePrice_Amount_text__c){ |
| | | if ( |
| | | tempMCA.startDateGurantee__c != tempMCA.startDateGurantee_Text__c || |
| | | tempMCA.endDateGurantee__c != tempMCA.endDateGurantee_Text__c || |
| | | tempMCA.Maintenance_Price_Amount__c != tempMCA.Maintenance_Price_Amount_Text__c || |
| | | tempMCA.GuaranteePrice_Amount__c != tempMCA.GuaranteePrice_Amount_text__c |
| | | ) { |
| | | UpdateMcaList.add(tempMCA); |
| | | } |
| | | } |
| | |
| | | |
| | | if (Trigger.isUpdate) { |
| | | Asset oObj = oldMap.get(nObj.Id); |
| | | if (oObj.Last_Reserve_RAES_Detail__c != null && nObj.Last_Reserve_RAES_Detail__c == null |
| | | && oObj.Last_Reserve_RAES_Detail_Flag__c == true) { |
| | | if ( |
| | | oObj.Last_Reserve_RAES_Detail__c != null && |
| | | nObj.Last_Reserve_RAES_Detail__c == null && |
| | | oObj.Last_Reserve_RAES_Detail_Flag__c == true |
| | | ) { |
| | | nObj.Pre_Reserve_RAES_Detail__c = oObj.Last_Reserve_RAES_Detail__c; |
| | | } |
| | | if (oObj.Last_Reserve_TAES_Detail__c != null && nObj.Last_Reserve_TAES_Detail__c == null |
| | | if (oObj.Last_Reserve_TAES_Detail__c != null && nObj.Last_Reserve_TAES_Detail__c == null) { |
| | | // TODO 由于__r超20,字段建不出来 |
| | | // && oObj.Last_Reserve_TAES_Detail_Flag__c == true |
| | | ) { |
| | | nObj.Pre_Reserve_TAES_Detail__c = oObj.Last_Reserve_TAES_Detail__c; |
| | | } |
| | | } |
| | |
| | | // 必ず最後で置く |
| | | nObj.Fixture_Status2_text__c = nObj.Fixture_Status2__c; |
| | | nObj.Fixture_Status3_text__c = nObj.Fixture_Status3__c; |
| | | nObj.BTreeIndexKey__c = nObj.Asset_Owner__c |
| | | + ':' + nObj.Asset_loaner_category__c |
| | | + ':' + String.valueOf(nobj.Freeze_sign_Abandoned_Flag__c) |
| | | + ':' + String.valueOf(nObj.Delete_Flag__c) |
| | | + ':' + String.valueOf(nObj.AssetManageConfirm__c); |
| | | nObj.BTreeIndexKey__c = |
| | | nObj.Asset_Owner__c + |
| | | ':' + |
| | | nObj.Asset_loaner_category__c + |
| | | ':' + |
| | | String.valueOf(nobj.Freeze_sign_Abandoned_Flag__c) + |
| | | ':' + |
| | | String.valueOf(nObj.Delete_Flag__c) + |
| | | ':' + |
| | | String.valueOf(nObj.AssetManageConfirm__c); |
| | | |
| | | if (nObj.Status == FixtureUtil.assetStatusMap.get(FixtureUtil.AssetStatus.Dai_Fei_Qi.ordinal())) { |
| | | nObj.Freeze_sign__c = false; |
| | |
| | | String nAbandoned_Inventory = nObj.Abandoned_Inventory__c == null ? '' : String.valueOf(nObj.Abandoned_Inventory__c); |
| | | if ((oQuantity != nQuantity && String.isNotBlank(nObj.ChangeQuantityReason__c)) || Trigger.isInsert) { |
| | | String rs = nObj.ChangeQuantityReason__c; |
| | | nObj.ChangeQuantityHistory__c = String.format(System.Label.ChangeQuantityHistory, |
| | | new String[]{oQuantity, nQuantity, rs}); |
| | | nObj.ChangeQuantityHistory__c = String.format( |
| | | System.Label.ChangeQuantityHistory, |
| | | new List<String>{ oQuantity, nQuantity, rs } |
| | | ); |
| | | // before里面入立规则过不了改到 |
| | | // 已经改进 Must_Input_ChangeQuantityReason 的 valida before可以完成 ChangeQuantityReason__c = '' |
| | | // nObj.ChangeQuantityReason__c = ''; |
| | |
| | | |
| | | if (oAbandoned_Inventory != nAbandoned_Inventory || Trigger.isInsert) { |
| | | String rs = nObj.Giveup_Return__c; |
| | | nObj.ChangeAbandoned_InventoryHistory__c = String.format(System.Label.ChangeAbandoned_InventoryHistory, |
| | | new String[]{oAbandoned_Inventory, nAbandoned_Inventory, rs}); |
| | | nObj.ChangeAbandoned_InventoryHistory__c = String.format( |
| | | System.Label.ChangeAbandoned_InventoryHistory, |
| | | new List<String>{ oAbandoned_Inventory, nAbandoned_Inventory, rs } |
| | | ); |
| | | } |
| | | } |
| | | } |
| | |
| | | List<Asset> assList = new List<Asset>(); |
| | | for (Asset nObj : newList) { |
| | | if (String.isBlank(nObj.ChangeQuantityReason__c) == false) { |
| | | assList.add(new Asset(Id = nObj.Id, |
| | | ChangeQuantityReason__c = '')); |
| | | assList.add(new Asset(Id = nObj.Id, ChangeQuantityReason__c = '')); |
| | | } |
| | | } |
| | | if (!assList.isEmpty()) { |
| | |
| | | List<Asset> assList = new List<Asset>(); |
| | | for (Asset nObj : newList) { |
| | | if (String.isBlank(nObj.Giveup_Return__c) == false) { |
| | | assList.add(new Asset( |
| | | Id = nObj.Id, |
| | | Giveup_Return__c = '')); |
| | | assList.add(new Asset(Id = nObj.Id, Giveup_Return__c = '')); |
| | | } |
| | | } |
| | | if (!assList.isEmpty()) { |
| | |
| | | } |
| | | if (!aSetIdSet.isEmpty()) { |
| | | List<Fixture_OneToOne_Link__c> oneToOneList = [ |
| | | SELECT Id FROM Fixture_OneToOne_Link__c WHERE Main_Asset__c IN :aSetIdSet]; |
| | | if (!oneToOneList.isEmpty()) { update oneToOneList; } |
| | | SELECT Id |
| | | FROM Fixture_OneToOne_Link__c |
| | | WHERE Main_Asset__c IN :aSetIdSet |
| | | ]; |
| | | if (!oneToOneList.isEmpty()) { |
| | | update oneToOneList; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | String whkey = ''; |
| | | for (Asset nObj : newList) { |
| | | //ToDo現在排队できるのは主体だけなので,今後个体管理の附属品も排队できるの場合があったらこのIFぶんを直す必要があります |
| | | if (!(nObj.Loaner_accsessary__c == false |
| | | && nObj.Asset_Owner__c == 'Olympus' |
| | | && nObj.Equipment_Type__c != '检测用备品' |
| | | && nObj.Delete_Flag__c == False |
| | | && nObj.You_Xiao_Ku_Cun__c > 0 |
| | | && nObj.Freeze_sign_Abandoned_Flag__c == False) |
| | | if ( |
| | | !(nObj.Loaner_accsessary__c == false && |
| | | nObj.Asset_Owner__c == 'Olympus' && |
| | | nObj.Equipment_Type__c != '检测用备品' && |
| | | nObj.Delete_Flag__c == false && |
| | | nObj.You_Xiao_Ku_Cun__c > 0 && |
| | | nObj.Freeze_sign_Abandoned_Flag__c == false) |
| | | ) { |
| | | continue; |
| | | } |
| | |
| | | if (String.isNotBlank(nObj.Product_category__c)) { |
| | | key += nObj.Product_category__c; |
| | | } |
| | | |
| | | |
| | | System.debug(LoggingLevel.INFO, '*** key: ' + key); |
| | | //有新的Asset的时候 暂定分配 |
| | |
| | | // You_Xiao_Ku_Cun__c > 0 在上面已经做了判断 |
| | | else { |
| | | Asset oObj = oldMap.get(nObj.Id); |
| | | if (nObj.Loaner_accsessary__c == false && String.isBlank(nObj.Last_Reserve_RAES_Detail__c) |
| | | && (nObj.Last_Reserve_RAES_Detail__c != oObj.Last_Reserve_RAES_Detail__c |
| | | || (nObj.Asset_Owner__c != oObj.Asset_Owner__c && nObj.Asset_Owner__c == 'Olympus') |
| | | if ( |
| | | nObj.Loaner_accsessary__c == false && |
| | | String.isBlank(nObj.Last_Reserve_RAES_Detail__c) && |
| | | (nObj.Last_Reserve_RAES_Detail__c != oObj.Last_Reserve_RAES_Detail__c || |
| | | (nObj.Asset_Owner__c != oObj.Asset_Owner__c && |
| | | nObj.Asset_Owner__c == 'Olympus') || |
| | | //备品存放地 OLY_OCM-722 恢复存放地的条件 |
| | | || (nObj.Internal_asset_location__c != oObj.Internal_asset_location__c) |
| | | (nObj.Internal_asset_location__c != oObj.Internal_asset_location__c) || |
| | | //备品分类并且不是 检测用备品 |
| | | || (nObj.Equipment_Type__c != oObj.Equipment_Type__c && nObj.Equipment_Type__c != '检测用备品') |
| | | (nObj.Equipment_Type__c != oObj.Equipment_Type__c && |
| | | nObj.Equipment_Type__c != '检测用备品') || |
| | | //销售本部 |
| | | || (nObj.Salesdepartment__c != oObj.Salesdepartment__c) |
| | | (nObj.Salesdepartment__c != oObj.Salesdepartment__c) || |
| | | //产品分类(GI/SP) |
| | | || (nObj.Product_category__c != oObj.Product_category__c) |
| | | (nObj.Product_category__c != oObj.Product_category__c) || |
| | | //备品配套明细型号 |
| | | || (nObj.Fixture_Model_No_F__c != oObj.Fixture_Model_No_F__c) |
| | | || (nObj.Delete_Flag__c != oObj.Delete_Flag__c && nObj.Delete_Flag__c == true) |
| | | || (nObj.Freeze_sign_Abandoned_Flag__c != oObj.Freeze_sign_Abandoned_Flag__c && nObj.Freeze_sign_Abandoned_Flag__c == false) |
| | | ) |
| | | (nObj.Fixture_Model_No_F__c != oObj.Fixture_Model_No_F__c) || |
| | | (nObj.Delete_Flag__c != oObj.Delete_Flag__c && |
| | | nObj.Delete_Flag__c == true) || |
| | | (nObj.Freeze_sign_Abandoned_Flag__c != oObj.Freeze_sign_Abandoned_Flag__c && |
| | | nObj.Freeze_sign_Abandoned_Flag__c == false)) |
| | | ) { |
| | | if (String.isBlank(nObj.Fixture_Model_No_F__c) == false) { |
| | | if (modelNoAssetIdMap.containsKey(key) == false) { |
| | |
| | | List<String> keyList = new List<String>(); |
| | | keyList.addAll(modelNoAssetIdMap.keySet()); |
| | | System.debug(LoggingLevel.INFO, '*** keyList: ' + keyList); |
| | | List<Rental_Apply_Sequence__c> targetSequence = [SELECT Id,Apply_Set_Detail__c, |
| | | List<Rental_Apply_Sequence__c> targetSequence = [ |
| | | SELECT |
| | | Id, |
| | | Apply_Set_Detail__c, |
| | | Apply_Set_Detail_ExternalKey__c, |
| | | Demo_Purpose2__c, Equipment_Type__c, ExternalKey__c, |
| | | Demo_Purpose2__c, |
| | | Equipment_Type__c, |
| | | ExternalKey__c, |
| | | Fixture_Model_No__c, |
| | | Internal_asset_location__c, Invalid_Flag__c, |
| | | Internal_asset_location__c, |
| | | Invalid_Flag__c, |
| | | Product_category__c, |
| | | Rental_Apply__c,Series_No__c, |
| | | Series_Unequal_Queue_Flag__c, Salesdepartment__c |
| | | Rental_Apply__c, |
| | | Series_No__c, |
| | | Series_Unequal_Queue_Flag__c, |
| | | Salesdepartment__c |
| | | FROM Rental_Apply_Sequence__c |
| | | WHERE Series_No__c > 0 AND Invalid_Flag__c =false |
| | | WHERE |
| | | Series_No__c > 0 |
| | | AND Invalid_Flag__c = FALSE |
| | | AND Apply_Set_Detail__c NOT IN:raesdIdSet |
| | | AND ExternalKey__c IN:keyList |
| | | AND Apply_Set_Detail__r.Cancel_Select__c = false |
| | | ORDER BY Series_No__c ]; |
| | | AND Apply_Set_Detail__r.Cancel_Select__c = FALSE |
| | | ORDER BY Series_No__c |
| | | ]; |
| | | System.debug(LoggingLevel.INFO, '*** targetSequence: ' + targetSequence); |
| | | Map<String,List<Rental_Apply_Sequence__c>> sequenceMap = new Map<String,List<Rental_Apply_Sequence__c>>(); |
| | | for(Rental_Apply_Sequence__c sequeuece:targetSequence){ |
| | |
| | | raesd.Queue_Number__c = 0; // 暂定分配 |
| | | updateMap.put(raesd.Id,raesd); |
| | | |
| | | |
| | | modelNoAssetIdMap.get(key).remove(assIdbk); |
| | | if (modelNoAssetIdMap.get(key).isEmpty()) { |
| | | modelNoAssetIdMap.remove(key); |
| | |
| | | System.debug(LoggingLevel.INFO, '*** modelNoAssetIdMap: ' + JSON.serialize(modelNoAssetIdMap)); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | System.debug(LoggingLevel.INFO, '*** updateMap.values(): ' + JSON.serialize(updateMap.values())); |
| | | update updateMap.values(); |
| | |
| | | // whkey += wher + ' ) OR'; |
| | | // } |
| | | |
| | | |
| | | |
| | | // if (String.isNotBlank(whkey)) { |
| | | // whkey = '( ' + whkey.removeEnd('OR') + ')'; |
| | | // } |
| | | |
| | | |
| | | |
| | | // String soql = 'SELECT Fixture_Model_No_F__c, Substitute_flag__c, Asset__c,' |
| | | // + ' Queue_Number__c, Fixture_Model_No_text__c, Salesdepartment_before__c,' |
| | |
| | | Set<String> centers = new Set<String> {'北京 备品中心', '上海 备品中心', '广州 备品中心'}; |
| | | for (Asset nObj : newList) { |
| | | //待废弃,废弃,和数量0的备品需要断开一对一link (目前只处理个体管理的) |
| | | if ((nObj.Fixture_Status__c == FixtureUtil.assetFixtureStatusMap.get(FixtureUtil.AssetFixtureStatus.Fei_Qi.ordinal()) |
| | | || nObj.Fixture_Status__c == FixtureUtil.assetFixtureStatusMap.get(FixtureUtil.AssetFixtureStatus.Dai_Fei_Qi.ordinal()) |
| | | || nObj.Quantity == 0) && nObj.Manage_type__c == FixtureUtil.managetypeMap.get(FixtureUtil.Managetype.Ge_Ti_Guan_Li)){ |
| | | if ( |
| | | (nObj.Fixture_Status__c == FixtureUtil.assetFixtureStatusMap.get(FixtureUtil.AssetFixtureStatus.Fei_Qi.ordinal()) || |
| | | nObj.Fixture_Status__c == FixtureUtil.assetFixtureStatusMap.get(FixtureUtil.AssetFixtureStatus.Dai_Fei_Qi.ordinal()) || |
| | | nObj.Quantity == 0) && nObj.Manage_type__c == FixtureUtil.managetypeMap.get(FixtureUtil.Managetype.Ge_Ti_Guan_Li) |
| | | ) { |
| | | //是一对一主体或者是一对一个体附属品 |
| | | if (nObj.Main_OneToOne__c == true || nObj.Fixture_OneToOne_Link__c <> null) { |
| | | if(centers.contains(nObj.Internal_asset_location__c)) { |
| | |
| | | } |
| | | |
| | | if (assetIds.size() > 0) { |
| | | Map<Id, Fixture_OneToOne_Link__c> linkMap = new Map<Id, Fixture_OneToOne_Link__c>([ |
| | | Map<Id, Fixture_OneToOne_Link__c> linkMap = new Map<Id, Fixture_OneToOne_Link__c>( |
| | | [ |
| | | SELECT Id |
| | | FROM Fixture_OneToOne_Link__c |
| | | WHERE Main_Asset__c in :assetIds |
| | | OR Accessory_Asset__c IN: assetIds |
| | | ]); |
| | | WHERE Main_Asset__c IN :assetIds OR Accessory_Asset__c IN :assetIds |
| | | ] |
| | | ); |
| | | if(!linkMap.isEmpty()){ |
| | | delete linkMap.values(); |
| | | } |
| | |
| | | * - 没有找的话, 不更新AccountId, 自动做 Account, Group, ApexShare |
| | | */ |
| | | private void beforeSetAccountId() { |
| | | Set<String> targetDepts = new Set<String> {'1.华北营业本部','2.东北营业本部','3.西北营业本部','4.华东营业本部','5.华南营业本部','6.西南营业本部'}; |
| | | Set<String> targetDepts = new Set<String>{ |
| | | '1.华北营业本部', |
| | | '2.东北营业本部', |
| | | '3.西北营业本部', |
| | | '4.华东营业本部', |
| | | '5.华南营业本部', |
| | | '6.西南营业本部' |
| | | }; |
| | | Set<String> targetCenters = new Set<String> {'北京 备品中心', '上海 备品中心', '广州 备品中心'}; |
| | | if (Test.isRunningTest() && testTargetDepts != null) { |
| | | targetDepts = testTargetDepts; |
| | |
| | | Asset oObj = (null == this.oldMap) ? null : this.oldMap.get(nObj.Id); |
| | | |
| | | // 作成, 确认字段有没有变化 |
| | | if (Trigger.isInsert |
| | | || (oObj != null |
| | | && (oObj.RecordTypeId != nObj.RecordTypeId |
| | | || oObj.Asset_loaner_category__c != nObj.Asset_loaner_category__c |
| | | || oObj.AssetManageConfirm__c != nObj.AssetManageConfirm__c |
| | | || oObj.Internal_asset_location__c != nObj.Internal_asset_location__c |
| | | || oObj.Salesdepartment__c != nObj.Salesdepartment__c |
| | | || oObj.OlympusAccShareName__c != nObj.OlympusAccShareName__c |
| | | ) |
| | | && (targetCenters.contains(nObj.Internal_asset_location__c) |
| | | || targetProvs.containsKey(nObj.Internal_asset_location__c) |
| | | ) |
| | | && !nObj.TransferToOther__c |
| | | ) |
| | | if ( |
| | | Trigger.isInsert || |
| | | (oObj != null && |
| | | (oObj.RecordTypeId != nObj.RecordTypeId || |
| | | oObj.Asset_loaner_category__c != nObj.Asset_loaner_category__c || |
| | | oObj.AssetManageConfirm__c != nObj.AssetManageConfirm__c || |
| | | oObj.Internal_asset_location__c != nObj.Internal_asset_location__c || |
| | | oObj.Salesdepartment__c != nObj.Salesdepartment__c || |
| | | oObj.OlympusAccShareName__c != nObj.OlympusAccShareName__c) && |
| | | (targetCenters.contains(nObj.Internal_asset_location__c) || targetProvs.containsKey(nObj.Internal_asset_location__c)) && |
| | | !nObj.TransferToOther__c) |
| | | ) { |
| | | // 是不是备品的确认 |
| | | if (System.Label.Asset_RecordType == nObj.RecordTypeId |
| | | && true == nObj.AssetManageConfirm__c |
| | | && nObj.Asset_loaner_category__c != '耗材' |
| | | if ( |
| | | System.Label.Asset_RecordType == nObj.RecordTypeId && |
| | | true == nObj.AssetManageConfirm__c && |
| | | nObj.Asset_loaner_category__c != '耗材' |
| | | ) { |
| | | // 办事处备品 → 动态设定 Asset.AccountId 的対象 |
| | | if (targetProvs.containsKey(nObj.Internal_asset_location__c) |
| | | && targetDepts.contains(nObj.Salesdepartment__c) |
| | | ) { |
| | | String accShareName = '备品共享_' |
| | | + targetProvs.get(nObj.Internal_asset_location__c) + '_' + nObj.Salesdepartment__c.right(6); |
| | | if (targetProvs.containsKey(nObj.Internal_asset_location__c) && targetDepts.contains(nObj.Salesdepartment__c)) { |
| | | String accShareName = |
| | | '备品共享_' + |
| | | targetProvs.get(nObj.Internal_asset_location__c) + |
| | | '_' + |
| | | nObj.Salesdepartment__c.right(6); |
| | | nObj.OlympusAccShareName__c = accShareName; |
| | | assetAccShareNameMap.put(nObj, accShareName); |
| | | } |
| | | else { |
| | | } else { |
| | | if (AssetHandler.Account_Asset_Id == null) { |
| | | // Static 只会执行一遍 |
| | | AssetHandler.Account_Asset_Id = [SELECT Id FROM Account WHERE AgentCode_Ext__c =: System.Label.Account_Asset].Id; |
| | | AssetHandler.Account_Asset_Id = [ |
| | | SELECT Id |
| | | FROM Account |
| | | WHERE AgentCode_Ext__c = :System.Label.Account_Asset |
| | | ] |
| | | .Id; |
| | | } |
| | | nObj.OlympusAccShareName__c = ''; |
| | | nObj.AccountId = AssetHandler.Account_Asset_Id; |
| | |
| | | Set<String> insertAccShareNameSet = new Set<String>(); |
| | | if (assetAccShareNameMap.size() > 0) { |
| | | Map<String, Id> accShareId = new Map<String, Id>(); |
| | | for (Account accShare : [SELECT Id |
| | | , Department_Name__c |
| | | for (Account accShare : [ |
| | | SELECT Id, Department_Name__c |
| | | FROM Account |
| | | WHERE RecordTypeId =: System.Label.Department_OTH |
| | | AND Department_Name__c IN: assetAccShareNameMap.values()]) { |
| | | WHERE RecordTypeId = :System.Label.Department_OTH AND Department_Name__c IN :assetAccShareNameMap.values() |
| | | ]) { |
| | | accShareId.put(accShare.Department_Name__c, accShare.Id); |
| | | } |
| | | |
| | |
| | | if (accShareId.containsKey(accShareName)) { |
| | | // 找到 Account 设定 AccountId, "Olympus社内 其他 备品" => "Olympus社内 其他 备品共享_XXX" |
| | | nObj.AccountId = accShareId.get(accShareName); |
| | | } |
| | | else { |
| | | } else { |
| | | // 找不到 AccountId, 新建 Account, Group, ApexShare |
| | | insertAccShareNameSet.add(accShareName); |
| | | } |
| | |
| | | */ |
| | | private static void insertAccShare(String insertAccShareNameJson, Datetime execNow) { |
| | | Set<String> insertAccShareNameSet = (Set<String>) JSON.deserialize(insertAccShareNameJson, Set<String>.class); |
| | | if (insertAccShareNameSet.isEmpty()) { return; } |
| | | if (insertAccShareNameSet.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | // Olympus社内 其他 |
| | | List<Account> olympusAccount_OtherDC; |
| | | try { |
| | | olympusAccount_OtherDC = [SELECT Id, ParentId |
| | | olympusAccount_OtherDC = [ |
| | | SELECT Id, ParentId |
| | | FROM Account |
| | | WHERE Parent.AgentCode_Ext__c = '9999999' AND Department_Class_Name__c = '其他' |
| | | FOR Update]; |
| | | FOR UPDATE |
| | | ]; |
| | | } catch (Exception e) { |
| | | System.enqueueJob(new MyQueueableClass(insertAccShareNameJson, execNow)); |
| | | return; |
| | | } |
| | | |
| | | List<Account> isInsertedList = [SELECT Id, Department_Name__c |
| | | List<Account> isInsertedList = [ |
| | | SELECT Id, Department_Name__c |
| | | FROM Account |
| | | WHERE ParentId =: olympusAccount_OtherDC[0].Id |
| | | AND Department_Name__c IN: insertAccShareNameSet]; |
| | | WHERE ParentId = :olympusAccount_OtherDC[0].Id AND Department_Name__c IN :insertAccShareNameSet |
| | | ]; |
| | | if (isInsertedList.size() > 0) { |
| | | Map<String, Account> insertedAccount = new Map<String, Account>(); |
| | | for (Account insertedAcc : isInsertedList) { |
| | |
| | | AssetHandler.updateAssetAccount(insertedAccount, execNow); |
| | | } |
| | | |
| | | |
| | | if (insertAccShareNameSet.size() > 0) { |
| | | Map<String, Account> insertAccount = new Map<String, Account>(); |
| | | for (String accShareName : insertAccShareNameSet) { |
| | | insertAccount.put(accShareName, new Account( |
| | | insertAccount.put( |
| | | accShareName, |
| | | new Account( |
| | | Name = '*', |
| | | Hospital__c = olympusAccount_OtherDC[0].ParentId, |
| | | ParentId = olympusAccount_OtherDC[0].Id, |
| | |
| | | Department_Name__c = accShareName, |
| | | OwnerId = System.Label.Batch_User_Id, |
| | | RecordTypeId = System.Label.Department_OTH |
| | | )); |
| | | ) |
| | | ); |
| | | } |
| | | AssetHandler.insertAccGrantShare(insertAccount, execNow); |
| | | } |
| | | } |
| | | |
| | | private static void insertAccGrantShare(Map<String, Account> insertAccountMap, Datetime execNow) { |
| | | if (insertAccountMap.isEmpty()) { return; } |
| | | if (insertAccountMap.isEmpty()) { |
| | | return; |
| | | } |
| | | Set<String> accShareNameSet = insertAccountMap.keySet(); |
| | | // insert Account的时候, 跳过 NFM001 |
| | | // OLY_OCM-1230 需要执行NFM001Trigger |
| | |
| | | Map<String, Group> insertGroup = new Map<String, Group>(); |
| | | Map<String, Group> groupNameMap = new Map<String, Group>(); |
| | | for (String accShareName : accShareNameSet) { |
| | | insertGroup.put(accShareName, new Group( |
| | | Name = accShareName |
| | | )); |
| | | insertGroup.put(accShareName, new Group(Name = accShareName)); |
| | | } |
| | | |
| | | // Check 有没有 Group |
| | | for (Group grp : [SELECT Id, Name FROM Group WHERE Type = 'Regular' AND Name IN: accShareNameSet]) { |
| | | for (Group grp : [ |
| | | SELECT Id, Name |
| | | FROM Group |
| | | WHERE Type = 'Regular' AND Name IN :accShareNameSet |
| | | ]) { |
| | | // 已经有Group 的话 不用 insert |
| | | insertGroup.remove(grp.Name); |
| | | groupNameMap.put(grp.Name, grp); |
| | |
| | | // 赋 Account 共享权限 |
| | | List<AccountShare> insertShareList = new List<AccountShare>(); |
| | | for (String accShareName : accShareNameSet) { |
| | | insertShareList.add(new AccountShare( |
| | | insertShareList.add( |
| | | new AccountShare( |
| | | UserOrGroupId = groupNameMap.get(accShareName).Id, |
| | | AccountId = insertAccountMap.get(accShareName).Id, |
| | | AccountAccessLevel = 'Edit', |
| | | OpportunityAccessLevel = 'None' |
| | | )); |
| | | ) |
| | | ); |
| | | } |
| | | insert insertShareList; |
| | | // Update Asset.AccountId |
| | |
| | | } |
| | | |
| | | private static void updateAssetAccount(Map<String, Account> accShareNameAccountMap, Datetime execNow) { |
| | | if (accShareNameAccountMap.isEmpty()) { return; } |
| | | if (accShareNameAccountMap.isEmpty()) { |
| | | return; |
| | | } |
| | | Set<String> accShareNameSet = accShareNameAccountMap.keySet(); |
| | | |
| | | List<Asset> updAssetAccount = new List<Asset>(); |
| | | for (Asset nObj : [SELECT Id, OlympusAccShareName__c, AccountId |
| | | for (Asset nObj : [ |
| | | SELECT Id, OlympusAccShareName__c, AccountId |
| | | FROM Asset |
| | | WHERE OlympusAccShareSameFlag__c = '0' |
| | | AND OlympusAccShareName__c IN: accShareNameSet |
| | | AND LastModifiedDate >=: execNow]) { |
| | | WHERE OlympusAccShareSameFlag__c = '0' AND OlympusAccShareName__c IN :accShareNameSet AND LastModifiedDate >= :execNow |
| | | ]) { |
| | | nObj.AccountId = accShareNameAccountMap.get(nObj.OlympusAccShareName__c).Id; |
| | | updAssetAccount.add(nObj); |
| | | } |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>35.0</apiVersion> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | global without sharing class Batch_FixAttachmentToFiles implements Database.Batchable<sObject> { |
| | | // Id batchJobId = Database.executeBatch(new Batch_FixAttachmentToFiles('Consumable_order__c',Datetime.newInstance(2023, 1, 1, 8, 0, 0),Datetime.newInstance(2024, 1, 1, 8, 0, 0)),2000); |
| | | private Datetime creStartDate = null; |
| | | private Datetime creEndDate = null; |
| | | private String objectApiName = null; |
| | | private Set<String> parentIds = new Set<String>(); //Add by Li Jun 20230703 |
| | | public Batch_FixAttachmentToFiles(String objectType, Datetime startTime, Datetime endTime) { |
| | | creStartDate = startTime; |
| | | creEndDate = endTime; |
| | | objectApiName = objectType; |
| | | } |
| | | //Add by Li Jun 20230703 Start |
| | | public Batch_FixAttachmentToFiles(Set<String> parentIds) { |
| | | this.parentIds = parentIds; |
| | | } |
| | | //Add by Li Jun 20230703 End |
| | | global Database.QueryLocator start(Database.BatchableContext BC) { |
| | | String queryObject = 'SELECT Id, Name, OwnerId, ParentId, Parent.Name, Parent.Type, Body, CreatedDate, CreatedById FROM Attachment WHERE Parent.Type =:objectApiName AND CreatedDate >=:creStartDate AND CreatedDate <:creEndDate Order by CreatedDate ASC'; |
| | | if (parentIds.size() > 0) { |
| | | queryObject = 'SELECT Id, Name, OwnerId, ParentId, Parent.Name, Parent.Type, Body, CreatedDate, CreatedById FROM Attachment WHERE ParentId in:parentIds'; |
| | | } |
| | | return Database.getQueryLocator(queryObject); |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, List<Attachment> scope) { |
| | | List<ContentVersion> insertContents = new List<ContentVersion>(); |
| | | Map<string, id> nameParentMaps = new Map<string, id>(); |
| | | Set<String> attachmentIds = new Set<String>(); |
| | | for (Attachment att : scope) { |
| | | nameParentMaps.put(att.Name, att.ParentId); |
| | | attachmentIds.add(att.Id); |
| | | ContentVersion cVersion = new ContentVersion(); |
| | | cVersion.ContentLocation = 'S'; //S-Document is in Salesforce. E-Document is outside of Salesforce. L-Document is on a Social Netork. |
| | | cVersion.PathOnClient = att.Name; //File name with extention |
| | | cVersion.Origin = 'C'; //C-Content Origin. H-Chatter Origin. |
| | | cVersion.Title = att.Name; //Name of the file |
| | | cVersion.VersionData = att.Body; //File content |
| | | insertContents.add(cVersion); |
| | | } |
| | | if (insertContents.isEmpty()) { |
| | | return; |
| | | } |
| | | //Insert insertContents; |
| | | List<Database.SaveResult> saveResultsContents = Database.insert(insertContents, false); |
| | | insertLog(saveResultsContents, attachmentIds); |
| | | set<Id> contentIds = new Set<Id>(); |
| | | for (ContentVersion cv : insertContents) { |
| | | contentIds.add(cv.id); |
| | | } |
| | | List<ContentVersion> conDocuments = [ |
| | | SELECT ContentDocumentId, Title |
| | | FROM ContentVersion |
| | | WHERE Id IN :contentIds |
| | | ]; |
| | | List<ContentDocumentLink> insertDocLinks = new List<ContentDocumentLink>(); |
| | | for (ContentVersion cv : conDocuments) { |
| | | ContentDocumentLink cDocLink = new ContentDocumentLink(); |
| | | cDocLink.ContentDocumentId = cv.ContentDocumentId; //Add ContentDocumentId |
| | | cDocLink.LinkedEntityId = nameParentMaps.get(cv.Title); //Add attachment parentId |
| | | cDocLink.ShareType = 'V'; //V - Viewer permission. C - Collaborator permission. I - Inferred permission. |
| | | cDocLink.Visibility = 'AllUsers'; |
| | | insertDocLinks.add(cDocLink); |
| | | } |
| | | //Insert insertDocLinks; |
| | | List<Database.SaveResult> saveResultsLinks = Database.insert(insertDocLinks, false); |
| | | insertLog(saveResultsLinks, attachmentIds); |
| | | } |
| | | |
| | | global void insertLog(List<Database.SaveResult> saveResults, Set<String> attachmentIds) { |
| | | Transaction_Log__c traLog = new Transaction_Log__c(); |
| | | List<Map<String, String>> logMapList = new List<Map<String, String>>(); |
| | | for (Database.SaveResult result : saveResults) { |
| | | String recordId = result.getId(); |
| | | if (!result.isSuccess()) { |
| | | for (Database.Error error : result.getErrors()) { |
| | | Map<String, String> logMap = new Map<String, String>(); |
| | | String errorMsg = error.getMessage(); |
| | | logMap.put('recordId', recordId); |
| | | logMap.put('errorMsg', errorMsg); |
| | | logMapList.add(logMap); |
| | | } |
| | | } |
| | | } |
| | | if (logMapList.size() > 0) { |
| | | Map<String, String> attachmentIdMap = new Map<String, String>(); |
| | | attachmentIdMap.put('attachmentIds', JSON.serialize(attachmentIds)); |
| | | logMapList.add(attachmentIdMap); |
| | | traLog.Response__c = JSON.serialize(logMapList); |
| | | traLog.Module__c = 'Attachment COnvert Transaction '; |
| | | insert traLog; |
| | | } |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>57.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest(SeeAllData=true) |
| | | private class Batch_FixAttachmentToFilesTest { |
| | | @isTest(SeeAllData=true) |
| | | static void testInit() { |
| | | String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId(); |
| | | Account accountItem1 = new Account(Name = 'Testaccount001', RecordTypeId = rectCo); |
| | | insert accountItem1; |
| | | |
| | | Consumable_order__c consOrder = new Consumable_order__c(); |
| | | consOrder.Name = 'test01'; |
| | | consOrder.Order_status__c = '批准'; |
| | | consOrder.Deliver_date__c = Date.today(); |
| | | consOrder.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | consOrder.Order_type__c = '订单'; |
| | | consOrder.Order_ProType__c = 'ENG'; |
| | | consOrder.Dealer_Info__c = accountItem1.Id; |
| | | consOrder.Delivery_detail_count__c = 5; |
| | | insert consOrder; |
| | | |
| | | List<Attachment> attachList = new List<Attachment>(); |
| | | Attachment attach = new Attachment(); |
| | | attach.Name = 'A-65224941-20200923--1.docx'; |
| | | Blob bodyBlob = Blob.valueOf('Unit Test Attachment Body'); |
| | | attach.body = bodyBlob; |
| | | attach.ParentId = consOrder.Id; |
| | | attachList.add(attach); |
| | | insert attachList; |
| | | |
| | | Set<String> Id = new Set<String>(); |
| | | String objectType; |
| | | Datetime creStartDate; |
| | | Datetime creEndDate; |
| | | |
| | | List<Attachment> attachmentList = [ |
| | | SELECT Id, Name, OwnerId, ParentId, Parent.Name, Parent.Type, Body, CreatedDate, CreatedById |
| | | FROM Attachment |
| | | WHERE Id = :attachList[0].Id |
| | | ORDER BY CreatedDate ASC |
| | | LIMIT 1 |
| | | ]; |
| | | for (Attachment att : attachmentList) { |
| | | Id.add(att.ParentId); |
| | | objectType = att.Parent.Name; |
| | | creStartDate = att.CreatedDate; |
| | | creEndDate = att.CreatedDate.addDays(1); |
| | | } |
| | | System.Test.startTest(); |
| | | Database.executeBatch(new Batch_FixAttachmentToFiles(objectType, creStartDate, creEndDate), 1); |
| | | Database.executeBatch(new Batch_FixAttachmentToFiles(Id), 1); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>57.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | this.oldList = (List < Contact > ) Trigger.old; |
| | | } |
| | | protected override void beforeInsert() { |
| | | if(Test.isRunningTest()||UserInfo.getUserId()!=System.Label.ByPassTrigger){ //Add by Li Jun for PIPL 20220331 |
| | | if (Test.isRunningTest() || UserInfo.getUserId() != System.Label.ByPassTrigger) { |
| | | //Add by Li Jun for PIPL 20220331 |
| | | mobileNumberVerification(); |
| | | } |
| | | } |
| | |
| | | mobileNumberVerification(); |
| | | } |
| | | |
| | | |
| | | protected override void afterDelete() { |
| | | syncToAgencyContactDelete(); |
| | | updateDealerNum(); |
| | |
| | | private void UpdateProcessingWork() { |
| | | for (Contact temContact: newList) { |
| | | if (System.label.UpdateServiceHistory.equals('true')) { |
| | | |
| | | string ProcessingWork = ''; |
| | | string ProcessingWorkWithoutNumber = ''; |
| | | if (temContact.ServiceBookInput__c != 0) { |
| | | ProcessingWork += '维修委托书填写' + temContact.ServiceBookInput__c + '次'; |
| | | ProcessingWorkWithoutNumber += '维修委托书填写'; |
| | | |
| | | } |
| | | if (temContact.InspectTime__c != 0) { |
| | | if (String.isBlank(ProcessingWork)) { |
| | |
| | | } else { |
| | | ProcessingWork += ',点检' + temContact.InspectTime__c + '次'; |
| | | ProcessingWorkWithoutNumber += ',点检'; |
| | | |
| | | } |
| | | } |
| | | if (temContact.InspectEquipmentTime__c != 0) { |
| | |
| | | ProcessingWork += ',点检设备' + temContact.InspectEquipmentTime__c + '个'; |
| | | ProcessingWorkWithoutNumber += ',点检设备'; |
| | | } |
| | | |
| | | } |
| | | if (temContact.VisitTime__c != 0) { |
| | | if (String.isBlank(ProcessingWork)) { |
| | |
| | | ProcessingWork += ',上门' + temContact.VisitTime__c + '次'; |
| | | ProcessingWorkWithoutNumber += ',上门'; |
| | | } |
| | | |
| | | } |
| | | if (temContact.pollingTime__c != 0) { |
| | | if (String.isBlank(ProcessingWork)) { |
| | |
| | | ProcessingWork += ',巡检' + temContact.pollingTime__c + '次'; |
| | | ProcessingWorkWithoutNumber += ',巡检'; |
| | | } |
| | | |
| | | } |
| | | if (temContact.TeachingTime__c != 0) { |
| | | if (String.isBlank(ProcessingWork)) { |
| | |
| | | //} |
| | | temContact.ProcessingWork__c = ProcessingWork; |
| | | temContact.ProcessingWorkWithoutNumber__c = ProcessingWorkWithoutNumber; |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | // 服务技师 2018/12/24 end |
| | | private void syncToAgencyContact() { |
| | |
| | | Map < Id, Agency_Contact__c > targetContactMap = new Map < Id, Agency_Contact__c > (); |
| | | Map < Id, Contact > ContactMap = new Map < Id, Contact > (); |
| | | for (Contact nObj: newList) { |
| | | if (nObj.RecordTypeId == '01210000000QfWdAAK' // Doctor |
| | | && |
| | | if ( |
| | | nObj.RecordTypeId == |
| | | '01210000000QfWdAAK' && // Doctor |
| | | String.isBlank(nObj.Strategic_dept_Class__c) == false |
| | | ) { |
| | | if (Trigger.isInsert || |
| | | (Trigger.isUpdate |
| | | if (Trigger.isInsert || (Trigger.isUpdate)) { |
| | | // && ( |
| | | // oldMap.get(nObj.Id).LastName != nObj.LastName |
| | | // || oldMap.get(nObj.Id).FirstName != nObj.FirstName |
| | |
| | | // || oldMap.get(nObj.Id).Type__c != nObj.Type__c |
| | | // || oldMap.get(nObj.Id).Doctor_Division1__c != nObj.Doctor_Division1__c |
| | | // ) |
| | | ) |
| | | ) { |
| | | //Agency_Contact__c acObj = new Agency_Contact__c(Agency_ID__c = '000000000000000', Contact__c = nObj.Id, ContactId18__c = nObj.Id, Agency_Hospital__c = null, Name = nObj.LastName + ((String.isBlank(nObj.FirstName) == false) ? ' ' + nObj.FirstName : ''), Department_Class__c = nObj.Strategic_dept_Class__c, Type__c = nObj.Type__c, Doctor_Division1__c = nObj.Doctor_Division1__c); |
| | | //zhj MEBG新方案改造 2022-11-27 去掉Encrypted start |
| | | Agency_Contact__c acObj = new Agency_Contact__c( |
| | |
| | | cIdList.add(oObj.Id); |
| | | } |
| | | if (cIdList.size() > 0) { |
| | | List < Agency_Contact__c > acList = [Select Id From Agency_Contact__c |
| | | Where Contact__c =: null and Agency_ID__c = '000000000000000' |
| | | List<Agency_Contact__c> acList = [ |
| | | SELECT Id |
| | | FROM Agency_Contact__c |
| | | WHERE Contact__c = :null AND Agency_ID__c = '000000000000000' |
| | | ]; |
| | | if (acList.size() > 0) { |
| | | delete acList; |
| | |
| | | Map < Id, Account > acMap = new Map < Id, Account > (); |
| | | if (Trigger.isUpdate) { |
| | | for (Contact contactnew: newList) { |
| | | if (contactnew.Agency_User__c != oldMap.get(contactnew.Id).Agency_User__c || (System.Label.onlyUpdate == '1' && UserInfo.getUserId() == '00510000005sEEMAA2')) { |
| | | if ( |
| | | contactnew.Agency_User__c != oldMap.get(contactnew.Id).Agency_User__c || |
| | | (System.Label.onlyUpdate == '1' && |
| | | UserInfo.getUserId() == '00510000005sEEMAA2') |
| | | ) { |
| | | accountSet.add(contactnew.AccountId); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | if (Trigger.isDelete) { |
| | | for (Contact contactold: oldList) { |
| | | if (contactold.Agency_User__c) { |
| | |
| | | } |
| | | |
| | | if (accountSet.size() > 0) { |
| | | List < AggregateResult > contactList = [select count(id) ctn, AccountId accid from Contact where Agency_User__c = true and AccountId =: accountSet and RecordTypeId = '01210000000QfWi' |
| | | group by AccountId |
| | | List<AggregateResult> contactList = [ |
| | | SELECT count(id) ctn, AccountId accid |
| | | FROM Contact |
| | | WHERE Agency_User__c = TRUE AND AccountId = :accountSet AND RecordTypeId = '01210000000QfWi' |
| | | GROUP BY AccountId |
| | | ]; |
| | | for (AggregateResult ar: contactList) { |
| | | String accid = (String) ar.get('accid'); |
| | |
| | | update acMap.values(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | //更新经销商用户人数字段 精琢技术 pk 2021-08-26 end |
| | | |
| | | //zhj 新方案改造 将手机号去重及其验证规则移动到AWS和前端 start |
| | | // 手机号去重及规则验证 及新增客户人员重名验证 |
| | | public void mobileNumberVerification(){ |
| | | |
| | | // Pattern pattern = Pattern.compile('^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$'); |
| | | Map<String, Map<String,Contact>> accountContactMap = new Map<String, Map<String,Contact>>(); |
| | | Set<Id> accountIdSet = new Set<Id>(); |
| | |
| | | accIdList.add(contact1.AccountId); |
| | | } |
| | | if (accIdList.size()>0){ |
| | | List<Account> accList=[select ID,Is_Active__c,Is_Active_Formula__c from Account where ID in:accIdList]; |
| | | List<Account> accList = [ |
| | | SELECT ID, Is_Active__c, Is_Active_Formula__c |
| | | FROM Account |
| | | WHERE ID IN :accIdList |
| | | ]; |
| | | if(accList.size()>0){ |
| | | for(Account acc:accList){ |
| | | if (String.isNotBlank(acc.Is_Active__c)){ |
| | |
| | | ID AgencyRecordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId(); |
| | | for (Contact contactnew : newList) { |
| | | // 手机号有值并且联系人有效,联系人的客户有效,进行手机号码验证 |
| | | if (('有效'.equals(contactnew.Isactive__c) || '有効'.equals(contactnew.Isactive__c)) |
| | | && ('有効'.equals(accMap.get(contactnew.AccountId)) || '有效'.equals(accMap.get(contactnew.AccountId)))) { |
| | | if ( |
| | | ('有效'.equals(contactnew.Isactive__c) || '有効'.equals(contactnew.Isactive__c)) && |
| | | ('有効'.equals(accMap.get(contactnew.AccountId)) || '有效'.equals(accMap.get(contactnew.AccountId))) |
| | | ) { |
| | | // 经销商客户人员不进行手机号校验 thh 20220517 start |
| | | if(AgencyRecordTypeId.equals(contactnew.RecordTypeId)){ |
| | | if(String.isNotBlank(contactnew.MobilePhone)){ |
| | |
| | | if (Trigger.isUpdate) { |
| | | old = oldMap.get(local.Id); |
| | | } |
| | | if (Trigger.isInsert |
| | | || old.LastName != local.LastName |
| | | || old.FirstName != local.FirstName |
| | | || old.Email != local.Email //メール Email |
| | | || old.MobilePhone != local.MobilePhone //手机号码 Mobile_Phone__c |
| | | || old.Employee_No_manual__c != local.Employee_No_manual__c //员工号码 Employee_No__c |
| | | || old.Work_Location_manual__c != local.Work_Location_manual__c //工作地 Work_Location__c |
| | | || old.Post_picklist__c != local.Post_picklist__c //职位 post__c |
| | | || old.Job_Category_picklist__c != local.Job_Category_picklist__c //职种 Job_Category__c |
| | | || old.Hire_date_text__c != local.Hire_date_text__c //入职日 Hire_date__c |
| | | || old.Gender_text__c != local.Gender_text__c //性别 Gender__c |
| | | || old.dept__c != local.dept__c //本部 dept__c |
| | | || old.Pregnant_Rest__c != local.Pregnant_Rest__c // 是否产假 Pregnant_Rest__c |
| | | || old.Stay_or_not__c != local.Stay_or_not__c // 在职/离职 Stay_or_not__c |
| | | if ( |
| | | Trigger.isInsert || |
| | | old.LastName != local.LastName || |
| | | old.FirstName != local.FirstName || |
| | | old.Email != local.Email || //メール Email |
| | | old.MobilePhone != local.MobilePhone || //手机号码 Mobile_Phone__c |
| | | old.Employee_No_manual__c != local.Employee_No_manual__c || //员工号码 Employee_No__c |
| | | old.Work_Location_manual__c != local.Work_Location_manual__c || //工作地 Work_Location__c |
| | | old.Post_picklist__c != local.Post_picklist__c || //职位 post__c |
| | | old.Job_Category_picklist__c != local.Job_Category_picklist__c || //职种 Job_Category__c |
| | | old.Hire_date_text__c != local.Hire_date_text__c || //入职日 Hire_date__c |
| | | old.Gender_text__c != local.Gender_text__c || //性别 Gender__c |
| | | old.dept__c != local.dept__c || //本部 dept__c |
| | | old.Pregnant_Rest__c != local.Pregnant_Rest__c || // 是否产假 Pregnant_Rest__c |
| | | old.Stay_or_not__c != local.Stay_or_not__c || // 在职/离职 Stay_or_not__c |
| | | //|| old.Salesdepartment_Text__c != local.Salesdepartment_Text__c // 销售本部 Salesdepartment__c |
| | | || old.AccountId != local.AccountId//客户人员换客户 |
| | | || old.Isactive__c != local.Isactive__c//状态变更 |
| | | || old.ServicePlatformCode__c != local.ServicePlatformCode__c//服务平台编码 |
| | | || old.UnifiedI_Contact_ID__c != local.UnifiedI_Contact_ID__c//智慧医疗编码 |
| | | || old.ContactType__c != local.ContactType__c//人员类型 |
| | | || (old.ChargeState__c != local.ChargeState__c && local.RecordTypeId == AgencyId)//负责省 // 20220830 ljh LLIU-CHR8FF add |
| | | old.AccountId != local.AccountId || //客户人员换客户 |
| | | old.Isactive__c != local.Isactive__c || //状态变更 |
| | | old.ServicePlatformCode__c != local.ServicePlatformCode__c || //服务平台编码 |
| | | old.UnifiedI_Contact_ID__c != local.UnifiedI_Contact_ID__c || //智慧医疗编码 |
| | | old.ContactType__c != local.ContactType__c || //人员类型 |
| | | (old.ChargeState__c != local.ChargeState__c && |
| | | local.RecordTypeId == AgencyId) //负责省 // 20220830 ljh LLIU-CHR8FF add |
| | | ) { |
| | | //获取客户人员的记录类型ID thh 20220330 start |
| | | ID InternalStaffRecordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Internal_staff').getRecordTypeId(); |
| | | ID InternalStaffRecordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName() |
| | | .get('Internal_staff') |
| | | .getRecordTypeId(); |
| | | ID DoctorRecordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Doctor').getRecordTypeId(); |
| | | ID AgencyRecordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId(); |
| | | //获取客户人员的记录类型ID thh 20220330 end |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | //606标记 |
| | |
| | | //添加future 判断 add for pipl sushanhu 20220317 start |
| | | // if (!(System.isFuture()||System.isBatch())) { |
| | | NFM606Controller.callout('', contactIdList); |
| | | |
| | | // } else{ |
| | | // NFM606Controller.executeNotFuture('', contactIdList); |
| | | // } |
| | |
| | | } |
| | | } |
| | | // 20220830 ljh LLIU-CHR8FF add end |
| | | |
| | | |
| | | } |
| | |
| | | public with sharing class DealerInquiryModifyStateController { |
| | | public List<OpportunityInfo> oppRecords { get; set; } |
| | | // ページレイアウトの情報を取得 |
| | | private Map<String, Map<String, String>> editLayoutItemRWMap = New Map<String, Map<String, String>>(); |
| | | private Map<String, Map<String, String>> editLayoutItemRWMap = new Map<String, Map<String, String>>(); |
| | | // private Map<String, Map<String, String>> editLayoutItemRWMapRt = null; |
| | | public List<OpportunityInfo> OPPORTList { get; set; } |
| | | /*****************検索用******************/ |
| | |
| | | public String preSortKey { get; set; } |
| | | public Boolean sortOrderAsc { get; set; } |
| | | public String[] sortOrder { get; set; } |
| | | public String[] columus = new String[] {'Id'}; |
| | | public String[] columus = new List<String>{ 'Id' }; |
| | | public String[] selColumus = null; |
| | | public Set<String> columusSet = new Set<String> {'Id'}; |
| | | |
| | |
| | | private String strColumus; |
| | | private String strRtColumus; |
| | | |
| | | @TestVisible private String accTypeForSort = null; |
| | | //add by Link 2023-6-2 |
| | | public String remindMsg { get; set; } |
| | | |
| | | @TestVisible |
| | | private String accTypeForSort = null; |
| | | private static Integer oppLimit = 500; |
| | | |
| | | public DealerInquiryModifyStateController() { |
| | |
| | | } |
| | | |
| | | public PageReference init() { |
| | | remindMsg = ''; |
| | | PartnerSoapSforceCom.Soap soap = new PartnerSoapSforceCom.Soap(); |
| | | soap.SessionHeader = new PartnerSoapSforceCom.SessionHeader_element(); |
| | | soap.SessionHeader.sessionId = UserInfo.getSessionId(); |
| | |
| | | for (PartnerSoapSforceCom.DescribeLayoutSection section : layout.editLayoutSections) { |
| | | for (PartnerSoapSforceCom.DescribeLayoutRow row : section.layoutRows) { |
| | | for (PartnerSoapSforceCom.DescribeLayoutItem item : row.layoutItems) { |
| | | if (item.layoutComponents != null && item.layoutComponents.size() > 0 |
| | | && String.isBlank(item.layoutComponents[0].value) == false) { |
| | | if ( |
| | | item.layoutComponents != null && |
| | | item.layoutComponents.size() > 0 && |
| | | String.isBlank(item.layoutComponents[0].value) == false |
| | | ) { |
| | | rtnInner.put(item.layoutComponents[0].value, 'r'); |
| | | if (item.editableForUpdate) { |
| | | rtnInner.put(item.layoutComponents[0].value, 'w'); |
| | |
| | | return null; |
| | | } |
| | | //用于获取经销商询价字段集和询价字段集以及相应的读写权限 |
| | | @TestVisible private void setLayoutRWInfo() { |
| | | @TestVisible |
| | | private void setLayoutRWInfo() { |
| | | if (this.sortOrder == null) { |
| | | selColumus = new String[] {}; |
| | | selColumus = new List<String>{}; |
| | | strColumus = ''; |
| | | ID accRecordTypeId = accTypeForSort; |
| | | |
| | |
| | | strRtColumus = strRtColumus + ',' + s; |
| | | } |
| | | columnRightCss.add(s.replace('.', '_')); |
| | | |
| | | } |
| | | strColumus = String.join(columus, ','); |
| | | System.debug('======-======-======strColumus' + strColumus); |
| | | System.debug('======-======-======strRtColumus' + strRtColumus); |
| | | this.sortOrderAsc = true; |
| | | this.sortOrder = new String[selColumus.size()]; |
| | | for (Integer i = 0; i < selColumus.size(); i++) this.sortOrder[i] = ' '; |
| | | this.sortOrder = new List<String>(selColumus.size()); |
| | | for (Integer i = 0; i < selColumus.size(); i++) |
| | | this.sortOrder[i] = ' '; |
| | | } |
| | | } |
| | | //用于拼接SOQL语句 根据不同检索条件拼接不同SOQL语句。 |
| | |
| | | // System.debug('pppqqq333'+querySoql); |
| | | // AND Ownerid in ( '+querySoql+')' |
| | | |
| | | String soql = 'SELECT Change_To_Opportunity__r.Id , Agency_Hospital__r.Name , Product_Category1__r.Name , Product_Category2__r.Name , Product_Category3__r.Name , Agency_Person__r.Name , Agency__r.Name , Change_To_Opportunity__r.Name ,' + |
| | | strColumus + ',' + strRtColumus + |
| | | String soql = |
| | | 'SELECT Change_To_Opportunity__r.Id , Agency_Hospital__r.Name , Product_Category1__r.Name , Product_Category2__r.Name , Product_Category3__r.Name , Agency_Person__r.Name , Agency__r.Name , Change_To_Opportunity__r.Name ,' + |
| | | strColumus + |
| | | ',' + |
| | | strRtColumus + |
| | | ' FROM Agency_Opportunity__c WHERE recordType.DeveloperName = \'Opportunity\' '; |
| | | //数据字段:经销商医院 +SOQL |
| | | if (!String.isBlank(accSearch)) { |
| | |
| | | soql += ' order by LastModifiedDate desc limit ' + Integer.valueOf(limits); |
| | | } else { |
| | | if (Integer.valueOf(this.sortKey) <= titleLeft.size() + 7) { |
| | | soql += ' order by ' + this.selColumus[Integer.valueOf(this.sortKey)] + ' ' + (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last') + ' limit ' + Integer.valueOf(limits); |
| | | soql += |
| | | ' order by ' + |
| | | this.selColumus[Integer.valueOf(this.sortKey)] + |
| | | ' ' + |
| | | (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last') + |
| | | ' limit ' + |
| | | Integer.valueOf(limits); |
| | | } else { |
| | | soql += ' order by Change_To_Opportunity__r.' + this.selColumus[Integer.valueOf(this.sortKey)] + ' ' + (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last') + ' limit ' + Integer.valueOf(limits); |
| | | soql += |
| | | ' order by Change_To_Opportunity__r.' + |
| | | this.selColumus[Integer.valueOf(this.sortKey)] + |
| | | ' ' + |
| | | (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last') + |
| | | ' limit ' + |
| | | Integer.valueOf(limits); |
| | | } |
| | | } |
| | | system.debug(soql); |
| | |
| | | str = '\'' + agc.Change_To_Opportunity__r.Id + '\''; |
| | | } else if (agc.Change_To_Opportunity__r.Id != null) { |
| | | str += ',\'' + agc.Change_To_Opportunity__r.Id + '\''; |
| | | |
| | | } |
| | | } |
| | | for (Agency_Opportunity__c info : InfoList) { |
| | |
| | | //显示提示操作信息 |
| | | if (String.isBlank(this.saveType) && String.isBlank(this.sortKey)) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '取得最近的 ' + oppCount + ' 条数据')); |
| | | //add by Link 2023-6-2 |
| | | remindMsg = '取得最近的 ' + oppCount + ' 条数据'; |
| | | } else if (!String.isBlank(this.sortKey)) { |
| | | if (oppCount > oppLimit) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '数据超过' + oppLimit + '件,只显示前' + oppLimit + '件')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.INFO, '数据超过' + oppLimit + '件,只显示前' + oppLimit + '件') |
| | | ); |
| | | //add by Link 2023-6-2 |
| | | remindMsg = '数据超过' + oppLimit + '件,只显示前' + oppLimit + '件'; |
| | | } else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '共有 ' + oppCount + ' 条数据')); |
| | | //add by Link 2023-6-2 |
| | | remindMsg = '共有 ' + oppCount + ' 条数据'; |
| | | } |
| | | } else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '共有 ' + oppCount + ' 条数据')); |
| | | //add by Link 2023-6-2 |
| | | remindMsg = '共有 ' + oppCount + ' 条数据'; |
| | | } |
| | | } |
| | | //检索条件:数据字段1,数据字段2,数据字段3均满足进入此方法 判断多种情况 |
| | |
| | | String cSql = ''; |
| | | soql += ' AND ('; |
| | | for (Integer icount = 0; icount < vals.size(); icount++) { |
| | | |
| | | //精琢科技 zxk 2021-08-25 start |
| | | String val = vals[icount]; |
| | | if (equalOpts == 'contains') { |
| | |
| | | soql += ' AND '; |
| | | } |
| | | } |
| | | |
| | | } |
| | | //精琢科技 zxk 2021-08-25 end |
| | | |
| | | |
| | | // String val = vals[icount]; |
| | | // cSql = this.makeTextSqlStr(textOpts, equalOpts, val); |
| | |
| | | else if (equalOpts == '=' || equalOpts == '<>') { |
| | | soql += 'AND ' + textOpts + equalOpts + '\'' + numtext + '\''; |
| | | } |
| | | |
| | | //精琢科技 zxk 2021-08-25 start |
| | | //起始字符 |
| | | else if (equalOpts == 'starts with' && numtext.contains(' ')) { |
| | |
| | | soql += ' ' + textOpts + ' LIKE \'%' + val + '%\'' ; |
| | | if (icount < vals.size() - 1) { |
| | | soql += ' OR '; |
| | | |
| | | } |
| | | } |
| | | } |
| | | soql += ')'; |
| | | |
| | | } |
| | | //精琢科技 zxk 2021-08-25 end |
| | | |
| | |
| | | return soql; |
| | | } |
| | | //检索条件:数据字段1,数据字段2,数据字段3均满足,并且进入makeTextSql()之后,内含数据字段包含多种时进入此方法。 |
| | | @TestVisible private String makeTextSqlStr(String textOpts, String equalOpts, String val) { |
| | | @TestVisible |
| | | private String makeTextSqlStr(String textOpts, String equalOpts, String val) { |
| | | String soql = ''; |
| | | if (!String.isBlank(textOpts)) { |
| | | String tmpVal = val; |
| | |
| | | if (oi.changeFlg == '1') { |
| | | oi.changeFlg = '0'; |
| | | updTarget.add(oi.AgcOpp); |
| | | |
| | | } |
| | | // if (oi.changeFlgRt == '1' && oi.opp.id != null) { |
| | | // oi.changeFlgRt = '0'; |
| | |
| | | // update updOpps; |
| | | // } |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '保存完了')); |
| | | //add by Link 2023-6-2 |
| | | remindMsg = '保存完了'; |
| | | } catch (Exception e) { |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '请确定科室分类和产品区分的关系')); |
| | | } |
| | |
| | | @isTest |
| | | private class DealerInquiryModifyStateControllerTest { |
| | | @TestSetup static void init() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | @TestSetup |
| | | static void init() { |
| | | List<RecordType> rectCo = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院' |
| | | ]; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 消化科']; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '診療科 消化科' |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | |
| | | opp.Name = 'GZ-SP-NFM007_1'; |
| | | opp.Trade__c = '内貿'; |
| | | opp.StageName = '引合'; |
| | | opp.CloseDate = date.newinstance(2022, 11, 30); |
| | | opp.CloseDate = Date.today(); |
| | | opp.Stock_apply_status__c = '申请中'; |
| | | insert opp; |
| | | Test.startTest(); |
| | |
| | | contact1.LastName = 'test1医院'; |
| | | contact1.Agency_User__c = true; |
| | | insert contact1; |
| | | List<Contact> contactlist = [select Id, FirstName |
| | | from Contact |
| | | List<Contact> contactlist = [ |
| | | SELECT Id, FirstName |
| | | FROM Contact |
| | | ]; |
| | | |
| | | System.assertEquals('責任者', contactlist[0].FirstName); |
| | | |
| | | |
| | | |
| | | // |
| | | User user = new User(); |
| | | Profile p = [select Id from Profile where Name = '901_经销商活动系统']; |
| | | Profile p = [SELECT Id FROM Profile WHERE Name = '901_经销商活动系统']; |
| | | user.ProfileId = p.Id; |
| | | user.ContactId = contact1.Id; |
| | | user.FirstName = 'ユーザー'; |
| | |
| | | user.Alias = 'テユ'; |
| | | user.CommunityNickname = 'テストユーザー'; |
| | | user.SalesManager__c = UserInfo.getUserId(); |
| | | |
| | | System.runAs(new User(Id = UserInfo.getUserId())) { |
| | | insert user; |
| | | List<user> users = [select Id, Name, LastName, FirstName from User where LastName = 'テスト']; |
| | | } |
| | | List<user> users = [ |
| | | SELECT Id, Name, LastName, FirstName |
| | | FROM User |
| | | WHERE LastName = 'テスト' |
| | | ]; |
| | | // |
| | | |
| | | Agency_Hospital_Link__c agency_hospital_link = new Agency_Hospital_Link__c(); |
| | |
| | | //System.assertEquals('テスト',users[0].LastName); |
| | | System.assertEquals('ユーザー', users[0].FirstName ); |
| | | |
| | | Id rtId = [select Id, DeveloperName from RecordType where IsActive = true and SobjectType = 'Agency_Opportunity__c' and DeveloperName = 'Opportunity'].Id; |
| | | Id rtId = [ |
| | | SELECT Id, DeveloperName |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Agency_Opportunity__c' AND DeveloperName = 'Opportunity' |
| | | ] |
| | | .Id; |
| | | // Schema.SobjectType.Agency_Opportunity__c.getRecordTypeInfosByName().get('询价').getRecordTypeId(); |
| | | Agency_opportunity__c agency_opportunity = new Agency_opportunity__c(); |
| | | agency_opportunity.RecordTypeId = rtId; |
| | |
| | | |
| | | insert agency_opportunity; |
| | | Test.stopTest(); |
| | | |
| | | } |
| | | |
| | | static testMethod void myUnitTest_SortKey() { |
| | |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | | System.Test.setCurrentPage(page); |
| | | |
| | | |
| | | // 初始化测试 |
| | | DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController(); |
| | | |
| | | |
| | | controller.init(); |
| | | //System.assertEquals(1, controller.oppRecords.size());验证预期值和结果值正确性 |
| | |
| | | controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-02-09'); |
| | | controller.chick(); |
| | | Test.stopTest(); |
| | | |
| | | } |
| | | static testMethod void myUnitTestTime02() { |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | |
| | | controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-02-09'); |
| | | controller.chick(); |
| | | Test.stopTest(); |
| | | |
| | | } |
| | | static testMethod void myUnitTestTimeSave() { |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | |
| | | esdIdMap.put(esd.rec.Id, esd.isChecked); |
| | | } |
| | | |
| | | String qryString = 'select Combine_Pack__c, Name, Id, DeliveryCompany_SlipNo__c,DeliveryType__c,Distributor_method__c,DeliveryCompany__c,Wh_Staff__c ' |
| | | + 'from FixtureDeliverySlip__c ' |
| | | + 'where Name =\''+ slip.Name +'\' and DeliveryType__c = \'发货\''; |
| | | String qryString = |
| | | 'select Combine_Pack__c, Name, Id, DeliveryCompany_SlipNo__c,DeliveryType__c,Distributor_method__c,DeliveryCompany__c,Wh_Staff__c ' + |
| | | 'from FixtureDeliverySlip__c ' + |
| | | 'where Name =\'' + |
| | | slip.Name + |
| | | '\' and DeliveryType__c = \'发货\''; |
| | | if (String.isNotBlank(slip.Distributor_method__c)) { |
| | | qryString += ' and Distributor_method__c = \''+ slip.Distributor_method__c +'\''; |
| | | } |
| | |
| | | } |
| | | slip = slipList[0]; |
| | | |
| | | List<Rental_Apply_Equipment_Set_Detail__c> eList = [select Rental_Apply__c, Rental_Apply__r.Shippment_ng_num__c, Rental_Apply__r.Pre_inspection_ng_num__c, SerialNumber_F__c, Rental_Apply_Equipment_Set__r.Inspection_not_finish__c, Fixture_Name_F__c, Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name, Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name, Rental_Apply_Equipment_Set__r.Name, Pre_inspection_time__c, StockDown__c, StockDown_time__c, Id, Name, Asset__c, Asset__r.Name, Asset__r.SerialNumber, Asset__r.Product_Serial_No__c, |
| | | Asset__r.Remark__c, Asset__r.ImageAsset__c, Asset__r.ImageSerial__c, Asset__r.ImageAssetUploadedTime__c, Asset__r.ImageSerialUploadedTime__c, |
| | | Loaner_CDS_Info__c, Inspection_result__c, Check_lost_Item__c, Pre_disinfection__c, Water_leacage_check__c, Inspection_result_after__c, Arrival_in_wh__c, |
| | | Asset__r.Pre_Reserve_RAES_Detail__c, Asset__r.Pre_Reserve_RAES_Detail__r.After_Inspection_time__c, |
| | | Inspection_result_after_ng__c, Inspection_result_ng__c, Lost_item_giveup__c, CDS_complete__c, Loaner_accsessary__c |
| | | from Rental_Apply_Equipment_Set_Detail__c |
| | | where (DeliverySlip__c = :slip.Id or Id in :esdIdMap.keySet()) |
| | | and Cancel_Select__c = False and Return_DeliverySlip__c = null |
| | | order by Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name, Rental_Apply_Equipment_Set__r.Name, Rental_Apply_Equipment_Set__c, Name]; |
| | | List<Rental_Apply_Equipment_Set_Detail__c> eList = [ |
| | | SELECT |
| | | Rental_Apply__c, |
| | | Rental_Apply__r.Shippment_ng_num__c, |
| | | Rental_Apply__r.Pre_inspection_ng_num__c, |
| | | SerialNumber_F__c, |
| | | Rental_Apply_Equipment_Set__r.Inspection_not_finish__c, |
| | | Fixture_Name_F__c, |
| | | Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name, |
| | | Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name, |
| | | Rental_Apply_Equipment_Set__r.Name, |
| | | Pre_inspection_time__c, |
| | | StockDown__c, |
| | | StockDown_time__c, |
| | | Id, |
| | | Name, |
| | | Asset__c, |
| | | Asset__r.Name, |
| | | Asset__r.SerialNumber, |
| | | Asset__r.Product_Serial_No__c, |
| | | Asset__r.Remark__c, |
| | | Asset__r.ImageAsset__c, |
| | | Asset__r.ImageSerial__c, |
| | | Asset__r.ImageAssetUploadedTime__c, |
| | | Asset__r.ImageSerialUploadedTime__c, |
| | | Loaner_CDS_Info__c, |
| | | Inspection_result__c, |
| | | Check_lost_Item__c, |
| | | Pre_disinfection__c, |
| | | Water_leacage_check__c, |
| | | Inspection_result_after__c, |
| | | Arrival_in_wh__c, |
| | | Asset__r.Pre_Reserve_RAES_Detail__c, |
| | | Asset__r.Pre_Reserve_RAES_Detail__r.After_Inspection_time__c, |
| | | Inspection_result_after_ng__c, |
| | | Inspection_result_ng__c, |
| | | Lost_item_giveup__c, |
| | | CDS_complete__c, |
| | | Loaner_accsessary__c |
| | | FROM Rental_Apply_Equipment_Set_Detail__c |
| | | WHERE |
| | | (DeliverySlip__c = :slip.Id |
| | | OR Id IN :esdIdMap.keySet()) |
| | | AND Cancel_Select__c = FALSE |
| | | AND Return_DeliverySlip__c = NULL |
| | | ORDER BY |
| | | Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name, |
| | | Rental_Apply_Equipment_Set__r.Name, |
| | | Rental_Apply_Equipment_Set__c, |
| | | Name |
| | | ]; |
| | | |
| | | esdList.clear(); |
| | | for (Rental_Apply_Equipment_Set_Detail__c esd : eList) { |
| | |
| | | List<String> ids = ApplyId.split(','); |
| | | Set<String> checkedIds = new Set<String>(CheckedId.split(':')); |
| | | CheckedId = null; |
| | | List<Rental_Apply_Equipment_Set__c> esList = [select Rental_Apply__r.Name, First_RAESD_Model_No_F__c, First_RAESD__r.SerialNumber_F__c, First_RAESD__r.Loaner_asset_no__c, Rental_Apply__c, Id, RAES_Status__c, Name, Shippment_loaner_time2__c |
| | | from Rental_Apply_Equipment_Set__c |
| | | where (Rental_Apply__r.Name in :ids or Id in :ids) |
| | | AND Cancel_Select__c = False |
| | | order by Rental_Apply__r.Name, Id]; |
| | | List<Rental_Apply_Equipment_Set__c> esList = [ |
| | | SELECT |
| | | Rental_Apply__r.Name, |
| | | First_RAESD_Model_No_F__c, |
| | | First_RAESD__r.SerialNumber_F__c, |
| | | First_RAESD__r.Loaner_asset_no__c, |
| | | Rental_Apply__c, |
| | | Id, |
| | | RAES_Status__c, |
| | | Name, |
| | | Shippment_loaner_time2__c |
| | | FROM Rental_Apply_Equipment_Set__c |
| | | WHERE (Rental_Apply__r.Name IN :ids OR Id IN :ids) AND Cancel_Select__c = FALSE |
| | | ORDER BY Rental_Apply__r.Name, Id |
| | | ]; |
| | | Set<Id> esIds = new Set<Id>(); |
| | | Set<Id> esdIds = new Set<Id>(); |
| | | Set<Id> applySet = new Set<Id>(); |
| | |
| | | esdIds.add(raesd.rec.Id); |
| | | } |
| | | List<Rental_Apply_Equipment_Set_Detail__c> eList = [ |
| | | select Rental_Apply__c, Rental_Apply__r.Shippment_ng_num__c, Rental_Apply__r.Pre_inspection_ng_num__c, SerialNumber_F__c, Rental_Apply_Equipment_Set__r.Inspection_not_finish__c, Fixture_Name_F__c, Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name, Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name, Rental_Apply_Equipment_Set__r.Name, Pre_inspection_time__c, StockDown__c, StockDown_time__c, Id, Name, Asset__c, Asset__r.Name, Asset__r.SerialNumber, Asset__r.Product_Serial_No__c, |
| | | Asset__r.Remark__c, Asset__r.ImageAsset__c, Asset__r.ImageSerial__c, Asset__r.ImageAssetUploadedTime__c, Asset__r.ImageSerialUploadedTime__c, |
| | | Loaner_CDS_Info__c, Inspection_result__c, Check_lost_Item__c, Pre_disinfection__c, Water_leacage_check__c, Inspection_result_after__c, Arrival_in_wh__c, |
| | | Asset__r.Pre_Reserve_RAES_Detail__c, Asset__r.Pre_Reserve_RAES_Detail__r.After_Inspection_time__c, |
| | | Inspection_result_after_ng__c, Inspection_result_ng__c, Lost_item_giveup__c, CDS_complete__c, Loaner_accsessary__c |
| | | from Rental_Apply_Equipment_Set_Detail__c |
| | | where Rental_Apply_Equipment_Set__c in :esIds and DeliverySlip__c = null and Return_DeliverySlip__c = null //and Inspection_result__c <> null and Shipment_request_time2__c <> null |
| | | and Cancel_Select__c = False |
| | | order by Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name, Rental_Apply_Equipment_Set__r.Name, Rental_Apply_Equipment_Set__c, Name |
| | | SELECT |
| | | Rental_Apply__c, |
| | | Rental_Apply__r.Shippment_ng_num__c, |
| | | Rental_Apply__r.Pre_inspection_ng_num__c, |
| | | SerialNumber_F__c, |
| | | Rental_Apply_Equipment_Set__r.Inspection_not_finish__c, |
| | | Fixture_Name_F__c, |
| | | Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name, |
| | | Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name, |
| | | Rental_Apply_Equipment_Set__r.Name, |
| | | Pre_inspection_time__c, |
| | | StockDown__c, |
| | | StockDown_time__c, |
| | | Id, |
| | | Name, |
| | | Asset__c, |
| | | Asset__r.Name, |
| | | Asset__r.SerialNumber, |
| | | Asset__r.Product_Serial_No__c, |
| | | Asset__r.Remark__c, |
| | | Asset__r.ImageAsset__c, |
| | | Asset__r.ImageSerial__c, |
| | | Asset__r.ImageAssetUploadedTime__c, |
| | | Asset__r.ImageSerialUploadedTime__c, |
| | | Loaner_CDS_Info__c, |
| | | Inspection_result__c, |
| | | Check_lost_Item__c, |
| | | Pre_disinfection__c, |
| | | Water_leacage_check__c, |
| | | Inspection_result_after__c, |
| | | Arrival_in_wh__c, |
| | | Asset__r.Pre_Reserve_RAES_Detail__c, |
| | | Asset__r.Pre_Reserve_RAES_Detail__r.After_Inspection_time__c, |
| | | Inspection_result_after_ng__c, |
| | | Inspection_result_ng__c, |
| | | Lost_item_giveup__c, |
| | | CDS_complete__c, |
| | | Loaner_accsessary__c |
| | | FROM Rental_Apply_Equipment_Set_Detail__c |
| | | WHERE |
| | | Rental_Apply_Equipment_Set__c IN :esIds |
| | | AND DeliverySlip__c = NULL |
| | | AND Return_DeliverySlip__c = NULL //and Inspection_result__c <> null and Shipment_request_time2__c <> null |
| | | AND Cancel_Select__c = FALSE |
| | | ORDER BY |
| | | Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name, |
| | | Rental_Apply_Equipment_Set__r.Name, |
| | | Rental_Apply_Equipment_Set__c, |
| | | Name |
| | | ]; |
| | | //esdList.clear(); |
| | | for (Rental_Apply_Equipment_Set_Detail__c esd : eList) { |
| | |
| | | system.debug('==================='+Id); |
| | | // 当前User |
| | | String userid = Userinfo.getUserId(); |
| | | User user = [select Id,Name from User where Id = :userid]; |
| | | User user = [SELECT Id, Name FROM User WHERE Id = :userid]; |
| | | List<Rental_Apply_Equipment_Set__c> esList; |
| | | List<String> ids = Id.split(','); |
| | | esList = [select Rental_Apply__r.Name, First_RAESD_Model_No_F__c, First_RAESD__r.SerialNumber_F__c, First_RAESD__r.Loaner_asset_no__c, Rental_Apply__c, Id, RAES_Status__c, Name, Shippment_loaner_time2__c |
| | | from Rental_Apply_Equipment_Set__c |
| | | where (Rental_Apply__r.Name in :ids or Id in:ids) |
| | | AND Cancel_Select__c = False |
| | | order by Rental_Apply__r.Name, Id]; |
| | | esList = [ |
| | | SELECT |
| | | Rental_Apply__r.Name, |
| | | First_RAESD_Model_No_F__c, |
| | | First_RAESD__r.SerialNumber_F__c, |
| | | First_RAESD__r.Loaner_asset_no__c, |
| | | Rental_Apply__c, |
| | | Id, |
| | | RAES_Status__c, |
| | | Name, |
| | | Shippment_loaner_time2__c |
| | | FROM Rental_Apply_Equipment_Set__c |
| | | WHERE (Rental_Apply__r.Name IN :ids OR Id IN :ids) AND Cancel_Select__c = FALSE |
| | | ORDER BY Rental_Apply__r.Name, Id |
| | | ]; |
| | | // if (Step_status == '追加') { |
| | | |
| | | //} else { |
| | |
| | | // system.debug('All::::'+Rac.repair__c); |
| | | // system.debug('All::::'+Ra_c.RAES_Status__c); |
| | | // 本番暂不上线该功能,启用后不能入库操作感觉不对 |
| | | |
| | | |
| | | } |
| | | |
| | | // 备品set明细 |
| | | List<Rental_Apply_Equipment_Set_Detail__c> eList = [ |
| | | select Rental_Apply__c, Rental_Apply__r.Shippment_ng_num__c, Rental_Apply__r.Pre_inspection_ng_num__c, SerialNumber_F__c, Rental_Apply_Equipment_Set__r.Inspection_not_finish__c, Fixture_Name_F__c, Rental_Apply_Equipment_Set__r.RAES_Status__c, Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name, Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name, Rental_Apply_Equipment_Set__r.Name, Pre_inspection_time__c, StockDown__c, StockDown_time__c, Id, Name, Asset__c, Asset__r.Name, Asset__r.SerialNumber, Asset__r.Product_Serial_No__c, |
| | | Asset__r.Remark__c, Asset__r.ImageAsset__c, Asset__r.ImageSerial__c, Asset__r.ImageAssetUploadedTime__c, Asset__r.ImageSerialUploadedTime__c, |
| | | Loaner_CDS_Info__c, Inspection_result__c, Check_lost_Item__c, Pre_disinfection__c, Water_leacage_check__c, Inspection_result_after__c, Arrival_in_wh__c, |
| | | Asset__r.Pre_Reserve_RAES_Detail__c, Asset__r.Pre_Reserve_RAES_Detail__r.After_Inspection_time__c, |
| | | Inspection_result_after_ng__c, Inspection_result_ng__c, Lost_item_giveup__c, CDS_complete__c, Loaner_accsessary__c |
| | | from Rental_Apply_Equipment_Set_Detail__c |
| | | where Rental_Apply_Equipment_Set__c in :esIds and DeliverySlip__c = null and Return_DeliverySlip__c = null//and Shipment_request_time__c <> null |
| | | and Cancel_Select__c = False |
| | | order by Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name, Rental_Apply_Equipment_Set__r.Name, Rental_Apply_Equipment_Set__c, Name |
| | | SELECT |
| | | Rental_Apply__c, |
| | | Rental_Apply__r.Shippment_ng_num__c, |
| | | Rental_Apply__r.Pre_inspection_ng_num__c, |
| | | SerialNumber_F__c, |
| | | Rental_Apply_Equipment_Set__r.Inspection_not_finish__c, |
| | | Fixture_Name_F__c, |
| | | Rental_Apply_Equipment_Set__r.RAES_Status__c, |
| | | Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name, |
| | | Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name, |
| | | Rental_Apply_Equipment_Set__r.Name, |
| | | Pre_inspection_time__c, |
| | | StockDown__c, |
| | | StockDown_time__c, |
| | | Id, |
| | | Name, |
| | | Asset__c, |
| | | Asset__r.Name, |
| | | Asset__r.SerialNumber, |
| | | Asset__r.Product_Serial_No__c, |
| | | Asset__r.Remark__c, |
| | | Asset__r.ImageAsset__c, |
| | | Asset__r.ImageSerial__c, |
| | | Asset__r.ImageAssetUploadedTime__c, |
| | | Asset__r.ImageSerialUploadedTime__c, |
| | | Loaner_CDS_Info__c, |
| | | Inspection_result__c, |
| | | Check_lost_Item__c, |
| | | Pre_disinfection__c, |
| | | Water_leacage_check__c, |
| | | Inspection_result_after__c, |
| | | Arrival_in_wh__c, |
| | | Asset__r.Pre_Reserve_RAES_Detail__c, |
| | | Asset__r.Pre_Reserve_RAES_Detail__r.After_Inspection_time__c, |
| | | Inspection_result_after_ng__c, |
| | | Inspection_result_ng__c, |
| | | Lost_item_giveup__c, |
| | | CDS_complete__c, |
| | | Loaner_accsessary__c |
| | | FROM Rental_Apply_Equipment_Set_Detail__c |
| | | WHERE |
| | | Rental_Apply_Equipment_Set__c IN :esIds |
| | | AND DeliverySlip__c = NULL |
| | | AND Return_DeliverySlip__c = NULL //and Shipment_request_time__c <> null |
| | | AND Cancel_Select__c = FALSE |
| | | ORDER BY |
| | | Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name, |
| | | Rental_Apply_Equipment_Set__r.Name, |
| | | Rental_Apply_Equipment_Set__c, |
| | | Name |
| | | ]; |
| | | //Set<Id> lockId = new Set<Id>(); |
| | | //for (Rental_Apply_Equipment_Set_Detail__c esd : eList) { |
| | |
| | | for (String raid : allcount.keySet()) { |
| | | if (allcount.get(raid) > shipcount.get(raid).size()) { |
| | | Step_status = '追加'; |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '申请单内存在未勾选的配套,请勾选全部配套或分割申请单!')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.Error, '申请单内存在未勾选的配套,请勾选全部配套或分割申请单!') |
| | | ); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | // 保存按钮 |
| | | public PageReference save() { |
| | | |
| | | List<String> raids = Raid.split(':'); |
| | | //检查是否可以继续 |
| | | List<Rental_Apply__c> RaTarList = [select Id,Name,Campaign__c,Repair__c,next_action__c |
| | | ,QIS_number__r.ReplaceDeliveryDate__c,demo_purpose2__c |
| | | ,Follow_UP_Opp__r.Shipping_Finished_Day_Func__c |
| | | ,Campaign__r.Status |
| | | ,Campaign__r.IF_Approved__c |
| | | ,Campaign__r.Meeting_Approved_No__c // 20220315 ljh obpm备品决裁状态相关修改 |
| | | ,Campaign__r.Approved_Status__c // 20220315 ljh obpm备品决裁状态相关修改 |
| | | ,repair__r.Return_Without_Repair_Date__c |
| | | ,Repair__r.Repair_Final_Inspection_Date__c |
| | | ,Repair__r.Repair_Shipped_Date__c |
| | | from Rental_Apply__c |
| | | where id in :raids];//20210602 ljh update 增加查询Name SFDC-C3LBNL |
| | | List<Rental_Apply__c> RaTarList = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Campaign__c, |
| | | Repair__c, |
| | | next_action__c, |
| | | QIS_number__r.ReplaceDeliveryDate__c, |
| | | demo_purpose2__c, |
| | | Follow_UP_Opp__r.Shipping_Finished_Day_Func__c, |
| | | Campaign__r.Status, |
| | | Campaign__r.IF_Approved__c, |
| | | Campaign__r.Meeting_Approved_No__c, // 20220315 ljh obpm备品决裁状态相关修改 |
| | | Campaign__r.Approved_Status__c, // 20220315 ljh obpm备品决裁状态相关修改 |
| | | repair__r.Return_Without_Repair_Date__c, |
| | | Repair__r.Repair_Final_Inspection_Date__c, |
| | | AccDealerBlacklist__c, //贸易合规 you |
| | | //,EquipmentGuaranteeFlg__c//贸易合规 you |
| | | Repair__r.Repair_Shipped_Date__c |
| | | FROM Rental_Apply__c |
| | | WHERE id IN :raids |
| | | ]; //20210602 ljh update 增加查询Name SFDC-C3LBNL |
| | | |
| | | // add lc 20220927 SFDC-CJ48VE 备品预计出库日逻辑调整 start |
| | | Map<Id, String> rentalApplyNameMap = new Map<Id, String>(); |
| | | List<Rental_Apply_Equipment_Set__c> RAESRecords = [ |
| | | SELECT Id,Rental_Apply__c,Rental_Apply__r.Name |
| | | FROM Rental_Apply_Equipment_Set__c |
| | | WHERE Rental_Apply__c in :raids |
| | | AND Cancel_Select__c = False |
| | | AND Rental_Start_Date__c <> :Date.today() |
| | | ORDER BY Rental_Apply__c]; |
| | | WHERE Rental_Apply__c IN :raids AND Cancel_Select__c = FALSE AND Rental_Start_Date__c != :Date.today() |
| | | ORDER BY Rental_Apply__c |
| | | ]; |
| | | |
| | | for (Rental_Apply_Equipment_Set__c RAES : RAESRecords) { |
| | | if (rentalApplyNameMap.isEmpty() || !rentalApplyNameMap.containsKey(RAES.Rental_Apply__c)) { |
| | |
| | | String message6 = ''; |
| | | String message7 = '';// 20220315 ljh obpm备品决裁状态相关修改 end |
| | | String message8 = '';//add lc 20220927 SFDC-CJ48VE 备品预计出库日逻辑调整 |
| | | String message9 = ''; //贸易合规 you |
| | | // 要判断决裁状态不能是草稿/驳回/终止申请/取消/删除 |
| | | List<String> statusList = System.Label.StatusProcessState.split(','); |
| | | Map<Id, Rental_Apply__c> RaMap = new Map<Id, Rental_Apply__c>(); |
| | | for (Rental_Apply__c RaTar : RaTarList) { |
| | | // 20230215 ljh DB202301265636 学会取消申请也拦截 start |
| | | // if( RaTar.Campaign__r.Status == '取消'){ |
| | | if( RaTar.Campaign__r.Status == '取消' || RaTar.Campaign__r.Status == '取消申请中'){ |
| | | //贸易合规 you |
| | | // && RaTar.EquipmentGuaranteeFlg__c==false |
| | | if (System.Label.TradeComplianceStatusFlagBP == 'true' && RaTar.AccDealerBlacklist__c == '1') { |
| | | errorFlag = true; |
| | | message9 += RaTar.Name + '、'; |
| | | } else if (RaTar.Campaign__r.Status == '取消' || RaTar.Campaign__r.Status == '取消申请中') { |
| | | // 20230215 ljh DB202301265636 学会取消申请也拦截 end |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '学会已取消,不能继续操作了')); |
| | | // return null; |
| | |
| | | errorFlag = true; |
| | | message1 += RaTar.Name+'、'; |
| | | }else if(RaTar.repair__r.Return_Without_Repair_Date__c!=null&&RaTar.repair__c!=null ){ |
| | | |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '未修理归还日不为空,不能出库')); |
| | | // return null; |
| | | errorFlag = true; |
| | | message2 += RaTar.Name+'、'; |
| | | }else if(RaTar.Repair__r.Repair_Shipped_Date__c!=null){ |
| | | |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '存在RC修理返送日,不能继续了')); |
| | | // return null; |
| | | errorFlag = true; |
| | |
| | | else if(RaTar.demo_purpose2__c=='已购待货' && RaTar.Follow_UP_Opp__r.Shipping_Finished_Day_Func__c!= null){ |
| | | errorFlag = true; |
| | | message4 += RaTar.Name+'、'; |
| | | }else if(RaTar.demo_purpose2__c=='索赔QIS' && RaTar.next_action__c=='无偿更换' && RaTar.QIS_number__r.ReplaceDeliveryDate__c!= null){ |
| | | } else if ( |
| | | RaTar.demo_purpose2__c == '索赔QIS' && |
| | | RaTar.next_action__c == '无偿更换' && |
| | | RaTar.QIS_number__r.ReplaceDeliveryDate__c != null |
| | | ) { |
| | | errorFlag = true; |
| | | message5 += RaTar.Name+'、'; |
| | | } |
| | |
| | | else if(RaTar.Campaign__c!= null && RaTar.Campaign__r.IF_Approved__c && RaTar.Campaign__r.Meeting_Approved_No__c == null) { |
| | | errorFlag = true; |
| | | message6 += RaTar.Name + '、'; |
| | | } |
| | | else if(RaTar.Campaign__c!= null && RaTar.Campaign__r.IF_Approved__c && RaTar.Campaign__r.Meeting_Approved_No__c != null && statusList.contains(RaTar.Campaign__r.Approved_Status__c)) { |
| | | } else if ( |
| | | RaTar.Campaign__c != null && |
| | | RaTar.Campaign__r.IF_Approved__c && |
| | | RaTar.Campaign__r.Meeting_Approved_No__c != null && |
| | | statusList.contains(RaTar.Campaign__r.Approved_Status__c) |
| | | ) { |
| | | errorFlag = true; |
| | | message7 += RaTar.Name + '、'; |
| | | } |
| | |
| | | } |
| | | // add lc 20220927 SFDC-CJ48VE 备品预计出库日逻辑调整 end |
| | | |
| | | if (String.isNotBlank(message9)) { |
| | | message += '单号No.' + message9.removeEnd('、') + System.Label.IFTradeComplianceAlertBP; |
| | | } |
| | | |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error,message)); |
| | | return null; |
| | | } |
| | |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '未选择备品set,不能创建发货单')); |
| | | return null; |
| | | } |
| | | eList = [select Rental_Apply__c, Rental_Apply__r.Shippment_ng_num__c, Rental_Apply__r.Pre_inspection_ng_num__c, Rental_Apply_Equipment_Set__r.Inspection_not_finish__c, Fixture_Name_F__c, Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name, Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name, Rental_Apply_Equipment_Set__r.Name, Pre_inspection_time__c, StockDown__c, StockDown_time__c, Id, Name, Asset__c, Asset__r.Name, Asset__r.SerialNumber, Asset__r.Product_Serial_No__c, |
| | | Asset__r.Remark__c, Asset__r.ImageAsset__c, Asset__r.ImageSerial__c, Asset__r.ImageAssetUploadedTime__c, Asset__r.ImageSerialUploadedTime__c, |
| | | Loaner_CDS_Info__c, Inspection_result__c, Check_lost_Item__c, Pre_disinfection__c, Water_leacage_check__c, Inspection_result_after__c, Arrival_in_wh__c, |
| | | Asset__r.Pre_Reserve_RAES_Detail__c, Asset__r.Pre_Reserve_RAES_Detail__r.After_Inspection_time__c, |
| | | Rental_Apply__r.Request_approval_time__c , Add_Request_approval_time__c ,ApplyToShipmentWorkTime__c, //20220309 ljh SFDC-CC6CLJ phase5上线课题131 提交申请到备品出库时长 |
| | | Inspection_result_after_ng__c, Inspection_result_ng__c, Lost_item_giveup__c, CDS_complete__c, Loaner_accsessary__c,Key_product__c |
| | | from Rental_Apply_Equipment_Set_Detail__c where Id in :eSet for update]; |
| | | eList = [ |
| | | SELECT |
| | | Rental_Apply__c, |
| | | Rental_Apply__r.Shippment_ng_num__c, |
| | | Rental_Apply__r.Pre_inspection_ng_num__c, |
| | | Rental_Apply_Equipment_Set__r.Inspection_not_finish__c, |
| | | Fixture_Name_F__c, |
| | | Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name, |
| | | Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name, |
| | | Rental_Apply_Equipment_Set__r.Name, |
| | | Pre_inspection_time__c, |
| | | StockDown__c, |
| | | StockDown_time__c, |
| | | Id, |
| | | Name, |
| | | Asset__c, |
| | | Asset__r.Name, |
| | | Asset__r.SerialNumber, |
| | | Asset__r.Product_Serial_No__c, |
| | | Asset__r.Remark__c, |
| | | Asset__r.ImageAsset__c, |
| | | Asset__r.ImageSerial__c, |
| | | Asset__r.ImageAssetUploadedTime__c, |
| | | Asset__r.ImageSerialUploadedTime__c, |
| | | Loaner_CDS_Info__c, |
| | | Inspection_result__c, |
| | | Check_lost_Item__c, |
| | | Pre_disinfection__c, |
| | | Water_leacage_check__c, |
| | | Inspection_result_after__c, |
| | | Arrival_in_wh__c, |
| | | Asset__r.Pre_Reserve_RAES_Detail__c, |
| | | Asset__r.Pre_Reserve_RAES_Detail__r.After_Inspection_time__c, |
| | | Rental_Apply__r.Request_approval_time__c, |
| | | Add_Request_approval_time__c, |
| | | ApplyToShipmentWorkTime__c, //20220309 ljh SFDC-CC6CLJ phase5上线课题131 提交申请到备品出库时长 |
| | | Inspection_result_after_ng__c, |
| | | Inspection_result_ng__c, |
| | | Lost_item_giveup__c, |
| | | CDS_complete__c, |
| | | Loaner_accsessary__c, |
| | | Key_product__c |
| | | FROM Rental_Apply_Equipment_Set_Detail__c |
| | | WHERE Id IN :eSet |
| | | FOR UPDATE |
| | | ]; |
| | | Boolean needSaveSet = false; |
| | | Boolean needSaveDetail = false; |
| | | Boolean needDeliverySlip = false; |
| | |
| | | //wangweipeng 是否是重点产品 2021/08/30 end |
| | | astForLock.add(esd.Asset__c); |
| | | // 20220315 ljh SFDC-CC6CLJ phase5上线课题131 提交申请到备品出库时长 start |
| | | Datetime keyDt = esd.Add_Request_approval_time__c != null?esd.Add_Request_approval_time__c:esd.Rental_Apply__r.Request_approval_time__c; |
| | | Datetime keyDt = esd.Add_Request_approval_time__c != null |
| | | ? esd.Add_Request_approval_time__c |
| | | : esd.Rental_Apply__r.Request_approval_time__c; |
| | | List<Rental_Apply_Equipment_Set_Detail__c> tempRaesdL; |
| | | if(approvalMap.containsKey(keyDt)){ |
| | | tempRaesdL = approvalMap.get(keyDt); |
| | |
| | | approvalMap.put(keyDt,tempRaesdL); |
| | | // 20220315 ljh SFDC-CC6CLJ phase5上线课题131 提交申请到备品出库时长 end |
| | | } |
| | | List<Asset> astLock = [select Id |
| | | from Asset |
| | | where id in :astForLock |
| | | for update]; |
| | | List<Asset> astLock = [ |
| | | SELECT Id |
| | | FROM Asset |
| | | WHERE id IN :astForLock |
| | | FOR UPDATE |
| | | ]; |
| | | if (Step_status == '明细') { |
| | | needDeliverySlip = true; |
| | | //if (slip.Id == null) { |
| | |
| | | // slip.Shippment_loaner_time__c = Datetime.now(); |
| | | //} |
| | | if (slip.Id != null) { |
| | | slip = [select Combine_Pack__c, Name, Id, DeliveryCompany_SlipNo__c,DeliveryType__c,Distributor_method__c,DeliveryCompany__c,Wh_Staff__c |
| | | from FixtureDeliverySlip__c |
| | | where Id =:slip.Id for update]; |
| | | slip = [ |
| | | SELECT |
| | | Combine_Pack__c, |
| | | Name, |
| | | Id, |
| | | DeliveryCompany_SlipNo__c, |
| | | DeliveryType__c, |
| | | Distributor_method__c, |
| | | DeliveryCompany__c, |
| | | Wh_Staff__c |
| | | FROM FixtureDeliverySlip__c |
| | | WHERE Id = :slip.Id |
| | | FOR UPDATE |
| | | ]; |
| | | } |
| | | slip.Shippment_loaner_time__c = Datetime.now(); |
| | | needSaveDetail = true; |
| | | } |
| | | List<Rental_Apply__c> raList = [select Id, DeliverySlip__c, Campaign__c |
| | | , Campaign__r.IF_Approved__c // 20220315 ljh obpm备品决裁状态相关修改 |
| | | , Campaign__r.Meeting_Approved_No__r.Name // 20220315 ljh obpm备品决裁状态相关修改 |
| | | , Campaign__r.Approved_Status__c // 20220315 ljh obpm备品决裁状态相关修改 |
| | | from Rental_Apply__c where Id in :raSet]; |
| | | List<Rental_Apply__c> raList = [ |
| | | SELECT |
| | | Id, |
| | | DeliverySlip__c, |
| | | Campaign__c, |
| | | Campaign__r.IF_Approved__c, // 20220315 ljh obpm备品决裁状态相关修改 |
| | | Campaign__r.Meeting_Approved_No__r.Name, // 20220315 ljh obpm备品决裁状态相关修改 |
| | | Campaign__r.Approved_Status__c, // 20220315 ljh obpm备品决裁状态相关修改 |
| | | Hospital__r.TradeComplianceStatus__c, //贸易合规 you |
| | | Outbound_TradeStatus__c //贸易合规 you |
| | | FROM Rental_Apply__c |
| | | WHERE Id IN :raSet |
| | | ]; |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try { |
| | | //if (needSaveSet) ControllerUtil.upRAdEquipmentSet(es); |
| | |
| | | FixtureUtil.withoutUpsertObjects(new List<FixtureDeliverySlip__c>{ slip }); |
| | | //ControllerUtil.updRADeliverySlipDetail(slip); |
| | | // 20220315 ljh SFDC-CC6CLJ phase5上线课题131 提交申请到备品出库时长 start |
| | | map<String,Decimal> ApplyToShipmentMap = new map<String,Decimal>(); |
| | | map<String, Decimal> ApplyToShipmentMap = new Map<String, Decimal>(); |
| | | if(approvalMap.size() > 0 ){ |
| | | // dtList[0] 第一个就是最小时间 |
| | | List<Datetime> dtList = new List<Datetime>(approvalMap.keySet()); |
| | | Date startDateSOQL = date.newinstance(dtList[0].year(), dtList[0].month(), dtList[0].day()); |
| | | List<OlympusCalendar__c> ocList = [SELECT Id, Date__c,IsWorkDay__c |
| | | List<OlympusCalendar__c> ocList = [ |
| | | SELECT Id, Date__c, IsWorkDay__c |
| | | FROM OlympusCalendar__c |
| | | WHERE Date__c >= :startDateSOQL |
| | | AND Date__c <= :Date.today() |
| | | ORDER BY Date__c ASC]; |
| | | WHERE Date__c >= :startDateSOQL AND Date__c <= :Date.today() |
| | | ORDER BY Date__c ASC |
| | | ]; |
| | | Map<Date,String> ocMap = new Map<Date,String>(); |
| | | for(OlympusCalendar__c oc:ocList){ |
| | | String IsWorkDay = oc.IsWorkDay__c.format(); |
| | |
| | | if(ocList[ocList.size() - 1].IsWorkDay__c == 0){ |
| | | for(Integer i = ocList.size() - 1; i >= 0;i--){ |
| | | if(ocList[i].IsWorkDay__c == 1){ |
| | | endTime = Datetime.newInstance(ocList[i].Date__c.addDays(1).year(),ocList[i].Date__c.addDays(1).month(),ocList[i].Date__c.addDays(1).day(),0,0,0); |
| | | endTime = Datetime.newInstance( |
| | | ocList[i].Date__c.addDays(1).year(), |
| | | ocList[i].Date__c.addDays(1).month(), |
| | | ocList[i].Date__c.addDays(1).day(), |
| | | 0, |
| | | 0, |
| | | 0 |
| | | ); |
| | | endDate = ocList[i].Date__c.addDays(1); |
| | | endFlag = true; |
| | | break; |
| | |
| | | //wangweipeng 是否是重点产品 2021/08/30 start |
| | | ra.Is_keyPoint_Product__c = keyPointProduct.get(ra.Id); |
| | | //wangweipeng 是否是重点产品 2021/08/30 start |
| | | |
| | | ra.Outbound_TradeStatus__c = ra.Hospital__r.TradeComplianceStatus__c; //贸易合规 you |
| | | // 20220315 ljh obpm备品决裁状态相关修改 update start |
| | | //20220217 sx add 备品借出申请-决裁控制 No.4 出库成功时,把此时点的决裁编号和决裁状态写到决裁编号(出库)和决裁状态(出库)上 |
| | | // if (!campMap.isEmpty() && campMap.containsKey(ra.Campaign__c) && campMap.get(ra.Campaign__c).IF_Approved__c){ |
| | |
| | | } |
| | | //if (needSaveDetail) ControllerUtil.updRAEquipmentSetDetail(eList); |
| | | if (needSaveDetail) { |
| | | // 备品优化追加 20230518 lc Start |
| | | RentalApplyEquipmentSetDetailHandler.skipUpdateAgain = true; |
| | | // 备品优化追加 20230518 lc End |
| | | FixtureUtil.withoutUpsertObjects(eList); |
| | | FixtureUtil.withoutUpsertObjects(raList); |
| | | } |
| | |
| | | this.isChecked = checked; |
| | | this.hasSended = false; |
| | | |
| | | if (rec.Asset__r.Pre_Reserve_RAES_Detail__c != null && rec.Asset__r.Pre_Reserve_RAES_Detail__r.After_Inspection_time__c != null) { |
| | | if ( |
| | | rec.Asset__r.Pre_Reserve_RAES_Detail__c != null && |
| | | rec.Asset__r.Pre_Reserve_RAES_Detail__r.After_Inspection_time__c != null |
| | | ) { |
| | | this.quickCheck = Datetime.now() < rec.Asset__r.Pre_Reserve_RAES_Detail__r.After_Inspection_time__c + 30 ? true : false; |
| | | } else { |
| | | this.quickCheck = false; |
| | |
| | | |
| | | public class LayoutDescriberHelper { |
| | | public static String urlPrefixToUse {get;set;} |
| | | public static List<String> requiredFieldAPIList{set;get;} |
| | | public static Map<String,String> fieldAPIToLabelMap{set;get;} |
| | | public static List<String> requiredFieldAPIList { get; set; } |
| | | public static Map<String, String> fieldAPIToLabelMap { get; set; } |
| | | public static Set<String> CaseWebFields = new Set<String>{'SuppliedCompany','SuppliedName','SuppliedEmail','SuppliedPhone'}; |
| | | public static Set<String> ConcatenationNameSType = new Set<String>{'Lead','Contact'}; |
| | | public static LayoutWrapper describeSectionWithFieldsWrapper(Id recordTypeId, String objectType,String userMode){ |
| | |
| | | } |
| | | List<LayoutSection> layoutSections = null; |
| | | if(Test.isRunningTest()){ |
| | | layoutSections = (List<LayoutSection>)Json.deserialize('[{"useHeader":true,"name":"Information","layoutFields":[{"isRequired":false,"isPlaceHolder":false,"fieldType":"reference","fieldLabel":"Owner","fieldAPI":"OwnerId","editableField":false,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"string","fieldLabel":"文件名","fieldAPI":"FileName__c","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"picklist","fieldLabel":"Currency","fieldAPI":"CurrencyIsoCode","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"string","fieldLabel":"预览链接","fieldAPI":"ViewLink__c","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":true,"fieldType":"","fieldLabel":"","fieldAPI":"","editableField":false,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"string","fieldLabel":"下载链接","fieldAPI":"DownloadLink__c","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":true,"fieldType":"","fieldLabel":"","fieldAPI":"","editableField":false,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"string","fieldLabel":"父级目录","fieldAPI":"ParentRecordId__c","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":true,"fieldType":"","fieldLabel":"","fieldAPI":"","editableField":false,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"string","fieldLabel":"AWS File Key","fieldAPI":"AWS_File_Key__c","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":true,"fieldType":"","fieldLabel":"","fieldAPI":"","editableField":false,"defaultValue":null}],"columns":2,"allowCollapse":false}]', List<LayoutSection>.class); |
| | | layoutSections = (List<LayoutSection>) Json.deserialize( |
| | | '[{"useHeader":true,"name":"Information","layoutFields":[{"isRequired":false,"isPlaceHolder":false,"fieldType":"reference","fieldLabel":"Owner","fieldAPI":"OwnerId","editableField":false,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"string","fieldLabel":"文件名","fieldAPI":"FileName__c","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"picklist","fieldLabel":"Currency","fieldAPI":"CurrencyIsoCode","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"string","fieldLabel":"预览链接","fieldAPI":"ViewLink__c","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":true,"fieldType":"","fieldLabel":"","fieldAPI":"","editableField":false,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"string","fieldLabel":"下载链接","fieldAPI":"DownloadLink__c","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":true,"fieldType":"","fieldLabel":"","fieldAPI":"","editableField":false,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"string","fieldLabel":"父级目录","fieldAPI":"ParentRecordId__c","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":true,"fieldType":"","fieldLabel":"","fieldAPI":"","editableField":false,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"string","fieldLabel":"AWS File Key","fieldAPI":"AWS_File_Key__c","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":true,"fieldType":"","fieldLabel":"","fieldAPI":"","editableField":false,"defaultValue":null}],"columns":2,"allowCollapse":false}]', |
| | | List<LayoutSection>.class |
| | | ); |
| | | }else{ |
| | | layoutSections = describeSectionWithFields(recordTypeId,objectType,userMode); |
| | | } |
| | |
| | | return null; |
| | | } |
| | | public class LayoutWrapper{ |
| | | @AuraEnabled public List<LayoutSection> layoutSections{set;get;} |
| | | @AuraEnabled public List<String> requiredFieldAPIList{set;get;} |
| | | @AuraEnabled public Map<String,String> fieldAPIToLabelMap{set;get;} |
| | | @AuraEnabled |
| | | public List<LayoutSection> layoutSections { get; set; } |
| | | @AuraEnabled |
| | | public List<String> requiredFieldAPIList { get; set; } |
| | | @AuraEnabled |
| | | public Map<String, String> fieldAPIToLabelMap { get; set; } |
| | | } |
| | | public class LayoutSection{ |
| | | @AuraEnabled public boolean useHeader {get;set;} |
| | | @AuraEnabled public String name {get;set;} |
| | | @AuraEnabled public boolean allowCollapse {get;set;} |
| | | @AuraEnabled public integer columns {get;set;} |
| | | @AuraEnabled public List<LayoutField> layoutFields {get;set;} |
| | | @AuraEnabled |
| | | public boolean useHeader { get; set; } |
| | | @AuraEnabled |
| | | public String name { get; set; } |
| | | @AuraEnabled |
| | | public boolean allowCollapse { get; set; } |
| | | @AuraEnabled |
| | | public integer columns { get; set; } |
| | | @AuraEnabled |
| | | public List<LayoutField> layoutFields { get; set; } |
| | | } |
| | | |
| | | public class LayoutField{ |
| | | @AuraEnabled public String fieldAPI {get;set;} |
| | | @AuraEnabled public String fieldLabel{set;get;} |
| | | @AuraEnabled public String fieldType{set;get;} |
| | | @AuraEnabled public boolean editableField {get;set;} |
| | | @AuraEnabled public boolean isRequired {get; set;} |
| | | @AuraEnabled public boolean isPlaceHolder {get;set;} |
| | | @AuraEnabled public String defaultValue{set;get;} |
| | | @AuraEnabled |
| | | public String fieldAPI { get; set; } |
| | | @AuraEnabled |
| | | public String fieldLabel { get; set; } |
| | | @AuraEnabled |
| | | public String fieldType { get; set; } |
| | | @AuraEnabled |
| | | public boolean editableField { get; set; } |
| | | @AuraEnabled |
| | | public boolean isRequired { get; set; } |
| | | @AuraEnabled |
| | | public boolean isPlaceHolder { get; set; } |
| | | @AuraEnabled |
| | | public String defaultValue { get; set; } |
| | | } |
| | | public static Integer ControllerUtil() { |
| | | Integer i = 0; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | |
| | | return i; |
| | | } |
| | | |
| | | } |
| | |
| | | String userMode = 'classic';//classic lightning |
| | | String objectType = 'Contact'; |
| | | String recordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Doctor').getRecordTypeId(); |
| | | |
| | | System.debug('record type id ===>' + recordTypeId + ' object type===>' + objectType + ' userMode===>' + userMode); |
| | | boolean useHeader = false; |
| | | String baseurl = System.URL.getOrgDomainUrl().getHost(); |
| | | Map<String,object> detailsMap = new Map<String,object>(); |
| | | Map<String,object> detailsMap2 = new Map<String,object>(); |
| | | Map<String,object> detailsMap3 = new Map<String,object>(); |
| | |
| | | detailsMap3.put('calculated',false); |
| | | detailsMap3.put('autoNumber',false); |
| | | detailsMap3.put('type','repair'); |
| | | String fieldTypeDetail = (String) detailsMap.get('type'); |
| | | |
| | | List<Map<String, object>> componentMapList = new List<Map<String, object>>(); |
| | | List<Map<String, object>> componentMapList2 = new List<Map<String, object>>(); |
| | |
| | | componentMap3.put('type','Field'); |
| | | componentMap3.put('details',detailsMap3); |
| | | componentMapList3.add(componentMap3); |
| | | String apiName = (String) componentMap.get('value'); |
| | | String fieldType = (String) componentMap.get('type'); |
| | | |
| | | List<Map<String, object>> layoutComponentsList = new List<Map<String, object>>(); |
| | | Map<String, object> layoutComponents = new Map<String, object>(); |
| | |
| | | layoutComponents.put('label','Address'); |
| | | layoutComponents.put('placeholder',true); |
| | | layoutComponents.put('editableForNew',true); |
| | | layoutComponents.put('editableForUpdate', true); |
| | | layoutComponents.put('required',false); |
| | | layoutComponentsList.add(layoutComponents); |
| | | Map<String, object> layoutComponents2 = new Map<String, object>(); |
| | |
| | | layoutComponents2.put('label','Repair'); |
| | | layoutComponents2.put('placeholder',true); |
| | | layoutComponents2.put('editableForNew',true); |
| | | layoutComponents2.put('editableForUpdate', true); |
| | | layoutComponents2.put('required',false); |
| | | layoutComponentsList.add(layoutComponents2); |
| | | Map<String, object> layoutComponents3 = new Map<String, object>(); |
| | |
| | | layoutComponents3.put('label','Repair'); |
| | | layoutComponents3.put('placeholder',true); |
| | | layoutComponents3.put('editableForNew',true); |
| | | layoutComponents3.put('editableForUpdate', true); |
| | | layoutComponents3.put('required',false); |
| | | layoutComponentsList.add(layoutComponents3); |
| | | |
| | | |
| | | boolean placeholderF = (boolean) layoutComponents.get('placeholder'); |
| | | boolean isEditable = (boolean) layoutComponents.get('editableForUpdate') || (boolean) layoutComponents.get('editableForNew'); |
| | | System.debug('isEditable ===>' + isEditable); |
| | | List<Map<String,object>> itemList = new List<Map<String,object>>(); |
| | | Map<String,object> item = new Map<String,object>(); |
| | | item.put('layoutItems',layoutComponentsList); |
| | | itemList.add(item); |
| | | |
| | | useHeader = true; |
| | | List<Map<String,object>> sectionList = new List<Map<String,object>>(); |
| | | Map<String,object> section = new Map<String,object>(); |
| | | section.put('heading',''); |
| | | section.put('useHeading',true); |
| | | section.put('useHeading', useHeader); |
| | | section.put('columns',1); |
| | | section.put('useCollapsibleSection',true); |
| | | section.put('layoutRows',itemList); |
| | |
| | | String layoutSectionJson = JSON.serialize(layoutSection); |
| | | LayoutDescriberHelper.ControllerUtil(); |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.BaseHttpMock(layoutSectionJson,'OK','200')); |
| | | |
| | | Test.startTest(); |
| | | LayoutDescriberHelper.describeSectionWithFieldsWrapper(recordTypeId,objectType,userMode); |
| | | LayoutDescriberHelper.describeSectionWithFieldsWrapper(null,objectType,userMode); |
| | | LayoutDescriberHelper.describeSectionWithFields(recordTypeId, objectType, userMode); |
| | | LayoutDescriberHelper.getLayoutSchema(recordTypeId, objectType, userMode); |
| | | LayoutDescriberHelper.getUrlPrefix(); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | |
| | | public without sharing class LexArriveGoodsController { |
| | | //初始化 |
| | | @AuraEnabled |
| | | public static Results init(String arrType, String eSetId) { |
| | | Results results = new Results(); |
| | | results.isNoteStay = LexUtility.getIsNoteStay(); |
| | | try { |
| | | ArriveGoodsController arrController = new ArriveGoodsController(eSetId, arrType); |
| | | arrController.isLwc = true; |
| | | arrController.init(); |
| | | results.arrGoodCon = JSON.serialize(arrController); |
| | | results.coc = arrController.coc; |
| | | results.saveFLGbln = arrController.saveFLGbln; |
| | | results.returnFLGbln = arrController.ReturnFLGbln; |
| | | results.result = 'Success'; |
| | | } catch (Exception e) { |
| | | results.result = 'Fail'; |
| | | results.errorMsg = e.getLineNumber() + '---' + e.getMessage(); |
| | | } |
| | | return results; |
| | | } |
| | | |
| | | //搜索产品 |
| | | @AuraEnabled |
| | | public static Results searchProduct(String barcode, String arrControllerStr) { |
| | | Results results = new Results(); |
| | | try { |
| | | System.debug('arrControllerStr:' + arrControllerStr); |
| | | ArriveGoodsController arrController = (ArriveGoodsController) JSON.deserialize(arrControllerStr, ArriveGoodsController.class); |
| | | arrController.barcode = barcode; |
| | | arrController.returnError = null; |
| | | arrController.warningList = new List<String>(); |
| | | arrController.errorList = new List<String>(); |
| | | arrController.SearchPro(); |
| | | results.arrGoodCon = JSON.serialize(arrController); |
| | | if (arrController.returnError != null && arrController.returnError != '') { |
| | | results.result = 'Fail'; |
| | | results.errorMsgList = arrController.errorList; |
| | | results.warningMsgList = arrController.warningList; |
| | | results.errorMsg = arrController.returnError; |
| | | } else { |
| | | results.coc = arrController.coc; |
| | | results.saveFLGbln = arrController.saveFLGbln; |
| | | results.returnFLGbln = arrController.ReturnFLGbln; |
| | | results.detailsSummary = changeType1(arrController.detailsSummary); |
| | | results.consumableorderdetailsRecords = changeType1(arrController.ConsumableorderdetailsRecords); |
| | | results.showGoodsofReturnList = changeType1(arrController.ShowGoodsofReturnList); |
| | | results.consumableInventory = changeType1(arrController.consumableInventory); |
| | | results.consumableorderdetailsRecordserror = changeType1(arrController.ConsumableorderdetailsRecordserror); |
| | | results.errorMsgList = arrController.errorList; |
| | | results.warningMsgList = arrController.warningList; |
| | | results.result = 'Success'; |
| | | } |
| | | } catch (Exception e) { |
| | | results.result = 'Fail'; |
| | | results.errorMsg = e.getLineNumber() + '---' + e.getMessage() + '---' + e.getStackTraceString(); |
| | | } |
| | | return results; |
| | | } |
| | | |
| | | //到货确认 |
| | | @AuraEnabled |
| | | public static Results arriveGoodsConfim(String arrControllerStr) { |
| | | Results results = new Results(); |
| | | try { |
| | | ArriveGoodsController arrController = (ArriveGoodsController) JSON.deserialize(arrControllerStr, ArriveGoodsController.class); |
| | | arrController.returnError = null; |
| | | arrController.warningList = new List<String>(); |
| | | arrController.errorList = new List<String>(); |
| | | Pagereference page = arrController.ArriveGoodsConfim(); |
| | | results.arrGoodCon = JSON.serialize(arrController); |
| | | if (arrController.returnError != null && arrController.returnError != '') { |
| | | results.result = 'Fail'; |
| | | results.errorMsgList = arrController.errorList; |
| | | results.warningMsgList = arrController.warningList; |
| | | results.errorMsg = arrController.returnError; |
| | | } else { |
| | | if (arrController.urlType == 'UnabletoEdit') { |
| | | results.url = '/lexarrivegsdetails?EsetId=' + arrController.arriveId; |
| | | } |
| | | results.errorMsgList = arrController.errorList; |
| | | results.warningMsgList = arrController.warningList; |
| | | results.result = 'Success'; |
| | | } |
| | | } catch (Exception e) { |
| | | results.result = 'Fail'; |
| | | results.errorMsg = e.getLineNumber() + '---' + e.getMessage(); |
| | | } |
| | | return results; |
| | | } |
| | | |
| | | //登录返品 |
| | | @AuraEnabled |
| | | public static Results updateGoodsOfReturn(String arrControllerStr, String showGoodsofReturnListStr) { |
| | | Results results = new Results(); |
| | | try { |
| | | List<ConsumableorderdetailsInfo> showGoodsofReturnList = (List<ConsumableorderdetailsInfo>) JSON.deserialize( |
| | | showGoodsofReturnListStr, |
| | | List<ConsumableorderdetailsInfo>.class |
| | | ); |
| | | ArriveGoodsController arrController = (ArriveGoodsController) JSON.deserialize(arrControllerStr, ArriveGoodsController.class); |
| | | arrController.ShowGoodsofReturnList = changeType2(showGoodsofReturnList); |
| | | arrController.returnError = null; |
| | | arrController.warningList = new List<String>(); |
| | | arrController.errorList = new List<String>(); |
| | | StaticParameter.ConsumableOrderTrigger = true; //Add by Li Jun for bypass ConsumableOrderTrigger 20230616 |
| | | Pagereference page = arrController.UpdateGoodsOfReturn(); |
| | | results.arrGoodCon = JSON.serialize(arrController); |
| | | if (arrController.returnError != null && arrController.returnError != '') { |
| | | results.result = 'Fail'; |
| | | results.errorMsgList = arrController.errorList; |
| | | results.warningMsgList = arrController.warningList; |
| | | results.errorMsg = arrController.returnError; |
| | | } else { |
| | | if (arrController.urlType == 'ToReturnGoodsPage') { |
| | | results.url = '/detail/' + arrController.return_Order_id; |
| | | } |
| | | if (arrController.urlType == 'ToInventoryGoodsPage') { |
| | | results.url = '/detail/' + arrController.inventory_Order_id; |
| | | } |
| | | results.errorMsgList = arrController.errorList; |
| | | results.warningMsgList = arrController.warningList; |
| | | results.result = 'Success'; |
| | | } |
| | | } catch (Exception e) { |
| | | results.result = 'Fail'; |
| | | results.errorMsg = e.getLineNumber() + '---' + e.getMessage(); |
| | | } |
| | | return results; |
| | | } |
| | | |
| | | public static List<ConsumableorderdetailsInfo> changeType1(List<ArriveGoodsController.ConsumableorderdetailsInfo> conList) { |
| | | List<ConsumableorderdetailsInfo> conList1 = new List<ConsumableorderdetailsInfo>(); |
| | | if (conList != null) { |
| | | for (ArriveGoodsController.ConsumableorderdetailsInfo con : conList) { |
| | | ConsumableorderdetailsInfo con1 = new ConsumableorderdetailsInfo(); |
| | | con1.esd = con.esd; |
| | | con1.Prod = con.Prod; |
| | | con1.ProductName = con.ProductName; |
| | | con1.barCodeNo = con.barCodeNo; |
| | | con1.sterilizationlimitDate = con.sterilizationlimitDate; |
| | | con1.serialNoorLotNo = con.serialNoorLotNo; |
| | | con1.tracingCodeNo = con.tracingCodeNo; |
| | | con1.ReturnReason = con.ReturnReason; |
| | | con1.oldConsumableCount = con.oldConsumableCount; |
| | | con1.ErrorReason = con.ErrorReason; |
| | | con1.canEdit = con.canEdit; |
| | | con1.intMark = con.intMark; |
| | | con1.arriveAmount = con.arriveAmount; |
| | | con1.arrivedCount = con.arrivedCount; |
| | | con1.ReportProductExpirationDate = con.ReportProductExpirationDate; |
| | | conList1.add(con1); |
| | | } |
| | | } |
| | | return conList1; |
| | | } |
| | | |
| | | public static List<ArriveGoodsController.ConsumableorderdetailsInfo> changeType2(List<ConsumableorderdetailsInfo> conList) { |
| | | List<ArriveGoodsController.ConsumableorderdetailsInfo> conList1 = new List<ArriveGoodsController.ConsumableorderdetailsInfo>(); |
| | | if (conList != null) { |
| | | for (ConsumableorderdetailsInfo con : conList) { |
| | | ArriveGoodsController.ConsumableorderdetailsInfo con1 = new ArriveGoodsController.ConsumableorderdetailsInfo(); |
| | | con1.esd = con.esd; |
| | | con1.Prod = con.Prod; |
| | | con1.ProductName = con.ProductName; |
| | | con1.barCodeNo = con.barCodeNo; |
| | | con1.sterilizationlimitDate = con.sterilizationlimitDate; |
| | | con1.serialNoorLotNo = con.serialNoorLotNo; |
| | | con1.tracingCodeNo = con.tracingCodeNo; |
| | | con1.ReturnReason = con.ReturnReason; |
| | | con1.oldConsumableCount = con.oldConsumableCount; |
| | | con1.ErrorReason = con.ErrorReason; |
| | | con1.canEdit = con.canEdit; |
| | | con1.intMark = con.intMark; |
| | | con1.arriveAmount = con.arriveAmount; |
| | | con1.arrivedCount = con.arrivedCount; |
| | | con1.ReportProductExpirationDate = con.ReportProductExpirationDate; |
| | | conList1.add(con1); |
| | | } |
| | | } |
| | | return conList1; |
| | | } |
| | | |
| | | public class Results { |
| | | @AuraEnabled |
| | | public String result; |
| | | @AuraEnabled |
| | | public String errorMsg; |
| | | @AuraEnabled |
| | | public String url; |
| | | @AuraEnabled |
| | | public String arrGoodCon; |
| | | @AuraEnabled |
| | | public Consumable_order__c coc; |
| | | @AuraEnabled |
| | | public Boolean returnFLGbln; |
| | | @AuraEnabled |
| | | public Boolean saveFLGbln; |
| | | @AuraEnabled |
| | | public List<ConsumableorderdetailsInfo> detailsSummary; |
| | | @AuraEnabled |
| | | public List<ConsumableorderdetailsInfo> consumableorderdetailsRecords; |
| | | @AuraEnabled |
| | | public List<ConsumableorderdetailsInfo> showGoodsofReturnList; |
| | | @AuraEnabled |
| | | public List<ConsumableorderdetailsInfo> consumableInventory; |
| | | @AuraEnabled |
| | | public List<ConsumableorderdetailsInfo> consumableorderdetailsRecordserror; |
| | | @AuraEnabled |
| | | public List<String> errorMsgList; |
| | | @AuraEnabled |
| | | public List<String> warningMsgList; |
| | | @AuraEnabled |
| | | public Boolean isNoteStay; |
| | | } |
| | | |
| | | public class ConsumableorderdetailsInfo implements Comparable { |
| | | @AuraEnabled |
| | | public Consumable_order_details2__c esd { get; set; } |
| | | @AuraEnabled |
| | | public Product2__c Prod { get; set; } |
| | | @AuraEnabled |
| | | public String ProductName { get; set; } |
| | | @AuraEnabled |
| | | public String barCodeNo { get; set; } |
| | | @AuraEnabled |
| | | public Date sterilizationlimitDate { get; set; } |
| | | @AuraEnabled |
| | | public String serialNoorLotNo { get; set; } |
| | | @AuraEnabled |
| | | public String tracingCodeNo { get; set; } |
| | | @AuraEnabled |
| | | public String ReturnReason { get; set; } |
| | | @AuraEnabled |
| | | public String oldConsumableCount { get; set; } |
| | | @AuraEnabled |
| | | public String ErrorReason { get; set; } |
| | | @AuraEnabled |
| | | public boolean canEdit { get; set; } |
| | | @AuraEnabled |
| | | public Integer intMark { get; set; } |
| | | @AuraEnabled |
| | | public Decimal arriveAmount { get; set; } |
| | | @AuraEnabled |
| | | public Decimal arrivedCount { get; set; } |
| | | @AuraEnabled |
| | | public String ReportProductExpirationDate { get; set; } |
| | | |
| | | public ConsumableorderdetailsInfo() { |
| | | } |
| | | |
| | | // 排序 |
| | | public Integer compareTo(Object compareTo) { |
| | | return null; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | @isTest |
| | | private class LexArriveGoodsControllerTest { |
| | | @IsTest |
| | | static void test1() { |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | | List<RecordType> rectCo = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | | WHERE Name = '901_经销商社区普通权限_2重验证(ET)' |
| | | ]; |
| | | |
| | | Account myAccount1 = new Account( |
| | | Name = 'Testaccount001', |
| | | Dealer_discount__c = 20, |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999996' |
| | | ); |
| | | Account myAccount2 = new Account( |
| | | Name = 'Testaccount002', |
| | | Dealer_discount__c = 10, |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900', |
| | | Product_Limit_Date__c = 'Test01|2|4,Test02|3|5' |
| | | ); |
| | | insert new List<Account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email = 'newuser@testorg.com', |
| | | EmailEncodingKey = 'UTF-8', |
| | | LastName = 'TestUser', |
| | | LanguageLocaleKey = 'zh_CN', |
| | | LocaleSidKey = 'zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey = 'Asia/Shanghai', |
| | | UserName = 'testUser@testorg.com', |
| | | UserPro_Type__c = 'ET' |
| | | ); |
| | | System.runAs(new User(Id = UserInfo.getUserId())) { |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | System.runAs(MyUser_Test) { |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | | ProductCode = 'Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | RecordTypeId = '01210000000aMAFAA2', |
| | | SFDA_Status__c = '有効', |
| | | JANCODE__c = '04953170200311', |
| | | Dealer_special_Object__c = true, |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod02 = new Product2( |
| | | Name = 'Test02', |
| | | ProductCode = 'Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | RecordTypeId = '01210000000aMAFAA2', |
| | | SFDA_Status__c = '有効', |
| | | JANCODE__c = '04953170200312', |
| | | Dealer_special_Object__c = true, |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | // Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Total_num__c = 3; |
| | | Order1.OrderNumber_arrived__c = 1; |
| | | Order1.Delivery_detail_count__c = 1; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 40; |
| | | insert Orderdet; |
| | | |
| | | //发货明细 |
| | | //到货正确信息 |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001002'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Test01'; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA'; |
| | | Orderdet1.TracingCode__c = 'BXJRA'; |
| | | |
| | | //取消产品 |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001003'; |
| | | Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Test01'; |
| | | //Orderdet2.Consumable_Arrived_order__c = Order1.Id; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB'; |
| | | Orderdet2.Cancellation_Date__c = Date.today(); |
| | | Orderdet2.TracingCode__c = 'BXJRB'; |
| | | //销售产品 |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(); |
| | | Orderdet3.Name = 'OCM_01_001004'; |
| | | Orderdet3.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet3.Consumable_Product__c = pro1.Id; |
| | | Orderdet3.Asset_Model_No__c = 'Test01'; |
| | | Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC'; |
| | | Orderdet3.Used_date__c = Date.today(); |
| | | Orderdet3.Arrive_date__c = Date.today(); |
| | | Orderdet3.TracingCode__c = 'BXJRC'; |
| | | //Orderdet3.Box_Piece__c = '盒'; |
| | | |
| | | //出库产品 |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001005'; |
| | | Orderdet4.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet4.Consumable_Product__c = pro1.Id; |
| | | Orderdet4.Asset_Model_No__c = 'Test01'; |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD'; |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | Orderdet4.Arrive_date__c = Date.today(); |
| | | Orderdet4.TracingCode__c = 'BXJRD'; |
| | | |
| | | //已到货产品 |
| | | Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c(); |
| | | Orderdet5.Name = 'OCM_01_001006'; |
| | | Orderdet5.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet5.Consumable_Product__c = pro1.Id; |
| | | Orderdet5.Asset_Model_No__c = 'Test01'; |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE'; |
| | | Orderdet5.Arrive_date__c = Date.today(); |
| | | Orderdet5.TracingCode__c = 'BXJRE'; |
| | | |
| | | //发货明细 |
| | | //管理编码包含数字 |
| | | Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c(); |
| | | Orderdet6.Name = 'OCM_01_001002'; |
| | | Orderdet6.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet6.Consumable_Product__c = pro1.Id; |
| | | Orderdet6.Asset_Model_No__c = 'Test01'; |
| | | Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BX123'; |
| | | Orderdet6.TracingCode__c = 'BX123'; |
| | | |
| | | //发错库 未到货 |
| | | Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c(); |
| | | Orderdets8.Name = 'OCM_01_001011'; |
| | | Orderdets8.Consumable_order_minor__c = Order1.Id; |
| | | Orderdets8.Consumable_Product__c = pro1.Id; |
| | | Orderdets8.Asset_Model_No__c = 'Test01'; |
| | | Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys'; |
| | | Orderdets8.Box_Piece__c = '盒'; |
| | | Orderdets8.TracingCode__c = 'BXsys'; |
| | | |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdets8 }; |
| | | |
| | | List<Consumable_orderdetails__c> cod1 = [ |
| | | SELECT Id |
| | | FROM Consumable_orderdetails__c |
| | | WHERE Consumable_order__c = :Order1.Id |
| | | ]; |
| | | System.assertEquals(1, cod1.size()); |
| | | |
| | | PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id); |
| | | |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | | System.Test.startTest(); |
| | | LexArriveGoodsController.Results re = LexArriveGoodsController.init('Arr', Order1.Id); |
| | | String arrControllerStr = re.arrGoodCon; |
| | | LexArriveGoodsController.searchProduct('', arrControllerStr); |
| | | re = LexArriveGoodsController.searchProduct( |
| | | '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXsys\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BX123', |
| | | arrControllerStr |
| | | ); |
| | | arrControllerStr = re.arrGoodCon; |
| | | LexArriveGoodsController.arriveGoodsConfim(arrControllerStr); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | @IsTest |
| | | static void test2() { |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | | List<RecordType> rectCo = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | | WHERE Name = '901_经销商社区普通权限_2重验证(ET)' |
| | | ]; |
| | | |
| | | Account myAccount2 = new Account( |
| | | name = 'Testaccount002', |
| | | Dealer_discount__c = 20, |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id); |
| | | insert new List<account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email = 'newuser@testorg.com', |
| | | EmailEncodingKey = 'UTF-8', |
| | | LastName = 'TestUser', |
| | | LanguageLocaleKey = 'zh_CN', |
| | | LocaleSidKey = 'zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey = 'Asia/Shanghai', |
| | | UserName = 'testUser@testorg.com', |
| | | UserPro_Type__c = 'ET' |
| | | ); |
| | | System.runAs(new User(Id = UserInfo.getUserId())) { |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | System.runAs(MyUser_Test) { |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | | ProductCode = 'Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | RecordTypeId = '01210000000aMAFAA2', |
| | | SFDA_Status__c = '有効', |
| | | JANCODE__c = '04953170200311', |
| | | Dealer_special_Object__c = true, |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod02 = new Product2( |
| | | Name = 'Test02', |
| | | ProductCode = 'Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | RecordTypeId = '01210000000aMAFAA2', |
| | | SFDA_Status__c = '有効', |
| | | JANCODE__c = '04953170200312', |
| | | Dealer_special_Object__c = true, |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | //订单 |
| | | |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | |
| | | //返品订单 |
| | | |
| | | Consumable_order__c Order2 = new Consumable_order__c(); |
| | | Order2.Name = 'OCM_01_002'; |
| | | Order2.Order_status__c = '批准'; |
| | | Order2.Order_type__c = '返品'; |
| | | Order2.Dealer_Info__c = myAccount1.id; |
| | | Order2.RecordTypeid = System.Label.Dealer_Returned_Label; |
| | | insert Order1; |
| | | insert Order2; |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 4; |
| | | insert Orderdet; |
| | | |
| | | //发货明细 |
| | | //没出库,没销售,就是在库 |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001001'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet1.Arrive_date__c = date.today(); |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | Orderdet1.TracingCode__c = 'BXSYS'; |
| | | |
| | | //daohuo |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001002'; |
| | | Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet2.Consumable_Arrived_order__c = Order1.Id; |
| | | Orderdet2.Arrive_date__c = date.today(); |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI'; |
| | | Orderdet2.TracingCode__c = 'BXSYS'; |
| | | //sale |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(); |
| | | Orderdet3.Name = 'OCM_01_001003'; |
| | | Orderdet3.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet3.Consumable_Product__c = pro1.Id; |
| | | Orderdet3.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet3.Consumable_Arrived_order__c = Order1.Id; |
| | | Orderdet3.Arrive_date__c = date.today(); |
| | | Orderdet3.Used_date__c = date.today(); |
| | | Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ'; |
| | | Orderdet3.TracingCode__c = 'BXSYS'; |
| | | //出库 |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001004'; |
| | | Orderdet4.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet4.Consumable_Product__c = pro1.Id; |
| | | Orderdet4.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet4.Consumable_Arrived_order__c = Order1.Id; |
| | | Orderdet4.Consumable_Shipment_order__c = Order1.Id; |
| | | Orderdet4.Send_Date__c = date.today(); |
| | | Orderdet4.Arrive_date__c = date.today(); |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BX222'; |
| | | Orderdet4.TracingCode__c = 'BXSYS'; |
| | | //quxiao |
| | | Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c(); |
| | | Orderdet5.Name = 'OCM_01_001005'; |
| | | Orderdet5.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet5.Consumable_Product__c = pro1.Id; |
| | | Orderdet5.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet5.Cancellation_Date__c = Date.today(); |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ'; |
| | | Orderdet5.Box_Piece__c = '个'; |
| | | Orderdet5.TracingCode__c = 'BXSYS'; |
| | | //fanpin |
| | | Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c(); |
| | | Orderdet6.Name = 'OCM_01_001006'; |
| | | Orderdet6.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet6.Consumable_Product__c = pro1.Id; |
| | | Orderdet6.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet6.Consumable_Return_order__c = Order2.Id; |
| | | Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA'; |
| | | Orderdet6.Box_Piece__c = '个'; |
| | | Orderdet6.TracingCode__c = 'BXSYS'; |
| | | |
| | | Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c(); |
| | | Orderdet7.Name = 'OCM_01_001001'; |
| | | Orderdet7.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet7.Consumable_Product__c = pro1.Id; |
| | | Orderdet7.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BX333'; |
| | | Orderdet7.TracingCode__c = 'BXSYS'; |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdet7 }; |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | System.Test.startTest(); |
| | | Controller.init(); |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXAAA\n01049531702003111115120017181000105ZK250BXJRJ\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BX123\n01049531702003111115120017181000105ZK250BX222'; |
| | | Controller.SearchPro(); |
| | | Controller.ArriveGoodsConfim(); |
| | | Controller.UpdateGoodsOfReturn(); |
| | | controller.getinventorysize(); |
| | | LexArriveGoodsController.Results re = LexArriveGoodsController.init('Arr', ''); |
| | | String arrControllerStr = re.arrGoodCon; |
| | | re = LexArriveGoodsController.searchProduct( |
| | | '01049531702003111115120017181000105ZK250BXAAA\n01049531702003111115120017181000105ZK250BXJRJ\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BX123\n01049531702003111115120017181000105ZK250BX222', |
| | | arrControllerStr |
| | | ); |
| | | arrControllerStr = re.arrGoodCon; |
| | | LexArriveGoodsController.arriveGoodsConfim(arrControllerStr); |
| | | LexArriveGoodsController.updateGoodsOfReturn(re.arrGoodCon, JSON.serialize(re.showGoodsofReturnList)); |
| | | LexArriveGoodsController.ConsumableorderdetailsInfo con = new LexArriveGoodsController.ConsumableorderdetailsInfo(); |
| | | List<LexArriveGoodsController.ConsumableorderdetailsInfo> conList = new List<LexArriveGoodsController.ConsumableorderdetailsInfo>(); |
| | | conList.add(con); |
| | | LexArriveGoodsController.changeType2(conList); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>57.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | public class LexArriveGoodsControllerTest1 { |
| | | static void test1() { |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | | List<RecordType> rectCo = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | | WHERE Name = '901_经销商社区普通权限_2重验证(ET)' |
| | | ]; |
| | | |
| | | Account myAccount1 = new Account( |
| | | Name = 'Testaccount001', |
| | | Dealer_discount__c = 20, |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999996' |
| | | ); |
| | | Account myAccount2 = new Account( |
| | | Name = 'Testaccount002', |
| | | Dealer_discount__c = 10, |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900', |
| | | Product_Limit_Date__c = 'Test01|2|4,Test02|3|5' |
| | | ); |
| | | insert new List<Account>{ myAccount1, myAccount2 }; |
| | | |
| | | Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = new User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email = 'newuser@testorg.com', |
| | | EmailEncodingKey = 'UTF-8', |
| | | LastName = 'TestUser', |
| | | LanguageLocaleKey = 'zh_CN', |
| | | LocaleSidKey = 'zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey = 'Asia/Shanghai', |
| | | UserName = 'testUser@testorg.com', |
| | | UserPro_Type__c = 'ET' |
| | | ); |
| | | System.runAs(new User(Id = UserInfo.getUserId())) { |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | System.runAs(MyUser_Test) { |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | | ProductCode = 'Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | RecordTypeId = '01210000000aMAFAA2', |
| | | SFDA_Status__c = '有効', |
| | | JANCODE__c = '04953170200311', |
| | | Dealer_special_Object__c = true, |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod02 = new Product2( |
| | | Name = 'Test02', |
| | | ProductCode = 'Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | RecordTypeId = '01210000000aMAFAA2', |
| | | SFDA_Status__c = '有効', |
| | | JANCODE__c = '04953170200312', |
| | | Dealer_special_Object__c = true, |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | // Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Total_num__c = 3; |
| | | Order1.OrderNumber_arrived__c = 1; |
| | | Order1.Delivery_detail_count__c = 1; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 40; |
| | | insert Orderdet; |
| | | |
| | | //发货明细 |
| | | //到货正确信息 |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001002'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Test01'; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA'; |
| | | Orderdet1.TracingCode__c = 'BXJRA'; |
| | | |
| | | //取消产品 |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001003'; |
| | | Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Test01'; |
| | | //Orderdet2.Consumable_Arrived_order__c = Order1.Id; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB'; |
| | | Orderdet2.Cancellation_Date__c = Date.today(); |
| | | Orderdet2.TracingCode__c = 'BXJRB'; |
| | | //销售产品 |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(); |
| | | Orderdet3.Name = 'OCM_01_001004'; |
| | | Orderdet3.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet3.Consumable_Product__c = pro1.Id; |
| | | Orderdet3.Asset_Model_No__c = 'Test01'; |
| | | Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC'; |
| | | Orderdet3.Used_date__c = Date.today(); |
| | | Orderdet3.Arrive_date__c = Date.today(); |
| | | Orderdet3.TracingCode__c = 'BXJRC'; |
| | | //Orderdet3.Box_Piece__c = '盒'; |
| | | |
| | | //出库产品 |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001005'; |
| | | Orderdet4.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet4.Consumable_Product__c = pro1.Id; |
| | | Orderdet4.Asset_Model_No__c = 'Test01'; |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD'; |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | Orderdet4.Arrive_date__c = Date.today(); |
| | | Orderdet4.TracingCode__c = 'BXJRD'; |
| | | |
| | | //已到货产品 |
| | | Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c(); |
| | | Orderdet5.Name = 'OCM_01_001006'; |
| | | Orderdet5.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet5.Consumable_Product__c = pro1.Id; |
| | | Orderdet5.Asset_Model_No__c = 'Test01'; |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE'; |
| | | Orderdet5.Arrive_date__c = Date.today(); |
| | | Orderdet5.TracingCode__c = 'BXJRE'; |
| | | |
| | | //发货明细 |
| | | //管理编码包含数字 |
| | | Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c(); |
| | | Orderdet6.Name = 'OCM_01_001002'; |
| | | Orderdet6.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet6.Consumable_Product__c = pro1.Id; |
| | | Orderdet6.Asset_Model_No__c = 'Test01'; |
| | | Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BX123'; |
| | | Orderdet6.TracingCode__c = 'BX123'; |
| | | |
| | | //发错库 未到货 |
| | | Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c(); |
| | | Orderdets8.Name = 'OCM_01_001011'; |
| | | Orderdets8.Consumable_order_minor__c = Order1.Id; |
| | | Orderdets8.Consumable_Product__c = pro1.Id; |
| | | Orderdets8.Asset_Model_No__c = 'Test01'; |
| | | Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys'; |
| | | Orderdets8.Box_Piece__c = '盒'; |
| | | Orderdets8.TracingCode__c = 'BXsys'; |
| | | |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdets8 }; |
| | | |
| | | List<Consumable_orderdetails__c> cod1 = [ |
| | | SELECT Id |
| | | FROM Consumable_orderdetails__c |
| | | WHERE Consumable_order__c = :Order1.Id |
| | | ]; |
| | | System.assertEquals(1, cod1.size()); |
| | | |
| | | PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id); |
| | | |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | | System.Test.startTest(); |
| | | LexArriveGoodsController.Results re = LexArriveGoodsController.init('Arr', Order1.Id); |
| | | String arrControllerStr = re.arrGoodCon; |
| | | LexArriveGoodsController.searchProduct('', arrControllerStr); |
| | | re = LexArriveGoodsController.searchProduct( |
| | | '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXsys\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BX123', |
| | | arrControllerStr |
| | | ); |
| | | arrControllerStr = re.arrGoodCon; |
| | | LexArriveGoodsController.arriveGoodsConfim(arrControllerStr); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>57.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | private static String cate1ForSort = null; |
| | | private static Date cate2ForSort = Date.today(); |
| | | private static Date cate2 = Date.today(); |
| | | private static String[] columus = new String[]{ 'Product2__c.Name'}; |
| | | private static String[] columus = new List<String>{ 'Product2__c.Name' }; |
| | | // 产品 ID |
| | | private static String ESetId = ''; |
| | | private static String accountid = null; |
| | |
| | | Results results = new Results(); |
| | | results.isNoteStay = LexUtility.getIsNoteStay(); |
| | | try { |
| | | List<String> idList = new List<String>(); |
| | | idList.add('a2K10000002zHyDEAU'); |
| | | idList.add('a2K10000002zIJEEA2'); |
| | | idList.add('a2K10000002zK9rEAE'); |
| | | idList.add('a2K10000004AKGBEA4'); |
| | | idList.add('a2K10000004ALqeEAG'); |
| | | idList.add('a2K10000004AMmrEAG'); |
| | | idList.add('a2K10000004ANvDEAW'); |
| | | idList.add('a2K10000004AOVxEAO'); |
| | | idList.add('a2K10000004AOJZEA4'); |
| | | idList.add('a2K10000004AOLuEAO'); |
| | | idList.add('a2K10000004AOLfEAO'); |
| | | // coc = new Consumable_order__c(); |
| | | String userId = UserInfo.getUserId(); |
| | | List<user> Useracc = New List<user>(); |
| | | Useracc = [select accountid, Work_Location__c,UserPro_Type__c from user where id =:userId]; |
| | | List<user> Useracc = new List<user>(); |
| | | Useracc = [ |
| | | SELECT accountid, Work_Location__c, UserPro_Type__c |
| | | FROM user |
| | | WHERE id = :userId |
| | | ]; |
| | | accountid = Useracc[0].accountid; |
| | | userWorkLocation = Useracc[0].Work_Location__c; |
| | | agencyProType = Useracc[0].UserPro_Type__c; |
| | |
| | | for (String s : column) { |
| | | soql += ',' + s; |
| | | } |
| | | soql += ' from Consumable_order__c where Order_type__c = \''+'订单'+'\' and recordtypeid =\'' + System.Label.RT_ConOrder_Delivery + '\' and Dealer_Info__c =\'' + accountid +'\' and Order_ProType__c =\'' + agencyProType +'\' and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_Owner_WorkLocal__c = \'' + userWorkLocation + '\' and showFalseNotshowTrue__c = false order by Deliver_date__c'; // |
| | | soql += |
| | | ' from Consumable_order__c where Order_type__c = \'' + |
| | | '订单' + |
| | | '\' and recordtypeid =\'' + |
| | | System.Label.RT_ConOrder_Delivery + |
| | | '\' and Dealer_Info__c =\'' + |
| | | accountid + |
| | | '\' and Order_ProType__c =\'' + |
| | | agencyProType + |
| | | '\' and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_Owner_WorkLocal__c = \'' + |
| | | userWorkLocation + |
| | | '\' and showFalseNotshowTrue__c = false order by Deliver_date__c'; // |
| | | // soql = 'select id,name,ContractNo__c,Total_num__c,OrderNumber_arrived__c,Delivery_detail_count__c,OrderNumber_notarrive__c,More_than_seven_days__c,Shipment_date__c,First_Delivery__c from Consumable_order__c where id in :idList'; |
| | | raesList = Database.query(soql); |
| | | //20200904 ljh add start |
| | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static Results searchConsumableorderdetails(String category1Str, Date cate2Str, String accountidStr, String userWorkLocationStr, String agencyProTypeStr){ |
| | | public static Results searchConsumableorderdetails( |
| | | String category1Str, |
| | | Date cate2Str, |
| | | String accountidStr, |
| | | String userWorkLocationStr, |
| | | String agencyProTypeStr |
| | | ) { |
| | | Results results = new Results(); |
| | | category1 = category1Str; |
| | | cate2 = cate2Str; |
| | |
| | | for (String s : column) { |
| | | soql += ',' + s; |
| | | } |
| | | soql += ' from Consumable_order__c where Order_type__c = \''+'订单'+'\' and recordtypeid =\'' + System.Label.RT_ConOrder_Delivery + '\' and Dealer_Info__c =\'' + accountid +'\' and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) '; |
| | | soql += |
| | | ' from Consumable_order__c where Order_type__c = \'' + |
| | | '订单' + |
| | | '\' and recordtypeid =\'' + |
| | | System.Label.RT_ConOrder_Delivery + |
| | | '\' and Dealer_Info__c =\'' + |
| | | accountid + |
| | | '\' and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) '; |
| | | soql += 'and Order_Owner_WorkLocal__c = \'' + userWorkLocation + '\' '; |
| | | soql += 'and showFalseNotshowTrue__c = false'; |
| | | if (!String.isBlank(category1)) { |
| force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls
force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls-meta.xml
force-app/main/default/classes/LexArriveGsDetailsController.cls
force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls
force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls-meta.xml
force-app/main/default/classes/LexCancelRemoveBoxController.cls
force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls
force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls-meta.xml
force-app/main/default/classes/LexConInvoiceListTest.cls
force-app/main/default/classes/LexConInvoiceListTest.cls-meta.xml
force-app/main/default/classes/LexConInvoiceViewController.cls
force-app/main/default/classes/LexConInvoiceViewControllerTest.cls
force-app/main/default/classes/LexConInvoiceViewControllerTest.cls-meta.xml
force-app/main/default/classes/LexConInvoicedetailsController.cls
force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls
force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls-meta.xml
force-app/main/default/classes/LexConsumableAccountController.cls
force-app/main/default/classes/LexConsumableAccountControllerTest.cls
force-app/main/default/classes/LexConsumableAccountControllerTest.cls-meta.xml
force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls
force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls-meta.xml
force-app/main/default/classes/LexConsumableAccountSOQL.cls
force-app/main/default/classes/LexConsumableAccountSOQLTest.cls
force-app/main/default/classes/LexConsumableAccountSOQLTest.cls-meta.xml
force-app/main/default/classes/LexConsumableController.cls
force-app/main/default/classes/LexConsumableControllerTest.cls
force-app/main/default/classes/LexConsumableControllerTest.cls-meta.xml
force-app/main/default/classes/LexConsumableGoodsInfo.cls
force-app/main/default/classes/LexConsumableGoodsInfoTest.cls
force-app/main/default/classes/LexConsumableGoodsInfoTest.cls-meta.xml
force-app/main/default/classes/LexConsumableOrderManageController.cls
force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls
force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls-meta.xml
force-app/main/default/classes/LexInventoryController.cls
force-app/main/default/classes/LexInventoryControllerTest.cls
force-app/main/default/classes/LexInventoryControllerTest.cls-meta.xml
force-app/main/default/classes/LexInventoryListController.cls
force-app/main/default/classes/LexInventoryListControllerTest.cls
force-app/main/default/classes/LexInventoryListControllerTest.cls-meta.xml
force-app/main/default/classes/LexInventoryViewController.cls
force-app/main/default/classes/LexInventoryViewControllerTest.cls
force-app/main/default/classes/LexInventoryViewControllerTest.cls-meta.xml
force-app/main/default/classes/LexLicenceReminderControllerTest.cls
force-app/main/default/classes/LexLicenceReminderControllerTest.cls-meta.xml
force-app/main/default/classes/LexNewAndEditBasePIPLController.cls
force-app/main/default/classes/LexNewAndEditBasePIPLController.cls-meta.xml
force-app/main/default/classes/LexNewAndEditContactPIPLController.cls
force-app/main/default/classes/LexNewAndEditContactPIPLController.cls-meta.xml
force-app/main/default/classes/LexOutboundorderImportController.cls
force-app/main/default/classes/LexOutboundorderImportControllerTest.cls
force-app/main/default/classes/LexOutboundorderImportControllerTest.cls-meta.xml
force-app/main/default/classes/LexOverdueStockController.cls
force-app/main/default/classes/LexOverdueStockControllerTest.cls
force-app/main/default/classes/LexOverdueStockControllerTest.cls-meta.xml
force-app/main/default/classes/LexProductLimitEditControllerTest.cls
force-app/main/default/classes/LexProductLimitEditControllerTest.cls-meta.xml
force-app/main/default/classes/LexRemoveBoxControllerTest.cls
force-app/main/default/classes/LexRemoveBoxControllerTest.cls-meta.xml
force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls
force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls-meta.xml
force-app/main/default/classes/LexSaleOrderController.cls
force-app/main/default/classes/LexSaleOrderControllerTest.cls
force-app/main/default/classes/LexSaleOrderControllerTest.cls-meta.xml
force-app/main/default/classes/LexSearchContractControllerTest.cls
force-app/main/default/classes/LexSearchContractControllerTest.cls-meta.xml
force-app/main/default/classes/LexSearchHospitalControllerTest.cls
force-app/main/default/classes/LexSearchHospitalControllerTest.cls-meta.xml
force-app/main/default/classes/LexSummonsCreatController.cls
force-app/main/default/classes/LexSummonsCreatControllerTest.cls
force-app/main/default/classes/LexSummonsCreatControllerTest.cls-meta.xml
force-app/main/default/classes/LexTopPageControllerTest.cls
force-app/main/default/classes/LexTopPageControllerTest.cls-meta.xml
force-app/main/default/classes/LexUpAccountProLimit.cls
force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls
force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls-meta.xml
force-app/main/default/classes/LexUtilityTest.cls
force-app/main/default/classes/LexUtilityTest.cls-meta.xml
force-app/main/default/classes/LightningUtil.cls
force-app/main/default/classes/LookupSearchResultTest.cls
force-app/main/default/classes/LookupSearchResultTest.cls-meta.xml
force-app/main/default/classes/MetaDataUtility.cls
force-app/main/default/classes/NewAndEditLeadController.cls
force-app/main/default/classes/NewAndEditLeadControllerTest.cls
force-app/main/default/classes/Product2Handler.cls
force-app/main/default/classes/RentalApplyEquipmentSetDetailHandler.cls
force-app/main/default/classes/ResponseBodyLWCTest.cls
force-app/main/default/classes/ResponseBodyLWCTest.cls-meta.xml
force-app/main/default/classes/WeeklyReportCmp.cls
force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls
force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls-meta.xml
force-app/main/default/contentassets/OlympusCommunityLoginBG.asset
force-app/main/default/contentassets/OlympusCommunityLoginBG.asset-meta.xml
force-app/main/default/contentassets/OlympusCommunityLogo.asset
force-app/main/default/contentassets/OlympusCommunityLogo.asset-meta.xml
force-app/main/default/dashboards/ConsumableSalesDashboard.dashboardFolder-meta.xml
force-app/main/default/dashboards/ConsumableSalesDashboard/ezyQWhsDlQfrUPdIMqUmGsdMeWiYAH2.dashboard-meta.xml
force-app/main/default/dashboards/Consumable_Dashboard/ezyQWhsDlQfrUPdIMqUmGsdMeWiYAH.dashboard-meta.xml (deleted)
force-app/main/default/dashboards/LEX.dashboardFolder-meta.xml (deleted)
force-app/main/default/experiences/Consumable1/brandingSets/partnerCentral.json
force-app/main/default/experiences/Consumable1/config/consumable系统.json
force-app/main/default/experiences/Consumable1/config/languages.json
force-app/main/default/experiences/Consumable1/config/loginAppPage.json
force-app/main/default/experiences/Consumable1/config/mainAppPage.json
force-app/main/default/experiences/Consumable1/routes/accountManagement.json
force-app/main/default/experiences/Consumable1/routes/cICList.json
force-app/main/default/experiences/Consumable1/routes/cICRelatedList.json
force-app/main/default/experiences/Consumable1/routes/cICリスト.json
force-app/main/default/experiences/Consumable1/routes/cIC関連リスト.json
force-app/main/default/experiences/Consumable1/routes/campaignList.json
force-app/main/default/experiences/Consumable1/routes/caseDetail.json
force-app/main/default/experiences/Consumable1/routes/checkPassword.json
force-app/main/default/experiences/Consumable1/routes/contactSupport.json
force-app/main/default/experiences/Consumable1/routes/createRecord.json
force-app/main/default/experiences/Consumable1/routes/dashboardDetail.json
force-app/main/default/experiences/Consumable1/routes/dashboardList.json
force-app/main/default/experiences/Consumable1/routes/error.json
force-app/main/default/experiences/Consumable1/routes/feedDetail.json
force-app/main/default/experiences/Consumable1/routes/fileDetail.json
force-app/main/default/experiences/Consumable1/routes/fileList.json
force-app/main/default/experiences/Consumable1/routes/flow.json
force-app/main/default/experiences/Consumable1/routes/forgotPassword.json
force-app/main/default/experiences/Consumable1/routes/groupDetail.json
force-app/main/default/experiences/Consumable1/routes/groupList.json
force-app/main/default/experiences/Consumable1/routes/home.json
force-app/main/default/experiences/Consumable1/routes/lexAgencyInfo.json
force-app/main/default/experiences/Consumable1/routes/lexArriveGoods.json
force-app/main/default/experiences/Consumable1/routes/lexArriveGoodsMain.json
force-app/main/default/experiences/Consumable1/routes/lexArriveGsDetails.json
force-app/main/default/experiences/Consumable1/routes/lexCancelRemoveBox.json
force-app/main/default/experiences/Consumable1/routes/lexConInvoiceView.json
force-app/main/default/experiences/Consumable1/routes/lexConsumable.json
force-app/main/default/experiences/Consumable1/routes/lexConsumableAccount.json
force-app/main/default/experiences/Consumable1/routes/lexConsumableAccountInfoPrint.json
force-app/main/default/experiences/Consumable1/routes/lexConsumableOrderManage.json
force-app/main/default/experiences/Consumable1/routes/lexInventory.json
force-app/main/default/experiences/Consumable1/routes/lexInventoryView.json
force-app/main/default/experiences/Consumable1/routes/lexOutboundorderImport.json
force-app/main/default/experiences/Consumable1/routes/lexOverdueStock.json
force-app/main/default/experiences/Consumable1/routes/lexProductLimitEdit.json
force-app/main/default/experiences/Consumable1/routes/lexRemoveBox.json
force-app/main/default/experiences/Consumable1/routes/lexSaleAndDelivery.json
force-app/main/default/experiences/Consumable1/routes/lexSummonsCreat.json
force-app/main/default/experiences/Consumable1/routes/lexTopPage.json
force-app/main/default/experiences/Consumable1/routes/login.json
force-app/main/default/experiences/Consumable1/routes/loginError.json
force-app/main/default/experiences/Consumable1/routes/mDFAndCoop.json
force-app/main/default/experiences/Consumable1/routes/messages.json
force-app/main/default/experiences/Consumable1/routes/myAccount.json
force-app/main/default/experiences/Consumable1/routes/questionDetail.json
force-app/main/default/experiences/Consumable1/routes/quipDocsRelatedList.json
force-app/main/default/experiences/Consumable1/routes/recordDetail.json
force-app/main/default/experiences/Consumable1/routes/recordList.json
force-app/main/default/experiences/Consumable1/routes/register.json
force-app/main/default/experiences/Consumable1/routes/relatedRecordList.json
force-app/main/default/experiences/Consumable1/routes/reportBuilder.json
force-app/main/default/experiences/Consumable1/routes/reportDetail.json
force-app/main/default/experiences/Consumable1/routes/reportList.json
force-app/main/default/experiences/Consumable1/routes/resources.json
force-app/main/default/experiences/Consumable1/routes/search.json
force-app/main/default/experiences/Consumable1/routes/streamDetail.json
force-app/main/default/experiences/Consumable1/routes/streamList.json
force-app/main/default/experiences/Consumable1/routes/topicCatalog.json
force-app/main/default/experiences/Consumable1/routes/topicDetail.json
force-app/main/default/experiences/Consumable1/routes/userProfile.json
force-app/main/default/experiences/Consumable1/routes/userSettings.json
force-app/main/default/experiences/Consumable1/routes/仪表板RelatedList.json
force-app/main/default/experiences/Consumable1/routes/仪表板関連リスト.json
force-app/main/default/experiences/Consumable1/routes/学会・培训Detail.json
force-app/main/default/experiences/Consumable1/routes/学会・培训RelatedList.json
force-app/main/default/experiences/Consumable1/routes/学会・培训詳細.json
force-app/main/default/experiences/Consumable1/routes/学会・培训関連リスト.json
force-app/main/default/experiences/Consumable1/routes/小组RelatedList.json
force-app/main/default/experiences/Consumable1/routes/小组関連リスト.json
force-app/main/default/experiences/Consumable1/routes/库存.json
force-app/main/default/experiences/Consumable1/routes/库存上下限编辑.json
force-app/main/default/experiences/Consumable1/routes/报表RelatedList.json
force-app/main/default/experiences/Consumable1/routes/报表関連リスト.json
force-app/main/default/experiences/Consumable1/routes/文件RelatedList.json
force-app/main/default/experiences/Consumable1/routes/文件関連リスト.json
force-app/main/default/experiences/Consumable1/routes/新建消耗品订单.json
force-app/main/default/experiences/Consumable1/routes/流RelatedList.json
force-app/main/default/experiences/Consumable1/routes/流関連リスト.json
force-app/main/default/experiences/Consumable1/routes/消耗品订单列表.json
force-app/main/default/experiences/Consumable1/routes/消耗品订单相关列表.json
force-app/main/default/experiences/Consumable1/routes/消耗品订单详细信息.json
force-app/main/default/experiences/Consumable1/routes/用户List.json
force-app/main/default/experiences/Consumable1/routes/用户RelatedList.json
force-app/main/default/experiences/Consumable1/routes/用户リスト.json
force-app/main/default/experiences/Consumable1/routes/用户関連リスト.json
force-app/main/default/experiences/Consumable1/themes/partnerCentral.json
force-app/main/default/experiences/Consumable1/variations/defaultCustomComponentPropertiesComponentProperties.json
force-app/main/default/experiences/Consumable1/variations/defaultNavigationMenuComponentProperties.json
force-app/main/default/experiences/Consumable1/views/accountManagement.json
force-app/main/default/experiences/Consumable1/views/cICList.json
force-app/main/default/experiences/Consumable1/views/cICRelatedList.json
force-app/main/default/experiences/Consumable1/views/cICリスト.json
force-app/main/default/experiences/Consumable1/views/cIC関連リスト.json
force-app/main/default/experiences/Consumable1/views/campaignList.json
force-app/main/default/experiences/Consumable1/views/caseDetail.json
force-app/main/default/experiences/Consumable1/views/checkPassword.json
force-app/main/default/experiences/Consumable1/views/consumableDetailFix.json
force-app/main/default/experiences/Consumable1/views/contactSupport.json
force-app/main/default/experiences/Consumable1/views/createRecord.json
force-app/main/default/experiences/Consumable1/views/dashboardDetail.json
force-app/main/default/experiences/Consumable1/views/dashboardList.json
force-app/main/default/experiences/Consumable1/views/error.json
force-app/main/default/experiences/Consumable1/views/feedDetail.json
force-app/main/default/experiences/Consumable1/views/fileDetail.json
force-app/main/default/experiences/Consumable1/views/fileList.json
force-app/main/default/experiences/Consumable1/views/flow.json
force-app/main/default/experiences/Consumable1/views/forgotPassword.json
force-app/main/default/experiences/Consumable1/views/groupDetail.json
force-app/main/default/experiences/Consumable1/views/groupList.json
force-app/main/default/experiences/Consumable1/views/home.json
force-app/main/default/experiences/Consumable1/views/homeFlexible.json
force-app/main/default/experiences/Consumable1/views/lexAgencyInfo.json
force-app/main/default/experiences/Consumable1/views/lexArriveGoods.json
force-app/main/default/experiences/Consumable1/views/lexArriveGoodsMain.json
force-app/main/default/experiences/Consumable1/views/lexArriveGsDetails.json
force-app/main/default/experiences/Consumable1/views/lexCancelRemoveBox.json
force-app/main/default/experiences/Consumable1/views/lexConInvoiceView.json
force-app/main/default/experiences/Consumable1/views/lexConsumable.json
force-app/main/default/experiences/Consumable1/views/lexConsumableAccount.json
force-app/main/default/experiences/Consumable1/views/lexConsumableAccountInfoPrint.json
force-app/main/default/experiences/Consumable1/views/lexConsumableOrderManage.json
force-app/main/default/experiences/Consumable1/views/lexInventory.json
force-app/main/default/experiences/Consumable1/views/lexInventoryView.json
force-app/main/default/experiences/Consumable1/views/lexOutboundorderImport.json
force-app/main/default/experiences/Consumable1/views/lexOverdueStock.json
force-app/main/default/experiences/Consumable1/views/lexProductLimitEdit.json
force-app/main/default/experiences/Consumable1/views/lexRemoveBox.json
force-app/main/default/experiences/Consumable1/views/lexSaleAndDelivery.json
force-app/main/default/experiences/Consumable1/views/lexSummonsCreat.json
force-app/main/default/experiences/Consumable1/views/lexTopPage.json
force-app/main/default/experiences/Consumable1/views/login.json
force-app/main/default/experiences/Consumable1/views/loginError.json
force-app/main/default/experiences/Consumable1/views/mDFAndCoop.json
force-app/main/default/experiences/Consumable1/views/messages.json
force-app/main/default/experiences/Consumable1/views/myAccount.json
force-app/main/default/experiences/Consumable1/views/neworder.json
force-app/main/default/experiences/Consumable1/views/questionDetail.json
force-app/main/default/experiences/Consumable1/views/quipDocsRelatedList.json
force-app/main/default/experiences/Consumable1/views/recordDetail.json
force-app/main/default/experiences/Consumable1/views/recordList.json
force-app/main/default/experiences/Consumable1/views/register.json
force-app/main/default/experiences/Consumable1/views/relatedRecordList.json
force-app/main/default/experiences/Consumable1/views/reportBuilder.json
force-app/main/default/experiences/Consumable1/views/reportDetail.json
force-app/main/default/experiences/Consumable1/views/reportList.json
force-app/main/default/experiences/Consumable1/views/resources.json
force-app/main/default/experiences/Consumable1/views/search.json
force-app/main/default/experiences/Consumable1/views/streamDetail.json
force-app/main/default/experiences/Consumable1/views/streamList.json
force-app/main/default/experiences/Consumable1/views/topicCatalog.json
force-app/main/default/experiences/Consumable1/views/topicDetail.json
force-app/main/default/experiences/Consumable1/views/userProfile.json
force-app/main/default/experiences/Consumable1/views/userSettings.json
force-app/main/default/experiences/Consumable1/views/仪表板RelatedList.json
force-app/main/default/experiences/Consumable1/views/仪表板関連リスト.json
force-app/main/default/experiences/Consumable1/views/学会・培训Detail.json
force-app/main/default/experiences/Consumable1/views/学会・培训RelatedList.json
force-app/main/default/experiences/Consumable1/views/学会・培训詳細.json
force-app/main/default/experiences/Consumable1/views/学会・培训関連リスト.json
force-app/main/default/experiences/Consumable1/views/小组RelatedList.json
force-app/main/default/experiences/Consumable1/views/小组関連リスト.json
force-app/main/default/experiences/Consumable1/views/库存.json
force-app/main/default/experiences/Consumable1/views/库存上下限编辑.json
force-app/main/default/experiences/Consumable1/views/报表RelatedList.json
force-app/main/default/experiences/Consumable1/views/报表関連リスト.json
force-app/main/default/experiences/Consumable1/views/文件RelatedList.json
force-app/main/default/experiences/Consumable1/views/文件関連リスト.json
force-app/main/default/experiences/Consumable1/views/流RelatedList.json
force-app/main/default/experiences/Consumable1/views/流関連リスト.json
force-app/main/default/experiences/Consumable1/views/消耗品订单列表.json
force-app/main/default/experiences/Consumable1/views/消耗品订单相关列表.json
force-app/main/default/experiences/Consumable1/views/消耗品订单详细信息.json
force-app/main/default/experiences/Consumable1/views/用户List.json
force-app/main/default/experiences/Consumable1/views/用户RelatedList.json
force-app/main/default/experiences/Consumable1/views/用户リスト.json
force-app/main/default/experiences/Consumable1/views/用户関連リスト.json
force-app/main/default/experiences/Consumable_21.site-meta.xml
force-app/main/default/experiences/Consumable_21/brandingSets/partnerCentral.json
force-app/main/default/experiences/Consumable_21/config/consumable系统2.json
force-app/main/default/experiences/Consumable_21/config/languages.json
force-app/main/default/experiences/Consumable_21/config/loginAppPage.json
force-app/main/default/experiences/Consumable_21/config/mainAppPage.json
force-app/main/default/experiences/Consumable_21/routes/accountManagement.json
force-app/main/default/experiences/Consumable_21/routes/cICList.json
force-app/main/default/experiences/Consumable_21/routes/cICRelatedList.json
force-app/main/default/experiences/Consumable_21/routes/campaignDetail.json
force-app/main/default/experiences/Consumable_21/routes/campaignList.json
force-app/main/default/experiences/Consumable_21/routes/campaignRelatedList.json
force-app/main/default/experiences/Consumable_21/routes/caseDetail.json
force-app/main/default/experiences/Consumable_21/routes/checkPassword.json
force-app/main/default/experiences/Consumable_21/routes/contactSupport.json
force-app/main/default/experiences/Consumable_21/routes/createRecord.json
force-app/main/default/experiences/Consumable_21/routes/dashboardDetail.json
force-app/main/default/experiences/Consumable_21/routes/dashboardList.json
force-app/main/default/experiences/Consumable_21/routes/dashboardRelatedList.json
force-app/main/default/experiences/Consumable_21/routes/error.json
force-app/main/default/experiences/Consumable_21/routes/feedDetail.json
force-app/main/default/experiences/Consumable_21/routes/fileDetail.json
force-app/main/default/experiences/Consumable_21/routes/fileList.json
force-app/main/default/experiences/Consumable_21/routes/fileRelatedList.json
force-app/main/default/experiences/Consumable_21/routes/flow.json
force-app/main/default/experiences/Consumable_21/routes/forgotPassword.json
force-app/main/default/experiences/Consumable_21/routes/groupDetail.json
force-app/main/default/experiences/Consumable_21/routes/groupList.json
force-app/main/default/experiences/Consumable_21/routes/groupRelatedList.json
force-app/main/default/experiences/Consumable_21/routes/home.json
force-app/main/default/experiences/Consumable_21/routes/lexAgencyInfo.json
force-app/main/default/experiences/Consumable_21/routes/lexArriveGoods.json
force-app/main/default/experiences/Consumable_21/routes/lexArriveGoodsMain.json
force-app/main/default/experiences/Consumable_21/routes/lexArriveGsDetails.json
force-app/main/default/experiences/Consumable_21/routes/lexCancelRemoveBox.json
force-app/main/default/experiences/Consumable_21/routes/lexConInvoiceView.json
force-app/main/default/experiences/Consumable_21/routes/lexConsumable.json
force-app/main/default/experiences/Consumable_21/routes/lexConsumableAccount.json
force-app/main/default/experiences/Consumable_21/routes/lexConsumableAccountInfoPrint.json
force-app/main/default/experiences/Consumable_21/routes/lexConsumableOrderManage.json
force-app/main/default/experiences/Consumable_21/routes/lexInventory.json
force-app/main/default/experiences/Consumable_21/routes/lexInventoryView.json
force-app/main/default/experiences/Consumable_21/routes/lexOutboundorderImport.json
force-app/main/default/experiences/Consumable_21/routes/lexOverdueStock.json
force-app/main/default/experiences/Consumable_21/routes/lexProductLimitEdit.json
force-app/main/default/experiences/Consumable_21/routes/lexRemoveBox.json
force-app/main/default/experiences/Consumable_21/routes/lexSaleAndDelivery.json
force-app/main/default/experiences/Consumable_21/routes/lexSummonsCreat.json
force-app/main/default/experiences/Consumable_21/routes/lexTopPage.json
force-app/main/default/experiences/Consumable_21/routes/login.json
force-app/main/default/experiences/Consumable_21/routes/loginError.json
force-app/main/default/experiences/Consumable_21/routes/mDFAndCoop.json
force-app/main/default/experiences/Consumable_21/routes/messages.json
force-app/main/default/experiences/Consumable_21/routes/myAccount.json
force-app/main/default/experiences/Consumable_21/routes/questionDetail.json
force-app/main/default/experiences/Consumable_21/routes/quipDocsRelatedList.json
force-app/main/default/experiences/Consumable_21/routes/recordDetail.json
force-app/main/default/experiences/Consumable_21/routes/recordList.json
force-app/main/default/experiences/Consumable_21/routes/register.json
force-app/main/default/experiences/Consumable_21/routes/relatedRecordList.json
force-app/main/default/experiences/Consumable_21/routes/reportBuilder.json
force-app/main/default/experiences/Consumable_21/routes/reportDetail.json
force-app/main/default/experiences/Consumable_21/routes/reportList.json
force-app/main/default/experiences/Consumable_21/routes/reportRelatedList.json
force-app/main/default/experiences/Consumable_21/routes/resources.json
force-app/main/default/experiences/Consumable_21/routes/search.json
force-app/main/default/experiences/Consumable_21/routes/streamDetail.json
force-app/main/default/experiences/Consumable_21/routes/streamList.json
force-app/main/default/experiences/Consumable_21/routes/streamRelatedList.json
force-app/main/default/experiences/Consumable_21/routes/topicCatalog.json
force-app/main/default/experiences/Consumable_21/routes/topicDetail.json
force-app/main/default/experiences/Consumable_21/routes/userList.json
force-app/main/default/experiences/Consumable_21/routes/userProfile.json
force-app/main/default/experiences/Consumable_21/routes/userRelatedList.json
force-app/main/default/experiences/Consumable_21/routes/userSettings.json
force-app/main/default/experiences/Consumable_21/routes/消耗品订单Detail.json
force-app/main/default/experiences/Consumable_21/routes/消耗品订单List.json
force-app/main/default/experiences/Consumable_21/routes/消耗品订单RelatedList.json
force-app/main/default/experiences/Consumable_21/themes/partnerCentral.json
force-app/main/default/experiences/Consumable_21/variations/defaultNavigationMenuComponentProperties.json
force-app/main/default/experiences/Consumable_21/views/accountManagement.json
force-app/main/default/experiences/Consumable_21/views/cICList.json
force-app/main/default/experiences/Consumable_21/views/cICRelatedList.json
force-app/main/default/experiences/Consumable_21/views/campaignDetail.json
force-app/main/default/experiences/Consumable_21/views/campaignList.json
force-app/main/default/experiences/Consumable_21/views/campaignRelatedList.json
force-app/main/default/experiences/Consumable_21/views/caseDetail.json
force-app/main/default/experiences/Consumable_21/views/checkPassword.json
force-app/main/default/experiences/Consumable_21/views/consumableDetailFix.json
force-app/main/default/experiences/Consumable_21/views/contactSupport.json
force-app/main/default/experiences/Consumable_21/views/createRecord.json
force-app/main/default/experiences/Consumable_21/views/dashboardDetail.json
force-app/main/default/experiences/Consumable_21/views/dashboardList.json
force-app/main/default/experiences/Consumable_21/views/dashboardRelatedList.json
force-app/main/default/experiences/Consumable_21/views/error.json
force-app/main/default/experiences/Consumable_21/views/feedDetail.json
force-app/main/default/experiences/Consumable_21/views/fileDetail.json
force-app/main/default/experiences/Consumable_21/views/fileList.json
force-app/main/default/experiences/Consumable_21/views/fileRelatedList.json
force-app/main/default/experiences/Consumable_21/views/flow.json
force-app/main/default/experiences/Consumable_21/views/forgotPassword.json
force-app/main/default/experiences/Consumable_21/views/groupDetail.json
force-app/main/default/experiences/Consumable_21/views/groupList.json
force-app/main/default/experiences/Consumable_21/views/groupRelatedList.json
force-app/main/default/experiences/Consumable_21/views/home.json
force-app/main/default/experiences/Consumable_21/views/homeFlexible.json
force-app/main/default/experiences/Consumable_21/views/lexAgencyInfo.json
force-app/main/default/experiences/Consumable_21/views/lexArriveGoods.json
force-app/main/default/experiences/Consumable_21/views/lexArriveGoodsMain.json
force-app/main/default/experiences/Consumable_21/views/lexArriveGsDetails.json
force-app/main/default/experiences/Consumable_21/views/lexCancelRemoveBox.json
force-app/main/default/experiences/Consumable_21/views/lexConInvoiceView.json
force-app/main/default/experiences/Consumable_21/views/lexConsumable.json
force-app/main/default/experiences/Consumable_21/views/lexConsumableAccount.json
force-app/main/default/experiences/Consumable_21/views/lexConsumableAccountInfoPrint.json
force-app/main/default/experiences/Consumable_21/views/lexConsumableOrderManage.json
force-app/main/default/experiences/Consumable_21/views/lexInventory.json
force-app/main/default/experiences/Consumable_21/views/lexInventoryView.json
force-app/main/default/experiences/Consumable_21/views/lexOutboundorderImport.json
force-app/main/default/experiences/Consumable_21/views/lexOverdueStock.json
force-app/main/default/experiences/Consumable_21/views/lexProductLimitEdit.json
force-app/main/default/experiences/Consumable_21/views/lexRemoveBox.json
force-app/main/default/experiences/Consumable_21/views/lexSaleAndDelivery.json
force-app/main/default/experiences/Consumable_21/views/lexSummonsCreat.json
force-app/main/default/experiences/Consumable_21/views/lexTopPage.json
force-app/main/default/experiences/Consumable_21/views/login.json
force-app/main/default/experiences/Consumable_21/views/loginError.json
force-app/main/default/experiences/Consumable_21/views/mDFAndCoop.json
force-app/main/default/experiences/Consumable_21/views/messages.json
force-app/main/default/experiences/Consumable_21/views/myAccount.json
force-app/main/default/experiences/Consumable_21/views/questionDetail.json
force-app/main/default/experiences/Consumable_21/views/quipDocsRelatedList.json
force-app/main/default/experiences/Consumable_21/views/recordDetail.json
force-app/main/default/experiences/Consumable_21/views/recordList.json
force-app/main/default/experiences/Consumable_21/views/register.json
force-app/main/default/experiences/Consumable_21/views/relatedRecordList.json
force-app/main/default/experiences/Consumable_21/views/reportBuilder.json
force-app/main/default/experiences/Consumable_21/views/reportDetail.json
force-app/main/default/experiences/Consumable_21/views/reportList.json
force-app/main/default/experiences/Consumable_21/views/reportRelatedList.json
force-app/main/default/experiences/Consumable_21/views/resources.json
force-app/main/default/experiences/Consumable_21/views/search.json
force-app/main/default/experiences/Consumable_21/views/streamDetail.json
force-app/main/default/experiences/Consumable_21/views/streamList.json
force-app/main/default/experiences/Consumable_21/views/streamRelatedList.json
force-app/main/default/experiences/Consumable_21/views/topicCatalog.json
force-app/main/default/experiences/Consumable_21/views/topicDetail.json
force-app/main/default/experiences/Consumable_21/views/userList.json
force-app/main/default/experiences/Consumable_21/views/userProfile.json
force-app/main/default/experiences/Consumable_21/views/userRelatedList.json
force-app/main/default/experiences/Consumable_21/views/userSettings.json
force-app/main/default/experiences/Consumable_21/views/消耗品订单Detail.json
force-app/main/default/experiences/Consumable_21/views/消耗品订单List.json
force-app/main/default/experiences/Consumable_21/views/消耗品订单RelatedList.json
force-app/main/default/experiences/Partner21.site-meta.xml
force-app/main/default/experiences/Partner21/brandingSets/partnerCentral.json
force-app/main/default/experiences/Partner21/config/languages.json
force-app/main/default/experiences/Partner21/config/loginAppPage.json
force-app/main/default/experiences/Partner21/config/mainAppPage.json
force-app/main/default/experiences/Partner21/config/partner2.json
force-app/main/default/experiences/Partner21/routes/accountManagement.json
force-app/main/default/experiences/Partner21/routes/cICリスト.json
force-app/main/default/experiences/Partner21/routes/cIC関連リスト.json
force-app/main/default/experiences/Partner21/routes/campaignList.json
force-app/main/default/experiences/Partner21/routes/caseDetail.json
force-app/main/default/experiences/Partner21/routes/checkPassword.json
force-app/main/default/experiences/Partner21/routes/contactSupport.json
force-app/main/default/experiences/Partner21/routes/createRecord.json
force-app/main/default/experiences/Partner21/routes/dashboardDetail.json
force-app/main/default/experiences/Partner21/routes/dashboardList.json
force-app/main/default/experiences/Partner21/routes/error.json
force-app/main/default/experiences/Partner21/routes/feedDetail.json
force-app/main/default/experiences/Partner21/routes/fileDetail.json
force-app/main/default/experiences/Partner21/routes/fileList.json
force-app/main/default/experiences/Partner21/routes/flow.json
force-app/main/default/experiences/Partner21/routes/forgotPassword.json
force-app/main/default/experiences/Partner21/routes/groupDetail.json
force-app/main/default/experiences/Partner21/routes/groupList.json
force-app/main/default/experiences/Partner21/routes/home.json
force-app/main/default/experiences/Partner21/routes/login.json
force-app/main/default/experiences/Partner21/routes/loginError.json
force-app/main/default/experiences/Partner21/routes/mDFAndCoop.json
force-app/main/default/experiences/Partner21/routes/messages.json
force-app/main/default/experiences/Partner21/routes/myAccount.json
force-app/main/default/experiences/Partner21/routes/questionDetail.json
force-app/main/default/experiences/Partner21/routes/quipDocsRelatedList.json
force-app/main/default/experiences/Partner21/routes/recordDetail.json
force-app/main/default/experiences/Partner21/routes/recordList.json
force-app/main/default/experiences/Partner21/routes/register.json
force-app/main/default/experiences/Partner21/routes/relatedRecordList.json
force-app/main/default/experiences/Partner21/routes/reportBuilder.json
force-app/main/default/experiences/Partner21/routes/reportDetail.json
force-app/main/default/experiences/Partner21/routes/reportList.json
force-app/main/default/experiences/Partner21/routes/resources.json
force-app/main/default/experiences/Partner21/routes/search.json
force-app/main/default/experiences/Partner21/routes/streamDetail.json
force-app/main/default/experiences/Partner21/routes/streamList.json
force-app/main/default/experiences/Partner21/routes/topicCatalog.json
force-app/main/default/experiences/Partner21/routes/topicDetail.json
force-app/main/default/experiences/Partner21/routes/userProfile.json
force-app/main/default/experiences/Partner21/routes/userSettings.json
force-app/main/default/experiences/Partner21/routes/仪表板関連リスト.json
force-app/main/default/experiences/Partner21/routes/学会・培训詳細.json
force-app/main/default/experiences/Partner21/routes/学会・培训関連リスト.json
force-app/main/default/experiences/Partner21/routes/小组関連リスト.json
force-app/main/default/experiences/Partner21/routes/报表関連リスト.json
force-app/main/default/experiences/Partner21/routes/文件関連リスト.json
force-app/main/default/experiences/Partner21/routes/流関連リスト.json
force-app/main/default/experiences/Partner21/routes/用户リスト.json
force-app/main/default/experiences/Partner21/routes/用户関連リスト.json
force-app/main/default/experiences/Partner21/themes/partnerCentral.json
force-app/main/default/experiences/Partner21/views/accountManagement.json
force-app/main/default/experiences/Partner21/views/cICリスト.json
force-app/main/default/experiences/Partner21/views/cIC関連リスト.json
force-app/main/default/experiences/Partner21/views/campaignList.json
force-app/main/default/experiences/Partner21/views/caseDetail.json
force-app/main/default/experiences/Partner21/views/checkPassword.json
force-app/main/default/experiences/Partner21/views/contactSupport.json
force-app/main/default/experiences/Partner21/views/createRecord.json
force-app/main/default/experiences/Partner21/views/dashboardDetail.json
force-app/main/default/experiences/Partner21/views/dashboardList.json
force-app/main/default/experiences/Partner21/views/error.json
force-app/main/default/experiences/Partner21/views/feedDetail.json
force-app/main/default/experiences/Partner21/views/fileDetail.json
force-app/main/default/experiences/Partner21/views/fileList.json
force-app/main/default/experiences/Partner21/views/flow.json
force-app/main/default/experiences/Partner21/views/forgotPassword.json
force-app/main/default/experiences/Partner21/views/groupDetail.json
force-app/main/default/experiences/Partner21/views/groupList.json
force-app/main/default/experiences/Partner21/views/home.json
force-app/main/default/experiences/Partner21/views/login.json
force-app/main/default/experiences/Partner21/views/loginError.json
force-app/main/default/experiences/Partner21/views/mDFAndCoop.json
force-app/main/default/experiences/Partner21/views/messages.json
force-app/main/default/experiences/Partner21/views/myAccount.json
force-app/main/default/experiences/Partner21/views/questionDetail.json
force-app/main/default/experiences/Partner21/views/quipDocsRelatedList.json
force-app/main/default/experiences/Partner21/views/recordDetail.json
force-app/main/default/experiences/Partner21/views/recordList.json
force-app/main/default/experiences/Partner21/views/register.json
force-app/main/default/experiences/Partner21/views/relatedRecordList.json
force-app/main/default/experiences/Partner21/views/reportBuilder.json
force-app/main/default/experiences/Partner21/views/reportDetail.json
force-app/main/default/experiences/Partner21/views/reportList.json
force-app/main/default/experiences/Partner21/views/resources.json
force-app/main/default/experiences/Partner21/views/search.json
force-app/main/default/experiences/Partner21/views/streamDetail.json
force-app/main/default/experiences/Partner21/views/streamList.json
force-app/main/default/experiences/Partner21/views/topicCatalog.json
force-app/main/default/experiences/Partner21/views/topicDetail.json
force-app/main/default/experiences/Partner21/views/userProfile.json
force-app/main/default/experiences/Partner21/views/userSettings.json
force-app/main/default/experiences/Partner21/views/仪表板関連リスト.json
force-app/main/default/experiences/Partner21/views/学会・培训詳細.json
force-app/main/default/experiences/Partner21/views/学会・培训関連リスト.json
force-app/main/default/experiences/Partner21/views/小组関連リスト.json
force-app/main/default/experiences/Partner21/views/报表関連リスト.json
force-app/main/default/experiences/Partner21/views/文件関連リスト.json
force-app/main/default/experiences/Partner21/views/流関連リスト.json
force-app/main/default/experiences/Partner21/views/用户リスト.json
force-app/main/default/experiences/Partner21/views/用户関連リスト.json
force-app/main/default/experiences/Site3.site-meta.xml
force-app/main/default/experiences/Site3/brandingSets/buildYourOwn.json
force-app/main/default/experiences/Site3/config/languages.json
force-app/main/default/experiences/Site3/config/loginAppPage.json
force-app/main/default/experiences/Site3/config/mainAppPage.json
force-app/main/default/experiences/Site3/config/电子签收系统.json
force-app/main/default/experiences/Site3/routes/checkPassword.json
force-app/main/default/experiences/Site3/routes/createRecord.json
force-app/main/default/experiences/Site3/routes/error.json
force-app/main/default/experiences/Site3/routes/forgotPassword.json
force-app/main/default/experiences/Site3/routes/home.json
force-app/main/default/experiences/Site3/routes/login.json
force-app/main/default/experiences/Site3/routes/loginError.json
force-app/main/default/experiences/Site3/routes/recordDetail.json
force-app/main/default/experiences/Site3/routes/recordList.json
force-app/main/default/experiences/Site3/routes/register.json
force-app/main/default/experiences/Site3/routes/relatedRecordList.json
force-app/main/default/experiences/Site3/routes/search.json
force-app/main/default/experiences/Site3/routes/奥林巴斯电子签收系统.json
force-app/main/default/experiences/Site3/routes/进口单证明细.json
force-app/main/default/experiences/Site3/themes/buildYourOwn.json
force-app/main/default/experiences/Site3/views/checkPassword.json
force-app/main/default/experiences/Site3/views/createRecord.json
force-app/main/default/experiences/Site3/views/error.json
force-app/main/default/experiences/Site3/views/forgotPassword.json
force-app/main/default/experiences/Site3/views/home.json
force-app/main/default/experiences/Site3/views/login.json
force-app/main/default/experiences/Site3/views/loginError.json
force-app/main/default/experiences/Site3/views/recordDetail.json
force-app/main/default/experiences/Site3/views/recordList.json
force-app/main/default/experiences/Site3/views/register.json
force-app/main/default/experiences/Site3/views/relatedRecordList.json
force-app/main/default/experiences/Site3/views/search.json
force-app/main/default/experiences/Site3/views/奥林巴斯电子签收系统.json
force-app/main/default/experiences/Site3/views/进口单证明细.json
force-app/main/default/labels/CustomLabels.labels-meta.xml
force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.html
force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js
force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js-meta.xml
force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.html
force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.js
force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.js-meta.xml
force-app/main/default/lwc/customMydrComp/customMydrComp.html
force-app/main/default/lwc/customMydrComp/customMydrComp.js
force-app/main/default/lwc/customMydrComp/customMydrComp.js-meta.xml
force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html
force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.js
force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.html
force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js
force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.css
force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.html
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.css
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html
force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js
force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.html
force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js
force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html
force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.css
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
force-app/main/default/lwc/lexConsumable/lexConsumable.html
force-app/main/default/lwc/lexConsumable/lexConsumable.js
force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.html
force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js
force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.html
force-app/main/default/lwc/lexCssUtility/lexCssUtility.css
force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.html
force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html
force-app/main/default/lwc/lexCustomLightningDatatable/customMyDrCheckBox.html
force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentNumber.html
force-app/main/default/lwc/lexCustomLightningDatatable/customaccountUrl.html
force-app/main/default/lwc/lexCustomLightningDatatable/customdeleteReason.html
force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.js
force-app/main/default/lwc/lexInventory/lexInventory.css
force-app/main/default/lwc/lexInventory/lexInventory.html
force-app/main/default/lwc/lexInventory/lexInventory.js
force-app/main/default/lwc/lexLookup/lexLookup.html
force-app/main/default/lwc/lexNewAndEditContactPIPL/lexNewAndEditContactPIPL.css
force-app/main/default/lwc/lexNewAndEditContactPIPL/lexNewAndEditContactPIPL.html
force-app/main/default/lwc/lexNewAndEditContactPIPL/lexNewAndEditContactPIPL.js
force-app/main/default/lwc/lexNewAndEditContactPIPL/lexNewAndEditContactPIPL.js-meta.xml
force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.html
force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.js
force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.html
force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.js
force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.html
force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.js
force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html
force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js
force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html
force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js
force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.css
force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.html
force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
force-app/main/default/lwc/lexTopPage/lexTopPage.html
force-app/main/default/lwc/lexTopPage/lexTopPage.js
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.css
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
force-app/main/default/networks/Consumable系统.network-meta.xml
force-app/main/default/networks/Consumable系统2.network-meta.xml
force-app/main/default/networks/Partner Sales.network-meta.xml
force-app/main/default/networks/Partner2.network-meta.xml
force-app/main/default/networks/消耗品管理系统.network-meta.xml
force-app/main/default/networks/电子签收系统.network-meta.xml
force-app/main/default/pages/DealerInquiryModifyState.page
force-app/main/default/pages/DealerInquiryModifyState.page-meta.xml
force-app/main/default/pages/OFSInsReportLayout.page
force-app/main/default/pages/StraightBackAddress.page
force-app/main/default/pages/StraightBackAddress.page-meta.xml
force-app/main/default/permissionsets/Community_Consumable_LEX_PS.permissionset-meta.xml
force-app/main/default/permissionsets/Community_LEX_PS.permissionset-meta.xml
force-app/main/default/reports/ConsumableSalesReport.reportFolder-meta.xml
force-app/main/default/reports/ConsumableSalesReport/Consumable_Outstock_Invoice_Lex.report-meta.xml
force-app/main/default/reports/ConsumableSalesReport/CurrentMonthSalesRankByAccount.report-meta.xml
force-app/main/default/reports/ConsumableSalesReport/CurrentMonthSalesRankByProduct.report-meta.xml
force-app/main/default/reports/ConsumableSalesReport/LastMonthSalesByAccount1.report-meta.xml
force-app/main/default/reports/ConsumableSalesReport/LastMonthSalesByProduct.report-meta.xml
force-app/main/default/reports/ConsumableSalesReport/Report_Outbound_Lex.report-meta.xml
force-app/main/default/reports/ConsumableSalesReport/WeeklyReportForAgency.report-meta.xml
force-app/main/default/reports/Consumable_KC/CurrentMonthSalesRankByAccount.report-meta.xml (deleted)
force-app/main/default/reports/Consumable_KC/CurrentMonthSalesRankByProduct.report-meta.xml (deleted)
force-app/main/default/reports/Consumable_KC/LastMonthSalesByAccount1.report-meta.xml (deleted)
force-app/main/default/reports/Consumable_KC/LastMonthSalesByProduct.report-meta.xml (deleted)
force-app/main/default/reports/Consumable_KC/WeeklyReportForAgency.report-meta.xml (deleted)
force-app/main/default/reports/Store_Custom_ReportLink/Consumable_Outstock_Invoice_Lex.report-meta.xml (deleted)
force-app/main/default/reports/Store_Custom_ReportLink/Report_Outbound_Lex.report-meta.xml (deleted)
force-app/main/default/sites/Consumable.site-meta.xml
force-app/main/default/sites/Consumable_2.site-meta.xml
force-app/main/default/sites/Partner2.site-meta.xml
force-app/main/default/sites/Partner_Sales.site-meta.xml
force-app/main/default/sites/Site.site-meta.xml
force-app/main/default/sites/Site2.site-meta.xml
force-app/main/default/sites/extsurvey.site-meta.xml
force-app/main/default/staticresources/lexdatatable.css
force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger
force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger-meta.xml
force-app/main/default/triggers/ConsumableOrderTrigger.trigger
force-app/main/default/triggers/ContentDocumentLink.trigger
force-app/main/default/triggers/ContentDocumentTrigger.trigger
manifest/LEXC00basecmp.xml
manifest/LEXC01packagelexcommunitynew.xml
manifest/LEXC02packagelexcommunityupdate.xml
manifest/LEXC03Dahsboard.xml
manifest/LEXC03report.xml
manifest/LEXC03reportanddashboard.xml (deleted)
manifest/LEXC04packagecommdeploy.xml |