binxie
2023-06-26 b5c5eb130ca0848124f9d136af4be142ad5aac07
backup0626
143个文件已修改
17676 ■■■■ 已修改文件
.sf/config.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/CreateTarget/CreateTarget.cmp 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/CreateTarget/CreateTarget.cmp-meta.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/CreateTarget/CreateTargetHelper.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/WeeklyReport/WeeklyReport.css 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/ArriveGoodsControllerTest.cls 1860 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/DealerInquiryModifyStateController.cls 14 ●●●●● 补丁 | 查看 | 原始文档 | 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/lexArriveGoods/lexArriveGoods.css 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html 289 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js 605 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js-meta.xml 补丁 | 查看 | 原始文档 | 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 1088 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js 1566 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexConsumable/lexConsumable.html 902 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexConsumable/lexConsumable.js 828 ●●●● 补丁 | 查看 | 原始文档 | 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 640 ●●●●● 补丁 | 查看 | 原始文档 | 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 490 ●●●●● 补丁 | 查看 | 原始文档 | 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/pages/DealerInquiryModifyState.page 200 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/DealerInquiryModifyState.page-meta.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/triggers/ContentDocumentLink.trigger 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/triggers/ContentDocumentTrigger.trigger 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest/LEXC01packagelexcommunitynew.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest/LEXC02packagelexcommunityupdate.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.sf/config.json
@@ -1,3 +1,3 @@
{
  "target-org": "OlympusDev"
  "target-org": "OlympusStageEnv"
}
force-app/main/default/aura/CreateTarget/CreateTarget.cmp
@@ -1,4 +1,4 @@
<aura:component controller="CreateTargetCmp" implements="force:appHostable,forceCommunity:availableForAllPageTypes,force:hasRecordId" access="global" >
<aura:component controller="CreateTargetCmp" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" access="global" >
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <aura:attribute name="recordId" type="Id" />
    <aura:attribute name="hospital" type="string" default=""/>
@@ -44,7 +44,6 @@
    <div class="button_area">
        <ui:button label="{!v.button_text}" press="{!c.toggle_report}"/>
    </div>
    <div aura:id="modal_window" role="dialog" tabindex="-1" class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget">
        <div class="slds-modal__container">
            <div class="slds-modal__header">
@@ -61,10 +60,10 @@
                            <div class="slds-form-element__row">
                                <div class="slds-form-element slds-size--1-of-2">
                                    <label class="slds-form-element__label" for="input-hos">医院</label>
                                    <force:inputField value="{!v.record.Agency_Hospital__c}" aura:id="input-hos"/>
                                    <!-- <lightning:recordEditForm objectApiName="Agency_Opportunity__c" recordId="{!v.record.Id}">
                                        <lightning:inputField fieldName="Agency_Hospital__c"/>
                                    </lightning:recordEditForm> -->
                                    <!-- <force:inputField value="{!v.record.Agency_Hospital__c}" aura:id="input-hos"/> -->
                                    <lightning:recordEditForm objectApiName="Agency_Opportunity__c">
                                        <lightning:inputField variant="label-hidden" fieldName="Agency_Hospital__c" value="{!v.record.Agency_Hospital__c}" aura:id="input-hos"/>
                                    </lightning:recordEditForm>
                                </div>
                            </div>
                            <!-- <h4 class="slds-section__title">访问目标</h4>
force-app/main/default/aura/CreateTarget/CreateTarget.cmp-meta.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>57.0</apiVersion>
    <apiVersion>42.0</apiVersion>
    <description>A Lightning Component Bundle</description>
</AuraDefinitionBundle>
force-app/main/default/aura/CreateTarget/CreateTargetHelper.js
@@ -15,8 +15,9 @@
                    var select_ah_name = ah.Name;
                    // component.set('v.record.Agency_Hospital__c', select_ah);
                    //add by Deloitte 2023-6-8
                    let agencyHosp = component.get('v.record');
                    agencyHosp.Agency_Hospital__c = select_ah;
                    let agency = component.get("v.record");
                    agency.Agency_Hospital__c = select_ah;
                    // component.set("v.record", agency);
                    // alert(JSON.stringify(component.find('input-hos').get("v.body")[0].get('v.values')));
                    if ($A.get("$Browser.formFactor") == 'DESKTOP') {
                        console.log("flag1");
@@ -109,13 +110,6 @@
            }
        });
        $A.enqueueAction(action);
        var modal_window = component.find('modal_window');
        var modal_bg = component.find('modal_bg');
        if ($A.util.hasClass(modal_window, 'disp_none') && !component.get("v.recordId")) {
            $A.get('e.force:refreshView').fire();
        }
    },
    toggle_report : function(component, event, helper) {
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js
@@ -40,6 +40,46 @@
        });
        $A.enqueueAction(action);
    },
    doinitSave: function (component, event, helper) {
        document.title = "追溯日报";
        component.set('v.loginEdit', true);
        this.report_date_list(component, event, helper, 5);
        var action = component.get('c.getalldata');
        action.setCallback(this, function (response) {
            var state = response.getState();
            if (state == 'SUCCESS') {
                var res = response.getReturnValue();
                component.set('v.alldata', res.reports);
                component.set('v.fieldsmap', res.fieldsMap);
                component.set('v.allselectlist', res.allselectlist);
                component.set('v.doclist', res.doclist);
                //fy
                var xx = res.UserProType;
                component.set('v.UserProType', res.UserProType);
                var gg = component.get('v.UserProType');
                //fy
                component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c));
                component.find('select_DealerPersonnel').set('v.options', this.conv_selected(res.allselectlist.DealerPersonnel__c));
                component.find('select_purpose_type').set('v.options', this.conv_selected(res.allselectlist.WorkRecord__c));
                component.find('select_ProductClassification').set('v.options', this.conv_selected(res.allselectlist.ProductClassification__c));
                component.find('select_stageName').set('v.options', this.conv_selected(res.allselectlist.StageName__c));
                component.set('v.selected_agency_person', res.allselectlist.AgencyPerson__c[0].label);
                component.set('v.dialog_type', '新建');
                this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value'));
                component.set('v.PIConfig', res.PIConfig);// 20220222 PI改造 by Bright
                component.set('v.loginEdit', false);
            }
            else {
                //component.set('v.errorMessage', 'doinit failed.');
                this.error('doinit failed.');
                this.showErrorToast(component);
                component.set('v.loginEdit', false);
            }
        });
        $A.enqueueAction(action);
    },
    //其他品牌产品类别 下拉框赋值
    selectProductCcategory: function (component) {
        var select_ProductClassification = component.find('select_ProductClassification').get('v.value');
@@ -76,7 +116,7 @@
            "date_str": date_str,
            "person_str": person_str,
        });
        component.set('v.login', true);
        component.set('v.loginEdit', true);
        action.setCallback(this, function (response) {
            
            var state = response.getState();
@@ -145,15 +185,15 @@
                                    component.set('v.report_count', res.reports.length);
                                }
                                //fy 20220414 end
                                component.set('v.login', false);
                                component.set('v.loginEdit', false);
                            }, staticResourceAgencyContact.token);
                        } else {
                            component.set('v.login', false);
                            component.set('v.loginEdit', false);
                        }
                    }
                } else {
                    component.set('v.list_message', 'no_data');
                    component.set('v.login', false);
                    component.set('v.loginEdit', false);
                }
            }
@@ -161,7 +201,7 @@
                //component.set('v.errorMessage', 'get_reports failed.');
                this.error('get_reports failed.');
                this.showErrorToast(component);
                component.set('v.login', false);
                component.set('v.loginEdit', false);
            }
        });
        $A.enqueueAction(action);
@@ -1013,7 +1053,7 @@
            return false;
        }
        // 保存処理
        component.set('v.login', true);
        component.set('v.loginEdit', true);
        if (component.get('v.mode') == 'edit') {
            var Agency_Report__c = component.get('v.select_report_data').Id;
            var action = component.get('c.editAgencyReport');
@@ -1047,6 +1087,7 @@
            action.setCallback(this, function (response) {
                var state = response.getState();
                if (state == 'SUCCESS') {
                    debugger
                    component.set('v.successMessage', '编辑保存成功');
                    this.showSuccessToast(component);
                    var report_id = response.getReturnValue();
@@ -1063,14 +1104,14 @@
                    component.set('v.update_select_report_data_id', report_id);
                    this.get_reports(component, event, helper, component.get('v.select_report_data').Submit_date__c, component.get('v.select_report_data').Person_In_Charge2__c);
                    component.find('save_button').set('v.disabled', false);
                    component.set('v.login', false);
                    component.set('v.loginEdit', false);
                }
                else {
                    //component.set('v.errorMessage', 'save_report failed.');
                    this.error('save_report failed.');
                    this.showErrorToast(component);
                    component.find('save_button').set('v.disabled', false);
                    component.set('v.login', false);
                    component.set('v.loginEdit', false);
                }
            });
            $A.enqueueAction(action);
@@ -1143,15 +1184,16 @@
                            this.error('get_reports_now failed.');
                            this.showErrorToast(component);
                            component.find('save_button').set('v.disabled', false);
                            component.set('v.login', false);
                            component.set('v.loginEdit', false);
                        }
                    });
                    $A.enqueueAction(action2);
                    this.allclear(component);
                    component.find('select_WorkMark').set('v.value', false);
                    component.find('save_button').set('v.disabled', false);
                    component.set('v.login', false);
                    this.doinit(component, event, helper);
                    component.set('v.loginEdit', false);
                    debugger
                    this.doinitSave(component, event, helper);
                }
                else {
                    var error = response.getError();
@@ -1159,7 +1201,7 @@
                    this.error('保存日报失败');
                    this.showErrorToast(component);
                    component.find('save_button').set('v.disabled', false);
                    component.set('v.login', false);
                    component.set('v.loginEdit', false);
                }
            });
            $A.enqueueAction(action);
force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
@@ -354,7 +354,9 @@
                        </div>
                        <!-- 医院 -->
                        <div aura:id="hospital_list" class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5 marginTop" data-select="single">
                            <ui:inputText aura:id="hospital_input_text" label="医院" class="field" value="{!v.hospital}" updateOn="keyup"/>
                            <!-- <ui:inputText aura:id="hospital_input_text" label="医院" class="field" value="{!v.hospital}" updateOn="keyup"/> -->
                            医院
                            <lightning:input aura:id="hospital_input_text" class="field" value="{!v.hospital}" variant="label-hidden" updateOn="keyup"/>
                            <div class="slds-lookup__menu" id="lookup-66">
                                <ul class="slds-lookup__list" role="listbox">
                                    <aura:iteration var="hospital" items="{!v.hospitalList}">
force-app/main/default/aura/WeeklyReport/WeeklyReport.css
@@ -152,4 +152,7 @@
.THIS .marginTop{
    margin-top: 10px;
}
.THIS .custom-input .uiInput {
    height: 2rem; /* 调整高度为你需要的值,如 2rem */
}
/* add by Deloitte-Link 2023-6-19 end*/
force-app/main/default/classes/ArriveGoodsControllerTest.cls
@@ -3,54 +3,20 @@
  @isTest
  static void myUnitTest() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -59,37 +25,13 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = 'Test001',
        Product2__c = prod01.Id
      );
      Product2__c pro2 = new Product2__c(
        Name = 'Pro002',
        OT_CODE_Text__c = 'Test002',
        Product2__c = prod02.Id
      );
      insert new List<Product2__c>{ pro1, pro2 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
            Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
            insert new Product2__c[] {pro1, pro2};
      //订单
      Consumable_order__c Order1 = new Consumable_order__c();
      Order1.Name = 'OCM_01_001';
@@ -149,6 +91,7 @@
      Orderdet3.TracingCode__c = 'BXJRC';
      //Orderdet3.Box_Piece__c = '盒';
      //出库产品
      Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
      Orderdet4.Name = 'OCM_01_001005';
@@ -194,26 +137,12 @@
      Orderdets8.Box_Piece__c = '盒';
      Orderdets8.TracingCode__c = 'BXsys';
      insert new List<Consumable_order_details2__c>{
        Orderdet1,
        Orderdet2,
        Orderdet3,
        Orderdet4,
        Orderdet5,
        Orderdet6,
        Orderdets8
      };
            insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdets8};
      List<Consumable_orderdetails__c> cod1 = [
        SELECT Id
        FROM Consumable_orderdetails__c
        WHERE Consumable_order__c = :Order1.Id
      ];
            List<Consumable_orderdetails__c> cod1 = [select Id from Consumable_orderdetails__c WHERE Consumable_order__c = :Order1.Id];
      System.assertEquals(1, cod1.size());
      PageReference page = new PageReference(
        '/apex/ArriveGoods?Esetid=' + Order1.Id
      );
            PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
      System.Test.setCurrentPage(page);
      ArriveGoodsController Controller = new ArriveGoodsController();
@@ -235,54 +164,21 @@
  @isTest
  static void arriveWithID() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -291,37 +187,13 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = 'N3047730',
        Product2__c = prod01.Id
      );
      Product2__c pro2 = new Product2__c(
        Name = 'Pro002',
        OT_CODE_Text__c = 'N3047731',
        Product2__c = prod02.Id
      );
      insert new List<Product2__c>{ pro1, pro2 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id);
            Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id);
            insert new Product2__c[] {pro1, pro2};
      //订单
      Consumable_order__c Order1 = new Consumable_order__c();
@@ -357,9 +229,7 @@
      insert Orderdet1;
      PageReference page = new PageReference(
        '/apex/ArriveGoods?ESetid=' + Order1.Id
      );
            PageReference page = new PageReference('/apex/ArriveGoods?ESetid=' + Order1.Id);
      System.Test.setCurrentPage(page);
      ArriveGoodsController Controller = new ArriveGoodsController();
      //初始化测试
@@ -370,67 +240,32 @@
      // System.assertEquals(1, Controller.ConsumableorderdetailsRecords.size());
      // System.assertEquals(2, Controller.consumableInventory.size());
      Controller.ArriveGoodsConfim();
      List<Consumable_order_details2__c> ins = [
        SELECT Id, Name
        FROM Consumable_order_details2__c
      ];
            List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c];
      // System.assertEquals(3, ins.size());
      System.Test.stopTest();
    }
  }
  //产品直接入库,包括01 和241
  @isTest
  static void arriveWithoutID() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -439,37 +274,13 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',ProductCode_Ext__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='N3047731',ProductCode_Ext__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = 'Test01',
        Product2__c = prod01.Id
      );
      Product2__c pro2 = new Product2__c(
        Name = 'Pro002',
        OT_CODE_Text__c = 'N3047731',
        Product2__c = prod02.Id
      );
      insert new List<Product2__c>{ pro1, pro2 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test01',Product2__c = prod01.Id);
            Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id);
            insert new Product2__c[] {pro1, pro2};
      PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
      System.Test.setCurrentPage(page);
      ArriveGoodsController Controller = new ArriveGoodsController();
@@ -482,15 +293,7 @@
      Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n241N30477311115120017181000105ZK250BXJRA\n241Test021115120017181000105ZK250\n01049531702003111115120017181000105ZK250';
      Controller.SearchPro();
      Controller.ArriveGoodsConfim();
      List<Consumable_order_details2__c> ins = [
        SELECT Id, Name
        FROM Consumable_order_details2__c
        WHERE
          Bar_Code__c IN (
            '01049531702003111115120017181000105ZK250BXJRF',
            '241N30477311115120017181000105ZK250BXJRA'
          )
      ];
            List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c WHERE Bar_Code__c in ('01049531702003111115120017181000105ZK250BXJRF','241N30477311115120017181000105ZK250BXJRA')];
      // System.assertEquals(2, ins.size());
      System.Test.stopTest();
    }
@@ -499,54 +302,20 @@
  @isTest
  static void ArriveTest() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Oly_TriggerHandler.bypass('ConsumableAssetHander');
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -555,32 +324,12 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = 'Test001',
        Product2__c = prod01.Id
      );
      insert new List<Product2__c>{ pro1 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
            insert new Product2__c[] {pro1};
      // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
      // insert myAccount1;
      Consumable_order__c Order2 = new Consumable_order__c();
@@ -662,6 +411,7 @@
      Orderdet3.SerialLotNo__c = '5ZK';
      //Orderdet3.Box_Piece__c = '个';
      //出库产品
      Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
      Orderdet4.Name = 'OCM_01_001005';
@@ -692,13 +442,9 @@
      Orderdet5.Box_Piece__c = '盒';
      Orderdet5.TracingCode__c = 'BXJRE';
      Orderdet5.SerialLotNo__c = '5ZK';
      insert new List<Consumable_order_details2__c>{
        Orderdet1,
        Orderdet2,
        Orderdet3,
        Orderdet4,
        Orderdet5
      };
            insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5};
      ArriveGoodsController Controller = new ArriveGoodsController();
      PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
@@ -710,12 +456,11 @@
      Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BXsys';
      Controller.SearchPro();
      System.assertEquals(
        'OCM_01_001002',
        controller.ConsumableorderdetailsRecords[0].esd.Name
      );
            System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name);
      // System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size());
      System.Test.stopTest();
    }
  }
@@ -723,55 +468,21 @@
  @isTest
  static void ArriveTest1() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Oly_TriggerHandler.bypass('ConsumableAssetHander');
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -780,37 +491,13 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = 'Test001',
        Product2__c = prod01.Id
      );
      Product2__c pro2 = new Product2__c(
        Name = 'Pro002',
        OT_CODE_Text__c = 'Test002',
        Product2__c = prod02.Id
      );
      insert new List<Product2__c>{ pro1, pro2 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
            Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
            insert new Product2__c[] {pro1, pro2};
      // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
      // insert myAccount1;
      Consumable_order__c Order2 = new Consumable_order__c();
@@ -890,6 +577,7 @@
      Orderdet3.TracingCode__c = 'BXJRC';
      Orderdet3.SerialLotNo__c = '5ZK';
      //出库产品
      Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
      Orderdet4.Name = 'OCM_01_001005';
@@ -918,13 +606,9 @@
      Orderdet5.Box_Piece__c = '盒';
      Orderdet5.TracingCode__c = 'BXJRE';
      Orderdet5.SerialLotNo__c = '5ZK';
      insert new List<Consumable_order_details2__c>{
        Orderdet1,
        Orderdet2,
        Orderdet3,
        Orderdet4,
        Orderdet5
      };
            insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5};
      ArriveGoodsController Controller = new ArriveGoodsController();
      PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
