buli
2023-06-05 125e6a5936a48d318603617d0df8ffcc2d129372
LEX CommunityUpdateCmp
6个文件已添加
5个文件已修改
25056 ■■■■■ 已修改文件
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp 1979 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js 617 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js 5173 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/ArriveGoodsController.cls 9828 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/ArriveGoodsControllerTest.cls 5935 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexArriveGoodsController.cls 356 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexArriveGoodsController.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.css 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html 380 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js 773 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js-meta.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp
@@ -1,720 +1,1289 @@
<aura:component controller="RetrospectiveWeeklyReportController"
    implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes"
    access="global">
    <ltng:require styles="{!$Resource.multilineToastCSS}" /> 
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    <aura:handler event="c:strike_evt" action="{!c.createAopp}" name="strike_evt_addNewRecord" />
    <aura:attribute name="data" type="Agency_Report__c" default="{sobjectType:'Agency_Report__c'}" />
    <aura:attribute name="oppdata" type="Agency_Opportunity__c" default="{sobjectType:'Agency_Opportunity__c'}" />
    <aura:attribute name="acondata" type="Agency_Contact__c" default="{sobjectType:'Ag
    ency_Contact__c'}" />
    <aura:attribute name="successMessage" type="String" />
    <aura:attribute name="etEng" type="String" />
    <aura:attribute name="errorMessage" type="String" />
    <aura:attribute name="Close_Forecasted_Date__c_o" type="Date" />
    <aura:attribute name="Amount__c_o" type="String" />
    <aura:attribute name="OCMSale_Price__c_o" type="String" />
    <aura:attribute name="StageName__c_o" type="String" />
    <aura:attribute name="fieldsmap" type="Map" />
    <aura:attribute name="AgencyReportMap" type="Boolean" default="false" />
    <!-- 周报分类 -->
<aura:component
  controller="RetrospectiveWeeklyReportController"
  implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes,lightning:availableForFlowScreens"
  access="global"
