| | |
| | | { |
| | | "target-org": "OlympusProd" |
| | | "target-org": "OlympusDev" |
| | | } |
| | |
| | | <aura:component |
| | | controller="CreateTargetCmp" |
| | | implements="forceCommunity:availableForAllPageTypes,force:hasRecordId" |
| | | implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" |
| | | access="global" |
| | | > |
| | | <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> |
| | |
| | | onclick="{!c.toggle_report}" |
| | | > |
| | | <lightning:icon |
| | | class="close_icn" |
| | | iconName="utility:close" |
| | | size="medium" |
| | | alternativeText="Indicates approval" |
| | | alternative-text="close" |
| | | variant="inverse" |
| | | /> |
| | | <span class="slds-assistive-text">Close</span> |
| | | </button> |
| | |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >医院</label |
| | | > |
| | | <force:inputField |
| | | value="{!v.record.Agency_Hospital__c}" |
| | | aura:id="input-hos" |
| | | /> |
| | | <!-- <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> |
| | |
| | | <?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; |
| | | } |
| | |
| | | action.setParams({ recordId: recordId }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | 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") { |
| | | console.log("flag1"); |
| | | var values = [ |
| | | { |
| | | type: "Agency_Hospital_Link__c", |
| | |
| | | } |
| | | } |
| | | ]; |
| | | component |
| | | .find("input-hos") |
| | | .get("v.body")[0] |
| | | .set("v.values", values); |
| | | // 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); |
| | | // 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 action = component.get("c.getProductList"); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | console.log("state2:" + state); |
| | | if (state === "SUCCESS") { |
| | | var opts = response.getReturnValue(); |
| | | // alert(JSON.stringify(opts["GI"])); |
| | |
| | | <aura:component |
| | | controller="RetrospectiveWeeklyReportController" |
| | | implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" |
| | | implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes,lightning:availableForFlowScreens" |
| | | access="global" |
| | | > |
| | | <ltng:require styles="{!$Resource.multilineToastCSS}" /> |
| | |
| | | <aura:attribute |
| | | name="acondata" |
| | | type="Agency_Contact__c" |
| | | default="{sobjectType:'Agency_Contact__c'}" |
| | | default="{sobjectType:'Ag |
| | | ency_Contact__c'}" |
| | | /> |
| | | <aura:attribute name="successMessage" type="String" /> |
| | | <aura:attribute name="etEng" 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="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="NumOfRecords" type="Integer" default="1000" /> |
| | | <aura:attribute name="showMain" type="Boolean" default="true" /> |
| | | <aura:attribute name="IsEventDefault" type="Boolean" default="true" /> |
| | | <!-- 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--> |
| | | |
| | | <aura:attribute name="PIConfig" type="Map" /> |
| | | |
| | |
| | | <!-- 批量添加日报 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" |
| | | > |
| | | <span class="slds-assistive-text">Loading</span> |
| | | <div class="slds-spinner__dot-a"></div> |
| | | <div class="slds-spinner__dot-b"></div> |
| | | <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> |
| | | </aura:renderIf> |
| | | </aura:renderIf> |
| | | <div aura:id="report" id="report" class="contents_wrapper"> |
| | | <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"></th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <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 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"> |
| | | <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"> |
| | | <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 |
| | | > |
| | |
| | | <tbody> |
| | | <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> |
| | | </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}"> |
| | | <lightning:input |
| | |
| | | class="disp_none slds-modal slds-fade-in-open slds-modal--large" |
| | | aria-labelledby="headerTarget" |
| | | > |
| | | <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> |
| | | </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-notify_container slds-is-relative"> |
| | | <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" |
| | | /> |
| | | <h2 class="slds-text-heading_small">{!v.errorMessage}</h2> |
| | | </div> |
| | | <!-- <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-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" /> |
| | | <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> |
| | | </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"> |
| | |
| | | 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"> |
| | | <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> |
| | | </aura:set> |
| | | </aura:if> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <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}" |
| | | /> |
| | | </div> |
| | | <div class="slds-modal__content slds-grow slds-p-around--medium"> |
| | | |
| | | <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}) |
| | | </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-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 |
| | | 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-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="医院" --> |
| | |
| | | class="field" |
| | | value="{!v.hospital}" |
| | | updateOn="keyup" |
| | | variant="label-hidden" |
| | | /> |
| | | <div class="slds-lookup__menu" id="lookup-66"> |
| | | <ul class="slds-lookup__list" role="listbox"> |
| | |
| | | </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 |
| | | <!-- <ui:inputText aura:id="select_department" class="slds-select" |
| | | change="{!c.select_department}"/> --> |
| | | <lightning:input |
| | | type="text" |
| | | onchange="{!c.select_department}" |
| | | aura:id="select_department" |
| | | class="slds-select" |
| | | change="{!c.select_department}" |
| | | variant="label-hidden" |
| | | /> |
| | | </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(产品型号)" --> |
| | |
| | | class="field" |
| | | value="{!v.UseProduct1}" |
| | | updateOn="keyup" |
| | | variant="label-hidden" |
| | | /> |
| | | <div class="slds-lookup__menu" id="lookup-11"> |
| | | <ul |
| | |
| | | <!-- 使用产品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" --> |
| | |
| | | class="field" |
| | | value="{!v.UseProduct2}" |
| | | updateOn="keyup" |
| | | variant="label-hidden" |
| | | /> |
| | | <div class="slds-lookup__menu" id="lookup-22"> |
| | | <ul |
| | |
| | | <!-- 使用产品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" --> |
| | |
| | | class="field" |
| | | value="{!v.UseProduct3}" |
| | | updateOn="keyup" |
| | | variant="label-hidden" |
| | | /> |
| | | <div class="slds-lookup__menu" id="lookup-33"> |
| | | <ul |
| | |
| | | <!-- 效果/进度 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 |
| | | <!-- <ui:inputText aura:id="select_ConsumptionOfConsumables" class="slds-select" |
| | | change="{!c.select_ConsumptionOfConsumables}" /> --> |
| | | <lightning:input |
| | | type="text" |
| | | onchange="{!c.select_ConsumptionOfConsumables}" |
| | | aura:id="select_ConsumptionOfConsumables" |
| | | class="slds-select" |
| | | change="{!c.select_ConsumptionOfConsumables}" |
| | | variant="label-hidden" |
| | | /> |
| | | </div> |
| | | <!-- 术士分类 WarlockClassification__c --> |
| | |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | > |
| | | {!v.fieldsmap.warlocksNumber__c} |
| | | <ui:inputText |
| | | <!-- <ui:inputText aura:id="select_warlocksNumber" class="slds-select" |
| | | change="{!c.select_warlocksNumber}" /> --> |
| | | <lightning:input |
| | | type="text" |
| | | onchange="{!c.select_warlocksNumber}" |
| | | aura:id="select_warlocksNumber" |
| | | class="slds-select" |
| | | change="{!c.select_warlocksNumber}" |
| | | variant="label-hidden" |
| | | /> |
| | | </div> |
| | | <!-- 支援需求 WorkMark__c--> |
| | | <div style="padding-left: 20px"> |
| | | <div style="padding-left: 12px"> |
| | | {!v.fieldsmap.WorkMark__c} |
| | | <lightning:input type="checkbox" aura:id="select_WorkMark" /> |
| | | </div> |
| | |
| | | @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: 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; |
| | | } |
| | |
| | | .THIS .customRequired { |
| | | font-weight: 400; |
| | | } |
| | | |
| | | .THIS .customRequired:before { |
| | | 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; |
| | | } |
| | |
| | | CreateRecord: function (component, event, helper) { |
| | | 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); |
| | | }, |
| | | |
| | | cancel: function (component, event, helper) { |
| | |
| | | }, |
| | | return_main_page: function (component, event, helper) { |
| | | 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"); |
| | | } |
| | | }); |
| | |
| | | ({ |
| | | doinit: function (component, event, helper) { |
| | | debugger; |
| | | document.title = "追溯日报"; |
| | | |
| | | this.report_date_list(component, event, helper, 5); |
| | | component.set("v.login", true); |
| | | var action = component.get("c.getalldata"); |
| | |
| | | component.set("v.allselectlist", res.allselectlist); |
| | | component.set("v.doclist", res.doclist); |
| | | //fy |
| | | debugger; |
| | | |
| | | var xx = res.UserProType; |
| | | component.set("v.UserProType", res.UserProType); |
| | | var gg = component.get("v.UserProType"); |
| | |
| | | component.set("v.PIConfig", res.PIConfig); // 20220222 PI改造 by Bright |
| | | component.set("v.login", false); |
| | | } else { |
| | | component.set("v.errorMessage", "doinit failed."); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', 'doinit failed.'); |
| | | this.error("doinit failed."); |
| | | //this.showErrorToast(component); |
| | | component.set("v.login", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | doinitSave: function (component, event, helper) { |
| | | document.title = "追溯日报"; |
| | | component.set("v.loginEdit", true); |
| | | this.report_date_list(component, event, helper, 5); |
| | | var action = component.get("c.getalldata"); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == "SUCCESS") { |
| | | var res = response.getReturnValue(); |
| | | component.set("v.alldata", res.reports); |
| | | component.set("v.fieldsmap", res.fieldsMap); |
| | | component.set("v.allselectlist", res.allselectlist); |
| | | component.set("v.doclist", res.doclist); |
| | | //fy |
| | | |
| | | var xx = res.UserProType; |
| | | component.set("v.UserProType", res.UserProType); |
| | | var gg = component.get("v.UserProType"); |
| | | //fy |
| | | component |
| | | .find("select_agency_person") |
| | | .set( |
| | | "v.options", |
| | | this.conv_selected(res.allselectlist.AgencyPerson__c) |
| | | ); |
| | | component |
| | | .find("select_DealerPersonnel") |
| | | .set( |
| | | "v.options", |
| | | this.conv_selected(res.allselectlist.DealerPersonnel__c) |
| | | ); |
| | | component |
| | | .find("select_purpose_type") |
| | | .set( |
| | | "v.options", |
| | | this.conv_selected(res.allselectlist.WorkRecord__c) |
| | | ); |
| | | component |
| | | .find("select_ProductClassification") |
| | | .set( |
| | | "v.options", |
| | | this.conv_selected(res.allselectlist.ProductClassification__c) |
| | | ); |
| | | component |
| | | .find("select_stageName") |
| | | .set("v.options", this.conv_selected(res.allselectlist.StageName__c)); |
| | | component.set( |
| | | "v.selected_agency_person", |
| | | res.allselectlist.AgencyPerson__c[0].label |
| | | ); |
| | | component.set("v.dialog_type", "新建"); |
| | | this.get_reports( |
| | | component, |
| | | event, |
| | | helper, |
| | | component.find("select_date").get("v.value"), |
| | | component.find("select_agency_person").get("v.value") |
| | | ); |
| | | |
| | | component.set("v.PIConfig", res.PIConfig); // 20220222 PI改造 by Bright |
| | | component.set("v.loginEdit", false); |
| | | } else { |
| | | //component.set('v.errorMessage', 'doinit failed.'); |
| | | this.error("doinit failed."); |
| | | //this.showErrorToast(component); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | date_str: date_str, |
| | | person_str: person_str |
| | | }); |
| | | component.set("v.login", true); |
| | | component.set("v.loginEdit", true); |
| | | action.setCallback(this, function (response) { |
| | | debugger; |
| | | var state = response.getState(); |
| | | if (state == "SUCCESS") { |
| | | var res = response.getReturnValue(); |
| | |
| | | m[data.object[di].dataId] = data.object[di]; |
| | | } |
| | | } |
| | | debugger; |
| | | |
| | | for (let ri in res.reports) { |
| | | if ( |
| | | res.reports[ri] && |
| | |
| | | component.set("v.report_count", res.reports.length); |
| | | } |
| | | //fy 20220414 end |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | }, |
| | | staticResourceAgencyContact.token |
| | | ); |
| | | } else { |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | } |
| | | } else { |
| | | component.set("v.list_message", "no_data"); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | } else { |
| | | component.set("v.errorMessage", "get_reports failed."); |
| | | this.showErrorToast(component); |
| | | component.set("v.login", false); |
| | | //component.set('v.errorMessage', 'get_reports failed.'); |
| | | this.error("get_reports failed."); |
| | | //this.showErrorToast(component); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | }, |
| | | //复制和编辑回显的位置 |
| | | toggle_report: function (component) { |
| | | debugger; |
| | | var modal_window = component.find("modal_window"); |
| | | var modal_bg = component.find("modal_bg"); |
| | | if ($A.util.hasClass(modal_window, "disp_none")) { |
| | |
| | | .find("select_WorkMark") |
| | | .set("v.checked", select_data["WorkMark__c"]); |
| | | } |
| | | debugger; |
| | | |
| | | var report_id = component.get("v.edit_copy_select_report_id"); |
| | | if (report_id != "") { |
| | | var select_EffectProgress1 = ""; |
| | |
| | | } |
| | | } |
| | | }, |
| | | toggle_report_edit: function (component) { |
| | | var modal_window = component.find("modal_window"); |
| | | var modal_bg = component.find("modal_bg"); |
| | | if ($A.util.hasClass(modal_window, "disp_none")) { |
| | | // OPEN |
| | | $A.util.removeClass(modal_window, "disp_none"); |
| | | $A.util.removeClass(modal_bg, "disp_none"); |
| | | 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"); |
| | | } else if (component.get("v.mode") == "copy") { |
| | | select_data = component.get("v.select_report_data_radio"); |
| | | } |
| | | var reports = component.get("v.reports"); |
| | | var Agency_Hospital_text = ""; |
| | | var Agency_Hospital_parent_id = ""; |
| | | // 医院名 |
| | | 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"]; |
| | | } |
| | | } |
| | | 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.find("new_con").set("v.disabled", false); |
| | | } |
| | | //使用产品1(产品型号) |
| | | var UseProduct1Text = ""; |
| | | var UseProduct1Id = ""; |
| | | if ( |
| | | select_data["UseProduct1__c"] != "" && |
| | | select_data["UseProduct1__c"] != undefined |
| | | ) { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i]["UseProduct1__c"] == select_data["UseProduct1__c"]) { |
| | | UseProduct1Text = |
| | | reports[i]["UseProduct1__r"]["Asset_Model_No__c"]; |
| | | UseProduct1Id = reports[i]["UseProduct1__c"]; |
| | | } |
| | | } |
| | | component.set("v.UseProduct1", UseProduct1Text); |
| | | component.set("v.UseProduct1Id", select_data["UseProduct1__c"]); |
| | | } |
| | | //使用产品2 |
| | | var UseProduct2Text = ""; |
| | | var UseProduct2Id = ""; |
| | | if ( |
| | | select_data["UseProduct2__c"] != "" && |
| | | select_data["UseProduct2__c"] != undefined |
| | | ) { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i]["UseProduct2__c"] == select_data["UseProduct2__c"]) { |
| | | UseProduct2Text = |
| | | reports[i]["UseProduct2__r"]["Asset_Model_No__c"]; |
| | | UseProduct2Id = reports[i]["UseProduct2__c"]; |
| | | } |
| | | } |
| | | component.set("v.UseProduct2", UseProduct2Text); |
| | | component.set("v.UseProduct2Id", select_data["UseProduct2__c"]); |
| | | } |
| | | //使用产品3 |
| | | var UseProduct3Text = ""; |
| | | var UseProduct3Id = ""; |
| | | if ( |
| | | select_data["UseProduct3__c"] != "" && |
| | | select_data["UseProduct3__c"] != undefined |
| | | ) { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i]["UseProduct3__c"] == select_data["UseProduct3__c"]) { |
| | | UseProduct3Text = |
| | | reports[i]["UseProduct3__r"]["Asset_Model_No__c"]; |
| | | UseProduct3Id = reports[i]["UseProduct3__c"]; |
| | | } |
| | | } |
| | | component.set("v.UseProduct3", UseProduct3Text); |
| | | component.set("v.UseProduct3Id", select_data["UseProduct3__c"]); |
| | | } |
| | | //活动日 |
| | | var reportDate; |
| | | if (select_data["Report_Date__c"] != "") { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i]["Report_Date__c"] == select_data["Report_Date__c"]) { |
| | | reportDate = reports[i]["Report_Date__c"]; |
| | | } |
| | | } |
| | | component.set("v.data.Report_Date__c", reportDate); |
| | | } |
| | | // 科室 |
| | | // if (select_data['Department_Cateogy__c'] != '') { |
| | | // component.find('select_department').set('v.value',select_data['Department_Cateogy__c']); |
| | | // } |
| | | //fy Department_Cateogy_text__c |
| | | if (select_data["Department_Cateogy_text__c"] != "") { |
| | | component |
| | | .find("select_department") |
| | | .set("v.value", select_data["Department_Cateogy_text__c"]); |
| | | } |
| | | //经销商人员 |
| | | if (select_data["DealerPersonnel__c"] != "") { |
| | | this.set_selected( |
| | | component, |
| | | "select_DealerPersonnel", |
| | | select_data["DealerPersonnel__c"] |
| | | ); |
| | | } |
| | | // 活动区分 |
| | | if (select_data["WorkRecord__c"] != "") { |
| | | this.set_selected( |
| | | component, |
| | | "select_purpose_type", |
| | | select_data["WorkRecord__c"] |
| | | ); |
| | | this.selectPurposeType(component); |
| | | } |
| | | // 拜访人 |
| | | if (select_data["WorkRecord__c"] == "科室会") { |
| | | component.set( |
| | | "v.default_select_doctor_id2", |
| | | select_data["doctor3__c"] |
| | | ); |
| | | var a = component.get("v.default_select_doctor_id2"); |
| | | this.set_doctor_list_edit(component); |
| | | } else { |
| | | component.set( |
| | | "v.default_select_doctor_id", |
| | | select_data["doctor2__c"] |
| | | ); |
| | | this.set_doctor_list_edit(component); |
| | | } |
| | | //产品分类(第三分类) |
| | | if (select_data["ProductClassification__c"] != null) { |
| | | this.set_selected( |
| | | component, |
| | | "select_ProductClassification", |
| | | select_data["ProductClassification__c"] |
| | | ); |
| | | this.selectProductClassification(component); |
| | | } |
| | | // 产品1同类耗材科室月使用量 |
| | | if (select_data["ConsumptionOfConsumables__c"] != "") { |
| | | component |
| | | .find("select_ConsumptionOfConsumables") |
| | | .set("v.value", select_data["ConsumptionOfConsumables__c"]); |
| | | } |
| | | // 产品用量 |
| | | if (select_data["warlocksNumber__c"] != "") { |
| | | component |
| | | .find("select_warlocksNumber") |
| | | .set("v.value", select_data["warlocksNumber__c"]); |
| | | } |
| | | // 支援需求 |
| | | if (select_data["WorkMark__c"] != false) { |
| | | component |
| | | .find("select_WorkMark") |
| | | .set("v.checked", select_data["WorkMark__c"]); |
| | | } |
| | | var report_id = component.get("v.edit_copy_select_report_id"); |
| | | if (report_id != "") { |
| | | var select_EffectProgress1 = ""; |
| | | var WarlockClassification = ""; |
| | | var ProductCcategory = ""; |
| | | var productCategories = ""; |
| | | var i = 0; |
| | | for (i = 0; i < reports.length; i++) { |
| | | if (report_id == reports[i]["Id"]) { |
| | | select_EffectProgress1 = reports[i]["EffectProgress__c"]; |
| | | WarlockClassification = reports[i]["WarlockClassification__c"]; |
| | | ProductCcategory = reports[i]["ProductCcategory__c"]; |
| | | productCategories = reports[i]["productCategories__c"]; |
| | | break; |
| | | } |
| | | } |
| | | //效果/进度 |
| | | if (select_EffectProgress1 != null && select_EffectProgress1 != "") { |
| | | component |
| | | .find("select_EffectProgress") |
| | | .set("v.value", select_EffectProgress1); |
| | | } |
| | | //术士分类 |
| | | if (WarlockClassification != null && WarlockClassification != "") { |
| | | component |
| | | .find("select_OtherBrandConsumables") |
| | | .set("v.value", WarlockClassification); |
| | | } |
| | | //已采用其他品牌 |
| | | if (ProductCcategory != null && ProductCcategory != "") { |
| | | component |
| | | .find("select_ProductCcategory") |
| | | .set("v.value", ProductCcategory); |
| | | this.selectpurposetype(component); |
| | | } |
| | | //其他品牌产品类别 |
| | | if (productCategories != null && productCategories != "") { |
| | | component |
| | | .find("select_productCategories") |
| | | .set("v.value", productCategories); |
| | | } |
| | | component.set("v.edit_copy_select_report_id", ""); |
| | | } |
| | | } |
| | | } else { |
| | | 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 UseProduct1__c = component.get("v.UseProduct1Id"); |
| | | var UseProduct2__c = component.get("v.UseProduct2Id"); |
| | | var UseProduct3__c = component.get("v.UseProduct3Id"); |
| | | var Department_Cateogy__c = component |
| | | .find("select_department") |
| | | .get("v.value"); |
| | | var ConsumptionOfConsumables__c = component |
| | | .find("select_ConsumptionOfConsumables") |
| | | .get("v.value"); |
| | | var DealerPersonnel__c = component |
| | | .find("select_DealerPersonnel") |
| | | .get("v.value"); |
| | | var doctor2__c = component.find("select_doctor").get("v.value"); |
| | | var WorkRecord__c = component.find("select_purpose_type").get("v.value"); |
| | | var EffectProgress__c = component |
| | | .find("select_EffectProgress") |
| | | .get("v.value"); |
| | | var WarlockClassification__c = component |
| | | .find("select_OtherBrandConsumables") |
| | | .get("v.value"); |
| | | var ProductCcategory__c = component |
| | | .find("select_ProductCcategory") |
| | | .get("v.value"); |
| | | var productCategories__c = component |
| | | .find("select_productCategories") |
| | | .get("v.value"); |
| | | var warlocksNumber__c = component |
| | | .find("select_warlocksNumber") |
| | | .get("v.value"); |
| | | var WorkMark__c = component.find("select_WorkMark").get("v.checked"); |
| | | if (component.get("v.mode") == "new") { |
| | | var confirm_title = "警告!"; |
| | | var confirm_text = "放弃新建日报?"; |
| | | if ( |
| | | !Report_Date__c && |
| | | !Agency_Hospital__c && |
| | | !UseProduct1__c && |
| | | !UseProduct2__c && |
| | | !UseProduct3__c && |
| | | !Department_Cateogy__c && |
| | | !ConsumptionOfConsumables__c && |
| | | !DealerPersonnel__c && |
| | | !doctor2__c && |
| | | !EffectProgress__c && |
| | | !WarlockClassification__c && |
| | | !ProductCcategory__c && |
| | | !productCategories__c && |
| | | !warlocksNumber__c && |
| | | !WorkMark__c && |
| | | !WorkRecord__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 { |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } else if (component.get("v.mode") == "copy") { |
| | | 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["UseProduct1__c"] == UseProduct1__c && |
| | | select_report_data["UseProduct2__c"] == UseProduct2__c && |
| | | select_report_data["UseProduct3__c"] == UseProduct3__c && |
| | | select_report_data["Department_Cateogy__c"] == |
| | | Department_Cateogy__c && |
| | | select_report_data["ConsumptionOfConsumables__c"] == |
| | | ConsumptionOfConsumables__c && |
| | | select_report_data["DealerPersonnel__c"] == DealerPersonnel__c && |
| | | select_report_data["doctor2__c"] == doctor2__c && |
| | | select_report_data["EffectProgress__c"] == EffectProgress__c && |
| | | select_report_data["WarlockClassification__c"] == |
| | | WarlockClassification__c && |
| | | select_report_data["ProductCcategory__c"] == ProductCcategory__c && |
| | | select_report_data["productCategories__c"] == productCategories__c && |
| | | select_report_data["warlocksNumber__c"] == warlocksNumber__c && |
| | | select_report_data["WorkMark__c"] == WorkMark__c && |
| | | select_report_data["WorkRecord__c"] == WorkRecord__c |
| | | ) { |
| | | this.allclear(component); |
| | | $A.util.addClass(modal_window, "disp_none"); |
| | | $A.util.addClass(modal_bg, "disp_none"); |
| | | } else { |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } else if (component.get("v.mode") == "edit") { |
| | | 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["UseProduct1__c"] == UseProduct1__c && |
| | | select_report_data["UseProduct2__c"] == UseProduct2__c && |
| | | select_report_data["UseProduct3__c"] == UseProduct3__c && |
| | | select_report_data["Department_Cateogy__c"] == |
| | | Department_Cateogy__c && |
| | | select_report_data["ConsumptionOfConsumables__c"] == |
| | | ConsumptionOfConsumables__c && |
| | | select_report_data["DealerPersonnel__c"] == DealerPersonnel__c && |
| | | select_report_data["doctor2__c"] == doctor2__c && |
| | | select_report_data["EffectProgress__c"] == EffectProgress__c && |
| | | select_report_data["WarlockClassification__c"] == |
| | | WarlockClassification__c && |
| | | select_report_data["ProductCcategory__c"] == ProductCcategory__c && |
| | | select_report_data["productCategories__c"] == productCategories__c && |
| | | select_report_data["warlocksNumber__c"] == warlocksNumber__c && |
| | | select_report_data["WorkMark__c"] == WorkMark__c && |
| | | select_report_data["WorkRecord__c"] == WorkRecord__c |
| | | ) { |
| | | this.allclear(component); |
| | | $A.util.addClass(modal_window, "disp_none"); |
| | | $A.util.addClass(modal_bg, "disp_none"); |
| | | } else { |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } |
| | | } |
| | | //component.set('v.loginEdit',false); |
| | | }, |
| | | //关闭页面是 小的提示框是否放弃新建日报 |
| | | close_confirm: function (component, title, text) { |
| | | var confirm_status = component.get("v.confirm_status"); |
| | |
| | | var modal_bg = component.find("modal_bg"); |
| | | var modal_confirm = component.find("modal_confirm"); |
| | | var modal_confirm_bg = component.find("modal_confirm_bg"); |
| | | debugger; |
| | | |
| | | if (confirm_status == 0) { |
| | | $A.util.addClass(modal_window, "disp_none"); |
| | | $A.util.addClass(modal_bg, "disp_none"); |
| | |
| | | }, |
| | | // 复制按钮 |
| | | copy_button: function (component, event, helper) { |
| | | debugger; |
| | | this.allclear(component); |
| | | component.set("v.mode", "copy"); |
| | | component.set("v.dialog_type", "新建"); |
| | |
| | | }, |
| | | //删除按钮 |
| | | delete_button: function (component, event, helper) { |
| | | debugger; |
| | | var select_report_data = component.get("v.select_report_data_radio"); |
| | | if (confirm("是否删除该数据?")) { |
| | | debugger; |
| | | component.set("v.login", true); |
| | | var action = component.get("c.deleteAgencyReport"); |
| | | action.setParams({ |
| | |
| | | }, |
| | | //复制按钮可用 |
| | | change_report_radio: function (component, event, helper) { |
| | | debugger; |
| | | var reports = component.get("v.reports"); |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i].Name == event.getSource().get("v.label")) { |
| | |
| | | }, |
| | | //编辑按钮 |
| | | edit_button: function (component, event, helper) { |
| | | this.allclear(component); |
| | | component.set("v.login", true); |
| | | debugger; |
| | | component.set("v.loadOpp", true); |
| | | //component.set('v.loginEdit', 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.mode", "edit"); |
| | |
| | | "v.edit_copy_select_report_id", |
| | | component.get("v.reports")[index].Id |
| | | ); |
| | | var ret = this.create_report_header( |
| | | var ret = this.create_report_header_edit( |
| | | component, |
| | | event, |
| | | helper, |
| | |
| | | ); |
| | | // SWAG-CF58C3 fy start |
| | | this.set_aws_url(component, "Agency_Contact__c"); |
| | | //component.set('v.login', false); |
| | | // SWAG-CF58C3 fy end |
| | | }, |
| | | //保存 |
| | |
| | | .find("select_agency_person") |
| | | .get("v.value"); |
| | | } |
| | | debugger; |
| | | |
| | | // Agency_Report_Header__c |
| | | var Agency_Report_Header__c = component.get("v.agency_report_header_id"); |
| | | // 医院 |
| | |
| | | |
| | | // if (!productCategories__c) { error.push("其他品牌产品类别 不存在"); } |
| | | |
| | | //let errorMsg = ''; |
| | | for (var i = 0; i < error.length; i++) { |
| | | component.set("v.errorMessage", error[i]); |
| | | this.showErrorToast(component); |
| | | //errorMsg += '; ' + error[i] |
| | | //this.error(error[i]); |
| | | } |
| | | // if(errorMsg != '') |
| | | // this.error(errorMsg.substring(1)); |
| | | if (error.length > 0) { |
| | | component.find("save_button").set("v.disabled", false); |
| | | 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"); |
| | |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == "SUCCESS") { |
| | | debugger; |
| | | component.set("v.successMessage", "编辑保存成功"); |
| | | this.showSuccessToast(component); |
| | | var report_id = response.getReturnValue(); |
| | |
| | | component.get("v.select_report_data").Person_In_Charge2__c |
| | | ); |
| | | component.find("save_button").set("v.disabled", false); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } else { |
| | | component.set("v.errorMessage", "save_report failed."); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', 'save_report failed.'); |
| | | this.error("保存日报失败"); |
| | | //this.showErrorToast(component); |
| | | component.find("save_button").set("v.disabled", false); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | var data_list = component.find("modal_data_list_tr"); |
| | | } |
| | | } else { |
| | | component.set("v.errorMessage", "get_reports_now failed."); |
| | | this.showErrorToast(component); |
| | | // component.set('v.errorMessage', 'get_reports_now failed.'); |
| | | this.error("get_reports_now failed."); |
| | | //this.showErrorToast(component); |
| | | component.find("save_button").set("v.disabled", false); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action2); |
| | | this.allclear(component); |
| | | component.find("select_WorkMark").set("v.value", false); |
| | | component.find("save_button").set("v.disabled", false); |
| | | component.set("v.login", false); |
| | | this.doinit(component, event, helper); |
| | | component.set("v.loginEdit", false); |
| | | debugger; |
| | | this.doinitSave(component, event, helper); |
| | | } else { |
| | | var error = response.getError(); |
| | | component.set("v.errorMessage", "saveAgencyReport failed."); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', '保存日报失败'); |
| | | this.error("保存日报失败"); |
| | | //this.showErrorToast(component); |
| | | component.find("save_button").set("v.disabled", false); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | ) { |
| | | s_date = this.get_date_string(s_date); |
| | | if (s_date == false) { |
| | | component.set("v.errorMessage", "get_date_string failed."); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', 'get_date_string failed.'); |
| | | this.error("get_date_string failed."); |
| | | //this.showErrorToast(component); |
| | | return false; |
| | | } |
| | | var head_key = this.create_header_input_key(s_agency, s_date); |
| | | component.set("v.agency_report_header", head_key); |
| | | if (head_key == false) { |
| | | component.set("v.errorMessage", "create_header_input_key failed."); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', 'create_header_input_key failed.'); |
| | | this.error("create_header_input_key failed."); |
| | | //this.showErrorToast(component); |
| | | return false; |
| | | } |
| | | var key2 = s_date.replace(/-/g, ""); |
| | |
| | | component.set("v.login", false); |
| | | this.toggle_report(component, event, helper); |
| | | } else { |
| | | component.set("v.errorMessage", "createReportHeader callback failed."); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', 'createReportHeader callback failed.'); |
| | | this.error("createReportHeader callback failed."); |
| | | //this.showErrorToast(component); |
| | | component.set("v.login", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | create_report_header_edit: function ( |
| | | component, |
| | | event, |
| | | helper, |
| | | name, |
| | | s_agency, |
| | | s_date |
| | | ) { |
| | | s_date = this.get_date_string(s_date); |
| | | if (s_date == false) { |
| | | //component.set('v.errorMessage', 'get_date_string failed.'); |
| | | this.error("get_date_string failed."); |
| | | //this.showErrorToast(component); |
| | | return false; |
| | | } |
| | | var head_key = this.create_header_input_key(s_agency, s_date); |
| | | component.set("v.agency_report_header", head_key); |
| | | if (head_key == false) { |
| | | //component.set('v.errorMessage', 'create_header_input_key failed.'); |
| | | this.error("create_header_input_key failed."); |
| | | //this.showErrorToast(component); |
| | | return false; |
| | | } |
| | | var key2 = s_date.replace(/-/g, ""); |
| | | var action = component.get("c.createReportHeader"); |
| | | |
| | | action.setParams({ |
| | | name: name, |
| | | s_date: s_date, |
| | | s_agency: s_agency, |
| | | head_key: head_key |
| | | }); |
| | | component.set("v.login", true); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == "SUCCESS") { |
| | | var res = response.getReturnValue(); |
| | | component.set("v.agency_report_header_id", res); |
| | | component.set("v.login", false); |
| | | this.toggle_report_edit(component, event, helper); |
| | | } else { |
| | | //component.set('v.errorMessage', 'createReportHeader callback failed.'); |
| | | this.error("createReportHeader callback failed."); |
| | | //this.showErrorToast(component); |
| | | component.set("v.login", false); |
| | | } |
| | | }); |
| | |
| | | if (typeof s_date != "string") { |
| | | s_date = this.get_date_string(s_date); |
| | | if (s_date == false) { |
| | | component.set( |
| | | "v.errorMessage", |
| | | "get_date_string in create_header_input_key." |
| | | ); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', 'get_date_string in create_header_input_key.'); |
| | | this.error("get_date_string in create_header_input_key."); |
| | | //this.showErrorToast(component); |
| | | return false; |
| | | } |
| | | } |
| | |
| | | component.set("v.hospitalId", ""); |
| | | }, |
| | | selectHos: function (component, event, helper) { |
| | | debugger; |
| | | var hospital_list = component.find("hospital_list"); |
| | | $A.util.removeClass(hospital_list, "slds-is-open"); |
| | | var accname = event.currentTarget.dataset.accname; |
| | |
| | | component.set("v.hospitals", accname); |
| | | component.set("v.hospital", accname); |
| | | component.set("v.hospitalId", accid); |
| | | debugger; |
| | | |
| | | component.set("v.setdoctorlisthos", true); |
| | | this.set_doctor_list(component, event, helper); |
| | | this.set_doctor_list_edit(component, event, helper); |
| | | }, |
| | | |
| | | //模糊查询使用产品1(产品型号) |
| | |
| | | component.set("v.data.UseProduct1__c", ""); |
| | | }, |
| | | seletUseProduct1Change: function (component, event, helper) { |
| | | debugger; |
| | | var UseProduct1_List = component.find("UseProduct1_List"); |
| | | $A.util.removeClass(UseProduct1_List, "slds-is-open"); |
| | | var accname = event.currentTarget.dataset.accname; |
| | |
| | | component.set("v.UseProduct1s", accname); |
| | | component.set("v.UseProduct1", accname); |
| | | } else { |
| | | component.set("v.errorMessage", "不能选择同样的产品"); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', '不能选择同样的产品'); |
| | | this.error("不能选择同样的产品"); |
| | | //this.showErrorToast(component); |
| | | } |
| | | }, |
| | | //模糊查询使用产品2 |
| | |
| | | component.set("v.UseProduct2s", accname); |
| | | component.set("v.UseProduct2", accname); |
| | | } else { |
| | | component.set("v.errorMessage", "不能选择同样的产品"); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', '不能选择同样的产品'); |
| | | this.error("不能选择同样的产品"); |
| | | //this.showErrorToast(component); |
| | | } |
| | | }, |
| | | //模糊查询使用产品3 |
| | |
| | | component.set("v.UseProduct3s", accname); |
| | | component.set("v.UseProduct3", accname); |
| | | } else { |
| | | component.set("v.errorMessage", "不能选择同样的产品"); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', '不能选择同样的产品'); |
| | | this.error("不能选择同样的产品"); |
| | | //this.showErrorToast(component); |
| | | } |
| | | }, |
| | | //hospitalLinkId 经销商医院的ID 拜访人复制的地方 |
| | | doctor_change: function (component, event, helper) { |
| | | debugger; |
| | | var doctorurpose = component.find("select_purpose_type").get("v.value"); |
| | | var doctor_value = component.find("select_doctor").get("v.value"); |
| | | var doctor_list = component.get("v.doctor_list"); |
| | |
| | | component.set("v.AWSsearch", awsmap.searchUrl); |
| | | component.set("v.AWStransactionURL", awsmap.transactionURL); |
| | | } else { |
| | | component.set("v.errorMessage", "AWS url/token error."); |
| | | this.showErrorToast(component); |
| | | // component.set('v.errorMessage', 'AWS url/token error.'); |
| | | this.error("AWS url/token error."); |
| | | //this.showErrorToast(component); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | helper, |
| | | hospitalName |
| | | ) { |
| | | console.log("newUrl = " + newUrl); |
| | | console.log("payload = " + payload); |
| | | console.log("token = " + token); |
| | | fetch(newUrl, { |
| | | method: "POST", |
| | | body: payload, |
| | |
| | | return data.json(); |
| | | }) |
| | | .then((result) => { |
| | | console.log("result = " + JSON.stringify(result)); |
| | | if (result.status == "0") { |
| | | $A.getCallback(function () { |
| | | helper.to_agencycontact(component, result, agencyHospitalid); |
| | |
| | | |
| | | this.to_confirm(component, token, confirmUrl, JSON.stringify(data)); |
| | | } else if (acMap.errormsg != "") { |
| | | component.set("v.errorMessage", acMap.errormsg); |
| | | this.showErrorToast(component); |
| | | // component.set('v.errorMessage', acMap.errormsg); |
| | | this.error(acMap.errormsg); |
| | | //this.showErrorToast(component); |
| | | component.set("v.login", false); |
| | | } else { |
| | | component.set("v.errorMessage", "agency contact insert id error."); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', 'agency contact insert id error.'); |
| | | this.error("agency contact insert id error."); |
| | | //this.showErrorToast(component); |
| | | component.set("v.login", false); |
| | | } |
| | | } else { |
| | | component.set("v.errorMessage", "agency contact insert error."); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', 'agency contact insert error.'); |
| | | this.error("agency contact insert error."); |
| | | //this.showErrorToast(component); |
| | | component.set("v.login", false); |
| | | } |
| | | }); |
| | |
| | | $A.util.addClass(modal_newAC, "disp_none"); |
| | | component.set("v.successMessage", ".拜访人已创建。"); |
| | | this.showSuccessToast(component); |
| | | this.set_doctor_list(component); |
| | | component.set("v.login", false); |
| | | this.set_doctor_list_edit(component); |
| | | } else { |
| | | component.set("v.errorMessage", "AWS confirm error."); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', 'AWS confirm error.'); |
| | | this.error("AWS confirm error."); |
| | | //this.showErrorToast(component); |
| | | component.set("v.login", false); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | component.set("v.errorMessage", "AWS confirm error."); |
| | | this.showErrorToast(component); |
| | | // component.set('v.errorMessage', 'AWS confirm error.'); |
| | | this.error("AWS confirm error."); |
| | | //this.showErrorToast(component); |
| | | component.set("v.login", false); |
| | | }); |
| | | }, |
| | | //SWAG-CF58C3 fy end 调用pi |
| | | |
| | | set_doctor_list: function (component) { |
| | | console.log("set_doctor_list"); |
| | | var doctor_value = component.find("select_purpose_type").get("v.value"); |
| | | var hospital_id = component.get("v.hospitalLinkId"); |
| | | console.log("hospital_id = " + hospital_id); |
| | | if (hospital_id) { |
| | | if (doctor_value == "科室会") { |
| | | component.set("v.login", true); |
| | | component.set("v.loginEdit", true); |
| | | this.set_doctor_list2(component); |
| | | } else { |
| | | component.set("v.login", true); |
| | | component.set("v.loginEdit", true); |
| | | var action = component.get("c.getDoctorList"); |
| | | action.setParams({ |
| | | hospital_id: hospital_id |
| | |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == "SUCCESS") { |
| | | debugger; |
| | | var res = this.conv_selected(response.getReturnValue()); |
| | | //fy |
| | | var setdoctorlisthos = component.get("v.setdoctorlisthos"); |
| | |
| | | } |
| | | component.find("select_doctor").set("v.options", res); |
| | | component.set("v.doctor_title", doctor_title); |
| | | |
| | | console.log("awsids = " + JSON.stringify(awsids)); |
| | | if (awsids.length > 0) { |
| | | let PIConfig = component.get("v.PIConfig"); |
| | | let staticResourceAgencyContact = JSON.parse( |
| | |
| | | dataIds: awsids |
| | | }, |
| | | function (data) { |
| | | console.log("data = " + JSON.stringify(data)); |
| | | if (data && data.object && data.object.length) { |
| | | let m = {}; |
| | | for (let di in data.object) { |
| | |
| | | component.find("select_doctor").set("v.options", res); |
| | | } |
| | | |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | }, |
| | | staticResourceAgencyContact.token |
| | | ); |
| | |
| | | component.find("select_doctor").set("v.options", res); |
| | | } |
| | | |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | }, |
| | | staticResourceAgencyContact.token |
| | | ); |
| | |
| | | } |
| | | } |
| | | // component.set('v.default_select_doctor_id', ''); |
| | | debugger; |
| | | |
| | | component.set("v.doctor_list", res); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } else { |
| | | component.set("v.errorMessage", "set_doctor_list failed."); |
| | | this.showErrorToast(component); |
| | | component.set("v.login", false); |
| | | // component.set('v.errorMessage', 'set_doctor_list failed.'); |
| | | this.error("set_doctor_list failed."); |
| | | //this.showErrorToast(component); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | component.find("select_doctor").set("v.options", ""); |
| | | } |
| | | } |
| | | component.set("v.loginEdit", false); |
| | | }, //fy 20220414 |
| | | set_doctor_list_edit: function (component) { |
| | | console.log("set_doctor_list"); |
| | | var doctor_value = component.find("select_purpose_type").get("v.value"); |
| | | var hospital_id = component.get("v.hospitalLinkId"); |
| | | console.log("hospital_id = " + hospital_id); |
| | | if (hospital_id) { |
| | | if (doctor_value == "科室会") { |
| | | component.set("v.loginEdit", true); |
| | | this.set_doctor_list2(component); |
| | | } else { |
| | | component.set("v.loginEdit", true); |
| | | var action = component.get("c.getDoctorList"); |
| | | action.setParams({ |
| | | hospital_id: hospital_id |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == "SUCCESS") { |
| | | var res = this.conv_selected(response.getReturnValue()); |
| | | //fy |
| | | var setdoctorlisthos = component.get("v.setdoctorlisthos"); |
| | | if (setdoctorlisthos) { |
| | | component.set("v.default_select_doctor_id", ""); |
| | | component.set("v.setdoctorlisthos", false); |
| | | } |
| | | //fy |
| | | var default_doctor = component.get("v.default_select_doctor_id"); |
| | | if (default_doctor != "" && res.length > 0) { |
| | | var doctor_title = ""; |
| | | let awsids = []; |
| | | for (var i = 0; i < res.length; i++) { |
| | | if (res[i].value == default_doctor) { |
| | | res[i].selected = true; |
| | | doctor_title = res[i].Doctor_Division1__c; |
| | | } else { |
| | | res[i].selected = false; |
| | | } |
| | | if (res[i].AWS_Data_Id__c) { |
| | | awsids.push(res[i].AWS_Data_Id__c); |
| | | } |
| | | } |
| | | component.find("select_doctor").set("v.options", res); |
| | | component.set("v.doctor_title", doctor_title); |
| | | console.log("awsids = " + JSON.stringify(awsids)); |
| | | if (awsids.length > 0) { |
| | | let PIConfig = component.get("v.PIConfig"); |
| | | let staticResourceAgencyContact = JSON.parse( |
| | | PIConfig.staticResourceAgencyContact |
| | | ); |
| | | AWSService.search( |
| | | staticResourceAgencyContact.searchUrl, |
| | | { |
| | | dataIds: awsids |
| | | }, |
| | | function (data) { |
| | | console.log("data = " + JSON.stringify(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]; |
| | | } |
| | | } |
| | | |
| | | for (let ri in res) { |
| | | if ( |
| | | res[ri] && |
| | | res[ri].AWS_Data_Id__c && |
| | | m.hasOwnProperty(res[ri].AWS_Data_Id__c) |
| | | ) { |
| | | res[ri].label = m[res[ri].AWS_Data_Id__c].name; |
| | | } |
| | | } |
| | | component.find("select_doctor").set("v.options", res); |
| | | } |
| | | |
| | | component.set("v.loginEdit", false); |
| | | }, |
| | | staticResourceAgencyContact.token |
| | | ); |
| | | } |
| | | } else { |
| | | let awsids = []; |
| | | for (var i = 0; i < res.length; i++) { |
| | | if (res[i].AWS_Data_Id__c) { |
| | | awsids.push(res[i].AWS_Data_Id__c); |
| | | } |
| | | } |
| | | component.find("select_doctor").set("v.options", res); |
| | | if (awsids.length > 0) { |
| | | let PIConfig = component.get("v.PIConfig"); |
| | | let staticResourceAgencyContact = JSON.parse( |
| | | PIConfig.staticResourceAgencyContact |
| | | ); |
| | | AWSService.search( |
| | | staticResourceAgencyContact.searchUrl, |
| | | { |
| | | dataIds: awsids |
| | | }, |
| | | 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]; |
| | | } |
| | | } |
| | | |
| | | for (let ri in res) { |
| | | if ( |
| | | res[ri] && |
| | | res[ri].AWS_Data_Id__c && |
| | | m.hasOwnProperty(res[ri].AWS_Data_Id__c) |
| | | ) { |
| | | res[ri].label = m[res[ri].AWS_Data_Id__c].name; |
| | | } |
| | | } |
| | | component.find("select_doctor").set("v.options", res); |
| | | } |
| | | |
| | | component.set("v.loginEdit", false); |
| | | }, |
| | | staticResourceAgencyContact.token |
| | | ); |
| | | } |
| | | // component.find('select_doctor').set('v.options', res); |
| | | if (res.length > 0) { |
| | | component.set("v.doctor_title", res[0].Doctor_Division1__c); |
| | | } |
| | | } |
| | | // component.set('v.default_select_doctor_id', ''); |
| | | |
| | | component.set("v.doctor_list", res); |
| | | component.set("v.loginEdit", false); |
| | | } else { |
| | | // component.set('v.errorMessage', 'set_doctor_list failed.'); |
| | | this.error("set_doctor_list failed."); |
| | | //this.showErrorToast(component); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | } else { |
| | | if (doctor_value == "科室会") { |
| | | this.set_doctor_list2(component); |
| | | } else { |
| | | component.find("select_doctor").set("v.options", ""); |
| | | } |
| | | } |
| | | }, |
| | | set_doctor_list2: function (component) { |
| | | var action1 = component.get("c.selectdoctor3c"); |
| | | action1.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == "SUCCESS") { |
| | | var res = response.getReturnValue(); |
| | | debugger; |
| | | |
| | | for (var i = 0; i < res.length; i++) { |
| | | if (res[i].selected == "true") { |
| | | res[i].selected = true; |
| | |
| | | res[i].selected = false; |
| | | } |
| | | } |
| | | debugger; |
| | | |
| | | component.find("select_doctor").set("v.options", res); |
| | | var doctor3value = component.get("v.default_select_doctor_id2"); |
| | | this.set_selected(component, "select_doctor", doctor3value); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action1); |
| | |
| | | (p1bool && p0bool && product_category_id == pcId1) || |
| | | (p2bool && p0bool && product_category_id == pcId2) |
| | | ) { |
| | | component.set("v.errorMessage", "不能选择同样的产品区分"); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | this.error("不能选择同样的产品区分"); |
| | | //this.showErrorToast(component); |
| | | component.find("select_Product1").set("v.value", ""); |
| | | } |
| | | }, |
| | |
| | | (p1bool && p0bool && product_category_id == pcId1) || |
| | | (p2bool && p0bool && product_category_id == pcId2) |
| | | ) { |
| | | component.set("v.errorMessage", "不能选择同样的产品区分"); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | this.error("不能选择同样的产品区分"); |
| | | //this.showErrorToast(component); |
| | | component.set("v.UseProduct2_TEXT", ""); |
| | | } |
| | | }, |
| | |
| | | (p1bool && p0bool && product_category_id == pcId1) || |
| | | (p2bool && p0bool && product_category_id == pcId2) |
| | | ) { |
| | | component.set("v.errorMessage", "不能选择同样的产品区分"); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | this.error("不能选择同样的产品区分"); |
| | | //this.showErrorToast(component); |
| | | component.find("select_Product3").set("v.value", ""); |
| | | } |
| | | }, |
| | |
| | | return obj; |
| | | }, |
| | | set_selected: function (component, aura_id_name, value) { |
| | | debugger; |
| | | var select_tmp = component.find(aura_id_name).get("v.options"); |
| | | if (select_tmp) { |
| | | for (var i = 0; i < select_tmp.length; i++) { |
| | |
| | | }, |
| | | //弹出 成功提示 |
| | | showSuccessToast: function (component) { |
| | | debugger; |
| | | $A.util.removeClass(component.find("successDiv"), "slds-hide"); |
| | | window.setTimeout( |
| | | $A.getCallback(function () { |
| | |
| | | }, |
| | | //弹出 成功提示 |
| | | showSuccessToast01: function (component) { |
| | | debugger; |
| | | $A.util.removeClass(component.find("successDiv01"), "slds-hide"); |
| | | window.setTimeout( |
| | | $A.getCallback(function () { |
| | |
| | | }, |
| | | //弹出 错误提示 |
| | | showErrorToast: function (component) { |
| | | debugger; |
| | | $A.util.removeClass(component.find("errorDiv"), "slds-hide"); |
| | | window.setTimeout( |
| | | $A.getCallback(function () { |
| | |
| | | }, |
| | | //弹出 错误提示 |
| | | showErrorToast01: function (component) { |
| | | debugger; |
| | | $A.util.removeClass(component.find("errorDiv01"), "slds-hide"); |
| | | window.setTimeout( |
| | | $A.getCallback(function () { |
| | |
| | | $A.util.addClass(modal_newAC, "disp_none"); |
| | | component.set("v.successMessage", ".拜访人已创建。"); |
| | | this.showSuccessToast(component); |
| | | this.set_doctor_list(component, event, helper); |
| | | this.set_doctor_list_edit(component, event, helper); |
| | | }, |
| | | createCancel: function (component, event, helper) { |
| | | component.set("v.truthy", false); |
| | |
| | | component.set("v.TargetFileName", output); |
| | | }; |
| | | reader.onload = function (e) { |
| | | debugger; |
| | | var data = e.target.result; |
| | | |
| | | component.set("v.fileContentData", data); |
| | |
| | | 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>"; |
| | | content += '<th scope="col" style="width:100px">' + "行号" + "</th>"; |
| | | for (i = 0; i < headers.length; i++) { |
| | | content += '<th scope="col">' + headers[i] + "</th>"; |
| | | if (headers[i] == "产品1同类耗材科室月使用量") { |
| | | content += |
| | | '<th scope="col" style="width:250px">' + headers[i] + "</th>"; |
| | | } else { |
| | | content += |
| | | '<th scope="col" style="width:200px">' + headers[i] + "</th>"; |
| | | } |
| | | } |
| | | content += "</tr></thead>"; |
| | | for (var i = 1; i < allTextLines.length; i++) { |
| | |
| | | var result = response.getReturnValue(); |
| | | if (callback) callback(result); |
| | | } else { |
| | | component.set("v.errorMessage", "AWS url/token error."); |
| | | this.showErrorToast01(component); |
| | | //component.set('v.errorMessage', 'AWS url/token error.'); |
| | | this.error("AWS url/token error."); |
| | | //this.showErrorToast01(component); |
| | | component.set("v.login", false); |
| | | } |
| | | }); |
| | |
| | | }) |
| | | .catch((error) => { |
| | | console.log("AWS search error = " + JSON.stringify(error)); |
| | | component.set("v.errorMessage", "AWS search error."); |
| | | this.showErrorToast01(component); |
| | | // component.set('v.errorMessage', 'AWS search error.'); |
| | | this.error("AWS search error."); |
| | | //this.showErrorToast01(component); |
| | | component.set("v.login", false); |
| | | }); |
| | | }, |
| | | saveRecords: function (component, event, helper) { |
| | | component.set("v.login", true); |
| | | //component.set('v.login', true); |
| | | component.set("v.modal_import_spinner", true); |
| | | //fy 导入 202200506 start |
| | | var action1 = component.get("c.processDataAWSId"); |
| | | action1.setParams({ |
| | |
| | | action1.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | debugger; |
| | | var ress = response.getReturnValue(); |
| | | if (ress) { |
| | | var valur = ress.split("error1"); |
| | | if (valur.length <= 1) { |
| | | var res = JSON.parse(response.getReturnValue()); |
| | | debugger; |
| | | |
| | | var dataArr = new Array(); |
| | | var dataMap = new Map(); |
| | | res.forEach((item) => { |
| | |
| | | dataMap.set(item.AWS_Data_Id__c, item.AWS_Data_Id__c); |
| | | } |
| | | }); |
| | | debugger; |
| | | |
| | | let obj = Object.create(null); |
| | | obj["dataIds"] = dataArr; |
| | | var payload = JSON.stringify(obj); |
| | |
| | | (result) => { |
| | | var token = result.token; |
| | | var searchUrl = result.searchUrl; |
| | | console.log("token = " + token); |
| | | console.log("searchUrl = " + searchUrl); |
| | | console.log("payload = " + payload); |
| | | this.search_core( |
| | | token, |
| | | searchUrl, |
| | | payload, |
| | | (result) => { |
| | | console.log("result = " + JSON.stringify(result)); |
| | | if (result.status == "0") { |
| | | if (result.object != null && result.object.length != 0) { |
| | | component.set("v.login", true); |
| | | //component.set('v.login', true); |
| | | component.set("v.modal_import_spinner", true); |
| | | this.saveRecordsEditFile( |
| | | component, |
| | | dataMap, |
| | |
| | | helper |
| | | ); |
| | | } else { |
| | | component.set("v.errorMessage", "AWS search status "); |
| | | this.showErrorToast01(component); |
| | | component.set("v.login", false); |
| | | //component.set('v.errorMessage', 'AWS 查询数据为空 '); |
| | | this.error("AWS 查询数据为空 "); |
| | | //this.showErrorToast01(component); |
| | | //component.set('v.login', false); |
| | | component.set("v.modal_import_spinner", false); |
| | | } |
| | | } else { |
| | | component.set( |
| | | "v.errorMessage", |
| | | "AWS search status : " + result.status |
| | | ); |
| | | this.showErrorToast01(component); |
| | | component.set("v.login", false); |
| | | //component.set('v.errorMessage', 'AWS search status : ' + result.status); |
| | | this.error("AWS search status : " + result.status); |
| | | //this.showErrorToast01(component); |
| | | //component.set('v.login', false); |
| | | component.set("v.modal_import_spinner", false); |
| | | } |
| | | }, |
| | | component |
| | |
| | | } |
| | | ); |
| | | } else { |
| | | component.set( |
| | | "v.errorMessage", |
| | | valur[1] + "\n" + "请修改后重新上传" |
| | | ); |
| | | this.showErrorToast01(component); |
| | | component.set("v.login", false); |
| | | //component.set('v.errorMessage', valur[1] + '\n' + "请修改后重新上传"); |
| | | this.error(valur[1] + "\n" + "请修改后重新上传"); |
| | | //this.showErrorToast01(component); |
| | | //component.set('v.login', false); |
| | | component.set("v.modal_import_spinner", false); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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 (searchData[i].name != null) { |
| | | var sd = searchData[i]; |
| | | searchDataMap.set(sd.name.replace(" ", ""), sd.dataId); |
| | | } |
| | | } |
| | | console.log("searchDataMap=" + searchDataMap); |
| | | var error = ""; |
| | |
| | | var nameDataId = searchDataMap.get(fileName.replace(" ", "")); |
| | | if (dataMap.get(nameDataId)) { |
| | | filelist[5] = dataMap.get(nameDataId); //zhj 新方案改造 filelist[5]不再存的nameEncrpt 2022-12-21 |
| | | console.log("filelist[5] = " + filelist[5]); |
| | | } else { |
| | | error += "error1 第" + i + "行数据拜访人SF不存在"; |
| | | } |
| | |
| | | } |
| | | |
| | | if (error != "") { |
| | | component.set("v.errorMessage", error); |
| | | this.showErrorToast01(component); |
| | | console.log("zhj error = " + error); |
| | | let errorArray = error.split("error1"); |
| | | let errorDatas = []; |
| | | let errorDataRow = []; |
| | | |
| | | var fileContentData = component.get("v.fileContentData").split("\n"); |
| | | console.log("fileContentData = " + JSON.stringify(fileContentData)); |
| | | console.log("errorArray = " + JSON.stringify(errorArray)); |
| | | for (var i in errorArray) { |
| | | // if (errorArray[i] != '') { |
| | | // let errorData = {} |
| | | // errorData.errorRow = errorArray[i].trim().substring(1, 2); |
| | | // errorData.errorInfo = errorArray[i].trim().substring(5); |
| | | // errorDatas.push(errorData); |
| | | // } |
| | | if (errorArray[i] != "") { |
| | | let errorData = {}; |
| | | 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); |
| | | if (errorData.errorInfo == "拜访人AWS不存在") { |
| | | errorData.errorInfo = |
| | | "拜访人 " + |
| | | fileContentData[errorData.errorRow].split(",")[5] + |
| | | "不存在"; |
| | | } |
| | | errorDatas.push(errorData); |
| | | } else { |
| | | if (errorArray[i].trim().substring(5) == "拜访人AWS不存在") { |
| | | errorData[index].errorInfo = |
| | | "; " + |
| | | "拜访人 " + |
| | | fileContentData[errorDatas[index].errorRow].split(",")[5] + |
| | | "不存在"; |
| | | } else { |
| | | errorDatas[index].errorInfo += |
| | | "; " + errorArray[i].trim().substring(5); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | var fileContentData = component.get("v.fileContentData").split("\n"); |
| | | console.log("fileContentData = " + JSON.stringify(fileContentData)); |
| | | 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 - 1; i++) { |
| | | let initialWidth = 180; |
| | | if ( |
| | | fileContentData[0].split(",")[i] == "产品1同类耗材科室月使用量" || |
| | | fileContentData[0].split(",")[i] == "使用产品1(产品型号)" |
| | | ) { |
| | | initialWidth = 250; |
| | | } |
| | | errorColumns.push({ |
| | | label: fileContentData[0].split(",")[i], |
| | | fieldName: "field" + i, |
| | | type: "text", |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | initialWidth: initialWidth |
| | | }); |
| | | } |
| | | |
| | | 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]; |
| | | } |
| | | } |
| | | } |
| | | 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); |
| | | //this.showErrorToast01(component); |
| | | console.log("error=" + error); |
| | | component.set("v.login", false); |
| | | //component.set('v.login', false); |
| | | component.set("v.modal_import_spinner", false); |
| | | return; |
| | | } |
| | | |
| | | console.log("fileStr=" + fileStr); |
| | | $A.getCallback(function () { |
| | | debugger; |
| | | helper.ImportMethod(component, fileStr, helper); |
| | | })(); |
| | | }, |
| | |
| | | if (res != "success") { |
| | | var ress = res.split("="); |
| | | console.log(ress); |
| | | let errorDatas = []; |
| | | let errorDataRow = []; |
| | | var fileContentData = component.get("v.fileContentData").split("\n"); |
| | | console.log( |
| | | "fileContentData[1].split(,)[5] = " + |
| | | fileContentData[1].split(",")[5] |
| | | ); |
| | | |
| | | 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(5); |
| | | if (errorData.errorInfo == "拜访人不存在") { |
| | | console.log("errorData.errorRow = " + errorData.errorRow); |
| | | errorData.errorInfo = |
| | | "拜访人 " + |
| | | fileContentData[errorData.errorRow].split(",")[5] + |
| | | "不存在"; |
| | | } |
| | | errorDatas.push(errorData); |
| | | } else { |
| | | if (ress[i].substr(7).substring(5) == "拜访人不存在") { |
| | | errorDatas[index].errorInfo += |
| | | "; " + |
| | | "拜访人 " + |
| | | fileContentData[errorDatas[index].errorRow].split(",")[5] + |
| | | "不存在"; |
| | | } else { |
| | | errorDatas[index].errorInfo += |
| | | "; " + ress[i].substr(7).substring(5); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | 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 - 1; i++) { |
| | | let initialWidth = 180; |
| | | if ( |
| | | fileContentData[0].split(",")[i] == "产品1同类耗材科室月使用量" || |
| | | fileContentData[0].split(",")[i] == "使用产品1(产品型号)" |
| | | ) { |
| | | initialWidth = 250; |
| | | } |
| | | errorColumns.push({ |
| | | label: fileContentData[0].split(",")[i], |
| | | fieldName: "field" + i, |
| | | type: "text", |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | initialWidth: initialWidth |
| | | }); |
| | | } |
| | | |
| | | 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]; |
| | | } |
| | | } |
| | | component.set("v.errorColumns", errorColumns); |
| | | component.set("v.errorData", errorDatas); |
| | | component.set("v.showErrorInfo", true); |
| | | |
| | | console.log("==" + res1); |
| | | component.set("v.errorMessage", res1 + "请修改后重新上传"); |
| | | this.showErrorToast01(component); |
| | | component.set("v.login", false); |
| | | //component.set('v.errorMessage', res1 + "请修改后重新上传"); |
| | | this.error(res1 + "请修改后重新上传"); |
| | | //this.showErrorToast01(component); |
| | | //component.set('v.login', false); |
| | | component.set("v.modal_import_spinner", false); |
| | | } else { |
| | | component.set("v.successMessage", "导入成功"); |
| | | this.showSuccessToast01(component); |
| | | component.set("v.showMain", true); |
| | | component.set("v.login", false); |
| | | //component.set('v.login', false); |
| | | component.set("v.modal_import_spinner", false); |
| | | this.doinit(component, event, helper); |
| | | } |
| | | } else if (state === "INCOMPLETE") { |
| | | component.set("v.login", false); |
| | | //component.set('v.login', false); |
| | | component.set("v.modal_import_spinner", 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); |
| | | //component.set('v.login', false); |
| | | component.set("v.modal_import_spinner", false); |
| | | } |
| | | } else { |
| | | console.log("Unknown error"); |
| | | component.set("v.login", false); |
| | | //component.set('v.login', false); |
| | | component.set("v.modal_import_spinner", false); |
| | | } |
| | | } |
| | | }); |
| | |
| | | component.set("v.doctor_list", res); |
| | | component.set("v.login", false); |
| | | } else { |
| | | component.set("v.errorMessage", "newlyBuild failed."); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', 'newlyBuild failed.'); |
| | | this.error("newlyBuild failed."); |
| | | //this.showErrorToast(component); |
| | | component.set("v.login", false); |
| | | } |
| | | }); |
| | |
| | | if (sc.replace(/\D/gi, "")) { |
| | | component.set("v.select_ConsumptionOfConsumables", sc); |
| | | } else { |
| | | component.set( |
| | | "v.errorMessage", |
| | | "产品1同类耗材科室月使用量必须输入数字!" |
| | | ); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', '产品1同类耗材科室月使用量必须输入数字!'); |
| | | this.error("产品1同类耗材科室月使用量必须输入数字!"); |
| | | //this.showErrorToast(component); |
| | | } |
| | | } else { |
| | | component.set( |
| | | "v.errorMessage", |
| | | "产品1同类耗材科室月使用量最多输入14位数字!" |
| | | ); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', '产品1同类耗材科室月使用量最多输入14位数字!'); |
| | | this.error("产品1同类耗材科室月使用量最多输入14位数字!"); |
| | | //this.showErrorToast(component); |
| | | } |
| | | } |
| | | }, |
| | |
| | | if (sc.replace(/\D/gi, "")) { |
| | | component.set("v.select_warlocksNumber", sc); |
| | | } else { |
| | | component.set("v.errorMessage", "产品用量必须输入数字!"); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', '产品用量必须输入数字!'); |
| | | this.error("产品用量必须输入数字!"); |
| | | //this.showErrorToast(component); |
| | | } |
| | | } else { |
| | | component.set("v.errorMessage", "产品用量最多输入14位数字!"); |
| | | this.showErrorToast(component); |
| | | //component.set('v.errorMessage', '产品用量最多输入14位数字!'); |
| | | this.error("产品用量最多输入14位数字!"); |
| | | //this.showErrorToast(component); |
| | | } |
| | | } |
| | | }, |
| | | //工作会记录 |
| | | selectPurposeType: function (component, event, helper) { |
| | | debugger; |
| | | var doctor_value = component.find("select_purpose_type").get("v.value"); |
| | | // alert(doctor_value); |
| | | if (doctor_value != "科室会") { |
| | |
| | | component.find("new_con").set("v.disabled", true); |
| | | } |
| | | if (doctor_value != "") { |
| | | this.set_doctor_list(component); |
| | | this.set_doctor_list_edit(component); |
| | | var action = component.get("c.selectPurposeTypes"); |
| | | action.setParams({ |
| | | doctor_value: doctor_value |
| | |
| | | }, |
| | | |
| | | selectProductClassification: function (component, event, helper) { |
| | | debugger; |
| | | var select_ProductClassification = component |
| | | .find("select_ProductClassification") |
| | | .get("v.value"); |
| | |
| | | var select_ProductCcategory = component |
| | | .find("select_ProductCcategory") |
| | | .get("v.value"); |
| | | debugger; |
| | | |
| | | if (select_ProductCcategory != "") { |
| | | var result = component.find("result"); |
| | | var UserProType = component.get("v.UserProType"); |
| | |
| | | $A.util.addClass(result, "disp_none"); |
| | | } |
| | | } else { |
| | | debugger; |
| | | component.find("select_productCategories").set("v.value", ""); |
| | | var result = component.find("result"); |
| | | $A.util.addClass(result, "disp_none"); |
| | |
| | | } |
| | | |
| | | $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); |
| | | }, |
| | | error: function (message) { |
| | | // $('toastMessage.forceToastManager').css('white-space', 'pre-wrap'); |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | |
| | | toastEvent.setParams({ |
| | | title: "错误!", |
| | | message: message, |
| | | type: "error" |
| | | //"duration" : "sticky" |
| | | }); |
| | | toastEvent.fire(); |
| | | } |
| | | //zhj 导出错误信息 2023-05-16 end |
| | | }); |
| | |
| | | <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="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" |
| | | > |
| | | <span id="aa" class="slds-assistive-text">Loading</span> |
| | | <div class="slds-spinner__dot-a"></div> |
| | | <div class="slds-spinner__dot-b"></div> |
| | | <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> |
| | | </div> |
| | | </aura:renderIf> |
| | | </aura:renderIf> |
| | | |
| | | <div aura:id="report" id="report" class="contents_wrapper"> |
| | |
| | | /> |
| | | </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" |
| | | 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" |
| | |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12" |
| | | 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" |
| | |
| | | > |
| | | <thead> |
| | | <tr class="slds-line-height--reset"> |
| | | <th class="table_header slds-text-title--caps"></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" |
| | | 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"> |
| | | <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" |
| | | <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"> |
| | | <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"> |
| | | <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 |
| | | > |
| | |
| | | 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"> |
| | |
| | | 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> |
| | |
| | | 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> |
| | | <h4 id="headerTarget" class="slds-float--left"></h4> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium"> |
| | | 周报({!v.selected_date} {!v.selected_agency_person}) |
| | | </h2> |
| | |
| | | <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-5 slds-large-size--1-of-6 marginTop" |
| | | > |
| | | 活动日 |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> --> |
| | | <force:inputField |
| | | <!-- <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" |
| | | 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 |
| | | <!-- <ui:inputText aura:id="hospital_input_text" label="医院" class="field" value="{!v.hospital}" updateOn="keyup"/> --> |
| | | 医院 |
| | | <lightning:input |
| | | aura:id="hospital_input_text" |
| | | label="医院" |
| | | class="field" |
| | | value="{!v.hospital}" |
| | | variant="label-hidden" |
| | | updateOn="keyup" |
| | | /> |
| | | <div class="slds-lookup__menu" id="lookup-66"> |
| | |
| | | |
| | | <!-- 科室分类 --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8" |
| | | 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 |
| | |
| | | |
| | | <!-- 先生 --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8" |
| | | 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 |
| | |
| | | </div> |
| | | |
| | | <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-5 slds-large-size--1-of-12 marginTop" |
| | | > |
| | | <br /> |
| | | <ui:button |
| | |
| | | |
| | | <!-- 职位 --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8" |
| | | 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" |
| | | 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 |
| | |
| | | <!-- 询价 --> |
| | | <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" |
| | | 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"/> --> |
| | |
| | | </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" |
| | | 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" |
| | | 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"/> --> |
| | |
| | | </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" |
| | | 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"/> --> |
| | |
| | | </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" |
| | | 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"/> --> |
| | |
| | | </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" |
| | | 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"/> --> |
| | |
| | | <!-- 製品分類 --> |
| | | <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" |
| | | 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"/> --> |
| | |
| | | </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" |
| | | 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"/> --> |
| | |
| | | </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" |
| | | 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"/> --> |
| | |
| | | <!--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" |
| | | 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" /> |
| | |
| | | <!--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" |
| | | 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" /> |
| | |
| | | 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> |
| | | </div> |
| | |
| | | .THIS.height100vh { |
| | | height: 100vh; |
| | | } |
| | | .THIS.contents_wrapper { |
| | | padding-top: 50px; |
| | | } |
| | | /* .THIS.contents_wrapper { |
| | | padding-top: 50px; |
| | | width: 105%; |
| | | } */ |
| | | .THIS .mt5 { |
| | | margin-top: 5px; |
| | | } |
| | |
| | | margin: 0.5em 0; |
| | | } |
| | | .THIS.report_list_area { |
| | | margin: 40px 0 20px 100px; |
| | | margin: 40px 0 20px 0px; |
| | | height: 60vh; |
| | | overflow-y: scroll; |
| | | } |
| | |
| | | .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 新方案"); |
| | | 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); |
| | | }, |
| | | |
| | |
| | | var token = component.get("v.AWStoken"); |
| | | var newUrl = component.get("v.AWSinsert") + "V2"; |
| | | |
| | | component.set("v.login", true); |
| | | component.set("v.loginEdit", true); |
| | | helper.insert_agencycontact( |
| | | component, |
| | | token, |
| | |
| | | // 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) { |
| | |
| | | close_export: function (component, event, helper) { |
| | | component.set("v.showMain", true); |
| | | helper.close_export(component); |
| | | }, |
| | | exportErrorInfo: function (component, event, helper) { |
| | | helper.exportErrorInfoHelper(component); |
| | | } |
| | | }); |
| | |
| | | if (result.object != null) { |
| | | 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.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) { |
| | |
| | | if (callback) callback(result); |
| | | } else { |
| | | this.error("AWS url/token error."); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | }); |
| | | $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( |
| | |
| | | // OPEN |
| | | $A.util.removeClass(modal_window, "disp_none"); |
| | | $A.util.removeClass(modal_bg, "disp_none"); |
| | | |
| | | component.set("v.loginEdit", true); |
| | | if ( |
| | | component.get("v.mode") == "edit" || |
| | | component.get("v.mode") == "copy" |
| | |
| | | } |
| | | |
| | | if (reportDate != null) { |
| | | console.log("reportDate = " + reportDate); |
| | | component.set("v.data.Report_Date__c", reportDate); |
| | | } |
| | | |
| | | component.set("v.edit_copy_select_report_id", ""); |
| | | } |
| | | } |
| | | setTimeout(function () { |
| | | component.set("v.loginEdit", false); |
| | | }, 1000); |
| | | } else { |
| | | // CLOSE |
| | | |
| | |
| | | }, |
| | | |
| | | 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.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"); |
| | |
| | | .set("v.options", select_agency_list); |
| | | |
| | | component.set("v.update_select_report_data_id", report_id); |
| | | this.get_reports( |
| | | this.get_reports_edit( |
| | | component, |
| | | event, |
| | | helper, |
| | |
| | | ); |
| | | |
| | | component.find("save_button").set("v.disabled", false); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } else { |
| | | // var error = response.getError(); |
| | | // alert(JSON.stringify(error)); |
| | |
| | | // } |
| | | 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); |
| | |
| | | var report_id = response.getReturnValue(); |
| | | component.set("v.create_agency_report_id", report_id); |
| | | |
| | | this.get_reports( |
| | | this.get_reports_edit( |
| | | component, |
| | | event, |
| | | helper, |
| | |
| | | } else { |
| | | this.error("get_reports_now failed."); |
| | | component.find("save_button").set("v.disabled", false); |
| | | component.set("v.login", 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); |
| | | 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("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.AWStransactionURL", awsmap.transactionURL); |
| | | } else { |
| | | this.error("AWS url/token error."); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | })(); |
| | | } else { |
| | | console.log("AWS status error:" + result); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | if (result.status == "129") { |
| | | component |
| | | .find("OppMessage") |
| | |
| | | }) |
| | | .catch((error) => { |
| | | console.log("AWS insert error:" + error); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | component.find("OppMessage").setError("AWS insert error."); |
| | | }); |
| | | }, |
| | |
| | | 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 { |
| | | this.error("agency contact insert error."); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | this.set_doctor_list(component); |
| | | } else { |
| | | this.error("AWS confirm error."); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }) |
| | | .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 |
| | |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | } else { |
| | | this.error("set_doctor_list failed."); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | dataArr.push(key); |
| | | } |
| | | if (dataArr.length == 0) { |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | this.warning("没有找到符合条件的客户人员"); |
| | | return; |
| | | } |
| | |
| | | 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 |
| | |
| | | return data.json(); |
| | | }) |
| | | .then((result) => { |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | if (callback) callback(result); |
| | | }) |
| | | .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 |
| | | |
| | |
| | | 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") { |
| | |
| | | // } 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 |
| | |
| | | ); |
| | | } |
| | | |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } else { |
| | | this.error("selectOpportunityByIdAndHospitalLinkId failed."); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | }, |
| | | |
| | | 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"); |
| | | action1.setParams({ |
| | | fileData: component.get("v.fileContentData") |
| | | }); |
| | | debugger; |
| | | action1.setCallback(this, function (response) { |
| | | console.log("response = " + JSON.stringify(response)); |
| | | var state = response.getState(); |
| | |
| | | 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); |
| | | console.log("payload zhj = " + JSON.stringify(payload)); |
| | | |
| | | this.search_contact_url( |
| | | component, |
| | | "Agency_Contact__c", |
| | |
| | | // component.set('v.login',true); |
| | | // this.ImportMethod(component,resultjson); |
| | | // } |
| | | component.set("v.login", true); |
| | | component.set("v.loginEdit", true); |
| | | this.saveRecordsEditFile( |
| | | component, |
| | | dataMap, |
| | |
| | | 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); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }, |
| | | component |
| | |
| | | // }); |
| | | // $A.enqueueAction(action); |
| | | }, |
| | | 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 |
| | |
| | | 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; |
| | | } |
| | | 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 { |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // $('.forceToastManager').css('white-space', 'pre-wrap'); |
| | | 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]; |
| | | } |
| | | } |
| | | } |
| | | component.set("v.errorColumns", errorColumns); |
| | | component.set("v.errorData", errorDatas); |
| | | component.set("v.showErrorInfo", true); |
| | | console.log("==" + res1); |
| | | this.error(res1 + "请修改后重新上传"); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } else { |
| | | component.set("v.showMain", true); |
| | | this.success("导入成功"); |
| | | // alert('saved successfully'); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | } else if (state === "INCOMPLETE") { |
| | | // do something |
| | | component.set("v.login", false); |
| | | 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); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | } else { |
| | | console.log("Unknown error"); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | } |
| | | }); |
| | |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | |
| | |
| | | }, |
| | | |
| | | 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( |
| | |
| | | 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) { |
| | |
| | | } |
| | | helper.showExportDate(component, res); |
| | | |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | }, |
| | | awsurl.token |
| | | ); |
| | |
| | | component.set("v.reports_date", res); |
| | | } else { |
| | | alert("导出失败,请检查活动日"); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | } |
| | | |
| | | $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 = []; |
| | | // for (let idx = 0; idx < res.length; idx++) { |
| | |
| | | //public String[] proidList =new String[]{}; |
| | | public Decimal orderCountAll = 0; |
| | | public Decimal orderCountNotarrive = 0; |
| | | private id return_Order_id = null; |
| | | private id inventory_Order_id = null; |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | public id return_Order_id = null; |
| | | public id inventory_Order_id = null; |
| | | public boolean ReturnFLGbln { get; set; } |
| | | public boolean saveFLGbln { get; set; } |
| | | public String ArrType { get; set; } |
| | |
| | | public String product_Type = null; |
| | | public Boolean EngFlag = false; |
| | | public Boolean ETFlag = false; |
| | | |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | public Boolean isLwc = false; |
| | | public String returnError; |
| | | public List<String> warningList; |
| | | public List<String> errorList; |
| | | public String urlType; |
| | | |
| | | public ArriveGoodsController() { |
| | | baseUrl = URL.getSalesforceBaseUrl().toExternalForm(); |
| | | ESetId = ApexPages.currentPage().getParameters().get('esetId'); |
| | |
| | | consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>(); |
| | | //add by rentx 20210602 CHAN-C3K4ZQ end |
| | | // OrderAllMap = new Map<String, String>(); |
| | | } |
| | | |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | public ArriveGoodsController(String eSetId, String arrType) { |
| | | this.ESetId = eSetId; |
| | | this.ArrType = arrType; |
| | | ConsumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>(); |
| | | ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>(); |
| | | ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>(); |
| | | consumableInventory = new List<ConsumableorderdetailsInfo>(); |
| | | consumableorderdetailsRecordsUse = new List<ConsumableorderdetailsInfo>(); |
| | | consumableInventoryUse = new List<ConsumableorderdetailsInfo>(); |
| | | consumableorderdetails2Cancle = new List<Consumable_order_details2__c>(); |
| | | orderdetails2trMap = new Map<String, Consumable_order_details2__c>(); |
| | | detailsSummary = new List<ConsumableorderdetailsInfo>(); |
| | | saveFLGbln = false; |
| | | consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>(); |
| | | noboxBarcodeList = new Set<String>(); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | warningList = new List<String>(); |
| | | errorList = new List<String>(); |
| | | returnError = null; |
| | | urlType = null; |
| | | } |
| | | |
| | | //add by rentx 20210602 CHAN-C3K4ZQ start 出错的原因是页面最多展示1000条数据,但是需要展示的数据超过了1000条,现在把展示上线改为1000 * 1000 |
| | |
| | | //========20160311======ADD_End================================== |
| | | //获取明细 |
| | | public void SearchPro() { |
| | | //从下边移上来 by Link 2023-5-23 |
| | | if (barcode == null || barcode.trim() == '') { |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | returnError = '请输入BarCode号'; |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.INFO, '请输入BarCode号。') |
| | | ); |
| | | } |
| | | return; |
| | | } |
| | | notInlist = new List<String>(); |
| | | otherAgencyMap = new Map<String, String>(); |
| | | barMcodeMap = new Map<String, String>(); |
| | |
| | | consumableInventoryUse = new List<ConsumableorderdetailsInfo>(); |
| | | consumableorderdetails2Cancle = new List<Consumable_order_details2__c>(); |
| | | orderdetails2trMap = new Map<String, Consumable_order_details2__c>(); |
| | | //update by Link 20230428 |
| | | if (isLwc) { |
| | | noboxBarcodeList = new Set<String>(); |
| | | } |
| | | //add by rentx 2021-01-27 start |
| | | HosErrorList = new List<String>(); |
| | | HosErrorMap = new Map<String, String>(); |
| | |
| | | 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() == '') { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.INFO, '请输入BarCode号。') |
| | | ); |
| | | return; |
| | | } |
| | | //移到最上边 by Link 2023-5-23 |
| | | // if(barcode == null || barcode.trim() ==''){ |
| | | // //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | // if(isLwc){ |
| | | // returnError = '请输入BarCode号'; |
| | | // }else { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'请输入BarCode号。')); |
| | | // } |
| | | // return; |
| | | // } |
| | | //对比全部库存中是否存在管理编码一样,barcode号不一样的产品 |
| | | reSet1 = [ |
| | | SELECT Id, Name, TracingCode__c, Bar_Code__c, Report_Product_Expiration__c |
| | |
| | | } else { |
| | | for (String str : barMcodeMap.keySet()) { |
| | | if (barMcodeMap.get(str) == reSet1[i].TracingCode__c) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | str + |
| | | ' 的管理编码已经存在于系统的库存中,请确认输入信息是否有误。' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | 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); |
| | | } |
| | |
| | | } |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '管理编码为空的产品 ' + ErrorIdMap)); |
| | | //整体到货 |
| | | System.debug('EsetId===>' + EsetId); |
| | | System.debug('ArrType===>' + ArrType); |
| | | if (EsetId == null || EsetId == '') { |
| | | if (ArrType != 'ReG') { |
| | | //到货但产品类型与用户的类型不符 |
| | |
| | | } |
| | | } |
| | | } |
| | | System.debug('reSet1===>' + reSet1); |
| | | //add by Wang Xueqin |
| | | //到货但产品类型与用户的类型不符 |
| | | 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, |
| | | Consumable_order_minor__r.ContractNo__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE |
| | | Bar_Code__c IN :BarCodeListP |
| | | AND (NOT Product_Type__c LIKE :userPro_Typestr) |
| | | ]; |
| | | |
| | | if (reSet1.size() > 0) { |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) { |
| | | // 跳过已经处理的消耗品明细 |
| | | continue; |
| | | } else { |
| | | String str = |
| | | '产品类型[' + |
| | | reSet1[i].Product_Type__c + |
| | | ']与用户的类型[' + |
| | | userPro_Type + |
| | | ']不符'; |
| | | ConsumableorderdetailsRecordserror.add( |
| | | new ConsumableorderdetailsInfo(reSet1[i], str) |
| | | ); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c); |
| | | } |
| | | } |
| | | } |
| | | System.debug('reSet1===>1' + reSet1); |
| | | //end |
| | | |
| | | //销售产品 |
| | | reSet1 = [ |
| | | SELECT |
| | |
| | | reSet1[i].Lose_Flag__c == true && |
| | | reSet1[i].ToDueDateDays__c >= 0 |
| | | ) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.WARNING, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | warningList.add( |
| | | '产品' + |
| | | reSet1[i].Consumable_Product__r.Name + |
| | | '存在丢失记录' |
| | | ) |
| | | ); //如果丢失产品就给提示。 |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.WARNING, |
| | | '产品' + |
| | | reSet1[i].Consumable_Product__r.Name + |
| | | '存在丢失记录' |
| | | ) |
| | | ); //如果丢失产品就给提示。 |
| | | } |
| | | } |
| | | if ( |
| | | reSet1[i].Lose_Flag__c == true && |
| | |
| | | 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, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | warningList.add( |
| | | '条形码为(' + str + ')的入库数据与发货数据不一致' |
| | | ) |
| | | ); |
| | | // 20220815 ljh SWAG-CH65B7 end |
| | | ); |
| | | } else { |
| | | // 20220815 ljh SWAG-CH65B7 start |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'此管理编码与实际发货BarCode不一致,请核对管理编码('+ str +')的入库及库存数据。')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.WARNING, |
| | | '条形码为(' + str + ')的入库数据与发货数据不一致' |
| | | ) |
| | | ); |
| | | // 20220815 ljh SWAG-CH65B7 end |
| | | } |
| | | } |
| | | if (barMcodeMap.get(str) == reSet[i].TracingCode__c) { |
| | | reSet[i].Bar_Code__c = str; |
| | |
| | | } else { |
| | | for (String str : barMcodeMap.keySet()) { |
| | | if (barMcodeMap.get(str) == reSet1[i].TracingCode__c) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | 'barcode' + |
| | | str + |
| | | '与出库单' + |
| | | reSet1[i].Sale_orderName__c + |
| | | ' 中的管理编码一致,但Barcode不同,请确认具体数据。' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | 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); |
| | | } |
| | |
| | | if (ArrType != 'ReG') { |
| | | inventoryEntryNoESetId(notInlist); |
| | | if (notInStorelist.size() > 0) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号' + notInStorelist + '不存在。' |
| | | ) |
| | | ); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | returnError = 'BarCode号' + notInStorelist + '不存在'; |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号' + notInStorelist + '不存在。' |
| | | ) |
| | | ); |
| | | } |
| | | return; |
| | | } |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | returnError = |
| | | 'BarCode号' + |
| | | notInlist + |
| | | '不存在,无对应的出库单,请先操作产品入库。' |
| | | ) |
| | | ); |
| | | notInlist + |
| | | '不存在,无对应的出库单,请先操作产品入库'; |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号' + |
| | | notInlist + |
| | | '不存在,无对应的出库单,请先操作产品入库。' |
| | | ) |
| | | ); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | |
| | | //add by rentx 2021-01-27 start |
| | | if (HosErrorList.size() > 0) { |
| | | for (String str : HosErrorList) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号:' + str + HosErrorMap.get(str) + '' |
| | | ) |
| | | ); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add('BarCode号:' + str + HosErrorMap.get(str) + ''); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号:' + str + HosErrorMap.get(str) + '' |
| | | ) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | //add by rentx 2021-01-27 end |
| | |
| | | if (notInlist.size() > 0) { |
| | | inventoryEntry(notInlist); |
| | | if (notInStorelist.size() > 0) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号' + notInStorelist + '不存在。' |
| | | ) |
| | | ); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | returnError = 'BarCode号' + notInStorelist + '不存在'; |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号' + notInStorelist + '不存在。' |
| | | ) |
| | | ); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | |
| | | //add by rentx 2021-01-27 start 当订单为医院特价类型的订单时,如果找不到barcode,不解析,并且默认该barcode对应的明细2为非医院特价产品,直接报错 |
| | | if (HosErrorList.size() > 0) { |
| | | for (String str : HosErrorList) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号:' + str + '是非医院特价产品' |
| | | ) |
| | | ); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add('BarCode号:' + str + '是非医院特价产品'); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号:' + str + '是非医院特价产品' |
| | | ) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | //add by rentx 2021-01-27 end |
| | |
| | | //生产日期 |
| | | List<String> janCode = new List<String>(); |
| | | if (barCodeList[i].length() < 16) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')的位数不足16,不符合要求错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | 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, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + barCodeList[i] + ')的janCode错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')的janCode错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | |
| | | barCodeList[i].length() - 5 |
| | | ) != '250' |
| | | ) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + barCodeList[i] + ')没有管理编码!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')没有管理编码!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | if (barCodeList[i].substring(16, 18) == '11') { |
| | |
| | | '-01'; |
| | | productionDate = Date.valueOf(productDateStr); |
| | | } catch (Exception e) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')的生产日期' + |
| | | productDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')的生产日期' + |
| | | productDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | if (barCodeList[i].length() >= 32) { |
| | |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | } |
| | | } catch (Exception e) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')的滅菌有効期限' + |
| | | expirationDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')的滅菌有効期限' + |
| | | expirationDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | if (barCodeList[i].length() >= 42) { |
| | |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | } |
| | | } catch (Exception e) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')的滅菌有効期限' + |
| | | expirationDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')的滅菌有効期限' + |
| | | expirationDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | if (barCodeList[i].length() >= 34) { |
| | |
| | | Pattern.compile('[0-9]').matcher(Atr).find() || |
| | | Pattern.compile('[0-9]').matcher(Ctr).find() |
| | | ) { |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | String str = '管理编码有误,请检查条形码数据。'; |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')管理编码有误,请检查条形码数据。' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')管理编码有误,请检查条形码数据。' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | // String str = '管理编码不正确,请与管理员确认是否错误。'; |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')管理编码中有数字,请与管理员确认是否错误!')); |
| | | // continue; |
| | | // gzw DB202305352696 入库管理编码验证程序调整 end |
| | | } |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + barCodeList[i] + ')的tracingCode错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')的tracingCode错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | |
| | | barCodeList[i].length() - 5 |
| | | ) != '250' |
| | | ) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + barCodeList[i] + ')没有管理编码!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | 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, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')的位数不足16,不符合要求错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | 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 { |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add('产品BarCode(' + barCodeList[i] + ')不符合要求!'); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')不符合要求!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | } else { |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add('产品BarCode(' + barCodeList[i] + ')不符合要求!'); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')不符合要求!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')不符合要求!' |
| | | ) |
| | | ); |
| | | continue; |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | if (errorMap.size() > 0) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | 'BarCode号[' + |
| | | errorMap.values() + |
| | | ']产品类型[' + |
| | |
| | | ']与用户类型[' + |
| | | userPro_Type + |
| | | ']不符' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号[' + |
| | | errorMap.values() + |
| | | ']产品类型[' + |
| | | product_Type + |
| | | ']与用户类型[' + |
| | | userPro_Type + |
| | | ']不符' |
| | | ) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | if (errorMap.size() > 0) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | 'BarCode号[' + |
| | | errorMap.values() + |
| | | ']产品类型[' + |
| | |
| | | ']与用户[' + |
| | | userPro_Type + |
| | | ']类型不符' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号[' + |
| | | errorMap.values() + |
| | | ']产品类型[' + |
| | | product_Type + |
| | | ']与用户[' + |
| | | userPro_Type + |
| | | ']类型不符' |
| | | ) |
| | | ); |
| | | } |
| | | } |
| | | product2InStore = [ |
| | | SELECT |
| | |
| | | '-01'; |
| | | productionDate = Date.valueOf(productDateStr); |
| | | } catch (Exception e) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | bar + |
| | | ')的生产日期' + |
| | | productDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | bar + |
| | | ')的生产日期' + |
| | | productDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | if (bar.length() >= oTcodeLength + 3 + 16) { |
| | |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | } |
| | | } catch (Exception e) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | bar + |
| | | ')的滅菌有効期限' + |
| | | expirationDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | bar + |
| | | ')的滅菌有効期限' + |
| | | expirationDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | if (bar.length() >= oTcodeLength + 3 + 25) { |
| | |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | } |
| | | } catch (Exception e) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | bar + |
| | | ')的滅菌有効期限' + |
| | | expirationDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | bar + |
| | | ')的滅菌有効期限' + |
| | | expirationDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | if (bar.length() >= oTcodeLength + 20) { |
| | |
| | | Pattern.compile('[0-9]').matcher(Atr).find() || |
| | | Pattern.compile('[0-9]').matcher(Ctr).find() |
| | | ) { |
| | | String str = '管理编码有误,请检查条形码数据。'; |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | String str = '管理编码不正确,请与管理员确认是否错误。'; |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | bar + |
| | | ')管理编码有误,请检查条形码数据。' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | bar + |
| | | ')管理编码有误,请检查条形码数据。' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | |
| | | // gzw DB202305352696 入库管理编码验证程序调整 end |
| | | } |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + bar + ')的tracingCode错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + bar + ')的tracingCode错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | |
| | | //生产日期 |
| | | List<String> janCode = new List<String>(); |
| | | if (barCodeList[i].length() < 16) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')的位数不足16,不符合要求错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | 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, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + barCodeList[i] + ')的janCode错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')的janCode错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | |
| | | barCodeList[i].length() - 5 |
| | | ) != '250' |
| | | ) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + barCodeList[i] + ')没有管理编码!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')没有管理编码!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | if (barCodeList[i].substring(16, 18) == '11') { |
| | |
| | | '-01'; |
| | | productionDate = Date.valueOf(productDateStr); |
| | | } catch (Exception e) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')的生产日期' + |
| | | productDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')的生产日期' + |
| | | productDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | if (barCodeList[i].length() >= 32) { |
| | |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | } |
| | | } catch (Exception e) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')的滅菌有効期限' + |
| | | expirationDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')的滅菌有効期限' + |
| | | expirationDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | if (barCodeList[i].length() >= 42) { |
| | |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | } |
| | | } catch (Exception e) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')的滅菌有効期限' + |
| | | expirationDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')的滅菌有効期限' + |
| | | expirationDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | if (barCodeList[i].length() >= 34) { |
| | |
| | | Pattern.compile('[0-9]').matcher(Atr).find() || |
| | | Pattern.compile('[0-9]').matcher(Ctr).find() |
| | | ) { |
| | | String str = '管理编码有误,请检查条形码数据。'; |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | String str = '管理编码不正确,请与管理员确认是否错误。'; |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')管理编码有误,请检查条形码数据。' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')管理编码有误,请检查条形码数据。' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | |
| | | // gzw DB202305352696 入库管理编码验证程序调整 end |
| | | } |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + barCodeList[i] + ')的tracingCode错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')的tracingCode错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | |
| | | barCodeList[i].length() - 5 |
| | | ) != '250' |
| | | ) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + barCodeList[i] + ')没有管理编码!' |
| | | ) |
| | | ); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add('产品BarCode(' + barCodeList[i] + ')没有管理编码!'); |
| | | } else { |
| | | 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, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')的位数不足16,不符合要求错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | 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, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')没有janCode或OTcode,不符合要求!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | barCodeList[i] + |
| | | ')没有janCode或OTcode,不符合要求!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | if (errorMap.size() > 0) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | 'BarCode号[' + |
| | | errorMap.values() + |
| | | ']产品类型[' + |
| | |
| | | ']与用户的类型[' + |
| | | userPro_Type + |
| | | ']不符' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号[' + |
| | | errorMap.values() + |
| | | ']产品类型[' + |
| | | product_Type + |
| | | ']与用户的类型[' + |
| | | userPro_Type + |
| | | ']不符' |
| | | ) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | product2InStore = [ |
| | |
| | | } |
| | | } |
| | | if (errorMap.size() > 0) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | 'BarCode号[' + |
| | | errorMap.values() + |
| | | ']产品类型[' + |
| | |
| | | ']与用户[' + |
| | | userPro_Type + |
| | | ']类型不符' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | 'BarCode号[' + |
| | | errorMap.values() + |
| | | ']产品类型[' + |
| | | product_Type + |
| | | ']与用户[' + |
| | | userPro_Type + |
| | | ']类型不符' |
| | | ) |
| | | ); |
| | | } |
| | | } |
| | | product2InStore = [ |
| | | SELECT |
| | |
| | | '-01'; |
| | | productionDate = Date.valueOf(productDateStr); |
| | | } catch (Exception e) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | bar + |
| | | ')的生产日期' + |
| | | productDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | bar + |
| | | ')的生产日期' + |
| | | productDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | if (bar.length() >= oTcodeLength + 3 + 16) { |
| | |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | } |
| | | } catch (Exception e) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | bar + |
| | | ')的滅菌有効期限' + |
| | | expirationDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | bar + |
| | | ')的滅菌有効期限' + |
| | | expirationDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | if (bar.length() >= oTcodeLength + 3 + 25) { |
| | |
| | | expirationDate = Date.valueOf(expirationDateStr); |
| | | } |
| | | } catch (Exception e) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | bar + |
| | | ')的滅菌有効期限' + |
| | | expirationDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | bar + |
| | | ')的滅菌有効期限' + |
| | | expirationDateStr + |
| | | '错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | if (bar.length() >= oTcodeLength + 20) { |
| | |
| | | Pattern.compile('[0-9]').matcher(Atr).find() || |
| | | Pattern.compile('[0-9]').matcher(Ctr).find() |
| | | ) { |
| | | String str = '管理编码有误,请检查条形码数据。'; |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | String str = '管理编码不正确,请与管理员确认是否错误。'; |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add( |
| | | '产品BarCode(' + |
| | | bar + |
| | | ')管理编码有误,请检查条形码数据。' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + |
| | | bar + |
| | | ')管理编码有误,请检查条形码数据。' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | |
| | | // gzw DB202305352696 入库管理编码验证程序调整 end |
| | | } |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + bar + ')的tracingCode错误!' |
| | | ) |
| | | ); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | errorList.add('产品BarCode(' + bar + ')的tracingCode错误!'); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '产品BarCode(' + bar + ')的tracingCode错误!' |
| | | ) |
| | | ); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | |
| | | if (notEqualBARcodeCunMap.size() > 0) { |
| | | for (String widget : notEqualBARcodeCunMap.keySet()) { |
| | | if (notEqualBARcodeCunMap.get(widget).size() > 0) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.INFO, |
| | | '以下barcode产品与订货产品不一致。' |
| | | ) |
| | | ); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | warningList.add('以下barcode产品与订货产品不一致。'); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.INFO, |
| | | '以下barcode产品与订货产品不一致。' |
| | | ) |
| | | ); |
| | | } |
| | | for ( |
| | | String barcodeListTTT : (List<String>) notEqualBARcodeCunMap.get( |
| | | widget |
| | | ) |
| | | ) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.INFO, barcodeListTTT) |
| | | ); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | warningList.add(barcodeListTTT); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.INFO, barcodeListTTT) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | ConsumableorderdetailsRecords.size() < 1 && |
| | | consumableInventory.size() < 1 |
| | | ) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '不存在到货明细') |
| | | ); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | returnError = '不存在到货明细'; |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '不存在到货明细') |
| | | ); |
| | | } |
| | | return null; |
| | | } |
| | | if (EsetId != null && EsetId != '') { |
| | |
| | | if (resultcheck.length() > 0) { |
| | | for (String widget : overOrderBARcodeCunMap.keySet()) { |
| | | if (overOrderBARcodeCunMap.get(widget).size() > 0) { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.INFO, |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | warningList.add( |
| | | '产品' + |
| | | widget + |
| | | '本次到货数量超过' + |
| | | overOrderBARcodeCunMap.get(widget).size() + |
| | | '个订货的数量。' |
| | | ) |
| | | ); |
| | | ); |
| | | } else { |
| | | 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) |
| | | ); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | warningList.add(barcodeListTTT); |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.INFO, barcodeListTTT) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | arriveId = orderMain.id; |
| | | Decimal arriveAmount = 0; |
| | | for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecordsUse) { |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------1------')); |
| | | Consumable_order_details2__c insDetails = new Consumable_order_details2__c(); |
| | | insDetails.Id = ass.esd.Id; |
| | | insDetails.Consumable_Arrived_order__c = orderMain.id; |
| | |
| | | if (updateconsumableorderdetails2.size() > 0) { |
| | | update updateconsumableorderdetails2; |
| | | } |
| | | |
| | | List<Consumable_order_details2__c> insertconsumableorderdetails2 = new List<Consumable_order_details2__c>(); |
| | | for (Consumable_order_details2__c Cod2 : consumableorderdetails2Insert) { |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------4------')); |
| | |
| | | i++; |
| | | } |
| | | |
| | | // return null; |
| | | //return null; |
| | | |
| | | if (insertconsumableorderdetails2.size() > 0) { |
| | | insert insertconsumableorderdetails2; |
| | |
| | | // Integer a = 1/0; |
| | | } catch (Exception e) { |
| | | Database.rollback(sp); |
| | | ApexPages.addMessages(e); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | returnError = e.getLineNumber() + '---' + e.getMessage(); |
| | | } else { |
| | | ApexPages.addMessages(e); |
| | | } |
| | | return null; |
| | | } |
| | | if (resultcheck.length() > 0) { |
| | |
| | | } else if (resultcheckWithoutOrder.size() > 0) { |
| | | return null; |
| | | } else { |
| | | urlType = 'UnabletoEdit'; |
| | | return UnabletoEdit(); |
| | | // return null; |
| | | } |
| | |
| | | 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]; //Commented By Li Jun 20230616 |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 end |
| | | |
| | | List<Consumable_order_details2__c> codcList = new List<Consumable_order_details2__c>(); |
| | |
| | | codi.esd.Return_reason__c == null || |
| | | codi.esd.Return_reason__c == '' |
| | | ) { |
| | | codi.esd.Return_reason__c.addError('请补充返品原因'); |
| | | if (isLwc) { |
| | | returnError = '请补充返品原因'; |
| | | } else { |
| | | codi.esd.Return_reason__c.addError('请补充返品原因'); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | |
| | | codi.esd.Bar_Code__c; |
| | | Integer deliverycnt = BarcodeCntMap.get(key); |
| | | if (codi.esd.Rrturn_count__c > deliverycnt) { |
| | | codi.esd.Rrturn_count__c.addError('超出出库数量'); |
| | | if (isLwc) { |
| | | returnError = '超出出库数量'; |
| | | } else { |
| | | codi.esd.Rrturn_count__c.addError('超出出库数量'); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | codcList.add(codi.esd); |
| | | } |
| | | } |
| | | |
| | | //明细2不存在的对应的到货订单明细 2017-07-05 |
| | | Integer i = 1; |
| | | //for(ConsumableorderdetailsInfo ass : consumableInventoryUse){ |
| | |
| | | // } |
| | | |
| | | if (ass.ReturnReason == null || ass.ReturnReason == '') { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '请补充返品原因') |
| | | ); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | returnError = '请补充返品原因'; |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '请补充返品原因' |
| | | ) |
| | | ); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | |
| | | // WYIN-BPE3T4 虚拟盘点单 update by vivek 2020-05-11 start |
| | | // return ToReturnGoodsPage(); |
| | | if (hasLoseGoods) { |
| | | urlType = 'ToInventoryGoodsPage'; |
| | | return ToInventoryGoodsPage(); |
| | | // return null; |
| | | } else { |
| | | urlType = 'ToReturnGoodsPage'; |
| | | return ToReturnGoodsPage(); |
| | | // return null; |
| | | } |
| | | // WYIN-BPE3T4 虚拟盘点单 update by vivek 2020-05-11 start |
| | | } else { |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | returnError = '没有需要登录的返品'; |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.ERROR, |
| | | '没有需要登录的返品' |
| | | ) |
| | | ); |
| | | } |
| | | return null; |
| | | } |
| | | } else { |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | returnError = '没有需要登录的返品'; |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | |
| | | '没有需要登录的返品' |
| | | ) |
| | | ); |
| | | return null; |
| | | } |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.ERROR, '没有需要登录的返品') |
| | | ); |
| | | return null; |
| | | } |
| | | } catch (Exception e) { |
| | | Database.rollback(sp); |
| | | ApexPages.addMessages(e); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if (isLwc) { |
| | | returnError = e.getLineNumber() + '---' + e.getMessage(); |
| | | } else { |
| | | ApexPages.addMessages(e); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | return ref; |
| | | } |
| | | |
| | | class ConsumableorderdetailsInfo implements Comparable { |
| | | public class ConsumableorderdetailsInfo implements Comparable { |
| | | public Consumable_order_details2__c esd { get; set; } |
| | | public Product2__c Prod { get; set; } |
| | | public String ProductName { get; set; } |
| | |
| | | public Decimal arrivedCount { get; set; } |
| | | |
| | | public String ReportProductExpirationDate { get; set; } |
| | | |
| | | public ConsumableorderdetailsInfo() { |
| | | } |
| | | |
| | | public ConsumableorderdetailsInfo( |
| | | Consumable_order_details2__c e, |
| | | string str |
| | |
| | | @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() { |
| | |
| | | //发货明细 |
| | | //fahuo |
| | | /*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.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Box_Piece__c ='盒'; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | //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.IsArrival__c = true; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Box_Piece__c ='盒'; |
| | | Orderdet2.Arrive_date__c = Date.today(); |
| | | //Orderdet2.Send_Date__c = Date.today(); |
| | | //Orderdet2.Used_date__c= Date.today(); |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';*/ |
| | | 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.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Box_Piece__c ='盒'; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | //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.IsArrival__c = true; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Box_Piece__c ='盒'; |
| | | Orderdet2.Arrive_date__c = Date.today(); |
| | | //Orderdet2.Send_Date__c = Date.today(); |
| | | //Orderdet2.Used_date__c= Date.today(); |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';*/ |
| | | //sale |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(); |
| | | Orderdet3.Name = 'OCM_01_001003'; |
| | |
| | | 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(); |
| | | } |
| | | } |
| | | } |
| | |
| | | private String strColumus; |
| | | private String strRtColumus; |
| | | |
| | | //add by Link 2023-6-2 |
| | | public String remindMsg { get; set; } |
| | | |
| | | @TestVisible |
| | | private String accTypeForSort = null; |
| | | private static Integer oppLimit = 500; |
| | |
| | | } |
| | | |
| | | public PageReference init() { |
| | | remindMsg = ''; |
| | | PartnerSoapSforceCom.Soap soap = new PartnerSoapSforceCom.Soap(); |
| | | soap.SessionHeader = new PartnerSoapSforceCom.SessionHeader_element(); |
| | | soap.SessionHeader.sessionId = UserInfo.getSessionId(); |
| | |
| | | '取得最近的 ' + oppCount + ' 条数据' |
| | | ) |
| | | ); |
| | | //add by Link 2023-6-2 |
| | | remindMsg = '取得最近的 ' + oppCount + ' 条数据'; |
| | | } else if (!String.isBlank(this.sortKey)) { |
| | | if (oppCount > oppLimit) { |
| | | ApexPages.addmessage( |
| | |
| | | '数据超过' + oppLimit + '件,只显示前' + oppLimit + '件' |
| | | ) |
| | | ); |
| | | //add by Link 2023-6-2 |
| | | remindMsg = '数据超过' + oppLimit + '件,只显示前' + oppLimit + '件'; |
| | | } else { |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | |
| | | '共有 ' + oppCount + ' 条数据' |
| | | ) |
| | | ); |
| | | //add by Link 2023-6-2 |
| | | remindMsg = '共有 ' + oppCount + ' 条数据'; |
| | | } |
| | | } else { |
| | | ApexPages.addmessage( |
| | |
| | | '共有 ' + oppCount + ' 条数据' |
| | | ) |
| | | ); |
| | | //add by Link 2023-6-2 |
| | | remindMsg = '共有 ' + oppCount + ' 条数据'; |
| | | } |
| | | } |
| | | //检索条件:数据字段1,数据字段2,数据字段3均满足进入此方法 判断多种情况 |
| | |
| | | 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, '请确定科室分类和产品区分的关系')); |
| | | } |
| | |
| | | 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(); |
| | |
| | | user.Alias = 'テユ'; |
| | | user.CommunityNickname = 'テストユーザー'; |
| | | user.SalesManager__c = UserInfo.getUserId(); |
| | | |
| | | insert user; |
| | | System.runAs(new User(Id = UserInfo.getUserId())) { |
| | | insert user; |
| | | } |
| | | List<user> users = [ |
| | | SELECT Id, Name, LastName, FirstName |
| | | FROM User |
| | |
| | | <template> |
| | | <template if:true={showSpinner}> |
| | | <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> --> |
| | | <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> |
| | | </template> |
| | | <c-common-toast></c-common-toast> |
| | | <div style="border: 1px solid #D4D4D4;border-radius:5px;"> |
| | | <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;"> |
| | | <!-- <p style="font-size: 18px;"><strong>库存管理</strong></p> --> |
| | | <lightning-layout> |
| | | <lightning-layout-item padding="around-small"> |
| | | <p style="font-size: 18px"> |
| | | <strong>库存管理</strong> |
| | | </p> |
| | | </lightning-layout-item> |
| | | </lightning-layout> |
| | | </div> |
| | | <div style="padding:10px;"> |
| | | <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;"> |
| | | <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:10px;"> |
| | | <!-- <lightning-button variant="brand" class = 'lexstyle' style="margin:12px;" label="库存盘点" title="库存盘点" |
| | | <template if:true={showSpinner}> |
| | | <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> --> |
| | | <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> |
| | | </template> |
| | | <c-common-toast></c-common-toast> |
| | | <div style="border: 1px solid #d4d4d4; border-radius: 5px"> |
| | | <div |
| | | style=" |
| | | border-top: 3px solid #51606e; |
| | | border-bottom: 1px solid #d4d4d4; |
| | | padding: 3px; |
| | | " |
| | | > |
| | | <!-- <p style="font-size: 18px;"><strong>库存管理</strong></p> --> |
| | | <lightning-layout> |
| | | <lightning-layout-item padding="around-small"> |
| | | <p style="font-size: 18px"> |
| | | <strong>库存管理</strong> |
| | | </p> |
| | | </lightning-layout-item> |
| | | </lightning-layout> |
| | | </div> |
| | | <div style="padding: 10px"> |
| | | <div |
| | | style=" |
| | | border: 1px solid #d4d4d4; |
| | | border-radius: 5px; |
| | | margin-bottom: 7px; |
| | | " |
| | | > |
| | | <div |
| | | style=" |
| | | border-top: 3px solid #51606e; |
| | | border-bottom: 1px solid #d4d4d4; |
| | | padding: 10px; |
| | | " |
| | | > |
| | | <!-- <lightning-button variant="brand" class = 'lexstyle' style="margin:12px;" label="库存盘点" title="库存盘点" |
| | | onclick={inventoryCount}></lightning-button> |
| | | <lightning-button variant="brand" class = 'lexstyle' style="margin: 12px;" label="过期库存销存" title="过期库存销存" |
| | | onclick={handleExpired}></lightning-button> |
| | | <lightning-button variant="brand" class = 'lexstyle' style="margin: 12px;" label="拆盒" title="拆盒" onclick={removeBox}></lightning-button> |
| | | <lightning-button variant="brand" class = 'lexstyle' style="margin: 12px;" label="取消拆盒" title="取消拆盒" |
| | | onclick={cancelremoveBox}></lightning-button> --> |
| | | <button style="margin-left:5px" |
| | | class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="库存盘点" |
| | | onclick={inventoryCount}>库存盘点</button> |
| | | <button class="slds-button slds-button_neutral slds-button_stretch lexButtoun" label="过期库存销存" |
| | | style="margin-left:60px;" onclick={handleExpired}>过期库存销存</button> |
| | | <button class="slds-button slds-button_neutral slds-button_stretch lexButtoun" label="拆盒" |
| | | style="margin-left:60px;" onclick={removeBox}>拆盒</button> |
| | | <button class="slds-button slds-button_neutral slds-button_stretch lexButtoun" label="取消拆盒" |
| | | style="margin-left:60px;" onclick={cancelremoveBox}>取消拆盒</button> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:30px;"> |
| | | <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;height:115px"> |
| | | <table style="margin-top:10px;"> |
| | | <colgroup> |
| | | <col width="160px" /> |
| | | <col width="100px" /> |
| | | <col width="10px" /> |
| | | <col width="70px" /> |
| | | <col width="100px" /> |
| | | <col width="10px" /> |
| | | <col width="70px" /> |
| | | <col width="100px" /> |
| | | <col width="10px" /> |
| | | <col width="90px" /> |
| | | <col width="100px" /> |
| | | <col width="85px" /> |
| | | <col width="100px" /> |
| | | <col width="10px" /> |
| | | <col width="70px" /> |
| | | <col width="100px" /> |
| | | </colgroup> |
| | | <tbody> |
| | | <tr> |
| | | <td style="width:10px;"></td> |
| | | <td style="width:250px"> |
| | | <div style="width:90px;margin-left:12px;" class="searchName">消耗品名称</div> |
| | | </td> |
| | | <td style="width: 21%;"> |
| | | <lightning-input class="searchName" type="text" name="Name" label="消耗品名称" |
| | | value={Name} variant="label-hidden" onchange={dataChange} |
| | | data-field="Name"></lightning-input> |
| | | </td> |
| | | <td style="width:150px"> |
| | | <div style="width:90px;text-align:center;" class="searchName">第3分类</div> |
| | | </td> |
| | | <td style="width: 21%;"> |
| | | <lightning-combobox class="inputFont" style="margin-left:5px;" name="CategoryThree" |
| | | label="第3分类" value={value} placeholder="请选择..." options={category3Options} |
| | | variant="label-hidden" data-field="CategoryThree" |
| | | onchange={dataChange}></lightning-combobox> |
| | | </td> |
| | | <td style="width:150px"> |
| | | <div style="width:90px;text-align:center;" class="searchName">第4分类</div> |
| | | </td> |
| | | <td style="width: 21%;"> |
| | | <lightning-combobox class="inputFont" name="CategoryFour" label="第4分类" value={value} |
| | | placeholder="请选择..." options={category4Options} variant="label-hidden" |
| | | data-field="CategoryFour" onchange={dataChange}></lightning-combobox> |
| | | </td> |
| | | <td style="width:150px"> |
| | | <div style="width:90px;text-align:center;" class="searchName">第5分类</div> |
| | | </td> |
| | | <td style="width: 21%;"> |
| | | <lightning-combobox class="inputFont" name="CategoryFive" label="第5分类" value={value} |
| | | placeholder="请选择..." options={category5Options} variant="label-hidden" |
| | | data-field="CategoryFive" onchange={dataChange}></lightning-combobox> |
| | | </td> |
| | | <td style="width: 1%;"></td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | <br /> |
| | | <div style="float:right;margin-right:10px;"> <button |
| | | class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" label="消耗品搜索" |
| | | onclick={searchOrderDetail}>消耗品搜索</button> |
| | | <button style="margin-left:10px;" |
| | | class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" label="清空" |
| | | onclick={clearAll}>清空</button> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;"> |
| | | <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;"> |
| | | <!-- <p style="font-size: 16px;"><strong>库存详情</strong></p> --> |
| | | <lightning-layout> |
| | | <lightning-layout-item padding="around-small"> |
| | | <p style="font-size: 18px"> |
| | | <strong>库存详情</strong> |
| | | </p> |
| | | </lightning-layout-item> |
| | | </lightning-layout> |
| | | </div> |
| | | <div style="padding:10px;"> |
| | | <template if:true={showTable}> |
| | | <c-lex-custom-lightning-datatable key-field="id" data={data} columns={columns} |
| | | default-sort-direction={defaultSortDirection} sorted-direction={sortDirection} |
| | | sorted-by={sortedBy} onsort={onHandleSort} hide-checkbox-column={hidecheckboxcolumn} |
| | | class="wrapped-header-datatable"> |
| | | </c-lex-custom-lightning-datatable> |
| | | </template> |
| | | <c-paginator onprevious={handlePrevious} onnext={handleNext} onpageschange={handlePageschange} |
| | | onfirst={handleFirst} onlast={handleLast} page-size-options={pageSizeOptions} |
| | | previous-button-disabled={previousButtonDisabled} next-button-disabled={nextButtonDisabled} |
| | | record-start={recordStart} record-end={recordEnd} total-records={totalRecords}></c-paginator> |
| | | </div> |
| | | </div> |
| | | <button |
| | | style="margin-left: 5px" |
| | | class="slds-button slds-button_neutral slds-button_stretch lexBorder" |
| | | label="库存盘点" |
| | | onclick={inventoryCount} |
| | | > |
| | | 库存盘点 |
| | | </button> |
| | | <button |
| | | class="slds-button slds-button_neutral slds-button_stretch lexButtoun" |
| | | label="过期库存销存" |
| | | style="margin-left: 60px" |
| | | onclick={handleExpired} |
| | | > |
| | | 过期库存销存 |
| | | </button> |
| | | <button |
| | | class="slds-button slds-button_neutral slds-button_stretch lexButtoun" |
| | | label="拆盒" |
| | | style="margin-left: 60px" |
| | | onclick={removeBox} |
| | | > |
| | | 拆盒 |
| | | </button> |
| | | <button |
| | | class="slds-button slds-button_neutral slds-button_stretch lexButtoun" |
| | | label="取消拆盒" |
| | | style="margin-left: 60px" |
| | | onclick={cancelremoveBox} |
| | | > |
| | | 取消拆盒 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div |
| | | style=" |
| | | border: 1px solid #d4d4d4; |
| | | border-radius: 5px; |
| | | margin-bottom: 7px; |
| | | margin-top: 30px; |
| | | " |
| | | > |
| | | <div |
| | | style=" |
| | | border-top: 3px solid #51606e; |
| | | border-bottom: 1px solid #d4d4d4; |
| | | padding: 3px; |
| | | height: 115px; |
| | | " |
| | | > |
| | | <table style="margin-top: 10px"> |
| | | <colgroup> |
| | | <col width="160px" /> |
| | | <col width="100px" /> |
| | | <col width="10px" /> |
| | | <col width="70px" /> |
| | | <col width="100px" /> |
| | | <col width="10px" /> |
| | | <col width="70px" /> |
| | | <col width="100px" /> |
| | | <col width="10px" /> |
| | | <col width="90px" /> |
| | | <col width="100px" /> |
| | | <col width="85px" /> |
| | | <col width="100px" /> |
| | | <col width="10px" /> |
| | | <col width="70px" /> |
| | | <col width="100px" /> |
| | | </colgroup> |
| | | <tbody> |
| | | <tr> |
| | | <td style="width: 10px"></td> |
| | | <td style="width: 250px"> |
| | | <div |
| | | style="width: 90px; margin-left: 12px" |
| | | class="searchName" |
| | | > |
| | | 消耗品名称 |
| | | </div> |
| | | </td> |
| | | <td style="width: 21%"> |
| | | <lightning-input |
| | | class="searchName" |
| | | type="text" |
| | | name="Name" |
| | | label="消耗品名称" |
| | | value={Name} |
| | | variant="label-hidden" |
| | | onchange={dataChange} |
| | | data-field="Name" |
| | | ></lightning-input> |
| | | </td> |
| | | <td style="width: 150px"> |
| | | <div |
| | | style="width: 90px; text-align: center" |
| | | class="searchName" |
| | | > |
| | | 第3分类 |
| | | </div> |
| | | </td> |
| | | <td style="width: 21%"> |
| | | <lightning-combobox |
| | | class="inputFont" |
| | | style="margin-left: 5px" |
| | | name="CategoryThree" |
| | | label="第3分类" |
| | | value={value} |
| | | placeholder="请选择..." |
| | | options={category3Options} |
| | | variant="label-hidden" |
| | | data-field="CategoryThree" |
| | | onchange={dataChange} |
| | | ></lightning-combobox> |
| | | </td> |
| | | <td style="width: 150px"> |
| | | <div |
| | | style="width: 90px; text-align: center" |
| | | class="searchName" |
| | | > |
| | | 第4分类 |
| | | </div> |
| | | </td> |
| | | <td style="width: 21%"> |
| | | <lightning-combobox |
| | | class="inputFont" |
| | | name="CategoryFour" |
| | | label="第4分类" |
| | | value={value} |
| | | placeholder="请选择..." |
| | | options={category4Options} |
| | | variant="label-hidden" |
| | | data-field="CategoryFour" |
| | | onchange={dataChange} |
| | | ></lightning-combobox> |
| | | </td> |
| | | <td style="width: 150px"> |
| | | <div |
| | | style="width: 90px; text-align: center" |
| | | class="searchName" |
| | | > |
| | | 第5分类 |
| | | </div> |
| | | </td> |
| | | <td style="width: 21%"> |
| | | <lightning-combobox |
| | | class="inputFont" |
| | | name="CategoryFive" |
| | | label="第5分类" |
| | | value={value} |
| | | placeholder="请选择..." |
| | | options={category5Options} |
| | | variant="label-hidden" |
| | | data-field="CategoryFive" |
| | | onchange={dataChange} |
| | | ></lightning-combobox> |
| | | </td> |
| | | <td style="width: 1%"></td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | <br /> |
| | | <div style="float: right; margin-right: 10px"> |
| | | <button |
| | | class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" |
| | | label="消耗品搜索" |
| | | onclick={searchOrderDetail} |
| | | > |
| | | 消耗品搜索 |
| | | </button> |
| | | <button |
| | | style="margin-left: 10px" |
| | | class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" |
| | | label="清空" |
| | | onclick={clearAll} |
| | | > |
| | | 清空 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div |
| | | style=" |
| | | border: 1px solid #d4d4d4; |
| | | border-radius: 5px; |
| | | margin-bottom: 7px; |
| | | " |
| | | > |
| | | <div |
| | | style=" |
| | | border-top: 3px solid #51606e; |
| | | border-bottom: 1px solid #d4d4d4; |
| | | padding: 3px; |
| | | " |
| | | > |
| | | <!-- <p style="font-size: 16px;"><strong>库存详情</strong></p> --> |
| | | <lightning-layout> |
| | | <lightning-layout-item padding="around-small"> |
| | | <p style="font-size: 18px"> |
| | | <strong>库存详情</strong> |
| | | </p> |
| | | </lightning-layout-item> |
| | | </lightning-layout> |
| | | </div> |
| | | <div style="padding: 10px"> |
| | | <template if:true={showTable}> |
| | | <c-lex-custom-lightning-datatable |
| | | key-field="id" |
| | | data={data} |
| | | columns={columns} |
| | | default-sort-direction={defaultSortDirection} |
| | | sorted-direction={sortDirection} |
| | | sorted-by={sortedBy} |
| | | onsort={onHandleSort} |
| | | hide-checkbox-column={hidecheckboxcolumn} |
| | | class="wrapped-header-datatable" |
| | | > |
| | | </c-lex-custom-lightning-datatable> |
| | | </template> |
| | | <c-paginator |
| | | onprevious={handlePrevious} |
| | | onnext={handleNext} |
| | | onpageschange={handlePageschange} |
| | | onfirst={handleFirst} |
| | | onlast={handleLast} |
| | | page-size-options={pageSizeOptions} |
| | | previous-button-disabled={previousButtonDisabled} |
| | | next-button-disabled={nextButtonDisabled} |
| | | record-start={recordStart} |
| | | record-end={recordEnd} |
| | | total-records={totalRecords} |
| | | ></c-paginator> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </div> |
| | | </template> |
| | |
| | | import { LightningElement, wire, api, track } from 'lwc'; |
| | | import { LightningElement, wire, api, track } from "lwc"; |
| | | import oninit from "@salesforce/apex/LexInventoryViewController.init"; |
| | | import { ShowToastEvent } from "lightning/platformShowToastEvent"; |
| | | import searchOrder from "@salesforce/apex/LexInventoryViewController.searchConsumableorderdetails"; |
| | | import categoryAllload from "@salesforce/apex/LexInventoryViewController.categoryAllload"; |
| | | import { NavigationMixin } from "lightning/navigation"; |
| | | |
| | | //table css |
| | | //table css |
| | | import { loadStyle } from "lightning/platformResourceLoader"; |
| | | import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable"; |
| | | |
| | | export default class LexinventoryViewLWC extends NavigationMixin( |
| | | LightningElement |
| | | ) { |
| | | //分页start |
| | | @track sortBy = ""; |
| | | //@track sortDirection = "asc"; |
| | | @track pageSize = 10; |
| | | error; |
| | | records; |
| | | currentPageToken = 0; |
| | | nextPageToken = this.pageSize; |
| | | @track totalRecords = 0; |
| | | @track loader = false; |
| | | @track pageNumber = 1; |
| | | @track paginationVisibility = false; |
| | | @track totalPages = 1; |
| | | pageSizeOptions = [10, 25, 50, 100]; |
| | | @track recordStart = 0; |
| | | @track recordEnd = 0; |
| | | //end |
| | | |
| | | export default class LexinventoryViewLWC extends NavigationMixin(LightningElement) { |
| | | //分页start |
| | | @track sortBy = ""; |
| | | //@track sortDirection = "asc"; |
| | | @track pageSize = 10; |
| | | error; |
| | | records; |
| | | currentPageToken = 0; |
| | | nextPageToken = this.pageSize; |
| | | @track totalRecords = 0; |
| | | @track loader = false; |
| | | @track pageNumber = 1; |
| | | @track paginationVisibility = false; |
| | | @track totalPages = 1; |
| | | pageSizeOptions = [10,25,50,100]; |
| | | @track recordStart = 0; |
| | | @track recordEnd = 0; |
| | | //end |
| | | @track data = []; |
| | | @track message = ""; |
| | | @track Name; |
| | | @track CategoryThree; |
| | | |
| | | @track data = []; |
| | | @track message = ""; |
| | | @track Name; |
| | | @track CategoryThree; |
| | | @track category3Options = []; |
| | | @track CategoryFour; |
| | | @track category4Options = []; |
| | | @track CategoryFive; |
| | | @track category5Options = []; |
| | | @track orderDetZaikuList = []; |
| | | @track accountName; |
| | | @track agencyProType; |
| | | @track userWorkLocation; |
| | | @track value = ""; |
| | | @track showTable = false; |
| | | @track hidecheckboxcolumn = true; |
| | | @track check = false; |
| | | @track productkucun; |
| | | //加载 |
| | | @track showSpinner = false; |
| | | @track showSpinners = false; |
| | | //医院特价 |
| | | @track hasHos = false; |
| | | //表头样式 |
| | | stylesLoaded = false; |
| | | |
| | | @track category3Options = []; |
| | | @track CategoryFour; |
| | | @track category4Options = []; |
| | | @track CategoryFive; |
| | | @track category5Options = []; |
| | | @track orderDetZaikuList = []; |
| | | @track accountName; |
| | | @track agencyProType; |
| | | @track userWorkLocation; |
| | | @track value = ""; |
| | | @track showTable = false; |
| | | @track hidecheckboxcolumn = true; |
| | | @track check = false; |
| | | @track productkucun; |
| | | //加载 |
| | | @track showSpinner = false; |
| | | @track showSpinners = false; |
| | | //医院特价 |
| | | @track hasHos = false; |
| | | //表头样式 |
| | | stylesLoaded = false; |
| | | @track columns = [ |
| | | { |
| | | label: "消耗品名称", |
| | | fieldName: "Name__c", |
| | | type: "Name", |
| | | sortable: true, |
| | | hideDefaultActions: true, |
| | | initialWidth: 300, |
| | | wrapText: true, |
| | | cellAttributes: { alignment: "left" } |
| | | }, |
| | | { |
| | | label: "第三分类", |
| | | fieldName: "Category3__c", |
| | | initialWidth: 120, |
| | | cellAttributes: { alignment: "left" }, |
| | | hideDefaultActions: true, |
| | | sortable: true, |
| | | wrapText: true |
| | | }, |
| | | { |
| | | label: "第四分类", |
| | | fieldName: "Category4__c", |
| | | cellAttributes: { alignment: "left" }, |
| | | initialWidth: 120, |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: "第五分类", |
| | | fieldName: "Category5__c", |
| | | cellAttributes: { alignment: "left" }, |
| | | initialWidth: 120, |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | sortable: true |
| | | }, |
| | | |
| | | { |
| | | label: "规格", |
| | | fieldName: "packing_list", |
| | | cellAttributes: { alignment: "right" }, |
| | | initialWidth: 55, |
| | | wrapText: true, |
| | | hideDefaultActions: true |
| | | }, |
| | | { |
| | | label: "单位", |
| | | fieldName: "BoxPiece", |
| | | cellAttributes: { alignment: "left" }, |
| | | initialWidth: 55, |
| | | wrapText: true, |
| | | hideDefaultActions: true |
| | | }, |
| | | { |
| | | label: "注册证编码号", |
| | | fieldName: "approbation_No", |
| | | cellAttributes: { alignment: "left" }, |
| | | wrapText: true, |
| | | initialWidth: 200, |
| | | hideDefaultActions: true |
| | | }, |
| | | { |
| | | label: "注册有效期", |
| | | fieldName: "expiration_Date", |
| | | cellAttributes: { alignment: "left" }, |
| | | wrapText: true, |
| | | hideDefaultActions: true, |
| | | initialWidth: 110 |
| | | }, |
| | | { |
| | | label: "CFDA状态", |
| | | fieldName: "SFDA_Status__c", |
| | | cellAttributes: { alignment: "left" }, |
| | | initialWidth: 95, |
| | | wrapText: true, |
| | | hideDefaultActions: true |
| | | }, |
| | | { |
| | | label: "使用期限", |
| | | fieldName: "guaranteeperiod", |
| | | cellAttributes: { alignment: "left" }, |
| | | hideDefaultActions: true, |
| | | initialWidth: 105 |
| | | }, |
| | | { |
| | | label: "有效期内库存", |
| | | type: "customInventoryColor", |
| | | fieldName: "limitCount", |
| | | sortable: true, |
| | | cellAttributes: { alignment: "right" }, |
| | | typeAttributes: { |
| | | value: { fieldName: "limitCount" }, |
| | | upperlimit: { fieldName: "upperlimit" }, |
| | | lowerlimit: { fieldName: "lowerlimit" }, |
| | | boxPrice: { fieldName: "BoxPiece" } |
| | | }, |
| | | hideDefaultActions: true, |
| | | initialWidth: 150 |
| | | }, |
| | | |
| | | @track columns = [ |
| | | { |
| | | label: "消耗品名称", |
| | | fieldName: "Name__c", |
| | | type: "Name", |
| | | sortable: true, |
| | | hideDefaultActions: true, |
| | | initialWidth: 300, |
| | | wrapText: true, |
| | | cellAttributes: { alignment: "left" } |
| | | }, |
| | | { |
| | | label: "第三分类", |
| | | fieldName: "Category3__c", |
| | | initialWidth: 120, |
| | | cellAttributes: { alignment: "left" }, |
| | | hideDefaultActions: true, |
| | | sortable: true, |
| | | wrapText: true, |
| | | }, |
| | | { |
| | | label: "第四分类", |
| | | fieldName: "Category4__c", |
| | | cellAttributes: { alignment: "left" }, |
| | | initialWidth: 120, |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | sortable: true, |
| | | |
| | | }, |
| | | { |
| | | label: "第五分类", |
| | | fieldName: "Category5__c", |
| | | cellAttributes: { alignment: "left" }, |
| | | initialWidth: 120, |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | sortable: true, |
| | | |
| | | }, |
| | | |
| | | { |
| | | label: "规格", |
| | | fieldName: "packing_list", |
| | | cellAttributes: { alignment: "right" }, |
| | | initialWidth: 55, |
| | | wrapText: true, |
| | | hideDefaultActions: true, |
| | | }, |
| | | { |
| | | label: "单位", |
| | | fieldName: "BoxPiece", |
| | | cellAttributes: { alignment: "left" }, |
| | | initialWidth: 55, |
| | | wrapText: true, |
| | | hideDefaultActions: true, |
| | | }, |
| | | { |
| | | label: "注册证编码号", |
| | | fieldName: "approbation_No", |
| | | cellAttributes: { alignment: "left" }, |
| | | wrapText: true, |
| | | initialWidth: 200, |
| | | hideDefaultActions: true, |
| | | }, |
| | | { |
| | | label: "注册有效期", |
| | | fieldName: "expiration_Date", |
| | | cellAttributes: { alignment: "left" }, |
| | | wrapText: true, |
| | | hideDefaultActions: true, |
| | | initialWidth: 110 |
| | | }, |
| | | { |
| | | label: "CFDA状态", |
| | | fieldName: "SFDA_Status__c", |
| | | cellAttributes: { alignment: "left" }, |
| | | initialWidth: 95, |
| | | wrapText: true, |
| | | hideDefaultActions: true, |
| | | }, |
| | | { |
| | | label: "使用期限", |
| | | fieldName: "guaranteeperiod", |
| | | cellAttributes: { alignment: "left" }, |
| | | hideDefaultActions: true, |
| | | initialWidth: 105 |
| | | }, |
| | | { |
| | | label:'有效期内库存', |
| | | type: "customInventoryColor", |
| | | fieldName: "limitCount", |
| | | sortable: true, |
| | | cellAttributes: {alignment: "right" }, |
| | | typeAttributes: { |
| | | value: { fieldName:"limitCount"}, |
| | | upperlimit: { fieldName: "upperlimit" }, |
| | | lowerlimit: { fieldName: "lowerlimit" }, |
| | | boxPrice:{ fieldName: "BoxPiece" }, |
| | | }, |
| | | hideDefaultActions: true, |
| | | initialWidth:150 |
| | | }, |
| | | |
| | | { |
| | | label: "过期库存", |
| | | fieldName: "overlimitCount", |
| | | hideDefaultActions: true, |
| | | cellAttributes: { alignment: "right" }, |
| | | initialWidth:80 |
| | | } |
| | | ]; |
| | | defaultSortDirection = "asc"; |
| | | sortDirection = "asc"; |
| | | sortedBy; |
| | | |
| | | |
| | | |
| | | renderedCallback() { |
| | | if (!this.stylesLoaded) { |
| | | Promise.all([loadStyle(this, WrappedHeaderTable)]) |
| | | .then(() => { |
| | | console.log("Custom styles loaded"); |
| | | this.stylesLoaded = true; |
| | | }) |
| | | .catch((error) => { |
| | | console.error("Error loading custom styles"); |
| | | }); |
| | | } |
| | | { |
| | | label: "过期库存", |
| | | fieldName: "overlimitCount", |
| | | hideDefaultActions: true, |
| | | cellAttributes: { alignment: "right" }, |
| | | initialWidth: 80 |
| | | } |
| | | ]; |
| | | defaultSortDirection = "asc"; |
| | | sortDirection = "asc"; |
| | | sortedBy; |
| | | |
| | | |
| | | connectedCallback() { |
| | | this.loader = true; |
| | | this.init(); |
| | | } |
| | | |
| | | init() { |
| | | this.showSpinner = true; |
| | | oninit({ |
| | | pageSizeLWC: this.pageSize, |
| | | pageTokenLWC: this.currentPageToken, |
| | | sortFieldLWC: this.sortBy, |
| | | sortOrderLWC: this.sortDirection |
| | | }).then((result) => { |
| | | result = JSON.parse(JSON.stringify(result)); |
| | | console.log("result.pageRecords = " + JSON.stringify(result.entity.pageRecords)); |
| | | console.log("result.consumableorderdetailsRecords = " + JSON.stringify(result.entity.consumableorderdetailsRecords)); |
| | | console.log("result.status = " + result.status); |
| | | console.log("result = " + JSON.stringify(result)); |
| | | console.log("result 1= " + JSON.stringify(result.entity)); |
| | | console.log("result 2= " + JSON.stringify(result.entity.pageRecords)); |
| | | if (result.status == "Success") { |
| | | console.log('result.entity.paginatedAccounts = ' + JSON.stringify(result.entity.paginatedAccounts)); |
| | | this.nextPageToken = result.entity.paginatedAccounts.nextPageToken; |
| | | this.totalRecords = result.entity.paginatedAccounts.totalRecords; |
| | | this.recordStart = result.entity.paginatedAccounts.recordStart; |
| | | this.recordEnd = result.entity.paginatedAccounts.recordEnd; |
| | | this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize); |
| | | console.log('this.totalPages = ' + this.totalPages); |
| | | this.paginationVisibility = this.totalPages > 1 ? true : false; |
| | | |
| | | this.loader = false; |
| | | this.data = result.entity.pageRecords; |
| | | this.productkucun = result.entity.productkucun; |
| | | |
| | | for (var i in this.data) { |
| | | this.data[i]["Name__c"] = this.data[i].Prod.Name__c; |
| | | this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c; |
| | | this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c; |
| | | this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c; |
| | | this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c; |
| | | } |
| | | this.showTable = true; |
| | | this.orderDetZaikuList = result.entity.orderDetZaikuList; |
| | | this.accountName = result.entity.accountName; |
| | | this.agencyProType = result.entity.agencyProType; |
| | | this.userWorkLocation = result.entity.userWorkLocation; |
| | | let option1ValueTemp = []; |
| | | for (var key in result.entity.categoryOptionMap) { |
| | | let object = {}; |
| | | object['label'] = result.entity.categoryOptionMap[key]; |
| | | object['value'] = key; |
| | | option1ValueTemp.push(object); |
| | | } |
| | | this.category3Options = option1ValueTemp; |
| | | console.log(' this.optionscatone===>' + JSON.stringify(this.optionscatone)); |
| | | let option2ValueTemp = []; |
| | | for (var key in result.entity.category4OptionMap) { |
| | | let object = {}; |
| | | object["label"] = result.entity.category4OptionMap[key]; |
| | | object["value"] = key; |
| | | option2ValueTemp.push(object); |
| | | } |
| | | this.category4Options = option2ValueTemp; |
| | | let option3ValueTemp = []; |
| | | for (var key in result.entity.category5OptionMap) { |
| | | let object = {}; |
| | | object["label"] = result.entity.category5OptionMap[key]; |
| | | object["value"] = key; |
| | | option3ValueTemp.push(object); |
| | | } |
| | | this.category5Options = option3ValueTemp; |
| | | this.hasHos = result.entity.hasHos; |
| | | console.log('this.hasHos'+this.hasHos); |
| | | //颜色标记 |
| | | |
| | | //hasHos = true 医院特价 |
| | | if (this.hasHos) { |
| | | let object1 = { |
| | | label: "医院特价", |
| | | fieldName: "hospitalSpecialOffer__c", |
| | | hideDefaultActions: true, |
| | | type:'boolean', |
| | | cellAttributes: { alignment: "left" }, |
| | | initialWidth:80 |
| | | |
| | | }; |
| | | this.columns.push(object1); |
| | | console.log(' this.columns'+ this.columns); |
| | | for (var j in this.data) { |
| | | this.data[j]["Name__c"] = this.data[j].Prod.Name__c; |
| | | this.data[j]["Category3__c"] = this.data[j].Prod.Category3__c; |
| | | this.data[j]["Category4__c"] = this.data[j].Prod.Category4__c; |
| | | this.data[j]["Category5__c"] = this.data[j].Prod.Category5__c; |
| | | this.data[j]["SFDA_Status__c"] = this.data[j].Prod.SFDA_Status__c; |
| | | this.data[j]["hospitalSpecialOffer__c"] = this.data[j].hospitalSpecialOffer; |
| | | console.log('this.data[j].hospitalSpecialOffer__c'+this.data[j].hospitalSpecialOffer); |
| | | } |
| | | } |
| | | this.showSpinner = false; |
| | | } else { |
| | | // this.showToast("Error",'Error', result.msg); |
| | | this.showMyToast('初始化失败',result.msg,'error'); |
| | | } |
| | | }).catch((error) => { |
| | | this.loader = false; |
| | | this.showSpinner = false; |
| | | console.log("error = " + JSON.stringify(error)); |
| | | }); |
| | | } |
| | | |
| | | handleChange(event) { |
| | | let fieldName = event.target.getAttribute("data-field"); |
| | | let value = event.detail.value; |
| | | console.log("======>fieldName" + fieldName); |
| | | console.log("======>value" + value); |
| | | switch (fieldName) { |
| | | case "Name": |
| | | this.Name = value; |
| | | break; |
| | | case "CategoryThree": |
| | | this.CategoryThree = value; |
| | | break; |
| | | case "CategoryFour": |
| | | this.CategoryFour = value; |
| | | break; |
| | | case "CategoryFive": |
| | | this.CategoryFive = value; |
| | | break; |
| | | default: |
| | | console.log("no data"); |
| | | } |
| | | } |
| | | dataChange(event) { |
| | | let fieldName = event.target.getAttribute("data-field"); |
| | | let value = event.detail.value; |
| | | console.log("fieldName = " + fieldName + " value = " + value); |
| | | switch (fieldName) { |
| | | case "Name": |
| | | this.Name = value; |
| | | break; |
| | | case "CategoryThree": |
| | | this.CategoryThree = value; |
| | | //调用后台显示第四五分类 |
| | | this.showAllCate(); |
| | | if (this.CategoryThree == '') { |
| | | this.CategoryFour = ''; |
| | | this.CategoryFive = ''; |
| | | } |
| | | break; |
| | | case "CategoryFour": |
| | | this.CategoryFour = value; |
| | | //调用后台显示第五分类 |
| | | this.showCate(); |
| | | if (this.CategoryFour == '') { |
| | | this.CategoryFive = ''; |
| | | } |
| | | break; |
| | | case "CategoryFive": |
| | | this.CategoryFive = value; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | showAllCate() { |
| | | categoryAllload({ |
| | | category3LWC: this.CategoryThree, |
| | | agencyProTypeLWC:this.agencyProType |
| | | }).then((result) => { |
| | | result = JSON.parse(JSON.stringify(result)); |
| | | console.log("result = " + JSON.stringify(result)); |
| | | if (result.status == "Success") { |
| | | this.category4Options = []; |
| | | this.category5Options = []; |
| | | //第4分类 |
| | | for (var key in result.entity.category4OptionMap) { |
| | | let object = {}; |
| | | object["label"] = result.entity.category4OptionMap[key]; |
| | | object["value"] = key; |
| | | this.category4Options.push(object); |
| | | } |
| | | console.log("this.category4Options = " + JSON.stringify(this.category4Options)); |
| | | //第5分类 |
| | | for (var key in result.entity.category5OptionMap) { |
| | | let object = {}; |
| | | object["label"] = result.entity.category5OptionMap[key]; |
| | | object["value"] = key; |
| | | this.category5Options.push(object); |
| | | } |
| | | } else { |
| | | console.log("result = " + JSON.stringify(result)); |
| | | this.showMyToast(result.msg,'','error'); |
| | | } |
| | | }).catch((error) => { |
| | | console.log("error" + JSON.stringify(error)); |
| | | renderedCallback() { |
| | | if (!this.stylesLoaded) { |
| | | Promise.all([loadStyle(this, WrappedHeaderTable)]) |
| | | .then(() => { |
| | | console.log("Custom styles loaded"); |
| | | this.stylesLoaded = true; |
| | | }) |
| | | .catch((error) => { |
| | | console.error("Error loading custom styles"); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | searchOrderDetail() { |
| | | this.showTable = false; |
| | | this.showSpinner = true; |
| | | searchOrder({ |
| | | category1: this.Name, |
| | | Category3: this.CategoryThree, |
| | | Category4: this.CategoryFour, |
| | | Category5: this.CategoryFive, |
| | | orderDetZaikuListLWC: JSON.stringify(this.orderDetZaikuList), |
| | | accountName: this.accountName, |
| | | agencyProType: this.agencyProType, |
| | | userWorkLocation: this.userWorkLocation, |
| | | pageSizeLWC: this.pageSize, |
| | | pageTokenLWC: this.currentPageToken, |
| | | productkucunLWC: this.productkucun |
| | | |
| | | // sortFieldLWC: this.sortBy, |
| | | // sortOrderLWC: this.sortDirection |
| | | }) |
| | | .then((result) => { |
| | | result = JSON.parse(JSON.stringify(result)); |
| | | if (result.status == "Success") { |
| | | this.nextPageToken = result.entity.paginatedAccounts.nextPageToken; |
| | | this.totalRecords = result.entity.paginatedAccounts.totalRecords; |
| | | this.recordStart = result.entity.paginatedAccounts.recordStart; |
| | | this.recordEnd = result.entity.paginatedAccounts.recordEnd; |
| | | this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize); |
| | | console.log('result.entity.paginatedAccounts = ' + JSON.stringify(result.entity.paginatedAccounts)); |
| | | console.log('this.totalPages = ' + this.totalPages); |
| | | this.paginationVisibility = this.totalPages > 1 ? true : false; |
| | | console.log('this.sortDirection = ' + this.sortDirection); |
| | | // this.showToast("Success",'搜索成功', result.msg); |
| | | // this.showMyToast('搜索成功',result.msg,'success'); |
| | | this.data = result.entity.pageRecords; |
| | | console.log('搜索Data==>'+JSON.stringify(this.data)); |
| | | for (var i in this.data) { |
| | | this.data[i]["Name__c"] = this.data[i].Prod.Name__c; |
| | | this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c; |
| | | this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c; |
| | | this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c; |
| | | this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c; |
| | | this.data[i]["hospitalSpecialOffer__c"] = this.data[i].hospitalSpecialOffer; |
| | | this.data[i]["guaranteeperiod"] = this.data[i].guaranteeperiod; |
| | | } |
| | | this.data = [...this.data]; |
| | | console.log('this.data = ' + JSON.stringify(this.data)); |
| | | this.showTable = true; |
| | | this.showSpinner = false; |
| | | } else { |
| | | this.nextPageToken = this.pageSize; |
| | | this.totalRecords = 0; |
| | | this.recordStart = 0; |
| | | this.recordEnd = 0; |
| | | this.totalPages =0; |
| | | connectedCallback() { |
| | | this.loader = true; |
| | | this.init(); |
| | | } |
| | | |
| | | // this.showToast("Error",'Error', result.msg); |
| | | // this.showMyToast('搜索失败',result.msg,'error'); |
| | | this.showSpinner = false; |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.log("error = " + JSON.stringify(error)); |
| | | this.showSpinner = false; |
| | | }); |
| | | } |
| | | inventoryCount() { |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__webPage', |
| | | attributes: { |
| | | url: '/lexinventory' |
| | | } |
| | | }); |
| | | } |
| | | init() { |
| | | this.showSpinner = true; |
| | | oninit({ |
| | | pageSizeLWC: this.pageSize, |
| | | pageTokenLWC: this.currentPageToken, |
| | | sortFieldLWC: this.sortBy, |
| | | sortOrderLWC: this.sortDirection |
| | | }) |
| | | .then((result) => { |
| | | result = JSON.parse(JSON.stringify(result)); |
| | | console.log( |
| | | "result.pageRecords = " + JSON.stringify(result.entity.pageRecords) |
| | | ); |
| | | console.log( |
| | | "result.consumableorderdetailsRecords = " + |
| | | JSON.stringify(result.entity.consumableorderdetailsRecords) |
| | | ); |
| | | console.log("result.status = " + result.status); |
| | | console.log("result = " + JSON.stringify(result)); |
| | | console.log("result 1= " + JSON.stringify(result.entity)); |
| | | console.log("result 2= " + JSON.stringify(result.entity.pageRecords)); |
| | | if (result.status == "Success") { |
| | | console.log( |
| | | "result.entity.paginatedAccounts = " + |
| | | JSON.stringify(result.entity.paginatedAccounts) |
| | | ); |
| | | this.nextPageToken = result.entity.paginatedAccounts.nextPageToken; |
| | | this.totalRecords = result.entity.paginatedAccounts.totalRecords; |
| | | this.recordStart = result.entity.paginatedAccounts.recordStart; |
| | | this.recordEnd = result.entity.paginatedAccounts.recordEnd; |
| | | this.totalPages = Math.ceil( |
| | | result.entity.paginatedAccounts.totalRecords / this.pageSize |
| | | ); |
| | | console.log("this.totalPages = " + this.totalPages); |
| | | this.paginationVisibility = this.totalPages > 1 ? true : false; |
| | | |
| | | handleExpired() { |
| | | console.log('过期库存呢销存'); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__webPage', |
| | | attributes: { |
| | | url: '/lexoverduestock' |
| | | } |
| | | }); |
| | | this.loader = false; |
| | | this.data = result.entity.pageRecords; |
| | | this.productkucun = result.entity.productkucun; |
| | | |
| | | } |
| | | removeBox() { |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__webPage', |
| | | attributes: { |
| | | url: '/lexremovebox' |
| | | } |
| | | }); |
| | | for (var i in this.data) { |
| | | this.data[i]["Name__c"] = this.data[i].Prod.Name__c; |
| | | this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c; |
| | | this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c; |
| | | this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c; |
| | | this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c; |
| | | } |
| | | this.showTable = true; |
| | | this.orderDetZaikuList = result.entity.orderDetZaikuList; |
| | | this.accountName = result.entity.accountName; |
| | | this.agencyProType = result.entity.agencyProType; |
| | | this.userWorkLocation = result.entity.userWorkLocation; |
| | | let option1ValueTemp = []; |
| | | for (var key in result.entity.categoryOptionMap) { |
| | | let object = {}; |
| | | object["label"] = result.entity.categoryOptionMap[key]; |
| | | object["value"] = key; |
| | | option1ValueTemp.push(object); |
| | | } |
| | | this.category3Options = option1ValueTemp; |
| | | console.log( |
| | | " this.optionscatone===>" + JSON.stringify(this.optionscatone) |
| | | ); |
| | | let option2ValueTemp = []; |
| | | for (var key in result.entity.category4OptionMap) { |
| | | let object = {}; |
| | | object["label"] = result.entity.category4OptionMap[key]; |
| | | object["value"] = key; |
| | | option2ValueTemp.push(object); |
| | | } |
| | | this.category4Options = option2ValueTemp; |
| | | let option3ValueTemp = []; |
| | | for (var key in result.entity.category5OptionMap) { |
| | | let object = {}; |
| | | object["label"] = result.entity.category5OptionMap[key]; |
| | | object["value"] = key; |
| | | option3ValueTemp.push(object); |
| | | } |
| | | this.category5Options = option3ValueTemp; |
| | | this.hasHos = result.entity.hasHos; |
| | | console.log("this.hasHos" + this.hasHos); |
| | | //颜色标记 |
| | | |
| | | } |
| | | cancelremoveBox() { |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__webPage', |
| | | attributes: { |
| | | url: '/lexcancelremovebox' |
| | | } |
| | | }); |
| | | //hasHos = true 医院特价 |
| | | if (this.hasHos) { |
| | | let object1 = { |
| | | label: "医院特价", |
| | | fieldName: "hospitalSpecialOffer__c", |
| | | hideDefaultActions: true, |
| | | type: "boolean", |
| | | cellAttributes: { alignment: "left" }, |
| | | initialWidth: 80 |
| | | }; |
| | | this.columns.push(object1); |
| | | console.log(" this.columns" + this.columns); |
| | | for (var j in this.data) { |
| | | this.data[j]["Name__c"] = this.data[j].Prod.Name__c; |
| | | this.data[j]["Category3__c"] = this.data[j].Prod.Category3__c; |
| | | this.data[j]["Category4__c"] = this.data[j].Prod.Category4__c; |
| | | this.data[j]["Category5__c"] = this.data[j].Prod.Category5__c; |
| | | this.data[j]["SFDA_Status__c"] = this.data[j].Prod.SFDA_Status__c; |
| | | this.data[j]["hospitalSpecialOffer__c"] = |
| | | this.data[j].hospitalSpecialOffer; |
| | | console.log( |
| | | "this.data[j].hospitalSpecialOffer__c" + |
| | | this.data[j].hospitalSpecialOffer |
| | | ); |
| | | } |
| | | } |
| | | this.showSpinner = false; |
| | | } else { |
| | | // this.showToast("Error",'Error', result.msg); |
| | | this.showMyToast("初始化失败", result.msg, "error"); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | this.loader = false; |
| | | this.showSpinner = false; |
| | | console.log("error = " + JSON.stringify(error)); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | clearAll() { |
| | | this.showSpinner = true; |
| | | this.showTable = false; |
| | | this.Name = ''; |
| | | this.CategoryThree = ''; |
| | | this.CategoryFour = ''; |
| | | this.CategoryFive = ''; |
| | | this.template.querySelectorAll("lightning-combobox").forEach((each) => { |
| | | each.value = null; |
| | | }); |
| | | console.log(' this.CategoryThree' + this.CategoryThree); |
| | | console.log('数据列表' + this.data); |
| | | searchOrder({ |
| | | category1: this.Name, |
| | | Category3: this.CategoryThree, |
| | | Category4: this.CategoryFour, |
| | | Category5: this.CategoryFive, |
| | | orderDetZaikuListLWC: JSON.stringify(this.orderDetZaikuList), |
| | | accountName: this.accountName, |
| | | agencyProType: this.agencyProType, |
| | | userWorkLocation: this.userWorkLocation, |
| | | pageSizeLWC: this.pageSize, |
| | | pageTokenLWC: this.currentPageToken, |
| | | }) |
| | | .then((result) => { |
| | | console.log("result搜索 = " + JSON.stringify(result)); |
| | | result = JSON.parse(JSON.stringify(result)); |
| | | if (result.status == "Success") { |
| | | |
| | | this.nextPageToken = result.entity.paginatedAccounts.nextPageToken; |
| | | this.totalRecords = result.entity.paginatedAccounts.totalRecords; |
| | | this.recordStart = result.entity.paginatedAccounts.recordStart; |
| | | this.recordEnd = result.entity.paginatedAccounts.recordEnd; |
| | | this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize); |
| | | console.log('this.totalPages = ' + this.totalPages); |
| | | this.paginationVisibility = this.totalPages > 1 ? true : false; |
| | | console.log('this.sortDirection = ' + this.sortDirection); |
| | | this.data = result.entity.pageRecords; |
| | | |
| | | for (var i in this.data) { |
| | | this.data[i]["Name__c"] = this.data[i].Prod.Name__c; |
| | | this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c; |
| | | this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c; |
| | | this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c; |
| | | this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c; |
| | | this.data[i]["guaranteeperiod"] = this.data[i].guaranteeperiod; |
| | | } |
| | | this.showSpinner = false; |
| | | this.showTable = true; |
| | | // this.showMyToast('搜索成功',result.msg,'success'); |
| | | // this.showToast("Success",'搜索成功', result.msg); |
| | | } else { |
| | | // this.showToast("Error", 'Error',result.msg); |
| | | // this.showMyToast('搜索失败',result.msg,'error'); |
| | | this.showSpinner = false; |
| | | |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.log("error = " + JSON.stringify(error)); |
| | | this.showSpinner = false; |
| | | }); |
| | | } |
| | | |
| | | sortByMethod(field, reverse, primer) { |
| | | const key = primer |
| | | ? function (x) { |
| | | return primer(x[field]); |
| | | } |
| | | : function (x) { |
| | | return x[field]; |
| | | }; |
| | | |
| | | return function (a, b) { |
| | | a = key(a); |
| | | b = key(b); |
| | | return reverse * ((a > b) - (b > a)); |
| | | }; |
| | | handleChange(event) { |
| | | let fieldName = event.target.getAttribute("data-field"); |
| | | let value = event.detail.value; |
| | | console.log("======>fieldName" + fieldName); |
| | | console.log("======>value" + value); |
| | | switch (fieldName) { |
| | | case "Name": |
| | | this.Name = value; |
| | | break; |
| | | case "CategoryThree": |
| | | this.CategoryThree = value; |
| | | break; |
| | | case "CategoryFour": |
| | | this.CategoryFour = value; |
| | | break; |
| | | case "CategoryFive": |
| | | this.CategoryFive = value; |
| | | break; |
| | | default: |
| | | console.log("no data"); |
| | | } |
| | | |
| | | onHandleSort(event) { |
| | | console.log("Sort"); |
| | | this.sortBy = event.detail.fieldName; |
| | | this.sortDirection = event.detail.sortDirection; |
| | | this.currentPageToken = 0; |
| | | console.log('this.sortBy = ' + this.sortBy) |
| | | console.log('this.sortDirection = ' + this.sortDirection) |
| | | // if('limitCount' != this.sortBy) |
| | | // this.searchOrderDetail(); |
| | | // else{ |
| | | // const { fieldName: sortedBy, sortDirection } = event.detail; |
| | | // const cloneData = [...this.data]; |
| | | // cloneData.sort(this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1)); |
| | | // this.data = cloneData; |
| | | // this.sortDirection = sortDirection; |
| | | // this.sortedBy = sortedBy; |
| | | // } |
| | | const { fieldName: sortedBy, sortDirection } = event.detail; |
| | | const cloneData = [...this.data]; |
| | | cloneData.sort(this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1)); |
| | | this.data = cloneData; |
| | | this.sortDirection = sortDirection; |
| | | this.sortedBy = sortedBy; |
| | | } |
| | | handlePaginatorChange(event) { |
| | | this.recordsToDisplay = event.detail.recordsToDisplay; |
| | | this.preSelected = event.detail.preSelected; |
| | | if (this.recordsToDisplay && this.recordsToDisplay > 0) { |
| | | this.rowNumberOffset = this.recordsToDisplay[0].rowNumber - 1; |
| | | } else { |
| | | this.rowNumberOffset = 0; |
| | | } |
| | | } |
| | | |
| | | handlePrevious() { |
| | | this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize); |
| | | this.searchOrderDetail(); |
| | | } |
| | | |
| | | handleNext() { |
| | | this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize); |
| | | this.searchOrderDetail(); |
| | | } |
| | | handleFirst() { |
| | | this.currentPageToken = 0; |
| | | this.searchOrderDetail(); |
| | | } |
| | | |
| | | handleLast() { |
| | | this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0; |
| | | this.searchOrderDetail(); |
| | | } |
| | | |
| | | handlePageschange(event) { |
| | | console.log(event.detail); |
| | | this.pageSize = event.detail; |
| | | this.currentPageToken = 0; |
| | | this.searchOrderDetail(); |
| | | } |
| | | get previousButtonDisabled() { |
| | | return this.currentPageToken === 0; |
| | | } |
| | | |
| | | get nextButtonDisabled() { |
| | | return this.nextPageToken === undefined; |
| | | } |
| | | showMyToast(title, message, variant) { |
| | | console.log('show custom message'); |
| | | var iconName = ''; |
| | | var content = ''; |
| | | if(variant == 'success'){ |
| | | iconName = 'utility:check'; |
| | | }else{ |
| | | iconName = 'utility:error'; |
| | | } |
| | | dataChange(event) { |
| | | let fieldName = event.target.getAttribute("data-field"); |
| | | let value = event.detail.value; |
| | | console.log("fieldName = " + fieldName + " value = " + value); |
| | | switch (fieldName) { |
| | | case "Name": |
| | | this.Name = value; |
| | | break; |
| | | case "CategoryThree": |
| | | this.CategoryThree = value; |
| | | //调用后台显示第四五分类 |
| | | this.showAllCate(); |
| | | if (this.CategoryThree == "") { |
| | | this.CategoryFour = ""; |
| | | this.CategoryFive = ""; |
| | | } |
| | | if(message != ''){ |
| | | content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>'; |
| | | }else{ |
| | | content = '<h2><strong>'+title+'<strong/></h2>'; |
| | | break; |
| | | case "CategoryFour": |
| | | this.CategoryFour = value; |
| | | //调用后台显示第五分类 |
| | | this.showCate(); |
| | | if (this.CategoryFour == "") { |
| | | this.CategoryFive = ""; |
| | | } |
| | | this.template.querySelector('c-common-toast').showToast(variant,content,iconName,10000); |
| | | } |
| | | } |
| | | break; |
| | | case "CategoryFive": |
| | | this.CategoryFive = value; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | showAllCate() { |
| | | categoryAllload({ |
| | | category3LWC: this.CategoryThree, |
| | | agencyProTypeLWC: this.agencyProType |
| | | }) |
| | | .then((result) => { |
| | | result = JSON.parse(JSON.stringify(result)); |
| | | console.log("result = " + JSON.stringify(result)); |
| | | if (result.status == "Success") { |
| | | this.category4Options = []; |
| | | this.category5Options = []; |
| | | //第4分类 |
| | | for (var key in result.entity.category4OptionMap) { |
| | | let object = {}; |
| | | object["label"] = result.entity.category4OptionMap[key]; |
| | | object["value"] = key; |
| | | this.category4Options.push(object); |
| | | } |
| | | console.log( |
| | | "this.category4Options = " + JSON.stringify(this.category4Options) |
| | | ); |
| | | //第5分类 |
| | | for (var key in result.entity.category5OptionMap) { |
| | | let object = {}; |
| | | object["label"] = result.entity.category5OptionMap[key]; |
| | | object["value"] = key; |
| | | this.category5Options.push(object); |
| | | } |
| | | } else { |
| | | console.log("result = " + JSON.stringify(result)); |
| | | this.showMyToast(result.msg, "", "error"); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.log("error" + JSON.stringify(error)); |
| | | }); |
| | | } |
| | | |
| | | searchOrderDetail() { |
| | | this.showTable = false; |
| | | this.showSpinner = true; |
| | | searchOrder({ |
| | | category1: this.Name, |
| | | Category3: this.CategoryThree, |
| | | Category4: this.CategoryFour, |
| | | Category5: this.CategoryFive, |
| | | orderDetZaikuListLWC: JSON.stringify(this.orderDetZaikuList), |
| | | accountName: this.accountName, |
| | | agencyProType: this.agencyProType, |
| | | userWorkLocation: this.userWorkLocation, |
| | | pageSizeLWC: this.pageSize, |
| | | pageTokenLWC: this.currentPageToken, |
| | | productkucunLWC: this.productkucun |
| | | |
| | | // sortFieldLWC: this.sortBy, |
| | | // sortOrderLWC: this.sortDirection |
| | | }) |
| | | .then((result) => { |
| | | result = JSON.parse(JSON.stringify(result)); |
| | | if (result.status == "Success") { |
| | | this.nextPageToken = result.entity.paginatedAccounts.nextPageToken; |
| | | this.totalRecords = result.entity.paginatedAccounts.totalRecords; |
| | | this.recordStart = result.entity.paginatedAccounts.recordStart; |
| | | this.recordEnd = result.entity.paginatedAccounts.recordEnd; |
| | | this.totalPages = Math.ceil( |
| | | result.entity.paginatedAccounts.totalRecords / this.pageSize |
| | | ); |
| | | console.log( |
| | | "result.entity.paginatedAccounts = " + |
| | | JSON.stringify(result.entity.paginatedAccounts) |
| | | ); |
| | | console.log("this.totalPages = " + this.totalPages); |
| | | this.paginationVisibility = this.totalPages > 1 ? true : false; |
| | | console.log("this.sortDirection = " + this.sortDirection); |
| | | // this.showToast("Success",'搜索成功', result.msg); |
| | | // this.showMyToast('搜索成功',result.msg,'success'); |
| | | this.data = result.entity.pageRecords; |
| | | console.log("搜索Data==>" + JSON.stringify(this.data)); |
| | | for (var i in this.data) { |
| | | this.data[i]["Name__c"] = this.data[i].Prod.Name__c; |
| | | this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c; |
| | | this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c; |
| | | this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c; |
| | | this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c; |
| | | this.data[i]["hospitalSpecialOffer__c"] = |
| | | this.data[i].hospitalSpecialOffer; |
| | | this.data[i]["guaranteeperiod"] = this.data[i].guaranteeperiod; |
| | | } |
| | | this.data = [...this.data]; |
| | | console.log("this.data = " + JSON.stringify(this.data)); |
| | | this.showTable = true; |
| | | this.showSpinner = false; |
| | | } else { |
| | | this.nextPageToken = this.pageSize; |
| | | this.totalRecords = 0; |
| | | this.recordStart = 0; |
| | | this.recordEnd = 0; |
| | | this.totalPages = 0; |
| | | |
| | | // this.showToast("Error",'Error', result.msg); |
| | | // this.showMyToast('搜索失败',result.msg,'error'); |
| | | this.showSpinner = false; |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.log("error = " + JSON.stringify(error)); |
| | | this.showSpinner = false; |
| | | }); |
| | | } |
| | | inventoryCount() { |
| | | this[NavigationMixin.Navigate]({ |
| | | type: "standard__webPage", |
| | | attributes: { |
| | | url: "/lexinventory" |
| | | } |
| | | }); |
| | | } |
| | | |
| | | handleExpired() { |
| | | console.log("过期库存呢销存"); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: "standard__webPage", |
| | | attributes: { |
| | | url: "/lexoverduestock" |
| | | } |
| | | }); |
| | | } |
| | | removeBox() { |
| | | this[NavigationMixin.Navigate]({ |
| | | type: "standard__webPage", |
| | | attributes: { |
| | | url: "/lexremovebox" |
| | | } |
| | | }); |
| | | } |
| | | cancelremoveBox() { |
| | | this[NavigationMixin.Navigate]({ |
| | | type: "standard__webPage", |
| | | attributes: { |
| | | url: "/lexcancelremovebox" |
| | | } |
| | | }); |
| | | } |
| | | |
| | | clearAll() { |
| | | this.showSpinner = true; |
| | | this.showTable = false; |
| | | this.Name = ""; |
| | | this.CategoryThree = ""; |
| | | this.CategoryFour = ""; |
| | | this.CategoryFive = ""; |
| | | this.template.querySelectorAll("lightning-combobox").forEach((each) => { |
| | | each.value = null; |
| | | }); |
| | | console.log(" this.CategoryThree" + this.CategoryThree); |
| | | console.log("数据列表" + this.data); |
| | | searchOrder({ |
| | | category1: this.Name, |
| | | Category3: this.CategoryThree, |
| | | Category4: this.CategoryFour, |
| | | Category5: this.CategoryFive, |
| | | orderDetZaikuListLWC: JSON.stringify(this.orderDetZaikuList), |
| | | accountName: this.accountName, |
| | | agencyProType: this.agencyProType, |
| | | userWorkLocation: this.userWorkLocation, |
| | | pageSizeLWC: this.pageSize, |
| | | pageTokenLWC: this.currentPageToken, |
| | | productkucunLWC: this.productkucun |
| | | }) |
| | | .then((result) => { |
| | | console.log("result搜索 = " + JSON.stringify(result)); |
| | | result = JSON.parse(JSON.stringify(result)); |
| | | if (result.status == "Success") { |
| | | this.nextPageToken = result.entity.paginatedAccounts.nextPageToken; |
| | | this.totalRecords = result.entity.paginatedAccounts.totalRecords; |
| | | this.recordStart = result.entity.paginatedAccounts.recordStart; |
| | | this.recordEnd = result.entity.paginatedAccounts.recordEnd; |
| | | this.totalPages = Math.ceil( |
| | | result.entity.paginatedAccounts.totalRecords / this.pageSize |
| | | ); |
| | | console.log("this.totalPages = " + this.totalPages); |
| | | this.paginationVisibility = this.totalPages > 1 ? true : false; |
| | | console.log("this.sortDirection = " + this.sortDirection); |
| | | this.data = result.entity.pageRecords; |
| | | |
| | | for (var i in this.data) { |
| | | this.data[i]["Name__c"] = this.data[i].Prod.Name__c; |
| | | this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c; |
| | | this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c; |
| | | this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c; |
| | | this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c; |
| | | this.data[i]["guaranteeperiod"] = this.data[i].guaranteeperiod; |
| | | } |
| | | this.showSpinner = false; |
| | | this.showTable = true; |
| | | // this.showMyToast('搜索成功',result.msg,'success'); |
| | | // this.showToast("Success",'搜索成功', result.msg); |
| | | } else { |
| | | // this.showToast("Error", 'Error',result.msg); |
| | | // this.showMyToast('搜索失败',result.msg,'error'); |
| | | this.showSpinner = false; |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.log("error = " + JSON.stringify(error)); |
| | | this.showSpinner = false; |
| | | }); |
| | | } |
| | | |
| | | sortByMethod(field, reverse, primer) { |
| | | const key = primer |
| | | ? function (x) { |
| | | return primer(x[field]); |
| | | } |
| | | : function (x) { |
| | | return x[field]; |
| | | }; |
| | | |
| | | return function (a, b) { |
| | | a = key(a); |
| | | b = key(b); |
| | | return reverse * ((a > b) - (b > a)); |
| | | }; |
| | | } |
| | | |
| | | onHandleSort(event) { |
| | | console.log("Sort"); |
| | | this.sortBy = event.detail.fieldName; |
| | | this.sortDirection = event.detail.sortDirection; |
| | | this.currentPageToken = 0; |
| | | console.log("this.sortBy = " + this.sortBy); |
| | | console.log("this.sortDirection = " + this.sortDirection); |
| | | // if('limitCount' != this.sortBy) |
| | | // this.searchOrderDetail(); |
| | | // else{ |
| | | // const { fieldName: sortedBy, sortDirection } = event.detail; |
| | | // const cloneData = [...this.data]; |
| | | // cloneData.sort(this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1)); |
| | | // this.data = cloneData; |
| | | // this.sortDirection = sortDirection; |
| | | // this.sortedBy = sortedBy; |
| | | // } |
| | | const { fieldName: sortedBy, sortDirection } = event.detail; |
| | | const cloneData = [...this.data]; |
| | | cloneData.sort( |
| | | this.sortByMethod(sortedBy, sortDirection === "asc" ? 1 : -1) |
| | | ); |
| | | this.data = cloneData; |
| | | this.sortDirection = sortDirection; |
| | | this.sortedBy = sortedBy; |
| | | } |
| | | handlePaginatorChange(event) { |
| | | this.recordsToDisplay = event.detail.recordsToDisplay; |
| | | this.preSelected = event.detail.preSelected; |
| | | if (this.recordsToDisplay && this.recordsToDisplay > 0) { |
| | | this.rowNumberOffset = this.recordsToDisplay[0].rowNumber - 1; |
| | | } else { |
| | | this.rowNumberOffset = 0; |
| | | } |
| | | } |
| | | |
| | | handlePrevious() { |
| | | this.currentPageToken = |
| | | Number(this.currentPageToken) - Number(this.pageSize); |
| | | this.searchOrderDetail(); |
| | | } |
| | | |
| | | handleNext() { |
| | | this.currentPageToken = |
| | | Number(this.currentPageToken) + Number(this.pageSize); |
| | | this.searchOrderDetail(); |
| | | } |
| | | handleFirst() { |
| | | this.currentPageToken = 0; |
| | | this.searchOrderDetail(); |
| | | } |
| | | |
| | | handleLast() { |
| | | this.currentPageToken = |
| | | this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0; |
| | | this.searchOrderDetail(); |
| | | } |
| | | |
| | | handlePageschange(event) { |
| | | console.log(event.detail); |
| | | this.pageSize = event.detail; |
| | | this.currentPageToken = 0; |
| | | this.searchOrderDetail(); |
| | | } |
| | | get previousButtonDisabled() { |
| | | return this.currentPageToken === 0; |
| | | } |
| | | |
| | | get nextButtonDisabled() { |
| | | return this.nextPageToken === undefined; |
| | | } |
| | | showMyToast(title, message, variant) { |
| | | console.log("show custom message"); |
| | | var iconName = ""; |
| | | var content = ""; |
| | | if (variant == "success") { |
| | | iconName = "utility:check"; |
| | | } else { |
| | | iconName = "utility:error"; |
| | | } |
| | | if (message != "") { |
| | | content = |
| | | "<h2><strong>" + title + "<strong/></h2><h5>" + message + "</h5>"; |
| | | } else { |
| | | content = "<h2><strong>" + title + "<strong/></h2>"; |
| | | } |
| | | this.template |
| | | .querySelector("c-common-toast") |
| | | .showToast(variant, content, iconName, 10000); |
| | | } |
| | | } |
| | |
| | | <apex:page |
| | | controller="DealerInquiryModifyStateController" |
| | | docType="html-5.0" |
| | | showHeader="false" |
| | | sidebar="false" |
| | | id="allPage" |
| | | action="{!init}" |
| | | lightningStyleSheets="true" |
| | | > |
| | | <head> |
| | | <title>经销商批量修改询价状态</title> |
| | |
| | | div.inline { |
| | | float: left; |
| | | } |
| | | |
| | | .clearBoth { |
| | | clear: both; |
| | | } |
| | | |
| | | div.reportBlock table.list { |
| | | width: auto; |
| | | } |
| | | |
| | | div#out_Div { |
| | | /* ここにヘッダを格納 */ |
| | | position: relative; |
| | | overflow: hidden; |
| | | float: left; |
| | | width: 50.3%; |
| | | width: 50% !important; |
| | | } |
| | | |
| | | div#out_Div_L { |
| | | position: relative; |
| | | overflow: hidden; |
| | | float: left; |
| | | width: 48%; |
| | | border-right: 2px solid #000; |
| | | width: 50% !important; |
| | | border-right: 2px solid #808383; |
| | | } |
| | | |
| | | div#in_Div { |
| | | /* tbodyが入っている。ここがスクロール対象*/ |
| | | position: relative; |
| | | overflow: auto; /*スクロールバー*/ |
| | | float: left; |
| | | width: 51.8%; |
| | | height: 373px; /* tbodyを表示する高さ、後でjsにて調整 */ |
| | | width: 50% !important; |
| | | height: 600px; |
| | | } |
| | | |
| | | div#in_Div_L { |
| | | position: relative; |
| | | overflow-x: auto; |
| | | overflow-y: hidden; |
| | | float: left; |
| | | width: 48%; |
| | | height: 373px; |
| | | border-right: 2px solid #000; |
| | | width: 50% !important; |
| | | height: 600px; |
| | | border-right: 2px solid #808383; |
| | | } |
| | | |
| | | body .pbBody table.list tr.headerRow td { |
| | |
| | | font-weight: normal; |
| | | padding: 0px 0px 0px 1px; |
| | | } |
| | | |
| | | body .pbBody table.list tr.headerRow td.header1 { |
| | | text-align: center; |
| | | font-weight: normal; |
| | | padding: 0px 0px 0px 0px; |
| | | } |
| | | |
| | | body .pbBody table.list tr.dataRow td { |
| | | box-sizing: border-box; |
| | | padding: 0px 0px 0px 1px; |
| | |
| | | vertical-align: middle; |
| | | word-break: break-all; |
| | | } |
| | | |
| | | body .pbBody table.list tr.dataRow td.dataCellBorder { |
| | | /* いらない、使っていない */ |
| | | padding: 0px 0px 0px 1px; |
| | |
| | | vertical-align: middle; |
| | | word-break: break-all; |
| | | } |
| | | |
| | | body .pbBody table.list tr.dataRow td.dataCellBorder1 { |
| | | padding: 0px 0px 0px 1px; |
| | | border-width: 0px 0px 1px 1px; |
| | | vertical-align: middle; |
| | | word-break: break-all; |
| | | } |
| | | |
| | | @-moz-document url-prefix() { |
| | | body .pbBody table.list tr.dataRow td.dataCellBorder1 { |
| | | padding: 0px 0px 0px 0px; |
| | |
| | | table.list td { |
| | | width: 100px; |
| | | } |
| | | |
| | | table.list td select { |
| | | width: 95%; |
| | | } |
| | | |
| | | table.list td input { |
| | | width: 95%; |
| | | } |
| | | |
| | | table.list td textarea { |
| | | height: 50px; |
| | | width: 90%; |
| | |
| | | table.list .col_OPD_USG400__c { |
| | | width: 118px; |
| | | } /*OPD对象:USG-400*/ |
| | | |
| | | table.list .col_Hospital_Name__c { |
| | | width: 139px; |
| | | } /*医院名*/ |
| | | table.list .col_Department_Name__c { |
| | | width: 60px; |
| | | } /*科室名称*/ |
| | | |
| | | table.list .col_Province_formula__c { |
| | | width: 78px; |
| | | } /*省(公式)*/ |
| | |
| | | width: 178px; |
| | | } /*活动计划(销售)*/ |
| | | /*table.list .col_Link1 {width:58px;} |
| | | table.list .col_Link2 {width:58px;} |
| | | table.list .col_Link3 {width:58px;} |
| | | table.list .col_Link4 {width:58px;} |
| | | table.list .col_Link5 {width:58px;} |
| | | table.list .col_Link6 {width:58px;} |
| | | table.list .col_Link7 {width:58px;} |
| | | table.list .col_Link8 {width:58px;}*/ |
| | | |
| | | table.list .col_Link2 {width:58px;} |
| | | table.list .col_Link3 {width:58px;} |
| | | table.list .col_Link4 {width:58px;} |
| | | table.list .col_Link5 {width:58px;} |
| | | table.list .col_Link6 {width:58px;} |
| | | table.list .col_Link7 {width:58px;} |
| | | table.list .col_Link8 {width:58px;}*/ |
| | | body .pbBody table.list tr.headerRow td.colViewing { |
| | | /* デフォルト値、最小化アイコンを表示 */ |
| | | background-image: url("{!URLFOR($Resource.IconResizeMinus_5)}"); |
| | |
| | | border-width: 0px; |
| | | } |
| | | /*.zxk{ |
| | | margin-bottom: 3px; |
| | | }*/ |
| | | margin-bottom: 3px; |
| | | }*/ |
| | | .buttonStyle { |
| | | font-size: 14px !important; |
| | | font-family: "sans-serif" !important; |
| | | font-weight: 500 !important; |
| | | width: 70px !important; |
| | | height: 32px !important; |
| | | border-radius: 4px !important; |
| | | opacity: 1 !important; |
| | | background: #090f84 !important; |
| | | color: #ffffff !important; |
| | | } |
| | | </style> |
| | | <script type="text/javascript"> |
| | | var heightAjustment = 120; |
| | |
| | | } |
| | | </script> |
| | | </head> |
| | | <apex:slds /> |
| | | <div id="spinner" class="slds-spinner_container" style="display: none"> |
| | | <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> |
| | | <apex:form id="allForm"> |
| | | <apex:actionFunction |
| | | name="saveAndSearch" |
| | | action="{!save}" |
| | | rerender="allPanel" |
| | | oncomplete="unblockUI();expandAll();" |
| | | oncomplete="closeSpinner();expandAll();" |
| | | > |
| | | <apex:param name="firstParam" assignTo="{!saveType}" value="" /> |
| | | </apex:actionFunction> |
| | |
| | | name="saveAndSort" |
| | | action="{!save}" |
| | | rerender="allPanel" |
| | | oncomplete="unblockUI();expandAll();" |
| | | oncomplete="closeSpinner();expandAll();" |
| | | > |
| | | <apex:param name="firstParam" assignTo="{!saveType}" value="" /> |
| | | <apex:param name="secondParam" assignTo="{!sortKey}" value="" /> |
| | |
| | | name="searchOpp" |
| | | action="{!chick}" |
| | | rerender="allPanel" |
| | | oncomplete="unblockUI();expandAll();" |
| | | oncomplete="closeSpinner();expandAll();" |
| | | /> |
| | | <apex:actionFunction |
| | | name="sortTable" |
| | | action="{!sortTable}" |
| | | rerender="allPanel" |
| | | oncomplete="unblockUI();expandAll();" |
| | | oncomplete="closeSpinner();expandAll();" |
| | | > |
| | | <apex:param name="firstParam" assignTo="{!sortKey}" value="" /> |
| | | </apex:actionFunction> |
| | | <apex:outputPanel id="allPanel"> |
| | | <div id="zxk" style="margin-bottom: -15px"> |
| | | <apex:pageBlock id="searchBlock" mode="maindetail"> |
| | | <!-- tabStyle="Report"红色 mode="maindetail" 消失 mode="edit" 变大 --> |
| | | <!-- <apex:pageMessages ></apex:pageMessages> --> |
| | | <!-- <table style="border-bottom-width: 0px; font-size:12px;"> |
| | | <tr> |
| | | <td width="150px"> |
| | | <apex:commandButton action="{!save}" value="保存" rerender="allPanel" onclick="blockme();" oncomplete="unblockUI();expandAll();" style="height:30px;width:50px;"/> |
| | | <apex:commandButton value="检索" onclick="searchOppJs_Account();return false;" style="height:30px;width:70px;"/> |
| | | </td> |
| | | <td width="1000px"> |
| | | <apex:pageMessages /> |
| | | </td> |
| | | </tr> |
| | | </table> --> |
| | | <table style="border-bottom-width: 0px; font-size: 12px"> |
| | | <table |
| | | style="border-bottom-width: 0px; font-size: 14px; color: #696969" |
| | | > |
| | | <tr> |
| | | <!-- <td width="150px">分类 <apex:selectList value="{!accType}" size="1" style="width:80px" id="accType"><apex:selectOptions value="{!accTypeOpts}" id="accTypeOptsId"/></apex:selectList></td> --> |
| | | <td width="250px"> |
| | | 经销商医院 <apex:inputText |
| | | value="{!accSearch}" |
| | | style="width: 170px" |
| | | /> |
| | | <td width="283px"> |
| | | <div style="color: #696969"> |
| | | 经销商医院 |
| | | <apex:inputText |
| | | styleClass="slds-input" |
| | | value="{!accSearch}" |
| | | style="width: 170px" |
| | | /> |
| | | </div> |
| | | </td> |
| | | <td></td> |
| | | <td width="250px"> |
| | | 销售担当 <apex:inputText |
| | | value="{!aooSearch}" |
| | | style="width: 150px" |
| | | /> |
| | | <div style="color: #696969"> |
| | | 销售担当 |
| | | <apex:inputText |
| | | styleClass="slds-input" |
| | | value="{!aooSearch}" |
| | | style="width: 150px" |
| | | /> |
| | | </div> |
| | | </td> |
| | | <td width="230px"> |
| | | 显示 |
| | | <apex:selectList |
| | | value="{!limits}" |
| | | size="1" |
| | | onchange="searchOppJs_Account();return false;" |
| | | > |
| | | <apex:selectOptions value="{!limitOpts}" /></apex:selectList |
| | | > 条数据 |
| | | <div style="color: #696969"> |
| | | 显示 |
| | | <apex:selectList |
| | | styleClass="slds-input slds-combobox__input" |
| | | style="width: 100px" |
| | | value="{!limits}" |
| | | size="1" |
| | | onchange="searchOppJs_Account();return false;" |
| | | > |
| | | <apex:selectOptions value="{!limitOpts}" /> |
| | | </apex:selectList> |
| | | 条数据 |
| | | </div> |
| | | </td> |
| | | <!-- <td width="10px"></td> --> |
| | | <td width="70px"> |
| | | <td> |
| | | <a |
| | | href="#" |
| | | onclick="expandAll();return false;" |
| | | style="text-decoration: underline" |
| | | style="text-decoration: underline; color: #696969" |
| | | >全部展开</a |
| | | > |
| | | </td> |
| | | <!-- text-decoration: underline; --> |
| | | </tr> |
| | | </table> |
| | | <table style="border-bottom-width: 0px; font-size: 12px"> |
| | | <p style="height: 10px"></p> |
| | | <table |
| | | style=" |
| | | border-bottom-width: 0px; |
| | | font-size: 12px; |
| | | font-size: 14px; |
| | | color: #696969; |
| | | " |
| | | > |
| | | <tr> |
| | | <td width="200px"> |
| | | <font>数 据 字 段 </font> |
| | | <apex:selectList |
| | | value="{!numtext1}" |
| | | size="1" |
| | | style="width: 110px" |
| | | ><apex:selectOptions value="{!textOpts}" |
| | | /></apex:selectList> |
| | | <td width="220px"> |
| | | <div style="color: #696969"> |
| | | <font>数 据 字 段</font |
| | | > |
| | | <apex:selectList |
| | | styleClass="slds-input slds-combobox__input" |
| | | value="{!numtext1}" |
| | | size="1" |
| | | style="width: 110px" |
| | | > |
| | | <apex:selectOptions value="{!textOpts}" /> |
| | | </apex:selectList> |
| | | </div> |
| | | </td> |
| | | <td width="130px"> |
| | | <apex:selectList |
| | | styleClass="slds-input slds-combobox__input" |
| | | value="{!numtext2}" |
| | | size="1" |
| | | style="width: 110px" |
| | | ><apex:selectOptions value="{!equalOpts}" |
| | | /></apex:selectList> |
| | | > |
| | | <apex:selectOptions value="{!equalOpts}" /> |
| | | </apex:selectList> |
| | | </td> |
| | | <td width="200px"> |
| | | <apex:inputText style="width: 150px" value="{!numtext}" /> |
| | | <td width="183px"> |
| | | <apex:inputText |
| | | styleClass="slds-input" |
| | | style="width: 150px" |
| | | value="{!numtext}" |
| | | /> |
| | | </td> |
| | | <td width="150px"> |
| | | <td width="188px"> |
| | | <!-- slds-button slds-button_brand --> |
| | | <apex:commandButton |
| | | styleClass="buttonStyle" |
| | | value="检索" |
| | | onclick="searchOppJs_Account();return false;" |
| | | style="height: 30px; width: 50px" |
| | | style="height: 30px; width: 70px" |
| | | /> |
| | | <apex:commandButton |
| | | styleClass="buttonStyle" |
| | | action="{!save}" |
| | | value="保存" |
| | | rerender="allPanel" |
| | | onclick="blockme();" |
| | | oncomplete="unblockUI();expandAll();" |
| | | style="height: 30px; width: 50px" |
| | | onclick="showSpinner();" |
| | | oncomplete="closeSpinner();expandAll();" |
| | | style="height: 30px; width: 70px" |
| | | /> |
| | | </td> |
| | | <td width="500px"> |
| | | <apex:pageMessages /> |
| | | <td> |
| | | <!-- <apex:pageMessages /> --> |
| | | <!-- add by Link 2023-6-2 --> |
| | | <apex:outputPanel |
| | | rendered="{! remindMsg != '' && remindMsg != null}" |
| | | > |
| | | <div |
| | | style=" |
| | | border: 1px solid #d4d4d4; |
| | | height: 32px; |
| | | border-radius: 5px; |
| | | color: #ff6a00; |
| | | font-size: 18px; |
| | | " |
| | | > |
| | | <span |
| | | class="slds-icon_container slds-icon-custom-custom53 slds-icon-text-default" |
| | | > |
| | | <svg aria-hidden="true" class="slds-icon"> |
| | | <use |
| | | xmlns:xlink="http://www.w3.org/1999/xlink" |
| | | xlink:href="/apexpages/slds/latest/assets/icons/custom-sprite/svg/symbols.svg#custom53" |
| | | ></use> |
| | | </svg> |
| | | <span class="slds-assistive-text">Custom 53</span> |
| | | </span> |
| | | <strong style="padding-top: 2px"> {!remindMsg}</strong> |
| | | </div> |
| | | </apex:outputPanel> |
| | | </td> |
| | | </tr> |
| | | <!-- <tr> |
| | | <td width="110px"> |
| | | <font> 日 期 </font> |
| | | <apex:selectList value="{!timetext1}" size="1" style="width:110px"><apex:selectOptions value="{!timeOpts}"/></apex:selectList> |
| | | </td> |
| | | <td> |
| | | 从<apex:inputField style="width:150px" value="{!tmpAO.MaxActivityDate__c}"/> --> |
| | | <!-- <apex:selectList value="{!timetext2}" size="1" style="width:110px"><apex:selectOptions value="{!timeequalOpts}"/></apex:selectList> --> |
| | | <!-- </td> |
| | | <td> |
| | | 到<apex:inputField style="width:150px" value="{!tmpBO.MaxActivityDate__c}"/> |
| | | </td> |
| | | </tr> --> |
| | | </table> |
| | | </apex:pageBlock> |
| | | </div> |
| | | <apex:pageBlock id="oppBlock"> |
| | | <!-- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;"> --> |
| | | <apex:pageBlock id="oppBlock" mode="maindetail"> |
| | | <!-- <apex:pageblocksection columns="1" id="oppSection"> --> |
| | | <apex:outputPanel> |
| | | <apex:inputHidden id="oppCount" value="{!oppCount}" /> |
| | |
| | | style=" |
| | | border-bottom-width: 0px; |
| | | width: 1100px; |
| | | font-size: 11px; |
| | | font-size: 14px !important; |
| | | border-spacing: 0; |
| | | " |
| | | border="" |
| | |
| | | <a |
| | | href="#" |
| | | onclick="sortTableJs_Account1('{!cnt + titleLeft.size}');return false;" |
| | | style="text-decoration: underline" |
| | | style=" |
| | | text-decoration: underline; |
| | | color: black; |
| | | font-size: 14px !important; |
| | | font-weight: bold; |
| | | " |
| | | ><apex:outputText value="{!t}" /></a |
| | | >{!sortOrder[cnt + titleLeft.size]} |
| | | </td> |
| | |
| | | style=" |
| | | border-bottom-width: 0px; |
| | | width: 2000px; |
| | | font-size: 11px; |
| | | font-size: 14px !important; |
| | | border-spacing: 0; |
| | | " |
| | | border="" |
| | |
| | | <a |
| | | href="#" |
| | | onclick="sortTableJs_Account1('{!cnt}');return false;" |
| | | style="text-decoration: underline" |
| | | style=" |
| | | text-decoration: underline; |
| | | color: black; |
| | | font-size: 14px !important; |
| | | font-weight: bold; |
| | | " |
| | | ><apex:outputText value="{!t}" /></a |
| | | >{!sortOrder[cnt]} |
| | | </td> |
| | |
| | | style=" |
| | | border-bottom-width: 0px; |
| | | width: 1100px; |
| | | font-size: 11px; |
| | | font-size: 13px; |
| | | border-spacing: 0; |
| | | " |
| | | border="" |
| | |
| | | <apex:repeat value="{!oppRecords}" var="or" id="oppTable"> |
| | | <tr |
| | | class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}" |
| | | style="height: 35px" |
| | | onmouseover="if (window.hiOn){hiOn(this);} " |
| | | onmouseout="if (window.hiOff){hiOff(this);} " |
| | | onblur="if (window.hiOff){hiOff(this);}" |
| | |
| | | <!-- <apex:outputLink rendered="{!c[0]=='Name'}" value="/{!or.opp.Id}" target="LINK_{!or.opp.Id}"><apex:outputField rendered="{!c[0]=='Name'}" value="{!or.opp[c[0]]}" /></apex:outputLink> --> |
| | | <!-- vivek end --> |
| | | <!-- <apex:outputField id="q1111111111" rendered="{!(c.size==1 && columnRightRW[c[0]]=='r' && or.opp.Id <> null && c[0] <> 'Name' && (c[0] <> 'Opp_Changed_Field__c' ||(c[0] == 'Opp_Changed_Field__c' && |
| | | or.opp.Opp_Changed_Field__c != '询价阶段发生了变化' &&or.opp.Opp_Changed_Field__c != '预测签约日发生了变化' &&or.opp.Opp_Changed_Field__c != '医院合同金额发生了变化' && or.opp.Opp_Changed_Field__c != '订货金额发生了变化')))}" value="{!or.opp[c[0]]}" /> && or.opp.Oly_Inquiry_Status1__c <> null AgcOpp --> |
| | | or.opp.Opp_Changed_Field__c != '询价阶段发生了变化' &&or.opp.Opp_Changed_Field__c != '预测签约日发生了变化' &&or.opp.Opp_Changed_Field__c != '医院合同金额发生了变化' && or.opp.Opp_Changed_Field__c != '订货金额发生了变化')))}" value="{!or.opp[c[0]]}" /> && or.opp.Oly_Inquiry_Status1__c <> null AgcOpp --> |
| | | <apex:outputField |
| | | rendered="{!c[0] == 'Change_To_Opportunity_T__c' }" |
| | | value="{!or.opp[c[0]]}" |
| | |
| | | value="{!or.opp[c[0]]}" |
| | | /> |
| | | <!-- <apex:outputField id="q1111111111" rendered="{!( columnRightRW[c[0]]=='r' && c[0] <> 'Name' && (c[0] <> 'StageName__c' ||(c[0] == 'StageName__c' && |
| | | or.opp.Oly_Inquiry_Stage__c != '询价阶段发生了变化' &&or.opp.Oly_Inquiry_Stage__c != '预测签约日发生了变化' &&or.opp.Oly_Inquiry_Stage__c != '医院合同金额发生了变化' && or.opp.Oly_Inquiry_Stage__c != '订货金额发生了变化')))}" value="{!or.opp[c[0]]}" /> --> |
| | | or.opp.Oly_Inquiry_Stage__c != '询价阶段发生了变化' &&or.opp.Oly_Inquiry_Stage__c != '预测签约日发生了变化' &&or.opp.Oly_Inquiry_Stage__c != '医院合同金额发生了变化' && or.opp.Oly_Inquiry_Stage__c != '订货金额发生了变化')))}" value="{!or.opp[c[0]]}" /> --> |
| | | <!-- <div style ="color:red"> --> |
| | | <!-- <apex:outputField id="q2222222" rendered="{!(c.size==1 && columnRightRW[c[0]]=='r' && or.opp.Id <> null && c[0] <> 'Name' && c[0] == 'Opp_Changed_Field__c' && ( |
| | | or.opp.Opp_Changed_Field__c == '询价阶段发生了变化' || or.opp.Opp_Changed_Field__c == '预测签约日发生了变化' || or.opp.Opp_Changed_Field__c == '医院合同金额发生了变化' || or.opp.Opp_Changed_Field__c == '订货金额发生了变化'))}" value="{!or.opp[c[0]]}" /> --> |
| | | or.opp.Opp_Changed_Field__c == '询价阶段发生了变化' || or.opp.Opp_Changed_Field__c == '预测签约日发生了变化' || or.opp.Opp_Changed_Field__c == '医院合同金额发生了变化' || or.opp.Opp_Changed_Field__c == '订货金额发生了变化'))}" value="{!or.opp[c[0]]}" /> --> |
| | | <!-- <apex:outputField id="q2222222" rendered="{!(c.size==1 && columnRightRW[c[0]]=='r' && c[0] <> 'Name' && c[0] == 'StageName__c' && ( |
| | | or.opp.Oly_Inquiry_Stage__c == '询价阶段发生了变化' || or.opp.Oly_Inquiry_Stage__c == '预测签约日发生了变化' || or.opp.Oly_Inquiry_Stage__c == '医院合同金额发生了变化' || or.opp.Oly_Inquiry_Stage__c == '订货金额发生了变化'))}" value="{!or.opp[c[0]]}" /> |
| | | |
| | | </div> --> |
| | | |
| | | </div> --> |
| | | <!-- <apex:inputField rendered="{!(c.size==1 && columnRightRW[c[0]]=='w' && or.opp.Id <> null && c[0] <> 'Name')}" value="{!or.opp[c[0]]}" onchange="setChangeFlgRight('{!or.lineNo}')"/> |
| | | <apex:outputPanel rendered="{!(c.size==1 && columnRightRW[c[0]]=='wm' && c[0] <> 'Name' && or.opp.Id <> null)}" layout="none"> |
| | | <div class="requiredInput_r"> |
| | | <div class="requiredBlock_r"></div> |
| | | <apex:inputField value="{!or.Opp[c[0]]}" onchange="setChangeFlg('{!or.lineNo}')"/> |
| | | </div> |
| | | <apex:outputPanel rendered="{!(c.size==1 && columnRightRW[c[0]]=='wm' && c[0] <> 'Name' && or.opp.Id <> null)}" layout="none"> |
| | | <div class="requiredInput_r"> |
| | | <div class="requiredBlock_r"></div> |
| | | <apex:inputField value="{!or.Opp[c[0]]}" onchange="setChangeFlg('{!or.lineNo}')"/> |
| | | </div> |
| | | </apex:outputPanel> --> |
| | | <apex:outputField |
| | | rendered="{!c[0] == 'Strategic_department_Class_Name__c'}" |
| | |
| | | /> |
| | | |
| | | <apex:inputField |
| | | styleClass="slds-form-element" |
| | | rendered="{!( columnRightRW[c[0]]=='w' && c[0] <> 'Strategic_department_Class_Name__c' && c[0] <> 'Change_To_Opportunity_T__c' && c[0] <> 'Name')}" |
| | | value="{!or.opp[c[0]]}" |
| | | onchange="setChangeFlgRight('{!or.lineNo}')" |
| | |
| | | <div class="requiredInput_r"> |
| | | <div class="requiredBlock_r"></div> |
| | | <apex:inputField |
| | | styleClass="slds-form-element" |
| | | value="{!or.Opp[c[0]]}" |
| | | onchange="setChangeFlg('{!or.lineNo}')" |
| | | /> |
| | |
| | | style=" |
| | | border-bottom-width: 0px; |
| | | width: 2000px; |
| | | font-size: 11px; |
| | | font-size: 13px; |
| | | border-spacing: 0; |
| | | " |
| | | border="" |
| | |
| | | <apex:repeat value="{!oppRecords}" var="or" id="oppTable_L"> |
| | | <tr |
| | | class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}" |
| | | style="height: 35px" |
| | | onmouseover="if (window.hiOn){hiOn(this);} " |
| | | onmouseout="if (window.hiOff){hiOff(this);} " |
| | | onblur="if (window.hiOff){hiOff(this);}" |
| | |
| | | <!-- OCSM询价 --> |
| | | <!-- <apex:outputLink target="_blank" rendered="{!c[0]=='Change_To_Opportunity__c'}" value="/{!or.AgcOpp[c[0]]}" > |
| | | <apex:outputText value="{!or.AgcOpp.Agency__r.Name }" /> |
| | | </apex:outputLink> --> |
| | | </apex:outputLink> --> |
| | | <!-- 必填字段 --> |
| | | <!-- <apex:outputField rendered="{!(c[0]<>'Name' && c[0]<>'Agency_Hospital__c' && c[0]<>'Product_Category1__c' && c[0]<>'Product_Category2__c' && c[0]<>'Product_Category3__c' && c[0]<>'Agency_Person__c' && c[0]<>'Agency__c' && c[0]<>'Change_To_Opportunity__c' && columnLeftRW[c[0]]=='wm')}" value="{!or.AgcOpp[c[0]] }"/> --> |
| | | <apex:inputField |
| | | styleClass="slds-form-element" |
| | | rendered="{!(c[0]<>'Name' && c[0]<>'Product_Category1__c' && c[0]<>'Product_Category2__c' && c[0]<>'Product_Category3__c' && c[0]<>'Agency_Person__c' && c[0]<>'Agency__c' && c[0]<>'Change_To_Opportunity__c' && columnLeftRW[c[0]]=='wm')}" |
| | | value="{!or.AgcOpp[c[0]] }" |
| | | onchange="setChangeFlg('{!or.lineNo}')" |
| | |
| | | <!-- <apex:outputField rendered="{!(c[0]<>'Name' && columnLeftRW[c[0]]<>'w')}" value="{!or.AgcOpp[c[0]] }"/> --> |
| | | <!-- 可编辑的字段 --> |
| | | <apex:inputField |
| | | styleClass="slds-form-element" |
| | | value="{!or.AgcOpp[c[0]]}" |
| | | rendered="{!columnLeftRW[c[0]]=='w'}" |
| | | onchange="setChangeFlg('{!or.lineNo}')" |
| | |
| | | <!-- /in_Div --> |
| | | </apex:outputPanel> |
| | | </apex:pageBlock> |
| | | <!-- </div> --> |
| | | <script type="text/javascript"> |
| | | j$(function () { |
| | | var tableWidth = 0; |
| | |
| | | |
| | | // list の headerRow の tdに toggleWidth() を追加 |
| | | bindTdToggleWidth(); |
| | | // j$("input").attr("styleClass","slds-input"); |
| | | }); |
| | | var elements = document.getElementsByTagName("select"); |
| | | for (i = 0; i < elements.length; i++) { |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <ApexPage xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>35.0</apiVersion> |
| | | <apiVersion>39.0</apiVersion> |
| | | <availableInTouch>true</availableInTouch> |
| | | <confirmationTokenRequired>false</confirmationTokenRequired> |
| | | <label>DealerInquiryModifyState</label> |
| | |
| | | update consumableOrderlist; |
| | | } |
| | | } |
| | | |
| | | //Back up by DTT - Li Jun 2023-06-14 Start for reduce soql times |
| | | // 2018年8月9日 HWAG-B3D9UV 获取所有的record ID start by 张玉山 |
| | | List<RecordType> allrtList = [ |
| | | SELECT Id, DeveloperName |
| | | FROM RecordType |
| | | WHERE SobjectType = 'Consumable_orderdetails__c' |
| | | ]; |
| | | //List<RecordType> allrtList = [select Id,DeveloperName from RecordType where SobjectType = 'Consumable_orderdetails__c']; |
| | | // 2018年8月9日 HWAG-B3D9UV 获取所有的record ID end by 张玉山 |
| | | //Back up by DTT - Li Jun 2023-06-14 Start |
| | | //到货和返品时,生成或修改消费品订货明细 |
| | | Set<String> arrivedSet = new Set<String>(); |
| | | Set<String> returnSet = new Set<String>(); |
| | |
| | | ar.get('Asset_Model_No__c'); |
| | | keyCount.put(key, Integer.valueOf(ar.get('recordCount'))); |
| | | } |
| | | //Back up by DTT - Li Jun 2023-06-14 Start |
| | | // 2018年8月9日 HWAG-B3D9UV 替代下面SQL select start by 张玉山 |
| | | List<RecordType> rtList = new List<RecordType>(); |
| | | for (RecordType rtl : allrtList) { |
| | | if ('Detail1_Arrival'.equals(rtl.DeveloperName)) { |
| | | rtList.add(rtl); |
| | | } |
| | | } |
| | | // List<RecordType> rtList = new List<RecordType>(); |
| | | // for(RecordType rtl : allrtList){ |
| | | // if('Detail1_Arrival'.equals(rtl.DeveloperName)){ |
| | | // rtList.add(rtl); |
| | | // } |
| | | // } |
| | | // 2018年8月9日 HWAG-B3D9UV 替代下面SQL select end by 张玉山 |
| | | //Back up by DTT - Li Jun 2023-06-14 End |
| | | |
| | | /* 2018年8月9日 HWAG-B3D9UV 原获取 recordtype start by 张玉山 |
| | | List<RecordType> rtList = [select Id from RecordType where DeveloperName = 'Detail1_Arrival' and SobjectType = 'Consumable_orderdetails__c']; |
| | | 2018年8月9日 HWAG-B3D9UV 原获取 recordtype end by 张玉山 */ |
| | | Id recordTypeId = null; |
| | | if (rtList.size() > 0) |
| | | recordTypeId = rtList[0].Id; |
| | | |
| | | //Back up by DTT - Li Jun 2023-06-14 Start |
| | | // Id recordTypeId = null; |
| | | // if (rtList.size() > 0) recordTypeId = rtList[0].Id; |
| | | //Back up by DTT - Li Jun 2023-06-14 End |
| | | Id recordtypeId = Schema.SObjectType.Consumable_Orderdetails__c.getRecordTypeInfosByDeveloperName() |
| | | .get('Detail1_Arrival') |
| | | .getRecordTypeId(); |
| | | results = [ |
| | | SELECT Consumable_order__c, count(Id) noCount |
| | | FROM Consumable_orderdetails__c |
| | |
| | | ar.get('Asset_Model_No__c'); |
| | | keyCount.put(key, Integer.valueOf(ar.get('recordCount'))); |
| | | } |
| | | |
| | | //Back up by DTT - Li Jun 2023-06-14 Start for reduce soql times |
| | | // 2018年8月9日 HWAG-B3D9UV 替代下面SQL select start by 张玉山 |
| | | List<RecordType> rtList = new List<RecordType>(); |
| | | for (RecordType rtl : allrtList) { |
| | | if ('Detail1_ReturnGoods'.equals(rtl.DeveloperName)) { |
| | | rtList.add(rtl); |
| | | } |
| | | } |
| | | // List<RecordType> rtList = new List<RecordType>(); |
| | | // for(RecordType rtl : allrtList){ |
| | | // if('Detail1_ReturnGoods'.equals(rtl.DeveloperName)){ |
| | | // rtList.add(rtl); |
| | | // } |
| | | // } |
| | | // 2018年8月9日 HWAG-B3D9UV 替代下面SQL select end by 张玉山 |
| | | |
| | | //Back up by DTT - Li Jun 2023-06-14 End |
| | | /* 2018年8月9日 HWAG-B3D9UV 原获取 recordtype start by 张玉山 |
| | | List<RecordType> rtList = [select Id from RecordType where DeveloperName = 'Detail1_ReturnGoods' and SobjectType = 'Consumable_orderdetails__c']; |
| | | 2018年8月9日 HWAG-B3D9UV 原获取 recordtype end by 张玉山 */ |
| | | |
| | | Id recordTypeId = null; |
| | | if (rtList.size() > 0) |
| | | recordTypeId = rtList[0].Id; |
| | | Id recordTypeId = Schema.SObjectType.Consumable_Orderdetails__c.getRecordTypeInfosByDeveloperName() |
| | | .get('Detail1_ReturnGoods') |
| | | .getRecordTypeId(); |
| | | //if (rtList.size() > 0) recordTypeId = rtList[0].Id; |
| | | |
| | | results = [ |
| | | SELECT Consumable_order__c, count(Id) noCount |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <ApexTrigger xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>40.0</apiVersion> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexTrigger> |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> |
| | | <Package xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <types> |
| | | <members>LexUpAccountProLimit</members> |
| | | <name>ApexClass</name> |
| | | </types> |
| | | <members>LexConsumable</members> |
| | | <name>LightningComponentBundle</name> |
| | | </types> |
| | | <types> |
| | | <members>lexdatatable</members> |
| | | <name>StaticResource</name> |
| | | </types> |
| | | <version>52.0</version> |
| | | </Package> |