@@ -936,67 +620,36 @@
      Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BXsys';
      Controller.SearchPro();
      System.assertEquals(
        'OCM_01_001002',
        controller.ConsumableorderdetailsRecords[0].esd.Name
      );
            System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name);
      // System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size());
      System.Test.stopTest();
    }
  }
  //返品
  @isTest
  static void productReturn() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -1005,37 +658,13 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = 'Test001',
        Product2__c = prod01.Id
      );
      Product2__c pro2 = new Product2__c(
        Name = 'Pro002',
        OT_CODE_Text__c = 'Test002',
        Product2__c = prod02.Id
      );
      insert new List<Product2__c>{ pro1, pro2 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
            Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
            insert new Product2__c[] {pro1, pro2};
      //订单
      Consumable_order__c Order1 = new Consumable_order__c();
@@ -1141,14 +770,7 @@
      Orderdet6.Box_Piece__c = '个';
      Orderdet6.TracingCode__c = 'BXJRF';
      insert new List<Consumable_order_details2__c>{
        Orderdet1,
        Orderdet2,
        Orderdet3,
        Orderdet4,
        Orderdet5,
        Orderdet6
      };
            insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6};
      PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
      System.Test.setCurrentPage(page);
      ArriveGoodsController Controller = new ArriveGoodsController();
@@ -1173,6 +795,7 @@
      Controller.ToReturnGoodsPage();
      Controller.geterrorsize();
      System.Test.stopTest();
    }
  }
@@ -1180,54 +803,21 @@
  @isTest
  static void productReturn_new() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -1236,37 +826,13 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = 'Test001',
        Product2__c = prod01.Id
      );
      Product2__c pro2 = new Product2__c(
        Name = 'Pro002',
        OT_CODE_Text__c = 'Test002',
        Product2__c = prod02.Id
      );
      insert new List<Product2__c>{ pro1, pro2 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
            Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
            insert new Product2__c[] {pro1, pro2};
      //订单
      Consumable_order__c Order1 = new Consumable_order__c();
      Order1.Name = 'OCM_01_001';
@@ -1358,11 +924,7 @@
      Orderdet5.Box_Piece__c = '个';
      Orderdet5.TracingCode__c = 'BXJRZ';
      Orderdet5.SerialLotNo__c = '5ZK';
      insert new List<Consumable_order_details2__c>{
        Orderdet3,
        Orderdet4,
        Orderdet5
      };
            insert new Consumable_order_details2__c[] {Orderdet3,Orderdet4,Orderdet5};
      PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
      System.Test.setCurrentPage(page);
@@ -1380,7 +942,7 @@
      controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c = 1;
      Controller.UpdateGoodsOfReturn();
      list<String> list1 = new List<String>();
            list<String> list1 = new list<String>();
      list1.add(Controller.barcode = '01234567898');
      Controller.inventoryEntryNoESetId(list1);
@@ -1443,6 +1005,7 @@
      list1.add(Controller.barcode = '0112345678901231106789012105625001234');
      Controller.inventoryEntryNoESetId(list1);
      System.Test.stopTest();
    }
  }
@@ -1450,54 +1013,21 @@
  @isTest
  static void arrivedirect() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -1506,43 +1036,18 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = '2344',
        Product2__c = prod01.Id
      );
      Product2__c pro2 = new Product2__c(
        Name = 'Pro002',
        OT_CODE_Text__c = '82324',
        Product2__c = prod02.Id
      );
      insert new List<Product2__c>{ pro1, pro2 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='2344',Product2__c = prod01.Id);
            Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='82324',Product2__c = prod02.Id);
            insert new Product2__c[] {pro1, pro2};
      //产品注册证
      Product_Register__c prc = new Product_Register__c(
        Name = '国械注进20162220210',
            Product_Register__c prc = new Product_Register__c(Name = '国械注进20162220210',
        MedPrdClass__c = '3',
        ValidFrom__c = date.newinstance(2018, 7, 22),
        ValidTo__c = date.newinstance(2028, 7, 22),
                                                              ValidFrom__c = date.newinstance(2018, 07, 22),
                                                              ValidTo__c = date.newinstance(2028, 07, 22),
        RegisterNoClass_Old__c = '6815',
        RegisterNoClass_New__c = '6815',
        RegisterNoStatus__c = '有效'
@@ -1631,15 +1136,8 @@
      //List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id];
      //System.assertEquals('○', proList[0].Estimation_Entry_Possibility__c);
      insert new List<Consumable_order_details2__c>{
        Orderdet1,
        Orderdet2,
        Orderdet3,
        Orderdet4
      };
      PageReference page = new PageReference(
        '/apex/ArriveGoods?Esetid=' + Order1.Id
      );
            insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4};
            PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
      System.Test.setCurrentPage(page);
      ArriveGoodsController Controller = new ArriveGoodsController();
      //初始化测试
@@ -1657,53 +1155,20 @@
  @isTest
  static void arrivedirect241() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -1712,43 +1177,18 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = 'Test001',
        Product2__c = prod01.Id
      );
      Product2__c pro2 = new Product2__c(
        Name = 'Pro002',
        OT_CODE_Text__c = 'Test002',
        Product2__c = prod02.Id
      );
      insert new List<Product2__c>{ pro1, pro2 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
            Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
            insert new Product2__c[] {pro1, pro2};
      //产品注册证
      Product_Register__c prc = new Product_Register__c(
        Name = '国械注进20162220210',
            Product_Register__c prc = new Product_Register__c(Name = '国械注进20162220210',
        MedPrdClass__c = '3',
        ValidFrom__c = date.newinstance(2018, 7, 22),
        ValidTo__c = date.newinstance(2028, 7, 22),
                                                              ValidFrom__c = date.newinstance(2018, 07, 22),
                                                              ValidTo__c = date.newinstance(2028, 07, 22),
        RegisterNoClass_Old__c = '6815',
        RegisterNoClass_New__c = '6815',
        RegisterNoStatus__c = '有效'
@@ -2040,23 +1480,8 @@
      //List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id];
      //System.assertEquals('○', proList[0].Estimation_Entry_Possibility__c);
      insert new List<Consumable_order_details2__c>{
        Orderdet1,
        Orderdet2,
        Orderdet3,
        Orderdet4,
        Orderdet5,
        Orderdet6,
        Orderdet7,
        Orderdet8,
        Orderdet9,
        lose,
        lose1,
        lose2
      };
      PageReference page = new PageReference(
        '/apex/ArriveGoods?Esetid=' + Order1.Id
      );
            insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdet7,Orderdet8,Orderdet9,lose,lose1,lose2};
            PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
      System.Test.setCurrentPage(page);
      ArriveGoodsController Controller = new ArriveGoodsController();
      //初始化测试
@@ -2071,58 +1496,26 @@
    }
  }
  //返品 明细2不存在的对应的到货订单明细
  @isTest
  static void productReturn_oldbarcode() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -2131,37 +1524,13 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = 'Test001',
        Product2__c = prod01.Id
      );
      Product2__c pro2 = new Product2__c(
        Name = 'Pro002',
        OT_CODE_Text__c = 'Test002',
        Product2__c = prod02.Id
      );
      insert new List<Product2__c>{ pro1, pro2 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
            Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
            insert new Product2__c[] {pro1, pro2};
      //订单
      Consumable_order__c Order1 = new Consumable_order__c();
@@ -2274,15 +1643,7 @@
      Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BX333';
      Orderdet7.TracingCode__c = 'BXSYS';
      insert new List<Consumable_order_details2__c>{
        Orderdet1,
        Orderdet2,
        Orderdet3,
        Orderdet4,
        Orderdet5,
        Orderdet6,
        Orderdet7
      };
            insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdet7};
      PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
      System.Test.setCurrentPage(page);
      ArriveGoodsController Controller = new ArriveGoodsController();
@@ -2306,59 +1667,27 @@
      controller.getinventorysize();
      System.Test.stopTest();
    }
  }
  @isTest
  static void barcodecheck() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -2366,40 +1695,16 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = '2344',
        Product2__c = prod01.Id
      );
      Product2__c pro2 = new Product2__c(
        Name = 'Pro002',
        OT_CODE_Text__c = '8232',
        Product2__c = prod02.Id
      );
      insert new List<Product2__c>{ pro1, pro2 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='2344',Product2__c = prod01.Id);
            Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='8232',Product2__c = prod02.Id);
            insert new Product2__c[] {pro1, pro2};
      ArriveGoodsController Controller = new ArriveGoodsController();
      //初始化测试
      list<String> list1 = new List<String>();
            list<String> list1 = new list<String>();
      list1.clear();
      list1.add(Controller.barcode = '2413456250BBBBA');
      Controller.inventoryEntry(list1);
@@ -2460,141 +1765,80 @@
      Controller.inventoryEntry(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '011234567890123411789012175678901234250BBBBM'
      );
            list1.add(Controller.barcode = '011234567890123411789012175678901234250BBBBM');
      Controller.inventoryEntry(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '01123456789012340138901217aaa8001234250BBBBN'
      );
            list1.add(Controller.barcode = '01123456789012340138901217aaa8001234250BBBBN');
      Controller.inventoryEntry(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '011234567890123456789012104567890250BBBBO'
      );
            list1.add(Controller.barcode = '011234567890123456789012104567890250BBBBO');
      Controller.inventoryEntry(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '01123456789012341778910034567890250BBBBP'
      );
            list1.add(Controller.barcode = '01123456789012341778910034567890250BBBBP');
      Controller.inventoryEntry(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '011234567890123417aa910034567890250BBBBQ'
      );
            list1.add(Controller.barcode = '011234567890123417aa910034567890250BBBBQ');
      Controller.inventoryEntry(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '01123456789012341778911134567890250BBBBR'
      );
            list1.add(Controller.barcode = '01123456789012341778911134567890250BBBBR');
      Controller.inventoryEntry(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '011234567890123417789121105678900000250BBBBS'
      );
            list1.add(Controller.barcode = '011234567890123417789121105678900000250BBBBS');
      Controller.inventoryEntry(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '011234567890123410789121105678900000250BBBBT'
      );
            list1.add(Controller.barcode = '011234567890123410789121105678900000250BBBBT');
      Controller.inventoryEntry(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '011234567890123411789012171a780012250BBBBU'
      );
            list1.add(Controller.barcode = '011234567890123411789012171a780012250BBBBU');
      Controller.inventoryEntry(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '0112345678901234110890121012789000250BBBBV'
      );
            list1.add(Controller.barcode = '0112345678901234110890121012789000250BBBBV');
      Controller.inventoryEntry(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '011234567890123417120506105678901234250BBBBW'
      );
            list1.add(Controller.barcode = '011234567890123417120506105678901234250BBBBW');
      Controller.inventoryEntry(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '0112345678901234111202121712050212250BBBBX'
      );
            list1.add(Controller.barcode = '0112345678901234111202121712050212250BBBBX');
      Controller.inventoryEntry(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '0112345678901234111202121712a50212250BBBBY'
      );
            list1.add(Controller.barcode = '0112345678901234111202121712a50212250BBBBY');
      Controller.inventoryEntry(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '0112345678901234111202121012050212250BBBBZ'
      );
            list1.add(Controller.barcode = '0112345678901234111202121012050212250BBBBZ');
      Controller.inventoryEntry(list1);
    }
  }
  @isTest
  static void barcodechkeck_2() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -2602,43 +1846,18 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = '2344',
        Product2__c = prod01.Id
      );
      Product2__c pro2 = new Product2__c(
        Name = 'Pro002',
        OT_CODE_Text__c = '82324',
        Product2__c = prod02.Id
      );
      insert new List<Product2__c>{ pro1, pro2 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='2344',Product2__c = prod01.Id);
            Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='82324',Product2__c = prod02.Id);
            insert new Product2__c[] {pro1, pro2};
      //产品注册证
      Product_Register__c prc = new Product_Register__c(
        Name = '国械注进20162220210',
            Product_Register__c prc = new Product_Register__c(Name = '国械注进20162220210',
        MedPrdClass__c = '3',
        ValidFrom__c = date.newinstance(2018, 7, 22),
        ValidTo__c = date.newinstance(2028, 7, 22),
                                                              ValidFrom__c = date.newinstance(2018, 07, 22),
                                                              ValidTo__c = date.newinstance(2028, 07, 22),
        RegisterNoClass_Old__c = '6815',
        RegisterNoClass_New__c = '6815',
        RegisterNoStatus__c = '有效'
@@ -2669,22 +1888,13 @@
      ArriveGoodsController Controller = new ArriveGoodsController();
      //List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id];
      //System.assertEquals('○', proList[0].Estimation_Entry_Possibility__c);
      List<Product2__c> product2InStore = [
        SELECT
          Id,
          Name,
          Name__c,
          Intra_Trade_List_RMB__c,
          Asset_Model_No__c,
          OT_CODE__c
            List<Product2__c> product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c
        FROM Product2__c
        WHERE
          Estimation_Entry_Possibility__c = '○'
          AND Pro2_Dealer_Object__c = TRUE
          AND OT_CODE__c = 'test'
      ];
                                                 WHERE Estimation_Entry_Possibility__c = '○'
                                                                                         AND Pro2_Dealer_Object__c = true
                                                                                                                     AND OT_CODE__c ='test' ];
      //System.assertEquals(1, product2InStore.size());
      list<String> list1 = new List<String>();
            list<String> list1 = new list<String>();
      list1.clear();
      list1.add(Controller.barcode = '2413456250BBBBA');
      Controller.inventoryEntryNoESetId(list1);
@@ -2763,33 +1973,27 @@
      list1.add(Controller.barcode = '241test111204121778900034567890250BBBBQ');
      Controller.inventoryEntryNoESetId(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '0111234101204120118901231712a4001234250BBBBR'
      );
            list1.add(Controller.barcode = '0111234101204120118901231712a4001234250BBBBR');
      Controller.inventoryEntryNoESetId(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '011123410120412011890123171204011234250BBBBS'
      );
            list1.add(Controller.barcode = '011123410120412011890123171204011234250BBBBS');
      Controller.inventoryEntryNoESetId(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '011test10120412011890123171a04011234250BBBBT'
      );
            list1.add(Controller.barcode = '011test10120412011890123171a04011234250BBBBT');
      Controller.inventoryEntryNoESetId(list1);
      list1.clear();
      list1.add(
        Controller.barcode = '0111234101204120118901231012040112342222250BBBBU'
      );
            list1.add(Controller.barcode = '0111234101204120118901231012040112342222250BBBBU');
      Controller.inventoryEntryNoESetId(list1);
      list1.clear();
      list1.add(Controller.barcode = '011123410120412017120100250AAAAA');
      Controller.inventoryEntryNoESetId(list1);
    }
  }
@@ -2797,54 +2001,21 @@
  @isTest
  static void addSaleOrderAuto() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -2852,32 +2023,12 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = 'Test001',
        Product2__c = prod01.Id
      );
      insert new List<Product2__c>{ pro1 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
            insert new Product2__c[] {pro1};
      // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
      // insert myAccount1;
      Consumable_order__c Order2 = new Consumable_order__c();
@@ -2920,54 +2071,21 @@
  @isTest
  static void methodTest1() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -2975,37 +2093,13 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = 'N3047730',
        Product2__c = prod01.Id
      );
      Product2__c pro2 = new Product2__c(
        Name = 'Pro002',
        OT_CODE_Text__c = 'N3047731',
        Product2__c = prod02.Id
      );
      insert new List<Product2__c>{ pro1, pro2 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id);
            Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id);
            insert new Product2__c[] {pro1, pro2};
      //订单
      Consumable_order__c Order1 = new Consumable_order__c();
@@ -3056,9 +2150,7 @@
      Orderdet2.SerialLotNo__c = '5ZK';
      insert Orderdet2;
      PageReference page = new PageReference(
        '/apex/ArriveGoods?ESetid=' + Order1.Id
      );
            PageReference page = new PageReference('/apex/ArriveGoods?ESetid=' + Order1.Id);
      System.Test.setCurrentPage(page);
      ArriveGoodsController Controller = new ArriveGoodsController();
      //初始化测试
@@ -3069,67 +2161,32 @@
      // System.assertEquals(1, Controller.ConsumableorderdetailsRecords.size());
      // System.assertEquals(2, Controller.consumableInventory.size());
      Controller.ArriveGoodsConfim();
      List<Consumable_order_details2__c> ins = [
        SELECT Id, Name
        FROM Consumable_order_details2__c
      ];
            List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c];
      // System.assertEquals(3, ins.size());
      System.Test.stopTest();
    }
  }
  //返品
  @isTest
  static void methodTest2() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -3137,37 +2194,13 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = 'Test001',
        Product2__c = prod01.Id
      );
      Product2__c pro2 = new Product2__c(
        Name = 'Pro002',
        OT_CODE_Text__c = 'Test002',
        Product2__c = prod02.Id
      );
      insert new List<Product2__c>{ pro1, pro2 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
            Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
            insert new Product2__c[] {pro1, pro2};
      //订单
      Consumable_order__c Order1 = new Consumable_order__c();
      Order1.Name = 'OCM_01_001';
@@ -3259,12 +2292,7 @@
      Orderdet5.Box_Piece__c = '个';
      Orderdet5.TracingCode__c = 'BXJRZ';
      Orderdet5.SerialLotNo__c = '5ZK';
      insert new List<Consumable_order_details2__c>{
        Orderdet1,
        Orderdet3,
        Orderdet4,
        Orderdet5
      };
            insert new Consumable_order_details2__c[] {Orderdet1,Orderdet3,Orderdet4,Orderdet5};
      PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
      System.Test.setCurrentPage(page);
@@ -3275,17 +2303,14 @@
      //排序
      Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRZ\n01049531702003111115120017181000105ZK250BXJRR';
      Controller.SearchPro();
      System.assertEquals(
        1,
        controller.ConsumableorderdetailsRecordserror.size()
      );
            System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size());
      // System.assertEquals(2, controller.ShowGoodsofReturnList.size());
      controller.ShowGoodsofReturnList[0].esd.Return_reason__c = '多发';
      // controller.ShowGoodsofReturnList[1].esd.Return_reason__c='多发';
      // controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c =1;
      Controller.UpdateGoodsOfReturn();
      list<String> list1 = new List<String>();
            list<String> list1 = new list<String>();
      list1.add(Controller.barcode = '01234567898');
      Controller.inventoryEntryNoESetId(list1);
@@ -3348,6 +2373,7 @@
      list1.add(Controller.barcode = '0112345678901231106789012105625001234');
      Controller.inventoryEntryNoESetId(list1);
      System.Test.stopTest();
    }
  }
