binxie
2023-06-26 dd004276162a2bf9d042ff0aaa569dc30a95d827
newbackup0626
132个文件已修改
15816 ■■■■■ 已修改文件
.sf/config.json 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexArriveGoodsMainController.cls 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexArriveGsDetailsController.cls 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexCancelRemoveBoxController.cls 386 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexConInvoiceViewController.cls 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexConInvoicedetailsController.cls 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexConsumableAccountController.cls 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexConsumableAccountInfoController.cls 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexConsumableAccountSOQL.cls 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexConsumableController.cls 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexConsumableGoodsInfo.cls 375 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexInventoryController.cls 572 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexInventoryListController.cls 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexInventoryViewController.cls 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexLicenceReminderController.cls 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexOutboundorderImportController.cls 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexOverdueStockController.cls 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexProductLimitEditController.cls 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexRemoveBoxController.cls 365 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexSaleAndDeliveryController.cls 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexSaleOrderController.cls 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexSearchContractController.cls 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexSearchHospitalController.cls 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexSummonsCreatController.cls 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexTopPageController.cls 223 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexUpAccountProLimit.cls 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexUtility.cls 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/ResponseBodyLWC.cls 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexSearchAgencyHospitalController.cls 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/labels/CustomLabels.labels-meta.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/boxorpieceType/boxorpieceType.html 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/boxorpieceType/boxorpieceType.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/commonToast/commonToast.html 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/commonToast/commonToast.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/customLightningDatatable/customLightningDatatable.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.html 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/customOutputGood/customOutputGood.html 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/customOutputGood/customOutputGood.js 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.js 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.html 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/customUnitComp/customUnitComp.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.html 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.js 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.html 181 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.js 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexAgencyOppCusCell/lexAgencyOppCusCell.html 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexAgencyOppCusCell/lexAgencyOppCusCell.js 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html 198 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js 302 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.html 139 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js 174 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html 159 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js 117 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html 1104 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js 1530 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexConsumable/lexConsumable.html 900 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexConsumable/lexConsumable.js 828 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.html 439 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js 607 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.html 211 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.js 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.html 169 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.js 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCssUtility/lexCssUtility.css 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.html 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.js 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.html 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomLightningDatatable/customAgencyOppInput.html 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomLightningDatatable/customInventoryColor.html 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomLightningDatatable/customOutboundCount.html 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomLightningDatatable/customOutputGoods.html 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomLightningDatatable/customReturnGoodInput.html 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentAmount.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentNumber.html 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomLightningDatatable/customShippingUnitPrice.html 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomLightningDatatable/customTableCellIcon.html 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomLightningDatatable/customTableInput.html 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomLightningDatatable/customdeleteReason.html 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomDiffReason.html 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.html 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.js 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomTableInput/lexCustomTableInput.html 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomTableInput/lexCustomTableInput.js 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.html 182 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.js 657 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexInventory/lexInventory.html 300 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexInventory/lexInventory.js 632 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.html 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.js 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLookup/lexLookup.html 216 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLookup/lexLookup.js 111 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewOrder/lexNewOrder.html 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewOrder/lexNewOrder.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.css 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.html 70 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.js 221 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.html 139 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.js 185 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.html 119 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.js 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html 158 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js 123 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.html 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html 169 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.html 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTopPage/lexTopPage.html 138 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTopPage/lexTopPage.js 492 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html 268 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js 426 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.html 103 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.js 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/myCustomTypeDatatable/customName.html 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/myCustomTypeDatatable/customNumber.html 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/myCustomTypeDatatable/customUnit.html 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/myCustomTypeDatatable/myCustomTypeDatatable.html 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/myCustomTypeDatatable/myCustomTypeDatatable.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/permissionsets/Community_LEX_PS.permissionset-meta.xml 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/triggers/ContentDocumentLink.trigger 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/triggers/ContentDocumentTrigger.trigger 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest/LEXC01packagelexcommunitynew.xml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest/LEXC02packagelexcommunityupdate.xml 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.sf/config.json
force-app/main/default/classes/LexArriveGoodsMainController.cls
@@ -7,7 +7,7 @@
    private static String cate1ForSort = null;
    private static Date cate2ForSort = Date.today();
    private static Date cate2 = Date.today();
    private static String[] columus = new String[]{ 'Product2__c.Name'};
    private static String[] columus = new List<String>{ 'Product2__c.Name' };
    // 产品 ID
    private static String ESetId = '';
    private static String accountid = null;
@@ -34,8 +34,8 @@
        try {
            // coc = new Consumable_order__c();
            String userId = UserInfo.getUserId();
            List<user> Useracc = New List<user>();
            Useracc = [select accountid, Work_Location__c,UserPro_Type__c from user where id =:userId];
            List<user> Useracc = new List<user>();
            Useracc = [SELECT accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :userId];
            accountid = Useracc[0].accountid;
            userWorkLocation = Useracc[0].Work_Location__c;
            agencyProType = Useracc[0].UserPro_Type__c;
@@ -62,7 +62,18 @@
            for (String s : column) {
                soql += ',' + s;
            }
            soql += ' from Consumable_order__c where Order_type__c = \''+'订单'+'\' and  recordtypeid =\'' + System.Label.RT_ConOrder_Delivery + '\' and Dealer_Info__c =\'' + accountid +'\' and Order_ProType__c =\'' + agencyProType +'\' and   (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_Owner_WorkLocal__c = \'' + userWorkLocation + '\' and showFalseNotshowTrue__c = false order by Deliver_date__c'; //
            soql +=
                ' from Consumable_order__c where Order_type__c = \'' +
                '订单' +
                '\' and  recordtypeid =\'' +
                System.Label.RT_ConOrder_Delivery +
                '\' and Dealer_Info__c =\'' +
                accountid +
                '\' and Order_ProType__c =\'' +
                agencyProType +
                '\' and   (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_Owner_WorkLocal__c = \'' +
                userWorkLocation +
                '\' and showFalseNotshowTrue__c = false order by Deliver_date__c'; //
            // soql = 'select id,name,ContractNo__c,Total_num__c,OrderNumber_arrived__c,Delivery_detail_count__c,OrderNumber_notarrive__c,More_than_seven_days__c,Shipment_date__c,First_Delivery__c from Consumable_order__c where id in :idList';
            raesList = Database.query(soql);
            //20200904 ljh add start
@@ -108,7 +119,13 @@
    }
    @AuraEnabled
    public static Results searchConsumableorderdetails(String category1Str, Date cate2Str, String accountidStr, String userWorkLocationStr, String agencyProTypeStr){
    public static Results searchConsumableorderdetails(
        String category1Str,
        Date cate2Str,
        String accountidStr,
        String userWorkLocationStr,
        String agencyProTypeStr
    ) {
        Results results = new Results();
        category1 = category1Str;
        cate2 = cate2Str;
@@ -137,7 +154,14 @@
            for (String s : column) {
                soql += ',' + s;
            }
            soql += ' from Consumable_order__c where Order_type__c = \''+'订单'+'\' and  recordtypeid =\'' + System.Label.RT_ConOrder_Delivery + '\' and Dealer_Info__c =\'' + accountid +'\' and  (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) ';
            soql +=
                ' from Consumable_order__c where Order_type__c = \'' +
                '订单' +
                '\' and  recordtypeid =\'' +
                System.Label.RT_ConOrder_Delivery +
                '\' and Dealer_Info__c =\'' +
                accountid +
                '\' and  (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) ';
            soql += 'and Order_Owner_WorkLocal__c = \'' + userWorkLocation + '\' ';
            soql += 'and showFalseNotshowTrue__c = false';
            if (!String.isBlank(category1)) {
force-app/main/default/classes/LexArriveGsDetailsController.cls
@@ -19,17 +19,28 @@
        try {
            //取经销商信息
            String userId = UserInfo.getUserId();
            List<user> useracc = New List<user>();
            useracc = [select accountid from user where id =:userId];
            List<user> useracc = new List<user>();
            useracc = [SELECT accountid FROM user WHERE id = :userId];
            accountid = useracc[0].accountid;
            List<Consumable_order__c> rs = New List<Consumable_order__c>();
            if(eSetId == NULL || eSetId == '') {
            List<Consumable_order__c> rs = new List<Consumable_order__c>();
            if (eSetId == null || eSetId == '') {
            }else {
                rs = [SELECT id,name,Order_reason__c,Arrive_Order__c,Arrive_Order__r.Total_num__c,Arrive_Order__r.IsShipment__c,Arrive_Order__r.Name,
                            recordtypeid,Order_status__c,Deliver_date__c,Arrive_total_amount__c
                rs = [
                    SELECT
                        id,
                        name,
                        Order_reason__c,
                        Arrive_Order__c,
                        Arrive_Order__r.Total_num__c,
                        Arrive_Order__r.IsShipment__c,
                        Arrive_Order__r.Name,
                        recordtypeid,
                        Order_status__c,
                        Deliver_date__c,
                        Arrive_total_amount__c
                        FROM Consumable_order__c
                        WHERE id =:eSetId];
                    WHERE id = :eSetId
                ];
                coc =  new Consumable_order__c();
                if(rs.size()>0){
                    coc = rs[0];
@@ -38,17 +49,31 @@
                if(coc.Arrive_Order__c == null){
                    arrivetoorder = true;
                }
                List<Consumable_order_details2__c> consumablearriveproductdetailsSelected = [SELECT Id,Dealer_Arrive__c,Bar_Code__c, RecordTypeid, Name,Consumable_Product__r.Name__c,
                                                            Consumable_Product__c,Consumable_Product__r.Name,Dealer_Saled__c,
                                                            Sterilization_limit__c,Deliver_date__c,
                                                            Intra_Trade_List_RMB__c,Asset_Model_No__c,Arrive_Date__c,Send_Date__c,
                List<Consumable_order_details2__c> consumablearriveproductdetailsSelected = [
                    SELECT
                        Id,
                        Dealer_Arrive__c,
                        Bar_Code__c,
                        RecordTypeid,
                        Name,
                        Consumable_Product__r.Name__c,
                        Consumable_Product__c,
                        Consumable_Product__r.Name,
                        Dealer_Saled__c,
                        Sterilization_limit__c,
                        Deliver_date__c,
                        Intra_Trade_List_RMB__c,
                        Asset_Model_No__c,
                        Arrive_Date__c,
                        Send_Date__c,
                                                            Consumable_Product__r.SFDA_Status__c,
                                                            Consumable_Product__r.Product2__r.Packing_list_manual__c,
                                                            Consumable_Product__r.Product2__r.SFDA_Approbation_No__c,
                                                            Consumable_Product__r.Product2__r.SFDA_Expiration_Date__c
                                                        FROM Consumable_order_details2__c
                                                        WHERE Consumable_Arrived_order__c = :eSetId
                                                        ORDER BY Name ];
                    ORDER BY Name
                ];
                for (Integer i = 0; i < consumablearriveproductdetailsSelected.size(); i++) {
                        consumableorderdetailsRecords.add(new ConsumableorderdetailsInfo(consumablearriveproductdetailsSelected[i]));
                    }
@@ -57,7 +82,9 @@
                bss.packing_list = bss.Prod.Product2__r.Packing_list_manual__c;
                bss.approbation_No = bss.Prod.Product2__r.SFDA_Approbation_No__c;
                //update by rentx 20210622 start CHAN-C3K4ZQ
                bss.expiration_DateStr = bss.Prod.Product2__r.SFDA_Expiration_Date__c == null ? '' : bss.Prod.Product2__r.SFDA_Expiration_Date__c.format();
                bss.expiration_DateStr = bss.Prod.Product2__r.SFDA_Expiration_Date__c == null
                    ? ''
                    : bss.Prod.Product2__r.SFDA_Expiration_Date__c.format();
                bss.Sterilization_limitStr = bss.esd.Sterilization_limit__c == null ? '' : bss.esd.Sterilization_limit__c.format();
                //update by rentx 20210622 end CHAN-C3K4ZQ
            }
@@ -93,11 +120,14 @@
            coc = (Consumable_order__c)JSON.deserialize(cocStr, Consumable_order__c.class);
            List<Consumable_order_details2__c> orderdetails = new List<Consumable_order_details2__c>();
            //发货明细2
            orderdetails = [SELECT Id
            orderdetails = [
                SELECT Id
                            FROM Consumable_order_details2__c
                            WHERE Consumable_order_minor__c =:coc.Arrive_Order__c
                WHERE
                    Consumable_order_minor__c = :coc.Arrive_Order__c
                            AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
                            AND Dealer_Arrive__c = true ];
                    AND Dealer_Arrive__c = TRUE
            ];
            if(orderallcount!= consumableorderdetailsCount){
                results.result = 'Fail';
                results.errorMsg = '订单不完全到货,无法出库';
@@ -157,7 +187,6 @@
        public String Sterilization_limitStr;
        @AuraEnabled
        public String prodName;
        // 已存在消耗品明细用
        public ConsumableorderdetailsInfo(Consumable_order_details2__c e) {
force-app/main/default/classes/LexCancelRemoveBoxController.cls
@@ -11,7 +11,7 @@
    public static List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy { get; set; }
    public static boolean saveFLGbln {get;set;}
    //错误信息
    public static String alertMessage {set;get;}
    public static String alertMessage { get; set; }
    //拆盒明细件数
    public static Integer getinventorysize(){
        return ConsumableorderdetailsRecordsdummy.size();
@@ -21,7 +21,7 @@
    public static Map<String, String> AllMap = new Map<String, String>();
    public static  List<String> BarCodeListP = new List<String>();
    //不符合的barcode和型号
    public static list<String> notInlist = new list<String>();
    public static list<String> notInlist = new List<String>();
    public static  String baseUrl {get;private set;}
    private static String accountid = null;
    private static String accountName = null;
@@ -34,7 +34,7 @@
        ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>();
        ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>();
        consumableInventory = new List<ConsumableorderdetailsInfo>();
        saveFLGbln = FALSE;
        saveFLGbln = false;
    }
    @AuraEnabled
@@ -44,7 +44,7 @@
        res.entity = data;
        String userId = UserInfo.getUserId();
        List<user> Useracc = New List<user>();
        List<user> Useracc = new List<user>();
        Useracc = [SELECT accountid, Work_Location__c,UserPro_Type__c FROM user WHERE id =:userId];
        accountid = Useracc[0].accountid;
        userWorkLocation = Useracc[0].Work_Location__c;
@@ -64,12 +64,11 @@
        res.code = 200;
        System.debug('res = ' + res);
        return res;
    }
    // 将页面或取得BarCode去掉重复的,转换成List
    public static List<String> ParseBarCode(String Code){
        String[] Cache = new String[]{};
        String[] Cache = new List<String>{};
        Cache = Code.split('\n');
        Set <String> Buff = new Set<String>();
        for(String A : Cache){
@@ -85,7 +84,12 @@
    //获取明细
    @AuraEnabled
    public static ResponseBodyLWC searchConsumableorderdetails(String barcode,String accountName,String userWorkLocation,String agencyProType) {
    public static ResponseBodyLWC searchConsumableorderdetails(
        String barcode,
        String accountName,
        String userWorkLocation,
        String agencyProType
    ) {
        ResponseBodyLWC res = new ResponseBodyLWC();
        Map<String,object> data = new Map<String,object>();
        res.entity = data;
@@ -97,15 +101,13 @@
        ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>();
        ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>();
        notInlist = new list<String>();
        notInlist = new List<String>();
        BarCodeListP = ParseBarCode(barcode);
        Consumable_order_details2__c p = new Consumable_order_details2__c();
        List<Consumable_order_details2__c> Ins = New List<Consumable_order_details2__c>();
        List<Consumable_order_details2__c> Ins = new List<Consumable_order_details2__c>();
        List<Consumable_order_details2__c> reSet = new List<Consumable_order_details2__c>();
        List<Consumable_order_details2__c> reSet1 = new List<Consumable_order_details2__c>();
        saveFLGbln = FALSE;
        saveFLGbln = false;
        alertMessage='';
        //判断barcode是否为空
@@ -122,22 +124,37 @@
        // ConsumableorderdetailsRecordsdummy.clear();
        // 产品类型不同
        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
                        Deliver_date__c,Bar_Code__c,Product_Type__c,
                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c, Arrive_Owner_Work_Location__c,
        reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__r.Name__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Bar_Code__c,
                Product_Type__c,
                Arrive_date__c,
                Send_Date__c,
                Consumable_order_minor__r.Name,
                Consumable_order_minor__c,
                recordtypeid,
                Consumable_order_minor__r.Arrive_Order__c,
                Arrive_Owner_Work_Location__c,
                        //add by rentx 2020-10-13 start
                        ContractNo_text__c
                        /*,ContractNo__c*/
                        //add by rentx 2020-10-13 end
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Arrive__c = true
                    AND   Bar_Code__c in :BarCodeListP
            WHERE
                Dealer_Arrive__c = TRUE
                AND Bar_Code__c IN :BarCodeListP
                    AND   Dealer_Info_text__c = :accountName
                    AND   Arrive_Owner_Work_Location__c = : userWorkLocation
                    AND (not Product_Type__c like : userPro_Typestr)
                    ORDER BY Name ];
                AND (NOT Product_Type__c LIKE :userPro_Typestr)
            ORDER BY Name
        ];
        if(reSet1.size() > 0){
            for (Integer i = 0; i < reSet1.size(); i++) {
                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
@@ -152,26 +169,39 @@
        }
        //没有拆盒
        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
                        Deliver_date__c,Bar_Code__c,
                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
        reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__r.Name__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Bar_Code__c,
                Arrive_date__c,
                Send_Date__c,
                Consumable_order_minor__r.Name,
                Consumable_order_minor__c,
                recordtypeid,
                Consumable_order_minor__r.Arrive_Order__c,
                        //add by rentx 2020-10-13 start
                        ContractNo_text__c
                         /*,ContractNo__c*/
                        //add by rentx 2020-10-13 end
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Arrive__c = true
                    AND  Dealer_Shipment__c= false
                    AND  Dealer_Saled__c = false
                    AND  Dealer_Returned__c = false
                    AND  Lose_Flag__c = false
            WHERE
                Dealer_Arrive__c = TRUE
                AND Dealer_Shipment__c = FALSE
                AND Dealer_Saled__c = FALSE
                AND Dealer_Returned__c = FALSE
                AND Lose_Flag__c = FALSE
                    AND  Box_Piece__c = '盒'
                    //AND  ProductPacking_list_manual__c > 1
                    AND  Bar_Code__c in :BarCodeListP
                AND Bar_Code__c IN :BarCodeListP
                    AND  Dealer_Info_text__c = :accountName
                    ORDER BY Name ];  //没出库,没销售,在库,没有拆盒
            ORDER BY Name
        ]; //没出库,没销售,在库,没有拆盒
        if(reSet1.size() > 0){
            for (Integer i = 0; i < reSet1.size(); i++) {
                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
@@ -186,25 +216,38 @@
        }
        //已出货,未到货
        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
                        Deliver_date__c,Bar_Code__c,
                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
        reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__r.Name__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Bar_Code__c,
                Arrive_date__c,
                Send_Date__c,
                Consumable_order_minor__r.Name,
                Consumable_order_minor__c,
                recordtypeid,
                Consumable_order_minor__r.Arrive_Order__c,
                        //add by rentx 2020-10-13 start
                        ContractNo_text__c
                        /*,ContractNo__c*/
                        //add by rentx 2020-10-13 end
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Arrive__c = FALSE
            WHERE
                Dealer_Arrive__c = FALSE
                    AND  Dealer_Shipment__c= FALSE
                    AND  Dealer_Saled__c = FALSE
                    AND  Dealer_Returned__c = false
                    AND  Lose_Flag__c = false
                AND Dealer_Returned__c = FALSE
                AND Lose_Flag__c = FALSE
                    AND  Box_Piece__c = '盒'
                    AND   Bar_Code__c in :BarCodeListP
                AND Bar_Code__c IN :BarCodeListP
                    AND   Dealer_Info_text__c = :accountName
                    ORDER BY Name ];
            ORDER BY Name
        ];
        if(reSet1.size() > 0){
            for (Integer i = 0; i < reSet1.size(); i++) {
                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
@@ -219,25 +262,38 @@
        }
        //拆盒已出货
        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
                        Deliver_date__c,Bar_Code__c,
                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
        reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__r.Name__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Bar_Code__c,
                Arrive_date__c,
                Send_Date__c,
                Consumable_order_minor__r.Name,
                Consumable_order_minor__c,
                recordtypeid,
                Consumable_order_minor__r.Arrive_Order__c,
                        //add by rentx 2020-10-13 start
                        ContractNo_text__c
                        /*,ContractNo__c*/
                        //add by rentx 2020-10-13 end
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Shipment__c = true
                    AND   Dealer_Arrive__c = true
                    AND   Dealer_Returned__c = false
                    AND   Lose_Flag__c = false
            WHERE
                Dealer_Shipment__c = TRUE
                AND Dealer_Arrive__c = TRUE
                AND Dealer_Returned__c = FALSE
                AND Lose_Flag__c = FALSE
                    AND   Box_Piece__c = '个'
                    AND   RemoveBox_date__c != null
                    AND   Bar_Code__c in :BarCodeListP
                AND RemoveBox_date__c != NULL
                AND Bar_Code__c IN :BarCodeListP
                    AND   Dealer_Info_text__c = :accountName
                    ORDER BY Name ];
            ORDER BY Name
        ];
        if(reSet1.size() > 0){
            for (Integer i = 0; i < reSet1.size(); i++) {
                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
@@ -252,25 +308,38 @@
        }
        //拆盒已销售
        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
                        Deliver_date__c,Bar_Code__c,
                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
        reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__r.Name__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Bar_Code__c,
                Arrive_date__c,
                Send_Date__c,
                Consumable_order_minor__r.Name,
                Consumable_order_minor__c,
                recordtypeid,
                Consumable_order_minor__r.Arrive_Order__c,
                        //add by rentx 2020-10-13 start
                        ContractNo_text__c
                        /*,ContractNo__c*/
                        //add by rentx 2020-10-13 end
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Saled__c = true
                    AND   Dealer_Arrive__c = true
                    AND   Dealer_Returned__c = false
                    AND   Lose_Flag__c = false
            WHERE
                Dealer_Saled__c = TRUE
                AND Dealer_Arrive__c = TRUE
                AND Dealer_Returned__c = FALSE
                AND Lose_Flag__c = FALSE
                    AND   Box_Piece__c = '个'
                    AND   RemoveBox_date__c != null
                    AND   Bar_Code__c in :BarCodeListP
                AND RemoveBox_date__c != NULL
                AND Bar_Code__c IN :BarCodeListP
                    AND   Dealer_Info_text__c = :accountName
                    ORDER BY Name ];
            ORDER BY Name
        ];
        if(reSet1.size() > 0){
            for (Integer i = 0; i < reSet1.size(); i++) {
                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
@@ -285,23 +354,36 @@
        }
        //拆盒返品
        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
                        Deliver_date__c,Bar_Code__c,
                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
        reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__r.Name__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Bar_Code__c,
                Arrive_date__c,
                Send_Date__c,
                Consumable_order_minor__r.Name,
                Consumable_order_minor__c,
                recordtypeid,
                Consumable_order_minor__r.Arrive_Order__c,
                        //add by rentx 2020-10-13 start
                        ContractNo_text__c
                        /*,ContractNo__c*/
                        //add by rentx 2020-10-13 end
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Returned__c = true
                    AND   Return_date__c != null
            WHERE
                Dealer_Returned__c = TRUE
                AND Return_date__c != NULL
                    AND   Box_Piece__c = '个'
                    AND   RemoveBox_date__c != null
                    AND   Bar_Code__c in :BarCodeListP
                AND RemoveBox_date__c != NULL
                AND Bar_Code__c IN :BarCodeListP
                    AND   Dealer_Info_text__c = :accountName
                    ORDER BY Name ];
            ORDER BY Name
        ];
        if(reSet1.size() > 0){
            for (Integer i = 0; i < reSet1.size(); i++) {
                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
@@ -315,24 +397,36 @@
            }
        }
        //拆盒后盘点过(盘点日期不为空)
        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
                        Deliver_date__c,Bar_Code__c,
                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
        reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__r.Name__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Bar_Code__c,
                Arrive_date__c,
                Send_Date__c,
                Consumable_order_minor__r.Name,
                Consumable_order_minor__c,
                recordtypeid,
                Consumable_order_minor__r.Arrive_Order__c,
                        //add by rentx 2020-10-13 start
                        ContractNo_text__c
                        /*,ContractNo__c*/
                        //add by rentx 2020-10-13 end
                    FROM Consumable_order_details2__c
                    WHERE Inventory_date__c != null
            WHERE
                Inventory_date__c != NULL
                    AND   Box_Piece__c = '个'
                    AND   RemoveBox_date__c != null
                    AND   Bar_Code__c in :BarCodeListP
                AND RemoveBox_date__c != NULL
                AND Bar_Code__c IN :BarCodeListP
                    AND   Dealer_Info_text__c = :accountName
                    ORDER BY Name ];
            ORDER BY Name
        ];
        if(reSet1.size() > 0){
            for (Integer i = 0; i < reSet1.size(); i++) {
                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
@@ -347,21 +441,35 @@
        }
        //不同工作地
        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
                        Deliver_date__c,Bar_Code__c,
                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c, Arrive_Owner_Work_Location__c,
        reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__r.Name__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Bar_Code__c,
                Arrive_date__c,
                Send_Date__c,
                Consumable_order_minor__r.Name,
                Consumable_order_minor__c,
                recordtypeid,
                Consumable_order_minor__r.Arrive_Order__c,
                Arrive_Owner_Work_Location__c,
                        //add by rentx 2020-10-13 start
                        ContractNo_text__c
                        /*,ContractNo__c*/
                        //add by rentx 2020-10-13 end
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Arrive__c = true
                    AND   Bar_Code__c in :BarCodeListP
            WHERE
                Dealer_Arrive__c = TRUE
                AND Bar_Code__c IN :BarCodeListP
                    AND   Dealer_Info_text__c = :accountName
                    AND   Arrive_Owner_Work_Location__c !=: userWorkLocation
                    ORDER BY Name ];
            ORDER BY Name
        ];
        if(reSet1.size() > 0){
            for (Integer i = 0; i < reSet1.size(); i++) {
                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
@@ -375,7 +483,9 @@
            }
        }
        reSet = [SELECT Id,
        reSet = [
            SELECT
                Id,
                        Name,
                        Intra_Trade_List_RMB__c,
                        Asset_Model_No__c,
@@ -400,29 +510,28 @@
                        /*,ContractNo__c*/
                        //add by rentx 2020-10-13 end
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Arrive__c = true
                    AND Dealer_Shipment__c = false
                    AND Dealer_Saled__c = false
                    AND Dealer_Returned__c = false
                    AND Lose_Flag__c = false
            WHERE
                Dealer_Arrive__c = TRUE
                AND Dealer_Shipment__c = FALSE
                AND Dealer_Saled__c = FALSE
                AND Dealer_Returned__c = FALSE
                AND Lose_Flag__c = FALSE
                    AND Box_Piece__c = '个'
                    AND RemoveBox_date__c != null
                    AND Bar_Code__c in :BarCodeListP
                AND RemoveBox_date__c != NULL
                AND Bar_Code__c IN :BarCodeListP
                    AND Dealer_Info_text__c = :accountName 
                    AND Arrive_Owner_Work_Location__c =: userWorkLocation
                    AND  Product_Type__c like : userPro_Typestr
                AND Product_Type__c LIKE :userPro_Typestr
                ];
        if(reSet.size()>0){
            for (Integer i = 0; i < reSet.size(); i++) {
                if(ErrorIdMap.containsKey(reSet[i].Bar_Code__c) ){
                    // 跳过错误的消耗品明细
                    continue;
                }
                else if(ExistIdMap.containsKey(reSet[i].Bar_Code__c) ){
                } else if (ExistIdMap.containsKey(reSet[i].Bar_Code__c)) {
                    // 跳过已经处理的消耗品明细
                    continue;
                }
                else{
                } else {
                    ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i]));
                    ExistIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
                }
@@ -452,12 +561,16 @@
        res.code = 200;
        System.debug('res = ' + res);
        return res;
    }
    //取消拆盒确认
    @AuraEnabled
    public static ResponseBodyLWC cancelRemoveBoxConfirm(String saveConsumableorderdetailsRecordsdummy,String accountName,String userWorkLocation,String agencyProType) {
    public static ResponseBodyLWC cancelRemoveBoxConfirm(
        String saveConsumableorderdetailsRecordsdummy,
        String accountName,
        String userWorkLocation,
        String agencyProType
    ) {
        ResponseBodyLWC res = new ResponseBodyLWC();
        Map<String,object> data = new Map<String,object>();
        res.entity = data;
@@ -465,10 +578,12 @@
        userPro_Typestr = '%' + agencyProType + '%';
        accountName = accountName;
        userWorkLocation =userWorkLocation;
        List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy = (List<ConsumableorderdetailsInfo>)JSON.deserialize(saveConsumableorderdetailsRecordsdummy,List<ConsumableorderdetailsInfo>.class);
        List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy = (List<ConsumableorderdetailsInfo>) JSON.deserialize(
            saveConsumableorderdetailsRecordsdummy,
            List<ConsumableorderdetailsInfo>.class
        );
        List<Consumable_order_details2__c> ins = New List<Consumable_order_details2__c>();
        List<Consumable_order_details2__c> ins = new List<Consumable_order_details2__c>();
        
        Savepoint sp = Database.setSavepoint();
        if(ConsumableorderdetailsRecordsdummy.size()<1){
@@ -484,7 +599,8 @@
        try{
            //取得通番大于001的在库明细
            List<Consumable_order_details2__c> orderDetails2del =  [SELECT
            List<Consumable_order_details2__c> orderDetails2del = [
                SELECT
                        Id,
                        Box_Piece__c,
                        RemoveBox_date__c,
@@ -495,18 +611,19 @@
                        /*,ContractNo__c*/
                        //add by rentx 2020-10-13 end
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Arrive__c = true
                    AND Dealer_Shipment__c = false
                    AND Dealer_Saled__c = false
                    AND Dealer_Returned__c = false
                    AND Lose_Flag__c = false
                WHERE
                    Dealer_Arrive__c = TRUE
                    AND Dealer_Shipment__c = FALSE
                    AND Dealer_Saled__c = FALSE
                    AND Dealer_Returned__c = FALSE
                    AND Lose_Flag__c = FALSE
                    AND Box_Piece__c = '个'
                    AND RemoveBox_date__c != null
                    AND RemoveBox_date__c != NULL
                    AND RemoveBox_No__c > 1
                    AND Bar_Code__c in :BarCodeList
                    AND Bar_Code__c IN :BarCodeList
                    AND Dealer_Info_text__c = :accountName 
                    AND Arrive_Owner_Work_Location__c =: userWorkLocation
                    AND  Product_Type__c like : userPro_Typestr
                    AND Product_Type__c LIKE :userPro_Typestr
                ];
            List<Consumable_order_details2__c> orderlistdel = new List<Consumable_order_details2__c>();
@@ -522,32 +639,34 @@
            }
            //取得通番001的在库明细
            List<Consumable_order_details2__c> orderDetails2 =  [SELECT
            List<Consumable_order_details2__c> orderDetails2 = [
                SELECT
                        Id,
                        Box_Piece__c,
                        RemoveBox_date__c,
                        RemoveBox_No__c,
                        Bar_Code__c,
                        //add by rentx 2020-10-13 start
                        ContractNo_text__c
                    ContractNo_text__c,
                        /*,ContractNo__c*/
                        //add by rebtx 2020-10-13 end
                    // tcm start
                    ,Consumable_order_minor__r.ContractNo__c
                    Consumable_order_minor__r.ContractNo__c
                    // tcm end
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Arrive__c = true
                    AND Dealer_Shipment__c = false
                    AND Dealer_Saled__c = false
                    AND Dealer_Returned__c = false
                    AND Lose_Flag__c = false
                WHERE
                    Dealer_Arrive__c = TRUE
                    AND Dealer_Shipment__c = FALSE
                    AND Dealer_Saled__c = FALSE
                    AND Dealer_Returned__c = FALSE
                    AND Lose_Flag__c = FALSE
                    AND Box_Piece__c = '个'
                    AND RemoveBox_date__c !=null
                    AND RemoveBox_date__c != NULL
                    AND RemoveBox_No__c = 1
                    AND Bar_Code__c in :BarCodeList
                    AND Bar_Code__c IN :BarCodeList
                    AND Dealer_Info_text__c = :accountName 
                    AND Arrive_Owner_Work_Location__c =: userWorkLocation
                    AND  Product_Type__c like : userPro_Typestr
                    AND Product_Type__c LIKE :userPro_Typestr
                ];
            for (Consumable_order_details2__c detail2tmp : orderDetails2) {
@@ -593,7 +712,6 @@
            return null;
        }
    }
    class ConsumableorderdetailsInfo implements Comparable {
        public Consumable_order_details2__c esd { get; set; }
force-app/main/default/classes/LexConInvoiceViewController.cls
@@ -388,7 +388,11 @@
        //         attachmentRecoeds.add(new InvoiceOrderInfo(attachmentinfo[i]));
        //     }
        // }
        List<ContentVersion> cvInfo = [SELECT Id, Title, OwnerId,Owner.Name, CreatedDate,ContentDocumentId FROM ContentVersion WHERE FirstPublishLocationId = :invoiceId];
        List<ContentVersion> cvInfo = [
            SELECT Id, Title, OwnerId, Owner.Name, CreatedDate, ContentDocumentId
            FROM ContentVersion
            WHERE FirstPublishLocationId = :invoiceId
        ];
        if (cvInfo.size() > 0) {
            for (Integer i = 0; i < cvInfo.size(); i++) {
                attachmentRecoeds.add(new InvoiceOrderInfo(cvInfo[i]));
@@ -424,7 +428,6 @@
        System.debug('res = ' + res);
        return res;
    }
    
    //保存
    @AuraEnabled
@@ -533,7 +536,6 @@
                }
            } else {
                if (HospitalInfo != null && HospitalInfo != '') {
                    System.debug('++++++++++++' + ass.esd.Order_ForHospital__c + '   ' + shipmentAccountString);
                    if (ass.esd.Order_ForHospital__c != shipmentAccountString) {
                        System.debug('HospitalInfo != null ass.esd.Order_ForHospital__c != shipmentAccountString');
@@ -552,7 +554,9 @@
                        (ass.esd.Order_ForDealerText__c != null || ass.esd.Order_ForDealerText__c != '') &&
                        ass.esd.ShipmentAccount__c != shipmentAccountString
                    ) {
                        System.debug('HospitalInfo == null && ass.esd.Order_ForDealerText__c != null ass.esd.ShipmentAccount__c != shipmentAccountString');
                        System.debug(
                            'HospitalInfo == null && ass.esd.Order_ForDealerText__c != null ass.esd.ShipmentAccount__c != shipmentAccountString'
                        );
                        invoiceOrderAccountList.add(ass.esd.Name);
                    }
                }
@@ -849,6 +853,8 @@
                    delete invoiceLinkdetList;
                }
                //新建发票明细1
                System.debug('===>' + chukudanID);
                System.debug('===>' + chukudanID.size());
                if (chukudanID.size() > 0) {
                    newinvoicedetails1(chukudanID);
                }
@@ -1299,7 +1305,16 @@
    // 检索(未开发票出库单)
    @AuraEnabled
    public static ResponseBodyLWC InvoiceorderSearch(Consumable_order__c cocLwc,String invoiceIdLwc,String accountidLwc,String userWorkLocationLwc,String agencyProTypeLwc,String HospitalInfoLwc,String SecondDealerLwc,String invoiceOrderRecoedsLwc) {
    public static ResponseBodyLWC InvoiceorderSearch(
        Consumable_order__c cocLwc,
        String invoiceIdLwc,
        String accountidLwc,
        String userWorkLocationLwc,
        String agencyProTypeLwc,
        String HospitalInfoLwc,
        String SecondDealerLwc,
        String invoiceOrderRecoedsLwc
    ) {
        System.debug('进入 InvoiceorderSearch');
        ResponseBodyLWC res = new ResponseBodyLWC();
        Map<String, object> data = new Map<String, object>();
@@ -1429,7 +1444,11 @@
    // 提交按钮
    @AuraEnabled
    public static ResponseBodyLWC approval(List<String> outOrderStringListLwc,Map<String, Consumable_Orderdetails__c> outordercountMapLwc,String invoiceIdLwc) {
    public static ResponseBodyLWC approval(
        List<String> outOrderStringListLwc,
        Map<String, Consumable_Orderdetails__c> outordercountMapLwc,
        String invoiceIdLwc
    ) {
        System.debug('进入 approval');
        ResponseBodyLWC res = new ResponseBodyLWC();
        Map<String, object> data = new Map<String, object>();
@@ -1501,6 +1520,8 @@
                        outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c
                    )
                    .Invoice_Unitprice__c;
                System.debug('====>procount' + invoiceUpdte1.Invoiced_Procount__c);
                System.debug('===>RMB' + outOrderdet1List[i].Delivery_List_RMB__c);
                invoiceUpdte1.InvoicedProCost_RMB__c = invoiceUpdte1.Invoiced_Procount__c * outOrderdet1List[i].Delivery_List_RMB__c;
                Decimal invoicedProcount = 0;
@@ -1521,6 +1542,8 @@
                    invoicedProcount = outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c)
                        .Invoiced_Count__c;
                }
                System.debug('发票数量===>' + outOrderdet1List[i].InvoiceProNot_count__c);
                System.debug('还没发票数量===>' + invoicedProcount);
                if (outOrderdet1List[i].InvoiceProNot_count__c < invoicedProcount) {
                    // ApexPages.addmessage(
@@ -1534,7 +1557,16 @@
                    //     )
                    // );
                    // return null;
                    return new ResponseBodyLWC('Error', 500, '出库单' + outOrderdet1List[i].Consumable_order__r.Name + '中,' + outOrderdet1List[i].Asset_Model_No__c + '还没开票数量小于发票数量,请确认是否有返品', '');
                    return new ResponseBodyLWC(
                        'Error',
                        500,
                        '出库单' +
                            outOrderdet1List[i].Consumable_order__r.Name +
                            '中,' +
                            outOrderdet1List[i].Asset_Model_No__c +
                            '还没开票数量小于发票数量,请确认是否有返品',
                        ''
                    );
                }
                outOrderdetUp1List.add(invoiceUpdte1);
@@ -1570,7 +1602,7 @@
        System.debug('res = ' + res);
        return res;
    }
    @TestVisible
    class InvoiceOrderInfo implements Comparable {
        @AuraEnabled
        public Boolean check { get; set; }
force-app/main/default/classes/LexConInvoicedetailsController.cls
@@ -101,6 +101,7 @@
            FROM Consumable_Orderdetails__c
            WHERE Consumable_order__c = :orderId
        ];
        System.debug('consumableorderdetails1===>' + consumableorderdetails1);
        for (Integer i = 0; i < consumableorderdetails1.size(); i++) {
            consumableorderdetails1Records.add(new ConsumableorderdetailsInfo(consumableorderdetails1[i]));
        }
@@ -153,7 +154,10 @@
        Map<String, object> data = new Map<String, object>();
        res.entity = data;
        consumableorderdetails1Records= (List<ConsumableorderdetailsInfo>)JSON.deserialize(consumableorderdetails1RecordsLwc, List<ConsumableorderdetailsInfo>.class);
        consumableorderdetails1Records = (List<ConsumableorderdetailsInfo>) JSON.deserialize(
            consumableorderdetails1RecordsLwc,
            List<ConsumableorderdetailsInfo>.class
        );
        invoiceId = invoiceIdLwc;
        orderId = orderIdLwc;
        System.debug('consumableorderdetails1Records = ' + consumableorderdetails1Records);
@@ -352,6 +356,7 @@
    }
    // Data Bean
    @TestVisible
    class ConsumableorderdetailsInfo {
        @AuraEnabled
        public Boolean check { get; set; }
@@ -379,10 +384,11 @@
            invoiceAllprice = 0;
            Packing_list_manual = e.Consumable_Product__r.Packing_list_manual__c;
            if (!Test.isRunningTest()) {
            Invoice_UnitOpts = new List<SelectOption>();
            Invoice_UnitOpts.add(new SelectOption('盒', '盒'));
            Invoice_UnitOpts.add(new SelectOption('个', '个'));
            }
            Invoice_UnitOptsMap = new Map<String,String>();
            Invoice_UnitOptsMap.put('盒', '盒');
force-app/main/default/classes/LexConsumableAccountController.cls
@@ -277,7 +277,6 @@
                    accountList.add(String.valueOf(ar.get('hospitalName')));
                    topInfo.deList.add(Decimal.valueOf(String.valueOf(ar.get('thisAmount'))));
                }
            }
            System.debug('accountList = ' + accountList);
            System.debug('topInfo = ' + topInfo);
force-app/main/default/classes/LexConsumableAccountInfoController.cls
force-app/main/default/classes/LexConsumableAccountSOQL.cls
@@ -1,16 +1,15 @@
public with sharing class LexConsumableAccountSOQL {
    public static AggregateResult[] getAccountBySales(Datetime thisDatetime ,Datetime nextDatetime){
        AggregateResult[] arList = new List<AggregateResult>([
        AggregateResult[] arList = new List<AggregateResult>(
            [
            SELECT count(id), Consumable_order__r.Order_ForHospital__r.name hospitalName, sum(Sale_amount__c) thisAmount
            FROM Consumable_Orderdetails__c
            WHERE
                CreatedDate >= :thisDatetime
                AND CreatedDate < :nextDatetime
                AND Consumable_order__r.Order_ForHospital__r.name != ''
                WHERE CreatedDate >= :thisDatetime AND CreatedDate < :nextDatetime AND Consumable_order__r.Order_ForHospital__r.name != ''
            GROUP BY Consumable_order__r.Order_ForHospital__r.Name
            ORDER BY sum(Sale_amount__c) DESC
            LIMIT 10
        ]);
            ]
        );
        return arList;
    }
@@ -22,6 +21,4 @@
        ];
        return saleAmountList;
    }
}
force-app/main/default/classes/LexConsumableController.cls
@@ -241,8 +241,7 @@
            OSHFLG = Useracc[0].OSHFLG__c; //lt 20230517 安徽两票制 add
            if(OSHFLG){
                agencyProType1 = 'OSH';
            }
            else if(String.isBlank(Useracc[0].UserPro_Type__c)){
            } else if (String.isBlank(Useracc[0].UserPro_Type__c)) {
                agencyProType1 = 'ET';
            }
            //lt 20230526 安徽两票制 end
@@ -264,9 +263,9 @@
                    RecordType.DeveloperName = 'AgencyContract'
                    AND Contract_Decide_Start_Date__c <= :dateToday
                    AND Contract_Decide_End_Date__c >= :dateToday
                    and Contact_Type__c like :agencyProType1//lt 20230517 安徽两票制 add 1
                    and Agent_Ref__c =:accountid
                    and OSH_Dealer__c =: OSHFLG  //lt 20230517 安徽两票制 add
                    AND Contact_Type__c LIKE :agencyProType1 //lt 20230517 安徽两票制 add 1
                    AND Agent_Ref__c = :accountid
                    AND OSH_Dealer__c = :OSHFLG //lt 20230517 安徽两票制 add
            ];
            for (Account contract : contractList) {
                contactDealer.add(contract.Id);
@@ -330,7 +329,7 @@
                    FROM Account
                    WHERE
                        ParentId = :accountid
                        AND Contact_Type__c like :agencyProType1 //lt 20230517 安徽两票制 add 1
                        AND Contact_Type__c LIKE :agencyProType1 //lt 20230517 安徽两票制 add 1
                        AND Contract_Decide_Start_Date__c <= :Date.Today()
                        AND Contract_Decide_End_Date__c >= :Date.Today()
                        AND OSH_Dealer__c =: OSHFLG  //lt 20230517 安徽两票制 add
@@ -382,7 +381,16 @@
                }
                consumableorderdetailsRecords.sort();
                if (methodType != null && methodType != '' && (methodType.equals('hospitalorder') || methodType.equals('promotionorder'))) {
                    searchorderdetails(methodType,accountid,hospitalId,contractId,userWorkLocation,accountName,proLimitAndDate,editAble);
                    searchorderdetails(
                        methodType,
                        accountid,
                        hospitalId,
                        contractId,
                        userWorkLocation,
                        accountName,
                        proLimitAndDate,
                        editAble
                    );
                    isfirst = true;
                }
                getPageInfo();
@@ -543,10 +551,21 @@
                //         attachmentRecoeds.add(new ConsumableorderdetailsInfo(attachmentinfo[i]));
                //     }
                // }
                List<ContentVersion> cvInfo = [SELECT Id, Title, OwnerId,Owner.Name, CreatedDate,ContentDocumentId FROM ContentVersion WHERE FirstPublishLocationId = :ESetId];
                List<ContentDocumentLink> links = [SELECT Id, ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :ESetId];
                if (links != null && links.size() > 0) {
                    List<String> documentIds = new List<String>();
                    for (ContentDocumentLink link : links) {
                        documentIds.add(link.ContentDocumentId);
                    }
                    List<ContentVersion> cvInfo = [
                        SELECT Id, Title, OwnerId, Owner.Name, CreatedDate, ContentDocumentId
                        FROM ContentVersion
                        WHERE ContentDocumentId IN :documentIds
                    ];
                if (cvInfo.size() > 0) {
                    for (Integer i = 0; i < cvInfo.size(); i++) {
                        attachmentRecoeds.add(new ConsumableorderdetailsInfo(cvInfo[i]));
                        }
                    }
                }
                //
@@ -949,7 +968,10 @@
        editAble = editAbleStr;
        proLimitAndDate = proLimitAndDateList;
        dealerProductId = (List<String>)JSON.deserialize(dealerProductIdStr, List<String>.class);
        consumableorderdetailsRecordsview = (List<ConsumableorderdetailsInfo>)JSON.deserialize(consumableorderdetailsRecordsviewStr, List<ConsumableorderdetailsInfo>.class);
        consumableorderdetailsRecordsview = (List<ConsumableorderdetailsInfo>) JSON.deserialize(
            consumableorderdetailsRecordsviewStr,
            List<ConsumableorderdetailsInfo>.class
        );
        size = Integer.valueOf(System.Label.orderdetLimitsize);
        pageLimit = Integer.valueOf(System.Label.orderdetPageLimitsize);
        try {
@@ -1618,7 +1640,20 @@
        Boolean OSHFLGStr
    ) {
        ESetId = '';
        return save(contractNameStr,cocStr,agencyProTypeStr,accountidStr,consumableorderdetailsRecordsviewStr,contactDealerStr,methodTypeStr,ESetId,hospitalIdStr,contractIdStr,agencyProType1Str,OSHFLGStr);
        return save(
            contractNameStr,
            cocStr,
            agencyProTypeStr,
            accountidStr,
            consumableorderdetailsRecordsviewStr,
            contactDealerStr,
            methodTypeStr,
            ESetId,
            hospitalIdStr,
            contractIdStr,
            agencyProType1Str,
            OSHFLGStr
        );
    }
    //保存按钮 
@@ -1652,7 +1687,10 @@
        coc = (Consumable_order__c)JSON.deserialize(cocStr, Consumable_order__c.class);
        contactDealer = (List<String>)JSON.deserialize(contactDealerStr, List<String>.class);
        System.debug('consumableorderdetailsRecordsviewStr:'+consumableorderdetailsRecordsviewStr);
        consumableorderdetailsRecordsview = (List<ConsumableorderdetailsInfo>)JSON.deserialize(consumableorderdetailsRecordsviewStr, List<ConsumableorderdetailsInfo>.class);
        consumableorderdetailsRecordsview = (List<ConsumableorderdetailsInfo>) JSON.deserialize(
            consumableorderdetailsRecordsviewStr,
            List<ConsumableorderdetailsInfo>.class
        );
        if(coc.Offers_Price__c != null){
            String offerStr = String.valueOf(coc.Offers_Price__c);
            bargainPrice = Decimal.valueOf(offerStr.replace(',',''));
@@ -1673,7 +1711,7 @@
                    AND Id =: contractId   //lt 20230517 安徽两票制 add
                    AND Contract_Decide_Start_Date__c <= :Date.Today()
                    AND Contract_Decide_End_Date__c >= :Date.Today()
                    AND Contact_Type__c like :agencyProType1  //lt 20230517 安徽两票制 add 1
                    AND Contact_Type__c LIKE :agencyProType1 //lt 20230517 安徽两票制 add 1
                    AND Agent_Ref__c =:accountid
                    AND OSH_Dealer__c =: OSHFLG  //lt 20230517 安徽两票制 add
            ];
@@ -1728,9 +1766,10 @@
            }
            //=======================================医院特价,有金额的话取金额
            Map<String, Decimal> dealerHospitalmMap = new Map<String, Decimal>();
            List<hospitalprice__c> hplist = [select Id,hospital__c,mPrice__c,pPrice__c,product__c,account__c
                                                from hospitalprice__c
                                                where product__c in :tpids and mPrice__c <> null and account__c=:accountid
            List<hospitalprice__c> hplist = [
                SELECT Id, hospital__c, mPrice__c, pPrice__c, product__c, account__c
                FROM hospitalprice__c
                WHERE product__c IN :tpids AND mPrice__c != NULL AND account__c = :accountid
                                                ];
            for (hospitalprice__c dealerProduct : hplist) {
                if (dealerProduct.mPrice__c != null) {                   
@@ -1817,7 +1856,7 @@
                WHERE
                    Name = :contractName
                    AND Id =: contractId   //lt 20230517 安徽两票制 add
                    AND Contact_Type__c like :agencyProType1  //lt 20230517 安徽两票制 add  1
                    AND Contact_Type__c LIKE :agencyProType1 //lt 20230517 安徽两票制 add  1
                    AND Contact_Type__c LIKE :agencyProType
                    AND Contract_Decide_Start_Date__c <= :Date.Today()
                    AND Contract_Decide_End_Date__c >= :Date.Today()
@@ -1894,7 +1933,10 @@
                                //医院特价
                                Consumable_order[0].Order_ForHospital__c = hospitalId;
                                Consumable_order[0].orderPattern__c = 'hospitalorder';
                                if (dealerHospitalmMap.containsKey(hospitalId + ass.Prod.Id) && dealerHospitalmMap.get(hospitalId + ass.Prod.Id) != null) {
                                if (
                                    dealerHospitalmMap.containsKey(hospitalId + ass.Prod.Id) &&
                                    dealerHospitalmMap.get(hospitalId + ass.Prod.Id) != null
                                ) {
                                    //直接根据促销金额计算
                                    InsAfterDel.Intra_Trade_List_RMB__c = dealerHospitalmMap.get(''+ hospitalId + ass.Prod.Id);        
                                }
@@ -1987,7 +2029,10 @@
                                Consumable_order[0].orderPattern__c = 'hospitalorder';
                                //医院特价
                                Consumable_order[0].Order_ForHospital__c = hospitalId;
                                if (dealerHospitalmMap.containsKey(hospitalId + ass.Prod.Id) && dealerHospitalmMap.get(hospitalId + ass.Prod.Id) != null) {
                                if (
                                    dealerHospitalmMap.containsKey(hospitalId + ass.Prod.Id) &&
                                    dealerHospitalmMap.get(hospitalId + ass.Prod.Id) != null
                                ) {
                                    //直接根据促销金额计算
                                    InsAfterDel.Intra_Trade_List_RMB__c = dealerHospitalmMap.get(''+ hospitalId + ass.Prod.Id);        
                                }
@@ -2025,7 +2070,7 @@
            List<ContentVersion> cvInfo = [SELECT Id FROM ContentVersion WHERE FirstPublishLocationId = :cocId];
            ContentVersion conVersion = [SELECT ContentDocumentId FROM ContentVersion WHERE Id = :contentVersionId];
            String contentDocumentId = conVersion.ContentDocumentId;
            ContentDocument conDocument =  [SELECT Id FROM ContentDocument where Id = :contentDocumentId];
            ContentDocument conDocument = [SELECT Id FROM ContentDocument WHERE Id = :contentDocumentId];
            delete conDocument;
            if(cvInfo.size() <= 1){
                Consumable_order__c c = [SELECT Id FROM Consumable_order__c WHERE Id =:cocId];
@@ -2116,7 +2161,6 @@
        public Decimal prodIntraTradeList { get; set; }
        @AuraEnabled
        public Decimal consumableCount { get; set; }
        // 已存产品明细
        public ConsumableorderdetailsInfo(Consumable_Orderdetails__c e) {
force-app/main/default/classes/LexConsumableGoodsInfo.cls
@@ -1,5 +1,4 @@
public without sharing class LexConsumableGoodsInfo {
    //所有产品一览
    @AuraEnabled
    public static Results initTotalNum(String ordId, String type){
@@ -12,9 +11,11 @@
        try {
            if(!(orderId.size() > 0)){
                String userId = UserInfo.getUserId();
                List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c
                List<User> userList = [
                    SELECT accountid, Work_Location__c, UserPro_Type__c
                                FROM user
                                WHERE id = :userId ];
                    WHERE id = :userId
                ];
                String accountid = userList[0].accountid;
                String userPro_Type = userList[0].UserPro_Type__c;
                String userWorklocation = userList[0].Work_Location__c;
@@ -22,9 +23,32 @@
                List<Consumable_order__c> conorderlist = new List<Consumable_order__c>();
                //20200916 ljh update start
                if(type !=null && type.equals('all')){
                    conorderlist  = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0)  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
                    conorderlist = [
                        SELECT id, Owner.Name
                        FROM Consumable_order__c
                        WHERE
                            Order_type__c = '订单'
                            AND recordtypeid = :rtTypeDelivery
                            AND Dealer_Info__c = :accountid
                            AND (OrderNumber_notarrive__c > 0
                            OR Delivery_detail_count__c > 0)
                            AND Order_ProType__c = :userPro_Type
                            AND Order_Owner_WorkLocal__c = :userWorklocation
                            AND showFalseNotshowTrue__c = FALSE
                    ];
                }else{
                    conorderlist  = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and  Delivery_detail_count__c >0  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
                    conorderlist = [
                        SELECT id, Owner.Name
                        FROM Consumable_order__c
                        WHERE
                            Order_type__c = '订单'
                            AND recordtypeid = :rtTypeDelivery
                            AND Dealer_Info__c = :accountid
                            AND Delivery_detail_count__c > 0
                            AND Order_ProType__c = :userPro_Type
                            AND Order_Owner_WorkLocal__c = :userWorklocation
                            AND showFalseNotshowTrue__c = FALSE
                    ];
                }
                for(Consumable_order__c conorder : conorderlist){
                    String temp = (String)conorder.Id;
@@ -34,7 +58,11 @@
            }
            List<Consumable_Orderdetails__c> conOrderList1 = new List<Consumable_Orderdetails__c>();
            conOrderList1 = [SELECT Asset_Model_No__c ,Consumable_count__c FROM Consumable_Orderdetails__c WHERE Consumable_order__c =:orderId];
            conOrderList1 = [
                SELECT Asset_Model_No__c, Consumable_count__c
                FROM Consumable_Orderdetails__c
                WHERE Consumable_order__c = :orderId
            ];
            
            Map<String,Decimal> allConOrderMap = new Map<String,Decimal>();
            for(Consumable_Orderdetails__c con : conOrderList1){
@@ -70,7 +98,11 @@
        Results results = new Results();
        List<ShowRecords> arrDetIifo = new List<ShowRecords>();
        try{
            List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = true AND Consumable_order_minor__c = :orderId];
            List<Consumable_order_details2__c> conList = [
                SELECT id, Bar_Code__c
                FROM Consumable_order_details2__c
                WHERE Dealer_Arrive__c = TRUE AND Consumable_order_minor__c = :orderId
            ];
            Map<String,String> srtMap = new Map<String,String>();
            for(Consumable_order_details2__c con : conList){
                srtMap.put(con.Bar_Code__c, con.Id);
@@ -79,9 +111,12 @@
            for(String s : srtMap.keySet()){
                str.add(srtMap.get(s));
            }
            List<AggregateResult> arrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
            List<AggregateResult> arrDetList = [
                SELECT Asset_Model_No__c prodModel, count(Id) recordCount
                FROM Consumable_order_details2__c
                            WHERE Id =: str
                            GROUP BY Asset_Model_No__c];
                GROUP BY Asset_Model_No__c
            ];
            for(Integer i = 0 ; i< arrDetList.size();i++){
                arrDetIifo.add(new showRecords(arrDetList[i]));
            }
@@ -101,9 +136,11 @@
        List<ShowRecords> allArrDetIifo = new List<ShowRecords>();
        try{
            String userId = UserInfo.getUserId();
            List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c
            List<User> userList = [
                SELECT accountid, Work_Location__c, UserPro_Type__c
                            FROM user
                            WHERE id = :userId ];
                WHERE id = :userId
            ];
            String accountid = userList[0].accountid;
            String userPro_Type = userList[0].UserPro_Type__c;
            String userWorklocation = userList[0].Work_Location__c;
@@ -113,9 +150,32 @@
            //20200916 ljh update start
            //conorderlist  = [select id,name,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and  Delivery_detail_count__c >0  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation];
            if(type !=null && type.equals('all')){
                conorderlist  = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0)  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
                conorderlist = [
                    SELECT id, Owner.Name
                    FROM Consumable_order__c
                    WHERE
                        Order_type__c = '订单'
                        AND recordtypeid = :rtTypeDelivery
                        AND Dealer_Info__c = :accountid
                        AND (OrderNumber_notarrive__c > 0
                        OR Delivery_detail_count__c > 0)
                        AND Order_ProType__c = :userPro_Type
                        AND Order_Owner_WorkLocal__c = :userWorklocation
                        AND showFalseNotshowTrue__c = FALSE
                ];
            }else{
                conorderlist  = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and  Delivery_detail_count__c >0  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
                conorderlist = [
                    SELECT id, Owner.Name
                    FROM Consumable_order__c
                    WHERE
                        Order_type__c = '订单'
                        AND recordtypeid = :rtTypeDelivery
                        AND Dealer_Info__c = :accountid
                        AND Delivery_detail_count__c > 0
                        AND Order_ProType__c = :userPro_Type
                        AND Order_Owner_WorkLocal__c = :userWorklocation
                        AND showFalseNotshowTrue__c = FALSE
                ];
            }
            //20200916 ljh update end
            // List<Consumable_order__c> conorderlist  = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c > 0  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation];
@@ -132,9 +192,24 @@
            //20200916 ljh update start
            //conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = true AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
            if(type !=null && type.equals('all')){
                conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = true AND Consumable_order_minor__c = :orderId AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
                conList = [
                    SELECT id, Bar_Code__c
                    FROM Consumable_order_details2__c
                    WHERE
                        Dealer_Arrive__c = TRUE
                        AND Consumable_order_minor__c = :orderId
                        AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
                ];
            }else{
                conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = true AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
                conList = [
                    SELECT id, Bar_Code__c
                    FROM Consumable_order_details2__c
                    WHERE
                        Dealer_Arrive__c = TRUE
                        AND Consumable_order_minor__c = :orderId
                        AND Deliver_date__c < :orderdate
                        AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
                ];
            }
            //20200916 ljh update end  
            // List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
@@ -146,9 +221,12 @@
            for(String s : srtMap.keySet()){
                str.add(srtMap.get(s));
            }
            List<AggregateResult> arrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
            List<AggregateResult> arrDetList = [
                SELECT Asset_Model_No__c prodModel, count(Id) recordCount
                FROM Consumable_order_details2__c
                            WHERE Id =: str 
                            GROUP BY Asset_Model_No__c];
                GROUP BY Asset_Model_No__c
            ];
            // List<showRecords> allArrDetIifo = new List<showRecords>();
            for(Integer i = 0 ; i< arrDetList.size();i++){
                allArrDetIifo.add(new showRecords(arrDetList[i]));
@@ -168,10 +246,12 @@
        Results results = new Results();
        List<ShowRecords> notArrDetIifo = new List<ShowRecords>();
        try{
            List<AggregateResult> notArrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
                        WHERE Dealer_Arrive__c = false
                        AND Consumable_order_minor__c = :orderId
                        GROUP BY Asset_Model_No__c];
            List<AggregateResult> notArrDetList = [
                SELECT Asset_Model_No__c prodModel, count(Id) recordCount
                FROM Consumable_order_details2__c
                WHERE Dealer_Arrive__c = FALSE AND Consumable_order_minor__c = :orderId
                GROUP BY Asset_Model_No__c
            ];
            for(Integer i = 0 ; i< notArrDetList.size();i++){
                notArrDetIifo.add(new showRecords(notArrDetList[i]));
            }
@@ -191,9 +271,11 @@
        List<ShowRecords> allNotArrDetIifo = new List<ShowRecords>();
        try{
            String userId = UserInfo.getUserId();
            List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c
            List<User> userList = [
                SELECT accountid, Work_Location__c, UserPro_Type__c
                            FROM user
                            WHERE id = :userId ];
                WHERE id = :userId
            ];
            String accountid = userList[0].accountid;
            String userPro_Type = userList[0].UserPro_Type__c;
            String userWorklocation = userList[0].Work_Location__c;
@@ -203,9 +285,32 @@
            //20200916 ljh update start
            //conorderlist  = [select id,name,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and  Delivery_detail_count__c >0  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation];
            if(type !=null && type.equals('all')){
                conorderlist  = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0)  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
                conorderlist = [
                    SELECT id, Owner.Name
                    FROM Consumable_order__c
                    WHERE
                        Order_type__c = '订单'
                        AND recordtypeid = :rtTypeDelivery
                        AND Dealer_Info__c = :accountid
                        AND (OrderNumber_notarrive__c > 0
                        OR Delivery_detail_count__c > 0)
                        AND Order_ProType__c = :userPro_Type
                        AND Order_Owner_WorkLocal__c = :userWorklocation
                        AND showFalseNotshowTrue__c = FALSE
                ];
            }else{
                conorderlist  = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and  Delivery_detail_count__c >0  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
                conorderlist = [
                    SELECT id, Owner.Name
                    FROM Consumable_order__c
                    WHERE
                        Order_type__c = '订单'
                        AND recordtypeid = :rtTypeDelivery
                        AND Dealer_Info__c = :accountid
                        AND Delivery_detail_count__c > 0
                        AND Order_ProType__c = :userPro_Type
                        AND Order_Owner_WorkLocal__c = :userWorklocation
                        AND showFalseNotshowTrue__c = FALSE
                ];
            }
            //20200916 ljh update end
            // List<Consumable_order__c> conorderlist  = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c > 0  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation];
@@ -218,13 +323,28 @@
                orderId.add(conorder.Id);
            }
            System.debug('ANY o'+orderId);
            List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
            //20200916 ljh update start
            //conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
            List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
            if(type !=null && type.equals('all')){
                conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
                conList = [
                    SELECT id, Bar_Code__c
                    FROM Consumable_order_details2__c
                    WHERE
                        Dealer_Arrive__c = FALSE
                        AND Consumable_order_minor__c = :orderId
                        AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
                ];
            }else{
                conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
                conList = [
                    SELECT id, Bar_Code__c
                    FROM Consumable_order_details2__c
                    WHERE
                        Dealer_Arrive__c = FALSE
                        AND Consumable_order_minor__c = :orderId
                        AND Deliver_date__c < :orderdate
                        AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
                ];
            }
            //20200916 ljh update end   
            // List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
@@ -236,9 +356,12 @@
            for(String s : srtMap.keySet()){
                str.add(srtMap.get(s));
            }
            List<AggregateResult> arrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
                            WHERE Id =: str and Cancellation_Flag__c = false
                            GROUP BY Asset_Model_No__c];
            List<AggregateResult> arrDetList = [
                SELECT Asset_Model_No__c prodModel, count(Id) recordCount
                FROM Consumable_order_details2__c
                WHERE Id = :str AND Cancellation_Flag__c = FALSE
                GROUP BY Asset_Model_No__c
            ];
            // List<showRecords> allArrDetIifo = new List<showRecords>();
            for(Integer i = 0 ; i< arrDetList.size();i++){
                allNotArrDetIifo.add(new showRecords(arrDetList[i]));
@@ -263,7 +386,11 @@
            List<showRecords> notArrDetIifo = new List<showRecords>();
            List<showRecords> allArrDetIifo = new List<showRecords>();
            // List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = true AND Consumable_order_minor__c = :orderId];
            List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Consumable_order_minor__c = :orderId];
            List<Consumable_order_details2__c> conList = [
                SELECT id, Bar_Code__c
                FROM Consumable_order_details2__c
                WHERE Consumable_order_minor__c = :orderId
            ];
            Map<String,String> srtMap = new Map<String,String>();
            for(Consumable_order_details2__c con : conList){
                srtMap.put(con.Bar_Code__c, con.Id);
@@ -272,17 +399,22 @@
            for(String s : srtMap.keySet()){
                str.add(srtMap.get(s));
            }
            List<AggregateResult> arrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
                            WHERE Id =: str AND Dealer_Arrive__c = true
                            GROUP BY Asset_Model_No__c];
            List<AggregateResult> arrDetList = [
                SELECT Asset_Model_No__c prodModel, count(Id) recordCount
                FROM Consumable_order_details2__c
                WHERE Id = :str AND Dealer_Arrive__c = TRUE
                GROUP BY Asset_Model_No__c
            ];
            for(Integer i = 0 ; i< arrDetList.size();i++){
                arrDetIifo.add(new showRecords(arrDetList[i]));
            }
            List<AggregateResult> notArrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
                            WHERE Dealer_Arrive__c = false
                            AND Consumable_order_minor__c = :orderId
                            GROUP BY Asset_Model_No__c];
            List<AggregateResult> notArrDetList = [
                SELECT Asset_Model_No__c prodModel, count(Id) recordCount
                FROM Consumable_order_details2__c
                WHERE Dealer_Arrive__c = FALSE AND Consumable_order_minor__c = :orderId
                GROUP BY Asset_Model_No__c
            ];
            for(Integer i = 0 ; i< notArrDetList.size();i++){
                notArrDetIifo.add(new showRecords(notArrDetList[i]));
            }
@@ -290,8 +422,11 @@
            // List<AggregateResult> allArrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
            //                 WHERE Id =: str
            //                 GROUP BY Asset_Model_No__c];
            List<Consumable_Orderdetails__c> allArrDetList = [SELECT Asset_Model_No__c,Consumable_count__c FROM Consumable_Orderdetails__c
                            WHERE Consumable_order__c =: orderId];
            List<Consumable_Orderdetails__c> allArrDetList = [
                SELECT Asset_Model_No__c, Consumable_count__c
                FROM Consumable_Orderdetails__c
                WHERE Consumable_order__c = :orderId
            ];
            // for(Integer i = 0 ; i< allArrDetList.size();i++){
            //     allArrDetIifo.add(new showRecords(notArrDetList[i]));
            // }
@@ -346,9 +481,11 @@
        List<ShowRecords> allOtherDetIifo = new List<ShowRecords>();
        try{
            String userId = UserInfo.getUserId();
            List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c
            List<User> userList = [
                SELECT accountid, Work_Location__c, UserPro_Type__c
                            FROM user
                            WHERE id = :userId ];
                WHERE id = :userId
            ];
            String accountid = userList[0].accountid;
            String userPro_Type = userList[0].UserPro_Type__c;
            String userWorklocation = userList[0].Work_Location__c;
@@ -358,9 +495,32 @@
            //20200916 ljh update start
            //conorderlist  = [select id,name,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and  Delivery_detail_count__c >0  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation];
            if(type !=null && type.equals('all')){
                conorderlist  = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0)  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
                conorderlist = [
                    SELECT id, Owner.Name
                    FROM Consumable_order__c
                    WHERE
                        Order_type__c = '订单'
                        AND recordtypeid = :rtTypeDelivery
                        AND Dealer_Info__c = :accountid
                        AND (OrderNumber_notarrive__c > 0
                        OR Delivery_detail_count__c > 0)
                        AND Order_ProType__c = :userPro_Type
                        AND Order_Owner_WorkLocal__c = :userWorklocation
                        AND showFalseNotshowTrue__c = FALSE
                ];
            }else{
                conorderlist  = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and  Delivery_detail_count__c >0  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
                conorderlist = [
                    SELECT id, Owner.Name
                    FROM Consumable_order__c
                    WHERE
                        Order_type__c = '订单'
                        AND recordtypeid = :rtTypeDelivery
                        AND Dealer_Info__c = :accountid
                        AND Delivery_detail_count__c > 0
                        AND Order_ProType__c = :userPro_Type
                        AND Order_Owner_WorkLocal__c = :userWorklocation
                        AND showFalseNotshowTrue__c = FALSE
                ];
            }
            //20200916 ljh update end
            // List<Consumable_order__c> conorderlist  = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c > 0  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation];
@@ -377,9 +537,20 @@
            //20200916 ljh update start
            //conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE  Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
            if(type !=null && type.equals('all')){
                conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE  Consumable_order_minor__c = :orderId  AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
                conList = [
                    SELECT id, Bar_Code__c
                    FROM Consumable_order_details2__c
                    WHERE Consumable_order_minor__c = :orderId AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
                ];
            }else{
                conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE  Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
                conList = [
                    SELECT id, Bar_Code__c
                    FROM Consumable_order_details2__c
                    WHERE
                        Consumable_order_minor__c = :orderId
                        AND Deliver_date__c < :orderdate
                        AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
                ];
            }
            //20200916 ljh update end    
            // List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
@@ -391,15 +562,22 @@
            for(String s : srtMap.keySet()){
                str.add(srtMap.get(s));
            }
            List<AggregateResult> arrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
                            WHERE Id =: str and Cancellation_Flag__c = false
                            GROUP BY Asset_Model_No__c];
            List<AggregateResult> arrDetList = [
                SELECT Asset_Model_No__c prodModel, count(Id) recordCount
                FROM Consumable_order_details2__c
                WHERE Id = :str AND Cancellation_Flag__c = FALSE
                GROUP BY Asset_Model_No__c
            ];
            Map<String,Decimal> conOrderMap = new Map<String,Decimal>();
            for(AggregateResult agg : arrDetList){
                conOrderMap.put(String.valueOf(agg.get('prodModel')), Integer.valueOf(agg.get('recordCount')));
            }
            List<Consumable_Orderdetails__c> conOrderList1 = [SELECT Asset_Model_No__c ,Consumable_count__c FROM Consumable_Orderdetails__c WHERE Consumable_order__c =: orderId ];
            List<Consumable_Orderdetails__c> conOrderList1 = [
                SELECT Asset_Model_No__c, Consumable_count__c
                FROM Consumable_Orderdetails__c
                WHERE Consumable_order__c = :orderId
            ];
            Map<String,Decimal> allConOrderMap = new Map<String,Decimal>();
            for(Consumable_Orderdetails__c con : conOrderList1){
                if(con.Consumable_count__c == null){
@@ -441,15 +619,19 @@
        Results results = new Results();
        List<ShowRecords> morethansevendaysIifo = new List<ShowRecords>();
        try{
            List<AggregateResult> morethan7daysList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
                            WHERE Consumable_order_minor__c != null
                            AND Dealer_Shipment__c = false
                            AND Dealer_Arrive__c = false
                            AND Dealer_Saled__c = false
                            AND Consumable_order_minor__r.showFalseNotshowTrue__c = false
            List<AggregateResult> morethan7daysList = [
                SELECT Asset_Model_No__c prodModel, count(Id) recordCount
                FROM Consumable_order_details2__c
                WHERE
                    Consumable_order_minor__c != NULL
                    AND Dealer_Shipment__c = FALSE
                    AND Dealer_Arrive__c = FALSE
                    AND Dealer_Saled__c = FALSE
                    AND Consumable_order_minor__r.showFalseNotshowTrue__c = FALSE
                            AND Deliver_date__c < LAST_N_DAYS:7
                            AND Consumable_order_minor__c = :orderId
                            GROUP BY Asset_Model_No__c];
                GROUP BY Asset_Model_No__c
            ];
                            
            for(Integer i = 0 ; i< morethan7daysList.size() ; i++){
                morethansevendaysIifo.add(new showRecords(morethan7daysList[i]));
@@ -470,9 +652,11 @@
        List<ShowRecords> morethansevendaysIifo = new List<ShowRecords>();
        try{
            String userId = UserInfo.getUserId();
            List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c
            List<User> userList = [
                SELECT accountid, Work_Location__c, UserPro_Type__c
                            FROM user
                            WHERE id = :userId ];
                WHERE id = :userId
            ];
            String accountid = userList[0].accountid;
            String userPro_Type = userList[0].UserPro_Type__c;
            String userWorklocation = userList[0].Work_Location__c;
@@ -482,9 +666,32 @@
            //20200916 ljh update start
            //conorderlist  = [select id,name,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and  Delivery_detail_count__c >0  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation];
            if(type !=null && type.equals('all')){
                conorderlist  = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0)  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
                conorderlist = [
                    SELECT id, Owner.Name
                    FROM Consumable_order__c
                    WHERE
                        Order_type__c = '订单'
                        AND recordtypeid = :rtTypeDelivery
                        AND Dealer_Info__c = :accountid
                        AND (OrderNumber_notarrive__c > 0
                        OR Delivery_detail_count__c > 0)
                        AND Order_ProType__c = :userPro_Type
                        AND Order_Owner_WorkLocal__c = :userWorklocation
                        AND showFalseNotshowTrue__c = FALSE
                ];
            }else{
                conorderlist  = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and  recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and  Delivery_detail_count__c >0  and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
                conorderlist = [
                    SELECT id, Owner.Name
                    FROM Consumable_order__c
                    WHERE
                        Order_type__c = '订单'
                        AND recordtypeid = :rtTypeDelivery
                        AND Dealer_Info__c = :accountid
                        AND Delivery_detail_count__c > 0
                        AND Order_ProType__c = :userPro_Type
                        AND Order_Owner_WorkLocal__c = :userWorklocation
                        AND showFalseNotshowTrue__c = FALSE
                ];
            }
            system.debug('==============>conorderlist'+conorderlist);
            system.debug('==============>conorderlist'+conorderlist.size());
@@ -504,11 +711,26 @@
            //conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
            if(type !=null && type.equals('all')){
                system.debug('all============');
                conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
                conList = [
                    SELECT id, Bar_Code__c
                    FROM Consumable_order_details2__c
                    WHERE
                        Dealer_Arrive__c = FALSE
                        AND Consumable_order_minor__c = :orderId
                        AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
                ];
                system.debug('allconList==========='+conList.size());
            }else{
                system.debug('notall=============');
                conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
                conList = [
                    SELECT id, Bar_Code__c
                    FROM Consumable_order_details2__c
                    WHERE
                        Dealer_Arrive__c = FALSE
                        AND Consumable_order_minor__c = :orderId
                        AND Deliver_date__c < :orderdate
                        AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
                ];
                system.debug('notallconList==========='+conList.size());
            }
            //20200916 ljh update end   
@@ -521,15 +743,20 @@
            for(String s : srtMap.keySet()){
                str.add(srtMap.get(s));
            }
            List<AggregateResult> morethan7daysList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
                            WHERE Id =: str and Cancellation_Flag__c = false
                            AND Consumable_order_minor__c != null
                            AND Dealer_Shipment__c = false
                            AND Dealer_Arrive__c = false
                            AND Dealer_Saled__c = false
                            AND Consumable_order_minor__r.showFalseNotshowTrue__c = false
            List<AggregateResult> morethan7daysList = [
                SELECT Asset_Model_No__c prodModel, count(Id) recordCount
                FROM Consumable_order_details2__c
                WHERE
                    Id = :str
                    AND Cancellation_Flag__c = FALSE
                    AND Consumable_order_minor__c != NULL
                    AND Dealer_Shipment__c = FALSE
                    AND Dealer_Arrive__c = FALSE
                    AND Dealer_Saled__c = FALSE
                    AND Consumable_order_minor__r.showFalseNotshowTrue__c = FALSE
                            AND Deliver_date__c < LAST_N_DAYS:7
                            GROUP BY Asset_Model_No__c];
                GROUP BY Asset_Model_No__c
            ];
            system.debug('Morethan7daysList================>'+morethan7daysList.size());
            for(Integer i = 0 ; i< morethan7daysList.size() ; i++){
                morethansevendaysIifo.add(new showRecords(morethan7daysList[i]));
@@ -553,14 +780,14 @@
        public List<ShowRecords> recordList;
    }
    public class ShowRecords implements Comparable {
        @AuraEnabled
        public Decimal recordCount { get; set; }
        @AuraEnabled
        public String prodModel { get; set; }
        public ShowRecords() {}
        public ShowRecords() {
        }
        public ShowRecords(AggregateResult e) {
            recordCount =Integer.valueOf(e.get('recordCount'));
force-app/main/default/classes/LexInventoryController.cls
@@ -20,7 +20,8 @@
    public static  Boolean done { get; set; }
    /*****************画面表示Bean******************/
    //页面主数据显示用
    private static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords;
    // private static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords;
    public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords;
    //盘点到的产品
    public static  List<Consumable_order_details2__c> reSet = new List<Consumable_order_details2__c>();
    public static  List<Consumable_order_details2__c> showcod2nid = new List<Consumable_order_details2__c>();
@@ -31,7 +32,7 @@
    public static  List<ConsumableorderdetailsInfo> consumableorderdetailsRecordserrordummy;  // 丢失和巡回的,实际炒作用
    @AuraEnabled
    public static  List<List<ConsumableorderdetailsInfo>> consumableorderdetailsRecordsview { get; set; }       // 产品单位的List
    public static  List<Consumable_order_details2__c> InsListUp = New List<Consumable_order_details2__c>();
    public static List<Consumable_order_details2__c> InsListUp = new List<Consumable_order_details2__c>();
    public static List<ConsumableorderdetailsInfo> consumableorderdetailsviewRecords;
   
@@ -74,13 +75,21 @@
    private static void initStandardController(){
        // init standard controller
        List<Consumable_order_details2__c> showcod2 = [select Id,  Name,Consumable_Product__c,
                            Bar_Code__c,Consumable_Product__r.Name__c,
                            Asset_Model_No__c,Isoverdue__c,Box_Piece__c,
        List<Consumable_order_details2__c> showcod2 = [
            SELECT
                Id,
                Name,
                Consumable_Product__c,
                Bar_Code__c,
                Consumable_Product__r.Name__c,
                Asset_Model_No__c,
                Isoverdue__c,
                Box_Piece__c,
                            Bar_Code_search__c
                        FROM Consumable_order_details2__c
                        WHERE Id in :pandiandetailsMap.keySet()
                        order by Name desc];
            WHERE Id IN :pandiandetailsMap.keySet()
            ORDER BY Name DESC
        ];
        setConDetails2 = showcod2;
        System.debug('setConDetails2===>'+setConDetails2);
        // setCon = new ApexPages.StandardSetController(showcod2);
@@ -113,8 +122,6 @@
    // 画面初始化
    @AuraEnabled
    public static ResponseBodyLWC init() {
        ResponseBodyLWC res = new ResponseBodyLWC();
        Map<String,object> data = new Map<String,object>();
        res.entity = data;
@@ -123,13 +130,21 @@
        setConDetails2 = new List<Consumable_order_details2__c>();
        String url = '在库调整一览';
        fileName = EncodingUtil.urlEncode(url, 'UTF-8');
        List<Consumable_order_details2__c> showcod2 = [select Id,  Name,Consumable_Product__c,
                            Bar_Code__c,Consumable_Product__r.Name__c,
                            Asset_Model_No__c,Isoverdue__c,Box_Piece__c,
        List<Consumable_order_details2__c> showcod2 = [
            SELECT
                Id,
                Name,
                Consumable_Product__c,
                Bar_Code__c,
                Consumable_Product__r.Name__c,
                Asset_Model_No__c,
                Isoverdue__c,
                Box_Piece__c,
                            Bar_Code_search__c
                        FROM Consumable_order_details2__c
                        WHERE Id in :pandiandetailsMap.keySet()
                        order by Name];
            WHERE Id IN :pandiandetailsMap.keySet()
            ORDER BY Name
        ];
                        System.debug('pandiandetailsMap====>'+pandiandetailsMap);
        initStandardController();
        makepagerecords();
@@ -142,7 +157,7 @@
        String userId = UserInfo.getUserId();
        //String userId = '00510000006k82X';
        //String userId = '00510000005QO75';
        user Useracc = [select Accountid, Work_Location__c,UserPro_Type__c from user where id =:userId];
        user Useracc = [SELECT Accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :userId];
        accountid = Useracc.Accountid;
        userWorkLocation = Useracc.Work_Location__c;
        agencyProType = Useracc.UserPro_Type__c;
@@ -170,33 +185,40 @@
        //     midMap.put(productCount_Unfull_bak[i].Id, productCount_Unfull_bak[i]);
        // }
        //查询库存 追加返品库存
        List<Consumable_order_details2__c> ProductCount_Res = [select Id,  Name,Consumable_Product__c,
                                Bar_Code__c,Consumable_Product__r.Name__c,
                                Asset_Model_No__c,Isoverdue__c,Box_Piece__c
        List<Consumable_order_details2__c> ProductCount_Res = [
            SELECT
                Id,
                Name,
                Consumable_Product__c,
                Bar_Code__c,
                Consumable_Product__r.Name__c,
                Asset_Model_No__c,
                Isoverdue__c,
                Box_Piece__c
                            FROM Consumable_order_details2__c
                            WHERE Dealer_Arrive__c = true
                            AND Dealer_Shipment__c = false
                            AND Dealer_Saled__c = false
                            AND Dealer_Returned__c = false
                            AND Lose_Flag__c = false
                            AND Cancellation_Flag__c = false
                            AND Bar_Code__c !=null
                            AND Product_Type__c like : sqlagencyProType
            WHERE
                Dealer_Arrive__c = TRUE
                AND Dealer_Shipment__c = FALSE
                AND Dealer_Saled__c = FALSE
                AND Dealer_Returned__c = FALSE
                AND Lose_Flag__c = FALSE
                AND Cancellation_Flag__c = FALSE
                AND Bar_Code__c != NULL
                AND Product_Type__c LIKE :sqlagencyProType
                            AND Arrive_Owner_Work_Location__c =: userWorkLocation
                            AND  Dealer_Info_text__c = :accountName];
                AND Dealer_Info_text__c = :accountName
        ];
        //DB202302357027 消耗品追溯系统无法正常使用——盘点页面操作即报错 fy start
        //开始制作表头数据
        Set<Id> Product2cIdSet = new Set<Id>();
        for(Consumable_order_details2__c con_or_d2item: ProductCount_Res){
            Product2cIdSet.add(con_or_d2item.Consumable_Product__c);
        }
        List<Product2__c> productCount_Unfull_bak = [select Id, Name,Name__c,
                                                            SFDA_Status__c,Packing_list_manual__c,
                                                            Asset_Model_No__c
                                                        from Product2__c
        List<Product2__c> productCount_Unfull_bak = [
            SELECT Id, Name, Name__c, SFDA_Status__c, Packing_list_manual__c, Asset_Model_No__c
            FROM Product2__c
                                                        //where Estimation_Entry_Possibility__c = '○'
                                                         where Id in:Product2cIdSet
                                                         and Product_Type__c like : sqlagencyProType
            WHERE Id IN :Product2cIdSet AND Product_Type__c LIKE :sqlagencyProType
                                                        ];
        for(integer i = 0;i < productCount_Unfull_bak.size() ; i++){
            midMap.put(productCount_Unfull_bak[i].Id, productCount_Unfull_bak[i]);
@@ -209,9 +231,11 @@
        for(Integer i = 0 ; i< ProductCount_Res.size();i++){
            //然后循环CountDel做Box和piece2个map
            if(MidMap.containsKey(ProductCount_Res[i].Consumable_Product__c) && ProductCount_Res[i].Box_Piece__c == '盒'){
                if(newMidBoxMap.containsKey(ProductCount_Res[i].Consumable_Product__c+ProductCount_Res[i].Box_Piece__c)){
                    ConsumableorderdetailsInfo Jstage = newMidBoxMap.get(ProductCount_Res[i].Consumable_Product__c+ProductCount_Res[i].Box_Piece__c).clone();
                    ConsumableorderdetailsInfo Jstage = newMidBoxMap.get(
                            ProductCount_Res[i].Consumable_Product__c + ProductCount_Res[i].Box_Piece__c
                        )
                        .clone();
                    Jstage.countid = Jstage.countid+1 ;
                    if(ProductCount_Res[i].Isoverdue__c == 1){
                        Jstage.limitCount = Jstage.limitCount + 1;
@@ -219,7 +243,9 @@
                    Jstage.boxPiece = ProductCount_Res[i].Box_Piece__c;
                    newMidBoxMap.put(ProductCount_Res[i].Consumable_Product__c+ProductCount_Res[i].Box_Piece__c, Jstage);
                }else{
                    ConsumableorderdetailsInfo Jstage = new ConsumableorderdetailsInfo(MidMap.get(ProductCount_Res[i].Consumable_Product__c));
                    ConsumableorderdetailsInfo Jstage = new ConsumableorderdetailsInfo(
                        MidMap.get(ProductCount_Res[i].Consumable_Product__c)
                    );
                    Jstage.countid = Jstage.countid+1 ;
                    if(ProductCount_Res[i].Isoverdue__c == 1){
                        Jstage.limitCount = Jstage.limitCount + 1;
@@ -229,7 +255,10 @@
                }
            }else if(MidMap.containsKey(ProductCount_Res[i].Consumable_Product__c) && ProductCount_Res[i].Box_Piece__c == '个'){
                if(newMidPieceMap.containsKey(ProductCount_Res[i].Consumable_Product__c+ProductCount_Res[i].Box_Piece__c)){
                    ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(ProductCount_Res[i].Consumable_Product__c+ProductCount_Res[i].Box_Piece__c).clone();
                    ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(
                            ProductCount_Res[i].Consumable_Product__c + ProductCount_Res[i].Box_Piece__c
                        )
                        .clone();
                    Jstage.countid = Jstage.countid+1 ;
                    if(ProductCount_Res[i].Isoverdue__c == 1){
                        Jstage.limitCount = Jstage.limitCount + 1;
@@ -237,7 +266,9 @@
                    Jstage.boxPiece = ProductCount_Res[i].Box_Piece__c;
                    newMidPieceMap.put(ProductCount_Res[i].Consumable_Product__c+ProductCount_Res[i].Box_Piece__c, Jstage);
                }else{
                    ConsumableorderdetailsInfo Jstage = new ConsumableorderdetailsInfo(MidMap.get(ProductCount_Res[i].Consumable_Product__c));
                    ConsumableorderdetailsInfo Jstage = new ConsumableorderdetailsInfo(
                        MidMap.get(ProductCount_Res[i].Consumable_Product__c)
                    );
                    Jstage.countid = Jstage.countid+1 ;
                    if(ProductCount_Res[i].Isoverdue__c == 1){
                        Jstage.limitCount = Jstage.limitCount + 1;
@@ -268,10 +299,6 @@
        }
        //consumableorderdetailsCount = consumableorderdetailsRecords.size();
        listCut();
        data.put('ConsumableorderdetailsRecordsview',JSON.serialize(ConsumableorderdetailsRecordsview));
        data.put('userWorkLocation',userWorkLocation);
@@ -318,7 +345,7 @@
    //========20160311======ADD_Start================================
    public static  List<String> ParseBarCode(String Code){
        Map<String,Integer> barcodeCountMap = new Map<String,Integer>();
        String[] Cache = new String[]{};
        String[] Cache = new List<String>{};
        Cache = Code.split('\n');
        List <String> Buff = new List<String>();
        for(String A : Cache){
@@ -331,10 +358,7 @@
            Buff.add(A + barcodeCountMap.get(A));
        }
        return Buff;
    }
    //test
@@ -345,14 +369,27 @@
    //========20160311======ADD_End==================================
    // BarCode录入
    @AuraEnabled
    public static ResponseBodyLWC searchConsumableorderdetails(String agencyProType,String userWorkLocation,String accountName,String barcode,String consumableorderdetailsRecordsLWC,Integer pageSizeLWC, Integer pageTokenLWC, String sortFieldLWC, String sortOrderLWC){
    public static ResponseBodyLWC searchConsumableorderdetails(
        String agencyProType,
        String userWorkLocation,
        String accountName,
        String barcode,
        String consumableorderdetailsRecordsLWC,
        Integer pageSizeLWC,
        Integer pageTokenLWC,
        String sortFieldLWC,
        String sortOrderLWC
    ) {
        pageSize = pageSizeLWC;
        pageToken = pageTokenLWC;
        sortField = sortFieldLWC;
        sortOrder = sortOrderLWC;
        System.debug('===>consumableorderdetailsRecordsLWC'+consumableorderdetailsRecordsLWC);
        List<ConsumableorderdetailsInfo> consumableorderdetailsRecords = (List<ConsumableorderdetailsInfo>)JSON.deserialize(consumableorderdetailsRecordsLWC,List<ConsumableorderdetailsInfo>.class);
        List<ConsumableorderdetailsInfo> consumableorderdetailsRecords = (List<ConsumableorderdetailsInfo>) JSON.deserialize(
            consumableorderdetailsRecordsLWC,
            List<ConsumableorderdetailsInfo>.class
        );
        // ConsumableorderdetailsInfo[] consumableorderdetailsRecords=(List<ConsumableorderdetailsInfo>)JSON.deserialize(consumableorderdetailsRecordsLWC,List<ConsumableorderdetailsInfo>.class);
       system.debug('=====>consumableorderdetailsRecordsLWC'+consumableorderdetailsRecordsLWC);
        ResponseBodyLWC res = new ResponseBodyLWC();
@@ -360,9 +397,9 @@
        res.entity = data;
        sqlagencyProType = '%' + agencyProType + '%';
        System.debug('sqlagencyProType==>' + sqlagencyProType);
        System.debug('accountName==>' + accountName);
        System.debug('userWorkLocation==>' + userWorkLocation);
        /* BarCodelist做成 */
        //FIXME barcodeSet 做成,ProductCount_ResSet 做成
@@ -370,22 +407,34 @@
        pandiandetailsListShow = new List<List<Consumable_order_details2__c>>();
        done = false;
        List<String> BarCodeListP = ParseBarCode( barcode );
        System.debug('BarCodeListP===>' + BarCodeListP);
        //查询库存 追加返品库存
        List<Consumable_order_details2__c> ProductCount_Res = [select Id,  Name,Consumable_Product__c,
                                Bar_Code__c,Consumable_Product__r.Name__c,Dealer_Info_text__c,
                                Asset_Model_No__c,Isoverdue__c,Box_Piece__c,
        List<Consumable_order_details2__c> ProductCount_Res = [
            SELECT
                Id,
                Name,
                Consumable_Product__c,
                Bar_Code__c,
                Consumable_Product__r.Name__c,
                Dealer_Info_text__c,
                Asset_Model_No__c,
                Isoverdue__c,
                Box_Piece__c,
                                Bar_Code_search__c
                            FROM Consumable_order_details2__c
                            WHERE Dealer_Arrive__c = true
                            AND Dealer_Shipment__c = false
                            AND Dealer_Saled__c = false
                            AND Dealer_Returned__c = false
                            AND Lose_Flag__c = false
                            AND Cancellation_Flag__c = false
                            AND Bar_Code__c !=null
                            AND Product_Type__c like : sqlagencyProType
            WHERE
                Dealer_Arrive__c = TRUE
                AND Dealer_Shipment__c = FALSE
                AND Dealer_Saled__c = FALSE
                AND Dealer_Returned__c = FALSE
                AND Lose_Flag__c = FALSE
                AND Cancellation_Flag__c = FALSE
                AND Bar_Code__c != NULL
                AND Product_Type__c LIKE :sqlagencyProType
                            AND Arrive_Owner_Work_Location__c =: userWorkLocation
                            AND  Dealer_Info_text__c = :accountName ];
                AND Dealer_Info_text__c = :accountName
        ];
        System.debug('ProductCount_Res==>' + ProductCount_Res);
        reFindProduct.clear();
        Map<String,ConsumableorderdetailsInfo> barCodeListAdjustMap = new  Map<String,ConsumableorderdetailsInfo>();
        //barCodeListLoseMap.clear();
@@ -408,11 +457,14 @@
                if(ass.check==true){
                    //ass.Diff = ass.countid - ass.Pandian;
                    for(integer i = 0 ; i < ProductCount_Res.size();i++){
                        System.debug('Pro==>' + ProductCount_Res[i].Consumable_Product__c);
                        System.debug('ProId==>' + ass.Prod.Id);
                        System.debug('ass.boxPiece ==>' + ass.boxPiece);
                        System.debug('boxPiece ==>' + ProductCount_Res[i].Box_Piece__c);
                        if(ProductCount_Res[i].Consumable_Product__c == ass.Prod.Id && ass.boxPiece == ProductCount_Res[i].Box_Piece__c){
                            if(carCodeListLose.contains(ProductCount_Res[i].Bar_Code__c)){
                                continue;
                            }else{
                                //consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(ProductCount_Res[i],'丢失'));
                                //pandiandetailsMap.put(ProductCount_Res[i].Id, '丢失');
                                ////barCodeListLoseMap.put(ProductCount_Res[i].Id, new ConsumableorderdetailsInfo(ProductCount_Res[i]));
@@ -424,47 +476,65 @@
            }
            //已经出库的产品
            List<Consumable_order_details2__c>  reSet1 = [SELECT Id,  Name,Consumable_Product__c,
                            Bar_Code__c,Consumable_Product__r.Name__c,
                            Asset_Model_No__c,Isoverdue__c,Box_Piece__c,
                            Bar_Code_search__c,Dealer_Info_text__c
            List<Consumable_order_details2__c> reSet1 = [
                SELECT
                    Id,
                    Name,
                    Consumable_Product__c,
                    Bar_Code__c,
                    Consumable_Product__r.Name__c,
                    Asset_Model_No__c,
                    Isoverdue__c,
                    Box_Piece__c,
                    Bar_Code_search__c,
                    Dealer_Info_text__c
                        FROM Consumable_order_details2__c
                        WHERE Dealer_Arrive__c = TRUE
                WHERE
                    Dealer_Arrive__c = TRUE
                        AND  (Dealer_Shipment__c= TRUE
                        or  Dealer_Saled__c = TRUE)
                    OR Dealer_Saled__c = TRUE)
                        AND  Dealer_Returned__c = FALSE
                        AND  Cancellation_Flag__c = FALSE
                        AND  Bar_Code__c in :carCodeListLose
                    AND Bar_Code__c IN :carCodeListLose
                        AND Dealer_Info_text__c = :accountName
                        ORDER BY Name ];
                ORDER BY Name
            ];
            Map<String,Consumable_order_details2__c> needreturnMap = new Map<String,Consumable_order_details2__c>();
            for(Consumable_order_details2__c cod2 :reSet1){
                needreturnMap.put(cod2.Bar_Code__c,cod2);
            }
            // 经销商之间或者同一经销商不同工作地调货
            reSet1 = [SELECT Id,  Name,Consumable_Product__c,
                            Bar_Code__c,Consumable_Product__r.Name__c,
                            Asset_Model_No__c,Isoverdue__c,Box_Piece__c,
                            Bar_Code_search__c,Dealer_Info_text__c
            reSet1 = [
                SELECT
                    Id,
                    Name,
                    Consumable_Product__c,
                    Bar_Code__c,
                    Consumable_Product__r.Name__c,
                    Asset_Model_No__c,
                    Isoverdue__c,
                    Box_Piece__c,
                    Bar_Code_search__c,
                    Dealer_Info_text__c
                        FROM Consumable_order_details2__c
                        WHERE Dealer_Arrive__c = TRUE
                WHERE
                    Dealer_Arrive__c = TRUE
                        AND  Dealer_Shipment__c= FALSE
                        AND  Dealer_Saled__c = FALSE
                        AND  Dealer_Returned__c = FALSE
                        AND  Cancellation_Flag__c = FALSE
                        AND  Bar_Code__c in :carCodeListLose
                    AND Bar_Code__c IN :carCodeListLose
                        AND (Dealer_Info_text__c != :accountName
                            OR (Dealer_Info_text__c = :accountName
                                AND Arrive_Owner_Work_Location__c != :userWorkLocation)
                        )
                        ORDER BY Name ];
                    AND Arrive_Owner_Work_Location__c != :userWorkLocation))
                ORDER BY Name
            ];
            Map<String,Consumable_order_details2__c> otherAgProMap = new Map<String,Consumable_order_details2__c>();
            for(Consumable_order_details2__c cod2 :reSet1){
                otherAgProMap.put(cod2.Bar_Code__c,cod2);
            }
            carCodeListLose.clear();
            for(ConsumableorderdetailsInfo ass : consumableorderdetailsRecords){
                if(ass.check==true){
@@ -475,21 +545,33 @@
                                continue;
                            }else{
                                if(needreturnMap.containsKey(ProductCount_Res[i].Bar_Code__c)){
                                    consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(ProductCount_Res[i],'该产品未返品'));
                                    consumableorderdetailsRecordserrordummy.add(
                                        new ConsumableorderdetailsInfo(ProductCount_Res[i], '该产品未返品')
                                    );
                                    pandiandetailsMap.put(ProductCount_Res[i].Id, '该产品未返品');
                                    carCodeListLose.add(ProductCount_Res[i].Bar_Code_search__c);
                                    continue;
                                }
                                if(otherAgProMap.containsKey(ProductCount_Res[i].Bar_Code__c)){
                                    consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(ProductCount_Res[i],'该产品归属于' + otherAgProMap.get(ProductCount_Res[i].Bar_Code__c).Dealer_Info_text__c + '的库存。'));
                                    pandiandetailsMap.put(ProductCount_Res[i].Id, '该产品归属于' + otherAgProMap.get(ProductCount_Res[i].Bar_Code__c).Dealer_Info_text__c + '的库存。');
                                    consumableorderdetailsRecordserrordummy.add(
                                        new ConsumableorderdetailsInfo(
                                            ProductCount_Res[i],
                                            '该产品归属于' +
                                                otherAgProMap.get(ProductCount_Res[i].Bar_Code__c).Dealer_Info_text__c +
                                                '的库存。'
                                        )
                                    );
                                    pandiandetailsMap.put(
                                        ProductCount_Res[i].Id,
                                        '该产品归属于' + otherAgProMap.get(ProductCount_Res[i].Bar_Code__c).Dealer_Info_text__c + '的库存。'
                                    );
                                    carCodeListLose.add(ProductCount_Res[i].Bar_Code_search__c);
                                    continue;
                                }
                                if (ProductCount_Res[i].Isoverdue__c == 0) {
                                    consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(ProductCount_Res[i],'该产品已经过有效期,请销存。'));
                                    consumableorderdetailsRecordserrordummy.add(
                                        new ConsumableorderdetailsInfo(ProductCount_Res[i], '该产品已经过有效期,请销存。')
                                    );
                                    pandiandetailsMap.put(ProductCount_Res[i].Id, '该产品已经过有效期,请销存。');
                                    carCodeListLose.add(ProductCount_Res[i].Bar_Code_search__c);
                                    ass.Diff--;
@@ -508,13 +590,21 @@
            }
            List<Consumable_order_details2__c> showcod2 = new List<Consumable_order_details2__c>();
            if (pandiandetailsMap.keySet().size() > 0) {
                showcod2 = [select Id,  Name,Consumable_Product__c,
                                Bar_Code__c,Consumable_Product__r.Name__c,
                                Asset_Model_No__c,Isoverdue__c,Box_Piece__c,
                showcod2 = [
                    SELECT
                        Id,
                        Name,
                        Consumable_Product__c,
                        Bar_Code__c,
                        Consumable_Product__r.Name__c,
                        Asset_Model_No__c,
                        Isoverdue__c,
                        Box_Piece__c,
                                Bar_Code_search__c
                            FROM Consumable_order_details2__c
                            WHERE Id in :pandiandetailsMap.keySet()
                            order by Name];
                    WHERE Id IN :pandiandetailsMap.keySet()
                    ORDER BY Name
                ];
            }
            initStandardController();
            showcod2nid = cod2s();
@@ -524,15 +614,17 @@
            }
            iSinventory = true;
            if(codPageRecords.size() > 0) done = true;
            if (codPageRecords.size() > 0)
                done = true;
            consumableorderdetailsRecordserrordummy.clear();
            //pandiandetailsList = new list<Consumable_order_details2__c>();
            pandiandetailsList = [select Id, Bar_Code__c,Consumable_Product__r.Name__c,
                                    Box_Piece__c,Lose_reason__c
            pandiandetailsList = [
                SELECT Id, Bar_Code__c, Consumable_Product__r.Name__c, Box_Piece__c, Lose_reason__c
                                FROM Consumable_order_details2__c
                                WHERE Id in :pandiandetailsMap.keySet()
                                order by Name];
                WHERE Id IN :pandiandetailsMap.keySet()
                ORDER BY Name
            ];
            for(Consumable_order_details2__c codDet : pandiandetailsList){
                codDet.Lose_reason__c = pandiandetailsMap.get(codDet.Id);
            }
@@ -587,10 +679,7 @@
            res.status = 'Success1';
         
            return res;
        }
        //CHAN-B7J4NB 只有一个时,盘点不到
        //init();
@@ -602,21 +691,23 @@
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCodeListP' + BarCodeListP));
        /***************************************************************************/
        // BarCode的检索  所有在库
        reSet = [select Id,Consumable_Product__c,Consumable_Product__r.Name__c,
                        Box_Piece__c,Bar_Code_search__c,Isoverdue__c
                    from Consumable_order_details2__c
                    where Bar_Code_search__c in :BarCodeListP
                    AND Dealer_Arrive__c = true
                    AND Dealer_Shipment__c = false
                    AND Dealer_Saled__c = false
                    AND Dealer_Returned__c = false
                    AND Lose_Flag__c = false
                    AND Cancellation_Date__c = null
                    and Bar_Code__c !=null
                    AND Product_Type__c like : sqlagencyProType
        reSet = [
            SELECT Id, Consumable_Product__c, Consumable_Product__r.Name__c, Box_Piece__c, Bar_Code_search__c, Isoverdue__c
            FROM Consumable_order_details2__c
            WHERE
                Bar_Code_search__c IN :BarCodeListP
                AND Dealer_Arrive__c = TRUE
                AND Dealer_Shipment__c = FALSE
                AND Dealer_Saled__c = FALSE
                AND Dealer_Returned__c = FALSE
                AND Lose_Flag__c = FALSE
                AND Cancellation_Date__c = NULL
                AND Bar_Code__c != NULL
                AND Product_Type__c LIKE :sqlagencyProType
                    AND Arrive_Owner_Work_Location__c =: userWorkLocation
                    AND  Dealer_Info_text__c = :accountName
                    order by Name];
            ORDER BY Name
        ];
                    System.debug('reSet===>'+reSet);
        Map<String, Integer> pandianProdIdCountMap = new Map<String, Integer>();        // ProdId 単位
        // 20200509 add gzw 记录需要销存数量
@@ -639,34 +730,52 @@
                if (pandianoverdueCountMap.containsKey(rs.Consumable_product__c + rs.Box_Piece__c) == false) {
                    pandianoverdueCountMap.put(rs.Consumable_Product__c + rs.Box_Piece__c, 1);
                } else {
                    pandianoverdueCountMap.put(rs.Consumable_Product__c + rs.Box_Piece__c, pandianoverdueCountMap.get(rs.Consumable_Product__c + rs.Box_Piece__c) + 1);
                    pandianoverdueCountMap.put(
                        rs.Consumable_Product__c + rs.Box_Piece__c,
                        pandianoverdueCountMap.get(rs.Consumable_Product__c + rs.Box_Piece__c) + 1
                    );
                }
                continue;
            }
            if (pandianProdIdCountMap.containsKey(rs.Consumable_product__c + rs.Box_Piece__c) == false) {
                pandianProdIdCountMap.put(rs.Consumable_Product__c + rs.Box_Piece__c, 1);
            } else {
                pandianProdIdCountMap.put(rs.Consumable_Product__c + rs.Box_Piece__c, pandianProdIdCountMap.get(rs.Consumable_Product__c + rs.Box_Piece__c) + 1);
                pandianProdIdCountMap.put(
                    rs.Consumable_Product__c + rs.Box_Piece__c,
                    pandianProdIdCountMap.get(rs.Consumable_Product__c + rs.Box_Piece__c) + 1
                );
            }
        }
        // 经销商之间或者同一经销商不同工作地调货
        List<Consumable_order_details2__c> reSet1 = [SELECT Id,  Name,Consumable_Product__c,
                        Bar_Code__c,Consumable_Product__r.Name__c,Dealer_Shipment__c,Dealer_Saled__c,
                        Asset_Model_No__c,Isoverdue__c,Box_Piece__c,Dealer_Arrive__c,
                        Bar_Code_search__c,Dealer_Info_text__c
        List<Consumable_order_details2__c> reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__c,
                Bar_Code__c,
                Consumable_Product__r.Name__c,
                Dealer_Shipment__c,
                Dealer_Saled__c,
                Asset_Model_No__c,
                Isoverdue__c,
                Box_Piece__c,
                Dealer_Arrive__c,
                Bar_Code_search__c,
                Dealer_Info_text__c
                    FROM Consumable_order_details2__c
                    WHERE (Dealer_Arrive__c = TRUE
                    or  Dealer_Shipment__c= TRUE
                    or  Dealer_Saled__c = TRUE)
            WHERE
                (Dealer_Arrive__c = TRUE
                OR Dealer_Shipment__c = TRUE
                OR Dealer_Saled__c = TRUE)
                    AND  Dealer_Returned__c = FALSE
                    AND  Cancellation_Flag__c = FALSE
                    AND  Bar_Code_search__c in :BarCodeListP
                AND Bar_Code_search__c IN :BarCodeListP
                    AND (Dealer_Info_text__c != :accountName
                        OR (Dealer_Info_text__c = :accountName
                            AND Arrive_Owner_Work_Location__c != :userWorkLocation)
                    )
                    ORDER BY Name ];
                AND Arrive_Owner_Work_Location__c != :userWorkLocation))
            ORDER BY Name
        ];
        Map<String,Consumable_order_details2__c> otherAgProMap = new Map<String,Consumable_order_details2__c>();
        for(Consumable_order_details2__c cod2 :reSet1){
            otherAgProMap.put(cod2.Bar_Code__c,cod2);
@@ -682,28 +791,40 @@
                reFindProductList.add(cod2);
                proIdNotinpage.put(cod2.Consumable_Product__c, cod2.Box_Piece__c);
            }
            if(!barCodeListPandianMap.containsKey(cod2.Bar_Code_search__c)
                && otherAgProMap.containsKey(cod2.Bar_Code__c)
                && (otherAgProMap.get(cod2.Bar_Code__c).Dealer_Saled__c == true
                || otherAgProMap.get(cod2.Bar_Code__c).Dealer_Shipment__c == true) ){
            if (
                !barCodeListPandianMap.containsKey(cod2.Bar_Code_search__c) &&
                otherAgProMap.containsKey(cod2.Bar_Code__c) &&
                (otherAgProMap.get(cod2.Bar_Code__c).Dealer_Saled__c == true ||
                otherAgProMap.get(cod2.Bar_Code__c).Dealer_Shipment__c == true)
            ) {
                consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(cod2,'无此产品的库存,请入库。'));
                pandiandetailsMap.put(cod2.Id, '无此产品的库存,请入库。');
            }
        }
        //寻回明细
        List<Consumable_order_details2__c> productAdjust = new List<Consumable_order_details2__c>();
        productAdjust = [select Id,  Name,Consumable_Product__c,
                            Bar_Code__c,Consumable_Product__r.Name__c,Lose_reason__c,
                            Asset_Model_No__c,Box_Piece__c,Bar_Code_search__c,Isoverdue__c
                        from Consumable_order_details2__c
                        where Bar_Code_search__c in :BarCodeListP
                          and Bar_Code__c !=null
                          and Lose_Flag__c = true
                          AND Product_Type__c like : sqlagencyProType
        productAdjust = [
            SELECT
                Id,
                Name,
                Consumable_Product__c,
                Bar_Code__c,
                Consumable_Product__r.Name__c,
                Lose_reason__c,
                Asset_Model_No__c,
                Box_Piece__c,
                Bar_Code_search__c,
                Isoverdue__c
            FROM Consumable_order_details2__c
            WHERE
                Bar_Code_search__c IN :BarCodeListP
                AND Bar_Code__c != NULL
                AND Lose_Flag__c = TRUE
                AND Product_Type__c LIKE :sqlagencyProType
                          AND  Dealer_Info_text__c = :accountName
                          AND Arrive_Owner_Work_Location__c =: userWorkLocation
                        order by Name];
            ORDER BY Name
        ];
        for (Consumable_order_details2__c rs : productAdjust){
            // 过期库存销存 20200427 gzw add srart
@@ -737,18 +858,22 @@
            List<ConsumableorderdetailsInfo> boxRecords = new List<ConsumableorderdetailsInfo>();
            Map<String,ConsumableorderdetailsInfo> newMidBoxMap = new Map<String,ConsumableorderdetailsInfo>();
            Map<String,ConsumableorderdetailsInfo> newMidPieceMap = new Map<String,ConsumableorderdetailsInfo>();
            List<Product2__c> product_Refind = [select Id, Name,Name__c,SFDA_Status__c,Packing_list_manual__c,Asset_Model_No__c
                                    from Product2__c
                                    WHERE Id in :proIdNotinpage.keySet()];
            List<Product2__c> product_Refind = [
                SELECT Id, Name, Name__c, SFDA_Status__c, Packing_list_manual__c, Asset_Model_No__c
                FROM Product2__c
                WHERE Id IN :proIdNotinpage.keySet()
            ];
            for(Product2__c pro : product_Refind){
                midMap.put(pro.Id, pro);
            }
            for(Integer i = 0 ; i< reFindProductList.size();i++){
                //然后循环CountDel做Box和piece2个map
                if(MidMap.containsKey(reFindProductList[i].Consumable_Product__c) && reFindProductList[i].Box_Piece__c == '盒'){
                    if(newMidBoxMap.containsKey(reFindProductList[i].Consumable_Product__c+reFindProductList[i].Box_Piece__c)){
                        ConsumableorderdetailsInfo Jstage = newMidBoxMap.get(reFindProductList[i].Consumable_Product__c+reFindProductList[i].Box_Piece__c).clone();
                        ConsumableorderdetailsInfo Jstage = newMidBoxMap.get(
                                reFindProductList[i].Consumable_Product__c + reFindProductList[i].Box_Piece__c
                            )
                            .clone();
                        Jstage.countid = 0 ;
                        if(reFindProductList[i].Isoverdue__c == 1){
                            Jstage.limitCount = 0;
@@ -756,7 +881,9 @@
                        Jstage.boxPiece = reFindProductList[i].Box_Piece__c;
                        newMidBoxMap.put(reFindProductList[i].Consumable_Product__c+reFindProductList[i].Box_Piece__c, Jstage);
}else{
                                            ConsumableorderdetailsInfo Jstage = new ConsumableorderdetailsInfo(MidMap.get(reFindProductList[i].Consumable_Product__c));
                        ConsumableorderdetailsInfo Jstage = new ConsumableorderdetailsInfo(
                            MidMap.get(reFindProductList[i].Consumable_Product__c)
                        );
                        Jstage.countid = 0 ;
                        if(reFindProductList[i].Isoverdue__c == 1){
                            Jstage.limitCount = 0;
@@ -766,7 +893,10 @@
                    }
                }else if(MidMap.containsKey(reFindProductList[i].Consumable_Product__c) && reFindProductList[i].Box_Piece__c == '个'){
                    if(newMidPieceMap.containsKey(reFindProductList[i].Consumable_Product__c+reFindProductList[i].Box_Piece__c)){
                        ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(reFindProductList[i].Consumable_product__c+reFindProductList[i].Box_Piece__c).clone();
                        ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(
                                reFindProductList[i].Consumable_product__c + reFindProductList[i].Box_Piece__c
                            )
                            .clone();
                        Jstage.countid = 0 ;
                        if(reFindProductList[i].Isoverdue__c == 1){
                            Jstage.limitCount = 0;
@@ -774,7 +904,9 @@
                        Jstage.boxPiece = reFindProductList[i].Box_Piece__c;
                        newMidPieceMap.put(reFindProductList[i].Consumable_Product__c+reFindProductList[i].Box_Piece__c, Jstage);
                    }else{
                        ConsumableorderdetailsInfo Jstage = new ConsumableorderdetailsInfo(MidMap.get(reFindProductList[i].Consumable_Product__c));
                        ConsumableorderdetailsInfo Jstage = new ConsumableorderdetailsInfo(
                            MidMap.get(reFindProductList[i].Consumable_Product__c)
                        );
                        Jstage.countid = 0 ;
                        if(reFindProductList[i].Isoverdue__c == 1){
                            Jstage.limitCount = 0;
@@ -825,19 +957,29 @@
            }
        }
        //已经出库的产品
        List<Consumable_order_details2__c>  reSet2 = [SELECT Id,  Name,Consumable_Product__c,
                        Bar_Code__c,Consumable_Product__r.Name__c,
                        Asset_Model_No__c,Isoverdue__c,Box_Piece__c,
                        Bar_Code_search__c,Dealer_Info_text__c
        List<Consumable_order_details2__c> reSet2 = [
            SELECT
                Id,
                Name,
                Consumable_Product__c,
                Bar_Code__c,
                Consumable_Product__r.Name__c,
                Asset_Model_No__c,
                Isoverdue__c,
                Box_Piece__c,
                Bar_Code_search__c,
                Dealer_Info_text__c
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Arrive__c = TRUE
            WHERE
                Dealer_Arrive__c = TRUE
                    AND  (Dealer_Shipment__c= TRUE
                    or  Dealer_Saled__c = TRUE)
                OR Dealer_Saled__c = TRUE)
                    AND  Dealer_Returned__c = FALSE
                    AND  Cancellation_Flag__c = FALSE
                    AND  Bar_Code_search__c in :BarCodeListP
                AND Bar_Code_search__c IN :BarCodeListP
                    AND Dealer_Info_text__c = :accountName
                    ORDER BY Name ];
            ORDER BY Name
        ];
        Map<String,Consumable_order_details2__c> needreturnMap = new Map<String,Consumable_order_details2__c>();
        for(Consumable_order_details2__c cod2 :reSet2){
            needreturnMap.put(cod2.Bar_Code__c,cod2);
@@ -873,12 +1015,23 @@
                            continue;
                        }
                        if (ProductCount_Res[i].Isoverdue__c == 0) {
                            consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(ProductCount_Res[i],'该产品已经过有效期,请销存。'));
                            consumableorderdetailsRecordserrordummy.add(
                                new ConsumableorderdetailsInfo(ProductCount_Res[i], '该产品已经过有效期,请销存。')
                            );
                            pandiandetailsMap.put(ProductCount_Res[i].Id, '该产品已经过有效期,请销存。');
                            if (pandianoverdueCountMap.containsKey(ProductCount_Res[i].Consumable_product__c + ProductCount_Res[i].Box_Piece__c) == false) {
                            if (
                                pandianoverdueCountMap.containsKey(
                                    ProductCount_Res[i].Consumable_product__c + ProductCount_Res[i].Box_Piece__c
                                ) == false
                            ) {
                                pandianoverdueCountMap.put(ProductCount_Res[i].Consumable_Product__c + ProductCount_Res[i].Box_Piece__c, 1);
                            } else {
                                pandianoverdueCountMap.put(ProductCount_Res[i].Consumable_Product__c + ProductCount_Res[i].Box_Piece__c, pandianoverdueCountMap.get(ProductCount_Res[i].Consumable_Product__c + ProductCount_Res[i].Box_Piece__c) + 1);
                                pandianoverdueCountMap.put(
                                    ProductCount_Res[i].Consumable_Product__c + ProductCount_Res[i].Box_Piece__c,
                                    pandianoverdueCountMap.get(
                                        ProductCount_Res[i].Consumable_Product__c + ProductCount_Res[i].Box_Piece__c
                                    ) + 1
                                );
                            }
                            continue;
                        }
@@ -890,12 +1043,22 @@
                // 同时存在其他经销商库存产品
                for(Consumable_order_details2__c cod2 : reSet1){
                    if(cod2.Consumable_Product__c == ass.Prod.Id && ass.boxPiece == cod2.Box_Piece__c){
                        if(barCodeListPandianMap.containsKey(cod2.Bar_Code_search__c)
                            && otherAgProMap.containsKey(cod2.Bar_Code__c)
                            && otherAgProMap.get(cod2.Bar_Code__c).Dealer_Saled__c == false
                            && otherAgProMap.get(cod2.Bar_Code__c).Dealer_Shipment__c == false ){
                            consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(cod2,'该产品归属于' + otherAgProMap.get(cod2.Bar_Code__c).Dealer_Info_text__c + '的库存。'));
                            pandiandetailsMap.put(cod2.Id, '该产品归属于' + otherAgProMap.get(cod2.Bar_Code__c).Dealer_Info_text__c + '的库存。');
                        if (
                            barCodeListPandianMap.containsKey(cod2.Bar_Code_search__c) &&
                            otherAgProMap.containsKey(cod2.Bar_Code__c) &&
                            otherAgProMap.get(cod2.Bar_Code__c).Dealer_Saled__c == false &&
                            otherAgProMap.get(cod2.Bar_Code__c).Dealer_Shipment__c == false
                        ) {
                            consumableorderdetailsRecordserrordummy.add(
                                new ConsumableorderdetailsInfo(
                                    cod2,
                                    '该产品归属于' + otherAgProMap.get(cod2.Bar_Code__c).Dealer_Info_text__c + '的库存。'
                                )
                            );
                            pandiandetailsMap.put(
                                cod2.Id,
                                '该产品归属于' + otherAgProMap.get(cod2.Bar_Code__c).Dealer_Info_text__c + '的库存。'
                            );
                            continue;
                        }
                    }
@@ -904,7 +1067,9 @@
                for(Consumable_order_details2__c cod2 : reSet2){
                    if(cod2.Consumable_Product__c == ass.Prod.Id && ass.boxPiece == cod2.Box_Piece__c){
                        if(needreturnMap.containsKey(cod2.Bar_Code__c)){
                            consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(cod2,'该产品目前出库状态,请返品。'));
                            consumableorderdetailsRecordserrordummy.add(
                                new ConsumableorderdetailsInfo(cod2, '该产品目前出库状态,请返品。')
                            );
                            pandiandetailsMap.put(cod2.Id, '该产品目前出库状态,请返品。');
                            continue;
                        }
@@ -942,7 +1107,6 @@
            }
        }
        //寻回做成
        for(ConsumableorderdetailsInfo ass :consumableorderdetailsRecords){
            for(ConsumableorderdetailsInfo adjust :consumableorderdetailsRecordsAdjust){
@@ -958,28 +1122,37 @@
            }
        }
        if (pandiandetailsMap.keySet().size() > 0) {
            List<Consumable_order_details2__c> showcod2 = [select Id,  Name,Consumable_Product__c,
                                Bar_Code__c,Consumable_Product__r.Name__c,
                                Asset_Model_No__c,Isoverdue__c,Box_Piece__c,
            List<Consumable_order_details2__c> showcod2 = [
                SELECT
                    Id,
                    Name,
                    Consumable_Product__c,
                    Bar_Code__c,
                    Consumable_Product__r.Name__c,
                    Asset_Model_No__c,
                    Isoverdue__c,
                    Box_Piece__c,
                                Bar_Code_search__c
                            FROM Consumable_order_details2__c
                            WHERE Id in :pandiandetailsMap.keySet()
                            order by Name];
                WHERE Id IN :pandiandetailsMap.keySet()
                ORDER BY Name
            ];
            initStandardController();
            showcod2nid = cod2s();
        }
        for (Consumable_order_details2__c cod2 : showcod2nid) {
            codPageRecords.add(new ConsumableorderdetailsInfo(cod2,pandiandetailsMap.get(cod2.Id)));
        }
        if(codPageRecords.size() > 0) done = true;
        if (codPageRecords.size() > 0)
            done = true;
        iSinventory = true;
        consumableorderdetailsRecordserrordummy.clear();
        pandiandetailsList = [select Id, Bar_Code__c,Consumable_Product__r.Name__c,
                                Box_Piece__c,Lose_reason__c
        pandiandetailsList = [
            SELECT Id, Bar_Code__c, Consumable_Product__r.Name__c, Box_Piece__c, Lose_reason__c
                            FROM Consumable_order_details2__c
                            WHERE Id in :pandiandetailsMap.keySet()
                            order by Name];
            WHERE Id IN :pandiandetailsMap.keySet()
            ORDER BY Name
        ];
        for(Consumable_order_details2__c codDet : pandiandetailsList){
            codDet.Lose_reason__c = pandiandetailsMap.get(codDet.Id);
        }
@@ -1039,8 +1212,18 @@
    
    // 保存按钮
    @AuraEnabled
    public static ResponseBodyLWC save(Boolean iSinventory,String consumableorderdetailsRecordsLWC,String accountid,String agencyProType,Map<Id,String> pandiandetailsMap,List<Consumable_order_details2__c> reSet) {
        List<ConsumableorderdetailsInfo> consumableorderdetailsRecords = (List<ConsumableorderdetailsInfo>)JSON.deserialize(consumableorderdetailsRecordsLWC,List<ConsumableorderdetailsInfo>.class);
    public static ResponseBodyLWC save(
        Boolean iSinventory,
        String consumableorderdetailsRecordsLWC,
        String accountid,
        String agencyProType,
        Map<Id, String> pandiandetailsMap,
        List<Consumable_order_details2__c> reSet
    ) {
        List<ConsumableorderdetailsInfo> consumableorderdetailsRecords = (List<ConsumableorderdetailsInfo>) JSON.deserialize(
            consumableorderdetailsRecordsLWC,
            List<ConsumableorderdetailsInfo>.class
        );
        agencyProType = agencyProType;
        accountid =accountid;
        pandiandetailsMap = pandiandetailsMap;
@@ -1098,9 +1281,9 @@
            insert  Po;
            eSetId = Po.id;
            List<Consumable_order__c> Consumable_order = [SELECT Name FROM Consumable_order__c WHERE id =:Po.id];
            List<Consumable_orderdetails__c> InsList = New List<Consumable_orderdetails__c>();
            List<Consumable_order_details2__c> InsListUp = New List<Consumable_order_details2__c>();
            List<Consumable_order_details2__c> updListAdjust = New List<Consumable_order_details2__c>();
            List<Consumable_orderdetails__c> InsList = new List<Consumable_orderdetails__c>();
            List<Consumable_order_details2__c> InsListUp = new List<Consumable_order_details2__c>();
            List<Consumable_order_details2__c> updListAdjust = new List<Consumable_order_details2__c>();
            Map<String,String> ErrorName = new Map<String,String>();
            Map<String,Boolean> CheckTF = new Map<String,Boolean>();
            for(ConsumableorderdetailsInfo header : consumableorderdetailsRecords){
@@ -1129,13 +1312,21 @@
            if(InsList.size()>0){
                insert InsList;
            }
            List<Consumable_order_details2__c> showcod2 = [select Id,  Name,Consumable_Product__c,
                                Bar_Code__c,Consumable_Product__r.Name__c,
                                Asset_Model_No__c,Isoverdue__c,Box_Piece__c,
            List<Consumable_order_details2__c> showcod2 = [
                SELECT
                    Id,
                    Name,
                    Consumable_Product__c,
                    Bar_Code__c,
                    Consumable_Product__r.Name__c,
                    Asset_Model_No__c,
                    Isoverdue__c,
                    Box_Piece__c,
                                Bar_Code_search__c
                            FROM Consumable_order_details2__c
                            WHERE Id in :pandiandetailsMap.keySet()
                            order by Name];
                WHERE Id IN :pandiandetailsMap.keySet()
                ORDER BY Name
            ];
            for(Consumable_order_details2__c cod : showcod2){
                Consumable_order_details2__c InsDetail = new Consumable_order_details2__c();
                InsDetail.Id =cod.Id;
@@ -1164,7 +1355,6 @@
            if(InsListUp.size()>0){
                ControllerUtil.updateOrderDetailsSatus(InsListUp);// Commented By DTT - Li Jun for testing 20230407
            }
        }catch (Exception e) {
            Database.rollback(sp);
            // ApexPages.addMessages(ex);
@@ -1209,6 +1399,7 @@
    }
    // Data Bean
    @TestVisible
    class ConsumableorderdetailsInfo implements Comparable {
        @AuraEnabled
        public Boolean check { get; set; }
@@ -1241,7 +1432,6 @@
        @AuraEnabled
        public String boxPiece { get; set; }
        public ConsumableorderdetailsInfo(Consumable_order_details2__c e,string str) {
            orderdetails2 = e;
            Prod = e.Consumable_Product__r;
            //e.Lose_reason__c = str;
force-app/main/default/classes/LexInventoryListController.cls
@@ -31,38 +31,59 @@
        coc = new Consumable_order__c();
        consumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>();
        List<Consumable_order__c> qs = New List<Consumable_order__c>();
        qs = [select Name,Inventory_date__c,Order_date__c From Consumable_order__c Where Id =:ESetId];
        List<Consumable_order__c> qs = new List<Consumable_order__c>();
        qs = [SELECT Name, Inventory_date__c, Order_date__c FROM Consumable_order__c WHERE Id = :ESetId];
        System.debug('qs===>'+qs);
        if (qs.size()>0){
            coc = qs[0];
        }
        // 選択済みの明细を取得
        consumableorderdetailsSelected = [
            select Id, Name, Consumable_Product__c,
                Consumable_Product__r.Name, Sterilization_limit__c,
                Deliver_date__c,Consumable_Product__r.Name__c,
                Consumable_Product__r.Intra_Trade_List_RMB__c,Bar_Code__c,
                Consumable_Product__r.Asset_Model_No__c,Lose_Flag__c,
                recordtypeid,Lose_reason__c
            from Consumable_order_details2__c
            where  Consumable_Inventory_order__c = :ESetId
            order by Name ];
            SELECT
                Id,
                Name,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Consumable_Product__r.Name__c,
                Consumable_Product__r.Intra_Trade_List_RMB__c,
                Bar_Code__c,
                Consumable_Product__r.Asset_Model_No__c,
                Lose_Flag__c,
                recordtypeid,
                Lose_reason__c
            FROM Consumable_order_details2__c
            WHERE Consumable_Inventory_order__c = :ESetId
            ORDER BY Name
        ];
        System.debug('consumableorderdetailsSelected==>'+consumableorderdetailsSelected);
        for (Integer i = 0; i < consumableorderdetailsSelected.size(); i++) {
            consumableorderdetailsRecordsError.add(new ConsumableorderdetailsInfo(consumableorderdetailsSelected[i]));
        }
        consumableorderdetails1 = [
            select Id, Name,Diff__c,inventory_sum__c,
                Count_Sum__c,Consumable_order__c,
                Consumable_Product__c,Consumable_Product__r.Name,Consumable_Count__c,
            SELECT
                Id,
                Name,
                Diff__c,
                inventory_sum__c,
                Count_Sum__c,
                Consumable_order__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Consumable_Count__c,
                Consumable_Product__r.Intra_Trade_List_RMB__c,
                Consumable_Product__r.Asset_Model_No__c,Consumable_Product__r.Name__c,
                Sum_of_money__c,recordtypeid,Lose_reason__c,Product_Refind__c
            from Consumable_orderdetails__c
            where  Consumable_order__c = :ESetId
            order by Name ];
                Consumable_Product__r.Asset_Model_No__c,
                Consumable_Product__r.Name__c,
                Sum_of_money__c,
                recordtypeid,
                Lose_reason__c,
                Product_Refind__c
            FROM Consumable_orderdetails__c
            WHERE Consumable_order__c = :ESetId
            ORDER BY Name
        ];
        for (Integer i = 0; i < consumableorderdetails1.size(); i++) {
            consumableorderdetailsRecords.add(new ConsumableorderdetailsInfo(consumableorderdetails1[i]));
        }
force-app/main/default/classes/LexInventoryViewController.cls
@@ -49,7 +49,7 @@
    public static String category1 { get; set; }
    public static Boolean editAble { get; set; }
    // 经销商在库产品ID
    public static List<String> orderDetZaikuList{set;get;}
    public static List<String> orderDetZaikuList { get; set; }
    // 产品 ID
    public static String ESetId { get; set; }
    public static String idCheck { get; set; }
@@ -98,7 +98,6 @@
        categoryOptionMap = new Map<String, String>();
        category4OptionMap = new Map<String, String>();
        category5OptionMap = new Map<String, String>();
        // 取用户ID
        String userId = UserInfo.getUserId();
@@ -240,9 +239,7 @@
                }
                if (newMidPieceMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) {
                    ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(
                            CountDel[i].Consumable_Product__c +
                            CountDel[i].Box_Piece__c +
                            tex
                            CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
                        )
                        .clone();
                    Jstage.allnumber = Jstage.allnumber + 1;
@@ -630,9 +627,7 @@
                    }
                    if (newMidBoxMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) {
                        ConsumableorderdetailsInfo Jstage = newMidBoxMap.get(
                                CountDel[i].Consumable_Product__c +
                                CountDel[i].Box_Piece__c +
                                tex
                                CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
                            )
                            .clone();
                        Jstage.allnumber = Jstage.allnumber + 1;
@@ -662,9 +657,7 @@
                    }
                    if (newMidPieceMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) {
                        ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(
                                CountDel[i].Consumable_Product__c +
                                CountDel[i].Box_Piece__c +
                                tex
                                CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
                            )
                            .clone();
                        Jstage.allnumber = Jstage.allnumber + 1;
@@ -938,7 +931,6 @@
    //     }
    //     pageRecords.sort();
    // }
    //检索sql文做成
    private static String makeSoql(String CateName, String CateCode, String Category3, String Category4, String Category5) {
force-app/main/default/classes/LexLicenceReminderController.cls
@@ -1,5 +1,4 @@
public without sharing class LexLicenceReminderController {
    @AuraEnabled
    public static Results initReminder(){
        Results results = new Results();
force-app/main/default/classes/LexOutboundorderImportController.cls
@@ -50,6 +50,7 @@
        res.status = 'Success';
        res.code = 200;
        res.msg = '';
        System.debug('res:' + res);
        return res;
    }
@@ -102,7 +103,7 @@
                            barcodePieceMap.put(csvRecordData[6], Integer.valueOf(csvRecordData[7]));
                        }
                    }
                    String[] csvRecordDataStr = new List<String>(13);
                    String[] csvRecordDataStr = new String[13];
                    for (Integer j = 0; j < csvRecordData.size(); j++) {
                        csvRecordDataStr[j] = csvRecordData[j];
                    }
@@ -753,9 +754,7 @@
                string[] csvRecordData = csvRecordStr[i];
                if (orderdetMap.containsKey(csvRecordData[0] + csvRecordData[12] + csvRecordData[9])) {
                    orderdetMap.put(
                        csvRecordData[0] +
                        csvRecordData[12] +
                        csvRecordData[9],
                        csvRecordData[0] + csvRecordData[12] + csvRecordData[9],
                        orderdetMap.get(csvRecordData[0] + csvRecordData[12] + csvRecordData[9]) + Decimal.valueOf(csvRecordData[7])
                    );
                    continue;
@@ -864,7 +863,7 @@
            return null;
        }
    }
    @TestVisible
    class ConsumableorderdetailsInfo implements Comparable {
        @AuraEnabled
        public Consumable_order__c order { get; set; }
force-app/main/default/classes/LexOverdueStockController.cls
@@ -1,5 +1,4 @@
public with sharing class LexOverdueStockController {
    /*****************検索用******************/
    public static String barcode { get; set; }
@@ -29,7 +28,6 @@
    }
    public LexOverdueStockController() {
    }
    // 画面初始化
@@ -42,7 +40,7 @@
        codPageRecords = new List<orderBean>();
        overduePageRecords = new List<orderBean>();
        // 获取用户和经销商信息
        user Useracc = [select Accountid, Work_Location__c,UserPro_Type__c from user where id =: UserInfo.getUserId()];
        user Useracc = [SELECT Accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId()];
        userWorkLocation = Useracc.Work_Location__c;
        agencyProType = Useracc.UserPro_Type__c;
        if(String.isBlank(Useracc.UserPro_Type__c)){
@@ -51,23 +49,23 @@
        sqlagencyProType = '%' + agencyProType + '%';
        accountInfo = [SELECT id,Name,Dealer_discount__c FROM account WHERE id =:Useracc.accountid];
        // 过期库存汇总信息
        List<AggregateResult>  orderDetZaiku = [SELECT count(Id) countsum,
                        Consumable_Product__c prodid,
                        Consumable_Product__r.Name_Text__c prodname,
                        Box_Piece__c boxPiece
        List<AggregateResult> orderDetZaiku = [
            SELECT count(Id) countsum, Consumable_Product__c prodid, Consumable_Product__r.Name_Text__c prodname, Box_Piece__c boxPiece
                        FROM Consumable_order_details2__c
                        WHERE Dealer_Arrive__c = true
                        AND Dealer_Shipment__c = false
                        AND Dealer_Saled__c = false
                        AND Lose_Flag__c = false
            WHERE
                Dealer_Arrive__c = TRUE
                AND Dealer_Shipment__c = FALSE
                AND Dealer_Saled__c = FALSE
                AND Lose_Flag__c = FALSE
                        AND Isoverdue__c = 0
                        AND Dealer_Returned__c = false
                        AND Cancellation_Flag__c = false
                        AND Bar_Code__c !=null
                        AND Product_Type__c like : sqlagencyProType
                AND Dealer_Returned__c = FALSE
                AND Cancellation_Flag__c = FALSE
                AND Bar_Code__c != NULL
                AND Product_Type__c LIKE :sqlagencyProType
                        AND Dealer_Info_text__c = :accountInfo.Name
                        AND Arrive_Owner_Work_Location__c = :userWorkLocation
                        group by Consumable_Product__c,Box_Piece__c,Consumable_Product__r.Name_Text__c];
            GROUP BY Consumable_Product__c, Box_Piece__c, Consumable_Product__r.Name_Text__c
        ];
        for(AggregateResult overdue : orderDetZaiku){
            codPageRecords.add(new orderBean(overdue));
@@ -83,12 +81,17 @@
        res.code = 200;
        System.debug('res = ' + res);
        return res;
    }
    // BarCode录入
    @AuraEnabled
    public static ResponseBodyLWC searchorderBean(String agencyProTypeLWC,String userWorkLocationLWC,String accountNameLWC,String barcodeLWC,String codPageRecordsLWC){
    public static ResponseBodyLWC searchorderBean(
        String agencyProTypeLWC,
        String userWorkLocationLWC,
        String accountNameLWC,
        String barcodeLWC,
        String codPageRecordsLWC
    ) {
        ResponseBodyLWC res = new ResponseBodyLWC();
        Map<String, object> data = new Map<String, object>();
        res.entity = data;
@@ -100,9 +103,8 @@
        userWorkLocation = userWorkLocationLWC;
        // add by Wang Xueqin 2023/04/12
        // 获取用户和经销商信息
        user Useracc = [select Accountid, Work_Location__c,UserPro_Type__c from user where id =: UserInfo.getUserId()];
        user Useracc = [SELECT Accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId()];
        accountInfo = [SELECT id,Name,Dealer_discount__c FROM account WHERE id =:Useracc.accountid];
       
        iSinventory = true;
        Set<String> barCodeoverdue = new Set<String>();
@@ -113,22 +115,33 @@
            codPage.pandian = 0;
        }
        // 查询所有过期库存
        List<Consumable_order_details2__c>  orderDetZaiku = [select Id,  Name,Consumable_Product__c,
                            Bar_Code__c,Consumable_Product__r.Name__c,Dealer_Info_text__c,
                            Asset_Model_No__c,Isoverdue__c,Box_Piece__c,Sterilization_limit__c,
        List<Consumable_order_details2__c> orderDetZaiku = [
            SELECT
                Id,
                Name,
                Consumable_Product__c,
                Bar_Code__c,
                Consumable_Product__r.Name__c,
                Dealer_Info_text__c,
                Asset_Model_No__c,
                Isoverdue__c,
                Box_Piece__c,
                Sterilization_limit__c,
                            Bar_Code_search__c
                        FROM Consumable_order_details2__c
                        WHERE Dealer_Arrive__c = true
                        AND Dealer_Shipment__c = false
                        AND Dealer_Saled__c = false
                        AND Lose_Flag__c = false
            WHERE
                Dealer_Arrive__c = TRUE
                AND Dealer_Shipment__c = FALSE
                AND Dealer_Saled__c = FALSE
                AND Lose_Flag__c = FALSE
                        AND Isoverdue__c = 0
                        AND Dealer_Returned__c = false
                        AND Cancellation_Flag__c = false
                        AND Bar_Code__c !=null
                        AND Product_Type__c like : sqlagencyProType
                AND Dealer_Returned__c = FALSE
                AND Cancellation_Flag__c = FALSE
                AND Bar_Code__c != NULL
                AND Product_Type__c LIKE :sqlagencyProType
                        AND Dealer_Info_text__c = :accountInfo.Name
                        AND Arrive_Owner_Work_Location__c = :userWorkLocation];
                AND Arrive_Owner_Work_Location__c = :userWorkLocation
        ];
        // 没有输入条码时,循环页面,所有打钩产品全部销存
        // 取得所有
        overdueList = new List<Consumable_order_details2__c>();
@@ -162,27 +175,42 @@
        // 输入barcode时
        // BarCode的检索  所有在库
        List<Consumable_order_details2__c> reSet = [select Id,Consumable_Product__c,
                        Consumable_Product__r.Name__c,Box_Piece__c,Bar_Code_search__c,
                        Dealer_Shipment__c,Dealer_Saled__c,Lose_Flag__c,Bar_Code__c,
                        Cancellation_Flag__c,Isoverdue__c,Sterilization_limit__c
                    from Consumable_order_details2__c
                    where Bar_Code_search__c in :BarCodeListP
                    AND Dealer_Arrive__c = true
                    AND Cancellation_Flag__c = false
                    and Dealer_Returned__c = false
                    and Bar_Code__c !=null
                    AND Product_Type__c like : sqlagencyProType
        List<Consumable_order_details2__c> reSet = [
            SELECT
                Id,
                Consumable_Product__c,
                Consumable_Product__r.Name__c,
                Box_Piece__c,
                Bar_Code_search__c,
                Dealer_Shipment__c,
                Dealer_Saled__c,
                Lose_Flag__c,
                Bar_Code__c,
                Cancellation_Flag__c,
                Isoverdue__c,
                Sterilization_limit__c
            FROM Consumable_order_details2__c
            WHERE
                Bar_Code_search__c IN :BarCodeListP
                AND Dealer_Arrive__c = TRUE
                AND Cancellation_Flag__c = FALSE
                AND Dealer_Returned__c = FALSE
                AND Bar_Code__c != NULL
                AND Product_Type__c LIKE :sqlagencyProType
                    AND Arrive_Owner_Work_Location__c =: userWorkLocation
                    AND  Dealer_Info_text__c = :accountInfo.Name
                    order by Name];
            ORDER BY Name
        ];
                
                    System.debug('reSet===>'+reSet);
        for(Consumable_order_details2__c cod2 : reSet){
            if ((cod2.Dealer_Shipment__c == false &&  cod2.Dealer_Saled__c == false
                && cod2.Lose_Flag__c == false && cod2.Cancellation_Flag__c == false) &&  cod2.Isoverdue__c == 0) {
            if (
                (cod2.Dealer_Shipment__c == false &&
                cod2.Dealer_Saled__c == false &&
                cod2.Lose_Flag__c == false &&
                cod2.Cancellation_Flag__c == false) && cod2.Isoverdue__c == 0
            ) {
                for (orderBean codPage : codPageRecords) {
                    if(cod2.Consumable_Product__c == codPage.prodid && cod2.Box_Piece__c == codPage.boxPiece){
                        overduePageRecords.add(new orderBean(cod2,'过期库存销存'));
@@ -208,7 +236,6 @@
        return res;
    }
    // 保存按钮
    @AuraEnabled
    public static ResponseBodyLWC save(Boolean iSinventory,string saveCodPageRecords,List<Consumable_order_details2__c> saveoverdueList) {
@@ -227,14 +254,14 @@
        // List<Consumable_order_details2__c> overdueList = (List<Consumable_order_details2__c>)JSON.deserialize(saveoverdueList,List<Consumable_order_details2__c>.class);
         // add by Wang Xueqin 2023/04/12
        // 获取用户和经销商信息
        user Useracc = [select Accountid, Work_Location__c,UserPro_Type__c from user where id =: UserInfo.getUserId()];
        user Useracc = [SELECT Accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId()];
        accountInfo = [SELECT id,Name,Dealer_discount__c FROM account WHERE id =:Useracc.accountid];
        // 跳过明细2不必要更新
        StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
        if(!iSinventory){
            // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'请先点【BarCode录入】'));
            return new ResponseBodyLWC('Error',500, '请先点击获取明细', '');
            return new ResponseBodyLWC('Error', 500, '请先录入BarCode', '');
            // return null;
        }
        integer Lo = 0;
@@ -262,7 +289,7 @@
        try{
            insert  po;
            Consumable_order__c order = [SELECT Name FROM Consumable_order__c WHERE id =:po.id];
            List<Consumable_orderdetails__c> InsList = New List<Consumable_orderdetails__c>();
            List<Consumable_orderdetails__c> InsList = new List<Consumable_orderdetails__c>();
            for(orderBean header : codPageRecords){
                if(header.check==true){
                    Consumable_orderdetails__c insPan = new Consumable_orderdetails__c();
@@ -291,12 +318,10 @@
                cod.Inventory_date__c = Date.today();
                cod.Lose_reason__c = '过期库存销存';
                cod.Lose_Flag__c = true;
            }
            if(overdueList.size()>0){
                ControllerUtil.updateOrderDetailsSatus(overdueList);
            }
        }catch (Exception ex) {
            Database.rollback(sp);
            ApexPages.addMessages(ex);
@@ -313,7 +338,7 @@
    // 将页面或取得BarCode去掉重复的,转换成List
    public static List<String> ParseBarCode(String Code){
        Map<String,Integer> barcodeCountMap = new Map<String,Integer>();
        String[] Cache = new String[]{};
        String[] Cache = new List<String>{};
        Cache = Code.split('\n');
        List <String> Buff = new List<String>();
        for(String A : Cache){
force-app/main/default/classes/LexProductLimitEditController.cls
@@ -37,18 +37,19 @@
            ETFlag = true;
        }
        List<Account> accinfo = New List<Account>();
        List<Account> accinfo = new List<Account>();
        //--------UpdateStart-----XHL--------------20181008-------------
        accinfo = [SELECT Product_Limit_Date__c,Product_Limit_DateENG__c
        accinfo = [
            SELECT Product_Limit_Date__c, Product_Limit_DateENG__c
                    FROM Account
                    WHERE id =:accountid];
            WHERE id = :accountid
        ];
        if(accinfo.size() > 0){
            if(EngFlag){
               product_Limit = accinfo [0].Product_Limit_DateENG__c;
            }else if(ETFlag){
               product_Limit = accinfo [0].Product_Limit_Date__c;
            }
        }
        System.debug('product_Limit==>'+product_Limit);
        data.put('product_Limit',product_Limit);
force-app/main/default/classes/LexRemoveBoxController.cls
@@ -11,7 +11,7 @@
    public static List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy { get; set; }
    public static boolean saveFLGbln {get;set;}
    //错误信息
    public static String alertMessage {set;get;}
    public static String alertMessage { get; set; }
    //拆盒明细件数
    public static integer getinventorysize(){
        return ConsumableorderdetailsRecordsdummy.size();
@@ -21,7 +21,7 @@
    public static Map<String, String> AllMap = new Map<String, String>();
    public static List<String> BarCodeListP = new List<String>();
    //不符合的barcode和型号
    public static list<String> notInlist = new list<String>();
    public static list<String> notInlist = new List<String>();
    public static String baseUrl {get;private set;}
    private static String accountid = null;
    private static String accountName = null;
@@ -34,7 +34,7 @@
        ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>();
        ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>();
        consumableInventory = new List<ConsumableorderdetailsInfo>();
        saveFLGbln = FALSE;
        saveFLGbln = false;
    }
    @AuraEnabled
@@ -43,9 +43,8 @@
        Map<String,object> data = new Map<String,object>();
        res.entity = data;
        String userId = UserInfo.getUserId();
        List<user> Useracc = New List<user>();
        List<user> Useracc = new List<user>();
        Useracc = [SELECT accountid, Work_Location__c,UserPro_Type__c FROM user WHERE id =:userId];
        accountid = Useracc[0].accountid;
        userWorkLocation = Useracc[0].Work_Location__c;
@@ -71,7 +70,7 @@
    // 将页面或取得BarCode去掉重复的,转换成List
    public static List<String> ParseBarCode(String Code){
        String[] Cache = new String[]{};
        String[] Cache = new List<String>{};
        Cache = Code.split('\n');
        Set <String> Buff = new Set<String>();
        for(String A : Cache){
@@ -87,8 +86,12 @@
    //获取明细
    @AuraEnabled
    public static ResponseBodyLWC searchConsumableorderdetails(String barcode,String accountName,String userWorkLocation,String agencyProType) {
    public static ResponseBodyLWC searchConsumableorderdetails(
        String barcode,
        String accountName,
        String userWorkLocation,
        String agencyProType
    ) {
        ResponseBodyLWC res = new ResponseBodyLWC();
        Map<String,object> data = new Map<String,object>();
        res.entity = data;
@@ -99,12 +102,10 @@
        ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>();
        ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>();
        notInlist = new list<String>();
        notInlist = new List<String>();
        BarCodeListP = ParseBarCode(barcode);
        Consumable_order_details2__c p = new Consumable_order_details2__c();
        List<Consumable_order_details2__c> Ins = New List<Consumable_order_details2__c>();
        List<Consumable_order_details2__c> Ins = new List<Consumable_order_details2__c>();
        List<Consumable_order_details2__c> reSet = new List<Consumable_order_details2__c>();
        List<Consumable_order_details2__c> reSet1 = new List<Consumable_order_details2__c>();
@@ -125,18 +126,33 @@
        // ConsumableorderdetailsRecordsdummy.clear();
        // 产品类型不同
        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
                        Deliver_date__c,Bar_Code__c,Product_Type__c,
                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c, Arrive_Owner_Work_Location__c
        reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__r.Name__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Bar_Code__c,
                Product_Type__c,
                Arrive_date__c,
                Send_Date__c,
                Consumable_order_minor__r.Name,
                Consumable_order_minor__c,
                recordtypeid,
                Consumable_order_minor__r.Arrive_Order__c,
                Arrive_Owner_Work_Location__c
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Arrive__c = true
                    AND   Bar_Code__c in :BarCodeListP
            WHERE
                Dealer_Arrive__c = TRUE
                AND Bar_Code__c IN :BarCodeListP
                    AND   Dealer_Info_text__c = :accountName
                    AND   Arrive_Owner_Work_Location__c = : userWorkLocation
                    AND (not Product_Type__c like : userPro_Typestr)
                    ORDER BY Name ];
                AND (NOT Product_Type__c LIKE :userPro_Typestr)
            ORDER BY Name
        ];
        if(reSet1.size() > 0){
            for (Integer i = 0; i < reSet1.size(); i++) {
                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
@@ -150,21 +166,34 @@
            }
        }
        //未到货
        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
                        Deliver_date__c,Bar_Code__c,
                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c
        reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__r.Name__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Bar_Code__c,
                Arrive_date__c,
                Send_Date__c,
                Consumable_order_minor__r.Name,
                Consumable_order_minor__c,
                recordtypeid,
                Consumable_order_minor__r.Arrive_Order__c
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Arrive__c = FALSE
            WHERE
                Dealer_Arrive__c = FALSE
                    AND  Dealer_Shipment__c= FALSE
                    AND  Dealer_Saled__c = FALSE
                    AND  Dealer_Returned__c = false
                    AND  Lose_Flag__c = false
                AND Dealer_Returned__c = FALSE
                AND Lose_Flag__c = FALSE
                    AND  Box_Piece__c = '盒'
                    AND  Bar_Code__c in :BarCodeListP
                AND Bar_Code__c IN :BarCodeListP
                    AND  Dealer_Info_text__c = :accountName
                    ORDER BY Name ];  //已发货,未到货
            ORDER BY Name
        ]; //已发货,未到货
        if(reSet1.size() > 0){
            for (Integer i = 0; i < reSet1.size(); i++) {
                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
@@ -179,22 +208,35 @@
        }
        //已规格=1
        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
                        Deliver_date__c,Bar_Code__c,
                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c
        reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__r.Name__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Bar_Code__c,
                Arrive_date__c,
                Send_Date__c,
                Consumable_order_minor__r.Name,
                Consumable_order_minor__c,
                recordtypeid,
                Consumable_order_minor__r.Arrive_Order__c
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Arrive__c = true
            WHERE
                Dealer_Arrive__c = TRUE
                    AND  Dealer_Shipment__c= FALSE
                    AND  Dealer_Saled__c = FALSE
                    AND  Dealer_Returned__c = false
                    AND  Lose_Flag__c = false
                AND Dealer_Returned__c = FALSE
                AND Lose_Flag__c = FALSE
                    AND  Box_Piece__c = '盒'
                    AND  ProductPacking_list_manual__c = 1
                    AND  Bar_Code__c in :BarCodeListP
                AND Bar_Code__c IN :BarCodeListP
                    AND  Dealer_Info_text__c = :accountName
                    ORDER BY Name ];  //没出库,没销售,就是在库,没拆盒,规格=1
            ORDER BY Name
        ]; //没出库,没销售,就是在库,没拆盒,规格=1
        if(reSet1.size() > 0){
            for (Integer i = 0; i < reSet1.size(); i++) {
                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
@@ -208,19 +250,32 @@
            }
        }
        //已出货
        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
                        Deliver_date__c,Bar_Code__c,
                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c
        reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__r.Name__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Bar_Code__c,
                Arrive_date__c,
                Send_Date__c,
                Consumable_order_minor__r.Name,
                Consumable_order_minor__c,
                recordtypeid,
                Consumable_order_minor__r.Arrive_Order__c
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Shipment__c = true
                    AND   Dealer_Arrive__c = true
                    AND   Dealer_Returned__c = false
                    AND   Lose_Flag__c = false
                    AND   Bar_Code__c in :BarCodeListP
            WHERE
                Dealer_Shipment__c = TRUE
                AND Dealer_Arrive__c = TRUE
                AND Dealer_Returned__c = FALSE
                AND Lose_Flag__c = FALSE
                AND Bar_Code__c IN :BarCodeListP
                    AND   Dealer_Info_text__c = :accountName
                    ORDER BY Name ];
            ORDER BY Name
        ];
        if(reSet1.size() > 0){
            for (Integer i = 0; i < reSet1.size(); i++) {
                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
@@ -235,18 +290,31 @@
        }
        //已销售
        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
                        Deliver_date__c,Bar_Code__c,
                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c
        reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__r.Name__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Bar_Code__c,
                Arrive_date__c,
                Send_Date__c,
                Consumable_order_minor__r.Name,
                Consumable_order_minor__c,
                recordtypeid,
                Consumable_order_minor__r.Arrive_Order__c
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Saled__c = true
                    AND   Dealer_Returned__c = false
                    AND   Dealer_Arrive__c = true
                    AND   Bar_Code__c in :BarCodeListP
            WHERE
                Dealer_Saled__c = TRUE
                AND Dealer_Returned__c = FALSE
                AND Dealer_Arrive__c = TRUE
                AND Bar_Code__c IN :BarCodeListP
                    AND   Dealer_Info_text__c = :accountName
                    ORDER BY Name ];
            ORDER BY Name
        ];
        if(reSet1.size() > 0){
            for (Integer i = 0; i < reSet1.size(); i++) {
                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
@@ -261,21 +329,34 @@
        }
        //已拆盒
        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
                        Deliver_date__c,Bar_Code__c,
                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c
        reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__r.Name__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Bar_Code__c,
                Arrive_date__c,
                Send_Date__c,
                Consumable_order_minor__r.Name,
                Consumable_order_minor__c,
                recordtypeid,
                Consumable_order_minor__r.Arrive_Order__c
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Arrive__c = true
                    AND  Dealer_Shipment__c= false
                    AND  Dealer_Saled__c = false
                    AND  Dealer_Returned__c = false
            WHERE
                Dealer_Arrive__c = TRUE
                AND Dealer_Shipment__c = FALSE
                AND Dealer_Saled__c = FALSE
                AND Dealer_Returned__c = FALSE
                    AND  Box_Piece__c = '个'
                    AND  ProductPacking_list_manual__c > 1
                    AND  Bar_Code__c in :BarCodeListP
                AND Bar_Code__c IN :BarCodeListP
                    AND  Dealer_Info_text__c = :accountName
                    ORDER BY Name ];  //没出库,没销售,就是在库,已拆盒
            ORDER BY Name
        ]; //没出库,没销售,就是在库,已拆盒
        if(reSet1.size() > 0){
            for (Integer i = 0; i < reSet1.size(); i++) {
                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
@@ -290,18 +371,32 @@
        }
        // 已经取消
        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
                        Deliver_date__c,Bar_Code__c,
                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c, Arrive_Owner_Work_Location__c
        reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__r.Name__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Bar_Code__c,
                Arrive_date__c,
                Send_Date__c,
                Consumable_order_minor__r.Name,
                Consumable_order_minor__c,
                recordtypeid,
                Consumable_order_minor__r.Arrive_Order__c,
                Arrive_Owner_Work_Location__c
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Arrive__c = true
                    AND   Cancellation_Flag__c = true
                    AND   Bar_Code__c in :BarCodeListP
            WHERE
                Dealer_Arrive__c = TRUE
                AND Cancellation_Flag__c = TRUE
                AND Bar_Code__c IN :BarCodeListP
                    AND   Dealer_Info_text__c = :accountName
                    AND   Arrive_Owner_Work_Location__c = : userWorkLocation
                    ORDER BY Name ];
            ORDER BY Name
        ];
        if(reSet1.size() > 0){
            for (Integer i = 0; i < reSet1.size(); i++) {
                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
@@ -316,22 +411,36 @@
        }
        // 工作地不同
        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
                        Deliver_date__c,Bar_Code__c,
                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c, Arrive_Owner_Work_Location__c
        reSet1 = [
            SELECT
                Id,
                Name,
                Consumable_Product__r.Name__c,
                Consumable_Product__c,
                Consumable_Product__r.Name,
                Sterilization_limit__c,
                Deliver_date__c,
                Bar_Code__c,
                Arrive_date__c,
                Send_Date__c,
                Consumable_order_minor__r.Name,
                Consumable_order_minor__c,
                recordtypeid,
                Consumable_order_minor__r.Arrive_Order__c,
                Arrive_Owner_Work_Location__c
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Arrive__c = true
            WHERE
                Dealer_Arrive__c = TRUE
                    // gzw 无法拆盒,去掉销售明细 20210802
                    AND  Dealer_Shipment__c= false
                    AND  Dealer_Saled__c = false
                    AND  Dealer_Returned__c = false
                AND Dealer_Shipment__c = FALSE
                AND Dealer_Saled__c = FALSE
                AND Dealer_Returned__c = FALSE
                    // gzw 无法拆盒,去掉销售明细 20210802
                    AND   Bar_Code__c in :BarCodeListP
                AND Bar_Code__c IN :BarCodeListP
                    AND   Dealer_Info_text__c = :accountName
                    AND   Arrive_Owner_Work_Location__c != : userWorkLocation
                    ORDER BY Name ];
            ORDER BY Name
        ];
        if(reSet1.size() > 0){
            for (Integer i = 0; i < reSet1.size(); i++) {
                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
@@ -345,9 +454,9 @@
            }
        }
        reSet = [SELECT Id,
        reSet = [
            SELECT
                Id,
                        Name,
                        Intra_Trade_List_RMB__c,
                        Asset_Model_No__c,
@@ -371,27 +480,26 @@
                        Frist_Storage_Agency__c,
                        Dealer_Info_text__c
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Arrive__c = true
                    AND Dealer_Shipment__c = false
                    AND Dealer_Saled__c = false
                    AND Dealer_Returned__c = false
                    AND Lose_Flag__c = false
                    AND Bar_Code__c in :BarCodeListP
            WHERE
                Dealer_Arrive__c = TRUE
                AND Dealer_Shipment__c = FALSE
                AND Dealer_Saled__c = FALSE
                AND Dealer_Returned__c = FALSE
                AND Lose_Flag__c = FALSE
                AND Bar_Code__c IN :BarCodeListP
                    AND Dealer_Info_text__c = :accountName
                    AND Arrive_Owner_Work_Location__c = : userWorkLocation
                    AND Product_Type__c like : userPro_Typestr
                AND Product_Type__c LIKE :userPro_Typestr
                ];
        if(reSet.size()>0){
            for (Integer i = 0; i < reSet.size(); i++) {
                if(ErrorIdMap.containsKey(reSet[i].Bar_Code__c) ){
                    // 跳过错误的消耗品明细
                    continue;
                }
                else if(ExistIdMap.containsKey(reSet[i].Bar_Code__c) ){
                } else if (ExistIdMap.containsKey(reSet[i].Bar_Code__c)) {
                    // 跳过已经处理的消耗品明细
                    continue;
                }
                else{
                } else {
                    ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i]));
                    ExistIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
                }
@@ -414,7 +522,6 @@
                return new ResponseBodyLWC('Error',500, 'BarCode'+ notInlist + '不存在', '');
        }
        data.put('ConsumableorderdetailsRecordsdummy',JSON.serialize(ConsumableorderdetailsRecordsdummy));
        data.put('ConsumableorderdetailsRecordserror',JSON.serialize(ConsumableorderdetailsRecordserror));
        data.put('dataSize',ConsumableorderdetailsRecordsdummy.size());
@@ -422,12 +529,16 @@
        res.code = 200;
        System.debug('res = ' + res);
        return res;
    }
    //拆盒确认
    @AuraEnabled
    public static ResponseBodyLWC removeBoxConfirm(String saveConsumableorderdetailsRecordsdummy,String accountName,String userWorkLocation,String agencyProType) {
    public static ResponseBodyLWC removeBoxConfirm(
        String saveConsumableorderdetailsRecordsdummy,
        String accountName,
        String userWorkLocation,
        String agencyProType
    ) {
        ResponseBodyLWC res = new ResponseBodyLWC();
        Map<String,object> data = new Map<String,object>();
        res.entity = data;
@@ -435,12 +546,12 @@
        userPro_Typestr = '%' + agencyProType + '%';
        accountName = accountName;
        userWorkLocation =userWorkLocation;
        List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy = (List<ConsumableorderdetailsInfo>)JSON.deserialize(saveConsumableorderdetailsRecordsdummy,List<ConsumableorderdetailsInfo>.class);
        List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy = (List<ConsumableorderdetailsInfo>) JSON.deserialize(
            saveConsumableorderdetailsRecordsdummy,
            List<ConsumableorderdetailsInfo>.class
        );
      
        List<Consumable_order_details2__c> ins = New List<Consumable_order_details2__c>();
        List<Consumable_order_details2__c> ins = new List<Consumable_order_details2__c>();
        Savepoint sp = Database.setSavepoint();
        if(ConsumableorderdetailsRecordsdummy.size()<1){
@@ -456,7 +567,8 @@
        try{
            //取得在库信息
            List<Consumable_order_details2__c> orderDetails2 =  [SELECT
            List<Consumable_order_details2__c> orderDetails2 = [
                SELECT
                        Id,
                        Name,
                        Bar_Code__c,
@@ -487,24 +599,25 @@
                        Frist_Storage_Agency__c,
                        Dealer_Info_text__c,
                        //add by rentx 2020-10-13 start
                        ContractNo_text__c
                    ContractNo_text__c,
                        /*,ContractNo__c*/
                        //add by rentx 2020-10-13 end
                         // tcm start
                        ,Consumable_order_minor__r.ContractNo__c
                    Consumable_order_minor__r.ContractNo__c
                        // tcm end
                    FROM Consumable_order_details2__c
                    WHERE Dealer_Arrive__c = true
                    AND Dealer_Shipment__c = false
                    AND Dealer_Saled__c = false
                    AND Dealer_Returned__c = false
                    AND Lose_Flag__c = false
                WHERE
                    Dealer_Arrive__c = TRUE
                    AND Dealer_Shipment__c = FALSE
                    AND Dealer_Saled__c = FALSE
                    AND Dealer_Returned__c = FALSE
                    AND Lose_Flag__c = FALSE
                    AND Box_Piece__c = '盒'
                    AND ProductPacking_list_manual__c > 1
                    AND Bar_Code__c in :BarCodeList
                    AND Bar_Code__c IN :BarCodeList
                    AND Dealer_Info_text__c = :accountName 
                    AND Arrive_Owner_Work_Location__c =: userWorkLocation
                    AND Product_Type__c like : userPro_Typestr
                    AND Product_Type__c LIKE :userPro_Typestr
                ];
            List<Consumable_order_details2__c> orderDetails2del = new List<Consumable_order_details2__c>();
@@ -550,7 +663,6 @@
            if(orderDetails2ins.size()>0){
                insert orderDetails2ins;
            }
            saveFLGbln = true;
@@ -568,7 +680,6 @@
            return null;
        }
    }
    class ConsumableorderdetailsInfo implements Comparable {
        @AuraEnabled
force-app/main/default/classes/LexSaleAndDeliveryController.cls
force-app/main/default/classes/LexSaleOrderController.cls
@@ -201,6 +201,7 @@
        //BarCodelist做成
        barCodeListP = ParseBarCode(barcode);
        System.debug('barCodeListP:' + barCodeListP);
        //针对所有商品到货确认
        reSet1 = [
            SELECT
@@ -235,6 +236,7 @@
                AND Arrive_Owner_Work_Location__c = :userWorkLocation
            ORDER BY RemoveBox_No__c DESC
        ];
        System.debug('reSet1:' + reSet1);
        List<Consumable_order_details2__c> newdet2 = new List<Consumable_order_details2__c>();
        Set<Id> proIds = new Set<Id>();
@@ -242,6 +244,7 @@
            Integer idx = 0;
            for (Consumable_order_details2__c cod2 : reSet1) {
                if (cod2.Bar_Code__c == barcode) {
                    System.debug('cod2.Bar_Code__c:' + cod2.Bar_Code__c);
                    newdet2.add(cod2);
                    reSet1.remove(idx);
                    proIds.add(cod2.Consumable_product__c);
@@ -1076,7 +1079,12 @@
        for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecords) {
            String key = '' + ass.orderdetails2.Bar_Code__c;
            Integer deliverycnt = BarcodeCntMap.get(key);
            if (ass.orderdetails2.Box_Piece__c == '个' &&(ass.outboundCount == null || String.valueof(ass.outboundCount) == '' || ass.outboundCount <= 0)) {
            if (
                ass.orderdetails2.Box_Piece__c == '个' &&
                (ass.outboundCount == null ||
                String.valueof(ass.outboundCount) == '' ||
                ass.outboundCount <= 0)
            ) {
                // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '请输入产品 '+ ass.Prod.Name +' 的出货数量'));
                // return null;
                System.debug('ass.orderdetails2.Box_Piece__c = '  + ass.orderdetails2.Box_Piece__c);
@@ -1265,6 +1273,7 @@
        return consumableorderdetails2Nobox.size();
    }
    @TestVisible
    class ConsumableorderdetailsInfo implements Comparable {
        @AuraEnabled
        public Consumable_orderdetails__c orderdetails1 { get; set; }
force-app/main/default/classes/LexSearchContractController.cls
@@ -9,14 +9,22 @@
            User useracc = [SELECT accountid,OSHFLG__c FROM user WHERE id = :UserInfo.getUserId() ];
            OSHFLG = Useracc.OSHFLG__c; //lt 20230517 安徽两票制 add;
            String accountId = Useracc.accountid;
            List<Account> attList = [SELECT id,Name,State_Master__c,State_Master__r.Name,Sales_Section__c,
                        Contract_Decide_Start_Date__c,Contract_Decide_End_Date__c
            List<Account> attList = [
                SELECT
                    id,
                    Name,
                    State_Master__c,
                    State_Master__r.Name,
                    Sales_Section__c,
                    Contract_Decide_Start_Date__c,
                    Contract_Decide_End_Date__c
                    FROM Account
                    WHERE ParentId = :accountId
                    AND Contact_Type__c like :ctype
                WHERE
                    ParentId = :accountId
                    AND Contact_Type__c LIKE :ctype
                    AND Contract_Decide_Start_Date__c <= :Date.Today()
                    AND Contract_Decide_End_Date__c >= :Date.Today()
                    AND Secondary_contract__c = false
                    AND Secondary_contract__c = FALSE
                    AND OSH_Dealer__c =: OSHFLG  //lt 20230517 安徽两票制 add
                    ];
            results.attList = attList;
@@ -43,7 +51,6 @@
    }
    private static String makeSoql(String CateName,Date timetest,String accountId, String ctype){
        String soql = 'SELECT id,Name,State_Master__c,State_Master__r.Name,Sales_Section__c,';
        soql += ' Contract_Decide_Start_Date__c,Contract_Decide_End_Date__c,OSH_Dealer__c FROM Account';
        soql += ' where ParentId = \'' + accountId + '\'' ;
force-app/main/default/classes/LexSearchHospitalController.cls
@@ -1,5 +1,4 @@
public without sharing class LexSearchHospitalController {
    @AuraEnabled
    public static Results init(){
        Results results = new Results();
force-app/main/default/classes/LexSummonsCreatController.cls
@@ -245,7 +245,13 @@
    // 画面初始化
    @AuraEnabled
    public static ResponseBodyLWC init(String ESetidJs, String statusEdit, Integer pageSizeLWC, Integer pageTokenLWC,String arriveorderLWC) {
    public static ResponseBodyLWC init(
        String ESetidJs,
        String statusEdit,
        Integer pageSizeLWC,
        Integer pageTokenLWC,
        String arriveorderLWC
    ) {
        try {
            firstInit(ESetidJs);
            statusEdit = statusEdit;
@@ -2122,11 +2128,7 @@
                    return new ResponseBodyLWC(
                        'Error',
                        500,
                        '经销商:' +
                        coc.Order_ForDealerText__c +
                        ' 没有消耗品:' +
                        proStr.substring(0, proStr.length() - 1) +
                        ' 的特价',
                        '经销商:' + coc.Order_ForDealerText__c + ' 没有消耗品:' + proStr.substring(0, proStr.length() - 1) + ' 的特价',
                        ''
                    );
                }
@@ -2183,7 +2185,10 @@
                    if (ass.orderdetails1.Delivery_List_RMB__c == null && coc.SummonsForDirction__c != '医院试用') {
                        return new ResponseBodyLWC('Error', 500, '请输入正确的出货单价 (元)', '');
                    }
                    if ((ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) && coc.SummonsForDirction__c != '医院试用') {
                    if (
                        (ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) &&
                        coc.SummonsForDirction__c != '医院试用'
                    ) {
                        return new ResponseBodyLWC('Error', 500, '请输入出货单价 (元)', '');
                    }
                    if (
@@ -2215,9 +2220,7 @@
                                return new ResponseBodyLWC(
                                    'Error',
                                    500,
                                    '消耗品' +
                                    ass.orderdetails1.Consumable_Product__r.Name__c +
                                    '库存不足',
                                    '消耗品' + ass.orderdetails1.Consumable_Product__r.Name__c + '库存不足',
                                    ''
                                );
                            }
@@ -2233,9 +2236,7 @@
                                return new ResponseBodyLWC(
                                    'Error',
                                    500,
                                    '消耗品' +
                                    ass.orderdetails1.Consumable_Product__r.Name__c +
                                    '库存不足',
                                    '消耗品' + ass.orderdetails1.Consumable_Product__r.Name__c + '库存不足',
                                    ''
                                );
                            }
@@ -2341,7 +2342,10 @@
                        return new ResponseBodyLWC('Error', 500, '请输入正确的出货单价 (元)', '');
                    }
                    Consumable_orderdetails__c InsAfterDel = new Consumable_orderdetails__c();
                    if ((ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) && coc.SummonsForDirction__c != '医院试用') {
                    if (
                        (ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) &&
                        coc.SummonsForDirction__c != '医院试用'
                    ) {
                        return new ResponseBodyLWC('Error', 500, '请输入出货单价 (元)', '');
                    }
                    if (
@@ -2367,9 +2371,7 @@
                                return new ResponseBodyLWC(
                                    'Error',
                                    500,
                                    '消耗品' +
                                    ass.orderdetails1.Consumable_Product__r.Name__c +
                                    '库存不足',
                                    '消耗品' + ass.orderdetails1.Consumable_Product__r.Name__c + '库存不足',
                                    ''
                                );
                            }
@@ -2384,9 +2386,7 @@
                                return new ResponseBodyLWC(
                                    'Error',
                                    500,
                                    '消耗品' +
                                    ass.orderdetails1.Consumable_Product__r.Name__c +
                                    '库存不足',
                                    '消耗品' + ass.orderdetails1.Consumable_Product__r.Name__c + '库存不足',
                                    ''
                                );
                            }
@@ -2561,7 +2561,6 @@
        //     ];
        // }
        Date today = Date.today();
        //Date today = Date.newInstance(2023, 3, 1);
        Integer thisMonth = today.month();
@@ -2580,7 +2579,7 @@
        System.debug('thisDatetime2 = ' + thisDatetime2);
        System.debug('nextDatetime = ' + nextDatetime);
        System.debug('UserInfo.getUserId() = ' + UserInfo.getUserId());
        User UserProTypecTemp = [select UserPro_Type__c from User where id =: UserInfo.getUserId()];
        User UserProTypecTemp = [SELECT UserPro_Type__c FROM User WHERE id = :UserInfo.getUserId()];
        String sql = 'SELECT id, Parentid FROM Account WHERE Parent.Name LIKE :nameCondition ';
        if(thisMonth < 4){
@@ -2693,7 +2692,7 @@
        try {
            ContentVersion conVersion = [SELECT ContentDocumentId FROM ContentVersion WHERE Id = :contentVersionId];
            String contentDocumentId = conVersion.ContentDocumentId;
            ContentDocument conDocument =  [SELECT Id FROM ContentDocument where Id = :contentDocumentId];
            ContentDocument conDocument = [SELECT Id FROM ContentDocument WHERE Id = :contentDocumentId];
            delete conDocument;
            return new ResponseBodyLWC('Success',200,'','');
        } catch (Exception e) {
@@ -2776,6 +2775,7 @@
    }
    // Data Bean
    @TestVisible
    class ConsumableorderdetailsInfo implements Comparable {
        @AuraEnabled
        public Boolean check { get; set; }
@@ -2916,6 +2916,7 @@
        }
    }
    @TestVisible
    class ConsumableorderdetailsInfoLwc {
        @AuraEnabled
        public Boolean check { get; set; }
force-app/main/default/classes/LexTopPageController.cls
@@ -39,9 +39,9 @@
    public static List<Consumable_order__c> raesList;
    /*****************一周未到货订单一览对应end******************/
    //排序使用
    private static String[] orderby = new String[]{ 'Product2__c.Name__c'};
    private static String[] orderby = new List<String>{ 'Product2__c.Name__c' };
    //产品上下限
    public static String[] proLimitAndDate =new String[]{};
    public static String[] proLimitAndDate = new List<String>{};
    public static String product_Limit;
    //库存产品最早有效期限
    private static Map<String,Date> productkucun = new Map<String,Date>();
@@ -79,18 +79,35 @@
            User useracc = [SELECT accountid, Work_Location__c,UserPro_Type__c FROM user WHERE id =:UserInfo.getUserId()];
            accountid = useracc.accountid;
            List<Account> accList = new List<Account>();
            accList = [SELECT Name,Ban_On_Use_Reason__c,Deposit_Price__c,
                    Medical_Equipment_Num__c,Medical_Equipment_Expiration_Date__c,
                    Ban_On_Use_Date__c,Tax_Practice_No__c,Tax_Practice_Expiration_Date__c,
                    Business_Authorization_No__c,Business_Paper_Expiration_Date__c,
                    Credit_Check_No__c,Dealer_discount__c,
                    Phone,Address_Together__c,Is_Active_Formula__c,
                    Management_Code__c,Sales_Shop_Class__c,Postal_Code__c,
                    Fax,Address__c,Deposit_Receipt_Finished__c,
            accList = [
                SELECT
                    Name,
                    Ban_On_Use_Reason__c,
                    Deposit_Price__c,
                    Medical_Equipment_Num__c,
                    Medical_Equipment_Expiration_Date__c,
                    Ban_On_Use_Date__c,
                    Tax_Practice_No__c,
                    Tax_Practice_Expiration_Date__c,
                    Business_Authorization_No__c,
                    Business_Paper_Expiration_Date__c,
                    Credit_Check_No__c,
                    Dealer_discount__c,
                    Phone,
                    Address_Together__c,
                    Is_Active_Formula__c,
                    Management_Code__c,
                    Sales_Shop_Class__c,
                    Postal_Code__c,
                    Fax,
                    Address__c,
                    Deposit_Receipt_Finished__c,
                    Deposit_Receipt_Completion_Day__c,
                    Product_Limit_Date__c,
                    Product_Limit_DateENG__c
                    FROM account WHERE id =:accountid];
                FROM account
                WHERE id = :accountid
            ];
            if(accList.size() == 1){
                accountInfo = accList[0];
            }else{
@@ -138,18 +155,35 @@
            }
            //经销商·基本信息获取
            List<Account> accList = new List<Account>();
            accList = [SELECT Name,Ban_On_Use_Reason__c,Deposit_Price__c,
                    Medical_Equipment_Num__c,Medical_Equipment_Expiration_Date__c,
                    Ban_On_Use_Date__c,Tax_Practice_No__c,Tax_Practice_Expiration_Date__c,
                    Business_Authorization_No__c,Business_Paper_Expiration_Date__c,
                    Credit_Check_No__c,Dealer_discount__c,
                    Phone,Address_Together__c,Is_Active_Formula__c,
                    Management_Code__c,Sales_Shop_Class__c,Postal_Code__c,
                    Fax,Address__c,Deposit_Receipt_Finished__c,
            accList = [
                SELECT
                    Name,
                    Ban_On_Use_Reason__c,
                    Deposit_Price__c,
                    Medical_Equipment_Num__c,
                    Medical_Equipment_Expiration_Date__c,
                    Ban_On_Use_Date__c,
                    Tax_Practice_No__c,
                    Tax_Practice_Expiration_Date__c,
                    Business_Authorization_No__c,
                    Business_Paper_Expiration_Date__c,
                    Credit_Check_No__c,
                    Dealer_discount__c,
                    Phone,
                    Address_Together__c,
                    Is_Active_Formula__c,
                    Management_Code__c,
                    Sales_Shop_Class__c,
                    Postal_Code__c,
                    Fax,
                    Address__c,
                    Deposit_Receipt_Finished__c,
                    Deposit_Receipt_Completion_Day__c,
                    Product_Limit_Date__c,
                    Product_Limit_DateENG__c
                    FROM account WHERE id =:accountid];
                FROM account
                WHERE id = :accountid
            ];
            if(accList.size() == 1){
                accountInfo = accList[0];
            }else{
@@ -169,25 +203,30 @@
            List<ConsumableorderdetailsInfo> boxRecords = new List<ConsumableorderdetailsInfo>();
             //库存明细取得
            orderDetZaikuList = new List<String>();
            List<AggregateResult>  orderDetZaiku = [SELECT count(Id),
                                                        Consumable_Product__c
            List<AggregateResult> orderDetZaiku = [
                SELECT count(Id), Consumable_Product__c
                                                    FROM Consumable_order_details2__c
                                                    WHERE Dealer_Arrive__c = true
                                                    AND Dealer_Shipment__c = false
                                                    AND Dealer_Saled__c = false
                                                    AND Lose_Flag__c = false
                                                    AND Dealer_Returned__c = false
                                                    AND Cancellation_Flag__c = false
                                                    AND Bar_Code__c !=null
                                                    AND Product_Type__c like : userPro_Typestr
                WHERE
                    Dealer_Arrive__c = TRUE
                    AND Dealer_Shipment__c = FALSE
                    AND Dealer_Saled__c = FALSE
                    AND Lose_Flag__c = FALSE
                    AND Dealer_Returned__c = FALSE
                    AND Cancellation_Flag__c = FALSE
                    AND Bar_Code__c != NULL
                    AND Product_Type__c LIKE :userPro_Typestr
                                                    AND Dealer_Info_text__c = :accountName
                                                    AND Arrive_Owner_Work_Location__c = :userWorkLocation
                                                    group by Consumable_Product__c];
                GROUP BY Consumable_Product__c
            ];
            for(AggregateResult zaikuId : orderDetZaiku){
                orderDetZaikuList.add(String.valueOf(zaikuId.get('Consumable_Product__c')));
            }
            Map<String,Product2__c> MidMap = new Map<String,Product2__c>();
            List<Product2__c> product2Selected = [SELECT Id, Name,
            List<Product2__c> product2Selected = [
                SELECT
                    Id,
                    Name,
                                    Name__c,
                                    Asset_Model_No__c,
                                    Category3__c,
@@ -198,14 +237,16 @@
                                    Product2__r.SFDA_Expiration_Date__c,
                                    Product2__r.Packing_list_manual__c
                                FROM Product2__c
                                WHERE Id in :orderDetZaikuList
                WHERE Id IN :orderDetZaikuList
                                ];
            for (Integer i = 0; i < product2Selected.size(); i++) {
                MidMap.put(product2Selected[i].Id, product2Selected[i]);
            }
            //返品库存统计
            List<Consumable_order_details2__c> CountDel = [SELECT Id,
            List<Consumable_order_details2__c> CountDel = [
                SELECT
                    Id,
                    Bar_Code__c,
                    Name,
                    Inventory_date__c,
@@ -216,16 +257,18 @@
                    Box_Piece__c,
                    hospitalSpecialOffer__c 
                FROM Consumable_order_details2__c
                WHERE  Dealer_Arrive__c = true
                AND Dealer_Shipment__c = false
                AND Dealer_Saled__c = false
                AND Dealer_Returned__c = false
                AND Lose_Flag__c = false
                AND Cancellation_Flag__c = false
                AND Bar_Code__c !=null
                AND Product_Type__c like : userPro_Typestr
                WHERE
                    Dealer_Arrive__c = TRUE
                    AND Dealer_Shipment__c = FALSE
                    AND Dealer_Saled__c = FALSE
                    AND Dealer_Returned__c = FALSE
                    AND Lose_Flag__c = FALSE
                    AND Cancellation_Flag__c = FALSE
                    AND Bar_Code__c != NULL
                    AND Product_Type__c LIKE :userPro_Typestr
                AND Dealer_Info_text__c = :accountName
                AND Arrive_Owner_Work_Location__c = :userWorkLocation];
                    AND Arrive_Owner_Work_Location__c = :userWorkLocation
            ];
            Map<String,ConsumableorderdetailsInfo> newMidBoxMap = new Map<String,ConsumableorderdetailsInfo>();
            Map<String,ConsumableorderdetailsInfo> newMidPieceMap = new Map<String,ConsumableorderdetailsInfo>();
            Map<String,ConsumableorderdetailsInfo> newHosMidBoxMap = new Map<String,ConsumableorderdetailsInfo>();
@@ -238,7 +281,10 @@
                        tex = 'B';
                    }
                    if(newMidBoxMap.containsKey(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c + tex)){
                        ConsumableorderdetailsInfo Jstage = newMidBoxMap.get(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c + tex).clone();
                        ConsumableorderdetailsInfo Jstage = newMidBoxMap.get(
                                CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
                            )
                            .clone();
                        Jstage.allnumber = Jstage.allnumber+1 ;
                        if(CountDel[i].Isoverdue__c == 1){
                            Jstage.limitCount = Jstage.limitCount + 1;
@@ -266,7 +312,10 @@
                        tex = 'B';
                    }
                    if(newMidPieceMap.containsKey(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c+ tex )){
                        ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c+ tex).clone();
                        ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(
                                CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
                            )
                            .clone();
                        Jstage.allnumber = Jstage.allnumber+1 ;
                        if(CountDel[i].Isoverdue__c == 1){
                            Jstage.limitCount = Jstage.limitCount + 1;
@@ -362,7 +411,6 @@
                if (bss.hospitalSpecialOffer) {
                    ishos = ishos+1;
                }
            }
            if (ishos > 0) {
                hasHos = true;
@@ -436,13 +484,15 @@
        //over_view = false;
        Date orderdate = Date.today().addDays(-7);
        
        List<Consumable_order_details2__c> orderdetails = [SELECT Id,Name,Consumable_order_minor__c
        List<Consumable_order_details2__c> orderdetails = [
            SELECT Id, Name, Consumable_order_minor__c
                                                            FROM Consumable_order_details2__c
                                                            WHERE Deliver_date__c < :orderdate
                                                            and Consumable_order_minor__c !=null
                                                            and Dealer_Info_text__c = :accountName
            WHERE
                Deliver_date__c < :orderdate
                AND Consumable_order_minor__c != NULL
                AND Dealer_Info_text__c = :accountName
                                                            AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
                                                            AND Dealer_Arrive__c = false
                AND Dealer_Arrive__c = FALSE
                                                            ];
        //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO , 'userPro_Type——————' + userPro_Type));
        Map<String, String> notarriveorderMap = new Map<String, String>();
@@ -477,7 +527,14 @@
        for (String s : column) {
            soql += ',' + s;
        }
        soql += ' from Consumable_order__c where Order_type__c = \''+'订单'+'\' and  recordtypeid =\'' + System.Label.RT_ConOrder_Delivery + '\' and Dealer_Info__c =\'' + accountid +'\'  and  Delivery_detail_count__c > 0 and showFalseNotshowTrue__c = false  ';
        soql +=
            ' from Consumable_order__c where Order_type__c = \'' +
            '订单' +
            '\' and  recordtypeid =\'' +
            System.Label.RT_ConOrder_Delivery +
            '\' and Dealer_Info__c =\'' +
            accountid +
            '\'  and  Delivery_detail_count__c > 0 and showFalseNotshowTrue__c = false  ';
        soql += ' and Order_ProType__c = \'' + userPro_Type  + '\' ' ;
        soql += ' and Order_Owner_WorkLocal__c = \'' + userWorkLocation + '\' ';
       
@@ -526,8 +583,12 @@
        }
        for(ConsumableorderdetailsInfo ass : consumableorderdetailsRecords){
            if(productLimt.containsKey(ass.Prod.Asset_Model_No__c)){
                ass.lowerlimit = decimal.valueOf(productLimt.get(ass.Prod.Asset_Model_No__c).subString(0, productLimt.get(ass.Prod.Asset_Model_No__c).indexOf( '|')));
                ass.upperlimit = decimal.valueOf(productLimt.get(ass.Prod.Asset_Model_No__c).subString(productLimt.get(ass.Prod.Asset_Model_No__c).indexOf( '|')+1));
                ass.lowerlimit = decimal.valueOf(
                    productLimt.get(ass.Prod.Asset_Model_No__c).subString(0, productLimt.get(ass.Prod.Asset_Model_No__c).indexOf('|'))
                );
                ass.upperlimit = decimal.valueOf(
                    productLimt.get(ass.Prod.Asset_Model_No__c).subString(productLimt.get(ass.Prod.Asset_Model_No__c).indexOf('|') + 1)
                );
           }
        }
    }
@@ -535,20 +596,29 @@
    public static void datelimitSearch(){
        Set<String> barcodekucun = new Set<String>();
        //--------UpdateStart-----XHL--------------20180929-------------
         List<Consumable_order_details2__c> orderkucun = [SELECT Id,Bar_Code__c, Name,Consumable_Product__c,
                                                        Recordtypeid,Guarantee_period_for_products__c,
                                                        Sterilization_limit__c,Box_Piece__c
        List<Consumable_order_details2__c> orderkucun = [
            SELECT
                Id,
                Bar_Code__c,
                Name,
                Consumable_Product__c,
                Recordtypeid,
                Guarantee_period_for_products__c,
                Sterilization_limit__c,
                Box_Piece__c
                                                        FROM Consumable_order_details2__c
                                                        WHERE Dealer_Arrive__c = true
                                                        AND Dealer_Shipment__c = false
                                                        AND Dealer_Saled__c = false
                                                        AND Dealer_Returned__c = false
                                                        AND Lose_Flag__c = false
                                                        AND Bar_Code__c !=null
                                                        AND Product_Type__c like :userPro_Typestr
            WHERE
                Dealer_Arrive__c = TRUE
                AND Dealer_Shipment__c = FALSE
                AND Dealer_Saled__c = FALSE
                AND Dealer_Returned__c = FALSE
                AND Lose_Flag__c = FALSE
                AND Bar_Code__c != NULL
                AND Product_Type__c LIKE :userPro_Typestr
                                                        AND Dealer_Info_text__c = :accountName
                                                        AND Arrive_Owner_Work_Location__c = :userWorkLocation
                                                        ORDER BY Consumable_Product__c, Sterilization_limit__c asc ];
            ORDER BY Consumable_Product__c, Sterilization_limit__c ASC
        ];
        //--------UpdateEnd-----XHL--------------20180929-------------
        for(Integer i = 0 ; i< orderkucun.size();i++){
            if(productkucun.containsKey(orderkucun[i].Consumable_Product__c)){
@@ -567,17 +637,19 @@
                }
            }
        }
        List<AggregateResult>  overlimitdatedetails = [SELECT Asset_Model_No__c prodName ,
                                            Box_Piece__c BoxPiece,count(id) countid
        List<AggregateResult> overlimitdatedetails = [
            SELECT Asset_Model_No__c prodName, Box_Piece__c BoxPiece, count(id) countid
                                        FROM Consumable_order_details2__c
                                        WHERE Bar_Code__c in :barcodekucun
                                        AND Dealer_Arrive__c = true
                                        AND Dealer_Shipment__c = false
                                        AND Dealer_Saled__c = false
                                        AND Dealer_Returned__c = false
                                        AND Lose_Flag__c = false
            WHERE
                Bar_Code__c IN :barcodekucun
                AND Dealer_Arrive__c = TRUE
                AND Dealer_Shipment__c = FALSE
                AND Dealer_Saled__c = FALSE
                AND Dealer_Returned__c = FALSE
                AND Lose_Flag__c = FALSE
                                        GROUP BY Asset_Model_No__c,Box_Piece__c
                                        ORDER BY Asset_Model_No__c,Box_Piece__c];
            ORDER BY Asset_Model_No__c, Box_Piece__c
        ];
        for(Integer i = 0 ; i< overlimitdatedetails.size();i++){
            overlimitdateorderdetails.add(new ConsumableorderdetailsInfo(overlimitdatedetails[i]));
        }
@@ -672,7 +744,6 @@
            allnumber = 0;
            limitCount = 0;
            overlimitCount = 0;
        }
        public ConsumableorderdetailsInfo(AggregateResult e) {
@@ -738,7 +809,5 @@
        public List<ConsumableorderdetailsInfo> pageCodeRecords;
        @AuraEnabled
        public PaginatedAccounts paginatedAccounts;
    }
}
force-app/main/default/classes/LexUpAccountProLimit.cls
@@ -24,23 +24,17 @@
        system.debug('userPro_Type' + userPro_Type);
        String checkResoultstr =  checkResoult(productLimit);
        system.debug('checkResoultstr====>'+checkResoultstr);
        system.debug('accountId'+accountId);
        if(String.isNotBlank(checkResoultstr)){
            return new ResponseBodyLWC('Error',500,''+checkResoultstr+'', '');
            // return checkResoultstr;
        }
        //String[] proidList =new String[]{};
        String[] proList =new String[]{};
        String[] pro_List =new String[]{};
        String[] proList = new List<String>{};
        String[] pro_List = new List<String>{};
        List<Account> acc = [
            SELECT
                    Id,
                    Name,
                    Product_Limit_Date__c
            FROM
                    Account
            WHERE
                    Id = : accountId
            SELECT Id, Name, Product_Limit_Date__c
            FROM Account
            WHERE Id = :accountId
            FOR UPDATE
        ];
        if(null == acc || acc.size() == 0) {
@@ -51,9 +45,11 @@
        //--------UpdateStart-----XHL--------------20180929-------------
        String sql = '';
      
        List<Product2__c> roduct2List = [SELECT Asset_Model_No__c,Estimation_Entry_Possibility__c
        List<Product2__c> roduct2List = [
            SELECT Asset_Model_No__c, Estimation_Entry_Possibility__c
        FROM Product2__c  
        WHERE Product_Type__c like :userPro_Typestr and Estimation_Entry_Possibility__c = '○'];//Add  by WangXueqin 20230605
            WHERE Product_Type__c LIKE :userPro_Typestr AND Estimation_Entry_Possibility__c = '○'
        ]; //Add  by WangXueqin 20230605
        //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'roduct2List:'+ roduct2List));
        //sql = 'SELECT Asset_Model_No__c '
        //    + ' FROM Product2__c '
@@ -88,7 +84,6 @@
        }
        String  productLimitDa = '';
        for(String str : productLimit.split(',')){
            if(str != null && str != ''){
                productLimitDa += ',' + str;
            }
@@ -103,7 +98,7 @@
               accinfo.Product_Limit_Date__c = String.isBlank(productLimitDa) ? productLimitDa : productLimitDa.subString(1);
            }
            
            UPDATE accinfo;
            update accinfo;
            res.status = 'Success';
            res.code = 200;
            System.debug('res = ' + res);
force-app/main/default/classes/LexUtility.cls
@@ -1,5 +1,4 @@
public without sharing class LexUtility {
    //查询是否一直显示提示
    public static Boolean getIsNoteStay(){
        NoteStay__c noteStay = NoteStay__c.getInstance('NoteStay');
force-app/main/default/classes/ResponseBodyLWC.cls
@@ -9,7 +9,8 @@
    public Object entity{get;set;}
    @AuraEnabled
    public List<Object> entityList{get;set;}
    public ResponseBodyLWC(){}
    public ResponseBodyLWC() {
    }
    
    public ResponseBodyLWC(String status,Integer code, String msg, Object entity){
        this.status = status;
force-app/main/default/classes/lexSearchAgencyHospitalController.cls
@@ -6,7 +6,6 @@
    @AuraEnabled
    public static List<Account> at {get;set;}
    @AuraEnabled
    public static ResponseBodyLWC init(String ctype){
        ResponseBodyLWC res = new ResponseBodyLWC();
@@ -19,7 +18,12 @@
            agencyProType = 'ET';
        }
        String soql = 'SELECT id,Name,State_Master__c,State_Master__r.Name FROM Account';
        soql += ' where id in (SELECT Hospital__c FROM Agency_Hospital_Link__c WHERE Agency__c = \'' + accountid + '\' AND Hosptial_Type__c like \'%' + String.escapeSingleQuotes(ctype.replaceAll('%', '\\%')) + '%\')' ;
        soql +=
            ' where id in (SELECT Hospital__c FROM Agency_Hospital_Link__c WHERE Agency__c = \'' +
            accountid +
            '\' AND Hosptial_Type__c like \'%' +
            String.escapeSingleQuotes(ctype.replaceAll('%', '\\%')) +
            '%\')';
        soql += ' order by Name desc limit 100';
        at = Database.query(soql);
        data.put('at',at);
@@ -45,9 +49,13 @@
    }
    private static String makeSoql(String searchName,String accountid,String ctype){
        String soql = 'SELECT id,Name,State_Master__c,State_Master__r.Name FROM Account';
        soql += ' where id in (SELECT Hospital__c FROM Agency_Hospital_Link__c WHERE Agency__c = \'' + accountid + '\' AND Hosptial_Type__c like \'%' + String.escapeSingleQuotes(ctype.replaceAll('%', '\\%')) + '%\')' ;
        soql +=
            ' where id in (SELECT Hospital__c FROM Agency_Hospital_Link__c WHERE Agency__c = \'' +
            accountid +
            '\' AND Hosptial_Type__c like \'%' +
            String.escapeSingleQuotes(ctype.replaceAll('%', '\\%')) +
            '%\')';
        if(String.isNotBlank(searchName)){
            soql += ' AND Name like \'%' + String.escapeSingleQuotes(searchName.replaceAll('%', '\\%')) + '%\'';
        }
force-app/main/default/labels/CustomLabels.labels-meta.xml
@@ -12,14 +12,14 @@
        <language>zh_CN</language>
        <protected>false</protected>
        <shortDescription>发票显示明细</shortDescription>
        <value>00O6D000000UPzaUAG</value>
        <value>00O0l000000zaGcEAI</value>
    </labels>
    <labels>
        <fullName>View_Weekly_Report</fullName>
        <language>zh_CN</language>
        <protected>false</protected>
        <shortDescription>查看周报活动</shortDescription>
        <value>00O6D000000UPzZUAW</value>
        <value>00O0l000000zo9aEAA</value>
    </labels>
    <labels>
        <fullName>invoiceStart</fullName>
force-app/main/default/lwc/boxorpieceType/boxorpieceType.html
@@ -5,6 +5,7 @@
            value={value}
            placeholder="请选择单位"
            options={options}
            onchange={handleChange} >
        onchange={handleChange}
    >
        </lightning-combobox>
</template>
force-app/main/default/lwc/boxorpieceType/boxorpieceType.js
@@ -12,7 +12,7 @@
    }
    connectedCallback(){
        console.log('enter BoxorpieceType')
        console.log('enter BoxorpieceType');
    }
    handleChange(event) {
force-app/main/default/lwc/commonToast/commonToast.html
@@ -4,7 +4,13 @@
            <div class={outerClass} role="status">
                <span class="slds-assistive-text">{type}</span>
                <span class={innerClass} title={message}>
                    <lightning-icon icon-name={getIconName} alternative-text="icon" styleclass="slds-icon slds-icon_small" variant="inverse" size="small"></lightning-icon>
                    <lightning-icon
                        icon-name={getIconName}
                        alternative-text="icon"
                        styleclass="slds-icon slds-icon_small"
                        variant="inverse"
                        size="small"
                    ></lightning-icon>
                </span>
                <div class="slds-notify__content">
                    <h2 class="slds-text-heading_small">
@@ -14,7 +20,14 @@
                </div>
                
                <div class="slds-notify__close">
                    <lightning-button-icon icon-name="utility:close" size="small" variant="border-filled" class="slds-button slds-button_icon slds-button_icon-inverse" alternative-text="next" onclick={closeModel} ></lightning-button-icon>
                    <lightning-button-icon
                        icon-name="utility:close"
                        size="small"
                        variant="border-filled"
                        class="slds-button slds-button_icon slds-button_icon-inverse"
                        alternative-text="next"
                        onclick={closeModel}
                    ></lightning-button-icon>
                </div>
            </div>
        </div>
force-app/main/default/lwc/commonToast/commonToast.js
@@ -27,18 +27,24 @@
    }
 
    get getIconName() {
        if(this.icon)
        {
        if (this.icon) {
            return this.icon;
        }
        return 'utility:' + this.type.toLowerCase();
    }
 
    get innerClass() {
        return 'slds-icon_container slds-icon-utility-' + this.type.toLowerCase() + ' slds-m-right_small slds-no-flex slds-align-top';
        return (
            'slds-icon_container slds-icon-utility-' +
            this.type.toLowerCase() +
            ' slds-m-right_small slds-no-flex slds-align-top'
        );
    }
 
    get outerClass() {
        return 'slds-notify slds-notify_toast slds-theme_' + this.type.toLowerCase();
        return (
            'slds-notify slds-notify_toast slds-theme_' +
            this.type.toLowerCase()
        );
    }
}
force-app/main/default/lwc/customLightningDatatable/customLightningDatatable.js
@@ -7,5 +7,5 @@
            template: boxorpieceType,
            typeAttributes: ['customValueA']
        }
    }
    };
}
force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.html
@@ -1,5 +1,15 @@
<template>
    <lightning-input step="0" type="number" name="count" label="出货数量"
    variant="label-hidden" onchange={outboundCountBlur} data-field="shipmentNumber" value={count}
    min="0" disabled={isDisable} style="min-width: 150px;"></lightning-input>
    <lightning-input
        step="0"
        type="number"
        name="count"
        label="出货数量"
        variant="label-hidden"
        onchange={outboundCountBlur}
        data-field="shipmentNumber"
        value={count}
        min="0"
        disabled={isDisable}
        style="min-width: 150px"
    ></lightning-input>
</template>
force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.js
@@ -5,7 +5,6 @@
    @api recordId;
    @api count;
    
    connectedCallback(){
        console.log('enter CustomOutboundCountComp');
        console.log('isDisable = ' + this.isDisable);
@@ -14,16 +13,18 @@
    }
    outboundCountBlur(event){
        console.log('outboundCountBlur')
        console.log('outboundCountBlur');
        this.count = event.target.value;
        this.dispatchEvent(new CustomEvent('outboundcount', {
        this.dispatchEvent(
            new CustomEvent('outboundcount', {
            composed: true,
            bubbles: true,
            cancelable: true,
            detail: {
                data: { count: this.count, recordId: this.recordId }
            }
        }));
            })
        );
    }
}
force-app/main/default/lwc/customOutputGood/customOutputGood.html
@@ -1,23 +1,48 @@
<template>
    <template if:true={showTitle}>
        <template if:true={showLink}>
            <p style="height: 10px;"></p>
            <a style="margin-left: 10px;margin-top: 10px;margin-bottom: 10px;" onclick={clickLink}><lightning-formatted-text value={outputValue}></lightning-formatted-text></a>
            <p style="height: 10px;"></p>
            <p style="height: 10px"></p>
            <a
                style="margin-left: 10px; margin-top: 10px; margin-bottom: 10px"
                onclick={clickLink}
                ><lightning-formatted-text
                    value={outputValue}
                ></lightning-formatted-text
            ></a>
            <p style="height: 10px"></p>
        </template>
        <template if:false={showLink}>
            <div style="margin-left: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;color:#696969;">
                <lightning-formatted-text value={outputValue}></lightning-formatted-text>
            <div
                style="
                    margin-left: 10px;
                    margin-top: 10px;
                    margin-bottom: 10px;
                    font-size: 16px;
                    color: #696969;
                "
            >
                <lightning-formatted-text
                    value={outputValue}
                ></lightning-formatted-text>
            </div>
        </template>
    </template>
    <template if:false={showTitle}>
        <div style="text-align: right;">
        <div style="text-align: right">
            <template if:true={showLink}>
                <a style="margin-left: 10px;margin-right: 10px;" onclick={clickLink}><lightning-formatted-number value={outputValue}></lightning-formatted-number></a>
                <a
                    style="margin-left: 10px; margin-right: 10px"
                    onclick={clickLink}
                    ><lightning-formatted-number
                        value={outputValue}
                    ></lightning-formatted-number
                ></a>
            </template>
            <template if:false={showLink}>
                <lightning-formatted-number style="margin-left: 10px;margin-right: 10px;" value={outputValue}></lightning-formatted-number>
                <lightning-formatted-number
                    style="margin-left: 10px; margin-right: 10px"
                    value={outputValue}
                ></lightning-formatted-number>
            </template>
        </div>
    </template>
force-app/main/default/lwc/customOutputGood/customOutputGood.js
@@ -15,13 +15,20 @@
    get showLink(){
        if(this.outputType == 'Title'){
            if(this.outputValue == '订单明细汇总' || this.outputValue == '待操作入库订单汇总'){
            if (
                this.outputValue == '订单明细汇总' ||
                this.outputValue == '待操作入库订单汇总'
            ) {
                return false;
            }else{
                return true
                return true;
            }
        }else{
            if(this.outputValue == 0 || this.outputValue == '0' || this.outputValue == ''){
            if (
                this.outputValue == 0 ||
                this.outputValue == '0' ||
                this.outputValue == ''
            ) {
                return false;
            }else{
                return true;
@@ -30,13 +37,19 @@
    }
    clickLink(event){
        this.dispatchEvent(new CustomEvent('clicklink', {
        this.dispatchEvent(
            new CustomEvent('clicklink', {
            composed: true,
            bubbles: true,
            cancelable: true,
            detail: {
                data: { value: this.outputValue, type: this.outputType, recordId:this.recordId}
                    data: {
                        value: this.outputValue,
                        type: this.outputType,
                        recordId: this.recordId
            }
        }));
                }
            })
        );
    }
}
force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.html
@@ -4,7 +4,8 @@
    label="shipmentAmount"
    variant="label-hidden"
    value={shipmentAmount}
    read-only style="margin-left: 10px;">
        read-only
        style="margin-left: 10px"
    >
    </lightning-input>
</template>
force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.js
@@ -4,6 +4,9 @@
    @api shipmentAmount;
    connectedCallback(){
        console.log('进入 CustomShipmentAmountComp shipmentAmount = ' + this.shipmentAmount);
        console.log(
            '进入 CustomShipmentAmountComp shipmentAmount = ' +
                this.shipmentAmount
        );
    }
}
force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html
@@ -1,6 +1,17 @@
<template>
    <c-common-toast></c-common-toast>
    <lightning-input style="border:1px solid red;border-radius:5px;" step="any" type="number" name="shipmentNumber" label="出货数量"
        variant="label-hidden" onchange={dataChange} data-field="shipmentNumber" value={shipmentNumber}
        onblur={shipmentNumberBlur} min="0" class="inputFont"></lightning-input>
    <lightning-input
        style="border: 1px solid red; border-radius: 5px"
        step="any"
        type="number"
        name="shipmentNumber"
        label="出货数量"
        variant="label-hidden"
        onchange={dataChange}
        data-field="shipmentNumber"
        value={shipmentNumber}
        onblur={shipmentNumberBlur}
        min="0"
        class="inputFont"
    ></lightning-input>
</template>
force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.js
@@ -11,8 +11,8 @@
    }
    shipmentNumberBlur(event) {
        debugger
        console.log('shipmentNumberBlur')
        debugger;
        console.log('shipmentNumberBlur');
        this.shipmentNumber = event.target.value;
        if (this.isConinvoice) {
            if (this.hasDecimals(this.shipmentNumber)) {
@@ -20,7 +20,11 @@
                this.shipmentNumber = 0;
            }else{
                if(this.esdInvoiceProNotCount < this.shipmentNumber){
                    this.showMyToast('错误', '发票数量不能超过还没发票数量!', 'Error');
                    this.showMyToast(
                        '错误',
                        '发票数量不能超过还没发票数量!',
                        'Error'
                    );
                    this.shipmentNumber = 0;
                }
            }
@@ -28,18 +32,23 @@
            //向下取整
            if (this.hasDecimals(this.shipmentNumber)) {
                this.showMyToast('错误', '请输入整数', 'Error');
                this.shipmentNumber = Math.floor(this.shipmentNumber)
                this.shipmentNumber = Math.floor(this.shipmentNumber);
            }
        }
        event.target.value = this.shipmentNumber;
        this.dispatchEvent(new CustomEvent('shipmentnumber', {
        this.dispatchEvent(
            new CustomEvent('shipmentnumber', {
            composed: true,
            bubbles: true,
            cancelable: true,
            detail: {
                data: { shipmentnumber: this.shipmentNumber, recordId: this.recordId }
                    data: {
                        shipmentnumber: this.shipmentNumber,
                        recordId: this.recordId
            }
        }));
                }
            })
        );
    }
    hasDecimals(num) {
@@ -61,10 +70,17 @@
            iconName = 'utility:error';
        }
        if (message != '') {
            content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
            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);
        this.template
            .querySelector('c-common-toast')
            .showToast(variant, content, iconName, 10000);
    }
}
force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.html
@@ -1,5 +1,16 @@
<template>
    <lightning-input style="border:1px solid red;border-radius:5px" step="any" type="number" name="shipmentUnitPrice"
        label="deliveryOrderNo" variant="label-hidden" data-field="shipmentUnitPrice" value={shippingUnitPrice}
        onblur={shipmentUnitPriceBlur} min="0" class="inputFont" onchange={limitDecimals}></lightning-input>
    <lightning-input
        style="border: 1px solid red; border-radius: 5px"
        step="any"
        type="number"
        name="shipmentUnitPrice"
        label="deliveryOrderNo"
        variant="label-hidden"
        data-field="shipmentUnitPrice"
        value={shippingUnitPrice}
        onblur={shipmentUnitPriceBlur}
        min="0"
        class="inputFont"
        onchange={limitDecimals}
    ></lightning-input>
</template>
force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js
@@ -11,24 +11,31 @@
    limitDecimals(event) {
        const value = parseFloat(event.target.value); // 将输入值转换为数字类型
        const roundedValue = Math.round(value * 100) / 100; // 将数字四舍五入到两位小数
        if (isNaN(value) || isNaN(roundedValue)) { // 如果数字无效,则清空输入框
        if (isNaN(value) || isNaN(roundedValue)) {
            // 如果数字无效,则清空输入框
            event.target.value = '';
        } else if (roundedValue !== value) { // 如果输入框的值超出了两位小数,则修改为两位小数
        } else if (roundedValue !== value) {
            // 如果输入框的值超出了两位小数,则修改为两位小数
            event.target.value = roundedValue.toFixed(2);
        }
    }
    shipmentUnitPriceBlur(event){
        console.log('shipmentUnitPriceBlur')
        console.log('shipmentUnitPriceBlur');
        this.shippingUnitPrice = event.target.value;
        this.dispatchEvent(new CustomEvent('shipmentunitprice', {
        this.dispatchEvent(
            new CustomEvent('shipmentunitprice', {
            composed: true,
            bubbles: true,
            cancelable: true,
            detail: {
                data: { shipmentunitprice: this.shippingUnitPrice, recordId: this.recordId }
                    data: {
                        shipmentunitprice: this.shippingUnitPrice,
                        recordId: this.recordId
            }
        }));
                }
            })
        );
    }
}
force-app/main/default/lwc/customUnitComp/customUnitComp.js
@@ -15,13 +15,15 @@
    handleDataChange(event){
        console.log('unitValue = ' + event.target.value);
        this.unitValue = event.target.value;
        this.dispatchEvent(new CustomEvent('unitchange', {
        this.dispatchEvent(
            new CustomEvent('unitchange', {
            composed: true,
            bubbles: true,
            cancelable: true,
            detail: {
                data: { unitValue: this.unitValue, recordId: this.recordId }
            }
        }));
            })
        );
    }
}
force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.html
@@ -1,8 +1,13 @@
<template>
    <template if:true={isShowButton}>
        <lightning-button label="查看周报活动" title="周报" onclick={toWeeklyReport} class="slds-m-left_x-small"></lightning-button>
        <lightning-button
            label="查看周报活动"
            title="周报"
            onclick={toWeeklyReport}
            class="slds-m-left_x-small"
        ></lightning-button>
    </template>
    <template if:false={isShowButton}>
        <p style="text-align: center;">...</p>
        <p style="text-align: center">...</p>
    </template>
</template>
force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.js
@@ -1,11 +1,13 @@
import { LightningElement, api, track } from 'lwc';
import { NavigationMixin } from "lightning/navigation";
import { NavigationMixin } from 'lightning/navigation';
import View_Weekly_Report from '@salesforce/label/c.View_Weekly_Report';
const customLabel = {
    View_Weekly_Report
}
export default class CustomWeeklyReportComp extends NavigationMixin(LightningElement) {
};
export default class CustomWeeklyReportComp extends NavigationMixin(
    LightningElement
) {
    @track label = customLabel;
    @api recordId;
@@ -14,20 +16,28 @@
    connectedCallback() {
        console.log('CustomWeeklyReportComp recordId = ' + this.recordId);
        console.log('CustomWeeklyReportComp hospitalName = ' + this.hospitalName);
        console.log(
            'CustomWeeklyReportComp hospitalName = ' + this.hospitalName
        );
    }
    toWeeklyReport() {
        console.log('去报表');
        let reportFilters = '[{"operator":"equals","value":"' + this.hospitalName + '","column":"Agency_Report__c.Hospital__c"}]';
        let reportFilters =
            '[{"operator":"equals","value":"' +
            this.hospitalName +
            '","column":"Agency_Report__c.Hospital__c"}]';
        let reportUrl = this.label.View_Weekly_Report;
        console.log('reportUrl = ' + reportUrl);
        let url = "/report/" + reportUrl + "?reportFilters=" + encodeURIComponent(reportFilters);
        let url =
            '/report/' +
            reportUrl +
            '?reportFilters=' +
            encodeURIComponent(reportFilters);
        this[NavigationMixin.Navigate]({
            type: "standard__webPage",
            type: 'standard__webPage',
            attributes: {
                url: url,
            },
                url: url
            }
        });
    }
}
force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.html
@@ -2,7 +2,10 @@
    <template if:true={showSpinner}>
        <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
        <div class="slds-spinner_container">
            <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
            <div
                role="status"
                class="slds-spinner slds-spinner_medium slds-spinner_brand"
            >
                <span class="slds-assistive-text">Loading</span>
                <div class="slds-spinner__dot-a"></div>
                <div class="slds-spinner__dot-b"></div>
@@ -11,8 +14,14 @@
    </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;">
        <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">
@@ -21,91 +30,175 @@
                    </lightning-layout-item>
                </lightning-layout>
            </div>
            <div style="padding:10px;">
                <lightning-accordion allow-multiple-sections-open active-section-name={activeSections}>
                    <lightning-record-view-form record-id={accountId} object-api-name="Account">
                        <lightning-accordion-section label="经销商详细信息" name="A">
            <div style="padding: 10px">
                <lightning-accordion
                    allow-multiple-sections-open
                    active-section-name={activeSections}
                >
                    <lightning-record-view-form
                        record-id={accountId}
                        object-api-name="Account"
                    >
                        <lightning-accordion-section
                            label="经销商详细信息"
                            name="A"
                        >
                            <lightning-layout multiple-rows="true">
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Management_Code__c"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Management_Code__c"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Name"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Name"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Ban_On_Use_Date__c"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Ban_On_Use_Date__c"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Ban_On_Use_Reason__c"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Ban_On_Use_Reason__c"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Dealer_discount__c"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Dealer_discount__c"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Sales_Shop_Class__c"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Sales_Shop_Class__c"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Deposit_Receipt_Finished__c"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Deposit_Receipt_Finished__c"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Deposit_Receipt_Completion_Day__c"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Deposit_Receipt_Completion_Day__c"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                            </lightning-layout>
                        </lightning-accordion-section>
                        <lightning-accordion-section label="营业许可证书状况" name="B">
                        <lightning-accordion-section
                            label="营业许可证书状况"
                            name="B"
                        >
                            <lightning-layout multiple-rows="true">
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Business_Authorization_No__c"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Business_Authorization_No__c"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Business_Paper_Expiration_Date__c"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Business_Paper_Expiration_Date__c"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Tax_Practice_No__c"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Tax_Practice_No__c"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Tax_Practice_Expiration_Date__c"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Tax_Practice_Expiration_Date__c"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Medical_Equipment_Num__c"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Medical_Equipment_Num__c"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Medical_Equipment_Expiration_Date__c"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Medical_Equipment_Expiration_Date__c"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                            </lightning-layout>
                        </lightning-accordion-section>
                        <lightning-accordion-section label="地址信息" name="C">
                            <lightning-layout multiple-rows="true">
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Postal_Code__c"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Postal_Code__c"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Phone"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Phone"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Address_Together__c"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Address_Together__c"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-output-field field-name="Fax"></lightning-output-field>
                                    <lightning-output-field
                                        field-name="Fax"
                                    ></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item
                                    size="1"
                                ></lightning-layout-item>
                            </lightning-layout>
                        </lightning-accordion-section>
                    </lightning-record-view-form>
force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.js
@@ -17,7 +17,7 @@
    init() {
        this.showSpinner = true;
        initAgency()
            .then(result => {
            .then((result) => {
                this.showPage = true;
                this.isNoteStay = result.isNoteStay;
                if (result.result == 'Success') {
@@ -26,15 +26,23 @@
                    this.showSpinner = false;
                } else {
                    this.showSpinner = false;
                    console.log("Error:" + result.errorMsg);
                    this.showMyToast('初始化页面失败', result.errorMsg, 'error');
                    console.log('Error:' + result.errorMsg);
                    this.showMyToast(
                        '初始化页面失败',
                        result.errorMsg,
                        'error'
                    );
                }
            })
            .catch(error => {
            .catch((error) => {
                this.showSpinner = false;
                console.log("Error:" + error);
                this.showMyToast('初始化页面失败', JSON.stringify(error), 'error');
            })
                console.log('Error:' + error);
                this.showMyToast(
                    '初始化页面失败',
                    JSON.stringify(error),
                    'error'
                );
            });
    }
    showMyToast(title, message, variant) {
@@ -47,12 +55,18 @@
           iconName = 'utility:error';
        }
        if(message != ''){
           content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
            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);
        this.template
            .querySelector('c-common-toast')
            .showToast(variant, content, iconName, 10000);
        // var mode;
        // if(this.isNoteStay){
        //     mode ='sticky';
force-app/main/default/lwc/lexAgencyOppCusCell/lexAgencyOppCusCell.html
@@ -1,12 +1,23 @@
<template>
    <template if:true={isShowInputField}>
        <lightning-record-edit-form object-api-name="Agency_Opportunity__c">
            <lightning-input-field field-name={fieldName} variant="label-hidden" value={inputValue} onchange={inputChange}></lightning-input-field>
            <lightning-input-field
                field-name={fieldName}
                variant="label-hidden"
                value={inputValue}
                onchange={inputChange}
            ></lightning-input-field>
        </lightning-record-edit-form>
    </template>
    <template if:false={isShowInputField}>
        <lightning-record-view-form record-id={recordId} object-api-name="Agency_Opportunity__c">
            <lightning-output-field variant="label-hidden" field-name={fieldName}></lightning-output-field>
        <lightning-record-view-form
            record-id={recordId}
            object-api-name="Agency_Opportunity__c"
        >
            <lightning-output-field
                variant="label-hidden"
                field-name={fieldName}
            ></lightning-output-field>
        </lightning-record-view-form>
    </template>
</template>
force-app/main/default/lwc/lexAgencyOppCusCell/lexAgencyOppCusCell.js
@@ -17,13 +17,20 @@
    inputChange(event){
        this.inputValue = event.detail.value;
        this.dispatchEvent(new CustomEvent('inputchange', {
        this.dispatchEvent(
            new CustomEvent('inputchange', {
            composed: true,
            bubbles: true,
            cancelable: true,
            detail: {
                data: {recordId:this.recordId,fieldName:this.fieldName,inputValue:this.inputValue,showType:this.showType}
                    data: {
                        recordId: this.recordId,
                        fieldName: this.fieldName,
                        inputValue: this.inputValue,
                        showType: this.showType
            }
        }));
                }
            })
        );
    }
}
force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html
@@ -2,7 +2,10 @@
    <template if:true={showSpinner}>
        <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
        <div class="slds-spinner_container">
            <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
            <div
                role="status"
                class="slds-spinner slds-spinner_medium slds-spinner_brand"
            >
                <span class="slds-assistive-text">Loading</span>
                <div class="slds-spinner__dot-a"></div>
                <div class="slds-spinner__dot-b"></div>
@@ -11,17 +14,44 @@
    </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="padding:10px;">
        <div
            style="
                border: 1px solid #d4d4d4;
                border-top: 3px solid #51606e;
                border-radius: 5px;
            "
        >
            <div style="padding: 10px">
                <!-- 按钮 -->
                <!-- <lightning-button style="margin: 5px;" label="入库" onclick={orderArrive}></lightning-button>
                <lightning-button style="margin: 5px;" label="返品" onclick={orderReturn}></lightning-button> -->
                <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;margin-right: 150px;" label="入库" onclick={orderArrive}>入库</button>
                <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="返品" onclick={orderReturn}>返品</button>
                <p style="height: 10px;"></p>
                <button
                    class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                    style="margin: 5px; margin-right: 150px"
                    label="入库"
                    onclick={orderArrive}
                >
                    入库
                </button>
                <button
                    class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                    style="margin: 5px"
                    label="返品"
                    onclick={orderReturn}
                >
                    返品
                </button>
                <p style="height: 10px"></p>
                <!-- 检索条件 -->
                <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;">
                <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">
@@ -31,30 +61,77 @@
                        </lightning-layout>
                        <!-- <p style="font-size: 16px;"><strong>检索条件</strong></p> -->
                    </div>
                    <div style="padding:10px;">
                    <div style="padding: 10px">
                        <table>
                            <tbody>
                                <tr>
                                    <td style="width: 10px;"></td>
                                    <td style="width: 120px;">
                                        <div style="color:#696969;font-size:16px;text-align: left;">消耗品订单名称</div>
                                    <td style="width: 10px"></td>
                                    <td style="width: 120px">
                                        <div
                                            style="
                                                color: #696969;
                                                font-size: 16px;
                                                text-align: left;
                                            "
                                        >
                                            消耗品订单名称
                                        </div>
                                    </td>
                                    <td>
                                        <lightning-input class="inputFont" type="text" variant="label-hidden" label="消耗品订单名称" value={category1} onchange={category1Change}></lightning-input>
                                        <lightning-input
                                            class="inputFont"
                                            type="text"
                                            variant="label-hidden"
                                            label="消耗品订单名称"
                                            value={category1}
                                            onchange={category1Change}
                                        ></lightning-input>
                                    </td>
                                    <td style="width: 30px;"></td>
                                    <td  style="width: 108px;">
                                        <div style="color:#696969;font-size:16px;text-align: left;">最新发货日期</div>
                                    <td style="width: 30px"></td>
                                    <td style="width: 108px">
                                        <div
                                            style="
                                                color: #696969;
                                                font-size: 16px;
                                                text-align: left;
                                            "
                                        >
                                            最新发货日期
                                        </div>
                                    </td>
                                    <td>
                                        <lightning-input class="inputFont" type="date" variant="label-hidden" label="最新发货日期" value={cate2} onchange={cate2Change}></lightning-input>
                                        <lightning-input
                                            class="inputFont"
                                            type="date"
                                            variant="label-hidden"
                                            label="最新发货日期"
                                            value={cate2}
                                            onchange={cate2Change}
                                        ></lightning-input>
                                    </td>
                                    <td style="width: 30px;"></td>
                                    <td style="width: 30px"></td>
                                    <td>
                                        <!-- <lightning-button style="margin-left: 10px;margin-right: 5px;" label="搜索" onclick={search}></lightning-button>
                                        <lightning-button style="margin-left: 5px;margin-right: 5px;" label="清空" onclick={clear}></lightning-button> -->
                                        <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height:32px;margin-right: 30px;" label="搜索" onclick={search}>搜索</button>
                                        <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="height:32px;" label="清空" onclick={clear}>清空</button>
                                        <button
                                            class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
                                            style="
                                                height: 32px;
                                                margin-right: 30px;
                                            "
                                            label="搜索"
                                            onclick={search}
                                        >
                                            搜索
                                        </button>
                                        <button
                                            class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
                                            style="height: 32px"
                                            label="清空"
                                            onclick={clear}
                                        >
                                            清空
                                        </button>
                                    </td>
                                </tr>
                            </tbody>
@@ -62,8 +139,15 @@
                    </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;">
                <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">
@@ -73,9 +157,16 @@
                        </lightning-layout>
                        <!-- <p style="font-size: 16px;"><strong>订单明细</strong></p> -->
                    </div>
                    <div style="padding:10px;">
                    <div style="padding: 10px">
                        <!-- <lightning-datatable hide-checkbox-column key-field="id" columns={colms}  data={raesList}></lightning-datatable> -->
                        <c-lex-custom-lightning-datatable class="wrapped-header-datatable" hide-checkbox-column key-field="Id" data={raesList} columns={colms} onclicklink={clickLick}></c-lex-custom-lightning-datatable>
                        <c-lex-custom-lightning-datatable
                            class="wrapped-header-datatable"
                            hide-checkbox-column
                            key-field="Id"
                            data={raesList}
                            columns={colms}
                            onclicklink={clickLick}
                        ></c-lex-custom-lightning-datatable>
                    </div>
                </div>
            </div>
@@ -83,24 +174,65 @@
    </template>
    <!-- 订单各种数量信息弹窗 -->
    <template if:true={showPop}>
        <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_small" style="border: 1px solid #D4D4D4;">
        <section
            role="dialog"
            tabindex="-1"
            aria-labelledby="modal-heading-01"
            aria-modal="true"
            aria-describedby="modal-content-id-1"
            class="slds-modal slds-fade-in-open slds-modal_small"
            style="border: 1px solid #d4d4d4"
        >
            <div class="slds-modal__container">
                <header class="slds-modal__header" style="background-color: #F3F3F3;">
                    <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closePop}>
                        <lightning-icon icon-name="utility:close"
                <header
                    class="slds-modal__header"
                    style="background-color: #f3f3f3"
                >
                    <button
                        style=""
                        class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
                        title="Close"
                        onclick={closePop}
                    >
                        <lightning-icon
                            icon-name="utility:close"
                            alternative-text="close"
                            variant="inverse"
                            size="small" ></lightning-icon>
                            size="small"
                        ></lightning-icon>
                        <span class="slds-assistive-text">Close</span>
                    </button>
                    <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">{popTitle}</h2>
                    <h2
                        id="modal-heading-01"
                        class="slds-text-heading_medium slds-hyphenate"
                    >
                        {popTitle}
                    </h2>
                </header>
                <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1" style="border: 1px solid #F3F3F3;">
                    <lightning-datatable class="wrapped-header-datatable" hide-checkbox-column key-field="prodModel" columns={colms2}  data={recordList}></lightning-datatable>
                <div
                    class="slds-modal__content slds-p-around_medium"
                    id="modal-content-id-1"
                    style="border: 1px solid #f3f3f3"
                >
                    <lightning-datatable
                        class="wrapped-header-datatable"
                        hide-checkbox-column
                        key-field="prodModel"
                        columns={colms2}
                        data={recordList}
                    ></lightning-datatable>
                </div>
                <footer class="slds-modal__footer">
                    <!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="关闭" onclick={closePop}></lightning-button> -->
                    <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="margin-left: 10px;" variant="neutral" label="关闭" onclick={closePop}>关闭</button>
                    <button
                        class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
                        style="margin-left: 10px"
                        variant="neutral"
                        label="关闭"
                        onclick={closePop}
                    >
                        关闭
                    </button>
                </footer>
            </div>
        </section>
force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js
@@ -14,10 +14,12 @@
import initMoreThan7 from '@salesforce/apex/LexConsumableGoodsInfo.initMoreThan7';
import initMoreThan7All from '@salesforce/apex/LexConsumableGoodsInfo.initMoreThan7All';
//table css 
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
import { loadStyle } from 'lightning/platformResourceLoader';
import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
export default class LexArriveGoodsMain extends NavigationMixin(LightningElement) {
export default class LexArriveGoodsMain extends NavigationMixin(
    LightningElement
) {
    //页面基础变量
    @track agencyProType;
    @track category1;
@@ -48,62 +50,107 @@
        // {label:'待系统操作入库数量',fieldName:'Delivery_detail_count__c'},
        // {label:'还没发货数量',fieldName:'OrderNumber_notarrive__c'},
        // {label:'发货七天还未到货数',fieldName:'More_than_seven_days__c'},
        {label:'消耗品订单名称',
            type: "customOutputGood",
        {
            label: '消耗品订单名称',
            type: 'customOutputGood',
            typeAttributes: {
                outputValue: { fieldName: "Name" },
                outputValue: { fieldName: 'Name' },
                type: 'Title',
                recordId: { fieldName: "Id" }
                recordId: { fieldName: 'Id' }
            },
            hideDefaultActions: true,initialWidth:200,wrapText:true},
        {label:'SAP合同号',fieldName:'ContractNo__c',hideDefaultActions: true,wrapText:true,initialWidth:180},
        {label:'订单总数',
            type: "customOutputGood",
            hideDefaultActions: true,
            initialWidth: 200,
            wrapText: true
        },
        {
            label: 'SAP合同号',
            fieldName: 'ContractNo__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 180
        },
        {
            label: '订单总数',
            type: 'customOutputGood',
            typeAttributes: {
                outputValue: { fieldName: "Total_num__c" },
                outputValue: { fieldName: 'Total_num__c' },
                type: 'TotalNum',
                recordId: { fieldName: "Id" }
                recordId: { fieldName: 'Id' }
            },
            hideDefaultActions: true, initialWidth: 100,cellAttributes: { alignment: "right" }},
        {label:'已到货数量',
            type: "customOutputGood",
            hideDefaultActions: true,
            initialWidth: 100,
            cellAttributes: { alignment: 'right' }
        },
        {
            label: '已到货数量',
            type: 'customOutputGood',
            typeAttributes: {
                outputValue: { fieldName: "OrderNumber_arrived__c" },
                outputValue: { fieldName: 'OrderNumber_arrived__c' },
                type: 'ArrDet',
                recordId: { fieldName: "Id" }
                recordId: { fieldName: 'Id' }
            },
            hideDefaultActions: true, initialWidth: 110,cellAttributes: { alignment: "right" }},
        {label:'待系统操作入库数量',
            type: "customOutputGood",
            hideDefaultActions: true,
            initialWidth: 110,
            cellAttributes: { alignment: 'right' }
        },
        {
            label: '待系统操作入库数量',
            type: 'customOutputGood',
            typeAttributes: {
                outputValue: { fieldName: "Delivery_detail_count__c" },
                outputValue: { fieldName: 'Delivery_detail_count__c' },
                type: 'DeliveryDet',
                recordId: { fieldName: "Id" }
                recordId: { fieldName: 'Id' }
            },
            hideDefaultActions: true, initialWidth: 180,cellAttributes: { alignment: "right" }},
        {label:'还没发货数量',
            type: "customOutputGood",
            hideDefaultActions: true,
            initialWidth: 180,
            cellAttributes: { alignment: 'right' }
        },
        {
            label: '还没发货数量',
            type: 'customOutputGood',
            typeAttributes: {
                outputValue: { fieldName: "OrderNumber_notarrive__c" },
                outputValue: { fieldName: 'OrderNumber_notarrive__c' },
                type: 'NotArrDet',
                recordId: { fieldName: "Id" }
                recordId: { fieldName: 'Id' }
            },
            hideDefaultActions: true, initialWidth: 120,cellAttributes: { alignment: "right" }},
        {label:'发货七天还未到货数',
            type: "customOutputGood",
            hideDefaultActions: true,
            initialWidth: 120,
            cellAttributes: { alignment: 'right' }
        },
        {
            label: '发货七天还未到货数',
            type: 'customOutputGood',
            typeAttributes: {
                outputValue: { fieldName: "More_than_seven_days__c" },
                outputValue: { fieldName: 'More_than_seven_days__c' },
                type: 'MoreThan7',
                recordId: { fieldName: "Id" }
                recordId: { fieldName: 'Id' }
            },
            hideDefaultActions: true, initialWidth: 180,cellAttributes: { alignment: "right" }},
        {label:'最新发货日期',fieldName:'Shipment_date__c',hideDefaultActions: true, initialWidth: 140},
        {label:'首次发货日期',fieldName:'First_Delivery__c',hideDefaultActions: true, initialWidth: 140}
            hideDefaultActions: true,
            initialWidth: 180,
            cellAttributes: { alignment: 'right' }
        },
        {
            label: '最新发货日期',
            fieldName: 'Shipment_date__c',
            hideDefaultActions: true,
            initialWidth: 140
        },
        {
            label: '首次发货日期',
            fieldName: 'First_Delivery__c',
            hideDefaultActions: true,
            initialWidth: 140
        }
    ];
    @track colms2 = [
        {label:'产品型号',fieldName:'prodModel',hideDefaultActions: true},
        {label:'数量',fieldName:'recordCount',hideDefaultActions: true,initialWidth: 100}
        {
            label: '数量',
            fieldName: 'recordCount',
            hideDefaultActions: true,
            initialWidth: 100
        }
    ];
    //获取参数
@@ -119,19 +166,18 @@
        if (!this.stylesLoaded) {
            Promise.all([loadStyle(this, WrappedHeaderTable)])
                .then(() => {
                    console.log("Custom styles loaded");
                    console.log('Custom styles loaded');
                    this.stylesLoaded = true;
                })
                .catch((error) => {
                    console.error("Error loading custom styles");
                    console.error('Error loading custom styles');
                });
        }
    }
   
    //初始化
    connectedCallback(){
        init()
            .then(result=>{
        init().then((result) => {
                this.isNoteStay = result.isNoteStay;
                if(result.result == 'Success'){
                    this.agencyProType = result.agencyProType;
@@ -144,15 +190,23 @@
                    this.orderNumberNotarrive = result.orderNumberNotarrive;
                    this.moreThanSevenDays = result.moreThanSevenDays;
                    this.raesList = result.raesList;
                    this.raesList.push({Id:'1',Name:'订单明细汇总',Total_num__c:this.totalNum,OrderNumber_arrived__c:this.orderNumberArrived,Delivery_detail_count__c:this.deliveryDetailCount,OrderNumber_notarrive__c:this.orderNumberNotarrive,More_than_seven_days__c:this.moreThanSevenDays});
                this.raesList.push({
                    Id: '1',
                    Name: '订单明细汇总',
                    Total_num__c: this.totalNum,
                    OrderNumber_arrived__c: this.orderNumberArrived,
                    Delivery_detail_count__c: this.deliveryDetailCount,
                    OrderNumber_notarrive__c: this.orderNumberNotarrive,
                    More_than_seven_days__c: this.moreThanSevenDays
                });
                    this.showSpinner = false;
                    this.showPage = true;
                }else{
                    this.showSpinner = false;
                    console.log("Error:"+result.errorMsg);
                console.log('Error:' + result.errorMsg);
                    this.showMyToast('初始化页面失败',result.errorMsg,'error');
                }
            })
        });
    }
    //点击链接
@@ -160,7 +214,9 @@
        var outputValue = event.detail.data.value;
        var outputType = event.detail.data.type;
        var recordId = event.detail.data.recordId;
        console.log("click:"+outputValue+"---"+outputType+"---"+recordId);
        console.log(
            'click:' + outputValue + '---' + outputType + '---' + recordId
        );
        if(outputType == 'Title'){
            const config = {
                type: 'standard__webPage',
@@ -171,8 +227,7 @@
            this[NavigationMixin.Navigate](config);
        }else if(outputType == 'TotalNum'){
            this.popTitle = '所有产品一览';
            initTotalNum({ordId:recordId, type:'all'})
            .then(result=>{
            initTotalNum({ ordId: recordId, type: 'all' }).then((result) => {
                if(result.result == 'Success'){
                    // this.recordList = result.recordList;
                    var dataStr = JSON.stringify(result.recordList);
@@ -180,14 +235,17 @@
                    console.log('data:'+JSON.stringify(this.recordList));
                    this.showPop = true;
                }else{
                    this.showMyToast('加载所有产品一览页面失败',result.errorMsg,'error');
                    this.showMyToast(
                        '加载所有产品一览页面失败',
                        result.errorMsg,
                        'error'
                    );
                }
            })
            });
        }else if(outputType == 'ArrDet'){
            if(recordId == '1'){
                this.popTitle = '所有已到货产品一览';
                initArrDetAll({type:'all'})
                .then(result=>{
                initArrDetAll({ type: 'all' }).then((result) => {
                    if(result.result == 'Success'){
                        // this.recordList = result.recordList;
                        var dataStr = JSON.stringify(result.recordList);
@@ -195,100 +253,124 @@
                        console.log('data:'+JSON.stringify(this.recordList));
                        this.showPop = true;
                    }else{
                        this.showMyToast('加载所有已到货产品一览页面失败',result.errorMsg,'error');
                        this.showMyToast(
                            '加载所有已到货产品一览页面失败',
                            result.errorMsg,
                            'error'
                        );
                    }
                })
                });
            }else{
                this.popTitle = '已到货产品一览';
                initArrDet({orderId:recordId})
                .then(result=>{
                initArrDet({ orderId: recordId }).then((result) => {
                    if(result.result == 'Success'){
                        this.recordList = result.recordList;
                        console.log('data:'+JSON.stringify(this.recordList));
                        this.showPop = true;
                    }else{
                        this.showMyToast('加载已到货产品一览页面失败',result.errorMsg,'error');
                        this.showMyToast(
                            '加载已到货产品一览页面失败',
                            result.errorMsg,
                            'error'
                        );
                    }
                })
                });
            }
        }else if(outputType == 'DeliveryDet'){
            if(recordId == '1'){
                this.popTitle = '所有已发货还没到货产品一览';
                initDeliveryDetAll({type:'all'})
                .then(result=>{
                initDeliveryDetAll({ type: 'all' }).then((result) => {
                    if(result.result == 'Success'){
                        this.recordList = result.recordList;
                        console.log('data:'+JSON.stringify(this.recordList));
                        this.showPop = true;
                    }else{
                        this.showMyToast('加载所有已发货还没到货产品一览页面失败',result.errorMsg,'error');
                        this.showMyToast(
                            '加载所有已发货还没到货产品一览页面失败',
                            result.errorMsg,
                            'error'
                        );
                    }
                })
                });
            }else{
                this.popTitle = '未到货产品一览';
                initDeliveryDet({orderId:recordId})
                .then(result=>{
                initDeliveryDet({ orderId: recordId }).then((result) => {
                    if(result.result == 'Success'){
                        this.recordList = result.recordList;
                        console.log('data:'+JSON.stringify(this.recordList));
                        this.showPop = true;
                    }else{
                        this.showMyToast('加载未到货产品一览页面失败',result.errorMsg,'error');
                        this.showMyToast(
                            '加载未到货产品一览页面失败',
                            result.errorMsg,
                            'error'
                        );
                    }
                })
                });
            }
        }else if(outputType == 'NotArrDet'){
            if(recordId == '1'){
                this.popTitle = '所有还没发货产品一览';
                initNotArrDetAll({type:'all'})
                .then(result=>{
                initNotArrDetAll({ type: 'all' }).then((result) => {
                    if(result.result == 'Success'){
                        this.recordList = result.recordList;
                        console.log('data:'+JSON.stringify(this.recordList));
                        this.showPop = true;
                    }else{
                        this.showMyToast('加载所有还没发货产品一览页面失败',result.errorMsg,'error');
                        this.showMyToast(
                            '加载所有还没发货产品一览页面失败',
                            result.errorMsg,
                            'error'
                        );
                    }
                })
                });
            }else{
                this.popTitle = '还没发货数量';
                initNotArrDet({orderId:recordId})
                .then(result=>{
                initNotArrDet({ orderId: recordId }).then((result) => {
                    if(result.result == 'Success'){
                        this.recordList = result.recordList;
                        console.log('data:'+JSON.stringify(this.recordList));
                        this.showPop = true;
                    }else{
                        this.showMyToast('加载还没发货数量页面失败',result.errorMsg,'error');
                        this.showMyToast(
                            '加载还没发货数量页面失败',
                            result.errorMsg,
                            'error'
                        );
                    }
                })
                });
            }
        }else if(outputType == 'MoreThan7'){
            if(recordId == '1'){
                this.popTitle = '所有发货七天还未到货数';
                initMoreThan7All({type:'all'})
                .then(result=>{
                initMoreThan7All({ type: 'all' }).then((result) => {
                    if(result.result == 'Success'){
                        this.recordList = result.recordList;
                        console.log('data:'+JSON.stringify(this.recordList));
                        this.showPop = true;
                    }else{
                        this.showMyToast('加载所有发货七天还未到货数页面失败',result.errorMsg,'error');
                        this.showMyToast(
                            '加载所有发货七天还未到货数页面失败',
                            result.errorMsg,
                            'error'
                        );
                    }
                })
                });
            }else{
                this.popTitle = '发货七天还未到货数';
                initMoreThan7({orderId:recordId})
                .then(result=>{
                initMoreThan7({ orderId: recordId }).then((result) => {
                    if(result.result == 'Success'){
                        this.recordList = result.recordList;
                        console.log('data:'+JSON.stringify(this.recordList));
                        this.showPop = true;
                    }else{
                        this.showMyToast('加载发货七天还未到货数页面失败',result.errorMsg,'error');
                        this.showMyToast(
                            '加载发货七天还未到货数页面失败',
                            result.errorMsg,
                            'error'
                        );
                    }
                })
                });
            }
        }
    }
@@ -316,22 +398,34 @@
            cate2Str:this.cate2,
            accountidStr:this.accountId,
            userWorkLocationStr:this.userWorkLocation,
            agencyProTypeStr:this.agencyProType})
        .then(result=>{
            agencyProTypeStr: this.agencyProType
        }).then((result) => {
            this.showSpinner = false;
            if(result.result == 'Success'){
                this.raesList = result.raesList;
                this.raesList.push({Id:'1',Name:'订单明细汇总',Total_num__c:this.totalNum,OrderNumber_arrived__c:this.orderNumberArrived,Delivery_detail_count__c:this.deliveryDetailCount,OrderNumber_notarrive__c:this.orderNumberNotarrive,More_than_seven_days__c:this.moreThanSevenDays});
                this.raesList.push({
                    Id: '1',
                    Name: '订单明细汇总',
                    Total_num__c: this.totalNum,
                    OrderNumber_arrived__c: this.orderNumberArrived,
                    Delivery_detail_count__c: this.deliveryDetailCount,
                    OrderNumber_notarrive__c: this.orderNumberNotarrive,
                    More_than_seven_days__c: this.moreThanSevenDays
                });
                if(this.raesList.length > 1){
                    var count = this.raesList.length - 1;
                    this.showMyToast('搜索成功','共搜索到'+count+'条数据','success');
                    this.showMyToast(
                        '搜索成功',
                        '共搜索到' + count + '条数据',
                        'success'
                    );
                }else{
                    this.showMyToast('未搜索到数据','','error');
                }
            }else{
                this.showMyToast('搜索失败',result.errorMsg,'error');
            }
        })
        });
    }
    
    //清空搜索框
@@ -344,22 +438,34 @@
            cate2Str:this.cate2,
            accountidStr:this.accountId,
            userWorkLocationStr:this.userWorkLocation,
            agencyProTypeStr:this.agencyProType})
        .then(result=>{
            agencyProTypeStr: this.agencyProType
        }).then((result) => {
            this.showSpinner = false;
            if(result.result == 'Success'){
                this.raesList = result.raesList;
                this.raesList.push({Id:'1',Name:'订单明细汇总',Total_num__c:this.totalNum,OrderNumber_arrived__c:this.orderNumberArrived,Delivery_detail_count__c:this.deliveryDetailCount,OrderNumber_notarrive__c:this.orderNumberNotarrive,More_than_seven_days__c:this.moreThanSevenDays});
                this.raesList.push({
                    Id: '1',
                    Name: '订单明细汇总',
                    Total_num__c: this.totalNum,
                    OrderNumber_arrived__c: this.orderNumberArrived,
                    Delivery_detail_count__c: this.deliveryDetailCount,
                    OrderNumber_notarrive__c: this.orderNumberNotarrive,
                    More_than_seven_days__c: this.moreThanSevenDays
                });
                if(this.raesList.length > 1){
                    var count = this.raesList.length - 1;
                    this.showMyToast('搜索成功','共搜索到'+count+'条数据','success');
                    this.showMyToast(
                        '搜索成功',
                        '共搜索到' + count + '条数据',
                        'success'
                    );
                }else{
                    this.showMyToast('未搜索到数据','','error');
                }
            }else{
                this.showMyToast('搜索失败',result.errorMsg,'error');
            }
        })
        });
    }
    //入库
@@ -394,12 +500,18 @@
           iconName = 'utility:error';
        }
        if(message != ''){
           content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
            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);
        this.template
            .querySelector('c-common-toast')
            .showToast(variant, content, iconName, 10000);
        // var mode;
        // if(this.isNoteStay){
        //     mode ='sticky';
force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.html
@@ -2,7 +2,10 @@
    <template if:true={showSpinner}>
        <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
        <div class="slds-spinner_container">
            <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
            <div
                role="status"
                class="slds-spinner slds-spinner_medium slds-spinner_brand"
            >
                <span class="slds-assistive-text">Loading</span>
                <div class="slds-spinner__dot-a"></div>
                <div class="slds-spinner__dot-b"></div>
@@ -11,8 +14,14 @@
    </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;">
        <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">
@@ -22,14 +31,29 @@
                </lightning-layout>
                <!-- <p style="font-size: 16px;"><strong>到货</strong></p> -->
            </div>
            <div style="padding:10px;">
            <div style="padding: 10px">
                <!-- 按钮 -->
                <!-- <lightning-button style="margin: 5px;" label="出库" onclick={proSale} disabled={arrivetoorder}></lightning-button> -->
                <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="出库" onclick={proSale} disabled={arrivetoorder}>出库</button>
                <p style="height: 10px;"></p>
                <button
                    class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                    style="margin: 5px"
                    label="出库"
                    onclick={proSale}
                    disabled={arrivetoorder}
                >
                    出库
                </button>
                <p style="height: 10px"></p>
                <!-- 到货订单信息 -->
                <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;">
                <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">
@@ -39,34 +63,77 @@
                        </lightning-layout>
                        <!-- <p style="font-size: 16px;"><strong>到货订单信息</strong></p> -->
                    </div>
                    <div style="padding:10px;">
                    <div style="padding: 10px">
                        <table>
                            <tbody>
                                <tr>
                                    <td  style="width:10px;"></td>
                                    <td style="width:140px;">
                                        <div style="color:#696969;font-size:16px;">到货订单名称</div>
                                    <td style="width: 10px"></td>
                                    <td style="width: 140px">
                                        <div
                                            style="
                                                color: #696969;
                                                font-size: 16px;
                                            "
                                        >
                                            到货订单名称
                                        </div>
                                    </td>
                                    <td style="width:200px;">
                                        <lightning-formatted-text style="font-size: 16px;" value={coc.Name}></lightning-formatted-text>
                                    <td style="width: 200px">
                                        <lightning-formatted-text
                                            style="font-size: 16px"
                                            value={coc.Name}
                                        ></lightning-formatted-text>
                                    </td>
                                    <td  style="width:30px;"></td>
                                    <td style="width:140px;">
                                        <div style="color:#696969;font-size:16px;">本次入库产品金额</div>
                                    <td style="width: 30px"></td>
                                    <td style="width: 140px">
                                        <div
                                            style="
                                                color: #696969;
                                                font-size: 16px;
                                            "
                                        >
                                            本次入库产品金额
                                        </div>
                                    </td>
                                    <td style="width:100px;">
                                        <lightning-formatted-number style="font-size: 16px;" value={coc.Arrive_total_amount__c} minimum-fraction-digits="2"></lightning-formatted-number>
                                    <td style="width: 100px">
                                        <lightning-formatted-number
                                            style="font-size: 16px"
                                            value={coc.Arrive_total_amount__c}
                                            minimum-fraction-digits="2"
                                        ></lightning-formatted-number>
                                    </td>
                                    <td></td>
                                </tr>
                                <tr style="height: 20px;"></tr>
                                <tr style="height: 20px"></tr>
                                <tr>
                                    <td  style="width:10px;"></td>
                                    <td style="width:120px;">
                                        <div style="color:#696969;font-size:16px;">消耗品订单名称<lightning-helptext style="--lwc-spacingXxSmall:0px;" content={label.helpText}></lightning-helptext></div>
                                    <td style="width: 10px"></td>
                                    <td style="width: 120px">
                                        <div
                                            style="
                                                color: #696969;
                                                font-size: 16px;
                                            "
                                        >
                                            消耗品订单名称<lightning-helptext
                                                style="
                                                    --lwc-spacingXxSmall: 0px;
                                                "
                                                content={label.helpText}
                                            ></lightning-helptext>
                                        </div>
                                    </td>
                                    <td style="width:200px;">
                                        <a style="text-decoration: underline;color:black;" onclick={clickOrder}><lightning-formatted-text style="font-size: 16px;" value={coc.arriveOrder}></lightning-formatted-text></a>
                                    <td style="width: 200px">
                                        <a
                                            style="
                                                text-decoration: underline;
                                                color: black;
                                            "
                                            onclick={clickOrder}
                                            ><lightning-formatted-text
                                                style="font-size: 16px"
                                                value={coc.arriveOrder}
                                            ></lightning-formatted-text
                                        ></a>
                                        <!-- <lightning-formatted-text value={coc.Arrive_Order__r.Name}></lightning-formatted-text> -->
                                    </td>
                                    <td></td>
@@ -76,8 +143,15 @@
                    </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;">
                <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">
@@ -87,8 +161,15 @@
                        </lightning-layout>
                        <!-- <p style="font-size: 16px;"><strong>在库商品库存一览</strong></p> -->
                    </div>
                    <div style="padding:10px;">
                        <lightning-datatable class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all;" hide-checkbox-column key-field="recordId" columns={colms} data={consumableorderdetailsRecords}></lightning-datatable>
                    <div style="padding: 10px">
                        <lightning-datatable
                            class="wrapped-header-datatable"
                            style="word-wrap: break-word; word-break: break-all"
                            hide-checkbox-column
                            key-field="recordId"
                            columns={colms}
                            data={consumableorderdetailsRecords}
                        ></lightning-datatable>
                    </div>
                </div>
            </div>
force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js
@@ -6,11 +6,12 @@
import proSale from '@salesforce/apex/LexArriveGsDetailsController.proSale';
import helpText from '@salesforce/label/c.LexArrivegsDetailsPageHelpText';
//table css 
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
import { loadStyle } from 'lightning/platformResourceLoader';
import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
export default class LexArriveGsDetails extends NavigationMixin(LightningElement) {
export default class LexArriveGsDetails extends NavigationMixin(
    LightningElement
) {
    @track eSetId;
    @track showSpinner = true;
    @track showPage = false;
@@ -24,14 +25,65 @@
    //是否一直显示提示
    @track isNoteStay = true;
    @track colms = [
        {label:'消耗品名称' , fieldName:'prodName', hideDefaultActions: true,wrapText:true},
        {label:'规格' , fieldName:'packing_list', hideDefaultActions: true,wrapText:true,initialWidth:50,cellAttributes: { alignment: "right" }},
        {label:'CFDA状态' , fieldName:'statusCFDA', hideDefaultActions: true,wrapText:true,initialWidth:100},
        {label:'注册证编码号' , fieldName:'approbation_No', hideDefaultActions: true,wrapText:true,initialWidth:125},
        {label:'注册证效期' , fieldName:'expiration_DateStr', hideDefaultActions: true,wrapText:true,initialWidth:115},
        {label:'使用期限' , fieldName:'Sterilization_limitStr', hideDefaultActions: true,wrapText:true,initialWidth:115},
        {label:'BarCode' , fieldName:'barCode', hideDefaultActions: true,initialWidth:250,wrapText:true},
        {label:'采购单价' ,type:'number',fieldName:'intraTradeList', hideDefaultActions: true,wrapText:true,initialWidth:120,typeAttributes:{minimumFractionDigits: 2},cellAttributes: { alignment: "right" }}
        {
            label: '消耗品名称',
            fieldName: 'prodName',
            hideDefaultActions: true,
            wrapText: true
        },
        {
            label: '规格',
            fieldName: 'packing_list',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 50,
            cellAttributes: { alignment: 'right' }
        },
        {
            label: 'CFDA状态',
            fieldName: 'statusCFDA',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 100
        },
        {
            label: '注册证编码号',
            fieldName: 'approbation_No',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 125
        },
        {
            label: '注册证效期',
            fieldName: 'expiration_DateStr',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 115
        },
        {
            label: '使用期限',
            fieldName: 'Sterilization_limitStr',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 115
        },
        {
            label: 'BarCode',
            fieldName: 'barCode',
            hideDefaultActions: true,
            initialWidth: 250,
            wrapText: true
        },
        {
            label: '采购单价',
            type: 'number',
            fieldName: 'intraTradeList',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 120,
            typeAttributes: { minimumFractionDigits: 2 },
            cellAttributes: { alignment: 'right' }
        }
    ];
    label = {helpText};
@@ -48,11 +100,11 @@
        if (!this.stylesLoaded) {
            Promise.all([loadStyle(this, WrappedHeaderTable)])
                .then(() => {
                    console.log("Custom styles loaded");
                    console.log('Custom styles loaded');
                    this.stylesLoaded = true;
                })
                .catch((error) => {
                    console.error("Error loading custom styles");
                    console.error('Error loading custom styles');
                });
        }
    }
@@ -60,48 +112,83 @@
    //初始化
    connectedCallback(){
        init({eSetIdStr : this.eSetId})
        .then(result=>{
            .then((result) => {
            this.showPage = true;
            this.isNoteStay = result.isNoteStay;
            if(result.result == 'Success'){
                this.coc = result.coc;
                if(this.coc.Arrive_Order__c != null && this.coc.Arrive_Order__c != ''){
                    if (
                        this.coc.Arrive_Order__c != null &&
                        this.coc.Arrive_Order__c != ''
                    ) {
                    this.coc['arriveOrder'] = this.coc.Arrive_Order__r.Name;
                }
                console.log('this.coc:'+JSON.stringify(this.coc));
                this.accountid = result.accountid;
                this.orderallcount = result.orderallcount;
                this.arrivetoorder = result.arrivetoorder;
                this.consumableorderdetailsCount = result.consumableorderdetailsCount;
                this.consumableorderdetailsRecords = result.consumableorderdetailsRecords;
                    this.consumableorderdetailsCount =
                        result.consumableorderdetailsCount;
                    this.consumableorderdetailsRecords =
                        result.consumableorderdetailsRecords;
                for(var i in this.consumableorderdetailsRecords){
                    if(this.consumableorderdetailsRecords[i].esd != null){
                        this.consumableorderdetailsRecords[i]['recordId'] = this.consumableorderdetailsRecords[i].esd.Id;
                        if(this.consumableorderdetailsRecords[i].esd.Consumable_Product__c != null && this.consumableorderdetailsRecords[i].esd.Consumable_Product__c != ''){
                            this.consumableorderdetailsRecords[i]['prodName'] = this.consumableorderdetailsRecords[i].esd.Consumable_Product__r.Name__c;
                            this.consumableorderdetailsRecords[i]['recordId'] =
                                this.consumableorderdetailsRecords[i].esd.Id;
                            if (
                                this.consumableorderdetailsRecords[i].esd
                                    .Consumable_Product__c != null &&
                                this.consumableorderdetailsRecords[i].esd
                                    .Consumable_Product__c != ''
                            ) {
                                this.consumableorderdetailsRecords[i][
                                    'prodName'
                                ] =
                                    this.consumableorderdetailsRecords[
                                        i
                                    ].esd.Consumable_Product__r.Name__c;
                        }
                        // this.consumableorderdetailsRecords[i]['prodName'] = this.consumableorderdetailsRecords[i].prodName;
                        this.consumableorderdetailsRecords[i]['barCode'] = this.consumableorderdetailsRecords[i].esd.Bar_Code__c;
                        this.consumableorderdetailsRecords[i]['intraTradeList'] = this.consumableorderdetailsRecords[i].esd.Intra_Trade_List_RMB__c;
                        console.log("Intra_Trade_List_RMB__c:"+this.consumableorderdetailsRecords[i].esd.Intra_Trade_List_RMB__c);
                            this.consumableorderdetailsRecords[i]['barCode'] =
                                this.consumableorderdetailsRecords[
                                    i
                                ].esd.Bar_Code__c;
                            this.consumableorderdetailsRecords[i][
                                'intraTradeList'
                            ] =
                                this.consumableorderdetailsRecords[
                                    i
                                ].esd.Intra_Trade_List_RMB__c;
                            console.log(
                                'Intra_Trade_List_RMB__c:' +
                                    this.consumableorderdetailsRecords[i].esd
                                        .Intra_Trade_List_RMB__c
                            );
                    }
                    if(this.consumableorderdetailsRecords[i].Prod != null){
                        this.consumableorderdetailsRecords[i]['statusCFDA'] = this.consumableorderdetailsRecords[i].Prod.SFDA_Status__c;
                        if (
                            this.consumableorderdetailsRecords[i].Prod != null
                        ) {
                            this.consumableorderdetailsRecords[i][
                                'statusCFDA'
                            ] =
                                this.consumableorderdetailsRecords[
                                    i
                                ].Prod.SFDA_Status__c;
                    }
                }
                this.showSpinner = false;
            }else {
                this.showSpinner = false;
                console.log("error:"+result.errorMsg);
                    console.log('error:' + result.errorMsg);
                this.showMyToast('初始化失败',result.errorMsg,'error');
            }
        })
        .catch(error=>{
            .catch((error) => {
            this.showSpinner = false;
            this.showPage = true;
            console.log("error:"+error);
                console.log('error:' + error);
            this.showMyToast('初始化失败',error,'error');
        })
            });
    }
    proSale(){
@@ -112,7 +199,7 @@
            consumableorderdetailsCountParm : this.consumableorderdetailsCount,
            eSetIdStr : this.eSetId
        })
        .then(result=>{
            .then((result) => {
            if(result.result == 'Success'){
                var url = result.url;
                const config = {
@@ -124,20 +211,23 @@
                this[NavigationMixin.Navigate](config);
            }else {
                this.showSpinner = false;
                console.log("error:"+result.errorMsg);
                    console.log('error:' + result.errorMsg);
                this.showMyToast('出库失败',result.errorMsg,'error');
            }
        })
        .catch(error=>{
            .catch((error) => {
            this.showPage = true;
            this.showSpinner = false;
            console.log("error:"+error);
                console.log('error:' + error);
            this.showMyToast('出库失败',error,'error');
        })
            });
    }
    clickOrder(){
        if(this.coc.Arrive_Order__c != null && this.coc.Arrive_Order__c != ''){
        if (
            this.coc.Arrive_Order__c != null &&
            this.coc.Arrive_Order__c != ''
        ) {
            const config = {
                type: 'standard__webPage',
                attributes: {
@@ -158,12 +248,18 @@
           iconName = 'utility:error';
        }
        if(message != ''){
           content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
            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);
        this.template
            .querySelector('c-common-toast')
            .showToast(variant, content, iconName, 10000);
        // var mode;
        // if(this.isNoteStay){
        //     mode ='sticky';
force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html
@@ -2,7 +2,10 @@
  <template if:true={showSpinner}>
      <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
      <div class="slds-spinner_container">
          <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
            <div
                role="status"
                class="slds-spinner slds-spinner_medium slds-spinner_brand"
            >
              <span class="slds-assistive-text">Loading</span>
              <div class="slds-spinner__dot-a"></div>
              <div class="slds-spinner__dot-b"></div>
@@ -10,9 +13,14 @@
      </div>
  </template>
  <c-common-toast></c-common-toast>
  <div style="border: 1px solid #D4D4D4;border-radius:5px;">
      <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
    <div style="border: 1px solid #d4d4d4; border-radius: 5px">
        <div
            style="
                border-top: 3px solid #51606e;
                border-bottom: 1px solid #d4d4d4;
                padding: 3px;
            "
        >
          <div>
              <!-- <p style="font-size: 18px;"><strong>取消拆盒</strong></p> -->
              <lightning-layout>
@@ -24,15 +32,51 @@
              </lightning-layout>
          </div>
      </div>
      <div style="padding:10px;">
          <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
          <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
        <div style="padding: 10px">
            <div
                style="
                    border: 1px solid #d4d4d4;
                    border-radius: 5px;
                    margin-bottom: 7px;
                "
            >
                <div
                    style="
                        border-top: 3px solid #51606e;
                        border-bottom: 1px solid #d4d4d4;
                        padding: 3px;
                    "
                >
              <!-- <lightning-button variant="brand" class='lexstyle' style="margin-left:10px;" label="取消拆盒确认" title="取消拆盒确认" onclick={saveConfirm}></lightning-button></td> -->
              <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin-left:10px;margin-top:12px;margin-bottom:12px;" label="取消拆盒确认" onclick={saveConfirm}>取消拆盒确认</button>
                    <button
                        class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                        style="
                            margin-left: 10px;
                            margin-top: 12px;
                            margin-bottom: 12px;
                        "
                        label="取消拆盒确认"
                        onclick={saveConfirm}
                    >
                        取消拆盒确认
                    </button>
          </div>
          </div>
          <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:5px;">
              <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
            <div
                style="
                    border: 1px solid #d4d4d4;
                    border-radius: 5px;
                    margin-bottom: 7px;
                    margin-top: 5px;
                "
            >
                <div
                    style="
                        border-top: 3px solid #51606e;
                        border-bottom: 1px solid #d4d4d4;
                        padding: 3px;
                    "
                >
                  <lightning-layout>
                      <lightning-layout-item padding="around-small">
                          <p style="font-size: 16px">
@@ -64,12 +108,25 @@
                          <tr>
                              <td></td>
                              <td align="right" class="searchName">BarCode</td>
                              <td style="width:600px"><lightning-textarea class="inputFont" name="BarCode" label=""
                                      onchange={handleChange}></lightning-textarea></td>
                            <td style="width: 600px">
                                <lightning-textarea
                                    class="inputFont"
                                    name="BarCode"
                                    label=""
                                    onchange={handleChange}
                                ></lightning-textarea>
                            </td>
                              <td align="right"></td>
                              <td></td>
                              <td  style="width: 200px;">
                                  <button style="margin-top:14px;"  class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="获取明细" onclick={getDetails}>获取明细</button>
                            <td style="width: 200px">
                                <button
                                    style="margin-top: 14px"
                                    class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                                    label="获取明细"
                                    onclick={getDetails}
                                >
                                    获取明细
                                </button>
                                  <!-- <lightning-button variant="brand" class='lexstyle' label="获取明细" title="获取明细" onclick={getDetails}
                                     ></lightning-button> -->
                              </td>
@@ -79,8 +136,20 @@
              <!-- </div> -->
          </div>
          <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
              <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
            <div
                style="
                    border: 1px solid #d4d4d4;
                    border-radius: 5px;
                    margin-bottom: 7px;
                "
            >
                <div
                    style="
                        border-top: 3px solid #51606e;
                        border-bottom: 1px solid #d4d4d4;
                        padding: 3px;
                    "
                >
                  <lightning-layout>
                      <lightning-layout-item padding="around-small">
                          <p style="font-size: 18px">
@@ -89,26 +158,46 @@
                      </lightning-layout-item>
                  </lightning-layout>
              </div>
              <div style="padding:10px;">
                <div style="padding: 10px">
                  <!-- <div style="height: 300px;"> -->
                      <!-- <template if:true={showTable}> -->
                          <c-lex-custom-lightning-datatable key-field="prodid" data={data} columns={columns}
                          onrowselection={getSelectedRows} hide-checkbox-column="true"
                          selected-rows={selectedRows} class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all; ">
                    <c-lex-custom-lightning-datatable
                        key-field="prodid"
                        data={data}
                        columns={columns}
                        onrowselection={getSelectedRows}
                        hide-checkbox-column="true"
                        selected-rows={selectedRows}
                        class="wrapped-header-datatable"
                        style="word-wrap: break-word; word-break: break-all"
                    >
                              </c-lex-custom-lightning-datatable>
                      <!-- </template> -->
                  <!-- </div> -->
              </div>
          </div>
          <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:10px">
              <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
            <div
                style="
                    border: 1px solid #d4d4d4;
                    border-radius: 5px;
                    margin-bottom: 7px;
                    margin-top: 10px;
                "
            >
                <div
                    style="
                        border-top: 3px solid #51606e;
                        border-bottom: 1px solid #d4d4d4;
                        padding: 3px;
                    "
                >
                  <table>
                      <tr>
                          <td>
                              <lightning-layout>
                                  <lightning-layout-item padding="around-small">
                                    <lightning-layout-item
                                        padding="around-small"
                                    >
                                      <p style="font-size: 18px">
                                          <strong>错误明细</strong>
                                      </p>
@@ -119,20 +208,20 @@
                  </table>
              </div>
          <div style="padding:10px;">
                <div style="padding: 10px">
              <lightning-datatable
              key-field="id" data={errorDetail} columns={column}
              onrowselection={getSelectedRows}   hide-checkbox-column="true"
             selected-rows={selectedRows}  class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all; ">
                        key-field="id"
                        data={errorDetail}
                        columns={column}
                        onrowselection={getSelectedRows}
                        hide-checkbox-column="true"
                        selected-rows={selectedRows}
                        class="wrapped-header-datatable"
                        style="word-wrap: break-word; word-break: break-all"
                    >
      </lightning-datatable>
          </div>
      </div>
      </div>
  </div>
</template>
force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js
@@ -1,12 +1,12 @@
import { LightningElement, wire, api, track } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import oninit from "@salesforce/apex/LexCancelRemoveBoxController.init";
import searchDeatail from "@salesforce/apex/LexCancelRemoveBoxController.searchConsumableorderdetails"
import oninit from '@salesforce/apex/LexCancelRemoveBoxController.init';
import searchDeatail from '@salesforce/apex/LexCancelRemoveBoxController.searchConsumableorderdetails';
import saveConfirm from '@salesforce/apex/LexCancelRemoveBoxController.cancelRemoveBoxConfirm';
//table css 
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
import { loadStyle } from 'lightning/platformResourceLoader';
import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
const columns = [
    {
      label: '消耗品名称',
@@ -14,15 +14,13 @@
      hideDefaultActions: true,
      wrapText:true
      // initialWidth: 350,
    },
    {
      label: '规格',
      fieldName: 'ProductPacking_list_manual__c',
      hideDefaultActions: true,
      cellAttributes: { alignment: "right" },
      initialWidth: 50,
        cellAttributes: { alignment: 'right' },
        initialWidth: 50
    },
    {
      label: 'CFDA状态',
@@ -30,7 +28,6 @@
      hideDefaultActions: true,
      initialWidth: 100,
      wrapText:true
    },
    {
      label: '注册证编码号',
@@ -60,25 +57,20 @@
      fieldName: 'Name__c',
      hideDefaultActions: true,
      wrapText:true
    },
    {
      label: 'BarCode',
      fieldName: 'Bar_Code__c',
      wrapText:true,
      hideDefaultActions: true,
        hideDefaultActions: true
      // initialWidth:600
    }
    ,
    },
    {
      label: '错误原因',
      fieldName: 'ErrorReason',
      hideDefaultActions: true,
        hideDefaultActions: true
    }
  ];
export default class LexCancelRemoveBox extends LightningElement {
    columns = columns;
@@ -88,40 +80,38 @@
    @track errorDetail = [];
  
    // 显示
    @track showTable = false
    @track showTable = false;
    @track showSpinner = false;
    //数据构成
    @track accountName
    @track userWorkLocation
    @track agencyProType
    @track barcode = ''
    @track saveFLGbln = false
    @track accountName;
    @track userWorkLocation;
    @track agencyProType;
    @track barcode = '';
    @track saveFLGbln = false;
    @track dataSize = 0;
    renderedCallback() {
      if (!this.stylesLoaded) {
          Promise.all([loadStyle(this, WrappedHeaderTable)])
              .then(() => {
                  console.log("Custom styles loaded");
                    console.log('Custom styles loaded');
                  this.stylesLoaded = true;
              })
              .catch((error) => {
                  console.error("Error loading custom styles");
                    console.error('Error loading custom styles');
              });
      }
  }
  
    connectedCallback() {
      console.log('初始化');
      // this.showTable = false;
      oninit().then((result) => {
        oninit()
            .then((result) => {
        result = JSON.parse(JSON.stringify(result));
        console.log('result =' + JSON.stringify(result));
        if (result.status = 'Success') {
                if ((result.status = 'Success')) {
          console.log('result');
          this.agencyProType = result.entity.agencyProType;
          this.userWorkLocation = result.entity.userWorkLocation;
@@ -131,7 +121,8 @@
        } else {
          this.showMyToast('初始化失败',result.msg,'error');
        }
      }).catch((error) => {
            })
            .catch((error) => {
        console.log('error = ' + JSON.stringify(error));
      });
    }
@@ -144,27 +135,40 @@
      userWorkLocation: this.userWorkLocation,
      agencyProType: this.agencyProType,
      barcode: this.barcode
    }).then((result) => {
        })
            .then((result) => {
      result = JSON.parse(JSON.stringify(result));
      console.log('result =' + JSON.stringify(result));
      if (result.status == 'Success') {
        console.log('成功');
        this.data = JSON.parse(result.entity.ConsumableorderdetailsRecordsdummy);
        this.errorDetail = JSON.parse(result.entity.ConsumableorderdetailsRecordserror);
                    this.data = JSON.parse(
                        result.entity.ConsumableorderdetailsRecordsdummy
                    );
                    this.errorDetail = JSON.parse(
                        result.entity.ConsumableorderdetailsRecordserror
                    );
        this.dataSize = result.entity.dataSize;
        for (let i in this.data) {
          this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
          this.data[i]['ProductPacking_list_manual__c'] = this.data[i].esd.ProductPacking_list_manual__c;
          this.data[i]['CFDA_Status__c'] = this.data[i].esd.CFDA_Status__c;
          this.data[i]['Report_Product_Approbation__c'] = this.data[i].esd.Report_Product_Approbation__c;
          this.data[i]['Report_Product_Expiration__c'] = this.data[i].esd.Report_Product_Expiration__c;
          this.data[i]['Bar_Code__c'] = this.data[i].esd.Bar_Code__c;
                        this.data[i]['ProductPacking_list_manual__c'] =
                            this.data[i].esd.ProductPacking_list_manual__c;
                        this.data[i]['CFDA_Status__c'] =
                            this.data[i].esd.CFDA_Status__c;
                        this.data[i]['Report_Product_Approbation__c'] =
                            this.data[i].esd.Report_Product_Approbation__c;
                        this.data[i]['Report_Product_Expiration__c'] =
                            this.data[i].esd.Report_Product_Expiration__c;
                        this.data[i]['Bar_Code__c'] =
                            this.data[i].esd.Bar_Code__c;
        }
        // this.showTable = true;
        for (let i in this.errorDetail) {
          this.errorDetail[i]['Name__c'] = this.errorDetail[i].Prod.Name__c;
          this.errorDetail[i]['Bar_Code__c'] = this.errorDetail[i].esd.Bar_Code__c;
          this.errorDetail[i]['ErrorReason'] = this.errorDetail[i].ErrorReason;
                        this.errorDetail[i]['Name__c'] =
                            this.errorDetail[i].Prod.Name__c;
                        this.errorDetail[i]['Bar_Code__c'] =
                            this.errorDetail[i].esd.Bar_Code__c;
                        this.errorDetail[i]['ErrorReason'] =
                            this.errorDetail[i].ErrorReason;
        }
        // this.showTables = true;
        this.showSpinner = false;
@@ -172,10 +176,10 @@
        this.showMyToast('获取失败',result.msg,'error');
        this.showSpinner = false;
      }
    }).catch((error) => {
            })
            .catch((error) => {
      console.log('error = ' + JSON.stringify(error));
    });
  }
   //获取当前输入值
   handleChange(event) {
@@ -185,9 +189,8 @@
    console.log('this.barcode' + this.barcode);
  }
  saveConfirm() {
    let msg = "确认取消拆盒吗";
        let msg = '确认取消拆盒吗';
    if (this.dataSize>0) {
        if (confirm(msg) == true) {
            this.CancelRemoveBox();
@@ -203,7 +206,8 @@
      accountName: this.accountName,
      userWorkLocation: this.userWorkLocation,
      agencyProType: this.agencyProType
    }).then((result) => {
        })
            .then((result) => {
      result = JSON.parse(JSON.stringify(result));
      console.log('result保存 = ' + JSON.stringify(result));
      if (result.status == 'Success') {
@@ -212,8 +216,6 @@
         if(this.saveFLGbln){
          this.showMyToast(result.msg,'','success');
          this.showSpinner = false;
         }
      } else {
        this.showMyToast('取消拆盒失败',result.msg,'error');
@@ -223,7 +225,6 @@
      .catch((error) => {
        console.log('error = ' + JSON.stringify(error));
      });
  }
  showMyToast(title, message, variant) {
    console.log('show custom message');
@@ -235,15 +236,17 @@
       iconName = 'utility:error';
    }
    if(message != ''){
       content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
            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);
        this.template
            .querySelector('c-common-toast')
            .showToast(variant, content, iconName, 10000);
    }
}
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html
@@ -3,55 +3,122 @@
<template>
    <c-common-toast></c-common-toast>
    <template if:true={isShowSpinner}>
        <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
                <span class="slds-assistive-text">Loading</span>
                <div class="slds-spinner__dot-a"></div>
                <div class="slds-spinner__dot-b"></div>
        </div>
        <div
            role="status"
            class="slds-spinner slds-spinner_medium slds-spinner_brand"
        >
                            <span class="slds-assistive-text">Loading</span>    
                       
            <div class="slds-spinner__dot-a"></div>
                           
            <div class="slds-spinner__dot-b"></div>
                   
        </div>
    </template>
    <template if:false={isDetailsShow}>
        <template if:false={isConInvoiceList}>
            <!-- 搜索客户名 -->
            <template if:true={isModalOpen}>
                <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true"
                    aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_medium"
                    style="border: 1px solid #D4D4D4;">
                <section
                    role="dialog"
                    tabindex="-1"
                    aria-labelledby="modal-heading-01"
                    aria-modal="true"
                    aria-describedby="modal-content-id-1"
                    class="slds-modal slds-fade-in-open slds-modal_medium"
                    style="border: 1px solid #d4d4d4"
                >
                    <div class="slds-modal__container">
                        <header class="slds-modal__header" style="background-color: #F3F3F3;">
                            <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
                                title="Close" onclick={closeModal}>
                                <lightning-icon icon-name="utility:close" alternative-text="close" variant="inverse"
                                    size="small"></lightning-icon>
                        <header
                            class="slds-modal__header"
                            style="background-color: #f3f3f3"
                        >
                            <button
                                style=""
                                class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
                                title="Close"
                                onclick={closeModal}
                            >
                                <lightning-icon
                                    icon-name="utility:close"
                                    alternative-text="close"
                                    variant="inverse"
                                    size="small"
                                ></lightning-icon>
                                <span class="slds-assistive-text">Close</span>
                            </button>
                            <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">经销商医院检索</h2>
                            <h2
                                id="modal-heading-01"
                                class="slds-text-heading_medium slds-hyphenate"
                            >
                                经销商医院检索
                            </h2>
                        </header>
                        <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1"
                            style="border: 1px solid #F3F3F3;">
                            <table style="width: 100%;">
                        <div
                            class="slds-modal__content slds-p-around_medium"
                            id="modal-content-id-1"
                            style="border: 1px solid #f3f3f3"
                        >
                            <table style="width: 100%">
                                <tbody>
                                    <tr>
                                        <td style="width: 74px;">
                                            <div style="color:#696969;font-size:16px;text-align: left;">医院名称</div>
                                        <td style="width: 74px">
                                            <div
                                                style="
                                                    color: #696969;
                                                    font-size: 16px;
                                                    text-align: left;
                                                "
                                            >
                                                医院名称
                                            </div>
                                        </td>
                                        <td style="width: 60%;"><lightning-input class="inputFont" label="医院名称"
                                                variant="label-hidden" placeholder="请输入医院名称" value={searchHospitalName}
                                                data-field="searchHospitalName" onchange={dataChange}></lightning-input></td>
                                        <td style="width: 10px;"></td>
                                        <td><button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
                                                style="height: 32px;" label="搜索" onclick={searchHospital}>搜索</button></td>
                                        <td style="width: 60%">
                                            <lightning-input
                                                class="inputFont"
                                                label="医院名称"
                                                variant="label-hidden"
                                                placeholder="请输入医院名称"
                                                value={searchHospitalName}
                                                data-field="searchHospitalName"
                                                onchange={dataChange}
                                            ></lightning-input>
                                        </td>
                                        <td style="width: 10px"></td>
                                        <td>
                                            <button
                                                class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
                                                style="height: 32px"
                                                label="搜索"
                                                onclick={searchHospital}
                                            >
                                                搜索
                                            </button>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <p style="height: 20px;"></p>
                            <p style="height: 20px"></p>
                            <!-- <p>已选择医院:{chooseHospital}</p> -->
                            <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;">
                                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">
                                        <lightning-layout-item
                                            padding="around-small"
                                        >
                                            <p style="font-size: 18px">
                                                <strong>搜索结果</strong>
                                            </p>
@@ -59,109 +126,199 @@
                                    </lightning-layout>
                                    <!-- <p style="font-size: 16px;"><strong>搜索结果</strong></p> -->
                                </div>
                                <div class="myTable" style="padding:10px;">
                                <div class="myTable" style="padding: 10px">
                                    <!-- <lightning-datatable class="wrapped-header-datatable" key-field="id"
                                        hide-checkbox-column="true" data={hospitalList} columns={hosCols}
                                        onrowaction={chooseHos}></lightning-datatable> -->
                                    <lightning-datatable class="datatabel slds-border_top wrapped-header-datatable"
                                        key-field="id" data={hospitalList} columns={hospitalColumns} hide-checkbox-column="true"
                                        onrowaction={searchHandleRowAction}>
                                    <lightning-datatable
                                        class="datatabel slds-border_top wrapped-header-datatable"
                                        key-field="id"
                                        data={hospitalList}
                                        columns={hospitalColumns}
                                        hide-checkbox-column="true"
                                        onrowaction={searchHandleRowAction}
                                    >
                                    </lightning-datatable>
                                </div>
                            </div>
                        </div>
                        <footer class="slds-modal__footer">
                            <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" label="取消"
                                onclick={closeModal}>取消</button>
                            <button
                                class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
                                label="取消"
                                onclick={closeModal}
                            >
                                取消
                            </button>
                        </footer>
                    </div>
                </section>
                <div class="slds-backdrop slds-backdrop_open"></div>
            </template>
            <div class="outerBorderCss">
                <div style="padding:5px;">
                <div style="padding: 5px">
                    <div class="borderCss">
                        <div style="padding:10px;">
                        <div style="padding: 10px">
                            <div lwc:dom="manual" class="resultDiv"></div>
                            <div draggable="false">
                                <template if:false={EditAble}>
                                    <lightning-layout multiple-rows="true">
                                        <lightning-layout-item size="2"></lightning-layout-item>
                                        <lightning-layout-item
                                            size="2"
                                        ></lightning-layout-item>
                                        <lightning-layout-item size="10">
                                            <button
                                                class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                                                onclick={SetEditAbleJs} disabled={isDisabledEdit}
                                                style="width: 150px;">编辑</button>
                                                onclick={SetEditAbleJs}
                                                disabled={isDisabledEdit}
                                                style="width: 150px"
                                            >
                                                编辑
                                            </button>
                                            <button
                                                class="slds-button slds-button_neutral slds-button_stretch lexBorder buttonminMarginLeft"
                                                onclick={approvalJs} disabled={isDisabledEdit}
                                                style="width: 150px;">提交</button>
                                                onclick={approvalJs}
                                                disabled={isDisabledEdit}
                                                style="width: 150px"
                                            >
                                                提交
                                            </button>
                                            <button
                                                class="slds-button slds-button_neutral slds-button_stretch lexBorder buttonminMarginLeft"
                                                onclick={openReportJs} disabled={isOpenReportDisabled}
                                                style="width: 150px;">显示明细</button>
                                                onclick={openReportJs}
                                                disabled={isOpenReportDisabled}
                                                style="width: 150px"
                                            >
                                                显示明细
                                            </button>
                                            <button
                                                class="slds-button slds-button_neutral slds-button_stretch lexBorder buttonminMarginLeft"
                                                onclick={reopenJs} disabled={isDisabledReopen}
                                                style="width: 150px;">作废重开</button>
                                                onclick={reopenJs}
                                                disabled={isDisabledReopen}
                                                style="width: 150px"
                                            >
                                                作废重开
                                            </button>
                                        </lightning-layout-item>
                                    </lightning-layout>
                                    <lightning-layout multiple-rows="true" style="margin-top: 20px;">
                                        <lightning-layout-item size="2"></lightning-layout-item>
                                    <lightning-layout
                                        multiple-rows="true"
                                        style="margin-top: 20px"
                                    >
                                        <lightning-layout-item
                                            size="2"
                                        ></lightning-layout-item>
                                        <lightning-layout-item size="10">
                                            <button
                                                class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                                                onclick={deleteButtonJs} disabled={isDisabledDelete}
                                                style="width: 150px;">删除</button>
                                                onclick={deleteButtonJs}
                                                disabled={isDisabledDelete}
                                                style="width: 150px"
                                            >
                                                删除
                                            </button>
                                            <button
                                                class="slds-button slds-button_neutral slds-button_stretch lexBorder buttonminMarginLeft"
                                                disabled={isDisabledReopen} onclick={uploadOrder}
                                                style="width: 150px;">上传附件</button>
                                                disabled={isDisabledReopen}
                                                onclick={uploadOrder}
                                                style="width: 150px"
                                            >
                                                上传附件
                                            </button>
                                            <button
                                                class="slds-button slds-button_neutral slds-button_stretch lexBorder buttonminMarginLeft"
                                                onclick={saveAttachmentJs} disabled={isDisabledReopen}
                                                style="width: 150px;">保存附件</button>
                                                onclick={saveAttachmentJs}
                                                disabled={isDisabledReopen}
                                                style="width: 150px"
                                            >
                                                保存附件
                                            </button>
                                        </lightning-layout-item>
                                    </lightning-layout>
                                </template>
                                <!-- 上传附件弹窗 -->
                                <template if:true={showAttPop}>
                                    <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-02"
                                        aria-modal="true" aria-describedby="modal-content-id-2"
                                    <section
                                        role="dialog"
                                        tabindex="-1"
                                        aria-labelledby="modal-heading-02"
                                        aria-modal="true"
                                        aria-describedby="modal-content-id-2"
                                        class="slds-modal slds-fade-in-open slds-modal_small"
                                        style="border: 1px solid #D4D4D4;">
                                        style="border: 1px solid #d4d4d4"
                                    >
                                        <template if:true={showPopSpinner}>
                                            <lightning-spinner size="medium" variant="brand"></lightning-spinner>
                                            <lightning-spinner
                                                size="medium"
                                                variant="brand"
                                            ></lightning-spinner>
                                        </template>
                                        <div class="slds-modal__container">
                                            <header class="slds-modal__header" style="background-color: #F3F3F3;">
                                                <button style=""
                                            <header
                                                class="slds-modal__header"
                                                style="
                                                    background-color: #f3f3f3;
                                                "
                                            >
                                                <button
                                                    style=""
                                                    class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
                                                    title="Close" onclick={closePop}>
                                                    <lightning-icon icon-name="utility:close" alternative-text="close"
                                                        variant="inverse" size="small"></lightning-icon>
                                                    <span class="slds-assistive-text">Close</span>
                                                    title="Close"
                                                    onclick={closePop}
                                                >
                                                    <lightning-icon
                                                        icon-name="utility:close"
                                                        alternative-text="close"
                                                        variant="inverse"
                                                        size="small"
                                                    ></lightning-icon>
                                                    <span
                                                        class="slds-assistive-text"
                                                        >Close</span
                                                    >
                                                </button>
                                                <h2 id="modal-heading-02"
                                                    class="slds-text-heading_medium slds-hyphenate">上传附件</h2>
                                                <h2
                                                    id="modal-heading-02"
                                                    class="slds-text-heading_medium slds-hyphenate"
                                                >
                                                    上传附件
                                                </h2>
                                            </header>
                                            <div class="slds-modal__content slds-p-around_medium searchName"
                                                id="modal-content-id-2" style="border: 1px solid #F3F3F3;">
                                                <div class="slds-m-top_medium slds-m-bottom_x-large">
                                                    <div class="slds-p-around_medium lgc-bg">
                                                        <lightning-input class="fileUpload" type="file" label="附件上传"
                                            <div
                                                class="slds-modal__content slds-p-around_medium searchName"
                                                id="modal-content-id-2"
                                                style="
                                                    border: 1px solid #f3f3f3;
                                                "
                                            >
                                                <div
                                                    class="slds-m-top_medium slds-m-bottom_x-large"
                                                >
                                                    <div
                                                        class="slds-p-around_medium lgc-bg"
                                                    >
                                                        <lightning-input
                                                            class="fileUpload"
                                                            type="file"
                                                            label="附件上传"
                                                            accept=".xlsx, .xls, .csv, .png, .doc, .docx, .pdf"
                                                            onchange={attChange}></lightning-input>
                                                            onchange={attChange}
                                                        ></lightning-input>
                                                    </div>
                                                    <p class="fontWeight">已选择文件:{fileName}
                                                    <p class="fontWeight">
                                                        已选择文件:{fileName}
                                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                        <template if:true={attDelBtn}>
                                                            <a onclick={removeAtt}>移除</a>
                                                        <template
                                                            if:true={attDelBtn}
                                                        >
                                                            <a
                                                                onclick={removeAtt}
                                                                >移除</a
                                                            >
                                                        </template>
                                                    </p>
                                                </div>
@@ -171,24 +328,49 @@
                                                    label="取消" onclick={closePop}></lightning-button>
                                                <lightning-button style="margin-left: 10px;" variant="neutral"
                                                    label="上传" onclick={handleFilesChange}></lightning-button> -->
                                                <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="margin-left: 10px;"
                                                    label="取消" onclick={closePop}>取消</button>
                                                <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="margin-left: 10px;"
                                                    label="上传" onclick={handleFilesChange}>上传</button>
                                                <button
                                                    class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
                                                    style="margin-left: 10px"
                                                    label="取消"
                                                    onclick={closePop}
                                                >
                                                    取消
                                                </button>
                                                <button
                                                    class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
                                                    style="margin-left: 10px"
                                                    label="上传"
                                                    onclick={handleFilesChange}
                                                >
                                                    上传
                                                </button>
                                            </footer>
                                        </div>
                                    </section>
                                    <div class="slds-backdrop slds-backdrop_open"></div>
                                    <div
                                        class="slds-backdrop slds-backdrop_open"
                                    ></div>
                                </template>
                                <template if:true={EditAble}>
                                    <lightning-layout>
                                        <lightning-layout-item size="1" padding="around-small"></lightning-layout-item>
                                        <lightning-layout-item size="2" padding="around-small"></lightning-layout-item>
                                        <lightning-layout-item padding="around-small">
                                        <lightning-layout-item
                                            size="1"
                                            padding="around-small"
                                        ></lightning-layout-item>
                                        <lightning-layout-item
                                            size="2"
                                            padding="around-small"
                                        ></lightning-layout-item>
                                        <lightning-layout-item
                                            padding="around-small"
                                        >
                                            <button
                                                class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                                                onclick={SaveJs}>确定</button>
                                                onclick={SaveJs}
                                            >
                                                确定
                                            </button>
                                        </lightning-layout-item>
                                    </lightning-layout>
                                </template>
@@ -225,7 +407,6 @@
                                    </template>
                                </lightning-layout> -->
                            </div>
                        </div>
                    </div>
@@ -240,103 +421,180 @@
                                </lightning-layout-item>
                            </lightning-layout>
                        </div>
                        <div style="padding:7px;">
                        <div style="padding: 7px">
                            <div lwc:dom="manual" class="resultDiv"></div>
                            <div draggable="false">
                                <!--发票信息 显示用 -->
                                <template if:false={isEditInvoice}>
                                    <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId}
                                        onload={handleLoad2}>
                                    <lightning-record-edit-form
                                        object-api-name="Consumable_order__c"
                                        record-id={cocId}
                                        onload={handleLoad2}
                                    >
                                        <!-- 发票号 状态 -->
                                        <lightning-layout multiple-rows="true">
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                            <lightning-layout-item class="hehe-layoutItem" size="5">
                                                <lightning-output-field field-name="Name"></lightning-output-field>
                                            </lightning-layout-item>
                                            <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;">
                                            <lightning-layout-item
                                                class="hehe-layoutItem"
                                                size="5"
                                            >
                                                <lightning-output-field
                                                    field-name="Invoice_status__c"></lightning-output-field>
                                                    field-name="Name"
                                                ></lightning-output-field>
                                            </lightning-layout-item>
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                            <lightning-layout-item
                                                class="hehe-layoutItem"
                                                size="5"
                                                style="padding-left: 100px"
                                            >
                                                <lightning-output-field
                                                    field-name="Invoice_status__c"
                                                ></lightning-output-field>
                                            </lightning-layout-item>
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                        </lightning-layout>
                                        <!-- 发票日期 -->
                                        <lightning-layout multiple-rows="true">
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                            <lightning-layout-item class="hehe-layoutItem" size="5">
                                            <lightning-layout-item
                                                class="hehe-layoutItem"
                                                size="5"
                                            >
                                                <lightning-output-field
                                                    field-name="Invoice_Date__c"></lightning-output-field>
                                                    field-name="Invoice_Date__c"
                                                ></lightning-output-field>
                                            </lightning-layout-item>
                                        </lightning-layout>
                                        <!-- 二级经销商 -->
                                        <template if:true={isShowSecondaryDistributor}>
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                        <template
                                            if:true={isShowSecondaryDistributor}
                                        >
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                            <lightning-layout multiple-rows="true">
                                                <lightning-layout-item class="hehe-layoutItem" size="5">
                                            <lightning-layout
                                                multiple-rows="true"
                                            >
                                                <lightning-layout-item
                                                    class="hehe-layoutItem"
                                                    size="5"
                                                >
                                                    <lightning-output-field
                                                        field-name="Order_Dealer_Info__c"></lightning-output-field>
                                                        field-name="Order_Dealer_Info__c"
                                                    ></lightning-output-field>
                                                </lightning-layout-item>
                                            </lightning-layout>
                                        </template>
                                        <!-- 客户名 -->
                                        <lightning-layout multiple-rows="true">
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                            <lightning-layout-item class="hehe-layoutItem" size="5">
                                                <lightning-output-field field-name="ShipmentAccount__c"
                                                    class="hideHelpText"></lightning-output-field>
                                            <lightning-layout-item
                                                class="hehe-layoutItem"
                                                size="5"
                                            >
                                                <lightning-output-field
                                                    field-name="ShipmentAccount__c"
                                                    class="hideHelpText"
                                                ></lightning-output-field>
                                            </lightning-layout-item>
                                        </lightning-layout>
                                        <!-- 科室 发票票面金额 -->
                                        <lightning-layout multiple-rows="true" style="height:35.5px">
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                        <lightning-layout
                                            multiple-rows="true"
                                            style="height: 35.5px"
                                        >
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                            <lightning-layout-item class="hehe-layoutItem" size="5">
                                            <lightning-layout-item
                                                class="hehe-layoutItem"
                                                size="5"
                                            >
                                                <lightning-output-field
                                                    field-name="Order_ForCustomerText__c"></lightning-output-field>
                                                    field-name="Order_ForCustomerText__c"
                                                ></lightning-output-field>
                                            </lightning-layout-item>
                                            <lightning-layout-item size="5" class="readOnly" style="padding-left: 100px;">
                                                <lightning-input label="发票票面金额(元)" value={sumPrice} read-only
                                                    variant="label-inline"></lightning-input>
                                            <lightning-layout-item
                                                size="5"
                                                class="readOnly"
                                                style="padding-left: 100px"
                                            >
                                                <lightning-input
                                                    label="发票票面金额(元)"
                                                    value={sumPrice}
                                                    read-only
                                                    variant="label-inline"
                                                ></lightning-input>
                                            </lightning-layout-item>
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                        </lightning-layout>
                                        <!-- 备注 -->
                                        <lightning-layout multiple-rows="true">
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                            <lightning-layout-item class="hehe-layoutItem" size="5">
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                            <lightning-layout-item
                                                class="hehe-layoutItem"
                                                size="5"
                                            >
                                                <lightning-output-field
                                                    field-name="Invoice_Note__c"></lightning-output-field>
                                                    field-name="Invoice_Note__c"
                                                ></lightning-output-field>
                                            </lightning-layout-item>
                                        </lightning-layout>
                                        <!-- 发票附件 明细附件 -->
                                        <lightning-layout multiple-rows="true">
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                            <lightning-layout-item class="hehe-layoutItem" size="5">
                                            <lightning-layout-item
                                                class="hehe-layoutItem"
                                                size="5"
                                            >
                                                <lightning-output-field
                                                    field-name="Invoice_attachment__c"></lightning-output-field>
                                                    field-name="Invoice_attachment__c"
                                                ></lightning-output-field>
                                            </lightning-layout-item>
                                            <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;">
                                            <lightning-layout-item
                                                class="hehe-layoutItem"
                                                size="5"
                                                style="padding-left: 100px"
                                            >
                                                <lightning-output-field
                                                    field-name="Invoicedet_attachment__c"></lightning-output-field>
                                                    field-name="Invoicedet_attachment__c"
                                                ></lightning-output-field>
                                            </lightning-layout-item>
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                        </lightning-layout>
                                        <!-- 附件预览 -->
@@ -344,30 +602,68 @@
                                            <lightning-layout-item size="1">
                                            </lightning-layout-item>
                                            <lightning-layout-item size="10">
                                                <lightning-card class="attListTitle" variant="Narrow" title="附件列表"
                                                    icon-name="utility:attach">
                                                    <lightning-layout slot="footer" multiple-rows="true">
                                                        <template for:each={fileData} for:item="item" for:index="index">
                                                            <lightning-layout-item padding="around-none" size="2"
                                                <lightning-card
                                                    class="attListTitle"
                                                    variant="Narrow"
                                                    title="附件列表"
                                                    icon-name="utility:attach"
                                                >
                                                    <lightning-layout
                                                        slot="footer"
                                                        multiple-rows="true"
                                                    >
                                                        <template
                                                            for:each={fileData}
                                                            for:item="item"
                                                            for:index="index"
                                                        >
                                                            <lightning-layout-item
                                                                padding="around-none"
                                                                size="2"
                                                                key={item.recordId}
                                                                style="text-align: left;padding:5px">
                                                                <lightning-icon title={item.Title}
                                                                    style="margin-left: 20px;" icon-name="doctype:gform"
                                                                style="
                                                                    text-align: left;
                                                                    padding: 5px;
                                                                "
                                                            >
                                                                <lightning-icon
                                                                    title={item.Title}
                                                                    style="
                                                                        margin-left: 20px;
                                                                    "
                                                                    icon-name="doctype:gform"
                                                                    alternative-text={item.Title}
                                                                    size="large"></lightning-icon><br />
                                                                <div title={item.Title} style="width: 100px;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;">
                                                                    size="large"
                                                                ></lightning-icon
                                                                ><br />
                                                                <div
                                                                    title={item.Title}
                                                                    style="
                                                                        width: 100px;
                                                                        text-overflow: ellipsis;
                                                                        overflow: hidden;
                                                                        white-space: nowrap;
                                                                    "
                                                                >
                                                                    {item.Title}
                                                                </div>
                                                                <p>
                                                                    <!-- <a data-fileid ={item.documentId} onclick={previweAtt}> -->
                                                                    <a href={item.attUrl} target="_blank">
                                                                        预览
                                                                    </a>&nbsp;·&nbsp;
                                                                    <a href={item.downloadUrl}>
                                                                        下载
                                                                    </a>&nbsp;·&nbsp;
                                                                    <a data-fileid={item.Id} onclick={deleteAtt}>
                                                                    <a
                                                                        href={item.attUrl}
                                                                        target="_blank"
                                                                    >
                                                                        预览 </a
                                                                    >&nbsp;·&nbsp;
                                                                    <a
                                                                        href={item.downloadUrl}
                                                                    >
                                                                        下载 </a
                                                                    >&nbsp;·&nbsp;
                                                                    <a
                                                                        data-fileid={item.Id}
                                                                        onclick={deleteAtt}
                                                                    >
                                                                        删除
                                                                    </a>
                                                                </p>
@@ -382,95 +678,177 @@
                                </template>
                                <!--发票信息 编辑用 -->
                                <template if:true={isEditInvoice}>
                                    <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId}
                                        onload={handleLoad2}>
                                    <lightning-record-edit-form
                                        object-api-name="Consumable_order__c"
                                        record-id={cocId}
                                        onload={handleLoad2}
                                    >
                                        <!-- 发票号 状态 -->
                                        <lightning-layout multiple-rows="true">
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                            <lightning-layout-item class="hehe-layoutItem" size="5">
                                                <lightning-input label="发票号" value={OrderCode} data-field="OrderCode"
                                                    onchange={dataChange} variant="label-inline" required
                                                    class="inputFont"></lightning-input>
                                            <lightning-layout-item
                                                class="hehe-layoutItem"
                                                size="5"
                                            >
                                                <lightning-input
                                                    label="发票号"
                                                    value={OrderCode}
                                                    data-field="OrderCode"
                                                    onchange={dataChange}
                                                    variant="label-inline"
                                                    required
                                                    class="inputFont"
                                                ></lightning-input>
                                            </lightning-layout-item>
                                            <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;">
                                            <lightning-layout-item
                                                class="hehe-layoutItem"
                                                size="5"
                                                style="padding-left: 100px"
                                            >
                                                <lightning-output-field
                                                    field-name="Invoice_status__c"></lightning-output-field>
                                                    field-name="Invoice_status__c"
                                                ></lightning-output-field>
                                            </lightning-layout-item>
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                        </lightning-layout>
                                        <!-- 发票日期 -->
                                        <lightning-layout multiple-rows="true">
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                            <lightning-layout-item class="hehe-layoutItem" size="5">
                                                <lightning-input type="date" label="发票日期" variant="label-inline"
                                                    value={InvoiceDate} onchange={invoiceDateChange} required
                                                    class="inputFont"></lightning-input>
                                            <lightning-layout-item
                                                class="hehe-layoutItem"
                                                size="5"
                                            >
                                                <lightning-input
                                                    type="date"
                                                    label="发票日期"
                                                    variant="label-inline"
                                                    value={InvoiceDate}
                                                    onchange={invoiceDateChange}
                                                    required
                                                    class="inputFont"
                                                ></lightning-input>
                                            </lightning-layout-item>
                                        </lightning-layout>
                                        <!-- 客户名 二级经销商 -->
                                        <lightning-layout multiple-rows="true">
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                            <lightning-layout-item class="hehe-layoutItem" size="5">
                                            <lightning-layout-item
                                                class="hehe-layoutItem"
                                                size="5"
                                            >
                                                <div
                                                    class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right">
                                                    <lightning-icon size="x-small"
                                                    class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right"
                                                >
                                                    <lightning-icon
                                                        size="x-small"
                                                        class="iconMargin slds-icon slds-input__icon slds-input__icon_right slds-icon-text-default hideHelpText"
                                                        icon-name="utility:search"></lightning-icon>
                                                    <lightning-input type="text" name="HospitalName" label="客户名"
                                                        value={HospitalName} variant="label-inline"
                                                        onclick={searchHospitalNameModal} data-field="HospitalName"
                                                        onchange={clearAgencyI} class="inputFont"></lightning-input>
                                                        icon-name="utility:search"
                                                    ></lightning-icon>
                                                    <lightning-input
                                                        type="text"
                                                        name="HospitalName"
                                                        label="客户名"
                                                        value={HospitalName}
                                                        variant="label-inline"
                                                        onclick={searchHospitalNameModal}
                                                        data-field="HospitalName"
                                                        onchange={clearAgencyI}
                                                        class="inputFont"
                                                    ></lightning-input>
                                                </div>
                                            </lightning-layout-item>
                                            <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;">
                                                <lightning-combobox data-field="secondaryDistributor"
                                                    name="secondaryDistributor" label="二级经销商"
                                                    value={secondaryDistributor} placeholder="请选择..."
                                                    options={provinceOptsMap} variant="label-inline"
                                                    onchange={dataChange} class="inputFont"></lightning-combobox>
                                            <lightning-layout-item
                                                class="hehe-layoutItem"
                                                size="5"
                                                style="padding-left: 100px"
                                            >
                                                <lightning-combobox
                                                    data-field="secondaryDistributor"
                                                    name="secondaryDistributor"
                                                    label="二级经销商"
                                                    value={secondaryDistributor}
                                                    placeholder="请选择..."
                                                    options={provinceOptsMap}
                                                    variant="label-inline"
                                                    onchange={dataChange}
                                                    class="inputFont"
                                                ></lightning-combobox>
                                            </lightning-layout-item>
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                        </lightning-layout>
                                        <!-- 科室 经销商(录入) -->
                                        <lightning-layout multiple-rows="true">
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                            <lightning-layout-item class="hehe-layoutItem" size="5">
                                                <lightning-input-field onchange={dataChange}
                                                    data-field="ForCustomerText" value={ForCustomerText}
                                            <lightning-layout-item
                                                class="hehe-layoutItem"
                                                size="5"
                                            >
                                                <lightning-input-field
                                                    onchange={dataChange}
                                                    data-field="ForCustomerText"
                                                    value={ForCustomerText}
                                                    field-name="Order_ForCustomerText__c"
                                                    class="inputFont"></lightning-input-field>
                                                    class="inputFont"
                                                ></lightning-input-field>
                                            </lightning-layout-item>
                                            <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;">
                                            <lightning-layout-item
                                                class="hehe-layoutItem"
                                                size="5"
                                                style="padding-left: 100px"
                                            >
                                                <lightning-output-field
                                                    field-name="Order_ForDealerText__c"></lightning-output-field>
                                                    field-name="Order_ForDealerText__c"
                                                ></lightning-output-field>
                                            </lightning-layout-item>
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                        </lightning-layout>
                                        <!-- 备注 -->
                                        <lightning-layout multiple-rows="true">
                                            <lightning-layout-item size="1"></lightning-layout-item>
                                            <lightning-layout-item
                                                size="1"
                                            ></lightning-layout-item>
                                            <lightning-layout-item class="hehe-layoutItem" size="5">
                                                <lightning-input-field onchange={dataChange} data-field="InvoiceNote"
                                                    value={InvoiceNote} field-name="Invoice_Note__c"
                                                    class="inputFont"></lightning-input-field>
                                            <lightning-layout-item
                                                class="hehe-layoutItem"
                                                size="5"
                                            >
                                                <lightning-input-field
                                                    onchange={dataChange}
                                                    data-field="InvoiceNote"
                                                    value={InvoiceNote}
                                                    field-name="Invoice_Note__c"
                                                    class="inputFont"
                                                ></lightning-input-field>
                                            </lightning-layout-item>
                                        </lightning-layout>
                                    </lightning-record-edit-form>
                                </template>
                            </div>
@@ -479,25 +857,31 @@
                    <!-- 出库单一览 -->
                    <div class="borderCss">
                        <div class="headerDorderCss">
                            <lightning-layout>
                                <lightning-layout-item padding="around-small">
                                    <p style="font-size: 18px">
                                        <strong>出库单一览</strong>
                                    </p>
                                </lightning-layout-item>
                                <lightning-layout-item size="2" padding="around-small">
                                <lightning-layout-item
                                    size="2"
                                    padding="around-small"
                                >
                                </lightning-layout-item>
                                <template if:false={hideCheckbox}>
                                    <lightning-layout-item padding="around-small">
                                    <lightning-layout-item
                                        padding="around-small"
                                    >
                                        <!-- <lightning-button label="&#12288;检索&#12288;"
                                            onclick={InvoiceorderSearchJs}></lightning-button> -->
                                        <button
                                            class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
                                            onclick={InvoiceorderSearchJs}>检索</button>
                                            onclick={InvoiceorderSearchJs}
                                        >
                                            检索
                                        </button>
                                    </lightning-layout-item>
                                </template>
                            </lightning-layout>
                        </div>
@@ -520,13 +904,25 @@
                        <div style="padding: 7px">
                            <div lwc:dom="manual" class="resultDiv"></div>
                            <div draggable="false">
                                <lightning-datatable key-field="Id" data={outboundData} columns={outboundColumns}
                                    hide-checkbox-column={hideCheckbox} onrowselection={getSelectedRows}
                                    selected-rows={selectedRows} class="wrapped-header-datatable" data-field="outbound">
                                <lightning-datatable
                                    key-field="Id"
                                    data={outboundData}
                                    columns={outboundColumns}
                                    hide-checkbox-column={hideCheckbox}
                                    onrowselection={getSelectedRows}
                                    selected-rows={selectedRows}
                                    class="wrapped-header-datatable"
                                    data-field="outbound"
                                >
                                </lightning-datatable>
                                <lightning-datatable key-field="id" data={outboundDataSumPrice}
                                    columns={outboundColumns} hide-checkbox-column hide-table-header
                                    class="wrapped-header-datatable">
                                <lightning-datatable
                                    key-field="id"
                                    data={outboundDataSumPrice}
                                    columns={outboundColumns}
                                    hide-checkbox-column
                                    hide-table-header
                                    class="wrapped-header-datatable"
                                >
                                </lightning-datatable>
                            </div>
                        </div>
@@ -536,7 +932,9 @@
                        <div class="borderCss">
                            <div class="headerDorderCss">
                                <lightning-layout>
                                    <lightning-layout-item padding="around-small">
                                    <lightning-layout-item
                                        padding="around-small"
                                    >
                                        <p style="font-size: 18px">
                                            <strong>发票明细</strong>
                                        </p>
@@ -546,9 +944,13 @@
                            <div style="padding: 7px">
                                <div lwc:dom="manual" class="resultDiv"></div>
                                <div draggable="false">
                                    <lightning-datatable key-field="id" data={invoiceOrderdetail1Recoeds}
                                        columns={invoiceDetailsColumns} hide-checkbox-column
                                        class="wrapped-header-datatable">
                                    <lightning-datatable
                                        key-field="id"
                                        data={invoiceOrderdetail1Recoeds}
                                        columns={invoiceDetailsColumns}
                                        hide-checkbox-column
                                        class="wrapped-header-datatable"
                                    >
                                    </lightning-datatable>
                                </div>
                            </div>
@@ -605,21 +1007,25 @@
        <template if:true={isConInvoiceList}>
            <div class="outerBorderCss">
                <div style="padding:5px;">
                <div style="padding: 5px">
                    <!-- 新建发票 -->
                    <div class="borderCss">
                        <div style="padding:15px;">
                        <div style="padding: 15px">
                            <div lwc:dom="manual" class="resultDiv"></div>
                            <div draggable="false">
                                <!-- <lightning-button label="新建发票" onclick={newInvoiceJs}></lightning-button> -->
                                <button class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                                    onclick={newInvoiceJs}>新建发票</button>
                                <button
                                    class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                                    onclick={newInvoiceJs}
                                >
                                    新建发票
                                </button>
                            </div>
                        </div>
                    </div>
                    <!-- 检索条件 -->
                    <div class="borderCss" style="margin-top: 5px;">
                    <div class="borderCss" style="margin-top: 5px">
                        <div class="headerDorderCss">
                            <lightning-layout>
                                <lightning-layout-item padding="around-small">
@@ -632,77 +1038,150 @@
                        <div style="padding: 15px">
                            <div lwc:dom="manual" class="resultDiv"></div>
                            <div draggable="false">
                                <lightning-layout multiple-rows>
                                    <lightning-layout-item flexibility="auto">
                                        <div class="slds-text-align_center">
                                            <div class="slds-grid slds-grid_vertical-align-center">
                                                <div class="slds-form-element__label ">出库日&#12288;从</div>
                                                <lightning-input type="date" variant="label-hidden" label="出库日 从"
                                                    onchange={dataChange} data-field="deliveryFromDate"
                                                    value={deliveryFromDate} class="inputFont"
                                                    style="max-width: 150px;"></lightning-input>
                                            <div
                                                class="slds-grid slds-grid_vertical-align-center"
                                            >
                                                <div
                                                    class="slds-form-element__label"
                                                >
                                                    出库日&#12288;从
                                                </div>
                                                <lightning-input
                                                    type="date"
                                                    variant="label-hidden"
                                                    label="出库日 从"
                                                    onchange={dataChange}
                                                    data-field="deliveryFromDate"
                                                    value={deliveryFromDate}
                                                    class="inputFont"
                                                    style="max-width: 150px"
                                                ></lightning-input>
                                            </div>
                                            </br>
                                            <div class="slds-grid slds-grid_vertical-align-center">
                                                <div class="slds-form-element__label ">&#12288;&#12288;&#12288;&#12288;到
                                            <!-- </br> -->
                                            <div
                                                class="slds-grid slds-grid_vertical-align-center"
                                            >
                                                <div
                                                    class="slds-form-element__label"
                                                >
                                                    &#12288;&#12288;&#12288;&#12288;到
                                                </div>
                                                <lightning-input type="date" variant="label-hidden" label="到"
                                                    onchange={dataChange} data-field="deliveryToDate"
                                                    value={deliveryToDate} class="inputFont"
                                                    style="max-width: 150px;"></lightning-input>
                                                <lightning-input
                                                    type="date"
                                                    variant="label-hidden"
                                                    label="到"
                                                    onchange={dataChange}
                                                    data-field="deliveryToDate"
                                                    value={deliveryToDate}
                                                    class="inputFont"
                                                    style="max-width: 150px"
                                                ></lightning-input>
                                            </div>
                                        </div>
                                    </lightning-layout-item>
                                    <lightning-layout-item flexibility="auto">
                                        <div class="slds-grid slds-grid_vertical-align-center">
                                            <div class="slds-form-element__label ">发票号</div>
                                            <lightning-input variant="label-hidden" label="发票号" onchange={dataChange}
                                                data-field="category1" value={category1} class="inputFont"
                                                style="max-width: 150px;"></lightning-input>
                                        <div
                                            class="slds-grid slds-grid_vertical-align-center"
                                        >
                                            <div
                                                class="slds-form-element__label"
                                            >
                                                发票号
                                            </div>
                                            <lightning-input
                                                variant="label-hidden"
                                                label="发票号"
                                                onchange={dataChange}
                                                data-field="category1"
                                                value={category1}
                                                class="inputFont"
                                                style="max-width: 150px"
                                            ></lightning-input>
                                        </div>
                                    </lightning-layout-item>
                                    <lightning-layout-item flexibility="auto">
                                        <div class="slds-grid slds-grid_vertical-align-center">
                                            <div class="slds-form-element__label ">客户名</div>
                                            <lightning-input variant="label-hidden" label="客户名" onchange={dataChange}
                                                data-field="category2" value={category2} class="inputFont"
                                                style="max-width: 150px;"></lightning-input>
                                        <div
                                            class="slds-grid slds-grid_vertical-align-center"
                                        >
                                            <div
                                                class="slds-form-element__label"
                                            >
                                                客户名
                                            </div>
                                            <lightning-input
                                                variant="label-hidden"
                                                label="客户名"
                                                onchange={dataChange}
                                                data-field="category2"
                                                value={category2}
                                                class="inputFont"
                                                style="max-width: 150px"
                                            ></lightning-input>
                                        </div>
                                    </lightning-layout-item>
                                    <lightning-layout-item flexibility="auto">
                                        <div class="slds-grid slds-grid_vertical-align-center">
                                            <div class="slds-form-element__label ">状态</div>
                                            <lightning-combobox data-field="invoiceStatus" name="invoiceStatus"
                                                label="状态" value={invoiceStatusValue} placeholder="请选择..."
                                                options={Options} variant="label-hidden" onchange={dataChange}
                                                style="min-width: 100px;max-width: 200px;"
                                                class="inputFont"></lightning-combobox>
                                        <div
                                            class="slds-grid slds-grid_vertical-align-center"
                                        >
                                            <div
                                                class="slds-form-element__label"
                                            >
                                                状态
                                            </div>
                                            <lightning-combobox
                                                data-field="invoiceStatus"
                                                name="invoiceStatus"
                                                label="状态"
                                                value={invoiceStatusValue}
                                                placeholder="请选择..."
                                                options={Options}
                                                variant="label-hidden"
                                                onchange={dataChange}
                                                style="
                                                    min-width: 100px;
                                                    max-width: 200px;
                                                "
                                                class="inputFont"
                                            ></lightning-combobox>
                                        </div>
                                    </lightning-layout-item>
                                    <lightning-layout-item flexibility="auto">
                                        <div class="slds-grid slds-grid_vertical-align-center">
                                        <div
                                            class="slds-grid slds-grid_vertical-align-center"
                                        >
                                            <button
                                                class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
                                                onclick={invoiceCodeSearchJs} style="max-width: 110px;">检索</button>
                                                onclick={invoiceCodeSearchJs}
                                                style="max-width: 110px"
                                            >
                                                检索
                                            </button>
                                        </div>
                                    </lightning-layout-item>
                                    <lightning-layout-item flexibility="auto">
                                        <div class="slds-grid slds-grid_vertical-align-center">
                                        <div
                                            class="slds-grid slds-grid_vertical-align-center"
                                        >
                                            <button
                                                class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
                                                onclick={ClearJs} style="max-width: 110px;">清空</button>
                                                onclick={ClearJs}
                                                style="max-width: 110px"
                                            >
                                                清空
                                            </button>
                                        </div>
                                    </lightning-layout-item>
                                </lightning-layout>
                            </div>
                        </div>
                    </div>
                    <!-- 发票一览 -->
                    <div class="borderCss" style="margin-top: 5px;">
                    <div class="borderCss" style="margin-top: 5px">
                        <div class="headerDorderCss">
                            <lightning-layout>
                                <lightning-layout-item padding="around-small">
@@ -715,8 +1194,13 @@
                        <div style="padding: 7px">
                            <div lwc:dom="manual" class="resultDiv"></div>
                            <div draggable="false">
                                <lightning-datatable key-field="id" data={invoiceData} columns={invoiceColumns}
                                    hide-checkbox-column="true" class="wrapped-header-datatable">
                                <lightning-datatable
                                    key-field="id"
                                    data={invoiceData}
                                    columns={invoiceColumns}
                                    hide-checkbox-column="true"
                                    class="wrapped-header-datatable"
                                >
                                </lightning-datatable>
                            </div>
                        </div>
@@ -728,21 +1212,25 @@
    <template if:true={isDetailsShow}>
        <div class="outerBorderCss">
            <div style="padding:5px;">
            <div style="padding: 5px">
                <!-- 确定 -->
                <div class="borderCss">
                    <div style="padding:10px;">
                    <div style="padding: 10px">
                        <div lwc:dom="manual" class="resultDiv"></div>
                        <div draggable="false">
                            <!-- <lightning-button label="确定" onclick={detailsSaveJs}></lightning-button> -->
                            <button class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                                onclick={detailsSaveJs}>确定</button>
                            <button
                                class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                                onclick={detailsSaveJs}
                            >
                                确定
                            </button>
                        </div>
                    </div>
                </div>
                <!-- 发票信息 -->
                <div class="borderCss" style="margin-top: 5px;">
                <div class="borderCss" style="margin-top: 5px">
                    <div class="headerDorderCss">
                        <lightning-layout>
                            <lightning-layout-item padding="around-small">
@@ -755,26 +1243,43 @@
                    <div style="padding: 7px">
                        <div lwc:dom="manual" class="resultDiv"></div>
                        <div draggable="false">
                            <lightning-record-edit-form object-api-name="Consumable_order__c"
                                record-id={detailsInvoiceId} onload={handleLoad2}>
                            <lightning-record-edit-form
                                object-api-name="Consumable_order__c"
                                record-id={detailsInvoiceId}
                                onload={handleLoad2}
                            >
                                <lightning-layout multiple-rows="true">
                                    <lightning-layout-item size="1"></lightning-layout-item>
                                    <lightning-layout-item size="5">
                                        <lightning-output-field field-name="Name"></lightning-output-field>
                                    </lightning-layout-item>
                                </lightning-layout>
                                <lightning-layout multiple-rows="true">
                                    <lightning-layout-item size="1"></lightning-layout-item>
                                    <lightning-layout-item size="5" class="hehe-layoutItem">
                                        <lightning-output-field field-name="ShipmentAccount__c"
                                            class="hideHelpText"></lightning-output-field>
                                    </lightning-layout-item>
                                </lightning-layout>
                                <lightning-layout multiple-rows="true">
                                    <lightning-layout-item size="1"></lightning-layout-item>
                                    <lightning-layout-item
                                        size="1"
                                    ></lightning-layout-item>
                                    <lightning-layout-item size="5">
                                        <lightning-output-field
                                            field-name="Order_ForCustomerText__c"></lightning-output-field>
                                            field-name="Name"
                                        ></lightning-output-field>
                                    </lightning-layout-item>
                                </lightning-layout>
                                <lightning-layout multiple-rows="true">
                                    <lightning-layout-item
                                        size="1"
                                    ></lightning-layout-item>
                                    <lightning-layout-item
                                        size="5"
                                        class="hehe-layoutItem"
                                    >
                                        <lightning-output-field
                                            field-name="ShipmentAccount__c"
                                            class="hideHelpText"
                                        ></lightning-output-field>
                                    </lightning-layout-item>
                                </lightning-layout>
                                <lightning-layout multiple-rows="true">
                                    <lightning-layout-item
                                        size="1"
                                    ></lightning-layout-item>
                                    <lightning-layout-item size="5">
                                        <lightning-output-field
                                            field-name="Order_ForCustomerText__c"
                                        ></lightning-output-field>
                                    </lightning-layout-item>
                                </lightning-layout>
                            </lightning-record-edit-form>
@@ -783,7 +1288,7 @@
                </div>
                <!-- 出库单 -->
                <div class="borderCss" style="margin-top: 5px;">
                <div class="borderCss" style="margin-top: 5px">
                    <div class="headerDorderCss">
                        <lightning-layout>
                            <lightning-layout-item padding="around-small">
@@ -796,17 +1301,28 @@
                    <div style="padding: 7px">
                        <div lwc:dom="manual" class="resultDiv"></div>
                        <div draggable="false">
                            <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={detailsCocId}>
                            <lightning-record-edit-form
                                object-api-name="Consumable_order__c"
                                record-id={detailsCocId}
                            >
                                <lightning-layout multiple-rows="true">
                                    <lightning-layout-item size="1"></lightning-layout-item>
                                    <lightning-layout-item
                                        size="1"
                                    ></lightning-layout-item>
                                    <lightning-layout-item size="5">
                                        <lightning-output-field field-name="Name"></lightning-output-field>
                                        <lightning-output-field
                                            field-name="Name"
                                        ></lightning-output-field>
                                    </lightning-layout-item>
                                </lightning-layout>
                                <lightning-layout multiple-rows="true">
                                    <lightning-layout-item size="1"></lightning-layout-item>
                                    <lightning-layout-item
                                        size="1"
                                    ></lightning-layout-item>
                                    <lightning-layout-item size="5">
                                        <lightning-output-field field-name="Outbound_Date__c"></lightning-output-field>
                                        <lightning-output-field
                                            field-name="Outbound_Date__c"
                                        ></lightning-output-field>
                                    </lightning-layout-item>
                                </lightning-layout>
                            </lightning-record-edit-form>
@@ -815,7 +1331,7 @@
                </div>
                <!-- 出库单明细 -->
                <div class="borderCss" style="margin-top: 5px;">
                <div class="borderCss" style="margin-top: 5px">
                    <div class="headerDorderCss">
                        <lightning-layout>
                            <lightning-layout-item padding="around-small">
@@ -831,15 +1347,30 @@
                            <!-- <lightning-datatable class="datatabel slds-border_top" key-field="id"
                                data={detaisData} columns={detailsColumns}>
                            </lightning-datatable> -->
                            <c-lex-custom-lightning-datatable key-field="Id" data={detailsData} columns={detailsColumns}
                                onunitchange={handleUnitChange} onshipmentnumber={handleShipmentNumber}
                                onrowselection={detailsGetSelectedRows} selected-rows={detailsSelectedRows}
                                style="word-wrap:break-word; word-break:break-all; " class="wrapped-header-datatable"
                                min-column-width="115">
                            <c-lex-custom-lightning-datatable
                                key-field="Id"
                                data={detailsData}
                                columns={detailsColumns}
                                onunitchange={handleUnitChange}
                                onshipmentnumber={handleShipmentNumber}
                                onrowselection={detailsGetSelectedRows}
                                selected-rows={detailsSelectedRows}
                                style="
                                    word-wrap: break-word;
                                    word-break: break-all;
                                "
                                class="wrapped-header-datatable"
                                min-column-width="115"
                            >
                            </c-lex-custom-lightning-datatable>
                            <lightning-datatable class="datatabel slds-border_top wrapped-header-datatable"
                                key-field="id" data={invoiceAllpriceData} columns={detailsColumns} hide-checkbox-column
                                hide-table-header>
                            <lightning-datatable
                                class="datatabel slds-border_top wrapped-header-datatable"
                                key-field="id"
                                data={invoiceAllpriceData}
                                columns={detailsColumns}
                                hide-checkbox-column
                                hide-table-header
                            >
                            </lightning-datatable>
                        </div>
                    </div>
@@ -847,5 +1378,4 @@
            </div>
        </div>
    </template>
</template>
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
@@ -1,290 +1,291 @@
import { LightningElement, api, track, wire } from 'lwc';
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import init from "@salesforce/apex/LexConInvoiceViewController.init";
import save from "@salesforce/apex/LexConInvoiceViewController.save";
import saveFile from "@salesforce/apex/LexConInvoiceViewController.saveFile";
import saveAttachment from "@salesforce/apex/LexConInvoiceViewController.saveAttachment";
import InvoiceorderSearch from "@salesforce/apex/LexConInvoiceViewController.InvoiceorderSearch";
import deleteButton from "@salesforce/apex/LexConInvoiceViewController.deleteButton";
import approval from "@salesforce/apex/LexConInvoiceViewController.approval";
import conInvoiceListInit from "@salesforce/apex/LexConInvoiceList.init";
import invoiceCodeSearch from "@salesforce/apex/LexConInvoiceList.invoiceCodeSearch";
import hospitalInit from "@salesforce/apex/lexSearchAgencyHospitalController.init";
import serContact from "@salesforce/apex/lexSearchAgencyHospitalController.serContact";
import detailsInit from "@salesforce/apex/LexConInvoicedetailsController.init";
import detailsSave from "@salesforce/apex/LexConInvoicedetailsController.save";
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init from '@salesforce/apex/LexConInvoiceViewController.init';
import save from '@salesforce/apex/LexConInvoiceViewController.save';
import saveFile from '@salesforce/apex/LexConInvoiceViewController.saveFile';
import saveAttachment from '@salesforce/apex/LexConInvoiceViewController.saveAttachment';
import InvoiceorderSearch from '@salesforce/apex/LexConInvoiceViewController.InvoiceorderSearch';
import deleteButton from '@salesforce/apex/LexConInvoiceViewController.deleteButton';
import approval from '@salesforce/apex/LexConInvoiceViewController.approval';
import conInvoiceListInit from '@salesforce/apex/LexConInvoiceList.init';
import invoiceCodeSearch from '@salesforce/apex/LexConInvoiceList.invoiceCodeSearch';
import hospitalInit from '@salesforce/apex/lexSearchAgencyHospitalController.init';
import serContact from '@salesforce/apex/lexSearchAgencyHospitalController.serContact';
import detailsInit from '@salesforce/apex/LexConInvoicedetailsController.init';
import detailsSave from '@salesforce/apex/LexConInvoicedetailsController.save';
import deleteAtt from '@salesforce/apex/LexSummonsCreatController.deleteAtt';
import { NavigationMixin } from "lightning/navigation";
import { NavigationMixin } from 'lightning/navigation';
//table css 
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
import { loadStyle } from 'lightning/platformResourceLoader';
import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
import LexConInvoiceViewReport from '@salesforce/label/c.LexConInvoiceViewReport';
const hospitalColumns = [
    {
        label: "",
        fieldName: "Id1",
        type: "button",
        label: '',
        fieldName: 'Id1',
        type: 'button',
        initialWidth: 90,
        hideDefaultActions: true,
        typeAttributes: {
            label: "选择",
            name: "Id2",
            size: 1,
        },
            label: '选择',
            name: 'Id2',
            size: 1
        }
    },
    {
        label: "医院名称",
        fieldName: "Name",
        label: '医院名称',
        fieldName: 'Name',
        hideDefaultActions: true,
        wrapText: true,
        wrapText: true
    },
    {
        label: "省份",
        fieldName: "stateMasterName",
        hideDefaultActions: true,
        label: '省份',
        fieldName: 'stateMasterName',
        hideDefaultActions: true
    }
];
const invoiceDetailsColumns = [
    {
        label: "出库日期",
        fieldName: "esdetProductOutDate",
        label: '出库日期',
        fieldName: 'esdetProductOutDate',
        hideDefaultActions: true,
        wrapText: true,
        wrapText: true
    },
    {
        label: "出库单编码",
        fieldName: "esdetInvoicedet1ODlinkName",
        label: '出库单编码',
        fieldName: 'esdetInvoicedet1ODlinkName',
        wrapText: true,
        hideDefaultActions: true,
        wrapText: true,
        wrapText: true
    },
    {
        label: "产品型号",
        fieldName: "esdetAssetModelNo",
        label: '产品型号',
        fieldName: 'esdetAssetModelNo',
        hideDefaultActions: true,
        wrapText: true,
        initialWidth: 400,
        initialWidth: 400
    },
    {
        label: "单位",
        fieldName: "esdetInvoiceUnit",
        label: '单位',
        fieldName: 'esdetInvoiceUnit',
        hideDefaultActions: true,
        wrapText: true,
        initialWidth: 50,
        initialWidth: 50
    },
    {
        label: "发票单价",
        fieldName: "esdetInvoiceUnitprice",
        label: '发票单价',
        fieldName: 'esdetInvoiceUnitprice',
        hideDefaultActions: true,
        wrapText: true,
        type: "number",
        type: 'number',
        typeAttributes: {
            minimumFractionDigits: 2,
        },
            minimumFractionDigits: 2
        }
    },
    {
        label: "发票数量",
        fieldName: "esdetInvoicedCount",
        label: '发票数量',
        fieldName: 'esdetInvoicedCount',
        cellAttributes: { alignment: 'right' },
        hideDefaultActions: true,
        wrapText: true,
        wrapText: true
    },
    {
        label: "发票票面金额(元)",
        fieldName: "esdetInvoicedProCostRMB",
        label: '发票票面金额(元)',
        fieldName: 'esdetInvoicedProCostRMB',
        hideDefaultActions: true,
        wrapText: true,
        cellAttributes: { alignment: 'right' },
        initialWidth:145,
        type: "number",
        type: 'number',
        typeAttributes: {
            minimumFractionDigits: 2,
        },
    },
            minimumFractionDigits: 2
        }
    }
];
const invoiceColumns = [
    {
        label: "发票日期",
        fieldName: "Invoice_Date__c",
        label: '发票日期',
        fieldName: 'Invoice_Date__c',
        hideDefaultActions: true,
        initialWidth: 150
    },
    {
        label: "发票号",
        label: '发票号',
        type: 'url',
        fieldName: "NameUrl",
        fieldName: 'NameUrl',
        typeAttributes: {
            label: { fieldName: "Name" },
            label: { fieldName: 'Name' }
        },
        hideDefaultActions: true,
        hideDefaultActions: true
    },
    {
        label: "客户名",
        fieldName: "ShipmentAccount__c",
        label: '客户名',
        fieldName: 'ShipmentAccount__c',
        hideDefaultActions: true,
        wrapText: true,
        wrapText: true
    },
    {
        label: "发票状态",
        fieldName: "Invoice_status__c",
        label: '发票状态',
        fieldName: 'Invoice_status__c',
        hideDefaultActions: true,
        initialWidth: 100
    },
    {
        label: "发票账面金额(元)",
        fieldName: "Invoice_total_amount__c",
        label: '发票账面金额(元)',
        fieldName: 'Invoice_total_amount__c',
        hideDefaultActions: true,
        type: "number",
        type: 'number',
        typeAttributes: {
            minimumFractionDigits: 2,
            minimumFractionDigits: 2
        },
        initialWidth: 180
    },
    {
        label: "发票附件",
        fieldName: "Invoice_attachment__c",
        label: '发票附件',
        fieldName: 'Invoice_attachment__c',
        type: 'boolean',
        hideDefaultActions: true,
        initialWidth: 120
    },
    {
        label: "发票明细附件",
        fieldName: "Invoicedet_attachment__c",
        label: '发票明细附件',
        fieldName: 'Invoicedet_attachment__c',
        type: 'boolean',
        hideDefaultActions: true,
        initialWidth: 120
    },
    }
];
const detailsColumns = [
    {
        label: "产品型号",
        fieldName: "esdAssetModelNo",
        label: '产品型号',
        fieldName: 'esdAssetModelNo',
        hideDefaultActions: true,
        initialWidth: 200,
        wrapText: true,
        wrapText: true
    },
    {
        label: "规格",
        fieldName: "packingListManual",
        label: '规格',
        fieldName: 'packingListManual',
        hideDefaultActions: true,
        initialWidth: 30
    },
    {
        label: "出货单价(元)",
        fieldName: "esdDeliveryListRMB",
        label: '出货单价(元)',
        fieldName: 'esdDeliveryListRMB',
        hideDefaultActions: true,
        type: "number",
        type: 'number',
        typeAttributes: {
            minimumFractionDigits: 2,
        },
            minimumFractionDigits: 2
        }
    },
    {
        label: "出货数量",
        fieldName: "esdShipmentCount",
        hideDefaultActions: true,
        label: '出货数量',
        fieldName: 'esdShipmentCount',
        hideDefaultActions: true
    },
    {
        label: "返品数量",
        fieldName: "esdRrturnProCount",
        hideDefaultActions: true,
        label: '返品数量',
        fieldName: 'esdRrturnProCount',
        hideDefaultActions: true
    },
    {
        label: "出库单位",
        fieldName: "esdBoxPiece",
        hideDefaultActions: true,
        label: '出库单位',
        fieldName: 'esdBoxPiece',
        hideDefaultActions: true
    },
    {
        label: "已发票数量",
        fieldName: "esdInvoicedProcount",
        label: '已发票数量',
        fieldName: 'esdInvoicedProcount',
        hideDefaultActions: true,
        type: "number",
        type: 'number',
        typeAttributes: {
            minimumFractionDigits: 2,
        },
            minimumFractionDigits: 2
        }
    },
    {
        label: "还没发票数量",
        fieldName: "esdInvoiceProNotCount",
        label: '还没发票数量',
        fieldName: 'esdInvoiceProNotCount',
        hideDefaultActions: true,
        type: "number",
        type: 'number',
        typeAttributes: {
            minimumFractionDigits: 2,
        },
            minimumFractionDigits: 2
        }
    },
    {
        label: "开票单位",
        label: '开票单位',
        hideDefaultActions: true,
        type: "customUnit",
        type: 'customUnit',
        typeAttributes: {
            unitValue: { fieldName: "unitValue" },
            unitOptions: { fieldName: "unitOptions" },
            recordId: { fieldName: "recordId" },
            isDisabled: { fieldName: "isDisabled" },
        },
            unitValue: { fieldName: 'unitValue' },
            unitOptions: { fieldName: 'unitOptions' },
            recordId: { fieldName: 'recordId' },
            isDisabled: { fieldName: 'isDisabled' }
        }
    },
    {
        label: "发票单价",
        fieldName: "esdInvoiceUnitprice",
        label: '发票单价',
        fieldName: 'esdInvoiceUnitprice',
        hideDefaultActions: true,
        type: "number",
        type: 'number',
        typeAttributes: {
            minimumFractionDigits: 2,
            minimumFractionDigits: 2
        },
        initialWidth: 130
    },
    {
        label: "发票数量",
        label: '发票数量',
        //fieldName: "invoiceCount",
        hideDefaultActions: true,
        type: "customShipment",
        type: 'customShipment',
        cellAttributes: { alignment: 'right' },
        typeAttributes: {
            recordId: { fieldName: "recordId" },
            shipmentNumber: { fieldName: "shipmentNumber" },
            isConinvoice: { fieldName: "isConinvoice" },
            esdInvoiceProNotCount: { fieldName: "esdInvoiceProNotCount" },
        },
            recordId: { fieldName: 'recordId' },
            shipmentNumber: { fieldName: 'shipmentNumber' },
            isConinvoice: { fieldName: 'isConinvoice' },
            esdInvoiceProNotCount: { fieldName: 'esdInvoiceProNotCount' }
        }
    },
    {
        label: "发票票面金额(元)",
        label: '发票票面金额(元)',
        cellAttributes: { alignment: 'right' },
        fieldName: "invoiceAllprice",
        fieldName: 'invoiceAllprice',
        hideDefaultActions: true,
        type: "number",
        type: 'number',
        initialWidth: 150,
        typeAttributes: {
            minimumFractionDigits: 2,
        },
    },
]
            minimumFractionDigits: 2
        }
    }
];
const customLabel = {
    LexConInvoiceViewReport
}
export default class LexConInvoiceView extends NavigationMixin(LightningElement) {
};
export default class LexConInvoiceView extends NavigationMixin(
    LightningElement
) {
    @track label = customLabel;
    invoiceColumns = invoiceColumns;
    detailsColumns = detailsColumns;
    @track outboundColumns = [
        {
            label: "出库日期",
            fieldName: "esdOutboundDate",
            label: '出库日期',
            fieldName: 'esdOutboundDate',
            hideDefaultActions: true,
            wrapText: true,
            wrapText: true
        },
        {
            label: "出库单编码",
            fieldName: "esdNameUrl",
            label: '出库单编码',
            fieldName: 'esdNameUrl',
            type: 'url',
            typeAttributes: {
                label: { fieldName: "esdName" },
                target: "_blank",
                label: { fieldName: 'esdName' },
                target: '_blank'
            },
            hideDefaultActions: true,
            wrapText: true,
            wrapText: true
        }
    ]
    ];
    @track outboundData = [];
    @track outboundDataSumPrice = [];
    @track invoiceData = [];
@@ -301,7 +302,7 @@
    @track coc = {};
    @track EditAble = false;
    @track isChange = false;
    @track sumPrice = 0.00;
    @track sumPrice = 0.0;
    @track OrderCode = '';
    @track ExistOutbound = false;
    @track reopen = '';
@@ -313,7 +314,7 @@
    @track detailsInvoiceId = '';
    @track detailsCocId = '';
    @track detailsData = [];
    @track invoiceAllprice = 0.00;
    @track invoiceAllprice = 0.0;
    //状态
    @track invoiceStatusValue = '';
    @track invoiceStatusOptions = [];
@@ -337,9 +338,9 @@
    @track secondaryDistributor = '';
    //客户名
    @track isModalOpen = false;
    @track HospitalName = "";
    @track HospitalInfo = "";
    @track searchHospitalName = "";
    @track HospitalName = '';
    @track HospitalInfo = '';
    @track searchHospitalName = '';
    @track isDisabledHospitalName = false;
    @track agencyProType = '';
    @track accountid = '';
@@ -375,47 +376,50 @@
    //文件上传
    @track showLoadingSpinner = false;
    @track showPopSpinner = false;
    @track UploadFile = "Upload File";
    @track fileName = "";
    @track UploadFile = 'Upload File';
    @track fileName = '';
    @track fileData = [];
    @track fileColumns = [
        {
            label: "标题",
            fieldName: "url",
            type: "url",
            typeAttributes: { label: { fieldName: "Title" }, target: "_blank" },
            hideDefaultActions: true,
            label: '标题',
            fieldName: 'url',
            type: 'url',
            typeAttributes: { label: { fieldName: 'Title' }, target: '_blank' },
            hideDefaultActions: true
        },
        {
            label: "创建人",
            type: "url",
            fieldName: "CreatedByNameUrl",
            typeAttributes: { label: { fieldName: "CreatedByName" }, target: "_blank" },
            hideDefaultActions: true,
            label: '创建人',
            type: 'url',
            fieldName: 'CreatedByNameUrl',
            typeAttributes: {
                label: { fieldName: 'CreatedByName' },
                target: '_blank'
            },
            hideDefaultActions: true
        },
        {
            label: "上传日期",
            label: '上传日期',
            type: 'date',
            typeAttributes: {
                year: "numeric",
                month: "long",
                day: "2-digit",
                hour: "2-digit",
                minute: "2-digit"
                year: 'numeric',
                month: 'long',
                day: '2-digit',
                hour: '2-digit',
                minute: '2-digit'
            },
            fieldName: "CreatedDate",
            hideDefaultActions: true,
            fieldName: 'CreatedDate',
            hideDefaultActions: true
        },
        {
            label: "附件类型",
            type: "customAttachmentType",
            label: '附件类型',
            type: 'customAttachmentType',
            typeAttributes: {
                typeValue: { fieldName: "typeValue" },
                typeOptions: { fieldName: "typeOptions" },
                recordId: { fieldName: "recordId" },
                isDisabledAttachment: { fieldName: "isDisabledAttachment" },
                typeValue: { fieldName: 'typeValue' },
                typeOptions: { fieldName: 'typeOptions' },
                recordId: { fieldName: 'recordId' },
                isDisabledAttachment: { fieldName: 'isDisabledAttachment' }
            },
            hideDefaultActions: true,
            hideDefaultActions: true
        },
        {
            label: '',
@@ -428,7 +432,7 @@
            },
            initialWidth: 50,
            hideDefaultActions: true
        },
        }
    ];
    filesUploaded = [];
    fileContents;
@@ -441,19 +445,19 @@
        if (!this.stylesLoaded) {
            Promise.all([loadStyle(this, WrappedHeaderTable)])
                .then(() => {
                    console.log("Custom styles loaded");
                    console.log('Custom styles loaded');
                    this.stylesLoaded = true;
                })
                .catch((error) => {
                    console.error("Error loading custom styles");
                    console.error('Error loading custom styles');
                });
        }
    }
    //获取链接参数
    getQueryString(name) {
        console.log("getQueryString name " + name);
        let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        console.log('getQueryString name ' + name);
        let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
        let r = window.location.search.substr(1).match(reg);
        if (r != null) {
            return decodeURIComponent(r[2]);
@@ -467,121 +471,178 @@
    init() {
        this.isShowSpinner = true;
        this.deliveryId = this.getQueryString("deliveryId");
        this.deliveryId = this.deliveryId == null ? "" : this.deliveryId;
        this.invoiceId = this.getQueryString("invoiceId");
        this.invoiceId = this.invoiceId == null ? "" : this.invoiceId;
        this.orderId = this.getQueryString("orderId");
        this.orderId = this.orderId == null ? "" : this.orderId;
        this.statusEdit = this.getQueryString("KeyWords");
        this.statusEdit = this.statusEdit == null ? "" : this.statusEdit;
        this.reopen = this.getQueryString("reopen");
        this.reopen = this.reopen == null ? "" : this.reopen;
        this.isNew = this.getQueryString("isNew");
        this.isNew = this.isNew == null ? "" : this.isNew;
        console.log('this.deliveryId = ' + this.deliveryId + ' this.invoiceId = ' + this.invoiceId + ' this.statusEdit = ' + this.statusEdit);
        this.deliveryId = this.getQueryString('deliveryId');
        this.deliveryId = this.deliveryId == null ? '' : this.deliveryId;
        this.invoiceId = this.getQueryString('invoiceId');
        this.invoiceId = this.invoiceId == null ? '' : this.invoiceId;
        this.orderId = this.getQueryString('orderId');
        this.orderId = this.orderId == null ? '' : this.orderId;
        this.statusEdit = this.getQueryString('KeyWords');
        this.statusEdit = this.statusEdit == null ? '' : this.statusEdit;
        this.reopen = this.getQueryString('reopen');
        this.reopen = this.reopen == null ? '' : this.reopen;
        this.isNew = this.getQueryString('isNew');
        this.isNew = this.isNew == null ? '' : this.isNew;
        console.log(
            'this.deliveryId = ' +
                this.deliveryId +
                ' this.invoiceId = ' +
                this.invoiceId +
                ' this.statusEdit = ' +
                this.statusEdit
        );
        if (this.invoiceId != '' && this.orderId != '') {
            //进入coninvoiceDetails
            detailsInit({
                orderIdLwc: this.orderId,
                invoiceIdLwc: this.invoiceId
            }).then((r) => {
            })
                .then((r) => {
                r = JSON.parse(JSON.stringify(r));
                if (r.status == "Success") {
                    if (r.status == 'Success') {
                    this.detailsInvoiceId = r.entity.invoicecode.Id;
                    this.detailsCocId = r.entity.coc.Id;
                    this.detailsData = r.entity.consumableorderdetails1Records;
                        this.detailsData =
                            r.entity.consumableorderdetails1Records;
                    for (var i in this.detailsData) {
                        this.detailsData[i]['Id'] = this.detailsData[i].esd.Id;
                            this.detailsData[i]['Id'] =
                                this.detailsData[i].esd.Id;
                        this.detailsData[i]['esdAssetModelNo'] = this.detailsData[i].esd.Asset_Model_No__c;
                        this.detailsData[i]['packingListManual'] = this.detailsData[i].Packing_list_manual;
                        this.detailsData[i]['esdDeliveryListRMB'] = this.detailsData[i].esd.Delivery_List_RMB__c;
                        this.detailsData[i]['esdShipmentCount'] = this.detailsData[i].esd.Shipment_Count__c;
                        this.detailsData[i]['esdRrturnProCount'] = this.detailsData[i].esd.RrturnPro_count__c;
                        this.detailsData[i]['esdBoxPiece'] = this.detailsData[i].esd.Box_Piece__c;
                            this.detailsData[i]['esdAssetModelNo'] =
                                this.detailsData[i].esd.Asset_Model_No__c;
                            this.detailsData[i]['packingListManual'] =
                                this.detailsData[i].Packing_list_manual;
                            this.detailsData[i]['esdDeliveryListRMB'] =
                                this.detailsData[i].esd.Delivery_List_RMB__c;
                            this.detailsData[i]['esdShipmentCount'] =
                                this.detailsData[i].esd.Shipment_Count__c;
                            this.detailsData[i]['esdRrturnProCount'] =
                                this.detailsData[i].esd.RrturnPro_count__c;
                            this.detailsData[i]['esdBoxPiece'] =
                                this.detailsData[i].esd.Box_Piece__c;
                        this.detailsData[i]['esdInvoicedProcount'] = this.detailsData[i].esd.Invoiced_Procount__c;
                        this.detailsData[i]['esdInvoiceProNotCount'] = this.detailsData[i].esd.InvoiceProNot_count__c;
                            this.detailsData[i]['esdInvoicedProcount'] =
                                this.detailsData[i].esd.Invoiced_Procount__c;
                            this.detailsData[i]['esdInvoiceProNotCount'] =
                                this.detailsData[i].esd.InvoiceProNot_count__c;
                        //开票单位
                        //this.detailsData[i].esd.Box_Piece__c
                        //this.detailsData[i]['unitValue'] = this.detailsData[i].esd.Invoice_Unit__c;
                        this.detailsData[i]['unitValue'] = this.detailsData[i].esd.Box_Piece__c;
                        console.log('unitValue = ' + this.detailsData[i]['unitValue']);
                        this.detailsData[i]['recordId'] = this.detailsData[i].esd.Id;
                            this.detailsData[i]['unitValue'] =
                                this.detailsData[i].esd.Box_Piece__c;
                            console.log(
                                'unitValue = ' +
                                    this.detailsData[i]['unitValue']
                            );
                            this.detailsData[i]['recordId'] =
                                this.detailsData[i].esd.Id;
                        //disabled="{!IF(records.esd.Box_Piece__c =='个' || (records.esd.Box_Piece__c =='盒' && records.Packing_list_manual ==1),true,false)}"
                        //this.detailsData[i]['isDisabled'] = (this.detailsData[i].esd.Box_Piece__c == '个' || (this.detailsData[i].esd.Box_Piece__c =='盒' && this.detailsData[i].Packing_list_manual ==1)) ? true:false;
                        this.detailsData[i]['isDisabled'] = true;
                        let unitOptions = [];
                        for (var key in this.detailsData[i].Invoice_UnitOptsMap) {
                            for (var key in this.detailsData[i]
                                .Invoice_UnitOptsMap) {
                            let unitOption = {};
                            unitOption["label"] = this.detailsData[i].Invoice_UnitOptsMap[key];
                            unitOption["value"] = key;
                                unitOption['label'] =
                                    this.detailsData[i].Invoice_UnitOptsMap[
                                        key
                                    ];
                                unitOption['value'] = key;
                            unitOptions.push(unitOption);
                        }
                        this.detailsData[i]["unitOptions"] = unitOptions;
                        this.detailsData[i]['esdInvoiceUnitprice'] = this.detailsData[i].esd.Invoice_Unitprice__c;
                            this.detailsData[i]['unitOptions'] = unitOptions;
                            this.detailsData[i]['esdInvoiceUnitprice'] =
                                this.detailsData[i].esd.Invoice_Unitprice__c;
                        //发票数量
                        this.detailsData[i]['shipmentNumber'] = this.detailsData[i].invoiceCount;
                            this.detailsData[i]['shipmentNumber'] =
                                this.detailsData[i].invoiceCount;
                        this.detailsData[i]['isConinvoice'] = true;
                        this.detailsData[i]['invoiceAllprice'] = this.detailsData[i].invoiceAllprice;
                            this.detailsData[i]['invoiceAllprice'] =
                                this.detailsData[i].invoiceAllprice;
                        if (this.detailsData[i].check) {
                            this.detailsSelectedRows.push(this.detailsData[i]['Id']);
                            this.invoiceAllprice += this.detailsData[i]['invoiceAllprice'];
                                this.detailsSelectedRows.push(
                                    this.detailsData[i]['Id']
                                );
                                this.invoiceAllprice +=
                                    this.detailsData[i]['invoiceAllprice'];
                        }
                    }
                    console.log('this.detailsData = ' + JSON.stringify(this.detailsData));
                        console.log(
                            'this.detailsData = ' +
                                JSON.stringify(this.detailsData)
                        );
                    let lastInvoiceAllprice = {
                        invoiceAllprice: this.invoiceAllprice
                    }
                        };
                    this.invoiceAllpriceData.push(lastInvoiceAllprice);
                    console.log('this.invoiceAllpriceData = ' + JSON.stringify(this.invoiceAllpriceData))
                        console.log(
                            'this.invoiceAllpriceData = ' +
                                JSON.stringify(this.invoiceAllpriceData)
                        );
                    this.isShowSpinner = false;
                    this.isDetailsShow = true;
                } else {
                    this.showMyToast('初始化失败', r.msg, 'Error');
                }
            }).catch((error) => {
                })
                .catch((error) => {
                this.isShowSpinner = false;
                console.log("error = " + JSON.stringify(error));
                    console.log('error = ' + JSON.stringify(error));
            });
        } else if (this.deliveryId == '' && this.invoiceId == '' && this.isNew == '') {
        } else if (
            this.deliveryId == '' &&
            this.invoiceId == '' &&
            this.isNew == ''
        ) {
            console.log('conInvoiceListInit');
            conInvoiceListInit().then((r) => {
            conInvoiceListInit()
                .then((r) => {
                r = JSON.parse(JSON.stringify(r));
                console.log("conInvoiceListInit r = " + JSON.stringify(r));
                if (r.status == "Success") {
                    console.log('conInvoiceListInit r = ' + JSON.stringify(r));
                    if (r.status == 'Success') {
                    this.ConInvoiceListAccountId = r.entity.accountid;
                    this.ConInvoiceListUserWorkLocation = r.entity.userWorkLocation;
                        this.ConInvoiceListUserWorkLocation =
                            r.entity.userWorkLocation;
                    this.ConInvoiceListAgencyProType = r.entity.agencyProType;
                        this.ConInvoiceListAgencyProType =
                            r.entity.agencyProType;
                    //if (this.ConInvoiceListAgencyProType != 'ET')
                        this.isOpenReportDisabled = false;
                    this.invoiceData = r.entity.raesList;
                    for (var i in this.invoiceData) {
                        this.invoiceData[i]['NameUrl'] = '/lexconinvoiceview?invoiceId=' + this.invoiceData[i].Id;
                            this.invoiceData[i]['NameUrl'] =
                                '/lexconinvoiceview?invoiceId=' +
                                this.invoiceData[i].Id;
                    }
                    console.log("this.invoiceData = " + JSON.stringify(this.invoiceData));
                        console.log(
                            'this.invoiceData = ' +
                                JSON.stringify(this.invoiceData)
                        );
                    for (var key in r.entity.statusMap) {
                        let object = {};
                        object["label"] = key;
                        object["value"] = r.entity.statusMap[key];
                            object['label'] = key;
                            object['value'] = r.entity.statusMap[key];
                        this.invoiceStatusOptions.push(object);
                    }
                    this.invoiceStatusOptions = [...this.invoiceStatusOptions];
                    console.log("this.invoiceStatusOptions = " + JSON.stringify(this.invoiceStatusOptions));
                        this.invoiceStatusOptions = [
                            ...this.invoiceStatusOptions
                        ];
                        console.log(
                            'this.invoiceStatusOptions = ' +
                                JSON.stringify(this.invoiceStatusOptions)
                        );
                    this.isShowSpinner = false;
                } else {
                    this.showMyToast('初始化失败', r.msg, 'Error');
                }
            }).catch((error) => {
                console.log("error = " + JSON.stringify(error));
                })
                .catch((error) => {
                    console.log('error = ' + JSON.stringify(error));
            });
        } else {
            console.log('init');
            this.isConInvoiceList = false;
@@ -589,79 +650,164 @@
                invoiceId: this.invoiceId,
                statusEdit: this.statusEdit,
                deliveryId: this.deliveryId
            }).then((r) => {
            })
                .then((r) => {
                r = JSON.parse(JSON.stringify(r));
                console.log("r = " + JSON.stringify(r));
                if (r.status == "Success") {
                    console.log('r = ' + JSON.stringify(r));
                    if (r.status == 'Success') {
                    this.coc = r.entity.coc;
                    this.cocId = this.coc.Id;
                    this.EditAble = r.entity.EditAble;
                    this.isChange = r.entity.isChange;
                    this.ExistOutbound = r.entity.ExistOutbound;
                    this.outboundData = r.entity.invoiceOrderRecoeds;
                    console.log('this.outboundData = ' + JSON.stringify(this.outboundData))
                        console.log(
                            'this.outboundData = ' +
                                JSON.stringify(this.outboundData)
                        );
                    this.done = r.entity.done;
                    this.accountid = r.entity.accountid;
                    this.userWorkLocation = r.entity.userWorkLocation;
                    this.outOrderStringListLwc = r.entity.outOrderStringList;
                        this.outOrderStringListLwc =
                            r.entity.outOrderStringList;
                    this.outordercountMapLwc = r.entity.outordercountMap;
                    this.invoiceOrderRecoedschange = r.entity.invoiceOrderRecoedschange;
                    this.isDisabledEdit = (this.coc.Invoice_status__c == '提交' || this.coc.Invoice_status__c == '已完成') ? true : false;
                    this.isDisabledReopen = this.coc.Invoice_status__c == '提交' ? false : true;
                    this.isDisabledDelete = this.coc.Invoice_status__c == '草案中' ? false : true;
                    this.isDisabledAttachment = this.coc.Invoice_status__c == '已完成' ? true : false;
                        this.invoiceOrderRecoedschange =
                            r.entity.invoiceOrderRecoedschange;
                        this.isDisabledEdit =
                            this.coc.Invoice_status__c == '提交' ||
                            this.coc.Invoice_status__c == '已完成'
                                ? true
                                : false;
                        this.isDisabledReopen =
                            this.coc.Invoice_status__c == '提交' ? false : true;
                        this.isDisabledDelete =
                            this.coc.Invoice_status__c == '草案中'
                                ? false
                                : true;
                        this.isDisabledAttachment =
                            this.coc.Invoice_status__c == '已完成'
                                ? true
                                : false;
                    this.OrderCode = this.coc.Name;
                    this.InvoiceDate = this.coc.Invoice_Date__c;
                    for (var i in this.outboundData) {
                        this.outboundData[i].Id = this.outboundData[i].esd.Id;
                            this.outboundData[i].Id =
                                this.outboundData[i].esd.Id;
                        if (this.outboundData[i].check)
                            this.selectedRows.push(this.outboundData[i].esd.Id);
                                this.selectedRows.push(
                                    this.outboundData[i].esd.Id
                                );
                    }
                    this.selectedRows = [...this.selectedRows];
                    console.log('r.entity.attachmentRecoeds = ' + JSON.stringify(r.entity.attachmentRecoeds))
                        console.log(
                            'r.entity.attachmentRecoeds = ' +
                                JSON.stringify(r.entity.attachmentRecoeds)
                        );
                    if (!this.EditAble) {
                        //附件显示
                        this.showLoadingSpinner = true;
                        this.fileData = r.entity.attachmentRecoeds;
                        for (var i in this.fileData) {
                            this.fileData[i]["Id"] = this.fileData[i].cvInfo.Id;
                            this.fileData[i]["recordId"] = this.fileData[i].cvInfo.Id;
                            this.fileData[i]["url"] = "/" + this.fileData[i].cvInfo.Id;
                            this.fileData[i]["Title"] = this.fileData[i].cvInfo.Title;
                            this.fileData[i]["CreatedByName"] = this.fileData[i].cvInfo.Owner.Name;
                            this.fileData[i]["CreatedByNameUrl"] = "/" + this.fileData[i].cvInfo.OwnerId;;
                            this.fileData[i]["CreatedDate"] = this.fileData[i].cvInfo.CreatedDate;
                            this.fileData[i]["attUrl"] = '/' + this.fileData[i].cvInfo.Id;
                            this.fileData[i]['downloadUrl'] = '/sfc/servlet.shepherd/document/download/' + this.fileData[i].cvInfo.ContentDocumentId + '?operationContext=S1';
                                this.fileData[i]['Id'] =
                                    this.fileData[i].cvInfo.Id;
                                this.fileData[i]['recordId'] =
                                    this.fileData[i].cvInfo.Id;
                                this.fileData[i]['url'] =
                                    '/' + this.fileData[i].cvInfo.Id;
                                this.fileData[i]['Title'] =
                                    this.fileData[i].cvInfo.Title;
                                this.fileData[i]['CreatedByName'] =
                                    this.fileData[i].cvInfo.Owner.Name;
                                this.fileData[i]['CreatedByNameUrl'] =
                                    '/' + this.fileData[i].cvInfo.OwnerId;
                                this.fileData[i]['CreatedDate'] =
                                    this.fileData[i].cvInfo.CreatedDate;
                                this.fileData[i]['attUrl'] =
                                    '/' + this.fileData[i].cvInfo.Id;
                                this.fileData[i]['downloadUrl'] =
                                    '/sfc/servlet.shepherd/document/download/' +
                                    this.fileData[i].cvInfo.ContentDocumentId +
                                    '?operationContext=S1';
                            if (this.isDisabledAttachment) {
                                console.log('进入this.isDisabledAttachment')
                                this.fileData[i]["isDisabledAttachment"] = true;
                                    console.log(
                                        '进入this.isDisabledAttachment'
                                    );
                                    this.fileData[i][
                                        'isDisabledAttachment'
                                    ] = true;
                            }
                            let typeOptions = [];
                            for (var key in this.fileData[i].mailSelectOptsMap) {
                                for (var key in this.fileData[i]
                                    .mailSelectOptsMap) {
                                let typeOption = {};
                                typeOption["label"] = this.fileData[i].mailSelectOptsMap[key];
                                typeOption["value"] = key;
                                    typeOption['label'] =
                                        this.fileData[i].mailSelectOptsMap[key];
                                    typeOption['value'] = key;
                                typeOptions.push(typeOption);
                            }
                            this.fileData[i]["typeValue"] = this.fileData[i].mailSelectOptsin == null ? typeOptions[0].value : this.fileData[i].mailSelectOptsin;
                            this.fileData[i]["typeOptions"] = typeOptions;
                            this.fileData[i]["mailSelectOptsin"] = this.fileData[i].mailSelectOptsin == null ? typeOptions[0].value : this.fileData[i].mailSelectOptsin;
                                this.fileData[i]['typeValue'] =
                                    this.fileData[i].mailSelectOptsin == null
                                        ? typeOptions[0].value
                                        : this.fileData[i].mailSelectOptsin;
                                this.fileData[i]['typeOptions'] = typeOptions;
                                this.fileData[i]['mailSelectOptsin'] =
                                    this.fileData[i].mailSelectOptsin == null
                                        ? typeOptions[0].value
                                        : this.fileData[i].mailSelectOptsin;
                        }
                        console.log('this.fileData = ' + JSON.stringify(this.fileData))
                            console.log(
                                'this.fileData = ' +
                                    JSON.stringify(this.fileData)
                            );
                    }
                    //发票明细
                    this.invoiceOrderdetail1Recoeds = r.entity.invoiceOrderdetail1Recoeds;
                        this.invoiceOrderdetail1Recoeds =
                            r.entity.invoiceOrderdetail1Recoeds;
                    for (var i in this.invoiceOrderdetail1Recoeds) {
                        this.invoiceOrderdetail1Recoeds[i]['esdetProductOutDate'] = this.invoiceOrderdetail1Recoeds[i].esdet.Product_OutDate__c;
                        this.invoiceOrderdetail1Recoeds[i]['esdetInvoicedet1ODlinkName'] = this.invoiceOrderdetail1Recoeds[i].esdet.Invoicedet1_OD_link__r.Name;
                        this.invoiceOrderdetail1Recoeds[i]['esdetAssetModelNo'] = this.invoiceOrderdetail1Recoeds[i].esdet.Asset_Model_No__c;
                        this.invoiceOrderdetail1Recoeds[i]['esdetInvoiceUnit'] = this.invoiceOrderdetail1Recoeds[i].esdet.Invoice_Unit__c;
                        this.invoiceOrderdetail1Recoeds[i]['esdetInvoiceUnitprice'] = this.invoiceOrderdetail1Recoeds[i].esdet.Invoice_Unitprice__c;
                        this.invoiceOrderdetail1Recoeds[i]['esdetInvoicedCount'] = this.invoiceOrderdetail1Recoeds[i].esdet.Invoiced_Count__c;
                        this.invoiceOrderdetail1Recoeds[i]['esdetInvoicedProCostRMB'] = this.invoiceOrderdetail1Recoeds[i].esdet.InvoicedProCost_RMB__c;
                            this.invoiceOrderdetail1Recoeds[i][
                                'esdetProductOutDate'
                            ] =
                                this.invoiceOrderdetail1Recoeds[
                                    i
                                ].esdet.Product_OutDate__c;
                            this.invoiceOrderdetail1Recoeds[i][
                                'esdetInvoicedet1ODlinkName'
                            ] =
                                this.invoiceOrderdetail1Recoeds[
                                    i
                                ].esdet.Invoicedet1_OD_link__r.Name;
                            this.invoiceOrderdetail1Recoeds[i][
                                'esdetAssetModelNo'
                            ] =
                                this.invoiceOrderdetail1Recoeds[
                                    i
                                ].esdet.Asset_Model_No__c;
                            this.invoiceOrderdetail1Recoeds[i][
                                'esdetInvoiceUnit'
                            ] =
                                this.invoiceOrderdetail1Recoeds[
                                    i
                                ].esdet.Invoice_Unit__c;
                            this.invoiceOrderdetail1Recoeds[i][
                                'esdetInvoiceUnitprice'
                            ] =
                                this.invoiceOrderdetail1Recoeds[
                                    i
                                ].esdet.Invoice_Unitprice__c;
                            this.invoiceOrderdetail1Recoeds[i][
                                'esdetInvoicedCount'
                            ] =
                                this.invoiceOrderdetail1Recoeds[
                                    i
                                ].esdet.Invoiced_Count__c;
                            this.invoiceOrderdetail1Recoeds[i][
                                'esdetInvoicedProCostRMB'
                            ] =
                                this.invoiceOrderdetail1Recoeds[
                                    i
                                ].esdet.InvoicedProCost_RMB__c;
                    }
                    //客户名
                    this.HospitalName = r.entity.HospitalName;
@@ -670,145 +816,179 @@
                    //if (this.agencyProType != 'ET')
                        this.isOpenReportDisabled = false;
                    //科室
                    this.ForCustomerText = this.coc.Order_ForCustomerText__c;
                        this.ForCustomerText =
                            this.coc.Order_ForCustomerText__c;
                    //备注
                    this.InvoiceNote = this.coc.Invoice_Note__c;
                    //二级经销商
                    for (var key in r.entity.provinceOptsMap) {
                        let object = {};
                        object["label"] = r.entity.provinceOptsMap[key];
                        object["value"] = key;
                            object['label'] = r.entity.provinceOptsMap[key];
                            object['value'] = key;
                        this.provinceOptsMap.push(object);
                    }
                    //出货一览columns
                    if (this.EditAble) {
                        let object1 = {
                            label: '客户名',
                            fieldName: "hospitalName",
                                fieldName: 'hospitalName',
                            hideDefaultActions: true,
                            wrapText: true,
                                wrapText: true
                        };
                        let object2 = {
                            label: '出货金额(元)',
                            fieldName: "shipmentAmount",
                            type: "number",
                                fieldName: 'shipmentAmount',
                                type: 'number',
                            typeAttributes: {
                                minimumFractionDigits: 2,
                                    minimumFractionDigits: 2
                            },
                            hideDefaultActions: true,
                                hideDefaultActions: true
                        };
                        let object3 = {
                            label: '返品金额(元)',
                            fieldName: "returnAmount",
                            type: "number",
                                fieldName: 'returnAmount',
                                type: 'number',
                            typeAttributes: {
                                minimumFractionDigits: 2,
                                    minimumFractionDigits: 2
                            },
                            hideDefaultActions: true,
                                hideDefaultActions: true
                        };
                        this.outboundColumns.push(object1)
                        this.outboundColumns.push(object2)
                        this.outboundColumns.push(object3)
                            this.outboundColumns.push(object1);
                            this.outboundColumns.push(object2);
                            this.outboundColumns.push(object3);
                    }
                    let object4 = {
                        label: '未发票金额(元)',
                        fieldName: "uninvoicedAmount",
                        type: "number",
                            fieldName: 'uninvoicedAmount',
                            type: 'number',
                        typeAttributes: {
                            minimumFractionDigits: 2,
                                minimumFractionDigits: 2
                        },
                        hideDefaultActions: true,
                            hideDefaultActions: true
                    };
                    this.outboundColumns.push(object4)
                        this.outboundColumns.push(object4);
                    //出货一览Data
                    let index = 0;
                    for (var i in this.outboundData) {
                        this.outboundData[i]['esdOutboundDate'] = this.outboundData[i].esd.Outbound_Date__c;
                        this.outboundData[i]['esdNameUrl'] = '/s/lexsummonscreat?ESetid=' + this.outboundData[i].esd.Id;
                        this.outboundData[i]['esdName'] = this.outboundData[i].esd.Name;
                            this.outboundData[i]['esdOutboundDate'] =
                                this.outboundData[i].esd.Outbound_Date__c;
                            this.outboundData[i]['esdNameUrl'] =
                                '/s/lexsummonscreat?ESetid=' +
                                this.outboundData[i].esd.Id;
                            this.outboundData[i]['esdName'] =
                                this.outboundData[i].esd.Name;
                        if (this.EditAble) {
                            this.outboundData[i]['hospitalName'] = this.outboundData[i].esd.ShipmentAccount__c;
                            this.outboundData[i]['shipmentAmount'] = this.outboundData[i].esd.Shipment_total_amount__c;
                            this.outboundData[i]['returnAmount'] = this.outboundData[i].esd.RrturnPro_total_amount__c;
                                this.outboundData[i]['hospitalName'] =
                                    this.outboundData[i].esd.ShipmentAccount__c;
                                this.outboundData[i]['shipmentAmount'] =
                                    this.outboundData[
                                        i
                                    ].esd.Shipment_total_amount__c;
                                this.outboundData[i]['returnAmount'] =
                                    this.outboundData[
                                        i
                                    ].esd.RrturnPro_total_amount__c;
                        }
                        this.outboundData[i]['uninvoicedAmount'] = this.outboundData[i].esd.InvoiceNotPro_money__c;
                        this.outboundData[i]['invoiceFaceAmount'] = this.keepTwoDecimalStr(this.outboundData[i].needInvoiceCount);
                        if (!(this.outboundData[i].esd.Billed_Status__c == '全部开票' || this.EditAble || this.coc.Invoice_status__c != '草案中')) {
                            console.log('进入 if')
                            let url = "/lexconinvoiceview?orderId=" + this.outboundData[i].esd.Id + "&invoiceId=" + this.invoiceId;
                            this.outboundData[i]['invoiceFaceAmountUrl'] = url;
                            this.outboundData[i]['uninvoicedAmount'] =
                                this.outboundData[i].esd.InvoiceNotPro_money__c;
                            this.outboundData[i]['invoiceFaceAmount'] =
                                this.keepTwoDecimalStr(
                                    this.outboundData[i].needInvoiceCount
                                );
                            if (
                                !(
                                    this.outboundData[i].esd.Billed_Status__c ==
                                        '全部开票' ||
                                    this.EditAble ||
                                    this.coc.Invoice_status__c != '草案中'
                                )
                            ) {
                                console.log('进入 if');
                                let url =
                                    '/lexconinvoiceview?orderId=' +
                                    this.outboundData[i].esd.Id +
                                    '&invoiceId=' +
                                    this.invoiceId;
                                this.outboundData[i]['invoiceFaceAmountUrl'] =
                                    url;
                            if (index == 0) {
                                let object5 = {
                                    label: '发票票面金额(元)',
                                    cellAttributes: { alignment: 'right' },
                                    type: 'url',
                                    fieldName: "invoiceFaceAmountUrl",
                                        fieldName: 'invoiceFaceAmountUrl',
                                    typeAttributes: {
                                        label: { fieldName: "invoiceFaceAmount" },
                                            label: {
                                                fieldName: 'invoiceFaceAmount'
                                            }
                                        //target: "_blank",
                                    },
                                    hideDefaultActions: true,
                                        hideDefaultActions: true
                                };
                                this.outboundColumns.push(object5)
                                    this.outboundColumns.push(object5);
                                index++;
                            }
                        } else {
                            console.log('进入 else')
                                console.log('进入 else');
                            if (index == 0) {
                                let object5 = {
                                    label: '发票票面金额(元)',
                                    cellAttributes: { alignment: 'right' },
                                    fieldName: "invoiceFaceAmount",
                                        fieldName: 'invoiceFaceAmount',
                                    hideDefaultActions: true,
                                    type: "number",
                                        type: 'number',
                                    typeAttributes: {
                                        minimumFractionDigits: 2,
                                    },
                                            minimumFractionDigits: 2
                                        }
                                };
                                this.outboundColumns.push(object5)
                                    this.outboundColumns.push(object5);
                                index++;
                            }
                        }
                        //计算发票票面金额
                        this.sumPrice += this.outboundData[i].needInvoiceCount;
                            this.sumPrice +=
                                this.outboundData[i].needInvoiceCount;
                    }
                    //四舍五入
                    //this.sumPrice = this.sumPrice.toFixed(2);
                    //如果不四舍五入
                    console.log('start keepTwoDecimalStr')
                        console.log('start keepTwoDecimalStr');
                    this.sumPrice = this.keepTwoDecimalStr(this.sumPrice);
                    console.log('end keepTwoDecimalStr = ' + this.sumPrice)
                        console.log('end keepTwoDecimalStr = ' + this.sumPrice);
                    //加最后一行显示金额
                    if (this.EditAble) {
                        let lastOutboundData = {
                            invoiceFaceAmount: this.sumPrice
                        }
                            };
                        this.outboundDataSumPrice.push(lastOutboundData);
                    }
                    this.outboundColumns = [...this.outboundColumns];
                    this.isEditInvoice = !(!this.EditAble || this.isChange);
                    if (this.coc.SummonsForDirction__c == '销售给二级经销商')
                        if (
                            this.coc.SummonsForDirction__c == '销售给二级经销商'
                        )
                        this.isShowSecondaryDistributor = true;
                    if (this.deliveryId == '' && !this.ExistOutbound && this.EditAble)
                        if (
                            this.deliveryId == '' &&
                            !this.ExistOutbound &&
                            this.EditAble
                        )
                        this.hideCheckbox = false;
                    this.isShowSpinner = false;
                    this.showLoadingSpinner = false;
                } else {
                    this.showMyToast('失败', r.msg, 'Error');
                }
            }).catch((error) => {
                console.log("error = " + JSON.stringify(error));
                })
                .catch((error) => {
                    console.log('error = ' + JSON.stringify(error));
            });
        }
    }
    //上传配置单
    uploadOrder(event) {
@@ -839,7 +1019,11 @@
    //是否显示附件移除
    get attDelBtn() {
        if (this.fileName != '' && this.fileName != null && this.fileName != '选择一个文件上传') {
        if (
            this.fileName != '' &&
            this.fileName != null &&
            this.fileName != '选择一个文件上传'
        ) {
            return true;
        } else {
            return false;
@@ -858,47 +1042,47 @@
            s += '0';
        }
        return s;
    };
    }
    dataChange(event) {
        let fieldName = event.target.getAttribute("data-field");
        let fieldName = event.target.getAttribute('data-field');
        let value = event.detail.value;
        console.log("fieldName = " + fieldName + " value = " + value);
        console.log('fieldName = ' + fieldName + ' value = ' + value);
        switch (fieldName) {
            case "OrderCode":
            case 'OrderCode':
                this.OrderCode = value;
                this.coc['Name'] = value;
                break;
            case "ForCustomerText":
            case 'ForCustomerText':
                this.ForCustomerText = value;
                this.coc['Order_ForCustomerText__c'] = value;
                break;
            case "InvoiceDate":
            case 'InvoiceDate':
                this.InvoiceDate = value;
                this.coc['Invoice_Date__c'] = value;
                break;
            case "secondaryDistributor":
            case 'secondaryDistributor':
                this.secondaryDistributor = value;
                break;
            case "deliveryFromDate":
            case 'deliveryFromDate':
                this.deliveryFromDate = value;
                break;
            case "deliveryToDate":
            case 'deliveryToDate':
                this.deliveryToDate = value;
                break;
            case "category1":
            case 'category1':
                this.category1 = value;
                break;
            case "category2":
            case 'category2':
                this.category2 = value;
                break;
            case "invoiceStatus":
            case 'invoiceStatus':
                this.invoiceStatusValue = value;
                break;
            case "searchHospitalName":
            case 'searchHospitalName':
                this.searchHospitalName = value;
                break;
            case "InvoiceNote":
            case 'InvoiceNote':
                this.InvoiceNote = value;
                this.coc['Invoice_Note__c'] = value;
                break;
@@ -913,58 +1097,68 @@
    //搜索客户名
    searchHospitalNameModal() {
        console.log("searchHospitalNameModal");
        console.log('searchHospitalNameModal');
        hospitalInit({
            ctype: this.agencyProType,
            ctype: this.agencyProType
        }).then((r) => {
            r = JSON.parse(JSON.stringify(r));
            if (r.status == "Success") {
            if (r.status == 'Success') {
                this.hospitalList = r.entity.at;
                for (var i in this.hospitalList) {
                    this.hospitalList[i]["stateMasterName"] = this.hospitalList[i].State_Master__r.Name;
                    this.hospitalList[i]['stateMasterName'] =
                        this.hospitalList[i].State_Master__r.Name;
                }
                console.log("hospitalInit r = " + JSON.stringify(this.hospitalList));
                console.log(
                    'hospitalInit r = ' + JSON.stringify(this.hospitalList)
                );
                this.isModalOpen = true;
            }
        });
    }
    searchHospital() {
        console.log("this.searchHospitalName = " + this.searchHospitalName);
        console.log('this.searchHospitalName = ' + this.searchHospitalName);
        serContact({
            searchName: this.searchHospitalName,
            ctype: this.agencyProType,
            ctype: this.agencyProType
        }).then((r) => {
            r = JSON.parse(JSON.stringify(r));
            if (r.status == "Success") {
            if (r.status == 'Success') {
                this.hospitalList = r.entity.at;
                for (var i in this.hospitalList) {
                    this.hospitalList[i]["stateMasterName"] =
                    this.hospitalList[i]['stateMasterName'] =
                        this.hospitalList[i].State_Master__r.Name;
                }
                console.log("hospitalInit r = " + JSON.stringify(this.hospitalList));
                console.log(
                    'hospitalInit r = ' + JSON.stringify(this.hospitalList)
                );
            }
        });
    }
    //选择客户名
    searchHandleRowAction(event) {
        console.log("searchHandleRowAction");
        console.log('searchHandleRowAction');
        let row = event.detail.row;
        this.HospitalInfo = row.Id;
        this.HospitalName = row.Name;
        console.log("this.HospitalInfo = " + this.HospitalInfo + " this.HospitalName = " + this.HospitalName);
        console.log(
            'this.HospitalInfo = ' +
                this.HospitalInfo +
                ' this.HospitalName = ' +
                this.HospitalName
        );
        this.isModalOpen = false;
    }
    //当客户名是空时。客户id也变为空
    clearAgencyI(event) {
        this.HospitalName = event.target.value;
        if (this.HospitalName == "" || this.HospitalName == null) {
            this.HospitalInfo = "";
        if (this.HospitalName == '' || this.HospitalName == null) {
            this.HospitalInfo = '';
        }
        console.log("this.HospitalName = " + this.HospitalName);
        console.log("this.HospitalInfo = " + this.HospitalInfo);
        console.log('this.HospitalName = ' + this.HospitalName);
        console.log('this.HospitalInfo = ' + this.HospitalInfo);
    }
    closeModal() {
@@ -973,10 +1167,12 @@
    SaveJs() {
        this.isShowSpinner = true;
        let cloneData = this.outboundData
        let cloneData = this.outboundData;
        debugger
        const selectedRows = this.template.querySelector("[data-field='outbound']").getSelectedRows();
        debugger;
        const selectedRows = this.template
            .querySelector("[data-field='outbound']")
            .getSelectedRows();
        console.log('selectedRows = ' + JSON.stringify(selectedRows));
        for (var i in cloneData) {
@@ -1011,7 +1207,10 @@
        console.log('this.accountid = ' + this.accountid);
        console.log('this.agencyProType = ' + this.agencyProType);
        console.log('this.reopen = ' + this.reopen);
        console.log('this.invoiceOrderRecoedschangeLwc = ' + JSON.stringify(this.invoiceOrderRecoedschange));
        console.log(
            'this.invoiceOrderRecoedschangeLwc = ' +
                JSON.stringify(this.invoiceOrderRecoedschange)
        );
        save({
            cocLwc: this.coc,
            HospitalNameLwc: this.HospitalName,
@@ -1023,32 +1222,37 @@
            accountidLwc: this.accountid,
            agencyProTypeLwc: this.agencyProType,
            reopenLwc: this.reopen,
            invoiceOrderRecoedschangeLwc: JSON.stringify(this.invoiceOrderRecoedschange)
        }).then((r) => {
            invoiceOrderRecoedschangeLwc: JSON.stringify(
                this.invoiceOrderRecoedschange
            )
        })
            .then((r) => {
            r = JSON.parse(JSON.stringify(r));
            console.log("r = " + JSON.stringify(r));
            if (r.status == "Success" && r.msg == '') {
                console.log('r = ' + JSON.stringify(r));
                if (r.status == 'Success' && r.msg == '') {
                this.isShowSpinner = false;
                console.log('save success');
                let url = "/lexconinvoiceview?invoiceId=" + r.entity.invoiceId;
                    let url =
                        '/lexconinvoiceview?invoiceId=' + r.entity.invoiceId;
                console.log('url = ' + url);
                this[NavigationMixin.Navigate]({
                    type: "standard__webPage",
                        type: 'standard__webPage',
                    attributes: {
                        url: url,
                    },
                            url: url
                        }
                });
            } else {
                this.showMyToast('保存失败', r.msg, 'Error');
            }
        }).catch((error) => {
            console.log("error = " + JSON.stringify(error));
            })
            .catch((error) => {
                console.log('error = ' + JSON.stringify(error));
        });
    }
    //上传附件,直接就保存好,然后展示
    handleFilesChange(event) {
        console.log("handleFilesChange");
        console.log('handleFilesChange');
        this.handleSave();
        // if (event.target.files.length > 0) {
            //     this.filesUploaded = event.target.files;
@@ -1058,7 +1262,7 @@
        }
        
        handleSave() {
        console.log("saveFile");
        console.log('saveFile');
        if (this.filesUploaded.length > 0) {
            this.showPopSpinner = true;
            this.file = this.filesUploaded[0];
@@ -1070,29 +1274,31 @@
            this.fileReader.onloadend = () => {
                this.fileContents = this.fileReader.result;
                let base64 = "base64,";
                this.content = this.fileContents.indexOf(base64) + base64.length;
                let base64 = 'base64,';
                this.content =
                    this.fileContents.indexOf(base64) + base64.length;
                this.fileContents = this.fileContents.substring(this.content);
                this.saveToFile();
            };
            this.fileReader.readAsDataURL(this.file);
        } else {
            this.fileName = "选择一个文件上传";
            this.fileName = '选择一个文件上传';
        }
    }
    saveToFile() {
        console.log("saveToFile");
        console.log("invoiceId = " + this.invoiceId);
        console.log("fileName = " + this.fileName);
        console.log("base64Data = " + encodeURIComponent(this.fileContents));
        console.log('saveToFile');
        console.log('invoiceId = ' + this.invoiceId);
        console.log('fileName = ' + this.fileName);
        console.log('base64Data = ' + encodeURIComponent(this.fileContents));
        saveFile({
            recordId: this.invoiceId,
            fileName: this.fileName,
            base64Data: encodeURIComponent(this.fileContents),
        }).then((r) => {
            base64Data: encodeURIComponent(this.fileContents)
        })
            .then((r) => {
            r = JSON.parse(JSON.stringify(r));
            console.log("r = " + JSON.stringify(r));
                console.log('r = ' + JSON.stringify(r));
            if (r != '') {
                this.showPopSpinner = false;
                this.showMyToast('上传成功', '', 'Success');
@@ -1101,41 +1307,41 @@
            } else {
                this.showMyToast('上传失败', r.msg, 'Error');
            }
        }).catch((error) => {
            console.log("error = " + error.message);
            })
            .catch((error) => {
                console.log('error = ' + error.message);
            this.showMyToast('错误', '上传失败', 'Error');
        });
    }
    handleTypeChange(event) {
        console.log("handleTypeChange");
        console.log('handleTypeChange');
        const typeDetail = event.detail;
        console.log("typeDetail = " + JSON.stringify(typeDetail));
        console.log('typeDetail = ' + JSON.stringify(typeDetail));
        for (var i in this.fileData) {
            if (this.fileData[i].recordId == typeDetail.data.recordId) {
                this.fileData[i].typeValue = typeDetail.data.typeValue;
                this.fileData[i].mailSelectOptsin = typeDetail.data.typeValue;
            }
        }
        console.log("this.fileData = " + JSON.stringify(this.fileData));
        console.log('this.fileData = ' + JSON.stringify(this.fileData));
    }
    newInvoiceJs() {
        let url = "/lexconinvoiceview?isNew=yes";
        let url = '/lexconinvoiceview?isNew=yes';
        console.log('url = ' + url);
        this[NavigationMixin.Navigate]({
            type: "standard__webPage",
            type: 'standard__webPage',
            attributes: {
                url: url,
            },
                url: url
            }
        });
    }
    saveAttachmentJs() {
        debugger
        debugger;
        this.showLoadingSpinner = true;
        let cloneData = this.deepClone(this.fileData)
        let cloneData = this.deepClone(this.fileData);
        for (var i in cloneData) {
            delete cloneData[i].Id;
            delete cloneData[i].recordId;
@@ -1152,10 +1358,11 @@
        saveAttachment({
            attachmentRecoedsLwc: JSON.stringify(cloneData),
            invoiceId: this.invoiceId
        }).then((r) => {
        })
            .then((r) => {
            r = JSON.parse(JSON.stringify(r));
            console.log("r = " + JSON.stringify(r));
            if (r.status == "Success") {
                console.log('r = ' + JSON.stringify(r));
                if (r.status == 'Success') {
                this.showLoadingSpinner = false;
                this.isShowSpinner = true;
                // const event = new ShowToastEvent({
@@ -1181,8 +1388,9 @@
            } else {
                this.showMyToast('上传失败', r.msg, 'Error');
            }
        }).catch((error) => {
            console.log("error = " + error.message);
            })
            .catch((error) => {
                console.log('error = ' + error.message);
            this.showMyToast('错误', '上传失败', 'Error');
        });
    }
@@ -1190,34 +1398,54 @@
    invoiceCodeSearchJs() {
        this.isShowSpinner = true;
        invoiceCodeSearch({
            orderDateLwc: this.deliveryFromDate == null ? null : new Date(this.deliveryFromDate),
            deliverDateLwc: this.deliveryToDate == null ? null : new Date(this.deliveryToDate),
            orderDateLwc:
                this.deliveryFromDate == null
                    ? null
                    : new Date(this.deliveryFromDate),
            deliverDateLwc:
                this.deliveryToDate == null
                    ? null
                    : new Date(this.deliveryToDate),
            invoiceStatusLwc: this.invoiceStatusValue,
            category1Lwc: this.category1,
            category2Lwc: this.category2,
            accountidLwc: this.ConInvoiceListAccountId,
            userWorkLocationLwc: this.ConInvoiceListUserWorkLocation,
            agencyProTypeLwc: this.ConInvoiceListAgencyProType,
        }).then((r) => {
            agencyProTypeLwc: this.ConInvoiceListAgencyProType
        })
            .then((r) => {
            r = JSON.parse(JSON.stringify(r));
            console.log("r = " + JSON.stringify(r));
            if (r.status == "Success") {
                console.log('r = ' + JSON.stringify(r));
                if (r.status == 'Success') {
                this.invoiceData = r.entity.raesList;
                for (var i in this.invoiceData) {
                    this.invoiceData[i]['NameUrl'] = '/lexconinvoiceview?invoiceId=' + this.invoiceData[i].Id;
                        this.invoiceData[i]['NameUrl'] =
                            '/lexconinvoiceview?invoiceId=' +
                            this.invoiceData[i].Id;
                }
                console.log("this.invoiceData = " + JSON.stringify(this.invoiceData));
                    console.log(
                        'this.invoiceData = ' + JSON.stringify(this.invoiceData)
                    );
                this.isShowSpinner = false;
                if (r.entity.raesListSize > 0) {
                    this.showMyToast('搜索成功', '共检索到' + r.entity.raesListSize + '个发票', 'Success');
                        this.showMyToast(
                            '搜索成功',
                            '共检索到' + r.entity.raesListSize + '个发票',
                            'Success'
                        );
                } else {
                    this.showMyToast('搜索失败', '没有搜索到相关发票', 'Error');
                        this.showMyToast(
                            '搜索失败',
                            '没有搜索到相关发票',
                            'Error'
                        );
                }
            } else {
                this.showMyToast('搜索失败', r.msg, 'Error');
            }
        }).catch((error) => {
            console.log("error = " + error.message);
            })
            .catch((error) => {
                console.log('error = ' + error.message);
            this.showMyToast('错误', '搜索失败', 'Error');
        });
    }
@@ -1229,30 +1457,38 @@
        this.category2 = '';
        this.invoiceStatusValue = '';
        this.isShowSpinner = true;
        conInvoiceListInit().then((r) => {
        conInvoiceListInit()
            .then((r) => {
            r = JSON.parse(JSON.stringify(r));
            console.log("conInvoiceListInit r = " + JSON.stringify(r));
            if (r.status == "Success") {
                console.log('conInvoiceListInit r = ' + JSON.stringify(r));
                if (r.status == 'Success') {
                this.invoiceData = r.entity.raesList;
                for (var i in this.invoiceData) {
                    this.invoiceData[i]['NameUrl'] = '/lexconinvoiceview?invoiceId=' + this.invoiceData[i].Id;
                        this.invoiceData[i]['NameUrl'] =
                            '/lexconinvoiceview?invoiceId=' +
                            this.invoiceData[i].Id;
                }
                console.log("this.invoiceData = " + JSON.stringify(this.invoiceData));
                    console.log(
                        'this.invoiceData = ' + JSON.stringify(this.invoiceData)
                    );
                this.isShowSpinner = false;
            } else {
                this.showMyToast('搜索失败', r.msg, 'Error');
            }
        }).catch((error) => {
            console.log("error = " + JSON.stringify(error));
            })
            .catch((error) => {
                console.log('error = ' + JSON.stringify(error));
        });
    }
    InvoiceorderSearchJs() {
        this.isShowSpinner = true;
        debugger
        let cloneData = this.outboundData
        const selectedRows = this.template.querySelector("[data-field='outbound']").getSelectedRows();
        debugger;
        let cloneData = this.outboundData;
        const selectedRows = this.template
            .querySelector("[data-field='outbound']")
            .getSelectedRows();
        console.log('selectedRows ' + JSON.stringify(selectedRows));
        for (var i in cloneData) {
            let b = false;
@@ -1293,33 +1529,60 @@
            agencyProTypeLwc: this.agencyProType,
            HospitalInfoLwc: this.HospitalInfo,
            SecondDealerLwc: this.secondaryDistributor,
            invoiceOrderRecoedsLwc: JSON.stringify(cloneData),
        }).then((r) => {
            invoiceOrderRecoedsLwc: JSON.stringify(cloneData)
        })
            .then((r) => {
            r = JSON.parse(JSON.stringify(r));
            console.log("r = " + JSON.stringify(r));
            if (r.status == "Success") {
                console.log('r = ' + JSON.stringify(r));
                if (r.status == 'Success') {
                this.outboundData = r.entity.invoiceOrderRecoeds;
                console.log('this.outboundData = ' + JSON.stringify(this.outboundData));
                    console.log(
                        'this.outboundData = ' +
                            JSON.stringify(this.outboundData)
                    );
                let index = 0;
                this.selectedRows = [];
                for (var i in this.outboundData) {
                    if (this.outboundData[i].check)
                        this.selectedRows.push(this.outboundData[i].esd.Id)
                            this.selectedRows.push(this.outboundData[i].esd.Id);
                    this.outboundData[i].Id = this.outboundData[i].esd.Id;
                    this.outboundData[i]['esdOutboundDate'] = this.outboundData[i].esd.Outbound_Date__c;
                    this.outboundData[i]['esdNameUrl'] = '/s/lexsummonscreat?ESetid=' + this.outboundData[i].esd.Id;
                    this.outboundData[i]['esdName'] = this.outboundData[i].esd.Name;
                        this.outboundData[i]['esdOutboundDate'] =
                            this.outboundData[i].esd.Outbound_Date__c;
                        this.outboundData[i]['esdNameUrl'] =
                            '/s/lexsummonscreat?ESetid=' +
                            this.outboundData[i].esd.Id;
                        this.outboundData[i]['esdName'] =
                            this.outboundData[i].esd.Name;
                    if (this.EditAble) {
                        this.outboundData[i]['hospitalName'] = this.outboundData[i].esd.ShipmentAccount__c;
                        this.outboundData[i]['shipmentAmount'] = this.outboundData[i].esd.Shipment_total_amount__c;
                        this.outboundData[i]['returnAmount'] = this.outboundData[i].esd.RrturnPro_total_amount__c;
                            this.outboundData[i]['hospitalName'] =
                                this.outboundData[i].esd.ShipmentAccount__c;
                            this.outboundData[i]['shipmentAmount'] =
                                this.outboundData[
                                    i
                                ].esd.Shipment_total_amount__c;
                            this.outboundData[i]['returnAmount'] =
                                this.outboundData[
                                    i
                                ].esd.RrturnPro_total_amount__c;
                    }
                    this.outboundData[i]['uninvoicedAmount'] = this.outboundData[i].esd.InvoiceNotPro_money__c;
                    this.outboundData[i]['invoiceFaceAmount'] = this.outboundData[i].needInvoiceCount;
                    if (!(this.outboundData[i].esd.Billed_Status__c == '全部开票' || this.EditAble || this.coc.Invoice_status__c != '草案中')) {
                        this.outboundData[i]['uninvoicedAmount'] =
                            this.outboundData[i].esd.InvoiceNotPro_money__c;
                        this.outboundData[i]['invoiceFaceAmount'] =
                            this.outboundData[i].needInvoiceCount;
                        if (
                            !(
                                this.outboundData[i].esd.Billed_Status__c ==
                                    '全部开票' ||
                                this.EditAble ||
                                this.coc.Invoice_status__c != '草案中'
                            )
                        ) {
                        //let url = "/ConInvoicedetails?orderId=" + this.outboundData[i].esd.Id + "&invoiceId=" + this.invoiceId;
                        let url = "/s/lexconinvoiceview?orderId=" + this.outboundData[i].esd.Id + "&invoiceId=" + this.invoiceId;
                            let url =
                                '/s/lexconinvoiceview?orderId=' +
                                this.outboundData[i].esd.Id +
                                '&invoiceId=' +
                                this.invoiceId;
                        this.outboundData[i]['invoiceFaceAmountUrl'] = url;
                        if (index == 0) {
@@ -1327,14 +1590,16 @@
                                label: '发票票面金额(元)',
                                cellAttributes: { alignment: 'right' },
                                type: 'url',
                                fieldName: "invoiceFaceAmountUrl",
                                    fieldName: 'invoiceFaceAmountUrl',
                                typeAttributes: {
                                    label: { fieldName: "invoiceFaceAmount" },
                                    target: "_blank",
                                        label: {
                                            fieldName: 'invoiceFaceAmount'
                                },
                                hideDefaultActions: true,
                                        target: '_blank'
                                    },
                                    hideDefaultActions: true
                            };
                            this.outboundColumns.push(object5)
                                this.outboundColumns.push(object5);
                            index++;
                        }
                    } else {
@@ -1342,23 +1607,27 @@
                            let object5 = {
                                label: '发票票面金额(元)',
                                cellAttributes: { alignment: 'right' },
                                fieldName: "invoiceFaceAmount",
                                hideDefaultActions: true,
                                    fieldName: 'invoiceFaceAmount',
                                    hideDefaultActions: true
                            };
                            this.outboundColumns.push(object5)
                                this.outboundColumns.push(object5);
                            index++;
                        }
                    }
                    //计算发票票面金额
                    this.sumPrice += this.outboundData[i].needInvoiceCount;
                }
                console.log('this.selectedRows = ' + JSON.stringify(this.selectedRows))
                    console.log(
                        'this.selectedRows = ' +
                            JSON.stringify(this.selectedRows)
                    );
                this.isShowSpinner = false;
            } else {
                this.showMyToast('搜索失败', r.msg, 'Error');
            }
        }).catch((error) => {
            console.log("error = " + error.message);
            })
            .catch((error) => {
                console.log('error = ' + error.message);
            this.showMyToast('错误', '搜索失败', 'Error');
        });
    }
@@ -1384,37 +1653,43 @@
        this.isShowSpinner = true;
        deleteButton({
            cocLwc: this.coc,
            invoiceIdLwc: this.invoiceId,
        }).then((r) => {
            invoiceIdLwc: this.invoiceId
        })
            .then((r) => {
            r = JSON.parse(JSON.stringify(r));
            console.log("r = " + JSON.stringify(r));
            if (r.status == "Success") {
                this.isShowSpinner = false
                let url = "/lexconinvoiceview";
                console.log('r = ' + JSON.stringify(r));
                if (r.status == 'Success') {
                    this.isShowSpinner = false;
                    let url = '/lexconinvoiceview';
                console.log('url = ' + url);
                this[NavigationMixin.Navigate]({
                    type: "standard__webPage",
                        type: 'standard__webPage',
                    attributes: {
                        url: url,
                    },
                            url: url
                        }
                });
            } else {
                this.showMyToast('删除失败', r.msg, 'Error');
            }
        }).catch((error) => {
            console.log("error = " + error.message);
            })
            .catch((error) => {
                console.log('error = ' + error.message);
        });
    }
    SetEditAbleJs() {
        let statusEditAbleJs = 'Redirect';
        let url = "/lexconinvoiceview?invoiceId=" + this.invoiceId + '&KeyWords=' + statusEditAbleJs;
        let url =
            '/lexconinvoiceview?invoiceId=' +
            this.invoiceId +
            '&KeyWords=' +
            statusEditAbleJs;
        console.log('url = ' + url);
        this[NavigationMixin.Navigate]({
            type: "standard__webPage",
            type: 'standard__webPage',
            attributes: {
                url: url,
            },
                url: url
            }
        });
    }
@@ -1424,13 +1699,14 @@
            outOrderStringListLwc: this.outOrderStringListLwc,
            outordercountMapLwc: this.outordercountMapLwc,
            invoiceIdLwc: this.invoiceId
        }).then((r) => {
        })
            .then((r) => {
            r = JSON.parse(JSON.stringify(r));
            console.log("r = " + JSON.stringify(r));
            if (r.status == "Success") {
                this.isShowSpinner = false
                let url = "/s/lexconinvoiceview?invoiceId=" + this.invoiceId;
                console.log('r = ' + JSON.stringify(r));
                if (r.status == 'Success') {
                    this.isShowSpinner = false;
                    let url =
                        '/s/lexconinvoiceview?invoiceId=' + this.invoiceId;
                console.log('url = ' + url);
                window.open(url, '_self');
                // this[NavigationMixin.Navigate]({
@@ -1442,17 +1718,25 @@
            } else {
                this.showMyToast('错误', r.msg, 'Error');
            }
        }).catch((error) => {
            console.log("error = " + error.message);
            })
            .catch((error) => {
                console.log('error = ' + error.message);
        });
    }
    openReportJs() {
        console.log("openReportJs");
        console.log('openReportJs');
        let reportUrl = this.label.LexConInvoiceViewReport;
        let reportFilters = '[{"operator":"equals","value":"' + this.OrderCode + '","column":"FK_NAME"}]';
        let reportFilters =
            '[{"operator":"equals","value":"' +
            this.OrderCode +
            '","column":"FK_NAME"}]';
        console.log('reportUrl = ' + reportUrl);
        let url = "/s/report/" + reportUrl + "?reportFilters=" + encodeURIComponent(reportFilters);
        let url =
            '/s/report/' +
            reportUrl +
            '?reportFilters=' +
            encodeURIComponent(reportFilters);
        window.open(url);
        // this[NavigationMixin.Navigate]({
        //     type: "standard__webPage",
@@ -1467,13 +1751,18 @@
        // statusEdit = 'Redirect';
        // PageReference ref = new Pagereference('/ConInvoiceView?invoiceId=' + invoiceId + '&reopen=isreopen' + '&KeyWords=' + statusEdit);
        let statusEditAbleJs = 'Redirect';
        let url = "/lexconinvoiceview?invoiceId=" + this.invoiceId + '&reopen=isreopen' + '&KeyWords=' + statusEditAbleJs;
        let url =
            '/lexconinvoiceview?invoiceId=' +
            this.invoiceId +
            '&reopen=isreopen' +
            '&KeyWords=' +
            statusEditAbleJs;
        console.log('url = ' + url);
        this[NavigationMixin.Navigate]({
            type: "standard__webPage",
            type: 'standard__webPage',
            attributes: {
                url: url,
            },
                url: url
            }
        });
    }
@@ -1493,26 +1782,36 @@
            iconName = 'utility:error';
        }
        if (message != '') {
            content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
            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);
        this.template
            .querySelector('c-common-toast')
            .showToast(variant, content, iconName, 10000);
    }
    handleLoad() {
        console.log('handleLoad')
        console.log('handleLoad');
        try {
            const style = document.createElement('style');
            style.innerText = '.hehe-layoutItem .slds-button__icon {display: none;}';
            style.innerText =
                '.hehe-layoutItem .slds-button__icon {display: none;}';
            this.template.querySelector('.hideHelpText').appendChild(style);
            const style2 = document.createElement('style');
            style2.innerText = '.hehe-layoutItem  .slds-form-element__label {padding : 0px}';
            style2.innerText =
                '.hehe-layoutItem  .slds-form-element__label {padding : 0px}';
            this.template.querySelector('.hideHelpText').appendChild(style2);
            const style3 = document.createElement('style');
            style3.innerText = '.readOnly  .slds-form-element__label {padding-top: 7px;}';
            style3.innerText =
                '.readOnly  .slds-form-element__label {padding-top: 7px;}';
            this.template.querySelector('.hideHelpText').appendChild(style3);
        } catch (error) {
            console.log(error);
@@ -1531,17 +1830,19 @@
            s += '0';
        }
        return s;
    };
    }
    handleLoad2() {
        console.log('handleLoad2')
        console.log('handleLoad2');
        try {
            const style = document.createElement('style');
            style.innerText = '.hehe-layoutItem .slds-button__icon {display: none;}';
            style.innerText =
                '.hehe-layoutItem .slds-button__icon {display: none;}';
            this.template.querySelector('.hideHelpText').appendChild(style);
            const style2 = document.createElement('style');
            style2.innerText = '.hehe-layoutItem  .slds-form-element__label {padding : 0px}';
            style2.innerText =
                '.hehe-layoutItem  .slds-form-element__label {padding : 0px}';
            this.template.querySelector('.hideHelpText').appendChild(style2);
        } catch (error) {
            console.log(error);
@@ -1549,120 +1850,203 @@
    }
    handleUnitChange(event) {
        console.log("handleUnitChange");
        this.invoiceAllpriceData[0].invoiceAllprice = 0.00;
        console.log('handleUnitChange');
        this.invoiceAllpriceData[0].invoiceAllprice = 0.0;
        const unitDetail = event.detail;
        console.log("unitDetail = " + JSON.stringify(unitDetail));
        console.log('unitDetail = ' + JSON.stringify(unitDetail));
        for (var i in this.detailsData) {
            if (this.detailsData[i].recordId == unitDetail.data.recordId) {
                this.detailsData[i].unitValue = unitDetail.data.unitValue;
                this.detailsData[i].esd.Invoice_Unit__c = unitDetail.data.unitValue;
                if (this.detailsSelectedRows.indexOf(this.detailsData[i].recordId) == -1)
                this.detailsData[i].esd.Invoice_Unit__c =
                    unitDetail.data.unitValue;
                if (
                    this.detailsSelectedRows.indexOf(
                        this.detailsData[i].recordId
                    ) == -1
                )
                    this.detailsSelectedRows.push(this.detailsData[i].recordId);
            }
        }
        this.detailsSelectedRows = [...this.detailsSelectedRows];
        console.log('this.detailsSelectedRows = ' + JSON.stringify(this.detailsSelectedRows))
        console.log(
            'this.detailsSelectedRows = ' +
                JSON.stringify(this.detailsSelectedRows)
        );
        for (var i in this.detailsData) {
            this.detailsData[i].invoiceAllprice = 0.00;
            this.detailsData[i].invoiceAllprice = 0.0;
            for (var j in this.detailsSelectedRows) {
                console.log('this.detailsData[i].Id = ' + this.detailsData[i].Id);
                console.log('this.detailsSelectedRows[j] = ' + this.detailsSelectedRows[j]);
                console.log(
                    'this.detailsData[i].Id = ' + this.detailsData[i].Id
                );
                console.log(
                    'this.detailsSelectedRows[j] = ' +
                        this.detailsSelectedRows[j]
                );
                if (this.detailsData[i].Id == this.detailsSelectedRows[j]) {
                    this.detailsData[i].invoiceAllprice = this.amend(this.detailsData[i].shipmentNumber, this.detailsData[i].esdInvoiceUnitprice, '*');
                    console.log('this.detailsData[i].invoiceAllprice = ' + this.detailsData[i].invoiceAllprice);
                    this.detailsData[i].invoiceAllprice = this.amend(
                        this.detailsData[i].shipmentNumber,
                        this.detailsData[i].esdInvoiceUnitprice,
                        '*'
                    );
                    console.log(
                        'this.detailsData[i].invoiceAllprice = ' +
                            this.detailsData[i].invoiceAllprice
                    );
                }
            }
            this.invoiceAllpriceData[0].invoiceAllprice = this.amend(this.invoiceAllpriceData[0].invoiceAllprice, this.detailsData[i].invoiceAllprice, '+');
            this.invoiceAllpriceData[0].invoiceAllprice = this.amend(
                this.invoiceAllpriceData[0].invoiceAllprice,
                this.detailsData[i].invoiceAllprice,
                '+'
            );
        }
        this.detailsData = [...this.detailsData];
        this.invoiceAllpriceData = [...this.invoiceAllpriceData];
    }
    handleShipmentNumber(event) {
        console.log("handleShipmentNumber");
        this.invoiceAllpriceData[0].invoiceAllprice = 0.00;
        console.log('handleShipmentNumber');
        this.invoiceAllpriceData[0].invoiceAllprice = 0.0;
        const numberDetail = event.detail;
        console.log('numberDetail = ' + JSON.stringify(numberDetail))
        console.log('numberDetail = ' + JSON.stringify(numberDetail));
        if (numberDetail.data.shipmentnumber == 0) {
            if (this.detailsSelectedRows.indexOf(numberDetail.data.recordId) != -1) {
                this.detailsSelectedRows.splice(this.detailsSelectedRows.indexOf(numberDetail.data.recordId), 1);
            if (
                this.detailsSelectedRows.indexOf(numberDetail.data.recordId) !=
                -1
            ) {
                this.detailsSelectedRows.splice(
                    this.detailsSelectedRows.indexOf(
                        numberDetail.data.recordId
                    ),
                    1
                );
            }
        }
        console.log("start this.detailsSelectedRows = " + JSON.stringify(this.detailsSelectedRows));
        console.log("numberDetail = " + JSON.stringify(numberDetail));
        console.log(
            'start this.detailsSelectedRows = ' +
                JSON.stringify(this.detailsSelectedRows)
        );
        console.log('numberDetail = ' + JSON.stringify(numberDetail));
        for (var i in this.detailsData) {
            if (this.detailsData[i].recordId == numberDetail.data.recordId) {
                this.detailsData[i].shipmentNumber = Number(numberDetail.data.shipmentnumber);
                this.detailsData[i].invoiceCount = Number(numberDetail.data.shipmentnumber);
                if (this.detailsSelectedRows.indexOf(this.detailsData[i].recordId) == -1 && numberDetail.data.shipmentnumber != 0)
                this.detailsData[i].shipmentNumber = Number(
                    numberDetail.data.shipmentnumber
                );
                this.detailsData[i].invoiceCount = Number(
                    numberDetail.data.shipmentnumber
                );
                if (
                    this.detailsSelectedRows.indexOf(
                        this.detailsData[i].recordId
                    ) == -1 &&
                    numberDetail.data.shipmentnumber != 0
                )
                    this.detailsSelectedRows.push(this.detailsData[i].recordId);
            }
        }
        console.log("end this.detailsSelectedRows = " + JSON.stringify(this.detailsSelectedRows));
        console.log(
            'end this.detailsSelectedRows = ' +
                JSON.stringify(this.detailsSelectedRows)
        );
        this.detailsSelectedRows = [...this.detailsSelectedRows];
        console.log('this.detailsSelectedRows = ' + JSON.stringify(this.detailsSelectedRows));
        console.log(
            'this.detailsSelectedRows = ' +
                JSON.stringify(this.detailsSelectedRows)
        );
        for (var i in this.detailsData) {
            this.detailsData[i].invoiceAllprice = 0.00;
            this.detailsData[i].invoiceAllprice = 0.0;
            for (var j in this.detailsSelectedRows) {
                console.log('this.detailsData[i].Id = ' + this.detailsData[i].Id);
                console.log('this.detailsSelectedRows[j] = ' + this.detailsSelectedRows[j]);
                console.log(
                    'this.detailsData[i].Id = ' + this.detailsData[i].Id
                );
                console.log(
                    'this.detailsSelectedRows[j] = ' +
                        this.detailsSelectedRows[j]
                );
                if (this.detailsData[i].Id == this.detailsSelectedRows[j]) {
                    this.detailsData[i].invoiceAllprice = this.amend(this.detailsData[i].shipmentNumber, this.detailsData[i].esdInvoiceUnitprice, '*');
                    console.log('this.detailsData[i].invoiceAllprice = ' + this.detailsData[i].invoiceAllprice);
                    this.detailsData[i].invoiceAllprice = this.amend(
                        this.detailsData[i].shipmentNumber,
                        this.detailsData[i].esdInvoiceUnitprice,
                        '*'
                    );
                    console.log(
                        'this.detailsData[i].invoiceAllprice = ' +
                            this.detailsData[i].invoiceAllprice
                    );
                }
            }
            this.invoiceAllpriceData[0].invoiceAllprice = this.amend(this.invoiceAllpriceData[0].invoiceAllprice, this.detailsData[i].invoiceAllprice, '+');
            this.invoiceAllpriceData[0].invoiceAllprice = this.amend(
                this.invoiceAllpriceData[0].invoiceAllprice,
                this.detailsData[i].invoiceAllprice,
                '+'
            );
        }
        this.detailsData = [...this.detailsData];
        this.invoiceAllpriceData = [...this.invoiceAllpriceData];
    }
    detailsGetSelectedRows(event) {
        console.log("detailsGetSelectedRows ");
        this.invoiceAllpriceData[0].invoiceAllprice = 0.00;
        console.log('detailsGetSelectedRows ');
        this.invoiceAllpriceData[0].invoiceAllprice = 0.0;
        let selectedRows = event.detail.selectedRows;
        for (var i in this.detailsData) {
            this.detailsData[i].invoiceAllprice = 0.00;
            this.detailsData[i].invoiceAllprice = 0.0;
            for (var j in selectedRows) {
                if (this.detailsData[i].Id == selectedRows[j].esd.Id) {
                    this.detailsData[i].invoiceAllprice = this.amend(this.detailsData[i].shipmentNumber, this.detailsData[i].esdInvoiceUnitprice, '*');
                    console.log('this.detailsData[i].invoiceAllprice = ' + this.detailsData[i].invoiceAllprice);
                    this.detailsData[i].invoiceAllprice = this.amend(
                        this.detailsData[i].shipmentNumber,
                        this.detailsData[i].esdInvoiceUnitprice,
                        '*'
                    );
                    console.log(
                        'this.detailsData[i].invoiceAllprice = ' +
                            this.detailsData[i].invoiceAllprice
                    );
                }
            }
            this.invoiceAllpriceData[0].invoiceAllprice = this.amend(this.invoiceAllpriceData[0].invoiceAllprice, this.detailsData[i].invoiceAllprice, '+');
            console.log('this.invoiceAllpriceData[0].invoiceAllprice = ' + this.invoiceAllpriceData[0].invoiceAllprice);
            this.invoiceAllpriceData[0].invoiceAllprice = this.amend(
                this.invoiceAllpriceData[0].invoiceAllprice,
                this.detailsData[i].invoiceAllprice,
                '+'
            );
            console.log(
                'this.invoiceAllpriceData[0].invoiceAllprice = ' +
                    this.invoiceAllpriceData[0].invoiceAllprice
            );
        }
        console.log('start this.detailsData = ' + JSON.stringify(this.detailsData));
        console.log(
            'start this.detailsData = ' + JSON.stringify(this.detailsData)
        );
        this.detailsData = [...this.detailsData];
        console.log('end this.detailsData = ' + JSON.stringify(this.detailsData));
        console.log(
            'end this.detailsData = ' + JSON.stringify(this.detailsData)
        );
        this.invoiceAllpriceData = [...this.invoiceAllpriceData];
    }
    ComputePrice(index, number, price) {
        console.log("index = " + index);
        console.log("number = " + number);
        console.log("price = " + price);
        let shipmentAmount = this.amend(number, price, "*");
        console.log("shipmentAmount = " + shipmentAmount);
        console.log('index = ' + index);
        console.log('number = ' + number);
        console.log('price = ' + price);
        let shipmentAmount = this.amend(number, price, '*');
        console.log('shipmentAmount = ' + shipmentAmount);
        let sumPrice = 0.0;
        this.data[index].shipmentAmount = shipmentAmount;
        for (var i in this.data) {
            if (this.data[i].shipmentAmount) sumPrice += this.data[i].shipmentAmount;
            if (this.data[i].shipmentAmount)
                sumPrice += this.data[i].shipmentAmount;
        }
        this.sumPrice = sumPrice + "元";
        this.sumPrice = sumPrice + '元';
        //存下选择行,不会被清空
        if (this.selectedRows.indexOf(this.data[index].Id) == -1)
            this.selectedRows.push(this.data[index].Id);
        this.data = [...this.data];
        this.selectedRows = [...this.selectedRows]
        console.log("this.selectedRows = " + JSON.stringify(this.selectedRows));
        console.log("this.data = " + JSON.stringify(this.data));
        this.selectedRows = [...this.selectedRows];
        console.log('this.selectedRows = ' + JSON.stringify(this.selectedRows));
        console.log('this.data = ' + JSON.stringify(this.data));
    }
    deepClone(obj) {
@@ -1673,7 +2057,9 @@
        this.isShowSpinner = true;
        let cloneData = this.deepClone(this.detailsData);
        let selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
        let selectedRows = this.template
            .querySelector('c-lex-custom-lightning-datatable')
            .getSelectedRows();
        console.log('selectedRows = ' + JSON.stringify(selectedRows));
        for (var i in cloneData) {
@@ -1700,28 +2086,28 @@
        }
        console.log('cloneData = ' + JSON.stringify(cloneData));
        detailsSave({
            consumableorderdetails1RecordsLwc: JSON.stringify(cloneData),
            invoiceIdLwc: this.invoiceId,
            orderIdLwc: this.orderId
        }).then((r) => {
        })
            .then((r) => {
            r = JSON.parse(JSON.stringify(r));
            console.log("r = " + JSON.stringify(r));
            if (r.status == "Success") {
                let url = "/lexconinvoiceview?invoiceId=" + this.invoiceId;
                console.log('r = ' + JSON.stringify(r));
                if (r.status == 'Success') {
                    let url = '/lexconinvoiceview?invoiceId=' + this.invoiceId;
                this[NavigationMixin.Navigate]({
                    type: "standard__webPage",
                        type: 'standard__webPage',
                    attributes: {
                        url: url,
                    },
                            url: url
                        }
                });
            } else {
                this.showMyToast('保存失败', r.msg, 'Error');
            }
        }).catch((error) => {
            console.log("error = " + error.message);
            })
            .catch((error) => {
                console.log('error = ' + error.message);
        });
    }
@@ -1734,27 +2120,27 @@
            str2Length;
        //解决整数没有小数点方法
        try {
            str1Length = str1.split(".")[1].length;
            str1Length = str1.split('.')[1].length;
        } catch (error) {
            str1Length = 0;
        }
        try {
            str2Length = str2.split(".")[1].length;
            str2Length = str2.split('.')[1].length;
        } catch (error) {
            str2Length = 0;
        }
        var step = Math.pow(10, Math.max(str1Length, str2Length));
        switch (symbol) {
            case "+":
            case '+':
                result = (num1 * step + num2 * step) / step;
                break;
            case "-":
            case '-':
                result = (num1 * step - num2 * step) / step;
                break;
            case "*":
            case '*':
                result = (num1 * step * (num2 * step)) / step / step;
                break;
            case "/":
            case '/':
                result = (num1 * step) / (num2 * step);
                break;
            default:
@@ -1767,23 +2153,23 @@
    deleteAtt(event) {
        this.isShowSpinner = true;
        //var recordId = event.detail.data.recordId;
        var recordId = event.target.getAttribute("data-fileid");
        var recordId = event.target.getAttribute('data-fileid');
        console.log('attid:' + recordId);
        deleteAtt({
            contentVersionId: recordId
        }).then(r => {
        })
            .then((r) => {
            r = JSON.parse(JSON.stringify(r));
            if (r.status == "Success") {
                if (r.status == 'Success') {
                this.showMyToast('删除成功', '', 'Success');
                if (this.fileData.length == 1)
                    window.location.reload();
                else
                    this.init();
                    if (this.fileData.length == 1) window.location.reload();
                    else this.init();
            } else {
                this.showMyToast('删除失败', r.msg, 'Error');
            }
        }).catch(error => {
            this.showMyToast('错误', error.message, 'Error');
        })
            .catch((error) => {
                this.showMyToast('错误', error.message, 'Error');
            });
    }
}
force-app/main/default/lwc/lexConsumable/lexConsumable.html
@@ -2,7 +2,10 @@
    <template if:true={showSpinner}>
        <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
        <div class="slds-spinner_container">
            <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
            <div
                role="status"
                class="slds-spinner slds-spinner_medium slds-spinner_brand"
            >
                <span class="slds-assistive-text">Loading</span>
                <div class="slds-spinner__dot-a"></div>
                <div class="slds-spinner__dot-b"></div>
@@ -11,36 +14,93 @@
    </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="padding:10px;">
        <div
            style="
                border: 1px solid #d4d4d4;
                border-top: 3px solid #51606e;
                border-radius: 5px;
            "
        >
            <div style="padding: 10px">
                <!-- 按钮 -->
                <template if:true={showEditBtn}>
                    <!-- <lightning-button style="margin: 5px;" label="编辑" disabled={disabledEditBtn} onclick={editOrder}></lightning-button> -->
                    <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" disabled={disabledEditBtn} onclick={editOrder}>编辑</button>
                    <button
                        class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                        disabled={disabledEditBtn}
                        onclick={editOrder}
                    >
                        编辑
                    </button>
                </template>
                <template if:true={showPrintSheetBtn}>
                    <!-- <lightning-button style="margin: 5px;" label="打印配置单" onclick={printOrder}></lightning-button> -->
                    <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="打印配置单" onclick={printOrder}>打印配置单</button>
                    <button
                        class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                        style="margin: 5px"
                        label="打印配置单"
                        onclick={printOrder}
                    >
                        打印配置单
                    </button>
                </template>
                <template if:true={showUploadSheetBtn}>
                    <!-- <lightning-button style="margin: 5px;" label="上传配置单" disabled={disabledUploadSheetBtn} onclick={uploadOrder}></lightning-button> -->
                    <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="上传配置单" disabled={disabledUploadSheetBtn} onclick={uploadOrder}>上传配置单</button>
                    <button
                        class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                        style="margin: 5px"
                        label="上传配置单"
                        disabled={disabledUploadSheetBtn}
                        onclick={uploadOrder}
                    >
                        上传配置单
                    </button>
                </template>
                <template if:true={showSubOrderbtn}>
                    <!-- <lightning-button style="margin: 5px;" label="提交订单" disabled={disabledSubOrderbtn} onclick={submitOrder}></lightning-button> -->
                    <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="提交订单" disabled={disabledSubOrderbtn} onclick={submitOrder}>提交订单</button>
                    <button
                        class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                        style="margin: 5px"
                        label="提交订单"
                        disabled={disabledSubOrderbtn}
                        onclick={submitOrder}
                    >
                        提交订单
                    </button>
                </template>
                <template if:true={showSaveOrderbtn1}>
                    <!-- <lightning-button style="margin: 5px;" label="保存订单" onclick={saveOrder}></lightning-button> -->
                    <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="保存订单" onclick={saveOrder}>保存订单</button>
                    <button
                        class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                        style="margin: 5px"
                        label="保存订单"
                        onclick={saveOrder}
                    >
                        保存订单
                    </button>
                </template>
                <template if:true={showSaveOrderbtn2}>
                    <!-- <lightning-button style="margin: 5px;" label="保存订单" onclick={orderCopy}></lightning-button> -->
                    <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="保存订单" onclick={orderCopy}>保存订单</button>
                    <button
                        class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                        style="margin: 5px"
                        label="保存订单"
                        onclick={orderCopy}
                    >
                        保存订单
                    </button>
                </template>
                <template if:true={showDeleteBtn}>
                    <!-- <lightning-button style="margin: 5px;" label="删除" disabled={disabledDeleteBtn} onclick={deleteOrder}></lightning-button> -->
                    <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="删除" disabled={disabledDeleteBtn} onclick={deleteOrder}>删除</button>
                    <button
                        class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                        style="margin: 5px"
                        label="删除"
                        disabled={disabledDeleteBtn}
                        onclick={deleteOrder}
                    >
                        删除
                    </button>
                </template>
                <!-- <template if:true={showOfferPriceInputBtn}>
                    <lightning-button style="margin: 5px;" label="特价金额录入" disabled={disabledOfferPriceInputBtn} onclick={inputOfferPrice}></lightning-button>
@@ -48,13 +108,32 @@
                </template> -->
                <template if:true={showReapplyBtn}>
                    <!-- <lightning-button style="margin: 5px;" label="再申请" onclick={reapplyOrder}></lightning-button> -->
                    <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="再申请" onclick={reapplyOrder}>再申请</button>
                    <button
                        class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                        style="margin: 5px"
                        label="再申请"
                        onclick={reapplyOrder}
                    >
                        再申请
                    </button>
                </template>
                <p style="height: 10px;"></p>
                <p style="height: 10px"></p>
                <!-- 订单信息 -->
                <template if:false={editAble}>
                    <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;">
                    <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">
@@ -64,21 +143,35 @@
                            </lightning-layout>
                            <!-- <p style="font-size: 16px;"><strong>订单信息</strong></p> -->
                        </div>
                        <div style="padding:10px;">
                            <lightning-record-view-form record-id={cocId} object-api-name="Consumable_order__c">
                                <table style="width: 100%;">
                        <div style="padding: 10px">
                            <lightning-record-view-form
                                record-id={cocId}
                                object-api-name="Consumable_order__c"
                            >
                                <table style="width: 100%">
                                    <tbody>
                                        <tr>
                                            <td style="width: 10%"></td>
                                            <td style="width: 40%;"><lightning-output-field class="outputfont" field-name="Name"></lightning-output-field></td>
                                            <td style="width: 40%;"><lightning-output-field field-name="Order_status__c"></lightning-output-field></td>
                                            <td style="width: 40%">
                                                <lightning-output-field
                                                    class="outputfont"
                                                    field-name="Name"
                                                ></lightning-output-field>
                                            </td>
                                            <td style="width: 40%">
                                                <lightning-output-field
                                                    field-name="Order_status__c"
                                                ></lightning-output-field>
                                            </td>
                                            <td style="width: 10%"></td>
                                        </tr>
                                        <tr>
                                            <td></td>
                                            <td>
                                                <template if:false={editAble}>
                                                    <lightning-output-field field-name="Total_amount__c"></lightning-output-field>
                                                    <lightning-output-field
                                                        field-name="Total_amount__c"
                                                    ></lightning-output-field>
                                                </template>
                                            </td>
                                            <td>
@@ -87,7 +180,10 @@
                                                    <lightning-formatted-text value={contractName}></lightning-formatted-text>
                                                </div> -->
                                                <!-- style="pointer-events: none;" -->
                                                    <lightning-output-field class="showContract" field-name="Order_effective_contact__c"  ></lightning-output-field>
                                                <lightning-output-field
                                                    class="showContract"
                                                    field-name="Order_effective_contact__c"
                                                ></lightning-output-field>
                                            </td>
                                            <!-- <td>合同:<lightning-formatted-text value={coc.Order_effective_contact__r.Name}></lightning-formatted-text></td> -->
                                            <td></td>
@@ -103,8 +199,12 @@
                                                </template>
                                            </td> -->
                                            <td>
                                                <template if:true={showAttUploadDate}>
                                                    <lightning-output-field field-name="Consumable_pdf_insert_day__c"></lightning-output-field>
                                                <template
                                                    if:true={showAttUploadDate}
                                                >
                                                    <lightning-output-field
                                                        field-name="Consumable_pdf_insert_day__c"
                                                    ></lightning-output-field>
                                                </template>
                                            </td>
                                            <td></td>
@@ -122,8 +222,12 @@
                                        <tr>
                                            <td></td>
                                            <td>
                                                <template if:true={showOrderDate}>
                                                    <lightning-output-field field-name="Order_date__c"></lightning-output-field>
                                                <template
                                                    if:true={showOrderDate}
                                                >
                                                    <lightning-output-field
                                                        field-name="Order_date__c"
                                                    ></lightning-output-field>
                                                </template>
                                            </td>
                                            <td></td>
@@ -132,26 +236,71 @@
                                        <tr>
                                            <td></td>
                                            <td colspan="2">
                                                <lightning-card class="attListTitle" variant="Narrow"  title="附件列表" icon-name="utility:attach">
                                                    <lightning-layout slot="footer" multiple-rows="true">
                                                        <template for:each={attachmentRecoeds} for:item="item" for:index="index">
                                                            <lightning-layout-item padding="around-none" size="2" key={item.recordId} style="text-align: left;padding:5px">
                                                                <lightning-icon title={item.fileFullName} style="margin-left: 20px;" icon-name="doctype:gform" alternative-text={item.fileFullName} size="large"></lightning-icon><br/>
                                                <lightning-card
                                                    class="attListTitle"
                                                    variant="Narrow"
                                                    title="附件列表"
                                                    icon-name="utility:attach"
                                                >
                                                    <lightning-layout
                                                        slot="footer"
                                                        multiple-rows="true"
                                                    >
                                                        <template
                                                            for:each={attachmentRecoeds}
                                                            for:item="item"
                                                            for:index="index"
                                                        >
                                                            <lightning-layout-item
                                                                padding="around-none"
                                                                size="2"
                                                                key={item.recordId}
                                                                style="
                                                                    text-align: left;
                                                                    padding: 5px;
                                                                "
                                                            >
                                                                <lightning-icon
                                                                    title={item.fileFullName}
                                                                    style="
                                                                        margin-left: 20px;
                                                                    "
                                                                    icon-name="doctype:gform"
                                                                    alternative-text={item.fileFullName}
                                                                    size="large"
                                                                ></lightning-icon
                                                                ><br />
                                                                <!-- <span style="word-wrap:break-word; word-break:break-all;width:80px;display:flex;" title={item.fileFullName}>
                                                                    {item.fileName}
                                                                </span> -->
                                                                <div title={item.fileFullName} style="width: 100px;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;">
                                                                <div
                                                                    title={item.fileFullName}
                                                                    style="
                                                                        width: 100px;
                                                                        text-overflow: ellipsis;
                                                                        overflow: hidden;
                                                                        white-space: nowrap;
                                                                    "
                                                                >
                                                                    {item.fileName}
                                                                </div>
                                                                <p>
                                                                    <!-- <a data-fileid ={item.documentId} onclick={previweAtt}> -->
                                                                    <a href={item.attUrl} target="_blank">
                                                                        预览
                                                                    </a>&nbsp;·&nbsp;
                                                                    <a href={item.downloadUrl}>
                                                                        下载
                                                                    </a>&nbsp;·&nbsp;
                                                                    <a data-fileid ={item.recordId} onclick={deleteAtt}>
                                                                    <a
                                                                        href={item.attUrl}
                                                                        target="_blank"
                                                                    >
                                                                        预览 </a
                                                                    >&nbsp;·&nbsp;
                                                                    <a
                                                                        href={item.downloadUrl}
                                                                    >
                                                                        下载 </a
                                                                    >&nbsp;·&nbsp;
                                                                    <a
                                                                        data-fileid={item.recordId}
                                                                        onclick={deleteAtt}
                                                                    >
                                                                        删除
                                                                    </a>
                                                                </p>
@@ -171,8 +320,15 @@
                </template>
                <!-- searchBlock -->
                <template if:true={editAble}>
                    <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
                        <div style="padding:10px;">
                    <div
                        style="
                            border: 1px solid #d4d4d4;
                            border-top: 3px solid #51606e;
                            border-radius: 5px;
                            margin-bottom: 7px;
                        "
                    >
                        <div style="padding: 10px">
                            <table>
                                <tbody>
                                    <!-- <tr>
@@ -208,62 +364,190 @@
                                    <!-- <tr style="height: 10px;"></tr> -->
                                    <tr>
                                        <td>
                                            <div style="color:#696969;font-size:16px;">消耗品名称</div>
                                            <div
                                                style="
                                                    color: #696969;
                                                    font-size: 16px;
                                                "
                                            >
                                                消耗品名称
                                            </div>
                                        </td>
                                        <td>
                                            <lightning-input class="inputFont" variant="label-hidden" label="消耗品名称" value={category1} onchange={category1Change}></lightning-input>
                                            <lightning-input
                                                class="inputFont"
                                                variant="label-hidden"
                                                label="消耗品名称"
                                                value={category1}
                                                onchange={category1Change}
                                            ></lightning-input>
                                        </td>
                                        <td></td>
                                        <td>
                                            <div style="color:#696969;font-size:16px;">第3分类</div>
                                            <div
                                                style="
                                                    color: #696969;
                                                    font-size: 16px;
                                                "
                                            >
                                                第3分类
                                            </div>
                                        </td>
                                        <td>
                                            <lightning-combobox class="inputFont" variant="label-hidden" label="第3分类" value={category3} options={category3Option} onchange={category3Change}></lightning-combobox>
                                            <lightning-combobox
                                                class="inputFont"
                                                variant="label-hidden"
                                                label="第3分类"
                                                value={category3}
                                                options={category3Option}
                                                onchange={category3Change}
                                            ></lightning-combobox>
                                        </td>
                                        <td style="width:30px;"></td>
                                        <td style="width:66px;">
                                            <div style="color:#696969;font-size:16px;">第4分类</div>
                                        <td style="width: 30px"></td>
                                        <td style="width: 66px">
                                            <div
                                                style="
                                                    color: #696969;
                                                    font-size: 16px;
                                                "
                                            >
                                                第4分类
                                            </div>
                                        </td>
                                        <td >
                                            <lightning-combobox class="inputFont" variant="label-hidden" label="第4分类" value={category4} options={category4Option} onchange={category4Change}></lightning-combobox>
                                            <lightning-combobox
                                                class="inputFont"
                                                variant="label-hidden"
                                                label="第4分类"
                                                value={category4}
                                                options={category4Option}
                                                onchange={category4Change}
                                            ></lightning-combobox>
                                        </td>
                                        <td></td>
                                        <td style="width: 66px;">
                                            <div style="color:#696969;font-size:16px;">第5分类</div>
                                        <td style="width: 66px">
                                            <div
                                                style="
                                                    color: #696969;
                                                    font-size: 16px;
                                                "
                                            >
                                                第5分类
                                            </div>
                                        </td>
                                        <td style="width: 160px;">
                                            <lightning-combobox class="inputFont" variant="label-hidden" label="第5分类" value={category5} options={category5Option} onchange={category5Change}></lightning-combobox>
                                        <td style="width: 160px">
                                            <lightning-combobox
                                                class="inputFont"
                                                variant="label-hidden"
                                                label="第5分类"
                                                value={category5}
                                                options={category5Option}
                                                onchange={category5Change}
                                            ></lightning-combobox>
                                        </td>
                                    </tr>
                                    <tr style="height: 10px;"></tr>
                                    <tr style="height: 10px"></tr>
                                    <tr>
                                        <td style="width: 100px;">
                                            <div style="color:#696969;font-size:16px;"><span style="color: red;">*&nbsp;</span>合同</div>
                                        </td>
                                        <td style="width:320px;">
                                            <div class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right">
                                                <lightning-icon size="x-small" class="iconMargin slds-icon slds-input__icon slds-input__icon_right slds-icon-text-default" icon-name="utility:search" ></lightning-icon>
                                                <lightning-input class="inputFont" variant="label-hidden" label="合同" placeholder="请选择合同" value={contractName} onchange={changeCon} onclick={showSearchCon}></lightning-input>
                                        <td style="width: 100px">
                                            <div
                                                style="
                                                    color: #696969;
                                                    font-size: 16px;
                                                "
                                            >
                                                <span style="color: red"
                                                    >*&nbsp;</span
                                                >合同
                                            </div>
                                        </td>
                                        <td style="width: 30px;"></td>
                                        <td style="width:66px;">
                                            <template if:true={showHospital}>
                                                <div style="color:#696969;font-size:16px;"><span style="color: red;">*&nbsp;</span>医院</div>
                                            </template>
                                        <td style="width: 320px">
                                            <div
                                                class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right"
                                            >
                                                <lightning-icon
                                                    size="x-small"
                                                    class="iconMargin slds-icon slds-input__icon slds-input__icon_right slds-icon-text-default"
                                                    icon-name="utility:search"
                                                ></lightning-icon>
                                                <lightning-input
                                                    class="inputFont"
                                                    variant="label-hidden"
                                                    label="合同"
                                                    placeholder="请选择合同"
                                                    value={contractName}
                                                    onchange={changeCon}
                                                    onclick={showSearchCon}
                                                ></lightning-input>
                                            </div>
                                        </td>
                                        <td colspan="4" style="padding-bottom:5px;padding-top:5px;">
                                        <td style="width: 30px"></td>
                                        <td style="width: 66px">
                                            <template if:true={showHospital}>
                                                <div class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right">
                                                    <lightning-icon size="x-small" class="iconMargin slds-icon slds-input__icon slds-input__icon_right slds-icon-text-default" icon-name="utility:search" ></lightning-icon>
                                                    <lightning-input class="inputFont" variant="label-hidden" label="医院" placeholder="请选择医院" value={hospitalName} onclick={showSearchHos} onchange={changeHos}></lightning-input>
                                                <div
                                                    style="
                                                        color: #696969;
                                                        font-size: 16px;
                                                    "
                                                >
                                                    <span style="color: red"
                                                        >*&nbsp;</span
                                                    >医院
                                                </div>
                                            </template>
                                        </td>
                                        <td style="width: 30px;"></td>
                                        <td
                                            colspan="4"
                                            style="
                                                padding-bottom: 5px;
                                                padding-top: 5px;
                                            "
                                        >
                                            <template if:true={showHospital}>
                                                <div
                                                    class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right"
                                                >
                                                    <lightning-icon
                                                        size="x-small"
                                                        class="iconMargin slds-icon slds-input__icon slds-input__icon_right slds-icon-text-default"
                                                        icon-name="utility:search"
                                                    ></lightning-icon>
                                                    <lightning-input
                                                        class="inputFont"
                                                        variant="label-hidden"
                                                        label="医院"
                                                        placeholder="请选择医院"
                                                        value={hospitalName}
                                                        onclick={showSearchHos}
                                                        onchange={changeHos}
                                                    ></lightning-input>
                                                </div>
                                            </template>
                                        </td>
                                        <td style="width: 30px"></td>
                                        <td colspan="2">
                                            <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="width:130px;height:32px;margin-right: 10px;" label="消耗品搜索" onclick={searchProduct}>消耗品搜索</button>
                                            <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="width:80px;height:32px;" label="清空" onclick={clear}>清空</button>
                                            <button
                                                class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
                                                style="
                                                    width: 130px;
                                                    height: 32px;
                                                    margin-right: 10px;
                                                "
                                                label="消耗品搜索"
                                                onclick={searchProduct}
                                            >
                                                消耗品搜索
                                            </button>
                                            <button
                                                class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
                                                style="
                                                    width: 80px;
                                                    height: 32px;
                                                "
                                                label="清空"
                                                onclick={clear}
                                            >
                                                清空
                                            </button>
                                        </td>
                                    </tr>
                                </tbody>
@@ -273,31 +557,94 @@
                </template>
                <!-- 警告提醒 -->
                <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 style="margin: 3px;" icon-name="utility:warning" size="small"></lightning-icon>
                    <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
                                style="margin: 3px"
                                icon-name="utility:warning"
                                size="small"
                            ></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:16px;margin-bottom:7px;">&nbsp;&nbsp;&nbsp;・&nbsp;{msg}</p>
                            <p
                                key={msg}
                                style="
                                    color: #ff6a00;
                                    padding-left: 7px;
                                    font-size: 16px;
                                    margin-bottom: 7px;
                                "
                            >
                                &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 style="margin: 3px;" icon-name="utility:error" size="small"></lightning-icon>
                    <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
                                style="margin: 3px"
                                icon-name="utility:error"
                                size="small"
                            ></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:16px;margin-bottom:7px;">&nbsp;&nbsp;&nbsp;・&nbsp;{msg}</p>
                            <p
                                key={msg}
                                style="
                                    color: red;
                                    padding-left: 7px;
                                    font-size: 16px;
                                    margin-bottom: 7px;
                                "
                            >
                                &nbsp;&nbsp;&nbsp;・&nbsp;{msg}
                            </p>
                        </template>
                    </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;">
                <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">
@@ -307,24 +654,65 @@
                        </lightning-layout>
                        <!-- <p style="font-size: 16px;"><strong>消耗品明细</strong></p> -->
                    </div>
                    <div style="padding:10px;">
                    <div style="padding: 10px">
                        <template if:true={editAble}>
                            <c-lex-custom-lightning-datatable class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all;" key-field="recordId" data={currentRecord} columns={cols}
                            selected-rows={selectRows} onrowselection={checkRows} onchangevalue={conCountChange} onvalueblur={conCountBlur}
                            default-sort-direction="asc" sorted-direction={sortDirection} sorted-by={sortedBy} onsort={onHandleSort}></c-lex-custom-lightning-datatable>
                            <c-paginator onprevious={prePageClick} onnext={nextPageClick}
                                onpageschange={pageSizeChange} onfirst={goFirstPage} onlast={goLastPage}
                                page-size-options={pageSizeOptions} previous-button-disabled={previousButtonDisabled}
                                next-button-disabled={nextButtonDisabled} record-start={recordStart}
                                record-end={recordEnd} total-records={totalRecords}></c-paginator>
                            <c-lex-custom-lightning-datatable
                                class="wrapped-header-datatable"
                                style="
                                    word-wrap: break-word;
                                    word-break: break-all;
                                "
                                key-field="recordId"
                                data={currentRecord}
                                columns={cols}
                                selected-rows={selectRows}
                                onrowselection={checkRows}
                                onchangevalue={conCountChange}
                                onvalueblur={conCountBlur}
                                default-sort-direction="asc"
                                sorted-direction={sortDirection}
                                sorted-by={sortedBy}
                                onsort={onHandleSort}
                            ></c-lex-custom-lightning-datatable>
                            <c-paginator
                                onprevious={prePageClick}
                                onnext={nextPageClick}
                                onpageschange={pageSizeChange}
                                onfirst={goFirstPage}
                                onlast={goLastPage}
                                page-size-options={pageSizeOptions}
                                previous-button-disabled={previousButtonDisabled}
                                next-button-disabled={nextButtonDisabled}
                                record-start={recordStart}
                                record-end={recordEnd}
                                total-records={totalRecords}
                            ></c-paginator>
                        </template>
                        <template if:false={editAble}>
                            <c-lex-custom-lightning-datatable class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all;" hide-checkbox-column key-field="recordId" data={consumableorderdetailsRecordsview} columns={cols}></c-lex-custom-lightning-datatable>
                            <c-paginator onprevious={prePageClick} onnext={nextPageClick}
                                onpageschange={pageSizeChange} onfirst={goFirstPage} onlast={goLastPage}
                                page-size-options={pageSizeOptions} previous-button-disabled={previousButtonDisabled}
                                next-button-disabled={nextButtonDisabled} record-start={recordStart}
                                record-end={recordEnd} total-records={totalRecords}></c-paginator>
                            <c-lex-custom-lightning-datatable
                                class="wrapped-header-datatable"
                                style="
                                    word-wrap: break-word;
                                    word-break: break-all;
                                "
                                hide-checkbox-column
                                key-field="recordId"
                                data={consumableorderdetailsRecordsview}
                                columns={cols}
                            ></c-lex-custom-lightning-datatable>
                            <c-paginator
                                onprevious={prePageClick}
                                onnext={nextPageClick}
                                onpageschange={pageSizeChange}
                                onfirst={goFirstPage}
                                onlast={goLastPage}
                                page-size-options={pageSizeOptions}
                                previous-button-disabled={previousButtonDisabled}
                                next-button-disabled={nextButtonDisabled}
                                record-start={recordStart}
                                record-end={recordEnd}
                                total-records={totalRecords}
                            ></c-paginator>
                        </template>
                    </div>
                </div>
@@ -349,27 +737,65 @@
        </template> -->
        <!-- 上传附件弹窗 -->
        <template if:true={showAttPop}>
            <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_small" style="border: 1px solid #D4D4D4;">
            <section
                role="dialog"
                tabindex="-1"
                aria-labelledby="modal-heading-01"
                aria-modal="true"
                aria-describedby="modal-content-id-1"
                class="slds-modal slds-fade-in-open slds-modal_small"
                style="border: 1px solid #d4d4d4"
            >
                <template if:true={showPopSpinner}>
                    <lightning-spinner size="medium" variant="brand"></lightning-spinner>
                    <lightning-spinner
                        size="medium"
                        variant="brand"
                    ></lightning-spinner>
                </template>
                <div class="slds-modal__container">
                    <header class="slds-modal__header" style="background-color: #F3F3F3;">
                        <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closePop}>
                            <lightning-icon icon-name="utility:close"
                    <header
                        class="slds-modal__header"
                        style="background-color: #f3f3f3"
                    >
                        <button
                            style=""
                            class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
                            title="Close"
                            onclick={closePop}
                        >
                            <lightning-icon
                                icon-name="utility:close"
                                alternative-text="close"
                                variant="inverse"
                                size="small" ></lightning-icon>
                                size="small"
                            ></lightning-icon>
                            <span class="slds-assistive-text">Close</span>
                        </button>
                        <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">上传配置单</h2>
                        <h2
                            id="modal-heading-01"
                            class="slds-text-heading_medium slds-hyphenate"
                        >
                            上传配置单
                        </h2>
                    </header>
                    <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1" style="border: 1px solid #F3F3F3;">
                    <div
                        class="slds-modal__content slds-p-around_medium"
                        id="modal-content-id-1"
                        style="border: 1px solid #f3f3f3"
                    >
                        <div class="slds-m-top_medium slds-m-bottom_x-large">
                            <div class="slds-p-around_medium lgc-bg">
                                <lightning-input class="fileUpload" type="file" label="附件上传" accept=".xlsx, .xls, .csv, .png, .doc, .docx, .pdf" onchange={attChange}></lightning-input>
                                <lightning-input
                                    class="fileUpload"
                                    type="file"
                                    label="附件上传"
                                    accept=".xlsx, .xls, .csv, .png, .doc, .docx, .pdf"
                                    onchange={attChange}
                                ></lightning-input>
                            </div>
                            <p style="font-size: 16px;">已选择文件:{fileName} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <p style="font-size: 16px">
                                已选择文件:{fileName}
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <template if:true={attDelBtn}>
                                    <a onclick={removeAtt}>移除</a>
                                </template>
@@ -379,8 +805,24 @@
                    <footer class="slds-modal__footer">
                        <!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="取消" onclick={closePop}></lightning-button>
                        <lightning-button style="margin-left: 10px;" variant="neutral" label="上传" onclick={uploadAtt}></lightning-button> -->
                        <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="margin-left: 10px;" variant="neutral" label="取消" onclick={closePop}>取消</button>
                        <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="margin-left: 10px;" variant="neutral" label="上传" onclick={uploadAtt}>上传</button>
                        <button
                            class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
                            style="margin-left: 10px"
                            variant="neutral"
                            label="取消"
                            onclick={closePop}
                        >
                            取消
                        </button>
                        <button
                            class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
                            style="margin-left: 10px"
                            variant="neutral"
                            label="上传"
                            onclick={uploadAtt}
                        >
                            上传
                        </button>
                    </footer>
                </div>
            </section>
@@ -388,35 +830,104 @@
        </template>
        <!-- 搜索医院 -->
        <template if:true={showAttHosPop}>
            <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_medium" style="border: 1px solid #D4D4D4;">
            <section
                role="dialog"
                tabindex="-1"
                aria-labelledby="modal-heading-01"
                aria-modal="true"
                aria-describedby="modal-content-id-1"
                class="slds-modal slds-fade-in-open slds-modal_medium"
                style="border: 1px solid #d4d4d4"
            >
                <div class="slds-modal__container">
                    <header class="slds-modal__header" style="background-color: #F3F3F3;">
                        <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closeHospitalPop}>
                            <lightning-icon icon-name="utility:close"
                    <header
                        class="slds-modal__header"
                        style="background-color: #f3f3f3"
                    >
                        <button
                            style=""
                            class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
                            title="Close"
                            onclick={closeHospitalPop}
                        >
                            <lightning-icon
                                icon-name="utility:close"
                                alternative-text="close"
                                variant="inverse"
                                size="small" ></lightning-icon>
                                size="small"
                            ></lightning-icon>
                            <span class="slds-assistive-text">Close</span>
                        </button>
                        <h2 id="modal-heading-02" class="slds-text-heading_medium slds-hyphenate">经销商医院检索</h2>
                        <h2
                            id="modal-heading-02"
                            class="slds-text-heading_medium slds-hyphenate"
                        >
                            经销商医院检索
                        </h2>
                    </header>
                    <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-2" style="border: 1px solid #F3F3F3;">
                        <table style="width: 100%;">
                    <div
                        class="slds-modal__content slds-p-around_medium"
                        id="modal-content-id-2"
                        style="border: 1px solid #f3f3f3"
                    >
                        <table style="width: 100%">
                            <tbody>
                                <tr>
                                    <td style="width: 74px;"><div style="color:#696969;font-size:16px;text-align: left;">医院名称</div></td>
                                    <td style="width: 60%;"><lightning-input class="inputFont" label="医院名称" variant="label-hidden" placeholder="请输入医院名称" value={searchNameHos} onchange={searchNameHosChange}></lightning-input></td>
                                    <td style="width: 10px;"></td>
                                    <td><button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height: 32px;" label="搜索" onclick={searchHos}>搜索</button></td>
                                    <td style="width: 74px">
                                        <div
                                            style="
                                                color: #696969;
                                                font-size: 16px;
                                                text-align: left;
                                            "
                                        >
                                            医院名称
                                        </div>
                                    </td>
                                    <td style="width: 60%">
                                        <lightning-input
                                            class="inputFont"
                                            label="医院名称"
                                            variant="label-hidden"
                                            placeholder="请输入医院名称"
                                            value={searchNameHos}
                                            onchange={searchNameHosChange}
                                        ></lightning-input>
                                    </td>
                                    <td style="width: 10px"></td>
                                    <td>
                                        <button
                                            class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
                                            style="height: 32px"
                                            label="搜索"
                                            onclick={searchHos}
                                        >
                                            搜索
                                        </button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <p style="height: 20px;"></p>
                        <p style="height: 20px"></p>
                        <!-- <p>已选择医院:{chooseHospital}</p> -->
                        <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;">
                        <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">
                                    <lightning-layout-item
                                        padding="around-small"
                                    >
                                        <p style="font-size: 18px">
                                            <strong>搜索结果</strong>
                                        </p>
@@ -424,14 +935,27 @@
                                </lightning-layout>
                                <!-- <p style="font-size: 16px;"><strong>搜索结果</strong></p> -->
                            </div>
                            <div class="myTable" style="padding:10px;">
                                <lightning-datatable class="wrapped-header-datatable" key-field="id" hide-checkbox-column="true" data={hospitalList} columns={hosCols} onrowaction={chooseHos}></lightning-datatable>
                            <div class="myTable" style="padding: 10px">
                                <lightning-datatable
                                    class="wrapped-header-datatable"
                                    key-field="id"
                                    hide-checkbox-column="true"
                                    data={hospitalList}
                                    columns={hosCols}
                                    onrowaction={chooseHos}
                                ></lightning-datatable>
                            </div>
                        </div>
                    </div>
                    <footer class="slds-modal__footer">
                        <!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="取消" onclick={closeHospitalPop}></lightning-button> -->
                        <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" label="取消" onclick={closeHospitalPop}>取消</button>
                        <button
                            class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
                            label="取消"
                            onclick={closeHospitalPop}
                        >
                            取消
                        </button>
                        <!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="确认" onclick={confirmHospital}></lightning-button> -->
                    </footer>
                </div>
@@ -440,50 +964,132 @@
        </template>
        <!-- 搜索合同 -->
        <template if:true={showConPop}>
            <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_medium" style="border: 1px solid #D4D4D4;">
            <section
                role="dialog"
                tabindex="-1"
                aria-labelledby="modal-heading-01"
                aria-modal="true"
                aria-describedby="modal-content-id-1"
                class="slds-modal slds-fade-in-open slds-modal_medium"
                style="border: 1px solid #d4d4d4"
            >
                <div class="slds-modal__container">
                    <header class="slds-modal__header" style="background-color: #F3F3F3;">
                        <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closeContractPop}>
                            <lightning-icon icon-name="utility:close"
                    <header
                        class="slds-modal__header"
                        style="background-color: #f3f3f3"
                    >
                        <button
                            style=""
                            class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
                            title="Close"
                            onclick={closeContractPop}
                        >
                            <lightning-icon
                                icon-name="utility:close"
                                alternative-text="close"
                                variant="inverse"
                                size="small" ></lightning-icon>
                                size="small"
                            ></lightning-icon>
                            <span class="slds-assistive-text">Close</span>
                        </button>
                        <h2 id="modal-heading-03" class="slds-text-heading_medium slds-hyphenate">合同检索</h2>
                        <h2
                            id="modal-heading-03"
                            class="slds-text-heading_medium slds-hyphenate"
                        >
                            合同检索
                        </h2>
                    </header>
                    <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-3" style="border: 1px solid #F3F3F3;">
                        <table style="width: 100%;">
                    <div
                        class="slds-modal__content slds-p-around_medium"
                        id="modal-content-id-3"
                        style="border: 1px solid #f3f3f3"
                    >
                        <table style="width: 100%">
                            <tbody>
                                <tr>
                                    <td style="width: 74px;"><div style="color:#696969;font-size:16px;text-align: left;">合同名称</div></td>
                                    <td style="width: 60%;"><lightning-input class="inputFont" label="合同名称" variant="label-hidden" placeholder="请输入合同名称" value={searchNameCon} onchange={searchNameConChange}></lightning-input></td>
                                    <td style="width: 10px;"></td>
                                    <td><button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height: 32px;" label="搜索" onclick={searchCon}>搜索</button></td>
                                    <td style="width: 74px">
                                        <div
                                            style="
                                                color: #696969;
                                                font-size: 16px;
                                                text-align: left;
                                            "
                                        >
                                            合同名称
                                        </div>
                                    </td>
                                    <td style="width: 60%">
                                        <lightning-input
                                            class="inputFont"
                                            label="合同名称"
                                            variant="label-hidden"
                                            placeholder="请输入合同名称"
                                            value={searchNameCon}
                                            onchange={searchNameConChange}
                                        ></lightning-input>
                                    </td>
                                    <td style="width: 10px"></td>
                                    <td>
                                        <button
                                            class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
                                            style="height: 32px"
                                            label="搜索"
                                            onclick={searchCon}
                                        >
                                            搜索
                                        </button>
                                    </td>
                                    <!-- <td><lightning-button label="搜索" onclick={searchCon}></lightning-button></td> -->
                                </tr>
                            </tbody>
                        </table>
                        <p style="height: 10px;"></p>
                        <p style="height: 10px"></p>
                        <!-- <p>已选择合同:{chooseContract}</p> -->
                        <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;">
                        <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">
                                    <lightning-layout-item
                                        padding="around-small"
                                    >
                                        <p style="font-size: 18px">
                                            <strong>搜索结果</strong>
                                        </p>
                                    </lightning-layout-item>
                                </lightning-layout>
                            </div>
                            <div style="padding:20px;">
                                <lightning-datatable class="wrapped-header-datatable" key-field="id" hide-checkbox-column="true" data={contractList} columns={conCols} onrowaction={chooseCon}></lightning-datatable>
                            <div style="padding: 20px">
                                <lightning-datatable
                                    class="wrapped-header-datatable"
                                    key-field="id"
                                    hide-checkbox-column="true"
                                    data={contractList}
                                    columns={conCols}
                                    onrowaction={chooseCon}
                                ></lightning-datatable>
                            </div>
                        </div>
                    </div>
                    <footer class="slds-modal__footer">
                        <!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="取消" onclick={closeContractPop}></lightning-button> -->
                        <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"  label="取消" onclick={closeContractPop}>取消</button>
                        <button
                            class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
                            label="取消"
                            onclick={closeContractPop}
                        >
                            取消
                        </button>
                        <!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="确认" onclick={confirmContract}></lightning-button> -->
                    </footer>
                </div>
force-app/main/default/lwc/lexConsumable/lexConsumable.js
@@ -20,11 +20,10 @@
import searchContract from '@salesforce/apex/LexSearchContractController.searchContract';
import deleteAtt from '@salesforce/apex/LexConsumableController.deleteAtt';
//table css 
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
import { loadStyle } from 'lightning/platformResourceLoader';
import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
export default class LexConsumable extends NavigationMixin(LightningElement) {
   //页面基础数据
   @track editAble;
   @track pageType;
@@ -115,10 +114,34 @@
   @track tempidHp;
   @track hosCols = [
      // {label:'医院名称',fieldName:'Name',type:'button',typeAttributes:{label:{fieldName:'Name'},variant:'base'}},
      {label:'',type:'button',typeAttributes:{label:'选择'},initialWidth:90,hideDefaultActions: true,wrapText:true},
      {label:'医院名称',fieldName:'Name',initialWidth:380,wrapText:true,hideDefaultActions: true},
      {label:'省份',fieldName:'StateMaster',initialWidth:80,hideDefaultActions: true,wrapText:true},
      {label:'地址',fieldName:'Address__c',hideDefaultActions: true,wrapText:true}
        {
            label: '',
            type: 'button',
            typeAttributes: { label: '选择' },
            initialWidth: 90,
            hideDefaultActions: true,
            wrapText: true
        },
        {
            label: '医院名称',
            fieldName: 'Name',
            initialWidth: 380,
            wrapText: true,
            hideDefaultActions: true
        },
        {
            label: '省份',
            fieldName: 'StateMaster',
            initialWidth: 80,
            hideDefaultActions: true,
            wrapText: true
        },
        {
            label: '地址',
            fieldName: 'Address__c',
            hideDefaultActions: true,
            wrapText: true
        }
   ];
   //合同搜索
   @track contractLabel;
@@ -131,66 +154,222 @@
   @track contractName;
   @track tempidPp;
   @track conCols = [
      {label:'',type:'button',typeAttributes:{label:'选择'},initialWidth:90,hideDefaultActions: true,wrapText:true},
      {label:'合同名称',fieldName:'Name',wrapText:true,hideDefaultActions: true},
      {label:'省份',fieldName:'StateMaster',initialWidth:80,hideDefaultActions: true,wrapText:true},
      {label:'申请销售课',fieldName:'Sales_Section__c',initialWidth:160,hideDefaultActions: true,wrapText:true},
      {label:'允许报价期间(开始日)',fieldName:'Contract_Decide_Start_Date__c',initialWidth:175,hideDefaultActions: true,wrapText:true},
      {label:'允许报价期间(结束日)',fieldName:'Contract_Decide_End_Date__c',initialWidth:175,hideDefaultActions: true,wrapText:true}
        {
            label: '',
            type: 'button',
            typeAttributes: { label: '选择' },
            initialWidth: 90,
            hideDefaultActions: true,
            wrapText: true
        },
        {
            label: '合同名称',
            fieldName: 'Name',
            wrapText: true,
            hideDefaultActions: true
        },
        {
            label: '省份',
            fieldName: 'StateMaster',
            initialWidth: 80,
            hideDefaultActions: true,
            wrapText: true
        },
        {
            label: '申请销售课',
            fieldName: 'Sales_Section__c',
            initialWidth: 160,
            hideDefaultActions: true,
            wrapText: true
        },
        {
            label: '允许报价期间(开始日)',
            fieldName: 'Contract_Decide_Start_Date__c',
            initialWidth: 175,
            hideDefaultActions: true,
            wrapText: true
        },
        {
            label: '允许报价期间(结束日)',
            fieldName: 'Contract_Decide_End_Date__c',
            initialWidth: 175,
            hideDefaultActions: true,
            wrapText: true
        }
   ];
   //消耗品数据col
   get cols(){
      var cols = [];
      cols.push({label:'消耗品名称',fieldName:'prodName',wrapText:true,hideDefaultActions: true,sortable: true,initialWidth:150});
      cols.push({label:'规格',fieldName:'packing_list',wrapText:true,hideDefaultActions: true,initialWidth:50,cellAttributes: { alignment: "right" }});
      cols.push({label:'CFDA状态',fieldName:'prodSFDAStatus',wrapText:true,hideDefaultActions: true,initialWidth:97});
      cols.push({label:'注册证编码号',fieldName:'approbation_No',wrapText:true,hideDefaultActions: true,initialWidth:120});
      cols.push({label:'注册证效期',fieldName:'expiration_Date',wrapText:true,hideDefaultActions: true,initialWidth:105});
      cols.push({label:'第3分类',fieldName:'prodCategory3',wrapText:true,hideDefaultActions: true,initialWidth:78,sortable: true});
      cols.push({label:'第4分类',fieldName:'prodCategory4',wrapText:true,hideDefaultActions: true,initialWidth:107,sortable: true});
      cols.push({label:'第5分类',fieldName:'prodCategory5',wrapText:true,hideDefaultActions: true,initialWidth:80,sortable: true});
        cols.push({
            label: '消耗品名称',
            fieldName: 'prodName',
            wrapText: true,
            hideDefaultActions: true,
            sortable: true,
            initialWidth: 150
        });
        cols.push({
            label: '规格',
            fieldName: 'packing_list',
            wrapText: true,
            hideDefaultActions: true,
            initialWidth: 50,
            cellAttributes: { alignment: 'right' }
        });
        cols.push({
            label: 'CFDA状态',
            fieldName: 'prodSFDAStatus',
            wrapText: true,
            hideDefaultActions: true,
            initialWidth: 97
        });
        cols.push({
            label: '注册证编码号',
            fieldName: 'approbation_No',
            wrapText: true,
            hideDefaultActions: true,
            initialWidth: 120
        });
        cols.push({
            label: '注册证效期',
            fieldName: 'expiration_Date',
            wrapText: true,
            hideDefaultActions: true,
            initialWidth: 105
        });
        cols.push({
            label: '第3分类',
            fieldName: 'prodCategory3',
            wrapText: true,
            hideDefaultActions: true,
            initialWidth: 78,
            sortable: true
        });
        cols.push({
            label: '第4分类',
            fieldName: 'prodCategory4',
            wrapText: true,
            hideDefaultActions: true,
            initialWidth: 107,
            sortable: true
        });
        cols.push({
            label: '第5分类',
            fieldName: 'prodCategory5',
            wrapText: true,
            hideDefaultActions: true,
            initialWidth: 80,
            sortable: true
        });
      if(this.cansee){
         cols.push({label:'标准单价',type:'number',typeAttributes:{minimumFractionDigits: 2},fieldName:'prodIntraTradeList',hideDefaultActions: true,initialWidth:80});
            cols.push({
                label: '标准单价',
                type: 'number',
                typeAttributes: { minimumFractionDigits: 2 },
                fieldName: 'prodIntraTradeList',
                hideDefaultActions: true,
                initialWidth: 80
            });
      }
      if(this.editAble){
         cols.push(
            {label:'采购数量',
            type: "customTableInput",typeAttributes: {
               recordId: { fieldName: "recordId" },
               inputValue: { fieldName: "consumableCount" },
               upperLimit: { fieldName: "upperlimit" },
               lowerLimit: { fieldName: "lowerlimit" },
               allnumber: { fieldName: "allnumber" },
            cols.push({
                label: '采购数量',
                type: 'customTableInput',
                typeAttributes: {
                    recordId: { fieldName: 'recordId' },
                    inputValue: { fieldName: 'consumableCount' },
                    upperLimit: { fieldName: 'upperlimit' },
                    lowerLimit: { fieldName: 'lowerlimit' },
                    allnumber: { fieldName: 'allnumber' },
               valueType: 'Number'
            },
            hideDefaultActions: true,initialWidth:80});
                hideDefaultActions: true,
                initialWidth: 80
            });
      }else{
         cols.push({label:'采购数量',fieldName:'consumableCount',hideDefaultActions: true,initialWidth:80,cellAttributes: { alignment: "right" }});
            cols.push({
                label: '采购数量',
                fieldName: 'consumableCount',
                hideDefaultActions: true,
                initialWidth: 80,
                cellAttributes: { alignment: 'right' }
            });
      }
      cols.push({label:'在库数下限',fieldName:'lowerlimit',hideDefaultActions: true,initialWidth:100,cellAttributes: { alignment: "right" }});
      cols.push({label:'在库数上限',fieldName:'upperlimit',hideDefaultActions: true,initialWidth:100,cellAttributes: { alignment: "right" }});
        cols.push({
            label: '在库数下限',
            fieldName: 'lowerlimit',
            hideDefaultActions: true,
            initialWidth: 100,
            cellAttributes: { alignment: 'right' }
        });
        cols.push({
            label: '在库数上限',
            fieldName: 'upperlimit',
            hideDefaultActions: true,
            initialWidth: 100,
            cellAttributes: { alignment: 'right' }
        });
      // cols.push({label:'有效期库存(盒)',fieldName:'allnumber',hideDefaultActions: true,initialWidth:105,sortable: true});
      cols.push(
         {label:'有效期库存(盒)',
         type: "customInventoryColor",
        cols.push({
            label: '有效期库存(盒)',
            type: 'customInventoryColor',
         typeAttributes: {
            value: { fieldName: "allnumber" },
            upperlimit: { fieldName: "upperlimit" },
            lowerlimit: { fieldName: "lowerlimit" },
                value: { fieldName: 'allnumber' },
                upperlimit: { fieldName: 'upperlimit' },
                lowerlimit: { fieldName: 'lowerlimit' },
            boxPrice: '盒'
         },
         hideDefaultActions: true,initialWidth:126});
      cols.push({label:'有效期库存(个)',fieldName:'allnumber_piece',hideDefaultActions: true,initialWidth:126,cellAttributes: { alignment: "right" }});
            hideDefaultActions: true,
            initialWidth: 126
        });
        cols.push({
            label: '有效期库存(个)',
            fieldName: 'allnumber_piece',
            hideDefaultActions: true,
            initialWidth: 126,
            cellAttributes: { alignment: 'right' }
        });
      return cols;
   }
   //附件cols
   @track attCols = [
      {label:'标题',fieldName:'attUrl',type:'url',typeAttributes:{label:{fieldName:'fileName'},target: "_blank"},hideDefaultActions: true},
      {label:'创建人',fieldName:'ownerUrl',type:'url',typeAttributes:{label:{fieldName:'ownerName'},target: "_blank"},hideDefaultActions: true},
      {label:'上传日期',fieldName:'updateDate',hideDefaultActions: true},
      {label:'',type:'tableCellIcon',typeAttributes:{iconName:'utility:delete',recordId:{fieldName : 'recordId'}},initialWidth:50,hideDefaultActions: true}
        {
            label: '标题',
            fieldName: 'attUrl',
            type: 'url',
            typeAttributes: {
                label: { fieldName: 'fileName' },
                target: '_blank'
            },
            hideDefaultActions: true
        },
        {
            label: '创建人',
            fieldName: 'ownerUrl',
            type: 'url',
            typeAttributes: {
                label: { fieldName: 'ownerName' },
                target: '_blank'
            },
            hideDefaultActions: true
        },
        {
            label: '上传日期',
            fieldName: 'updateDate',
            hideDefaultActions: true
        },
        {
            label: '',
            type: 'tableCellIcon',
            typeAttributes: {
                iconName: 'utility:delete',
                recordId: { fieldName: 'recordId' }
            },
            initialWidth: 50,
            hideDefaultActions: true
        }
   ];
   //取得所有被勾选的产品id
@@ -210,23 +389,33 @@
      for(var i in this.consumableorderdetailsRecordsview){
         var count = 0;
         for(var j in selectedRows){
            if(this.consumableorderdetailsRecordsview[i].recordId == selectedRows[j].recordId){
               count++
               console.log("checkId:"+selectedRows[j].recordId+'---'+this.consumableorderdetailsRecordsview[i].prodName);
                if (
                    this.consumableorderdetailsRecordsview[i].recordId ==
                    selectedRows[j].recordId
                ) {
                    count++;
                    console.log(
                        'checkId:' +
                            selectedRows[j].recordId +
                            '---' +
                            this.consumableorderdetailsRecordsview[i].prodName
                    );
            }
         }
         if(count == 0){
            this.consumableorderdetailsRecordsview[i].check = false;
         }else{
            this.consumableorderdetailsRecordsview[i].check = true;
            this.selectRows.push(this.consumableorderdetailsRecordsview[i].recordId);
                this.selectRows.push(
                    this.consumableorderdetailsRecordsview[i].recordId
                );
         }
      }
      for(var i in this.selectRows){
         console.log("checkId1:"+this.selectRows[i]);
            console.log('checkId1:' + this.selectRows[i]);
         for(var i in this.currentRecord){
            if(this.currentRecord[i].recordId == this.selectRows[i]){
               console.log("currentRecord:"+this.selectRows[i]);
                    console.log('currentRecord:' + this.selectRows[i]);
            }
         }
      }
@@ -238,22 +427,33 @@
      var conCount = event.detail.data.value;
      console.log('countChange:'+recordId+'---'+conCount);
      for(var i in this.consumableorderdetailsRecordsview){
         if(this.consumableorderdetailsRecordsview[i].recordId == recordId){
            this.consumableorderdetailsRecordsview[i].esd.Consumable_count__c = conCount;
            this.consumableorderdetailsRecordsview[i].consumableCount = conCount;
            if (
                this.consumableorderdetailsRecordsview[i].recordId == recordId
            ) {
                this.consumableorderdetailsRecordsview[
                    i
                ].esd.Consumable_count__c = conCount;
                this.consumableorderdetailsRecordsview[i].consumableCount =
                    conCount;
            if(conCount != null && conCount !=0 && conCount!=''){
               this.consumableorderdetailsRecordsview[i].check = true;
            }else{
               this.consumableorderdetailsRecordsview[i].check = false;
               this.consumableorderdetailsRecordsview[i].esd.Consumable_count__c = null;
               this.consumableorderdetailsRecordsview[i].consumableCount = null;
                    this.consumableorderdetailsRecordsview[
                        i
                    ].esd.Consumable_count__c = null;
                    this.consumableorderdetailsRecordsview[i].consumableCount =
                        null;
            }
         }
      }
      this.getAllChecked();
      for(var i in this.currentRecord){
         if(this.currentRecord[i].recordId == recordId){
            console.log("currentRecord1:"+this.currentRecord[i].esd.Consumable_count__c);
                console.log(
                    'currentRecord1:' +
                        this.currentRecord[i].esd.Consumable_count__c
                );
         }
      }
   }
@@ -264,8 +464,22 @@
      var allnumber = event.detail.data.allnumber;
      var upperLimit = event.detail.data.upperLimit;
      var lowerLimit = event.detail.data.lowerLimit;
      console.log('limit:'+conCount+'---'+ allnumber+'---'+lowerLimit+'---'+allnumber);
      if(upperLimit != null && lowerLimit != null && conCount != null && allnumber != null){
        console.log(
            'limit:' +
                conCount +
                '---' +
                allnumber +
                '---' +
                lowerLimit +
                '---' +
                allnumber
        );
        if (
            upperLimit != null &&
            lowerLimit != null &&
            conCount != null &&
            allnumber != null
        ) {
         if(parseInt(allnumber) + parseInt(conCount) > upperLimit){
            // window.alert("该产品订购数量超出库存上限!");
            this.showMyToast('该产品订购数量超出库存上限!','','error');
@@ -294,11 +508,11 @@
      if (!this.stylesLoaded) {
          Promise.all([loadStyle(this, WrappedHeaderTable)])
              .then(() => {
                  console.log("Custom styles loaded");
                    console.log('Custom styles loaded');
                  this.stylesLoaded = true;
              })
              .catch((error) => {
                  console.error("Error loading custom styles");
                    console.error('Error loading custom styles');
              });
      }
   }
@@ -306,14 +520,19 @@
   //页面初始化
   connectedCallback(){
      this.showSpinner = true;
      initPage({type:this.pageType, esetId:this.esetId, keywordStr:this.keyWords})
         .then(result=>{
        initPage({
            type: this.pageType,
            esetId: this.esetId,
            keywordStr: this.keyWords
        })
            .then((result) => {
            this.isNoteStay = result.isNoteStay;
            if(result.result == 'Success'){
               this.editAble = result.editAble;
               this.edoffersPrice = result.edoffersPrice;
               this.cansee = result.cansee;
               this.editDelCommitBtnDisabled = result.editDelCommitBtnDisabled;
                    this.editDelCommitBtnDisabled =
                        result.editDelCommitBtnDisabled;
               this.category3Option = result.category3Option;
               this.category4Option = result.category4Option;
               this.category5Option = result.category5Option;
@@ -323,32 +542,48 @@
               this.hospitalName = result.hospitalName;
               this.contractName = result.contractName;
               this.contractLabel = '经销商有效合同';
               this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview;
                    this.consumableorderdetailsRecordsview =
                        result.consumableorderdetailsRecordsview;
               this.currentPage = 1;
               this.showCurrentReocrd();
               this.getAllChecked();
               this.attachmentRecoeds = result.attachmentRecoeds;
               console.log("attSize:"+this.attachmentRecoeds.length);
                    console.log('attSize:' + this.attachmentRecoeds.length);
               for(var i in this.attachmentRecoeds){
                  this.attachmentRecoeds[i]['recordId'] = this.attachmentRecoeds[i].Concc.Id;
                  this.attachmentRecoeds[i]['documentId'] = this.attachmentRecoeds[i].Concc.ContentDocumentId;
                  this.attachmentRecoeds[i]['fileFullName'] = this.attachmentRecoeds[i].Concc.Title;
                  var contractionName = this.attachmentRecoeds[i].Concc.Title;
                        this.attachmentRecoeds[i]['recordId'] =
                            this.attachmentRecoeds[i].Concc.Id;
                        this.attachmentRecoeds[i]['documentId'] =
                            this.attachmentRecoeds[i].Concc.ContentDocumentId;
                        this.attachmentRecoeds[i]['fileFullName'] =
                            this.attachmentRecoeds[i].Concc.Title;
                        var contractionName =
                            this.attachmentRecoeds[i].Concc.Title;
                  // var contractionName = '长文件长文件长文件长文件';
                  if(contractionName.length > 25){
                     contractionName = contractionName.substr(0,21) + "...";
                            contractionName =
                                contractionName.substr(0, 21) + '...';
                  }
                  this.attachmentRecoeds[i]['fileName'] = contractionName;
                  this.attachmentRecoeds[i]['ownerName'] = this.attachmentRecoeds[i].Concc.Owner.Name;
                  this.attachmentRecoeds[i]['downloadUrl'] = '/sfc/servlet.shepherd/document/download/'+this.attachmentRecoeds[i].Concc.ContentDocumentId+'?operationContext=S1';
                        this.attachmentRecoeds[i]['ownerName'] =
                            this.attachmentRecoeds[i].Concc.Owner.Name;
                        this.attachmentRecoeds[i]['downloadUrl'] =
                            '/sfc/servlet.shepherd/document/download/' +
                            this.attachmentRecoeds[i].Concc.ContentDocumentId +
                            '?operationContext=S1';
                  // var date = this.attachmentRecoeds[i].Concc.CreatedDate;
                  // var year = date.getFullYear();
                  // var month = date.getMonth();
                  // var day = date.getDay();
                  // console.log(year+'-'+month+'-'+day);
                  this.attachmentRecoeds[i]['updateDate'] = new Date(Date.parse(this.attachmentRecoeds[i].Concc.CreatedDate)).toLocaleString();
                  this.attachmentRecoeds[i]['attUrl'] = '/'+this.attachmentRecoeds[i].Concc.Id;
                  this.attachmentRecoeds[i]['ownerUrl'] = '/'+this.attachmentRecoeds[i].Concc.OwnerId;
                        this.attachmentRecoeds[i]['updateDate'] = new Date(
                            Date.parse(
                                this.attachmentRecoeds[i].Concc.CreatedDate
                            )
                        ).toLocaleString();
                        this.attachmentRecoeds[i]['attUrl'] =
                            '/' + this.attachmentRecoeds[i].Concc.Id;
                        this.attachmentRecoeds[i]['ownerUrl'] =
                            '/' + this.attachmentRecoeds[i].Concc.OwnerId;
               }
               this.errorMsgs = result.errorMsgList;
               this.warningMsgs = result.warningMsgList;
@@ -363,13 +598,22 @@
               this.contactDealer = result.contactDealer;
               this.pageType = result.methodType;
               this.proLimitAndDate = result.proLimitAndDate;
               console.log("proLimitAndDate:"+JSON.stringify(this.proLimitAndDate));
                    console.log(
                        'proLimitAndDate:' +
                            JSON.stringify(this.proLimitAndDate)
                    );
               this.coc = result.coc;
               this.cocId = this.coc.Id;
               if(this.pageType == 'hospitalorder' && this.agencyProType != 'ET'){
                    if (
                        this.pageType == 'hospitalorder' &&
                        this.agencyProType != 'ET'
                    ) {
                  this.showHospital = true;
               }
               if(this.coc.Order_status__c == "已提交" || this.coc.Order_status__c == "批准"){
                    if (
                        this.coc.Order_status__c == '已提交' ||
                        this.coc.Order_status__c == '批准'
                    ) {
                  this.showOrderDate = true;
               }
               if(this.coc.Consumable_pdf_insert_day__c != null){
@@ -379,41 +623,60 @@
                  this.showEditBtn = true;
                  this.showOfferPriceInputBtn = true;
               }
               if(this.coc.Order_status__c == "已提交" || this.coc.Order_status__c == "批准" || this.coc.Order_status__c == "驳回"){
                    if (
                        this.coc.Order_status__c == '已提交' ||
                        this.coc.Order_status__c == '批准' ||
                        this.coc.Order_status__c == '驳回'
                    ) {
                  this.disabledEditBtn = true;
                  this.disabledUploadSheetBtn = true;
                  this.disabledSubOrderbtn = true;
                  this.disabledDeleteBtn = true;
                  this.disabledOfferPriceInputBtn = true;
               }
               if(!(this.editDelCommitBtnDisabled || this.editAble || this.edoffersPrice)){
                    if (
                        !(
                            this.editDelCommitBtnDisabled ||
                            this.editAble ||
                            this.edoffersPrice
                        )
                    ) {
                  this.showPrintSheetBtn = true;
                  this.showUploadSheetBtn = true;
                  this.showSubOrderbtn = true;
                  this.showDeleteBtn = true;
               }
               if((this.editDelCommitBtnDisabled || this.editAble || this.edoffersPrice) && this.coc.Order_status__c != "驳回"){
                    if (
                        (this.editDelCommitBtnDisabled ||
                            this.editAble ||
                            this.edoffersPrice) &&
                        this.coc.Order_status__c != '驳回'
                    ) {
                  this.showSaveOrderbtn1 = true;
               }
               if(this.coc.Order_status__c == "驳回" && this.editAble){
                    if (this.coc.Order_status__c == '驳回' && this.editAble) {
                  this.showSaveOrderbtn2 = true;
               }
               if(this.coc.Order_status__c == "驳回" && !this.editAble){
                    if (this.coc.Order_status__c == '驳回' && !this.editAble) {
                  this.showReapplyBtn = true;
               }
               this.showSpinner = false;
               this.showPage = true;
            }else{
               this.showSpinner = false;
               console.log("Error:"+result.errorMsg);
               this.showMyToast('初始化页面失败',result.errorMsg,'error');
                    console.log('Error:' + result.errorMsg);
                    this.showMyToast(
                        '初始化页面失败',
                        result.errorMsg,
                        'error'
                    );
            }
         })
         .catch(error=>{
            .catch((error) => {
            this.showSpinner = false;
            console.log("error:"+error);
                console.log('error:' + error);
            this.showMyToast('初始化页面失败',error,'error');
         })
            });
   }
   //排序
@@ -423,9 +686,13 @@
      if(this.editAble){
         const { fieldName: sortedBy, sortDirection } = event.detail;
         const cloneData = [...this.currentRecord];
         cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));
            cloneData.sort(
                this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1)
            );
         let index = 0;
         let selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
            let selectedRows = this.template
                .querySelector('c-lex-custom-lightning-datatable')
                .getSelectedRows();
         let selectedRowsIds = [];
         for(var i in selectedRows){
            selectedRowsIds.push(selectedRows[i].recordId);
@@ -447,7 +714,9 @@
      }else{
         const { fieldName: sortedBy, sortDirection } = event.detail;
         const cloneData = [...this.currentRecord];
         cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));
            cloneData.sort(
                this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1)
            );
         this.currentRecord = cloneData;
         this.sortDirection = sortDirection;
         this.sortedBy = sortedBy;
@@ -506,18 +775,20 @@
      this.category3 = event.detail.value;
      this.category4 = '';
      this.category5 = '';
      categoryAllload({agencyProTypeStr:this.agencyProType, category3Str:this.category3})
         .then(result=>{
        categoryAllload({
            agencyProTypeStr: this.agencyProType,
            category3Str: this.category3
        }).then((result) => {
            if(result.result == 'Success'){
               this.category4Option = result.category4Option;
               this.category5Option = result.category5Option;
               this.showSpinner = false;
            }else{
               this.showSpinner = false;
               console.log("Error:"+result.errorMsg);
                console.log('Error:' + result.errorMsg);
               this.showMyToast('加载分类失败',result.errorMsg,'error');
            }
         })
        });
   }
   //第四分类change事件
@@ -525,18 +796,21 @@
      this.showSpinner = true;
      this.category4 = event.detail.value;
      this.category5 = '';
      categoryload({agencyProTypeStr:this.agencyProType, category3Str:this.category3, category4Str:this.category4})
         .then(result=>{
        categoryload({
            agencyProTypeStr: this.agencyProType,
            category3Str: this.category3,
            category4Str: this.category4
        }).then((result) => {
            if(result.result == 'Success'){
               this.category4Option = result.category4Option;
               this.category5Option = result.category5Option;
               this.showSpinner = false;
            }else{
               this.showSpinner = false;
               console.log("Error:"+result.errorMsg);
                console.log('Error:' + result.errorMsg);
               this.showMyToast('加载分类失败',result.errorMsg,'error');
            }
         })
        });
   }
   //第五分类change事件
@@ -547,7 +821,8 @@
   //搜索产品
   searchProduct(event){
      this.showSpinner = true;
      searchConsumableorderdetails({userWorkLocationStr:this.userWorkLocation,
        searchConsumableorderdetails({
            userWorkLocationStr: this.userWorkLocation,
         agencyProTypeStr:this.agencyProType,
         accountNameStr:this.accountName,
         accountIdStr:this.accountid,
@@ -562,12 +837,15 @@
         dealerProductIdStr:JSON.stringify(this.dealerProductId), 
         methodTypeStr:this.pageType,
         editAbleStr:this.editAble,
         consumableorderdetailsRecordsviewStr:JSON.stringify(this.consumableorderdetailsRecordsview),
            consumableorderdetailsRecordsviewStr: JSON.stringify(
                this.consumableorderdetailsRecordsview
            ),
         proLimitAndDateList : this.proLimitAndDate
      })
            .then(result=>{
            .then((result) => {
               if(result.result == 'Success'){
                  this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview;
                    this.consumableorderdetailsRecordsview =
                        result.consumableorderdetailsRecordsview;
                  this.currentPage = 1;
                  this.currentRecord = [];
                  this.showCurrentReocrd();
@@ -580,7 +858,7 @@
                  this.showMyToast('搜索成功',result.errorMsg,'success');
               }else{
                  this.showSpinner = false;
                  console.log("Error:"+result.errorMsg);
                    console.log('Error:' + result.errorMsg);
                  if(result.errorMsg == '没有搜索到相关数据'){
                     this.showMyToast(result.errorMsg,'','error');
                  }else{
@@ -588,9 +866,9 @@
                  }
               }
            })
            .catch(error=>{
               console.log("Error:"+error);
            })
            .catch((error) => {
                console.log('Error:' + error);
            });
   }
   //清除搜索栏
@@ -616,11 +894,14 @@
         dealerProductIdStr:JSON.stringify(this.dealerProductId), 
         methodTypeStr:this.pageType,
         editAbleStr:this.editAble,
         consumableorderdetailsRecordsviewStr:JSON.stringify(this.consumableorderdetailsRecordsview),
            consumableorderdetailsRecordsviewStr: JSON.stringify(
                this.consumableorderdetailsRecordsview
            ),
         proLimitAndDateList : this.proLimitAndDate
      }).then(result=>{
        }).then((result) => {
            if(result.result == 'Success'){
               this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview;
                this.consumableorderdetailsRecordsview =
                    result.consumableorderdetailsRecordsview;
               this.currentPage = 1;
               this.currentRecord = [];
               this.showCurrentReocrd();
@@ -629,27 +910,33 @@
               this.showMyToast('搜索成功',result.errorMsg,'success');
            }else{
               this.showSpinner = false;
               console.log("Error:"+result.errorMsg);
                console.log('Error:' + result.errorMsg);
               if(result.errorMsg == '没有搜索到相关数据'){
                  this.showMyToast(result.errorMsg,'','error');
               }else{
                  this.showMyToast('搜索失败',result.errorMsg,'error');
               }
            }
         })
        });
   }
   //选择所有
   checkAll(event){
      for(let i=0, len=this.consumableorderdetailsRecordsview.length; i < len ;i++){
         this.consumableorderdetailsRecordsview[i].check = event.target.checked;
        for (
            let i = 0, len = this.consumableorderdetailsRecordsview.length;
            i < len;
            i++
        ) {
            this.consumableorderdetailsRecordsview[i].check =
                event.target.checked;
      }
   }
   //选择
   check(event){
      let index = event.target.getAttribute("data-index");
      this.consumableorderdetailsRecordsview[index].check = event.target.checked;
        let index = event.target.getAttribute('data-index');
        this.consumableorderdetailsRecordsview[index].check =
            event.target.checked;
   }
   //采购数量change事件
@@ -676,7 +963,9 @@
         cocStr:JSON.stringify(this.coc),
         agencyProTypeStr:this.agencyProType,
         accountidStr:this.accountid,
         consumableorderdetailsRecordsviewStr:JSON.stringify(this.consumableorderdetailsRecordsview),
            consumableorderdetailsRecordsviewStr: JSON.stringify(
                this.consumableorderdetailsRecordsview
            ),
         contactDealerStr:JSON.stringify(this.contactDealer),
         methodTypeStr:this.pageType,
         eSetIdStr:this.esetId,
@@ -684,23 +973,27 @@
         contractIdStr : this.contractId,
         agencyProType1Str : this.agencyProType1,
         OSHFLGStr : this.OSHFLG
      }).then(result=>{
        }).then((result) => {
         this.showSpinner = false;
         if(result.result == 'Success'){
            this.esetId = result.eSetId;
            const config = {
               type: 'standard__webPage',
               attributes: {
                  url: '/lexconsumable?ESetid=' + this.esetId + '&type=' + this.pageType
                        url:
                            '/lexconsumable?ESetid=' +
                            this.esetId +
                            '&type=' +
                            this.pageType
               }
           };
           this[NavigationMixin.Navigate](config);
         }else{
            this.showSpinner = false;
            console.log("Error:"+result.errorMsg);
                console.log('Error:' + result.errorMsg);
            this.showMyToast('保存失败',result.errorMsg,'error');
         }
      })
        });
   }
   //保存订单(驳回)
@@ -711,36 +1004,41 @@
         cocStr:JSON.stringify(this.coc),
         agencyProTypeStr:this.agencyProType,
         accountidStr:this.accountid,
         consumableorderdetailsRecordsviewStr:JSON.stringify(this.consumableorderdetailsRecordsview),
            consumableorderdetailsRecordsviewStr: JSON.stringify(
                this.consumableorderdetailsRecordsview
            ),
         contactDealerStr:JSON.stringify(this.contactDealer),
         methodTypeStr:this.pageType,
         hospitalIdStr:this.hospitalId,
         contractIdStr : this.contractId,
         agencyProType1Str : this.agencyProType1,
         OSHFLGStr : this.OSHFLG
      }).then(result=>{
        }).then((result) => {
         this.showSpinner = false;
         if(result.result == 'Success'){
            this.esetId = result.eSetId;
            const config = {
               type: 'standard__webPage',
               attributes: {
                   url: '/lexconsumable?ESetid=' + this.esetId + '&type=' + this.pageType
                        url:
                            '/lexconsumable?ESetid=' +
                            this.esetId +
                            '&type=' +
                            this.pageType
               }
           };
           this[NavigationMixin.Navigate](config);
         }else{
            this.showSpinner = false;
            console.log("Error:"+result.errorMsg);
                console.log('Error:' + result.errorMsg);
            this.showMyToast('保存失败',result.errorMsg,'error');
         }
      })
        });
   }
   //编辑
   editOrder(event){
      setEditAble({eSetidStr:this.esetId})
         .then(result=>{
        setEditAble({ eSetidStr: this.esetId }).then((result) => {
            if(result.result == 'Success'){
               const config = {
                  type: 'standard__webPage',
@@ -751,10 +1049,10 @@
              this[NavigationMixin.Navigate](config);
            }else{
               this.showSpinner = false;
               console.log("Error:"+result.errorMsg);
                console.log('Error:' + result.errorMsg);
               this.showMyToast('编辑失败',result.errorMsg,'error');
            }
         })
        });
   }
   //打印配置单
@@ -763,7 +1061,8 @@
      const config = {
         type: 'standard__webPage',
         attributes: {
            url: site+'/consumable/PrintConsumblePDF?ESetid='+this.esetId
                url:
                    site + '/consumable/PrintConsumblePDF?ESetid=' + this.esetId
         }
      };
      this[NavigationMixin.Navigate](config);
@@ -777,7 +1076,7 @@
   //提交订单
   submitOrder(event){
      sorder({eSetidStr:this.esetId,accountidStr:this.accountid})
         .then(result=>{
            .then((result) => {
            if(result.result == 'Success'){
               const config = {
                  type: 'standard__webPage',
@@ -790,16 +1089,16 @@
               this.showSpinner = false;
               this.errorMsgs = result.errorMsgList;
               this.warningMsgs = result.warningMsgList;
               console.log("Error:"+result.errorMsg);
               if(result.errorMsg.indexOf("请上传订货配置单附件") != -1){
                    console.log('Error:' + result.errorMsg);
                    if (result.errorMsg.indexOf('请上传订货配置单附件') != -1) {
                  result.errorMsg = '请上传订货配置单附件';
               }
               this.showMyToast('提交失败',result.errorMsg,'error');
            }
         })
         .catch(error=>{
            console.log("Error:"+error);
         })
            .catch((error) => {
                console.log('Error:' + error);
            });
   }
   //删除订单
@@ -807,8 +1106,7 @@
      if(!window.confirm('删除是不可恢复的,你确认要删除吗?')){
         return;
      }
      delConsumable({eSetidStr:this.esetId})
         .then(result=>{
        delConsumable({ eSetidStr: this.esetId }).then((result) => {
            if(result.result == 'Success'){
               const config = {
                  type: 'standard__webPage',
@@ -819,10 +1117,10 @@
            this[NavigationMixin.Navigate](config);
            }else{
               this.showSpinner = false;
               console.log("Error:"+result.errorMsg);
                console.log('Error:' + result.errorMsg);
               this.showMyToast('删除失败',result.errorMsg,'error');
            }
         })
        });
   }
   //特价金额录入
@@ -835,7 +1133,13 @@
         this.showEditBtn = false;
         this.showOfferPriceInputBtn = false;
      }
      if(!(this.editDelCommitBtnDisabled || this.editAble || this.edoffersPrice)){
        if (
            !(
                this.editDelCommitBtnDisabled ||
                this.editAble ||
                this.edoffersPrice
            )
        ) {
         this.showPrintSheetBtn = true;
         this.showUploadSheetBtn = true;
         this.showSubOrderbtn = true;
@@ -846,7 +1150,12 @@
         this.showSubOrderbtn = false;
         this.showDeleteBtn = false;
      }
      if((this.editDelCommitBtnDisabled || this.editAble || this.edoffersPrice) && this.coc.Order_status__c != "驳回"){
        if (
            (this.editDelCommitBtnDisabled ||
                this.editAble ||
                this.edoffersPrice) &&
            this.coc.Order_status__c != '驳回'
        ) {
         this.showSaveOrderbtn1 = true;
      }else{
         this.showSaveOrderbtn1 = false;
@@ -855,8 +1164,7 @@
   //再申请
   reapplyOrder(event){
      backOrder({eSetidStr:this.esetId})
         .then(result=>{
        backOrder({ eSetidStr: this.esetId }).then((result) => {
            if(result.result == 'Success'){
               const config = {
                  type: 'standard__webPage',
@@ -867,10 +1175,10 @@
            this[NavigationMixin.Navigate](config);
            }else{
               this.showSpinner = false;
               console.log("Error:"+result.errorMsg);
                console.log('Error:' + result.errorMsg);
               this.showMyToast('再申请失败',result.errorMsg,'error');
            }
         })
        });
   }
   //附件change事件
@@ -884,7 +1192,11 @@
   //是否显示附件移除
   get attDelBtn(){
      if(this.fileName != '' && this.fileName != null && this.fileName != '请选择一个文件上传'){
        if (
            this.fileName != '' &&
            this.fileName != null &&
            this.fileName != '请选择一个文件上传'
        ) {
         return true;
      }else{
         return false;
@@ -914,16 +1226,16 @@
         }
         this.fileReader= new FileReader();
         this.fileReader.onloadend = (() => {
            this.fileReader.onloadend = () => {
            this.fileContents = this.fileReader.result;
            let base64 = 'base64,';
            this.content = this.fileContents.indexOf(base64) + base64.length;
                this.content =
                    this.fileContents.indexOf(base64) + base64.length;
            this.fileContents = this.fileContents.substring(this.content);
            this.saveToFile();
         });
            };
         this.fileReader.readAsDataURL(this.file);
      }
      else {
        } else {
         this.fileName = '请选择一个文件上传';
      }
   }
@@ -931,18 +1243,22 @@
   //调用上传附件后台方法
   saveToFile() {
      this.showPopSpinner = true;
      filesUpload({pId:this.esetId, fileName: this.file.name, base64Data: encodeURIComponent(this.fileContents)})
         .then(result => {
        filesUpload({
            pId: this.esetId,
            fileName: this.file.name,
            base64Data: encodeURIComponent(this.fileContents)
        })
            .then((result) => {
            this.showPopSpinner = false;
            if(result.result == 'Success'){
               this.closePop();
               window.location.reload();
            }else{
               console.log("Error:"+result.errorMsg);
                    console.log('Error:' + result.errorMsg);
               this.showMyToast('上传失败',result.errorMsg,'error');
            }
         })
         .catch(error => {
            .catch((error) => {
            this.showPopSpinner = false;
            this.showMyToast('上传失败',error,'error');
         });
@@ -951,28 +1267,28 @@
   //删除附件
   deleteAtt(event){
      this.showSpinner = true;
      var recordId = event.target.getAttribute("data-fileid");
        var recordId = event.target.getAttribute('data-fileid');
      console.log('attid:'+recordId);
      deleteAtt({contentVersionId : recordId, cocId : this.esetId})
      .then(result=>{
            .then((result) => {
         this.showSpinner = false;
         if(result.result == 'Success'){
            window.location.reload();
         }else{
            console.log("Error:"+result.errorMsg);
                    console.log('Error:' + result.errorMsg);
            this.showMyToast('删除失败',result.errorMsg,'error');
         }
      })
      .catch(error=>{
            .catch((error) => {
         this.showSpinner = false;
         console.log("Error:"+error);
                console.log('Error:' + error);
         this.showMyToast('删除失败',JSON.stringify(error),'error');
      })
            });
   }
   //预览附件
   previweAtt(event){
      var recordId = event.target.getAttribute("data-fileid");
        var recordId = event.target.getAttribute('data-fileid');
      console.log(recordId);
      this[NavigationMixin.Navigate]({ 
         type:'standard__namedPage',
@@ -989,46 +1305,55 @@
   //打开搜索弹窗,并初始化弹窗
   showSearchHos(event){
      initHospital()
         .then(result=>{
            .then((result) => {
            if(result.result == 'Success'){
               this.showAttHosPop = true;
               this.hospitalList = result.attList;
               for(var i in this.hospitalList){
                  if(this.hospitalList[i].State_Master__c){
                     this.hospitalList[i]['StateMaster'] = this.hospitalList[i].State_Master__r.Name;
                            this.hospitalList[i]['StateMaster'] =
                                this.hospitalList[i].State_Master__r.Name;
                  }
               }
            }else{
               console.log("Error:"+result.errorMsg);
               this.showMyToast('初始化检索医院页面失败',result.errorMsg,'error');
                    console.log('Error:' + result.errorMsg);
                    this.showMyToast(
                        '初始化检索医院页面失败',
                        result.errorMsg,
                        'error'
                    );
            }
         })
         .catch(error=>{
            console.log("Error:"+error);
            .catch((error) => {
                console.log('Error:' + error);
            this.showMyToast('初始化检索医院页面失败',error,'error');
         })
            });
   }
   //检索医院
   searchHos(event){
      searchHospital({searchName:this.searchNameHos, accountId:this.accountid})
         .then(result=>{
        searchHospital({
            searchName: this.searchNameHos,
            accountId: this.accountid
        })
            .then((result) => {
            if(result.result == 'Success'){
               this.hospitalList = result.attList;
               for(var i in this.hospitalList){
                  if(this.hospitalList[i].State_Master__c){
                     this.hospitalList[i]['StateMaster'] = this.hospitalList[i].State_Master__r.Name;
                            this.hospitalList[i]['StateMaster'] =
                                this.hospitalList[i].State_Master__r.Name;
                  }
               }
            }else{
               console.log("Error:"+result.errorMsg);
                    console.log('Error:' + result.errorMsg);
               this.showMyToast('搜索失败',result.errorMsg,'error');
            }
         })
         .catch(error=>{
            console.log("Error:"+error);
            .catch((error) => {
                console.log('Error:' + error);
            this.showMyToast('搜索失败',error,'error');
         })
            });
   }
   //医院名称change
@@ -1094,27 +1419,37 @@
               accountNameStr : this.accountName,
               proLimitAndDateList : this.proLimitAndDate,
               editAbleStr : this.editAble
            }).then(result=>{
                })
                    .then((result) => {
               if(result.result == 'Success'){
                  this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview;
                            this.consumableorderdetailsRecordsview =
                                result.consumableorderdetailsRecordsview;
                  this.currentPage = 1;
                  this.currentRecord = [];
                  this.showCurrentReocrd();
                  this.getAllChecked();
                  this.showMyToast('搜索成功',result.errorMsg,'success');
                            this.showMyToast(
                                '搜索成功',
                                result.errorMsg,
                                'success'
                            );
               }else{
                  console.log("Error:"+result.errorMsg);
                            console.log('Error:' + result.errorMsg);
                  if(result.errorMsg == '没有搜索到相关数据'){
                     this.showMyToast(result.errorMsg,'','error');
                  }else{
                     this.showMyToast('搜索产品失败',result.errorMsg,'error');
                                this.showMyToast(
                                    '搜索产品失败',
                                    result.errorMsg,
                                    'error'
                                );
                  }
               }
            })
            .catch(error=>{
               console.log("Error:"+error);
                    .catch((error) => {
                        console.log('Error:' + error);
               this.showMyToast('搜索产品失败',error,'error');
            })
                    });
            this.tempidHp = 'tempId';
         }
      }else{
@@ -1125,46 +1460,57 @@
   //打开合同检索弹窗并初始化
   showSearchCon(){
      initContract({ctype:this.agencyProType1})
      .then(result=>{
            .then((result) => {
         if(result.result == 'Success'){
            this.showConPop = true;
            this.contractList = result.attList;
            for(var i in this.contractList){
               if(this.contractList[i].State_Master__c){
                  this.contractList[i]['StateMaster'] = this.contractList[i].State_Master__r.Name;
                            this.contractList[i]['StateMaster'] =
                                this.contractList[i].State_Master__r.Name;
               }
            }
         }else{
            console.log("Error:"+result.errorMsg);
            this.showMyToast('初始化检索合同页面失败',result.errorMsg,'error');
                    console.log('Error:' + result.errorMsg);
                    this.showMyToast(
                        '初始化检索合同页面失败',
                        result.errorMsg,
                        'error'
                    );
         }
      })
      .catch(error=>{
         console.log("Error:"+error);
            .catch((error) => {
                console.log('Error:' + error);
         this.showMyToast('初始化检索合同页面失败',error,'error');
      })
            });
   }
   //检索合同
   searchCon(){
      searchContract({searchName:this.searchNameCon, accountId:this.accountid, ctype:this.agencyProType1,OSHFLGStr : this.OSHFLG})
      .then(result=>{
        searchContract({
            searchName: this.searchNameCon,
            accountId: this.accountid,
            ctype: this.agencyProType1,
            OSHFLGStr: this.OSHFLG
        })
            .then((result) => {
         if(result.result == 'Success'){
            this.contractList = result.attList;
            for(var i in this.contractList){
               if(this.contractList[i].State_Master__c){
                  this.contractList[i]['StateMaster'] = this.contractList[i].State_Master__r.Name;
                            this.contractList[i]['StateMaster'] =
                                this.contractList[i].State_Master__r.Name;
               }
            }
         }else{
            console.log("Error:"+result.errorMsg);
                    console.log('Error:' + result.errorMsg);
            this.showMyToast('搜索失败',result.errorMsg,'error');
         }
      })
      .catch(error=>{
         console.log("Error:"+error);
            .catch((error) => {
                console.log('Error:' + error);
         this.showMyToast('搜索失败',error,'error');
      })
            });
   }
   searchNameConChange(event){
@@ -1203,7 +1549,12 @@
         this.tempidPp = this.chooseContractId;
         this.contractName = this.chooseContract;
         this.closeContractPop();
         if(this.tempidPp != 'tempId' && this.tempidPp != '' && this.contractId != '' && this.pageType == 'promotionorder'){
            if (
                this.tempidPp != 'tempId' &&
                this.tempidPp != '' &&
                this.contractId != '' &&
                this.pageType == 'promotionorder'
            ) {
            searchorderdetails({
               methodTypeStr : this.pageType,
               accountIdStr : this.accountid,
@@ -1213,27 +1564,37 @@
               accountNameStr : this.accountName,
               proLimitAndDateList : this.proLimitAndDate,
               editAbleStr : this.editAble
            }).then(result=>{
                })
                    .then((result) => {
               if(result.result == 'Success'){
                  this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview;
                            this.consumableorderdetailsRecordsview =
                                result.consumableorderdetailsRecordsview;
                  this.currentPage = 1;
                  this.currentRecord = [];
                  this.showCurrentReocrd();
                  this.getAllChecked();
                  this.showMyToast('搜索成功',result.errorMsg,'success');
                            this.showMyToast(
                                '搜索成功',
                                result.errorMsg,
                                'success'
                            );
               }else{
                  console.log("Error:"+result.errorMsg);
                            console.log('Error:' + result.errorMsg);
                  if(result.errorMsg == '没有搜索到相关数据'){
                     this.showMyToast(result.errorMsg,'','error');
                  }else{
                     this.showMyToast('搜索产品失败',result.errorMsg,'error');
                                this.showMyToast(
                                    '搜索产品失败',
                                    result.errorMsg,
                                    'error'
                                );
                  }
               }
            })
            .catch(error=>{
               console.log("Error:"+error);
                    .catch((error) => {
                        console.log('Error:' + error);
               this.showMyToast('搜索产品失败',error,'error');
            })
                    });
            this.tempidPp = 'tempId';
         }
      }else{
@@ -1251,12 +1612,18 @@
         iconName = 'utility:error';
      }
      if(message != ''){
         content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
            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);
        this.template
            .querySelector('c-common-toast')
            .showToast(variant, content, iconName, 10000);
      // var mode;
      // if(this.isNoteStay){
      //     mode ='sticky';
@@ -1277,10 +1644,14 @@
      var startIndex = 0;
      var endIndex = 0;
      console.log('len:'+this.consumableorderdetailsRecordsview.length);
      if(this.consumableorderdetailsRecordsview != null && this.consumableorderdetailsRecordsview.length > 0){
        if (
            this.consumableorderdetailsRecordsview != null &&
            this.consumableorderdetailsRecordsview.length > 0
        ) {
         var currentRecord = [];
         var currentCount = 0;
         var mu = this.consumableorderdetailsRecordsview.length % this.pageSize;
            var mu =
                this.consumableorderdetailsRecordsview.length % this.pageSize;
         if(this.currentPage == this.totalPage){
            if(mu != 0){
               currentCount = mu;
@@ -1308,12 +1679,17 @@
         for(var i = startIndex; i <= endIndex; i++){
            var count  = 0;
            for(var j in this.currentRecord){
               if(this.consumableorderdetailsRecordsview[i].recordId == this.currentRecord[j].recordId){
                    if (
                        this.consumableorderdetailsRecordsview[i].recordId ==
                        this.currentRecord[j].recordId
                    ) {
                  count++;
               }
            }
            if(count == 0){
               currentRecord.push(this.consumableorderdetailsRecordsview[i]);
                    currentRecord.push(
                        this.consumableorderdetailsRecordsview[i]
                    );
            }
         }
         this.recordStart = startIndex + 1;
@@ -1334,10 +1710,20 @@
   }
   get totalPage(){
      if(this.consumableorderdetailsRecordsview.length % this.pageSize == 0){
         return Math.trunc(this.consumableorderdetailsRecordsview.length / this.pageSize);
        if (
            this.consumableorderdetailsRecordsview.length % this.pageSize ==
            0
        ) {
            return Math.trunc(
                this.consumableorderdetailsRecordsview.length / this.pageSize
            );
      }else{
         return Math.trunc(this.consumableorderdetailsRecordsview.length / this.pageSize) + 1;
            return (
                Math.trunc(
                    this.consumableorderdetailsRecordsview.length /
                        this.pageSize
                ) + 1
            );
      }
   }
force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.html
@@ -11,23 +11,50 @@
                <div class="borderCss">
                    <div class="headerDorderCss">
                        <lightning-layout>
                            <lightning-layout-item padding="around-small" size="2">
                                <lightning-icon icon-name="action:priority" alternative-text="priority" title="priority"
                                    size="x-small" style="float: left;"></lightning-icon>
                                <p style="font-size: 18px; margin-left: 5px;float: left;">
                            <lightning-layout-item
                                padding="around-small"
                                size="2"
                            >
                                <lightning-icon
                                    icon-name="action:priority"
                                    alternative-text="priority"
                                    title="priority"
                                    size="x-small"
                                    style="float: left"
                                ></lightning-icon>
                                <p
                                    style="
                                        font-size: 18px;
                                        margin-left: 5px;
                                        float: left;
                                    "
                                >
                                    <strong>销量前十</strong>
                                </p>
                            </lightning-layout-item>
                            <lightning-layout-item size="7"></lightning-layout-item>
                            <lightning-layout-item padding="around-small" size="3">
                                <lightning-combobox name="progress" label="财年" value={fiscalYearOption}
                                    variant="label-hidden" options={fiscalYearOptions} onchange={dataChange}
                                    data-field="fiscalYearOption" class="inputFont" style="
                            <lightning-layout-item
                                size="7"
                            ></lightning-layout-item>
                            <lightning-layout-item
                                padding="around-small"
                                size="3"
                            >
                                <lightning-combobox
                                    name="progress"
                                    label="财年"
                                    value={fiscalYearOption}
                                    variant="label-hidden"
                                    options={fiscalYearOptions}
                                    onchange={dataChange}
                                    data-field="fiscalYearOption"
                                    class="inputFont"
                                    style="
                                            min-width: 250px;
                                            max-width: 250px;
                                            margin-left: 10px;
                                            float: left;
                                        "></lightning-combobox>
                                    "
                                ></lightning-combobox>
                            </lightning-layout-item>
                        </lightning-layout>
                    </div>
@@ -36,9 +63,14 @@
                                class="wrapped-header-datatable">
                            </lightning-datatable> -->
                        <c-lex-custom-lightning-datatable key-field="Id" data={topAccountData} columns={topColumns}
                            hide-checkbox-column style="word-wrap: break-word; word-break: break-all"
                            class="wrapped-header-datatable">
                        <c-lex-custom-lightning-datatable
                            key-field="Id"
                            data={topAccountData}
                            columns={topColumns}
                            hide-checkbox-column
                            style="word-wrap: break-word; word-break: break-all"
                            class="wrapped-header-datatable"
                        >
                        </c-lex-custom-lightning-datatable>
                    </div>
                </div>
@@ -71,16 +103,29 @@
                                <p style="font-size: 18px; margin-left: 5px;float: left;">
                                    <strong>销量前十</strong>
                                </p> -->
                                <lightning-icon icon-name="standard:account" alternative-text="Account" title="客户"
                                    size="small" style="float: left;margin-top:3px"></lightning-icon>
                                <lightning-combobox name="progress" label="客户" value={viewOption} variant="label-hidden"
                                    options={listViewOptions} onchange={dataChange} data-field="viewOption"
                                    class="inputFont" style="
                                <lightning-icon
                                    icon-name="standard:account"
                                    alternative-text="Account"
                                    title="客户"
                                    size="small"
                                    style="float: left; margin-top: 3px"
                                ></lightning-icon>
                                <lightning-combobox
                                    name="progress"
                                    label="客户"
                                    value={viewOption}
                                    variant="label-hidden"
                                    options={listViewOptions}
                                    onchange={dataChange}
                                    data-field="viewOption"
                                    class="inputFont"
                                    style="
                                            min-width: 250px;
                                            max-width: 250px;
                                            margin-left: 10px;
                                            float: left;
                                        "></lightning-combobox>
                                    "
                                ></lightning-combobox>
                            </lightning-layout-item>
                        </lightning-layout>
                    </div>
@@ -91,17 +136,31 @@
                        <div lwc:dom="manual" class="resultDiv"></div>
                        <div draggable="false">
                            <div class="slds-m-top_small slds-m-bottom_medium">
                                <lightning-datatable key-field="id" data={pageRecords} columns={columns}
                                    hide-checkbox-column default-sort-direction={defaultSortDirection}
                                    sorted-direction={sortDirection} sorted-by={sortedBy} onsort={onHandleSort}
                                    class="wrapped-header-datatable grayBackground">
                                <lightning-datatable
                                    key-field="id"
                                    data={pageRecords}
                                    columns={columns}
                                    hide-checkbox-column
                                    default-sort-direction={defaultSortDirection}
                                    sorted-direction={sortDirection}
                                    sorted-by={sortedBy}
                                    onsort={onHandleSort}
                                    class="wrapped-header-datatable grayBackground"
                                >
                                </lightning-datatable>
                                <c-paginator onprevious={handlePrevious} onnext={handleNext}
                                    onpageschange={handlePageschange} onfirst={handleFirst} onlast={handleLast}
                                <c-paginator
                                    onprevious={handlePrevious}
                                    onnext={handleNext}
                                    onpageschange={handlePageschange}
                                    onfirst={handleFirst}
                                    onlast={handleLast}
                                    page-size-options={pageSizeOptions}
                                    previous-button-disabled={previousButtonDisabled}
                                    next-button-disabled={nextButtonDisabled} record-start={recordStart}
                                    record-end={recordEnd} total-records={totalRecords}></c-paginator>
                                    next-button-disabled={nextButtonDisabled}
                                    record-start={recordStart}
                                    record-end={recordEnd}
                                    total-records={totalRecords}
                                ></c-paginator>
                            </div>
                        </div>
                    </div>
@@ -117,13 +176,19 @@
                <div></div>
                <strong style="font-size: 20px">{accountDataInfo.name}</strong>
                <p>
                    <lightning-formatted-url value="/lexconsumableaccount" label="返回列表"></lightning-formatted-url>
                    <lightning-formatted-url
                        value="/lexconsumableaccount"
                        label="返回列表"
                    ></lightning-formatted-url>
                </p>
            </lightning-layout-item>
            <lightning-layout-item size="9"></lightning-layout-item>
            <lightning-layout-item size="1">
                <p>
                    <lightning-formatted-url value={printUrl} label="可打印视图"></lightning-formatted-url>
                    <lightning-formatted-url
                        value={printUrl}
                        label="可打印视图"
                    ></lightning-formatted-url>
                </p>
            </lightning-layout-item>
        </lightning-layout>
@@ -155,76 +220,124 @@
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="客户名" value={accountDataInfo.name}
                                            variant="label-inline" read-only style="
                                                border-bottom: 1px solid #dde4e9;
                                            " class="adjustHeight"></lightning-input>
                                    </lightning-layout-item>
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="客户所有人" value={accountDataInfo.ownerName}
                                            variant="label-inline" read-only style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                    </lightning-layout-item>
                                </lightning-layout>
                                <lightning-layout multiple-rows="true">
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="别名1" value={accountDataInfo.site}
                                            variant="label-inline" read-only style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                    </lightning-layout-item>
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="有效/无效" value={accountDataInfo.isActive}
                                            variant="label-inline" read-only style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                    </lightning-layout-item>
                                </lightning-layout>
                                <lightning-layout multiple-rows="true">
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="别名2" value={accountDataInfo.aliasName2}
                                            variant="label-inline" read-only style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                    </lightning-layout-item>
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="禁用理由" value={accountDataInfo.banOnUseReason}
                                            variant="label-inline" read-only style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                    </lightning-layout-item>
                                </lightning-layout>
                                <lightning-layout multiple-rows="true">
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="政府等級" value={accountDataInfo.grade}
                                            variant="label-inline" read-only style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                    </lightning-layout-item>
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="医院所属性质"
                                            value={accountDataInfo.attributeType} variant="label-inline" read-only
                                        <lightning-input
                                            type="text"
                                            label="客户名"
                                            value={accountDataInfo.name}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                            "
                                            class="adjustHeight"
                                        ></lightning-input>
                                    </lightning-layout-item>
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input
                                            type="text"
                                            label="客户所有人"
                                            value={accountDataInfo.ownerName}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                </lightning-layout>
                                <lightning-layout multiple-rows="true">
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input
                                            type="text"
                                            label="别名1"
                                            value={accountDataInfo.site}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input
                                            type="text"
                                            label="有效/无效"
                                            value={accountDataInfo.isActive}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                </lightning-layout>
                                <lightning-layout multiple-rows="true">
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input
                                            type="text"
                                            label="别名2"
                                            value={accountDataInfo.aliasName2}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input
                                            type="text"
                                            label="禁用理由"
                                            value={accountDataInfo.banOnUseReason}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                </lightning-layout>
                                <lightning-layout multiple-rows="true">
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input
                                            type="text"
                                            label="政府等級"
                                            value={accountDataInfo.grade}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input
                                            type="text"
                                            label="医院所属性质"
                                            value={accountDataInfo.attributeType}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                </lightning-layout>
@@ -240,11 +353,16 @@
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="医院专业区分"
                                            value={accountDataInfo.specialityType} variant="label-inline" read-only
                                        <lightning-input
                                            type="text"
                                            label="医院专业区分"
                                            value={accountDataInfo.specialityType}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                </lightning-layout>
                            </div>
@@ -266,18 +384,30 @@
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="省" value={accountDataInfo.stateMasterName}
                                            variant="label-inline" read-only style="
                                        <lightning-input
                                            type="text"
                                            label="省"
                                            value={accountDataInfo.stateMasterName}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="电话" value={accountDataInfo.phone}
                                            variant="label-inline" read-only style="
                                        <lightning-input
                                            type="text"
                                            label="电话"
                                            value={accountDataInfo.phone}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                </lightning-layout>
@@ -285,18 +415,30 @@
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="市" value={accountDataInfo.cityMasterName}
                                            variant="label-inline" read-only style="
                                        <lightning-input
                                            type="text"
                                            label="市"
                                            value={accountDataInfo.cityMasterName}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="电话2" value={accountDataInfo.phoneCall}
                                            variant="label-inline" read-only style="
                                        <lightning-input
                                            type="text"
                                            label="电话2"
                                            value={accountDataInfo.phoneCall}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                </lightning-layout>
@@ -304,18 +446,30 @@
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="县/区" value={accountDataInfo.town}
                                            variant="label-inline" read-only style="
                                        <lightning-input
                                            type="text"
                                            label="县/区"
                                            value={accountDataInfo.town}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="传真" value={accountDataInfo.fax}
                                            variant="label-inline" read-only style="
                                        <lightning-input
                                            type="text"
                                            label="传真"
                                            value={accountDataInfo.fax}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                </lightning-layout>
@@ -323,18 +477,30 @@
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="街道" value={accountDataInfo.street}
                                            variant="label-inline" read-only style="
                                        <lightning-input
                                            type="text"
                                            label="街道"
                                            value={accountDataInfo.street}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="邮编" value={accountDataInfo.postalCode}
                                            variant="label-inline" read-only style="
                                        <lightning-input
                                            type="text"
                                            label="邮编"
                                            value={accountDataInfo.postalCode}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                </lightning-layout>
@@ -342,10 +508,16 @@
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="地址" value={accountDataInfo.address}
                                            variant="label-inline" read-only style="
                                        <lightning-input
                                            type="text"
                                            label="地址"
                                            value={accountDataInfo.address}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                </lightning-layout>
                            </div>
@@ -367,10 +539,16 @@
                                    <lightning-layout-item size="1">
                                    </lightning-layout-item>
                                    <lightning-layout-item size="4">
                                        <lightning-input type="text" label="母公司" value={accountDataInfo.parentName}
                                            variant="label-inline" read-only style="
                                        <lightning-input
                                            type="text"
                                            label="母公司"
                                            value={accountDataInfo.parentName}
                                            variant="label-inline"
                                            read-only
                                            style="
                                                border-bottom: 1px solid #dde4e9;
                                            "></lightning-input>
                                            "
                                        ></lightning-input>
                                    </lightning-layout-item>
                                </lightning-layout>
                            </div>
@@ -380,5 +558,4 @@
            </div>
        </div>
    </template>
</template>
force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js
@@ -1,28 +1,28 @@
import { LightningElement, wire, api, track } from "lwc";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import init from "@salesforce/apex/LexConsumableAccountController.init";
import changeFiscalYearView from "@salesforce/apex/LexConsumableAccountController.changeFiscalYearView";
import changelistView from "@salesforce/apex/LexConsumableAccountController.changelistView";
import accountInit from "@salesforce/apex/LexConsumableAccountInfoController.init";
import { LightningElement, wire, api, track } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init from '@salesforce/apex/LexConsumableAccountController.init';
import changeFiscalYearView from '@salesforce/apex/LexConsumableAccountController.changeFiscalYearView';
import changelistView from '@salesforce/apex/LexConsumableAccountController.changelistView';
import accountInit from '@salesforce/apex/LexConsumableAccountInfoController.init';
//table css
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
import { loadStyle } from 'lightning/platformResourceLoader';
import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
const columns = [
    {
        label: "客户名",
        fieldName: "NameUrl",
        label: '客户名',
        fieldName: 'NameUrl',
        hideDefaultActions: true,
        wrapText: true,
        initialWidth: 200,
        sortable: true,
        type: "url",
        type: 'url',
        typeAttributes: {
            label: {
                fieldName: "Name",
                fieldName: 'Name'
            },
            target:"_blank"
        },
            target: '_blank'
        }
    },
    // {
    //     label: "省",
@@ -39,39 +39,39 @@
    //     },
    // },
    {
        label: "省",
        fieldName: "StateMasterName",
        label: '省',
        fieldName: 'StateMasterName',
        hideDefaultActions: true,
        wrapText: true,
        sortable: true,
        sortable: true
    },
    {
        label: "销售本部医院",
        fieldName: "Salesdepartment_HP__c",
        label: '销售本部医院',
        fieldName: 'Salesdepartment_HP__c',
        hideDefaultActions: true,
        sortable: true,
        wrapText: true,
        wrapText: true
    },
    {
        label: "创建日期",
        fieldName: "CreatedDate",
        label: '创建日期',
        fieldName: 'CreatedDate',
        hideDefaultActions: true,
        sortable: true,
        wrapText: true,
        type: "date",
        type: 'date',
        typeAttributes: {
            timeZone: "Asia/Shanghai",
            day: "numeric",
            month: "numeric",
            year: "numeric",
        },
            timeZone: 'Asia/Shanghai',
            day: 'numeric',
            month: 'numeric',
            year: 'numeric'
        }
    },
    {
        label: "有效/无效",
        fieldName: "Is_Active__c",
        label: '有效/无效',
        fieldName: 'Is_Active__c',
        hideDefaultActions: true,
        sortable: true,
        wrapText: true,
        wrapText: true
    },
    // {
    //     label: "客户记录类型",
@@ -82,11 +82,11 @@
    //     initialWidth: 130,
    // },
    {
        label: "政府等级",
        fieldName: "Grade__c",
        label: '政府等级',
        fieldName: 'Grade__c',
        hideDefaultActions: true,
        sortable: true,
        wrapText: true,
        wrapText: true
    },
    // {
    //     label: "OCSM分类(医院)",
@@ -110,40 +110,40 @@
    //     },
    // },
    {
        label: "市",
        fieldName: "CityMasterName",
        label: '市',
        fieldName: 'CityMasterName',
        hideDefaultActions: true,
        sortable: true,
        wrapText: true,
        wrapText: true
    },
    {
        label: "县/区",
        fieldName: "Town__c",
        label: '县/区',
        fieldName: 'Town__c',
        hideDefaultActions: true,
        sortable: true,
        wrapText: true,
        wrapText: true
    },
    {
        label: "客户电话",
        fieldName: "Phone",
        label: '客户电话',
        fieldName: 'Phone',
        hideDefaultActions: true,
        sortable: true,
        wrapText: true,
    },
        wrapText: true
    }
];
const topColumns = [
    {
        label: "客户名",
        label: '客户名',
        hideDefaultActions: true,
        fieldName : "accountName",
        fieldName: 'accountName',
        wrapText: true,
        type: "customShowAccountUrl",
        type: 'customShowAccountUrl',
        typeAttributes: {
            accountName: { fieldName: "accountName" },
            accountUrl: { fieldName: "accountUrl" },
            isDisable: { fieldName: "isDisable" },
        },
            accountName: { fieldName: 'accountName' },
            accountUrl: { fieldName: 'accountUrl' },
            isDisable: { fieldName: 'isDisable' }
        }
    },
    // {
    //     label: "市",
@@ -158,36 +158,36 @@
    //     },
    // },
    {
        label: "市",
        fieldName: "CityMasterName",
        label: '市',
        fieldName: 'CityMasterName',
        hideDefaultActions: true,
        wrapText: true,
        wrapText: true
    },
    {
        label: "县/区",
        fieldName: "Town__c",
        label: '县/区',
        fieldName: 'Town__c',
        hideDefaultActions: true,
        wrapText: true,
        wrapText: true
    },
    {
        label: "销量占比",
        fieldName: "proportion",
        label: '销量占比',
        fieldName: 'proportion',
        hideDefaultActions: true,
        wrapText: true,
        initialWidth: 100,
        cellAttributes: { alignment: "right" },
        cellAttributes: { alignment: 'right' }
    },
    {
        label: "操作",
        fieldName: "Town__c",
        label: '操作',
        fieldName: 'Town__c',
        type: 'weeklyReport',
        initialWidth: 150,
        typeAttributes: {
            recordId: { fieldName: "Id" },
            hospitalName: { fieldName: "Name" },
            isShowButton: { fieldName: "isShowButton" },
            recordId: { fieldName: 'Id' },
            hospitalName: { fieldName: 'Name' },
            isShowButton: { fieldName: 'isShowButton' }
        },
        hideDefaultActions: true,
        hideDefaultActions: true
    }
];
export default class LexConsumableAccount extends LightningElement {
@@ -195,13 +195,13 @@
    topColumns = topColumns;
    @track isShowSpinner = false;
    @track pageRecords = [];
    @track accountId = "";
    @track agencyProType = "";
    @track agencyProTypestr = "";
    @track accountId = '';
    @track agencyProType = '';
    @track agencyProTypestr = '';
    @track listViewOptions = [
        {
            label: "01. 医院_Hospital",
            value: "01. 医院_Hospital",
            label: '01. 医院_Hospital',
            value: '01. 医院_Hospital'
        },
        // {
        //     label: "61. 医院_Hospital草案中的医院",
@@ -212,22 +212,22 @@
        //     value: "62. 医院_Hospital申请中的医院",
        // },
        {
            label: "63. 医院_Hospital上周创建的医院",
            value: "63. 医院_Hospital上周创建的医院",
        },
            label: '63. 医院_Hospital上周创建的医院',
            value: '63. 医院_Hospital上周创建的医院'
        }
    ];
    @track viewOption = "01. 医院_Hospital";
    @track viewOption = '01. 医院_Hospital';
    @track isShowAccountInfo = false;
    @track topAccountData = [];
    //前端排序
    defaultSortDirection = "asc";
    sortDirection = "asc";
    defaultSortDirection = 'asc';
    sortDirection = 'asc';
    sortedBy;
    //分页start
    @track sortBy = "";
    @track sortBy = '';
    @track pageSize = 10;
    error;
    records;
@@ -243,31 +243,30 @@
    @track recordEnd = 0;
    //end
    @track AccId = "";
    @track printUrl = "";
    @track AccId = '';
    @track printUrl = '';
    @track accountDataInfo = {
        name: "",
        ownerName: "",
        site: "",
        isActive: "",
        aliasName2: "",
        banOnUseReason: "",
        grade: "",
        attributeType: "",
        oCMCategory: "",
        specialityType: "",
        stateMasterName: "",
        phone: "",
        cityMasterName: "",
        phoneCall: "",
        town: "",
        fax: "",
        street: "",
        postalCode: "",
        address: "",
        parentName: "",
        name: '',
        ownerName: '',
        site: '',
        isActive: '',
        aliasName2: '',
        banOnUseReason: '',
        grade: '',
        attributeType: '',
        oCMCategory: '',
        specialityType: '',
        stateMasterName: '',
        phone: '',
        cityMasterName: '',
        phoneCall: '',
        town: '',
        fax: '',
        street: '',
        postalCode: '',
        address: '',
        parentName: ''
    };
    stylesLoaded = false;
@@ -275,7 +274,7 @@
    @track fiscalYearOptions = [
        { label: '本财年', value: 'thisYear' },
        { label: '上一财年', value: 'lastYear' },
        { label: '上一财年+本财年', value: 'allYear' },
        { label: '上一财年+本财年', value: 'allYear' }
    ];
    @track fiscalYearOption = 'thisYear';
    @track topInfo = [];
@@ -284,19 +283,19 @@
        if (!this.stylesLoaded) {
            Promise.all([loadStyle(this, WrappedHeaderTable)])
                .then(() => {
                    console.log("Custom styles loaded");
                    console.log('Custom styles loaded');
                    this.stylesLoaded = true;
                })
                .catch((error) => {
                    console.error("Error loading custom styles");
                    console.error('Error loading custom styles');
                });
        }
    }
    //获取链接参数
    getQueryString(name) {
        console.log("getQueryString name " + name);
        let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        console.log('getQueryString name ' + name);
        let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
        let r = window.location.search.substr(1).match(reg);
        if (r != null) {
            return decodeURIComponent(r[2]);
@@ -306,47 +305,76 @@
    connectedCallback() {
        this.isShowSpinner = true;
        this.AccId = this.getQueryString("AccId");
        this.AccId = this.AccId == null ? "" : this.AccId;
        if (this.AccId != "") {
            console.log("this.AccId = " + this.AccId);
        this.AccId = this.getQueryString('AccId');
        this.AccId = this.AccId == null ? '' : this.AccId;
        if (this.AccId != '') {
            console.log('this.AccId = ' + this.AccId);
            accountInit({
                accId: this.AccId,
            }).then((r) => {
                accId: this.AccId
            })
                .then((r) => {
                r = JSON.parse(JSON.stringify(r));
                console.log("r = " + JSON.stringify(r));
                if (r.status == "Success") {
                    console.log('r.entity.obj = ' + JSON.stringify(r.entity.obj))
                    console.log('r = ' + JSON.stringify(r));
                    if (r.status == 'Success') {
                        console.log(
                            'r.entity.obj = ' + JSON.stringify(r.entity.obj)
                        );
                    this.accountDataInfo.name = r.entity.obj.Name;
                    this.accountDataInfo.ownerName = r.entity.obj.Owner == null ? "" : r.entity.obj.Owner.Name;
                        this.accountDataInfo.ownerName =
                            r.entity.obj.Owner == null
                                ? ''
                                : r.entity.obj.Owner.Name;
                    this.accountDataInfo.site = r.entity.obj.site;
                    this.accountDataInfo.isActive = r.entity.obj.Is_Active__c;
                    this.accountDataInfo.aliasName2 = r.entity.obj.Alias_Name2__c;
                    this.accountDataInfo.banOnUseReason = r.entity.obj.Ban_On_Use_Reason__c;
                        this.accountDataInfo.isActive =
                            r.entity.obj.Is_Active__c;
                        this.accountDataInfo.aliasName2 =
                            r.entity.obj.Alias_Name2__c;
                        this.accountDataInfo.banOnUseReason =
                            r.entity.obj.Ban_On_Use_Reason__c;
                    this.accountDataInfo.grade = r.entity.obj.Grade__c;
                    this.accountDataInfo.attributeType = r.entity.obj.Attribute_Type__c;
                    this.accountDataInfo.oCMCategory = r.entity.obj.OCM_Category__c;
                    this.accountDataInfo.specialityType = r.entity.obj.Speciality_Type__c;
                    this.accountDataInfo.stateMasterName = r.entity.obj.State_Master__r == null ? "" : r.entity.obj.State_Master__r.Name;
                        this.accountDataInfo.attributeType =
                            r.entity.obj.Attribute_Type__c;
                        this.accountDataInfo.oCMCategory =
                            r.entity.obj.OCM_Category__c;
                        this.accountDataInfo.specialityType =
                            r.entity.obj.Speciality_Type__c;
                        this.accountDataInfo.stateMasterName =
                            r.entity.obj.State_Master__r == null
                                ? ''
                                : r.entity.obj.State_Master__r.Name;
                    this.accountDataInfo.phone = r.entity.obj.Phone;
                    this.accountDataInfo.cityMasterName = r.entity.obj.City_Master__r == null ? "" : r.entity.obj.City_Master__r.Name;
                    this.accountDataInfo.phoneCall = r.entity.obj.PhoneCall__c;
                        this.accountDataInfo.cityMasterName =
                            r.entity.obj.City_Master__r == null
                                ? ''
                                : r.entity.obj.City_Master__r.Name;
                        this.accountDataInfo.phoneCall =
                            r.entity.obj.PhoneCall__c;
                    this.accountDataInfo.town = r.entity.obj.Town__c;
                    this.accountDataInfo.fax = r.entity.obj.Fax;
                    this.accountDataInfo.street = r.entity.obj.Street__c;
                    this.accountDataInfo.postalCode = r.entity.obj.Postal_Code__c;
                        this.accountDataInfo.postalCode =
                            r.entity.obj.Postal_Code__c;
                    this.accountDataInfo.address = r.entity.obj.Address__c;
                    this.accountDataInfo.parentName = r.entity.obj.Parent == null ? "" : r.entity.obj.Parent.Name;
                    console.log('this.accountDataInfo = ' + JSON.stringify(this.accountDataInfo))
                    this.printUrl = "/lexconsumableaccountinfoprint?AccId=" + this.AccId;
                        this.accountDataInfo.parentName =
                            r.entity.obj.Parent == null
                                ? ''
                                : r.entity.obj.Parent.Name;
                        console.log(
                            'this.accountDataInfo = ' +
                                JSON.stringify(this.accountDataInfo)
                        );
                        this.printUrl =
                            '/lexconsumableaccountinfoprint?AccId=' +
                            this.AccId;
                    this.isShowAccountInfo = true;
                    this.isShowSpinner = false;
                } else {
                    console.log("r = " + JSON.stringify(r));
                        console.log('r = ' + JSON.stringify(r));
                    this.showMyToast('Error', r.msg, 'Error');
                }
            }).catch((error) => {
                console.log("error = " + JSON.stringify(error));
                })
                .catch((error) => {
                    console.log('error = ' + JSON.stringify(error));
                this.showMyToast('Error', '初始化失败', 'Error');
            });
        } else {
@@ -354,67 +382,119 @@
                pageSizeLWC: this.pageSize,
                pageTokenLWC: this.currentPageToken,
                fiscalYear: this.fiscalYearOption
            }).then((r) => {
            })
                .then((r) => {
                r = JSON.parse(JSON.stringify(r));
                console.log("r = " + JSON.stringify(r));
                if (r.status == "Success") {
                    console.log('r = ' + JSON.stringify(r));
                    if (r.status == 'Success') {
                    //分页
                    this.nextPageToken = r.entity.paginatedAccounts.nextPageToken;
                    this.totalRecords = r.entity.paginatedAccounts.totalRecords;
                    this.recordStart = r.entity.paginatedAccounts.recordStart;
                        this.nextPageToken =
                            r.entity.paginatedAccounts.nextPageToken;
                        this.totalRecords =
                            r.entity.paginatedAccounts.totalRecords;
                        this.recordStart =
                            r.entity.paginatedAccounts.recordStart;
                    this.recordEnd = r.entity.paginatedAccounts.recordEnd;
                    this.totalPages = Math.ceil(
                        r.entity.paginatedAccounts.totalRecords / this.pageSize
                            r.entity.paginatedAccounts.totalRecords /
                                this.pageSize
                    );
                    console.log("this.totalPages = " + this.totalPages);
                    this.paginationVisibility = this.totalPages > 1 ? true : false;
                        console.log('this.totalPages = ' + this.totalPages);
                        this.paginationVisibility =
                            this.totalPages > 1 ? true : false;
                    this.pageRecords = r.entity.pageRecords;
                    this.accountId = r.entity.accountId;
                    this.agencyProType = r.entity.agencyProType;
                    this.agencyProTypestr = r.entity.agencyProTypestr;
                    console.log("this.agencyProTypestr = " + this.agencyProTypestr);
                        console.log(
                            'this.agencyProTypestr = ' + this.agencyProTypestr
                        );
                    for (var i in this.pageRecords) {
                        this.pageRecords[i]["Is_Active__c"] = this.pageRecords[i].Is_Active__c.replace('効','效');
                        this.pageRecords[i]["NameUrl"] = "/s/lexconsumableaccount?AccId=" + this.pageRecords[i].Id;
                        this.pageRecords[i]["StateMasterName"] = this.pageRecords[i].State_Master__r.Name;
                        this.pageRecords[i]["StateMasterUrl"] = "/" + this.pageRecords[i].State_Master__c;
                        this.pageRecords[i]["CityMasterName"] = this.pageRecords[i].City_Master__r.Name;
                        this.pageRecords[i]["CityMasterNameUrl"] = "/" + this.pageRecords[i].City_Master__c;
                        this.pageRecords[i]["RecordTypeName"] = this.pageRecords[i].RecordType.Name;
                            this.pageRecords[i]['Is_Active__c'] =
                                this.pageRecords[i].Is_Active__c.replace(
                                    '効',
                                    '效'
                                );
                            this.pageRecords[i]['NameUrl'] =
                                '/s/lexconsumableaccount?AccId=' +
                                this.pageRecords[i].Id;
                            this.pageRecords[i]['StateMasterName'] =
                                this.pageRecords[i].State_Master__r.Name;
                            this.pageRecords[i]['StateMasterUrl'] =
                                '/' + this.pageRecords[i].State_Master__c;
                            this.pageRecords[i]['CityMasterName'] =
                                this.pageRecords[i].City_Master__r.Name;
                            this.pageRecords[i]['CityMasterNameUrl'] =
                                '/' + this.pageRecords[i].City_Master__c;
                            this.pageRecords[i]['RecordTypeName'] =
                                this.pageRecords[i].RecordType.Name;
                    }
                    console.log(
                        "this.listViewOptions = " + JSON.stringify(this.listViewOptions)
                            'this.listViewOptions = ' +
                                JSON.stringify(this.listViewOptions)
                    );
                    console.log('r.entity.topInfo = ' + JSON.stringify(r.entity.topInfo))
                        console.log(
                            'r.entity.topInfo = ' +
                                JSON.stringify(r.entity.topInfo)
                        );
                    //top10客户
                    this.topInfo = r.entity.topInfo;
                    console.log("this.topInfo = " + JSON.stringify(this.topInfo));
                        console.log(
                            'this.topInfo = ' + JSON.stringify(this.topInfo)
                        );
                    this.topAccountData = this.topInfo.acList;
                    console.log(
                        "this.topAccountData = " + JSON.stringify(this.topAccountData)
                            'this.topAccountData = ' +
                                JSON.stringify(this.topAccountData)
                    );
                    console.log('9/3 = ' + this.keepTwoDecimalStr(this.amend(9, 3, '/').toFixed(2)));
                        console.log(
                            '9/3 = ' +
                                this.keepTwoDecimalStr(
                                    this.amend(9, 3, '/').toFixed(2)
                                )
                        );
                    let total = 100;
                    try {
                        for (var i in this.topAccountData) {
                            console.log('i = ' + i);
                            this.topAccountData[i]["accountName"] = this.topAccountData[i].Name;
                            this.topAccountData[i]["accountUrl"] = "/s/lexconsumableaccount?AccId=" + this.topAccountData[i].Id;
                            this.topAccountData[i]["isDisable"] = false;
                            this.topAccountData[i]["StateMasterName"] = this.topAccountData[i].State_Master__r.Name;
                            this.topAccountData[i]["StateMasterUrl"] = "/" + this.topAccountData[i].State_Master__c;
                            this.topAccountData[i]["CityMasterName"] = this.topAccountData[i].City_Master__r.Name;
                            this.topAccountData[i]["CityMasterNameUrl"] = "/" + this.topAccountData[i].City_Master__c;
                            this.topAccountData[i]["RecordTypeName"] = this.topAccountData[i].RecordType.Name;
                            this.topAccountData[i]["isShowButton"] = true;
                            let number = this.keepTwoDecimalStr((this.amend(this.topInfo.deList[i], this.topInfo.saleAmount, '/') * 100).toFixed(2));
                                this.topAccountData[i]['accountName'] =
                                    this.topAccountData[i].Name;
                                this.topAccountData[i]['accountUrl'] =
                                    '/s/lexconsumableaccount?AccId=' +
                                    this.topAccountData[i].Id;
                                this.topAccountData[i]['isDisable'] = false;
                                this.topAccountData[i]['StateMasterName'] =
                                    this.topAccountData[i].State_Master__r.Name;
                                this.topAccountData[i]['StateMasterUrl'] =
                                    '/' +
                                    this.topAccountData[i].State_Master__c;
                                this.topAccountData[i]['CityMasterName'] =
                                    this.topAccountData[i].City_Master__r.Name;
                                this.topAccountData[i]['CityMasterNameUrl'] =
                                    '/' + this.topAccountData[i].City_Master__c;
                                this.topAccountData[i]['RecordTypeName'] =
                                    this.topAccountData[i].RecordType.Name;
                                this.topAccountData[i]['isShowButton'] = true;
                                let number = this.keepTwoDecimalStr(
                                    (
                                        this.amend(
                                            this.topInfo.deList[i],
                                            this.topInfo.saleAmount,
                                            '/'
                                        ) * 100
                                    ).toFixed(2)
                                );
                            total -= number;
                            this.topAccountData[i]["proportion"] = number + '%';
                                this.topAccountData[i]['proportion'] =
                                    number + '%';
                        }
                        console.log('this.topAccountData = ' + JSON.stringify(this.topAccountData));
                            console.log(
                                'this.topAccountData = ' +
                                    JSON.stringify(this.topAccountData)
                            );
                        //其他
                        if (total != 100) {
@@ -427,32 +507,43 @@
                                CityMasterNameUrl: '/lexconsumableaccount',
                                Town__c: '...',
                                isShowButton: false
                            })
                                });
                        } else {
                            let title = '';
                            for (var key in this.fiscalYearOptions) {
                                if (this.fiscalYearOption == this.fiscalYearOptions[key].value)
                                    title = this.fiscalYearOptions[key].label;
                                    if (
                                        this.fiscalYearOption ==
                                        this.fiscalYearOptions[key].value
                                    )
                                        title =
                                            this.fiscalYearOptions[key].label;
                            }
                            this.showMyToast(title, '无数据', 'Error');
                        }
                        this.isShowSpinner = false;
                    } catch (error) {
                        console.log('error = ' + error.message)
                            console.log('error = ' + error.message);
                    }
                } else {
                    console.log("r = " + JSON.stringify(r));
                        console.log('r = ' + JSON.stringify(r));
                    this.showMyToast('Error', r.msg, 'Error');
                }
            }).catch((error) => {
                console.log("error = " + JSON.stringify(error));
                this.showMyToast('Error', '销量前十客户初始化失败', 'Error');
                })
                .catch((error) => {
                    console.log('error = ' + JSON.stringify(error));
                    this.showMyToast(
                        'Error',
                        '销量前十客户初始化失败',
                        'Error'
                    );
            });
        }
    }
    amend(num1, num2, symbol) {
        console.log('num1 = ' + num1);
        console.log('num2 = ' + num2);
        console.log('symbol = ' + symbol);
        var str1 = num1.toString(),
            str2 = num2.toString(),
            result,
@@ -460,28 +551,28 @@
            str2Length;
        //解决整数没有小数点方法
        try {
            str1Length = str1.split(".")[1].length;
            str1Length = str1.split('.')[1].length;
        } catch (error) {
            str1Length = 0;
        }
        try {
            str2Length = str2.split(".")[1].length;
            str2Length = str2.split('.')[1].length;
        } catch (error) {
            str2Length = 0;
        }
        var step = Math.pow(10, Math.max(str1Length, str2Length));
        console.log(step);
        switch (symbol) {
            case "+":
            case '+':
                result = (num1 * step + num2 * step) / step;
                break;
            case "-":
            case '-':
                result = (num1 * step - num2 * step) / step;
                break;
            case "*":
            case '*':
                result = (num1 * step * (num2 * step)) / step / step;
                break;
            case "/":
            case '/':
                result = (num1 * step) / (num2 * step);
                break;
            default:
@@ -489,7 +580,6 @@
        }
        return result;
    }
    keepTwoDecimalStr(num) {
        const result = Number(num.toString().match(/^\d+(?:\.\d{0,2})?/));
@@ -503,12 +593,12 @@
            s += '0';
        }
        return s;
    };
    }
    dataChange(event) {
        let fieldName = event.target.getAttribute("data-field");
        let fieldName = event.target.getAttribute('data-field');
        let value = event.detail.value;
        console.log("fieldName = " + fieldName + " value = " + value);
        console.log('fieldName = ' + fieldName + ' value = ' + value);
        switch (fieldName) {
            case 'viewOption':
                this.viewOption = value;
@@ -525,32 +615,52 @@
        this.isShowSpinner = true;
        changeFiscalYearView({
            fiscalYear: this.fiscalYearOption
        }).then((r) => {
        })
            .then((r) => {
            r = JSON.parse(JSON.stringify(r));
            console.log("r = " + JSON.stringify(r));
            if (r.status == "Success") {
                console.log('r = ' + JSON.stringify(r));
                if (r.status == 'Success') {
                //top10客户
                this.topInfo = r.entity.topInfo;
                console.log("this.topInfo = " + JSON.stringify(this.topInfo));
                    console.log(
                        'this.topInfo = ' + JSON.stringify(this.topInfo)
                    );
                this.topAccountData = this.topInfo.acList;
                console.log(
                    "this.topAccountData = " + JSON.stringify(this.topAccountData)
                        'this.topAccountData = ' +
                            JSON.stringify(this.topAccountData)
                );
                let total = 100;
                for (var i in this.topAccountData) {
                    console.log('i = ' + i);
                    this.topAccountData[i]["accountName"] = this.topAccountData[i].Name;
                    this.topAccountData[i]["accountUrl"] = "/s/lexconsumableaccount?AccId=" + this.topAccountData[i].Id;
                    this.topAccountData[i]["isDisable"] = false;
                    this.topAccountData[i]["StateMasterName"] = this.topAccountData[i].State_Master__r.Name;
                    this.topAccountData[i]["StateMasterUrl"] = "/" + this.topAccountData[i].State_Master__c;
                    this.topAccountData[i]["CityMasterName"] = this.topAccountData[i].City_Master__r.Name;
                    this.topAccountData[i]["CityMasterNameUrl"] = "/" + this.topAccountData[i].City_Master__c;
                    this.topAccountData[i]["RecordTypeName"] = this.topAccountData[i].RecordType.Name;
                    this.topAccountData[i]["isShowButton"] = true;
                    let number = this.keepTwoDecimalStr((this.amend(this.topInfo.deList[i], this.topInfo.saleAmount, '/') * 100).toFixed(2));
                        this.topAccountData[i]['accountName'] =
                            this.topAccountData[i].Name;
                        this.topAccountData[i]['accountUrl'] =
                            '/s/lexconsumableaccount?AccId=' +
                            this.topAccountData[i].Id;
                        this.topAccountData[i]['isDisable'] = false;
                        this.topAccountData[i]['StateMasterName'] =
                            this.topAccountData[i].State_Master__r.Name;
                        this.topAccountData[i]['StateMasterUrl'] =
                            '/' + this.topAccountData[i].State_Master__c;
                        this.topAccountData[i]['CityMasterName'] =
                            this.topAccountData[i].City_Master__r.Name;
                        this.topAccountData[i]['CityMasterNameUrl'] =
                            '/' + this.topAccountData[i].City_Master__c;
                        this.topAccountData[i]['RecordTypeName'] =
                            this.topAccountData[i].RecordType.Name;
                        this.topAccountData[i]['isShowButton'] = true;
                        let number = this.keepTwoDecimalStr(
                            (
                                this.amend(
                                    this.topInfo.deList[i],
                                    this.topInfo.saleAmount,
                                    '/'
                                ) * 100
                            ).toFixed(2)
                        );
                    total -= number;
                    this.topAccountData[i]["proportion"] = number + '%';
                        this.topAccountData[i]['proportion'] = number + '%';
                }
                // //其他
@@ -564,23 +674,27 @@
                        CityMasterNameUrl: '/lexconsumableaccount',
                        Town__c: '...',
                        isShowButton: false
                    })
                        });
                } else {
                    let title = '';
                    for (var key in this.fiscalYearOptions) {
                        if (this.fiscalYearOption == this.fiscalYearOptions[key].value)
                            title = this.fiscalYearOptions[key].label;;
                            if (
                                this.fiscalYearOption ==
                                this.fiscalYearOptions[key].value
                            )
                                title = this.fiscalYearOptions[key].label;
                    }
                    this.showMyToast(title, '无数据', 'Error');
                }
                this.isShowSpinner = false;
            } else {
                console.log("r = " + JSON.stringify(r));
                    console.log('r = ' + JSON.stringify(r));
                this.showMyToast('Error', r.msg, 'Error');
            }
        }).catch((error) => {
            console.log("error = " + JSON.stringify(error));
            })
            .catch((error) => {
                console.log('error = ' + JSON.stringify(error));
            this.showMyToast('Error', '销量前十客户初始化失败', 'Error');
        });
    }
@@ -594,40 +708,54 @@
            pageSizeLWC: this.pageSize,
            pageTokenLWC: this.currentPageToken,
            sortFieldLWC: this.sortBy,
            sortOrderLWC: this.sortDirection,
            sortOrderLWC: this.sortDirection
        })
            .then((r) => {
                r = JSON.parse(JSON.stringify(r));
                console.log("r = " + JSON.stringify(r));
                if (r.status == "Success") {
                console.log('r = ' + JSON.stringify(r));
                if (r.status == 'Success') {
                    //分页
                    this.nextPageToken = r.entity.paginatedAccounts.nextPageToken;
                    this.nextPageToken =
                        r.entity.paginatedAccounts.nextPageToken;
                    this.totalRecords = r.entity.paginatedAccounts.totalRecords;
                    this.recordStart = r.entity.paginatedAccounts.recordStart;
                    this.recordEnd = r.entity.paginatedAccounts.recordEnd;
                    this.totalPages = Math.ceil(
                        r.entity.paginatedAccounts.totalRecords / this.pageSize
                    );
                    console.log("this.totalPages = " + this.totalPages);
                    this.paginationVisibility = this.totalPages > 1 ? true : false;
                    console.log('this.totalPages = ' + this.totalPages);
                    this.paginationVisibility =
                        this.totalPages > 1 ? true : false;
                    this.pageRecords = r.entity.pageRecords;
                    console.log("this.pageRecords = " + JSON.stringify(this.pageRecords));
                    console.log(
                        'this.pageRecords = ' + JSON.stringify(this.pageRecords)
                    );
                    for (var i in this.pageRecords) {
                        this.pageRecords[i]["Is_Active__c"] = this.pageRecords[i].Is_Active__c.replace('効','效');
                        this.pageRecords[i]["NameUrl"] = "/s/lexconsumableaccount?AccId=" + this.pageRecords[i].Id;
                        this.pageRecords[i]["StateMasterName"] = this.pageRecords[i].State_Master__r.Name;
                        this.pageRecords[i]["StateMasterUrl"] = "/" + this.pageRecords[i].State_Master__c;
                        this.pageRecords[i]["CityMasterName"] = this.pageRecords[i].City_Master__r.Name;
                        this.pageRecords[i]["CityMasterNameUrl"] = "/" + this.pageRecords[i].City_Master__c;
                        this.pageRecords[i]["RecordTypeName"] = this.pageRecords[i].RecordType.Name;
                        this.pageRecords[i]['Is_Active__c'] = this.pageRecords[
                            i
                        ].Is_Active__c.replace('効', '效');
                        this.pageRecords[i]['NameUrl'] =
                            '/s/lexconsumableaccount?AccId=' +
                            this.pageRecords[i].Id;
                        this.pageRecords[i]['StateMasterName'] =
                            this.pageRecords[i].State_Master__r.Name;
                        this.pageRecords[i]['StateMasterUrl'] =
                            '/' + this.pageRecords[i].State_Master__c;
                        this.pageRecords[i]['CityMasterName'] =
                            this.pageRecords[i].City_Master__r.Name;
                        this.pageRecords[i]['CityMasterNameUrl'] =
                            '/' + this.pageRecords[i].City_Master__c;
                        this.pageRecords[i]['RecordTypeName'] =
                            this.pageRecords[i].RecordType.Name;
                    }
                    this.isShowSpinner = false;
                } else {
                    this.showMyToast('Error', r.msg, 'Error');
                }
            }).catch((error) => {
                console.log('error = ' + JSON.stringify(error.message))
            })
            .catch((error) => {
                console.log('error = ' + JSON.stringify(error.message));
            });
    }
@@ -642,11 +770,18 @@
            iconName = 'utility:error';
        }
        if (message != '') {
            content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
            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);
        this.template
            .querySelector('c-common-toast')
            .showToast(variant, content, iconName, 10000);
    }
    sortByMethod(field, reverse, primer) {
@@ -668,26 +803,26 @@
    onHandleSort(event) {
        this.sortBy = event.detail.fieldName;
        switch (this.sortBy) {
            case "NameUrl":
                this.sortBy = "Name";
            case 'NameUrl':
                this.sortBy = 'Name';
                break;
            case "StateMasterUrl":
                this.sortBy = "State_Master__r.Name";
            case 'StateMasterUrl':
                this.sortBy = 'State_Master__r.Name';
                break;
            case "RecordTypeName":
                this.sortBy = "RecordType.Name";
            case 'RecordTypeName':
                this.sortBy = 'RecordType.Name';
                break;
            case "CityMasterNameUrl":
                this.sortBy = "City_Master__r.Name";
            case 'CityMasterNameUrl':
                this.sortBy = 'City_Master__r.Name';
                break;
        }
        this.sortDirection = event.detail.sortDirection;
        this.currentPageToken = 0;
        console.log("this.sortBy = " + this.sortBy);
        console.log("this.sortDirection = " + this.sortDirection);
        console.log('this.sortBy = ' + this.sortBy);
        console.log('this.sortDirection = ' + this.sortDirection);
        this.changelistView();
        const { fieldName: sortedBy, sortDirection } = event.detail;
        this.sortByMethod(sortedBy, sortDirection === "asc" ? 1 : -1);
        this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1);
        this.sortDirection = sortDirection;
        this.sortedBy = sortedBy;
    }
force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.html
@@ -1,8 +1,8 @@
<template>
    <lightning-layout multiple-rows="true">
        <lightning-layout-item size="2">
            <strong style="font-size: 20px;">消耗品管理系统</strong>
            <div style="height: 20px;"></div>
            <strong style="font-size: 20px">消耗品管理系统</strong>
            <div style="height: 20px"></div>
            <strong>{accountDataInfo.name}</strong>
        </lightning-layout-item>
        <lightning-layout-item size="9"></lightning-layout-item>
@@ -16,24 +16,33 @@
    </lightning-layout>
    <div class="outerBorderCss">
        <div style="padding:5px;">
        <div style="padding: 5px">
            <div class="borderCss">
                <div style="padding:10px;border-bottom:1px solid #DDE4E9">
                    <div lwc:dom="manual" class="resultDiv">
                    </div>
                    <p style="font-size: 15px;"><strong>客户信息</strong></p>
                <div style="padding: 10px; border-bottom: 1px solid #dde4e9">
                    <div lwc:dom="manual" class="resultDiv"></div>
                    <p style="font-size: 15px"><strong>客户信息</strong></p>
                    <div draggable="false">
                        <div class="slds-m-top_small slds-m-bottom_medium">
                            <lightning-layout multiple-rows="true">
                                <lightning-layout-item size="2">
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="客户名" value={accountDataInfo.name}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="客户名"
                                        value={accountDataInfo.name}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="客户所有人" value={accountDataInfo.ownerName}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="客户所有人"
                                        value={accountDataInfo.ownerName}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                            </lightning-layout>
@@ -41,12 +50,22 @@
                                <lightning-layout-item size="2">
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="别名1" value={accountDataInfo.site}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="别名1"
                                        value={accountDataInfo.site}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="有效/无效" value={accountDataInfo.isActive}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="有效/无效"
                                        value={accountDataInfo.isActive}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                            </lightning-layout>
@@ -54,12 +73,22 @@
                                <lightning-layout-item size="2">
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="别名2" value={accountDataInfo.aliasName2}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="别名2"
                                        value={accountDataInfo.aliasName2}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="禁用理由" value={accountDataInfo.banOnUseReason}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="禁用理由"
                                        value={accountDataInfo.banOnUseReason}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                            </lightning-layout>
@@ -67,13 +96,22 @@
                                <lightning-layout-item size="2">
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="政府等級" value={accountDataInfo.grade}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="政府等級"
                                        value={accountDataInfo.grade}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="医院所属性质"
                                        value={accountDataInfo.attributeType} variant="label-inline"
                                        read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="医院所属性质"
                                        value={accountDataInfo.attributeType}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                            </lightning-layout>
@@ -81,36 +119,53 @@
                                <lightning-layout-item size="2">
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="OCSM分类(医院)"
                                        value={accountDataInfo.oCMCategory} variant="label-inline"
                                        read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="OCSM分类(医院)"
                                        value={accountDataInfo.oCMCategory}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="医院专业区分"
                                        value={accountDataInfo.specialityType} variant="label-inline"
                                        read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="医院专业区分"
                                        value={accountDataInfo.specialityType}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                            </lightning-layout>
                        </div>
                    </div>
                </div>
                <div style="padding:10px;border-bottom:1px solid #DDE4E9">
                    <div lwc:dom="manual" class="resultDiv">
                    </div>
                    <p style="font-size: 15px;"><strong>地址信息</strong></p>
                <div style="padding: 10px; border-bottom: 1px solid #dde4e9">
                    <div lwc:dom="manual" class="resultDiv"></div>
                    <p style="font-size: 15px"><strong>地址信息</strong></p>
                    <div draggable="false">
                        <div class="slds-m-top_small slds-m-bottom_medium">
                            <lightning-layout multiple-rows="true">
                                <lightning-layout-item size="2">
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="省" value={accountDataInfo.stateMasterName}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="省"
                                        value={accountDataInfo.stateMasterName}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="电话" value={accountDataInfo.phone}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="电话"
                                        value={accountDataInfo.phone}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                            </lightning-layout>
@@ -118,12 +173,22 @@
                                <lightning-layout-item size="2">
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="市" value={accountDataInfo.cityMasterName}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="市"
                                        value={accountDataInfo.cityMasterName}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="电话2" value={accountDataInfo.phoneCall}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="电话2"
                                        value={accountDataInfo.phoneCall}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                            </lightning-layout>
@@ -131,12 +196,22 @@
                                <lightning-layout-item size="2">
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="县/区" value={accountDataInfo.town}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="县/区"
                                        value={accountDataInfo.town}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="传真" value={accountDataInfo.fax}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="传真"
                                        value={accountDataInfo.fax}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                            </lightning-layout>
@@ -144,12 +219,22 @@
                                <lightning-layout-item size="2">
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="街道" value={accountDataInfo.street}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="街道"
                                        value={accountDataInfo.street}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="邮编" value={accountDataInfo.postalCode}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="邮编"
                                        value={accountDataInfo.postalCode}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                            </lightning-layout>
@@ -157,32 +242,40 @@
                                <lightning-layout-item size="2">
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="地址" value={accountDataInfo.address}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="地址"
                                        value={accountDataInfo.address}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                            </lightning-layout>
                        </div>
                    </div>
                </div>
                <div style="padding:10px;border-bottom:1px solid #DDE4E9">
                    <div lwc:dom="manual" class="resultDiv">
                    </div>
                    <p style="font-size: 15px;"><strong>系统信息</strong></p>
                <div style="padding: 10px; border-bottom: 1px solid #dde4e9">
                    <div lwc:dom="manual" class="resultDiv"></div>
                    <p style="font-size: 15px"><strong>系统信息</strong></p>
                    <div draggable="false">
                        <div class="slds-m-top_small slds-m-bottom_medium">
                            <lightning-layout multiple-rows="true">
                                <lightning-layout-item size="2">
                                </lightning-layout-item>
                                <lightning-layout-item size="5">
                                    <lightning-input type="text" label="母公司" value={accountDataInfo.parentName}
                                        variant="label-inline" read-only></lightning-input>
                                    <lightning-input
                                        type="text"
                                        label="母公司"
                                        value={accountDataInfo.parentName}
                                        variant="label-inline"
                                        read-only
                                    ></lightning-input>
                                </lightning-layout-item>
                            </lightning-layout>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.js
@@ -1,5 +1,5 @@
import { LightningElement, wire, api, track } from 'lwc';
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import accountInit from '@salesforce/apex/LexConsumableAccountInfoController.init';
export default class LexConsumableAccountInfoPrint extends LightningElement {
@@ -25,12 +25,12 @@
        postalCode: '',
        address: '',
        parentName: ''
    }
    };
    //获取链接参数
    getQueryString(name) {
        console.log("getQueryString name " + name);
        let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        console.log('getQueryString name ' + name);
        let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
        let r = window.location.search.substr(1).match(reg);
        if (r != null) {
            return decodeURIComponent(r[2]);
@@ -39,47 +39,72 @@
    }
    connectedCallback(){
        this.AccId = this.getQueryString("AccId");
        this.AccId = this.getQueryString('AccId');
        this.AccId = this.AccId == null ? '' : this.AccId;
        if (this.AccId != '') {
            console.log('this.AccId = ' + this.AccId);
            accountInit({
                accId: this.AccId
            }).then((r) => {
            })
                .then((r) => {
                r = JSON.parse(JSON.stringify(r));
                console.log('r = ' + JSON.stringify(r));
                if (r.status == 'Success') {
                    this.accountDataInfo.name = r.entity.obj.Name;
                    this.accountDataInfo.ownerName = r.entity.obj.Owner == null ? '' : r.entity.obj.Owner.Name;
                        this.accountDataInfo.ownerName =
                            r.entity.obj.Owner == null
                                ? ''
                                : r.entity.obj.Owner.Name;
                    this.accountDataInfo.site = r.entity.obj.site;
                    this.accountDataInfo.isActive = r.entity.obj.Is_Active__c;
                    this.accountDataInfo.aliasName2 = r.entity.obj.Alias_Name2__c;
                    this.accountDataInfo.banOnUseReason = r.entity.obj.Ban_On_Use_Reason__c;
                        this.accountDataInfo.isActive =
                            r.entity.obj.Is_Active__c;
                        this.accountDataInfo.aliasName2 =
                            r.entity.obj.Alias_Name2__c;
                        this.accountDataInfo.banOnUseReason =
                            r.entity.obj.Ban_On_Use_Reason__c;
                    this.accountDataInfo.grade = r.entity.obj.Grade__c;
                    this.accountDataInfo.attributeType = r.entity.obj.Attribute_Type__c;
                    this.accountDataInfo.oCMCategory = r.entity.obj.OCM_Category__c;
                    this.accountDataInfo.specialityType = r.entity.obj.Speciality_Type__c;
                    this.accountDataInfo.stateMasterName = r.entity.obj.State_Master__r == null ? '' : r.entity.obj.State_Master__r.Name;
                        this.accountDataInfo.attributeType =
                            r.entity.obj.Attribute_Type__c;
                        this.accountDataInfo.oCMCategory =
                            r.entity.obj.OCM_Category__c;
                        this.accountDataInfo.specialityType =
                            r.entity.obj.Speciality_Type__c;
                        this.accountDataInfo.stateMasterName =
                            r.entity.obj.State_Master__r == null
                                ? ''
                                : r.entity.obj.State_Master__r.Name;
                    this.accountDataInfo.phone = r.entity.obj.Phone;
                    this.accountDataInfo.cityMasterName = r.entity.obj.City_Master__r == null ? '' : r.entity.obj.City_Master__r.Name;
                    this.accountDataInfo.phoneCall = r.entity.obj.PhoneCall__c;
                        this.accountDataInfo.cityMasterName =
                            r.entity.obj.City_Master__r == null
                                ? ''
                                : r.entity.obj.City_Master__r.Name;
                        this.accountDataInfo.phoneCall =
                            r.entity.obj.PhoneCall__c;
                    this.accountDataInfo.town = r.entity.obj.Town__c;
                    this.accountDataInfo.fax = r.entity.obj.Fax;
                    this.accountDataInfo.street = r.entity.obj.Street__c;
                    this.accountDataInfo.postalCode = r.entity.obj.Postal_Code__c;
                        this.accountDataInfo.postalCode =
                            r.entity.obj.Postal_Code__c;
                    this.accountDataInfo.address = r.entity.obj.Address__c;
                    this.accountDataInfo.parentName = r.entity.obj.Parent == null ? '' : r.entity.obj.Parent.Name;
                    console.log('this.accountDataInfo = ' + JSON.stringify(this.accountDataInfo));
                        this.accountDataInfo.parentName =
                            r.entity.obj.Parent == null
                                ? ''
                                : r.entity.obj.Parent.Name;
                        console.log(
                            'this.accountDataInfo = ' +
                                JSON.stringify(this.accountDataInfo)
                        );
                    this.isShowAccountInfo = true;
                    this.isShowSpinner = false;
                } else {
                    console.log('r = ' + JSON.stringify(r))
                        console.log('r = ' + JSON.stringify(r));
                    this.showToast('Error', r.msg);
                }
            }).catch((error) => {
                console.log('error = ' + JSON.stringify(error))
                this.showToast('Error', r.msg);
            })
                .catch((error) => {
                    console.log('error = ' + JSON.stringify(error));
                    this.showToast('Error', r.msg);
                });
        }
    }
@@ -98,6 +123,6 @@
    }
    closePage(){
        window.location.href = "/s/lexconsumableaccount";
        window.location.href = '/s/lexconsumableaccount';
    }
}
force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.html
@@ -2,7 +2,10 @@
    <template if:true={showSpinner}>
        <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
        <div class="slds-spinner_container">
            <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
            <div
                role="status"
                class="slds-spinner slds-spinner_medium slds-spinner_brand"
            >
                <span class="slds-assistive-text">Loading</span>
                <div class="slds-spinner__dot-a"></div>
                <div class="slds-spinner__dot-b"></div>
@@ -11,23 +14,53 @@
    </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="padding:10px;">
        <div
            style="
                border: 1px solid #d4d4d4;
                border-top: 3px solid #51606e;
                border-radius: 5px;
            "
        >
            <div style="padding: 10px">
                <!-- 按钮 -->
                <!-- <lightning-button style="margin: 5px;" label="协议订货" onclick={agreementorder}></lightning-button> -->
                <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin-right: 150px;" onclick={agreementorder}>协议订货</button>
                <button
                    class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                    style="margin-right: 150px"
                    onclick={agreementorder}
                >
                    协议订货
                </button>
                <template if:true={showHop}>
                    <!-- <lightning-button style="margin: 5px;" label="医院特价" onclick={hospitalorder}></lightning-button> -->
                    <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin-right: 150px;" onclick={hospitalorder}>医院特价</button>
                    <button
                        class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                        style="margin-right: 150px"
                        onclick={hospitalorder}
                    >
                        医院特价
                    </button>
                </template>
                <template if:true={hasSpecial}>
                    <!-- <lightning-button style="margin: 5px;" label="促销订货" onclick={promotionorder}></lightning-button> -->
                    <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={promotionorder}>促销订货</button>
                    <button
                        class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                        onclick={promotionorder}
                    >
                        促销订货
                    </button>
                </template>
                <p style="height: 10px;"></p>
                <p style="height: 10px"></p>
                <!-- 搜索 -->
                <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;">
                <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">
@@ -37,42 +70,103 @@
                        </lightning-layout>
                        <!-- <p style="font-size: 16px;"><strong>检索条件</strong></p> -->
                    </div>
                    <div style="padding:10px;">
                    <div style="padding: 10px">
                        <table>
                            <tbody>
                                <tr>
                                    <td style="width:10px;"></td>
                                    <td style="width:122px;">
                                        <div style="color:#696969;font-size:16px;">消耗品订单名称</div>
                                    <td style="width: 10px"></td>
                                    <td style="width: 122px">
                                        <div
                                            style="
                                                color: #696969;
                                                font-size: 16px;
                                            "
                                        >
                                            消耗品订单名称
                                        </div>
                                    </td>
                                    <td >
                                        <lightning-input class="inputFont" type="text" label="消耗品订单名称" value={category1} variant="label-hidden" onchange={category1Change}></lightning-input>
                                        <lightning-input
                                            class="inputFont"
                                            type="text"
                                            label="消耗品订单名称"
                                            value={category1}
                                            variant="label-hidden"
                                            onchange={category1Change}
                                        ></lightning-input>
                                    </td>
                                    <td style="width:30px;"></td>
                                    <td style="width: 74px;">
                                        <div style="color:#696969;font-size:16px;">订单日期</div>
                                    <td style="width: 30px"></td>
                                    <td style="width: 74px">
                                        <div
                                            style="
                                                color: #696969;
                                                font-size: 16px;
                                            "
                                        >
                                            订单日期
                                        </div>
                                    </td>
                                    <td >
                                        <lightning-input class="inputFont" type="date" name="orderDate" value={orderDate} label="订单日期" variant="label-hidden"  onchange={orderDateChange}></lightning-input>
                                        <lightning-input
                                            class="inputFont"
                                            type="date"
                                            name="orderDate"
                                            value={orderDate}
                                            label="订单日期"
                                            variant="label-hidden"
                                            onchange={orderDateChange}
                                        ></lightning-input>
                                    </td>
                                    <td style="width:30px;"></td>
                                    <td style="width: 74px;">
                                        <div style="color:#696969;font-size:16px;">订单状态</div>
                                    <td style="width: 30px"></td>
                                    <td style="width: 74px">
                                        <div
                                            style="
                                                color: #696969;
                                                font-size: 16px;
                                            "
                                        >
                                            订单状态
                                        </div>
                                    </td>
                                    <td style="width: 250px;">
                                        <lightning-combobox class="inputFont" name="orderStatus" label="订单状态" value={orderStatus} placeholder="请选择..." options={provinceOpts} variant="label-hidden"  onchange={orderStatusChange}></lightning-combobox>
                                    <td style="width: 250px">
                                        <lightning-combobox
                                            class="inputFont"
                                            name="orderStatus"
                                            label="订单状态"
                                            value={orderStatus}
                                            placeholder="请选择..."
                                            options={provinceOpts}
                                            variant="label-hidden"
                                            onchange={orderStatusChange}
                                        ></lightning-combobox>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <p style="height:10px;"></p>
                        <p style="height: 10px"></p>
                        <table>
                            <tbody>
                                <tr>
                                    <td></td>
                                    <td style="width:325px;">
                                        <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="margin-right: 20px;height:32px;width: 150px;" onclick={searchProduct}>搜索</button>
                                        <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="height:32px;width: 150px;" onclick={clear}>清空</button>
                                    <td style="width: 325px">
                                        <button
                                            class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
                                            style="
                                                margin-right: 20px;
                                                height: 32px;
                                                width: 150px;
                                            "
                                            onclick={searchProduct}
                                        >
                                            搜索
                                        </button>
                                        <button
                                            class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
                                            style="height: 32px; width: 150px"
                                            onclick={clear}
                                        >
                                            清空
                                        </button>
                                    </td>
                                </tr>
                            </tbody>
@@ -80,8 +174,15 @@
                    </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;">
                <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">
@@ -91,9 +192,15 @@
                        </lightning-layout>
                        <!-- <p style="font-size: 16px;"><strong>订货明细</strong></p> -->
                    </div>
                    <div style="padding:10px;">
                    <div style="padding: 10px">
                        <div class="table-container">
                            <lightning-datatable class="wrapped-header-datatable" key-field="id" hide-checkbox-column="true" data={raesList} columns={cols}></lightning-datatable>
                            <lightning-datatable
                                class="wrapped-header-datatable"
                                key-field="id"
                                hide-checkbox-column="true"
                                data={raesList}
                                columns={cols}
                            ></lightning-datatable>
                        </div>
                    </div>
                </div>
force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.js
@@ -4,11 +4,12 @@
import initPage from '@salesforce/apex/LexConsumableOrderManageController.init1';
import searchConsumableorderdetails from '@salesforce/apex/LexConsumableOrderManageController.searchConsumableorderdetails';
//table css 
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
import { loadStyle } from 'lightning/platformResourceLoader';
import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
export default class LexConsumableOrderManage extends NavigationMixin(LightningElement) {
export default class LexConsumableOrderManage extends NavigationMixin(
    LightningElement
) {
    @track category1;
    @track orderDate;
    @track orderStatus = '';
@@ -31,7 +32,7 @@
    connectedCallback(){
        this.showSpinner = true;
        initPage()
            .then(result=>{
            .then((result) => {
                this.isNoteStay = result.isNoteStay;
                if(result.result == 'Success'){
                    this.provinceOpts = result.provinceOpts;
@@ -48,16 +49,20 @@
                    }
                    for(var i in this.raesList){
                        if(this.raesList[i].Order_ForHospital__c){
                            this.raesList[i]['hosUrl'] = '/s/detail/'+this.raesList[i].Order_ForHospital__c;
                            this.raesList[i]['hosName'] = this.raesList[i].Order_ForHospital__r.Name;
                            this.raesList[i]['hosUrl'] =
                                '/s/detail/' +
                                this.raesList[i].Order_ForHospital__c;
                            this.raesList[i]['hosName'] =
                                this.raesList[i].Order_ForHospital__r.Name;
                        }
                        this.raesList[i]['nameUrl'] = '/s/lexconsumable?ESetid='+this.raesList[i].Id;
                        this.raesList[i]['nameUrl'] =
                            '/s/lexconsumable?ESetid=' + this.raesList[i].Id;
                    }
                    this.showSpinner = false;
                    this.showPage = true;
                }else{
                    this.showSpinner = false;
                    console.log("Error:"+result.errorMsg);
                    console.log('Error:' + result.errorMsg);
                    const evt = new ShowToastEvent({
                        title : '初始化页面失败',
                        message: result.errorMsg,
@@ -66,21 +71,21 @@
                    this.dispatchEvent(evt);
                }
            })
            .catch(error=>{
            .catch((error) => {
                this.showSpinner = false;
                console.log("Error:"+error);
            })
                console.log('Error:' + error);
            });
    }
    renderedCallback(){ 
        if (!this.stylesLoaded) {
            Promise.all([loadStyle(this, WrappedHeaderTable)])
                .then(() => {
                    console.log("Custom styles loaded");
                    console.log('Custom styles loaded');
                    this.stylesLoaded = true;
                })
                .catch((error) => {
                    console.error("Error loading custom styles");
                    console.error('Error loading custom styles');
                });
        }
    }
@@ -132,23 +137,33 @@
    searchProduct(event){
        this.showSpinner = true;
        searchConsumableorderdetails({categoryStr:this.category1,orderDate:this.orderDate,orderStatus:this.orderStatus,accountidStr:this.accountid,agencyProTypeStr:this.agencyProType,userWorkLocationStr:this.userWorkLocation})
            .then(result=>{
        searchConsumableorderdetails({
            categoryStr: this.category1,
            orderDate: this.orderDate,
            orderStatus: this.orderStatus,
            accountidStr: this.accountid,
            agencyProTypeStr: this.agencyProType,
            userWorkLocationStr: this.userWorkLocation
        }).then((result) => {
                if(result.result == 'Success'){
                    this.raesList = result.raesList;
                    for(var i in this.raesList){
                        if(this.raesList[i].Order_ForHospital__c){
                            this.raesList[i]['hosUrl'] = '/s/detail/'+this.raesList[i].Order_ForHospital__c;
                            this.raesList[i]['hosName'] = this.raesList[i].Order_ForHospital__r.Name;
                        this.raesList[i]['hosUrl'] =
                            '/s/detail/' +
                            this.raesList[i].Order_ForHospital__c;
                        this.raesList[i]['hosName'] =
                            this.raesList[i].Order_ForHospital__r.Name;
                        }
                        this.raesList[i]['nameUrl'] = '/s/lexconsumable?ESetid='+this.raesList[i].Id;
                    this.raesList[i]['nameUrl'] =
                        '/s/lexconsumable?ESetid=' + this.raesList[i].Id;
                    }
                    this.showSpinner = false;
                    this.showMyToast('搜索成功',result.errorMsg,'success');
                }else{
                    this.showSpinner = false;
                    this.raesList = result.raesList;
                    console.log("Error:"+result.errorMsg);
                console.log('Error:' + result.errorMsg);
                    if(result.errorMsg == '没有搜索到相关订单'){
                        this.showMyToast(result.errorMsg,'','error');
                    }else{
@@ -156,28 +171,38 @@
                    }
                    this.dispatchEvent(evt);
                }
            })
        });
    }
    clear(event){
        this.category1 = '';
        this.orderDate = null;
        this.orderStatus = '';
        searchConsumableorderdetails({categoryStr:this.category1,orderDate:this.orderDate,orderStatus:this.orderStatus,accountidStr:this.accountid,agencyProTypeStr:this.agencyProType,userWorkLocationStr:this.userWorkLocation})
            .then(result=>{
        searchConsumableorderdetails({
            categoryStr: this.category1,
            orderDate: this.orderDate,
            orderStatus: this.orderStatus,
            accountidStr: this.accountid,
            agencyProTypeStr: this.agencyProType,
            userWorkLocationStr: this.userWorkLocation
        }).then((result) => {
                if(result.result == 'Success'){
                    this.raesList = result.raesList;
                    for(var i in this.raesList){
                        if(this.raesList[i].Order_ForHospital__c){
                            this.raesList[i]['hosUrl'] = '/s/detail/'+this.raesList[i].Order_ForHospital__c;
                            this.raesList[i]['hosName'] = this.raesList[i].Order_ForHospital__r.Name;
                        this.raesList[i]['hosUrl'] =
                            '/s/detail/' +
                            this.raesList[i].Order_ForHospital__c;
                        this.raesList[i]['hosName'] =
                            this.raesList[i].Order_ForHospital__r.Name;
                        }
                        this.raesList[i]['nameUrl'] = '/s/lexconsumable?ESetid='+this.raesList[i].Id;
                    this.raesList[i]['nameUrl'] =
                        '/s/lexconsumable?ESetid=' + this.raesList[i].Id;
                    }
                    this.showMyToast('搜索成功',result.errorMsg,'success');
                }else{
                    this.raesList = result.raesList;
                    console.log("Error:"+result.errorMsg);
                console.log('Error:' + result.errorMsg);
                    if(result.errorMsg == '没有搜索到相关订单'){
                        this.showMyToast(result.errorMsg,'','error');
                    }else{
@@ -185,7 +210,7 @@
                    }
                    this.dispatchEvent(evt);
                }
            })
        });
    }
    showMyToast(title, message, variant) {
@@ -198,12 +223,18 @@
           iconName = 'utility:error';
        }
        if(message != ''){
           content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
            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);
        this.template
            .querySelector('c-common-toast')
            .showToast(variant, content, iconName, 10000);
        // var mode;
        // if(this.isNoteStay){
        //     mode ='sticky';
force-app/main/default/lwc/lexCssUtility/lexCssUtility.css
@@ -10,22 +10,21 @@
    /* --slds-c-button-brand-text-color-hover:#ccc;  */
/* } */
/* button边框 */
.lexBorder{
    font-size: 18px;
    font-family: 'sans-serif';
    font-weight:500;
    color:#0A81DF;
    color: #0a81df;
    /* border:2px solid rgb(8,16,132); */
    /* border-color:rgb(8,16,132); */
    width: 160px;
    height: 36px;
    border-radius: 4px;
    opacity: 1;
    background: #FFFFFF;
    background: #ffffff;
    box-sizing: border-box;
    border:1px solid #0A81DF;
    border: 1px solid #0a81df;
}
.lexsearchStyle{
    font-size: 18px;
@@ -35,8 +34,8 @@
    height: 36px;
    border-radius: 4px;
    opacity: 1;
    background:#090F84;
    color:#FFFFFF;
    background: #090f84;
    color: #ffffff;
}
.lexclearStyle{
    font-size: 18px;
@@ -46,30 +45,27 @@
    height: 36px;
    border-radius: 4px;
    opacity: 1;
    background: #FFFFFF;
    background: #ffffff;
    border:1px solid #4d4d4d;
    color:#333333;
}
/* button边框 */
.lexBorderWidth{
    font-size: 18px;
    font-family: 'sans-serif';
    font-weight:500;
    color:#0A81DF;;
    color: #0a81df;
    /* border:2px solid rgb(8,16,132); */
    /* border-color:rgb(8,16,132); */
    width: 200px;
    height: 36px;
    border-radius: 4px;
    opacity: 1;
    background: #FFFFFF;
    background: #ffffff;
    box-sizing: border-box;
    border-style: rgb(212, 212, 212);
}
/* button距离 */
.buttonMarginLeft{
@@ -93,10 +89,10 @@
    font-size: 18px;
    font-family: 'sans-serif';
    font-weight:500;
    color:#0A81DF;;
    color: #0a81df;
    border-radius: 4px;
    opacity: 1;
    background: #FFFFFF;
    background: #ffffff;
    box-sizing: border-box;
    border-style: rgb(212, 212, 212);
}
@@ -105,9 +101,7 @@
    font-size: 16px;
    font-family: 'sans-serif';
    font-weight:500;
}
/* input 字体大小 by Link */
.inputFont {
force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.html
@@ -12,5 +12,4 @@
            disabled={isDisabledAttachment}
        ></lightning-combobox>
    </div>
</template>
force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.js
@@ -7,19 +7,30 @@
    @api isDisabledAttachment;
    connectedCallback(){
        console.log('typeValue = ' + this.typeValue + ' typeOptions = ' + this.typeOptions + ' recordId' + this.recordId + ' isDisabledAttachment=' + this.isDisabledAttachment);
        console.log(
            'typeValue = ' +
                this.typeValue +
                ' typeOptions = ' +
                this.typeOptions +
                ' recordId' +
                this.recordId +
                ' isDisabledAttachment=' +
                this.isDisabledAttachment
        );
    }
    handleDataChange(event){
        console.log('typeValue = ' + event.target.value);
        this.typeValue = event.target.value;
        this.dispatchEvent(new CustomEvent('typechange', {
        this.dispatchEvent(
            new CustomEvent('typechange', {
            composed: true,
            bubbles: true,
            cancelable: true,
            detail: {
                data: { typeValue: this.typeValue, recordId: this.recordId }
            }
        }));
            })
        );
    }
}
force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.html
@@ -1,10 +1,10 @@
<template>
    <lightning-input
    style="width:90%;"
        style="width: 90%"
    variant="label-hidden"
    type='text'
        type="text"
    value = {DiffReason}
    onblur={diffReasonBlur}>
        onblur={diffReasonBlur}
    >
    </lightning-input>
</template>
force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.js
@@ -5,24 +5,27 @@
    @api boxPiece;
    @track DiffReason = '';
    connectedCallback(){
        console.log('ProdId'+this.prodId);
    }
    diffReasonBlur(event){
        console.log('LexCustomDiffReasonComp')
        console.log('LexCustomDiffReasonComp');
        this.DiffReason = event.target.value;
        this.dispatchEvent(new CustomEvent('diffreasons', {
        this.dispatchEvent(
            new CustomEvent('diffreasons', {
            composed: true,
            bubbles: true,
            cancelable: true,
            detail: {
                data: { DiffReason: this.DiffReason, ProdId: this.prodId ,boxPiece:this.boxPiece}
                    data: {
                        DiffReason: this.DiffReason,
                        ProdId: this.prodId,
                        boxPiece: this.boxPiece
            }
        }));
    }
            })
        );
    }
}
force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html
@@ -1,16 +1,19 @@
<template>
    <template if:true={showNormal}>
        <div style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;text-align: right;padding-right:10px;">
        <div
            style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;text-align: right;padding-right:10px;">
            <lightning-formatted-number value={value}></lightning-formatted-number>
        </div>
    </template>
    <template if:true={showRed}>
        <div style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;background-color:red;text-align: right;padding-right:10px;">
        <div
            style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;background-color:red;text-align: right;padding-right:10px;">
            <lightning-formatted-number value={value}></lightning-formatted-number>
        </div>
    </template>
    <template if:true={showYellow}>
        <div style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;background-color:yellow;text-align: right;padding-right:10px;">
        <div
            style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;background-color:yellow;text-align: right;padding-right:10px;">
            <lightning-formatted-number value={value}></lightning-formatted-number>
        </div>
    </template>
force-app/main/default/lwc/lexCustomLightningDatatable/customAgencyOppInput.html
@@ -1,3 +1,8 @@
<template>
    <c-lex-agency-opp-cus-cell input-value={typeAttributes.inputValue} record-id={typeAttributes.recordId} field-name={typeAttributes.fieldName} show-type={typeAttributes.showType}></c-lex-agency-opp-cus-cell>
    <c-lex-agency-opp-cus-cell
        input-value={typeAttributes.inputValue}
        record-id={typeAttributes.recordId}
        field-name={typeAttributes.fieldName}
        show-type={typeAttributes.showType}
    ></c-lex-agency-opp-cus-cell>
</template>
force-app/main/default/lwc/lexCustomLightningDatatable/customInventoryColor.html
@@ -1,3 +1,8 @@
<template>
    <c-lex-custom-inventory-color value={typeAttributes.value} upperlimit={typeAttributes.upperlimit} lowerlimit={typeAttributes.lowerlimit} box-price = {typeAttributes.boxPrice}></c-lex-custom-inventory-color>
    <c-lex-custom-inventory-color
        value={typeAttributes.value}
        upperlimit={typeAttributes.upperlimit}
        lowerlimit={typeAttributes.lowerlimit}
        box-price={typeAttributes.boxPrice}
    ></c-lex-custom-inventory-color>
</template>
force-app/main/default/lwc/lexCustomLightningDatatable/customOutboundCount.html
@@ -2,6 +2,7 @@
    <c-custom-outbound-count-comp
    is-disable={typeAttributes.isDisable}
    record-id={typeAttributes.recordId}
    count={typeAttributes.count}>
        count={typeAttributes.count}
    >
    </c-custom-outbound-count-comp>
</template>
force-app/main/default/lwc/lexCustomLightningDatatable/customOutputGoods.html
@@ -1,3 +1,7 @@
<template>
    <c-custom-output-good output-value={typeAttributes.outputValue} output-type={typeAttributes.type} record-id={typeAttributes.recordId}></c-custom-output-good>
    <c-custom-output-good
        output-value={typeAttributes.outputValue}
        output-type={typeAttributes.type}
        record-id={typeAttributes.recordId}
    ></c-custom-output-good>
</template>
force-app/main/default/lwc/lexCustomLightningDatatable/customReturnGoodInput.html
@@ -1,3 +1,7 @@
<template>
    <c-lex-return-good-cus-input input-value={typeAttributes.inputValue} box-price={typeAttributes.boxPrice} record-id={typeAttributes.recordId}></c-lex-return-good-cus-input>
    <c-lex-return-good-cus-input
        input-value={typeAttributes.inputValue}
        box-price={typeAttributes.boxPrice}
        record-id={typeAttributes.recordId}
    ></c-lex-return-good-cus-input>
</template>
force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentAmount.html
@@ -1,7 +1,7 @@
<template>
    <c-custom-shipment-Amount-comp
    shipment-amount={typeAttributes.shipmentAmount}
    record-id={typeAttributes.recordId}>
        record-id={typeAttributes.recordId}
    >
    </c-custom-shipment-Amount-comp>
</template>
force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentNumber.html
@@ -1,11 +1,10 @@
<template>
    <c-custom-shipment-number-comp
    style="border-color: red;"
        style="border-color: red"
    record-id={typeAttributes.recordId}
    shipment-number={typeAttributes.shipmentNumber}
    is-coninvoice={typeAttributes.isConinvoice}
    esd-invoice-pro-not-count={typeAttributes.esdInvoiceProNotCount}
    >
    </c-custom-shipment-number-comp>
</template>
force-app/main/default/lwc/lexCustomLightningDatatable/customShippingUnitPrice.html
@@ -3,6 +3,5 @@
    record-id={typeAttributes.recordId}
    shipping-unit-price={typeAttributes.shippingUnitPrice}
    >
    </c-custom-shipping-unit-price-comp>
</template>
force-app/main/default/lwc/lexCustomLightningDatatable/customTableCellIcon.html
@@ -1,3 +1,6 @@
<template>
    <c-lex-table-cell-icon icon-name={typeAttributes.iconName} record-id={typeAttributes.recordId}></c-lex-table-cell-icon>
    <c-lex-table-cell-icon
        icon-name={typeAttributes.iconName}
        record-id={typeAttributes.recordId}
    ></c-lex-table-cell-icon>
</template>
force-app/main/default/lwc/lexCustomLightningDatatable/customTableInput.html
@@ -1,3 +1,10 @@
<template>
    <c-lex-custom-table-input input-value={typeAttributes.inputValue} record-id={typeAttributes.recordId} value-type={typeAttributes.valueType} upper-limit={typeAttributes.upperLimit} lower-limit={typeAttributes.lowerLimit} allnumber={typeAttributes.allnumber}></c-lex-custom-table-input>
    <c-lex-custom-table-input
        input-value={typeAttributes.inputValue}
        record-id={typeAttributes.recordId}
        value-type={typeAttributes.valueType}
        upper-limit={typeAttributes.upperLimit}
        lower-limit={typeAttributes.lowerLimit}
        allnumber={typeAttributes.allnumber}
    ></c-lex-custom-table-input>
</template>
force-app/main/default/lwc/lexCustomLightningDatatable/customdeleteReason.html
@@ -1,8 +1,6 @@
<!-- sldsValidatorIgnore -->
<!-- sldsValidatorIgnore -->
<template>
    <c-custom-delete-reason-comp
        record-id={typeAttributes.recordId}
    >
    <c-custom-delete-reason-comp record-id={typeAttributes.recordId}>
    </c-custom-delete-reason-comp>
</template>
force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomDiffReason.html
@@ -1,5 +1,7 @@
<template>
    <c-lex-custom-diff-reason-comp
        prod-id={typeAttributes.ProdId} box-piece ={typeAttributes.boxPiece}>
        prod-id={typeAttributes.ProdId}
        box-piece={typeAttributes.boxPiece}
    >
    </c-lex-custom-diff-reason-comp>
</template>
force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.html
@@ -1,3 +1 @@
<template>
</template>
<template> </template>
force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.js
@@ -23,77 +23,97 @@
    static customTypes = {
        customUnit: {
            template: customUnitTemplate,
            typeAttributes: ['unitValue','unitOptions','recordId','isDisabled'],
            typeAttributes: [
                'unitValue',
                'unitOptions',
                'recordId',
                'isDisabled'
            ]
        },
        customShipment: {
            template: customShipmentNumberTemplate,
            typeAttributes: ['shipmentNumber','recordId','isConinvoice','esdInvoiceProNotCount'],
            typeAttributes: [
                'shipmentNumber',
                'recordId',
                'isConinvoice',
                'esdInvoiceProNotCount'
            ]
        },
        customShipmentUnitPrice: {
            template: customShippingUnitPriceTemplate,
            typeAttributes: ['shippingUnitPrice','recordId'],
            typeAttributes: ['shippingUnitPrice', 'recordId']
        },
        customShipmentAmount: {
            template: customShipmentAmountTemplate,
            typeAttributes: ['shipmentAmount','recordId'],
            typeAttributes: ['shipmentAmount', 'recordId']
        },
        customDiffReason : {
            template: customDiffReasonTemplate,
            typeAttributes: ['ProdId','boxPiece'],
            typeAttributes: ['ProdId', 'boxPiece']
        },
        customAttachmentType: {
            template: attachmentTypeTemplate,
            typeAttributes: ['typeValue','typeOptions','recordId','isDisabledAttachment'],
            typeAttributes: [
                'typeValue',
                'typeOptions',
                'recordId',
                'isDisabledAttachment'
            ]
        },
        customTableInput: {
            template: customTableInputTemplate,
            typeAttributes:['inputValue','recordId','valueType','upperLimit','lowerLimit','allnumber'],
            typeAttributes: [
                'inputValue',
                'recordId',
                'valueType',
                'upperLimit',
                'lowerLimit',
                'allnumber'
            ]
        },
        customOutputGood:{
            template: customOutputGoodsTemplate,
            typeAttributes:['outputValue','type','recordId'],
            typeAttributes: ['outputValue', 'type', 'recordId']
        },
        customReturnGoodInput:{
            template: customReturnGoodInputTemplate,
            typeAttributes:['inputValue','boxPrice','recordId'],
            typeAttributes: ['inputValue', 'boxPrice', 'recordId']
        },
        customInventoryColor:{
            template: customInventoryColorTemplate,
            typeAttributes:['value','upperlimit','lowerlimit','boxPrice'],
            typeAttributes: ['value', 'upperlimit', 'lowerlimit', 'boxPrice']
        },
        tableCellIcon:{
            template: customTableCellIconTemplate,
            typeAttributes:['iconName','recordId'],
            typeAttributes: ['iconName', 'recordId']
        },
        outboundCount:{
            template: customOutboundCountTemplate,
            typeAttributes:['isDisable','recordId','Count'],
            typeAttributes: ['isDisable', 'recordId', 'Count']
        },
        weeklyReport:{
            template: customWeeklyReportTemplate,
            typeAttributes:['recordId','hospitalName','isShowButton'],
            typeAttributes: ['recordId', 'hospitalName', 'isShowButton']
        },
        agencyOppInput:{
            template: customAgencyOppInputTemplate,
            typeAttributes:['inputValue','recordId','fieldName','showType'],
            typeAttributes: ['inputValue', 'recordId', 'fieldName', 'showType']
        },
        MyDrCheckBox:{
            template: customMyDrCheckBoxTemplate,
            typeAttributes:['recordId','isCheckedMyDr'],
            typeAttributes: ['recordId', 'isCheckedMyDr']
        },
        deleteReason:{
            template: customdeleteReasonTemplate,
            typeAttributes:['recordId'],
            typeAttributes: ['recordId']
        },
        customShowAccountUrl:{
            template: customAccountUrlTemplate,
            typeAttributes:['accountName','accountUrl','isDisable'],
            typeAttributes: ['accountName', 'accountUrl', 'isDisable']
        }
    };
    constructor() {
        super();
        Promise.all([
            loadStyle(this, LexCustomDataTable),
        ]).then(() => {})
        Promise.all([loadStyle(this, LexCustomDataTable)]).then(() => {});
    }
}
force-app/main/default/lwc/lexCustomTableInput/lexCustomTableInput.html
@@ -1,8 +1,22 @@
<template>
    <template if:true={showInputType}>
        <lightning-input type="number" name="cusInput" label="cusInput" variant="label-hidden" value={inputValue} onchange={valueChange} onblur={blurInput}></lightning-input>
        <lightning-input
            type="number"
            name="cusInput"
            label="cusInput"
            variant="label-hidden"
            value={inputValue}
            onchange={valueChange}
            onblur={blurInput}
        ></lightning-input>
    </template>
    <template if:false={showInputType}>
        <lightning-input name="cusInput" label="cusInput" variant="label-hidden" value={inputValue} onchange={valueChange}></lightning-input>
        <lightning-input
            name="cusInput"
            label="cusInput"
            variant="label-hidden"
            value={inputValue}
            onchange={valueChange}
        ></lightning-input>
    </template>
</template>
force-app/main/default/lwc/lexCustomTableInput/lexCustomTableInput.js
@@ -19,26 +19,44 @@
    valueChange(event){
        this.inputValue = event.target.value;
        this.dispatchEvent(new CustomEvent('changevalue', {
        this.dispatchEvent(
            new CustomEvent('changevalue', {
            composed: true,
            bubbles: true,
            cancelable: true,
            detail: {
                data: { value: this.inputValue, recordId: this.recordId }
            }
        }));
            })
        );
    }
    blurInput(event){
        console.log('value1:'+event.target.value);
        console.log('limit:'+this.inputValue+'---'+ this.upperLimit+'---'+this.lowerLimit+'---'+this.allnumber);
        this.dispatchEvent(new CustomEvent('valueblur', {
        console.log(
            'limit:' +
                this.inputValue +
                '---' +
                this.upperLimit +
                '---' +
                this.lowerLimit +
                '---' +
                this.allnumber
        );
        this.dispatchEvent(
            new CustomEvent('valueblur', {
            composed: true,
            bubbles: true,
            cancelable: true,
            detail: {
                data: { value: this.inputValue, upperLimit: this.upperLimit, lowerLimit: this.lowerLimit, allnumber: this.allnumber }
                    data: {
                        value: this.inputValue,
                        upperLimit: this.upperLimit,
                        lowerLimit: this.lowerLimit,
                        allnumber: this.allnumber
            }
        }));
                }
            })
        );
    }
}
force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.html
@@ -3,8 +3,14 @@
        <lightning-spinner size="medium" variant="brand"></lightning-spinner>
    </template>
    <c-common-toast></c-common-toast>
    <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
        <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
    <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">
@@ -13,10 +19,17 @@
                </lightning-layout-item>
            </lightning-layout>
        </div>
        <div style="padding:10px;">
        <div style="padding: 10px">
            <!-- 搜索 -->
            <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:10px;">
                <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
            <div
                style="
                    border: 1px solid #d4d4d4;
                    border-top: 3px solid #51606e;
                    border-radius: 5px;
                    margin-bottom: 10px;
                "
            >
                <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
                    <lightning-layout>
                        <lightning-layout-item padding="around-small">
                            <p style="font-size: 18px">
@@ -25,37 +38,63 @@
                        </lightning-layout-item>
                    </lightning-layout>
                </div>
                <div style="padding:10px;">
                <div style="padding: 10px">
                    <!-- 第一行 -->
                    <table style="margin-bottom: 20px;">
                    <table style="margin-bottom: 20px">
                        <tbody>
                            <tr>
                                <td style="width: 100px;">
                                    <div style="font-size:16px;">经销商医院</div>
                                <td style="width: 100px">
                                    <div style="font-size: 16px">
                                        经销商医院
                                    </div>
                                </td>
                                <td style="width: 230px;">
                                    <lightning-input class="inputFont" variant="label-hidden" value={accSearch} onchange={accSearchChange}></lightning-input>
                                <td style="width: 230px">
                                    <lightning-input
                                        class="inputFont"
                                        variant="label-hidden"
                                        value={accSearch}
                                        onchange={accSearchChange}
                                    ></lightning-input>
                                </td>
                                <td style="width: 30px;"></td>
                                <td style="width: 74px;">
                                    <div style="font-size:16px;">销售担当</div>
                                <td style="width: 30px"></td>
                                <td style="width: 74px">
                                    <div style="font-size: 16px">销售担当</div>
                                </td>
                                <td style="width: 230px;">
                                    <lightning-input class="inputFont" variant="label-hidden" value={aooSearch} onchange={aooSearchChange}></lightning-input>
                                <td style="width: 230px">
                                    <lightning-input
                                        class="inputFont"
                                        variant="label-hidden"
                                        value={aooSearch}
                                        onchange={aooSearchChange}
                                    ></lightning-input>
                                </td>
                                <td style="width: 30px;"></td>
                                <td style="width: 32px;">
                                    <span style="font-size:16px;">显示</span>
                                <td style="width: 30px"></td>
                                <td style="width: 32px">
                                    <span style="font-size: 16px">显示</span>
                                </td>
                                <td style="width: 50px;">
                                    <lightning-combobox class="inputFont" variant="label-hidden" value={limits} options={limitOpts} onchange={limitsChange}></lightning-combobox>
                                <td style="width: 50px">
                                    <lightning-combobox
                                        class="inputFont"
                                        variant="label-hidden"
                                        value={limits}
                                        options={limitOpts}
                                        onchange={limitsChange}
                                    ></lightning-combobox>
                                </td>
                                <td style="width: 48px;">
                                    <span style="font-size:16px;">条数据</span>
                                <td style="width: 48px">
                                    <span style="font-size: 16px">条数据</span>
                                </td>
                                <td style="width: 30px;"></td>
                                <td style="width: 64px;">
                                    <a href="#" onclick={expandAll} style="text-decoration: underline;font-size:16px;">全部展开</a>
                                <td style="width: 30px"></td>
                                <td style="width: 64px">
                                    <a
                                        href="#"
                                        onclick={expandAll}
                                        style="
                                            text-decoration: underline;
                                            font-size: 16px;
                                        "
                                        >全部展开</a
                                    >
                                </td>
                                <td></td>
                            </tr>
@@ -65,22 +104,53 @@
                    <table>
                        <tbody>
                            <tr>
                                <td style="width: 100px;">
                                    <div style="font-size:16px;">数据字段</div>
                                <td style="width: 100px">
                                    <div style="font-size: 16px">数据字段</div>
                                </td>
                                <td>
                                    <lightning-combobox class="inputFont" variant="label-hidden" value={numtext1} options={textOpts} onchange={numtext1Change}></lightning-combobox>
                                    <lightning-combobox
                                        class="inputFont"
                                        variant="label-hidden"
                                        value={numtext1}
                                        options={textOpts}
                                        onchange={numtext1Change}
                                    ></lightning-combobox>
                                </td>
                                <td>
                                    <lightning-combobox style="margin-left:10px;" class="inputFont" variant="label-hidden" value={numtext2} options={equalOpts} onchange={numtext2Change}></lightning-combobox>
                                    <lightning-combobox
                                        style="margin-left: 10px"
                                        class="inputFont"
                                        variant="label-hidden"
                                        value={numtext2}
                                        options={equalOpts}
                                        onchange={numtext2Change}
                                    ></lightning-combobox>
                                </td>
                                <td>
                                    <lightning-input style="margin-left:10px;" class="inputFont" variant="label-hidden" value={numtext} onchange={numtextChange}></lightning-input>
                                    <lightning-input
                                        style="margin-left: 10px"
                                        class="inputFont"
                                        variant="label-hidden"
                                        value={numtext}
                                        onchange={numtextChange}
                                    ></lightning-input>
                                </td>
                                <td style="width: 30px;"></td>
                                <td style="width: 30px"></td>
                                <td>
                                    <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height: 32px;" onclick={search}>检索</button>
                                    <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height: 32px;" onclick={save}>保存</button>
                                    <button
                                        class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
                                        style="height: 32px"
                                        onclick={search}
                                    >
                                        检索
                                    </button>
                                    <button
                                        class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
                                        style="height: 32px"
                                        onclick={save}
                                    >
                                        保存
                                    </button>
                                </td>
                            </tr>
                        </tbody>
@@ -88,8 +158,14 @@
                </div>
            </div>
            <!-- 数据展示 -->
            <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
                <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
            <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">
@@ -98,14 +174,32 @@
                        </lightning-layout-item>
                    </lightning-layout>
                </div>
                <div style="padding:10px;">
                    <c-lex-custom-lightning-datatable key-field="recordId" columns={colms} data={datas} oninputchange={agencyOppInputChange} class="wrapped-header-datatable"
                    default-sort-direction={defaultSortDirection} sorted-direction={sortDirection}
                    sorted-by={sortedBy} onsort={onHandleSort} hide-checkbox-column={hidecheckboxcolumn}></c-lex-custom-lightning-datatable>
                    <c-paginator onprevious={handlePrevious} onnext={handleNext} onpageschange={handlePageschange}
                    onfirst={handleFirst} onlast={handleLast} page-size-options={pageSizeOptions}
                    previous-button-disabled={previousButtonDisabled} next-button-disabled={nextButtonDisabled}
                    record-start={recordStart} record-end={recordEnd} total-records={totalRecords}></c-paginator>
                <div style="padding: 10px">
                    <c-lex-custom-lightning-datatable
                        key-field="recordId"
                        columns={colms}
                        data={datas}
                        oninputchange={agencyOppInputChange}
                        class="wrapped-header-datatable"
                        default-sort-direction={defaultSortDirection}
                        sorted-direction={sortDirection}
                        sorted-by={sortedBy}
                        onsort={onHandleSort}
                        hide-checkbox-column={hidecheckboxcolumn}
                    ></c-lex-custom-lightning-datatable>
                    <c-paginator
                        onprevious={handlePrevious}
                        onnext={handleNext}
                        onpageschange={handlePageschange}
                        onfirst={handleFirst}
                        onlast={handleLast}
                        page-size-options={pageSizeOptions}
                        previous-button-disabled={previousButtonDisabled}
                        next-button-disabled={nextButtonDisabled}
                        record-start={recordStart}
                        record-end={recordEnd}
                        total-records={totalRecords}
                    ></c-paginator>
                    <!-- <lightning-layout multiple-rows="true">
                        <lightning-layout-item size="6">
                            <table id="tableLeft" >
force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.js
@@ -6,12 +6,10 @@
// import jQueryMin from '@salesforce/resourceUrl/lexJQuery';
// import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
//table css 
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
import { loadStyle } from 'lightning/platformResourceLoader';
import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
export default class LexDealerInquiryModifyState extends LightningElement {
    @track showSpinner = true;
    //表头样式
    stylesLoaded = false;
@@ -28,7 +26,7 @@
    @track strRtColumus = '';
    //分页start
    @track sortBy = "";
    @track sortBy = '';
    //@track sortDirection = "asc";
    @track pageSize = 10;
    error;
@@ -44,17 +42,14 @@
    @track recordStart = 0;
    @track recordEnd = 0;
    //end
    defaultSortDirection = "asc";
    sortDirection = "asc";
    defaultSortDirection = 'asc';
    sortDirection = 'asc';
    sortedBy;
    @track hidecheckboxcolumn = true;
    @track changeFlg;
    @track canEdit;
    @track saveType;
    @track sortKey;
    // @track colmLeft = [
    //     {label:"OCSM询价编码",fieldName:"field1",hideDefaultActions: true},
@@ -120,234 +115,366 @@
    @track colms = [
        {
            label: "OCSM询价编码", fieldName: "OCSM_Opportunity_No__c", hideDefaultActions: true, wrapText: true, initialWidth: 140,sortable: true,
            label: 'OCSM询价编码',
            fieldName: 'OCSM_Opportunity_No__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 140,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "OCSM_Opportunity_No__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'OCSM_Opportunity_No__c' },
                showType: 'outputField'
            },
            }
        },
        {
            label: "OCSM询价", fieldName: "Change_To_Opportunity_T__c", hideDefaultActions: true, wrapText: true, initialWidth: 100,sortable: true,
            label: 'OCSM询价',
            fieldName: 'Change_To_Opportunity_T__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 100,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Change_To_Opportunity_T__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Change_To_Opportunity_T__c' },
                showType: 'outputField'
            },
            }
        },
        {
            label: "科室分类", fieldName: "Strategic_department_Class_Name__c", hideDefaultActions: true, wrapText: true, initialWidth: 105,sortable: true,
            label: '科室分类',
            fieldName: 'Strategic_department_Class_Name__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 105,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Strategic_department_Class_Name__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Strategic_department_Class_Name__c' },
                showType: 'outputField'
            },
            }
        },
        {
            label: "状态1", fieldName: "Oly_Inquiry_Status1__c", hideDefaultActions: true, wrapText: true, initialWidth: 100,sortable: true,
            label: '状态1',
            fieldName: 'Oly_Inquiry_Status1__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 100,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Oly_Inquiry_Status1__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Oly_Inquiry_Status1__c' },
                showType: 'outputField'
            },
            }
        },
        {
            label: "Oly询价阶段", fieldName: "Oly_Inquiry_Stage__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
            label: 'Oly询价阶段',
            fieldName: 'Oly_Inquiry_Stage__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 110,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Oly_Inquiry_Stage__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Oly_Inquiry_Stage__c' },
                showType: 'outputField'
            },
            }
        },
        {
            label: "预测OCSM签约日", fieldName: "Oly_Forecasted_Date__c", hideDefaultActions: true, wrapText: true, initialWidth: 150,sortable: true,
            label: '预测OCSM签约日',
            fieldName: 'Oly_Forecasted_Date__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 150,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Oly_Forecasted_Date__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Oly_Forecasted_Date__c' },
                showType: 'outputField'
            },
            }
        },
        {
            label: "是否上月预测询价", fieldName: "Oly_Forecast_last_month__c", hideDefaultActions: true, wrapText: true, initialWidth: 150,sortable: true,
            label: '是否上月预测询价',
            fieldName: 'Oly_Forecast_last_month__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 150,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Oly_Forecast_last_month__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Oly_Forecast_last_month__c' },
                showType: 'outputField'
            },
            }
        },
        {
            label: "是否本月预测询价", fieldName: "Oly_Forecast_this_month__c", hideDefaultActions: true, wrapText: true, initialWidth: 150,sortable: true,
            label: '是否本月预测询价',
            fieldName: 'Oly_Forecast_this_month__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 150,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Oly_Forecast_this_month__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Oly_Forecast_this_month__c' },
                showType: 'outputField'
            },
            }
        },
        {
            label: "是否次月预测询价", fieldName: "Oly_NM_Forecast__c", hideDefaultActions: true, wrapText: true, initialWidth: 150,sortable: true,
            label: '是否次月预测询价',
            fieldName: 'Oly_NM_Forecast__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 150,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Oly_NM_Forecast__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Oly_NM_Forecast__c' },
                showType: 'outputField'
            },
            }
        },
        {
            label: "授权申请编码", fieldName: "Oly_Authorized_DB_No__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
            label: '授权申请编码',
            fieldName: 'Oly_Authorized_DB_No__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 110,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Oly_Authorized_DB_No__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Oly_Authorized_DB_No__c' },
                showType: 'outputField'
            },
            }
        },
        // -----------------------------------------------
        {
            label: "询价名", fieldName: "NameLink", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
            label: '询价名',
            fieldName: 'NameLink',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 110,
            sortable: true,
            type: 'url',
            typeAttributes: { label: { fieldName: 'Name' }, target: '_blank' }
        },
        {
            label: "经销商询价编码", fieldName: "Agency_Opportunity_No__c", hideDefaultActions: true, wrapText: true, initialWidth: 130,sortable: true,
            label: '经销商询价编码',
            fieldName: 'Agency_Opportunity_No__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 130,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Agency_Opportunity_No__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Agency_Opportunity_No__c' },
                showType: 'outputField'
            },
            }
        },
        {
            label: "经销商医院", fieldName: "Agency_Hospital__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
            label: '经销商医院',
            fieldName: 'Agency_Hospital__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 110,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Agency_Hospital__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Agency_Hospital__c' },
                showType: 'inputField'
            },
            }
        },
        {
            label: "科室分类", fieldName: "Department_Cateogy__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
            label: '科室分类',
            fieldName: 'Department_Cateogy__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 110,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Department_Cateogy__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Department_Cateogy__c' },
                showType: 'inputField'
            },
            }
        },
        {
            label: "科室名称", fieldName: "Department_Name_Text__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
            label: '科室名称',
            fieldName: 'Department_Name_Text__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 110,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Department_Cateogy__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Department_Cateogy__c' },
                showType: 'inputField'
            },
            }
        },
        {
            label: "市", fieldName: "Hospital_City_Master__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
            label: '市',
            fieldName: 'Hospital_City_Master__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 110,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Hospital_City_Master__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Hospital_City_Master__c' },
                showType: 'outputField'
            },
            }
        },
        {
            label: "产品区分1", fieldName: "Product_Category1_P__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
            label: '产品区分1',
            fieldName: 'Product_Category1_P__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 110,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Product_Category1_P__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Product_Category1_P__c' },
                showType: 'inputField'
            },
            }
        },
        {
            label: "产品区分2", fieldName: "Product_Category2_P__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
            label: '产品区分2',
            fieldName: 'Product_Category2_P__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 110,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Product_Category2_P__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Product_Category2_P__c' },
                showType: 'inputField'
            },
            }
        },
        {
            label: "产品区分3", fieldName: "Product_Category3_P__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
            label: '产品区分3',
            fieldName: 'Product_Category3_P__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 110,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Product_Category3_P__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Product_Category3_P__c' },
                showType: 'inputField'
            },
            }
        },
        {
            label: "客户人员", fieldName: "Agency_Contact__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
            label: '客户人员',
            fieldName: 'Agency_Contact__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 110,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Agency_Contact__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Agency_Contact__c' },
                showType: 'inputField'
            },
            }
        },
        {
            label: "销售担当", fieldName: "Agency_PersonName__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
            label: '销售担当',
            fieldName: 'Agency_PersonName__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 110,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Agency_PersonName__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Agency_PersonName__c' },
                showType: 'outputField'
            },
            }
        },
        {
            label: "医院采购预算(不含税,元)", fieldName: "Amount__c", hideDefaultActions: true, wrapText: true, initialWidth: 200,sortable: true,
            label: '医院采购预算(不含税,元)',
            fieldName: 'Amount__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 200,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Amount__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Amount__c' },
                showType: 'inputField'
            },
            }
        },
        {
            label: "订货金额(不含税,元)", fieldName: "OCMSale_Price__c", hideDefaultActions: true, wrapText: true, initialWidth: 190,sortable: true,
            label: '订货金额(不含税,元)',
            fieldName: 'OCMSale_Price__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 190,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "OCMSale_Price__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'OCMSale_Price__c' },
                showType: 'inputField'
            },
            }
        },
        {
            label: "预测与OCSM签约日", fieldName: "Close_Forecasted_Date__c", hideDefaultActions: true, wrapText: true, initialWidth: 190,sortable: true,
            label: '预测与OCSM签约日',
            fieldName: 'Close_Forecasted_Date__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 190,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Close_Forecasted_Date__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Close_Forecasted_Date__c' },
                showType: 'inputField'
            },
            }
        },
        {
            label: "预测招标日", fieldName: "Bid_Planned_Date__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
            label: '预测招标日',
            fieldName: 'Bid_Planned_Date__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 110,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "Bid_Planned_Date__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'Bid_Planned_Date__c' },
                showType: 'inputField'
            },
            }
        },
        {
            label: "询价阶段", fieldName: "StageName__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
            label: '询价阶段',
            fieldName: 'StageName__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 110,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "StageName__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'StageName__c' },
                showType: 'inputField'
            },
            }
        },
        {
            label: "是否OCSM共享询价", fieldName: "OCM_Change_To_Opportunity_Flg__c", hideDefaultActions: true, wrapText: true, initialWidth: 190,sortable: true,
            label: '是否OCSM共享询价',
            fieldName: 'OCM_Change_To_Opportunity_Flg__c',
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 190,
            sortable: true,
            typeAttributes: {
                recordId: { fieldName: "recordId" },
                inputValue: { fieldName: "OCM_Change_To_Opportunity_Flg__c" },
                recordId: { fieldName: 'recordId' },
                inputValue: { fieldName: 'OCM_Change_To_Opportunity_Flg__c' },
                showType: 'inputField'
            },
            }
        }
    ];
    @track datas = [];
    renderedCallback() {
        if (!this.stylesLoaded) {
            Promise.all([loadStyle(this, WrappedHeaderTable)])
                .then(() => {
                    console.log("Custom styles loaded");
                    console.log('Custom styles loaded');
                    this.stylesLoaded = true;
                })
                .catch((error) => {
                    console.error("Error loading custom styles");
                    console.error('Error loading custom styles');
                });
        }
    }
@@ -356,7 +483,6 @@
    connectedCallback() {
        this.loader = true;
        this.init();
    }
    init(){
        this.showSpinner = true;
@@ -364,7 +490,7 @@
            pageSizeLWC: this.pageSize,
            pageTokenLWC: this.currentPageToken
        })
            .then(result => {
            .then((result) => {
                if (result.result == 'Success') {
                    console.log('result==>' + JSON.stringify(result));
                    //分页start
@@ -372,9 +498,12 @@
                    this.totalRecords = result.paginatedAccounts.totalRecords;
                    this.recordStart = result.paginatedAccounts.recordStart;
                    this.recordEnd = result.paginatedAccounts.recordEnd;
                    this.totalPages = Math.ceil(result.paginatedAccounts.totalRecords / this.pageSize);
                    this.totalPages = Math.ceil(
                        result.paginatedAccounts.totalRecords / this.pageSize
                    );
                    console.log('this.totalPages = ' + this.totalPages);
                    this.paginationVisibility = this.totalPages > 1 ? true : false;
                    this.paginationVisibility =
                        this.totalPages > 1 ? true : false;
                     console.log('this.sortDirection = ' + this.sortDirection);
                    this.loader = false;
                    //分页end
@@ -391,35 +520,66 @@
                    this.changeFlg = result.oppRecords.changeFlg;
                    for (var i in this.datas) {
                        this.datas[i]['recordId'] = this.datas[i].opp.Id;
                        this.datas[i]['OCSM_Opportunity_No__c'] = this.datas[i].opp.OCSM_Opportunity_No__c;
                        this.datas[i]['Change_To_Opportunity_T__c'] = this.datas[i].opp.Change_To_Opportunity_T__c;
                        this.datas[i]['Strategic_department_Class_Name__c'] = this.datas[i].opp.Strategic_department_Class_Name__c;
                        this.datas[i]['Oly_Inquiry_Status1__c'] = this.datas[i].opp.Oly_Inquiry_Status1__c;
                        this.datas[i]['Oly_Inquiry_Stage__c'] = this.datas[i].opp.Oly_Inquiry_Stage__c;
                        this.datas[i]['Oly_Forecasted_Date__c'] = this.datas[i].opp.Oly_Forecasted_Date__c;
                        this.datas[i]['Oly_Forecast_last_month__c'] = this.datas[i].opp.Oly_Forecast_last_month__c;
                        this.datas[i]['Oly_Forecast_this_month__c'] = this.datas[i].opp.Oly_Forecast_this_month__c;
                        this.datas[i]['Oly_NM_Forecast__c'] = this.datas[i].opp.Oly_NM_Forecast__c;
                        this.datas[i]['Oly_Authorized_DB_No__c'] = this.datas[i].opp.Oly_Authorized_DB_No__c;
                        this.datas[i]['OCSM_Opportunity_No__c'] =
                            this.datas[i].opp.OCSM_Opportunity_No__c;
                        this.datas[i]['Change_To_Opportunity_T__c'] =
                            this.datas[i].opp.Change_To_Opportunity_T__c;
                        this.datas[i]['Strategic_department_Class_Name__c'] =
                            this.datas[
                                i
                            ].opp.Strategic_department_Class_Name__c;
                        this.datas[i]['Oly_Inquiry_Status1__c'] =
                            this.datas[i].opp.Oly_Inquiry_Status1__c;
                        this.datas[i]['Oly_Inquiry_Stage__c'] =
                            this.datas[i].opp.Oly_Inquiry_Stage__c;
                        this.datas[i]['Oly_Forecasted_Date__c'] =
                            this.datas[i].opp.Oly_Forecasted_Date__c;
                        this.datas[i]['Oly_Forecast_last_month__c'] =
                            this.datas[i].opp.Oly_Forecast_last_month__c;
                        this.datas[i]['Oly_Forecast_this_month__c'] =
                            this.datas[i].opp.Oly_Forecast_this_month__c;
                        this.datas[i]['Oly_NM_Forecast__c'] =
                            this.datas[i].opp.Oly_NM_Forecast__c;
                        this.datas[i]['Oly_Authorized_DB_No__c'] =
                            this.datas[i].opp.Oly_Authorized_DB_No__c;
                        // -------
                        this.datas[i]['Name'] = this.datas[i].AgcOpp.Name;
                        this.datas[i]['Agency_Opportunity_No__c'] = this.datas[i].AgcOpp.Agency_Opportunity_No__c;
                        this.datas[i]['Agency_Hospital__c'] = this.datas[i].AgcOpp.Agency_Hospital__c;
                        this.datas[i]['Department_Cateogy__c'] = this.datas[i].AgcOpp.Department_Cateogy__c;
                        this.datas[i]['Department_Name_Text__c'] = this.datas[i].AgcOpp.Department_Name_Text__c;
                        this.datas[i]['Hospital_City_Master__c'] = this.datas[i].AgcOpp.Hospital_City_Master__c;
                        this.datas[i]['Product_Category1_P__c'] = this.datas[i].AgcOpp.Product_Category1_P__c;
                        this.datas[i]['Product_Category2_P__c'] = this.datas[i].AgcOpp.Product_Category2_P__c;
                        this.datas[i]['Product_Category3_P__c'] = this.datas[i].AgcOpp.Product_Category3_P__c;
                        this.datas[i]['Agency_Contact__c'] = this.datas[i].AgcOpp.Agency_Contact__c;
                        this.datas[i]['Agency_PersonName__c'] = this.datas[i].AgcOpp.Agency_PersonName__c;
                        this.datas[i]['Amount__c'] = this.datas[i].AgcOpp.Amount__c;
                        this.datas[i]['OCMSale_Price__c'] = this.datas[i].AgcOpp.OCMSale_Price__c;
                        this.datas[i]['Close_Forecasted_Date__c'] = this.datas[i].AgcOpp.Close_Forecasted_Date__c;
                        this.datas[i]['Bid_Planned_Date__c'] = this.datas[i].AgcOpp.Bid_Planned_Date__c;
                        this.datas[i]['StageName__c'] = this.datas[i].AgcOpp.StageName__c;
                        this.datas[i]['OCM_Change_To_Opportunity_Flg__c'] = this.datas[i].AgcOpp.OCM_Change_To_Opportunity_Flg__c;
                        this.datas[i]['NameLink'] = '/s/agency-opportunity/'+this.datas[i].opp.Id;
                        this.datas[i]['Agency_Opportunity_No__c'] =
                            this.datas[i].AgcOpp.Agency_Opportunity_No__c;
                        this.datas[i]['Agency_Hospital__c'] =
                            this.datas[i].AgcOpp.Agency_Hospital__c;
                        this.datas[i]['Department_Cateogy__c'] =
                            this.datas[i].AgcOpp.Department_Cateogy__c;
                        this.datas[i]['Department_Name_Text__c'] =
                            this.datas[i].AgcOpp.Department_Name_Text__c;
                        this.datas[i]['Hospital_City_Master__c'] =
                            this.datas[i].AgcOpp.Hospital_City_Master__c;
                        this.datas[i]['Product_Category1_P__c'] =
                            this.datas[i].AgcOpp.Product_Category1_P__c;
                        this.datas[i]['Product_Category2_P__c'] =
                            this.datas[i].AgcOpp.Product_Category2_P__c;
                        this.datas[i]['Product_Category3_P__c'] =
                            this.datas[i].AgcOpp.Product_Category3_P__c;
                        this.datas[i]['Agency_Contact__c'] =
                            this.datas[i].AgcOpp.Agency_Contact__c;
                        this.datas[i]['Agency_PersonName__c'] =
                            this.datas[i].AgcOpp.Agency_PersonName__c;
                        this.datas[i]['Amount__c'] =
                            this.datas[i].AgcOpp.Amount__c;
                        this.datas[i]['OCMSale_Price__c'] =
                            this.datas[i].AgcOpp.OCMSale_Price__c;
                        this.datas[i]['Close_Forecasted_Date__c'] =
                            this.datas[i].AgcOpp.Close_Forecasted_Date__c;
                        this.datas[i]['Bid_Planned_Date__c'] =
                            this.datas[i].AgcOpp.Bid_Planned_Date__c;
                        this.datas[i]['StageName__c'] =
                            this.datas[i].AgcOpp.StageName__c;
                        this.datas[i]['OCM_Change_To_Opportunity_Flg__c'] =
                            this.datas[
                                i
                            ].AgcOpp.OCM_Change_To_Opportunity_Flg__c;
                        this.datas[i]['NameLink'] =
                            '/s/agency-opportunity/' + this.datas[i].opp.Id;
                    }
                    this.showMyToast(result.Msg, '', 'success');
                    this.showSpinner = false;
@@ -428,12 +588,15 @@
                    this.showMyToast('初始化页面失败', result.Msg, 'error');
                }
            })
            .catch(error => {
            .catch((error) => {
                this.showSpinner = false;
                console.log("Error:" + JSON.stringify(error));
                this.showMyToast('初始化页面失败', JSON.stringify(error), 'error');
            })
                console.log('Error:' + JSON.stringify(error));
                this.showMyToast(
                    '初始化页面失败',
                    JSON.stringify(error),
                    'error'
                );
            });
    }
    // renderedCallback() {
@@ -473,14 +636,16 @@
        var inputValue = event.detail.data.inputValue;
        var recordId = event.detail.data.recordId;
        var fieldName = event.detail.data.fieldName;
        console.log("valueChange:" + recordId + '---' + fieldName + '---' + inputValue);
        console.log(
            'valueChange:' + recordId + '---' + fieldName + '---' + inputValue
        );
        for (var i in this.datas) {
            if (this.datas[i]['recordId'] == recordId) {
                this.datas[i]['fieldName'] = inputValue;
                this.datas[i]['changeFlg'] =  this.changeFlg;
            }
        }
        console.log(" this.datas==>" + JSON.stringify(this.datas));
        console.log(' this.datas==>' + JSON.stringify(this.datas));
    }
    accSearchChange(event) {
@@ -507,15 +672,17 @@
        this.numtext = event.detail.value;
    }
    expandAll() {
    }
    expandAll() {}
    search(){
        console.log('搜索');
        this.showSpinner = true;
        if(this.changeFlg == 1){
            if (window.confirm('画面上的数据有变化,要保存所做的变更吗?\n点击 [确定] 保存并检索\n点击 [取消] 只检索,放弃保存')) {
            if (
                window.confirm(
                    '画面上的数据有变化,要保存所做的变更吗?\n点击 [确定] 保存并检索\n点击 [取消] 只检索,放弃保存'
                )
            ) {
                this.save();
                this.searchOpp();
                this.showSpinner = false;
@@ -527,8 +694,6 @@
        }else{
            this.searchOpp();
            this.showSpinner = false;
        }
    }
    searchOpp(){
@@ -544,8 +709,9 @@
            aooSearch: this.aooSearch,
            numtext: this.numtext,
            numtext1: this.numtext1,
            numtext2: this.numtext2,
        }).then((result) => {
            numtext2: this.numtext2
        })
            .then((result) => {
            if (result.result == 'Success') {
                //分页Start
                // this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
@@ -562,45 +728,73 @@
                console.log('result==>' + JSON.stringify(result));
                for (var i in this.datas) {
                    this.datas[i]['recordId'] = this.datas[i].opp.Id;
                    this.datas[i]['OCSM_Opportunity_No__c'] = this.datas[i].opp.OCSM_Opportunity_No__c;
                    this.datas[i]['Change_To_Opportunity_T__c'] = this.datas[i].opp.Change_To_Opportunity_T__c;
                    this.datas[i]['Strategic_department_Class_Name__c'] = this.datas[i].opp.Strategic_department_Class_Name__c;
                    this.datas[i]['Oly_Inquiry_Status1__c'] = this.datas[i].opp.Oly_Inquiry_Status1__c;
                    this.datas[i]['Oly_Inquiry_Stage__c'] = this.datas[i].opp.Oly_Inquiry_Stage__c;
                    this.datas[i]['Oly_Forecasted_Date__c'] = this.datas[i].opp.Oly_Forecasted_Date__c;
                    this.datas[i]['Oly_Forecast_last_month__c'] = this.datas[i].opp.Oly_Forecast_last_month__c;
                    this.datas[i]['Oly_Forecast_this_month__c'] = this.datas[i].opp.Oly_Forecast_this_month__c;
                    this.datas[i]['Oly_NM_Forecast__c'] = this.datas[i].opp.Oly_NM_Forecast__c;
                    this.datas[i]['Oly_Authorized_DB_No__c'] = this.datas[i].opp.Oly_Authorized_DB_No__c;
                        this.datas[i]['OCSM_Opportunity_No__c'] =
                            this.datas[i].opp.OCSM_Opportunity_No__c;
                        this.datas[i]['Change_To_Opportunity_T__c'] =
                            this.datas[i].opp.Change_To_Opportunity_T__c;
                        this.datas[i]['Strategic_department_Class_Name__c'] =
                            this.datas[
                                i
                            ].opp.Strategic_department_Class_Name__c;
                        this.datas[i]['Oly_Inquiry_Status1__c'] =
                            this.datas[i].opp.Oly_Inquiry_Status1__c;
                        this.datas[i]['Oly_Inquiry_Stage__c'] =
                            this.datas[i].opp.Oly_Inquiry_Stage__c;
                        this.datas[i]['Oly_Forecasted_Date__c'] =
                            this.datas[i].opp.Oly_Forecasted_Date__c;
                        this.datas[i]['Oly_Forecast_last_month__c'] =
                            this.datas[i].opp.Oly_Forecast_last_month__c;
                        this.datas[i]['Oly_Forecast_this_month__c'] =
                            this.datas[i].opp.Oly_Forecast_this_month__c;
                        this.datas[i]['Oly_NM_Forecast__c'] =
                            this.datas[i].opp.Oly_NM_Forecast__c;
                        this.datas[i]['Oly_Authorized_DB_No__c'] =
                            this.datas[i].opp.Oly_Authorized_DB_No__c;
                    // -------
                    this.datas[i]['Name'] = this.datas[i].AgcOpp.Name;
                    this.datas[i]['Agency_Opportunity_No__c'] = this.datas[i].AgcOpp.Agency_Opportunity_No__c;
                    this.datas[i]['Agency_Hospital__c'] = this.datas[i].AgcOpp.Agency_Hospital__c;
                    this.datas[i]['Department_Cateogy__c'] = this.datas[i].AgcOpp.Department_Cateogy__c;
                    this.datas[i]['Department_Name_Text__c'] = this.datas[i].AgcOpp.Department_Name_Text__c;
                    this.datas[i]['Hospital_City_Master__c'] = this.datas[i].AgcOpp.Hospital_City_Master__c;
                    this.datas[i]['Product_Category1_P__c'] = this.datas[i].AgcOpp.Product_Category1_P__c;
                    this.datas[i]['Product_Category2_P__c'] = this.datas[i].AgcOpp.Product_Category2_P__c;
                    this.datas[i]['Product_Category3_P__c'] = this.datas[i].AgcOpp.Product_Category3_P__c;
                    this.datas[i]['Agency_Contact__c'] = this.datas[i].AgcOpp.Agency_Contact__c;
                    this.datas[i]['Agency_PersonName__c'] = this.datas[i].AgcOpp.Agency_PersonName__c;
                    this.datas[i]['Amount__c'] = this.datas[i].AgcOpp.Amount__c;
                    this.datas[i]['OCMSale_Price__c'] = this.datas[i].AgcOpp.OCMSale_Price__c;
                    this.datas[i]['Close_Forecasted_Date__c'] = this.datas[i].AgcOpp.Close_Forecasted_Date__c;
                    this.datas[i]['Bid_Planned_Date__c'] = this.datas[i].AgcOpp.Bid_Planned_Date__c;
                    this.datas[i]['StageName__c'] = this.datas[i].AgcOpp.StageName__c;
                    this.datas[i]['OCM_Change_To_Opportunity_Flg__c'] = this.datas[i].AgcOpp.OCM_Change_To_Opportunity_Flg__c;
                        this.datas[i]['Agency_Opportunity_No__c'] =
                            this.datas[i].AgcOpp.Agency_Opportunity_No__c;
                        this.datas[i]['Agency_Hospital__c'] =
                            this.datas[i].AgcOpp.Agency_Hospital__c;
                        this.datas[i]['Department_Cateogy__c'] =
                            this.datas[i].AgcOpp.Department_Cateogy__c;
                        this.datas[i]['Department_Name_Text__c'] =
                            this.datas[i].AgcOpp.Department_Name_Text__c;
                        this.datas[i]['Hospital_City_Master__c'] =
                            this.datas[i].AgcOpp.Hospital_City_Master__c;
                        this.datas[i]['Product_Category1_P__c'] =
                            this.datas[i].AgcOpp.Product_Category1_P__c;
                        this.datas[i]['Product_Category2_P__c'] =
                            this.datas[i].AgcOpp.Product_Category2_P__c;
                        this.datas[i]['Product_Category3_P__c'] =
                            this.datas[i].AgcOpp.Product_Category3_P__c;
                        this.datas[i]['Agency_Contact__c'] =
                            this.datas[i].AgcOpp.Agency_Contact__c;
                        this.datas[i]['Agency_PersonName__c'] =
                            this.datas[i].AgcOpp.Agency_PersonName__c;
                        this.datas[i]['Amount__c'] =
                            this.datas[i].AgcOpp.Amount__c;
                        this.datas[i]['OCMSale_Price__c'] =
                            this.datas[i].AgcOpp.OCMSale_Price__c;
                        this.datas[i]['Close_Forecasted_Date__c'] =
                            this.datas[i].AgcOpp.Close_Forecasted_Date__c;
                        this.datas[i]['Bid_Planned_Date__c'] =
                            this.datas[i].AgcOpp.Bid_Planned_Date__c;
                        this.datas[i]['StageName__c'] =
                            this.datas[i].AgcOpp.StageName__c;
                        this.datas[i]['OCM_Change_To_Opportunity_Flg__c'] =
                            this.datas[
                                i
                            ].AgcOpp.OCM_Change_To_Opportunity_Flg__c;
                }
                this.showSpinner = false;
                this.showMyToast('搜索成功', result.Msg, 'success');
            } else {
                this.showSpinner = false;
                this.showMyToast('搜索失败', result.Msg, 'error');
            }
        }).catch((error) => {
            })
            .catch((error) => {
            this.showSpinner = false;
            console.log('error = ' + JSON.stringify(error));
        });
@@ -611,24 +805,22 @@
        save({
            oppRecordsLWC: this.datas,
            sortKeyLWC:this.sortKey
        }).then((result) => {
        })
            .then((result) => {
            if (result.result == 'Success') {
                this.datas = result.oppRecords;
                console.log('result==>' + JSON.stringify(result));
                this.showSpinner = false;
                this.showMyToast('保存成功', '', 'success');
            } else {
                this.showSpinner = false;
                this.showMyToast('保存失败', result.Msg, 'error');
            }
        }).catch((error) => {
            })
            .catch((error) => {
            this.showSpinner = false;
            console.log('error = ' + JSON.stringify(error));
        });
    }
    showMyToast(title, message, variant) {
@@ -641,12 +833,18 @@
            iconName = 'utility:error';
        }
        if (message != '') {
            content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
            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);
        this.template
            .querySelector('c-common-toast')
            .showToast(variant, content, iconName, 10000);
    }
    //排序
    sortByMethod(field, reverse, primer) {
@@ -666,18 +864,27 @@
    }
    onHandleSort(event) {
        console.log("Sort");
        console.log("this.changeFlg"+this.changeFlg);
        console.log('Sort');
        console.log('this.changeFlg' + this.changeFlg);
        if(this.changeFlg == 1){
            if (window.confirm('画面上的数据有变化,要保存所做的变更吗?\n点击 [确定] 保存并排序\n点击 [取消] 只排序,放弃保存')){
            if (
                window.confirm(
                    '画面上的数据有变化,要保存所做的变更吗?\n点击 [确定] 保存并排序\n点击 [取消] 只排序,放弃保存'
                )
            ) {
                this.sortBy = event.detail.fieldName;
                this.sortDirection = event.detail.sortDirection;
                this.currentPageToken = 0;
                console.log('this.sortBy = ' + this.sortBy)
                console.log('this.sortDirection = ' + this.sortDirection)
                console.log('this.sortBy = ' + this.sortBy);
                console.log('this.sortDirection = ' + this.sortDirection);
                const { fieldName: sortedBy, sortDirection } = event.detail;
                const cloneData = [...this.datas];
                cloneData.sort(this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1));
                cloneData.sort(
                    this.sortByMethod(
                        sortedBy,
                        sortDirection === 'asc' ? 1 : -1
                    )
                );
                this.datas = cloneData;
                this.sortDirection = sortDirection;
                this.sortedBy = sortedBy;
@@ -688,11 +895,16 @@
                console.log('this.sortBy==>'+this.sortBy);
                this.sortDirection = event.detail.sortDirection;
                this.currentPageToken = 0;
                console.log('this.sortBy = ' + this.sortBy)
                console.log('this.sortDirection = ' + this.sortDirection)
                console.log('this.sortBy = ' + this.sortBy);
                console.log('this.sortDirection = ' + this.sortDirection);
                const { fieldName: sortedBy, sortDirection } = event.detail;
                const cloneData = [...this.datas];
                cloneData.sort(this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1));
                cloneData.sort(
                    this.sortByMethod(
                        sortedBy,
                        sortDirection === 'asc' ? 1 : -1
                    )
                );
                this.datas = cloneData;
                this.sortDirection = sortDirection;
                this.sortedBy = sortedBy;
@@ -702,11 +914,13 @@
            console.log('this.sortBy==>'+this.sortBy);
            this.sortDirection = event.detail.sortDirection;
            this.currentPageToken = 0;
            console.log('this.sortBy = ' + this.sortBy)
            console.log('this.sortDirection = ' + this.sortDirection)
            console.log('this.sortBy = ' + this.sortBy);
            console.log('this.sortDirection = ' + this.sortDirection);
            const { fieldName: sortedBy, sortDirection } = event.detail;
            const cloneData = [...this.datas];
            cloneData.sort(this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1));
            cloneData.sort(
                this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1)
            );
            this.datas = cloneData;
            this.sortDirection = sortDirection;
            this.sortedBy = sortedBy;
@@ -723,12 +937,14 @@
        }
    }
    handlePrevious() {
        this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize);
        this.currentPageToken =
            Number(this.currentPageToken) - Number(this.pageSize);
        this.init();
    }
    handleNext() {
        this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize);
        this.currentPageToken =
            Number(this.currentPageToken) + Number(this.pageSize);
        this.init();
    }
    handleFirst() {
@@ -737,7 +953,8 @@
    }
    handleLast() {
        this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
        this.currentPageToken =
            this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
        this.init();
    }
force-app/main/default/lwc/lexInventory/lexInventory.html
@@ -2,7 +2,10 @@
    <template if:true={showSpinner}>
        <!-- <lightning-spinner class="spinner-container" size="medium" variant="brand"></lightning-spinner> -->
        <div class="slds-spinner_container">
            <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
            <div
                role="status"
                class="slds-spinner slds-spinner_medium slds-spinner_brand"
            >
                <span class="slds-assistive-text">Loading</span>
                <div class="slds-spinner__dot-a"></div>
                <div class="slds-spinner__dot-b"></div>
@@ -11,20 +14,46 @@
    </template>
    <c-common-toast></c-common-toast>
    <template if:true={showcount}>
        <div style="border: 1px solid #D4D4D4;border-radius:5px;">
            <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
                <div style="margin:12px;">
                    <p style="font-size: 18px;float:left"><strong>库存盘点</strong></p>
        <div style="border: 1px solid #d4d4d4; border-radius: 5px">
            <div
                style="
                    border-top: 3px solid #51606e;
                    border-bottom: 1px solid #d4d4d4;
                    padding: 3px;
                "
            >
                <div style="margin: 12px">
                    <p style="font-size: 18px; float: left">
                        <strong>库存盘点</strong>
                    </p>
                </div>
                <div style="margin-left:400px;margin-bottom:12px;">
                <div style="margin-left: 400px; margin-bottom: 12px">
                    <!-- <lightning-button class = 'lexstyle' label="盘点确认" title="盘点确认" onclick={saveConfirm}></lightning-button> -->
                    <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="盘点确认" onclick={saveConfirm}>盘点确认</button>
                    <button
                        class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                        label="盘点确认"
                        onclick={saveConfirm}
                    >
                        盘点确认
                    </button>
                </div>
            </div>
            <div style="padding:10px;">
                <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
                    <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
            <div style="padding: 10px">
                <div
                    style="
                        border: 1px solid #d4d4d4;
                        border-radius: 5px;
                        margin-bottom: 7px;
                    "
                >
                    <div
                        style="
                            border-top: 3px solid #51606e;
                            border-bottom: 1px solid #d4d4d4;
                            padding: 3px;
                        "
                    >
                        <table>
                            <colgroup>
                                <col width="160px" />
@@ -45,13 +74,28 @@
                            <tbody>
                                <tr>
                                    <td></td>
                                    <td align="right" class="searchName">BarCode</td>
                                    <td style="width:600px"><lightning-textarea  class="inputFont"  name="BarCode" label=""
                                            onchange={handleChange}></lightning-textarea></td>
                                    <td align="right" class="searchName">
                                        BarCode
                                    </td>
                                    <td style="width: 600px">
                                        <lightning-textarea
                                            class="inputFont"
                                            name="BarCode"
                                            label=""
                                            onchange={handleChange}
                                        ></lightning-textarea>
                                    </td>
                                    <td align="right"></td>
                                    <td></td>
                                    <td style="width:200px">
                                        <button style="margin-top:14px;" class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="获取明细" onclick={barcodeEntrys}>获取明细</button>
                                        <button
                                            style="margin-top: 14px"
                                            class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                                            label="获取明细"
                                            onclick={barcodeEntrys}
                                        >
                                            获取明细
                                        </button>
                                        <!-- <lightning-button class = 'lexstyle' label="BarCode录入" title="BarCode录入"
                                            onclick={barcodeEntrys} style="width: 300px;"></lightning-button> -->
                                    </td>
@@ -61,8 +105,20 @@
                    </div>
                </div>
                <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
                    <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
                <div
                    style="
                        border: 1px solid #d4d4d4;
                        border-radius: 5px;
                        margin-bottom: 7px;
                    "
                >
                    <div
                        style="
                            border-top: 3px solid #51606e;
                            border-bottom: 1px solid #d4d4d4;
                            padding: 3px;
                        "
                    >
                        <!-- <p style="font-size: 16px;"><strong>在库商品库存一览</strong></p> -->
                        <lightning-layout>
                            <lightning-layout-item padding="around-small">
@@ -72,122 +128,222 @@
                            </lightning-layout-item>
                        </lightning-layout>
                    </div>
                    <div style="padding:10px;">
                        <div style="height: 300px;">
                    <div style="padding: 10px">
                        <div style="height: 300px">
                            <template if:true={showTable}>
                                <c-lex-custom-lightning-datatable key-field="key" data={data} columns={columns}
                                    ondiffreasons={diffreasons} onrowselection={getSelectedRows}
                                    selected-rows={selectedRows} class="wrapped-header-datatable">
                                <c-lex-custom-lightning-datatable
                                    key-field="key"
                                    data={data}
                                    columns={columns}
                                    ondiffreasons={diffreasons}
                                    onrowselection={getSelectedRows}
                                    selected-rows={selectedRows}
                                    class="wrapped-header-datatable"
                                >
                                </c-lex-custom-lightning-datatable>
                            </template>
                        </div>
                    </div>
                </div>
                <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
                    <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
                </div>
                <div
                    style="
                        border: 1px solid #d4d4d4;
                        border-radius: 5px;
                        margin-bottom: 7px;
                    "
                >
                    <div
                        style="
                            border-top: 3px solid #51606e;
                            border-bottom: 1px solid #d4d4d4;
                            padding: 3px;
                        "
                    >
                        <table>
                            <tr>
                                <td>
                                    <!-- <p style="font-size: 16px;"><strong>调整明细</strong></p> -->
                                    <lightning-layout>
                                        <lightning-layout-item padding="around-small">
                                        <lightning-layout-item
                                            padding="around-small"
                                        >
                                            <p style="font-size: 18px">
                                                <strong>调整明细</strong>
                                            </p>
                                        </lightning-layout-item>
                                    </lightning-layout>
                                </td>
                                <template if:true={showbutton}>
                                    <td align="center"> 
                                        <!-- <lightning-button variant="brand"  class='count' label="下载本次盘点库存变化明细" title="下载本次盘点库存变化明细"
                                            onclick={exportData} style="width: 150px;"></lightning-button> -->
                                            <button class="slds-button slds-button_neutral slds-button_stretch changeDetail" label="下载本次盘点库存变化明细" onclick={exportData}>下载本次盘点库存变化明细</button>
                                        <button
                                            class="slds-button slds-button_neutral slds-button_stretch changeDetail"
                                            label="下载本次盘点库存变化明细"
                                            onclick={exportData}
                                        >
                                            下载本次盘点库存变化明细
                                        </button>
                                        </td>
                                </template>
                            </tr>
                        </table>
                    </div>
                    <!-- <template if:true={showTable}> -->
                    <div style="padding:10px;">
                        <lightning-datatable key-field="id" data={pageCodeRecords} columns={column}
                            hide-checkbox-column={hidecheckbox} class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all; ">
                    <div style="padding: 10px">
                        <lightning-datatable
                            key-field="id"
                            data={pageCodeRecords}
                            columns={column}
                            hide-checkbox-column={hidecheckbox}
                            class="wrapped-header-datatable"
                            style="word-wrap: break-word; word-break: break-all"
                        >
                        </lightning-datatable>
                        <c-paginator onprevious={handlePrevious} onnext={handleNext} onpageschange={handlePageschange}
                            onfirst={handleFirst} onlast={handleLast} page-size-options={pageSizeOptions}
                            previous-button-disabled={previousButtonDisabled} next-button-disabled={nextButtonDisabled}
                            record-start={recordStart} record-end={recordEnd}
                            total-records={totalRecords}></c-paginator>
                        <c-paginator
                            onprevious={handlePrevious}
                            onnext={handleNext}
                            onpageschange={handlePageschange}
                            onfirst={handleFirst}
                            onlast={handleLast}
                            page-size-options={pageSizeOptions}
                            previous-button-disabled={previousButtonDisabled}
                            next-button-disabled={nextButtonDisabled}
                            record-start={recordStart}
                            record-end={recordEnd}
                            total-records={totalRecords}
                        ></c-paginator>
                    </div>
                    <!-- </template> -->
                </div>
            </div>
        </div>
    </template>
    <template if:true={EditAble}>
        <div style="border: 1px solid #D4D4D4;border-radius:5px;">
            <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
                <div style="border: 1px solid #D4D4D4;border-radius:5px;">
                    <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:6px;">
                        <p style="font-size: 19px;"><strong>盘点情况一览</strong></p>
        <div style="border: 1px solid #d4d4d4; border-radius: 5px">
            <div
                style="
                    border-top: 3px solid #51606e;
                    border-bottom: 1px solid #d4d4d4;
                    padding: 3px;
                "
            >
                <div style="border: 1px solid #d4d4d4; border-radius: 5px">
                    <div
                        style="
                            border-top: 3px solid #51606e;
                            border-bottom: 1px solid #d4d4d4;
                            padding: 6px;
                        "
                    >
                        <p style="font-size: 19px">
                            <strong>盘点情况一览</strong>
                        </p>
                    </div>
                    <div class="acc-container">
                        <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={conId}
                            onload={handleLoad2} class="hideHelpText">
                            <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
                        <lightning-record-edit-form
                            object-api-name="Consumable_order__c"
                            record-id={conId}
                            onload={handleLoad2}
                            class="hideHelpText"
                        >
                            <div
                                class="slds-modal__content slds-p-around_medium"
                                id="modal-content-id-1"
                            >
                                <div class="slds-grid">
                                    <div class="slds-col slds-size_1-of-2">
                                        <lightning-output-field field-name="Name"
                                            class="hehe-layoutItem" style="padding-left:20px;"></lightning-output-field>
                                        <lightning-output-field
                                            field-name="Name"
                                            class="hehe-layoutItem"
                                            style="padding-left: 20px"
                                        ></lightning-output-field>
                                    </div>
                                    <div class="slds-col slds-size_1-of-2">
                                        <lightning-output-field field-name="Inventory_date__c"
                                            class="hehe-layoutItem"></lightning-output-field>
                                        <lightning-output-field
                                            field-name="Inventory_date__c"
                                            class="hehe-layoutItem"
                                        ></lightning-output-field>
                                    </div>
                                </div>
                            </div>
                        </lightning-record-edit-form>
                    </div>
                </div>
                <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-top:10px">
                    <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:6px;">
                        <lightning-accordion allow-multiple-sections-open class="slds-m-around_medium"
                            active-section-name={activeSections}>
                            <lightning-accordion-section name="dataExpand" label="盘点明细" class="accordionClass">
                                <lightning-datatable key-field="id" data={detailData} columns={dcolumns}
                <div
                    style="
                        border: 1px solid #d4d4d4;
                        border-radius: 5px;
                        margin-top: 10px;
                    "
                >
                    <div
                        style="
                            border-top: 3px solid #51606e;
                            border-bottom: 1px solid #d4d4d4;
                            padding: 6px;
                        "
                    >
                        <lightning-accordion
                            allow-multiple-sections-open
                            class="slds-m-around_medium"
                            active-section-name={activeSections}
                        >
                            <lightning-accordion-section
                                name="dataExpand"
                                label="盘点明细"
                                class="accordionClass"
                            >
                                <lightning-datatable
                                    key-field="id"
                                    data={detailData}
                                    columns={dcolumns}
                                    hide-checkbox-column={hidecheckbox}
                                    class="wrapped-header-datatable accordionClass2">
                                    class="wrapped-header-datatable accordionClass2"
                                >
                                </lightning-datatable>
                            </lightning-accordion-section>
                        </lightning-accordion>
                    </div>
                </div>
                <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-top:10px">
                    <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:6px;">
                        <lightning-accordion allow-multiple-sections-open class="slds-m-around_medium"
                            active-section-name={activeSections}>
                            <lightning-accordion-section name="dataExpand" label="在库调整明细" class="accordionClass">
                                <lightning-datatable key-field="id" data={adjustdata} columns={stockadjustcolumns}
                <div
                    style="
                        border: 1px solid #d4d4d4;
                        border-radius: 5px;
                        margin-top: 10px;
                    "
                >
                    <div
                        style="
                            border-top: 3px solid #51606e;
                            border-bottom: 1px solid #d4d4d4;
                            padding: 6px;
                        "
                    >
                        <lightning-accordion
                            allow-multiple-sections-open
                            class="slds-m-around_medium"
                            active-section-name={activeSections}
                        >
                            <lightning-accordion-section
                                name="dataExpand"
                                label="在库调整明细"
                                class="accordionClass"
                            >
                                <lightning-datatable
                                    key-field="id"
                                    data={adjustdata}
                                    columns={stockadjustcolumns}
                                    hide-checkbox-column={hidecheckbox}
                                    class="wrapped-header-datatable accordionClass2">
                                    class="wrapped-header-datatable accordionClass2"
                                >
                                </lightning-datatable>
                            </lightning-accordion-section>
                        </lightning-accordion>
                    </div>
                </div>
            </div>
        </div>
    </template>
</template>
force-app/main/default/lwc/lexInventory/lexInventory.js
@@ -1,222 +1,193 @@
import { LightningElement, wire, api, track } from "lwc";
import oninit from "@salesforce/apex/LexInventoryController.init";
import { LightningElement, wire, api, track } from 'lwc';
import oninit from '@salesforce/apex/LexInventoryController.init';
// import sheetjs from '@salesforce/resourceUrl/sheetjs';
import barcodeEntry from "@salesforce/apex/LexInventoryController.searchConsumableorderdetails";
import save from "@salesforce/apex/LexInventoryController.save";
import datainit from "@salesforce/apex/LexInventoryListController.init";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import { NavigationMixin } from "lightning/navigation";
import barcodeEntry from '@salesforce/apex/LexInventoryController.searchConsumableorderdetails';
import save from '@salesforce/apex/LexInventoryController.save';
import datainit from '@salesforce/apex/LexInventoryListController.init';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
//table css 
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
import { loadStyle } from 'lightning/platformResourceLoader';
import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
//库存盘点主页面数据
const columns = [
    {
        label: "是否盘点",
        fieldName: "iscount",
        label: '是否盘点',
        fieldName: 'iscount',
        hideDefaultActions: true,
        initialWidth: 80,
        initialWidth: 80
    },
    {
        label: "消耗品名称",
        fieldName: "Name__c",
        label: '消耗品名称',
        fieldName: 'Name__c',
        hideDefaultActions: true,
        // initialWidth: 400,
        wrapText:true
    },
    {
        label: "规格",
        label: '规格',
        initialWidth: 50,
        fieldName: "Packing_list_manual__c",
        cellAttributes: { alignment: "right" },
        hideDefaultActions: true,
        fieldName: 'Packing_list_manual__c',
        cellAttributes: { alignment: 'right' },
        hideDefaultActions: true
    },
    {
        label: "单位",
        fieldName: "boxPiece",
        label: '单位',
        fieldName: 'boxPiece',
        initialWidth: 50,
        hideDefaultActions: true,
        hideDefaultActions: true
    },
    {
        label: "有效期内库存",
        fieldName: "limitCount",
        label: '有效期内库存',
        fieldName: 'limitCount',
        initialWidth: 120,
        hideDefaultActions: true,
        cellAttributes: { alignment: "right" },
        cellAttributes: { alignment: 'right' }
    },
    {
        label: "过期库存",
        label: '过期库存',
        initialWidth: 100,
        fieldName: "overlimitCount",
        fieldName: 'overlimitCount',
        hideDefaultActions: true,
        cellAttributes: { alignment: "right" },
        cellAttributes: { alignment: 'right' }
    },
    {
        label: "盘点",
        label: '盘点',
        initialWidth: 50,
        fieldName: "Pandian",
        fieldName: 'Pandian',
        hideDefaultActions: true,
        cellAttributes: { alignment: "right" },
        cellAttributes: { alignment: 'right' }
    },
    {
        label: "丢失",
        label: '丢失',
        initialWidth: 50,
        fieldName: "Diff",
        fieldName: 'Diff',
        hideDefaultActions: true,
        cellAttributes: { alignment: "right" },
        cellAttributes: { alignment: 'right' }
    },
    {
        label: "寻回",
        label: '寻回',
        initialWidth: 50,
        fieldName: "refind",
        fieldName: 'refind',
        hideDefaultActions: true,
        cellAttributes: { alignment: "right" },
        cellAttributes: { alignment: 'right' }
    },
    {
        label: "差异原因",
        label: '差异原因',
        // fieldName: "DiffReason",
        initialWidth: 200,
        hideDefaultActions: true,
        type: "customDiffReason",
        type: 'customDiffReason',
        typeAttributes: {
            DiffReason: { fieldName: "DiffReason" },
            ProdId: { fieldName: "ProdId" },
            boxPiece: { fieldName: "boxPiece" }
        },
    },
            DiffReason: { fieldName: 'DiffReason' },
            ProdId: { fieldName: 'ProdId' },
            boxPiece: { fieldName: 'boxPiece' }
        }
    }
];
//调整明细
const column = [
    {
        label: "消耗品名称",
        fieldName: "Name__c",
        label: '消耗品名称',
        fieldName: 'Name__c',
        wrapText: true,
        hideDefaultActions: true,
        hideDefaultActions: true
        // initialWidth: 550
    },
    {
        label: "单位",
        fieldName: "Box_Piece__c",
        label: '单位',
        fieldName: 'Box_Piece__c',
        hideDefaultActions: true,
        initialWidth: 50,
        initialWidth: 50
    },
    {
        label: "BarCode",
        fieldName: "Bar_Code__c",
        label: 'BarCode',
        fieldName: 'Bar_Code__c',
        hideDefaultActions: true,
        wrapText: true,
        wrapText: true
        // initialWidth: 300,
    },
    {
        label: "调整原因",
        fieldName: "DiffReason",
        label: '调整原因',
        fieldName: 'DiffReason',
        hideDefaultActions: true,
        wrapText: true,
        wrapText: true
        // initialWidth: 
    },
    }
];
//盘点明细
const dcolumns = [
    {
        label: "消耗品名称",
        fieldName: "Name__c",
        label: '消耗品名称',
        fieldName: 'Name__c',
        hideDefaultActions: true,
        // initialWidth: 250,
        wrapText: true,
        wrapText: true
    },
    {
        label: "库存",
        fieldName: "Count_Sum__c",
        label: '库存',
        fieldName: 'Count_Sum__c',
        hideDefaultActions: true,
        initialWidth: 100,
        cellAttributes: { alignment: "right" },
        cellAttributes: { alignment: 'right' }
    },
    {
        label: "盘点",
        fieldName: "inventory_sum__c",
        label: '盘点',
        fieldName: 'inventory_sum__c',
        hideDefaultActions: true,
        initialWidth: 100,
        cellAttributes: { alignment: "right" },
        cellAttributes: { alignment: 'right' }
    },
    {
        label: "丢失",
        fieldName: "Diff__c",
        label: '丢失',
        fieldName: 'Diff__c',
        hideDefaultActions: true,
        initialWidth: 100,
        cellAttributes: { alignment: "right" },
        cellAttributes: { alignment: 'right' }
    },
    {
        label: "寻回",
        fieldName: "Product_Refind__c",
        label: '寻回',
        fieldName: 'Product_Refind__c',
        hideDefaultActions: true,
        initialWidth: 100,
        cellAttributes: { alignment: "right" },
        cellAttributes: { alignment: 'right' }
    },
    {
        label: "差异原因",
        fieldName: "Lose_reason__c",
        hideDefaultActions: true,
    },
        label: '差异原因',
        fieldName: 'Lose_reason__c',
        hideDefaultActions: true
    }
];
//在库调整明细
const stockadjustcolumns = [
    {
        label: "消耗品名称",
        fieldName: "Name__c",
        label: '消耗品名称',
        fieldName: 'Name__c',
        wrapText: true,
        hideDefaultActions: true,
        hideDefaultActions: true
    },
    {
        label: "产品型号",
        fieldName: "Asset_Model_No__c",
        hideDefaultActions: true,
        label: '产品型号',
        fieldName: 'Asset_Model_No__c',
        hideDefaultActions: true
    },
    {
        label: "差异原因",
        fieldName: "Lose_reason__c",
        label: '差异原因',
        fieldName: 'Lose_reason__c',
        hideDefaultActions: true,
        initialWidth: 150,
        initialWidth: 150
    },
    {
        label: "是否丢失",
        type: "boolean",
        fieldName: "Lose_Flag__c",
        hideDefaultActions: true,
    },
        label: '是否丢失',
        type: 'boolean',
        fieldName: 'Lose_Flag__c',
        hideDefaultActions: true
    }
];
export default class LexInventory extends NavigationMixin(LightningElement) {
@@ -230,24 +201,24 @@
    @track accountName;
    @track agencyProType;
    @track userWorkLocation;
    @track accountid
    @track pandiandetailsMap
    @track reSet
    @track reSet1
    @track accountid;
    @track pandiandetailsMap;
    @track reSet;
    @track reSet1;
    @track showTable = false;
    @track showbutton = false;
    @track barcode = "";
    @track barcode = '';
    @track ConsumableorderdetailsRecordsview = [];
    @track consumableorderdetailsRecords = [];
    @track showcount = true;
    @track iSinventory = false
    @track iSinventory = false;
    @track numberDetail;
    @track hidecheckbox = true;
    //分页start
    @track sortBy = "";
    @track sortDirection = "asc";
    @track sortBy = '';
    @track sortDirection = 'asc';
    @track pageSize = 10;
    error;
    records;
@@ -263,7 +234,6 @@
    @track recordEnd = 0;
    //end
    //加载框
    // @track casesSpinner = true;
    @track showSpinner = true;
@@ -273,10 +243,10 @@
    //inventoryList
    @track isSummonsFlag;
    //展开栏
    activeSections = ["dataExpand"];
    columnHeader = ["消耗品名称", "单位", "BarCode", "调整原因"];
    activeSections = ['dataExpand'];
    columnHeader = ['消耗品名称', '单位', 'BarCode', '调整原因'];
    //确认一览
    @track eSetId = "";
    @track eSetId = '';
    @track EditAble = false;
    @track selectedData;
    @track conId;
@@ -284,14 +254,13 @@
    @track adjustdata = [];
    @track detalipan = [];
    //导出csv 
    xlsDataHeader = ['消耗品名称', '单位', 'barCode', '调整原因'];
    //获取链接参数
    getQueryString(name) {
        console.log("getQueryString name " + name);
        let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        console.log('getQueryString name ' + name);
        let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
        let r = window.location.search.substr(1).match(reg);
        if (r != null) {
            return decodeURIComponent(r[2]);
@@ -302,24 +271,23 @@
        if (!this.stylesLoaded) {
            Promise.all([loadStyle(this, WrappedHeaderTable)])
                .then(() => {
                    console.log("Custom styles loaded");
                    console.log('Custom styles loaded');
                    this.stylesLoaded = true;
                })
                .catch((error) => {
                    console.error("Error loading custom styles");
                    console.error('Error loading custom styles');
                });
        }
    }
    connectedCallback() {
        console.log("===>初始化");
        console.log('===>初始化');
        //获取ESetid
        this.eSetId = this.getQueryString("eSetId");
        this.eSetId = this.eSetId == null ? "" : this.eSetId;
        console.log(" this.eSetId" + this.eSetId);
        if (this.eSetId == "") {
        this.eSetId = this.getQueryString('eSetId');
        this.eSetId = this.eSetId == null ? '' : this.eSetId;
        console.log(' this.eSetId' + this.eSetId);
        if (this.eSetId == '') {
            this.EditAble = false;
            this.init();
        } else {
@@ -327,29 +295,41 @@
            this.showcount = false;
            this.EditAble = true;
        }
    }
    init() {
        this.showSpinner = true;
        oninit()
            .then((result) => {
                console.log("1112" + JSON.stringify(result));
                console.log('1112' + JSON.stringify(result));
                result = JSON.parse(JSON.stringify(result));
                console.log("result.status = " + result.status);
                console.log("ConsumableorderdetailsRecordsview= " + result.entity.ConsumableorderdetailsRecordsview);
                this.ConsumableorderdetailsRecordsview = JSON.parse(result.entity.ConsumableorderdetailsRecordsview);
                this.consumableorderdetailsRecords = result.entity.consumableorderdetailsRecords;
                console.log("consumableorderdetailsRecords= " + result.entity.consumableorderdetailsRecords);
                console.log("传参类型", typeof this.consumableorderdetailsRecords);
                if (result.status == "Success") {
                console.log('result.status = ' + result.status);
                console.log(
                    'ConsumableorderdetailsRecordsview= ' +
                        result.entity.ConsumableorderdetailsRecordsview
                );
                this.ConsumableorderdetailsRecordsview = JSON.parse(
                    result.entity.ConsumableorderdetailsRecordsview
                );
                this.consumableorderdetailsRecords =
                    result.entity.consumableorderdetailsRecords;
                console.log(
                    'consumableorderdetailsRecords= ' +
                        result.entity.consumableorderdetailsRecords
                );
                console.log(
                    '传参类型',
                    typeof this.consumableorderdetailsRecords
                );
                if (result.status == 'Success') {
                    this.data = [];
                    this.data = this.ConsumableorderdetailsRecordsview[0];
                    console.log("this.data ==>" + JSON.stringify(this.data));
                    console.log('this.data ==>' + JSON.stringify(this.data));
                    for (let i in this.data) {
                        this.data[i]["key"] = this.data[i]["ProdId"] + this.data[i]["boxPiece"];
                        this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
                        this.data[i]["Packing_list_manual__c"] = this.data[i].Prod.Packing_list_manual__c;
                        this.data[i]['key'] =
                            this.data[i]['ProdId'] + this.data[i]['boxPiece'];
                        this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
                        this.data[i]['Packing_list_manual__c'] =
                            this.data[i].Prod.Packing_list_manual__c;
                    }
                    this.accountName = result.entity.accountName;
                    this.agencyProType = result.entity.agencyProType;
@@ -363,11 +343,11 @@
                }
            })
            .catch((error) => {
                console.log("error = " + JSON.stringify(error));
                console.log('error = ' + JSON.stringify(error));
                this.showSpinner = false;
            });
        //默认展开栏
        this.activeSections = ["dataExpand"];
        this.activeSections = ['dataExpand'];
        this.showTable = false;
        this.showbutton = false;
    }
@@ -380,19 +360,27 @@
        this.showSpinner = true;
        
        //查询有哪些选择了的然后check
        const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
        const selectedRows = this.template
            .querySelector('c-lex-custom-lightning-datatable')
            .getSelectedRows();
        console.log('selectedRows========> ' + JSON.stringify(selectedRows));
        for (var i in this.data) {
            this.data[i]["check"] = false;
            this.data[i]['check'] = false;
        }
        for (var i in this.data) {
            for (var j in selectedRows) {
                if (this.data[i].ProdId+this.data[i]["boxPiece"] == selectedRows[j].ProdId+ selectedRows[j]["boxPiece"]) {
                    this.data[i]["check"] = true;
                if (
                    this.data[i].ProdId + this.data[i]['boxPiece'] ==
                    selectedRows[j].ProdId + selectedRows[j]['boxPiece']
                ) {
                    this.data[i]['check'] = true;
                }
                // console.log('this.data[i].ProdId+this.data[i]["boxPiece"]'+this.data[i].ProdId+this.data[i]["boxPiece"]);
                console.log('selectedRows[j].ProdId+this.data[i]["boxPiece"]'+selectedRows[j].ProdId+selectedRows[j]["boxPiece"]);
                console.log(
                    'selectedRows[j].ProdId+this.data[i]["boxPiece"]' +
                        selectedRows[j].ProdId +
                        selectedRows[j]['boxPiece']
                );
            }
        }
        // if(this.barcode == ''||this.barcode == null){
@@ -412,95 +400,151 @@
            pageTokenLWC: this.currentPageToken,
            sortFieldLWC: this.sortBy,
            sortOrderLWC: this.sortDirection
        })
            .then((result) => {
                result = JSON.parse(JSON.stringify(result));
                console.log("result ===>" + JSON.stringify(result));
                if (result.status == "Success1") {
                console.log('result ===>' + JSON.stringify(result));
                if (result.status == 'Success1') {
                        //分页start
                        this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
                        this.totalRecords = result.entity.paginatedAccounts.totalRecords;
                        this.recordStart = result.entity.paginatedAccounts.recordStart;
                    this.nextPageToken =
                        result.entity.paginatedAccounts.nextPageToken;
                    this.totalRecords =
                        result.entity.paginatedAccounts.totalRecords;
                    this.recordStart =
                        result.entity.paginatedAccounts.recordStart;
                        this.recordEnd = result.entity.paginatedAccounts.recordEnd;
                        this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize);
                    this.totalPages = Math.ceil(
                        result.entity.paginatedAccounts.totalRecords /
                            this.pageSize
                    );
                        console.log('this.totalPages = ' + this.totalPages);
                        this.paginationVisibility = this.totalPages > 1 ? true : false;
                    this.paginationVisibility =
                        this.totalPages > 1 ? true : false;
                        console.log('this.sortDirection = ' + this.sortDirection);
                        //分页end
                        this.codPageRecords = JSON.parse(result.entity.codPageRecords);
                    this.codPageRecords = JSON.parse(
                        result.entity.codPageRecords
                    );
                        for (var i in this.codPageRecords) {
                            this.codPageRecords[i]["Name__c"] = this.codPageRecords[i].Prod.Name__c;
                            this.codPageRecords[i]["Box_Piece__c"] = this.codPageRecords[i].orderdetails2.Box_Piece__c;
                            this.codPageRecords[i]["Bar_Code__c"] = this.codPageRecords[i].orderdetails2.Bar_Code__c;
                        this.codPageRecords[i]['Name__c'] =
                            this.codPageRecords[i].Prod.Name__c;
                        this.codPageRecords[i]['Box_Piece__c'] =
                            this.codPageRecords[i].orderdetails2.Box_Piece__c;
                        this.codPageRecords[i]['Bar_Code__c'] =
                            this.codPageRecords[i].orderdetails2.Bar_Code__c;
                        }
                        this.pageCodeRecords = result.entity.pageCodeRecords;
                        for (var i in this.pageCodeRecords) {
                            this.pageCodeRecords[i]["Name__c"] = this.pageCodeRecords[i].Prod.Name__c;
                            this.pageCodeRecords[i]["Box_Piece__c"] = this.pageCodeRecords[i].orderdetails2.Box_Piece__c;
                            this.pageCodeRecords[i]["Bar_Code__c"] = this.pageCodeRecords[i].orderdetails2.Bar_Code__c;
                        this.pageCodeRecords[i]['Name__c'] =
                            this.pageCodeRecords[i].Prod.Name__c;
                        this.pageCodeRecords[i]['Box_Piece__c'] =
                            this.pageCodeRecords[i].orderdetails2.Box_Piece__c;
                        this.pageCodeRecords[i]['Bar_Code__c'] =
                            this.pageCodeRecords[i].orderdetails2.Bar_Code__c;
                        }
                        this.data = JSON.parse(result.entity.consumableorderdetailsRecords);
                    this.data = JSON.parse(
                        result.entity.consumableorderdetailsRecords
                    );
                        for (var i in this.data) {
                            this.data[i]["key"] = this.data[i]["ProdId"] + this.data[i]["boxPiece"];
                            this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
                            this.data[i]["Packing_list_manual__c"] = this.data[i].Prod.Packing_list_manual__c;
                            if (this.data[i]["check"]) {
                                this.selectedRows.push(this.data[i].ProdId + this.data[i]["boxPiece"]);
                                console.log("selectedRows:" + this.selectedRows);
                        this.data[i]['key'] =
                            this.data[i]['ProdId'] + this.data[i]['boxPiece'];
                        this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
                        this.data[i]['Packing_list_manual__c'] =
                            this.data[i].Prod.Packing_list_manual__c;
                        if (this.data[i]['check']) {
                            this.selectedRows.push(
                                this.data[i].ProdId + this.data[i]['boxPiece']
                            );
                            console.log('selectedRows:' + this.selectedRows);
                            }
                        }
                        this.iSinventory = result.entity.iSinventory;
                        this.pandiandetailsMap = result.entity.pandiandetailsMap;
                        this.reSet = result.entity.reSet1;
                        console.log("iSinventory:" + this.iSinventory);
                    console.log('iSinventory:' + this.iSinventory);
                        this.showTable = true;
                        this.showbutton = true;
                        this.showSpinner = false;
                        console.log("result录入= " + JSON.stringify(result));
                }
                else {
                    if (result.status == "Sucess") {
                    console.log('result录入= ' + JSON.stringify(result));
                } else {
                    if (result.status == 'Sucess') {
                        //分页start
                        this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
                        this.totalRecords = result.entity.paginatedAccounts.totalRecords;
                        this.recordStart = result.entity.paginatedAccounts.recordStart;
                        this.recordEnd = result.entity.paginatedAccounts.recordEnd;
                        this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize);
                        this.nextPageToken =
                            result.entity.paginatedAccounts.nextPageToken;
                        this.totalRecords =
                            result.entity.paginatedAccounts.totalRecords;
                        this.recordStart =
                            result.entity.paginatedAccounts.recordStart;
                        this.recordEnd =
                            result.entity.paginatedAccounts.recordEnd;
                        this.totalPages = Math.ceil(
                            result.entity.paginatedAccounts.totalRecords /
                                this.pageSize
                        );
                        console.log('this.totalPages = ' + this.totalPages);
                        this.paginationVisibility = this.totalPages > 1 ? true : false;
                        console.log('this.sortDirection = ' + this.sortDirection);
                        this.paginationVisibility =
                            this.totalPages > 1 ? true : false;
                        console.log(
                            'this.sortDirection = ' + this.sortDirection
                        );
                        //分页end
                        this.codPageRecords = JSON.parse(result.entity.codPageRecords);
                        this.codPageRecords = JSON.parse(
                            result.entity.codPageRecords
                        );
                        for (var i in this.codPageRecords) {
                            this.codPageRecords[i]["Name__c"] = this.codPageRecords[i].Prod.Name__c;
                            this.codPageRecords[i]["Box_Piece__c"] = this.codPageRecords[i].orderdetails2.Box_Piece__c;
                            this.codPageRecords[i]["Bar_Code__c"] = this.codPageRecords[i].orderdetails2.Bar_Code__c;
                            this.codPageRecords[i]['Name__c'] =
                                this.codPageRecords[i].Prod.Name__c;
                            this.codPageRecords[i]['Box_Piece__c'] =
                                this.codPageRecords[
                                    i
                                ].orderdetails2.Box_Piece__c;
                            this.codPageRecords[i]['Bar_Code__c'] =
                                this.codPageRecords[
                                    i
                                ].orderdetails2.Bar_Code__c;
                        }
                        this.pageCodeRecords = result.entity.pageCodeRecords;
                        for (var i in this.pageCodeRecords) {
                            this.pageCodeRecords[i]["Name__c"] = this.pageCodeRecords[i].Prod.Name__c;
                            this.pageCodeRecords[i]["Box_Piece__c"] = this.pageCodeRecords[i].orderdetails2.Box_Piece__c;
                            this.pageCodeRecords[i]["Bar_Code__c"] = this.pageCodeRecords[i].orderdetails2.Bar_Code__c;
                            this.pageCodeRecords[i]['Name__c'] =
                                this.pageCodeRecords[i].Prod.Name__c;
                            this.pageCodeRecords[i]['Box_Piece__c'] =
                                this.pageCodeRecords[
                                    i
                                ].orderdetails2.Box_Piece__c;
                            this.pageCodeRecords[i]['Bar_Code__c'] =
                                this.pageCodeRecords[
                                    i
                                ].orderdetails2.Bar_Code__c;
                        }
                        this.data = JSON.parse(result.entity.consumableorderdetailsRecords);
                        this.data = JSON.parse(
                            result.entity.consumableorderdetailsRecords
                        );
                        for (var i in this.data) {
                            this.data[i]["key"] = this.data[i]["ProdId"] + this.data[i]["boxPiece"];
                            this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
                            this.data[i]["Packing_list_manual__c"] = this.data[i].Prod.Packing_list_manual__c;
                            if (this.data[i]["check"]) {
                                this.selectedRows.push(this.data[i].ProdId + this.data[i]["boxPiece"]);
                                console.log("selectedRows:" + this.selectedRows);
                            this.data[i]['key'] =
                                this.data[i]['ProdId'] +
                                this.data[i]['boxPiece'];
                            this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
                            this.data[i]['Packing_list_manual__c'] =
                                this.data[i].Prod.Packing_list_manual__c;
                            if (this.data[i]['check']) {
                                this.selectedRows.push(
                                    this.data[i].ProdId +
                                        this.data[i]['boxPiece']
                                );
                                console.log(
                                    'selectedRows:' + this.selectedRows
                                );
                            }
                        }
                        this.iSinventory = result.entity.iSinventory;
                        this.pandiandetailsMap = result.entity.pandiandetailsMap;
                        this.pandiandetailsMap =
                            result.entity.pandiandetailsMap;
                        this.reSet = result.entity.reSet;
                        console.log("iSinventory:" + this.iSinventory);
                        console.log('iSinventory:' + this.iSinventory);
                        this.showTable = true;
                        this.showbutton = true;
                        this.showSpinner = false;
                        console.log("result录入= " + JSON.stringify(result));
                        console.log('result录入= ' + JSON.stringify(result));
                    } else {
                        console.log('Error:' + result.msg);
                        this.showMyToast(result.msg,'','error');
@@ -510,13 +554,13 @@
                }
            })
            .catch((error) => {
                console.log("error = " + JSON.stringify(error));
                console.log('error = ' + JSON.stringify(error));
            });
    }
    //获取当前输入值
    handleChange(event) {
        let value = event.detail.value;
        console.log("value" + value);
        console.log('value' + value);
        this.barcode = value;
    }
@@ -525,8 +569,14 @@
            this.selectedRows = [];
            for (var i in this.data) {
                for (var j in selectedRowsEvent) {
                    if (this.data[i].ProdId+this.data[i]["boxPiece"] == selectedRowsEvent[j].ProdId+ selectedRowsEvent[j]["boxPiece"]) {
                        this.selectedRows.push(selectedRowsEvent[j].ProdId+this.data[i]["boxPiece"])
                if (
                    this.data[i].ProdId + this.data[i]['boxPiece'] ==
                    selectedRowsEvent[j].ProdId +
                        selectedRowsEvent[j]['boxPiece']
                ) {
                    this.selectedRows.push(
                        selectedRowsEvent[j].ProdId + this.data[i]['boxPiece']
                    );
                    }
                }
            // for (var i in selectedRowsEvent) {
@@ -549,12 +599,12 @@
        doc += '</style>';
        // Add all the Table Headers
        doc += '<tr>';
        this.columnHeader.forEach(element => {
            doc += '<th style="font-weight: bold";>' + element + '</th>'
        this.columnHeader.forEach((element) => {
            doc += '<th style="font-weight: bold";>' + element + '</th>';
        });
        doc += '</tr>';
        // Add the data rows
        this.codPageRecords.forEach(record => {
        this.codPageRecords.forEach((record) => {
            doc += '<tr>';
            doc += '<td>' + record.Name__c + '</td>';
            doc += '<td>' + record.Box_Piece__c + '</td>';
@@ -564,54 +614,73 @@
        });
        doc += '</table>';
        console.log('doc' + doc);
        var bom = "\uFEFF";
        var element = 'data:application/vnd.ms-excel,' + encodeURIComponent(bom + doc);
        var bom = '\uFEFF';
        // link.href = 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv);
        var element =
            'data:application/vnd.ms-excel,' + encodeURIComponent(bom + doc);
        let downloadElement = document.createElement('a');
        downloadElement.href = element;
        downloadElement.target = '_self';
        // 设置响应头禁用缓存
        // downloadElement.setAttribute('data-turbolinks-cache-control', 'no-cache');
        // downloadElement.setAttribute('data-turbolinks-track', 'reload');
        // use .csv as extension on below line if you want to export data as csv
        downloadElement.download = '在库调整一览.xls';
        document.body.appendChild(downloadElement);
        downloadElement.click();
    }
    //自定义dataType
    diffreasons(event) {
        const numberDetail = event.detail;
        // this.numberDetail = numberDetail;
        console.log("numberDetail" + JSON.stringify(numberDetail));
        console.log('numberDetail' + JSON.stringify(numberDetail));
        for (var i in this.data) {
            console.log('this.data[i]["key"]' + this.data[i]["key"]);
            console.log('numberDetail.data.ProdId+numberDetail.data.boxPiece' + numberDetail.data.ProdId + numberDetail.data.boxPiece);
            console.log('this.data[i]["key"]' + this.data[i]['key']);
            console.log(
                'numberDetail.data.ProdId+numberDetail.data.boxPiece' +
                    numberDetail.data.ProdId +
                    numberDetail.data.boxPiece
            );
            if (this.data[i]["key"] == numberDetail.data.ProdId + numberDetail.data.boxPiece) {
                this.data[i]["DiffReason"] = numberDetail.data.DiffReason;
            if (
                this.data[i]['key'] ==
                numberDetail.data.ProdId + numberDetail.data.boxPiece
            ) {
                this.data[i]['DiffReason'] = numberDetail.data.DiffReason;
            }
        }
        console.log(" this.data==>" + JSON.stringify(this.data));
        console.log(' this.data==>' + JSON.stringify(this.data));
    }
    saveConfirm() {
        console.log("进入盘点确认");
        console.log('进入盘点确认');
        console.log('reSet' + this.reSet);
        this.showSpinner = true;
        console.log('pandiandetailsMap' + this.pandiandetailsMap);
        //查询有哪些选择了的然后check
        const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
        const selectedRows = this.template
            .querySelector('c-lex-custom-lightning-datatable')
            .getSelectedRows();
        console.log('selectedRows========> ' + JSON.stringify(selectedRows));
        for (var i in this.data) {
            this.data[i]["check"] = false;
            this.data[i]['check'] = false;
        }
        for (var i in this.data) {
            for (var j in selectedRows) {
                if (this.data[i].ProdId+this.data[i]["boxPiece"] == selectedRows[j].ProdId+ selectedRows[j]["boxPiece"]) {
                    this.data[i]["check"] = true;
                if (
                    this.data[i].ProdId + this.data[i]['boxPiece'] ==
                    selectedRows[j].ProdId + selectedRows[j]['boxPiece']
                ) {
                    this.data[i]['check'] = true;
                }
                // console.log('this.data[i].ProdId+this.data[i]["boxPiece"]'+this.data[i].ProdId+this.data[i]["boxPiece"]);
                console.log('selectedRows[j].ProdId+this.data[i]["boxPiece"]'+selectedRows[j].ProdId+selectedRows[j]["boxPiece"]);
                console.log(
                    'selectedRows[j].ProdId+this.data[i]["boxPiece"]' +
                        selectedRows[j].ProdId +
                        selectedRows[j]['boxPiece']
                );
            }
        }
@@ -633,19 +702,19 @@
        })
            .then((result) => {
                result = JSON.parse(JSON.stringify(result));
                console.log("result = " + JSON.stringify(result));
                console.log("111111");
                console.log('result = ' + JSON.stringify(result));
                console.log('111111');
                if (result.status == "Success") {
                    let url = "/lexinventory?ESetid=" + result.entity.eSetId;
                if (result.status == 'Success') {
                    let url = '/lexinventory?ESetid=' + result.entity.eSetId;
                    this[NavigationMixin.Navigate]({
                        type: "standard__webPage",
                        type: 'standard__webPage',
                        attributes: {
                            url: url,
                        },
                            url: url
                        }
                    });
                    this.showSpinner = false;
                    console.log("Id" + this.eSetId);
                    console.log('Id' + this.eSetId);
                    // this.EditAble = true;
                    // this.showcount = false;
                } else {
@@ -654,15 +723,15 @@
                }
            })
            .catch((error) => {
                console.log("error = " + JSON.stringify(error));
                console.log('error = ' + JSON.stringify(error));
                this.showSpinner = false;
            });
    }
    inits() {
        this.showSpinner = true
        this.showSpinner = true;
        datainit({
            eSetId: this.eSetId,
            eSetId: this.eSetId
        })
            .then((result) => {
                result = JSON.parse(JSON.stringify(result));
@@ -671,45 +740,59 @@
                for (var i in result.entity.qs) {
                    this.conId = result.entity.qs[i].Id;
                }
                console.log("this.conId" + typeof this.conId);
                this.detailData = JSON.parse(result.entity.consumableorderdetailsRecords);
                console.log('this.conId' + typeof this.conId);
                this.detailData = JSON.parse(
                    result.entity.consumableorderdetailsRecords
                );
                if (result.entity.ConsumableorderdetailsRecordsError != null) {
                    this.adjustdata = JSON.parse(
                        result.entity.ConsumableorderdetailsRecordsError
                    );
                    for (let i in this.detailData) {
                        this.detailData[i].Name__c = this.detailData[i].Prod.Name__c;
                        this.detailData[i].Count_Sum__c = this.detailData[i].orderdetails1.Count_Sum__c;
                        this.detailData[i].inventory_sum__c = this.detailData[i].orderdetails1.inventory_sum__c;
                        this.detailData[i].Diff__c = this.detailData[i].orderdetails1.Diff__c;
                        this.detailData[i].Product_Refind__c = this.detailData[i].orderdetails1.Product_Refind__c;
                        this.detailData[i].Lose_reason__c = this.detailData[i].orderdetails1.Lose_reason__c;
                        this.detailData[i].Name__c =
                            this.detailData[i].Prod.Name__c;
                        this.detailData[i].Count_Sum__c =
                            this.detailData[i].orderdetails1.Count_Sum__c;
                        this.detailData[i].inventory_sum__c =
                            this.detailData[i].orderdetails1.inventory_sum__c;
                        this.detailData[i].Diff__c =
                            this.detailData[i].orderdetails1.Diff__c;
                        this.detailData[i].Product_Refind__c =
                            this.detailData[i].orderdetails1.Product_Refind__c;
                        this.detailData[i].Lose_reason__c =
                            this.detailData[i].orderdetails1.Lose_reason__c;
                    }
                    for (let i in this.adjustdata) {
                        this.adjustdata[i].Name__c = this.adjustdata[i].Prod.Name__c;
                        this.adjustdata[i].Asset_Model_No__c = this.adjustdata[i].Prod.Asset_Model_No__c;
                        this.adjustdata[i].Lose_reason__c = this.adjustdata[i].orderdetails2.Lose_reason__c;
                        this.adjustdata[i].Lose_Flag__c = this.adjustdata[i].orderdetails2.Lose_Flag__c;
                        this.adjustdata[i].Name__c =
                            this.adjustdata[i].Prod.Name__c;
                        this.adjustdata[i].Asset_Model_No__c =
                            this.adjustdata[i].Prod.Asset_Model_No__c;
                        this.adjustdata[i].Lose_reason__c =
                            this.adjustdata[i].orderdetails2.Lose_reason__c;
                        this.adjustdata[i].Lose_Flag__c =
                            this.adjustdata[i].orderdetails2.Lose_Flag__c;
                    }
                }
                this.showSpinner = false;
                console.log("result盘点Id" + JSON.stringify(this.conId));
                console.log("调整明细" + JSON.stringify(this.adjustdata));
                console.log('result盘点Id' + JSON.stringify(this.conId));
                console.log('调整明细' + JSON.stringify(this.adjustdata));
            })
            .catch((error) => {
                console.log("error = " + JSON.stringify(error));
                console.log('error = ' + JSON.stringify(error));
                this.showSpinner = false;
            });
    }
    //分页
    handlePrevious() {
        this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize);
        this.currentPageToken =
            Number(this.currentPageToken) - Number(this.pageSize);
        this.barcodeEntrys();
    }
    handleNext() {
        console.log('111');
        this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize);
        this.currentPageToken =
            Number(this.currentPageToken) + Number(this.pageSize);
        this.barcodeEntrys();
    }
    handleFirst() {
@@ -718,7 +801,8 @@
    }
    handleLast() {
        this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
        this.currentPageToken =
            this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
        this.barcodeEntrys();
    }
@@ -737,10 +821,11 @@
    }
    handleLoad2() {
        console.log('handleLoad2')
        console.log('handleLoad2');
        try {
            const style2 = document.createElement('style');
            style2.innerText = '.hehe-layoutItem  .slds-form-element__label {padding : 0px}';
            style2.innerText =
                '.hehe-layoutItem  .slds-form-element__label {padding : 0px}';
            this.template.querySelector('.hideHelpText').appendChild(style2);
        } catch (error) {
            console.log(error);
@@ -756,10 +841,17 @@
           iconName = 'utility:error';
        }
        if(message != ''){
           content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
            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);
        this.template
            .querySelector('c-common-toast')
            .showToast(variant, content, iconName, 10000);
    }
}
force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.html
@@ -1,9 +1,23 @@
<template>
    <c-common-toast></c-common-toast>
    <template if:true={isShowReminder}>
        <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;color:#ff6a00;font-size:18px;">
            <lightning-icon style="margin: 2px;" icon-name="custom:custom53" size="small"></lightning-icon>
            <strong style="padding-top: 2px;">&nbsp;&nbsp;&nbsp;提醒:{msg}</strong>
        <div
            style="
                border: 1px solid #d4d4d4;
                border-radius: 5px;
                margin-bottom: 7px;
                color: #ff6a00;
                font-size: 18px;
            "
        >
            <lightning-icon
                style="margin: 2px"
                icon-name="custom:custom53"
                size="small"
            ></lightning-icon>
            <strong style="padding-top: 2px"
                >&nbsp;&nbsp;&nbsp;提醒:{msg}</strong
            >
        </div>
    </template>
</template>
force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.js
@@ -8,27 +8,37 @@
    connectedCallback(){
        initReminder()
        .then(result=>{
            .then((result) => {
            if (result.result == 'Success') {
                this.days = result.days;
                this.isShowReminder = result.isShowReminder;
                if(this.days > 0){
                    this.msg = '您的医疗器械经营企业许可证还有'+this.days+'天就到期了!';
                        this.msg =
                            '您的医疗器械经营企业许可证还有' +
                            this.days +
                            '天就到期了!';
                }else if(this.days == 0){
                    this.msg = '您的医疗器械经营企业许可证今天就到期了!';
                }else if(this.days < 0){
                    var days = this.days * -1
                    this.msg = '您的医疗器械经营企业许可证已经过期'+days+'天了!';
                        var days = this.days * -1;
                        this.msg =
                            '您的医疗器械经营企业许可证已经过期' +
                            days +
                            '天了!';
                }
            } else {
                console.log("Error:" + result.errorMsg);
                    console.log('Error:' + result.errorMsg);
                this.showMyToast(result.errorMsg, '', 'error');
            }
        })
        .catch(error => {
            console.log("Error:" + JSON.stringify(error));
            this.showMyToast('初始化提醒失败', JSON.stringify(error), 'error');
        })
            .catch((error) => {
                console.log('Error:' + JSON.stringify(error));
                this.showMyToast(
                    '初始化提醒失败',
                    JSON.stringify(error),
                    'error'
                );
            });
    }
    showMyToast(title, message, variant) {
@@ -41,12 +51,18 @@
           iconName = 'utility:error';
        }
        if(message != ''){
           content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
            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);
        this.template
            .querySelector('c-common-toast')
            .showToast(variant, content, iconName, 10000);
        // var mode;
        // if(this.isNoteStay){
        //     mode ='sticky';
force-app/main/default/lwc/lexLookup/lexLookup.html
@@ -1,67 +1,139 @@
<template>
    <div class={getFormElementClass}>
        <label lwc:if={label} class={getLabelClass} for="combobox">
            <abbr lwc:if={required} title="required" class="slds-required">*</abbr>
            <abbr lwc:if={required} title="required" class="slds-required"
                >*</abbr
            >
            {label}
        </label>
        <div class="slds-form-element__control">
            <div class={getContainerClass}>
                <div class={getDropdownClass} aria-expanded={isListboxOpen} aria-haspopup="listbox" aria-owns="listbox"
                    role="combobox">
                <div
                    class={getDropdownClass}
                    aria-expanded={isListboxOpen}
                    aria-haspopup="listbox"
                    aria-owns="listbox"
                    role="combobox"
                >
                    <!-- Search input start -->
                    <div class={getComboboxClass} role="none">
                        <template lwc:if={isSingleEntry}>
                            <lightning-icon icon-name={getSelectIconName} size="small"
                                alternative-text="Selected item icon" class={getSelectIconClass}>
                            <lightning-icon
                                icon-name={getSelectIconName}
                                size="small"
                                alternative-text="Selected item icon"
                                class={getSelectIconClass}
                            >
                            </lightning-icon>
                        </template>
                        <!-- Text input -->
                        <input type="text" class={getInputClass} aria-autocomplete="list" aria-controls="listbox"
                            aria-activedescendant={_focusedResultIndex} autocomplete="off" role="textbox" id="combobox"
                            placeholder={placeholder} value={getInputValue} title={getInputTitle}
                            readonly={isInputReadonly} disabled={disabled} onfocus={handleFocus} onblur={handleBlur}
                            oninput={handleInput} onkeydown={handleKeyDown} />
                        <input
                            type="text"
                            class={getInputClass}
                            aria-autocomplete="list"
                            aria-controls="listbox"
                            aria-activedescendant={_focusedResultIndex}
                            autocomplete="off"
                            role="textbox"
                            id="combobox"
                            placeholder={placeholder}
                            value={getInputValue}
                            title={getInputTitle}
                            readonly={isInputReadonly}
                            disabled={disabled}
                            onfocus={handleFocus}
                            onblur={handleBlur}
                            oninput={handleInput}
                            onkeydown={handleKeyDown}
                        />
                        <!-- Search icon -->
                        <lightning-icon icon-name="utility:search" size="x-small" alternative-text="Search icon"
                            class={getSearchIconClass}></lightning-icon>
                        <lightning-icon
                            icon-name="utility:search"
                            size="x-small"
                            alternative-text="Search icon"
                            class={getSearchIconClass}
                        ></lightning-icon>
                        <!-- Clear selection button icon for single entry lookups -->
                        <template lwc:if={isSingleEntry}>
                            <button title="Remove selected option" type="button" onclick={handleClearSelection}
                                class={getClearSelectionButtonClass} disabled={disabled}>
                                <lightning-icon icon-name="utility:close" size="x-small"
                            <button
                                title="Remove selected option"
                                type="button"
                                onclick={handleClearSelection}
                                class={getClearSelectionButtonClass}
                                disabled={disabled}
                            >
                                <lightning-icon
                                    icon-name="utility:close"
                                    size="x-small"
                                    alternative-text="Remove selected option"
                                    class="slds-button__icon"></lightning-icon>
                                    class="slds-button__icon"
                                ></lightning-icon>
                            </button>
                        </template>
                    </div>
                    <!-- Search input end -->
                    <!-- Result list box start -->
                    <div id="listbox" role="listbox" aria-label={label} onmousedown={handleComboboxMouseDown}
                        onmouseup={handleComboboxMouseUp} class={getListboxClass}>
                        <ul class="slds-listbox slds-listbox_vertical" role="presentation">
                    <div
                        id="listbox"
                        role="listbox"
                        aria-label={label}
                        onmousedown={handleComboboxMouseDown}
                        onmouseup={handleComboboxMouseUp}
                        class={getListboxClass}
                    >
                        <ul
                            class="slds-listbox slds-listbox_vertical"
                            role="presentation"
                        >
                            <!-- Spinner to display when waiting for results of search -->
                            <div lwc:if={loading}>
                                <lightning-spinner alternative-text="Loading" size="small"></lightning-spinner>
                                <lightning-spinner
                                    alternative-text="Loading"
                                    size="small"
                                ></lightning-spinner>
                            </div>
                            <!-- Result list start -->
                            <template for:each={searchResultsLocalState} for:item="item" for:index="index"
                                lwc:if={hasResults}>
                                <li key={item.result.id} role="presentation" class="slds-listbox__item">
                                    <div class={item.classes} role="option" id={index} aria-label={item.result.title}
                                        onclick={handleResultClick} data-recordid={item.result.id}>
                                        <span class="slds-media__figure slds-listbox__option-icon">
                                            <lightning-icon icon-name={item.result.icon} size="small"
                                                alternative-text="Result item icon"></lightning-icon>
                            <template
                                for:each={searchResultsLocalState}
                                for:item="item"
                                for:index="index"
                                lwc:if={hasResults}
                            >
                                <li
                                    key={item.result.id}
                                    role="presentation"
                                    class="slds-listbox__item"
                                >
                                    <div
                                        class={item.classes}
                                        role="option"
                                        id={index}
                                        aria-label={item.result.title}
                                        onclick={handleResultClick}
                                        data-recordid={item.result.id}
                                    >
                                        <span
                                            class="slds-media__figure slds-listbox__option-icon"
                                        >
                                            <lightning-icon
                                                icon-name={item.result.icon}
                                                size="small"
                                                alternative-text="Result item icon"
                                            ></lightning-icon>
                                        </span>
                                        <span class="slds-media__body">
                                            <span class="slds-listbox__option-text slds-listbox__option-text_entity">
                                                <lightning-formatted-rich-text value={item.result.titleFormatted}
                                                    disable-linkify>
                                            <span
                                                class="slds-listbox__option-text slds-listbox__option-text_entity"
                                            >
                                                <lightning-formatted-rich-text
                                                    value={item.result.titleFormatted}
                                                    disable-linkify
                                                >
                                                </lightning-formatted-rich-text>
                                            </span>
                                            <!-- <span lwc:if={item.result.subtitleFormatted}
@@ -79,25 +151,53 @@
                            <!-- No results start -->
                            <template lwc:else>
                                <li role="presentation">
                                    <span class="slds-media slds-listbox__option_entity" role="option">
                                        <span lwc:if={loading} class="slds-media__body">Loading...</span>
                                        <span lwc:else class="slds-media__body">No results.</span>
                                    <span
                                        class="slds-media slds-listbox__option_entity"
                                        role="option"
                                    >
                                        <span
                                            lwc:if={loading}
                                            class="slds-media__body"
                                            >Loading...</span
                                        >
                                        <span lwc:else class="slds-media__body"
                                            >No results.</span
                                        >
                                    </span>
                                </li>
                            </template>
                            <!-- No results end -->
                            <!-- Create new records -->
                            <template for:each={newRecordOptions} for:item="newRecord">
                                <li key={newRecord.value} role="presentation" class="slds-listbox__item">
                                    <div class="slds-media slds-media_center slds-listbox__option slds-listbox__option_entity"
                                        onclick={handleNewRecordClick} data-sobject={newRecord.value} role="option">
                                        <span class="slds-media__figure slds-listbox__option-icon">
                                            <lightning-icon icon-name="utility:add" size="small"
                                                alternative-text={newRecord.label}></lightning-icon>
                            <template
                                for:each={newRecordOptions}
                                for:item="newRecord"
                            >
                                <li
                                    key={newRecord.value}
                                    role="presentation"
                                    class="slds-listbox__item"
                                >
                                    <div
                                        class="slds-media slds-media_center slds-listbox__option slds-listbox__option_entity"
                                        onclick={handleNewRecordClick}
                                        data-sobject={newRecord.value}
                                        role="option"
                                    >
                                        <span
                                            class="slds-media__figure slds-listbox__option-icon"
                                        >
                                            <lightning-icon
                                                icon-name="utility:add"
                                                size="small"
                                                alternative-text={newRecord.label}
                                            ></lightning-icon>
                                        </span>
                                        <span class="slds-media__body">
                                            <span class="slds-listbox__option-text">{newRecord.label}</span>
                                            <span
                                                class="slds-listbox__option-text"
                                                >{newRecord.label}</span
                                            >
                                        </span>
                                    </div>
                                </li>
@@ -111,14 +211,28 @@
            <!-- Multi-selection start -->
            <template lwc:if={isMultiEntry}>
                <div id="selection" role="listbox" aria-label={label} aria-orientation="horizontal">
                    <ul class="slds-listbox slds-listbox_inline slds-var-p-top_xxx-small" role="group"
                        aria-label="Selected options">
                <div
                    id="selection"
                    role="listbox"
                    aria-label={label}
                    aria-orientation="horizontal"
                >
                    <ul
                        class="slds-listbox slds-listbox_inline slds-var-p-top_xxx-small"
                        role="group"
                        aria-label="Selected options"
                    >
                        <template for:each={selection} for:item="item">
                            <li key={item.id} role="presentation">
                                <lightning-pill label={item.title} title={item.title}
                                    onremove={handleRemoveSelectedItem} name={item.id}>
                                    <lightning-icon icon-name={item.icon}></lightning-icon>
                                <lightning-pill
                                    label={item.title}
                                    title={item.title}
                                    onremove={handleRemoveSelectedItem}
                                    name={item.id}
                                >
                                    <lightning-icon
                                        icon-name={item.icon}
                                    ></lightning-icon>
                                </lightning-pill>
                            </li>
                        </template>
@@ -129,7 +243,11 @@
            <!-- Errors start -->
            <template for:each={_errors} for:item="error">
                <div key={error.id} role="alert" class="slds-form-element__label slds-var-m-top_xx-small form-error">
                <div
                    key={error.id}
                    role="alert"
                    class="slds-form-element__label slds-var-m-top_xx-small form-error"
                >
                    {error.message}
                </div>
            </template>
force-app/main/default/lwc/lexLookup/lexLookup.js
@@ -11,7 +11,8 @@
const VARIANT_LABEL_INLINE = 'label-inline';
const VARIANT_LABEL_HIDDEN = 'label-hidden';
const REGEX_SOSL_RESERVED = /(\?|&|\||!|\{|\}|\[|\]|\(|\)|\^|~|\*|:|"|\+|-|\\)/g;
const REGEX_SOSL_RESERVED =
    /(\?|&|\||!|\{|\}|\[|\]|\(|\)|\^|~|\*|:|"|\+|-|\\)/g;
const REGEX_EXTRA_TRAP = /(\$|\\)/g;
export default class LexLookup extends NavigationMixin(LightningElement) {
@@ -45,15 +46,13 @@
    _curSelection = [];
    _focusedResultIndex = null;
    // PUBLIC FUNCTIONS AND GETTERS/SETTERS
    @api
    set selection(initialSelection) {
        if (initialSelection) {
            this._curSelection = Array.isArray(initialSelection) ? initialSelection : [initialSelection];
            this._curSelection = Array.isArray(initialSelection)
                ? initialSelection
                : [initialSelection];
            this.processSelectionUpdate(false);
        }
    }
@@ -93,9 +92,13 @@
        let resultsLocal = JSON.parse(JSON.stringify(results));
        // Remove selected items from search results
        const selectedIds = this._curSelection.map((sel) => sel.id);
        resultsLocal = resultsLocal.filter((result) => selectedIds.indexOf(result.id) === -1);
        resultsLocal = resultsLocal.filter(
            (result) => selectedIds.indexOf(result.id) === -1
        );
        // Format results
        const cleanSearchTerm = this._searchTerm.replace(REGEX_SOSL_RESERVED, '.?').replace(REGEX_EXTRA_TRAP, '\\$1');
        const cleanSearchTerm = this._searchTerm
            .replace(REGEX_SOSL_RESERVED, '.?')
            .replace(REGEX_EXTRA_TRAP, '\\$1');
        const regex = new RegExp(`(${cleanSearchTerm})`, 'gi');
        this._searchResults = resultsLocal.map((result) => {
            // Format title and subtitle
@@ -124,7 +127,8 @@
                result,
                state: {},
                get classes() {
                    let cls = 'slds-media slds-media_center slds-listbox__option slds-listbox__option_entity';
                    let cls =
                        'slds-media slds-media_center slds-listbox__option slds-listbox__option_entity';
                    if (result.subtitleFormatted) {
                        cls += ' slds-listbox__option_has-meta';
                    }
@@ -158,7 +162,9 @@
    connectedCallback(){
        console.log('LexLookup accountValue = ' + this.accountValue);
        console.log('isDisabledForDealerText = ' + this.isDisabledForDealerText);
        console.log(
            'isDisabledForDealerText = ' + this.isDisabledForDealerText
        );
    }
    // INTERNAL FUNCTIONS
@@ -166,7 +172,10 @@
        this._searchTerm = newSearchTerm;
        // Compare clean new search term with current one and abort if identical
        const newCleanSearchTerm = newSearchTerm.trim().replace(REGEX_SOSL_RESERVED, '?').toLowerCase();
        const newCleanSearchTerm = newSearchTerm
            .trim()
            .replace(REGEX_SOSL_RESERVED, '?')
            .toLowerCase();
        if (this._cleanSearchTerm === newCleanSearchTerm) {
            return;
        }
@@ -175,7 +184,10 @@
        this._cleanSearchTerm = newCleanSearchTerm;
        // Ignore search terms that are too small after removing special characters
        if (newCleanSearchTerm.replace(/\?/g, '').length < this.minSearchTermLength) {
        if (
            newCleanSearchTerm.replace(/\?/g, '').length <
            this.minSearchTermLength
        ) {
            this.setSearchResults(this._defaultSearchResults);
            return;
        }
@@ -195,7 +207,9 @@
                    detail: {
                        searchTerm: this._cleanSearchTerm,
                        rawSearchTerm: newSearchTerm,
                        selectedIds: this._curSelection.map((element) => element.id)
                        selectedIds: this._curSelection.map(
                            (element) => element.id
                        )
                    }
                });
                this.dispatchEvent(searchEvent);
@@ -229,7 +243,9 @@
        // If selection was changed by user, notify parent components
        if (isUserInteraction) {
            const selectedIds = this._curSelection.map((sel) => sel.id);
            this.dispatchEvent(new CustomEvent('selectionchange', { detail: selectedIds }));
            this.dispatchEvent(
                new CustomEvent('selectionchange', { detail: selectedIds })
            );
        }
    }
@@ -261,12 +277,18 @@
                this._focusedResultIndex = this._searchResults.length - 1;
            }
            event.preventDefault();
        } else if (event.keyCode === KEY_ENTER && this._hasFocus && this._focusedResultIndex >= 0) {
        } else if (
            event.keyCode === KEY_ENTER &&
            this._hasFocus &&
            this._focusedResultIndex >= 0
        ) {
            // If the user presses enter, and the box is open, and we have used arrows,
            // treat this just like a click on the listbox item
            const selectedId = this._searchResults[this._focusedResultIndex].id;
            console.log('selectedid:'+selectedId);
            this.template.querySelector(`[data-recordid="${selectedId}"]`).click();
            this.template
                .querySelector(`[data-recordid="${selectedId}"]`)
                .click();
            event.preventDefault();
        }
    }
@@ -275,7 +297,9 @@
        const recordId = event.currentTarget.dataset.recordid;
        // Save selection
        const selectedItem = this._searchResults.find((result) => result.id === recordId);
        const selectedItem = this._searchResults.find(
            (result) => result.id === recordId
        );
        if (!selectedItem) {
            return;
        }
@@ -329,7 +353,9 @@
            return;
        }
        const recordId = event.currentTarget.name;
        this._curSelection = this._curSelection.filter((item) => item.id !== recordId);
        this._curSelection = this._curSelection.filter(
            (item) => item.id !== recordId
        );
        // Process selection update
        this.processSelectionUpdate(true);
    }
@@ -344,7 +370,9 @@
    handleNewRecordClick(event) {
        const objectApiName = event.currentTarget.dataset.sobject;
        const selection = this.newRecordOptions.find((option) => option.value === objectApiName);
        const selection = this.newRecordOptions.find(
            (option) => option.value === objectApiName
        );
        const preNavigateCallback = selection.preNavigateCallback
            ? selection.preNavigateCallback
@@ -370,11 +398,15 @@
    }
    get isListboxOpen() {
        const isSearchTermValid = this._cleanSearchTerm && this._cleanSearchTerm.length >= this.minSearchTermLength;
        const isSearchTermValid =
            this._cleanSearchTerm &&
            this._cleanSearchTerm.length >= this.minSearchTermLength;
        return (
            this._hasFocus &&
            this.isSelectionAllowed() &&
            (isSearchTermValid || this.hasResults || this.newRecordOptions?.length > 0)
            (isSearchTermValid ||
                this.hasResults ||
                this.newRecordOptions?.length > 0)
        );
    }
@@ -403,7 +435,8 @@
    }
    get getDropdownClass() {
        let css = 'slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click ';
        let css =
            'slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click ';
        if (this.isListboxOpen) {
            css += 'slds-is-open';
        }
@@ -415,11 +448,16 @@
        if (this._hasFocus && this.hasResults) {
            css += 'slds-has-focus ';
        }
        if (this._errors.length > 0 || (this._isDirty && this.required && !this.hasSelection())) {
        if (
            this._errors.length > 0 ||
            (this._isDirty && this.required && !this.hasSelection())
        ) {
            css += 'has-custom-error ';
        }
        if (!this.isMultiEntry) {
            css += 'slds-combobox__input-value ' + (this.hasSelection() ? 'has-custom-border' : '');
            css +=
                'slds-combobox__input-value ' +
                (this.hasSelection() ? 'has-custom-border' : '');
        }
        return css;
    }
@@ -429,7 +467,9 @@
        if (this.isMultiEntry) {
            css += 'slds-input-has-icon_right';
        } else {
            css += this.hasSelection() ? 'slds-input-has-icon_left-right' : 'slds-input-has-icon_right';
            css += this.hasSelection()
                ? 'slds-input-has-icon_left-right'
                : 'slds-input-has-icon_right';
        }
        return css;
    }
@@ -451,12 +491,19 @@
    get getSelectIconName() {
        if(this._curSelection[0])
            console.log('this._curSelection[0].icon = ' + this._curSelection[0].icon);
        return this.hasSelection() ? this._curSelection[0].icon : 'standard:default';
            console.log(
                'this._curSelection[0].icon = ' + this._curSelection[0].icon
            );
        return this.hasSelection()
            ? this._curSelection[0].icon
            : 'standard:default';
    }
    get getSelectIconClass() {
        return 'slds-combobox__input-entity-icon ' + (this.hasSelection() ? '' : 'slds-hide');
        return (
            'slds-combobox__input-entity-icon ' +
            (this.hasSelection() ? '' : 'slds-hide')
        );
    }
    get getInputValue() {
@@ -466,7 +513,9 @@
        if(this.accountValue != ''){
            return this.accountValue;
        }
        return this.hasSelection() ? this._curSelection[0].title : this._searchTerm;
        return this.hasSelection()
            ? this._curSelection[0].title
            : this._searchTerm;
    }
    get getInputTitle() {
@@ -479,7 +528,9 @@
    get getListboxClass() {
        return (
            'slds-dropdown ' +
            (this.scrollAfterNItems ? `slds-dropdown_length-with-icon-${this.scrollAfterNItems} ` : '') +
            (this.scrollAfterNItems
                ? `slds-dropdown_length-with-icon-${this.scrollAfterNItems} `
                : '') +
            'slds-dropdown_fluid'
        );
    }
force-app/main/default/lwc/lexNewOrder/lexNewOrder.html
@@ -2,6 +2,20 @@
    <template if:true={showSpinner}>
        <lightning-spinner size="medium" variant="brand"></lightning-spinner>
    </template>
    <div onclick={handleClick} style="width:200px;height:30px;background:#515151;font-weight:bold;font-size:16px Arial;color:white;border-radius: 5px 10px 10px 5px;;padding:5px 9px;cursor:pointer">新建消耗品订单</div>
    <div
        onclick={handleClick}
        style="
            width: 200px;
            height: 30px;
            background: #515151;
            font-weight: bold;
            font-size: 16px Arial;
            color: white;
            border-radius: 5px 10px 10px 5px;
            padding: 5px 9px;
            cursor: pointer;
        "
    >
        新建消耗品订单
    </div>
</template>
Diff truncated after the above file
force-app/main/default/lwc/lexNewOrder/lexNewOrder.js force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.css force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.html force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.js force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.html force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.js force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.html force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.js force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.html force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.js force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.html force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.js force-app/main/default/lwc/lexTopPage/lexTopPage.html force-app/main/default/lwc/lexTopPage/lexTopPage.js force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.html force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.js force-app/main/default/lwc/myCustomTypeDatatable/customName.html force-app/main/default/lwc/myCustomTypeDatatable/customNumber.html force-app/main/default/lwc/myCustomTypeDatatable/customUnit.html force-app/main/default/lwc/myCustomTypeDatatable/myCustomTypeDatatable.html force-app/main/default/lwc/myCustomTypeDatatable/myCustomTypeDatatable.js force-app/main/default/permissionsets/Community_LEX_PS.permissionset-meta.xml force-app/main/default/triggers/ContentDocumentLink.trigger force-app/main/default/triggers/ContentDocumentTrigger.trigger manifest/LEXC01packagelexcommunitynew.xml manifest/LEXC02packagelexcommunityupdate.xml