>
  <ltng:require styles="{!$Resource.multilineToastCSS}" /> 
  <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
  <aura:handler
    event="c:strike_evt"
    action="{!c.createAopp}"
    name="strike_evt_addNewRecord"
  />
  <aura:attribute
    name="data"
    type="Agency_Report__c"
    default="{sobjectType:'Agency_Report__c'}"
  />
  <aura:attribute
    name="oppdata"
    type="Agency_Opportunity__c"
    default="{sobjectType:'Agency_Opportunity__c'}"
  />
  <aura:attribute
    name="acondata"
    type="Agency_Contact__c"
    default="{sobjectType:'Ag
    ency_Contact__c'}"
  />
  <aura:attribute name="successMessage" type="String" />
  <aura:attribute name="etEng" type="String" />
  <aura:attribute name="errorMessage" type="String" />
  <aura:attribute name="Close_Forecasted_Date__c_o" type="Date" />
  <aura:attribute name="Amount__c_o" type="String" />
  <aura:attribute name="OCMSale_Price__c_o" type="String" />
  <aura:attribute name="StageName__c_o" type="String" />
  <aura:attribute name="fieldsmap" type="Map" />
  <aura:attribute name="AgencyReportMap" type="Boolean" default="false" />
  <!-- 日报分类 -->
    <aura:attribute name="alldata" type="List" />
    <aura:attribute name="allselectlist" type="Map" />
    <aura:attribute name="doclist" type="List" />
    <aura:attribute name="docmap" type="Map" />
    <aura:attribute name="login" 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="report_date_list" type="Map" />
    <aura:attribute name="selected_date" type="String" />
    <aura:attribute name="selected_agency_person" type="String" />
    <aura:attribute name="agency_report_header" type="String" />
    <aura:attribute name="agency_report_header_id" type="String" />
    <aura:attribute name="result" type="String" default="" />
    <!-- //医院 点选需要    -->
    <aura:attribute name="hospital" type="string" default="" />
    <aura:attribute name="hospitalId" type="string" default="" />
    <aura:attribute name="hospitalLinkId" type="string" default="" />
    <aura:handler name="change" value="{!v.hospital}" action="{!c.hosChange}" />
    <aura:attribute name="hospitalList" type="Map" />
    <!-- 使用产品1(产品型号) -->
    <aura:attribute name="UseProduct1" type="string" default="" />
    <aura:handler name="change" value="{!v.UseProduct1}" action="{!c.UseProduct1Change}" />
    <aura:attribute name="UseProduct1List" type="Map" />
    <aura:attribute name="UseProduct1Id" type="string" default="" />
    <!-- 使用产品2 -->
    <aura:attribute name="UseProduct2" type="string" default="" />
    <aura:handler name="change" value="{!v.UseProduct2}" action="{!c.UseProduct2Change}" />
    <aura:attribute name="UseProduct2List" type="Map" />
    <aura:attribute name="UseProduct2Id" type="string" default="" />
    <!-- 使用产品3 -->
    <aura:attribute name="UseProduct3" type="string" default="" />
    <aura:handler name="change" value="{!v.UseProduct3}" action="{!c.UseProduct3Change}" />
    <aura:attribute name="UseProduct3List" type="Map" />
    <aura:attribute name="UseProduct3Id" type="string" default="" />
  <aura:attribute name="alldata" type="List" />
  <aura:attribute name="setdoctorlisthos" type="Boolean" default="false" />
  <aura:attribute name="allselectlist" type="Map" />
  <aura:attribute name="doclist" type="List" />
  <aura:attribute name="docmap" type="Map" />
  <aura:attribute name="login" 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="report_date_list" type="Map" />
  <aura:attribute name="selected_date" type="String" />
  <aura:attribute name="selected_agency_person" type="String" />
  <aura:attribute name="agency_report_header" type="String" />
  <aura:attribute name="agency_report_header_id" type="String" />
  <aura:attribute name="result" type="String" default="" />
  <!-- //医院 点选需要    -->
  <aura:attribute name="hospital" type="string" default="" />
  <aura:attribute name="hospitalId" type="string" default="" />
  <aura:attribute name="hospitals" type="string" default="" />
  <aura:attribute name="hospitalLinkId" type="string" default="" />
  <aura:handler name="change" value="{!v.hospital}" action="{!c.hosChange}" />
  <aura:attribute name="hospitalList" type="Map" />
  <!-- 使用产品1(产品型号) -->
  <aura:attribute name="UseProduct1" type="string" default="" />
  <aura:attribute name="UseProduct1s" type="string" default="" />
  <aura:handler
    name="change"
    value="{!v.UseProduct1}"
    action="{!c.UseProduct1Change}"
  />
  <aura:attribute name="UseProduct1List" type="Map" />
  <aura:attribute name="UseProduct1Id" type="string" default="" />
  <!-- 使用产品2 -->
  <aura:attribute name="UseProduct2" type="string" default="" />
  <aura:attribute name="UseProduct2s" type="string" default="" />
  <aura:handler
    name="change"
    value="{!v.UseProduct2}"
    action="{!c.UseProduct2Change}"
  />
  <aura:attribute name="UseProduct2List" type="Map" />
  <aura:attribute name="UseProduct2Id" type="string" default="" />
  <!-- 使用产品3 -->
  <aura:attribute name="UseProduct3" type="string" default="" />
  <aura:attribute name="UseProduct3s" type="string" default="" />
  <aura:handler
    name="change"
    value="{!v.UseProduct3}"
    action="{!c.UseProduct3Change}"
  />
  <aura:attribute name="UseProduct3List" type="Map" />
  <aura:attribute name="UseProduct3Id" type="string" default="" />
  <!--SWAG-CF58C3 fy start -->
  <aura:attribute name="AWStoken" type="String" />
  <aura:attribute name="AWSsearch" type="String" />
  <aura:attribute name="AWSinsert" type="String" />
  <aura:attribute name="AWStransactionURL" type="String" />
  <aura:attribute name="AWSDoctor2Map" type="String" />
  <aura:attribute name="awsurl" type="Map" />
  <aura:attribute name="contactawsurl" type="Map" />
  <aura:attribute name="allselectlistAgencyPerson" type="Map" />
  <!--SWAG-CF58C3 fy end -->
  <aura:attribute name="doctor_list" type="Map" />
  <!-- <aura:attribute name="doctor_title" type="String" /> -->
  <aura:attribute name="opportunity_list" type="Map" />
  <aura:attribute name="edit_copy_select_report_id" type="String" />
  <aura:attribute name="create_agency_report_id" type="String" />
  <aura:attribute name="reports" type="List" />
  <aura:attribute name="reports_now" type="List" />
  <aura:attribute name="reports_now_count" type="Integer" />
  <aura:attribute name="mode" type="String" />
  <aura:attribute name="select_report_data" type="Map" />
  <aura:attribute name="select_report_data_radio" type="Map" />
  <aura:attribute name="default_select_doctor_id" type="String" />
  <aura:attribute name="default_select_doctor_id2" type="String" />
  <aura:attribute name="default_select_opportunity_id" type="String" />
  <aura:attribute name="report_count" type="Integer" />
  <aura:attribute name="dialog_type" type="String" />
  <aura:attribute name="truthy" type="Boolean" default="false" />
  <aura:attribute name="list_message" type="String" default="搜索" />
  <aura:attribute name="confirm_status" type="Integer" default="0" />
  <aura:attribute name="modal_confirm_title" type="String" />
  <aura:attribute name="modal_confirm_text" type="String" />
  <!-- <aura:attribute name="new_falg" type="String" /> -->
  <!-- fy -->
  <aura:attribute name="UserProType" type="String" />
  <!-- 科室 -->
  <aura:attribute name="opportunity_cfilter" type="String" />
  <aura:attribute
    name="update_select_report_data_id"
    type="String"
    default=""
  />
  <!-- 批量添加日报 start-->
  <aura:attribute name="reports_date" type="List" />
  <aura:attribute
    name="TableContent"
    type="String"
    description=" Show the Result class"
  />
  <aura:attribute
    name="TableContent2"
    type="String"
    description=" Show the Result class"
  />
  <aura:attribute
    name="TargetFileName"
    type="String"
    description="Name of the file"
  />
  <aura:attribute name="tableheaders" type="Object[]" />
  <aura:attribute name="fileContentData" type="String" />
  <aura:attribute name="filename" type="String" />
  <aura:attribute name="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-->
  <!-- Imports -->
  <!-- <aura:import library="lightningcomponentdemo:mockdataFaker" property="mockdataLibrary"/> -->
  <!-- attributes -->
  <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" />
    <aura:attribute name="doctor_list" type="Map" />
    <!-- <aura:attribute name="doctor_title" type="String" /> -->
    <aura:attribute name="opportunity_list" type="Map" />
    <aura:attribute name="edit_copy_select_report_id" type="String" />
    <aura:attribute name="create_agency_report_id" type="String" />
    <aura:attribute name="reports" type="List" />
    <aura:attribute name="reports_now" type="List" />
    <aura:attribute name="reports_now_count" type="Integer" />
    <aura:attribute name="mode" type="String" />
    <aura:attribute name="select_report_data" type="Map" />
    <aura:attribute name="select_report_data_radio" type="Map" />
    <aura:attribute name="default_select_doctor_id" type="String" />
    <aura:attribute name="default_select_opportunity_id" type="String" />
    <aura:attribute name="report_count" type="Integer" />
    <aura:attribute name="dialog_type" type="String" />
    <aura:attribute name="truthy" type="Boolean" default="false" />
    <aura:attribute name="list_message" type="String" default="搜索" />
    <aura:attribute name="confirm_status" type="Integer" default="0" />
    <aura:attribute name="modal_confirm_title" type="String" />
    <aura:attribute name="modal_confirm_text" type="String" />
    <!-- fy -->
    <aura:attribute name="UserProType" type="String" />
    <!-- 科室 -->
    <aura:attribute name="opportunity_cfilter" type="String" />
    <aura:attribute name="update_select_report_data_id" type="String" default="" />
    <!-- 批量添加周报 start-->
    <aura:attribute name="reports_date" type="List" />
    <aura:attribute name="TableContent" type="String" description=" Show the Result class" />
    <aura:attribute name="TableContent2" type="String" description=" Show the Result class" />
    <aura:attribute name="TargetFileName" type="String" description="Name of the file" />
    <aura:attribute name="tableheaders" type="Object[]" />
    <aura:attribute name="fileContentData" type="String" />
    <aura:attribute name="filename" type="String" />
    <aura:attribute name="NumOfRecords" type="Integer" default="1000" />
    <aura:attribute name="showMain" type="Boolean" default="true" />
    <aura:attribute name="IsEventDefault" type="Boolean" default="true" />
    <aura:attribute name="PIConfig" type="Map"/>
        <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" />
    <ltng:require scripts="{! $Resource.jquery183minjs }" />
    <!-- 批量添加周报 end-->
    <!--ロード中...-->
    <aura:renderIf isTrue="{!v.login}">
        <div class="slds-spinner_container height100vh">
            <div class="slds-spinner--brand slds-spinner slds-spinner--medium" role="alert">
                <span class="slds-assistive-text">Loading</span>
                <div class="slds-spinner__dot-a"></div>
                <div class="slds-spinner__dot-b"></div>
            </div>
        </div>
    </aura:renderIf>
    <div aura:id="report" id="report" class="contents_wrapper">
        <div class="slds-grid slds-wrap slds-grid--pull-padded">
            <div style="width: 230px;"></div>
            <div
                class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12">
                周
            </div>
            <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12">
                <ui:inputSelect aura:id="select_date" class="slds-select" change="{!c.select_date_change}" />
            </div>
            <!-- 代理店担当者 -->
            <div class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12"
                style="display: none;">
                {!v.fieldsmap.Person_In_Charge2__c}
            </div>
            <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"
                style="display: none;">
                <ui:inputSelect aura:id="select_agency_person" class="slds-select agency_person_select"
                    change="{!c.select_agency_change}" />
            </div>
            <div style="width: 200px;">
            </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"
                style="display: contents;">
                <ui:button aura:id="new_button" label="新建" press="{!c.new_report}" />
            </div>
            <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12">
                <ui:button aura:id="copy_button" label="复制" press="{!c.copy_button}" disabled="true" />
                <ui:button aura:id="import" label="导入" press="{!c.import}" />
                <ui:button aura:id="export" label="导出" press="{!c.export_condition}" />
            </div>
        </div>
  <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" />
  <ltng:require scripts="{! $Resource.jquery183minjs }" />
  <!-- 批量添加日报 end-->
  <!--ロード中...-->
  <aura:renderIf isTrue="{!v.login}">
    <div class="slds-spinner_container height100vh">
      <div
        class="slds-spinner--brand slds-spinner slds-spinner--medium"
        role="alert"
      >
        <span class="slds-assistive-text">Loading</span>
        <div class="slds-spinner__dot-a"></div>
        <div class="slds-spinner__dot-b"></div>
      </div>
    </div>
    <div aura:id="report_list" class="report_list_area">
        <div class="slds-table--edit_container slds-is-relative" style="padding-left: 50px;">
            <table class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus"
                role="grid" style="width:66.75rem;">
  </aura:renderIf>
  <div aura:id="report" id="report" class="contents_wrapper">
    <div class="slds-grid slds-wrap slds-grid--pull-padded">
      <div style="width: 200px"></div>
      <div
        class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12"
      >
        周
      </div>
      <div
        class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"
      >
        <ui:inputSelect
          aura:id="select_date"
          class="slds-select"
          change="{!c.select_date_change}"
        />
      </div>
      <!-- 代理店担当者 -->
      <div
        class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12"
        style="display: none"
      >
        {!v.fieldsmap.Person_In_Charge2__c}
      </div>
      <div
        class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"
        style="display: none"
      >
        <ui:inputSelect
          aura:id="select_agency_person"
          class="slds-select agency_person_select"
          change="{!c.select_agency_change}"
        />
      </div>
      <div style="width: 100px"></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"
        style="display: contents"
      >
        <ui:button aura:id="new_button" label="新建" press="{!c.new_report}" />
      </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"
      >
        <ui:button
          aura:id="copy_button"
          label="复制"
          press="{!c.copy_button}"
          disabled="true"
        />
        <ui:button
          aura:id="delete_button"
          label="删除"
          press="{!c.delete_button}"
          disabled="true"
        />
        <ui:button aura:id="import" label="导入" press="{!c.import}" />
        <ui:button
          aura:id="export"
          label="导出"
          press="{!c.export_condition}"
        />
        <ui:button
          aura:id="returnbutton"
          label="返回"
          press="{!c.return_main_page}"
        />
      </div>
    </div>
  </div>
  <div aura:id="report_list" class="report_list_area">
    <div
      class="slds-table--edit_container slds-is-relative"
      style="padding-left: 50px"
    >
      <table
        class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus"
        role="grid"
        style="width: 66.75rem"
      >
        <thead>
          <tr class="slds-line-height--reset">
            <th
              class="table_header slds-text-title--caps"
              style="width: 250px"
            ></th>
            <th class="table_header slds-text-title--caps">
              <span class="slds-truncate" title="Name"
                >{!v.fieldsmap.Person_In_Charge2__c}</span
              >
              <!-- {!v.fieldsmap.Person_In_Charge2__c}  担当-->
            </th>
            <th class="table_header slds-text-title--caps" style="width: 250px">
              <span class="slds-truncate" title="Name">医院</span>
            </th>
            <th class="table_header slds-text-title--caps">
              <span class="slds-truncate" title="Name"
                >{!v.fieldsmap.Department_Cateogy__c}</span
              >
              <!-- {!v.fieldsmap.Department_Cateogy__c}    科室-->
            </th>
            <th class="table_header slds-text-title--caps">
              <span class="slds-truncate" title="Name">拜访人</span>
              <!-- {!v.fieldsmap.doctor2__c}    拜访人 -->
            </th>
            <th class="table_header slds-text-title--caps">
              <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">
              <span class="slds-truncate" title="Name"
                >{!v.fieldsmap.WorkMark__c}</span
              >
              <!-- {!v.fieldsmap.visitor_title__c}   职位-->
            </th>
          </tr>
        </thead>
        <tbody>
          <aura:iteration items="{!v.reports}" var="item" indexVar="index">
            <tr class="slds-hint-parent">
              <td role="gridcell" class="slds-cell-edit">
                <ui:inputRadio
                  class="report_radio"
                  name="report_radio"
                  label="{!item.Name}"
                  change="{!c.change_report_radio}"
                />
                <lightning:buttonIcon
                  class="edit_button"
                  iconName="utility:edit"
                  size="small"
                  alternativeText="edit"
                  value="{!index}"
                  onclick="{!c.edit_button}"
                />
              </td>
              <td role="gridcell" class="slds-cell-edit">
                <span class="slds-grid slds-grid--align-spread">
                  <span
                    class="slds-truncate"
                    title="{!item.Person_In_Charge2__r.Name}"
                    >{!item.Person_In_Charge2__r.Name}</span
                  >
                </span>
              </td>
              <th scope="row" tabindex="0" class="slds-cell-edit">
                <span class="slds-grid slds-grid--align-spread">
                  {!item.Agency_Hospital__r.Name}
                </span>
              </th>
              <td role="gridcell" class="slds-cell-edit">
                <span class="slds-grid slds-grid--align-spread">
                  <span
                    class="slds-truncate"
                    title="{!item.Department_Cateogy_text__c}"
                    >{!item.Department_Cateogy_text__c}</span
                  >
                </span>
              </td>
              <td role="gridcell" class="slds-cell-edit">
                <span class="slds-grid slds-grid--align-spread">
                  <span class="slds-truncate" title="{!item.doctor2__r.Name}">
                    <span class="encrypt">{!item.doctor2__r.Name}</span>
                    <span class="decrypt">{!item.doctor2__r.awsdata.name}</span>
                  </span>
                </span>
              </td>
              <td role="gridcell" class="slds-cell-edit">
                <span class="slds-grid slds-grid--align-spread">
                  <span
                    class="slds-truncate"
                    title="{!item.DealerPersonnel__r.Name}"
                    >{!item.DealerPersonnel__r.Name}</span
                  >
                </span>
              </td>
              <td role="gridcell" class="slds-cell-edit">
                <span class="slds-grid slds-grid--align-spread">
                  <span class="slds-truncate" title="{!item.WorkMark__c}">
                    <lightning:input
                      type="checkbox"
                      checked="{!item.WorkMark__c}"
                      disabled="true"
                    />
                  </span>
                </span>
              </td>
            </tr>
          </aura:iteration>
        </tbody>
      </table>
    </div>
    <aura:renderIf isTrue="{!v.report_count > 0}">
      <aura:set attribute="else">
        <div class="no_data_area">{!v.list_message}</div>
      </aura:set>
    </aura:renderIf>
  </div>
  <!-- 批量添加日报 start-->
  <div
    aura:id="modal_import"
    role="dialog"
    tabindex="-1"
    class="disp_none slds-modal slds-fade-in-open slds-modal--large"
    aria-labelledby="headerTarget"
  >
    <div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv01">
      <!-- <ui:inputText aura:id="articleURL" /> -->
      <div class="demo-only" style="height: 8rem">
        <div class="slds-notify_container slds-is-relative">
          <div
            class="slds-notify slds-notify_toast slds-theme_success"
            role="alert"
          >
            <div class="slds-m-left_xx-large">
              <div
                class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"
              >
                <lightning:icon
                  alternativeText="Success"
                  iconName="utility:success"
                  size="small"
                  class="buttonColor slds-m-right_small"
                />
                <h2 class="slds-text-heading_small">{!v.successMessage}</h2>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div
      class="slds-modal slds-fade-in-open slds-hide"
      aura:id="errorDiv01"
      style="z-index: 10001"
    >
      <!-- <ui:inputText aura:id="articleURL" /> -->
      <div class="demo-only" style="height: 8rem">
        <div class="slds-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>
          </div>
        </div>
      </div>
    </div>
    <div class="slds-modal__container">
      <div class="slds-modal__header">
        <h4 id="headerTarget" class="slds-float--left"></h4>
        <h2 id="headerTarget" class="slds-text-heading--medium">
          日报批量导入
        </h2>
        <ui:button
          aura:id="close_button"
          label="关闭"
          class="close_button slds-button slds-button--neutral slds-order--1"
          press="{!c.close_import}"
        />
      </div>
      <div
        class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium"
      >
        <aura:if isTrue="{!v.showMain}">
          <div>
            <lightning:input
              type="file"
              class="file"
              uara:id="file"
              onchange="{!c.CreateRecord}"
            />
          </div>
          <aura:set attribute="else">
            <ui:outputRichText
              class="uiOutputRichText slds-m--around-large"
              value="{!v.TableContent}"
            />
            <div class="slds-p-around--large slds-align--absolute-center">
              <lightning:button
                label="保存"
                variant="brand"
                onclick="{!c.processFileContent}"
              />
              <lightning:button
                label="取消"
                variant="brand"
                onclick="{!c.cancel}"
              />
            </div>
            <aura:if isTrue="{!v.showErrorInfo}">
              <div class="slds-p-around--large slds-align--absolute-center">
                <lightning:button
                  label="导出错误信息"
                  variant="brand"
                  onclick="{!c.exportErrorInfo}"
                />
              </div>
              <div class="slds-p-around--large slds-align--absolute-center">
                <div style="height: 300px">
                  <lightning:datatable
                    keyField="id"
                    data="{! v.errorData }"
                    columns="{! v.errorColumns }"
                    hideCheckboxColumn="true"
                  />
                </div>
              </div>
            </aura:if>
          </aura:set>
        </aura:if>
      </div>
    </div>
  </div>
  <div
    aura:id="modal_importbg"
    class="disp_none slds-backdrop slds-backdrop--open"
  ></div>
  <!-- 批量添加日报 end-->
  <!-- 批量导出日报 start-->
  <div
    aura:id="modal_export"
    role="dialog"
    tabindex="-1"
    class="disp_none slds-modal slds-fade-in-open slds-modal--large"
  >
    <div class="slds-modal__container">
      <div class="slds-modal__header">
        <h4 id="headerTarget" class="slds-float--left"></h4>
        <h2 id="headerTarget" class="slds-text-heading--medium">
          日报批量导出
        </h2>
        <ui:button
          aura:id="close_button"
          label="关闭"
          class="close_button slds-button slds-button--neutral slds-order--1"
          press="{!c.close_export}"
        />
      </div>
      <div
        class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium"
      >
        <aura:if isTrue="{!v.showMain}">
          <div class="slds-grid slds-wrap slds-grid--pull-padded">
            <div
              class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"
            ></div>
            <div
              class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"
            >
              活动日开始日期
              <lightning:input
                type="Date"
                class="slds-input slds-input_bare"
                aura:id="input-report-date1"
              />
            </div>
            <div
              class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"
            >
              活动日结束日期
              <lightning:input
                type="Date"
                class="slds-input slds-input_bare"
                aura:id="input-report-date2"
              />
            </div>
            <div
              class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"
            ></div>
            <div class="slds-p-around--large slds-align--absolute-center">
              <lightning:button
                label="确认"
                variant="brand"
                onclick="{!c.select_repores_date}"
              />
              <lightning:button
                label="取消"
                variant="brand"
                onclick="{!c.close_export}"
              />
            </div>
          </div>
          <aura:set attribute="else">
            <ui:outputRichText
              class="uiOutputRichText slds-m--around-large"
              value="{!v.TableContent2}"
            />
            <div class="slds-p-around--large slds-align--absolute-center">
              <lightning:button
                label="确认"
                variant="brand"
                onclick="{!c.exportDate}"
              />
              <lightning:button
                label="取消"
                variant="brand"
                onclick="{!c.close_export}"
              />
            </div>
          </aura:set>
        </aura:if>
      </div>
    </div>
  </div>
  <div
    aura:id="modal_exportbg"
    class="disp_none slds-backdrop slds-backdrop--open"
  ></div>
  <!-- 批量导出日报 end-->
  <div
    aura:id="modal_window"
    role="dialog"
    tabindex="-1"
    class="disp_none slds-modal slds-fade-in-open slds-modal--large"
    aria-labelledby="headerTarget"
  >
    <div class="slds-modal__container">
      <div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv">
        <!-- <ui:inputText aura:id="articleURL" /> -->
        <div class="demo-only" style="height: 8rem">
          <div class="slds-notify_container slds-is-relative">
            <div
              class="slds-notify slds-notify_toast slds-theme_success"
              role="alert"
            >
              <div class="slds-m-left_xx-large">
                <div
                  class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"
                >
                  <lightning:icon
                    alternativeText="Success"
                    iconName="utility:success"
                    size="small"
                    class="buttonColor slds-m-right_small"
                  />
                  <h2 class="slds-text-heading_small">{!v.successMessage}</h2>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div
        class="slds-modal slds-fade-in-open slds-hide"
        aura:id="errorDiv"
        style="z-index: 10001"
      >
        <!-- <ui:inputText aura:id="articleURL" /> -->
        <div class="demo-only" style="height: 8rem">
          <div class="slds-notify_container slds-is-relative">
            <div
              class="slds-notify slds-notify_toast slds-theme_error"
              role="status"
            >
              <div class="slds-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>
            </div>
          </div>
        </div>
      </div>
      <div class="slds-modal__header">
        <h2 id="headerTarget" class="slds-text-heading--medium">
          日报({!v.selected_date}&nbsp;{!v.selected_agency_person})
        </h2>
        <ui:button
          aura:id="close_button"
          label="关闭"
          class="close_button slds-button slds-button--neutral slds-order--1"
          press="{!c.toggle_report}"
        />
      </div>
      <div class="slds-modal__content slds-grow slds-p-around--medium">
        <div class="slds-box slds-theme--shade">
          <div class="slds-grid slds-wrap slds-grid--pull-padded">
            <div
              class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"
            >
              活动日
              <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"
              data-select="single"
            >
              <!-- label="医院" -->
              医院
              <lightning:input
                aura:id="hospital_input_text"
                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">
                  <aura:iteration var="hospital" items="{!v.hospitalList}">
                    <li
                      role="presentation"
                      onclick="{!c.selectHos}"
                      data-accName="{!hospital.Hospital_Name_readonly__c}"
                      data-accId="{!hospital.Hospital__c}"
                    >
                      <span
                        class="slds-lookup__item-action slds-media"
                        id="lookup-option-498"
                        role="option"
                      >
                        <div class="slds-media__body">
                          <div class="slds-lookup__result-text">
                            {!hospital.Hospital_Name_readonly__c}
                          </div>
                        </div>
                      </span>
                    </li>
                  </aura:iteration>
                </ul>
              </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"
            >
              {!v.fieldsmap.Department_Cateogy__c}
              <!-- <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"
                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"
              style="width: 145px"
            >
              {!v.fieldsmap.DealerPersonnel__c}
              <ui:inputSelect
                aura:id="select_DealerPersonnel"
                class="slds-select"
              />
            </div>
            <!-- 活动区分   -->
            <div
              class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"
            >
              {!v.fieldsmap.WorkRecord__c}
              <ui:inputSelect
                aura:id="select_purpose_type"
                class="slds-select"
                change="{!c.select_purpose_type}"
              />
            </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"
              style="width: 145px"
            >
              拜访人
              <ui:inputSelect
                aura:id="select_doctor"
                class="slds-select"
                change="{!c.doctor_change}"
              />
            </div>
            <!-- <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"
            >
              <br />
              <ui:button
                label="新建"
                class="slds-button"
                press="{!c.createCon}"
                disabled="true"
                aura:id="new_con"
              />
            </div>
            <!-- </p> -->
            <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"
            >
              产品分类(第三分类)
              <ui:inputSelect
                aura:id="select_ProductClassification"
                class="slds-select"
                change="{!c.selectProductClassification}"
              />
            </div>
            <!-- 使用产品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"
              data-select="single"
            >
              <!-- label="使用产品1(产品型号)" -->
              使用产品1(产品型号)
              <lightning:input
                aura:id="UseProduct1_TEXT"
                class="field"
                value="{!v.UseProduct1}"
                updateOn="keyup"
                variant="label-hidden"
              />
              <div class="slds-lookup__menu" id="lookup-11">
                <ul
                  class="slds-lookup__list"
                  role="listbox"
                  style="max-height: 230px"
                >
                  <aura:iteration
                    var="UseProduct1"
                    items="{!v.UseProduct1List}"
                  >
                    <li
                      role="presentation"
                      onclick="{!c.seletUseProduct1Change}"
                      data-accid="{!UseProduct1.Id}"
                      data-accName="{!UseProduct1.Asset_Model_No__c}"
                    >
                      <span
                        class="slds-lookup__item-action slds-media"
                        id="lookup-option-498"
                        role="option"
                      >
                        <div class="slds-media__body">
                          <div class="slds-lookup__result-text">
                            {!UseProduct1.Asset_Model_No__c}
                          </div>
                        </div>
                      </span>
                    </li>
                  </aura:iteration>
                </ul>
              </div>
            </div>
            <!-- 使用产品2   UseProduct2__c  -->
            <div
              aura:id="UseProduct2_List"
              class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"
              data-select="single"
            >
              <!-- label="使用产品2" -->
              使用产品2
              <lightning:input
                aura:id="UseProduct2_TEXT"
                class="field"
                value="{!v.UseProduct2}"
                updateOn="keyup"
                variant="label-hidden"
              />
              <div class="slds-lookup__menu" id="lookup-22">
                <ul
                  class="slds-lookup__list"
                  role="listbox"
                  style="max-height: 230px"
                >
                  <aura:iteration
                    var="UseProduct2"
                    items="{!v.UseProduct2List}"
                  >
                    <li
                      role="presentation"
                      onclick="{!c.seletUseProduct2Change}"
                      data-accid="{!UseProduct2.Id}"
                      data-accName="{!UseProduct2.Asset_Model_No__c}"
                    >
                      <span
                        class="slds-lookup__item-action slds-media"
                        id="lookup-option-498"
                        role="option"
                      >
                        <div class="slds-media__body">
                          <div class="slds-lookup__result-text">
                            {!UseProduct2.Asset_Model_No__c}
                          </div>
                        </div>
                      </span>
                    </li>
                  </aura:iteration>
                </ul>
              </div>
            </div>
            <!-- 使用产品3   UseProduct3__c  -->
            <div
              aura:id="UseProduct3_List"
              class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"
              data-select="single"
            >
              <!-- label="使用产品3" -->
              使用产品3
              <lightning:input
                aura:id="UseProduct3_TEXT"
                class="field"
                value="{!v.UseProduct3}"
                updateOn="keyup"
                variant="label-hidden"
              />
              <div class="slds-lookup__menu" id="lookup-33">
                <ul
                  class="slds-lookup__list"
                  role="listbox"
                  style="max-height: 230px"
                >
                  <aura:iteration
                    var="UseProduct3"
                    items="{!v.UseProduct3List}"
                  >
                    <li
                      role="presentation"
                      onclick="{!c.seletUseProduct3Change}"
                      data-accid="{!UseProduct3.Id}"
                      data-accName="{!UseProduct3.Asset_Model_No__c}"
                    >
                      <span
                        class="slds-lookup__item-action slds-media"
                        id="lookup-option-498"
                        role="option"
                      >
                        <div class="slds-media__body">
                          <div class="slds-lookup__result-text">
                            {!UseProduct3.Asset_Model_No__c}
                          </div>
                        </div>
                      </span>
                    </li>
                  </aura:iteration>
                </ul>
              </div>
            </div>
            <!-- 效果/进度  EffectProgress__c-->
            <div
              aura:id="product_category_select1"
              class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"
            >
              {!v.fieldsmap.EffectProgress__c}
              <ui:inputSelect
                aura:id="select_EffectProgress"
                class="slds-select"
              />
            </div>
            <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"
            >
              {!v.fieldsmap.ConsumptionOfConsumables__c}
              <!-- <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"
                variant="label-hidden"
              />
            </div>
            <!-- 术士分类   WarlockClassification__c   -->
            <div
              class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"
            >
              {!v.fieldsmap.WarlockClassification__c}
              <ui:inputSelect
                aura:id="select_OtherBrandConsumables"
                class="slds-select"
              />
            </div>
            <!-- 已采用其他品牌   ProductCcategory__c -->
            <div
              class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"
            >
              {!v.fieldsmap.ProductCcategory__c}
              <ui:inputSelect
                aura:id="select_ProductCcategory"
                class="slds-select"
                change="{!c.selectpurposetype}"
              />
            </div>
            <!-- 其他品牌产品类别  -->
            <div
              aura:id="result"
              class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"
            >
              {!v.fieldsmap.productCategories__c}
              <ui:inputSelect
                aura:id="select_productCategories"
                class="slds-select"
              />
            </div>
            <!-- 产品用量   warlocksNumber__c   -->
            <div
              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 aura:id="select_warlocksNumber" class="slds-select"
                                change="{!c.select_warlocksNumber}" /> -->
              <lightning:input
                type="text"
                onchange="{!c.select_warlocksNumber}"
                aura:id="select_warlocksNumber"
                variant="label-hidden"
              />
            </div>
            <!-- 支援需求      WorkMark__c-->
            <div style="padding-left: 12px">
              {!v.fieldsmap.WorkMark__c}
              <lightning:input type="checkbox" aura:id="select_WorkMark" />
            </div>
            <div
              aura:id="input-opportunity-stage"
              class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"
            >
              {!v.fieldsmap.StageName__c}
              <ui:inputSelect aura:id="select_stageName" class="slds-select" />
            </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"
            >
              {!v.fieldsmap.Amount__c}
              <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/>  医院采购预算(不含税,元)-->
              <lightning:inputField value="{!v.oppdata.Amount__c}" class="" />
            </div>
            <div
              aura:id="input-opportunity-amount2"
              class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"
            >
              {!v.fieldsmap.OCMSale_Price__c}
              <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/>      订货金额(不含税,元)  -->
              <lightning:inputField
                value="{!v.oppdata.OCMSale_Price__c}"
                class=""
              />
            </div>
            <div
              aura:id="input-opportunity-date"
              class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"
            >
              {!v.fieldsmap.Close_Forecasted_Date__c}
              <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/>    预测与OCSM签约日 -->
              <lightning:inputField
                value="{!v.oppdata.Close_Forecasted_Date__c}"
                class=""
              />
            </div>
            <hr />
          </div>
        </div>
        <div class="save_button_area">
          <ui:button
            aura:id="save_button"
            label="保存并新建"
            class="save_button slds-button slds-button--brand slds-order--3"
            press="{!c.save_report}"
          />
        </div>
        <aura:renderIf isTrue="{!v.reports_now_count > 0}">
          <div class="mt40 slds-box slds-theme--shade">
            <div class="slds-table--edit_container slds-is-relative">
              <table
                class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus"
                role="grid"
              >
                <thead>
                    <tr class="slds-line-height--reset">
                        <th class="table_header slds-text-title--caps">
                        </th>
                        <th class="table_header slds-text-title--caps">
                            <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">
                            <span class="slds-truncate" title="Name">医院</span>
                        </th>
                        <th class="table_header slds-text-title--caps">
                            <span class="slds-truncate" title="Name">{!v.fieldsmap.Department_Cateogy__c}</span>
                            <!-- {!v.fieldsmap.Department_Cateogy__c}    科室-->
                        </th>
                        <th class="table_header slds-text-title--caps">
                            <span class="slds-truncate" title="Name">医院人员</span>
                            <!-- {!v.fieldsmap.doctor2__c}    医院人员 -->
                        </th>
                        <th class="table_header slds-text-title--caps">
                            <span class="slds-truncate" title="Name">{!v.fieldsmap.DealerPersonnel__c}</span>
                            <!-- {!v.fieldsmap.visitor_title__c}   职位-->
                        </th>
                    </tr>
                  <tr class="slds-line-height--reset">
                    <th class="table_header slds-text-title--caps">
                      <span class="slds-truncate" title="Name"></span>
                    </th>
                    <th class="table_header slds-text-title--caps">
                      <span class="slds-truncate" title="Name">医院</span>
                    </th>
                    <th class="table_header slds-text-title--caps">
                      <span class="slds-truncate" title="Name"
                        >{!v.fieldsmap.Department_Cateogy__c}</span
                      >
                    </th>
                    <th class="table_header slds-text-title--caps">
                      <span class="slds-truncate" title="Name"
                        >{!v.fieldsmap.doctor2__c}</span
                      >
                      <!-- 客户人员 -->
                    </th>
                    <th class="table_header slds-text-title--caps">
                      <span class="slds-truncate" title="Name"
                        >{!v.fieldsmap.visitor_title__c}</span
                      >
                    </th>
                    <th class="table_header slds-text-title--caps">
                      <span class="slds-truncate" title="Name"
                        >{!v.fieldsmap.WorkRecord__c}</span
                      >
                    </th>
                  </tr>
                </thead>
                <tbody>
                    <aura:iteration items="{!v.reports}" var="item" indexVar="index">
                        <tr class="slds-hint-parent">
                            <td role="gridcell" class="slds-cell-edit">
                                <ui:inputRadio class="report_radio" name="report_radio" label="{!item.Name}"
                                    change="{!c.change_report_radio}" />
                                <lightning:buttonIcon class="edit_button" iconName="utility:edit" size="small"
                                    alternativeText="edit" value="{!index}" onclick="{!c.edit_button}" />
                            </td>
                            <td role="gridcell" class="slds-cell-edit">
                                <span class="slds-grid slds-grid--align-spread">
                                    <span class="slds-truncate"
                                        title="{!item.Person_In_Charge2__r.Name}">{!item.Person_In_Charge2__r.Name}</span>
                                </span>
                            </td>
                            <th scope="row" tabindex="0" class="slds-cell-edit">
                                <span class="slds-grid slds-grid--align-spread">
                                    {!item.Agency_Hospital__r.Name}
                                </span>
                            </th>
                            <td role="gridcell" class="slds-cell-edit">
                                <span class="slds-grid slds-grid--align-spread">
                                    <span class="slds-truncate"
                                        title="{!item.Department_Cateogy__c}">{!item.Department_Cateogy__c}</span>
                                </span>
                            </td>
                            <td role="gridcell" class="slds-cell-edit">
                                <span class="slds-grid slds-grid--align-spread">
                                    <span class="slds-truncate"
                                        title="{!item.doctor2__r.Name}">
                                        <span class="encrypt">{!item.doctor2__r.Name}</span>
                                        <span class="decrypt">{!item.doctor2__r.awsdata.name}</span>
                                    </span>
                                </span>
                            </td>
                            <td role="gridcell" class="slds-cell-edit">
                                <span class="slds-grid slds-grid--align-spread">
                                    <span class="slds-truncate"
                                        title="{!item.DealerPersonnel__r.Name}">{!item.DealerPersonnel__r.Name}</span>
                                </span>
                            </td>
                        </tr>
                    </aura:iteration>
                  <aura:iteration
                    items="{!v.reports_now}"
                    var="item"
                    indexVar="index"
                  >
                    <tr aura:id="modal_data_list_tr" class="slds-hint-parent">
                      <td role="gridcell" class="slds-cell-edit">
                        <span class="slds-grid slds-grid--align-spread">
                          <span
                            class="slds-truncate"
                            title="{!item.Department_Cateogy_text__c}"
                            >{!item.Name}</span
                          >
                        </span>
                      </td>
                      <td role="gridcell" class="slds-cell-edit">
                        <span class="slds-grid slds-grid--align-spread">
                          <span
                            class="slds-truncate"
                            title="{!item.Agency_Hospital__r.Name}"
                            >{!item.Agency_Hospital__r.Name}</span
                          >
                        </span>
                      </td>
                      <td role="gridcell" class="slds-cell-edit">
                        <span class="slds-grid slds-grid--align-spread">
                          <span
                            class="slds-truncate"
                            title="{!item.Department_Cateogy_text__c}"
                            >{!item.Department_Cateogy_text__c}</span
                          >
                        </span>
                      </td>
                      <td role="gridcell" class="slds-cell-edit">
                        <span class="slds-grid slds-grid--align-spread">
                          <span
                            class="slds-truncate"
                            title="{!item.doctor2__r.Name}"
                            >{!item.doctor2__r.Name}</span
                          >
                        </span>
                      </td>
                      <td role="gridcell" class="slds-cell-edit">
                        <span class="slds-grid slds-grid--align-spread">
                          <span
                            class="slds-truncate"
                            title="{!item.visitor_title__c}"
                            >{!item.visitor_title__c}</span
                          >
                        </span>
                      </td>
                      <td role="gridcell" class="slds-cell-edit">
                        <span class="slds-grid slds-grid--align-spread">
                          <span
                            class="slds-truncate"
                            title="{!item.WorkRecord__c}"
                            >{!item.WorkRecord__c}</span
                          >
                        </span>
                      </td>
                    </tr>
                  </aura:iteration>
                </tbody>
            </table>
        </div>
        <aura:renderIf isTrue="{!v.report_count > 0}">
            <aura:set attribute="else">
                <div class="no_data_area">
                    {!v.list_message}
                </div>
            </aura:set>
              </table>
            </div>
          </div>
        </aura:renderIf>
      </div>
    </div>
    <!-- 批量添加周报 start-->
    <div aura:id="modal_import" role="dialog" tabindex="-1"
        class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget">
        <div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv01">
            <ui:inputText aura:id="articleURL" />
            <div class="demo-only" style="height: 8rem;">
                <div class="slds-notify_container slds-is-relative">
                    <div class="slds-notify slds-notify_toast slds-theme_success" role="alert">
                        <div class=" slds-m-left_xx-large">
                            <div
                                class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large">
                                <lightning:icon alternativeText="Success" iconName="utility:success" size="small"
                                    class="buttonColor slds-m-right_small" />
                                <h2 class="slds-text-heading_small ">{!v.successMessage}</h2>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="slds-modal__container ">
            <div class="slds-modal__header ">
                <h4 id="headerTarget" class="slds-float--left"></h4>
                <h2 id="headerTarget" class="slds-text-heading--medium">周报批量导入</h2>
                <ui:button aura:id="close_button" label="关闭"
                    class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.close_import}" />
            </div>
            <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium ">
                <aura:if isTrue="{!v.showMain}">
                    <div>
                        <lightning:input type="file" class="file" uara:id="file" onchange="{!c.CreateRecord}" />
                    </div>
                    <aura:set attribute="else">
                        <ui:outputRichText class="uiOutputRichText slds-m--around-large" value="{!v.TableContent}" />
                        <div class="slds-p-around--large slds-align--absolute-center">
                            <lightning:button label="保存" variant="brand" onclick="{!c.processFileContent}" />
                            <lightning:button label="取消" variant="brand" onclick="{!c.cancel}" />
                        </div>
  </div>
                    </aura:set>
                </aura:if>
            </div>
        </div>
  <div
    aura:id="modal_bg"
    class="disp_none slds-backdrop slds-backdrop--open"
  ></div>
  <div
    aura:id="modal_confirm"
    role="dialog"
    tabindex="-2"
    aria-labelledby="header43"
    class="disp_none slds-modal slds-fade-in-open"
  >
    <div class="slds-modal__container">
      <div class="slds-modal__header">
        <h2 id="header43" class="slds-text-heading--medium">
          {!v.modal_confirm_title}
        </h2>
      </div>
      <div class="slds-modal__content slds-p-around--medium">
        <p>{!v.modal_confirm_text}</p>
      </div>
      <div class="slds-modal__footer">
        <ui:button
          label="是"
          class="slds-button slds-button--brand"
          press="{!c.yes_button}"
        />
        <ui:button
          label="否"
          class="slds-button slds-button--neutral"
          press="{!c.no_button}"
        />
      </div>
    </div>
    <div aura:id="modal_importbg" class="disp_none slds-backdrop slds-backdrop--open"></div>
    <!-- 批量添加周报 end-->
  </div>
  <div
    aura:id="modal_confirm_bg"
    class="disp_none slds-backdrop slds-backdrop--open"
  ></div>
    <!-- 批量导出周报 start-->
    <div aura:id="modal_export" role="dialog" tabindex="-1"
        class="disp_none slds-modal slds-fade-in-open slds-modal--large">
        <div class="slds-modal__container">
            <div class="slds-modal__header">
                <h4 id="headerTarget" class="slds-float--left"></h4>
                <h2 id="headerTarget" class="slds-text-heading--medium">周报批量导出</h2>
                <ui:button aura:id="close_button" label="关闭"
                    class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.close_export}" />
            </div>
            <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium">
                <aura:if isTrue="{!v.showMain}">
                    <div class="slds-grid slds-wrap slds-grid--pull-padded">
                        <div
                            class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4">
                        </div>
                        <div
                            class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4">
                            活动日开始日期
                            <lightning:input type="Date" class="slds-input slds-input_bare "
                                aura:id="input-report-date1" />
                        </div>
                        <div
                            class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4">
                            活动日结束日期
                            <lightning:input type="Date" class="slds-input slds-input_bare "
                                aura:id="input-report-date2" />
                        </div>
                        <div
                            class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4">
                        </div>
                        <div class="slds-p-around--large slds-align--absolute-center">
                            <lightning:button label="确认" variant="brand" onclick="{!c.select_repores_date}" />
                            <lightning:button label="取消" variant="brand" onclick="{!c.close_export}" />
                        </div>
                    </div>
                    <aura:set attribute="else">
                        <ui:outputRichText class="uiOutputRichText slds-m--around-large" value="{!v.TableContent2}" />
                        <div class="slds-p-around--large slds-align--absolute-center">
                            <lightning:button label="确认" variant="brand" onclick="{!c.exportDate}" />
                            <lightning:button label="取消" variant="brand" onclick="{!c.close_export}" />
                        </div>
                    </aura:set>
                </aura:if>
            </div>
        </div>
  <div
    aura:id="modal_newAC"
    role="dialog"
    tabindex="-3"
    aria-labelledby="headertest"
    class="disp_none slds-modal slds-fade-in-open"
  >
    <div class="slds-modal__container">
      <div class="slds-modal__header">
        <h2 id="headertest" class="slds-text-heading--medium">新建.拜访人</h2>
      </div>
      <div class="slds-modal__content slds-p-around--medium">
        <lightning:recordEditForm
          aura:id="recordEditForm"
          objectApiName="Agency_Contact__c"
          onsuccess="{!c.handleSuccess}"
          onload="{!c.showRequiredFields}"
          onsubmit="{!c.handleSubmit}"
        >
          <lightning:messages aura:id="OppMessage" />
          <!-- onload="{!c.showRequiredFields}" -->
          <aura:renderIf isTrue="{!v.truthy}">
            <lightning:inputField
              fieldName="Name"
              aura:id="newOpportunityField"
            />
            <lightning:inputField
              fieldName="Type__c"
              aura:id="newOpportunityField"
            />
            <lightning:inputField
              fieldName="Doctor_Division1__c"
              aura:id="newOpportunityField"
            />
          </aura:renderIf>
          <br />
          <br />
          <br />
          <br />
          <br />
          <div class="save_button_area">
            <lightning:button
              class="slds-m-top_small"
              type="button"
              label="取消"
              onclick="{!c.createCancel}"
            />
            <lightning:button
              class="slds-m-top_small"
              type="button"
              label="保存"
              onclick="{!c.handleSubmit}"
            />
          </div>
        </lightning:recordEditForm>
      </div>
    </div>
    <div aura:id="modal_exportbg" class="disp_none slds-backdrop slds-backdrop--open"></div>
    <!-- 批量导出周报 end-->
    <div aura:id="modal_window" role="dialog" tabindex="-1"
        class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget">
        <div class="slds-modal__container">
            <div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv">
                <ui:inputText aura:id="articleURL" />
                <div class="demo-only" style="height: 8rem;">
                    <div class="slds-notify_container slds-is-relative">
                        <div class="slds-notify slds-notify_toast slds-theme_success" role="alert">
                            <div class=" slds-m-left_xx-large">
                                <div
                                    class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large">
                                    <lightning:icon alternativeText="Success" iconName="utility:success" size="small"
                                        class="buttonColor slds-m-right_small" />
                                    <h2 class="slds-text-heading_small ">{!v.successMessage}</h2>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="slds-modal slds-fade-in-open slds-hide" aura:id="errorDiv" style="z-index: 10001">
                <ui:inputText aura:id="articleURL" />
                <div class="demo-only" style="height: 8rem;">
                    <div class="slds-notify_container slds-is-relative">
                        <div class="slds-notify slds-notify_toast slds-theme_error" role="status">
                            <div class=" slds-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>
                        </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}&nbsp;{!v.selected_agency_person})</h2>
                <ui:button aura:id="close_button" label="关闭"
                    class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.toggle_report}" />
            </div>
            <div class="slds-modal__content slds-grow slds-p-around--medium">
                <div class="slds-box slds-theme--shade">
                    <div class="slds-grid slds-wrap slds-grid--pull-padded">
                        <div
                            class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6">
                            活动日
                            <lightning:input type="date" value="{!v.data.Report_Date__c}" aura:id="input-report-date" />
                        </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"
                            data-select="single">
                            <lightning:input aura:id="hospital_input_text" label="医院" class="field"
                                value="{!v.hospital}" updateOn="keyup" />
                            <div class="slds-lookup__menu" id="lookup-66">
                                <ul class="slds-lookup__list" role="listbox">
                                    <aura:iteration var="hospital" items="{!v.hospitalList}">
                                        <li role="presentation" onclick="{!c.selectHos}"
                                            data-accName="{!hospital.Hospital_Name_readonly__c}"
                                            data-accId="{!hospital.Hospital__c}">
                                            <span class="slds-lookup__item-action slds-media" id="lookup-option-498"
                                                role="option">
                                                <div class="slds-media__body">
                                                    <div class="slds-lookup__result-text">
                                                        {!hospital.Hospital_Name_readonly__c}</div>
                                                </div>
                                            </span>
                                        </li>
                                    </aura:iteration>
                                </ul>
                            </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">
                            {!v.fieldsmap.Department_Cateogy__c}
                            <ui:inputText aura:id="select_department" class="slds-select"
                                change="{!c.select_department}" />
                        </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">
                            {!v.fieldsmap.DealerPersonnel__c}
                            <ui:inputSelect aura:id="select_DealerPersonnel" class="slds-select" />
                        </div>
                        <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">
                            <br />
                            <ui:button label="新建" class="slds-button" press="{!c.createCon}" disabled="true"
                                aura:id="new_con" />
                        </div>
                        </p>
                        <!-- 工作记录   -->
                        <div
                            class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6">
                            {!v.fieldsmap.WorkRecord__c}
                            <ui:inputSelect aura:id="select_purpose_type" class="slds-select"
                                change="{!c.select_purpose_type}" />
                        </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">
                            医院人员
                            <ui:inputSelect aura:id="select_doctor" class="slds-select" change="{!c.doctor_change}" />
                        </div>
                        <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">
                            产品分类(第三分类)
                            <ui:inputSelect aura:id="select_ProductClassification" class="slds-select"
                                change="{!c.selectProductClassification}" />
                        </div>
                        <!-- 使用产品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"
                            data-select="single">
                            <lightning:input aura:id="UseProduct1_TEXT" label="使用产品1(产品型号)" class="field"
                                value="{!v.UseProduct1}" updateOn="keyup" />
                            <div class="slds-lookup__menu" id="lookup-11">
                                <ul class="slds-lookup__list" role="listbox">
                                    <aura:iteration var="UseProduct1" items="{!v.UseProduct1List}">
                                        <li role="presentation" onclick="{!c.seletUseProduct1Change}"
                                            data-accid="{!UseProduct1.Id}" data-accName="{!UseProduct1.Name}">
                                            <span class="slds-lookup__item-action slds-media" id="lookup-option-498"
                                                role="option">
                                                <div class="slds-media__body">
                                                    <div class="slds-lookup__result-text">{!UseProduct1.Name}</div>
                                                </div>
                                            </span>
                                        </li>
                                    </aura:iteration>
                                </ul>
                            </div>
                        </div>
                        <!-- 使用产品2   UseProduct2__c  -->
                        <div aura:id="UseProduct2_List"
                        class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"
                            data-select="single">
                            <lightning:input aura:id="UseProduct2_TEXT" label="使用产品2" class="field"
                                value="{!v.UseProduct2}" updateOn="keyup" />
                            <div class="slds-lookup__menu" id="lookup-22">
                                <ul class="slds-lookup__list" role="listbox">
                                    <aura:iteration var="UseProduct2" items="{!v.UseProduct2List}">
                                        <li role="presentation" onclick="{!c.seletUseProduct2Change}"
                                            data-accid="{!UseProduct2.Id}" data-accName="{!UseProduct2.Name}">
                                            <span class="slds-lookup__item-action slds-media" id="lookup-option-498"
                                                role="option">
                                                <div class="slds-media__body">
                                                    <div class="slds-lookup__result-text">{!UseProduct2.Name}</div>
                                                </div>
                                            </span>
                                        </li>
                                    </aura:iteration>
                                </ul>
                            </div>
                        </div>
                        <!-- 使用产品3   UseProduct3__c  -->
                        <div aura:id="UseProduct3_List"
                        class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"
                            data-select="single">
                            <lightning:input aura:id="UseProduct3_TEXT" label="使用产品3" class="field"
                                value="{!v.UseProduct3}" updateOn="keyup" />
                            <div class="slds-lookup__menu" id="lookup-33">
                                <ul class="slds-lookup__list" role="listbox">
                                    <aura:iteration var="UseProduct3" items="{!v.UseProduct3List}">
                                        <li role="presentation" onclick="{!c.seletUseProduct3Change}"
                                            data-accid="{!UseProduct3.Id}" data-accName="{!UseProduct3.Name}">
                                            <span class="slds-lookup__item-action slds-media" id="lookup-option-498"
                                                role="option">
                                                <div class="slds-media__body">
                                                    <div class="slds-lookup__result-text">{!UseProduct3.Name}</div>
                                                </div>
                                            </span>
                                        </li>
                                    </aura:iteration>
                                </ul>
                            </div>
                        </div>
                        <!-- 效果/进度  EffectProgress__c-->
                        <div aura:id="product_category_select1"
                            class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6">
                            {!v.fieldsmap.EffectProgress__c}
                            <ui:inputSelect aura:id="select_EffectProgress" class="slds-select" />
                        </div>
                        <hr />
                        <!-- 科室同类耗材月使用量  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">
                            {!v.fieldsmap.ConsumptionOfConsumables__c}
                            <ui:inputText aura:id="select_ConsumptionOfConsumables" class="slds-select"
                                change="{!c.select_ConsumptionOfConsumables}" />
                        </div>
                        <!-- 术士分类   WarlockClassification__c   -->
                        <div
                            class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6">
                            {!v.fieldsmap.WarlockClassification__c}
                            <ui:inputSelect aura:id="select_OtherBrandConsumables" class="slds-select" />
                        </div>
                        <!-- 已采用其他品牌   ProductCcategory__c -->
                        <div
                            class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6">
                            {!v.fieldsmap.ProductCcategory__c}
                            <ui:inputSelect aura:id="select_ProductCcategory" class="slds-select"
                                change="{!c.selectpurposetype}" />
                        </div>
                        <!-- 其他品牌产品类别  -->
                        <div aura:id="result"
                            class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6">
                            {!v.fieldsmap.productCategories__c}
                            <ui:inputSelect aura:id="select_productCategories" class="slds-select" />
                        </div>
                        <!-- 产品用量   warlocksNumber__c   -->
                        <div
                            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 aura:id="select_warlocksNumber" class="slds-select"
                                change="{!c.select_warlocksNumber}" />
                        </div>
                        <!-- 工作标记      WorkMark__c-->
                        <div style="padding-left: 20px;">
                            {!v.fieldsmap.WorkMark__c}
                            <lightning:input type="checkbox" aura:id="select_WorkMark" />
                        </div>
                        <div aura:id="input-opportunity-stage"
                            class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12">
                            {!v.fieldsmap.StageName__c}
                            <ui:inputSelect aura:id="select_stageName" class="slds-select" />
                        </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">
                            {!v.fieldsmap.Amount__c}
                            <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/>  医院采购预算(不含税,元)-->
                            <lightning:inputField value="{!v.oppdata.Amount__c}" class="" />
                        </div>
                        <div aura:id="input-opportunity-amount2"
                            class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12">
                            {!v.fieldsmap.OCMSale_Price__c}
                            <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/>      订货金额(不含税,元)  -->
                            <lightning:inputField value="{!v.oppdata.OCMSale_Price__c}" class="" />
                        </div>
                        <div aura:id="input-opportunity-date"
                            class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12">
                            {!v.fieldsmap.Close_Forecasted_Date__c}
                            <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/>    预测与OCSM签约日 -->
                            <lightning:inputField value="{!v.oppdata.Close_Forecasted_Date__c}" class="" />
                        </div>
                        <hr />
                    </div>
                </div>
                <div class="save_button_area">
                    <ui:button aura:id="save_button" label="保存并新建"
                        class="save_button slds-button slds-button--brand slds-order--3" press="{!c.save_report}" />
                </div>
                <aura:renderIf isTrue="{!v.reports_now_count > 0}">
                    <div class="mt40 slds-box slds-theme--shade">
                        <div class="slds-table--edit_container slds-is-relative">
                            <table
                                class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus"
                                role="grid">
                                <thead>
                                    <tr class="slds-line-height--reset">
                                        <th class="table_header slds-text-title--caps">
                                            <span class="slds-truncate" title="Name"></span>
                                        </th>
                                        <th class="table_header slds-text-title--caps">
                                            <span class="slds-truncate" title="Name">医院</span>
                                        </th>
                                        <th class="table_header slds-text-title--caps">
                                            <span class="slds-truncate"
                                                title="Name">{!v.fieldsmap.Department_Cateogy__c}</span>
                                        </th>
                                        <th class="table_header slds-text-title--caps">
                                            <span class="slds-truncate" title="Name">{!v.fieldsmap.doctor2__c}</span>
                                            <!-- 客户人员 -->
                                        </th>
                                        <th class="table_header slds-text-title--caps">
                                            <span class="slds-truncate"
                                                title="Name">{!v.fieldsmap.visitor_title__c}</span>
                                        </th>
                                        <th class="table_header slds-text-title--caps">
                                            <span class="slds-truncate" title="Name">{!v.fieldsmap.WorkRecord__c}</span>
                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <aura:iteration items="{!v.reports_now}" var="item" indexVar="index">
                                        <tr aura:id="modal_data_list_tr" class="slds-hint-parent">
                                            <td role="gridcell" class="slds-cell-edit">
                                                <span class="slds-grid slds-grid--align-spread">
                                                    <span class="slds-truncate"
                                                        title="{!item.Department_Cateogy__c}">{!item.Name}</span>
                                                </span>
                                            </td>
                                            <td role="gridcell" class="slds-cell-edit">
                                                <span class="slds-grid slds-grid--align-spread">
                                                    <span class="slds-truncate"
                                                        title="{!item.Agency_Hospital__r.Name}">{!item.Agency_Hospital__r.Name}</span>
                                                </span>
                                            </td>
                                            <td role="gridcell" class="slds-cell-edit">
                                                <span class="slds-grid slds-grid--align-spread">
                                                    <span class="slds-truncate"
                                                        title="{!item.Department_Cateogy__c}">{!item.Department_Cateogy__c}</span>
                                                </span>
                                            </td>
                                            <td role="gridcell" class="slds-cell-edit">
                                                <span class="slds-grid slds-grid--align-spread">
                                                    <span class="slds-truncate"
                                                        title="{!item.doctor2__r.Name}">{!item.doctor2__r.Name}</span>
                                                </span>
                                            </td>
                                            <td role="gridcell" class="slds-cell-edit">
                                                <span class="slds-grid slds-grid--align-spread">
                                                    <span class="slds-truncate"
                                                        title="{!item.visitor_title__c}">{!item.visitor_title__c}</span>
                                                </span>
                                            </td>
                                            <td role="gridcell" class="slds-cell-edit">
                                                <span class="slds-grid slds-grid--align-spread">
                                                    <span class="slds-truncate"
                                                        title="{!item.WorkRecord__c}">{!item.WorkRecord__c}</span>
                                                </span>
                                            </td>
                                        </tr>
                                    </aura:iteration>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </aura:renderIf>
            </div>
        </div>
    </div>
    <div aura:id="modal_bg" class="disp_none slds-backdrop slds-backdrop--open"></div>
    <div aura:id="modal_confirm" role="dialog" tabindex="-2" aria-labelledby="header43"
        class="disp_none slds-modal slds-fade-in-open">
        <div class="slds-modal__container">
            <div class="slds-modal__header">
                <h2 id="header43" class="slds-text-heading--medium">{!v.modal_confirm_title}</h2>
            </div>
            <div class="slds-modal__content slds-p-around--medium">
                <p>{!v.modal_confirm_text}</p>
            </div>
            <div class="slds-modal__footer">
                <ui:button label="是" class="slds-button slds-button--brand" press="{!c.yes_button}" />
                <ui:button label="否" class="slds-button slds-button--neutral" press="{!c.no_button}" />
            </div>
        </div>
    </div>
    <div aura:id="modal_confirm_bg" class="disp_none slds-backdrop slds-backdrop--open"></div>
    <div aura:id="modal_newAC" role="dialog" tabindex="-3" aria-labelledby="headertest"
        class="disp_none slds-modal slds-fade-in-open">
        <div class="slds-modal__container">
            <div class="slds-modal__header">
                <h2 id="headertest" class="slds-text-heading--medium">新建.客户人员</h2>
            </div>
            <div class="slds-modal__content slds-p-around--medium">
                <lightning:recordEditForm aura:id="recordEditForm" objectApiName="Agency_Contact__c"
                    onsuccess="{!c.handleSuccess}" onload="{!c.showRequiredFields}" onsubmit="{!c.handleSubmit}">
                    <lightning:messages aura:id="OppMessage" />
                    <!-- onload="{!c.showRequiredFields}" -->
                    <aura:renderIf isTrue="{!v.truthy}">
                        <lightning:inputField fieldName="Name" aura:id="newOpportunityField" />
                        <lightning:inputField fieldName="Type__c" aura:id="newOpportunityField" />
                        <lightning:inputField fieldName="Doctor_Division1__c" aura:id="newOpportunityField" />
                    </aura:renderIf>
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <div class="save_button_area">
                        <lightning:button class="slds-m-top_small" type="button" label="取消"
                            onclick="{!c.createCancel}" />
                        <lightning:button class="slds-m-top_small" type="button" label="新建"
                            onclick="{!c.handleSubmit}" />
                    </div>
                </lightning:recordEditForm>
            </div>
        </div>
    </div>