@@ -3355,54 +2381,20 @@
  @isTest
  static void ArrivejancodeTest() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Oly_TriggerHandler.bypass('ConsumableAssetHander');
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -3411,32 +2403,12 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = 'Test001',
        Product2__c = prod01.Id
      );
      insert new List<Product2__c>{ pro1 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
            insert new Product2__c[] {pro1};
      // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
      // insert myAccount1;
      Consumable_order__c Order2 = new Consumable_order__c();
@@ -3518,6 +2490,7 @@
      Orderdet3.SerialLotNo__c = '5ZK';
      //Orderdet3.Box_Piece__c = '个';
      //出库产品
      Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
      Orderdet4.Name = 'OCM_01_001005';
@@ -3548,13 +2521,9 @@
      Orderdet5.Box_Piece__c = '盒';
      Orderdet5.TracingCode__c = 'BXJRE';
      Orderdet5.SerialLotNo__c = '5ZK';
      insert new List<Consumable_order_details2__c>{
        Orderdet1,
        Orderdet2,
        Orderdet3,
        Orderdet4,
        Orderdet5
      };
            insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5};
      ArriveGoodsController Controller = new ArriveGoodsController();
      PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
@@ -3566,12 +2535,11 @@
      Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BXsys';
      Controller.SearchPro();
      System.assertEquals(
        'OCM_01_001002',
        controller.ConsumableorderdetailsRecords[0].esd.Name
      );
            System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name);
      // System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size());
      System.Test.stopTest();
    }
  }
@@ -3579,54 +2547,20 @@
  @isTest
  static void ArriveotheragencyTest() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Oly_TriggerHandler.bypass('ConsumableAssetHander');
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -3635,37 +2569,13 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = 'Test001',
        Product2__c = prod01.Id
      );
      insert new List<Product2__c>{ pro1 };
      Account myAccount3 = new Account(
        name = 'Testaccount003',
        Dealer_discount__c = 30,
        RecordTypeId = rectCo[0].Id
      );
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
            insert new Product2__c[] {pro1};
            Account myAccount3 = new Account(name='Testaccount003',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
      insert myAccount3;
      Consumable_order__c Order2 = new Consumable_order__c();
      Order2.Name = 'OCM_02_001';
@@ -3763,6 +2673,7 @@
      // Orderdet3.SerialLotNo__c = '5ZK';
      // //Orderdet3.Box_Piece__c = '个';
      // //出库产品
      // Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
      // Orderdet4.Name = 'OCM_01_001005';
@@ -3795,6 +2706,8 @@
      // Orderdet5.SerialLotNo__c = '5ZK';
      // insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5};
      ArriveGoodsController Controller = new ArriveGoodsController();
      PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
      System.Test.setCurrentPage(page);
@@ -3808,6 +2721,8 @@
      // System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size());
      System.Test.stopTest();
    }
  }
@@ -3815,54 +2730,21 @@
  @isTest
  static void addInventoryDetails1() {
    // // TO DO: implement unit test
    List<RecordType> rectCo = [
      SELECT Id
      FROM RecordType
      WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
    ];
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
    if (rectCo.size() == 0) {
      return;
    }
    // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)'];
    Profile prof = [
      SELECT Id
      FROM Profile
      WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
    ];
        Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
    Account myAccount2 = new Account(
      name = 'Testaccount002',
      Dealer_discount__c = 20,
      RecordTypeId = rectCo[0].Id,
      AgentCode_Ext__c = '9999900'
    );
    Account myAccount1 = new Account(
      name = 'Testaccount001',
      Dealer_discount__c = 30,
      RecordTypeId = rectCo[0].Id
    );
    insert new List<account>{ myAccount1, myAccount2 };
    Contact core = new Contact(
      email = 'jplumber@salesforce.com',
      firstname = 'Joe',
      lastname = 'Plumber',
      accountid = myAccount1.id
    );
        Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
        Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
        insert new account[]{myAccount1,myAccount2};
        Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
    insert core;
    user MyUser_Test = new User(
      ContactId = core.id,
      Alias = 'newUser',
      Email = 'newuser@testorg.com',
      EmailEncodingKey = 'UTF-8',
      LastName = 'TestUser',
      LanguageLocaleKey = 'zh_CN',
      LocaleSidKey = 'zh_CN',
      ProfileId = prof.Id,
      TimeZoneSidKey = 'Asia/Shanghai',
      UserName = 'testUser@testorg.com',
      UserPro_Type__c = 'ET'
    );
        user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
    System.runAs(new User(Id = UserInfo.getUserId())) {
      insert MyUser_Test;
    }
@@ -3871,37 +2753,13 @@
    // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
    // insert new Product2[] {prod01,prod02};
    System.runAs(MyUser_Test) {
      Product2 prod01 = new Product2(
        Name = 'Test01',
        ProductCode = 'Test01',
        Asset_Model_No__c = 'Test01',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200311',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      Product2 prod02 = new Product2(
        Name = 'Test02',
        ProductCode = 'Test02',
        Asset_Model_No__c = 'Test02',
        SFDA_Status__c = '有効',
        JANCODE__c = '04953170200312',
        Dealer_special_Object__c = true,
        Manual_Entry__c = false
      );
      insert new List<Product2>{ prod01, prod02 };
      Product2__c pro1 = new Product2__c(
        Name = 'Pro001',
        OT_CODE_Text__c = 'Test001',
        Product2__c = prod01.Id
      );
      Product2__c pro2 = new Product2__c(
        Name = 'Pro002',
        OT_CODE_Text__c = 'Test002',
        Product2__c = prod02.Id
      );
      insert new List<Product2__c>{ pro1, pro2 };
        system.runAs(MyUser_Test){
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
            insert new Product2[] {prod01,prod02};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
            Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
            insert new Product2__c[] {pro1, pro2};
      //订单
      Oly_TriggerHandler.bypass('ConsumableAssetHander');
      Consumable_order__c Order1 = new Consumable_order__c();
@@ -4021,15 +2879,7 @@
      Orderdet7.Box_Piece__c = '个';
      Orderdet7.TracingCode__c = 'BXJQT';
      insert new List<Consumable_order_details2__c>{
        Orderdet1,
        Orderdet2,
        Orderdet3,
        Orderdet4,
        Orderdet5,
        Orderdet6,
        Orderdet7
      };
            insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdet7};
      PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
      System.Test.setCurrentPage(page);
      ArriveGoodsController Controller = new ArriveGoodsController();
@@ -4054,6 +2904,8 @@
      Controller.ToReturnGoodsPage();
      Controller.geterrorsize();
      System.Test.stopTest();
    }
  }
}
force-app/main/default/classes/DealerInquiryModifyStateController.cls
@@ -51,6 +51,9 @@
    private String strColumus;
    private String strRtColumus;
    //add by Link 2023-6-2
    public String remindMsg{get;set;}
    @TestVisible private String accTypeForSort = null;
    private static Integer oppLimit = 500;
@@ -124,6 +127,7 @@
    }
    public PageReference init() {
        remindMsg = '';
        PartnerSoapSforceCom.Soap soap = new PartnerSoapSforceCom.Soap();
        soap.SessionHeader = new PartnerSoapSforceCom.SessionHeader_element();
        soap.SessionHeader.sessionId = UserInfo.getSessionId();
@@ -372,14 +376,22 @@
        //显示提示操作信息
        if (String.isBlank(this.saveType) && String.isBlank(this.sortKey)) {
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '取得最近的 ' + oppCount + ' 条数据'));
            //add by Link 2023-6-2
            remindMsg = '取得最近的 ' + oppCount + ' 条数据';
        } else if (!String.isBlank(this.sortKey)) {
            if (oppCount > oppLimit) {
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '数据超过' + oppLimit + '件,只显示前' + oppLimit + '件'));
                //add by Link 2023-6-2
                remindMsg = '数据超过' + oppLimit + '件,只显示前' + oppLimit + '件';
            } else {
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '共有 ' + oppCount + ' 条数据'));
                //add by Link 2023-6-2
                remindMsg = '共有 ' + oppCount + ' 条数据';
            }
        } else {
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '共有 ' + oppCount + ' 条数据'));
            //add by Link 2023-6-2
            remindMsg = '共有 ' + oppCount + ' 条数据';
        }
    }
    //检索条件:数据字段1,数据字段2,数据字段3均满足进入此方法 判断多种情况
@@ -566,6 +578,8 @@
            //     update updOpps;
            // }
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '保存完了'));
            //add by Link 2023-6-2
            remindMsg = '保存完了';
        } catch (Exception e) {
            //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '请确定科室分类和产品区分的关系'));
        }
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 List<String>{ 'Product2__c.Name' };
    private static String[] columus = new 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,18 +62,7 @@
            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
@@ -119,13 +108,7 @@
    }
    @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;
@@ -154,14 +137,7 @@
            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,28 +19,17 @@
        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];
@@ -49,31 +38,17 @@
                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]));
                }
@@ -82,9 +57,7 @@
                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
            }
@@ -120,14 +93,11 @@
            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 = '订单不完全到货,无法出库';
@@ -188,6 +158,7 @@
        @AuraEnabled
        public String prodName;
        // 已存在消耗品明细用
        public ConsumableorderdetailsInfo(Consumable_order_details2__c e) {
            esd = 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 { get; set; }
    public static String alertMessage {set;get;}
    //拆盒明细件数
    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,11 +64,12 @@
        res.code = 200;
        System.debug('res = ' + res);
        return res;
    }
    // 将页面或取得BarCode去掉重复的,转换成List
    public static List<String> ParseBarCode(String Code) {
        String[] Cache = new List<String>{};
        String[] Cache = new String[]{};
        Cache = Code.split('\n');
        Set<String> Buff = new Set<String>();
        for (String A : Cache) {
@@ -84,12 +85,7 @@
    //获取明细
    @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;
@@ -101,13 +97,15 @@
        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是否为空
@@ -124,37 +122,22 @@
        // 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)) {
@@ -169,39 +152,26 @@
        }
        //没有拆盒
        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)) {
@@ -216,38 +186,25 @@
        }
        //已出货,未到货
        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)) {
@@ -262,38 +219,25 @@
        }
        //拆盒已出货
        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)) {
@@ -308,38 +252,25 @@
        }
        //拆盒已销售
        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)) {
@@ -354,36 +285,23 @@
        }
        //拆盒返品
        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)) {
@@ -397,36 +315,24 @@
            }
        }
        //拆盒后盘点过(盘点日期不为空)
        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)) {
@@ -441,35 +347,21 @@
        }
        //不同工作地
        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)) {
@@ -483,9 +375,7 @@
            }
        }
        reSet = [
            SELECT
                Id,
        reSet = [SELECT Id,
                Name,
                Intra_Trade_List_RMB__c,
                Asset_Model_No__c,
@@ -510,28 +400,29 @@
            /*,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);
                }
@@ -561,16 +452,12 @@
        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;
@@ -578,12 +465,10 @@
        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) {
@@ -599,8 +484,7 @@
        try {
            //取得通番大于001的在库明细
            List<Consumable_order_details2__c> orderDetails2del = [
                SELECT
            List<Consumable_order_details2__c> orderDetails2del =  [SELECT
                    Id,
                    Box_Piece__c,
                    RemoveBox_date__c,
@@ -611,19 +495,18 @@
                /*,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>();
@@ -639,34 +522,32 @@
            }
            //取得通番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) {
@@ -713,6 +594,7 @@
        }
    }
    class ConsumableorderdetailsInfo implements Comparable {
        public Consumable_order_details2__c esd { get; set; }
        public Product2__c Prod { get; set; }
force-app/main/default/classes/LexConInvoiceViewController.cls
@@ -388,11 +388,7 @@
        //         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]));
@@ -428,6 +424,7 @@
        System.debug('res = ' + res);
        return res;
    }
    //保存
    @AuraEnabled
@@ -536,6 +533,7 @@
                }
            } 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');
@@ -554,9 +552,7 @@
                        (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);
                    }
                }
@@ -853,8 +849,6 @@
                    delete invoiceLinkdetList;
                }
                //新建发票明细1
                System.debug('===>' + chukudanID);
                System.debug('===>' + chukudanID.size());
                if (chukudanID.size() > 0) {
                    newinvoicedetails1(chukudanID);
                }
@@ -1305,16 +1299,7 @@
    // 检索(未开发票出库单)
    @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>();
@@ -1444,11 +1429,7 @@
    // 提交按钮
    @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>();
@@ -1520,8 +1501,6 @@
                        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;
@@ -1542,8 +1521,6 @@
                    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(
@@ -1557,16 +1534,7 @@
                    //     )
                    // );
                    // 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);
@@ -1602,7 +1570,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,7 +101,6 @@
            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]));
        }
@@ -154,10 +153,7 @@
        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);
@@ -356,7 +352,6 @@
    }
    // Data Bean
    @TestVisible
    class ConsumableorderdetailsInfo {
        @AuraEnabled
        public Boolean check { get; set; }
@@ -384,11 +379,10 @@
            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,6 +277,7 @@
                    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,15 +1,16 @@
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;
    }
@@ -21,4 +22,6 @@
        ];
        return saleAmountList;
    }
}
force-app/main/default/classes/LexConsumableController.cls
@@ -241,7 +241,8 @@
            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
@@ -263,9 +264,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);
@@ -329,7 +330,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
@@ -381,16 +382,7 @@
                }
                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();
@@ -551,21 +543,10 @@
                //         attachmentRecoeds.add(new ConsumableorderdetailsInfo(attachmentinfo[i]));
                //     }
                // }
                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
                    ];
                List<ContentVersion> cvInfo = [SELECT Id, Title, OwnerId,Owner.Name, CreatedDate,ContentDocumentId FROM ContentVersion WHERE FirstPublishLocationId = :ESetId];
                    if (cvInfo.size() > 0) {
                        for (Integer i = 0; i < cvInfo.size(); i++) {
                            attachmentRecoeds.add(new ConsumableorderdetailsInfo(cvInfo[i]));
                        }
                    }
                }
                //
@@ -968,10 +949,7 @@
        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 {
@@ -1640,20 +1618,7 @@
        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);
    }
    //保存按钮
@@ -1687,10 +1652,7 @@
        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(',', ''));
@@ -1711,7 +1673,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
            ];
@@ -1766,10 +1728,9 @@
            }
            //=======================================医院特价,有金额的话取金额
            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) {
@@ -1856,7 +1817,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()
@@ -1933,10 +1894,7 @@
                                //医院特价
                                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);
                                }
@@ -2029,10 +1987,7 @@
                                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);
                                }
@@ -2070,7 +2025,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];
@@ -2162,6 +2117,7 @@
        @AuraEnabled
        public Decimal consumableCount { get; set; }
        // 已存产品明细
        public ConsumableorderdetailsInfo(Consumable_Orderdetails__c e) {
            check = true;
force-app/main/default/classes/LexConsumableGoodsInfo.cls
@@ -1,4 +1,5 @@
public without sharing class LexConsumableGoodsInfo {
    //所有产品一览
    @AuraEnabled
    public static Results initTotalNum(String ordId, String type) {
@@ -11,11 +12,9 @@
        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;
@@ -23,32 +22,9 @@
                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;
@@ -58,11 +34,7 @@
            }
            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) {
@@ -98,11 +70,7 @@
        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);
@@ -111,12 +79,9 @@
            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]));
            }
@@ -136,11 +101,9 @@
        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;
@@ -150,32 +113,9 @@
            //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];
@@ -192,24 +132,9 @@
            //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];
@@ -221,12 +146,9 @@
            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]));
@@ -246,12 +168,10 @@
        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]));
            }
@@ -271,11 +191,9 @@
        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;
@@ -285,32 +203,9 @@
            //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];
@@ -323,28 +218,13 @@
                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];
@@ -356,12 +236,9 @@
            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]));
@@ -386,11 +263,7 @@
            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);
@@ -399,22 +272,17 @@
            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]));
            }
@@ -422,11 +290,8 @@
            // 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]));
            // }
@@ -481,11 +346,9 @@
        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;
@@ -495,32 +358,9 @@
            //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];
@@ -537,20 +377,9 @@
            //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];
@@ -562,22 +391,15 @@
            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) {
@@ -619,19 +441,15 @@
        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]));
@@ -652,11 +470,9 @@
        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;
@@ -666,32 +482,9 @@
            //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());
@@ -711,26 +504,11 @@
            //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
@@ -743,20 +521,15 @@
            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]));
@@ -780,14 +553,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,8 +20,7 @@
    public static Boolean done { get; set; }
    /*****************画面表示Bean******************/
    //页面主数据显示用
    // private static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords;
    public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords;
    private 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>();
@@ -32,7 +31,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;
@@ -75,21 +74,13 @@
    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);
@@ -122,6 +113,8 @@
    // 画面初始化
    @AuraEnabled
    public static ResponseBodyLWC init() {
        ResponseBodyLWC res = new ResponseBodyLWC();
        Map<String, object> data = new Map<String, object>();
        res.entity = data;
@@ -130,21 +123,13 @@
        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();
@@ -157,7 +142,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;
@@ -185,40 +170,33 @@
        //     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]);
@@ -231,11 +209,9 @@
        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;
@@ -243,9 +219,7 @@
                    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;
@@ -255,10 +229,7 @@
                }
            } 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;
@@ -266,9 +237,7 @@
                    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;
@@ -299,6 +268,10 @@
        }
        //consumableorderdetailsCount = consumableorderdetailsRecords.size();
        listCut();
        data.put('ConsumableorderdetailsRecordsview', JSON.serialize(ConsumableorderdetailsRecordsview));
        data.put('userWorkLocation', userWorkLocation);
@@ -345,7 +318,7 @@
    //========20160311======ADD_Start================================
    public static List<String> ParseBarCode(String Code) {
        Map<String, Integer> barcodeCountMap = new Map<String, Integer>();
        String[] Cache = new List<String>{};
        String[] Cache = new String[]{};
        Cache = Code.split('\n');
        List<String> Buff = new List<String>();
        for (String A : Cache) {
@@ -358,7 +331,10 @@
            Buff.add(A + barcodeCountMap.get(A));
        }
        return Buff;
    }
    //test
@@ -369,27 +345,14 @@
    //========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();
@@ -397,9 +360,9 @@
        res.entity = data;
        sqlagencyProType = '%' + agencyProType + '%';
        System.debug('sqlagencyProType==>' + sqlagencyProType);
        System.debug('accountName==>' + accountName);
        System.debug('userWorkLocation==>' + userWorkLocation);
        /* BarCodelist做成 */
        //FIXME barcodeSet 做成,ProductCount_ResSet 做成
@@ -407,34 +370,22 @@
        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
        ];
        System.debug('ProductCount_Res==>' + ProductCount_Res);
                            AND  Dealer_Info_text__c = :accountName ];
        reFindProduct.clear();
        Map<String, ConsumableorderdetailsInfo> barCodeListAdjustMap = new Map<String, ConsumableorderdetailsInfo>();
        //barCodeListLoseMap.clear();
@@ -457,14 +408,11 @@
                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]));
@@ -476,65 +424,47 @@
            }
            //已经出库的产品
            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) {
@@ -545,33 +475,21 @@
                                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--;
@@ -590,21 +508,13 @@
            }
            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();
@@ -614,17 +524,15 @@
            }
            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);
            }
@@ -679,7 +587,10 @@
            res.status = 'Success1';
            return res;
        }
        //CHAN-B7J4NB 只有一个时,盘点不到
        //init();
@@ -691,23 +602,21 @@
        // 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 记录需要销存数量
@@ -730,52 +639,34 @@
                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);
@@ -791,40 +682,28 @@
                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
@@ -858,22 +737,18 @@
            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;
@@ -881,9 +756,7 @@
                        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;
@@ -893,10 +766,7 @@
                    }
                } 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;
@@ -904,9 +774,7 @@
                        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;
@@ -957,29 +825,19 @@
            }
        }
        //已经出库的产品
        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);
@@ -1015,23 +873,12 @@
                            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;
                        }
@@ -1043,22 +890,12 @@
                // 同时存在其他经销商库存产品
                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;
                        }
                    }
@@ -1067,9 +904,7 @@
                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;
                        }
@@ -1107,6 +942,7 @@
            }
        }
        //寻回做成
        for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecords) {
            for (ConsumableorderdetailsInfo adjust : consumableorderdetailsRecordsAdjust) {
@@ -1122,37 +958,28 @@
            }
        }
        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);
        }
@@ -1212,18 +1039,8 @@
    // 保存按钮
    @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;
@@ -1281,9 +1098,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) {
@@ -1312,21 +1129,13 @@
            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;
@@ -1355,6 +1164,7 @@
            if (InsListUp.size() > 0) {
                ControllerUtil.updateOrderDetailsSatus(InsListUp); // Commented By DTT - Li Jun for testing 20230407
            }
        } catch (Exception e) {
            Database.rollback(sp);
            // ApexPages.addMessages(ex);
@@ -1399,7 +1209,6 @@
    }
    // Data Bean
    @TestVisible
    class ConsumableorderdetailsInfo implements Comparable {
        @AuraEnabled
        public Boolean check { get; set; }
@@ -1432,6 +1241,7 @@
        @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,59 +31,38 @@
        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 { get; set; }
    public static List<String> orderDetZaikuList{set;get;}
    // 产品 ID
    public static String ESetId { get; set; }
    public static String idCheck { get; set; }
@@ -98,6 +98,7 @@
        categoryOptionMap = new Map<String, String>();
        category4OptionMap = new Map<String, String>();
        category5OptionMap = new Map<String, String>();
        // 取用户ID
        String userId = UserInfo.getUserId();
@@ -239,7 +240,9 @@
                }
                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;
@@ -627,7 +630,9 @@
                    }
                    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;
@@ -657,7 +662,9 @@
                    }
                    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;
@@ -932,6 +939,7 @@
    //     pageRecords.sort();
    // }
    //检索sql文做成
    private static String makeSoql(String CateName, String CateCode, String Category3, String Category4, String Category5) {
        System.debug('orderDetZaikuList = ' + orderDetZaikuList);
force-app/main/default/classes/LexLicenceReminderController.cls
@@ -1,4 +1,5 @@
public without sharing class LexLicenceReminderController {
    @AuraEnabled
    public static Results initReminder() {
        Results results = new Results();
force-app/main/default/classes/LexOutboundorderImportController.cls
@@ -50,7 +50,6 @@
        res.status = 'Success';
        res.code = 200;
        res.msg = '';
        System.debug('res:' + res);
        return res;
    }
@@ -103,7 +102,7 @@
                            barcodePieceMap.put(csvRecordData[6], Integer.valueOf(csvRecordData[7]));
                        }
                    }
                    String[] csvRecordDataStr = new String[13];
                    String[] csvRecordDataStr = new List<String>(13);
                    for (Integer j = 0; j < csvRecordData.size(); j++) {
                        csvRecordDataStr[j] = csvRecordData[j];
                    }
@@ -754,7 +753,9 @@
                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;
@@ -863,7 +864,7 @@
            return null;
        }
    }
    @TestVisible
    class ConsumableorderdetailsInfo implements Comparable {
        @AuraEnabled
        public Consumable_order__c order { get; set; }
force-app/main/default/classes/LexOverdueStockController.cls
@@ -1,4 +1,5 @@
public with sharing class LexOverdueStockController {
    /*****************検索用******************/
    public static String barcode { get; set; }
@@ -28,6 +29,7 @@
    }
    public LexOverdueStockController() {
    }
    // 画面初始化
@@ -40,7 +42,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)) {
@@ -49,23 +51,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));
@@ -81,17 +83,12 @@
        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;
@@ -103,8 +100,9 @@
        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>();
@@ -115,33 +113,22 @@
            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>();
@@ -175,42 +162,27 @@
        // 输入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, '过期库存销存'));
@@ -236,6 +208,7 @@
        return res;
    }
    // 保存按钮
    @AuraEnabled
    public static ResponseBodyLWC save(Boolean iSinventory, string saveCodPageRecords, List<Consumable_order_details2__c> saveoverdueList) {
@@ -254,14 +227,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, '请先录入BarCode', '');
            return new ResponseBodyLWC('Error',500, '请先点击获取明细', '');
            // return null;
        }
        integer Lo = 0;
@@ -289,7 +262,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();
@@ -318,10 +291,12 @@
                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);
@@ -338,7 +313,7 @@
    // 将页面或取得BarCode去掉重复的,转换成List
    public static List<String> ParseBarCode(String Code) {
        Map<String, Integer> barcodeCountMap = new Map<String, Integer>();
        String[] Cache = new List<String>{};
        String[] Cache = new String[]{};
        Cache = Code.split('\n');
        List<String> Buff = new List<String>();
        for (String A : Cache) {
force-app/main/default/classes/LexProductLimitEditController.cls
@@ -37,19 +37,18 @@
            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 { get; set; }
    public static String alertMessage {set;get;}
    //拆盒明细件数
    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,8 +43,9 @@
        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;
@@ -70,7 +71,7 @@
    // 将页面或取得BarCode去掉重复的,转换成List
    public static List<String> ParseBarCode(String Code) {
        String[] Cache = new List<String>{};
        String[] Cache = new String[]{};
        Cache = Code.split('\n');
        Set<String> Buff = new Set<String>();
        for (String A : Cache) {
@@ -86,12 +87,8 @@
    //获取明细
    @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;
@@ -102,10 +99,12 @@
        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>();
@@ -126,33 +125,18 @@
        // 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)) {
@@ -166,34 +150,21 @@
            }
        }
        //未到货
        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)) {
@@ -208,35 +179,22 @@
        }
        //已规格=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)) {
@@ -250,32 +208,19 @@
            }
        }
        //已出货
        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)) {
@@ -290,31 +235,18 @@
        }
        //已销售
        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)) {
@@ -329,34 +261,21 @@
        }
        //已拆盒
        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)) {
@@ -371,32 +290,18 @@
        }
        // 已经取消
        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)) {
@@ -411,36 +316,22 @@
        }
        // 工作地不同
        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)) {
@@ -454,9 +345,9 @@
            }
        }
        reSet = [
            SELECT
                Id,
        reSet = [SELECT Id,
                Name,
                Intra_Trade_List_RMB__c,
                Asset_Model_No__c,
@@ -480,26 +371,27 @@
                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);
                }
@@ -522,6 +414,7 @@
            return new ResponseBodyLWC('Error', 500, 'BarCode' + notInlist + '不存在', '');
        }
        data.put('ConsumableorderdetailsRecordsdummy', JSON.serialize(ConsumableorderdetailsRecordsdummy));
        data.put('ConsumableorderdetailsRecordserror', JSON.serialize(ConsumableorderdetailsRecordserror));
        data.put('dataSize', ConsumableorderdetailsRecordsdummy.size());
@@ -529,16 +422,12 @@
        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;
@@ -546,12 +435,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) {
@@ -567,8 +456,7 @@
        try {
            //取得在库信息
            List<Consumable_order_details2__c> orderDetails2 = [
                SELECT
            List<Consumable_order_details2__c> orderDetails2 =  [SELECT
                    Id,
                    Name,
                    Bar_Code__c,
@@ -599,25 +487,24 @@
                    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>();
@@ -663,6 +550,7 @@
            if (orderDetails2ins.size() > 0) {
                insert orderDetails2ins;
            }
            saveFLGbln = true;
@@ -681,6 +569,7 @@
        }
    }
    class ConsumableorderdetailsInfo implements Comparable {
        @AuraEnabled
        public Consumable_order_details2__c esd { get; set; }
force-app/main/default/classes/LexSaleAndDeliveryController.cls
force-app/main/default/classes/LexSaleOrderController.cls
@@ -201,7 +201,6 @@
        //BarCodelist做成
        barCodeListP = ParseBarCode(barcode);
        System.debug('barCodeListP:' + barCodeListP);
        //针对所有商品到货确认
        reSet1 = [
            SELECT
@@ -236,7 +235,6 @@
                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>();
@@ -244,7 +242,6 @@
            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);
@@ -1079,12 +1076,7 @@
        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);
@@ -1273,7 +1265,6 @@
        return consumableorderdetails2Nobox.size();
    }
    @TestVisible
    class ConsumableorderdetailsInfo implements Comparable {
        @AuraEnabled
        public Consumable_orderdetails__c orderdetails1 { get; set; }
force-app/main/default/classes/LexSearchContractController.cls
@@ -9,22 +9,14 @@
            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;
@@ -51,6 +43,7 @@
    }
    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,4 +1,5 @@
public without sharing class LexSearchHospitalController {
    @AuraEnabled
    public static Results init() {
        Results results = new Results();
force-app/main/default/classes/LexSummonsCreatController.cls
@@ -245,13 +245,7 @@
    // 画面初始化
    @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;
@@ -2128,7 +2122,11 @@
                    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) +
                        ' 的特价',
                        ''
                    );
                }
@@ -2185,10 +2183,7 @@
                    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 (
@@ -2220,7 +2215,9 @@
                                return new ResponseBodyLWC(
                                    'Error',
                                    500,
                                    '消耗品' + ass.orderdetails1.Consumable_Product__r.Name__c + '库存不足',
                                    '消耗品' +
                                    ass.orderdetails1.Consumable_Product__r.Name__c +
                                    '库存不足',
                                    ''
                                );
                            }
@@ -2236,7 +2233,9 @@
                                return new ResponseBodyLWC(
                                    'Error',
                                    500,
                                    '消耗品' + ass.orderdetails1.Consumable_Product__r.Name__c + '库存不足',
                                    '消耗品' +
                                    ass.orderdetails1.Consumable_Product__r.Name__c +
                                    '库存不足',
                                    ''
                                );
                            }
@@ -2342,10 +2341,7 @@
                        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 (
@@ -2371,7 +2367,9 @@
                                return new ResponseBodyLWC(
                                    'Error',
                                    500,
                                    '消耗品' + ass.orderdetails1.Consumable_Product__r.Name__c + '库存不足',
                                    '消耗品' +
                                    ass.orderdetails1.Consumable_Product__r.Name__c +
                                    '库存不足',
                                    ''
                                );
                            }
@@ -2386,7 +2384,9 @@
                                return new ResponseBodyLWC(
                                    'Error',
                                    500,
                                    '消耗品' + ass.orderdetails1.Consumable_Product__r.Name__c + '库存不足',
                                    '消耗品' +
                                    ass.orderdetails1.Consumable_Product__r.Name__c +
                                    '库存不足',
                                    ''
                                );
                            }
@@ -2561,6 +2561,7 @@
        //     ];
        // }
        Date today = Date.today();
        //Date today = Date.newInstance(2023, 3, 1);
        Integer thisMonth = today.month();
@@ -2579,7 +2580,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) {
@@ -2692,7 +2693,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) {
@@ -2775,7 +2776,6 @@
    }
    // Data Bean
    @TestVisible
    class ConsumableorderdetailsInfo implements Comparable {
        @AuraEnabled
        public Boolean check { get; set; }
@@ -2916,7 +2916,6 @@
        }
    }
    @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 List<String>{ 'Product2__c.Name__c' };
    private static String[] orderby = new String[]{ 'Product2__c.Name__c'};
    //产品上下限
    public static String[] proLimitAndDate = new List<String>{};
    public static String[] proLimitAndDate =new String[]{};
    public static String product_Limit;
    //库存产品最早有效期限
    private static Map<String, Date> productkucun = new Map<String, Date>();
@@ -79,35 +79,18 @@
            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 {
@@ -155,35 +138,18 @@
            }
            //经销商·基本信息获取
            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 {
@@ -203,30 +169,25 @@
            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,
@@ -237,16 +198,14 @@
                    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,
@@ -257,18 +216,16 @@
                    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>();
@@ -281,10 +238,7 @@
                        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;
@@ -312,10 +266,7 @@
                        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;
@@ -411,6 +362,7 @@
                if (bss.hospitalSpecialOffer) {
                    ishos = ishos + 1;
                }
            }
            if (ishos > 0) {
                hasHos = true;
@@ -484,15 +436,13 @@
        //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>();
@@ -527,14 +477,7 @@
        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 + '\' ';
@@ -583,12 +526,8 @@
        }
        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));
            }
        }
    }
@@ -596,29 +535,20 @@
    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)) {
@@ -637,19 +567,17 @@
                }
            }
        }
        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]));
        }
@@ -744,6 +672,7 @@
            allnumber = 0;
            limitCount = 0;
            overlimitCount = 0;
        }
        public ConsumableorderdetailsInfo(AggregateResult e) {
@@ -809,5 +738,7 @@
        public List<ConsumableorderdetailsInfo> pageCodeRecords;
        @AuraEnabled
        public PaginatedAccounts paginatedAccounts;
    }
}
force-app/main/default/classes/LexUpAccountProLimit.cls
@@ -24,17 +24,23 @@
        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 List<String>{};
        String[] pro_List = new List<String>{};
        String[] proList =new String[]{};
        String[] pro_List =new 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) {
@@ -45,11 +51,9 @@
        //--------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 '
@@ -84,6 +88,7 @@
        }
        String productLimitDa = '';
        for (String str : productLimit.split(',')) {
            if (str != null && str != '') {
                productLimitDa += ',' + str;
            }
@@ -98,7 +103,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,4 +1,5 @@
public without sharing class LexUtility {
    //查询是否一直显示提示
    public static Boolean getIsNoteStay() {
        NoteStay__c noteStay = NoteStay__c.getInstance('NoteStay');
force-app/main/default/classes/ResponseBodyLWC.cls
@@ -9,8 +9,7 @@
    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,6 +6,7 @@
    @AuraEnabled
    public static List<Account> at { get; set; }
    @AuraEnabled
    public static ResponseBodyLWC init(String ctype) {
        ResponseBodyLWC res = new ResponseBodyLWC();
@@ -18,12 +19,7 @@
            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);
@@ -49,13 +45,9 @@
    }
    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>00O0l000000zaGcEAI</value>
        <value>00O6D000000UPzaUAG</value>
    </labels>
    <labels>
        <fullName>View_Weekly_Report</fullName>
        <language>zh_CN</language>
        <protected>false</protected>
        <shortDescription>查看周报活动</shortDescription>
        <value>00O0l000000zo9aEAA</value>
        <value>00O6D000000UPzZUAW</value>
    </labels>
    <labels>
        <fullName>invoiceStart</fullName>
force-app/main/default/lwc/boxorpieceType/boxorpieceType.html
@@ -5,7 +5,6 @@
        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,13 +4,7 @@
            <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">
@@ -20,14 +14,7 @@
                </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,24 +27,18 @@
    }
    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,15 +1,5 @@
<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,6 +5,7 @@
    @api recordId;
    @api count;
    connectedCallback() {
        console.log('enter CustomOutboundCountComp');
        console.log('isDisable = ' + this.isDisable);
@@ -13,18 +14,16 @@
    }
    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,48 +1,23 @@
<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,20 +15,13 @@
    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;
@@ -37,19 +30,13 @@
    }
    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,8 +4,7 @@
        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,9 +4,6 @@
    @api shipmentAmount;
    connectedCallback() {
        console.log(
            '进入 CustomShipmentAmountComp shipmentAmount = ' +
                this.shipmentAmount
        );
        console.log('进入 CustomShipmentAmountComp shipmentAmount = ' + this.shipmentAmount);
    }
}
force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html
@@ -1,17 +1,6 @@
<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,11 +20,7 @@
                this.shipmentNumber = 0;
            } else {
                if (this.esdInvoiceProNotCount < this.shipmentNumber) {
                    this.showMyToast(
                        '错误',
                        '发票数量不能超过还没发票数量!',
                        'Error'
                    );
                    this.showMyToast('错误', '发票数量不能超过还没发票数量!', 'Error');
                    this.shipmentNumber = 0;
                }
            }