</aura:component>
  </div>
</aura:component>
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js
@@ -1,242 +1,389 @@
({
    doInit : function(component, event, helper) {
            helper.doinit(component, event, helper);
    },
  doInit: function (component, event, helper) {
    helper.doinit(component, event, helper);
    component.set("v.errorColumns", [
      {
        label: "错误行",
        fieldName: "errorRow",
        type: "text",
        hideDefaultActions: true,
        initialWidth: 100
      },
      {
        label: "错误信息",
        fieldName: "errorInfo",
        type: "text",
        hideDefaultActions: true
      }
    ]);
  },
    createAopp : function(component, event, helper) {
        var addRecordEvent = $A.get('e.force:createRecord');
        addRecordEvent.setParams({
            entityApiName: 'Agency_Opportunity__c',
            recordTypeId: '012100000006KW7'
        });
        addRecordEvent.fire();
    },
    new_report : function(component, event, helper) {
        component.find('save_button').set('v.label', '保存并新建');
        helper.new_report(component, event, helper);
    },
    copy_button : function(component, event, helper) {
        component.find('save_button').set('v.label', '保存并新建');
        helper.copy_button(component, event, helper);
    },
    change_report_radio : function(component, event, helper) {
        helper.change_report_radio(component, event, helper);
    },
    edit_button : function(component, event, helper) {
        component.find('save_button').set('v.label', '保存');
        helper.edit_button(component, event, helper);
    },
    createCon : function(component, event, helper) {
        helper.createCon(component, event, helper);
    },
  createAopp: function (component, event, helper) {
    var addRecordEvent = $A.get("e.force:createRecord");
    addRecordEvent.setParams({
      entityApiName: "Agency_Opportunity__c",
      recordTypeId: "012100000006KW7"
    });
    addRecordEvent.fire();
  },
    showRequiredFields: function(component, event, helper){
        $A.util.removeClass(component.find("newOpportunityField"), "none");
        $A.util.removeClass(component.find("newOpportunityField"), "none");
    },
    handleSuccess : function(component, event, helper) {
        helper.handleSuccess(component, event, helper);
    },
    handleSubmit : function(component, event, helper) {
        event.preventDefault(); // stop form submission
        var showValidationError = false;
        var fields = component.find("newOpportunityField");
        var vaildationFailReason = '';
        fields.forEach(function (field) {
            if(field.get("v.fieldName") === 'Type__c' && $A.util.isEmpty(field.get("v.value"))){
                showValidationError = true;
                vaildationFailReason = "分类不能为空!";
            }else if(field.get("v.fieldName") === 'Doctor_Division1__c' && $A.util.isEmpty(field.get("v.value"))){
                showValidationError = true;
                if(vaildationFailReason != ''){
                    vaildationFailReason += "医生区分(职务)不能为空!";
                }else{
                    vaildationFailReason = "医生区分(职务)不能为空!";
                }
            }
        });
        if (!showValidationError) {
            helper.newlyBuild(component, event, helper);
        }else{
            component.find('OppMessage').setError(vaildationFailReason);
  new_report: function (component, event, helper) {
    component.find("save_button").set("v.label", "保存并新建");
    helper.new_report(component, event, helper);
  },
  copy_button: function (component, event, helper) {
    component.find("save_button").set("v.label", "保存并新建");
    helper.copy_button(component, event, helper);
  },
  delete_button: function (component, event, helper) {
    helper.delete_button(component, event, helper);
  },
  change_report_radio: function (component, event, helper) {
    helper.change_report_radio(component, event, helper);
  },
  edit_button: function (component, event, helper) {
    component.find("save_button").set("v.label", "保存");
    helper.edit_button(component, event, helper);
  },
  createCon: function (component, event, helper) {
    helper.createCon(component, event, helper);
  },
  showRequiredFields: function (component, event, helper) {
    $A.util.removeClass(component.find("newOpportunityField"), "none");
    $A.util.removeClass(component.find("newOpportunityField"), "none");
  },
  handleSuccess: function (component, event, helper) {
    helper.handleSuccess(component, event, helper);
  },
  handleSubmit: function (component, event, helper) {
    event.preventDefault(); // stop form submission
    var showValidationError = false;
    var fields = component.find("newOpportunityField");
    var vaildationFailReason = "";
    let agencyReport = Object.create(null);
    fields.forEach(function (field) {
      if (
        field.get("v.fieldName") === "Type__c" &&
        $A.util.isEmpty(field.get("v.value"))
      ) {
        showValidationError = true;
        vaildationFailReason = "分类不能为空!";
      } else if (
        field.get("v.fieldName") === "Doctor_Division1__c" &&
        $A.util.isEmpty(field.get("v.value"))
      ) {
        showValidationError = true;
        if (vaildationFailReason != "") {
          vaildationFailReason += "医生区分(职务)不能为空!";
        } else {
          vaildationFailReason = "医生区分(职务)不能为空!";
        }
    },
    createCancel : function(component, event, helper) {
        helper.createCancel(component, event, helper);
    },
    yes_button : function(component, event, helper) {
        component.set('v.confirm_status', 1);
        helper.close_confirm(component, component.get('v.modal_confirm_title'), component.get('v.modal_confirm_text'));
    },
      }
      //SWAG-CF58C3 fy start
      if (field.get("v.fieldName") === "Name") {
        agencyReport["name"] = field.get("v.value");
      } else if (field.get("v.fieldName") === "Type__c") {
        agencyReport["type"] = field.get("v.value");
      } else if (field.get("v.fieldName") === "Doctor_Division1__c") {
        agencyReport["doctorDivision1"] = field.get("v.value");
      }
      //SWAG-CF58C3 fy end
    });
    if (!showValidationError) {
      //SWAG-CF58C3 fy start
      var agencyHospitalid = component.get("v.hospitalLinkId");
      //zhj MEBG新方案改造 2022-11-29 start
      debugger;
      let hospitalName = "";
      //调用后端searchAgencyDataId方法查询出医院下面所有客户人员dataid
      helper.CallBackAction(
        component,
        "searchAgencyDataId",
        {
          hospitalId: agencyHospitalid
        },
        function (data) {
          if (data.getState() == "SUCCESS") {
            var data = data.getReturnValue();
            if (data.IsSuccess == true) {
              let agencyContactIds = "";
              if (data.Message == "" && data.Data && data.Data.length > 0) {
                hospitalName = data.Data[0].Agency_Hospital__r.Name;
                for (var i = 0; i < data.Data.length; i++) {
                  if (data.Data[i].AWS_Data_Id__c)
                    agencyContactIds += "," + data.Data[i].AWS_Data_Id__c;
                }
                agencyContactIds = agencyContactIds.substring(1);
                agencyReport["agencyContactIds"] = agencyContactIds;
              } else {
                agencyReport["agencyContactIds"] = agencyContactIds;
              }
              var arr = new Array();
              arr.push(agencyReport);
              var requestData = JSON.stringify(arr);
              // helper.set_aws_url(component,data,agencyHospitalid);
    no_button : function(component, event, helper) {
        component.set('v.confirm_status', 2);
        helper.close_confirm(component, component.get('v.modal_confirm_title'), component.get('v.modal_confirm_text'));
    },
    toggle_report : function(component, event, helper) {
        helper.toggle_report(component, event, helper);
    },
              var token = component.get("v.AWStoken");
              var newUrl = component.get("v.AWSinsert") + "V2";
    save_report : function(component, event, helper) {
        helper.save_report(component, event, helper);
    },
    select_date_change : function(component, event, helper) {
        helper.select_date_change(component, event, helper);
    },
    select_agency_change : function(component, event, helper) {
        helper.select_agency_change(component, event, helper);
    },
    hosChange : function(component, event, helper) {
        var hospital_name = event.getParam("value");
        if (hospital_name.match(/(\S+\s)+/)) {
            helper.searchHos(component, event, helper);
        } else {
            helper.hideSearch(component, event, helper);
        }
    },
    selectHos : function(component, event, helper) {
        helper.selectHos(component, event, helper);
        helper.setOpportunity_cfilter(component);
    },
    //使用产品1
    UseProduct1Change : function(component, event, helper) {
        var UseProduct1Name = event.getParam("value");
        if (UseProduct1Name.match(/(\S+\s)+/)) {
            helper.searchUseProduct1(component, event, helper);
        } else {
            helper.hideSearchUseProduct1(component, event, helper);
        }
    },
    seletUseProduct1Change : function(component, event, helper) {
        helper.seletUseProduct1Change(component, event, helper);
    },
     //使用产品2
    UseProduct2Change : function(component, event, helper) {
        var UseProduct2Name = event.getParam("value");
        if (UseProduct2Name.match(/(\S+\s)+/)) {
            helper.searchUseProduct2(component, event, helper);
        } else {
            helper.hideSearchUseProduct2(component, event, helper);
        }
    },
    seletUseProduct2Change : function(component, event, helper) {
        helper.seletUseProduct2Change(component, event, helper);
    },
    productcategoryChange2 : function(component, event, helper) {
        helper.productcategoryChange2(component, event, helper);
    },
    //使用产品3
    UseProduct3Change : function(component, event, helper) {
        var UseProduct3Name = event.getParam("value");
        if (UseProduct3Name.match(/(\S+\s)+/)) {
            helper.searchUseProduct3(component, event, helper);
        } else {
            helper.hideSearchUseProduct3(component, event, helper);
        }
    },
    seletUseProduct3Change : function(component, event, helper) {
        helper.seletUseProduct3Change(component, event, helper);
    },
    select_department : function(component, event, helper) {
        helper.setOpportunity_cfilter(component);
    },
    doctor_change : function(component, event, helper) {
        helper.doctor_change(component, event, helper);
    },
    stageNameChange : function(component, event, helper) {
        helper.stageNameChange(component, event, helper);
    },
    onDragOver : function(component, event, helper) {
        event.preventDefault();
    },
    onDrop : function(component, event, helper) {
        event.stopPropagation();
        event.preventDefault();
        event.dataTransfer.dropEffect='copy';
        var files=event.dataTransfer.files;
        helper.readFile(component,helper,files[0]);
    },
    CreateRecord : function(component, event, helper){
        var files = event.getSource().get("v.files");
        helper.readFile(component,helper,files[0]);
    },
    processFileContent : function(component,event,helper){
        helper.saveRecords(component,event,helper);
    },
    cancel : function(component,event,helper){
        component.set("v.showMain",true);
    },
    import : function(component,event,helper){
        helper.showImport(component);
    },
    exportDate : function(component,event,helper){
        var stockData = component.get("v.reports_date");
        console.log('导出数据'+stockData);
        var csv = helper.convertArrayOfObjectsToCSV(component,stockData);
        if (csv == null){return;}
        var universalBOM = "\uFEFF";
        var hiddenElement = document.createElement('a');
        hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(universalBOM+csv);
        hiddenElement.target = '_self'; //
        hiddenElement.download = 'ExportData.csv';  // CSV file Name* you can change it.[only name not .csv]
        document.body.appendChild(hiddenElement); // Required for FireFox browser
        hiddenElement.click(); // using click() js function to download csv file
    },
    export_condition : function(component,event,helper){
        helper.showExport(component);
    },
    select_repores_date : function(component,event,helper){
        helper.select_repores_date(component,event,helper);
    },
    export : function(component,event,helper){
        console.log('进入export');
        var stockData = component.get("v.reports_date");
        console.log('查出的数据'+stockData);
    },
    close_import : function(component,event,helper){
        component.set("v.showMain",true);
        helper.close_import(component);
    },
    close_export : function(component,event,helper){
        component.set("v.showMain",true);
        helper.close_export(component);
    },
    select_ConsumptionOfConsumables : function(component,event,helper){
        helper.select_ConsumptionOfConsumables(component,event,helper);
    },
    select_purpose_type : function(component,event,helper){
        helper.selectPurposeType(component,event,helper);
    },
    select_warlocksNumber : function(component,event,helper){
        helper.select_warlocksNumber(component,event,helper);
    },
    selectProductClassification : function(component,event,helper){
        helper.selectProductClassification(component,event,helper);
    },
    selectpurposetype : function(component,event,helper){
        helper.selectpurposetype(component,event,helper);
              component.set("v.login", true);
              helper.insert_agencycontact(
                component,
                token,
                newUrl,
                requestData,
                agencyHospitalid,
                helper,
                hospitalName
              );
            } else {
              helper.ShowToast({
                message: data.message,
                type: "error"
              });
            }
          } else {
            helper.ShowToast({
              message: "searchAgency失败",
              type: "error"
            });
          }
        }
      );
      //zhj MEBG新方案改造 2022-11-29 end
      // var arr = new Array();
      // arr.push(agencyReport);
      // var data = JSON.stringify(arr);
      // var token = component.get('v.AWStoken');
      // var newUrl = component.get('v.AWSinsert');
      // component.set('v.login',true);
      // helper.insert_agencycontact(component,token,newUrl,data,agencyHospitalid,helper);
      //SWAG-CF58C3 fy end
      // helper.newlyBuild(component, event, helper);
    } else {
      component.find("OppMessage").setError(vaildationFailReason);
    }
})
  },
  createCancel: function (component, event, helper) {
    helper.createCancel(component, event, helper);
  },
  yes_button: function (component, event, helper) {
    component.set("v.confirm_status", 1);
    helper.close_confirm(
      component,
      component.get("v.modal_confirm_title"),
      component.get("v.modal_confirm_text")
    );
  },
  no_button: function (component, event, helper) {
    component.set("v.confirm_status", 2);
    helper.close_confirm(
      component,
      component.get("v.modal_confirm_title"),
      component.get("v.modal_confirm_text")
    );
  },
  toggle_report: function (component, event, helper) {
    helper.toggle_report(component, event, helper);
  },
  save_report: function (component, event, helper) {
    helper.save_report(component, event, helper);
  },
  select_date_change: function (component, event, helper) {
    helper.select_date_change(component, event, helper);
  },
  select_agency_change: function (component, event, helper) {
    debugger;
    helper.select_agency_change(component, event, helper);
  },
  hosChange: function (component, event, helper) {
    var hospital_name = event.getParam("value");
    var hospital_nameld = component.get("v.UseProduct1s");
    if (hospital_name.match(/(\S+\s)+/)) {
      if (hospital_nameld != hospital_name) {
        helper.searchHos(component, event, helper);
      }
    } else {
      if (hospital_name == "") {
        helper.hideSearchs(component, event, helper);
      } else {
        helper.hideSearch(component, event, helper);
      }
    }
  },
  selectHos: function (component, event, helper) {
    helper.selectHos(component, event, helper);
    helper.setOpportunity_cfilter(component);
  },
  //使用产品1
  UseProduct1Change: function (component, event, helper) {
    var UseProduct1Name = event.getParam("value");
    var UseProduct1Nameold = component.get("v.UseProduct1s");
    debugger;
    if (UseProduct1Name.match(/(\S+\s)+/)) {
      if (UseProduct1Name != UseProduct1Nameold) {
        helper.searchUseProduct1(component, event, helper);
      }
    } else {
      if (UseProduct1Name == "") {
        helper.hideSearchUseProduct1s(component, event, helper);
      } else {
        helper.hideSearchUseProduct1(component, event, helper);
      }
    }
  },
  seletUseProduct1Change: function (component, event, helper) {
    helper.seletUseProduct1Change(component, event, helper);
  },
  //使用产品2
  UseProduct2Change: function (component, event, helper) {
    var UseProduct2Name = event.getParam("value");
    var UseProduct2Nameold = component.get("v.UseProduct2s");
    if (UseProduct2Name.match(/(\S+\s)+/)) {
      if (UseProduct2Name != UseProduct2Nameold) {
        helper.searchUseProduct2(component, event, helper);
      }
    } else {
      if (UseProduct2Name == "") {
        helper.hideSearchUseProduct2s(component, event, helper);
      } else {
        helper.hideSearchUseProduct2(component, event, helper);
      }
    }
  },
  seletUseProduct2Change: function (component, event, helper) {
    helper.seletUseProduct2Change(component, event, helper);
  },
  productcategoryChange2: function (component, event, helper) {
    helper.productcategoryChange2(component, event, helper);
  },
  //使用产品3
  UseProduct3Change: function (component, event, helper) {
    var UseProduct3Name = event.getParam("value");
    var UseProduct3Nameold = component.get("v.UseProduct3s");
    if (UseProduct3Name.match(/(\S+\s)+/)) {
      if (UseProduct3Name != UseProduct3Nameold) {
        helper.searchUseProduct3(component, event, helper);
      }
    } else {
      if (UseProduct3Name == "") {
        helper.hideSearchUseProduct3s(component, event, helper);
      } else {
        helper.hideSearchUseProduct3(component, event, helper);
      }
    }
  },
  seletUseProduct3Change: function (component, event, helper) {
    helper.seletUseProduct3Change(component, event, helper);
  },
  select_department: function (component, event, helper) {
    helper.setOpportunity_cfilter(component);
  },
  doctor_change: function (component, event, helper) {
    helper.doctor_change(component, event, helper);
  },
  stageNameChange: function (component, event, helper) {
    helper.stageNameChange(component, event, helper);
  },
  onDragOver: function (component, event, helper) {
    event.preventDefault();
  },
  onDrop: function (component, event, helper) {
    event.stopPropagation();
    event.preventDefault();
    event.dataTransfer.dropEffect = "copy";
    var files = event.dataTransfer.files;
    helper.readFile(component, helper, files[0]);
  },
  CreateRecord: function (component, event, helper) {
    var files = event.getSource().get("v.files");
    helper.readFile(component, helper, files[0]);
  },
  processFileContent: function (component, event, helper) {
    helper.saveRecords(component, event, helper);
    component.set("v.showErrorInfo", false);
  },
  cancel: function (component, event, helper) {
    component.set("v.showMain", true);
  },
  import: function (component, event, helper) {
    helper.showImport(component);
  },
  exportDate: function (component, event, helper) {
    var stockData = component.get("v.reports_date");
    console.log("导出数据" + stockData);
    var csv = helper.convertArrayOfObjectsToCSV(component, stockData);
    if (csv == null) {
      return;
    }
    var universalBOM = "\uFEFF";
    var hiddenElement = document.createElement("a");
    hiddenElement.href =
      "data:text/csv;charset=utf-8," + encodeURI(universalBOM + csv);
    hiddenElement.target = "_self"; //
    hiddenElement.download = "ExportData.csv"; // CSV file Name* you can change it.[only name not .csv]
    document.body.appendChild(hiddenElement); // Required for FireFox browser
    hiddenElement.click(); // using click() js function to download csv file
  },
  export_condition: function (component, event, helper) {
    helper.showExport(component);
  },
  select_repores_date: function (component, event, helper) {
    helper.select_repores_date(component, event, helper);
  },
  export: function (component, event, helper) {
    console.log("进入export");
    var stockData = component.get("v.reports_date");
    console.log("查出的数据" + stockData);
  },
  close_import: function (component, event, helper) {
    component.set("v.showMain", true);
    helper.close_import(component);
  },
  close_export: function (component, event, helper) {
    component.set("v.showMain", true);
    helper.close_export(component);
  },
  select_ConsumptionOfConsumables: function (component, event, helper) {
    helper.select_ConsumptionOfConsumables(component, event, helper);
  },
  select_purpose_type: function (component, event, helper) {
    helper.selectPurposeType(component, event, helper);
  },
  select_warlocksNumber: function (component, event, helper) {
    helper.select_warlocksNumber(component, event, helper);
  },
  selectProductClassification: function (component, event, helper) {
    helper.selectProductClassification(component, event, helper);
  },
  selectpurposetype: function (component, event, helper) {
    helper.selectpurposetype(component, event, helper);
  },
  return_main_page: function (component, event, helper) {
    window.open("/customer/", "_self");
  },
  exportErrorInfo: function (component, event, helper) {
    helper.exportErrorInfoHelper(component);
  }
});
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js
Diff too large
force-app/main/default/classes/ArriveGoodsController.cls
Diff too large
force-app/main/default/classes/ArriveGoodsControllerTest.cls
Diff too large
force-app/main/default/classes/LexArriveGoodsController.cls
New file
@@ -0,0 +1,356 @@
public without sharing class LexArriveGoodsController {
  //初始化
  @AuraEnabled
  public static Results init(String arrType, String eSetId) {
    Results results = new Results();
    results.isNoteStay = LexUtility.getIsNoteStay();
    try {
      ArriveGoodsController arrController = new ArriveGoodsController(
        eSetId,
        arrType
      );
      arrController.isLwc = true;
      arrController.init();
      results.arrGoodCon = JSON.serialize(arrController);
      results.coc = arrController.coc;
      results.saveFLGbln = arrController.saveFLGbln;
      results.returnFLGbln = arrController.ReturnFLGbln;
      results.result = 'Success';
    } catch (Exception e) {
      results.result = 'Fail';
      results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
    }
    return results;
  }
  //搜索产品
  @AuraEnabled
  public static Results searchProduct(String barcode, String arrControllerStr) {
    Results results = new Results();
    try {
      System.debug('arrControllerStr:' + arrControllerStr);
      ArriveGoodsController arrController = (ArriveGoodsController) JSON.deserialize(
        arrControllerStr,
        ArriveGoodsController.class
      );
      arrController.barcode = barcode;
      arrController.returnError = null;
      arrController.warningList = new List<String>();
      arrController.errorList = new List<String>();
      arrController.SearchPro();
      results.arrGoodCon = JSON.serialize(arrController);
      if (
        arrController.returnError != null &&
        arrController.returnError != ''
      ) {
        results.result = 'Fail';
        results.errorMsgList = arrController.errorList;
        results.warningMsgList = arrController.warningList;
        results.errorMsg = arrController.returnError;
      } else {
        results.coc = arrController.coc;
        results.saveFLGbln = arrController.saveFLGbln;
        results.returnFLGbln = arrController.ReturnFLGbln;
        results.detailsSummary = changeType1(arrController.detailsSummary);
        results.consumableorderdetailsRecords = changeType1(
          arrController.ConsumableorderdetailsRecords
        );
        results.showGoodsofReturnList = changeType1(
          arrController.ShowGoodsofReturnList
        );
        results.consumableInventory = changeType1(
          arrController.consumableInventory
        );
        results.consumableorderdetailsRecordserror = changeType1(
          arrController.ConsumableorderdetailsRecordserror
        );
        results.errorMsgList = arrController.errorList;
        results.warningMsgList = arrController.warningList;
        results.result = 'Success';
      }
    } catch (Exception e) {
      results.result = 'Fail';
      results.errorMsg =
        e.getLineNumber() +
        '---' +
        e.getMessage() +
        '---' +
        e.getStackTraceString();
    }
    return results;
  }
  //到货确认
  @AuraEnabled
  public static Results arriveGoodsConfim(String arrControllerStr) {
    Results results = new Results();
    try {
      ArriveGoodsController arrController = (ArriveGoodsController) JSON.deserialize(
        arrControllerStr,
        ArriveGoodsController.class
      );
      arrController.returnError = null;
      arrController.warningList = new List<String>();
      arrController.errorList = new List<String>();
      Pagereference page = arrController.ArriveGoodsConfim();
      results.arrGoodCon = JSON.serialize(arrController);
      if (
        arrController.returnError != null &&
        arrController.returnError != ''
      ) {
        results.result = 'Fail';
        results.errorMsgList = arrController.errorList;
        results.warningMsgList = arrController.warningList;
        results.errorMsg = arrController.returnError;
      } else {
        if (arrController.urlType == 'UnabletoEdit') {
          results.url = '/lexarrivegsdetails?EsetId=' + arrController.arriveId;
        }
        results.errorMsgList = arrController.errorList;
        results.warningMsgList = arrController.warningList;
        results.result = 'Success';
      }
    } catch (Exception e) {
      results.result = 'Fail';
      results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
    }
    return results;
  }
  //登录返品
  @AuraEnabled
  public static Results updateGoodsOfReturn(
    String arrControllerStr,
    String showGoodsofReturnListStr
  ) {
    Results results = new Results();
    try {
      List<ConsumableorderdetailsInfo> showGoodsofReturnList = (List<ConsumableorderdetailsInfo>) JSON.deserialize(
        showGoodsofReturnListStr,
        List<ConsumableorderdetailsInfo>.class
      );
      ArriveGoodsController arrController = (ArriveGoodsController) JSON.deserialize(
        arrControllerStr,
        ArriveGoodsController.class
      );
      arrController.ShowGoodsofReturnList = changeType2(showGoodsofReturnList);
      arrController.returnError = null;
      arrController.warningList = new List<String>();
      arrController.errorList = new List<String>();
      Pagereference page = arrController.UpdateGoodsOfReturn();
      results.arrGoodCon = JSON.serialize(arrController);
      if (
        arrController.returnError != null &&
        arrController.returnError != ''
      ) {
        results.result = 'Fail';
        results.errorMsgList = arrController.errorList;
        results.warningMsgList = arrController.warningList;
        results.errorMsg = arrController.returnError;
      } else {
        if (arrController.urlType == 'ToReturnGoodsPage') {
          results.url = '/detail/' + arrController.return_Order_id;
        }
        if (arrController.urlType == 'ToInventoryGoodsPage') {
          results.url = '/detail/' + arrController.inventory_Order_id;
        }
        results.errorMsgList = arrController.errorList;
        results.warningMsgList = arrController.warningList;
        results.result = 'Success';
      }
    } catch (Exception e) {
      results.result = 'Fail';
      results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
    }
    return results;
  }
  public static List<ConsumableorderdetailsInfo> changeType1(
    List<ArriveGoodsController.ConsumableorderdetailsInfo> conList
  ) {
    List<ConsumableorderdetailsInfo> conList1 = new List<ConsumableorderdetailsInfo>();
    if (conList != null) {
      for (ArriveGoodsController.ConsumableorderdetailsInfo con : conList) {
        ConsumableorderdetailsInfo con1 = new ConsumableorderdetailsInfo();
        con1.esd = con.esd;
        con1.Prod = con.Prod;
        con1.ProductName = con.ProductName;
        con1.barCodeNo = con.barCodeNo;
        con1.sterilizationlimitDate = con.sterilizationlimitDate;
        con1.serialNoorLotNo = con.serialNoorLotNo;
        con1.tracingCodeNo = con.tracingCodeNo;
        con1.ReturnReason = con.ReturnReason;
        con1.oldConsumableCount = con.oldConsumableCount;
        con1.ErrorReason = con.ErrorReason;
        con1.canEdit = con.canEdit;
        con1.intMark = con.intMark;
        con1.arriveAmount = con.arriveAmount;
        con1.arrivedCount = con.arrivedCount;
        con1.ReportProductExpirationDate = con.ReportProductExpirationDate;
        conList1.add(con1);
      }
    }
    return conList1;
  }
  public static List<ArriveGoodsController.ConsumableorderdetailsInfo> changeType2(
    List<ConsumableorderdetailsInfo> conList
  ) {
    List<ArriveGoodsController.ConsumableorderdetailsInfo> conList1 = new List<ArriveGoodsController.ConsumableorderdetailsInfo>();
    if (conList != null) {
      for (ConsumableorderdetailsInfo con : conList) {
        ArriveGoodsController.ConsumableorderdetailsInfo con1 = new ArriveGoodsController.ConsumableorderdetailsInfo();
        con1.esd = con.esd;
        con1.Prod = con.Prod;
        con1.ProductName = con.ProductName;
        con1.barCodeNo = con.barCodeNo;
        con1.sterilizationlimitDate = con.sterilizationlimitDate;
        con1.serialNoorLotNo = con.serialNoorLotNo;
        con1.tracingCodeNo = con.tracingCodeNo;
        con1.ReturnReason = con.ReturnReason;
        con1.oldConsumableCount = con.oldConsumableCount;
        con1.ErrorReason = con.ErrorReason;
        con1.canEdit = con.canEdit;
        con1.intMark = con.intMark;
        con1.arriveAmount = con.arriveAmount;
        con1.arrivedCount = con.arrivedCount;
        con1.ReportProductExpirationDate = con.ReportProductExpirationDate;
        conList1.add(con1);
      }
    }
    return conList1;
  }
  public class Results {
    @AuraEnabled
    public String result;
    @AuraEnabled
    public String errorMsg;
    @AuraEnabled
    public String url;
    @AuraEnabled
    public String arrGoodCon;
    @AuraEnabled
    public Consumable_order__c coc;
    @AuraEnabled
    public Boolean returnFLGbln;
    @AuraEnabled
    public Boolean saveFLGbln;
    @AuraEnabled
    public List<ConsumableorderdetailsInfo> detailsSummary;
    @AuraEnabled
    public List<ConsumableorderdetailsInfo> consumableorderdetailsRecords;
    @AuraEnabled
    public List<ConsumableorderdetailsInfo> showGoodsofReturnList;
    @AuraEnabled
    public List<ConsumableorderdetailsInfo> consumableInventory;
    @AuraEnabled
    public List<ConsumableorderdetailsInfo> consumableorderdetailsRecordserror;
    @AuraEnabled
    public List<String> errorMsgList;
    @AuraEnabled
    public List<String> warningMsgList;
    @AuraEnabled
    public Boolean isNoteStay;
  }
  public class ConsumableorderdetailsInfo implements Comparable {
    @AuraEnabled
    public Consumable_order_details2__c esd { get; set; }
    @AuraEnabled
    public Product2__c Prod { get; set; }
    @AuraEnabled
    public String ProductName { get; set; }
    @AuraEnabled
    public String barCodeNo { get; set; }
    @AuraEnabled
    public Date sterilizationlimitDate { get; set; }
    @AuraEnabled
    public String serialNoorLotNo { get; set; }
    @AuraEnabled
    public String tracingCodeNo { get; set; }
    @AuraEnabled
    public String ReturnReason { get; set; }
    @AuraEnabled
    public String oldConsumableCount { get; set; }
    @AuraEnabled
    public String ErrorReason { get; set; }
    @AuraEnabled
    public boolean canEdit { get; set; }
    @AuraEnabled
    public Integer intMark { get; set; }
    @AuraEnabled
    public Decimal arriveAmount { get; set; }
    @AuraEnabled
    public Decimal arrivedCount { get; set; }
    @AuraEnabled
    public String ReportProductExpirationDate { get; set; }
    public ConsumableorderdetailsInfo() {
    }
    public ConsumableorderdetailsInfo(
      Consumable_order_details2__c e,
      string str
    ) {
      esd = e;
      Prod = e.Consumable_Product__r;
      oldConsumableCount = e.name;
      ErrorReason = str;
      intMark = 1;
      if (e.Report_Product_Expiration__c != null) {
        ReportProductExpirationDate = e.Report_Product_Expiration__c.format();
      }
    }
    public ConsumableorderdetailsInfo(Consumable_order_details2__c e) {
      canEdit = false;
      if (e.Box_Piece__c == '盒') {
        e.Rrturn_count__c = 1;
        canEdit = true;
      }
      esd = e;
      Prod = e.Consumable_Product__r;
      oldConsumableCount = e.name;
      if (e.Report_Product_Expiration__c != null) {
        ReportProductExpirationDate = e.Report_Product_Expiration__c.format();
      }
    }
    public ConsumableorderdetailsInfo(Product2__c e, List<String> barinfoL) {
      esd = new Consumable_order_details2__c();
      ProductName = e.Name__c;
      Prod = e;
      barCodeNo = barinfoL[0];
      if (String.isNotBlank(barinfoL[1])) {
        sterilizationlimitDate = Date.valueOf(barinfoL[1]);
      }
      serialNoorLotNo = barinfoL[2];
      tracingCodeNo = barinfoL[3];
      ReturnReason = '';
    }
    public ConsumableorderdetailsInfo(
      Consumable_order_details2__c e,
      List<String> barinfoL
    ) {
      esd = e;
      Prod = e.Consumable_Product__r;
      barCodeNo = barinfoL[0];
      if (String.isNotBlank(barinfoL[1])) {
        sterilizationlimitDate = Date.valueOf(barinfoL[1]);
      }
      serialNoorLotNo = barinfoL[2];
      tracingCodeNo = barinfoL[3];
      if (e.Report_Product_Expiration__c != null) {
        ReportProductExpirationDate = e.Report_Product_Expiration__c.format();
      }
    }
    public ConsumableorderdetailsInfo(Product2__c e) {
      Prod = e;
    }
    // 排序
    public Integer compareTo(Object compareTo) {
      return null;
    }
  }
}
force-app/main/default/classes/LexArriveGoodsController.cls-meta.xml
New file
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>56.0</apiVersion>
    <status>Active</status>