@@ -32,23 +28,18 @@
            //向下取整
            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) {
@@ -70,17 +61,10 @@
            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,16 +1,5 @@
<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,31 +11,24 @@
    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,15 +15,13 @@
    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,13 +1,8 @@
<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,13 +1,11 @@
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;
@@ -16,28 +14,20 @@
    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;
        let url =
            '/report/' +
            reportUrl +
            '?reportFilters=' +
            encodeURIComponent(reportFilters);
        console.log('reportUrl = ' + reportUrl);
        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,10 +2,7 @@
    <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>
@@ -14,14 +11,8 @@
    </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">
@@ -30,175 +21,91 @@
                    </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,23 +26,15 @@
                    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) {
@@ -55,18 +47,12 @@
            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,23 +1,12 @@
<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,20 +17,13 @@
    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/lexArriveGoods/lexArriveGoods.css
@@ -1 +1 @@
@import "c/lexCssUtility";
@import 'c/lexCssUtility';
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html
@@ -1,17 +1,18 @@
<template>
  <template if:true={showSpinner}>
    <lightning-spinner size="medium" variant="brand"></lightning-spinner>
        <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
        <div class="slds-spinner_container">
            <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
                <span class="slds-assistive-text">Loading</span>
                <div class="slds-spinner__dot-a"></div>
                <div class="slds-spinner__dot-b"></div>
            </div>
        </div>
  </template>
  <c-common-toast></c-common-toast>
  <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,43 +22,21 @@
        </lightning-layout>
        <!-- <p style="font-size: 16px;"><strong>入库/返品</strong></p> -->
      </div>
      <div style="padding: 10px">
            <div style="padding:10px;">
        <!-- 按钮 -->
        <template if:false={returnFLGbln}>
          <!-- <lightning-button style="margin: 5px;" label="到货确认" onclick={arriveGoodsConfim} disabled={saveFLGbln}></lightning-button> -->
          <button
            class="slds-button slds-button_neutral slds-button_stretch lexBorder"
            style="margin: 5px"
            label="到货确认"
            onclick={arriveGoodsConfim}
            disabled={saveFLGbln}
          >
            到货确认
          </button>
                    <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="到货确认" onclick={arriveGoodsConfim} disabled={saveFLGbln}>到货确认</button>
        </template>
        <template if:true={returnFLGbln}>
          <!-- <lightning-button style="margin: 5px;" label="登录返品" onclick={updateGoodsOfReturn}></lightning-button> -->
          <button
            class="slds-button slds-button_neutral slds-button_stretch lexBorder"
            style="margin: 5px"
            label="登录返品"
            onclick={updateGoodsOfReturn}
          >
            登录返品
          </button>
                    <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="登录返品" onclick={updateGoodsOfReturn}>登录返品</button>
        </template>
        <p style="height: 10px"></p>
                <p style="height: 10px;"></p>
        <!-- 订单信息 -->
        <template if:true={showOrderDetail}>
          <div
            style="
              border: 1px solid #d4d4d4;
              border-top: 3px solid #51606e;
              border-radius: 5px;
              margin-bottom: 7px;
            "
          >
            <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
                    <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">
@@ -67,53 +46,37 @@
              </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: 60px">
                      <div style="color: #696969; font-size: 12px">
                        订单名称
                      </div>
                                        <td  style="width:10px;"></td>
                                        <td style="width:60px;">
                                            <div style="color:#696969;font-size:12px;">订单名称</div>
                    </td>
                    <td style="width: 200px">
                      <lightning-formatted-text
                        value={coc.Name}
                      ></lightning-formatted-text>
                                        <td style="width:200px;">
                                            <lightning-formatted-text value={coc.Name}></lightning-formatted-text>
                    </td>
                    <td style="width: 30px"></td>
                    <td style="width: 60px">
                      <div style="color: #696969; font-size: 12px">
                        订单总数
                      </div>
                                        <td  style="width:30px;"></td>
                                        <td style="width:60px;">
                                            <div style="color:#696969;font-size:12px;">订单总数</div>
                    </td>
                    <td style="width: 100px">
                      <lightning-formatted-number
                        value={coc.Total_num__c}
                      ></lightning-formatted-number>
                                        <td style="width:100px;">
                                            <lightning-formatted-number value={coc.Total_num__c}></lightning-formatted-number>
                    </td>
                    <td style="width: 30px"></td>
                    <td style="width: 72px">
                      <div style="color: #696969; font-size: 12px">
                        已到货数量
                      </div>
                                        <td  style="width:30px;"></td>
                                        <td style="width:72px;">
                                            <div style="color:#696969;font-size:12px;">已到货数量</div>
                    </td>
                    <td style="width: 100px">
                      <lightning-formatted-number
                        value={coc.OrderNumber_arrived__c}
                      ></lightning-formatted-number>
                                        <td style="width:100px;">
                                            <lightning-formatted-number value={coc.OrderNumber_arrived__c}></lightning-formatted-number>
                    </td>
                    <td style="width: 30px"></td>
                    <td style="width: 84px">
                      <div style="color: #696969; font-size: 12px">
                        还没发货数量
                      </div>
                                        <td  style="width:30px;"></td>
                                        <td style="width:84px;">
                                            <div style="color:#696969;font-size:12px;">还没发货数量</div>
                    </td>
                    <td style="width: 100px">
                      <lightning-formatted-number
                        value={coc.OrderNumber_notarrive__c}
                      ></lightning-formatted-number>
                                        <td style="width:100px;">
                                            <lightning-formatted-number value={coc.OrderNumber_notarrive__c}></lightning-formatted-number>
                    </td>
                    <td></td>
                  </tr>
@@ -123,15 +86,8 @@
          </div>
        </template>
        <!-- BarCode录入 -->
        <div
          style="
            border: 1px solid #d4d4d4;
            border-top: 3px solid #51606e;
            border-radius: 5px;
            margin-bottom: 7px;
          "
        >
          <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
                <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">
@@ -141,33 +97,20 @@
            </lightning-layout>
            <!-- <p style="font-size: 16px;"><strong>BarCode录入</strong></p> -->
          </div>
          <div style="padding: 10px">
                    <div style="padding:10px;">
            <table>
              <tbody>
                <tr>
                  <td style="width: 20px"></td>
                  <td style="width: 60px; font-size: 16px">BarCode</td>
                  <td style="width: 30px"></td>
                  <td style="width: 600px">
                    <lightning-textarea
                      class="inputFont"
                      name="BarCode"
                      value={barcode}
                      label=""
                      variant="label-hidden"
                      onchange={barcodeChange}
                    ></lightning-textarea>
                                    <td style="width:20px;"></td>
                                    <td style="width:60px;font-size:16px;">BarCode</td>
                                    <td style="width:30px;"></td>
                                    <td style="width:600px;">
                                        <lightning-textarea  class="inputFont" name="BarCode" value={barcode} label="" variant="label-hidden" onchange={barcodeChange}></lightning-textarea>
                  </td>
                  <td style="width: 30px"></td>
                  <td style="width: 200px">
                                    <td style="width:30px;"></td>
                                    <td style="width:200px;">
                    <!-- <lightning-button label="获取明细" title="获取明细" onclick={barcodeEntrys} style="width: 300px;"></lightning-button> -->
                    <button
                      class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                      label="获取明细"
                      onclick={barcodeEntrys}
                    >
                      获取明细
                    </button>
                                        <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="获取明细" onclick={barcodeEntrys}>获取明细</button>
                  </td>
                  <td></td>
                </tr>
@@ -177,77 +120,32 @@
        </div>
        <!-- 警告提醒 -->
        <template if:true={hasWarning}>
          <div
            style="
              border: 1px solid #d4d4d4;
              border-radius: 5px;
              margin-bottom: 7px;
            "
          >
            <div
              style="
                border-bottom: 1px solid #d4d4d4;
                border-radius: 5px;
                margin-bottom: 7px;
                color: #ff6a00;
                font-size: 17px;
              "
            >
                    <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
                        <div style="border-bottom: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;color:#ff6a00;font-size:17px;">
              <lightning-icon icon-name="utility:warning"></lightning-icon>
              <strong>&nbsp;&nbsp;&nbsp;警告</strong>
            </div>
            <template for:each={warningMsgs} for:item="msg">
              <p
                key={msg}
                style="color: #ff6a00; padding-left: 7px; font-size: 14px"
              >
                &nbsp;&nbsp;&nbsp;・&nbsp;{msg}
              </p>
                            <p key={msg} style="color:#ff6a00;padding-left:7px;font-size:14px;">&nbsp;&nbsp;&nbsp;・&nbsp;{msg}</p>
            </template>
          </div>
        </template>
        <!-- 报错提醒 -->
        <template if:true={hasError}>
          <div
            style="
              border: 1px solid #d4d4d4;
              border-radius: 5px;
              margin-bottom: 7px;
            "
          >
            <div
              style="
                border-bottom: 1px solid #d4d4d4;
                border-radius: 5px;
                margin-bottom: 7px;
                color: red;
                font-size: 17px;
              "
            >
                    <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
                        <div style="border-bottom: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;color:red;font-size:17px;">
              <lightning-icon icon-name="utility:error"></lightning-icon>
              <strong>&nbsp;&nbsp;&nbsp;错误</strong>
            </div>
            <template for:each={errorMsgs} for:item="msg">
              <p
                key={msg}
                style="color: red; padding-left: 7px; font-size: 14px"
              >
                &nbsp;&nbsp;&nbsp;・&nbsp;{msg}
              </p>
                            <p key={msg} style="color:red;padding-left:7px;font-size:14px;">&nbsp;&nbsp;&nbsp;・&nbsp;{msg}</p>
            </template>
          </div>
        </template>
        <!-- 本次到货产品汇总 -->
        <template if:false={returnFLGbln}>
          <div
            style="
              border: 1px solid #d4d4d4;
              border-top: 3px solid #51606e;
              border-radius: 5px;
              margin-bottom: 7px;
            "
          >
            <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
                    <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">
@@ -257,28 +155,15 @@
              </lightning-layout>
              <!-- <p style="font-size: 16px;"><strong>本次到货产品汇总</strong></p> -->
            </div>
            <div style="padding: 10px">
              <lightning-datatable
                class="wrapped-header-datatable"
                hide-checkbox-column
                key-field="recordId"
                columns={currentArrProdCols}
                data={detailsSummary}
              ></lightning-datatable>
                        <div 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={currentArrProdCols} data={detailsSummary}></lightning-datatable>
            </div>
          </div>
        </template>
        <!-- 到货明细 -->
        <template if:false={returnFLGbln}>
          <div
            style="
              border: 1px solid #d4d4d4;
              border-top: 3px solid #51606e;
              border-radius: 5px;
              margin-bottom: 7px;
            "
          >
            <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
                    <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">
@@ -287,28 +172,15 @@
                </lightning-layout-item>
              </lightning-layout>
            </div>
            <div style="padding: 10px">
              <lightning-datatable
                class="wrapped-header-datatable"
                hide-checkbox-column
                key-field="recordId"
                columns={arrDetailCols}
                data={consumableorderdetailsRecordsview}
              ></lightning-datatable>
                        <div 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={arrDetailCols} data={consumableorderdetailsRecordsview}></lightning-datatable>
            </div>
          </div>
        </template>
        <!-- 返品明细 -->
        <template if:true={returnFLGbln}>
          <div
            style="
              border: 1px solid #d4d4d4;
              border-top: 3px solid #51606e;
              border-radius: 5px;
              margin-bottom: 7px;
            "
          >
            <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
                    <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">
@@ -317,16 +189,8 @@
                </lightning-layout-item>
              </lightning-layout>
            </div>
            <div style="padding: 10px">
              <c-lex-custom-lightning-datatable
                class="wrapped-header-datatable"
                hide-checkbox-column
                key-field="recordId"
                data={showGoodsofReturnListView}
                columns={returnDetailCols}
                onchangereturncount={returnCountChange}
                onchangevalue={returnReasonChange}
              ></c-lex-custom-lightning-datatable>
                        <div style="padding:10px;">
                            <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={showGoodsofReturnListView} columns={returnDetailCols} onchangereturncount={returnCountChange} onchangevalue={returnReasonChange}></c-lex-custom-lightning-datatable>
            </div>
          </div>
        </template>
@@ -346,15 +210,8 @@
                    </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">
@@ -364,14 +221,8 @@
            </lightning-layout>
            <!-- <p style="font-size: 16px;"><strong>错误明细</strong></p> -->
          </div>
          <div style="padding: 10px">
            <lightning-datatable
              class="wrapped-header-datatable"
              hide-checkbox-column
              key-field="recordId"
              columns={errorDetailCols}
              data={consumableorderdetailsRecordserror}
            ></lightning-datatable>
                    <div 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={errorDetailCols} data={consumableorderdetailsRecordserror}></lightning-datatable>
          </div>
        </div>
      </div>
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
@@ -1,11 +1,11 @@
import { LightningElement, wire, track } from "lwc";
import { CurrentPageReference } from "lightning/navigation";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import { NavigationMixin } from "lightning/navigation";
import init from "@salesforce/apex/LexArriveGoodsController.init";
import searchProduct from "@salesforce/apex/LexArriveGoodsController.searchProduct";
import arriveGoodsConfim from "@salesforce/apex/LexArriveGoodsController.arriveGoodsConfim";
import updateGoodsOfReturn from "@salesforce/apex/LexArriveGoodsController.updateGoodsOfReturn";
import { LightningElement,wire,track } from 'lwc';
import { CurrentPageReference } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
import init from '@salesforce/apex/LexArriveGoodsController.init';
import searchProduct from '@salesforce/apex/LexArriveGoodsController.searchProduct';
import arriveGoodsConfim from '@salesforce/apex/LexArriveGoodsController.arriveGoodsConfim';
import updateGoodsOfReturn from '@salesforce/apex/LexArriveGoodsController.updateGoodsOfReturn';
//table css
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
@@ -64,283 +64,82 @@
  //本次到货产品汇总cols
  @track currentArrProdCols = [
    {
      label: "产品型号",
      fieldName: "assetModelNo",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 220
    },
    {
      label: "产品名称",
      fieldName: "prodName",
      hideDefaultActions: true,
      wrapText: true
    },
    {
      label: "到货数量",
      fieldName: "arrivedCount",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 220,
      cellAttributes: { alignment: "right" }
    },
    {
      label: "到货金额",
      type: "number",
      typeAttributes: { minimumFractionDigits: 2 },
      fieldName: "arriveAmount",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 220,
      cellAttributes: { alignment: "right" }
    }
        {label:'产品型号' , fieldName:'assetModelNo', hideDefaultActions: true,wrapText:true,initialWidth:220},
        {label:'产品名称' , fieldName:'prodName', hideDefaultActions: true,wrapText:true},
        {label:'到货数量' , fieldName:'arrivedCount', hideDefaultActions: true,wrapText:true,initialWidth:220,cellAttributes: { alignment: "right" }},
        {label:'到货金额' ,type:'number',typeAttributes:{minimumFractionDigits: 2}, fieldName:'arriveAmount', hideDefaultActions: true,wrapText:true,initialWidth:220,cellAttributes: { alignment: "right" }}
  ];
  //到货明细cols
  @track arrDetailCols = [
    {
      label: "消耗品名称",
      fieldName: "prodName",
      hideDefaultActions: true,
      wrapText: true
    },
    {
      label: "规格",
      fieldName: "productPackingListManual",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 120,
      cellAttributes: { alignment: "right" }
    },
    {
      label: "CFDA状态",
      fieldName: "status",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 120
    },
    {
      label: "注册证编码号",
      fieldName: "reportProductApprobation",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 180
    },
    {
      label: "注册证效期",
      fieldName: "ReportProductExpirationDate",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 100
    },
    {
      label: "BarCode",
      fieldName: "barCode",
      hideDefaultActions: true,
      wrap: true,
      initialWidth: 400
    }
        {label:'消耗品名称' , fieldName:'prodName', hideDefaultActions: true,wrapText:true},
        {label:'规格' , fieldName:'productPackingListManual', hideDefaultActions: true,wrapText:true,initialWidth:55,cellAttributes: { alignment: "right" }},
        {label:'CFDA状态' , fieldName:'status', hideDefaultActions: true,wrapText:true,initialWidth:120},
        {label:'注册证编码号' , fieldName:'reportProductApprobation', hideDefaultActions: true,wrapText:true,initialWidth:190},
        {label:'注册证效期' , fieldName:'ReportProductExpirationDate', hideDefaultActions: true,wrapText:true,initialWidth:110},
        {label:'BarCode' , fieldName:'barCode', hideDefaultActions: true,wrapText:true,initialWidth:400}
  ];
  //返品明细cols
  get returnDetailCols() {
    var cols = [];
    cols.push({
      label: "出库单",
      fieldName: "orderUrl",
      type: "url",
      typeAttributes: { label: { fieldName: "orderNo" }, target: "_blank" },
      hideDefaultActions: true,
      wrapText: true
    });
        cols.push({label:'出库单',fieldName:'orderUrl',type:'url',typeAttributes:{label:{fieldName:'orderNo'},target: "_blank"},hideDefaultActions: true,wrapText:true,initialWidth:180});
    // cols.push({label:'出库单' , fieldName:'orderNo', hideDefaultActions: true});
        cols.push({label:'出库日' , fieldName:'prodOutDate',wrapText:true, hideDefaultActions: true,initialWidth:110});
        cols.push({label:'消耗品名称' , fieldName:'prodName',wrapText:true, hideDefaultActions: true,wrapText:true,initialWidth:190});
        cols.push({label:'出库目的' , fieldName:'summonsForDirctionDet',wrapText:true, hideDefaultActions: true,initialWidth:130});
        cols.push({label:'客户名' , fieldName:'hospitalName', hideDefaultActions: true,wrapText:true,initialWidth:130});
        cols.push({label:'经销商' , fieldName:'orderDealer', hideDefaultActions: true,wrapText:true,initialWidth:100});
        cols.push({label:'BarCode' , fieldName:'barCode', hideDefaultActions: true,wrapText:true,initialWidth:230});
        cols.push({label:'使用期限' , fieldName:'sterilizationLimit', hideDefaultActions: true,wrapText:true,initialWidth:110});
        cols.push({label:'单位' , fieldName:'boxPiece', hideDefaultActions: true,wrapText:true,initialWidth:50});
    cols.push({
      label: "出库日",
      fieldName: "prodOutDate",
      wrapText: true,
      hideDefaultActions: true,
      initialWidth: 110
    });
    cols.push({
      label: "消耗品名称",
      fieldName: "prodName",
      wrapText: true,
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 190
    });
    cols.push({
      label: "出库目的",
      fieldName: "summonsForDirctionDet",
      wrapText: true,
      hideDefaultActions: true,
      initialWidth: 130
    });
    cols.push({
      label: "客户名",
      fieldName: "hospitalName",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 130
    });
    cols.push({
      label: "经销商",
      fieldName: "orderDealer",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 100
    });
    cols.push({
      label: "BarCode",
      fieldName: "barCode",
      hideDefaultActions: true,
      wrap: true,
      initialWidth: 230
    });
    cols.push({
      label: "使用期限",
      fieldName: "sterilizationLimit",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 110
    });
    cols.push({
      label: "单位",
      fieldName: "boxPiece",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 50
    });
    cols.push({
      label: "返品数量",
            label:'返品数量',
      type: "customReturnGoodInput",
      typeAttributes: {
        inputValue: { fieldName: "returnCount" },
        boxPrice: { fieldName: "boxPiece" },
        recordId: { fieldName: "recordId" }
      },
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 100
    });
            hideDefaultActions: true,wrapText:true,initialWidth:100});
    cols.push({
      label: "返品原因",
            label:'返品原因',
      type: "customTableInput",
      typeAttributes: {
        recordId: { fieldName: "recordId" },
        inputValue: { fieldName: "returnReason" },
        valueType: "Text"
                    valueType: 'Text'
      },
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 100
    });
            hideDefaultActions: true,wrapText:true,initialWidth:150});
    // cols.push({label:'返品原因' , fieldName:'returnReason', hideDefaultActions: true});
    return cols;
  }
  //入库明细cols
  get inDetailCols() {
    var cols = [];
    cols.push({
      label: "消耗品名称",
      fieldName: "prodName",
      hideDefaultActions: true,
      wrapText: true
    });
    cols.push({
      label: "BarCode",
      fieldName: "barCodeNo",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 400
    });
    cols.push({
      label: "使用期限",
      fieldName: "sterilizationlimitDate",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 100
    });
    cols.push({
      label: "serialNoorLotNo",
      fieldName: "serialNoorLotNo",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 140
    });
    cols.push({
      label: "tracingCode",
      fieldName: "tracingCodeNo",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 140
    });
        cols.push({label:'消耗品名称' , fieldName:'prodName', hideDefaultActions: true,wrapText:true});
        cols.push({label:'BarCode' , fieldName:'barCodeNo', hideDefaultActions: true,wrapText:true,initialWidth:500});
        cols.push({label:'使用期限' , fieldName:'sterilizationlimitDate', hideDefaultActions: true,wrapText:true,initialWidth:100});
        cols.push({label:'serialNoorLotNo' , fieldName:'serialNoorLotNo', hideDefaultActions: true,wrapText:true,initialWidth:140});
        cols.push({label:'tracingCode' , fieldName:'tracingCodeNo', hideDefaultActions: true,wrapText:true,initialWidth:140});
    if (this.returnFLGbln) {
      cols.push({
        label: "返品原因",
        fieldName: "ReturnReason",
        hideDefaultActions: true,
        wrapText: true,
        initialWidth: 150
      });
            cols.push({label:'返品原因' , fieldName:'ReturnReason', hideDefaultActions: true,wrapText:true,initialWidth:150});
    }
    return cols;
  }
  //错误明细cols
  @track errorDetailCols = [
    // {label:'消耗品订单' , fieldName:'consumableOrderMinor', hideDefaultActions: true,wrapText:true},
    {
      label: "消耗品订单",
      fieldName: "consumableOrderUrl",
      type: "url",
      typeAttributes: {
        label: { fieldName: "consumableOrderMinorName" },
        target: "_blank"
      },
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 180
    },
    {
      label: "消耗品名称",
      fieldName: "prodName",
      hideDefaultActions: true,
      wrapText: true
    },
    {
      label: "BarCode",
      fieldName: "barCode",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 400
    },
    {
      label: "单位",
      fieldName: "boxPiece",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 60
    },
    {
      label: "数量",
      fieldName: "intMark",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 100,
      cellAttributes: { alignment: "right" }
    },
    {
      label: "错误原因",
      fieldName: "ErrorReason",
      hideDefaultActions: true,
      initialWidth: 280,
      wrapText: true
    }
        {label:'消耗品订单',fieldName:'consumableOrderUrl',type:'url',typeAttributes:{label:{fieldName:'consumableOrderMinorName'},target: "_blank"},hideDefaultActions: true,wrapText:true,initialWidth:180},
        {label:'消耗品名称' , fieldName:'prodName', hideDefaultActions: true,wrapText:true},
        {label:'BarCode' , fieldName:'barCode', hideDefaultActions: true,wrapText:true,initialWidth:400},
        {label:'单位' , fieldName:'boxPiece', hideDefaultActions: true,wrapText:true,initialWidth:60},
        {label:'数量' , fieldName:'intMark', hideDefaultActions: true,wrapText:true,initialWidth:100,cellAttributes: { alignment: "right" }},
        {label:'错误原因' , fieldName:'ErrorReason', hideDefaultActions: true,initialWidth:280,wrapText:true}
  ];
  // 获取参数
  @wire(CurrentPageReference)
  getStateParameters(currentPageReference) {
    console.log("CurrentPageReference");
        console.log('CurrentPageReference');
    if (currentPageReference) {
      this.arrType = currentPageReference.state?.ArrType;
      this.eSetId = currentPageReference.state?.ESetId;
@@ -348,7 +147,7 @@
  }
  get showOrderDetail() {
    if (this.eSetId != "" && this.eSetId != null) {
        if(this.eSetId != '' && this.eSetId != null){
      return true;
    } else {
      return false;
@@ -371,11 +170,11 @@
  //初始化
  connectedCallback() {
    init({ arrType: this.arrType, eSetId: this.eSetId })
      .then((result) => {
        .then(result=>{
        this.isNoteStay = result.isNoteStay;
        this.arrController = result.arrGoodCon;
        console.log("this.arrController:" + this.arrController);
        if (result.result == "Success") {
            if(result.result == 'Success'){
          this.saveFLGbln = result.saveFLGbln;
          this.returnFLGbln = result.returnFLGbln;
          this.coc = result.coc;
@@ -390,15 +189,15 @@
          this.showSpinner = false;
          this.showPage = true;
          console.log("error:" + result.errorMsg);
          this.showMyToast("初始化页面失败", result.errorMsg, "error");
                this.showMyToast('初始化页面失败',result.errorMsg,'error');
        }
      })
      .catch((error) => {
        .catch(error=>{
        this.showSpinner = false;
        this.showPage = true;
        console.log("error:" + JSON.stringify(error));
        this.showMyToast("初始化页面失败", JSON.stringify(error), "error");
      });
            this.showMyToast('初始化页面失败',JSON.stringify(error),'error');
        })
  }
  //barcode change
@@ -413,9 +212,9 @@
      barcode: this.barcode,
      arrControllerStr: this.arrController
    })
      .then((result) => {
        .then(result=>{
        this.arrController = result.arrGoodCon;
        if (result.result == "Success") {
            if(result.result == 'Success'){
          this.saveFLGbln = result.saveFLGbln;
          this.returnFLGbln = result.returnFLGbln;
          this.coc = result.coc;
@@ -425,144 +224,86 @@
          this.detailsSummary = result.detailsSummary;
          for (var i in this.detailsSummary) {
            if (this.detailsSummary[i].Prod != null) {
              this.detailsSummary[i]["recordId"] =
                this.detailsSummary[i].Prod.Id;
              this.detailsSummary[i]["assetModelNo"] =
                this.detailsSummary[i].Prod.Asset_Model_No__c;
              this.detailsSummary[i]["prodName"] =
                this.detailsSummary[i].Prod.Name__c;
                        this.detailsSummary[i]['recordId'] = this.detailsSummary[i].Prod.Id;
                        this.detailsSummary[i]['assetModelNo'] = this.detailsSummary[i].Prod.Asset_Model_No__c;
                        this.detailsSummary[i]['prodName'] = this.detailsSummary[i].Prod.Name__c;
            }
          }
          console.log(
            "this.detailsSummary:" + JSON.stringify(this.detailsSummary)
          );
          this.consumableorderdetailsRecords =
            result.consumableorderdetailsRecords;
                console.log('this.detailsSummary:'+JSON.stringify(this.detailsSummary));
                this.consumableorderdetailsRecords = result.consumableorderdetailsRecords;
          var consumableorderdetailsRecordsview = [];
          for (var i in this.consumableorderdetailsRecords) {
            consumableorderdetailsRecordsview.push(
              this.consumableorderdetailsRecords[i]
            );
                    this.consumableorderdetailsRecords[i]['dataType'] = 'DataileRecords';
                    consumableorderdetailsRecordsview.push(this.consumableorderdetailsRecords[i]);
          }
          for (var i in this.consumableInventory) {
                    this.consumableInventory[i]['dataType'] = 'Inventory';
            consumableorderdetailsRecordsview.push(this.consumableInventory[i]);
          }
          this.consumableorderdetailsRecordsview =
            consumableorderdetailsRecordsview;
                this.consumableorderdetailsRecordsview = consumableorderdetailsRecordsview;
          for (var i in this.consumableorderdetailsRecordsview) {
            if (this.consumableorderdetailsRecordsview[i].Prod != null) {
              this.consumableorderdetailsRecordsview[i]["recordId"] =
                this.consumableorderdetailsRecordsview[i].Prod.Id;
              this.consumableorderdetailsRecordsview[i]["prodName"] =
                this.consumableorderdetailsRecordsview[i].Prod.Name__c;
                        this.consumableorderdetailsRecordsview[i]['recordId'] = this.consumableorderdetailsRecordsview[i].Prod.Id;
                        this.consumableorderdetailsRecordsview[i]['prodName'] = this.consumableorderdetailsRecordsview[i].Prod.Name__c;
                    }
                    if(this.consumableorderdetailsRecordsview[i]['dataType'] == 'Inventory'){
                        this.consumableorderdetailsRecordsview[i]['barCode'] = this.consumableorderdetailsRecordsview[i].barCodeNo;
                    }else if(this.consumableorderdetailsRecordsview[i].esd != null){
                        this.consumableorderdetailsRecordsview[i]['barCode'] = this.consumableorderdetailsRecordsview[i].esd.Bar_Code__c;
            }
            if (this.consumableorderdetailsRecordsview[i].esd != null) {
              this.consumableorderdetailsRecordsview[i][
                "productPackingListManual"
              ] =
                this.consumableorderdetailsRecordsview[
                  i
                ].esd.ProductPacking_list_manual__c;
              this.consumableorderdetailsRecordsview[i]["status"] =
                this.consumableorderdetailsRecordsview[i].esd.CFDA_Status__c;
              this.consumableorderdetailsRecordsview[i][
                "reportProductApprobation"
              ] =
                this.consumableorderdetailsRecordsview[
                  i
                ].esd.Report_Product_Approbation__c;
              this.consumableorderdetailsRecordsview[i]["barCode"] =
                this.consumableorderdetailsRecordsview[i].esd.Bar_Code__c;
                        this.consumableorderdetailsRecordsview[i]['productPackingListManual'] = this.consumableorderdetailsRecordsview[i].esd.ProductPacking_list_manual__c;
                        this.consumableorderdetailsRecordsview[i]['status'] = this.consumableorderdetailsRecordsview[i].esd.CFDA_Status__c;
                        this.consumableorderdetailsRecordsview[i]['reportProductApprobation'] = this.consumableorderdetailsRecordsview[i].esd.Report_Product_Approbation__c;
            }
          }
          console.log("len1:" + this.consumableorderdetailsRecords.length);
          console.log("len2:" + this.consumableorderdetailsRecordsview.length);
          console.log(
            "this.consumableorderdetailsRecordsview:" +
              JSON.stringify(this.consumableorderdetailsRecordsview)
          );
                console.log('len1:'+this.consumableorderdetailsRecords.length);
                console.log('len2:'+this.consumableorderdetailsRecordsview.length);
                console.log('this.consumableorderdetailsRecordsview:'+JSON.stringify(this.consumableorderdetailsRecordsview));
          this.showGoodsofReturnList = result.showGoodsofReturnList;
          var showGoodsofReturnListView = [];
          for (var i in this.showGoodsofReturnList) {
                    this.showGoodsofReturnList[i]['dataType'] = 'GoodsoOfReturn';
            showGoodsofReturnListView.push(this.showGoodsofReturnList[i]);
          }
          for (var i in this.consumableInventory) {
                    this.consumableInventory[i]['dataType'] = 'Inventory';
            showGoodsofReturnListView.push(this.consumableInventory[i]);
          }
          this.showGoodsofReturnListView = showGoodsofReturnListView;
          for (var i in this.showGoodsofReturnListView) {
            if (this.showGoodsofReturnListView[i].Prod != null) {
              this.showGoodsofReturnListView[i]["prodName"] =
                this.showGoodsofReturnListView[i].Prod.Name__c;
                        this.showGoodsofReturnListView[i]['prodName'] = this.showGoodsofReturnListView[i].Prod.Name__c;
                    }
                    if(this.showGoodsofReturnListView[i]['dataType'] == 'Inventory'){
                        this.showGoodsofReturnListView[i]['barCode'] = this.showGoodsofReturnListView[i].barCodeNo;
                    }else if(this.showGoodsofReturnListView[i].esd != null){
                        this.showGoodsofReturnListView[i]['barCode'] = this.showGoodsofReturnListView[i].esd.Bar_Code__c;
            }
            if (this.showGoodsofReturnListView[i].esd != null) {
              if (
                this.showGoodsofReturnListView[i].esd
                  .Consumable_Shipment_order__c != "" &&
                this.showGoodsofReturnListView[i].esd
                  .Consumable_Shipment_order__c != null
              ) {
                this.showGoodsofReturnListView[i]["recordId"] =
                  this.showGoodsofReturnListView[
                    i
                  ].esd.Consumable_Shipment_order__c;
                this.showGoodsofReturnListView[i]["orderUrl"] =
                  "/lexsummonscreat?ESetid=" +
                  this.showGoodsofReturnListView[i].esd
                    .Consumable_Shipment_order__c;
                this.showGoodsofReturnListView[i]["orderNo"] =
                  this.showGoodsofReturnListView[
                    i
                  ].esd.Consumable_Shipment_order__r.Name;
              } else if (
                this.showGoodsofReturnListView[i].esd
                  .Consumable_Sale_order__c != "" &&
                this.showGoodsofReturnListView[i].esd
                  .Consumable_Sale_order__c != null
              ) {
                this.showGoodsofReturnListView[i]["recordId"] =
                  this.showGoodsofReturnListView[
                    i
                  ].esd.Consumable_Sale_order__c;
                this.showGoodsofReturnListView[i]["orderUrl"] =
                  "/lexsummonscreat?ESetid=" +
                  this.showGoodsofReturnListView[i].esd
                    .Consumable_Sale_order__c;
                this.showGoodsofReturnListView[i]["orderNo"] =
                  this.showGoodsofReturnListView[
                    i
                  ].esd.Consumable_Sale_order__r.Name;
                        if(this.showGoodsofReturnListView[i].esd.Consumable_Shipment_order__c != '' && this.showGoodsofReturnListView[i].esd.Consumable_Shipment_order__c != null){
                            this.showGoodsofReturnListView[i]['recordId'] = this.showGoodsofReturnListView[i].esd.Consumable_Shipment_order__c;
                            this.showGoodsofReturnListView[i]['orderUrl'] = '/lexsummonscreat?ESetid='+this.showGoodsofReturnListView[i].esd.Consumable_Shipment_order__c;
                            this.showGoodsofReturnListView[i]['orderNo'] = this.showGoodsofReturnListView[i].esd.Consumable_Shipment_order__r.Name;
                        }else if(this.showGoodsofReturnListView[i].esd.Consumable_Sale_order__c != '' && this.showGoodsofReturnListView[i].esd.Consumable_Sale_order__c != null){
                            this.showGoodsofReturnListView[i]['recordId'] = this.showGoodsofReturnListView[i].esd.Consumable_Sale_order__c;
                            this.showGoodsofReturnListView[i]['orderUrl'] = '/lexsummonscreat?ESetid='+this.showGoodsofReturnListView[i].esd.Consumable_Sale_order__c;
                            this.showGoodsofReturnListView[i]['orderNo'] = this.showGoodsofReturnListView[i].esd.Consumable_Sale_order__r.Name;
              }
              this.showGoodsofReturnListView[i]["prodOutDate"] =
                this.showGoodsofReturnListView[i].esd.Product_OutDate__c;
              this.showGoodsofReturnListView[i]["summonsForDirctionDet"] =
                this.showGoodsofReturnListView[i].esd.SummonsForDirction_det__c;
              this.showGoodsofReturnListView[i]["hospitalName"] =
                this.showGoodsofReturnListView[i].esd.HospItal_Name__c;
              this.showGoodsofReturnListView[i]["orderDealer"] =
                this.showGoodsofReturnListView[i].esd.Order_Dealer_Info__c;
              this.showGoodsofReturnListView[i]["barCode"] =
                this.showGoodsofReturnListView[i].esd.Bar_Code__c;
              this.showGoodsofReturnListView[i]["sterilizationLimit"] =
                this.showGoodsofReturnListView[i].esd.Sterilization_limit__c;
              this.showGoodsofReturnListView[i]["boxPiece"] =
                this.showGoodsofReturnListView[i].esd.Box_Piece__c;
              this.showGoodsofReturnListView[i]["returnCount"] =
                this.showGoodsofReturnListView[i].esd.Rrturn_count__c;
              console.log(
                "returnCount:" +
                  this.showGoodsofReturnListView[i].esd.Rrturn_count__c
              );
              this.showGoodsofReturnListView[i]["returnReason"] =
                this.showGoodsofReturnListView[i].esd.Return_reason__c;
                        this.showGoodsofReturnListView[i]['prodOutDate'] = this.showGoodsofReturnListView[i].esd.Product_OutDate__c;
                        this.showGoodsofReturnListView[i]['summonsForDirctionDet'] = this.showGoodsofReturnListView[i].esd.SummonsForDirction_det__c;
                        this.showGoodsofReturnListView[i]['hospitalName'] = this.showGoodsofReturnListView[i].esd.HospItal_Name__c;
                        this.showGoodsofReturnListView[i]['orderDealer'] = this.showGoodsofReturnListView[i].esd.Order_Dealer_Info__c;
                        this.showGoodsofReturnListView[i]['sterilizationLimit'] = this.showGoodsofReturnListView[i].esd.Sterilization_limit__c;
                        this.showGoodsofReturnListView[i]['boxPiece'] = this.showGoodsofReturnListView[i].esd.Box_Piece__c;
                        this.showGoodsofReturnListView[i]['returnCount'] = this.showGoodsofReturnListView[i].esd.Rrturn_count__c;
                        console.log('returnCount:'+this.showGoodsofReturnListView[i].esd.Rrturn_count__c);
                        this.showGoodsofReturnListView[i]['returnReason'] = this.showGoodsofReturnListView[i].esd.Return_reason__c;
            }
          }
          console.log("len1:" + this.showGoodsofReturnList.length);
          console.log("len2:" + this.showGoodsofReturnListView.length);
          console.log(
            "this.showGoodsofReturnListView:" +
              JSON.stringify(this.showGoodsofReturnListView)
          );
                console.log('len1:'+this.showGoodsofReturnList.length);
                console.log('len2:'+this.showGoodsofReturnListView.length);
                console.log('this.showGoodsofReturnListView:'+JSON.stringify(this.showGoodsofReturnListView));
          // this.consumableInventory = result.consumableInventory;
          // for(var i in this.consumableInventory){
          //     if(this.consumableInventory[i].Prod != null){
@@ -570,68 +311,41 @@
          //         this.consumableInventory[i]['prodName'] = this.consumableInventory[i].Prod.Name__c;
          //     }
          // }
          console.log(
            "this.consumableInventory:" +
              JSON.stringify(this.consumableInventory)
          );
          this.consumableorderdetailsRecordserror =
            result.consumableorderdetailsRecordserror;
                console.log('this.consumableInventory:'+JSON.stringify(this.consumableInventory));
                this.consumableorderdetailsRecordserror = result.consumableorderdetailsRecordserror;
          for (var i in this.consumableorderdetailsRecordserror) {
            if (this.consumableorderdetailsRecordserror[i].Prod != null) {
              this.consumableorderdetailsRecordserror[i]["recordId"] =
                this.consumableorderdetailsRecordserror[i].Prod.Id;
              this.consumableorderdetailsRecordserror[i]["prodName"] =
                this.consumableorderdetailsRecordserror[i].Prod.Name__c;
                        this.consumableorderdetailsRecordserror[i]['recordId'] = this.consumableorderdetailsRecordserror[i].Prod.Id;
                        this.consumableorderdetailsRecordserror[i]['prodName'] = this.consumableorderdetailsRecordserror[i].Prod.Name__c;
            }
            if (this.consumableorderdetailsRecordserror[i].esd != null) {
              this.consumableorderdetailsRecordserror[i][
                "consumableOrderMinor"
              ] =
                this.consumableorderdetailsRecordserror[
                  i
                ].esd.Consumable_order_minor__c;
              if (
                this.consumableorderdetailsRecordserror[i].esd
                  .Consumable_order_minor__c != null
              ) {
                this.consumableorderdetailsRecordserror[i][
                  "consumableOrderMinorName"
                ] =
                  this.consumableorderdetailsRecordserror[
                    i
                  ].esd.Consumable_order_minor__r.Name;
                this.consumableorderdetailsRecordserror[i][
                  "consumableOrderUrl"
                ] =
                  "/s/detail/" +
                  this.consumableorderdetailsRecordserror[i].esd
                    .Consumable_order_minor__c;
                        this.consumableorderdetailsRecordserror[i]['consumableOrderMinor'] = this.consumableorderdetailsRecordserror[i].esd.Consumable_order_minor__c;
                        if(this.consumableorderdetailsRecordserror[i].esd.Consumable_order_minor__c != null){
                            this.consumableorderdetailsRecordserror[i]['consumableOrderMinorName'] = this.consumableorderdetailsRecordserror[i].esd.Consumable_order_minor__r.Name;
                            this.consumableorderdetailsRecordserror[i]['consumableOrderUrl'] = "/s/detail/"+this.consumableorderdetailsRecordserror[i].esd.Consumable_order_minor__c;
              }
              this.consumableorderdetailsRecordserror[i]["barCode"] =
                this.consumableorderdetailsRecordserror[i].esd.Bar_Code__c;
              this.consumableorderdetailsRecordserror[i]["boxPiece"] =
                this.consumableorderdetailsRecordserror[i].esd.Box_Piece__c;
                        this.consumableorderdetailsRecordserror[i]['barCode'] = this.consumableorderdetailsRecordserror[i].esd.Bar_Code__c;
                        this.consumableorderdetailsRecordserror[i]['boxPiece'] = this.consumableorderdetailsRecordserror[i].esd.Box_Piece__c;
            }
          }
          console.log(
            "this.consumableorderdetailsRecordserror:" +
              JSON.stringify(this.consumableorderdetailsRecordserror)
          );
                console.log('this.consumableorderdetailsRecordserror:'+JSON.stringify(this.consumableorderdetailsRecordserror));
          this.showSpinner = false;
          this.showMyToast("获取成功", "", "success");
                if(this.errorMsgs.length < 1){
                    this.showMyToast('获取成功','','success');
                }
        } else {
          this.showSpinner = false;
          this.warningMsgs = result.warningMsgList;
          this.errorMsgs = result.errorMsgList;
          console.log("error:" + result.errorMsg);
          this.showMyToast("获取失败", result.errorMsg, "error");
                this.showMyToast('获取失败',result.errorMsg,'error');
        }
      })
      .catch((error) => {
        .catch(error=>{
        this.showSpinner = false;
        console.log("error:" + error);
        this.showMyToast("获取失败", error, "error");
      });
            this.showMyToast('获取失败',error,'error');
        })
  }
  //返品数量change
@@ -641,15 +355,13 @@
    var recordId = event.detail.data.recordId;
    console.log("返品数量:" + value + boxPrice + "---" + recordId);
    for (var i in this.showGoodsofReturnList) {
      if (this.showGoodsofReturnList[i]["recordId"] == recordId) {
            if(this.showGoodsofReturnList[i]['recordId'] == recordId){
        if (this.showGoodsofReturnList[i].canEdit) {
          this.showGoodsofReturnList[i].esd.Rrturn_count__c = 1;
          this.showGoodsofReturnList[i]["returnCount"] =
            this.showGoodsofReturnList[i].esd.Rrturn_count__c;
                    this.showGoodsofReturnList[i]['returnCount'] = this.showGoodsofReturnList[i].esd.Rrturn_count__c;
        } else {
          this.showGoodsofReturnList[i].esd.Rrturn_count__c = value;
          this.showGoodsofReturnList[i]["returnCount"] =
            this.showGoodsofReturnList[i].esd.Rrturn_count__c;
                    this.showGoodsofReturnList[i]['returnCount'] = this.showGoodsofReturnList[i].esd.Rrturn_count__c;
        }
      }
    }
@@ -661,10 +373,9 @@
    var value = event.detail.data.value;
    console.log("返品原因:" + value + "---" + recordId);
    for (var i in this.showGoodsofReturnList) {
      if (this.showGoodsofReturnList[i]["recordId"] == recordId) {
            if(this.showGoodsofReturnList[i]['recordId'] == recordId){
        this.showGoodsofReturnList[i].esd.Return_reason__c = value;
        this.showGoodsofReturnList[i]["returnReason"] =
          this.showGoodsofReturnList[i].esd.Return_reason__c;
                this.showGoodsofReturnList[i]['returnReason'] = this.showGoodsofReturnList[i].esd.Return_reason__c;
      }
    }
  }
@@ -673,15 +384,15 @@
  arriveGoodsConfim() {
    this.showSpinner = true;
    arriveGoodsConfim({ arrControllerStr: this.arrController })
      .then((result) => {
        .then(result=>{
        this.arrController = result.arrGoodCon;
        if (result.result == "Success") {
            if(result.result == 'Success'){
          this.showSpinner = false;
          this.warningMsgs = result.warningMsgList;
          this.errorMsgs = result.errorMsgList;
          var url = result.url;
          const config = {
            type: "standard__webPage",
                    type: 'standard__webPage',
            attributes: {
              url: url
            }
@@ -692,70 +403,68 @@
          this.warningMsgs = result.warningMsgList;
          this.errorMsgs = result.errorMsgList;
          console.log("error1:" + result.errorMsg);
          this.showMyToast("到货确认失败", result.errorMsg, "error");
                this.showMyToast('到货确认失败',result.errorMsg,'error');
        }
      })
      .catch((error) => {
        .catch(error=>{
        this.showSpinner = false;
        console.log("error2:" + error);
        this.showMyToast("到货确认失败", error, "error");
      });
            this.showMyToast('到货确认失败',error,'error');
        })
  }
  // 登录返品
  updateGoodsOfReturn() {
    this.showSpinner = true;
    updateGoodsOfReturn({
      arrControllerStr: this.arrController,
      showGoodsofReturnListStr: JSON.stringify(this.showGoodsofReturnList)
    })
      .then((result) => {
        updateGoodsOfReturn({arrControllerStr : this.arrController,showGoodsofReturnListStr : JSON.stringify(this.showGoodsofReturnList)})
        .then(result=>{
        this.showSpinner = false;
        this.arrController = result.arrGoodCon;
        if (result.result == "Success") {
            if(result.result == 'Success'){
          this.warningMsgs = result.warningMsgList;
          this.errorMsgs = result.errorMsgList;
          var url = result.url;
          const config = {
            type: "standard__webPage",
                    type: 'standard__webPage',
            attributes: {
              url: url
            }
          };
          this[NavigationMixin.Navigate](config);
        } else {
                console.log("error1:"+result.errorMsg);
          this.showSpinner = false;
          this.warningMsgs = result.warningMsgList;
          this.errorMsgs = result.errorMsgList;
          console.log("error1:" + result.errorMsg);
          this.showMyToast("登录返品失败", result.errorMsg, "error");
                if(result.errorMsg.includes('无法保存此记录')){
                    result.errorMsg = '无法保存记录';
                }
                this.showMyToast('登录返品失败',result.errorMsg,'error');
        }
      })
      .catch((error) => {
        .catch(error=>{
        this.showSpinner = false;
        console.log("error2:" + JSON.stringify(error));
        this.showMyToast("登录返品失败", error, "error");
      });
            this.showMyToast('登录返品失败',error,'error');
        })
  }
  showMyToast(title, message, variant) {
    console.log("show custom message");
    var iconName = "";
    var content = "";
    if (variant == "success") {
      iconName = "utility:check";
        console.log('show custom message');
        var iconName = '';
        var content = '';
        if(variant == 'success'){
           iconName = 'utility:check';
    } else {
      iconName = "utility:error";
           iconName = 'utility:error';
    }
    if (message != "") {
      content =
        "<h2><strong>" + title + "<strong/></h2><h5>" + message + "</h5>";
        if(message != ''){
           content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
    } else {
      content = "<h2><strong>" + title + "<strong/></h2>";
           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/lexArriveGoods/lexArriveGoods.js-meta.xml
force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html
@@ -2,10 +2,7 @@
    <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>
@@ -14,44 +11,17 @@
    </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">
@@ -61,77 +31,30 @@
                        </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>
@@ -139,15 +62,8 @@
                    </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">
@@ -157,16 +73,9 @@
                        </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>
@@ -174,65 +83,24 @@
    </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,12 +14,10 @@
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;
@@ -50,107 +48,62 @@
        // {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}
    ];
    //获取参数
@@ -166,18 +119,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");
                });
        }
    }
    //初始化
    connectedCallback() {
        init().then((result) => {
        init()
            .then(result=>{
            this.isNoteStay = result.isNoteStay;
            if (result.result == 'Success') {
                this.agencyProType = result.agencyProType;
@@ -190,23 +144,15 @@
                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');
            }
        });
            })
    }
    //点击链接
@@ -214,9 +160,7 @@
        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',
@@ -227,7 +171,8 @@
            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);
@@ -235,17 +180,14 @@
                    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);
@@ -253,124 +195,100 @@
                        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');
                    }
                });
                })
            }
        }
    }
@@ -398,34 +316,22 @@
            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');
            }
        });
        })
    }
    //清空搜索框
@@ -438,34 +344,22 @@
            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');
            }
        });
        })
    }
    //入库
@@ -500,18 +394,12 @@
            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,10 +2,7 @@
    <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>
@@ -14,14 +11,8 @@
    </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">
@@ -31,29 +22,14 @@
                </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">
@@ -63,77 +39,34 @@
                        </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>
@@ -143,15 +76,8 @@
                    </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">
@@ -161,15 +87,8 @@
                        </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,12 +6,11 @@
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;
@@ -25,65 +24,14 @@
    //是否一直显示提示
    @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 };
@@ -100,11 +48,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");
                });
        }
    }
@@ -112,83 +60,48 @@
    //初始化
    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() {
@@ -199,7 +112,7 @@
            consumableorderdetailsCountParm: this.consumableorderdetailsCount,
            eSetIdStr: this.eSetId
        })
            .then((result) => {
        .then(result=>{
                if (result.result == 'Success') {
                    var url = result.url;
                    const config = {
@@ -211,23 +124,20 @@
                    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: {
@@ -248,18 +158,12 @@
            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,10 +2,7 @@
    <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>
@@ -13,14 +10,9 @@
        </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>
@@ -32,51 +24,15 @@
                </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">
@@ -108,25 +64,12 @@
                        <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>
@@ -136,20 +79,8 @@
                <!-- </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">
@@ -158,46 +89,26 @@
                        </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>
@@ -208,20 +119,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,13 +14,15 @@
        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状态',
@@ -28,6 +30,7 @@
        hideDefaultActions: true,
        initialWidth: 100,
        wrapText: true
    },
    {
        label: '注册证编码号',
@@ -57,20 +60,25 @@
        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;
@@ -80,38 +88,40 @@
    @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;
@@ -121,8 +131,7 @@
                } else {
                    this.showMyToast('初始化失败', result.msg, 'error');
                }
            })
            .catch((error) => {
      }).catch((error) => {
                console.log('error = ' + JSON.stringify(error));
            });
    }
@@ -135,40 +144,27 @@
            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;
@@ -176,10 +172,10 @@
                    this.showMyToast('获取失败', result.msg, 'error');
                    this.showSpinner = false;
                }
            })
            .catch((error) => {
    }).catch((error) => {
                console.log('error = ' + JSON.stringify(error));
            });
    }
    //获取当前输入值
    handleChange(event) {
@@ -189,8 +185,9 @@
        console.log('this.barcode' + this.barcode);
    }
    saveConfirm() {
        let msg = '确认取消拆盒吗';
    let msg = "确认取消拆盒吗";
        if (this.dataSize > 0) {
            if (confirm(msg) == true) {
                this.CancelRemoveBox();
@@ -206,8 +203,7 @@
            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') {
@@ -216,6 +212,8 @@
                    if (this.saveFLGbln) {
                        this.showMyToast(result.msg, '', 'success');
                        this.showSpinner = false;
                    }
                } else {
                    this.showMyToast('取消拆盒失败', result.msg, 'error');
@@ -225,6 +223,7 @@
            .catch((error) => {
                console.log('error = ' + JSON.stringify(error));
            });
    }
    showMyToast(title, message, variant) {
        console.log('show custom message');
@@ -236,17 +235,15 @@
            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,122 +3,55 @@
<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>
@@ -126,199 +59,109 @@
                                    </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>
@@ -328,49 +171,24 @@
                                                    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>
@@ -407,6 +225,7 @@
                                    </template>
                                </lightning-layout> -->
                            </div>
                        </div>
                    </div>
@@ -421,180 +240,103 @@
                                </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 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" 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-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>
                                        <!-- 附件预览 -->
@@ -602,68 +344,30 @@
                                            <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>
@@ -678,177 +382,95 @@
                                </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>
@@ -857,31 +479,25 @@
                    <!-- 出库单一览 -->
                    <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>
@@ -904,25 +520,13 @@
                        <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>
@@ -932,9 +536,7 @@
                        <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>
@@ -944,13 +546,9 @@
                            <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>
@@ -1007,25 +605,21 @@
        <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">
@@ -1038,150 +632,77 @@
                        <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">
@@ -1194,13 +715,8 @@
                        <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>
@@ -1212,25 +728,21 @@
    <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">
@@ -1243,43 +755,26 @@
                    <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="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="5"
                                        class="hehe-layoutItem"
                                    >
                                        <lightning-output-field
                                            field-name="ShipmentAccount__c"
                                            class="hideHelpText"
                                        ></lightning-output-field>
                                    <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="Order_ForCustomerText__c"></lightning-output-field>
                                    </lightning-layout-item>
                                </lightning-layout>
                            </lightning-record-edit-form>
@@ -1288,7 +783,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">
@@ -1301,28 +796,17 @@
                    <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>
@@ -1331,7 +815,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">
@@ -1347,30 +831,15 @@
                            <!-- <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>
@@ -1378,4 +847,5 @@
            </div>
        </div>
    </template>
</template>
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
@@ -1,291 +1,290 @@
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',
        hideDefaultActions: true,
        wrapText: true
    },
    {
        label: '出库单编码',
        fieldName: 'esdetInvoicedet1ODlinkName',
        wrapText: true,
        hideDefaultActions: true,
        wrapText: true
    },
    {
        label: '产品型号',
        fieldName: 'esdetAssetModelNo',
        label: "出库日期",
        fieldName: "esdetProductOutDate",
        hideDefaultActions: true,
        wrapText: true,
        initialWidth: 400
    },
    {
        label: '单位',
        fieldName: 'esdetInvoiceUnit',
        label: "出库单编码",
        fieldName: "esdetInvoicedet1ODlinkName",
        wrapText: true,
        hideDefaultActions: true,
        wrapText: true,
        initialWidth: 50
    },
    {
        label: '发票单价',
        fieldName: 'esdetInvoiceUnitprice',
        label: "产品型号",
        fieldName: "esdetAssetModelNo",
        hideDefaultActions: true,
        wrapText: true,
        type: 'number',
        initialWidth: 400,
    },
    {
        label: "单位",
        fieldName: "esdetInvoiceUnit",
        hideDefaultActions: true,
        wrapText: true,
        initialWidth: 50,
    },
    {
        label: "发票单价",
        fieldName: "esdetInvoiceUnitprice",
        hideDefaultActions: true,
        wrapText: true,
        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
    },
    {
        label: '客户名',
        fieldName: 'ShipmentAccount__c',
        hideDefaultActions: true,
        wrapText: true
    },
    {
        label: '发票状态',
        fieldName: 'Invoice_status__c',
        label: "客户名",
        fieldName: "ShipmentAccount__c",
        hideDefaultActions: true,
        wrapText: true,
    },
    {
        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: 'esdRrturnProCount',
        hideDefaultActions: true
    },
    {
        label: '出库单位',
        fieldName: 'esdBoxPiece',
        hideDefaultActions: true
    },
    {
        label: '已发票数量',
        fieldName: 'esdInvoicedProcount',
        label: "出货数量",
        fieldName: "esdShipmentCount",
        hideDefaultActions: true,
        type: 'number',
        typeAttributes: {
            minimumFractionDigits: 2
        }
    },
    {
        label: '还没发票数量',
        fieldName: 'esdInvoiceProNotCount',
        label: "返品数量",
        fieldName: "esdRrturnProCount",
        hideDefaultActions: true,
        type: 'number',
        typeAttributes: {
            minimumFractionDigits: 2
        }
    },
    {
        label: '开票单位',
        label: "出库单位",
        fieldName: "esdBoxPiece",
        hideDefaultActions: true,
        type: 'customUnit',
        typeAttributes: {
            unitValue: { fieldName: 'unitValue' },
            unitOptions: { fieldName: 'unitOptions' },
            recordId: { fieldName: 'recordId' },
            isDisabled: { fieldName: 'isDisabled' }
        }
    },
    {
        label: '发票单价',
        fieldName: 'esdInvoiceUnitprice',
        label: "已发票数量",
        fieldName: "esdInvoicedProcount",
        hideDefaultActions: true,
        type: 'number',
        type: "number",
        typeAttributes: {
            minimumFractionDigits: 2
            minimumFractionDigits: 2,
        },
    },
    {
        label: "还没发票数量",
        fieldName: "esdInvoiceProNotCount",
        hideDefaultActions: true,
        type: "number",
        typeAttributes: {
            minimumFractionDigits: 2,
        },
    },
    {
        label: "开票单位",
        hideDefaultActions: true,
        type: "customUnit",
        typeAttributes: {
            unitValue: { fieldName: "unitValue" },
            unitOptions: { fieldName: "unitOptions" },
            recordId: { fieldName: "recordId" },
            isDisabled: { fieldName: "isDisabled" },
        },
    },
    {
        label: "发票单价",
        fieldName: "esdInvoiceUnitprice",
        hideDefaultActions: true,
        type: "number",
        typeAttributes: {
            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 = [];
@@ -302,7 +301,7 @@
    @track coc = {};
    @track EditAble = false;
    @track isChange = false;
    @track sumPrice = 0.0;
    @track sumPrice = 0.00;
    @track OrderCode = '';
    @track ExistOutbound = false;
    @track reopen = '';
@@ -314,7 +313,7 @@
    @track detailsInvoiceId = '';
    @track detailsCocId = '';
    @track detailsData = [];
    @track invoiceAllprice = 0.0;
    @track invoiceAllprice = 0.00;
    //状态
    @track invoiceStatusValue = '';
    @track invoiceStatusOptions = [];
@@ -338,9 +337,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 = '';
@@ -376,50 +375,47 @@
    //文件上传
    @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: '',
@@ -432,7 +428,7 @@
            },
            initialWidth: 50,
            hideDefaultActions: true
        }
        },
    ];
    filesUploaded = [];
    fileContents;