</ApexClass>
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.css
New file
@@ -0,0 +1 @@
@import "c/lexCssUtility";
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html
New file
@@ -0,0 +1,380 @@
<template>
  <template if:true={showSpinner}>
    <lightning-spinner size="medium" variant="brand"></lightning-spinner>
  </template>
  <c-common-toast></c-common-toast>
  <template if:true={showPage}>
    <div
      style="
        border: 1px solid #d4d4d4;
        border-top: 3px solid #51606e;
        border-radius: 5px;
      "
    >
      <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
        <lightning-layout>
          <lightning-layout-item padding="around-small">
            <p style="font-size: 18px">
              <strong>入库/返品</strong>
            </p>
          </lightning-layout-item>
        </lightning-layout>
        <!-- <p style="font-size: 16px;"><strong>入库/返品</strong></p> -->
      </div>
      <div style="padding: 10px">
        <!-- 按钮 -->
        <template if:false={returnFLGbln}>
          <!-- <lightning-button style="margin: 5px;" label="到货确认" onclick={arriveGoodsConfim} disabled={saveFLGbln}></lightning-button> -->
          <button
            class="slds-button slds-button_neutral slds-button_stretch lexBorder"
            style="margin: 5px"
            label="到货确认"
            onclick={arriveGoodsConfim}
            disabled={saveFLGbln}
          >
            到货确认
          </button>
        </template>
        <template if:true={returnFLGbln}>
          <!-- <lightning-button style="margin: 5px;" label="登录返品" onclick={updateGoodsOfReturn}></lightning-button> -->
          <button
            class="slds-button slds-button_neutral slds-button_stretch lexBorder"
            style="margin: 5px"
            label="登录返品"
            onclick={updateGoodsOfReturn}
          >
            登录返品
          </button>
        </template>
        <p style="height: 10px"></p>
        <!-- 订单信息 -->
        <template if:true={showOrderDetail}>
          <div
            style="
              border: 1px solid #d4d4d4;
              border-top: 3px solid #51606e;
              border-radius: 5px;
              margin-bottom: 7px;
            "
          >
            <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
              <lightning-layout>
                <lightning-layout-item padding="around-small">
                  <p style="font-size: 18px">
                    <strong>订单信息</strong>
                  </p>
                </lightning-layout-item>
              </lightning-layout>
              <!-- <p style="font-size: 16px;"><strong>订单信息</strong></p> -->
            </div>
            <div style="padding: 10px">
              <table>
                <tbody>
                  <tr>
                    <td style="width: 10px"></td>
                    <td style="width: 60px">
                      <div style="color: #696969; font-size: 12px">
                        订单名称
                      </div>
                    </td>
                    <td style="width: 200px">
                      <lightning-formatted-text
                        value={coc.Name}
                      ></lightning-formatted-text>
                    </td>
                    <td style="width: 30px"></td>
                    <td style="width: 60px">
                      <div style="color: #696969; font-size: 12px">
                        订单总数
                      </div>
                    </td>
                    <td style="width: 100px">
                      <lightning-formatted-number
                        value={coc.Total_num__c}
                      ></lightning-formatted-number>
                    </td>
                    <td style="width: 30px"></td>
                    <td style="width: 72px">
                      <div style="color: #696969; font-size: 12px">
                        已到货数量
                      </div>
                    </td>
                    <td style="width: 100px">
                      <lightning-formatted-number
                        value={coc.OrderNumber_arrived__c}
                      ></lightning-formatted-number>
                    </td>
                    <td style="width: 30px"></td>
                    <td style="width: 84px">
                      <div style="color: #696969; font-size: 12px">
                        还没发货数量
                      </div>
                    </td>
                    <td style="width: 100px">
                      <lightning-formatted-number
                        value={coc.OrderNumber_notarrive__c}
                      ></lightning-formatted-number>
                    </td>
                    <td></td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
        </template>
        <!-- BarCode录入 -->
        <div
          style="
            border: 1px solid #d4d4d4;
            border-top: 3px solid #51606e;
            border-radius: 5px;
            margin-bottom: 7px;
          "
        >
          <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
            <lightning-layout>
              <lightning-layout-item padding="around-small">
                <p style="font-size: 18px">
                  <strong>BarCode录入</strong>
                </p>
              </lightning-layout-item>
            </lightning-layout>
            <!-- <p style="font-size: 16px;"><strong>BarCode录入</strong></p> -->
          </div>
          <div style="padding: 10px">
            <table>
              <tbody>
                <tr>
                  <td style="width: 20px"></td>
                  <td style="width: 60px; font-size: 16px">BarCode</td>
                  <td style="width: 30px"></td>
                  <td style="width: 600px">
                    <lightning-textarea
                      class="inputFont"
                      name="BarCode"
                      value={barcode}
                      label=""
                      variant="label-hidden"
                      onchange={barcodeChange}
                    ></lightning-textarea>
                  </td>
                  <td style="width: 30px"></td>
                  <td style="width: 200px">
                    <!-- <lightning-button label="获取明细" title="获取明细" onclick={barcodeEntrys} style="width: 300px;"></lightning-button> -->
                    <button
                      class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                      label="获取明细"
                      onclick={barcodeEntrys}
                    >
                      获取明细
                    </button>
                  </td>
                  <td></td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
        <!-- 警告提醒 -->
        <template if:true={hasWarning}>
          <div
            style="
              border: 1px solid #d4d4d4;
              border-radius: 5px;
              margin-bottom: 7px;
            "
          >
            <div
              style="
                border-bottom: 1px solid #d4d4d4;
                border-radius: 5px;
                margin-bottom: 7px;
                color: #ff6a00;
                font-size: 17px;
              "
            >
              <lightning-icon icon-name="utility:warning"></lightning-icon>
              <strong>&nbsp;&nbsp;&nbsp;警告</strong>
            </div>
            <template for:each={warningMsgs} for:item="msg">
              <p
                key={msg}
                style="color: #ff6a00; padding-left: 7px; font-size: 14px"
              >
                &nbsp;&nbsp;&nbsp;・&nbsp;{msg}
              </p>
            </template>
          </div>
        </template>
        <!-- 报错提醒 -->
        <template if:true={hasError}>
          <div
            style="
              border: 1px solid #d4d4d4;
              border-radius: 5px;
              margin-bottom: 7px;
            "
          >
            <div
              style="
                border-bottom: 1px solid #d4d4d4;
                border-radius: 5px;
                margin-bottom: 7px;
                color: red;
                font-size: 17px;
              "
            >
              <lightning-icon icon-name="utility:error"></lightning-icon>
              <strong>&nbsp;&nbsp;&nbsp;错误</strong>
            </div>
            <template for:each={errorMsgs} for:item="msg">
              <p
                key={msg}
                style="color: red; padding-left: 7px; font-size: 14px"
              >
                &nbsp;&nbsp;&nbsp;・&nbsp;{msg}
              </p>
            </template>
          </div>
        </template>
        <!-- 本次到货产品汇总 -->
        <template if:false={returnFLGbln}>
          <div
            style="
              border: 1px solid #d4d4d4;
              border-top: 3px solid #51606e;
              border-radius: 5px;
              margin-bottom: 7px;
            "
          >
            <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
              <lightning-layout>
                <lightning-layout-item padding="around-small">
                  <p style="font-size: 18px">
                    <strong>本次到货产品汇总</strong>
                  </p>
                </lightning-layout-item>
              </lightning-layout>
              <!-- <p style="font-size: 16px;"><strong>本次到货产品汇总</strong></p> -->
            </div>
            <div style="padding: 10px">
              <lightning-datatable
                class="wrapped-header-datatable"
                hide-checkbox-column
                key-field="recordId"
                columns={currentArrProdCols}
                data={detailsSummary}
              ></lightning-datatable>
            </div>
          </div>
        </template>
        <!-- 到货明细 -->
        <template if:false={returnFLGbln}>
          <div
            style="
              border: 1px solid #d4d4d4;
              border-top: 3px solid #51606e;
              border-radius: 5px;
              margin-bottom: 7px;
            "
          >
            <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
              <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">
              <lightning-datatable
                class="wrapped-header-datatable"
                hide-checkbox-column
                key-field="recordId"
                columns={arrDetailCols}
                data={consumableorderdetailsRecordsview}
              ></lightning-datatable>
            </div>
          </div>
        </template>
        <!-- 返品明细 -->
        <template if:true={returnFLGbln}>
          <div
            style="
              border: 1px solid #d4d4d4;
              border-top: 3px solid #51606e;
              border-radius: 5px;
              margin-bottom: 7px;
            "
          >
            <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
              <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">
              <c-lex-custom-lightning-datatable
                class="wrapped-header-datatable"
                hide-checkbox-column
                key-field="recordId"
                data={showGoodsofReturnListView}
                columns={returnDetailCols}
                onchangereturncount={returnCountChange}
                onchangevalue={returnReasonChange}
              ></c-lex-custom-lightning-datatable>
            </div>
          </div>
        </template>
        <!-- 入库明细 -->
        <!-- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
                    <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
                        <lightning-layout>
                            <lightning-layout-item padding="around-small">
                                <p style="font-size: 16px">
                                    <strong>入库明细</strong>
                                </p>
                            </lightning-layout-item>
                        </lightning-layout>
                    </div>
                    <div style="padding:10px;">
                        <lightning-datatable class="wrapped-header-datatable" hide-checkbox-column key-field="recordId" columns={inDetailCols} data={consumableInventory}></lightning-datatable>
                    </div>
                </div> -->
        <!-- 错误明细 -->
        <div
          style="
            border: 1px solid #d4d4d4;
            border-top: 3px solid #51606e;
            border-radius: 5px;
            margin-bottom: 7px;
          "
        >
          <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
            <lightning-layout>
              <lightning-layout-item padding="around-small">
                <p style="font-size: 18px">
                  <strong>错误明细</strong>
                </p>
              </lightning-layout-item>
            </lightning-layout>
            <!-- <p style="font-size: 16px;"><strong>错误明细</strong></p> -->
          </div>
          <div style="padding: 10px">
            <lightning-datatable
              class="wrapped-header-datatable"
              hide-checkbox-column
              key-field="recordId"
              columns={errorDetailCols}
              data={consumableorderdetailsRecordserror}
            ></lightning-datatable>
          </div>
        </div>
      </div>
    </div>
  </template>