@@ -445,19 +441,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]);
@@ -471,178 +467,121 @@
    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;
@@ -650,164 +589,79 @@
                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;
@@ -816,179 +670,145 @@
                        //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) {
@@ -1019,11 +839,7 @@
    //是否显示附件移除
    get attDelBtn() {
        if (
            this.fileName != '' &&
            this.fileName != null &&
            this.fileName != '选择一个文件上传'
        ) {
        if (this.fileName != '' && this.fileName != null && this.fileName != '选择一个文件上传') {
            return true;
        } else {
            return false;
@@ -1042,47 +858,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;
@@ -1097,68 +913,58 @@
    //搜索客户名
    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() {
@@ -1167,12 +973,10 @@
    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) {
@@ -1207,10 +1011,7 @@
        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,
@@ -1222,37 +1023,32 @@
            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;
@@ -1262,7 +1058,7 @@
    }
    handleSave() {
        console.log('saveFile');
        console.log("saveFile");
        if (this.filesUploaded.length > 0) {
            this.showPopSpinner = true;
            this.file = this.filesUploaded[0];
@@ -1274,31 +1070,29 @@
            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');
@@ -1307,41 +1101,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;
@@ -1358,11 +1152,10 @@
        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({
@@ -1388,9 +1181,8 @@
                } else {
                    this.showMyToast('上传失败', r.msg, 'Error');
                }
            })
            .catch((error) => {
                console.log('error = ' + error.message);
        }).catch((error) => {
            console.log("error = " + error.message);
                this.showMyToast('错误', '上传失败', 'Error');
            });
    }
@@ -1398,54 +1190,34 @@
    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');
            });
    }
@@ -1457,38 +1229,30 @@
        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;
@@ -1529,60 +1293,33 @@
            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) {
@@ -1590,16 +1327,14 @@
                                    label: '发票票面金额(元)',
                                    cellAttributes: { alignment: 'right' },
                                    type: 'url',
                                    fieldName: 'invoiceFaceAmountUrl',
                                fieldName: "invoiceFaceAmountUrl",
                                    typeAttributes: {
                                        label: {
                                            fieldName: 'invoiceFaceAmount'
                                    label: { fieldName: "invoiceFaceAmount" },
                                    target: "_blank",
                                        },
                                        target: '_blank'
                                    },
                                    hideDefaultActions: true
                                hideDefaultActions: true,
                                };
                                this.outboundColumns.push(object5);
                            this.outboundColumns.push(object5)
                                index++;
                            }
                        } else {
@@ -1607,27 +1342,23 @@
                                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');
            });
    }
@@ -1653,43 +1384,37 @@
        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,
            },
        });
    }
@@ -1699,14 +1424,13 @@
            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]({
@@ -1718,25 +1442,17 @@
                } 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",
@@ -1751,18 +1467,13 @@
        // 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,
            },
        });
    }
@@ -1782,36 +1493,26 @@
            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);
@@ -1830,19 +1531,17 @@
            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);
@@ -1850,203 +1549,120 @@
    }
    handleUnitChange(event) {
        console.log('handleUnitChange');
        this.invoiceAllpriceData[0].invoiceAllprice = 0.0;
        console.log("handleUnitChange");
        this.invoiceAllpriceData[0].invoiceAllprice = 0.00;
        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.0;
            this.detailsData[i].invoiceAllprice = 0.00;
            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.0;
        console.log("handleShipmentNumber");
        this.invoiceAllpriceData[0].invoiceAllprice = 0.00;
        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.0;
            this.detailsData[i].invoiceAllprice = 0.00;
            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.0;
        console.log("detailsGetSelectedRows ");
        this.invoiceAllpriceData[0].invoiceAllprice = 0.00;
        let selectedRows = event.detail.selectedRows;
        for (var i in this.detailsData) {
            this.detailsData[i].invoiceAllprice = 0.0;
            this.detailsData[i].invoiceAllprice = 0.00;
            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) {
@@ -2057,9 +1673,7 @@
        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) {
@@ -2086,28 +1700,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);
            });
    }
@@ -2120,27 +1734,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:
@@ -2153,23 +1767,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) => {
        }).catch(error => {
                this.showMyToast('错误', error.message, 'Error');
            });
        })
    }
}
force-app/main/default/lwc/lexConsumable/lexConsumable.html
@@ -2,10 +2,7 @@
    <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>
@@ -14,93 +11,36 @@
    </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>
@@ -108,32 +48,13 @@
                </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">
@@ -143,35 +64,21 @@
                            </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>
@@ -180,10 +87,7 @@
                                                    <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>
@@ -199,12 +103,8 @@
                                                </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>
@@ -222,12 +122,8 @@
                                        <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>
@@ -236,71 +132,26 @@
                                        <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>
@@ -320,15 +171,8 @@
                </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>
@@ -364,190 +208,62 @@
                                    <!-- <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
                                                >合同
                                        <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>
                                            </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>
                                            </div>
                                        </td>
                                        <td style="width: 30px"></td>
                                        <td style="width: 66px">
                                        <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 style="color:#696969;font-size:16px;"><span style="color: red;">*&nbsp;</span>医院</div>
                                            </template>
                                        </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
                                            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 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>
@@ -557,94 +273,31 @@
                </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">
@@ -654,65 +307,24 @@
                        </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>
@@ -737,65 +349,27 @@
        </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>
@@ -805,24 +379,8 @@
                    <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>
@@ -830,104 +388,35 @@
        </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>
@@ -935,27 +424,14 @@
                                </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>
@@ -964,132 +440,50 @@
        </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,10 +20,11 @@
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;
@@ -114,34 +115,10 @@
    @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;
@@ -154,222 +131,66 @@
    @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
@@ -389,33 +210,23 @@
        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]);
                }
            }
        }
@@ -427,33 +238,22 @@
        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);
            }
        }
    }
@@ -464,22 +264,8 @@
        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');
@@ -508,11 +294,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");
                });
        }
    }
@@ -520,19 +306,14 @@
    //页面初始化
    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;
@@ -542,48 +323,32 @@
                    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;
@@ -598,22 +363,13 @@
                    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) {
@@ -623,60 +379,41 @@
                        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');
            });
         })
    }
    //排序
@@ -686,13 +423,9 @@
        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);
@@ -714,9 +447,7 @@
        } 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;
@@ -775,20 +506,18 @@
        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事件
@@ -796,21 +525,18 @@
        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事件
@@ -821,8 +547,7 @@
    //搜索产品
    searchProduct(event) {
        this.showSpinner = true;
        searchConsumableorderdetails({
            userWorkLocationStr: this.userWorkLocation,
      searchConsumableorderdetails({userWorkLocationStr:this.userWorkLocation,
            agencyProTypeStr: this.agencyProType,
            accountNameStr: this.accountName,
            accountIdStr: this.accountid,
@@ -837,15 +562,12 @@
            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();
@@ -858,7 +580,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 {
@@ -866,9 +588,9 @@
                    }
                }
            })
            .catch((error) => {
                console.log('Error:' + error);
            });
            .catch(error=>{
               console.log("Error:"+error);
            })
    }
    //清除搜索栏
@@ -894,14 +616,11 @@
            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();
@@ -910,33 +629,27 @@
                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事件
@@ -963,9 +676,7 @@
            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,
@@ -973,27 +684,23 @@
            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');
            }
        });
      })
    }
    //保存订单(驳回)
@@ -1004,41 +711,36 @@
            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',
@@ -1049,10 +751,10 @@
                this[NavigationMixin.Navigate](config);
            } else {
                this.showSpinner = false;
                console.log('Error:' + result.errorMsg);
               console.log("Error:"+result.errorMsg);
                this.showMyToast('编辑失败', result.errorMsg, 'error');
            }
        });
         })
    }
    //打印配置单
@@ -1061,8 +763,7 @@
        const config = {
            type: 'standard__webPage',
            attributes: {
                url:
                    site + '/consumable/PrintConsumblePDF?ESetid=' + this.esetId
            url: site+'/consumable/PrintConsumblePDF?ESetid='+this.esetId
            }
        };
        this[NavigationMixin.Navigate](config);
@@ -1076,7 +777,7 @@
    //提交订单
    submitOrder(event) {
        sorder({ eSetidStr: this.esetId, accountidStr: this.accountid })
            .then((result) => {
         .then(result=>{
                if (result.result == 'Success') {
                    const config = {
                        type: 'standard__webPage',
@@ -1089,16 +790,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);
         })
    }
    //删除订单
@@ -1106,7 +807,8 @@
        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',
@@ -1117,10 +819,10 @@
                this[NavigationMixin.Navigate](config);
            } else {
                this.showSpinner = false;
                console.log('Error:' + result.errorMsg);
               console.log("Error:"+result.errorMsg);
                this.showMyToast('删除失败', result.errorMsg, 'error');
            }
        });
         })
    }
    //特价金额录入
@@ -1133,13 +835,7 @@
            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;
@@ -1150,12 +846,7 @@
            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;
@@ -1164,7 +855,8 @@
    //再申请
    reapplyOrder(event) {
        backOrder({ eSetidStr: this.esetId }).then((result) => {
      backOrder({eSetidStr:this.esetId})
         .then(result=>{
            if (result.result == 'Success') {
                const config = {
                    type: 'standard__webPage',
@@ -1175,10 +867,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事件
@@ -1192,11 +884,7 @@
    //是否显示附件移除
    get attDelBtn() {
        if (
            this.fileName != '' &&
            this.fileName != null &&
            this.fileName != '请选择一个文件上传'
        ) {
      if(this.fileName != '' && this.fileName != null && this.fileName != '请选择一个文件上传'){
            return true;
        } else {
            return false;
@@ -1226,16 +914,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 = '请选择一个文件上传';
        }
    }
@@ -1243,22 +931,18 @@
    //调用上传附件后台方法
    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');
            });
@@ -1267,28 +951,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',
@@ -1305,55 +989,46 @@
    //打开搜索弹窗,并初始化弹窗
    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
@@ -1419,37 +1094,27 @@
                    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 {
@@ -1460,57 +1125,46 @@
    //打开合同检索弹窗并初始化
    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) {
@@ -1549,12 +1203,7 @@
            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,
@@ -1564,37 +1213,27 @@
                    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 {
@@ -1612,18 +1251,12 @@
            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';
@@ -1644,14 +1277,10 @@
        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;
@@ -1679,17 +1308,12 @@
            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;
@@ -1710,20 +1334,10 @@
    }
    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/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,33 +16,24 @@
    </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>
@@ -50,22 +41,12 @@
                                <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>
@@ -73,22 +54,12 @@
                                <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>
@@ -96,22 +67,13 @@
                                <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>
@@ -119,53 +81,36 @@
                                <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>
@@ -173,22 +118,12 @@
                                <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>
@@ -196,22 +131,12 @@
                                <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>
@@ -219,22 +144,12 @@
                                <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>
@@ -242,40 +157,32 @@
                                <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,72 +39,47 @@
    }
    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));
            }).catch((error) => {
                console.log('error = ' + JSON.stringify(error))
                    this.showToast('Error', r.msg);
                });
            })
        }
    }
@@ -123,6 +98,6 @@
    }
    closePage() {
        window.location.href = '/s/lexconsumableaccount';
        window.location.href = "/s/lexconsumableaccount";
    }
}
force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.html
@@ -2,10 +2,7 @@
    <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>
@@ -14,53 +11,23 @@
    </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">
@@ -70,103 +37,42 @@
                        </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>
@@ -174,15 +80,8 @@
                    </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">
@@ -192,15 +91,9 @@
                        </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,12 +4,11 @@
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 = '';
@@ -32,7 +31,7 @@
    connectedCallback() {
        this.showSpinner = true;
        initPage()
            .then((result) => {
            .then(result=>{
                this.isNoteStay = result.isNoteStay;
                if (result.result == 'Success') {
                    this.provinceOpts = result.provinceOpts;
@@ -49,20 +48,16 @@
                    }
                    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,
@@ -71,21 +66,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");
                });
        }
    }
@@ -137,33 +132,23 @@
    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 {
@@ -171,38 +156,28 @@
                }
                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 {
@@ -210,7 +185,7 @@
                }
                this.dispatchEvent(evt);
            }
        });
            })
    }
    showMyToast(title, message, variant) {
@@ -223,18 +198,12 @@
            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,21 +10,22 @@
/* --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;
@@ -34,8 +35,8 @@
    height: 36px;
    border-radius: 4px;
    opacity: 1;
    background: #090f84;
    color: #ffffff;
    background:#090F84;
    color:#FFFFFF;
}
.lexclearStyle {
    font-size: 18px;
@@ -45,27 +46,30 @@
    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 {
@@ -89,10 +93,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);
}
@@ -101,8 +105,10 @@
    font-size: 16px;
    font-family: 'sans-serif';
    font-weight: 500;
}
/* input 字体大小 by Link */
.inputFont {
    font-size: 14px;
force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.html
@@ -12,4 +12,5 @@
            disabled={isDisabledAttachment}
        ></lightning-combobox>
    </div>
</template>
force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.js
@@ -7,30 +7,19 @@
    @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,27 +5,24 @@
    @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,19 +1,16 @@
<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,8 +1,3 @@
<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,8 +1,3 @@
<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,7 +2,6 @@
    <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,7 +1,3 @@
<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,7 +1,3 @@
<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,10 +1,11 @@
<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,5 +3,6 @@
        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,6 +1,3 @@
<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,10 +1,3 @@
<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,6 +1,8 @@
<!-- 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,7 +1,5 @@
<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 +1,3 @@
<template> </template>
<template>
</template>
force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.js
@@ -23,97 +23,77 @@
    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,22 +1,8 @@
<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,44 +19,26 @@
    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,14 +3,8 @@
        <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">
@@ -19,17 +13,10 @@
                </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">
@@ -38,63 +25,37 @@
                        </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>
@@ -104,53 +65,22 @@
                    <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>
@@ -158,14 +88,8 @@
                </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">
@@ -174,32 +98,14 @@
                        </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,10 +6,12 @@
// 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;
@@ -26,7 +28,7 @@
    @track strRtColumus = '';
    //分页start
    @track sortBy = '';
    @track sortBy = "";
    //@track sortDirection = "asc";
    @track pageSize = 10;
    error;
@@ -42,14 +44,17 @@
    @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},
@@ -115,366 +120,234 @@
    @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");
                });
        }
    }
@@ -483,6 +356,7 @@
    connectedCallback() {
        this.loader = true;
        this.init();
    }
    init() {
        this.showSpinner = true;
@@ -490,7 +364,7 @@
            pageSizeLWC: this.pageSize,
            pageTokenLWC: this.currentPageToken
        })
            .then((result) => {
            .then(result => {
                if (result.result == 'Success') {
                    console.log('result==>' + JSON.stringify(result));
                    //分页start
@@ -498,12 +372,9 @@
                    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
@@ -520,66 +391,35 @@
                    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;
@@ -588,15 +428,12 @@
                    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() {
@@ -636,16 +473,14 @@
        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) {
@@ -672,17 +507,15 @@
        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;
@@ -694,6 +527,8 @@
        } else {
            this.searchOpp();
            this.showSpinner = false;
        }
    }
    searchOpp() {
@@ -709,9 +544,8 @@
            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;
@@ -728,73 +562,45 @@
                    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));
            });
@@ -805,22 +611,24 @@
        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) {
@@ -833,18 +641,12 @@
            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) {
@@ -864,27 +666,18 @@
    }
    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;
@@ -895,16 +688,11 @@
                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;
@@ -914,13 +702,11 @@
            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;
@@ -937,14 +723,12 @@
        }
    }
    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() {
@@ -953,8 +737,7 @@
    }
    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();
    }
Diff truncated after the above file
force-app/main/default/lwc/lexInventory/lexInventory.html force-app/main/default/lwc/lexInventory/lexInventory.js force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.html force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.js force-app/main/default/lwc/lexLookup/lexLookup.html force-app/main/default/lwc/lexLookup/lexLookup.js force-app/main/default/lwc/lexNewOrder/lexNewOrder.html 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/pages/DealerInquiryModifyState.page force-app/main/default/pages/DealerInquiryModifyState.page-meta.xml force-app/main/default/triggers/ContentDocumentLink.trigger force-app/main/default/triggers/ContentDocumentTrigger.trigger manifest/LEXC01packagelexcommunitynew.xml manifest/LEXC02packagelexcommunityupdate.xml