</template>
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
New file
@@ -0,0 +1,773 @@
import { LightningElement, wire, track } from "lwc";
import { CurrentPageReference } from "lightning/navigation";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import { NavigationMixin } from "lightning/navigation";
import init from "@salesforce/apex/LexArriveGoodsController.init";
import searchProduct from "@salesforce/apex/LexArriveGoodsController.searchProduct";
import arriveGoodsConfim from "@salesforce/apex/LexArriveGoodsController.arriveGoodsConfim";
import updateGoodsOfReturn from "@salesforce/apex/LexArriveGoodsController.updateGoodsOfReturn";
//table css
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
export default class LexArriveGoods extends NavigationMixin(LightningElement) {
  //页面变量
  @track arrType;
  @track eSetId;
  @track returnFLGbln = false;
  @track saveFLGbln = false;
  @track barcode;
  @track arrController;
  stylesLoaded = false;
  @track showSpinner = true;
  @track showPage = false;
  //消耗品订单
  @track coc;
  @track cocId;
  //本次到货产品汇总
  @track detailsSummary = [];
  //到货明细
  @track consumableorderdetailsRecords = [];
  @track consumableorderdetailsRecordsview = [];
  //返品明细
  @track showGoodsofReturnList = [];
  @track showGoodsofReturnListView = [];
  //入库明细
  @track consumableInventory = [];
  //错误明细
  @track consumableorderdetailsRecordserror = [];
  //报错提醒
  @track errorMsgs = [];
  @track warningMsgs = [];
  //是否一直显示提示
  @track isNoteStay = true;
  //是否有警告
  get hasWarning() {
    if (this.warningMsgs == null || this.warningMsgs.length == 0) {
      return false;
    }
    if (this.warningMsgs.length > 0) {
      return true;
    }
  }
  //是否有错误
  get hasError() {
    if (this.errorMsgs == null || this.errorMsgs.length == 0) {
      return false;
    }
    if (this.errorMsgs.length > 0) {
      return true;
    }
  }
  //本次到货产品汇总cols
  @track currentArrProdCols = [
    {
      label: "产品型号",
      fieldName: "assetModelNo",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 220
    },
    {
      label: "产品名称",
      fieldName: "prodName",
      hideDefaultActions: true,
      wrapText: true
    },
    {
      label: "到货数量",
      fieldName: "arrivedCount",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 220,
      cellAttributes: { alignment: "right" }
    },
    {
      label: "到货金额",
      type: "number",
      typeAttributes: { minimumFractionDigits: 2 },
      fieldName: "arriveAmount",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 220,
      cellAttributes: { alignment: "right" }
    }
  ];
  //到货明细cols
  @track arrDetailCols = [
    {
      label: "消耗品名称",
      fieldName: "prodName",
      hideDefaultActions: true,
      wrapText: true
    },
    {
      label: "规格",
      fieldName: "productPackingListManual",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 120,
      cellAttributes: { alignment: "right" }
    },
    {
      label: "CFDA状态",
      fieldName: "status",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 120
    },
    {
      label: "注册证编码号",
      fieldName: "reportProductApprobation",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 180
    },
    {
      label: "注册证效期",
      fieldName: "ReportProductExpirationDate",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 100
    },
    {
      label: "BarCode",
      fieldName: "barCode",
      hideDefaultActions: true,
      wrap: true,
      initialWidth: 400
    }
  ];
  //返品明细cols
  get returnDetailCols() {
    var cols = [];
    cols.push({
      label: "出库单",
      fieldName: "orderUrl",
      type: "url",
      typeAttributes: { label: { fieldName: "orderNo" }, target: "_blank" },
      hideDefaultActions: true,
      wrapText: true
    });
    // cols.push({label:'出库单' , fieldName:'orderNo', hideDefaultActions: true});
    cols.push({
      label: "出库日",
      fieldName: "prodOutDate",
      wrapText: true,
      hideDefaultActions: true,
      initialWidth: 110
    });
    cols.push({
      label: "消耗品名称",
      fieldName: "prodName",
      wrapText: true,
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 190
    });
    cols.push({
      label: "出库目的",
      fieldName: "summonsForDirctionDet",
      wrapText: true,
      hideDefaultActions: true,
      initialWidth: 130
    });
    cols.push({
      label: "客户名",
      fieldName: "hospitalName",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 130
    });
    cols.push({
      label: "经销商",
      fieldName: "orderDealer",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 100
    });
    cols.push({
      label: "BarCode",
      fieldName: "barCode",
      hideDefaultActions: true,
      wrap: true,
      initialWidth: 230
    });
    cols.push({
      label: "使用期限",
      fieldName: "sterilizationLimit",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 110
    });
    cols.push({
      label: "单位",
      fieldName: "boxPiece",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 50
    });
    cols.push({
      label: "返品数量",
      type: "customReturnGoodInput",
      typeAttributes: {
        inputValue: { fieldName: "returnCount" },
        boxPrice: { fieldName: "boxPiece" },
        recordId: { fieldName: "recordId" }
      },
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 100
    });
    cols.push({
      label: "返品原因",
      type: "customTableInput",
      typeAttributes: {
        recordId: { fieldName: "recordId" },
        inputValue: { fieldName: "returnReason" },
        valueType: "Text"
      },
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 100
    });
    // cols.push({label:'返品原因' , fieldName:'returnReason', hideDefaultActions: true});
    return cols;
  }
  //入库明细cols
  get inDetailCols() {
    var cols = [];
    cols.push({
      label: "消耗品名称",
      fieldName: "prodName",
      hideDefaultActions: true,
      wrapText: true
    });
    cols.push({
      label: "BarCode",
      fieldName: "barCodeNo",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 400
    });
    cols.push({
      label: "使用期限",
      fieldName: "sterilizationlimitDate",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 100
    });
    cols.push({
      label: "serialNoorLotNo",
      fieldName: "serialNoorLotNo",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 140
    });
    cols.push({
      label: "tracingCode",
      fieldName: "tracingCodeNo",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 140
    });
    if (this.returnFLGbln) {
      cols.push({
        label: "返品原因",
        fieldName: "ReturnReason",
        hideDefaultActions: true,
        wrapText: true,
        initialWidth: 150
      });
    }
    return cols;
  }
  //错误明细cols
  @track errorDetailCols = [
    // {label:'消耗品订单' , fieldName:'consumableOrderMinor', hideDefaultActions: true,wrapText:true},
    {
      label: "消耗品订单",
      fieldName: "consumableOrderUrl",
      type: "url",
      typeAttributes: {
        label: { fieldName: "consumableOrderMinorName" },
        target: "_blank"
      },
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 180
    },
    {
      label: "消耗品名称",
      fieldName: "prodName",
      hideDefaultActions: true,
      wrapText: true
    },
    {
      label: "BarCode",
      fieldName: "barCode",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 400
    },
    {
      label: "单位",
      fieldName: "boxPiece",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 60
    },
    {
      label: "数量",
      fieldName: "intMark",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 100,
      cellAttributes: { alignment: "right" }
    },
    {
      label: "错误原因",
      fieldName: "ErrorReason",
      hideDefaultActions: true,
      initialWidth: 280,
      wrapText: true
    }
  ];
  // 获取参数
  @wire(CurrentPageReference)
  getStateParameters(currentPageReference) {
    console.log("CurrentPageReference");
    if (currentPageReference) {
      this.arrType = currentPageReference.state?.ArrType;
      this.eSetId = currentPageReference.state?.ESetId;
    }
  }
  get showOrderDetail() {
    if (this.eSetId != "" && this.eSetId != null) {
      return true;
    } else {
      return false;
    }
  }
  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");
        });
    }
  }
  //初始化
  connectedCallback() {
    init({ arrType: this.arrType, eSetId: this.eSetId })
      .then((result) => {
        this.isNoteStay = result.isNoteStay;
        this.arrController = result.arrGoodCon;
        console.log("this.arrController:" + this.arrController);
        if (result.result == "Success") {
          this.saveFLGbln = result.saveFLGbln;
          this.returnFLGbln = result.returnFLGbln;
          this.coc = result.coc;
          this.cocId = result.coc.Id;
          this.warningMsgs = result.warningMsgList;
          this.errorMsgs = result.errorMsgList;
          this.showSpinner = false;
          this.showPage = true;
        } else {
          this.warningMsgs = result.warningMsgList;
          this.errorMsgs = result.errorMsgList;
          this.showSpinner = false;
          this.showPage = true;
          console.log("error:" + result.errorMsg);
          this.showMyToast("初始化页面失败", result.errorMsg, "error");
        }
      })
      .catch((error) => {
        this.showSpinner = false;
        this.showPage = true;
        console.log("error:" + JSON.stringify(error));
        this.showMyToast("初始化页面失败", JSON.stringify(error), "error");
      });
  }
  //barcode change
  barcodeChange(event) {
    this.barcode = event.detail.value;
  }
  //根据barcode搜索
  barcodeEntrys() {
    this.showSpinner = true;
    searchProduct({
      barcode: this.barcode,
      arrControllerStr: this.arrController
    })
      .then((result) => {
        this.arrController = result.arrGoodCon;
        if (result.result == "Success") {
          this.saveFLGbln = result.saveFLGbln;
          this.returnFLGbln = result.returnFLGbln;
          this.coc = result.coc;
          this.warningMsgs = result.warningMsgList;
          this.errorMsgs = result.errorMsgList;
          this.consumableInventory = result.consumableInventory;
          this.detailsSummary = result.detailsSummary;
          for (var i in this.detailsSummary) {
            if (this.detailsSummary[i].Prod != null) {
              this.detailsSummary[i]["recordId"] =
                this.detailsSummary[i].Prod.Id;
              this.detailsSummary[i]["assetModelNo"] =
                this.detailsSummary[i].Prod.Asset_Model_No__c;
              this.detailsSummary[i]["prodName"] =
                this.detailsSummary[i].Prod.Name__c;
            }
          }
          console.log(
            "this.detailsSummary:" + JSON.stringify(this.detailsSummary)
          );
          this.consumableorderdetailsRecords =
            result.consumableorderdetailsRecords;
          var consumableorderdetailsRecordsview = [];
          for (var i in this.consumableorderdetailsRecords) {
            consumableorderdetailsRecordsview.push(
              this.consumableorderdetailsRecords[i]
            );
          }
          for (var i in this.consumableInventory) {
            consumableorderdetailsRecordsview.push(this.consumableInventory[i]);
          }
          this.consumableorderdetailsRecordsview =
            consumableorderdetailsRecordsview;
          for (var i in this.consumableorderdetailsRecordsview) {
            if (this.consumableorderdetailsRecordsview[i].Prod != null) {
              this.consumableorderdetailsRecordsview[i]["recordId"] =
                this.consumableorderdetailsRecordsview[i].Prod.Id;
              this.consumableorderdetailsRecordsview[i]["prodName"] =
                this.consumableorderdetailsRecordsview[i].Prod.Name__c;
            }
            if (this.consumableorderdetailsRecordsview[i].esd != null) {
              this.consumableorderdetailsRecordsview[i][
                "productPackingListManual"
              ] =
                this.consumableorderdetailsRecordsview[
                  i
                ].esd.ProductPacking_list_manual__c;
              this.consumableorderdetailsRecordsview[i]["status"] =
                this.consumableorderdetailsRecordsview[i].esd.CFDA_Status__c;
              this.consumableorderdetailsRecordsview[i][
                "reportProductApprobation"
              ] =
                this.consumableorderdetailsRecordsview[
                  i
                ].esd.Report_Product_Approbation__c;
              this.consumableorderdetailsRecordsview[i]["barCode"] =
                this.consumableorderdetailsRecordsview[i].esd.Bar_Code__c;
            }
          }
          console.log("len1:" + this.consumableorderdetailsRecords.length);
          console.log("len2:" + this.consumableorderdetailsRecordsview.length);
          console.log(
            "this.consumableorderdetailsRecordsview:" +
              JSON.stringify(this.consumableorderdetailsRecordsview)
          );
          this.showGoodsofReturnList = result.showGoodsofReturnList;
          var showGoodsofReturnListView = [];
          for (var i in this.showGoodsofReturnList) {
            showGoodsofReturnListView.push(this.showGoodsofReturnList[i]);
          }
          for (var i in this.consumableInventory) {
            showGoodsofReturnListView.push(this.consumableInventory[i]);
          }
          this.showGoodsofReturnListView = showGoodsofReturnListView;
          for (var i in this.showGoodsofReturnListView) {
            if (this.showGoodsofReturnListView[i].Prod != null) {
              this.showGoodsofReturnListView[i]["prodName"] =
                this.showGoodsofReturnListView[i].Prod.Name__c;
            }
            if (this.showGoodsofReturnListView[i].esd != null) {
              if (
                this.showGoodsofReturnListView[i].esd
                  .Consumable_Shipment_order__c != "" &&
                this.showGoodsofReturnListView[i].esd
                  .Consumable_Shipment_order__c != null
              ) {
                this.showGoodsofReturnListView[i]["recordId"] =
                  this.showGoodsofReturnListView[
                    i
                  ].esd.Consumable_Shipment_order__c;
                this.showGoodsofReturnListView[i]["orderUrl"] =
                  "/lexsummonscreat?ESetid=" +
                  this.showGoodsofReturnListView[i].esd
                    .Consumable_Shipment_order__c;
                this.showGoodsofReturnListView[i]["orderNo"] =
                  this.showGoodsofReturnListView[
                    i
                  ].esd.Consumable_Shipment_order__r.Name;
              } else if (
                this.showGoodsofReturnListView[i].esd
                  .Consumable_Sale_order__c != "" &&
                this.showGoodsofReturnListView[i].esd
                  .Consumable_Sale_order__c != null
              ) {
                this.showGoodsofReturnListView[i]["recordId"] =
                  this.showGoodsofReturnListView[
                    i
                  ].esd.Consumable_Sale_order__c;
                this.showGoodsofReturnListView[i]["orderUrl"] =
                  "/lexsummonscreat?ESetid=" +
                  this.showGoodsofReturnListView[i].esd
                    .Consumable_Sale_order__c;
                this.showGoodsofReturnListView[i]["orderNo"] =
                  this.showGoodsofReturnListView[
                    i
                  ].esd.Consumable_Sale_order__r.Name;
              }
              this.showGoodsofReturnListView[i]["prodOutDate"] =
                this.showGoodsofReturnListView[i].esd.Product_OutDate__c;
              this.showGoodsofReturnListView[i]["summonsForDirctionDet"] =
                this.showGoodsofReturnListView[i].esd.SummonsForDirction_det__c;
              this.showGoodsofReturnListView[i]["hospitalName"] =
                this.showGoodsofReturnListView[i].esd.HospItal_Name__c;
              this.showGoodsofReturnListView[i]["orderDealer"] =
                this.showGoodsofReturnListView[i].esd.Order_Dealer_Info__c;
              this.showGoodsofReturnListView[i]["barCode"] =
                this.showGoodsofReturnListView[i].esd.Bar_Code__c;
              this.showGoodsofReturnListView[i]["sterilizationLimit"] =
                this.showGoodsofReturnListView[i].esd.Sterilization_limit__c;
              this.showGoodsofReturnListView[i]["boxPiece"] =
                this.showGoodsofReturnListView[i].esd.Box_Piece__c;
              this.showGoodsofReturnListView[i]["returnCount"] =
                this.showGoodsofReturnListView[i].esd.Rrturn_count__c;
              console.log(
                "returnCount:" +
                  this.showGoodsofReturnListView[i].esd.Rrturn_count__c
              );
              this.showGoodsofReturnListView[i]["returnReason"] =
                this.showGoodsofReturnListView[i].esd.Return_reason__c;
            }
          }
          console.log("len1:" + this.showGoodsofReturnList.length);
          console.log("len2:" + this.showGoodsofReturnListView.length);
          console.log(
            "this.showGoodsofReturnListView:" +
              JSON.stringify(this.showGoodsofReturnListView)
          );
          // this.consumableInventory = result.consumableInventory;
          // for(var i in this.consumableInventory){
          //     if(this.consumableInventory[i].Prod != null){
          //         this.consumableInventory[i]['recordId'] = this.consumableInventory[i].Prod.Id;
          //         this.consumableInventory[i]['prodName'] = this.consumableInventory[i].Prod.Name__c;
          //     }
          // }
          console.log(
            "this.consumableInventory:" +
              JSON.stringify(this.consumableInventory)
          );
          this.consumableorderdetailsRecordserror =
            result.consumableorderdetailsRecordserror;
          for (var i in this.consumableorderdetailsRecordserror) {
            if (this.consumableorderdetailsRecordserror[i].Prod != null) {
              this.consumableorderdetailsRecordserror[i]["recordId"] =
                this.consumableorderdetailsRecordserror[i].Prod.Id;
              this.consumableorderdetailsRecordserror[i]["prodName"] =
                this.consumableorderdetailsRecordserror[i].Prod.Name__c;
            }
            if (this.consumableorderdetailsRecordserror[i].esd != null) {
              this.consumableorderdetailsRecordserror[i][
                "consumableOrderMinor"
              ] =
                this.consumableorderdetailsRecordserror[
                  i
                ].esd.Consumable_order_minor__c;
              if (
                this.consumableorderdetailsRecordserror[i].esd
                  .Consumable_order_minor__c != null
              ) {
                this.consumableorderdetailsRecordserror[i][
                  "consumableOrderMinorName"
                ] =
                  this.consumableorderdetailsRecordserror[
                    i
                  ].esd.Consumable_order_minor__r.Name;
                this.consumableorderdetailsRecordserror[i][
                  "consumableOrderUrl"
                ] =
                  "/s/detail/" +
                  this.consumableorderdetailsRecordserror[i].esd
                    .Consumable_order_minor__c;
              }
              this.consumableorderdetailsRecordserror[i]["barCode"] =
                this.consumableorderdetailsRecordserror[i].esd.Bar_Code__c;
              this.consumableorderdetailsRecordserror[i]["boxPiece"] =
                this.consumableorderdetailsRecordserror[i].esd.Box_Piece__c;
            }
          }
          console.log(
            "this.consumableorderdetailsRecordserror:" +
              JSON.stringify(this.consumableorderdetailsRecordserror)
          );
          this.showSpinner = false;
          this.showMyToast("获取成功", "", "success");
        } else {
          this.showSpinner = false;
          this.warningMsgs = result.warningMsgList;
          this.errorMsgs = result.errorMsgList;
          console.log("error:" + result.errorMsg);
          this.showMyToast("获取失败", result.errorMsg, "error");
        }
      })
      .catch((error) => {
        this.showSpinner = false;
        console.log("error:" + error);
        this.showMyToast("获取失败", error, "error");
      });
  }
  //返品数量change
  returnCountChange(event) {
    var value = event.detail.data.value;
    var boxPrice = event.detail.data.boxPrice;
    var recordId = event.detail.data.recordId;
    console.log("返品数量:" + value + boxPrice + "---" + recordId);
    for (var i in this.showGoodsofReturnList) {
      if (this.showGoodsofReturnList[i]["recordId"] == recordId) {
        if (this.showGoodsofReturnList[i].canEdit) {
          this.showGoodsofReturnList[i].esd.Rrturn_count__c = 1;
          this.showGoodsofReturnList[i]["returnCount"] =
            this.showGoodsofReturnList[i].esd.Rrturn_count__c;
        } else {
          this.showGoodsofReturnList[i].esd.Rrturn_count__c = value;
          this.showGoodsofReturnList[i]["returnCount"] =
            this.showGoodsofReturnList[i].esd.Rrturn_count__c;
        }
      }
    }
  }
  //返品原因change
  returnReasonChange(event) {
    var recordId = event.detail.data.recordId;
    var value = event.detail.data.value;
    console.log("返品原因:" + value + "---" + recordId);
    for (var i in this.showGoodsofReturnList) {
      if (this.showGoodsofReturnList[i]["recordId"] == recordId) {
        this.showGoodsofReturnList[i].esd.Return_reason__c = value;
        this.showGoodsofReturnList[i]["returnReason"] =
          this.showGoodsofReturnList[i].esd.Return_reason__c;
      }
    }
  }
  // 到货确认
  arriveGoodsConfim() {
    this.showSpinner = true;
    arriveGoodsConfim({ arrControllerStr: this.arrController })
      .then((result) => {
        this.arrController = result.arrGoodCon;
        if (result.result == "Success") {
          this.showSpinner = false;
          this.warningMsgs = result.warningMsgList;
          this.errorMsgs = result.errorMsgList;
          var url = result.url;
          const config = {
            type: "standard__webPage",
            attributes: {
              url: url
            }
          };
          this[NavigationMixin.Navigate](config);
        } else {
          this.showSpinner = false;
          this.warningMsgs = result.warningMsgList;
          this.errorMsgs = result.errorMsgList;
          console.log("error1:" + result.errorMsg);
          this.showMyToast("到货确认失败", result.errorMsg, "error");
        }
      })
      .catch((error) => {
        this.showSpinner = false;
        console.log("error2:" + error);
        this.showMyToast("到货确认失败", error, "error");
      });
  }
  // 登录返品
  updateGoodsOfReturn() {
    this.showSpinner = true;
    updateGoodsOfReturn({
      arrControllerStr: this.arrController,
      showGoodsofReturnListStr: JSON.stringify(this.showGoodsofReturnList)
    })
      .then((result) => {
        this.showSpinner = false;
        this.arrController = result.arrGoodCon;
        if (result.result == "Success") {
          this.warningMsgs = result.warningMsgList;
          this.errorMsgs = result.errorMsgList;
          var url = result.url;
          const config = {
            type: "standard__webPage",
            attributes: {
              url: url
            }
          };
          this[NavigationMixin.Navigate](config);
        } else {
          this.showSpinner = false;
          this.warningMsgs = result.warningMsgList;
          this.errorMsgs = result.errorMsgList;
          console.log("error1:" + result.errorMsg);
          this.showMyToast("登录返品失败", result.errorMsg, "error");
        }
      })
      .catch((error) => {
        this.showSpinner = false;
        console.log("error2:" + JSON.stringify(error));
        this.showMyToast("登录返品失败", error, "error");
      });
  }
  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);
    // var mode;
    // if(this.isNoteStay){
    //     mode ='sticky';
    // }else{
    //     mode = 'dismissable';
    // }
    // const evt = new ShowToastEvent({
    //     title: title,
    //     message: message,
    //     variant: variant,
    //     mode: mode
    // });
    // this.dispatchEvent(evt);
  }
}
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js-meta.xml
New file
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>56.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightningCommunity__Page</target>
        <target>lightningCommunity__Default</target>
    </targets>
</LightningComponentBundle>