From dd004276162a2bf9d042ff0aaa569dc30a95d827 Mon Sep 17 00:00:00 2001
From: binxie <137736985@qq.com>
Date: 星期一, 26 六月 2023 14:23:26 +0800
Subject: [PATCH] newbackup0626
---
force-app/main/default/lwc/lexNewOrder/lexNewOrder.js | 16
force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.html | 4
manifest/LEXC01packagelexcommunitynew.xml | 14
force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html | 9
force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.html | 17
force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js | 330
force-app/main/default/lwc/lexTopPage/lexTopPage.js | 622
force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.js | 84
force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.html | 9
force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.html | 1
force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.html | 13
force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html | 198
manifest/LEXC02packagelexcommunityupdate.xml | 34
force-app/main/default/lwc/lexCustomLightningDatatable/customShippingUnitPrice.html | 5
force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.js | 35
force-app/main/default/lwc/customOutputGood/customOutputGood.html | 41
force-app/main/default/classes/ResponseBodyLWC.cls | 19
force-app/main/default/lwc/lexAgencyOppCusCell/lexAgencyOppCusCell.html | 17
force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.js | 48
force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html | 360
force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.html | 12
force-app/main/default/lwc/customLightningDatatable/customLightningDatatable.js | 2
.sf/config.json | 2
force-app/main/default/classes/LexOutboundorderImportController.cls | 17
force-app/main/default/lwc/lexAgencyOppCusCell/lexAgencyOppCusCell.js | 33
force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js | 409
force-app/main/default/classes/LexArriveGsDetailsController.cls | 109
force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.js | 212
force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.js | 27
force-app/main/default/classes/LexTopPageController.cls | 529
force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html | 17
force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.js | 773 +
force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.html | 455
force-app/main/default/classes/LexUtility.cls | 5
force-app/main/default/lwc/lexLookup/lexLookup.html | 216
force-app/main/default/classes/LexSearchContractController.cls | 49
force-app/main/default/lwc/myCustomTypeDatatable/customNumber.html | 10
force-app/main/default/classes/LexArriveGoodsMainController.cls | 80
force-app/main/default/classes/LexProductLimitEditController.cls | 53
force-app/main/default/lwc/lexCustomLightningDatatable/customReturnGoodInput.html | 6
force-app/main/default/lwc/commonToast/commonToast.js | 38
force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js | 35
force-app/main/default/classes/LexConInvoiceViewController.cls | 86
force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.html | 182
force-app/main/default/classes/LexSearchHospitalController.cls | 21
force-app/main/default/lwc/lexCustomLightningDatatable/customTableCellIcon.html | 5
force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.html | 135
force-app/main/default/lwc/myCustomTypeDatatable/myCustomTypeDatatable.js | 17
force-app/main/default/lwc/lexInventory/lexInventory.js | 1486 +-
force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomDiffReason.html | 4
force-app/main/default/classes/LexConsumableGoodsInfo.cls | 683
force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html | 173
force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.css | 34
force-app/main/default/classes/LexInventoryViewController.cls | 50
force-app/main/default/lwc/myCustomTypeDatatable/myCustomTypeDatatable.html | 3
force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js | 453
force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.html | 20
force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js | 294
force-app/main/default/classes/LexSummonsCreatController.cls | 67
force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.html | 16
force-app/main/default/classes/LexOverdueStockController.cls | 325
force-app/main/default/classes/LexInventoryListController.cls | 79
force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js | 42
force-app/main/default/lwc/lexNewOrder/lexNewOrder.html | 18
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js | 2136 ++-
force-app/main/default/lwc/lexCustomLightningDatatable/customOutputGoods.html | 6
force-app/main/default/classes/LexConsumableAccountController.cls | 13
force-app/main/default/classes/LexSaleOrderController.cls | 25
force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.html | 181
force-app/main/default/lwc/lexCustomLightningDatatable/customAgencyOppInput.html | 7
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html | 274
force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.html | 211
force-app/main/default/lwc/lexTopPage/lexTopPage.html | 140
force-app/main/default/classes/LexConsumableAccountInfoController.cls | 2
force-app/main/default/lwc/boxorpieceType/boxorpieceType.js | 6
force-app/main/default/lwc/lexCustomLightningDatatable/customTableInput.html | 9
force-app/main/default/classes/lexSearchAgencyHospitalController.cls | 42
force-app/main/default/lwc/lexCssUtility/lexCssUtility.css | 86
force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.js | 36
force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.html | 135
force-app/main/default/lwc/customUnitComp/customUnitComp.js | 26
force-app/main/default/classes/LexInventoryController.cls | 1734 ++-
force-app/main/default/classes/LexUpAccountProLimit.cls | 121
force-app/main/default/lwc/boxorpieceType/boxorpieceType.html | 15
force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.js | 80
force-app/main/default/classes/LexConsumableController.cls | 220
force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.html | 139
force-app/main/default/lwc/myCustomTypeDatatable/customName.html | 5
force-app/main/default/classes/LexSaleAndDeliveryController.cls | 14
force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.html | 6
force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.js | 30
force-app/main/default/lwc/lexLookup/lexLookup.js | 123
force-app/main/default/classes/LexCancelRemoveBoxController.cls | 814 +
force-app/main/default/lwc/lexInventory/lexInventory.html | 304
force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.js | 289
force-app/main/default/classes/LexLicenceReminderController.cls | 21
force-app/main/default/lwc/lexCustomLightningDatatable/customdeleteReason.html | 4
force-app/main/default/lwc/myCustomTypeDatatable/customUnit.html | 2
force-app/main/default/classes/LexConsumableAccountSOQL.cls | 27
force-app/main/default/classes/LexRemoveBoxController.cls | 759
force-app/main/default/lwc/lexCustomTableInput/lexCustomTableInput.js | 66
force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.js | 206
force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.js | 52
force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.js | 9
force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html | 355
force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.js | 213
force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentNumber.html | 11
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html | 1104 +
force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js | 809 +
force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.js | 35
force-app/main/default/labels/CustomLabels.labels-meta.xml | 4
force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.js | 28
force-app/main/default/permissionsets/Community_LEX_PS.permissionset-meta.xml | 164
force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.js | 111
force-app/main/default/lwc/lexCustomTableInput/lexCustomTableInput.html | 18
force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js | 518
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js | 1210 +-
force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.html | 173
force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.html | 325
force-app/main/default/lwc/lexConsumable/lexConsumable.js | 3038 +++--
force-app/main/default/lwc/lexConsumable/lexConsumable.html | 934 +
force-app/main/default/triggers/ContentDocumentTrigger.trigger | 6
force-app/main/default/lwc/commonToast/commonToast.html | 19
force-app/main/default/triggers/ContentDocumentLink.trigger | 6
force-app/main/default/lwc/lexCustomLightningDatatable/customInventoryColor.html | 7
force-app/main/default/lwc/lexCustomLightningDatatable/customOutboundCount.html | 7
force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.html | 14
force-app/main/default/classes/LexConInvoicedetailsController.cls | 52
force-app/main/default/lwc/customOutputGood/customOutputGood.js | 57
force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentAmount.html | 6
force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.html | 70
force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.js | 691
132 files changed, 16,897 insertions(+), 10,621 deletions(-)
diff --git a/.sf/config.json b/.sf/config.json
index 5b4e627..1a4cc75 100644
--- a/.sf/config.json
+++ b/.sf/config.json
@@ -1,3 +1,3 @@
{
"target-org": "OlympusDev"
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexArriveGoodsMainController.cls b/force-app/main/default/classes/LexArriveGoodsMainController.cls
index 57746d1..d79a1a0 100644
--- a/force-app/main/default/classes/LexArriveGoodsMainController.cls
+++ b/force-app/main/default/classes/LexArriveGoodsMainController.cls
@@ -1,13 +1,13 @@
public without sharing class LexArriveGoodsMainController {
/*****************妞滅储鐢�******************/
//缁忛攢鍟嗕骇鍝佸垎绫�
- public static String agencyProType {get;set;}
+ public static String agencyProType { get; set; }
// public static Consumable_order__c coc { get; set; }
public static String category1 { get; set; }
private static String cate1ForSort = null;
private static Date cate2ForSort = Date.today();
private static Date cate2 = Date.today();
- private static String[] columus = new String[]{ 'Product2__c.Name'};
+ private static String[] columus = new List<String>{ 'Product2__c.Name' };
// 浜у搧 ID
private static String ESetId = '';
private static String accountid = null;
@@ -21,25 +21,25 @@
// 鐧诲綍鑰呭伐浣滃湴
private static String userWorkLocation;
// 20200904 ljh 姹囨�讳娇鐢� start
- public static Integer Total_num {get; set;}
- public static Integer OrderNumber_arrived {get; set;}
- public static Integer Delivery_detail_count {get; set;}
- public static Integer OrderNumber_notarrive {get; set;}
- public static Integer More_than_seven_days {get; set;}
+ public static Integer Total_num { get; set; }
+ public static Integer OrderNumber_arrived { get; set; }
+ public static Integer Delivery_detail_count { get; set; }
+ public static Integer OrderNumber_notarrive { get; set; }
+ public static Integer More_than_seven_days { get; set; }
@AuraEnabled
- public static Results init(){
+ public static Results init() {
Results results = new Results();
results.isNoteStay = LexUtility.getIsNoteStay();
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;
- if(String.isBlank(Useracc[0].UserPro_Type__c)){
+ if (String.isBlank(Useracc[0].UserPro_Type__c)) {
agencyProType = 'ET';
}
// 鑾峰緱璁㈠崟涓�瑙�
@@ -62,7 +62,18 @@
for (String s : column) {
soql += ',' + s;
}
- soql += ' from Consumable_order__c where Order_type__c = \''+'璁㈠崟'+'\' and recordtypeid =\'' + System.Label.RT_ConOrder_Delivery + '\' and Dealer_Info__c =\'' + accountid +'\' and Order_ProType__c =\'' + agencyProType +'\' and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_Owner_WorkLocal__c = \'' + userWorkLocation + '\' and showFalseNotshowTrue__c = false order by Deliver_date__c'; //
+ soql +=
+ ' from Consumable_order__c where Order_type__c = \'' +
+ '璁㈠崟' +
+ '\' and recordtypeid =\'' +
+ System.Label.RT_ConOrder_Delivery +
+ '\' and Dealer_Info__c =\'' +
+ accountid +
+ '\' and Order_ProType__c =\'' +
+ agencyProType +
+ '\' and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_Owner_WorkLocal__c = \'' +
+ userWorkLocation +
+ '\' and showFalseNotshowTrue__c = false order by Deliver_date__c'; //
// soql = 'select id,name,ContractNo__c,Total_num__c,OrderNumber_arrived__c,Delivery_detail_count__c,OrderNumber_notarrive__c,More_than_seven_days__c,Shipment_date__c,First_Delivery__c from Consumable_order__c where id in :idList';
raesList = Database.query(soql);
//20200904 ljh add start
@@ -71,22 +82,22 @@
Delivery_detail_count = 0;
OrderNumber_notarrive = 0;
More_than_seven_days = 0;
- System.debug('-----1------'+raesList);
- for(Consumable_order__c conorder :raesList){
- if(conorder.Total_num__c != null){
- Total_num += (Integer)conorder.Total_num__c;
+ System.debug('-----1------' + raesList);
+ for (Consumable_order__c conorder : raesList) {
+ if (conorder.Total_num__c != null) {
+ Total_num += (Integer) conorder.Total_num__c;
}
- if(conorder.OrderNumber_arrived__c != null){
- OrderNumber_arrived += (Integer)conorder.OrderNumber_arrived__c;
+ if (conorder.OrderNumber_arrived__c != null) {
+ OrderNumber_arrived += (Integer) conorder.OrderNumber_arrived__c;
}
- if(conorder.Delivery_detail_count__c != null){
- Delivery_detail_count += (Integer)conorder.Delivery_detail_count__c;
+ if (conorder.Delivery_detail_count__c != null) {
+ Delivery_detail_count += (Integer) conorder.Delivery_detail_count__c;
}
- if(conorder.OrderNumber_notarrive__c != null){
- OrderNumber_notarrive += (Integer)conorder.OrderNumber_notarrive__c;
+ if (conorder.OrderNumber_notarrive__c != null) {
+ OrderNumber_notarrive += (Integer) conorder.OrderNumber_notarrive__c;
}
- if(conorder.More_than_seven_days__c != null){
- More_than_seven_days += (Integer)conorder.More_than_seven_days__c;
+ if (conorder.More_than_seven_days__c != null) {
+ More_than_seven_days += (Integer) conorder.More_than_seven_days__c;
}
}
results.agencyProType = agencyProType;
@@ -108,7 +119,13 @@
}
@AuraEnabled
- public static Results searchConsumableorderdetails(String category1Str, Date cate2Str, String accountidStr, String userWorkLocationStr, String agencyProTypeStr){
+ public static Results searchConsumableorderdetails(
+ String category1Str,
+ Date cate2Str,
+ String accountidStr,
+ String userWorkLocationStr,
+ String agencyProTypeStr
+ ) {
Results results = new Results();
category1 = category1Str;
cate2 = cate2Str;
@@ -137,16 +154,23 @@
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)) {
soql += ' and Name like \'%' + String.escapeSingleQuotes(category1.replaceAll('%', '\\%')) + '%\' ';
}
- if(cate2 != null){
+ if (cate2 != null) {
soql += ' and Shipment_date__c = :cate2 ';
}
- soql += ' and Order_ProType__c =\'' + agencyProType +'\'';
+ soql += ' and Order_ProType__c =\'' + agencyProType + '\'';
soql += ' order by Deliver_date__c';
system.debug('====soql:' + soql);
raesList = Database.query(soql);
diff --git a/force-app/main/default/classes/LexArriveGsDetailsController.cls b/force-app/main/default/classes/LexArriveGsDetailsController.cls
index 69da85c..c58d900 100644
--- a/force-app/main/default/classes/LexArriveGsDetailsController.cls
+++ b/force-app/main/default/classes/LexArriveGsDetailsController.cls
@@ -19,45 +19,72 @@
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 == '') {
-
- }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
- FROM Consumable_order__c
- WHERE id =:eSetId];
- coc = new Consumable_order__c();
- if(rs.size()>0){
+ 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
+ FROM Consumable_order__c
+ WHERE id = :eSetId
+ ];
+ coc = new Consumable_order__c();
+ if (rs.size() > 0) {
coc = rs[0];
orderallcount = coc.Arrive_Order__r.Total_num__c;
}
- if(coc.Arrive_Order__c == null){
+ 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,
- 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 ];
+ 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
+ ];
for (Integer i = 0; i < consumablearriveproductdetailsSelected.size(); i++) {
- consumableorderdetailsRecords.add(new ConsumableorderdetailsInfo(consumablearriveproductdetailsSelected[i]));
- }
+ consumableorderdetailsRecords.add(new ConsumableorderdetailsInfo(consumablearriveproductdetailsSelected[i]));
+ }
}
- for(ConsumableorderdetailsInfo bss : consumableorderdetailsRecords){
+ for (ConsumableorderdetailsInfo bss : consumableorderdetailsRecords) {
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
}
@@ -65,7 +92,7 @@
//add by rentx 20210622 CHAN-C3K4ZQ
// makeRecordsView(consumableorderdetailsRecords);
//add by rentx 20210622 CHAN-
- for(ConsumableorderdetailsInfo con : consumableorderdetailsRecords){
+ for (ConsumableorderdetailsInfo con : consumableorderdetailsRecords) {
con.prodName = con.esd.Consumable_Product__r.Name__c;
}
results.coc = coc;
@@ -90,25 +117,28 @@
try {
orderallcount = orderallcountParm;
consumableorderdetailsCount = consumableorderdetailsCountParm;
- coc = (Consumable_order__c)JSON.deserialize(cocStr, Consumable_order__c.class);
+ 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
- FROM Consumable_order_details2__c
- WHERE Consumable_order_minor__c =:coc.Arrive_Order__c
- AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- AND Dealer_Arrive__c = true ];
- if(orderallcount!= consumableorderdetailsCount){
+ orderdetails = [
+ SELECT Id
+ FROM Consumable_order_details2__c
+ WHERE
+ Consumable_order_minor__c = :coc.Arrive_Order__c
+ AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
+ AND Dealer_Arrive__c = TRUE
+ ];
+ if (orderallcount != consumableorderdetailsCount) {
results.result = 'Fail';
results.errorMsg = '璁㈠崟涓嶅畬鍏ㄥ埌璐э紝鏃犳硶鍑哄簱';
return results;
}
- if(coc.Arrive_Order__r.IsShipment__c == true){
+ if (coc.Arrive_Order__r.IsShipment__c == true) {
results.result = 'Fail';
results.errorMsg = '璁㈠崟宸茬粡鍑哄簱';
return results;
}
- results.url = '/lexsummonscreat?arriveorder=' + eSetId +'&KeyWords=Redirect';
+ results.url = '/lexsummonscreat?arriveorder=' + eSetId + '&KeyWords=Redirect';
results.result = 'Success';
} catch (Exception e) {
results.result = 'Fail';
@@ -144,7 +174,7 @@
@AuraEnabled
public Consumable_order_details2__c esd;
@AuraEnabled
- public Product2__c Prod;
+ public Product2__c Prod;
@AuraEnabled
public Decimal packing_list;
@AuraEnabled
@@ -157,7 +187,6 @@
public String Sterilization_limitStr;
@AuraEnabled
public String prodName;
-
// 宸插瓨鍦ㄦ秷鑰楀搧鏄庣粏鐢�
public ConsumableorderdetailsInfo(Consumable_order_details2__c e) {
diff --git a/force-app/main/default/classes/LexCancelRemoveBoxController.cls b/force-app/main/default/classes/LexCancelRemoveBoxController.cls
index 7bd832f..24ddae3 100644
--- a/force-app/main/default/classes/LexCancelRemoveBoxController.cls
+++ b/force-app/main/default/classes/LexCancelRemoveBoxController.cls
@@ -1,6 +1,6 @@
public with sharing class LexCancelRemoveBoxController {
//缁忛攢鍟嗕骇鍝佸垎绫�
- public static String agencyProType {get;set;}
+ public static String agencyProType { get; set; }
public static String userPro_Typestr = null;
public static String barcode { get; set; }
/*****************鐢婚潰琛ㄧずBean******************/
@@ -9,32 +9,32 @@
public static List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordserror { get; set; }
//鎷嗙洅鏄庣粏
public static List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy { get; set; }
- public static boolean saveFLGbln {get;set;}
+ public static boolean saveFLGbln { get; set; }
//閿欒淇℃伅
- public static String alertMessage {set;get;}
+ public static String alertMessage { get; set; }
//鎷嗙洅鏄庣粏浠舵暟
- public static Integer getinventorysize(){
+ public static Integer getinventorysize() {
return ConsumableorderdetailsRecordsdummy.size();
}
public static Map<String, String> ExistIdMap = new Map<String, String>();
public static Map<String, String> ErrorIdMap = new Map<String, String>();
public static Map<String, String> AllMap = new Map<String, String>();
- public static List<String> BarCodeListP = new List<String>();
+ public static List<String> BarCodeListP = new List<String>();
//涓嶇鍚堢殑barcode鍜屽瀷鍙�
- public static list<String> notInlist = new list<String>();
- public static String baseUrl {get;private set;}
+ 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;
//public String[] proidList =new String[]{};
// 鐧诲綍鑰呭伐浣滃湴
private static String userWorkLocation;
- public LexCancelRemoveBoxController(){
+ public LexCancelRemoveBoxController() {
baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>();
ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>();
consumableInventory = new List<ConsumableorderdetailsInfo>();
- saveFLGbln = FALSE;
+ saveFLGbln = false;
}
@AuraEnabled
@@ -44,39 +44,38 @@
res.entity = data;
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;
- if(String.isBlank(Useracc[0].UserPro_Type__c)){
+ if (String.isBlank(Useracc[0].UserPro_Type__c)) {
agencyProType = 'ET';
}
userPro_Typestr = '%' + agencyProType + '%';
- List<account> accountInfo = [SELECT Name FROM account WHERE id =:accountid];
+ List<account> accountInfo = [SELECT Name FROM account WHERE id = :accountid];
//String view_product = accountInfo[0].view_product__c;
accountName = accountInfo[0].Name;
//proidList = view_product.split(',');
- data.put('accountName',accountName);
- data.put('userWorkLocation',userWorkLocation);
- data.put('agencyProType',agencyProType);
+ data.put('accountName', accountName);
+ data.put('userWorkLocation', userWorkLocation);
+ data.put('agencyProType', agencyProType);
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
return res;
-
}
// 灏嗛〉闈㈡垨鍙栧緱BarCode鍘绘帀閲嶅鐨勶紝杞崲鎴怢ist
- public static List<String> ParseBarCode(String Code){
- String[] Cache = new String[]{};
+ public static List<String> ParseBarCode(String Code) {
+ String[] Cache = new List<String>{};
Cache = Code.split('\n');
- Set <String> Buff = new Set<String>();
- for(String A : Cache){
+ Set<String> Buff = new Set<String>();
+ for (String A : Cache) {
Buff.add(A);
}
List<String> outPut = new List<String>();
- for(String B :Buff){
+ for (String B : Buff) {
B = B.trim();
outPut.add(B);
}
@@ -85,9 +84,14 @@
//鑾峰彇鏄庣粏
@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>();
+ Map<String, object> data = new Map<String, object>();
res.entity = data;
userPro_Typestr = '%' + agencyProType + '%';
barcode = barcode;
@@ -97,20 +101,18 @@
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;
- alertMessage='';
+ saveFLGbln = false;
+ alertMessage = '';
//鍒ゆ柇barcode鏄惁涓虹┖
- if(barcode == null || barcode ==''){
- return new ResponseBodyLWC('Error',500, '璇疯緭鍏arCode鍙�', '');
+ if (barcode == null || barcode == '') {
+ return new ResponseBodyLWC('Error', 500, '璇疯緭鍏arCode鍙�', '');
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'璇疯緭鍏arCode鍙枫��'));
// return;
}
@@ -122,309 +124,416 @@
// 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,
- //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
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c = : userWorkLocation
- AND (not Product_Type__c like : userPro_Typestr)
- ORDER BY Name ];
- if(reSet1.size() > 0){
+ 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
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c = :userWorkLocation
+ 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)){
+ if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- }else{
- String str = '璇ュ晢鍝佺被鍨�'+ reSet1[i].Product_Type__c +'涓庝骇鍝佺被鍨�'+ agencyProType +'涓嶇,涓嶈兘鎷嗙洅';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ } else {
+ String str = '璇ュ晢鍝佺被鍨�' + reSet1[i].Product_Type__c + '涓庝骇鍝佺被鍨�' + agencyProType + '涓嶇,涓嶈兘鎷嗙洅';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
}
//娌℃湁鎷嗙洅
- reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
- Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
- Deliver_date__c,Bar_Code__c,
- 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
- AND Box_Piece__c = '鐩�'
- //AND ProductPacking_list_manual__c > 1
- AND Bar_Code__c in :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name ]; //娌″嚭搴擄紝娌¢攢鍞紝鍦ㄥ簱锛屾病鏈夋媶鐩�
- if(reSet1.size() > 0){
+ 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
+ AND Box_Piece__c = '鐩�'
+ //AND ProductPacking_list_manual__c > 1
+ AND Bar_Code__c IN :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name
+ ]; //娌″嚭搴擄紝娌¢攢鍞紝鍦ㄥ簱锛屾病鏈夋媶鐩�
+ if (reSet1.size() > 0) {
for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- }else{
+ } else {
String str = '璇ュ晢鍝佹病鏈夋媶鐩�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
}
//宸插嚭璐э紝鏈埌璐�
- reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
- Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
- Deliver_date__c,Bar_Code__c,
- 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
- 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 Bar_Code__c in :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name ];
- if(reSet1.size() > 0){
+ 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
+ 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 Bar_Code__c IN :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name
+ ];
+ if (reSet1.size() > 0) {
for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- }else{
+ } else {
String str = '璇ュ晢鍝佽繕鏈埌璐�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
}
//鎷嗙洅宸插嚭璐�
- reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
- Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
- Deliver_date__c,Bar_Code__c,
- 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
- AND Box_Piece__c = '涓�'
- AND RemoveBox_date__c != null
- AND Bar_Code__c in :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name ];
- if(reSet1.size() > 0){
+ 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
+ AND Box_Piece__c = '涓�'
+ AND RemoveBox_date__c != NULL
+ AND Bar_Code__c IN :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name
+ ];
+ if (reSet1.size() > 0) {
for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- }else{
+ } else {
String str = '璇ュ晢鍝佸瓨鍦ㄥ嚭璐у饱鍘�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
}
//鎷嗙洅宸查攢鍞�
- reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
- Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
- Deliver_date__c,Bar_Code__c,
- 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
- AND Box_Piece__c = '涓�'
- AND RemoveBox_date__c != null
- AND Bar_Code__c in :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name ];
- if(reSet1.size() > 0){
+ 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
+ AND Box_Piece__c = '涓�'
+ AND RemoveBox_date__c != NULL
+ AND Bar_Code__c IN :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name
+ ];
+ if (reSet1.size() > 0) {
for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- }else{
+ } else {
String str = '璇ュ晢鍝佸瓨鍦ㄩ攢鍞饱鍘�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
}
//鎷嗙洅杩斿搧
- reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
- Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
- Deliver_date__c,Bar_Code__c,
- 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
- AND Box_Piece__c = '涓�'
- AND RemoveBox_date__c != null
- AND Bar_Code__c in :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name ];
- if(reSet1.size() > 0){
+ 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
+ AND Box_Piece__c = '涓�'
+ AND RemoveBox_date__c != NULL
+ AND Bar_Code__c IN :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name
+ ];
+ if (reSet1.size() > 0) {
for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- }else{
+ } else {
String str = '璇ュ晢鍝佸瓨鍦ㄨ繑鍝佸饱鍘�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
}
-
//鎷嗙洅鍚庣洏鐐硅繃(鐩樼偣鏃ユ湡涓嶄负绌�)
- reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
- Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
- Deliver_date__c,Bar_Code__c,
- 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
- AND Box_Piece__c = '涓�'
- AND RemoveBox_date__c != null
- AND Bar_Code__c in :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name ];
- if(reSet1.size() > 0){
+ 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
+ AND Box_Piece__c = '涓�'
+ AND RemoveBox_date__c != NULL
+ AND Bar_Code__c IN :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name
+ ];
+ if (reSet1.size() > 0) {
for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- }else{
+ } else {
String str = '璇ュ晢鍝佸瓨鍦ㄧ洏鐐瑰饱鍘�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
}
//涓嶅悓宸ヤ綔鍦�
- reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
- Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
- Deliver_date__c,Bar_Code__c,
- 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
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c !=: userWorkLocation
- ORDER BY Name ];
- if(reSet1.size() > 0){
+ 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
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c != :userWorkLocation
+ ORDER BY Name
+ ];
+ if (reSet1.size() > 0) {
for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- }else{
+ } else {
String str = '璇ュ晢鍝佸睘浜�' + reSet1[i].Arrive_Owner_Work_Location__c + ',涓嶈兘鍙栨秷鎷嗙洅';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
}
- reSet = [SELECT Id,
- Name,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Consumable_Product__r.Name__c,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- Dealer_Arrive__c,
- Guarantee_period_for_products__c,
- CFDA_Status__c,
- ProductPacking_list_manual__c,
- Report_Product_Approbation__c,
- Report_Product_Expiration__c,
- //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
- AND Box_Piece__c = '涓�'
- 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
- ];
- if(reSet.size()>0){
+ reSet = [
+ SELECT
+ Id,
+ Name,
+ Intra_Trade_List_RMB__c,
+ Asset_Model_No__c,
+ Consumable_Product__c,
+ Consumable_Product__r.Name,
+ Consumable_Product__r.Name__c,
+ Sterilization_limit__c,
+ Deliver_date__c,
+ Bar_Code__c,
+ Arrive_date__c,
+ Send_Date__c,
+ Consumable_order_minor__r.Name,
+ Consumable_order_minor__c,
+ Dealer_Arrive__c,
+ Guarantee_period_for_products__c,
+ CFDA_Status__c,
+ ProductPacking_list_manual__c,
+ Report_Product_Approbation__c,
+ Report_Product_Expiration__c,
+ //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
+ AND Box_Piece__c = '涓�'
+ 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
+ ];
+ if (reSet.size() > 0) {
for (Integer i = 0; i < reSet.size(); i++) {
- if(ErrorIdMap.containsKey(reSet[i].Bar_Code__c) ){
+ 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);
+ ExistIdMap.put(reSet[i].Bar_Code__c, reSet[i].Bar_Code__c);
}
}
}
@@ -432,89 +541,97 @@
AllMap.putAll(ExistIdMap);
//寰楀埌涓嶅瓨鍦ㄧ殑BarCode
- for(Integer i = 0; i < BarCodeListP.size(); i++){
- if(ExistIdMap.containsKey(BarCodeListP[i])){
+ for (Integer i = 0; i < BarCodeListP.size(); i++) {
+ if (ExistIdMap.containsKey(BarCodeListP[i])) {
continue;
- }else if(ErrorIdMap.containsKey(BarCodeListP[i])){
+ } else if (ErrorIdMap.containsKey(BarCodeListP[i])) {
continue;
- }else{
+ } else {
notInlist.add(BarCodeListP[i]);
}
}
- if(notInlist.size()>0){
- // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode'+ notInlist + '涓嶅瓨鍦ㄣ��'));
- return new ResponseBodyLWC('Error',500, 'BarCode'+ notInlist + '涓嶅瓨鍦ㄣ��', '');
+ if (notInlist.size() > 0) {
+ // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode'+ notInlist + '涓嶅瓨鍦ㄣ��'));
+ return new ResponseBodyLWC('Error', 500, 'BarCode' + notInlist + '涓嶅瓨鍦ㄣ��', '');
}
- data.put('ConsumableorderdetailsRecordsdummy',JSON.serialize(ConsumableorderdetailsRecordsdummy));
- data.put('ConsumableorderdetailsRecordserror',JSON.serialize(ConsumableorderdetailsRecordserror));
- data.put('dataSize',ConsumableorderdetailsRecordsdummy.size());
+ data.put('ConsumableorderdetailsRecordsdummy', JSON.serialize(ConsumableorderdetailsRecordsdummy));
+ data.put('ConsumableorderdetailsRecordserror', JSON.serialize(ConsumableorderdetailsRecordserror));
+ data.put('dataSize', ConsumableorderdetailsRecordsdummy.size());
res.status = 'Success';
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>();
+ Map<String, object> data = new Map<String, object>();
res.entity = data;
userPro_Typestr = '%' + agencyProType + '%';
accountName = accountName;
- userWorkLocation =userWorkLocation;
- List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy = (List<ConsumableorderdetailsInfo>)JSON.deserialize(saveConsumableorderdetailsRecordsdummy,List<ConsumableorderdetailsInfo>.class);
+ userWorkLocation = userWorkLocation;
+ 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){
+ if (ConsumableorderdetailsRecordsdummy.size() < 1) {
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'涓嶅瓨鍦ㄥ彇娑堟媶鐩掓槑缁�'));
- return new ResponseBodyLWC('Error',500, '涓嶅瓨鍦ㄥ彇娑堟媶鐩掓槑缁�', '');
+ return new ResponseBodyLWC('Error', 500, '涓嶅瓨鍦ㄥ彇娑堟媶鐩掓槑缁�', '');
// return null;
}
List<String> BarCodeList = new List<String>();
- for (ConsumableorderdetailsInfo tmp : ConsumableorderdetailsRecordsdummy) {
+ for (ConsumableorderdetailsInfo tmp : ConsumableorderdetailsRecordsdummy) {
BarCodeList.add(tmp.esd.Bar_Code__c);
}
- try{
+ try {
//鍙栧緱閫氱暘澶т簬001鐨勫湪搴撴槑缁�
- List<Consumable_order_details2__c> orderDetails2del = [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__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
+ List<Consumable_order_details2__c> orderDetails2del = [
+ 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__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
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 Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c =: userWorkLocation
- AND Product_Type__c like : userPro_Typestr
- ];
+ 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
+ ];
List<Consumable_order_details2__c> orderlistdel = new List<Consumable_order_details2__c>();
- List<Consumable_order_details2__c> orderlistupd= new List<Consumable_order_details2__c>();
-
+ List<Consumable_order_details2__c> orderlistupd = new List<Consumable_order_details2__c>();
+
for (Consumable_order_details2__c detail2tmp : orderDetails2del) {
Consumable_order_details2__c delDetails2 = new Consumable_order_details2__c();
- delDetails2.Id = detail2tmp.Id;
+ delDetails2.Id = detail2tmp.Id;
//鍒犻櫎閫氱暘澶т簬001鐨勬槑缁�2
//delete delDetails2;
@@ -522,46 +639,48 @@
}
//鍙栧緱閫氱暘001鐨勫湪搴撴槑缁�
- 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__c*/
- //add by rebtx 2020-10-13 end
+ 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__c*/
+ //add by rebtx 2020-10-13 end
// tcm start
- ,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
+ 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
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 Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c =: userWorkLocation
- AND Product_Type__c like : userPro_Typestr
- ];
+ 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
+ ];
for (Consumable_order_details2__c detail2tmp : orderDetails2) {
Consumable_order_details2__c updDetails2 = new Consumable_order_details2__c();
- updDetails2.Id = detail2tmp.Id;
- updDetails2.Box_Piece__c = '鐩�';
- updDetails2.RemoveBox_date__c = null;
- updDetails2.RemoveBox_No__c = null;
+ updDetails2.Id = detail2tmp.Id;
+ updDetails2.Box_Piece__c = '鐩�';
+ updDetails2.RemoveBox_date__c = null;
+ updDetails2.RemoveBox_No__c = null;
// tcm start
if (String.isBlank(detail2tmp.Consumable_order_minor__r.ContractNo__c)) {
- updDetails2.ContractNo_text__c= detail2tmp.ContractNo_text__c;
- }else {
- updDetails2.ContractNo_text__c= detail2tmp.Consumable_order_minor__r.ContractNo__c;
+ updDetails2.ContractNo_text__c = detail2tmp.ContractNo_text__c;
+ } else {
+ updDetails2.ContractNo_text__c = detail2tmp.Consumable_order_minor__r.ContractNo__c;
}
// updDetails2.ContractNo_text__c = detail2tmp.ContractNo__c;
// tcm end
@@ -571,29 +690,28 @@
orderlistupd.add(updDetails2);
}
- if(orderlistdel.size()>0){
+ if (orderlistdel.size() > 0) {
delete orderlistdel;
}
- if(orderlistupd.size()>0){
+ if (orderlistupd.size() > 0) {
update orderlistupd;
}
saveFLGbln = true;
alertMessage = '鍙栨秷鎷嗙洅瀹屾垚';
- data.put('saveFLGbln',saveFLGbln);
+ data.put('saveFLGbln', saveFLGbln);
res.status = 'Success';
res.code = 200;
res.msg = alertMessage;
System.debug('res = ' + res);
return res;
// return null;
- }catch(Exception e){
+ } catch (Exception e) {
Database.rollback(sp);
ApexPages.addMessages(e);
return null;
}
}
-
class ConsumableorderdetailsInfo implements Comparable {
public Consumable_order_details2__c esd { get; set; }
@@ -606,18 +724,18 @@
//public String tracingCodeNo { get; set; }
public String oldConsumableCount { get; set; }
public String ErrorReason { get; set; }
- public ConsumableorderdetailsInfo(Consumable_order_details2__c e,string str) {
- esd = e;
- Prod = e.Consumable_Product__r;
+ public ConsumableorderdetailsInfo(Consumable_order_details2__c e, string str) {
+ esd = e;
+ Prod = e.Consumable_Product__r;
oldConsumableCount = e.name;
- ErrorReason = str;
+ ErrorReason = str;
}
public ConsumableorderdetailsInfo(Consumable_order_details2__c e) {
- esd = e;
- Prod = e.Consumable_Product__r;
+ esd = e;
+ Prod = e.Consumable_Product__r;
oldConsumableCount = e.name;
}
-/*
+ /*
public ConsumableorderdetailsInfo(Product2__c e,String barCode,Date sterilizationlimit,String serialNoorLot,String tracingCode) {
esd = new Consumable_order_details2__c();
ProductName = e.Name__c;
diff --git a/force-app/main/default/classes/LexConInvoiceViewController.cls b/force-app/main/default/classes/LexConInvoiceViewController.cls
index 0173b6c..61a4641 100644
--- a/force-app/main/default/classes/LexConInvoiceViewController.cls
+++ b/force-app/main/default/classes/LexConInvoiceViewController.cls
@@ -388,7 +388,11 @@
// attachmentRecoeds.add(new InvoiceOrderInfo(attachmentinfo[i]));
// }
// }
- List<ContentVersion> cvInfo = [SELECT Id, Title, OwnerId,Owner.Name, CreatedDate,ContentDocumentId FROM ContentVersion WHERE FirstPublishLocationId = :invoiceId];
+ List<ContentVersion> cvInfo = [
+ SELECT Id, Title, OwnerId, Owner.Name, CreatedDate, ContentDocumentId
+ FROM ContentVersion
+ WHERE FirstPublishLocationId = :invoiceId
+ ];
if (cvInfo.size() > 0) {
for (Integer i = 0; i < cvInfo.size(); i++) {
attachmentRecoeds.add(new InvoiceOrderInfo(cvInfo[i]));
@@ -415,17 +419,16 @@
data.put('done', getdone());
data.put('invoiceOrderdetail1Recoeds', invoiceOrderdetail1Recoeds);
data.put('accountid', accountid);
- data.put('invoiceOrderRecoedschange',invoiceOrderRecoedschange);
- data.put('attachmentRecoeds',attachmentRecoeds);
- data.put('outOrderStringList',outOrderStringList);
- data.put('outordercountMap',outordercountMap);
+ data.put('invoiceOrderRecoedschange', invoiceOrderRecoedschange);
+ data.put('attachmentRecoeds', attachmentRecoeds);
+ data.put('outOrderStringList', outOrderStringList);
+ data.put('outordercountMap', outordercountMap);
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
return res;
}
-
//淇濆瓨
@AuraEnabled
public static ResponseBodyLWC save(
@@ -453,12 +456,12 @@
SecondDealer = SecondDealerLwc;
errorMsg = '';
deliveryId = deliveryIdLwc;
- invoiceOrderRecoeds = (List<InvoiceOrderInfo>)JSON.deserialize(invoiceOrderRecoedsLwc, List<InvoiceOrderInfo>.class);
+ invoiceOrderRecoeds = (List<InvoiceOrderInfo>) JSON.deserialize(invoiceOrderRecoedsLwc, List<InvoiceOrderInfo>.class);
invoiceId = invoiceIdLwc;
accountid = accountidLwc;
agencyProType = agencyProTypeLwc;
reopen = reopenLwc;
- invoiceOrderRecoedschange = (List<InvoiceOrderInfo>)JSON.deserialize(invoiceOrderRecoedschangeLwc, List<InvoiceOrderInfo>.class);
+ invoiceOrderRecoedschange = (List<InvoiceOrderInfo>) JSON.deserialize(invoiceOrderRecoedschangeLwc, List<InvoiceOrderInfo>.class);
List<String> chukudanID = new List<String>();
if (coc.Name == '' || coc.Name == null) {
@@ -533,7 +536,6 @@
}
} else {
if (HospitalInfo != null && HospitalInfo != '') {
-
System.debug('++++++++++++' + ass.esd.Order_ForHospital__c + ' ' + shipmentAccountString);
if (ass.esd.Order_ForHospital__c != shipmentAccountString) {
System.debug('HospitalInfo != null ass.esd.Order_ForHospital__c != shipmentAccountString');
@@ -552,7 +554,9 @@
(ass.esd.Order_ForDealerText__c != null || ass.esd.Order_ForDealerText__c != '') &&
ass.esd.ShipmentAccount__c != shipmentAccountString
) {
- System.debug('HospitalInfo == null && ass.esd.Order_ForDealerText__c != null ass.esd.ShipmentAccount__c != shipmentAccountString');
+ System.debug(
+ 'HospitalInfo == null && ass.esd.Order_ForDealerText__c != null ass.esd.ShipmentAccount__c != shipmentAccountString'
+ );
invoiceOrderAccountList.add(ass.esd.Name);
}
}
@@ -693,12 +697,12 @@
invoiceHead.Order_ProType__c = agencyProType;
invoiceHead.Order_ForCustomerText__c = coc.Order_ForCustomerText__c;
//if (deliveryId != null) {
- if (String.isNotBlank(deliveryId)) {
+ if (String.isNotBlank(deliveryId)) {
invoiceHead.Outbound_order__c = deliveryId;
}
invoiceHead.RecordTypeid = System.Label.RT_ConOrder_Invoice;
//if (SecondDealer == null) {
- if (String.isBlank(SecondDealer)) {
+ if (String.isBlank(SecondDealer)) {
if (HospitalInfo != null && HospitalInfo != '') {
invoiceHead.Order_ForHospital__c = HospitalInfo;
}
@@ -849,6 +853,8 @@
delete invoiceLinkdetList;
}
//鏂板缓鍙戠エ鏄庣粏1
+ System.debug('===>' + chukudanID);
+ System.debug('===>' + chukudanID.size());
if (chukudanID.size() > 0) {
newinvoicedetails1(chukudanID);
}
@@ -883,7 +889,7 @@
if (cocinfo.size() > 0) {
invoiceHead = cocinfo[0];
}
- if (String.isNotBlank(deliveryId)) {
+ if (String.isNotBlank(deliveryId)) {
for (InvoiceOrderInfo ass : invoiceOrderRecoedschange) {
insertDetMap.put(ass.esd.Id, invoiceHead.Id);
}
@@ -1267,13 +1273,13 @@
// 淇濆瓨闄勪欢
@AuraEnabled
- public static ResponseBodyLWC saveAttachment(String attachmentRecoedsLwc,String invoiceId) {
+ public static ResponseBodyLWC saveAttachment(String attachmentRecoedsLwc, String invoiceId) {
System.debug('杩涘叆 saveAttachment');
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
res.entity = data;
invoiceId = invoiceId;
- attachmentRecoeds = (List<InvoiceOrderInfo>)JSON.deserialize(attachmentRecoedsLwc, List<InvoiceOrderInfo>.class);
+ attachmentRecoeds = (List<InvoiceOrderInfo>) JSON.deserialize(attachmentRecoedsLwc, List<InvoiceOrderInfo>.class);
System.debug('attachmentRecoeds = ' + attachmentRecoeds);
try {
Consumable_accessories_invoice__c attachmentdetails = new Consumable_accessories_invoice__c();
@@ -1299,7 +1305,16 @@
// 妫�绱�(鏈紑鍙戠エ鍑哄簱鍗�)
@AuraEnabled
- public static ResponseBodyLWC InvoiceorderSearch(Consumable_order__c cocLwc,String invoiceIdLwc,String accountidLwc,String userWorkLocationLwc,String agencyProTypeLwc,String HospitalInfoLwc,String SecondDealerLwc,String invoiceOrderRecoedsLwc) {
+ public static ResponseBodyLWC InvoiceorderSearch(
+ Consumable_order__c cocLwc,
+ String invoiceIdLwc,
+ String accountidLwc,
+ String userWorkLocationLwc,
+ String agencyProTypeLwc,
+ String HospitalInfoLwc,
+ String SecondDealerLwc,
+ String invoiceOrderRecoedsLwc
+ ) {
System.debug('杩涘叆 InvoiceorderSearch');
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
@@ -1309,12 +1324,12 @@
HospitalInfo = HospitalInfoLwc;
SecondDealer = SecondDealerLwc;
errorMsg = '';
- invoiceOrderRecoeds = (List<InvoiceOrderInfo>)JSON.deserialize(invoiceOrderRecoedsLwc, List<InvoiceOrderInfo>.class);
+ invoiceOrderRecoeds = (List<InvoiceOrderInfo>) JSON.deserialize(invoiceOrderRecoedsLwc, List<InvoiceOrderInfo>.class);
invoiceId = invoiceIdLwc;
accountid = accountidLwc;
agencyProType = agencyProTypeLwc;
userWorkLocation = userWorkLocationLwc;
-
+
Map<String, String> invoiceOrderMap = new Map<String, String>();
String msoql = '';
List<InvoiceOrderInfo> invoiceOrderdetailMid = new List<InvoiceOrderInfo>();
@@ -1340,7 +1355,7 @@
invoiceOrderMap.put(invoiceOrderList[i].Name, invoiceOrderList[i].Name);
}
}
- data.put('invoiceOrderRecoeds',invoiceOrderRecoeds);
+ data.put('invoiceOrderRecoeds', invoiceOrderRecoeds);
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
@@ -1396,7 +1411,7 @@
// 鍒犻櫎鎸夐挳
@AuraEnabled
- public static ResponseBodyLWC deleteButton(String invoiceIdLwc,Consumable_order__c cocLwc) {
+ public static ResponseBodyLWC deleteButton(String invoiceIdLwc, Consumable_order__c cocLwc) {
System.debug('杩涘叆 deleteButton');
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
@@ -1429,7 +1444,11 @@
// 鎻愪氦鎸夐挳
@AuraEnabled
- public static ResponseBodyLWC approval(List<String> outOrderStringListLwc,Map<String, Consumable_Orderdetails__c> outordercountMapLwc,String invoiceIdLwc) {
+ public static ResponseBodyLWC approval(
+ List<String> outOrderStringListLwc,
+ Map<String, Consumable_Orderdetails__c> outordercountMapLwc,
+ String invoiceIdLwc
+ ) {
System.debug('杩涘叆 approval');
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
@@ -1437,7 +1456,7 @@
outOrderStringList = outOrderStringListLwc;
outordercountMap = outordercountMapLwc;
- invoiceId= invoiceIdLwc;
+ invoiceId = invoiceIdLwc;
//鏇存柊鍙戠エ鏄庣粏2閾炬帴
Consumable_order__c P = new Consumable_order__c();
List<Consumable_order__c> cocinfo = new List<Consumable_order__c>();
@@ -1501,6 +1520,8 @@
outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c
)
.Invoice_Unitprice__c;
+ System.debug('====>procount' + invoiceUpdte1.Invoiced_Procount__c);
+ System.debug('===>RMB' + outOrderdet1List[i].Delivery_List_RMB__c);
invoiceUpdte1.InvoicedProCost_RMB__c = invoiceUpdte1.Invoiced_Procount__c * outOrderdet1List[i].Delivery_List_RMB__c;
Decimal invoicedProcount = 0;
@@ -1521,6 +1542,8 @@
invoicedProcount = outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c)
.Invoiced_Count__c;
}
+ System.debug('鍙戠エ鏁伴噺===>' + outOrderdet1List[i].InvoiceProNot_count__c);
+ System.debug('杩樻病鍙戠エ鏁伴噺===>' + invoicedProcount);
if (outOrderdet1List[i].InvoiceProNot_count__c < invoicedProcount) {
// ApexPages.addmessage(
@@ -1534,7 +1557,16 @@
// )
// );
// return null;
- return new ResponseBodyLWC('Error', 500, '鍑哄簱鍗�' + outOrderdet1List[i].Consumable_order__r.Name + '涓紝' + outOrderdet1List[i].Asset_Model_No__c + '杩樻病寮�绁ㄦ暟閲忓皬浜庡彂绁ㄦ暟閲忥紝璇风‘璁ゆ槸鍚︽湁杩斿搧', '');
+ return new ResponseBodyLWC(
+ 'Error',
+ 500,
+ '鍑哄簱鍗�' +
+ outOrderdet1List[i].Consumable_order__r.Name +
+ '涓紝' +
+ outOrderdet1List[i].Asset_Model_No__c +
+ '杩樻病寮�绁ㄦ暟閲忓皬浜庡彂绁ㄦ暟閲忥紝璇风‘璁ゆ槸鍚︽湁杩斿搧',
+ ''
+ );
}
outOrderdetUp1List.add(invoiceUpdte1);
@@ -1570,7 +1602,7 @@
System.debug('res = ' + res);
return res;
}
-
+ @TestVisible
class InvoiceOrderInfo implements Comparable {
@AuraEnabled
public Boolean check { get; set; }
@@ -1583,12 +1615,12 @@
@AuraEnabled
public Attachment attach { get; set; }
@AuraEnabled
- public ContentVersion cvInfo{ get; set; }
+ public ContentVersion cvInfo { get; set; }
@AuraEnabled
public String mailSelectOptsin { get; set; }
public List<SelectOption> mailSelectOpts { get; set; }
@AuraEnabled
- public Map<String,String> mailSelectOptsMap { get; set; }
+ public Map<String, String> mailSelectOptsMap { get; set; }
@AuraEnabled
public String invoiceOrderId { get; set; }
@AuraEnabled
@@ -1616,7 +1648,7 @@
//ContentVersion
public InvoiceOrderInfo(ContentVersion cv) {
cvInfo = cv;
- mailSelectOptsMap = new Map<String,String>();
+ mailSelectOptsMap = new Map<String, String>();
mailSelectOptsMap.put('鍙戠エ鍜屾槑缁�', '鍙戠エ鍜屾槑缁�');
mailSelectOptsMap.put('鍙戠エ', '鍙戠エ');
mailSelectOptsMap.put('鏄庣粏', '鏄庣粏');
diff --git a/force-app/main/default/classes/LexConInvoicedetailsController.cls b/force-app/main/default/classes/LexConInvoicedetailsController.cls
index 18a4fb5..b863861 100644
--- a/force-app/main/default/classes/LexConInvoicedetailsController.cls
+++ b/force-app/main/default/classes/LexConInvoicedetailsController.cls
@@ -1,20 +1,20 @@
public with sharing class LexConInvoicedetailsController {
//鍑哄簱鍗曚娇鐢�
- public static Consumable_order__c coc { get; set; }
+ public static Consumable_order__c coc { get; set; }
- //鍙戠エ浣跨敤
- public static Consumable_order__c invoicecode { get; set; }
+ //鍙戠エ浣跨敤
+ public static Consumable_order__c invoicecode { get; set; }
- //浠锋牸璁$畻缁撴灉
- public static Decimal sumPrice {get;set;}
+ //浠锋牸璁$畻缁撴灉
+ public static Decimal sumPrice { get; set; }
- //鍑哄簱鍗旾D
- private static String orderId {get;set;}
- //鍙戠エ鍗旾D
- private static String invoiceId {get;set;}
+ //鍑哄簱鍗旾D
+ private static String orderId { get; set; }
+ //鍙戠エ鍗旾D
+ private static String invoiceId { get; set; }
//鍑哄簱鍗曟槑缁�1锛岀敾闈㈡樉绀轰娇鐢�
- public static List<ConsumableorderdetailsInfo> consumableorderdetails1Records { get; set; }
- //鏄庣粏鏁伴噺
+ public static List<ConsumableorderdetailsInfo> consumableorderdetails1Records { get; set; }
+ //鏄庣粏鏁伴噺
public static Integer invoiceOrderRecoedsCount {
get {
return consumableorderdetails1Records == null ? 0 : consumableorderdetails1Records.size();
@@ -23,7 +23,7 @@
//椤甸潰鍒濆鍖�
@AuraEnabled
- public static ResponseBodyLWC init(String orderIdLwc,String invoiceIdLwc) {
+ public static ResponseBodyLWC init(String orderIdLwc, String invoiceIdLwc) {
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
res.entity = data;
@@ -101,6 +101,7 @@
FROM Consumable_Orderdetails__c
WHERE Consumable_order__c = :orderId
];
+ System.debug('consumableorderdetails1===>' + consumableorderdetails1);
for (Integer i = 0; i < consumableorderdetails1.size(); i++) {
consumableorderdetails1Records.add(new ConsumableorderdetailsInfo(consumableorderdetails1[i]));
}
@@ -138,9 +139,9 @@
ass.esd.Invoice_Unitprice__c = ass.esd.Delivery_List_RMB__c;
}
}
- data.put('invoicecode',invoicecode);
- data.put('coc',coc);
- data.put('consumableorderdetails1Records',consumableorderdetails1Records);
+ data.put('invoicecode', invoicecode);
+ data.put('coc', coc);
+ data.put('consumableorderdetails1Records', consumableorderdetails1Records);
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
@@ -148,12 +149,15 @@
}
@AuraEnabled
- public static ResponseBodyLWC save(String consumableorderdetails1RecordsLwc,String invoiceIdLwc,String orderIdLwc) {
+ public static ResponseBodyLWC save(String consumableorderdetails1RecordsLwc, String invoiceIdLwc, String orderIdLwc) {
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
res.entity = data;
- consumableorderdetails1Records= (List<ConsumableorderdetailsInfo>)JSON.deserialize(consumableorderdetails1RecordsLwc, List<ConsumableorderdetailsInfo>.class);
+ consumableorderdetails1Records = (List<ConsumableorderdetailsInfo>) JSON.deserialize(
+ consumableorderdetails1RecordsLwc,
+ List<ConsumableorderdetailsInfo>.class
+ );
invoiceId = invoiceIdLwc;
orderId = orderIdLwc;
System.debug('consumableorderdetails1Records = ' + consumableorderdetails1Records);
@@ -352,6 +356,7 @@
}
// Data Bean
+ @TestVisible
class ConsumableorderdetailsInfo {
@AuraEnabled
public Boolean check { get; set; }
@@ -369,7 +374,7 @@
public Decimal Packing_list_manual { get; set; }
public List<SelectOption> Invoice_UnitOpts { get; set; }
@AuraEnabled
- public Map<String,String> Invoice_UnitOptsMap { get; set; }
+ public Map<String, String> Invoice_UnitOptsMap { get; set; }
// 娑堣�楀搧浜у搧鏄庣粏
public ConsumableorderdetailsInfo(Consumable_Orderdetails__c e) {
check = false;
@@ -379,12 +384,13 @@
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_UnitOpts = new List<SelectOption>();
- Invoice_UnitOpts.add(new SelectOption('鐩�', '鐩�'));
- Invoice_UnitOpts.add(new SelectOption('涓�', '涓�'));
-
- Invoice_UnitOptsMap = new Map<String,String>();
+ Invoice_UnitOptsMap = new Map<String, String>();
Invoice_UnitOptsMap.put('鐩�', '鐩�');
Invoice_UnitOptsMap.put('涓�', '涓�');
}
diff --git a/force-app/main/default/classes/LexConsumableAccountController.cls b/force-app/main/default/classes/LexConsumableAccountController.cls
index 21d519d..b8dde25 100644
--- a/force-app/main/default/classes/LexConsumableAccountController.cls
+++ b/force-app/main/default/classes/LexConsumableAccountController.cls
@@ -168,9 +168,9 @@
List<String> accountList = new List<String>();
for (AggregateResult ar : arList) {
System.debug('thisAmount = ' + String.valueOf(ar.get('thisAmount')));
- if(String.valueOf(ar.get('thisAmount')) != '0.0'){
+ if (String.valueOf(ar.get('thisAmount')) != '0.0') {
accountList.add(String.valueOf(ar.get('hospitalName')));
- topInfo.deList.add(Decimal.valueOf(String.valueOf(ar.get('thisAmount'))));
+ topInfo.deList.add(Decimal.valueOf(String.valueOf(ar.get('thisAmount'))));
}
}
@@ -249,21 +249,21 @@
if (fiscalYear == 'thisYear') {
AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(thisDatetime, nextDatetime);
- if(saleAmountList[0].get('saleAmount') != null){
+ if (saleAmountList[0].get('saleAmount') != null) {
topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
}
arList = LexConsumableAccountSOQL.getAccountBySales(thisDatetime, nextDatetime);
} else if (fiscalYear == 'lastYear') {
AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, thisDatetime2);
- if(saleAmountList[0].get('saleAmount') != null){
+ if (saleAmountList[0].get('saleAmount') != null) {
topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
}
arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, thisDatetime2);
} else {
AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, nextDatetime);
- if(saleAmountList[0].get('saleAmount') != null){
+ if (saleAmountList[0].get('saleAmount') != null) {
topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
}
@@ -273,11 +273,10 @@
List<String> accountList = new List<String>();
for (AggregateResult ar : arList) {
System.debug('thisAmount = ' + String.valueOf(ar.get('thisAmount')));
- if(String.valueOf(ar.get('thisAmount')) != '0.0'){
+ if (String.valueOf(ar.get('thisAmount')) != '0.0') {
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);
diff --git a/force-app/main/default/classes/LexConsumableAccountInfoController.cls b/force-app/main/default/classes/LexConsumableAccountInfoController.cls
index 09f8d19..1495608 100644
--- a/force-app/main/default/classes/LexConsumableAccountInfoController.cls
+++ b/force-app/main/default/classes/LexConsumableAccountInfoController.cls
@@ -37,7 +37,7 @@
if (accList != null && accList.size() > 0) {
obj = accList.get(0);
}
- }else {
+ } else {
return new ResponseBodyLWC('Error', 500, 'accId涓虹┖', '');
}
data.put('obj', obj);
diff --git a/force-app/main/default/classes/LexConsumableAccountSOQL.cls b/force-app/main/default/classes/LexConsumableAccountSOQL.cls
index eef1437..6620269 100644
--- a/force-app/main/default/classes/LexConsumableAccountSOQL.cls
+++ b/force-app/main/default/classes/LexConsumableAccountSOQL.cls
@@ -1,20 +1,19 @@
public with sharing class LexConsumableAccountSOQL {
- public static AggregateResult[] getAccountBySales(Datetime thisDatetime ,Datetime nextDatetime){
- 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 != ''
- GROUP BY Consumable_order__r.Order_ForHospital__r.Name
- ORDER BY sum(Sale_amount__c) DESC
- LIMIT 10
- ]);
+ public static AggregateResult[] getAccountBySales(Datetime thisDatetime, Datetime nextDatetime) {
+ 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 != ''
+ GROUP BY Consumable_order__r.Order_ForHospital__r.Name
+ ORDER BY sum(Sale_amount__c) DESC
+ LIMIT 10
+ ]
+ );
return arList;
}
- public static AggregateResult[] getAccountTotalSales(Datetime thisDatetime ,Datetime nextDatetime){
+ public static AggregateResult[] getAccountTotalSales(Datetime thisDatetime, Datetime nextDatetime) {
AggregateResult[] saleAmountList = [
SELECT sum(Sale_amount__c) saleAmount
FROM Consumable_Orderdetails__c
@@ -22,6 +21,4 @@
];
return saleAmountList;
}
-
-
}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConsumableController.cls b/force-app/main/default/classes/LexConsumableController.cls
index c6f9846..870954c 100644
--- a/force-app/main/default/classes/LexConsumableController.cls
+++ b/force-app/main/default/classes/LexConsumableController.cls
@@ -105,8 +105,8 @@
// 鐧诲綍鑰呭伐浣滃湴
private static String userWorkLocation;
public static String agencyProType { get; set; }
- public static String agencyProType1 {get;set;} //lt 20230526 瀹夊窘涓ょエ鍒� add
- private static Boolean OSHFLG;//lt 20230517 瀹夊窘涓ょエ鍒� add
+ public static String agencyProType1 { get; set; } //lt 20230526 瀹夊窘涓ょエ鍒� add
+ private static Boolean OSHFLG; //lt 20230517 瀹夊窘涓ょエ鍒� add
public static String methodType { get; set; }
public static String hospitalName { get; set; }
public static String hospitalId { get; set; }
@@ -167,10 +167,10 @@
if (selectedIdMap.containsKey(consumableorderdetailsRecords[i].Prod.Id)) {
addNo++;
//continue;
- }
+ }
// else if (consumableorderdetailsRecordsview.size() >= pageLimit + size) {
// break;
- // }
+ // }
else {
if (consumableorderdetailsRecords[i].check == false) {
consumableorderdetailsRecords[i].esd = orderdetails1;
@@ -206,12 +206,12 @@
pageLimit = Integer.valueOf(System.Label.orderdetPageLimitsize);
ESetId = esetId;
methodType = type;
- if(String.isBlank(methodType) && String.isNotBlank(ESetId)){
+ if (String.isBlank(methodType) && String.isNotBlank(ESetId)) {
List<Consumable_order__c> oclist = [SELECT orderPattern__c FROM Consumable_order__c WHERE id = :ESetid];
methodType = oclist.get(0).orderPattern__c;
}
statusEdit = keywordStr;
- System.debug('Param:'+ESetId+'---'+methodType+'---'+statusEdit);
+ System.debug('Param:' + ESetId + '---' + methodType + '---' + statusEdit);
try {
sortKey = '1';
preSortKey = '1';
@@ -232,17 +232,16 @@
userId = UserInfo.getUserId();
List<user> Useracc = new List<user>();
//lt 20230517 瀹夊窘涓ょエ鍒� add ,OSHFLG__c
- Useracc = [SELECT accountid, Work_Location__c,UserPro_Type__c,OSHFLG__c FROM user WHERE id = :userId ];
+ Useracc = [SELECT accountid, Work_Location__c, UserPro_Type__c, OSHFLG__c FROM user WHERE id = :userId];
accountid = Useracc[0].accountid;
userWorkLocation = Useracc[0].Work_Location__c;
agencyProType = Useracc[0].UserPro_Type__c;
agencyProType1 = Useracc[0].UserPro_Type__c; //lt 20230526 瀹夊窘涓ょエ鍒� add
//lt 20230526 瀹夊窘涓ょエ鍒� start
OSHFLG = Useracc[0].OSHFLG__c; //lt 20230517 瀹夊窘涓ょエ鍒� add
- if(OSHFLG){
+ if (OSHFLG) {
agencyProType1 = 'OSH';
- }
- else if(String.isBlank(Useracc[0].UserPro_Type__c)){
+ } else if (String.isBlank(Useracc[0].UserPro_Type__c)) {
agencyProType1 = 'ET';
}
//lt 20230526 瀹夊窘涓ょエ鍒� end
@@ -264,9 +263,9 @@
RecordType.DeveloperName = 'AgencyContract'
AND Contract_Decide_Start_Date__c <= :dateToday
AND Contract_Decide_End_Date__c >= :dateToday
- and Contact_Type__c like :agencyProType1//lt 20230517 瀹夊窘涓ょエ鍒� add 1
- and Agent_Ref__c =:accountid
- and OSH_Dealer__c =: OSHFLG //lt 20230517 瀹夊窘涓ょエ鍒� add
+ AND Contact_Type__c LIKE :agencyProType1 //lt 20230517 瀹夊窘涓ょエ鍒� add 1
+ AND Agent_Ref__c = :accountid
+ AND OSH_Dealer__c = :OSHFLG //lt 20230517 瀹夊窘涓ょエ鍒� add
];
for (Account contract : contractList) {
contactDealer.add(contract.Id);
@@ -330,10 +329,10 @@
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
+ AND OSH_Dealer__c = :OSHFLG //lt 20230517 瀹夊窘涓ょエ鍒� add
];
if (contract.size() == 1) {
contractName = contract[0].Name;
@@ -382,7 +381,16 @@
}
consumableorderdetailsRecords.sort();
if (methodType != null && methodType != '' && (methodType.equals('hospitalorder') || methodType.equals('promotionorder'))) {
- searchorderdetails(methodType,accountid,hospitalId,contractId,userWorkLocation,accountName,proLimitAndDate,editAble);
+ searchorderdetails(
+ methodType,
+ accountid,
+ hospitalId,
+ contractId,
+ userWorkLocation,
+ accountName,
+ proLimitAndDate,
+ editAble
+ );
isfirst = true;
}
getPageInfo();
@@ -458,12 +466,12 @@
AND Consumable_order__r.Dealer_Info__c = :accountid
];
for (Consumable_Orderdetails__c cdc1 : ConsumableorderdetailsSelected) {
- if(cdc1.Consumable_Product__c != null){
+ if (cdc1.Consumable_Product__c != null) {
orderzaikuId.add(cdc1.Consumable_Product__c);
}
}
soql = makeSoqlorderdet();
- System.debug('soql:'+soql);
+ System.debug('soql:' + soql);
size = orderzaikuId.size();
initStandardController();
product2Selected = Database.query(soql);
@@ -543,10 +551,21 @@
// attachmentRecoeds.add(new ConsumableorderdetailsInfo(attachmentinfo[i]));
// }
// }
- List<ContentVersion> cvInfo = [SELECT Id, Title, OwnerId,Owner.Name, CreatedDate,ContentDocumentId FROM ContentVersion WHERE FirstPublishLocationId = :ESetId];
- if (cvInfo.size() > 0) {
- for (Integer i = 0; i < cvInfo.size(); i++) {
- attachmentRecoeds.add(new ConsumableorderdetailsInfo(cvInfo[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
+ ];
+ if (cvInfo.size() > 0) {
+ for (Integer i = 0; i < cvInfo.size(); i++) {
+ attachmentRecoeds.add(new ConsumableorderdetailsInfo(cvInfo[i]));
+ }
}
}
//
@@ -560,7 +579,7 @@
List<String> upper = new List<String>();
if (String.isNotBlank(ESetid)) {
for (ConsumableorderdetailsInfo bss : consumableorderdetailsRecords) {
- if(bss.esd.Consumable_count__c != null && bss.allnumber != null && bss.upperlimit != null){
+ if (bss.esd.Consumable_count__c != null && bss.allnumber != null && bss.upperlimit != null) {
if (bss.esd.Consumable_count__c + bss.allnumber > bss.upperlimit) {
upper.add(bss.esd.Consumable_Product__r.Name__c);
}
@@ -596,22 +615,22 @@
// categoryOptionList = new List<SelectOption>();
category3Option = new List<CusOption>();
// categoryOptionList.add(new SelectOption('', '-鏃�-'));
- category3Option.add(new CusOption('-鏃�-',''));
+ category3Option.add(new CusOption('-鏃�-', ''));
for (AggregateResult category3Search : categoryList) {
String deliverycnt = String.valueOf(category3Search.get('c3c'));
// categoryOptionList.add(new SelectOption(deliverycnt, deliverycnt));
- category3Option.add(new CusOption(deliverycnt,deliverycnt));
+ category3Option.add(new CusOption(deliverycnt, deliverycnt));
}
//categoty4
// category4OptionList = new List<SelectOption>();
category4Option = new List<CusOption>();
// category4OptionList.add(new SelectOption('', '-鏃�-'));
- category4Option.add(new CusOption('-鏃�-',''));
+ category4Option.add(new CusOption('-鏃�-', ''));
//categoty5
// category5OptionList = new List<SelectOption>();
category5Option = new List<CusOption>();
// category5OptionList.add(new SelectOption('', '-鏃�-'));
- category5Option.add(new CusOption('-鏃�-',''));
+ category5Option.add(new CusOption('-鏃�-', ''));
//return msg
consumableorderdetailsRecordsview = consumableorderdetailsRecords;
getConsumableShowTableFieldValue();
@@ -652,7 +671,7 @@
}
@AuraEnabled
- public static Results categoryAllload(String agencyProTypeStr, String category3Str){
+ public static Results categoryAllload(String agencyProTypeStr, String category3Str) {
Results results = new Results();
agencyProType = agencyProTypeStr;
category3 = category3Str;
@@ -708,7 +727,7 @@
}
@AuraEnabled
- public static Results categoryload(String agencyProTypeStr, String category3Str, String category4Str){
+ public static Results categoryload(String agencyProTypeStr, String category3Str, String category4Str) {
Results results = new Results();
agencyProType = agencyProTypeStr;
category3 = category3Str;
@@ -734,7 +753,7 @@
// category4OptionList.add(new SelectOption(deliverycnt4, deliverycnt4));
category4Option.add(new CusOption(deliverycnt4, deliverycnt4));
}
-
+
AggregateResult[] category5List = [
SELECT Count(id), Category5_text__c c5c
FROM Product2__c
@@ -929,7 +948,7 @@
String consumableorderdetailsRecordsviewStr,
Boolean editAbleStr,
List<String> proLimitAndDateList
- ){
+ ) {
Results results = new Results();
errorMsgList = new List<String>();
warningMsgList = new List<String>();
@@ -948,8 +967,11 @@
methodType = methodTypeStr;
editAble = editAbleStr;
proLimitAndDate = proLimitAndDateList;
- dealerProductId = (List<String>)JSON.deserialize(dealerProductIdStr, List<String>.class);
- consumableorderdetailsRecordsview = (List<ConsumableorderdetailsInfo>)JSON.deserialize(consumableorderdetailsRecordsviewStr, List<ConsumableorderdetailsInfo>.class);
+ dealerProductId = (List<String>) JSON.deserialize(dealerProductIdStr, List<String>.class);
+ consumableorderdetailsRecordsview = (List<ConsumableorderdetailsInfo>) JSON.deserialize(
+ consumableorderdetailsRecordsviewStr,
+ List<ConsumableorderdetailsInfo>.class
+ );
size = Integer.valueOf(System.Label.orderdetLimitsize);
pageLimit = Integer.valueOf(System.Label.orderdetPageLimitsize);
try {
@@ -993,7 +1015,7 @@
soql = makeSoql(category1, category_Goods, category3, category4, category5, specialCampaign, DealerProductId);
size = Integer.valueOf(System.Label.orderdetLimitsize);
initStandardController();
- System.debug('soql:'+soql);
+ System.debug('soql:' + soql);
product2Selected = Database.query(soql);
for (Integer i = 0; i < product2Selected.size(); i++) {
MidMap.put(product2Selected[i].Id, new ConsumableorderdetailsInfo(product2Selected[i]));
@@ -1068,12 +1090,12 @@
// makeMessage();
results.errorMsgList = errorMsgList;
results.warningMsgList = warningMsgList;
- if(consumableorderdetailsRecords.size() > 0){
+ if (consumableorderdetailsRecords.size() > 0) {
getConsumableShowTableFieldValue();
results.result = 'Success';
results.consumableorderdetailsRecordsview = consumableorderdetailsRecordsview;
results.errorMsg = '鎼滅储鍒�' + consumableorderdetailsRecords.size() + '浠朵骇鍝�';
- }else {
+ } else {
getConsumableShowTableFieldValue();
results.result = 'Fail';
results.consumableorderdetailsRecordsview = consumableorderdetailsRecordsview;
@@ -1097,7 +1119,7 @@
String accountNameStr,
List<String> proLimitAndDateList,
Boolean editAbleStr
- ){
+ ) {
Results results = new Results();
methodType = methodTypeStr;
accountId = accountIdStr;
@@ -1123,7 +1145,7 @@
for (hospitalprice__c hc : hplist) {
hpids.add(hc.product__c);
}
-
+
if (hpids != null && hpids.size() > 0) {
soql += ' AND Id in : hpids ';
}
@@ -1248,10 +1270,10 @@
noOfRecords = consumableorderdetailsRecords.size();
getConsumableShowTableFieldValue();
results.consumableorderdetailsRecordsview = consumableorderdetailsRecordsview;
- if(consumableorderdetailsRecordsview.size() > 0){
+ if (consumableorderdetailsRecordsview.size() > 0) {
results.result = 'Success';
- results.errorMsg = '鍏辨悳绱㈠埌'+consumableorderdetailsRecordsview.size()+'鏉℃暟鎹�';
- }else {
+ results.errorMsg = '鍏辨悳绱㈠埌' + consumableorderdetailsRecordsview.size() + '鏉℃暟鎹�';
+ } else {
results.result = 'Fail';
results.errorMsg = '娌℃湁鎼滅储鍒扮浉鍏虫暟鎹�';
}
@@ -1278,10 +1300,10 @@
if (selectedIdMap.containsKey(consumableorderdetailsRecords[i].Prod.Id)) {
addNo++;
//continue;
- }
+ }
// else if (consumableorderdetailsRecordsview.size() >= pageLimit + size) {
// break;
- // }
+ // }
else {
if (consumableorderdetailsRecords[i].check == false) {
consumableorderdetailsRecords[i].esd = orderdetails1;
@@ -1442,8 +1464,8 @@
}
}
String soql = 'SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,SFDA_Status__c,Product2__r.SFDA_Approbation_No__c,Product2__r.SFDA_Expiration_Date__c,Product2__r.Packing_list_manual__c,Category3__c,Category4__c,Category5__c FROM Product2__c WHERE Estimation_Entry_Possibility__c = \'鈼媆' ';
- System.debug('sqlTail:'+sqlTail);
- System.debug('orderzaikuId:'+orderzaikuId);
+ System.debug('sqlTail:' + sqlTail);
+ System.debug('orderzaikuId:' + orderzaikuId);
if (orderzaikuId.size() > 0) {
soql += ' AND Id in' + sqlTail;
}
@@ -1452,7 +1474,7 @@
// 缂栬緫鎸夐挳
@AuraEnabled
- public static Results setEditAble(String eSetidStr){
+ public static Results setEditAble(String eSetidStr) {
Results results = new Results();
ESetId = eSetidStr;
try {
@@ -1501,7 +1523,7 @@
cv.VersionData = EncodingUtil.base64Decode(base64Data);
cv.IsMajorVersion = true;
insert cv;
- Consumable_order__c c = [SELECT Id FROM Consumable_order__c WHERE Id =:pId];
+ Consumable_order__c c = [SELECT Id FROM Consumable_order__c WHERE Id = :pId];
c.Consumable_pdf_insert_day__c = Date.today();
update c;
results.result = 'Success';
@@ -1514,7 +1536,7 @@
//鍒犻櫎鎸夐挳
@AuraEnabled
- public static Results delConsumable(String eSetidStr){
+ public static Results delConsumable(String eSetidStr) {
Results results = new Results();
ESetId = eSetidStr;
try {
@@ -1537,7 +1559,7 @@
// 鎻愪氦鎸夐挳
@AuraEnabled
- public static Results sorder(String eSetidStr,String accountidStr){
+ public static Results sorder(String eSetidStr, String accountidStr) {
Results results = new Results();
errorMsgList = new List<String>();
warningMsgList = new List<String>();
@@ -1618,10 +1640,23 @@
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
+ );
}
- //淇濆瓨鎸夐挳
+ //淇濆瓨鎸夐挳
@AuraEnabled
public static Results save(
String contractNameStr,
@@ -1636,7 +1671,7 @@
String contractIdStr,
String agencyProType1Str,
Boolean OSHFLGStr
- ){
+ ) {
Results results = new Results();
errorMsgList = new List<String>();
warningMsgList = new List<String>();
@@ -1649,13 +1684,16 @@
contractId = contractIdStr;
agencyProType1 = agencyProType1Str;
OSHFLG = OSHFLGStr;
- 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);
- if(coc.Offers_Price__c != null){
+ 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
+ );
+ if (coc.Offers_Price__c != null) {
String offerStr = String.valueOf(coc.Offers_Price__c);
- bargainPrice = Decimal.valueOf(offerStr.replace(',',''));
+ bargainPrice = Decimal.valueOf(offerStr.replace(',', ''));
}
Savepoint sp = Database.setSavepoint();
try {
@@ -1670,12 +1708,12 @@
FROM account
WHERE
Name = :contractName
- AND Id =: contractId //lt 20230517 瀹夊窘涓ょエ鍒� add
+ 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 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
];
if (contract.size() <= 0) {
// coc.Order_effective_contact__c.addError('涓嶅瓨鍦ㄧ殑鍚堝悓锛岃閲嶆柊纭銆�');
@@ -1728,13 +1766,14 @@
}
//=======================================鍖婚櫌鐗逛环,鏈夐噾棰濈殑璇濆彇閲戦
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) {
- dealerHospitalmMap.put('' + dealerProduct.hospital__c + dealerProduct.product__c,dealerProduct.mPrice__c);
+ if (dealerProduct.mPrice__c != null) {
+ dealerHospitalmMap.put('' + dealerProduct.hospital__c + dealerProduct.product__c, dealerProduct.mPrice__c);
}
}
//淇冮攢璁㈣揣 鏍规嵁缁忛攢鍟嗕骇鍝佷腑鐨勬暟鎹绠楅噾棰�
@@ -1816,13 +1855,13 @@
FROM Account
WHERE
Name = :contractName
- AND Id =: contractId //lt 20230517 瀹夊窘涓ょエ鍒� add
- AND Contact_Type__c like :agencyProType1 //lt 20230517 瀹夊窘涓ょエ鍒� add 1
+ AND Id = :contractId //lt 20230517 瀹夊窘涓ょエ鍒� add
+ 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()
AND Contract_Decide_End_Date__c >= :Date.Today()
- AND OSH_Dealer__c =: OSHFLG //lt 20230517 瀹夊窘涓ょエ鍒� add
+ AND OSH_Dealer__c = :OSHFLG //lt 20230517 瀹夊窘涓ょエ鍒� add
];
if (at.size() > 0 && at[0].Dealer_discount__c != null) {
disCount = at[0].Dealer_discount__c;
@@ -1887,16 +1926,19 @@
ass.Prod.Intra_Trade_List_RMB__c *
dealerPDiscountMap.get('' + contract[0].Id + ass.Prod.Id) /
100;
- system.debug('cai 00' + InsAfterDel.Intra_Trade_List_RMB__c);
+ system.debug('cai 00' + InsAfterDel.Intra_Trade_List_RMB__c);
}
//=====================================================================================update by rentx 2020-11-25
} else if (methodType.equals('hospitalorder')) {
//鍖婚櫌鐗逛环
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);
+ InsAfterDel.Intra_Trade_List_RMB__c = dealerHospitalmMap.get('' + hospitalId + ass.Prod.Id);
}
} else if (DealerProductMap.containsKey(ass.Prod.Id)) {
InsAfterDel.Intra_Trade_List_RMB__c = DealerProductMap.get(ass.Prod.Id).Special_Campaign_Price__c;
@@ -1987,9 +2029,12 @@
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);
+ InsAfterDel.Intra_Trade_List_RMB__c = dealerHospitalmMap.get('' + hospitalId + ass.Prod.Id);
}
} else if (DealerProductMap.containsKey(ass.Prod.Id)) {
InsAfterDel.Intra_Trade_List_RMB__c = DealerProductMap.get(ass.Prod.Id).Special_Campaign_Price__c;
@@ -2019,17 +2064,17 @@
//鍒犻櫎闄勪欢
@AuraEnabled
- public static Results deleteAtt(String contentVersionId, String cocId){
+ public static Results deleteAtt(String contentVersionId, String cocId) {
Results results = new Results();
try {
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];
- c.Consumable_pdf_insert_day__c =null;
+ if (cvInfo.size() <= 1) {
+ Consumable_order__c c = [SELECT Id FROM Consumable_order__c WHERE Id = :cocId];
+ c.Consumable_pdf_insert_day__c = null;
update c;
}
results.result = 'Success';
@@ -2040,11 +2085,11 @@
return results;
}
- public static void getConsumableShowTableFieldValue(){
- for(ConsumableorderdetailsInfo con :consumableorderdetailsRecordsview){
- if(con.Prod != null){
+ public static void getConsumableShowTableFieldValue() {
+ for (ConsumableorderdetailsInfo con : consumableorderdetailsRecordsview) {
+ if (con.Prod != null) {
con.recordId = con.Prod.Id;
- if(!con.oldCheck){
+ if (!con.oldCheck) {
con.prodName = con.Prod.Name__c;
// System.debug('ProdName:'+con.Prod.Id+'---'+con.Prod.Name__c);
}
@@ -2054,9 +2099,9 @@
con.prodCategory5 = con.Prod.Category5__c;
con.prodIntraTradeList = con.Prod.Intra_Trade_List_RMB__c;
}
- if(con.esd != null){
+ if (con.esd != null) {
// if(con.oldCheck){
- // con.prodName = con.esd.Consumable_Product__r.Name__c;
+ // con.prodName = con.esd.Consumable_Product__r.Name__c;
// }
con.consumableCount = con.esd.Consumable_count__c;
}
@@ -2116,7 +2161,6 @@
public Decimal prodIntraTradeList { get; set; }
@AuraEnabled
public Decimal consumableCount { get; set; }
-
// 宸插瓨浜у搧鏄庣粏
public ConsumableorderdetailsInfo(Consumable_Orderdetails__c e) {
diff --git a/force-app/main/default/classes/LexConsumableGoodsInfo.cls b/force-app/main/default/classes/LexConsumableGoodsInfo.cls
index 78044ce..ded35fe 100644
--- a/force-app/main/default/classes/LexConsumableGoodsInfo.cls
+++ b/force-app/main/default/classes/LexConsumableGoodsInfo.cls
@@ -1,59 +1,87 @@
public without sharing class LexConsumableGoodsInfo {
-
//鎵�鏈変骇鍝佷竴瑙�
@AuraEnabled
- public static Results initTotalNum(String ordId, String type){
+ public static Results initTotalNum(String ordId, String type) {
Results results = new Results();
List<ShowRecords> allOtherDetIifo = new List<ShowRecords>();
Set<String> orderId = new Set<String>();
- if(ordId != '1'){
- orderId.add(ordId);
+ if (ordId != '1') {
+ orderId.add(ordId);
}
try {
- if(!(orderId.size() > 0)){
+ if (!(orderId.size() > 0)) {
String userId = UserInfo.getUserId();
- List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c
- FROM user
- WHERE id = :userId ];
+ List<User> userList = [
+ SELECT accountid, Work_Location__c, UserPro_Type__c
+ FROM user
+ WHERE id = :userId
+ ];
String accountid = userList[0].accountid;
String userPro_Type = userList[0].UserPro_Type__c;
String userWorklocation = userList[0].Work_Location__c;
String rtTypeDelivery = System.Label.RT_ConOrder_Delivery;
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];
- }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];
+ 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
+ ];
+ } 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
+ ];
}
- for(Consumable_order__c conorder : conorderlist){
- String temp = (String)conorder.Id;
+ for (Consumable_order__c conorder : conorderlist) {
+ String temp = (String) conorder.Id;
orderId.add(temp);
}
- System.debug('ANY o'+orderId);
+ System.debug('ANY o' + orderId);
}
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];
-
- Map<String,Decimal> allConOrderMap = new Map<String,Decimal>();
- for(Consumable_Orderdetails__c con : conOrderList1){
- if(con.Consumable_count__c == null){
+ 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) {
con.Consumable_count__c = 0;
}
- if(allConOrderMap.containsKey(con.Asset_Model_No__c)){
- allConOrderMap.put(con.Asset_Model_No__c,allConOrderMap.get(con.Asset_Model_No__c)+con.Consumable_count__c);
- }else{
+ if (allConOrderMap.containsKey(con.Asset_Model_No__c)) {
+ allConOrderMap.put(con.Asset_Model_No__c, allConOrderMap.get(con.Asset_Model_No__c) + con.Consumable_count__c);
+ } else {
allConOrderMap.put(con.Asset_Model_No__c, con.Consumable_count__c);
}
}
- for(String pmodel : allConOrderMap.keySet()){
- if(allConOrderMap.get(pmodel) > 0){
+ for (String pmodel : allConOrderMap.keySet()) {
+ if (allConOrderMap.get(pmodel) > 0) {
ShowRecords showrecord2 = new ShowRecords();
showrecord2.recordCount = allConOrderMap.get(pmodel);
showrecord2.prodModel = pmodel;
allOtherDetIifo.add(showrecord2);
- }
+ }
}
results.result = 'Success';
results.recordList = allOtherDetIifo;
@@ -66,28 +94,35 @@
//宸插埌璐т骇鍝佷竴瑙�
@AuraEnabled
- public static Results initArrDet(String orderId){
+ public static Results initArrDet(String orderId) {
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];
- Map<String,String> srtMap = new Map<String,String>();
- for(Consumable_order_details2__c con : conList){
+ 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
+ ];
+ Map<String, String> srtMap = new Map<String, String>();
+ for (Consumable_order_details2__c con : conList) {
srtMap.put(con.Bar_Code__c, con.Id);
}
List<String> str = new List<String>();
- for(String s : srtMap.keySet()){
+ 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
- GROUP BY Asset_Model_No__c];
- for(Integer i = 0 ; i< arrDetList.size();i++){
+ 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
+ ];
+ for (Integer i = 0; i < arrDetList.size(); i++) {
arrDetIifo.add(new showRecords(arrDetList[i]));
}
results.recordList = arrDetIifo;
results.result = 'Success';
- }catch (Exception e){
+ } catch (Exception e) {
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -96,14 +131,16 @@
//宸插埌璐т骇鍝佷竴瑙圓ll
@AuraEnabled
- public static Results initArrDetAll(String type){
+ public static Results initArrDetAll(String type) {
Results results = new Results();
List<ShowRecords> allArrDetIifo = new List<ShowRecords>();
- try{
+ try {
String userId = UserInfo.getUserId();
- List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c
- FROM user
- WHERE id = :userId ];
+ List<User> userList = [
+ SELECT accountid, Work_Location__c, UserPro_Type__c
+ FROM user
+ WHERE id = :userId
+ ];
String accountid = userList[0].accountid;
String userPro_Type = userList[0].UserPro_Type__c;
String userWorklocation = userList[0].Work_Location__c;
@@ -112,50 +149,91 @@
List<Consumable_order__c> conorderlist = new List<Consumable_order__c>();
//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];
- }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];
+ 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
+ ];
+ } 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
+ ];
}
//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];
- System.debug('======'+conorderlist+'daxiao:'+conorderlist.size());
- for(Consumable_order__c conorder : conorderlist){
- System.debug('======'+conorder.Owner.Name+'======');
+ System.debug('======' + conorderlist + 'daxiao:' + conorderlist.size());
+ for (Consumable_order__c conorder : conorderlist) {
+ System.debug('======' + conorder.Owner.Name + '======');
}
Set<String> orderId = new Set<String>();
- for(Consumable_order__c conorder : conorderlist){
+ for (Consumable_order__c conorder : conorderlist) {
orderId.add(conorder.Id);
}
- System.debug('ANY o'+orderId);
+ 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 = 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];
- }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];
+ 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
+ ];
+ } 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
+ ];
}
- //20200916 ljh update end
+ //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];
- Map<String,String> srtMap = new Map<String,String>();
- for(Consumable_order_details2__c con : conList){
+ Map<String, String> srtMap = new Map<String, String>();
+ for (Consumable_order_details2__c con : conList) {
srtMap.put(con.Bar_Code__c, con.Id);
}
List<String> str = new List<String>();
- for(String s : srtMap.keySet()){
+ 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
- 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
+ GROUP BY Asset_Model_No__c
+ ];
// List<showRecords> allArrDetIifo = new List<showRecords>();
- for(Integer i = 0 ; i< arrDetList.size();i++){
+ for (Integer i = 0; i < arrDetList.size(); i++) {
allArrDetIifo.add(new showRecords(arrDetList[i]));
}
results.recordList = allArrDetIifo;
results.result = 'Success';
- }catch (Exception e){
+ } catch (Exception e) {
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -164,20 +242,22 @@
//鏈埌璐т骇鍝佷竴瑙�
@AuraEnabled
- public static Results initDeliveryDet(String orderId){
+ public static Results initDeliveryDet(String orderId) {
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];
- for(Integer i = 0 ; i< notArrDetList.size();i++){
+ 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
+ ];
+ for (Integer i = 0; i < notArrDetList.size(); i++) {
notArrDetIifo.add(new showRecords(notArrDetList[i]));
}
results.recordList = notArrDetIifo;
results.result = 'Success';
- }catch (Exception e){
+ } catch (Exception e) {
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -186,14 +266,16 @@
//鏈埌璐т骇鍝佷竴瑙圓ll
@AuraEnabled
- public static Results initDeliveryDetAll(String type){
+ public static Results initDeliveryDetAll(String type) {
Results results = new Results();
List<ShowRecords> allNotArrDetIifo = new List<ShowRecords>();
- try{
+ try {
String userId = UserInfo.getUserId();
- List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c
- FROM user
- WHERE id = :userId ];
+ List<User> userList = [
+ SELECT accountid, Work_Location__c, UserPro_Type__c
+ FROM user
+ WHERE id = :userId
+ ];
String accountid = userList[0].accountid;
String userPro_Type = userList[0].UserPro_Type__c;
String userWorklocation = userList[0].Work_Location__c;
@@ -202,50 +284,91 @@
List<Consumable_order__c> conorderlist = new List<Consumable_order__c>();
//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];
- }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];
+ 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
+ ];
+ } 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
+ ];
}
//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];
- System.debug('======'+conorderlist+'daxiao:'+conorderlist.size());
- for(Consumable_order__c conorder : conorderlist){
- System.debug('======'+conorder.Owner.Name+'======');
+ System.debug('======' + conorderlist + 'daxiao:' + conorderlist.size());
+ for (Consumable_order__c conorder : conorderlist) {
+ System.debug('======' + conorder.Owner.Name + '======');
}
Set<String> orderId = new Set<String>();
- for(Consumable_order__c conorder : conorderlist){
+ for (Consumable_order__c conorder : conorderlist) {
orderId.add(conorder.Id);
}
- System.debug('ANY o'+orderId);
- List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
+ System.debug('ANY o' + orderId);
//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];
- 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];
- }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];
+ 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
+ ];
+ } 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
+ ];
}
- //20200916 ljh update end
+ //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];
- Map<String,String> srtMap = new Map<String,String>();
- for(Consumable_order_details2__c con : conList){
+ Map<String, String> srtMap = new Map<String, String>();
+ for (Consumable_order_details2__c con : conList) {
srtMap.put(con.Bar_Code__c, con.Id);
}
List<String> str = new List<String>();
- for(String s : srtMap.keySet()){
+ 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++){
+ for (Integer i = 0; i < arrDetList.size(); i++) {
allNotArrDetIifo.add(new showRecords(arrDetList[i]));
}
results.recordList = allNotArrDetIifo;
results.result = 'Success';
- }catch (Exception e){
+ } catch (Exception e) {
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -254,77 +377,89 @@
//杩樻病鍙戣揣鏁伴噺
@AuraEnabled
- public static Results initNotArrDet(String orderId){
+ public static Results initNotArrDet(String orderId) {
Results results = new Results();
List<Consumable_Orderdetails__c> otherArrDetIifo = new List<Consumable_Orderdetails__c>();
List<ShowRecords> otherArrList = new List<ShowRecords>();
- try{
+ try {
List<showRecords> arrDetIifo = new List<showRecords>();
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];
- Map<String,String> srtMap = new Map<String,String>();
- for(Consumable_order_details2__c con : conList){
+ 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);
}
List<String> str = new List<String>();
- for(String s : srtMap.keySet()){
+ 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];
- for(Integer i = 0 ; i< arrDetList.size();i++){
+ 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];
- for(Integer i = 0 ; i< notArrDetList.size();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
+ ];
+ for (Integer i = 0; i < notArrDetList.size(); i++) {
notArrDetIifo.add(new showRecords(notArrDetList[i]));
}
// 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]));
// }
- Map<String,Decimal> arrDetMap = new Map<String,Decimal>();
- for(showRecords arr : arrDetIifo){
+ Map<String, Decimal> arrDetMap = new Map<String, Decimal>();
+ for (showRecords arr : arrDetIifo) {
arrDetMap.put(arr.prodModel, arr.recordCount);
}
- for(showRecords notarr : notArrDetIifo){
- if(arrDetMap.containsKey(notarr.prodModel)){
- arrDetMap.put(notarr.prodModel, arrDetMap.get(notarr.prodModel)+notarr.recordCount);
- }else{
+ for (showRecords notarr : notArrDetIifo) {
+ if (arrDetMap.containsKey(notarr.prodModel)) {
+ arrDetMap.put(notarr.prodModel, arrDetMap.get(notarr.prodModel) + notarr.recordCount);
+ } else {
arrDetMap.put(notarr.prodModel, notarr.recordCount);
}
}
- List<String> AssetModelNoEdList = new List<String>();//20200904 ljh add
- for(Consumable_Orderdetails__c allarr : allArrDetList){
- for(String promodel : arrDetMap.keySet()){
- if(allarr.Asset_Model_No__c == promodel){
- if((allarr.Consumable_count__c - arrDetMap.get(promodel)) > 0){
+ List<String> AssetModelNoEdList = new List<String>(); //20200904 ljh add
+ for (Consumable_Orderdetails__c allarr : allArrDetList) {
+ for (String promodel : arrDetMap.keySet()) {
+ if (allarr.Asset_Model_No__c == promodel) {
+ if ((allarr.Consumable_count__c - arrDetMap.get(promodel)) > 0) {
allarr.Consumable_count__c = (allarr.Consumable_count__c - arrDetMap.get(promodel));
otherArrDetIifo.add(allarr);
}
- AssetModelNoEdList.add(promodel);//20200904 ljh add
+ AssetModelNoEdList.add(promodel); //20200904 ljh add
}
}
}
//20200904 ljh add start
- for(Consumable_Orderdetails__c allarr1 : allArrDetList){
- if(!AssetModelNoEdList.contains(allarr1.Asset_Model_No__c)){
+ for (Consumable_Orderdetails__c allarr1 : allArrDetList) {
+ if (!AssetModelNoEdList.contains(allarr1.Asset_Model_No__c)) {
otherArrDetIifo.add(allarr1);
}
}
- for(Consumable_Orderdetails__c conOrderDetail : otherArrDetIifo){
+ for (Consumable_Orderdetails__c conOrderDetail : otherArrDetIifo) {
ShowRecords record = new ShowRecords();
record.prodModel = conOrderDetail.Asset_Model_No__c;
record.recordCount = conOrderDetail.Consumable_count__c;
@@ -332,7 +467,7 @@
}
results.recordList = otherArrList;
results.result = 'Success';
- }catch (Exception e){
+ } catch (Exception e) {
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -341,14 +476,16 @@
//杩樻病鍙戣揣鏁伴噺All
@AuraEnabled
- public static Results initNotArrDetAll(String type){
+ public static Results initNotArrDetAll(String type) {
Results results = new Results();
List<ShowRecords> allOtherDetIifo = new List<ShowRecords>();
- try{
+ try {
String userId = UserInfo.getUserId();
- List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c
- FROM user
- WHERE id = :userId ];
+ List<User> userList = [
+ SELECT accountid, Work_Location__c, UserPro_Type__c
+ FROM user
+ WHERE id = :userId
+ ];
String accountid = userList[0].accountid;
String userPro_Type = userList[0].UserPro_Type__c;
String userWorklocation = userList[0].Work_Location__c;
@@ -357,69 +494,110 @@
List<Consumable_order__c> conorderlist = new List<Consumable_order__c>();
//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];
- }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];
+ 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
+ ];
+ } 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
+ ];
}
//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];
- System.debug('======'+conorderlist+'daxiao:'+conorderlist.size());
- for(Consumable_order__c conorder : conorderlist){
- System.debug('======'+conorder.Owner.Name+'======');
+ System.debug('======' + conorderlist + 'daxiao:' + conorderlist.size());
+ for (Consumable_order__c conorder : conorderlist) {
+ System.debug('======' + conorder.Owner.Name + '======');
}
Set<String> orderId = new Set<String>();
- for(Consumable_order__c conorder : conorderlist){
+ for (Consumable_order__c conorder : conorderlist) {
orderId.add(conorder.Id);
}
- System.debug('ANY o'+orderId);
+ 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 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];
- }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];
+ 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
+ ];
+ } 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
+ ];
}
- //20200916 ljh update end
+ //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];
- Map<String,String> srtMap = new Map<String,String>();
- for(Consumable_order_details2__c con : conList){
+ Map<String, String> srtMap = new Map<String, String>();
+ for (Consumable_order_details2__c con : conList) {
srtMap.put(con.Bar_Code__c, con.Id);
}
List<String> str = new List<String>();
- for(String s : srtMap.keySet()){
+ 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];
- Map<String,Decimal> conOrderMap = new Map<String,Decimal>();
- for(AggregateResult agg : arrDetList){
+ 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 ];
- Map<String,Decimal> allConOrderMap = new Map<String,Decimal>();
- for(Consumable_Orderdetails__c con : conOrderList1){
- if(con.Consumable_count__c == null){
+ 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) {
con.Consumable_count__c = 0;
}
- if(allConOrderMap.containsKey(con.Asset_Model_No__c)){
- allConOrderMap.put(con.Asset_Model_No__c,allConOrderMap.get(con.Asset_Model_No__c)+con.Consumable_count__c);
- }else{
+ if (allConOrderMap.containsKey(con.Asset_Model_No__c)) {
+ allConOrderMap.put(con.Asset_Model_No__c, allConOrderMap.get(con.Asset_Model_No__c) + con.Consumable_count__c);
+ } else {
allConOrderMap.put(con.Asset_Model_No__c, con.Consumable_count__c);
}
}
- for(String pmodel : allConOrderMap.keySet()){
- if(conOrderMap.containsKey(pmodel)){
- if(allConOrderMap.get(pmodel) - conOrderMap.get(pmodel) > 0){
+ for (String pmodel : allConOrderMap.keySet()) {
+ if (conOrderMap.containsKey(pmodel)) {
+ if (allConOrderMap.get(pmodel) - conOrderMap.get(pmodel) > 0) {
showRecords showrecord1 = new showRecords();
showrecord1.recordCount = allConOrderMap.get(pmodel) - conOrderMap.get(pmodel);
showrecord1.prodModel = pmodel;
allOtherDetIifo.add(showrecord1);
}
- }else{
+ } else {
showRecords showrecord2 = new showRecords();
showrecord2.recordCount = allConOrderMap.get(pmodel);
showrecord2.prodModel = pmodel;
@@ -428,7 +606,7 @@
}
results.recordList = allOtherDetIifo;
results.result = 'Success';
- }catch (Exception e){
+ } catch (Exception e) {
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -437,26 +615,30 @@
//鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁�
@AuraEnabled
- public static Results initMoreThan7(String orderId){
+ public static Results initMoreThan7(String orderId) {
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
- AND Deliver_date__c < LAST_N_DAYS:7
- AND Consumable_order_minor__c = :orderId
- GROUP BY Asset_Model_No__c];
-
- for(Integer i = 0 ; i< morethan7daysList.size() ; i++){
+ 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
+ AND Deliver_date__c < LAST_N_DAYS:7
+ AND Consumable_order_minor__c = :orderId
+ GROUP BY Asset_Model_No__c
+ ];
+
+ for (Integer i = 0; i < morethan7daysList.size(); i++) {
morethansevendaysIifo.add(new showRecords(morethan7daysList[i]));
}
results.recordList = morethansevendaysIifo;
results.result = 'Success';
- }catch (Exception e){
+ } catch (Exception e) {
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -465,14 +647,16 @@
//鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁癆ll
@AuraEnabled
- public static Results initMoreThan7All(String type){
+ public static Results initMoreThan7All(String type) {
Results results = new Results();
List<ShowRecords> morethansevendaysIifo = new List<ShowRecords>();
- try{
+ try {
String userId = UserInfo.getUserId();
- List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c
- FROM user
- WHERE id = :userId ];
+ List<User> userList = [
+ SELECT accountid, Work_Location__c, UserPro_Type__c
+ FROM user
+ WHERE id = :userId
+ ];
String accountid = userList[0].accountid;
String userPro_Type = userList[0].UserPro_Type__c;
String userWorklocation = userList[0].Work_Location__c;
@@ -481,63 +665,106 @@
List<Consumable_order__c> conorderlist = new List<Consumable_order__c>();
//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];
- }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];
+ 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
+ ];
+ } 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
+ ];
}
- system.debug('==============>conorderlist'+conorderlist);
- system.debug('==============>conorderlist'+conorderlist.size());
+ system.debug('==============>conorderlist' + conorderlist);
+ system.debug('==============>conorderlist' + conorderlist.size());
//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];
- System.debug('======'+conorderlist+'daxiao:'+conorderlist.size());
- for(Consumable_order__c conorder : conorderlist){
- System.debug('======'+conorder.Owner.Name+'======');
+ System.debug('======' + conorderlist + 'daxiao:' + conorderlist.size());
+ for (Consumable_order__c conorder : conorderlist) {
+ System.debug('======' + conorder.Owner.Name + '======');
}
Set<String> orderId = new Set<String>();
- for(Consumable_order__c conorder : conorderlist){
+ for (Consumable_order__c conorder : conorderlist) {
orderId.add(conorder.Id);
}
- System.debug('ANY o'+orderId);
+ 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];
- if(type !=null && type.equals('all')){
+ 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];
- system.debug('allconList==========='+conList.size());
- }else{
+ 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];
- system.debug('notallconList==========='+conList.size());
+ 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
+ //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];
- Map<String,String> srtMap = new Map<String,String>();
- for(Consumable_order_details2__c con : conList){
+ Map<String, String> srtMap = new Map<String, String>();
+ for (Consumable_order_details2__c con : conList) {
srtMap.put(con.Bar_Code__c, con.Id);
}
List<String> str = new List<String>();
- for(String s : srtMap.keySet()){
+ 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
- AND Deliver_date__c < LAST_N_DAYS:7
- GROUP BY Asset_Model_No__c];
- system.debug('Morethan7daysList================>'+morethan7daysList.size());
- for(Integer i = 0 ; i< morethan7daysList.size() ; i++){
+ 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
+ ];
+ system.debug('Morethan7daysList================>' + morethan7daysList.size());
+ for (Integer i = 0; i < morethan7daysList.size(); i++) {
morethansevendaysIifo.add(new showRecords(morethan7daysList[i]));
- system.debug('MorethansevendaysIifo+++++++'+morethansevendaysIifo);
+ system.debug('MorethansevendaysIifo+++++++' + morethansevendaysIifo);
}
results.recordList = morethansevendaysIifo;
results.result = 'Success';
- }catch (Exception e){
+ } catch (Exception e) {
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -553,17 +780,17 @@
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'));
+ recordCount = Integer.valueOf(e.get('recordCount'));
prodModel = String.valueOf(e.get('prodModel'));
}
// 鎺掑簭
diff --git a/force-app/main/default/classes/LexInventoryController.cls b/force-app/main/default/classes/LexInventoryController.cls
index 564eded..7380b26 100644
--- a/force-app/main/default/classes/LexInventoryController.cls
+++ b/force-app/main/default/classes/LexInventoryController.cls
@@ -4,44 +4,45 @@
public static Integer pageToken { get; set; }
public static String sortField { get; set; }
public static String sortOrder { get; set; }
-
+
public static Integer totalcount { get; set; }
//鍒嗛〉浣跨敤鏁版嵁
public static String fileName { get; set; }
- public static Integer size{get;set;}
- public static Integer noOfRecords{get; set;}
- public static List<ConsumableorderdetailsInfo> codPageRecords { get; set; } // 涓㈠け鍜屽贰鍥炵殑,鐢婚潰鏄剧ず鐢�
- public static ApexPages.StandardSetController setCon { get; set; }
+ public static Integer size { get; set; }
+ public static Integer noOfRecords { get; set; }
+ public static List<ConsumableorderdetailsInfo> codPageRecords { get; set; } // 涓㈠け鍜屽贰鍥炵殑,鐢婚潰鏄剧ず鐢�
+ public static ApexPages.StandardSetController setCon { get; set; }
@AuraEnabled
- public static List<Consumable_order_details2__c> setConDetails2 { get; set; }
- public static Map<Id,String> pandiandetailsMap = new Map<Id,String>();
+ public static List<Consumable_order_details2__c> setConDetails2 { get; set; }
+ public static Map<Id, String> pandiandetailsMap = new Map<Id, String>();
/*****************妞滅储鐢�******************/
- public static String barcode { get; set; }
- public static Boolean done { get; set; }
+ public static String barcode { get; set; }
+ public static Boolean done { get; set; }
/*****************鐢婚潰琛ㄧずBean******************/
//椤甸潰涓绘暟鎹樉绀虹敤
- private static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords;
+ // private static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords;
+ public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords;
//鐩樼偣鍒扮殑浜у搧
- public static List<Consumable_order_details2__c> reSet = new List<Consumable_order_details2__c>();
- public static List<Consumable_order_details2__c> showcod2nid = new List<Consumable_order_details2__c>();
+ 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>();
//public List<Consumable_order_details2__c> pandiandetailsList { get; set; }
- public static List<List<Consumable_order_details2__c>> pandiandetailsListShow { get; set; }
+ public static List<List<Consumable_order_details2__c>> pandiandetailsListShow { get; set; }
//瀵诲洖鏄庣粏
- public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecordserrordummy; // 涓㈠け鍜屽贰鍥炵殑,瀹為檯鐐掍綔鐢�
+ public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecordserrordummy; // 涓㈠け鍜屽贰鍥炵殑,瀹為檯鐐掍綔鐢�
@AuraEnabled
- public static List<List<ConsumableorderdetailsInfo>> consumableorderdetailsRecordsview { get; set; } // 浜у搧鍗曚綅鐨凩ist
- public static List<Consumable_order_details2__c> InsListUp = New List<Consumable_order_details2__c>();
+ public static List<List<ConsumableorderdetailsInfo>> consumableorderdetailsRecordsview { get; set; } // 浜у搧鍗曚綅鐨凩ist
+ public static List<Consumable_order_details2__c> InsListUp = new List<Consumable_order_details2__c>();
public static List<ConsumableorderdetailsInfo> consumableorderdetailsviewRecords;
-
- public static Integer consumableorderdetailsCount {
+
+ public static Integer consumableorderdetailsCount {
get {
return consumableorderdetailsRecords == null ? 0 : consumableorderdetailsRecords.size();
}
}
//list<String> notexitlist = new list<String>();
- public static Map<String,String> reFindProduct = new Map<String,String>();
+ public static Map<String, String> reFindProduct = new Map<String, String>();
//鎺掑簭鐢�
// public static String sortKey;
// public static String preSortKey;
@@ -56,12 +57,12 @@
// 鐧诲綍鑰呭伐浣滃湴
private static String userWorkLocation;
//缁忛攢鍟嗙敤鎴蜂骇鍝佸垎绫伙紙ET銆丒NG锛�
- public static String agencyProType {get;set;}
+ public static String agencyProType { get; set; }
public static String sqlagencyProType;
//鍒ゆ柇鎿嶄綔浜哄憳鏄惁鐩樼偣
public static Boolean iSinventory = false;
- public LexInventoryController(){
+ public LexInventoryController() {
size = Integer.valueOf(System.Label.orderdetLimitsize);
consumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>();
done = false;
@@ -72,65 +73,79 @@
//codPageRecordsShow = new List<ConsumableorderdetailsInfo>();
}
- private static void initStandardController(){
+ 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,
- Bar_Code_search__c
- FROM Consumable_order_details2__c
- WHERE Id in :pandiandetailsMap.keySet()
- order by Name desc];
+ 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
+ ];
setConDetails2 = showcod2;
- System.debug('setConDetails2===>'+setConDetails2);
+ System.debug('setConDetails2===>' + setConDetails2);
// setCon = new ApexPages.StandardSetController(showcod2);
// // sets the number of records in each page set
// setCon.setPageSize(size);
// noOfRecords = setCon.getResultSize();
}
- public static List<Consumable_order_details2__c> cod2s() {
- return setConDetails2;
+ public static List<Consumable_order_details2__c> cod2s() {
+ return setConDetails2;
}
//Changes the size of pagination
- public static PageReference refreshPageSize() {
+ public static PageReference refreshPageSize() {
setCon.setPageSize(size);
//showcod2nid = cod2s();
makepagerecords();
return null;
}
- public static List<ConsumableorderdetailsInfo> makepagerecords() {
+ public static List<ConsumableorderdetailsInfo> makepagerecords() {
showcod2nid = cod2s();
codPageRecords = new List<ConsumableorderdetailsInfo>();
for (Consumable_order_details2__c cod2 : showcod2nid) {
- codPageRecords.add(new ConsumableorderdetailsInfo(cod2,pandiandetailsMap.get(cod2.Id)));
+ codPageRecords.add(new ConsumableorderdetailsInfo(cod2, pandiandetailsMap.get(cod2.Id)));
}
- System.debug('===>codPageRecords1'+codPageRecords);
- return codPageRecords;
+ System.debug('===>codPageRecords1' + codPageRecords);
+ return codPageRecords;
}
// 鐢婚潰鍒濆鍖�
@AuraEnabled
public static ResponseBodyLWC init() {
-
-
ResponseBodyLWC res = new ResponseBodyLWC();
- Map<String,object> data = new Map<String,object>();
+ Map<String, object> data = new Map<String, object>();
res.entity = data;
consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>();
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,
- Bar_Code_search__c
- FROM Consumable_order_details2__c
- WHERE Id in :pandiandetailsMap.keySet()
- order by Name];
- System.debug('pandiandetailsMap====>'+pandiandetailsMap);
+ 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
+ ];
+ System.debug('pandiandetailsMap====>' + pandiandetailsMap);
initStandardController();
makepagerecords();
// sortKey = '1';
@@ -142,21 +157,21 @@
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;
- if(String.isBlank(Useracc.UserPro_Type__c)){
+ if (String.isBlank(Useracc.UserPro_Type__c)) {
agencyProType = 'ET';
}
sqlagencyProType = '%' + agencyProType + '%';
- Account accountInfo = [SELECT Name,Dealer_discount__c FROM account WHERE id =:accountid];
+ Account accountInfo = [SELECT Name, Dealer_discount__c FROM account WHERE id = :accountid];
accountName = accountInfo.Name;
consumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>();
- Map<String,Product2__c> midMap = new Map<String,Product2__c>();
+ Map<String, Product2__c> midMap = new Map<String, Product2__c>();
List<ConsumableorderdetailsInfo> boxRecords = new List<ConsumableorderdetailsInfo>();
- Map<String,ConsumableorderdetailsInfo> newMidBoxMap = new Map<String,ConsumableorderdetailsInfo>();
- Map<String,ConsumableorderdetailsInfo> newMidPieceMap = new Map<String,ConsumableorderdetailsInfo>();
+ Map<String, ConsumableorderdetailsInfo> newMidBoxMap = new Map<String, ConsumableorderdetailsInfo>();
+ Map<String, ConsumableorderdetailsInfo> newMidPieceMap = new Map<String, ConsumableorderdetailsInfo>();
//DB202302357027 娑堣�楀搧杩芥函绯荤粺鏃犳硶姝e父浣跨敤鈥斺�旂洏鐐归〉闈㈡搷浣滃嵆鎶ラ敊 fy start
//寮�濮嬪埗浣滆〃澶存暟鎹�
// List<Product2__c> productCount_Unfull_bak = [select Id, Name,Name__c,
@@ -170,123 +185,135 @@
// 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
- 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
- AND Arrive_Owner_Work_Location__c =: userWorkLocation
- AND Dealer_Info_text__c = :accountName];
+ 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
+ AND Arrive_Owner_Work_Location__c = :userWorkLocation
+ AND Dealer_Info_text__c = :accountName
+ ];
//DB202302357027 娑堣�楀搧杩芥函绯荤粺鏃犳硶姝e父浣跨敤鈥斺�旂洏鐐归〉闈㈡搷浣滃嵆鎶ラ敊 fy start
//寮�濮嬪埗浣滆〃澶存暟鎹�
Set<Id> Product2cIdSet = new Set<Id>();
- for(Consumable_order_details2__c con_or_d2item: ProductCount_Res){
+ 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
- //where Estimation_Entry_Possibility__c = '鈼�'
- where Id in:Product2cIdSet
- and Product_Type__c like : sqlagencyProType
- ];
- for(integer i = 0;i < productCount_Unfull_bak.size() ; i++){
+ 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
+ ];
+ for (integer i = 0; i < productCount_Unfull_bak.size(); i++) {
midMap.put(productCount_Unfull_bak[i].Id, productCount_Unfull_bak[i]);
- }
- system.debug('productCount_Unfull_bak'+productCount_Unfull_bak.size());
+ }
+ system.debug('productCount_Unfull_bak' + productCount_Unfull_bak.size());
// String erro='productCount_Unfull_bak:'+productCount_Unfull_bak.size();
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, erro));
//DB202302357027 娑堣�楀搧杩芥函绯荤粺鏃犳硶姝e父浣跨敤鈥斺�旂洏鐐归〉闈㈡搷浣滃嵆鎶ラ敊 fy end
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'ProductCount_Res ' + ProductCount_Res.size()));
- for(Integer i = 0 ; i< ProductCount_Res.size();i++){
+ for (Integer i = 0; i < ProductCount_Res.size(); i++) {
//鐒跺悗寰幆CountDel鍋欱ox鍜宲iece2涓猰ap
- 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();
- Jstage.countid = Jstage.countid+1 ;
- if(ProductCount_Res[i].Isoverdue__c == 1){
+ 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();
+ Jstage.countid = Jstage.countid + 1;
+ if (ProductCount_Res[i].Isoverdue__c == 1) {
Jstage.limitCount = Jstage.limitCount + 1;
}
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));
- Jstage.countid = Jstage.countid+1 ;
- if(ProductCount_Res[i].Isoverdue__c == 1){
+ 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)
+ );
+ Jstage.countid = Jstage.countid + 1;
+ if (ProductCount_Res[i].Isoverdue__c == 1) {
Jstage.limitCount = Jstage.limitCount + 1;
}
Jstage.boxPiece = ProductCount_Res[i].Box_Piece__c;
- newMidBoxMap.put(ProductCount_Res[i].Consumable_Product__c+ProductCount_Res[i].Box_Piece__c, Jstage);
+ newMidBoxMap.put(ProductCount_Res[i].Consumable_Product__c + ProductCount_Res[i].Box_Piece__c, Jstage);
}
- }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();
- Jstage.countid = Jstage.countid+1 ;
- if(ProductCount_Res[i].Isoverdue__c == 1){
+ } 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();
+ Jstage.countid = Jstage.countid + 1;
+ if (ProductCount_Res[i].Isoverdue__c == 1) {
Jstage.limitCount = Jstage.limitCount + 1;
}
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));
- Jstage.countid = Jstage.countid+1 ;
- if(ProductCount_Res[i].Isoverdue__c == 1){
+ 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)
+ );
+ Jstage.countid = Jstage.countid + 1;
+ if (ProductCount_Res[i].Isoverdue__c == 1) {
Jstage.limitCount = Jstage.limitCount + 1;
}
Jstage.boxPiece = ProductCount_Res[i].Box_Piece__c;
- newMidPieceMap.put(ProductCount_Res[i].Consumable_Product__c+ProductCount_Res[i].Box_Piece__c, Jstage);
+ newMidPieceMap.put(ProductCount_Res[i].Consumable_Product__c + ProductCount_Res[i].Box_Piece__c, Jstage);
}
}
}
- for(ConsumableorderdetailsInfo bss : newMidBoxMap.values()){
+ for (ConsumableorderdetailsInfo bss : newMidBoxMap.values()) {
bss.overlimitCount = bss.countid - bss.limitCount;
boxRecords.add(bss);
}
boxRecords.sort();
- for(ConsumableorderdetailsInfo bss : newMidPieceMap.values()){
+ for (ConsumableorderdetailsInfo bss : newMidPieceMap.values()) {
bss.overlimitCount = bss.countid - bss.limitCount;
}
- for(ConsumableorderdetailsInfo bss : boxRecords){
+ for (ConsumableorderdetailsInfo bss : boxRecords) {
consumableorderdetailsRecords.add(bss);
- if(newMidPieceMap.containsKey(bss.Prod.Id + '涓�')){
+ if (newMidPieceMap.containsKey(bss.Prod.Id + '涓�')) {
consumableorderdetailsRecords.add(newMidPieceMap.get(bss.Prod.Id + '涓�'));
//newMidPieceMap绉婚櫎宸茬粡娣诲姞鐨凱iece
newMidPieceMap.remove(bss.Prod.Id + '涓�');
}
}
- for(ConsumableorderdetailsInfo bss : newMidPieceMap.values()){
+ for (ConsumableorderdetailsInfo bss : newMidPieceMap.values()) {
consumableorderdetailsRecords.add(newMidPieceMap.get(bss.Prod.Id + '涓�'));
}
//consumableorderdetailsCount = consumableorderdetailsRecords.size();
listCut();
-
-
+ data.put('ConsumableorderdetailsRecordsview', JSON.serialize(ConsumableorderdetailsRecordsview));
+ data.put('userWorkLocation', userWorkLocation);
+ data.put('agencyProType', agencyProType);
+ data.put('accountName', accountName);
+ data.put('accountid', accountid);
-
- data.put('ConsumableorderdetailsRecordsview',JSON.serialize(ConsumableorderdetailsRecordsview));
- data.put('userWorkLocation',userWorkLocation);
- data.put('agencyProType',agencyProType);
- data.put('accountName',accountName);
- data.put('accountid',accountid);
-
- data.put('consumableorderdetailsRecords',JSON.serialize(consumableorderdetailsRecords));
+ data.put('consumableorderdetailsRecords', JSON.serialize(consumableorderdetailsRecords));
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
return res;
}
- private static void listCut(){
+ private static void listCut() {
//鎷嗗垎鏆傜敤list
List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsbreak = new List<ConsumableorderdetailsInfo>();
List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsbreakover = new List<ConsumableorderdetailsInfo>();
@@ -297,44 +324,41 @@
//閫夋嫨浜у搧view
ConsumableorderdetailsRecordsbreak = new List<ConsumableorderdetailsInfo>();
ConsumableorderdetailsRecordsbreakover = new List<ConsumableorderdetailsInfo>();
- if(consumableorderdetailsRecords.size() > 1000){
- for(Integer i = 0; i < consumableorderdetailsRecords.size(); i++){
- if(i < 1000){
+ if (consumableorderdetailsRecords.size() > 1000) {
+ for (Integer i = 0; i < consumableorderdetailsRecords.size(); i++) {
+ if (i < 1000) {
c = consumableorderdetailsRecords.get(i);
ConsumableorderdetailsRecordsbreak.add(c);
- }else{
+ } else {
c = consumableorderdetailsRecords.get(i);
ConsumableorderdetailsRecordsbreakover.add(c);
}
}
consumableorderdetailsRecordsview.add(ConsumableorderdetailsRecordsbreak);
consumableorderdetailsRecordsview.add(ConsumableorderdetailsRecordsbreakover);
- }else{
+ } else {
consumableorderdetailsRecordsview.add(consumableorderdetailsRecords);
}
}
//========20160311======ADD_Start================================
// 灏嗛〉闈㈡垨鍙栧緱BarCode鍘绘帀閲嶅鐨勶紝杞崲鎴怢ist
//========20160311======ADD_Start================================
- public static List<String> ParseBarCode(String Code){
- Map<String,Integer> barcodeCountMap = new Map<String,Integer>();
- String[] Cache = new String[]{};
+ public static List<String> ParseBarCode(String Code) {
+ Map<String, Integer> barcodeCountMap = new Map<String, Integer>();
+ String[] Cache = new List<String>{};
Cache = Code.split('\n');
- List <String> Buff = new List<String>();
- for(String A : Cache){
+ List<String> Buff = new List<String>();
+ for (String A : Cache) {
A = A.trim().toUpperCase();
- if(barcodeCountMap.containsKey(A)){
- barcodeCountMap.put(A,barcodeCountMap.get(A) + 1);
- }else{
- barcodeCountMap.put(A,1);
+ if (barcodeCountMap.containsKey(A)) {
+ barcodeCountMap.put(A, barcodeCountMap.get(A) + 1);
+ } else {
+ barcodeCountMap.put(A, 1);
}
Buff.add(A + barcodeCountMap.get(A));
}
return Buff;
-
}
-
-
//test
@@ -345,53 +369,78 @@
//========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);
+ System.debug('===>consumableorderdetailsRecordsLWC' + consumableorderdetailsRecordsLWC);
+ 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);
+ system.debug('=====>consumableorderdetailsRecordsLWC' + consumableorderdetailsRecordsLWC);
ResponseBodyLWC res = new ResponseBodyLWC();
- Map<String,object> data = new Map<String,object>();
+ Map<String, object> data = new Map<String, object>();
res.entity = data;
sqlagencyProType = '%' + agencyProType + '%';
-
-
-
+ System.debug('sqlagencyProType==>' + sqlagencyProType);
+ System.debug('accountName==>' + accountName);
+ System.debug('userWorkLocation==>' + userWorkLocation);
/* BarCodelist鍋氭垚 */
//FIXME barcodeSet 鍋氭垚锛孭roductCount_ResSet 鍋氭垚
List<Consumable_order_details2__c> pandiandetailsList = new List<Consumable_order_details2__c>();
pandiandetailsListShow = new List<List<Consumable_order_details2__c>>();
done = false;
- List<String> BarCodeListP = ParseBarCode( barcode );
+ 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,
- 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
- AND Arrive_Owner_Work_Location__c =: userWorkLocation
- AND Dealer_Info_text__c = :accountName ];
+ 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
+ AND Arrive_Owner_Work_Location__c = :userWorkLocation
+ AND Dealer_Info_text__c = :accountName
+ ];
+ System.debug('ProductCount_Res==>' + ProductCount_Res);
reFindProduct.clear();
- Map<String,ConsumableorderdetailsInfo> barCodeListAdjustMap = new Map<String,ConsumableorderdetailsInfo>();
+ Map<String, ConsumableorderdetailsInfo> barCodeListAdjustMap = new Map<String, ConsumableorderdetailsInfo>();
//barCodeListLoseMap.clear();
Set<String> carCodeListLose = new Set<String>();
List<ConsumableorderdetailsInfo> consumableorderdetailsRecordsAdjust = new List<ConsumableorderdetailsInfo>();
- Map<String,String> proIdNotinpage = new Map<String,String>();
+ Map<String, String> proIdNotinpage = new Map<String, String>();
List<Consumable_order_details2__c> reFindProductList = new List<Consumable_order_details2__c>();
codPageRecords = new List<ConsumableorderdetailsInfo>();
consumableorderdetailsRecordserrordummy = new List<ConsumableorderdetailsInfo>();
@@ -399,20 +448,23 @@
pandiandetailsMap.clear();
reSet = new List<Consumable_order_details2__c>();
/* 鍒ゆ柇BarCode鏄惁涓虹┖ */
- if (barcode == null || barcode == ''){
+ if (barcode == null || barcode == '') {
//鍏堝彇鍑烘墍鏈変涪澶变骇鍝�
- for(ConsumableorderdetailsInfo ass : consumableorderdetailsRecords){
+ for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecords) {
// 20200509 gzw add 鐩樼偣鏁伴噺鍒濆鍖�
ass.Pandian = 0;
// 20200509 gzw add 鐩樼偣鏁伴噺鍒濆鍖�
- if(ass.check==true){
+ if (ass.check == true) {
//ass.Diff = ass.countid - ass.Pandian;
- for(integer i = 0 ; i < ProductCount_Res.size();i++){
- 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)){
+ 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{
-
+ } else {
//consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(ProductCount_Res[i],'涓㈠け'));
//pandiandetailsMap.put(ProductCount_Res[i].Id, '涓㈠け');
////barCodeListLoseMap.put(ProductCount_Res[i].Id, new ConsumableorderdetailsInfo(ProductCount_Res[i]));
@@ -424,576 +476,170 @@
}
//宸茬粡鍑哄簱鐨勪骇鍝�
- 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
- AND (Dealer_Shipment__c= TRUE
- or Dealer_Saled__c = TRUE)
- AND Dealer_Returned__c = FALSE
- AND Cancellation_Flag__c = FALSE
- AND Bar_Code__c in :carCodeListLose
- AND Dealer_Info_text__c = :accountName
- 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);
+ 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
+ AND (Dealer_Shipment__c = TRUE
+ OR Dealer_Saled__c = TRUE)
+ AND Dealer_Returned__c = FALSE
+ AND Cancellation_Flag__c = FALSE
+ AND Bar_Code__c IN :carCodeListLose
+ AND Dealer_Info_text__c = :accountName
+ 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
- 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 Cancellation_Flag__c = FALSE
- 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 ];
- 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);
+ 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
+ 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 (Dealer_Info_text__c != :accountName
+ OR (Dealer_Info_text__c = :accountName
+ 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){
+ for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecords) {
+ if (ass.check == true) {
ass.Diff = ass.countid - ass.Pandian;
- for(integer i = 0 ; i < ProductCount_Res.size();i++){
- 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_search__c)){
+ for (integer i = 0; i < ProductCount_Res.size(); i++) {
+ 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_search__c)) {
continue;
- }else{
- if(needreturnMap.containsKey(ProductCount_Res[i].Bar_Code__c)){
- consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(ProductCount_Res[i],'璇ヤ骇鍝佹湭杩斿搧'));
+ } else {
+ if (needreturnMap.containsKey(ProductCount_Res[i].Bar_Code__c)) {
+ 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 + '鐨勫簱瀛樸��');
+ 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 + '鐨勫簱瀛樸��'
+ );
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--;
continue;
}
- 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);
}
}
}
- }else{
+ } else {
ass.Pandian = 0;
ass.Diff = 0;
}
}
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,
- Bar_Code_search__c
- FROM Consumable_order_details2__c
- WHERE Id in :pandiandetailsMap.keySet()
- order by Name];
+ 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
+ ];
}
initStandardController();
showcod2nid = cod2s();
-
+
for (Consumable_order_details2__c cod2 : showcod2nid) {
- codPageRecords.add(new ConsumableorderdetailsInfo(cod2,pandiandetailsMap.get(cod2.Id)));
+ codPageRecords.add(new ConsumableorderdetailsInfo(cod2, pandiandetailsMap.get(cod2.Id)));
}
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
- FROM Consumable_order_details2__c
- WHERE Id in :pandiandetailsMap.keySet()
- order by Name];
- for(Consumable_order_details2__c codDet : pandiandetailsList){
+ 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
+ ];
+ for (Consumable_order_details2__c codDet : pandiandetailsList) {
codDet.Lose_reason__c = pandiandetailsMap.get(codDet.Id);
}
List<Consumable_order_details2__c> pandiandetailsListMid = new List<Consumable_order_details2__c>();
- for(Consumable_order_details2__c cod2 : pandiandetailsList){
+ for (Consumable_order_details2__c cod2 : pandiandetailsList) {
pandiandetailsListMid.add(cod2);
- if(pandiandetailsListMid.size() == 1000){
+ if (pandiandetailsListMid.size() == 1000) {
pandiandetailsListShow.add(pandiandetailsListMid);
pandiandetailsListMid = new List<Consumable_order_details2__c>();
}
}
- if(pandiandetailsListMid.size() > 0){
- pandiandetailsListShow.add(pandiandetailsListMid);
- }
-
- //鍒嗛〉
- PaginatedAccounts paginatedAccounts = new PaginatedAccounts();
- totalCount = codPageRecords.size();
- paginatedAccounts.nextPageToken = (pageToken + pageSize < totalCount) ? pageToken + pageSize : null;
- paginatedAccounts.recordStart = pageToken + 1;
- paginatedAccounts.pageNumber = pageToken / pageSize + 1;
- Integer recordEnd = pageSize * paginatedAccounts.pageNumber;
- paginatedAccounts.recordEnd = totalCount >= recordEnd ? recordEnd : totalCount;
- paginatedAccounts.totalRecords = totalCount;
-
- Integer startIdx;
- Integer endIdx;
- List<ConsumableorderdetailsInfo> pageCodeRecords = new List<ConsumableorderdetailsInfo>();
- startIdx = pageToken;
- endIdx = startIdx + pageSize;
- if (endIdx > codPageRecords.size()) {
- endIdx = codPageRecords.size();
- }
- for (Integer i = startIdx; i < endIdx; i++) {
- pageCodeRecords.add(codPageRecords.get(i));
- }
-
- data.put('paginatedAccounts', paginatedAccounts);
- data.put('pageCodeRecords', pageCodeRecords);
-
- //end
- data.put('codPageRecords',JSON.serialize(codPageRecords));
- data.put('consumableorderdetailsRecords',JSON.serialize(consumableorderdetailsRecords));
- data.put('consumableorderdetailsRecordsview',JSON.serialize(consumableorderdetailsRecordsview));
- data.put('pandiandetailsMap',pandiandetailsMap);
- System.debug('iSinventory===>'+iSinventory);
- System.debug('codPageRecords===>'+codPageRecords);
- data.put('iSinventory',JSON.serialize(iSinventory));
- data.put('reSet1',reSet1);
- System.debug('reSet1===>'+reSet1);
- res.code = 200;
- res.status = 'Success1';
-
- return res;
-
- }
-
-
-
- //CHAN-B7J4NB 鍙湁涓�涓椂锛岀洏鐐逛笉鍒�
- //init();
- //CHAN-B7J4NB
- Map<String,String> showproductIdMap = new Map<String,String>();
- for(ConsumableorderdetailsInfo ass : consumableorderdetailsRecords){
- showproductIdMap.put(ass.prod.Id + ass.boxPiece, ass.prod.Id + ass.boxPiece);
- }
-// 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
- AND Arrive_Owner_Work_Location__c =: userWorkLocation
- AND Dealer_Info_text__c = :accountName
- order by Name];
- System.debug('reSet===>'+reSet);
- Map<String, Integer> pandianProdIdCountMap = new Map<String, Integer>(); // ProdId 鍗樹綅
- // 20200509 add gzw 璁板綍闇�瑕侀攢瀛樻暟閲�
- Map<String, Integer> pandianoverdueCountMap = new Map<String, Integer>(); // ProdId 鍗樹綅
- // 20200509 add gzw 璁板綍闇�瑕侀攢瀛樻暟閲�
- Map<String,ConsumableorderdetailsInfo> barCodeListPandianMap = new Map<String,ConsumableorderdetailsInfo>(); // 鏄庣窗銉愩兗銈炽兗銉� 鍗樹綅
- //鐩樼偣鍒扮殑鏄庣粏
- for(Consumable_order_details2__c rs : reSet){
- //BarCodeListPandian.add(rs.Bar_Code_search__c);
- for(ConsumableorderdetailsInfo ass : consumableorderdetailsRecords){
- if(rs.Consumable_Product__c == ass.Prod.Id && rs.Box_Piece__c == ass.boxPiece){
- ass.check = true;
- }
- }
-
- barCodeListPandianMap.put(rs.Bar_Code_search__c, new ConsumableorderdetailsInfo(rs));
- if (rs.Isoverdue__c == 0) {
- consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(rs,'璇ヤ骇鍝佸凡缁忚繃鏈夋晥鏈燂紝璇烽攢瀛樸��'));
- pandiandetailsMap.put(rs.Id, '璇ヤ骇鍝佸凡缁忚繃鏈夋晥鏈燂紝璇烽攢瀛樸��');
- 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);
- }
- 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);
- }
- }
-
- // 缁忛攢鍟嗕箣闂存垨鑰呭悓涓�缁忛攢鍟嗕笉鍚屽伐浣滃湴璋冭揣
- 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)
- AND Dealer_Returned__c = FALSE
- AND Cancellation_Flag__c = FALSE
- 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 ];
- 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);
- }
- // 闇�瑕佸叆搴撶殑浜у搧
- for(Consumable_order_details2__c cod2 : reSet1){
- for(ConsumableorderdetailsInfo ass : consumableorderdetailsRecords){
- if(cod2.Consumable_Product__c == ass.Prod.Id && cod2.Box_Piece__c == ass.boxPiece){
- ass.check = true;
- }
- }
- if(!showproductIdMap.containsKey(cod2.Consumable_product__c + cod2.Box_Piece__c)){
- 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) ){
- 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
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c =: userWorkLocation
- order by Name];
-
-
- for (Consumable_order_details2__c rs : productAdjust){
- // 杩囨湡搴撳瓨閿�瀛� 20200427 gzw add srart
- if (rs.Isoverdue__c == 0 || rs.Lose_reason__c == '杩囨湡搴撳瓨閿�瀛�' ) {
- consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(rs,'杩囨湡鎴栬�呴攢瀛樹骇鍝侊紝鏃犳硶瀵诲洖鍏ュ簱'));
- pandiandetailsMap.put(rs.Id, '杩囨湡鎴栬�呴攢瀛樹骇鍝侊紝鏃犳硶瀵诲洖鍏ュ簱');
- carCodeListLose.add(rs.Bar_Code_search__c);
- continue;
- }
- // 杩囨湡搴撳瓨閿�瀛� 20200427 gzw add end
- for(ConsumableorderdetailsInfo ass : consumableorderdetailsRecords){
- if(rs.Consumable_Product__c == ass.Prod.Id && rs.Box_Piece__c == ass.boxPiece){
- ass.check = true;
- }
- }
- if(!showproductIdMap.containsKey(rs.Consumable_product__c + rs.Box_Piece__c)){
- reFindProductList.add(rs);
- proIdNotinpage.put(rs.Consumable_Product__c, rs.Box_Piece__c);
- }
- if(barCodeListAdjustMap.containsKey(rs.Bar_Code_search__c)){
- continue;
- }else{
- barCodeListAdjustMap.put(rs.Bar_Code_search__c, new ConsumableorderdetailsInfo(rs));
- consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(rs,'瀵诲洖'));
- pandiandetailsMap.put(rs.Id, '瀵诲洖');
- consumableorderdetailsRecordsAdjust.add(new ConsumableorderdetailsInfo(rs));
- }
- }
- if(reFindProductList.size() > 0){
- Map<String,Product2__c> midMap = new Map<String,Product2__c>();
- 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()];
- for(Product2__c pro : product_Refind){
- midMap.put(pro.Id, pro);
- }
- for(Integer i = 0 ; i< reFindProductList.size();i++){
- //鐒跺悗寰幆CountDel鍋欱ox鍜宲iece2涓猰ap
- 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();
- Jstage.countid = 0 ;
- if(reFindProductList[i].Isoverdue__c == 1){
- Jstage.limitCount = 0;
- }
- 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));
- Jstage.countid = 0 ;
- if(reFindProductList[i].Isoverdue__c == 1){
- Jstage.limitCount = 0;
- }
- Jstage.boxPiece = reFindProductList[i].Box_Piece__c;
- newMidBoxMap.put(reFindProductList[i].Consumable_Product__c+reFindProductList[i].Box_Piece__c, Jstage);
- }
- }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();
- Jstage.countid = 0 ;
- if(reFindProductList[i].Isoverdue__c == 1){
- Jstage.limitCount = 0;
- }
- 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));
- Jstage.countid = 0 ;
- if(reFindProductList[i].Isoverdue__c == 1){
- Jstage.limitCount = 0;
- }
- Jstage.boxPiece = reFindProductList[i].Box_Piece__c;
- newMidPieceMap.put(reFindProductList[i].Consumable_Product__c+reFindProductList[i].Box_Piece__c, Jstage);
- }
- }
- }
- for(ConsumableorderdetailsInfo bss : newMidBoxMap.values()){
- bss.check = true;
- bss.overlimitCount = bss.countid - bss.limitCount;
- boxRecords.add(bss);
- }
- boxRecords.sort();
- for(ConsumableorderdetailsInfo bss : newMidPieceMap.values()){
- bss.check = true;
- bss.overlimitCount = bss.countid - bss.limitCount;
- }
- for(ConsumableorderdetailsInfo bss : boxRecords){
- consumableorderdetailsRecords.add(bss);
- if(newMidPieceMap.containsKey(bss.Prod.Id + '涓�')){
- consumableorderdetailsRecords.add(newMidPieceMap.get(bss.Prod.Id + '涓�'));
- //newMidPieceMap绉婚櫎宸茬粡娣诲姞鐨凱iece
- newMidPieceMap.remove(bss.Prod.Id + '涓�');
- }
- }
- for(ConsumableorderdetailsInfo bss : newMidPieceMap.values()){
- consumableorderdetailsRecords.add(newMidPieceMap.get(bss.Prod.Id + '涓�'));
- }
- }
-
- //鍏堝彇鍑烘湭鐩樼偣鍒扮殑浜у搧
- for(ConsumableorderdetailsInfo ass : consumableorderdetailsRecords){
- if(ass.check == true){
- for(integer i = 0 ; i<ProductCount_Res.size();i++){
- if(ProductCount_Res[i].Consumable_Product__c == ass.Prod.Id && ass.boxPiece == ProductCount_Res[i].Box_Piece__c){
- if(barCodeListPandianMap.get(ProductCount_Res[i].Bar_Code_search__c) != null){
- continue;
- }else{
- carCodeListLose.add(ProductCount_Res[i].Bar_Code__c);
- ////barCodeListLoseMap.put(ProductCount_Res[i].Id, new ConsumableorderdetailsInfo(ProductCount_Res[i]));
- //consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(ProductCount_Res[i],'涓㈠け'));
- //pandiandetailsMap.put(ProductCount_Res[i].Id, '涓㈠け');
- }
- }
- }
- }
- }
- //宸茬粡鍑哄簱鐨勪骇鍝�
- 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
- AND (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 Dealer_Info_text__c = :accountName
- 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);
- }
- //// 缁忛攢鍟嗕箣闂存垨鑰呭悓涓�缁忛攢鍟嗕笉鍚屽伐浣滃湴璋冭揣
- //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)
- // AND Dealer_Returned__c = FALSE
- // AND Cancellation_Flag__c = FALSE
- // 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 ];
- //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){
- for(integer i = 0 ; i<ProductCount_Res.size();i++){
- if(ProductCount_Res[i].Consumable_Product__c == ass.Prod.Id && ass.boxPiece == ProductCount_Res[i].Box_Piece__c){
- if(barCodeListPandianMap.containsKey(ProductCount_Res[i].Bar_Code_search__c)){
- continue;
- }
- if (ProductCount_Res[i].Isoverdue__c == 0) {
- 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) {
- 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);
- }
- continue;
- }
-
- consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(ProductCount_Res[i],'涓㈠け'));
- pandiandetailsMap.put(ProductCount_Res[i].Id, '涓㈠け');
- }
- }
- // 鍚屾椂瀛樺湪鍏朵粬缁忛攢鍟嗗簱瀛樹骇鍝�
- 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 + '鐨勫簱瀛樸��');
- continue;
- }
- }
- }
- // 闇�瑕佽繑鍝佺殑浜у搧
- 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,'璇ヤ骇鍝佺洰鍓嶅嚭搴撶姸鎬侊紝璇疯繑鍝併��'));
- pandiandetailsMap.put(cod2.Id, '璇ヤ骇鍝佺洰鍓嶅嚭搴撶姸鎬侊紝璇疯繑鍝併��');
- continue;
- }
- }
- }
- }
- }
-
- //鏇存柊涓绘槑缁嗗崟
- if(barCodeListPandianMap.size() > 0){
- for(ConsumableorderdetailsInfo ass : consumableorderdetailsRecords){
- if(ass.check == true){
- integer countSum = 0;
- if (pandianProdIdCountMap.containsKey(ass.Prod.Id + ass.boxPiece)) {
- countSum = pandianProdIdCountMap.get(ass.Prod.Id + ass.boxPiece);
- }
- integer overdueSum = 0;
- if (pandianoverdueCountMap.containsKey(ass.Prod.Id + ass.boxPiece)) {
- overdueSum = pandianoverdueCountMap.get(ass.Prod.Id + ass.boxPiece);
- }
- ass.Pandian = countSum;
- ass.Diff = ass.countid - countSum - overdueSum;
- ass.refind = 0;
- }
- }
- }else{
- for(ConsumableorderdetailsInfo ass : consumableorderdetailsRecords){
- if(ass.check == true){
- integer overdueSum = 0;
- if (pandianoverdueCountMap.containsKey(ass.Prod.Id + ass.boxPiece)) {
- overdueSum = pandianoverdueCountMap.get(ass.Prod.Id + ass.boxPiece);
- }
- ass.Diff = ass.countid - ass.Pandian - overdueSum;
- }
- }
- }
-
-
- //瀵诲洖鍋氭垚
- for(ConsumableorderdetailsInfo ass :consumableorderdetailsRecords){
- for(ConsumableorderdetailsInfo adjust :consumableorderdetailsRecordsAdjust){
- if(ass.Prod.Name__c == adjust.Prod.Name__c && ass.boxPiece == adjust.orderdetails2.Box_Piece__c){
- if(reFindProduct.containsKey(adjust.orderdetails2.Bar_Code_search__c)){
- continue;
- }else {
- ass.Pandian ++;
- ass.refind ++;
- reFindProduct.put(adjust.orderdetails2.Bar_Code_search__c,adjust.orderdetails2.Bar_Code_search__c);
- }
- }
- }
- }
- 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,
- Bar_Code_search__c
- FROM Consumable_order_details2__c
- 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;
- iSinventory = true;
- consumableorderdetailsRecordserrordummy.clear();
- 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];
- for(Consumable_order_details2__c codDet : pandiandetailsList){
- codDet.Lose_reason__c = pandiandetailsMap.get(codDet.Id);
- }
- List<Consumable_order_details2__c> pandiandetailsListMid = new List<Consumable_order_details2__c>();
- for(Consumable_order_details2__c cod2 : pandiandetailsList){
- pandiandetailsListMid.add(cod2);
- if(pandiandetailsListMid.size() == 1000){
- pandiandetailsListShow.add(pandiandetailsListMid);
- pandiandetailsListMid = new List<Consumable_order_details2__c>();
- }
- }
- if(pandiandetailsListMid.size() > 0){
+ if (pandiandetailsListMid.size() > 0) {
pandiandetailsListShow.add(pandiandetailsListMid);
}
+
//鍒嗛〉
PaginatedAccounts paginatedAccounts = new PaginatedAccounts();
totalCount = codPageRecords.size();
@@ -1020,101 +666,638 @@
data.put('pageCodeRecords', pageCodeRecords);
//end
-
- System.debug('=====>codPageRecords2'+codPageRecords);
- System.debug('=====>consumableorderdetailsRecords'+consumableorderdetailsRecords);
- data.put('codPageRecords',JSON.serialize(codPageRecords));
- data.put('consumableorderdetailsRecords',JSON.serialize(consumableorderdetailsRecords));
- System.debug('iSinventory===>'+iSinventory);
- data.put('iSinventory',JSON.serialize(iSinventory));
- System.debug('pandiandetailsMap===>'+pandiandetailsMap);
- data.put('pandiandetailsMap',pandiandetailsMap);
- data.put('reSet',reSet);
- data.put('consumableorderdetailsRecordsview',JSON.serialize(consumableorderdetailsRecordsview));
- System.debug('=====>consumableorderdetailsRecordsview'+consumableorderdetailsRecordsview);
+ data.put('codPageRecords', JSON.serialize(codPageRecords));
+ data.put('consumableorderdetailsRecords', JSON.serialize(consumableorderdetailsRecords));
+ data.put('consumableorderdetailsRecordsview', JSON.serialize(consumableorderdetailsRecordsview));
+ data.put('pandiandetailsMap', pandiandetailsMap);
+ System.debug('iSinventory===>' + iSinventory);
+ System.debug('codPageRecords===>' + codPageRecords);
+ data.put('iSinventory', JSON.serialize(iSinventory));
+ data.put('reSet1', reSet1);
+ System.debug('reSet1===>' + reSet1);
res.code = 200;
- res.status = 'Sucess';
+ res.status = 'Success1';
+
return res;
+ }
+
+ //CHAN-B7J4NB 鍙湁涓�涓椂锛岀洏鐐逛笉鍒�
+ //init();
+ //CHAN-B7J4NB
+ Map<String, String> showproductIdMap = new Map<String, String>();
+ for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecords) {
+ showproductIdMap.put(ass.prod.Id + ass.boxPiece, ass.prod.Id + ass.boxPiece);
+ }
+ // 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
+ AND Arrive_Owner_Work_Location__c = :userWorkLocation
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name
+ ];
+ System.debug('reSet===>' + reSet);
+ Map<String, Integer> pandianProdIdCountMap = new Map<String, Integer>(); // ProdId 鍗樹綅
+ // 20200509 add gzw 璁板綍闇�瑕侀攢瀛樻暟閲�
+ Map<String, Integer> pandianoverdueCountMap = new Map<String, Integer>(); // ProdId 鍗樹綅
+ // 20200509 add gzw 璁板綍闇�瑕侀攢瀛樻暟閲�
+ Map<String, ConsumableorderdetailsInfo> barCodeListPandianMap = new Map<String, ConsumableorderdetailsInfo>(); // 鏄庣窗銉愩兗銈炽兗銉� 鍗樹綅
+ //鐩樼偣鍒扮殑鏄庣粏
+ for (Consumable_order_details2__c rs : reSet) {
+ //BarCodeListPandian.add(rs.Bar_Code_search__c);
+ for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecords) {
+ if (rs.Consumable_Product__c == ass.Prod.Id && rs.Box_Piece__c == ass.boxPiece) {
+ ass.check = true;
+ }
+ }
+
+ barCodeListPandianMap.put(rs.Bar_Code_search__c, new ConsumableorderdetailsInfo(rs));
+ if (rs.Isoverdue__c == 0) {
+ consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(rs, '璇ヤ骇鍝佸凡缁忚繃鏈夋晥鏈燂紝璇烽攢瀛樸��'));
+ pandiandetailsMap.put(rs.Id, '璇ヤ骇鍝佸凡缁忚繃鏈夋晥鏈燂紝璇烽攢瀛樸��');
+ 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
+ );
+ }
+ 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
+ );
+ }
+ }
+
+ // 缁忛攢鍟嗕箣闂存垨鑰呭悓涓�缁忛攢鍟嗕笉鍚屽伐浣滃湴璋冭揣
+ 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)
+ AND Dealer_Returned__c = FALSE
+ AND Cancellation_Flag__c = FALSE
+ 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
+ ];
+ 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);
+ }
+ // 闇�瑕佸叆搴撶殑浜у搧
+ for (Consumable_order_details2__c cod2 : reSet1) {
+ for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecords) {
+ if (cod2.Consumable_Product__c == ass.Prod.Id && cod2.Box_Piece__c == ass.boxPiece) {
+ ass.check = true;
+ }
+ }
+ if (!showproductIdMap.containsKey(cod2.Consumable_product__c + cod2.Box_Piece__c)) {
+ 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)
+ ) {
+ 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
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c = :userWorkLocation
+ ORDER BY Name
+ ];
+
+ for (Consumable_order_details2__c rs : productAdjust) {
+ // 杩囨湡搴撳瓨閿�瀛� 20200427 gzw add srart
+ if (rs.Isoverdue__c == 0 || rs.Lose_reason__c == '杩囨湡搴撳瓨閿�瀛�') {
+ consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(rs, '杩囨湡鎴栬�呴攢瀛樹骇鍝侊紝鏃犳硶瀵诲洖鍏ュ簱'));
+ pandiandetailsMap.put(rs.Id, '杩囨湡鎴栬�呴攢瀛樹骇鍝侊紝鏃犳硶瀵诲洖鍏ュ簱');
+ carCodeListLose.add(rs.Bar_Code_search__c);
+ continue;
+ }
+ // 杩囨湡搴撳瓨閿�瀛� 20200427 gzw add end
+ for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecords) {
+ if (rs.Consumable_Product__c == ass.Prod.Id && rs.Box_Piece__c == ass.boxPiece) {
+ ass.check = true;
+ }
+ }
+ if (!showproductIdMap.containsKey(rs.Consumable_product__c + rs.Box_Piece__c)) {
+ reFindProductList.add(rs);
+ proIdNotinpage.put(rs.Consumable_Product__c, rs.Box_Piece__c);
+ }
+ if (barCodeListAdjustMap.containsKey(rs.Bar_Code_search__c)) {
+ continue;
+ } else {
+ barCodeListAdjustMap.put(rs.Bar_Code_search__c, new ConsumableorderdetailsInfo(rs));
+ consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(rs, '瀵诲洖'));
+ pandiandetailsMap.put(rs.Id, '瀵诲洖');
+ consumableorderdetailsRecordsAdjust.add(new ConsumableorderdetailsInfo(rs));
+ }
+ }
+ if (reFindProductList.size() > 0) {
+ Map<String, Product2__c> midMap = new Map<String, Product2__c>();
+ 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()
+ ];
+ for (Product2__c pro : product_Refind) {
+ midMap.put(pro.Id, pro);
+ }
+ for (Integer i = 0; i < reFindProductList.size(); i++) {
+ //鐒跺悗寰幆CountDel鍋欱ox鍜宲iece2涓猰ap
+ 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();
+ Jstage.countid = 0;
+ if (reFindProductList[i].Isoverdue__c == 1) {
+ Jstage.limitCount = 0;
+ }
+ 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)
+ );
+ Jstage.countid = 0;
+ if (reFindProductList[i].Isoverdue__c == 1) {
+ Jstage.limitCount = 0;
+ }
+ Jstage.boxPiece = reFindProductList[i].Box_Piece__c;
+ newMidBoxMap.put(reFindProductList[i].Consumable_Product__c + reFindProductList[i].Box_Piece__c, Jstage);
+ }
+ } 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();
+ Jstage.countid = 0;
+ if (reFindProductList[i].Isoverdue__c == 1) {
+ Jstage.limitCount = 0;
+ }
+ 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)
+ );
+ Jstage.countid = 0;
+ if (reFindProductList[i].Isoverdue__c == 1) {
+ Jstage.limitCount = 0;
+ }
+ Jstage.boxPiece = reFindProductList[i].Box_Piece__c;
+ newMidPieceMap.put(reFindProductList[i].Consumable_Product__c + reFindProductList[i].Box_Piece__c, Jstage);
+ }
+ }
+ }
+ for (ConsumableorderdetailsInfo bss : newMidBoxMap.values()) {
+ bss.check = true;
+ bss.overlimitCount = bss.countid - bss.limitCount;
+ boxRecords.add(bss);
+ }
+ boxRecords.sort();
+ for (ConsumableorderdetailsInfo bss : newMidPieceMap.values()) {
+ bss.check = true;
+ bss.overlimitCount = bss.countid - bss.limitCount;
+ }
+ for (ConsumableorderdetailsInfo bss : boxRecords) {
+ consumableorderdetailsRecords.add(bss);
+ if (newMidPieceMap.containsKey(bss.Prod.Id + '涓�')) {
+ consumableorderdetailsRecords.add(newMidPieceMap.get(bss.Prod.Id + '涓�'));
+ //newMidPieceMap绉婚櫎宸茬粡娣诲姞鐨凱iece
+ newMidPieceMap.remove(bss.Prod.Id + '涓�');
+ }
+ }
+ for (ConsumableorderdetailsInfo bss : newMidPieceMap.values()) {
+ consumableorderdetailsRecords.add(newMidPieceMap.get(bss.Prod.Id + '涓�'));
+ }
+ }
+
+ //鍏堝彇鍑烘湭鐩樼偣鍒扮殑浜у搧
+ for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecords) {
+ if (ass.check == true) {
+ for (integer i = 0; i < ProductCount_Res.size(); i++) {
+ if (ProductCount_Res[i].Consumable_Product__c == ass.Prod.Id && ass.boxPiece == ProductCount_Res[i].Box_Piece__c) {
+ if (barCodeListPandianMap.get(ProductCount_Res[i].Bar_Code_search__c) != null) {
+ continue;
+ } else {
+ carCodeListLose.add(ProductCount_Res[i].Bar_Code__c);
+ ////barCodeListLoseMap.put(ProductCount_Res[i].Id, new ConsumableorderdetailsInfo(ProductCount_Res[i]));
+ //consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(ProductCount_Res[i],'涓㈠け'));
+ //pandiandetailsMap.put(ProductCount_Res[i].Id, '涓㈠け');
+ }
+ }
+ }
+ }
+ }
+ //宸茬粡鍑哄簱鐨勪骇鍝�
+ 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
+ AND (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 Dealer_Info_text__c = :accountName
+ 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);
+ }
+ //// 缁忛攢鍟嗕箣闂存垨鑰呭悓涓�缁忛攢鍟嗕笉鍚屽伐浣滃湴璋冭揣
+ //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)
+ // AND Dealer_Returned__c = FALSE
+ // AND Cancellation_Flag__c = FALSE
+ // 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 ];
+ //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) {
+ for (integer i = 0; i < ProductCount_Res.size(); i++) {
+ if (ProductCount_Res[i].Consumable_Product__c == ass.Prod.Id && ass.boxPiece == ProductCount_Res[i].Box_Piece__c) {
+ if (barCodeListPandianMap.containsKey(ProductCount_Res[i].Bar_Code_search__c)) {
+ continue;
+ }
+ if (ProductCount_Res[i].Isoverdue__c == 0) {
+ 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
+ ) {
+ 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
+ );
+ }
+ continue;
+ }
+
+ consumableorderdetailsRecordserrordummy.add(new ConsumableorderdetailsInfo(ProductCount_Res[i], '涓㈠け'));
+ pandiandetailsMap.put(ProductCount_Res[i].Id, '涓㈠け');
+ }
+ }
+ // 鍚屾椂瀛樺湪鍏朵粬缁忛攢鍟嗗簱瀛樹骇鍝�
+ 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 + '鐨勫簱瀛樸��'
+ );
+ continue;
+ }
+ }
+ }
+ // 闇�瑕佽繑鍝佺殑浜у搧
+ 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, '璇ヤ骇鍝佺洰鍓嶅嚭搴撶姸鎬侊紝璇疯繑鍝併��')
+ );
+ pandiandetailsMap.put(cod2.Id, '璇ヤ骇鍝佺洰鍓嶅嚭搴撶姸鎬侊紝璇疯繑鍝併��');
+ continue;
+ }
+ }
+ }
+ }
+ }
+
+ //鏇存柊涓绘槑缁嗗崟
+ if (barCodeListPandianMap.size() > 0) {
+ for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecords) {
+ if (ass.check == true) {
+ integer countSum = 0;
+ if (pandianProdIdCountMap.containsKey(ass.Prod.Id + ass.boxPiece)) {
+ countSum = pandianProdIdCountMap.get(ass.Prod.Id + ass.boxPiece);
+ }
+ integer overdueSum = 0;
+ if (pandianoverdueCountMap.containsKey(ass.Prod.Id + ass.boxPiece)) {
+ overdueSum = pandianoverdueCountMap.get(ass.Prod.Id + ass.boxPiece);
+ }
+ ass.Pandian = countSum;
+ ass.Diff = ass.countid - countSum - overdueSum;
+ ass.refind = 0;
+ }
+ }
+ } else {
+ for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecords) {
+ if (ass.check == true) {
+ integer overdueSum = 0;
+ if (pandianoverdueCountMap.containsKey(ass.Prod.Id + ass.boxPiece)) {
+ overdueSum = pandianoverdueCountMap.get(ass.Prod.Id + ass.boxPiece);
+ }
+ ass.Diff = ass.countid - ass.Pandian - overdueSum;
+ }
+ }
+ }
+
+ //瀵诲洖鍋氭垚
+ for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecords) {
+ for (ConsumableorderdetailsInfo adjust : consumableorderdetailsRecordsAdjust) {
+ if (ass.Prod.Name__c == adjust.Prod.Name__c && ass.boxPiece == adjust.orderdetails2.Box_Piece__c) {
+ if (reFindProduct.containsKey(adjust.orderdetails2.Bar_Code_search__c)) {
+ continue;
+ } else {
+ ass.Pandian++;
+ ass.refind++;
+ reFindProduct.put(adjust.orderdetails2.Bar_Code_search__c, adjust.orderdetails2.Bar_Code_search__c);
+ }
+ }
+ }
+ }
+ 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,
+ Bar_Code_search__c
+ FROM Consumable_order_details2__c
+ 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;
+ iSinventory = true;
+ consumableorderdetailsRecordserrordummy.clear();
+ 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
+ ];
+ for (Consumable_order_details2__c codDet : pandiandetailsList) {
+ codDet.Lose_reason__c = pandiandetailsMap.get(codDet.Id);
+ }
+ List<Consumable_order_details2__c> pandiandetailsListMid = new List<Consumable_order_details2__c>();
+ for (Consumable_order_details2__c cod2 : pandiandetailsList) {
+ pandiandetailsListMid.add(cod2);
+ if (pandiandetailsListMid.size() == 1000) {
+ pandiandetailsListShow.add(pandiandetailsListMid);
+ pandiandetailsListMid = new List<Consumable_order_details2__c>();
+ }
+ }
+ if (pandiandetailsListMid.size() > 0) {
+ pandiandetailsListShow.add(pandiandetailsListMid);
+ }
+ //鍒嗛〉
+ PaginatedAccounts paginatedAccounts = new PaginatedAccounts();
+ totalCount = codPageRecords.size();
+ paginatedAccounts.nextPageToken = (pageToken + pageSize < totalCount) ? pageToken + pageSize : null;
+ paginatedAccounts.recordStart = pageToken + 1;
+ paginatedAccounts.pageNumber = pageToken / pageSize + 1;
+ Integer recordEnd = pageSize * paginatedAccounts.pageNumber;
+ paginatedAccounts.recordEnd = totalCount >= recordEnd ? recordEnd : totalCount;
+ paginatedAccounts.totalRecords = totalCount;
+
+ Integer startIdx;
+ Integer endIdx;
+ List<ConsumableorderdetailsInfo> pageCodeRecords = new List<ConsumableorderdetailsInfo>();
+ startIdx = pageToken;
+ endIdx = startIdx + pageSize;
+ if (endIdx > codPageRecords.size()) {
+ endIdx = codPageRecords.size();
+ }
+ for (Integer i = startIdx; i < endIdx; i++) {
+ pageCodeRecords.add(codPageRecords.get(i));
+ }
+
+ data.put('paginatedAccounts', paginatedAccounts);
+ data.put('pageCodeRecords', pageCodeRecords);
+
+ //end
+
+ System.debug('=====>codPageRecords2' + codPageRecords);
+ System.debug('=====>consumableorderdetailsRecords' + consumableorderdetailsRecords);
+ data.put('codPageRecords', JSON.serialize(codPageRecords));
+ data.put('consumableorderdetailsRecords', JSON.serialize(consumableorderdetailsRecords));
+ System.debug('iSinventory===>' + iSinventory);
+ data.put('iSinventory', JSON.serialize(iSinventory));
+ System.debug('pandiandetailsMap===>' + pandiandetailsMap);
+ data.put('pandiandetailsMap', pandiandetailsMap);
+ data.put('reSet', reSet);
+ data.put('consumableorderdetailsRecordsview', JSON.serialize(consumableorderdetailsRecordsview));
+ System.debug('=====>consumableorderdetailsRecordsview' + consumableorderdetailsRecordsview);
+ res.code = 200;
+ res.status = 'Sucess';
+ return res;
}
-
+
// 淇濆瓨鎸夐挳
@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;
+ accountid = accountid;
pandiandetailsMap = pandiandetailsMap;
- reSet =reSet;
- System.debug('pandiandetailsMap===>'+pandiandetailsMap);
+ reSet = reSet;
+ System.debug('pandiandetailsMap===>' + pandiandetailsMap);
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
res.entity = data;
// 璺宠繃鏄庣粏2涓嶅繀瑕佹洿鏂�
StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
- if(!iSinventory){
- return new ResponseBodyLWC('Error',500, '璇峰厛褰曞叆BarCode', '');
+ if (!iSinventory) {
+ return new ResponseBodyLWC('Error', 500, '璇峰厛褰曞叆BarCode', '');
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'璇峰厛鐐广�怋arCode褰曞叆銆�'));
// return null;
}
integer Lo = 0;
- for(ConsumableorderdetailsInfo header : consumableorderdetailsRecords){
- if(header.check==true){
+ for (ConsumableorderdetailsInfo header : consumableorderdetailsRecords) {
+ if (header.check == true) {
Lo++;
}
}
- if(Lo == 0){
+ if (Lo == 0) {
iSinventory = false;
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'璇烽�夋嫨瑕佺洏鐐圭殑鏄庣粏'));
// return null;
- return new ResponseBodyLWC('Error',500, '璇烽�夋嫨瑕佺洏鐐圭殑鏄庣粏', '');
+ return new ResponseBodyLWC('Error', 500, '璇烽�夋嫨瑕佺洏鐐圭殑鏄庣粏', '');
}
- for(ConsumableorderdetailsInfo header : consumableorderdetailsRecords){
- if(header.check==true){
+ for (ConsumableorderdetailsInfo header : consumableorderdetailsRecords) {
+ if (header.check == true) {
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, header.prod.Name__c + ' '+header.prod.Name__c));
//return null;
- if((header.DiffReason == ''||header.DiffReason ==null)&&header.Diff>0){
- return new ResponseBodyLWC('Error',500, header.prod.Name__c + '璇疯緭鍏ュ樊寮傚師鍥�', '');
+ if ((header.DiffReason == '' || header.DiffReason == null) && header.Diff > 0) {
+ return new ResponseBodyLWC('Error', 500, header.prod.Name__c + '璇疯緭鍏ュ樊寮傚師鍥�', '');
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, header.prod.Name__c + '璇疯緭鍏ュ樊寮傚師鍥�'));
// return null;
- }else if ((header.DiffReason != ''&&header.DiffReason !=null)&&header.Diff==0){
+ } else if ((header.DiffReason != '' && header.DiffReason != null) && header.Diff == 0) {
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '鏃犱涪澶变骇鍝侊紝涓嶉渶瑕佸~鍐欏樊寮傚師鍥�'));
// return null;
- return new ResponseBodyLWC('Error',500, header.prod.Name__c + '鏃犱涪澶变骇鍝侊紝涓嶉渶瑕佸~鍐欏樊寮傚師鍥�', '');
+ return new ResponseBodyLWC('Error', 500, header.prod.Name__c + '鏃犱涪澶变骇鍝侊紝涓嶉渶瑕佸~鍐欏樊寮傚師鍥�', '');
}
}
}
Integer orderDetNo = 1;
Savepoint sp = Database.setSavepoint();
Consumable_order__c Po = new Consumable_order__c();
- Po.Name ='*';
+ Po.Name = '*';
Po.Order_status__c = '鎵瑰噯';
Po.Inventory_date__c = Date.today();
Po.Order_type__c = '鐩樼偣';
Po.Dealer_Info__c = accountid;
Po.Order_ProType__c = agencyProType;
Po.RecordTypeid = System.Label.RT_ConOrder_Inventory;
- try{
- insert Po;
+ try {
+ 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>();
- Map<String,String> ErrorName = new Map<String,String>();
- Map<String,Boolean> CheckTF = new Map<String,Boolean>();
- for(ConsumableorderdetailsInfo header : consumableorderdetailsRecords){
- if(header.check==true){
+ 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>();
+ Map<String, String> ErrorName = new Map<String, String>();
+ Map<String, Boolean> CheckTF = new Map<String, Boolean>();
+ for (ConsumableorderdetailsInfo header : consumableorderdetailsRecords) {
+ if (header.check == true) {
Consumable_orderdetails__c insPan = new Consumable_orderdetails__c();
insPan = new Consumable_orderdetails__c();
String str = string.valueOf(orderDetNo);
- if(str.length() == 1){
- str = '0' + str;
+ if (str.length() == 1) {
+ str = '0' + str;
}
- insPan.Name = Consumable_order[0].Name + '-'+ str;
+ insPan.Name = Consumable_order[0].Name + '-' + str;
insPan.Consumable_Product__c = header.ProdId;
- ErrorName.put(insPan.Consumable_Product__c,header.DiffReason);
- CheckTF.put(insPan.Consumable_product__c,true);
+ ErrorName.put(insPan.Consumable_Product__c, header.DiffReason);
+ CheckTF.put(insPan.Consumable_product__c, true);
insPan.Consumable_order__c = Po.Id;
insPan.Lose_reason__c = header.DiffReason;
insPan.Diff__c = header.Diff;
@@ -1122,60 +1305,67 @@
insPan.inventory_sum__c = header.Pandian;
insPan.Count_Sum__c = header.countid;
insPan.RecordTypeId = System.Label.RT_ConOrderDetail1_Inventory;
- orderDetNo ++;
+ orderDetNo++;
InsList.add(insPan);
}
}
- if(InsList.size()>0){
+ 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,
- Bar_Code_search__c
- FROM Consumable_order_details2__c
- WHERE Id in :pandiandetailsMap.keySet()
- order by Name];
- for(Consumable_order_details2__c cod : showcod2){
+ 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
+ ];
+ for (Consumable_order_details2__c cod : showcod2) {
Consumable_order_details2__c InsDetail = new Consumable_order_details2__c();
- InsDetail.Id =cod.Id;
+ InsDetail.Id = cod.Id;
InsDetail.Consumable_Inventory_order__c = po.Id;
InsDetail.Inventory_date__c = Date.today();
// 20210224 gzw CHAN-BXF3PG start
// if(pandiandetailsMap.get(cod.Id) == '涓㈠け' ){
- if(pandiandetailsMap.get(cod.Id) == '涓㈠け' && CheckTF.containsKey(cod.Consumable_product__c)){
- // 20210224 gzw CHAN-BXF3PG end
+ if (pandiandetailsMap.get(cod.Id) == '涓㈠け' && CheckTF.containsKey(cod.Consumable_product__c)) {
+ // 20210224 gzw CHAN-BXF3PG end
InsDetail.Lose_reason__c = ErrorName.get(cod.Consumable_product__c);
InsDetail.Lose_Flag__c = true;
- }else if(pandiandetailsMap.get(cod.Id) == '瀵诲洖' ){
+ } else if (pandiandetailsMap.get(cod.Id) == '瀵诲洖') {
InsDetail.Lose_reason__c = '';
InsDetail.Lose_Flag__c = false;
- }else{
+ } else {
continue;
}
InsListUp.add(InsDetail);
}
- for(Consumable_order_details2__c rs : reSet){
+ for (Consumable_order_details2__c rs : reSet) {
rs.Inventory_date__c = Date.today();
}
- if(reSet.size() > 0){
+ if (reSet.size() > 0) {
update reSet;
}
- if(InsListUp.size()>0){
- ControllerUtil.updateOrderDetailsSatus(InsListUp);// Commented By DTT - Li Jun for testing 20230407
+ if (InsListUp.size() > 0) {
+ ControllerUtil.updateOrderDetailsSatus(InsListUp); // Commented By DTT - Li Jun for testing 20230407
}
-
- }catch (Exception e) {
+ } catch (Exception e) {
Database.rollback(sp);
// ApexPages.addMessages(ex);
- return new ResponseBodyLWC('Error',500, e.getMessage()+e.getLineNumber(), '');
+ return new ResponseBodyLWC('Error', 500, e.getMessage() + e.getLineNumber(), '');
// return null;
}
// FIXME impliment BarCodeListAdjust
/************************************************************************************************/
// return ProS();
- data.put('eSetId',eSetId);
- data.put('InsListUp',InsListUp);
+ data.put('eSetId', eSetId);
+ data.put('InsListUp', InsListUp);
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
@@ -1187,15 +1377,15 @@
// 杩斿洖鐩樼偣涓�瑙�
PageReference ref = new Pagereference('/apex/InventoryList?eSetId=' + eSetId);
ref.setRedirect(true);
- return ref;
+ return ref;
}
//CSV鍑哄姏
public PageReference doClick() {
Pagereference pr = page.InventoryCSV;
return pr;
}
- //鍒嗛〉Bean
- public class PaginatedAccounts {
+ //鍒嗛〉Bean
+ public class PaginatedAccounts {
@AuraEnabled
public Integer nextPageToken;
@AuraEnabled
@@ -1209,6 +1399,7 @@
}
// Data Bean
+ @TestVisible
class ConsumableorderdetailsInfo implements Comparable {
@AuraEnabled
public Boolean check { get; set; }
@@ -1221,7 +1412,7 @@
@AuraEnabled
public Decimal countid { get; set; }
@AuraEnabled
- public String ProdId{get;set;}
+ public String ProdId { get; set; }
@AuraEnabled
public Decimal Pandian { get; set; }
@AuraEnabled
@@ -1240,14 +1431,13 @@
public Decimal overlimitCount { get; set; }
@AuraEnabled
public String boxPiece { get; set; }
- public ConsumableorderdetailsInfo(Consumable_order_details2__c e,string str) {
-
+ public ConsumableorderdetailsInfo(Consumable_order_details2__c e, string str) {
orderdetails2 = e;
Prod = e.Consumable_Product__r;
//e.Lose_reason__c = str;
DiffReason = str;
}
-
+
// 宸插瓨鍦ㄦ秷鑰楀搧鏄庣粏鐢�
public ConsumableorderdetailsInfo(Consumable_order_details2__c e) {
check = false;
@@ -1259,9 +1449,9 @@
check = false;
//orderdetails1 = new Consumable_orderdetails__c();
Prod = e;
- canSelect = true;
+ canSelect = true;
ProdId = string.valueOf(e.id);
- countid =0;
+ countid = 0;
Pandian = 0;
refind = 0;
Diff = 0;
@@ -1270,11 +1460,11 @@
}
// 鎺掑簭
public Integer compareTo(Object compareTo) {
- ConsumableorderdetailsInfo compareToesd =(ConsumableorderdetailsInfo)compareTo;
+ ConsumableorderdetailsInfo compareToesd = (ConsumableorderdetailsInfo) compareTo;
Integer returnValue = 0;
- if (countid > compareToesd.countid ) {
+ if (countid > compareToesd.countid) {
returnValue = -1;
- } else if (countid < compareToesd.countid ) {
+ } else if (countid < compareToesd.countid) {
returnValue = 1;
}
return returnValue;
diff --git a/force-app/main/default/classes/LexInventoryListController.cls b/force-app/main/default/classes/LexInventoryListController.cls
index a4e9395..b662082 100644
--- a/force-app/main/default/classes/LexInventoryListController.cls
+++ b/force-app/main/default/classes/LexInventoryListController.cls
@@ -1,7 +1,7 @@
public without sharing class LexInventoryListController {
/*****************妞滅储鐢�******************/
public static Consumable_order__c coc { get; set; }
- public static String baseUrl {get;private set;}
+ public static String baseUrl { get; private set; }
/*****************鐢婚潰琛ㄧずBean******************/
public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords { get; set; }
public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecordsError { get; set; }
@@ -22,7 +22,7 @@
// 鐢婚潰鍒濆鍖�
@AuraEnabled
public static ResponseBodyLWC init(String eSetId) {
- system.debug('eSetId====>'+eSetId);
+ system.debug('eSetId====>' + eSetId);
ESetId = eSetId;
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
@@ -31,49 +31,70 @@
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];
- System.debug('qs===>'+qs);
- if (qs.size()>0){
+ 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 ];
- System.debug('consumableorderdetailsSelected==>'+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
+ ];
+ 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]));
}
- data.put('qs',qs);
- System.debug('consumableorderdetailsRecords====>'+consumableorderdetailsRecords);
- data.put('consumableorderdetailsRecords',JSON.serialize(consumableorderdetailsRecords));
- data.put('ConsumableorderdetailsRecordsError',JSON.serialize(ConsumableorderdetailsRecordsError));
+ data.put('qs', qs);
+ System.debug('consumableorderdetailsRecords====>' + consumableorderdetailsRecords);
+ data.put('consumableorderdetailsRecords', JSON.serialize(consumableorderdetailsRecords));
+ data.put('ConsumableorderdetailsRecordsError', JSON.serialize(ConsumableorderdetailsRecordsError));
// if(ConsumableorderdetailsRecordsError.size()!=null){
// data.put('ConsumableorderdetailsRecordsError',JSON.serialize(ConsumableorderdetailsRecordsError));
// }
- System.debug('ConsumableorderdetailsRecordsError====>'+ConsumableorderdetailsRecordsError);
+ System.debug('ConsumableorderdetailsRecordsError====>' + ConsumableorderdetailsRecordsError);
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
diff --git a/force-app/main/default/classes/LexInventoryViewController.cls b/force-app/main/default/classes/LexInventoryViewController.cls
index 1a4c8fd..130028e 100644
--- a/force-app/main/default/classes/LexInventoryViewController.cls
+++ b/force-app/main/default/classes/LexInventoryViewController.cls
@@ -49,7 +49,7 @@
public static String category1 { get; set; }
public static Boolean editAble { get; set; }
// 缁忛攢鍟嗗湪搴撲骇鍝両D
- public static List<String> orderDetZaikuList{set;get;}
+ public static List<String> orderDetZaikuList { get; set; }
// 浜у搧 ID
public static String ESetId { get; set; }
public static String idCheck { get; set; }
@@ -98,7 +98,6 @@
categoryOptionMap = new Map<String, String>();
category4OptionMap = new Map<String, String>();
category5OptionMap = new Map<String, String>();
-
// 鍙栫敤鎴稩D
String userId = UserInfo.getUserId();
@@ -240,9 +239,7 @@
}
if (newMidPieceMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) {
ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(
- CountDel[i].Consumable_Product__c +
- CountDel[i].Box_Piece__c +
- tex
+ CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
)
.clone();
Jstage.allnumber = Jstage.allnumber + 1;
@@ -407,8 +404,8 @@
data.put('pageRecords', pageRecords);
data.put('consumableorderdetailsRecords', consumableorderdetailsRecords);
data.put('hasHos', hasHos);
- data.put('productLimtAndDate',proLimitAndDate);
- data.put('productkucun',productkucun);
+ data.put('productLimtAndDate', proLimitAndDate);
+ data.put('productkucun', productkucun);
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
@@ -416,16 +413,16 @@
return res;
}
@AuraEnabled
- public static ResponseBodyLWC categoryAllload(String category3LWC,String agencyProTypeLWC) {
+ public static ResponseBodyLWC categoryAllload(String category3LWC, String agencyProTypeLWC) {
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
res.entity = data;
- category3 = category3LWC;
- agencyProType = '%' + agencyProTypeLWC + '%';
+ category3 = category3LWC;
+ agencyProType = '%' + agencyProTypeLWC + '%';
- System.debug('category3LWC===>'+category3LWC);
- System.debug('agencyProType===>'+agencyProType);
-
+ System.debug('category3LWC===>' + category3LWC);
+ System.debug('agencyProType===>' + agencyProType);
+
AggregateResult[] category4List = [
SELECT Count(id), Category4_text__c c4c
FROM Product2__c
@@ -469,8 +466,8 @@
category5OptionList.add(new SelectOption(deliverycnt5, deliverycnt5));
category5OptionMap.put(deliverycnt5, deliverycnt5);
}
- System.debug('绫诲埆4'+category4OptionList);
- System.debug('绫诲埆5'+category5OptionList);
+ System.debug('绫诲埆4' + category4OptionList);
+ System.debug('绫诲埆5' + category5OptionList);
data.put('category4OptionMap', category4OptionMap);
data.put('category5OptionMap', category5OptionMap);
res.status = 'Success';
@@ -535,13 +532,13 @@
Map<String, Date> productkucunLWC
) {
try {
- System.debug('orderDetZaikuListLWC===>'+orderDetZaikuListLWC);
- System.debug('productkucun===>'+productkucun);
+ System.debug('orderDetZaikuListLWC===>' + orderDetZaikuListLWC);
+ System.debug('productkucun===>' + productkucun);
pageSize = pageSizeLWC;
pageToken = pageTokenLWC;
sortField = sortFieldLWC;
sortOrder = sortOrderLWC;
- productkucun = new Map<String, Date>();
+ productkucun = new Map<String, Date>();
orderDetZaikuList = new List<String>();
productkucun = productkucunLWC;
@@ -606,7 +603,7 @@
// if (String.isNotBlank(sortField) && String.isNotBlank(sortOrder)) {
// if(sortFieldLWC != 'limitCount'){
// soql += ' ORDER BY ' + sortField + ' ' + sortOrder;
-
+
// }
// }
System.debug('soql = ' + soql);
@@ -630,9 +627,7 @@
}
if (newMidBoxMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) {
ConsumableorderdetailsInfo Jstage = newMidBoxMap.get(
- CountDel[i].Consumable_Product__c +
- CountDel[i].Box_Piece__c +
- tex
+ CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
)
.clone();
Jstage.allnumber = Jstage.allnumber + 1;
@@ -662,9 +657,7 @@
}
if (newMidPieceMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) {
ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(
- CountDel[i].Consumable_Product__c +
- CountDel[i].Box_Piece__c +
- tex
+ CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
)
.clone();
Jstage.allnumber = Jstage.allnumber + 1;
@@ -780,11 +773,11 @@
paginatedAccounts.recordEnd = totalCount >= recordEnd ? recordEnd : totalCount;
paginatedAccounts.totalRecords = totalCount;
- List<ConsumableorderdetailsInfo> pageRecordsCompare = new List<ConsumableorderdetailsInfo>();
+ List<ConsumableorderdetailsInfo> pageRecordsCompare = new List<ConsumableorderdetailsInfo>();
System.debug('queryList = ' + JSON.serialize(queryList));
for (Integer i = 0; i < queryList.size(); i++) {
- for(ConsumableorderdetailsInfo ci : pageRecords){
- if(queryList[i].Id == ci.Prod.Id){
+ for (ConsumableorderdetailsInfo ci : pageRecords) {
+ if (queryList[i].Id == ci.Prod.Id) {
System.debug('queryList[i].Id =' + queryList[i].Id);
System.debug('ci.Prod.Id =' + queryList[i].Id);
pageRecordsCompare.add(ci);
@@ -938,7 +931,6 @@
// }
// pageRecords.sort();
// }
-
//妫�绱ql鏂囧仛鎴�
private static String makeSoql(String CateName, String CateCode, String Category3, String Category4, String Category5) {
diff --git a/force-app/main/default/classes/LexLicenceReminderController.cls b/force-app/main/default/classes/LexLicenceReminderController.cls
index 97a1cf3..a4e7706 100644
--- a/force-app/main/default/classes/LexLicenceReminderController.cls
+++ b/force-app/main/default/classes/LexLicenceReminderController.cls
@@ -1,41 +1,40 @@
public without sharing class LexLicenceReminderController {
-
@AuraEnabled
- public static Results initReminder(){
+ public static Results initReminder() {
Results results = new Results();
try {
- 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()];
String accountId = useracc.AccountId;
- List<Account> accList = [SELECT Name,Medical_Equipment_Expiration_Date__c FROM Account WHERE Id =:accountId];
+ List<Account> accList = [SELECT Name, Medical_Equipment_Expiration_Date__c FROM Account WHERE Id = :accountId];
Account accountInfo = new Account();
- if(accList.size() == 1){
+ if (accList.size() == 1) {
accountInfo = accList[0];
- }else{
+ } else {
results.result = 'Fail';
results.isShowReminder = false;
results.errorMsg = '鏈幏鍙栧埌缁忛攢鍟嗕俊鎭�';
return results;
}
- if(accountInfo.Medical_Equipment_Expiration_Date__c != null){
+ if (accountInfo.Medical_Equipment_Expiration_Date__c != null) {
Integer days = LexUtility.getLicenceReminderDays();
Date today = Date.today();
// Date today = Date.newInstance(2024, 7, 21);
Integer numberDaysDue = today.daysBetween(accountInfo.Medical_Equipment_Expiration_Date__c);
- if(numberDaysDue > days){
+ if (numberDaysDue > days) {
results.isShowReminder = false;
- }else{
+ } else {
results.isShowReminder = true;
results.days = numberDaysDue;
}
results.result = 'Success';
- }else {
+ } else {
results.result = 'Fail';
results.errorMsg = '鏈幏鍙栧埌鍖荤枟鍣ㄦ缁忚惀浼佷笟璁稿彲璇佹湁鏁堟湡闄�';
}
} catch (Exception e) {
results.result = 'Fail';
results.isShowReminder = false;
- results.errorMsg = e.getLineNumber()+'---'+e.getMessage();
+ results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
return results;
}
diff --git a/force-app/main/default/classes/LexOutboundorderImportController.cls b/force-app/main/default/classes/LexOutboundorderImportController.cls
index a1f00f6..aad8163 100644
--- a/force-app/main/default/classes/LexOutboundorderImportController.cls
+++ b/force-app/main/default/classes/LexOutboundorderImportController.cls
@@ -50,6 +50,7 @@
res.status = 'Success';
res.code = 200;
res.msg = '';
+ System.debug('res:' + res);
return res;
}
@@ -102,7 +103,7 @@
barcodePieceMap.put(csvRecordData[6], Integer.valueOf(csvRecordData[7]));
}
}
- String[] csvRecordDataStr = new List<String>(13);
+ String[] csvRecordDataStr = new String[13];
for (Integer j = 0; j < csvRecordData.size(); j++) {
csvRecordDataStr[j] = csvRecordData[j];
}
@@ -190,8 +191,8 @@
data.put('saveFLGbln', saveFLGbln);
data.put('csvRecordStr', csvRecordStr);
data.put('barcodeList', barcodeList);
- data.put('secondAgencyMap',secondAgencyMap);
- data.put('hospitalSysMap',hospitalSysMap);
+ data.put('secondAgencyMap', secondAgencyMap);
+ data.put('hospitalSysMap', hospitalSysMap);
res.status = 'Success';
res.code = 200;
res.msg = errorMsg;
@@ -587,7 +588,7 @@
res.entity = data;
csvRecordStr = csvRecordStrLwc;
- orderRecords = (List<ConsumableorderdetailsInfo>)JSON.deserialize(orderRecordsLwc, List<ConsumableorderdetailsInfo>.class);
+ orderRecords = (List<ConsumableorderdetailsInfo>) JSON.deserialize(orderRecordsLwc, List<ConsumableorderdetailsInfo>.class);
System.debug('orderRecords = ' + orderRecords);
sqlagencyProType = sqlagencyProTypeLwc;
userWorkLocation = userWorkLocationLwc;
@@ -753,9 +754,7 @@
string[] csvRecordData = csvRecordStr[i];
if (orderdetMap.containsKey(csvRecordData[0] + csvRecordData[12] + csvRecordData[9])) {
orderdetMap.put(
- csvRecordData[0] +
- csvRecordData[12] +
- csvRecordData[9],
+ csvRecordData[0] + csvRecordData[12] + csvRecordData[9],
orderdetMap.get(csvRecordData[0] + csvRecordData[12] + csvRecordData[9]) + Decimal.valueOf(csvRecordData[7])
);
continue;
@@ -786,7 +785,7 @@
// ApexPages.addMessages(e);
// return null;
errorMsg += e.getMessage() + ' ' + e.getLineNumber() + ';';
- System.debug('orderdetRecords = null ' + e.getLineNumber());
+ System.debug('orderdetRecords = null ' + e.getLineNumber());
return null;
}
}
@@ -864,7 +863,7 @@
return null;
}
}
-
+ @TestVisible
class ConsumableorderdetailsInfo implements Comparable {
@AuraEnabled
public Consumable_order__c order { get; set; }
diff --git a/force-app/main/default/classes/LexOverdueStockController.cls b/force-app/main/default/classes/LexOverdueStockController.cls
index c6d0fd1..1a71a71 100644
--- a/force-app/main/default/classes/LexOverdueStockController.cls
+++ b/force-app/main/default/classes/LexOverdueStockController.cls
@@ -1,5 +1,4 @@
public with sharing class LexOverdueStockController {
-
/*****************妞滅储鐢�******************/
public static String barcode { get; set; }
@@ -17,19 +16,18 @@
// 缁忛攢鍟嗕俊鎭�
private static Account accountInfo;
- //鍒ゆ柇鎿嶄綔浜哄憳鏄惁閿�瀛�
+ //鍒ゆ柇鎿嶄綔浜哄憳鏄惁閿�瀛�
public static Boolean iSinventory = false;
public static List<Consumable_order_details2__c> overdueList = new List<Consumable_order_details2__c>();
- public static Integer pageRecordsSize {
+ public static Integer pageRecordsSize {
get {
return codPageRecords == null ? 0 : codPageRecords.size();
}
}
public LexOverdueStockController() {
-
}
// 鐢婚潰鍒濆鍖�
@@ -42,103 +40,118 @@
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)){
+ if (String.isBlank(Useracc.UserPro_Type__c)) {
agencyProType = 'ET';
}
sqlagencyProType = '%' + agencyProType + '%';
- accountInfo = [SELECT id,Name,Dealer_discount__c FROM account WHERE id =:Useracc.accountid];
+ 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
- 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 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_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];
+ 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
+ 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_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
+ ];
- for(AggregateResult overdue : orderDetZaiku){
+ for (AggregateResult overdue : orderDetZaiku) {
codPageRecords.add(new orderBean(overdue));
}
- system.debug('codPageRecords====>'+codPageRecords);
- data.put('codPageRecords',JSON.serialize(codPageRecords));
- data.put('userWorkLocation',userWorkLocation);
- data.put('accountName',accountInfo.Name);
- data.put('agencyProType',agencyProType);
- data.put('orderDetZaiku',JSON.serialize(orderDetZaiku));
+ system.debug('codPageRecords====>' + codPageRecords);
+ data.put('codPageRecords', JSON.serialize(codPageRecords));
+ data.put('userWorkLocation', userWorkLocation);
+ data.put('accountName', accountInfo.Name);
+ data.put('agencyProType', agencyProType);
+ data.put('orderDetZaiku', JSON.serialize(orderDetZaiku));
res.status = 'Success';
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;
- List<orderBean> codPageRecords = (List<orderBean>)JSON.deserialize(codPageRecordsLWC,List<orderBean>.class);
+ List<orderBean> codPageRecords = (List<orderBean>) JSON.deserialize(codPageRecordsLWC, List<orderBean>.class);
sqlagencyProType = '%' + agencyProTypeLWC + '%';
- system.debug('sqlagencyProType==>'+ sqlagencyProType);
+ system.debug('sqlagencyProType==>' + sqlagencyProType);
barcode = barcodeLWC;
- system.debug('barcode==>'+ barcode);
+ system.debug('barcode==>' + barcode);
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()];
- accountInfo = [SELECT id,Name,Dealer_discount__c FROM account WHERE id =:Useracc.accountid];
-
-
+ 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>();
overduePageRecords = new List<orderBean>();
- List<String> barCodeListP = ParseBarCode( barcode );
+ List<String> barCodeListP = ParseBarCode(barcode);
// 椤甸潰鏄剧ず鏁版嵁鍒濆鍖�
for (orderBean codPage : codPageRecords) {
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,
- 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
- 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_Info_text__c = :accountInfo.Name
- AND Arrive_Owner_Work_Location__c = :userWorkLocation];
+ 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
+ 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_Info_text__c = :accountInfo.Name
+ AND Arrive_Owner_Work_Location__c = :userWorkLocation
+ ];
// 娌℃湁杈撳叆鏉$爜鏃讹紝寰幆椤甸潰锛屾墍鏈夋墦閽╀骇鍝佸叏閮ㄩ攢瀛�
// 鍙栧緱鎵�鏈�
overdueList = new List<Consumable_order_details2__c>();
if (String.isBlank(barcode)) {
System.debug('barcode绌�');
- for(orderBean codPage : codPageRecords){
+ for (orderBean codPage : codPageRecords) {
if (codPage.check) {
- for(Consumable_order_details2__c cod2 : orderDetZaiku){
- if(cod2.Consumable_Product__c == codPage.prodid && codPage.boxPiece == cod2.Box_Piece__c){
- overduePageRecords.add(new orderBean(cod2,'杩囨湡搴撳瓨閿�瀛�'));
+ for (Consumable_order_details2__c cod2 : orderDetZaiku) {
+ if (cod2.Consumable_Product__c == codPage.prodid && codPage.boxPiece == cod2.Box_Piece__c) {
+ overduePageRecords.add(new orderBean(cod2, '杩囨湡搴撳瓨閿�瀛�'));
overdueList.add(cod2);
}
}
@@ -146,164 +159,176 @@
}
}
// return;
- System.debug('overduePageRecords = ' + overduePageRecords);
- System.debug('overdueList = ' + overdueList);
- data.put('overduePageRecords',JSON.serialize(overduePageRecords));
- data.put('codPageRecords',JSON.serialize(codPageRecords));
- data.put('iSinventory',iSinventory);
- data.put('overdueList',overdueList);
- res.status = 'Success1';
- res.code = 200;
- // res.msg = '璇疯緭鍏arCode鍙�';
- System.debug('res = ' + res);
- return res;
+ System.debug('overduePageRecords = ' + overduePageRecords);
+ System.debug('overdueList = ' + overdueList);
+ data.put('overduePageRecords', JSON.serialize(overduePageRecords));
+ data.put('codPageRecords', JSON.serialize(codPageRecords));
+ data.put('iSinventory', iSinventory);
+ data.put('overdueList', overdueList);
+ res.status = 'Success1';
+ res.code = 200;
+ // res.msg = '璇疯緭鍏arCode鍙�';
+ System.debug('res = ' + res);
+ return res;
}
// 杈撳叆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
- AND Arrive_Owner_Work_Location__c =: userWorkLocation
- AND Dealer_Info_text__c = :accountInfo.Name
- order by Name];
-
- System.debug('reSet===>'+reSet);
+ 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
+ ];
+ 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) {
+ 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
+ ) {
for (orderBean codPage : codPageRecords) {
- if(cod2.Consumable_Product__c == codPage.prodid && cod2.Box_Piece__c == codPage.boxPiece){
- overduePageRecords.add(new orderBean(cod2,'杩囨湡搴撳瓨閿�瀛�'));
+ if (cod2.Consumable_Product__c == codPage.prodid && cod2.Box_Piece__c == codPage.boxPiece) {
+ overduePageRecords.add(new orderBean(cod2, '杩囨湡搴撳瓨閿�瀛�'));
overdueList.add(cod2);
- codPage.pandian ++;
+ codPage.pandian++;
codPage.check = true;
}
}
- }else if (cod2.Dealer_Shipment__c || cod2.Dealer_Saled__c) {
- overduePageRecords.add(new orderBean(cod2,'浜у搧宸茬粡鍑哄簱'));
- }else{
- overduePageRecords.add(new orderBean(cod2,'涓嶆槸杩囨湡搴撳瓨'));
+ } else if (cod2.Dealer_Shipment__c || cod2.Dealer_Saled__c) {
+ overduePageRecords.add(new orderBean(cod2, '浜у搧宸茬粡鍑哄簱'));
+ } else {
+ overduePageRecords.add(new orderBean(cod2, '涓嶆槸杩囨湡搴撳瓨'));
}
}
System.debug('overduePageRecords = ' + overduePageRecords);
- data.put('overduePageRecords',JSON.serialize(overduePageRecords));
- data.put('codPageRecords',JSON.serialize(codPageRecords));
- data.put('iSinventory',iSinventory);
- data.put('overdueList',overdueList);
+ data.put('overduePageRecords', JSON.serialize(overduePageRecords));
+ data.put('codPageRecords', JSON.serialize(codPageRecords));
+ data.put('iSinventory', iSinventory);
+ data.put('overdueList', overdueList);
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
return res;
}
-
// 淇濆瓨鎸夐挳
@AuraEnabled
- public static ResponseBodyLWC save(Boolean iSinventory,string saveCodPageRecords,List<Consumable_order_details2__c> saveoverdueList) {
+ public static ResponseBodyLWC save(Boolean iSinventory, string saveCodPageRecords, List<Consumable_order_details2__c> saveoverdueList) {
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
res.entity = data;
- system.debug('saveCodPageRecords=============>'+saveCodPageRecords);
- system.debug('saveoverdueList'+saveoverdueList);
- overdueList = saveoverdueList;
+ system.debug('saveCodPageRecords=============>' + saveCodPageRecords);
+ system.debug('saveoverdueList' + saveoverdueList);
+ overdueList = saveoverdueList;
// if(saveoverdueList==null){
// return new ResponseBodyLWC('Error',500, '璇烽�夋嫨瑕侀攢瀛樼殑鏄庣粏', '');
// }
- List<orderBean> codPageRecords = (List<orderBean>)JSON.deserialize(saveCodPageRecords,List<orderBean>.class);
+ List<orderBean> codPageRecords = (List<orderBean>) JSON.deserialize(saveCodPageRecords, List<orderBean>.class);
// 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
+ // add by Wang Xueqin 2023/04/12
// 鑾峰彇鐢ㄦ埛鍜岀粡閿�鍟嗕俊鎭�
- 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];
+ 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){
+ if (!iSinventory) {
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'璇峰厛鐐广�怋arCode褰曞叆銆�'));
- return new ResponseBodyLWC('Error',500, '璇峰厛鐐瑰嚮鑾峰彇鏄庣粏', '');
+ return new ResponseBodyLWC('Error', 500, '璇峰厛褰曞叆BarCode', '');
// return null;
}
integer Lo = 0;
- for(orderBean header : codPageRecords){
- if(header.check==true){
+ for (orderBean header : codPageRecords) {
+ if (header.check == true) {
Lo++;
}
}
- if(Lo == 0){
+ if (Lo == 0) {
iSinventory = false;
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'璇烽�夋嫨瑕侀攢瀛樼殑鏄庣粏銆�'));
- return new ResponseBodyLWC('Error',500, '璇烽�夋嫨瑕侀攢瀛樼殑鏄庣粏', '');
+ return new ResponseBodyLWC('Error', 500, '璇烽�夋嫨瑕侀攢瀛樼殑鏄庣粏', '');
// return null;
}
Integer orderDetNo = 1;
Savepoint sp = Database.setSavepoint();
Consumable_order__c po = new Consumable_order__c();
- po.Name ='*';
+ po.Name = '*';
po.Order_status__c = '鎵瑰噯';
po.Inventory_date__c = Date.today();
po.Order_type__c = '閿�瀛�';
po.Dealer_Info__c = accountInfo.Id;
po.Order_ProType__c = agencyProType;
po.RecordTypeid = System.Label.RT_ConOrder_Overdue;
- 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>();
- for(orderBean header : codPageRecords){
- if(header.check==true){
+ 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>();
+ for (orderBean header : codPageRecords) {
+ if (header.check == true) {
Consumable_orderdetails__c insPan = new Consumable_orderdetails__c();
String str = string.valueOf(orderDetNo);
- if(str.length() == 1){
- str = '0' + str;
+ if (str.length() == 1) {
+ str = '0' + str;
}
- insPan.Name = order.Name + '-'+ str;
+ insPan.Name = order.Name + '-' + str;
insPan.Consumable_Product__c = header.prodId;
insPan.Consumable_order__c = po.Id;
insPan.Lose_reason__c = '杩囨湡搴撳瓨閿�瀛�';
insPan.Overdue_count__c = header.pandian;
insPan.Overdue_SUM__c = header.overlimitCount;
insPan.RecordTypeId = System.Label.RT_ConOrderDetail1_Inventory;
- orderDetNo ++;
+ orderDetNo++;
InsList.add(insPan);
}
}
// 鐢熸垚鏄庣粏1
- if(InsList.size()>0){
+ if (InsList.size() > 0) {
insert InsList;
}
- for(Consumable_order_details2__c cod : overdueList){
+ for (Consumable_order_details2__c cod : overdueList) {
cod.Consumable_Inventory_order__c = po.Id;
cod.Inventory_date__c = Date.today();
cod.Lose_reason__c = '杩囨湡搴撳瓨閿�瀛�';
cod.Lose_Flag__c = true;
-
}
- if(overdueList.size()>0){
+ if (overdueList.size() > 0) {
ControllerUtil.updateOrderDetailsSatus(overdueList);
}
-
- }catch (Exception ex) {
+ } catch (Exception ex) {
Database.rollback(sp);
ApexPages.addMessages(ex);
return null;
}
// return new Pagereference('/' + po.Id);
- data.put('Id',po.Id);
+ data.put('Id', po.Id);
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
@@ -311,24 +336,24 @@
}
// 灏嗛〉闈㈡垨鍙栧緱BarCode鍘绘帀閲嶅鐨勶紝杞崲鎴怢ist
- public static List<String> ParseBarCode(String Code){
- Map<String,Integer> barcodeCountMap = new Map<String,Integer>();
- String[] Cache = new String[]{};
+ public static List<String> ParseBarCode(String Code) {
+ Map<String, Integer> barcodeCountMap = new Map<String, Integer>();
+ String[] Cache = new List<String>{};
Cache = Code.split('\n');
- List <String> Buff = new List<String>();
- for(String A : Cache){
+ List<String> Buff = new List<String>();
+ for (String A : Cache) {
A = A.trim().toUpperCase();
- if(barcodeCountMap.containsKey(A)){
- barcodeCountMap.put(A,barcodeCountMap.get(A) + 1);
- }else{
- barcodeCountMap.put(A,1);
+ if (barcodeCountMap.containsKey(A)) {
+ barcodeCountMap.put(A, barcodeCountMap.get(A) + 1);
+ } else {
+ barcodeCountMap.put(A, 1);
}
Buff.add(A + barcodeCountMap.get(A));
}
return Buff;
}
- // Data Bean
+ // Data Bean
class orderBean implements Comparable {
@AuraEnabled
public Consumable_order_details2__c orderdetails2 { get; set; }
@@ -336,7 +361,7 @@
public Product2__c Prod { get; set; }
@AuraEnabled
public Boolean check { get; set; }
-
+
// 杩囨湡搴撳瓨
@AuraEnabled
public Integer overlimitCount { get; set; }
@@ -353,7 +378,7 @@
public String prodname { get; set; }
@AuraEnabled
public String prodid { get; set; }
- orderBean(Consumable_order_details2__c e,string str) {
+ orderBean(Consumable_order_details2__c e, string str) {
orderdetails2 = e;
Prod = e.Consumable_Product__r;
DiffReason = str;
@@ -368,11 +393,11 @@
}
// 鎺掑簭
public Integer compareTo(Object compareTo) {
- orderBean compareToesd =(orderBean)compareTo;
+ orderBean compareToesd = (orderBean) compareTo;
Integer returnValue = 0;
- if (overlimitCount > compareToesd.overlimitCount ) {
+ if (overlimitCount > compareToesd.overlimitCount) {
returnValue = -1;
- } else if (overlimitCount < compareToesd.overlimitCount ) {
+ } else if (overlimitCount < compareToesd.overlimitCount) {
returnValue = 1;
}
return returnValue;
diff --git a/force-app/main/default/classes/LexProductLimitEditController.cls b/force-app/main/default/classes/LexProductLimitEditController.cls
index 3a8ca5b..a3b0aeb 100644
--- a/force-app/main/default/classes/LexProductLimitEditController.cls
+++ b/force-app/main/default/classes/LexProductLimitEditController.cls
@@ -4,54 +4,55 @@
//--------AddStart-----XHL--------------20180929-------------
public static String userPro_Type { get; set; }
public static Boolean EngFlag = false;
- public static Boolean ETFlag = false;
+ public static Boolean ETFlag = false;
//--------AddEnd-----XHL--------------20180929-------------
// 鐢婚潰鍒濆鍖�
- public LexProductLimitEditController (){
- accountid= ApexPages.currentPage().getParameters().get('accountid');
+ public LexProductLimitEditController() {
+ accountid = ApexPages.currentPage().getParameters().get('accountid');
//--------AddStart-----XHL--------------20181008-------------
- userPro_Type= ApexPages.currentPage().getParameters().get('userPro_Type');
- if(String.isBlank(userPro_Type)){
+ userPro_Type = ApexPages.currentPage().getParameters().get('userPro_Type');
+ if (String.isBlank(userPro_Type)) {
userPro_Type = 'ET';
}
- if(userPro_Type == 'ENG'){
+ if (userPro_Type == 'ENG') {
EngFlag = true;
- }else{
+ } else {
ETFlag = true;
}
//--------AddEnd-----XHL--------------20181008-------------
}
@AuraEnabled
- public static ResponseBodyLWC init(String accountid,string userPro_Type) {
- System.debug('userPro_Type==>'+userPro_Type);
- System.debug('accountid==>'+accountid);
+ public static ResponseBodyLWC init(String accountid, string userPro_Type) {
+ System.debug('userPro_Type==>' + userPro_Type);
+ System.debug('accountid==>' + accountid);
ResponseBodyLWC res = new ResponseBodyLWC();
- Map<String,object> data = new Map<String,object>();
+ Map<String, object> data = new Map<String, object>();
res.entity = data;
- if(String.isBlank(userPro_Type)){
+ if (String.isBlank(userPro_Type)) {
userPro_Type = 'ET';
}
- if(userPro_Type == 'ENG'){
+ if (userPro_Type == 'ENG') {
EngFlag = true;
- }else{
+ } else {
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
- FROM Account
- 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;
+ accinfo = [
+ SELECT Product_Limit_Date__c, Product_Limit_DateENG__c
+ FROM Account
+ 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);
+ System.debug('product_Limit==>' + product_Limit);
+ data.put('product_Limit', product_Limit);
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
diff --git a/force-app/main/default/classes/LexRemoveBoxController.cls b/force-app/main/default/classes/LexRemoveBoxController.cls
index 8388cd6..6360f98 100644
--- a/force-app/main/default/classes/LexRemoveBoxController.cls
+++ b/force-app/main/default/classes/LexRemoveBoxController.cls
@@ -1,6 +1,6 @@
public without sharing class LexRemoveBoxController {
//缁忛攢鍟嗕骇鍝佸垎绫�
- public static String agencyProType {get;set;}
+ public static String agencyProType { get; set; }
public static String userPro_Typestr = null;
public static String barcode { get; set; }
/*****************鐢婚潰琛ㄧずBean******************/
@@ -9,11 +9,11 @@
public static List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordserror { get; set; }
//鎷嗙洅鏄庣粏
public static List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy { get; set; }
- public static boolean saveFLGbln {get;set;}
+ public static boolean saveFLGbln { get; set; }
//閿欒淇℃伅
- public static String alertMessage {set;get;}
+ public static String alertMessage { get; set; }
//鎷嗙洅鏄庣粏浠舵暟
- public static integer getinventorysize(){
+ public static integer getinventorysize() {
return ConsumableorderdetailsRecordsdummy.size();
}
public static Map<String, String> ExistIdMap = new Map<String, String>();
@@ -21,48 +21,47 @@
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 String baseUrl {get;private set;}
+ 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;
//public String[] proidList =new String[]{};
// 鐧诲綍鑰呭伐浣滃湴
private static String userWorkLocation;
- public LexRemoveBoxController(){
+ public LexRemoveBoxController() {
baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>();
ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>();
consumableInventory = new List<ConsumableorderdetailsInfo>();
- saveFLGbln = FALSE;
+ saveFLGbln = false;
}
@AuraEnabled
public static ResponseBodyLWC init() {
ResponseBodyLWC res = new ResponseBodyLWC();
- Map<String,object> data = new Map<String,object>();
+ Map<String, object> data = new Map<String, object>();
res.entity = data;
-
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;
- if(String.isBlank(Useracc[0].UserPro_Type__c)){
+ if (String.isBlank(Useracc[0].UserPro_Type__c)) {
agencyProType = 'ET';
}
userPro_Typestr = '%' + agencyProType + '%';
- List<account> accountInfo = [SELECT Name FROM account WHERE id =:accountid];
+ List<account> accountInfo = [SELECT Name FROM account WHERE id = :accountid];
//String view_product = accountInfo[0].view_product__c;
accountName = accountInfo[0].Name;
//proidList = view_product.split(',');
- data.put('ConsumableorderdetailsRecordsdummy',JSON.serialize(ConsumableorderdetailsRecordsdummy));
- data.put('accountName',accountName);
- data.put('userWorkLocation',userWorkLocation);
- data.put('agencyProType',agencyProType);
+ data.put('ConsumableorderdetailsRecordsdummy', JSON.serialize(ConsumableorderdetailsRecordsdummy));
+ data.put('accountName', accountName);
+ data.put('userWorkLocation', userWorkLocation);
+ data.put('agencyProType', agencyProType);
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
@@ -70,15 +69,15 @@
}
// 灏嗛〉闈㈡垨鍙栧緱BarCode鍘绘帀閲嶅鐨勶紝杞崲鎴怢ist
- public static List<String> ParseBarCode(String Code){
- String[] Cache = new String[]{};
+ public static List<String> ParseBarCode(String Code) {
+ String[] Cache = new List<String>{};
Cache = Code.split('\n');
- Set <String> Buff = new Set<String>();
- for(String A : Cache){
+ Set<String> Buff = new Set<String>();
+ for (String A : Cache) {
Buff.add(A);
}
List<String> outPut = new List<String>();
- for(String B :Buff){
+ for (String B : Buff) {
B = B.trim();
outPut.add(B);
}
@@ -87,10 +86,14 @@
//鑾峰彇鏄庣粏
@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>();
+ Map<String, object> data = new Map<String, object>();
res.entity = data;
userPro_Typestr = '%' + agencyProType + '%';
barcode = barcode;
@@ -99,21 +102,19 @@
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;
- alertMessage='';
-
+ alertMessage = '';
+
//鍒ゆ柇barcode鏄惁涓虹┖
- if(barcode == null || barcode ==''){
- return new ResponseBodyLWC('Error',500, '璇疯緭鍏arCode鍙�', '');
+ if (barcode == null || barcode == '') {
+ return new ResponseBodyLWC('Error', 500, '璇疯緭鍏arCode鍙�', '');
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'璇疯緭鍏arCode鍙枫��'));
// return;
}
@@ -125,417 +126,529 @@
// 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
- FROM Consumable_order_details2__c
- 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 ];
- if(reSet1.size() > 0){
+ 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
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c = :userWorkLocation
+ 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)){
+ if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- }else{
- String str = '璇ュ晢鍝佺被鍨�'+ reSet1[i].Product_Type__c +'涓庣敤鎴风被鍨�'+ agencyProType +'涓嶇,涓嶈兘鎷嗙洅';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ } else {
+ String str = '璇ュ晢鍝佺被鍨�' + reSet1[i].Product_Type__c + '涓庣敤鎴风被鍨�' + agencyProType + '涓嶇,涓嶈兘鎷嗙洅';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
}
//鏈埌璐�
- reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
- Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
- Deliver_date__c,Bar_Code__c,
- 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
- 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 Bar_Code__c in :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name ]; //宸插彂璐э紝鏈埌璐�
- if(reSet1.size() > 0){
+ 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
+ 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 Bar_Code__c IN :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name
+ ]; //宸插彂璐э紝鏈埌璐�
+ if (reSet1.size() > 0) {
for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- }else{
+ } else {
String str = '璇ュ晢鍝佹湭鍒拌揣,涓嶈兘鎷嗙洅';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
}
//宸茶鏍�=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
- 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 Box_Piece__c = '鐩�'
- AND ProductPacking_list_manual__c = 1
- AND Bar_Code__c in :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name ]; //娌″嚭搴擄紝娌¢攢鍞紝灏辨槸鍦ㄥ簱锛屾病鎷嗙洅锛岃鏍�=1
- if(reSet1.size() > 0){
+ 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
+ AND Lose_Flag__c = FALSE
+ AND Box_Piece__c = '鐩�'
+ AND ProductPacking_list_manual__c = 1
+ AND Bar_Code__c IN :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name
+ ]; //娌″嚭搴擄紝娌¢攢鍞紝灏辨槸鍦ㄥ簱锛屾病鎷嗙洅锛岃鏍�=1
+ if (reSet1.size() > 0) {
for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- }else{
+ } else {
String str = '璇ュ晢鍝佽鏍间负1,涓嶈兘鎷嗙洅';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
}
//宸插嚭璐�
- reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
- Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
- Deliver_date__c,Bar_Code__c,
- 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
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name ];
- if(reSet1.size() > 0){
+ 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
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name
+ ];
+ if (reSet1.size() > 0) {
for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- }else{
+ } else {
String str = '璇ュ晢鍝佸凡鍑鸿揣';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
}
//宸查攢鍞�
- reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
- Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
- Deliver_date__c,Bar_Code__c,
- 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
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name ];
- if(reSet1.size() > 0){
+ 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
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name
+ ];
+ if (reSet1.size() > 0) {
for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- }else{
+ } else {
String str = '璇ュ晢鍝佸凡閿�鍞�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
}
//宸叉媶鐩�
- reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
- Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
- Deliver_date__c,Bar_Code__c,
- 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
- AND Box_Piece__c = '涓�'
- AND ProductPacking_list_manual__c > 1
- AND Bar_Code__c in :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name ]; //娌″嚭搴擄紝娌¢攢鍞紝灏辨槸鍦ㄥ簱锛屽凡鎷嗙洅
- if(reSet1.size() > 0){
+ 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
+ AND Box_Piece__c = '涓�'
+ AND ProductPacking_list_manual__c > 1
+ AND Bar_Code__c IN :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name
+ ]; //娌″嚭搴擄紝娌¢攢鍞紝灏辨槸鍦ㄥ簱锛屽凡鎷嗙洅
+ if (reSet1.size() > 0) {
for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- }else{
+ } else {
String str = '璇ュ晢鍝佸凡鎷嗙洅';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
}
// 宸茬粡鍙栨秷
- reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
- Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
- Deliver_date__c,Bar_Code__c,
- 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
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c = : userWorkLocation
- ORDER BY Name ];
- if(reSet1.size() > 0){
+ 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
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c = :userWorkLocation
+ ORDER BY Name
+ ];
+ if (reSet1.size() > 0) {
for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- }else{
+ } else {
String str = '璇ュ晢鍝佸凡缁忓彇娑�,涓嶈兘鎷嗙洅';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
}
// 宸ヤ綔鍦颁笉鍚�
- reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
- Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
- Deliver_date__c,Bar_Code__c,
- 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
- // gzw 鏃犳硶鎷嗙洅锛屽幓鎺夐攢鍞槑缁� 20210802
- AND Dealer_Shipment__c= false
- AND Dealer_Saled__c = false
- AND Dealer_Returned__c = false
- // gzw 鏃犳硶鎷嗙洅锛屽幓鎺夐攢鍞槑缁� 20210802
- AND Bar_Code__c in :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c != : userWorkLocation
- ORDER BY Name ];
- if(reSet1.size() > 0){
+ 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
+ // gzw 鏃犳硶鎷嗙洅锛屽幓鎺夐攢鍞槑缁� 20210802
+ AND Dealer_Shipment__c = FALSE
+ AND Dealer_Saled__c = FALSE
+ AND Dealer_Returned__c = FALSE
+ // gzw 鏃犳硶鎷嗙洅锛屽幓鎺夐攢鍞槑缁� 20210802
+ AND Bar_Code__c IN :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c != :userWorkLocation
+ ORDER BY Name
+ ];
+ if (reSet1.size() > 0) {
for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- }else{
+ } else {
String str = '璇ュ晢鍝佸睘浜�' + reSet1[i].Arrive_Owner_Work_Location__c + ',涓嶈兘鎷嗙洅';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
}
-
-
- reSet = [SELECT Id,
- Name,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Consumable_Product__r.Name__c,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- Dealer_Arrive__c,
- Guarantee_period_for_products__c,
- CFDA_Status__c,
- ProductPacking_list_manual__c,
- Report_Product_Approbation__c,
- Report_Product_Expiration__c,
- Agencyinfo_fromSAP__c,
- 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
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c = : userWorkLocation
- AND Product_Type__c like : userPro_Typestr
- ];
- if(reSet.size()>0){
+ reSet = [
+ SELECT
+ Id,
+ Name,
+ Intra_Trade_List_RMB__c,
+ Asset_Model_No__c,
+ Consumable_Product__c,
+ Consumable_Product__r.Name,
+ Consumable_Product__r.Name__c,
+ Sterilization_limit__c,
+ Deliver_date__c,
+ Bar_Code__c,
+ Arrive_date__c,
+ Send_Date__c,
+ Consumable_order_minor__r.Name,
+ Consumable_order_minor__c,
+ Dealer_Arrive__c,
+ Guarantee_period_for_products__c,
+ CFDA_Status__c,
+ ProductPacking_list_manual__c,
+ Report_Product_Approbation__c,
+ Report_Product_Expiration__c,
+ Agencyinfo_fromSAP__c,
+ 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
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c = :userWorkLocation
+ 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) ){
+ 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);
+ ExistIdMap.put(reSet[i].Bar_Code__c, reSet[i].Bar_Code__c);
}
}
}
AllMap.putAll(ExistIdMap);
//寰楀埌涓嶅瓨鍦ㄧ殑BarCode
- for(Integer i = 0; i < BarCodeListP.size(); i++){
- if(ExistIdMap.containsKey(BarCodeListP[i])){
+ for (Integer i = 0; i < BarCodeListP.size(); i++) {
+ if (ExistIdMap.containsKey(BarCodeListP[i])) {
continue;
- }else if(ErrorIdMap.containsKey(BarCodeListP[i])){
+ } else if (ErrorIdMap.containsKey(BarCodeListP[i])) {
continue;
- }else{
+ } else {
notInlist.add(BarCodeListP[i]);
}
}
- if(notInlist.size()>0){
- // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode'+ notInlist + '涓嶅瓨鍦ㄣ��'));
- return new ResponseBodyLWC('Error',500, 'BarCode'+ notInlist + '涓嶅瓨鍦�', '');
+ if (notInlist.size() > 0) {
+ // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode'+ notInlist + '涓嶅瓨鍦ㄣ��'));
+ return new ResponseBodyLWC('Error', 500, 'BarCode' + notInlist + '涓嶅瓨鍦�', '');
}
-
- data.put('ConsumableorderdetailsRecordsdummy',JSON.serialize(ConsumableorderdetailsRecordsdummy));
- data.put('ConsumableorderdetailsRecordserror',JSON.serialize(ConsumableorderdetailsRecordserror));
- data.put('dataSize',ConsumableorderdetailsRecordsdummy.size());
+ data.put('ConsumableorderdetailsRecordsdummy', JSON.serialize(ConsumableorderdetailsRecordsdummy));
+ data.put('ConsumableorderdetailsRecordserror', JSON.serialize(ConsumableorderdetailsRecordserror));
+ data.put('dataSize', ConsumableorderdetailsRecordsdummy.size());
res.status = 'Success';
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>();
+ Map<String, object> data = new Map<String, object>();
res.entity = data;
userPro_Typestr = '%' + agencyProType + '%';
accountName = accountName;
- userWorkLocation =userWorkLocation;
- List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy = (List<ConsumableorderdetailsInfo>)JSON.deserialize(saveConsumableorderdetailsRecordsdummy,List<ConsumableorderdetailsInfo>.class);
-
+ userWorkLocation = userWorkLocation;
+ 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){
- return new ResponseBodyLWC('Error',500, '涓嶅瓨鍦ㄦ媶鐩掓槑缁�', '');
+ if (ConsumableorderdetailsRecordsdummy.size() < 1) {
+ return new ResponseBodyLWC('Error', 500, '涓嶅瓨鍦ㄦ媶鐩掓槑缁�', '');
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'涓嶅瓨鍦ㄦ媶鐩掓槑缁�'));
// return null;
}
List<String> BarCodeList = new List<String>();
- for (ConsumableorderdetailsInfo tmp : ConsumableorderdetailsRecordsdummy) {
+ for (ConsumableorderdetailsInfo tmp : ConsumableorderdetailsRecordsdummy) {
BarCodeList.add(tmp.esd.Bar_Code__c);
}
- try{
+ try {
//鍙栧緱鍦ㄥ簱淇℃伅
- List<Consumable_order_details2__c> orderDetails2 = [SELECT
- Id,
- Name,
- Bar_Code__c,
- TracingCode__c,
- Intra_Trade_List_RMB__c,
- Purchase_Unitprice_From__c,
- Guarantee_period_for_products__c,
- Used_account__c,
- Consumable_ZS_order__c,
- Cancellation_Date__c,
- Consumable_product__c,
- Consumable_order_minor__c,
- Direct_Arrive_Product__c,
- Arrive_date__c,
- Consumable_Arrived_order__c,
- Unitprice_To_agency__c,
- SerialLotNo__c,
- Sterilization_limit__c,
- Invoice_Date__c,
- Lose_reason__c,
- Asset_Model_No__c,
- Deliver_date__c,
- Inventory_date__c,
- Consumable_Inventory_order__c,
- Dealer_Arrive__c,
- ProductPacking_list_manual__c,
- Agencyinfo_fromSAP__c,
- Frist_Storage_Agency__c,
- Dealer_Info_text__c,
- //add by rentx 2020-10-13 start
- ContractNo_text__c
- /*,ContractNo__c*/
- //add by rentx 2020-10-13 end
- // tcm start
- ,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
+ List<Consumable_order_details2__c> orderDetails2 = [
+ SELECT
+ Id,
+ Name,
+ Bar_Code__c,
+ TracingCode__c,
+ Intra_Trade_List_RMB__c,
+ Purchase_Unitprice_From__c,
+ Guarantee_period_for_products__c,
+ Used_account__c,
+ Consumable_ZS_order__c,
+ Cancellation_Date__c,
+ Consumable_product__c,
+ Consumable_order_minor__c,
+ Direct_Arrive_Product__c,
+ Arrive_date__c,
+ Consumable_Arrived_order__c,
+ Unitprice_To_agency__c,
+ SerialLotNo__c,
+ Sterilization_limit__c,
+ Invoice_Date__c,
+ Lose_reason__c,
+ Asset_Model_No__c,
+ Deliver_date__c,
+ Inventory_date__c,
+ Consumable_Inventory_order__c,
+ Dealer_Arrive__c,
+ ProductPacking_list_manual__c,
+ Agencyinfo_fromSAP__c,
+ Frist_Storage_Agency__c,
+ Dealer_Info_text__c,
+ //add by rentx 2020-10-13 start
+ ContractNo_text__c,
+ /*,ContractNo__c*/
+ //add by rentx 2020-10-13 end
+ // tcm start
+ 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
AND Box_Piece__c = '鐩�'
AND ProductPacking_list_manual__c > 1
- 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 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
+ ];
List<Consumable_order_details2__c> orderDetails2del = new List<Consumable_order_details2__c>();
List<Consumable_order_details2__c> orderDetails2ins = new List<Consumable_order_details2__c>();
for (Consumable_order_details2__c detail2tmp : orderDetails2) {
- Decimal num = detail2tmp.ProductPacking_list_manual__c;
+ Decimal num = detail2tmp.ProductPacking_list_manual__c;
Consumable_order_details2__c delDetails2 = new Consumable_order_details2__c();
- delDetails2.Id = detail2tmp.Id;
+ delDetails2.Id = detail2tmp.Id;
//鍒犻櫎鎷嗙洅鍓嶅湪搴�
//delete delDetails2;
orderDetails2del.add(delDetails2);
- for(integer i=0; i < num; i++){
+ for (integer i = 0; i < num; i++) {
Consumable_order_details2__c insertDetails2 = new Consumable_order_details2__c();
insertDetails2 = detail2tmp.clone();
- insertDetails2.Id = null;
+ insertDetails2.Id = null;
//鍗曚綅锛堢洅/涓級
- insertDetails2.Box_Piece__c = '涓�';
+ insertDetails2.Box_Piece__c = '涓�';
//鎷嗙洅鐣彿
- insertDetails2.RemoveBox_No__c = i+1;
+ insertDetails2.RemoveBox_No__c = i + 1;
//鎷嗙洅鏃ユ湡
- insertDetails2.RemoveBox_date__c = Date.today();
+ insertDetails2.RemoveBox_date__c = Date.today();
//add by rentx 2020-10-13 start 鎷嗙洅/鍙栨秷鎷嗙洅鏃�,璁板綍SAP鍚堝悓鍙�
// insertDetails2.ContractNo_text__c= detail2tmp.ContractNo__c;
// tcm start
if (String.isBlank(detail2tmp.Consumable_order_minor__r.ContractNo__c)) {
- insertDetails2.ContractNo_text__c= detail2tmp.ContractNo_text__c;
- }else {
- insertDetails2.ContractNo_text__c= detail2tmp.Consumable_order_minor__r.ContractNo__c;
+ insertDetails2.ContractNo_text__c = detail2tmp.ContractNo_text__c;
+ } else {
+ insertDetails2.ContractNo_text__c = detail2tmp.Consumable_order_minor__r.ContractNo__c;
}
// tcm end
//鐧诲綍鎷嗙洅鍚庡湪搴�
@@ -544,31 +657,29 @@
}
}
- if (orderDetails2del.size()>0){
+ if (orderDetails2del.size() > 0) {
delete orderDetails2del;
}
- if(orderDetails2ins.size()>0){
+ if (orderDetails2ins.size() > 0) {
insert orderDetails2ins;
-
}
saveFLGbln = true;
alertMessage = '鎷嗙洅瀹屾垚';
- data.put('saveFLGbln',saveFLGbln);
+ data.put('saveFLGbln', saveFLGbln);
res.status = 'Success';
res.code = 200;
res.msg = alertMessage;
System.debug('res = ' + res);
return res;
// return null;
- }catch(Exception e){
+ } catch (Exception e) {
Database.rollback(sp);
ApexPages.addMessages(e);
return null;
}
}
-
class ConsumableorderdetailsInfo implements Comparable {
@AuraEnabled
@@ -585,18 +696,18 @@
public String oldConsumableCount { get; set; }
@AuraEnabled
public String ErrorReason { get; set; }
- public ConsumableorderdetailsInfo(Consumable_order_details2__c e,string str) {
- esd = e;
- Prod = e.Consumable_Product__r;
+ public ConsumableorderdetailsInfo(Consumable_order_details2__c e, string str) {
+ esd = e;
+ Prod = e.Consumable_Product__r;
oldConsumableCount = e.name;
- ErrorReason = str;
+ ErrorReason = str;
}
public ConsumableorderdetailsInfo(Consumable_order_details2__c e) {
- esd = e;
- Prod = e.Consumable_Product__r;
+ esd = e;
+ Prod = e.Consumable_Product__r;
oldConsumableCount = e.name;
}
- /*
+ /*
public ConsumableorderdetailsInfo(Product2__c e,String barCode,Date sterilizationlimit,String serialNoorLot,String tracingCode) {
esd = new Consumable_order_details2__c();
ProductName = e.Name__c;
diff --git a/force-app/main/default/classes/LexSaleAndDeliveryController.cls b/force-app/main/default/classes/LexSaleAndDeliveryController.cls
index 6f07385..adbd428 100644
--- a/force-app/main/default/classes/LexSaleAndDeliveryController.cls
+++ b/force-app/main/default/classes/LexSaleAndDeliveryController.cls
@@ -34,13 +34,13 @@
data.put('userWorkLocation', userWorkLocation);
System.debug(
'userinfoId = ' +
- userinfoId +
- ' accountid = ' +
- accountid +
- ' agencyProType = ' +
- agencyProType +
- ' userWorkLocation = ' +
- userWorkLocation
+ userinfoId +
+ ' accountid = ' +
+ accountid +
+ ' agencyProType = ' +
+ agencyProType +
+ ' userWorkLocation = ' +
+ userWorkLocation
);
//榛樿妫�绱㈡樉绀烘湭瀹屾垚鐨勬寚绀哄崟
List<Consumable_order__c> raesList = new List<Consumable_order__c>();
diff --git a/force-app/main/default/classes/LexSaleOrderController.cls b/force-app/main/default/classes/LexSaleOrderController.cls
index d967cc7..29616ff 100644
--- a/force-app/main/default/classes/LexSaleOrderController.cls
+++ b/force-app/main/default/classes/LexSaleOrderController.cls
@@ -201,6 +201,7 @@
//BarCodelist鍋氭垚
barCodeListP = ParseBarCode(barcode);
+ System.debug('barCodeListP:' + barCodeListP);
//閽堝鎵�鏈夊晢鍝佸埌璐х‘璁�
reSet1 = [
SELECT
@@ -235,6 +236,7 @@
AND Arrive_Owner_Work_Location__c = :userWorkLocation
ORDER BY RemoveBox_No__c DESC
];
+ System.debug('reSet1:' + reSet1);
List<Consumable_order_details2__c> newdet2 = new List<Consumable_order_details2__c>();
Set<Id> proIds = new Set<Id>();
@@ -242,6 +244,7 @@
Integer idx = 0;
for (Consumable_order_details2__c cod2 : reSet1) {
if (cod2.Bar_Code__c == barcode) {
+ System.debug('cod2.Bar_Code__c:' + cod2.Bar_Code__c);
newdet2.add(cod2);
reSet1.remove(idx);
proIds.add(cod2.Consumable_product__c);
@@ -678,13 +681,13 @@
if (n.find()) {
if (newdet2[j].TracingCode__c.length() == 5) {
String tr = newdet2[j].TracingCode__c;
- String Ctr = tr.substring(tr.length() - 3,tr.length());
- String Btr = tr.substring(tr.length() - 4,tr.length()-3);
- String Atr = tr.substring(tr.length() - 5,tr.length()-4);
+ String Ctr = tr.substring(tr.length() - 3, tr.length());
+ String Btr = tr.substring(tr.length() - 4, tr.length() - 3);
+ String Atr = tr.substring(tr.length() - 5, tr.length() - 4);
if (Pattern.compile('[0-9]').matcher(Atr).find() || Pattern.compile('[0-9]').matcher(Ctr).find()) {
String str = '绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�';
- consumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(newdet2[j],str));
- errorIdMap.put(newdet2[j].Bar_Code__c,newdet2[j].Bar_Code__c);
+ consumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(newdet2[j], str));
+ errorIdMap.put(newdet2[j].Bar_Code__c, newdet2[j].Bar_Code__c);
continue;
}
}
@@ -1076,11 +1079,16 @@
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);
- System.debug('ass.outboundCount = ' + ass.outboundCount);
+ System.debug('ass.orderdetails2.Box_Piece__c = ' + ass.orderdetails2.Box_Piece__c);
+ System.debug('ass.outboundCount = ' + ass.outboundCount);
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ヤ骇鍝� ' + ass.Prod.Name + ' 鐨勫嚭璐ф暟閲�', '');
}
if (ass.outboundCount > deliverycnt) {
@@ -1265,6 +1273,7 @@
return consumableorderdetails2Nobox.size();
}
+ @TestVisible
class ConsumableorderdetailsInfo implements Comparable {
@AuraEnabled
public Consumable_orderdetails__c orderdetails1 { get; set; }
diff --git a/force-app/main/default/classes/LexSearchContractController.cls b/force-app/main/default/classes/LexSearchContractController.cls
index 1cf641e..a7fd48d 100644
--- a/force-app/main/default/classes/LexSearchContractController.cls
+++ b/force-app/main/default/classes/LexSearchContractController.cls
@@ -1,26 +1,34 @@
public without sharing class LexSearchContractController {
- private static Boolean OSHFLG;//lt 20230517 瀹夊窘涓ょエ鍒� add
+ private static Boolean OSHFLG; //lt 20230517 瀹夊窘涓ょエ鍒� add
@AuraEnabled
- public static Results init(String ctype){
+ public static Results init(String ctype) {
Results results = new Results();
try {
//lt 20230517 瀹夊窘涓ょエ鍒� add ,OSHFLG__c
- User useracc = [SELECT accountid,OSHFLG__c FROM user WHERE id = :UserInfo.getUserId() ];
+ 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
- FROM Account
- WHERE ParentId = :accountId
- AND Contact_Type__c like :ctype
+ 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
AND Contract_Decide_Start_Date__c <= :Date.Today()
AND Contract_Decide_End_Date__c >= :Date.Today()
- AND Secondary_contract__c = false
- AND OSH_Dealer__c =: OSHFLG //lt 20230517 瀹夊窘涓ょエ鍒� add
- ];
+ AND Secondary_contract__c = FALSE
+ AND OSH_Dealer__c = :OSHFLG //lt 20230517 瀹夊窘涓ょエ鍒� add
+ ];
results.attList = attList;
- results.result = 'Success';
+ results.result = 'Success';
} catch (Exception e) {
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
@@ -29,12 +37,12 @@
}
@AuraEnabled
- public static Results searchContract(String searchName, String accountId, String ctype, Boolean OSHFLGStr){
+ public static Results searchContract(String searchName, String accountId, String ctype, Boolean OSHFLGStr) {
Results results = new Results();
OSHFLG = OSHFLGStr;
try {
- results.attList = Database.query(makeSoql(searchName,Date.today(),accountId,ctype));
- results.result = 'Success';
+ results.attList = Database.query(makeSoql(searchName, Date.today(), accountId, ctype));
+ results.result = 'Success';
} catch (Exception e) {
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
@@ -42,17 +50,16 @@
return results;
}
- private static String makeSoql(String CateName,Date timetest,String accountId, String ctype){
-
+ 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 + '\'' ;
- soql += ' AND OSH_Dealer__c = ' + OSHFLG + '' ; //lt 20230517 瀹夊窘涓ょエ鍒� add
- soql += ' AND Secondary_contract__c = false' ;
+ soql += ' where ParentId = \'' + accountId + '\'';
+ soql += ' AND OSH_Dealer__c = ' + OSHFLG + ''; //lt 20230517 瀹夊窘涓ょエ鍒� add
+ soql += ' AND Secondary_contract__c = false';
soql += ' AND Contact_Type__c like \'%' + String.escapeSingleQuotes(ctype.replaceAll('%', '\\%')) + '%\'';
soql += ' AND Contract_Decide_Start_Date__c <=' + String.valueOf(timetest).substring(0, 10);
soql += ' AND Contract_Decide_End_Date__c >= ' + String.valueOf(timetest).substring(0, 10);
- if(!String.isBlank(CateName)){
+ if (!String.isBlank(CateName)) {
soql += ' AND Name like \'%' + String.escapeSingleQuotes(CateName.replaceAll('%', '\\%')) + '%\'';
}
return soql;
diff --git a/force-app/main/default/classes/LexSearchHospitalController.cls b/force-app/main/default/classes/LexSearchHospitalController.cls
index 147544e..912d15c 100644
--- a/force-app/main/default/classes/LexSearchHospitalController.cls
+++ b/force-app/main/default/classes/LexSearchHospitalController.cls
@@ -1,16 +1,15 @@
public without sharing class LexSearchHospitalController {
-
@AuraEnabled
- public static Results init(){
+ public static Results init() {
Results results = new Results();
try {
- User useracc = [SELECT accountid,UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId() ];
+ User useracc = [SELECT accountid, UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId()];
String accountId = Useracc.accountid;
String soql = 'SELECT id,Name,State_Master__c,State_Master__r.Name,Address__c FROM Account';
- soql += ' where id in (SELECT Hospital__c FROM hospitalprice__c WHERE account__c = :accountId) ' ;
+ soql += ' where id in (SELECT Hospital__c FROM hospitalprice__c WHERE account__c = :accountId) ';
soql += ' order by Name desc limit 100';
results.attList = Database.query(soql);
- results.result = 'Success';
+ results.result = 'Success';
} catch (Exception e) {
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
@@ -19,7 +18,7 @@
}
@AuraEnabled
- public static Results searchHospital(String searchName, String accountId){
+ public static Results searchHospital(String searchName, String accountId) {
Results results = new Results();
try {
results.attList = Database.query(makeSoql(searchName, accountId));
@@ -31,16 +30,16 @@
return results;
}
- private static String makeSoql(String searchName,String accountId){
+ private static String makeSoql(String searchName, String accountId) {
String soql = 'SELECT id,Name,State_Master__c,State_Master__r.Name,Address__c FROM Account';
- soql += ' where id in (SELECT Hospital__c FROM hospitalprice__c WHERE account__c = :accountId) ' ;
- if(String.isNotBlank(searchName)){
- soql += ' AND Name like \'%' + searchName+ '%\'';
+ soql += ' where id in (SELECT Hospital__c FROM hospitalprice__c WHERE account__c = :accountId) ';
+ if (String.isNotBlank(searchName)) {
+ soql += ' AND Name like \'%' + searchName + '%\'';
}
soql += ' order by Name desc limit 100';
return soql;
}
-
+
public class Results {
@AuraEnabled
public String result;
diff --git a/force-app/main/default/classes/LexSummonsCreatController.cls b/force-app/main/default/classes/LexSummonsCreatController.cls
index df46d82..f5fb177 100644
--- a/force-app/main/default/classes/LexSummonsCreatController.cls
+++ b/force-app/main/default/classes/LexSummonsCreatController.cls
@@ -245,7 +245,13 @@
// 鐢婚潰鍒濆鍖�
@AuraEnabled
- public static ResponseBodyLWC init(String ESetidJs, String statusEdit, Integer pageSizeLWC, Integer pageTokenLWC,String arriveorderLWC) {
+ public static ResponseBodyLWC init(
+ String ESetidJs,
+ String statusEdit,
+ Integer pageSizeLWC,
+ Integer pageTokenLWC,
+ String arriveorderLWC
+ ) {
try {
firstInit(ESetidJs);
statusEdit = statusEdit;
@@ -1394,7 +1400,7 @@
System.debug('res = ' + res);
return res;
} catch (Exception e) {
- return new ResponseBodyLWC('Error',500, e.getMessage() + e.getLineNumber(), '');
+ return new ResponseBodyLWC('Error', 500, e.getMessage() + e.getLineNumber(), '');
}
}
@@ -2122,11 +2128,7 @@
return new ResponseBodyLWC(
'Error',
500,
- '缁忛攢鍟�:' +
- coc.Order_ForDealerText__c +
- ' 娌℃湁娑堣�楀搧:' +
- proStr.substring(0, proStr.length() - 1) +
- ' 鐨勭壒浠�',
+ '缁忛攢鍟�:' + coc.Order_ForDealerText__c + ' 娌℃湁娑堣�楀搧:' + proStr.substring(0, proStr.length() - 1) + ' 鐨勭壒浠�',
''
);
}
@@ -2183,7 +2185,10 @@
if (ass.orderdetails1.Delivery_List_RMB__c == null && coc.SummonsForDirction__c != '鍖婚櫌璇曠敤') {
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ユ纭殑鍑鸿揣鍗曚环 (鍏�)', '');
}
- if ((ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) && coc.SummonsForDirction__c != '鍖婚櫌璇曠敤') {
+ if (
+ (ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) &&
+ coc.SummonsForDirction__c != '鍖婚櫌璇曠敤'
+ ) {
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ュ嚭璐у崟浠� (鍏�)', '');
}
if (
@@ -2215,9 +2220,7 @@
return new ResponseBodyLWC(
'Error',
500,
- '娑堣�楀搧' +
- ass.orderdetails1.Consumable_Product__r.Name__c +
- '搴撳瓨涓嶈冻',
+ '娑堣�楀搧' + ass.orderdetails1.Consumable_Product__r.Name__c + '搴撳瓨涓嶈冻',
''
);
}
@@ -2233,9 +2236,7 @@
return new ResponseBodyLWC(
'Error',
500,
- '娑堣�楀搧' +
- ass.orderdetails1.Consumable_Product__r.Name__c +
- '搴撳瓨涓嶈冻',
+ '娑堣�楀搧' + ass.orderdetails1.Consumable_Product__r.Name__c + '搴撳瓨涓嶈冻',
''
);
}
@@ -2341,7 +2342,10 @@
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ユ纭殑鍑鸿揣鍗曚环 (鍏�)', '');
}
Consumable_orderdetails__c InsAfterDel = new Consumable_orderdetails__c();
- if ((ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) && coc.SummonsForDirction__c != '鍖婚櫌璇曠敤') {
+ if (
+ (ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) &&
+ coc.SummonsForDirction__c != '鍖婚櫌璇曠敤'
+ ) {
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ュ嚭璐у崟浠� (鍏�)', '');
}
if (
@@ -2367,9 +2371,7 @@
return new ResponseBodyLWC(
'Error',
500,
- '娑堣�楀搧' +
- ass.orderdetails1.Consumable_Product__r.Name__c +
- '搴撳瓨涓嶈冻',
+ '娑堣�楀搧' + ass.orderdetails1.Consumable_Product__r.Name__c + '搴撳瓨涓嶈冻',
''
);
}
@@ -2384,9 +2386,7 @@
return new ResponseBodyLWC(
'Error',
500,
- '娑堣�楀搧' +
- ass.orderdetails1.Consumable_Product__r.Name__c +
- '搴撳瓨涓嶈冻',
+ '娑堣�楀搧' + ass.orderdetails1.Consumable_Product__r.Name__c + '搴撳瓨涓嶈冻',
''
);
}
@@ -2534,7 +2534,7 @@
// FROM Account
// WHERE
// // Name = '濂ユ灄宸存柉锛堝寳浜級閿�鍞湇鍔℃湁闄愬叕鍙�'
- // // AND
+ // // AND
// Name LIKE :nameCondition
// AND RecordType.DeveloperName = 'AgencyContract'
// AND Contract_Decide_Start_Date__c >= :thisDatetime
@@ -2550,7 +2550,7 @@
// FROM Account
// WHERE
// // Name = '濂ユ灄宸存柉锛堝寳浜級閿�鍞湇鍔℃湁闄愬叕鍙�'
- // // AND
+ // // AND
// Name LIKE :nameCondition
// AND RecordType.DeveloperName = 'AgencyContract'
// AND Contract_Decide_Start_Date__c >= :thisDatetime
@@ -2561,7 +2561,6 @@
// ];
// }
-
Date today = Date.today();
//Date today = Date.newInstance(2023, 3, 1);
Integer thisMonth = today.month();
@@ -2570,7 +2569,7 @@
Integer lastYear = today.year() - 1;
Integer thisYear = today.year();
Integer nextYear = today.year() + 1;
-
+
Date lastDatetime = Date.newInstance(lastYear, 4, 1);
Date thisDatetime = Date.newInstance(thisYear, 4, 1);
Date thisDatetime2 = Date.newInstance(thisYear, 7, 1);
@@ -2580,14 +2579,14 @@
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){
+ if (thisMonth < 4) {
sql += 'AND Contract_Decide_Start_Date__c >= :lastDatetime AND Contract_Decide_End_Date__c < :thisDatetime2 ';
- }else if(thisMonth >= 4 && thisMonth <= 6){
+ } else if (thisMonth >= 4 && thisMonth <= 6) {
sql += 'AND Contract_Decide_Start_Date__c >= :lastDatetime AND Contract_Decide_End_Date__c < :nextDatetime ';
- }else{
+ } else {
sql += 'AND Contract_Decide_Start_Date__c >= :thisDatetime AND Contract_Decide_End_Date__c < :nextDatetime ';
}
if (UserProTypecTemp.UserPro_Type__c == 'ENG') {
@@ -2689,15 +2688,15 @@
//鍒犻櫎闄勪欢
@AuraEnabled
- public static ResponseBodyLWC deleteAtt(String contentVersionId){
+ public static ResponseBodyLWC deleteAtt(String contentVersionId) {
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,'','');
+ return new ResponseBodyLWC('Success', 200, '', '');
} catch (Exception e) {
- return new ResponseBodyLWC('Error',500, e.getMessage() + e.getLineNumber(), '');
+ return new ResponseBodyLWC('Error', 500, e.getMessage() + e.getLineNumber(), '');
}
}
@@ -2776,6 +2775,7 @@
}
// Data Bean
+ @TestVisible
class ConsumableorderdetailsInfo implements Comparable {
@AuraEnabled
public Boolean check { get; set; }
@@ -2916,6 +2916,7 @@
}
}
+ @TestVisible
class ConsumableorderdetailsInfoLwc {
@AuraEnabled
public Boolean check { get; set; }
diff --git a/force-app/main/default/classes/LexTopPageController.cls b/force-app/main/default/classes/LexTopPageController.cls
index aab986b..955f049 100644
--- a/force-app/main/default/classes/LexTopPageController.cls
+++ b/force-app/main/default/classes/LexTopPageController.cls
@@ -2,7 +2,7 @@
//缁忛攢鍟嗕俊鎭�
public static account accountInfo;
/*****************鐢婚潰琛ㄧずBean******************/
- public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords =new List<ConsumableorderdetailsInfo>();
+ public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>();
public static List<List<ConsumableorderdetailsInfo>> consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>();
//page
public static Integer pagesize { get; set; }
@@ -17,7 +17,7 @@
// public static Boolean hasPrevious;
// public static Boolean hasNext;
public static List<ConsumableorderdetailsInfo> pageRecords;
- public static String soql {get;set;}
+ public static String soql { get; set; }
// 姹囨�讳娇鐢�
public static Integer Total_num;
public static Integer OrderNumber_arrived;
@@ -39,12 +39,12 @@
public static List<Consumable_order__c> raesList;
/*****************涓�鍛ㄦ湭鍒拌揣璁㈠崟涓�瑙堝搴攅nd******************/
//鎺掑簭浣跨敤
- private static String[] orderby = new String[]{ 'Product2__c.Name__c'};
+ private static String[] orderby = new List<String>{ 'Product2__c.Name__c' };
//浜у搧涓婁笅闄�
- public static String[] proLimitAndDate =new String[]{};
+ public static String[] proLimitAndDate = new List<String>{};
public static String product_Limit;
//搴撳瓨浜у搧鏈�鏃╂湁鏁堟湡闄�
- private static Map<String,Date> productkucun = new Map<String,Date>();
+ private static Map<String, Date> productkucun = new Map<String, Date>();
//娑堣垂鏈熼檺灏忎簬涓�骞寸殑浜у搧
public static List<ConsumableorderdetailsInfo> overlimitdateorderdetails = new List<ConsumableorderdetailsInfo>();
public static String accountid;
@@ -72,43 +72,60 @@
public static Boolean hasHos;
@AuraEnabled
- public static Results initAgency(){
+ public static Results initAgency() {
Results results = new Results();
results.isNoteStay = LexUtility.getIsNoteStay();
try {
- 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()];
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];
- if(accList.size() == 1){
+ FROM account
+ WHERE id = :accountid
+ ];
+ if (accList.size() == 1) {
accountInfo = accList[0];
- }else{
+ } else {
results.result = 'Fail';
results.errorMsg = '鏈幏鍙栧埌缁忛攢鍟嗕俊鎭�';
return results;
}
results.result = 'Success';
results.accountInfo = accountInfo;
- }catch(Exception e){
+ } catch (Exception e) {
results.result = 'Fail';
- results.errorMsg = e.getLineNumber()+'---'+e.getMessage();
+ results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
return results;
}
@AuraEnabled
- public static Results initPage(Integer pageSizeLWC,Integer pageTokenLWC){
+ public static Results initPage(Integer pageSizeLWC, Integer pageTokenLWC) {
pageSize = pageSizeLWC;
pageToken = pageTokenLWC;
Results results = new Results();
@@ -121,91 +138,115 @@
// pagesize = Integer.valueof(system.label.orderdetLimitsize);
// currentpage = 0;
- 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()];
// String uid = '0051000000E7Pv9AAF';
// User useracc = [SELECT accountid, Work_Location__c,UserPro_Type__c FROM user WHERE id =:uid];
accountid = useracc.accountid;
userWorkLocation = useracc.Work_Location__c;
userPro_Type = useracc.UserPro_Type__c;
- if(String.isBlank(userPro_Type)){
+ if (String.isBlank(userPro_Type)) {
userPro_Type = 'ET';
}
userPro_Typestr = '%' + userPro_Type + '%';
- if(userPro_Type == 'ENG'){
+ if (userPro_Type == 'ENG') {
EngFlag = true;
- }else{
+ } else {
ETFlag = true;
}
//缁忛攢鍟喡峰熀鏈俊鎭幏鍙�
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];
- if(accList.size() == 1){
+ FROM account
+ WHERE id = :accountid
+ ];
+ if (accList.size() == 1) {
accountInfo = accList[0];
- }else{
+ } else {
results.result = 'Fail';
results.errorMsg = '鏈幏鍙栧埌缁忛攢鍟嗕俊鎭�';
return results;
}
accountName = accountInfo.Name;
- if(EngFlag){
- product_Limit = accountInfo.Product_Limit_DateENG__c;
- }else if(ETFlag){
+ if (EngFlag) {
+ product_Limit = accountInfo.Product_Limit_DateENG__c;
+ } else if (ETFlag) {
product_Limit = accountInfo.Product_Limit_Date__c;
}
- if(product_Limit != null && product_Limit !=''){
+ if (product_Limit != null && product_Limit != '') {
proLimitAndDate = product_Limit.split(',');
}
List<ConsumableorderdetailsInfo> boxRecords = new List<ConsumableorderdetailsInfo>();
- //搴撳瓨鏄庣粏鍙栧緱
+ //搴撳瓨鏄庣粏鍙栧緱
orderDetZaikuList = new List<String>();
- 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
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- group by Consumable_Product__c];
- for(AggregateResult zaikuId : orderDetZaiku){
+ 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
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c = :userWorkLocation
+ 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,
- Name__c,
- Asset_Model_No__c,
- Category3__c,
- Category4__c,
- Category5__c,
- SFDA_Status__c,
- Product2__r.SFDA_Approbation_No__c,
- Product2__r.SFDA_Expiration_Date__c,
- Product2__r.Packing_list_manual__c
- FROM Product2__c
- WHERE Id in :orderDetZaikuList
- ];
+ Map<String, Product2__c> MidMap = new Map<String, Product2__c>();
+ List<Product2__c> product2Selected = [
+ SELECT
+ Id,
+ Name,
+ Name__c,
+ Asset_Model_No__c,
+ Category3__c,
+ Category4__c,
+ Category5__c,
+ SFDA_Status__c,
+ Product2__r.SFDA_Approbation_No__c,
+ Product2__r.SFDA_Expiration_Date__c,
+ Product2__r.Packing_list_manual__c
+ FROM Product2__c
+ 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,
@@ -214,78 +255,86 @@
Guarantee_period_for_products__c,
Isoverdue__c,
Box_Piece__c,
- hospitalSpecialOffer__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
- AND Dealer_Info_text__c = :accountName
- 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>();
- Map<String,ConsumableorderdetailsInfo> newHosMidPieceMap = new Map<String,ConsumableorderdetailsInfo>();
- for(Integer i = 0 ; i< CountDel.size();i++){
+ 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
+ ];
+ Map<String, ConsumableorderdetailsInfo> newMidBoxMap = new Map<String, ConsumableorderdetailsInfo>();
+ Map<String, ConsumableorderdetailsInfo> newMidPieceMap = new Map<String, ConsumableorderdetailsInfo>();
+ Map<String, ConsumableorderdetailsInfo> newHosMidBoxMap = new Map<String, ConsumableorderdetailsInfo>();
+ Map<String, ConsumableorderdetailsInfo> newHosMidPieceMap = new Map<String, ConsumableorderdetailsInfo>();
+ for (Integer i = 0; i < CountDel.size(); i++) {
//鐒跺悗寰幆CountDel鍋欱ox鍜宲iece2涓猰ap
- if(MidMap.containsKey(CountDel[i].Consumable_Product__c) && CountDel[i].Box_Piece__c == '鐩�'){
+ if (MidMap.containsKey(CountDel[i].Consumable_Product__c) && CountDel[i].Box_Piece__c == '鐩�') {
String tex = 'A';
if (CountDel[i].hospitalSpecialOffer__c) {
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();
- Jstage.allnumber = Jstage.allnumber+1 ;
- if(CountDel[i].Isoverdue__c == 1){
+ 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();
+ Jstage.allnumber = Jstage.allnumber + 1;
+ if (CountDel[i].Isoverdue__c == 1) {
Jstage.limitCount = Jstage.limitCount + 1;
}
Jstage.BoxPiece = CountDel[i].Box_Piece__c;
- newMidBoxMap.put(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c + tex, Jstage);
- }else{
+ newMidBoxMap.put(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex, Jstage);
+ } else {
ConsumableorderdetailsInfo Jstage = new ConsumableorderdetailsInfo(MidMap.get(CountDel[i].Consumable_Product__c));
- Jstage.allnumber = Jstage.allnumber+1 ;
- if(CountDel[i].Isoverdue__c == 1){
+ Jstage.allnumber = Jstage.allnumber + 1;
+ if (CountDel[i].Isoverdue__c == 1) {
Jstage.limitCount = Jstage.limitCount + 1;
}
Jstage.BoxPiece = CountDel[i].Box_Piece__c;
if (CountDel[i].hospitalSpecialOffer__c) {
Jstage.hospitalSpecialOffer = true;
- newMidBoxMap.put(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c + tex, Jstage);
- }else{
+ newMidBoxMap.put(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex, Jstage);
+ } else {
Jstage.hospitalSpecialOffer = false;
- newMidBoxMap.put(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c + tex, Jstage);
+ newMidBoxMap.put(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex, Jstage);
}
}
- }else if(MidMap.containsKey(CountDel[i].Consumable_Product__c) && CountDel[i].Box_Piece__c == '涓�'){
+ } else if (MidMap.containsKey(CountDel[i].Consumable_Product__c) && CountDel[i].Box_Piece__c == '涓�') {
String tex = 'A';
if (CountDel[i].hospitalSpecialOffer__c) {
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();
- Jstage.allnumber = Jstage.allnumber+1 ;
- if(CountDel[i].Isoverdue__c == 1){
+ 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();
+ Jstage.allnumber = Jstage.allnumber + 1;
+ if (CountDel[i].Isoverdue__c == 1) {
Jstage.limitCount = Jstage.limitCount + 1;
}
Jstage.BoxPiece = CountDel[i].Box_Piece__c;
- newMidPieceMap.put(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c + tex, Jstage);
- }else{
+ newMidPieceMap.put(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex, Jstage);
+ } else {
ConsumableorderdetailsInfo Jstage = new ConsumableorderdetailsInfo(MidMap.get(CountDel[i].Consumable_Product__c));
- Jstage.allnumber = Jstage.allnumber+1 ;
- if(CountDel[i].Isoverdue__c == 1){
+ Jstage.allnumber = Jstage.allnumber + 1;
+ if (CountDel[i].Isoverdue__c == 1) {
Jstage.limitCount = Jstage.limitCount + 1;
}
Jstage.BoxPiece = CountDel[i].Box_Piece__c;
if (CountDel[i].hospitalSpecialOffer__c) {
Jstage.hospitalSpecialOffer = true;
- newMidPieceMap.put(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c+ tex, Jstage);
- }else{
+ newMidPieceMap.put(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex, Jstage);
+ } else {
Jstage.hospitalSpecialOffer = false;
- newMidPieceMap.put(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c+ tex, Jstage);
+ newMidPieceMap.put(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex, Jstage);
}
}
}
@@ -294,8 +343,8 @@
consumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>();
List<ConsumableorderdetailsInfo> newHosMidBoxList = new List<ConsumableorderdetailsInfo>();
//鎶夿oxmap閲岀殑鍊间粠鏂拌祴缁檅oxRecords
- for(ConsumableorderdetailsInfo bss : newMidBoxMap.values()){
- if(bss.allnumber>0){
+ for (ConsumableorderdetailsInfo bss : newMidBoxMap.values()) {
+ if (bss.allnumber > 0) {
bss.packing_list = Integer.valueof(bss.Prod.Product2__r.Packing_list_manual__c);
bss.approbation_No = bss.Prod.Product2__r.SFDA_Approbation_No__c;
bss.expiration_Date = bss.Prod.Product2__r.SFDA_Expiration_Date__c;
@@ -304,8 +353,8 @@
}
}
boxRecords.sort();
- for(ConsumableorderdetailsInfo bss : newMidPieceMap.values()){
- if(bss.allnumber>0){
+ for (ConsumableorderdetailsInfo bss : newMidPieceMap.values()) {
+ if (bss.allnumber > 0) {
bss.packing_list = Integer.valueof(bss.Prod.Product2__r.Packing_list_manual__c);
bss.approbation_No = bss.Prod.Product2__r.SFDA_Approbation_No__c;
bss.expiration_Date = bss.Prod.Product2__r.SFDA_Expiration_Date__c;
@@ -316,31 +365,31 @@
//add by rentx 2020-11-27 鍏堝垽鏂尰闄㈢壒浠风殑鐩� 鍜� 涓�
//2020-11-27 鏃� 浜� rentx 娉ㄩ噴 start
String temp = 'A';
- for(ConsumableorderdetailsInfo bss : boxRecords){
+ for (ConsumableorderdetailsInfo bss : boxRecords) {
consumableorderdetailsRecords.add(bss);
//璇ヤ骇鍝佹槸鍖婚櫌鐗逛环浜у搧
- if (bss.hospitalSpecialOffer && newMidPieceMap.containsKey(bss.Prod.Id+'涓狟')) {
- if (newMidPieceMap.get(bss.Prod.Id+'涓狟').hospitalSpecialOffer) {
- consumableorderdetailsRecords.add(newMidPieceMap.get(bss.Prod.Id+'涓狟'));
- newMidPieceMap.remove(bss.Prod.Id+'涓狟');
+ if (bss.hospitalSpecialOffer && newMidPieceMap.containsKey(bss.Prod.Id + '涓狟')) {
+ if (newMidPieceMap.get(bss.Prod.Id + '涓狟').hospitalSpecialOffer) {
+ consumableorderdetailsRecords.add(newMidPieceMap.get(bss.Prod.Id + '涓狟'));
+ newMidPieceMap.remove(bss.Prod.Id + '涓狟');
}
}
- if (!bss.hospitalSpecialOffer && newMidPieceMap.containsKey(bss.Prod.Id+'涓狝')) {
+ if (!bss.hospitalSpecialOffer && newMidPieceMap.containsKey(bss.Prod.Id + '涓狝')) {
// if (newMidPieceMap.get(bss.Prod.Id+'涓狝')) {
- consumableorderdetailsRecords.add(newMidPieceMap.get(bss.Prod.Id+'涓狝'));
- newMidPieceMap.remove(bss.Prod.Id+'涓狝');
+ consumableorderdetailsRecords.add(newMidPieceMap.get(bss.Prod.Id + '涓狝'));
+ newMidPieceMap.remove(bss.Prod.Id + '涓狝');
// }
}
}
- for(ConsumableorderdetailsInfo bss : newMidPieceMap.values()){
- if (newMidPieceMap.containsKey(bss.Prod.Id+'涓狟')) {
+ for (ConsumableorderdetailsInfo bss : newMidPieceMap.values()) {
+ if (newMidPieceMap.containsKey(bss.Prod.Id + '涓狟')) {
consumableorderdetailsRecords.add(newMidPieceMap.get(bss.Prod.Id + '涓狟'));
}
}
- for(ConsumableorderdetailsInfo bss : newMidPieceMap.values()){
- if (newMidPieceMap.containsKey(bss.Prod.Id+'涓狝')) {
+ for (ConsumableorderdetailsInfo bss : newMidPieceMap.values()) {
+ if (newMidPieceMap.containsKey(bss.Prod.Id + '涓狝')) {
consumableorderdetailsRecords.add(newMidPieceMap.get(bss.Prod.Id + '涓狝'));
}
}
@@ -348,25 +397,24 @@
//2020-11-27 鏃� 浜� rentx 娉ㄩ噴 end
// consumableorderdetailsRecords.addAll(newMidPieceMap.values());
//2020-11-27 鏃� 浜� rentx 娉ㄩ噴 end
-
+
notarriveorder();
productLimtAndDate();
datelimitSearch();
//add by rentx
Integer ishos = 0;
- for(ConsumableorderdetailsInfo bss : consumableorderdetailsRecords){
- if(productkucun.get(bss.Prod.Id) != null){
+ for (ConsumableorderdetailsInfo bss : consumableorderdetailsRecords) {
+ if (productkucun.get(bss.Prod.Id) != null) {
bss.guaranteeperiod = productkucun.get(bss.Prod.Id);
}
//add by rentx 2021-3-10 start
if (bss.hospitalSpecialOffer) {
- ishos = ishos+1;
+ ishos = ishos + 1;
}
-
}
if (ishos > 0) {
hasHos = true;
- }else{
+ } else {
hasHos = false;
}
//add by rentx 2021-3-10 end
@@ -381,28 +429,28 @@
//鎬讳欢鏁�
totalCount = consumableorderdetailsRecords.size();
//椤垫暟
- // pagecount=(totalcount + pagesize - 1) / pagesize;
+ // pagecount=(totalcount + pagesize - 1) / pagesize;
//鏄剧ず绗竴椤�
// moveToFirst();
makeCurrentPageRecords();
- //鍒嗛〉
+ //鍒嗛〉
PaginatedAccounts paginatedAccounts = new PaginatedAccounts();
- System.debug('pageToken==>'+ pageToken);
- System.debug('pageSize===>'+ pageSize);
+ System.debug('pageToken==>' + pageToken);
+ System.debug('pageSize===>' + pageSize);
paginatedAccounts.nextPageToken = (pageToken + pageSize < totalCount) ? pageToken + pageSize : null;
paginatedAccounts.recordStart = pageToken + 1;
paginatedAccounts.pageNumber = pageToken / pageSize + 1;
Integer recordEnd = pageSize * paginatedAccounts.pageNumber;
- System.debug('paginatedAccounts.recordStart'+ paginatedAccounts.recordStart);
- System.debug('paginatedAccounts.pageNumber'+ paginatedAccounts.pageNumber);
- System.debug('paginatedAccounts.nextPageToken===>'+paginatedAccounts.nextPageToken);
- System.debug('recordEnd'+ recordEnd);
+ System.debug('paginatedAccounts.recordStart' + paginatedAccounts.recordStart);
+ System.debug('paginatedAccounts.pageNumber' + paginatedAccounts.pageNumber);
+ System.debug('paginatedAccounts.nextPageToken===>' + paginatedAccounts.nextPageToken);
+ System.debug('recordEnd' + recordEnd);
paginatedAccounts.recordEnd = totalCount >= recordEnd ? recordEnd : totalCount;
paginatedAccounts.totalRecords = totalCount;
- //end
- System.debug('PaginatedAccounts===>'+PaginatedAccounts);
+ //end
+ System.debug('PaginatedAccounts===>' + PaginatedAccounts);
//璧嬪�煎洖浼�
results.result = 'Success';
@@ -421,36 +469,38 @@
results.deliveryDetailCount = Delivery_detail_count;
results.orderNumberNotarrive = OrderNumber_notarrive;
results.moreThanSevenDays = More_than_seven_days;
- //add by WangXueqin 2023/05/05
+ //add by WangXueqin 2023/05/05
results.userPro_Type = userPro_Type;
results.paginatedAccounts = paginatedAccounts;
} catch (Exception e) {
results.result = 'Fail';
- results.errorMsg = e.getLineNumber()+'---'+e.getMessage();
+ results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
return results;
}
//瓒呰繃涓�鍛ㄦ湭鍒拌揣璁㈠崟
- public static void notarriveorder(){
+ public static void notarriveorder() {
//over_view = false;
Date orderdate = Date.today().addDays(-7);
-
- 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
- AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- AND Dealer_Arrive__c = false
- ];
+
+ 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
+ AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
+ 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>();
List<String> notarriveorderid = new List<String>();
- for(Integer i = 0; i < orderdetails.size(); i++){
- if(notarriveorderMap.containsKey(orderdetails[i].Consumable_order_minor__c)){
+ for (Integer i = 0; i < orderdetails.size(); i++) {
+ if (notarriveorderMap.containsKey(orderdetails[i].Consumable_order_minor__c)) {
continue;
- }else{
+ } else {
notarriveorderMap.put(orderdetails[i].Consumable_order_minor__c, orderdetails[i].Consumable_order_minor__c);
//notarriveorderid.add('\'' + orderdetails[i].Consumable_order_minor__c +'\'');
notarriveorderid.add(orderdetails[i].Consumable_order_minor__c);
@@ -470,115 +520,137 @@
column.add(fsm.getFieldPath());
columns.add(fsm.getFieldPath().split('\\.'));
}
- system.debug('columns=====================>'+columns);
+ system.debug('columns=====================>' + columns);
// 鑾峰緱鏄剧ず鏁版嵁
raesList = new List<Consumable_order__c>();
String soql = 'select Id';
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 += ' and Order_ProType__c = \'' + userPro_Type + '\' ' ;
+ 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 + '\' ';
-
- if(notarriveorderid.size() < 1){
- soql +=' AND Id = null ';
- }else{
+
+ if (notarriveorderid.size() < 1) {
+ soql += ' AND Id = null ';
+ } else {
String sqlTail = '(\'';
- for(Integer i = 0 ; i< notarriveorderid.size();i++){
- if(i<notarriveorderid.size()-1){
- sqlTail += notarriveorderid[i]+'\',\'';
- }else{
- sqlTail += notarriveorderid[i]+'\')';
+ for (Integer i = 0; i < notarriveorderid.size(); i++) {
+ if (i < notarriveorderid.size() - 1) {
+ sqlTail += notarriveorderid[i] + '\',\'';
+ } else {
+ sqlTail += notarriveorderid[i] + '\')';
}
}
//over_view = true;
- soql +=' AND Id in ' + sqlTail;
+ soql += ' AND Id in ' + sqlTail;
}
system.debug('soql_____11111__' + soql);
raesList = Database.query(soql);
- // update end by vivek2020-01-15
+ // update end by vivek2020-01-15
Total_num = 0;
OrderNumber_arrived = 0;
Delivery_detail_count = 0;
OrderNumber_notarrive = 0;
More_than_seven_days = 0;
- for(Consumable_order__c conorder :raesList){
- Total_num += (Integer)conorder.Total_num__c;
- OrderNumber_arrived += (Integer)conorder.OrderNumber_arrived__c;
- Delivery_detail_count += (Integer)conorder.Delivery_detail_count__c;
- OrderNumber_notarrive += (Integer)conorder.OrderNumber_notarrive__c;
- More_than_seven_days += (Integer)conorder.More_than_seven_days__c;
+ for (Consumable_order__c conorder : raesList) {
+ Total_num += (Integer) conorder.Total_num__c;
+ OrderNumber_arrived += (Integer) conorder.OrderNumber_arrived__c;
+ Delivery_detail_count += (Integer) conorder.Delivery_detail_count__c;
+ OrderNumber_notarrive += (Integer) conorder.OrderNumber_notarrive__c;
+ More_than_seven_days += (Integer) conorder.More_than_seven_days__c;
}
// update end by vivek2020-01-15
}
- public static void productLimtAndDate(){
+ public static void productLimtAndDate() {
String nowName = null, nowRightAsstModelNo = null;
- Map<String,String> productLimt = new Map<String,String>();
- for(Integer i = 0; i < proLimitAndDate.size(); i++){
+ Map<String, String> productLimt = new Map<String, String>();
+ for (Integer i = 0; i < proLimitAndDate.size(); i++) {
nowName = proLimitAndDate[i];
- if( nowName.indexOf( '|') >= 0) {
- nowRightAsstModelNo = nowName.subString( 0, nowName.indexOf( '|'));
- nowName = nowName.subString( nowName.indexOf( '|')+1);
+ if (nowName.indexOf('|') >= 0) {
+ nowRightAsstModelNo = nowName.subString(0, nowName.indexOf('|'));
+ nowName = nowName.subString(nowName.indexOf('|') + 1);
}
productLimt.put(nowRightAsstModelNo, nowName);
}
- 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));
- }
+ 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)
+ );
+ }
}
}
- public static void datelimitSearch(){
+ 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
- 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
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- ORDER BY Consumable_Product__c, Sterilization_limit__c asc ];
+ 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
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c = :userWorkLocation
+ 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)){
+ for (Integer i = 0; i < orderkucun.size(); i++) {
+ if (productkucun.containsKey(orderkucun[i].Consumable_Product__c)) {
continue;
- }else{
+ } else {
productkucun.put(orderkucun[i].Consumable_Product__c, orderkucun[i].Sterilization_limit__c);
}
}
barcodekucun.clear();
- for(Integer i = 0 ; i< orderkucun.size();i++){
- if(orderkucun[i].Sterilization_limit__c < Date.today().addYears(1)){
- if(barcodekucun.contains(orderkucun[i].Bar_Code__c)){
+ for (Integer i = 0; i < orderkucun.size(); i++) {
+ if (orderkucun[i].Sterilization_limit__c < Date.today().addYears(1)) {
+ if (barcodekucun.contains(orderkucun[i].Bar_Code__c)) {
continue;
- }else{
+ } else {
barcodekucun.add(orderkucun[i].Bar_Code__c);
}
}
}
- 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
- GROUP 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++){
+ 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
+ GROUP 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]));
}
}
@@ -599,7 +671,7 @@
// }
//缂栬緫褰撳墠椤靛唴瀹�
- public static void makeCurrentPageRecords(){
+ public static void makeCurrentPageRecords() {
Integer startIdx;
Integer endIdx;
pageRecords = new List<ConsumableorderdetailsInfo>();
@@ -661,7 +733,7 @@
@AuraEnabled
public String BoxPiece { get; set; }
@AuraEnabled
- public Boolean hospitalSpecialOffer { get; set ;}
+ public Boolean hospitalSpecialOffer { get; set; }
public ConsumableorderdetailsInfo(Product2__c e) {
//check = false;
@@ -672,18 +744,17 @@
allnumber = 0;
limitCount = 0;
overlimitCount = 0;
-
}
public ConsumableorderdetailsInfo(AggregateResult e) {
- countid =Integer.valueOf(e.get('countid'));
+ countid = Integer.valueOf(e.get('countid'));
prodName = String.valueOf(e.get('prodname'));
BoxPiece = String.valueOf(e.get('BoxPiece'));
}
// 鎺掑簭
public Integer compareTo(Object compareTo) {
- ConsumableorderdetailsInfo compareToesd =(ConsumableorderdetailsInfo)compareTo;
+ ConsumableorderdetailsInfo compareToesd = (ConsumableorderdetailsInfo) compareTo;
Integer returnValue = 0;
if (allnumber > compareToesd.allnumber) {
returnValue = -1;
@@ -738,7 +809,5 @@
public List<ConsumableorderdetailsInfo> pageCodeRecords;
@AuraEnabled
public PaginatedAccounts paginatedAccounts;
-
-
}
}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexUpAccountProLimit.cls b/force-app/main/default/classes/LexUpAccountProLimit.cls
index 7f195d7..b604be5 100644
--- a/force-app/main/default/classes/LexUpAccountProLimit.cls
+++ b/force-app/main/default/classes/LexUpAccountProLimit.cls
@@ -1,59 +1,55 @@
public without sharing class LexUpAccountProLimit {
@AuraEnabled
- public static ResponseBodyLWC upAccount(String accountId,String productLimit,String userPro_Type){
+ public static ResponseBodyLWC upAccount(String accountId, String productLimit, String userPro_Type) {
ResponseBodyLWC res = new ResponseBodyLWC();
- Map<String,object> data = new Map<String,object>();
+ Map<String, object> data = new Map<String, object>();
res.entity = data;
//--------AddStart-----XHL--------------20180929-------------
Boolean EngFlag = false;
- Boolean ETFlag = false;
- String userPro_Typestr = null;
- if(String.isBlank(userPro_Type)){
+ Boolean ETFlag = false;
+ String userPro_Typestr = null;
+ if (String.isBlank(userPro_Type)) {
userPro_Type = 'ET';
}
- if(userPro_Type == 'ENG'){
+ if (userPro_Type == 'ENG') {
EngFlag = true;
- }else{
+ } else {
ETFlag = true;
}
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'userPro_Type:'+ userPro_Type));
//ApexPages.message(ApexPages.severity.ERROR,'userPro_Type:'+ userPro_Type));
userPro_Typestr = '%' + userPro_Type + '%';
- //--------AddEnd-----XHL--------------20180929-------------
+ //--------AddEnd-----XHL--------------20180929-------------
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+'', '');
+ String checkResoultstr = checkResoult(productLimit);
+ system.debug('checkResoultstr====>' + checkResoultstr);
+ if (String.isNotBlank(checkResoultstr)) {
+ return new ResponseBodyLWC('Error', 500, '' + checkResoultstr + '', '');
// return checkResoultstr;
}
//String[] proidList =new String[]{};
- String[] proList =new String[]{};
- String[] pro_List =new String[]{};
+ String[] proList = new List<String>{};
+ String[] pro_List = new List<String>{};
List<Account> acc = [
- SELECT
- Id,
- Name,
- Product_Limit_Date__c
- FROM
- Account
- WHERE
- Id = : accountId
+ SELECT Id, Name, Product_Limit_Date__c
+ FROM Account
+ WHERE Id = :accountId
FOR UPDATE
];
- if(null == acc || acc.size() == 0) {
+ if (null == acc || acc.size() == 0) {
// return '娌℃湁缁忛攢鍟嗭細' + accountId + '鐨勬暟鎹��';
- return new ResponseBodyLWC('Error',500,'娌℃湁缁忛攢鍟嗭細' + accountId + '鐨勬暟鎹��', '');
+ return new ResponseBodyLWC('Error', 500, '娌℃湁缁忛攢鍟嗭細' + accountId + '鐨勬暟鎹��', '');
}
//proidList = acc[0].view_product__c.split(',');
//--------UpdateStart-----XHL--------------20180929-------------
String sql = '';
-
- 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
+
+ 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
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'roduct2List:'+ roduct2List));
//sql = 'SELECT Asset_Model_No__c '
// + ' FROM Product2__c '
@@ -61,84 +57,83 @@
//if(EngFlag){
// sql += ' AND Pro2_Dealer_ENG__c =' + EngFlag ;
//}else if(ETFlag){
- // sql += ' AND Pro2_Dealer_Object__c = ' + ETFlag;
+ // sql += ' AND Pro2_Dealer_Object__c = ' + ETFlag;
//}
//system.debug('sqlZZZZZZ' + sql);
- //List<Product2__c> roduct2List = Database.query(sql);
+ //List<Product2__c> roduct2List = Database.query(sql);
//--------UpdateEnd-----XHL--------------20180929-------------
Map<String, String> productMap = new Map<String, String>();
proList = productLimit.split(',');
system.debug('productLimitDDDDD' + productLimit);
system.debug('proListFFFFF' + proList);
- if(proList.size() > 0 && String.isNotEmpty(proList[0])){
- for(Integer i = 0; i < proList.size(); i++){
- pro_List.add(proList[i].subString(0,proList[i].indexOf( '|')));
+ if (proList.size() > 0 && String.isNotEmpty(proList[0])) {
+ for (Integer i = 0; i < proList.size(); i++) {
+ pro_List.add(proList[i].subString(0, proList[i].indexOf('|')));
}
}
- if(roduct2List.size() > 0){
- for(Product2__c pro2 :roduct2List){
+ if (roduct2List.size() > 0) {
+ for (Product2__c pro2 : roduct2List) {
productMap.put(pro2.Asset_Model_No__c, pro2.Asset_Model_No__c);
}
}
- for(Integer i = 0; i < pro_List.size(); i++){
- if(!productMap.containsKey(pro_List[i])){
+ for (Integer i = 0; i < pro_List.size(); i++) {
+ if (!productMap.containsKey(pro_List[i])) {
// return '缁忛攢鍟嗘病鏈� ' + pro_List[i] + ' 鐨勪骇鍝佷笂闄愯瀹氭潈闄愶紝鎴栦骇鍝佷笉瀛樺湪锛�';
- return new ResponseBodyLWC('Error',500,'缁忛攢鍟嗘病鏈� ' + pro_List[i] + ' 鐨勪骇鍝佷笂闄愯瀹氭潈闄愶紝鎴栦骇鍝佷笉瀛樺湪锛�', '');
+ return new ResponseBodyLWC('Error', 500, '缁忛攢鍟嗘病鏈� ' + pro_List[i] + ' 鐨勪骇鍝佷笂闄愯瀹氭潈闄愶紝鎴栦骇鍝佷笉瀛樺湪锛�', '');
}
}
- String productLimitDa = '';
- for(String str : productLimit.split(',')){
-
- if(str != null && str != ''){
+ String productLimitDa = '';
+ for (String str : productLimit.split(',')) {
+ if (str != null && str != '') {
productLimitDa += ',' + str;
}
- }
+ }
Savepoint sp = Database.setSavepoint();
- try{
+ try {
Account accinfo = new Account();
accinfo.Id = accountId;
- if(EngFlag){
- accinfo.Product_Limit_DateENG__c = String.isBlank(productLimitDa) ? productLimitDa : productLimitDa.subString(1);
- }else if(ETFlag){
- accinfo.Product_Limit_Date__c = String.isBlank(productLimitDa) ? productLimitDa : productLimitDa.subString(1);
+ if (EngFlag) {
+ accinfo.Product_Limit_DateENG__c = String.isBlank(productLimitDa) ? productLimitDa : productLimitDa.subString(1);
+ } else if (ETFlag) {
+ 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);
return res;
// return '';
- }catch(DmlException de){
+ } catch (DmlException de) {
Database.rollback(sp);
throw de;
- }
+ }
}
- public static String checkResoult (String productLimit){
+ public static String checkResoult(String productLimit) {
String[] proLimit = productLimit.split(',');
String nowName = null, nowRightAsstModelNo = null;
List<String> asstModelNo = new List<String>();
- Map<String,String> asstModelNoMap = new Map<String,String>();
+ Map<String, String> asstModelNoMap = new Map<String, String>();
List<String> asstModelNoCount = new List<String>();
- for(Integer i = 0; i < proLimit.size(); i++){
+ for (Integer i = 0; i < proLimit.size(); i++) {
nowName = proLimit[i];
- if( nowName.indexOf( '|') >= 0) {
- nowRightAsstModelNo = nowName.subString( 0, nowName.indexOf( '|'));
+ if (nowName.indexOf('|') >= 0) {
+ nowRightAsstModelNo = nowName.subString(0, nowName.indexOf('|'));
}
asstModelNo.add(nowRightAsstModelNo);
}
- for(Integer i = 0; i < asstModelNo.size(); i++){
- if(asstModelNoMap.containsKey(asstModelNo[i])){
+ for (Integer i = 0; i < asstModelNo.size(); i++) {
+ if (asstModelNoMap.containsKey(asstModelNo[i])) {
asstModelNoCount.add(asstModelNo[i]);
- }else{
+ } else {
asstModelNoMap.put(asstModelNo[i], asstModelNo[i]);
}
}
- if(asstModelNoCount.size() > 0){
+ if (asstModelNoCount.size() > 0) {
return '浜у搧锛�' + asstModelNoCount + '鐨勬暟鎹噸澶嶃��';
// return new ResponseBodyLWC('Error',500,'浜у搧锛�' + asstModelNoCount + '鐨勬暟鎹噸澶嶃��', '');
- }else{
+ } else {
return '';
}
}
diff --git a/force-app/main/default/classes/LexUtility.cls b/force-app/main/default/classes/LexUtility.cls
index 56d6ae7..3dc9f81 100644
--- a/force-app/main/default/classes/LexUtility.cls
+++ b/force-app/main/default/classes/LexUtility.cls
@@ -1,13 +1,12 @@
public without sharing class LexUtility {
-
//鏌ヨ鏄惁涓�鐩存樉绀烘彁绀�
- public static Boolean getIsNoteStay(){
+ public static Boolean getIsNoteStay() {
NoteStay__c noteStay = NoteStay__c.getInstance('NoteStay');
return noteStay.IsStay__c;
}
//鏌ヨ璁稿彲璇佹彁閱掑ぉ鏁�
- public static Integer getLicenceReminderDays(){
+ public static Integer getLicenceReminderDays() {
LicenceReminderDate__c days = LicenceReminderDate__c.getInstance('180Days');
return days.ReminderDays__c.intValue();
}
diff --git a/force-app/main/default/classes/ResponseBodyLWC.cls b/force-app/main/default/classes/ResponseBodyLWC.cls
index 5efe728..b21d235 100644
--- a/force-app/main/default/classes/ResponseBodyLWC.cls
+++ b/force-app/main/default/classes/ResponseBodyLWC.cls
@@ -1,24 +1,25 @@
public class ResponseBodyLWC {
@AuraEnabled
- public String status{get;set;}
+ public String status { get; set; }
@AuraEnabled
- public Integer code{get;set;}
+ public Integer code { get; set; }
@AuraEnabled
- public String msg{get;set;}
+ public String msg { get; set; }
@AuraEnabled
- public Object entity{get;set;}
+ public Object entity { get; set; }
@AuraEnabled
- public List<Object> entityList{get;set;}
- public ResponseBodyLWC(){}
-
- public ResponseBodyLWC(String status,Integer code, String msg, Object entity){
+ public List<Object> entityList { get; set; }
+ public ResponseBodyLWC() {
+ }
+
+ public ResponseBodyLWC(String status, Integer code, String msg, Object entity) {
this.status = status;
this.code = code;
this.msg = msg;
this.entity = entity;
}
- public ResponseBodyLWC(String status,Integer code, String msg, List<Object> entityList){
+ public ResponseBodyLWC(String status, Integer code, String msg, List<Object> entityList) {
this.status = status;
this.code = code;
this.msg = msg;
diff --git a/force-app/main/default/classes/lexSearchAgencyHospitalController.cls b/force-app/main/default/classes/lexSearchAgencyHospitalController.cls
index b244fc7..f47d1c1 100644
--- a/force-app/main/default/classes/lexSearchAgencyHospitalController.cls
+++ b/force-app/main/default/classes/lexSearchAgencyHospitalController.cls
@@ -1,28 +1,32 @@
public without sharing class lexSearchAgencyHospitalController {
//缁忛攢鍟嗙敤鎴蜂骇鍝佸垎绫伙紙ET銆丒NG锛�
- public static String agencyProType {get;set;}
- public static String searchName {get;set;}
+ public static String agencyProType { get; set; }
+ public static String searchName { get; set; }
private static String accountid = null;
@AuraEnabled
- public static List<Account> at {get;set;}
-
+ public static List<Account> at { get; set; }
@AuraEnabled
- public static ResponseBodyLWC init(String ctype){
+ public static ResponseBodyLWC init(String ctype) {
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
res.entity = data;
- User useracc = [SELECT accountid,UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId() ];
+ User useracc = [SELECT accountid, UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId()];
accountid = Useracc.accountid;
agencyProType = Useracc.UserPro_Type__c;
- if(String.isBlank(Useracc.UserPro_Type__c)){
+ if (String.isBlank(Useracc.UserPro_Type__c)) {
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);
+ data.put('at', at);
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
@@ -30,25 +34,29 @@
}
@AuraEnabled
- public static ResponseBodyLWC serContact(String searchName,String ctype){
+ public static ResponseBodyLWC serContact(String searchName, String ctype) {
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
res.entity = data;
- User useracc = [SELECT accountid,UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId() ];
+ User useracc = [SELECT accountid, UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId()];
accountid = Useracc.accountid;
- at = Database.query(makeSoql(searchName,accountid,ctype));
- data.put('at',at);
+ at = Database.query(makeSoql(searchName, accountid, ctype));
+ data.put('at', at);
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
return res;
}
- private static String makeSoql(String searchName,String accountid,String ctype){
-
+ 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('%', '\\%')) + '%\')' ;
- if(String.isNotBlank(searchName)){
+ 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('%', '\\%')) + '%\'';
}
soql += ' order by Name desc limit 100';
diff --git a/force-app/main/default/labels/CustomLabels.labels-meta.xml b/force-app/main/default/labels/CustomLabels.labels-meta.xml
index d4cd83a..f4ea642 100644
--- a/force-app/main/default/labels/CustomLabels.labels-meta.xml
+++ b/force-app/main/default/labels/CustomLabels.labels-meta.xml
@@ -12,14 +12,14 @@
<language>zh_CN</language>
<protected>false</protected>
<shortDescription>鍙戠エ鏄剧ず鏄庣粏</shortDescription>
- <value>00O6D000000UPzaUAG</value>
+ <value>00O0l000000zaGcEAI</value>
</labels>
<labels>
<fullName>View_Weekly_Report</fullName>
<language>zh_CN</language>
<protected>false</protected>
<shortDescription>鏌ョ湅鍛ㄦ姤娲诲姩</shortDescription>
- <value>00O6D000000UPzZUAW</value>
+ <value>00O0l000000zo9aEAA</value>
</labels>
<labels>
<fullName>invoiceStart</fullName>
diff --git a/force-app/main/default/lwc/boxorpieceType/boxorpieceType.html b/force-app/main/default/lwc/boxorpieceType/boxorpieceType.html
index d693bae..aa3f32b 100644
--- a/force-app/main/default/lwc/boxorpieceType/boxorpieceType.html
+++ b/force-app/main/default/lwc/boxorpieceType/boxorpieceType.html
@@ -1,10 +1,11 @@
<template>
<lightning-combobox
- name="progress"
- label="Status"
- value={value}
- placeholder="璇烽�夋嫨鍗曚綅"
- options={options}
- onchange={handleChange} >
- </lightning-combobox>
+ name="progress"
+ label="Status"
+ value={value}
+ placeholder="璇烽�夋嫨鍗曚綅"
+ options={options}
+ onchange={handleChange}
+ >
+ </lightning-combobox>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/boxorpieceType/boxorpieceType.js b/force-app/main/default/lwc/boxorpieceType/boxorpieceType.js
index 6e88773..6155dc5 100644
--- a/force-app/main/default/lwc/boxorpieceType/boxorpieceType.js
+++ b/force-app/main/default/lwc/boxorpieceType/boxorpieceType.js
@@ -1,4 +1,4 @@
-import { LightningElement,api } from 'lwc';
+import { LightningElement, api } from 'lwc';
export default class BoxorpieceType extends LightningElement {
value = '鐩�';
@@ -11,8 +11,8 @@
];
}
- connectedCallback(){
- console.log('enter BoxorpieceType')
+ connectedCallback() {
+ console.log('enter BoxorpieceType');
}
handleChange(event) {
diff --git a/force-app/main/default/lwc/commonToast/commonToast.html b/force-app/main/default/lwc/commonToast/commonToast.html
index f367b87..2c2e51f 100644
--- a/force-app/main/default/lwc/commonToast/commonToast.html
+++ b/force-app/main/default/lwc/commonToast/commonToast.html
@@ -4,7 +4,13 @@
<div class={outerClass} role="status">
<span class="slds-assistive-text">{type}</span>
<span class={innerClass} title={message}>
- <lightning-icon icon-name={getIconName} alternative-text="icon" styleclass="slds-icon slds-icon_small" variant="inverse" size="small"></lightning-icon>
+ <lightning-icon
+ icon-name={getIconName}
+ alternative-text="icon"
+ styleclass="slds-icon slds-icon_small"
+ variant="inverse"
+ size="small"
+ ></lightning-icon>
</span>
<div class="slds-notify__content">
<h2 class="slds-text-heading_small">
@@ -12,9 +18,16 @@
</lightning-formatted-rich-text>
</h2>
</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>
diff --git a/force-app/main/default/lwc/commonToast/commonToast.js b/force-app/main/default/lwc/commonToast/commonToast.js
index 5da6e8e..474f3eb 100644
--- a/force-app/main/default/lwc/commonToast/commonToast.js
+++ b/force-app/main/default/lwc/commonToast/commonToast.js
@@ -1,44 +1,50 @@
-import { LightningElement,track,api} from 'lwc';
+import { LightningElement, track, api } from 'lwc';
export default class CommonToast extends LightningElement {
- @track type='success';
+ @track type = 'success';
@track message;
- @track messageIsHtml=false;
+ @track messageIsHtml = false;
@track showToastBar = false;
@api autoCloseTime = 5000;
- @track icon='';
-
+ @track icon = '';
+
@api
- showToast(type, message,icon,time) {
+ showToast(type, message, icon, time) {
this.type = type;
this.message = message;
- this.icon=icon;
- this.autoCloseTime=time;
+ this.icon = icon;
+ this.autoCloseTime = time;
this.showToastBar = true;
setTimeout(() => {
this.closeModel();
}, this.autoCloseTime);
}
-
+
closeModel() {
this.showToastBar = false;
this.type = '';
this.message = '';
}
-
+
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()
+ );
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customLightningDatatable/customLightningDatatable.js b/force-app/main/default/lwc/customLightningDatatable/customLightningDatatable.js
index fbef290..8fd5af3 100644
--- a/force-app/main/default/lwc/customLightningDatatable/customLightningDatatable.js
+++ b/force-app/main/default/lwc/customLightningDatatable/customLightningDatatable.js
@@ -7,5 +7,5 @@
template: boxorpieceType,
typeAttributes: ['customValueA']
}
- }
+ };
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.html b/force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.html
index baae6dd..026dddf 100644
--- a/force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.html
+++ b/force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.html
@@ -1,5 +1,15 @@
<template>
- <lightning-input step="0" type="number" name="count" label="鍑鸿揣鏁伴噺"
- variant="label-hidden" onchange={outboundCountBlur} data-field="shipmentNumber" value={count}
- min="0" disabled={isDisable} style="min-width: 150px;"></lightning-input>
+ <lightning-input
+ step="0"
+ type="number"
+ name="count"
+ label="鍑鸿揣鏁伴噺"
+ variant="label-hidden"
+ onchange={outboundCountBlur}
+ data-field="shipmentNumber"
+ value={count}
+ min="0"
+ disabled={isDisable}
+ style="min-width: 150px"
+ ></lightning-input>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.js b/force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.js
index ef28c10..6d73ec4 100644
--- a/force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.js
+++ b/force-app/main/default/lwc/customOutboundCountComp/customOutboundCountComp.js
@@ -1,29 +1,30 @@
-import { LightningElement,api } from 'lwc';
+import { LightningElement, api } from 'lwc';
export default class CustomOutboundCountComp extends LightningElement {
@api isDisable;
@api recordId;
@api count;
-
- connectedCallback(){
+ connectedCallback() {
console.log('enter CustomOutboundCountComp');
console.log('isDisable = ' + this.isDisable);
console.log('recordId = ' + this.recordId);
console.log('count = ' + this.count);
}
- outboundCountBlur(event){
- console.log('outboundCountBlur')
+ outboundCountBlur(event) {
+ console.log('outboundCountBlur');
this.count = event.target.value;
- this.dispatchEvent(new CustomEvent('outboundcount', {
- composed: true,
- bubbles: true,
- cancelable: true,
- detail: {
- data: { count: this.count, recordId: this.recordId }
- }
- }));
+ this.dispatchEvent(
+ new CustomEvent('outboundcount', {
+ composed: true,
+ bubbles: true,
+ cancelable: true,
+ detail: {
+ data: { count: this.count, recordId: this.recordId }
+ }
+ })
+ );
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customOutputGood/customOutputGood.html b/force-app/main/default/lwc/customOutputGood/customOutputGood.html
index 0277ba5..1ca7b1b 100644
--- a/force-app/main/default/lwc/customOutputGood/customOutputGood.html
+++ b/force-app/main/default/lwc/customOutputGood/customOutputGood.html
@@ -1,23 +1,48 @@
<template>
<template if:true={showTitle}>
<template if:true={showLink}>
- <p style="height: 10px;"></p>
- <a style="margin-left: 10px;margin-top: 10px;margin-bottom: 10px;" onclick={clickLink}><lightning-formatted-text value={outputValue}></lightning-formatted-text></a>
- <p style="height: 10px;"></p>
+ <p style="height: 10px"></p>
+ <a
+ style="margin-left: 10px; margin-top: 10px; margin-bottom: 10px"
+ onclick={clickLink}
+ ><lightning-formatted-text
+ value={outputValue}
+ ></lightning-formatted-text
+ ></a>
+ <p style="height: 10px"></p>
</template>
<template if:false={showLink}>
- <div style="margin-left: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;color:#696969;">
- <lightning-formatted-text value={outputValue}></lightning-formatted-text>
+ <div
+ style="
+ margin-left: 10px;
+ margin-top: 10px;
+ margin-bottom: 10px;
+ font-size: 16px;
+ color: #696969;
+ "
+ >
+ <lightning-formatted-text
+ value={outputValue}
+ ></lightning-formatted-text>
</div>
</template>
</template>
<template if:false={showTitle}>
- <div style="text-align: right;">
+ <div style="text-align: right">
<template if:true={showLink}>
- <a style="margin-left: 10px;margin-right: 10px;" onclick={clickLink}><lightning-formatted-number value={outputValue}></lightning-formatted-number></a>
+ <a
+ style="margin-left: 10px; margin-right: 10px"
+ onclick={clickLink}
+ ><lightning-formatted-number
+ value={outputValue}
+ ></lightning-formatted-number
+ ></a>
</template>
<template if:false={showLink}>
- <lightning-formatted-number style="margin-left: 10px;margin-right: 10px;" value={outputValue}></lightning-formatted-number>
+ <lightning-formatted-number
+ style="margin-left: 10px; margin-right: 10px"
+ value={outputValue}
+ ></lightning-formatted-number>
</template>
</div>
</template>
diff --git a/force-app/main/default/lwc/customOutputGood/customOutputGood.js b/force-app/main/default/lwc/customOutputGood/customOutputGood.js
index 643c9ce..a3b4649 100644
--- a/force-app/main/default/lwc/customOutputGood/customOutputGood.js
+++ b/force-app/main/default/lwc/customOutputGood/customOutputGood.js
@@ -1,42 +1,55 @@
-import { LightningElement,api,track } from 'lwc';
+import { LightningElement, api, track } from 'lwc';
export default class CustomOutputGood extends LightningElement {
@api outputValue;
@api outputType;
@api recordId;
-
- get showTitle(){
- if(this.outputType == 'Title'){
+
+ get showTitle() {
+ if (this.outputType == 'Title') {
return true;
- }else{
+ } else {
return false;
}
}
- get showLink(){
- if(this.outputType == 'Title'){
- if(this.outputValue == '璁㈠崟鏄庣粏姹囨��' || this.outputValue == '寰呮搷浣滃叆搴撹鍗曟眹鎬�'){
+ get showLink() {
+ if (this.outputType == 'Title') {
+ if (
+ this.outputValue == '璁㈠崟鏄庣粏姹囨��' ||
+ this.outputValue == '寰呮搷浣滃叆搴撹鍗曟眹鎬�'
+ ) {
return false;
- }else{
- return true
+ } else {
+ return true;
}
- }else{
- if(this.outputValue == 0 || this.outputValue == '0' || this.outputValue == ''){
+ } else {
+ if (
+ this.outputValue == 0 ||
+ this.outputValue == '0' ||
+ this.outputValue == ''
+ ) {
return false;
- }else{
+ } else {
return true;
}
}
}
- clickLink(event){
- this.dispatchEvent(new CustomEvent('clicklink', {
- composed: true,
- bubbles: true,
- cancelable: true,
- detail: {
- data: { value: this.outputValue, type: this.outputType, recordId:this.recordId}
- }
- }));
+ clickLink(event) {
+ this.dispatchEvent(
+ new CustomEvent('clicklink', {
+ composed: true,
+ bubbles: true,
+ cancelable: true,
+ detail: {
+ data: {
+ value: this.outputValue,
+ type: this.outputType,
+ recordId: this.recordId
+ }
+ }
+ })
+ );
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.html b/force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.html
index 70cde91..7f8cb20 100644
--- a/force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.html
+++ b/force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.html
@@ -1,10 +1,11 @@
<template>
<lightning-input
- name="shipmentAmount"
- label="shipmentAmount"
- variant="label-hidden"
- value={shipmentAmount}
- read-only style="margin-left: 10px;">
-
+ name="shipmentAmount"
+ label="shipmentAmount"
+ variant="label-hidden"
+ value={shipmentAmount}
+ read-only
+ style="margin-left: 10px"
+ >
</lightning-input>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.js b/force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.js
index 6822093..8e67f2e 100644
--- a/force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.js
+++ b/force-app/main/default/lwc/customShipmentAmountComp/customShipmentAmountComp.js
@@ -1,9 +1,12 @@
-import { LightningElement,api } from 'lwc';
+import { LightningElement, api } from 'lwc';
export default class CustomShipmentAmountComp extends LightningElement {
@api shipmentAmount;
- connectedCallback(){
- console.log('杩涘叆 CustomShipmentAmountComp shipmentAmount = ' + this.shipmentAmount);
+ connectedCallback() {
+ console.log(
+ '杩涘叆 CustomShipmentAmountComp shipmentAmount = ' +
+ this.shipmentAmount
+ );
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html b/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html
index 4638662..c5cff5b 100644
--- a/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html
+++ b/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html
@@ -1,6 +1,17 @@
<template>
<c-common-toast></c-common-toast>
- <lightning-input style="border:1px solid red;border-radius:5px;" step="any" type="number" name="shipmentNumber" label="鍑鸿揣鏁伴噺"
- variant="label-hidden" onchange={dataChange} data-field="shipmentNumber" value={shipmentNumber}
- onblur={shipmentNumberBlur} min="0" class="inputFont"></lightning-input>
+ <lightning-input
+ style="border: 1px solid red; border-radius: 5px"
+ step="any"
+ type="number"
+ name="shipmentNumber"
+ label="鍑鸿揣鏁伴噺"
+ variant="label-hidden"
+ onchange={dataChange}
+ data-field="shipmentNumber"
+ value={shipmentNumber}
+ onblur={shipmentNumberBlur}
+ min="0"
+ class="inputFont"
+ ></lightning-input>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.js b/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.js
index d16b48f..f3f1583 100644
--- a/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.js
+++ b/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.js
@@ -11,16 +11,20 @@
}
shipmentNumberBlur(event) {
- debugger
- console.log('shipmentNumberBlur')
+ debugger;
+ console.log('shipmentNumberBlur');
this.shipmentNumber = event.target.value;
if (this.isConinvoice) {
if (this.hasDecimals(this.shipmentNumber)) {
this.showMyToast('閿欒', '璇疯緭鍏ユ暣鏁�', 'Error');
this.shipmentNumber = 0;
- }else{
- if(this.esdInvoiceProNotCount < this.shipmentNumber){
- this.showMyToast('閿欒', '鍙戠エ鏁伴噺涓嶈兘瓒呰繃杩樻病鍙戠エ鏁伴噺锛�', 'Error');
+ } else {
+ if (this.esdInvoiceProNotCount < this.shipmentNumber) {
+ this.showMyToast(
+ '閿欒',
+ '鍙戠エ鏁伴噺涓嶈兘瓒呰繃杩樻病鍙戠エ鏁伴噺锛�',
+ 'Error'
+ );
this.shipmentNumber = 0;
}
}
@@ -28,18 +32,23 @@
//鍚戜笅鍙栨暣
if (this.hasDecimals(this.shipmentNumber)) {
this.showMyToast('閿欒', '璇疯緭鍏ユ暣鏁�', 'Error');
- this.shipmentNumber = Math.floor(this.shipmentNumber)
+ this.shipmentNumber = Math.floor(this.shipmentNumber);
}
}
event.target.value = this.shipmentNumber;
- this.dispatchEvent(new CustomEvent('shipmentnumber', {
- composed: true,
- bubbles: true,
- cancelable: true,
- detail: {
- data: { shipmentnumber: this.shipmentNumber, recordId: this.recordId }
- }
- }));
+ this.dispatchEvent(
+ new CustomEvent('shipmentnumber', {
+ composed: true,
+ bubbles: true,
+ cancelable: true,
+ detail: {
+ data: {
+ shipmentnumber: this.shipmentNumber,
+ recordId: this.recordId
+ }
+ }
+ })
+ );
}
hasDecimals(num) {
@@ -61,10 +70,17 @@
iconName = 'utility:error';
}
if (message != '') {
- content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
} else {
content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template.querySelector('c-common-toast').showToast(variant, content, iconName, 10000);
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.html b/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.html
index b573650..68f1d77 100644
--- a/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.html
+++ b/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.html
@@ -1,5 +1,16 @@
<template>
- <lightning-input style="border:1px solid red;border-radius:5px" step="any" type="number" name="shipmentUnitPrice"
- label="deliveryOrderNo" variant="label-hidden" data-field="shipmentUnitPrice" value={shippingUnitPrice}
- onblur={shipmentUnitPriceBlur} min="0" class="inputFont" onchange={limitDecimals}></lightning-input>
+ <lightning-input
+ style="border: 1px solid red; border-radius: 5px"
+ step="any"
+ type="number"
+ name="shipmentUnitPrice"
+ label="deliveryOrderNo"
+ variant="label-hidden"
+ data-field="shipmentUnitPrice"
+ value={shippingUnitPrice}
+ onblur={shipmentUnitPriceBlur}
+ min="0"
+ class="inputFont"
+ onchange={limitDecimals}
+ ></lightning-input>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js b/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js
index fa196e7..2fab414 100644
--- a/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js
+++ b/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js
@@ -1,34 +1,41 @@
-import { LightningElement,api,track } from 'lwc';
+import { LightningElement, api, track } from 'lwc';
export default class CustomShippingUnitPriceComp extends LightningElement {
@api recordId;
@api shippingUnitPrice;
- connectedCallback(){
+ connectedCallback() {
console.log('shippingUnitPrice = ' + this.shippingUnitPrice);
}
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')
+ shipmentUnitPriceBlur(event) {
+ console.log('shipmentUnitPriceBlur');
this.shippingUnitPrice = event.target.value;
- this.dispatchEvent(new CustomEvent('shipmentunitprice', {
- composed: true,
- bubbles: true,
- cancelable: true,
- detail: {
- data: { shipmentunitprice: this.shippingUnitPrice, recordId: this.recordId }
- }
- }));
+ this.dispatchEvent(
+ new CustomEvent('shipmentunitprice', {
+ composed: true,
+ bubbles: true,
+ cancelable: true,
+ detail: {
+ data: {
+ shipmentunitprice: this.shippingUnitPrice,
+ recordId: this.recordId
+ }
+ }
+ })
+ );
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customUnitComp/customUnitComp.js b/force-app/main/default/lwc/customUnitComp/customUnitComp.js
index 4592b6c..89e69e5 100644
--- a/force-app/main/default/lwc/customUnitComp/customUnitComp.js
+++ b/force-app/main/default/lwc/customUnitComp/customUnitComp.js
@@ -1,4 +1,4 @@
-import { LightningElement,api } from 'lwc';
+import { LightningElement, api } from 'lwc';
export default class CustomUnitComp extends LightningElement {
@api unitValue;
@@ -6,22 +6,24 @@
@api recordId;
@api isDisabled;
- connectedCallback(){
- if(this.isDisabled == null){
+ connectedCallback() {
+ if (this.isDisabled == null) {
this.isDisabled = false;
}
}
- handleDataChange(event){
+ handleDataChange(event) {
console.log('unitValue = ' + event.target.value);
this.unitValue = event.target.value;
- this.dispatchEvent(new CustomEvent('unitchange', {
- composed: true,
- bubbles: true,
- cancelable: true,
- detail: {
- data: { unitValue: this.unitValue, recordId: this.recordId }
- }
- }));
+ this.dispatchEvent(
+ new CustomEvent('unitchange', {
+ composed: true,
+ bubbles: true,
+ cancelable: true,
+ detail: {
+ data: { unitValue: this.unitValue, recordId: this.recordId }
+ }
+ })
+ );
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.html b/force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.html
index a4c23fb..4fbefed 100644
--- a/force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.html
+++ b/force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.html
@@ -1,8 +1,13 @@
<template>
<template if:true={isShowButton}>
- <lightning-button label="鏌ョ湅鍛ㄦ姤娲诲姩" title="鍛ㄦ姤" onclick={toWeeklyReport} class="slds-m-left_x-small"></lightning-button>
+ <lightning-button
+ label="鏌ョ湅鍛ㄦ姤娲诲姩"
+ title="鍛ㄦ姤"
+ onclick={toWeeklyReport}
+ class="slds-m-left_x-small"
+ ></lightning-button>
</template>
<template if:false={isShowButton}>
- <p style="text-align: center;">...</p>
+ <p style="text-align: center">...</p>
</template>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.js b/force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.js
index 9c1404f..184e80d 100644
--- a/force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.js
+++ b/force-app/main/default/lwc/customWeeklyReportComp/customWeeklyReportComp.js
@@ -1,11 +1,13 @@
import { LightningElement, api, track } from 'lwc';
-import { NavigationMixin } from "lightning/navigation";
+import { NavigationMixin } from 'lightning/navigation';
import View_Weekly_Report from '@salesforce/label/c.View_Weekly_Report';
const customLabel = {
View_Weekly_Report
-}
-export default class CustomWeeklyReportComp extends NavigationMixin(LightningElement) {
+};
+export default class CustomWeeklyReportComp extends NavigationMixin(
+ LightningElement
+) {
@track label = customLabel;
@api recordId;
@@ -14,20 +16,28 @@
connectedCallback() {
console.log('CustomWeeklyReportComp recordId = ' + this.recordId);
- console.log('CustomWeeklyReportComp hospitalName = ' + this.hospitalName);
+ console.log(
+ 'CustomWeeklyReportComp hospitalName = ' + this.hospitalName
+ );
}
toWeeklyReport() {
console.log('鍘绘姤琛�');
- let reportFilters = '[{"operator":"equals","value":"' + this.hospitalName + '","column":"Agency_Report__c.Hospital__c"}]';
+ let reportFilters =
+ '[{"operator":"equals","value":"' +
+ this.hospitalName +
+ '","column":"Agency_Report__c.Hospital__c"}]';
let reportUrl = this.label.View_Weekly_Report;
- console.log('reportUrl = ' + reportUrl);
- let url = "/report/" + reportUrl + "?reportFilters=" + encodeURIComponent(reportFilters);
+ let url =
+ '/report/' +
+ reportUrl +
+ '?reportFilters=' +
+ encodeURIComponent(reportFilters);
this[NavigationMixin.Navigate]({
- type: "standard__webPage",
+ type: 'standard__webPage',
attributes: {
- url: url,
- },
+ url: url
+ }
});
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.html b/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.html
index 1f6f8c2..bfe4e5b 100644
--- a/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.html
+++ b/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.html
@@ -2,7 +2,10 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
+ <div
+ role="status"
+ class="slds-spinner slds-spinner_medium slds-spinner_brand"
+ >
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -11,8 +14,14 @@
</template>
<c-common-toast></c-common-toast>
<template if:true={showPage}>
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ "
+ >
+ <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -21,91 +30,175 @@
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding:10px;">
- <lightning-accordion allow-multiple-sections-open active-section-name={activeSections}>
- <lightning-record-view-form record-id={accountId} object-api-name="Account">
- <lightning-accordion-section label="缁忛攢鍟嗚缁嗕俊鎭�" name="A">
+ <div style="padding: 10px">
+ <lightning-accordion
+ allow-multiple-sections-open
+ active-section-name={activeSections}
+ >
+ <lightning-record-view-form
+ record-id={accountId}
+ object-api-name="Account"
+ >
+ <lightning-accordion-section
+ label="缁忛攢鍟嗚缁嗕俊鎭�"
+ name="A"
+ >
<lightning-layout multiple-rows="true">
<lightning-layout-item size="5">
- <lightning-output-field field-name="Management_Code__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Management_Code__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Name"></lightning-output-field>
+ <lightning-output-field
+ field-name="Name"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Ban_On_Use_Date__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Ban_On_Use_Date__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Ban_On_Use_Reason__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Ban_On_Use_Reason__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Dealer_discount__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Dealer_discount__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Sales_Shop_Class__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Sales_Shop_Class__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Deposit_Receipt_Finished__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Deposit_Receipt_Finished__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Deposit_Receipt_Completion_Day__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Deposit_Receipt_Completion_Day__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
</lightning-layout>
</lightning-accordion-section>
- <lightning-accordion-section label="钀ヤ笟璁稿彲璇佷功鐘跺喌" name="B">
+ <lightning-accordion-section
+ label="钀ヤ笟璁稿彲璇佷功鐘跺喌"
+ name="B"
+ >
<lightning-layout multiple-rows="true">
<lightning-layout-item size="5">
- <lightning-output-field field-name="Business_Authorization_No__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Business_Authorization_No__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Business_Paper_Expiration_Date__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Business_Paper_Expiration_Date__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Tax_Practice_No__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Tax_Practice_No__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Tax_Practice_Expiration_Date__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Tax_Practice_Expiration_Date__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Medical_Equipment_Num__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Medical_Equipment_Num__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Medical_Equipment_Expiration_Date__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Medical_Equipment_Expiration_Date__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
</lightning-layout>
</lightning-accordion-section>
<lightning-accordion-section label="鍦板潃淇℃伅" name="C">
<lightning-layout multiple-rows="true">
<lightning-layout-item size="5">
- <lightning-output-field field-name="Postal_Code__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Postal_Code__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Phone"></lightning-output-field>
+ <lightning-output-field
+ field-name="Phone"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Address_Together__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Address_Together__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Fax"></lightning-output-field>
+ <lightning-output-field
+ field-name="Fax"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
</lightning-layout>
</lightning-accordion-section>
</lightning-record-view-form>
diff --git a/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.js b/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.js
index 0d8ae06..c4dcb37 100644
--- a/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.js
+++ b/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.js
@@ -1,4 +1,4 @@
-import { LightningElement,track } from 'lwc';
+import { LightningElement, track } from 'lwc';
import initAgency from '@salesforce/apex/LexTopPageController.initAgency';
export default class LexAgencyInfo extends LightningElement {
@@ -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,33 +26,47 @@
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) {
console.log('show custom message');
var iconName = '';
var content = '';
- if(variant == 'success'){
- iconName = 'utility:check';
- }else{
- iconName = 'utility:error';
+ if (variant == 'success') {
+ iconName = 'utility:check';
+ } else {
+ iconName = 'utility:error';
}
- if(message != ''){
- content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
- }else{
- content = '<h2><strong>'+title+'<strong/></h2>';
+ if (message != '') {
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
+ } else {
+ content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template.querySelector('c-common-toast').
- showToast(variant,content,iconName,10000);
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
// var mode;
// if(this.isNoteStay){
// mode ='sticky';
@@ -66,5 +80,5 @@
// mode: mode
// });
// this.dispatchEvent(evt);
- }
+ }
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAgencyOppCusCell/lexAgencyOppCusCell.html b/force-app/main/default/lwc/lexAgencyOppCusCell/lexAgencyOppCusCell.html
index 1080fb3..9df951c 100644
--- a/force-app/main/default/lwc/lexAgencyOppCusCell/lexAgencyOppCusCell.html
+++ b/force-app/main/default/lwc/lexAgencyOppCusCell/lexAgencyOppCusCell.html
@@ -1,12 +1,23 @@
<template>
<template if:true={isShowInputField}>
<lightning-record-edit-form object-api-name="Agency_Opportunity__c">
- <lightning-input-field field-name={fieldName} variant="label-hidden" value={inputValue} onchange={inputChange}></lightning-input-field>
+ <lightning-input-field
+ field-name={fieldName}
+ variant="label-hidden"
+ value={inputValue}
+ onchange={inputChange}
+ ></lightning-input-field>
</lightning-record-edit-form>
</template>
<template if:false={isShowInputField}>
- <lightning-record-view-form record-id={recordId} object-api-name="Agency_Opportunity__c">
- <lightning-output-field variant="label-hidden" field-name={fieldName}></lightning-output-field>
+ <lightning-record-view-form
+ record-id={recordId}
+ object-api-name="Agency_Opportunity__c"
+ >
+ <lightning-output-field
+ variant="label-hidden"
+ field-name={fieldName}
+ ></lightning-output-field>
</lightning-record-view-form>
</template>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAgencyOppCusCell/lexAgencyOppCusCell.js b/force-app/main/default/lwc/lexAgencyOppCusCell/lexAgencyOppCusCell.js
index bce7edd..b406e66 100644
--- a/force-app/main/default/lwc/lexAgencyOppCusCell/lexAgencyOppCusCell.js
+++ b/force-app/main/default/lwc/lexAgencyOppCusCell/lexAgencyOppCusCell.js
@@ -1,4 +1,4 @@
-import { LightningElement,api } from 'lwc';
+import { LightningElement, api } from 'lwc';
export default class LexAgencyOppCusCell extends LightningElement {
@api recordId;
@@ -6,24 +6,31 @@
@api inputValue;
@api showType;
- get isShowInputField(){
- if(this.showType == 'inputField'){
+ get isShowInputField() {
+ if (this.showType == 'inputField') {
return true;
- }else {
+ } else {
return false;
}
}
- inputChange(event){
+ inputChange(event) {
this.inputValue = event.detail.value;
- 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}
- }
- }));
+ 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
+ }
+ }
+ })
+ );
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html b/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html
index 724c9c6..d83b5ea 100644
--- a/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html
+++ b/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html
@@ -2,7 +2,10 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
+ <div
+ role="status"
+ class="slds-spinner slds-spinner_medium slds-spinner_brand"
+ >
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -11,17 +14,44 @@
</template>
<c-common-toast></c-common-toast>
<template if:true={showPage}>
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
- <div style="padding:10px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ "
+ >
+ <div style="padding: 10px">
<!-- 鎸夐挳 -->
<!-- <lightning-button style="margin: 5px;" label="鍏ュ簱" onclick={orderArrive}></lightning-button>
<lightning-button style="margin: 5px;" label="杩斿搧" onclick={orderReturn}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;margin-right: 150px;" label="鍏ュ簱" onclick={orderArrive}>鍏ュ簱</button>
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="杩斿搧" onclick={orderReturn}>杩斿搧</button>
- <p style="height: 10px;"></p>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ style="margin: 5px; margin-right: 150px"
+ label="鍏ュ簱"
+ onclick={orderArrive}
+ >
+ 鍏ュ簱
+ </button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ style="margin: 5px"
+ label="杩斿搧"
+ onclick={orderReturn}
+ >
+ 杩斿搧
+ </button>
+ <p style="height: 10px"></p>
<!-- 妫�绱㈡潯浠� -->
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -31,30 +61,77 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>妫�绱㈡潯浠�</strong></p> -->
</div>
- <div style="padding:10px;">
+ <div style="padding: 10px">
<table>
<tbody>
<tr>
- <td style="width: 10px;"></td>
- <td style="width: 120px;">
- <div style="color:#696969;font-size:16px;text-align: left;">娑堣�楀搧璁㈠崟鍚嶇О</div>
+ <td style="width: 10px"></td>
+ <td style="width: 120px">
+ <div
+ style="
+ color: #696969;
+ font-size: 16px;
+ text-align: left;
+ "
+ >
+ 娑堣�楀搧璁㈠崟鍚嶇О
+ </div>
</td>
<td>
- <lightning-input class="inputFont" type="text" variant="label-hidden" label="娑堣�楀搧璁㈠崟鍚嶇О" value={category1} onchange={category1Change}></lightning-input>
+ <lightning-input
+ class="inputFont"
+ type="text"
+ variant="label-hidden"
+ label="娑堣�楀搧璁㈠崟鍚嶇О"
+ value={category1}
+ onchange={category1Change}
+ ></lightning-input>
</td>
- <td style="width: 30px;"></td>
- <td style="width: 108px;">
- <div style="color:#696969;font-size:16px;text-align: left;">鏈�鏂板彂璐ф棩鏈�</div>
+ <td style="width: 30px"></td>
+ <td style="width: 108px">
+ <div
+ style="
+ color: #696969;
+ font-size: 16px;
+ text-align: left;
+ "
+ >
+ 鏈�鏂板彂璐ф棩鏈�
+ </div>
</td>
<td>
- <lightning-input class="inputFont" type="date" variant="label-hidden" label="鏈�鏂板彂璐ф棩鏈�" value={cate2} onchange={cate2Change}></lightning-input>
+ <lightning-input
+ class="inputFont"
+ type="date"
+ variant="label-hidden"
+ label="鏈�鏂板彂璐ф棩鏈�"
+ value={cate2}
+ onchange={cate2Change}
+ ></lightning-input>
</td>
- <td style="width: 30px;"></td>
+ <td style="width: 30px"></td>
<td>
<!-- <lightning-button style="margin-left: 10px;margin-right: 5px;" label="鎼滅储" onclick={search}></lightning-button>
<lightning-button style="margin-left: 5px;margin-right: 5px;" label="娓呯┖" onclick={clear}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height:32px;margin-right: 30px;" label="鎼滅储" onclick={search}>鎼滅储</button>
- <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="height:32px;" label="娓呯┖" onclick={clear}>娓呯┖</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
+ style="
+ height: 32px;
+ margin-right: 30px;
+ "
+ label="鎼滅储"
+ onclick={search}
+ >
+ 鎼滅储
+ </button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
+ style="height: 32px"
+ label="娓呯┖"
+ onclick={clear}
+ >
+ 娓呯┖
+ </button>
</td>
</tr>
</tbody>
@@ -62,8 +139,15 @@
</div>
</div>
<!-- 璁㈠崟鏄庣粏 -->
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -73,9 +157,16 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>璁㈠崟鏄庣粏</strong></p> -->
</div>
- <div style="padding:10px;">
+ <div style="padding: 10px">
<!-- <lightning-datatable hide-checkbox-column key-field="id" columns={colms} data={raesList}></lightning-datatable> -->
- <c-lex-custom-lightning-datatable class="wrapped-header-datatable" hide-checkbox-column key-field="Id" data={raesList} columns={colms} onclicklink={clickLick}></c-lex-custom-lightning-datatable>
+ <c-lex-custom-lightning-datatable
+ class="wrapped-header-datatable"
+ hide-checkbox-column
+ key-field="Id"
+ data={raesList}
+ columns={colms}
+ onclicklink={clickLick}
+ ></c-lex-custom-lightning-datatable>
</div>
</div>
</div>
@@ -83,24 +174,65 @@
</template>
<!-- 璁㈠崟鍚勭鏁伴噺淇℃伅寮圭獥 -->
<template if:true={showPop}>
- <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_small" style="border: 1px solid #D4D4D4;">
+ <section
+ role="dialog"
+ tabindex="-1"
+ aria-labelledby="modal-heading-01"
+ aria-modal="true"
+ aria-describedby="modal-content-id-1"
+ class="slds-modal slds-fade-in-open slds-modal_small"
+ style="border: 1px solid #d4d4d4"
+ >
<div class="slds-modal__container">
- <header class="slds-modal__header" style="background-color: #F3F3F3;">
- <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closePop}>
- <lightning-icon icon-name="utility:close"
+ <header
+ class="slds-modal__header"
+ style="background-color: #f3f3f3"
+ >
+ <button
+ style=""
+ class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
+ title="Close"
+ onclick={closePop}
+ >
+ <lightning-icon
+ icon-name="utility:close"
alternative-text="close"
variant="inverse"
- size="small" ></lightning-icon>
+ size="small"
+ ></lightning-icon>
<span class="slds-assistive-text">Close</span>
</button>
- <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">{popTitle}</h2>
+ <h2
+ id="modal-heading-01"
+ class="slds-text-heading_medium slds-hyphenate"
+ >
+ {popTitle}
+ </h2>
</header>
- <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1" style="border: 1px solid #F3F3F3;">
- <lightning-datatable class="wrapped-header-datatable" hide-checkbox-column key-field="prodModel" columns={colms2} data={recordList}></lightning-datatable>
+ <div
+ class="slds-modal__content slds-p-around_medium"
+ id="modal-content-id-1"
+ style="border: 1px solid #f3f3f3"
+ >
+ <lightning-datatable
+ class="wrapped-header-datatable"
+ hide-checkbox-column
+ key-field="prodModel"
+ columns={colms2}
+ data={recordList}
+ ></lightning-datatable>
</div>
<footer class="slds-modal__footer">
<!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="鍏抽棴" onclick={closePop}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="margin-left: 10px;" variant="neutral" label="鍏抽棴" onclick={closePop}>鍏抽棴</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
+ style="margin-left: 10px"
+ variant="neutral"
+ label="鍏抽棴"
+ onclick={closePop}
+ >
+ 鍏抽棴
+ </button>
</footer>
</div>
</section>
diff --git a/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js b/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js
index 163a81f..47b005d 100644
--- a/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js
+++ b/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js
@@ -1,4 +1,4 @@
-import { LightningElement,wire,api,track } from 'lwc';
+import { LightningElement, wire, api, track } from 'lwc';
import { CurrentPageReference } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
@@ -13,11 +13,13 @@
import initNotArrDetAll from '@salesforce/apex/LexConsumableGoodsInfo.initNotArrDetAll';
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";
+//table css
+import { loadStyle } from 'lightning/platformResourceLoader';
+import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
-export default class LexArriveGoodsMain extends NavigationMixin(LightningElement) {
+export default class LexArriveGoodsMain extends NavigationMixin(
+ LightningElement
+) {
//椤甸潰鍩虹鍙橀噺
@track agencyProType;
@track category1;
@@ -48,62 +50,107 @@
// {label:'寰呯郴缁熸搷浣滃叆搴撴暟閲�',fieldName:'Delivery_detail_count__c'},
// {label:'杩樻病鍙戣揣鏁伴噺',fieldName:'OrderNumber_notarrive__c'},
// {label:'鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁�',fieldName:'More_than_seven_days__c'},
- {label:'娑堣�楀搧璁㈠崟鍚嶇О',
- type: "customOutputGood",
+ {
+ label: '娑堣�楀搧璁㈠崟鍚嶇О',
+ type: 'customOutputGood',
typeAttributes: {
- outputValue: { fieldName: "Name" },
+ outputValue: { fieldName: 'Name' },
type: 'Title',
- recordId: { fieldName: "Id" }
+ recordId: { fieldName: 'Id' }
},
- hideDefaultActions: true,initialWidth:200,wrapText:true},
- {label:'SAP鍚堝悓鍙�',fieldName:'ContractNo__c',hideDefaultActions: true,wrapText:true,initialWidth:180},
- {label:'璁㈠崟鎬绘暟',
- type: "customOutputGood",
+ hideDefaultActions: true,
+ initialWidth: 200,
+ wrapText: true
+ },
+ {
+ label: 'SAP鍚堝悓鍙�',
+ fieldName: 'ContractNo__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 180
+ },
+ {
+ label: '璁㈠崟鎬绘暟',
+ type: 'customOutputGood',
typeAttributes: {
- outputValue: { fieldName: "Total_num__c" },
+ outputValue: { fieldName: 'Total_num__c' },
type: 'TotalNum',
- recordId: { fieldName: "Id" }
+ recordId: { fieldName: 'Id' }
},
- hideDefaultActions: true, initialWidth: 100,cellAttributes: { alignment: "right" }},
- {label:'宸插埌璐ф暟閲�',
- type: "customOutputGood",
+ hideDefaultActions: true,
+ initialWidth: 100,
+ cellAttributes: { alignment: 'right' }
+ },
+ {
+ label: '宸插埌璐ф暟閲�',
+ type: 'customOutputGood',
typeAttributes: {
- outputValue: { fieldName: "OrderNumber_arrived__c" },
+ outputValue: { fieldName: 'OrderNumber_arrived__c' },
type: 'ArrDet',
- recordId: { fieldName: "Id" }
+ recordId: { fieldName: 'Id' }
},
- hideDefaultActions: true, initialWidth: 110,cellAttributes: { alignment: "right" }},
- {label:'寰呯郴缁熸搷浣滃叆搴撴暟閲�',
- type: "customOutputGood",
+ hideDefaultActions: true,
+ initialWidth: 110,
+ cellAttributes: { alignment: 'right' }
+ },
+ {
+ label: '寰呯郴缁熸搷浣滃叆搴撴暟閲�',
+ type: 'customOutputGood',
typeAttributes: {
- outputValue: { fieldName: "Delivery_detail_count__c" },
+ outputValue: { fieldName: 'Delivery_detail_count__c' },
type: 'DeliveryDet',
- recordId: { fieldName: "Id" }
+ recordId: { fieldName: 'Id' }
},
- hideDefaultActions: true, initialWidth: 180,cellAttributes: { alignment: "right" }},
- {label:'杩樻病鍙戣揣鏁伴噺',
- type: "customOutputGood",
+ hideDefaultActions: true,
+ initialWidth: 180,
+ cellAttributes: { alignment: 'right' }
+ },
+ {
+ label: '杩樻病鍙戣揣鏁伴噺',
+ type: 'customOutputGood',
typeAttributes: {
- outputValue: { fieldName: "OrderNumber_notarrive__c" },
+ outputValue: { fieldName: 'OrderNumber_notarrive__c' },
type: 'NotArrDet',
- recordId: { fieldName: "Id" }
+ recordId: { fieldName: 'Id' }
},
- hideDefaultActions: true, initialWidth: 120,cellAttributes: { alignment: "right" }},
- {label:'鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁�',
- type: "customOutputGood",
+ hideDefaultActions: true,
+ initialWidth: 120,
+ cellAttributes: { alignment: 'right' }
+ },
+ {
+ label: '鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁�',
+ type: 'customOutputGood',
typeAttributes: {
- outputValue: { fieldName: "More_than_seven_days__c" },
+ outputValue: { fieldName: 'More_than_seven_days__c' },
type: 'MoreThan7',
- recordId: { fieldName: "Id" }
+ recordId: { fieldName: 'Id' }
},
- hideDefaultActions: true, initialWidth: 180,cellAttributes: { alignment: "right" }},
- {label:'鏈�鏂板彂璐ф棩鏈�',fieldName:'Shipment_date__c',hideDefaultActions: true, initialWidth: 140},
- {label:'棣栨鍙戣揣鏃ユ湡',fieldName:'First_Delivery__c',hideDefaultActions: true, initialWidth: 140}
+ hideDefaultActions: true,
+ initialWidth: 180,
+ cellAttributes: { alignment: 'right' }
+ },
+ {
+ label: '鏈�鏂板彂璐ф棩鏈�',
+ fieldName: 'Shipment_date__c',
+ hideDefaultActions: true,
+ initialWidth: 140
+ },
+ {
+ label: '棣栨鍙戣揣鏃ユ湡',
+ fieldName: 'First_Delivery__c',
+ hideDefaultActions: true,
+ initialWidth: 140
+ }
];
@track colms2 = [
- {label:'浜у搧鍨嬪彿',fieldName:'prodModel',hideDefaultActions: true},
- {label:'鏁伴噺',fieldName:'recordCount',hideDefaultActions: true,initialWidth: 100}
+ { label: '浜у搧鍨嬪彿', fieldName: 'prodModel', hideDefaultActions: true },
+ {
+ label: '鏁伴噺',
+ fieldName: 'recordCount',
+ hideDefaultActions: true,
+ initialWidth: 100
+ }
];
//鑾峰彇鍙傛暟
@@ -115,270 +162,329 @@
// }
// }
- renderedCallback(){
+ 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(){
- init()
- .then(result=>{
- this.isNoteStay = result.isNoteStay;
- if(result.result == 'Success'){
- this.agencyProType = result.agencyProType;
- this.accountId = result.accountId;
- this.title = result.title;
- this.userWorkLocation = result.userWorkLocation;
- this.totalNum = result.totalNum;
- this.orderNumberArrived = result.orderNumberArrived;
- this.deliveryDetailCount = result.deliveryDetailCount;
- 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.showSpinner = false;
- this.showPage = true;
- }else{
- this.showSpinner = false;
- console.log("Error:"+result.errorMsg);
- this.showMyToast('鍒濆鍖栭〉闈㈠け璐�',result.errorMsg,'error');
- }
- })
+ connectedCallback() {
+ init().then((result) => {
+ this.isNoteStay = result.isNoteStay;
+ if (result.result == 'Success') {
+ this.agencyProType = result.agencyProType;
+ this.accountId = result.accountId;
+ this.title = result.title;
+ this.userWorkLocation = result.userWorkLocation;
+ this.totalNum = result.totalNum;
+ this.orderNumberArrived = result.orderNumberArrived;
+ this.deliveryDetailCount = result.deliveryDetailCount;
+ 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.showSpinner = false;
+ this.showPage = true;
+ } else {
+ this.showSpinner = false;
+ console.log('Error:' + result.errorMsg);
+ this.showMyToast('鍒濆鍖栭〉闈㈠け璐�', result.errorMsg, 'error');
+ }
+ });
}
//鐐瑰嚮閾炬帴
- clickLick(event){
+ clickLick(event) {
var outputValue = event.detail.data.value;
var outputType = event.detail.data.type;
var recordId = event.detail.data.recordId;
- console.log("click:"+outputValue+"---"+outputType+"---"+recordId);
- if(outputType == 'Title'){
+ console.log(
+ 'click:' + outputValue + '---' + outputType + '---' + recordId
+ );
+ if (outputType == 'Title') {
const config = {
type: 'standard__webPage',
attributes: {
- url: '/lexarrivegoods?ESetId='+recordId
+ url: '/lexarrivegoods?ESetId=' + recordId
}
};
this[NavigationMixin.Navigate](config);
- }else if(outputType == 'TotalNum'){
+ } else if (outputType == 'TotalNum') {
this.popTitle = '鎵�鏈変骇鍝佷竴瑙�';
- initTotalNum({ordId:recordId, type:'all'})
- .then(result=>{
- if(result.result == 'Success'){
+ initTotalNum({ ordId: recordId, type: 'all' }).then((result) => {
+ if (result.result == 'Success') {
// this.recordList = result.recordList;
var dataStr = JSON.stringify(result.recordList);
this.recordList = JSON.parse(dataStr);
- console.log('data:'+JSON.stringify(this.recordList));
+ console.log('data:' + JSON.stringify(this.recordList));
this.showPop = true;
- }else{
- this.showMyToast('鍔犺浇鎵�鏈変骇鍝佷竴瑙堥〉闈㈠け璐�',result.errorMsg,'error');
+ } else {
+ this.showMyToast(
+ '鍔犺浇鎵�鏈変骇鍝佷竴瑙堥〉闈㈠け璐�',
+ result.errorMsg,
+ 'error'
+ );
}
- })
- }else if(outputType == 'ArrDet'){
- if(recordId == '1'){
+ });
+ } else if (outputType == 'ArrDet') {
+ if (recordId == '1') {
this.popTitle = '鎵�鏈夊凡鍒拌揣浜у搧涓�瑙�';
- initArrDetAll({type:'all'})
- .then(result=>{
- if(result.result == 'Success'){
+ initArrDetAll({ type: 'all' }).then((result) => {
+ if (result.result == 'Success') {
// this.recordList = result.recordList;
var dataStr = JSON.stringify(result.recordList);
this.recordList = JSON.parse(dataStr);
- console.log('data:'+JSON.stringify(this.recordList));
+ console.log('data:' + JSON.stringify(this.recordList));
this.showPop = true;
- }else{
- this.showMyToast('鍔犺浇鎵�鏈夊凡鍒拌揣浜у搧涓�瑙堥〉闈㈠け璐�',result.errorMsg,'error');
+ } else {
+ this.showMyToast(
+ '鍔犺浇鎵�鏈夊凡鍒拌揣浜у搧涓�瑙堥〉闈㈠け璐�',
+ result.errorMsg,
+ 'error'
+ );
}
- })
- }else{
+ });
+ } else {
this.popTitle = '宸插埌璐т骇鍝佷竴瑙�';
- initArrDet({orderId:recordId})
- .then(result=>{
- if(result.result == 'Success'){
+ initArrDet({ orderId: recordId }).then((result) => {
+ if (result.result == 'Success') {
this.recordList = result.recordList;
- console.log('data:'+JSON.stringify(this.recordList));
+ console.log('data:' + JSON.stringify(this.recordList));
this.showPop = true;
- }else{
- this.showMyToast('鍔犺浇宸插埌璐т骇鍝佷竴瑙堥〉闈㈠け璐�',result.errorMsg,'error');
+ } else {
+ this.showMyToast(
+ '鍔犺浇宸插埌璐т骇鍝佷竴瑙堥〉闈㈠け璐�',
+ result.errorMsg,
+ 'error'
+ );
}
- })
+ });
}
- }else if(outputType == 'DeliveryDet'){
- if(recordId == '1'){
+ } else if (outputType == 'DeliveryDet') {
+ if (recordId == '1') {
this.popTitle = '鎵�鏈夊凡鍙戣揣杩樻病鍒拌揣浜у搧涓�瑙�';
- initDeliveryDetAll({type:'all'})
- .then(result=>{
- if(result.result == 'Success'){
+ initDeliveryDetAll({ type: 'all' }).then((result) => {
+ if (result.result == 'Success') {
this.recordList = result.recordList;
- console.log('data:'+JSON.stringify(this.recordList));
+ console.log('data:' + JSON.stringify(this.recordList));
this.showPop = true;
- }else{
- this.showMyToast('鍔犺浇鎵�鏈夊凡鍙戣揣杩樻病鍒拌揣浜у搧涓�瑙堥〉闈㈠け璐�',result.errorMsg,'error');
+ } else {
+ this.showMyToast(
+ '鍔犺浇鎵�鏈夊凡鍙戣揣杩樻病鍒拌揣浜у搧涓�瑙堥〉闈㈠け璐�',
+ result.errorMsg,
+ 'error'
+ );
}
- })
- }else{
+ });
+ } else {
this.popTitle = '鏈埌璐т骇鍝佷竴瑙�';
- initDeliveryDet({orderId:recordId})
- .then(result=>{
- if(result.result == 'Success'){
+ initDeliveryDet({ orderId: recordId }).then((result) => {
+ if (result.result == 'Success') {
this.recordList = result.recordList;
- console.log('data:'+JSON.stringify(this.recordList));
+ console.log('data:' + JSON.stringify(this.recordList));
this.showPop = true;
- }else{
- this.showMyToast('鍔犺浇鏈埌璐т骇鍝佷竴瑙堥〉闈㈠け璐�',result.errorMsg,'error');
+ } else {
+ this.showMyToast(
+ '鍔犺浇鏈埌璐т骇鍝佷竴瑙堥〉闈㈠け璐�',
+ result.errorMsg,
+ 'error'
+ );
}
- })
+ });
}
- }else if(outputType == 'NotArrDet'){
- if(recordId == '1'){
+ } else if (outputType == 'NotArrDet') {
+ if (recordId == '1') {
this.popTitle = '鎵�鏈夎繕娌″彂璐т骇鍝佷竴瑙�';
- initNotArrDetAll({type:'all'})
- .then(result=>{
- if(result.result == 'Success'){
+ initNotArrDetAll({ type: 'all' }).then((result) => {
+ if (result.result == 'Success') {
this.recordList = result.recordList;
- console.log('data:'+JSON.stringify(this.recordList));
+ console.log('data:' + JSON.stringify(this.recordList));
this.showPop = true;
- }else{
- this.showMyToast('鍔犺浇鎵�鏈夎繕娌″彂璐т骇鍝佷竴瑙堥〉闈㈠け璐�',result.errorMsg,'error');
+ } else {
+ this.showMyToast(
+ '鍔犺浇鎵�鏈夎繕娌″彂璐т骇鍝佷竴瑙堥〉闈㈠け璐�',
+ result.errorMsg,
+ 'error'
+ );
}
- })
- }else{
+ });
+ } else {
this.popTitle = '杩樻病鍙戣揣鏁伴噺';
- initNotArrDet({orderId:recordId})
- .then(result=>{
- if(result.result == 'Success'){
+ initNotArrDet({ orderId: recordId }).then((result) => {
+ if (result.result == 'Success') {
this.recordList = result.recordList;
- console.log('data:'+JSON.stringify(this.recordList));
+ console.log('data:' + JSON.stringify(this.recordList));
this.showPop = true;
- }else{
- this.showMyToast('鍔犺浇杩樻病鍙戣揣鏁伴噺椤甸潰澶辫触',result.errorMsg,'error');
+ } else {
+ this.showMyToast(
+ '鍔犺浇杩樻病鍙戣揣鏁伴噺椤甸潰澶辫触',
+ result.errorMsg,
+ 'error'
+ );
}
- })
+ });
}
-
- }else if(outputType == 'MoreThan7'){
- if(recordId == '1'){
+ } else if (outputType == 'MoreThan7') {
+ if (recordId == '1') {
this.popTitle = '鎵�鏈夊彂璐т竷澶╄繕鏈埌璐ф暟';
- initMoreThan7All({type:'all'})
- .then(result=>{
- if(result.result == 'Success'){
+ initMoreThan7All({ type: 'all' }).then((result) => {
+ if (result.result == 'Success') {
this.recordList = result.recordList;
- console.log('data:'+JSON.stringify(this.recordList));
+ console.log('data:' + JSON.stringify(this.recordList));
this.showPop = true;
- }else{
- this.showMyToast('鍔犺浇鎵�鏈夊彂璐т竷澶╄繕鏈埌璐ф暟椤甸潰澶辫触',result.errorMsg,'error');
+ } else {
+ this.showMyToast(
+ '鍔犺浇鎵�鏈夊彂璐т竷澶╄繕鏈埌璐ф暟椤甸潰澶辫触',
+ result.errorMsg,
+ 'error'
+ );
}
- })
- }else{
+ });
+ } else {
this.popTitle = '鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁�';
- initMoreThan7({orderId:recordId})
- .then(result=>{
- if(result.result == 'Success'){
+ initMoreThan7({ orderId: recordId }).then((result) => {
+ if (result.result == 'Success') {
this.recordList = result.recordList;
- console.log('data:'+JSON.stringify(this.recordList));
+ console.log('data:' + JSON.stringify(this.recordList));
this.showPop = true;
- }else{
- this.showMyToast('鍔犺浇鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁伴〉闈㈠け璐�',result.errorMsg,'error');
+ } else {
+ this.showMyToast(
+ '鍔犺浇鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁伴〉闈㈠け璐�',
+ result.errorMsg,
+ 'error'
+ );
}
- })
+ });
}
}
}
//鍏抽棴寮圭獥
- closePop(){
+ closePop() {
this.showPop = false;
}
//娑堣�楀搧璁㈠崟鍚嶇О鍙樻洿
- category1Change(event){
+ category1Change(event) {
this.category1 = event.detail.value;
}
-
+
//鏈�鏂板彂璐ф棩鏈熷彉鏇�
- cate2Change(event){
+ cate2Change(event) {
this.cate2 = event.detail.value;
}
-
+
//妫�绱�
- search(){
+ search() {
this.showSpinner = true;
searchConsumableorderdetails({
- category1Str:this.category1,
- cate2Str:this.cate2,
- accountidStr:this.accountId,
- userWorkLocationStr:this.userWorkLocation,
- agencyProTypeStr:this.agencyProType})
- .then(result=>{
+ category1Str: this.category1,
+ cate2Str: this.cate2,
+ accountidStr: this.accountId,
+ userWorkLocationStr: this.userWorkLocation,
+ agencyProTypeStr: this.agencyProType
+ }).then((result) => {
this.showSpinner = false;
- if(result.result == 'Success'){
+ 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});
- if(this.raesList.length > 1){
+ 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');
- }else{
- this.showMyToast('鏈悳绱㈠埌鏁版嵁','','error');
+ this.showMyToast(
+ '鎼滅储鎴愬姛',
+ '鍏辨悳绱㈠埌' + count + '鏉℃暟鎹�',
+ 'success'
+ );
+ } else {
+ this.showMyToast('鏈悳绱㈠埌鏁版嵁', '', 'error');
}
- }else{
- this.showMyToast('鎼滅储澶辫触',result.errorMsg,'error');
+ } else {
+ this.showMyToast('鎼滅储澶辫触', result.errorMsg, 'error');
}
- })
+ });
}
-
+
//娓呯┖鎼滅储妗�
- clear(){
+ clear() {
this.showSpinner = true;
this.category1 = '';
this.cate2 = null;
searchConsumableorderdetails({
- category1Str:this.category1,
- cate2Str:this.cate2,
- accountidStr:this.accountId,
- userWorkLocationStr:this.userWorkLocation,
- agencyProTypeStr:this.agencyProType})
- .then(result=>{
+ category1Str: this.category1,
+ cate2Str: this.cate2,
+ accountidStr: this.accountId,
+ userWorkLocationStr: this.userWorkLocation,
+ agencyProTypeStr: this.agencyProType
+ }).then((result) => {
this.showSpinner = false;
- if(result.result == 'Success'){
+ 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});
- if(this.raesList.length > 1){
+ 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');
- }else{
- this.showMyToast('鏈悳绱㈠埌鏁版嵁','','error');
+ this.showMyToast(
+ '鎼滅储鎴愬姛',
+ '鍏辨悳绱㈠埌' + count + '鏉℃暟鎹�',
+ 'success'
+ );
+ } else {
+ this.showMyToast('鏈悳绱㈠埌鏁版嵁', '', 'error');
}
- }else{
- this.showMyToast('鎼滅储澶辫触',result.errorMsg,'error');
+ } else {
+ this.showMyToast('鎼滅储澶辫触', result.errorMsg, 'error');
}
- })
+ });
}
//鍏ュ簱
- orderArrive(){
+ orderArrive() {
const config = {
type: 'standard__webPage',
attributes: {
- url: '/lexarrivegoods?ArrType=Arr'
+ url: '/lexarrivegoods?ArrType=Arr'
}
};
this[NavigationMixin.Navigate](config);
}
-
+
//杩斿搧
- orderReturn(){
+ orderReturn() {
const config = {
type: 'standard__webPage',
attributes: {
- url: '/lexarrivegoods?ArrType=ReG'
+ url: '/lexarrivegoods?ArrType=ReG'
}
};
this[NavigationMixin.Navigate](config);
@@ -388,18 +494,24 @@
console.log('show custom message');
var iconName = '';
var content = '';
- if(variant == 'success'){
- iconName = 'utility:check';
- }else{
- iconName = 'utility:error';
+ if (variant == 'success') {
+ iconName = 'utility:check';
+ } else {
+ iconName = 'utility:error';
}
- if(message != ''){
- content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
- }else{
- content = '<h2><strong>'+title+'<strong/></h2>';
+ if (message != '') {
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
+ } else {
+ content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template.querySelector('c-common-toast').
- showToast(variant,content,iconName,10000);
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
// var mode;
// if(this.isNoteStay){
// mode ='sticky';
@@ -413,5 +525,5 @@
// mode: mode
// });
// this.dispatchEvent(evt);
- }
+ }
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.html b/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.html
index e83098a..64fd2e0 100644
--- a/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.html
+++ b/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.html
@@ -2,7 +2,10 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
+ <div
+ role="status"
+ class="slds-spinner slds-spinner_medium slds-spinner_brand"
+ >
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -11,8 +14,14 @@
</template>
<c-common-toast></c-common-toast>
<template if:true={showPage}>
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ "
+ >
+ <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -22,14 +31,29 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>鍒拌揣</strong></p> -->
</div>
- <div style="padding:10px;">
+ <div style="padding: 10px">
<!-- 鎸夐挳 -->
<!-- <lightning-button style="margin: 5px;" label="鍑哄簱" onclick={proSale} disabled={arrivetoorder}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="鍑哄簱" onclick={proSale} disabled={arrivetoorder}>鍑哄簱</button>
- <p style="height: 10px;"></p>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ style="margin: 5px"
+ label="鍑哄簱"
+ onclick={proSale}
+ disabled={arrivetoorder}
+ >
+ 鍑哄簱
+ </button>
+ <p style="height: 10px"></p>
<!-- 鍒拌揣璁㈠崟淇℃伅 -->
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -39,34 +63,77 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>鍒拌揣璁㈠崟淇℃伅</strong></p> -->
</div>
- <div style="padding:10px;">
+ <div style="padding: 10px">
<table>
<tbody>
<tr>
- <td style="width:10px;"></td>
- <td style="width:140px;">
- <div style="color:#696969;font-size:16px;">鍒拌揣璁㈠崟鍚嶇О</div>
+ <td style="width: 10px"></td>
+ <td style="width: 140px">
+ <div
+ style="
+ color: #696969;
+ font-size: 16px;
+ "
+ >
+ 鍒拌揣璁㈠崟鍚嶇О
+ </div>
</td>
- <td style="width:200px;">
- <lightning-formatted-text style="font-size: 16px;" value={coc.Name}></lightning-formatted-text>
+ <td style="width: 200px">
+ <lightning-formatted-text
+ style="font-size: 16px"
+ value={coc.Name}
+ ></lightning-formatted-text>
</td>
- <td style="width:30px;"></td>
- <td style="width:140px;">
- <div style="color:#696969;font-size:16px;">鏈鍏ュ簱浜у搧閲戦</div>
+ <td style="width: 30px"></td>
+ <td style="width: 140px">
+ <div
+ style="
+ color: #696969;
+ font-size: 16px;
+ "
+ >
+ 鏈鍏ュ簱浜у搧閲戦
+ </div>
</td>
- <td style="width:100px;">
- <lightning-formatted-number style="font-size: 16px;" value={coc.Arrive_total_amount__c} minimum-fraction-digits="2"></lightning-formatted-number>
+ <td style="width: 100px">
+ <lightning-formatted-number
+ style="font-size: 16px"
+ value={coc.Arrive_total_amount__c}
+ minimum-fraction-digits="2"
+ ></lightning-formatted-number>
</td>
<td></td>
</tr>
- <tr style="height: 20px;"></tr>
+ <tr style="height: 20px"></tr>
<tr>
- <td style="width:10px;"></td>
- <td style="width:120px;">
- <div style="color:#696969;font-size:16px;">娑堣�楀搧璁㈠崟鍚嶇О<lightning-helptext style="--lwc-spacingXxSmall:0px;" content={label.helpText}></lightning-helptext></div>
+ <td style="width: 10px"></td>
+ <td style="width: 120px">
+ <div
+ style="
+ color: #696969;
+ font-size: 16px;
+ "
+ >
+ 娑堣�楀搧璁㈠崟鍚嶇О<lightning-helptext
+ style="
+ --lwc-spacingXxSmall: 0px;
+ "
+ content={label.helpText}
+ ></lightning-helptext>
+ </div>
</td>
- <td style="width:200px;">
- <a style="text-decoration: underline;color:black;" onclick={clickOrder}><lightning-formatted-text style="font-size: 16px;" value={coc.arriveOrder}></lightning-formatted-text></a>
+ <td style="width: 200px">
+ <a
+ style="
+ text-decoration: underline;
+ color: black;
+ "
+ onclick={clickOrder}
+ ><lightning-formatted-text
+ style="font-size: 16px"
+ value={coc.arriveOrder}
+ ></lightning-formatted-text
+ ></a>
<!-- <lightning-formatted-text value={coc.Arrive_Order__r.Name}></lightning-formatted-text> -->
</td>
<td></td>
@@ -76,8 +143,15 @@
</div>
</div>
<!-- 鍦ㄥ簱鍟嗗搧搴撳瓨涓�瑙� -->
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -87,8 +161,15 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>鍦ㄥ簱鍟嗗搧搴撳瓨涓�瑙�</strong></p> -->
</div>
- <div style="padding:10px;">
- <lightning-datatable class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all;" hide-checkbox-column key-field="recordId" columns={colms} data={consumableorderdetailsRecords}></lightning-datatable>
+ <div style="padding: 10px">
+ <lightning-datatable
+ class="wrapped-header-datatable"
+ style="word-wrap: break-word; word-break: break-all"
+ hide-checkbox-column
+ key-field="recordId"
+ columns={colms}
+ data={consumableorderdetailsRecords}
+ ></lightning-datatable>
</div>
</div>
</div>
diff --git a/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js b/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js
index 30c135b..20bef77 100644
--- a/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js
+++ b/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js
@@ -1,16 +1,17 @@
-import { LightningElement,wire,track } from 'lwc';
+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/LexArriveGsDetailsController.init';
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";
+//table css
+import { loadStyle } from 'lightning/platformResourceLoader';
+import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
-export default class LexArriveGsDetails extends NavigationMixin(LightningElement) {
-
+export default class LexArriveGsDetails extends NavigationMixin(
+ LightningElement
+) {
@track eSetId;
@track showSpinner = true;
@track showPage = false;
@@ -24,16 +25,67 @@
//鏄惁涓�鐩存樉绀烘彁绀�
@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};
+ label = { helpText };
// 鑾峰彇鍙傛暟
@wire(CurrentPageReference)
@@ -41,107 +93,145 @@
if (currentPageReference) {
this.eSetId = currentPageReference.state?.EsetId;
}
- console.log('CurrentPageReference:'+this.eSetId);
+ console.log('CurrentPageReference:' + this.eSetId);
}
- renderedCallback(){
+ 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(){
- init({eSetIdStr : this.eSetId})
- .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 != ''){
- 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;
- 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;
+ connectedCallback() {
+ init({ eSetIdStr: this.eSetId })
+ .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 != ''
+ ) {
+ 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;
+ 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]['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]['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);
+ 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);
+ this.showMyToast('鍒濆鍖栧け璐�', result.errorMsg, 'error');
}
+ })
+ .catch((error) => {
this.showSpinner = false;
- }else {
- this.showSpinner = false;
- console.log("error:"+result.errorMsg);
- this.showMyToast('鍒濆鍖栧け璐�',result.errorMsg,'error');
- }
- })
- .catch(error=>{
- this.showSpinner = false;
- this.showPage = true;
- console.log("error:"+error);
- this.showMyToast('鍒濆鍖栧け璐�',error,'error');
- })
+ this.showPage = true;
+ console.log('error:' + error);
+ this.showMyToast('鍒濆鍖栧け璐�', error, 'error');
+ });
}
- proSale(){
+ proSale() {
this.showSpinner = true;
proSale({
- cocStr : JSON.stringify(this.coc),
- orderallcountParm : this.orderallcount,
- consumableorderdetailsCountParm : this.consumableorderdetailsCount,
- eSetIdStr : this.eSetId
+ cocStr: JSON.stringify(this.coc),
+ orderallcountParm: this.orderallcount,
+ consumableorderdetailsCountParm: this.consumableorderdetailsCount,
+ eSetIdStr: this.eSetId
})
- .then(result=>{
- if(result.result == 'Success'){
- var url = result.url;
- const config = {
- type: 'standard__webPage',
- attributes: {
- url: url
- }
- };
- this[NavigationMixin.Navigate](config);
- }else {
+ .then((result) => {
+ if (result.result == 'Success') {
+ var url = result.url;
+ const config = {
+ type: 'standard__webPage',
+ attributes: {
+ url: url
+ }
+ };
+ this[NavigationMixin.Navigate](config);
+ } else {
+ this.showSpinner = false;
+ console.log('error:' + result.errorMsg);
+ this.showMyToast('鍑哄簱澶辫触', result.errorMsg, 'error');
+ }
+ })
+ .catch((error) => {
+ this.showPage = true;
this.showSpinner = false;
- console.log("error:"+result.errorMsg);
- this.showMyToast('鍑哄簱澶辫触',result.errorMsg,'error');
- }
- })
- .catch(error=>{
- this.showPage = true;
- this.showSpinner = false;
- console.log("error:"+error);
- this.showMyToast('鍑哄簱澶辫触',error,'error');
- })
+ console.log('error:' + error);
+ this.showMyToast('鍑哄簱澶辫触', error, 'error');
+ });
}
- clickOrder(){
- if(this.coc.Arrive_Order__c != null && this.coc.Arrive_Order__c != ''){
+ clickOrder() {
+ if (
+ this.coc.Arrive_Order__c != null &&
+ this.coc.Arrive_Order__c != ''
+ ) {
const config = {
type: 'standard__webPage',
attributes: {
- url: '/detail/'+this.coc.Arrive_Order__c
+ url: '/detail/' + this.coc.Arrive_Order__c
}
};
this[NavigationMixin.Navigate](config);
@@ -152,18 +242,24 @@
console.log('show custom message');
var iconName = '';
var content = '';
- if(variant == 'success'){
- iconName = 'utility:check';
- }else{
- iconName = 'utility:error';
+ if (variant == 'success') {
+ iconName = 'utility:check';
+ } else {
+ iconName = 'utility:error';
}
- if(message != ''){
- content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
- }else{
- content = '<h2><strong>'+title+'<strong/></h2>';
+ if (message != '') {
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
+ } else {
+ content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template.querySelector('c-common-toast').
- showToast(variant,content,iconName,10000);
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
// var mode;
// if(this.isNoteStay){
// mode ='sticky';
@@ -177,5 +273,5 @@
// mode: mode
// });
// this.dispatchEvent(evt);
- }
+ }
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html b/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html
index 60898fb..7b3b455 100644
--- a/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html
+++ b/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html
@@ -1,138 +1,227 @@
<template>
- <template if:true={showSpinner}>
- <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
- <div class="slds-spinner_container">
- <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
- <span class="slds-assistive-text">Loading</span>
- <div class="slds-spinner__dot-a"></div>
- <div class="slds-spinner__dot-b"></div>
- </div>
- </div>
- </template>
- <c-common-toast></c-common-toast>
- <div style="border: 1px solid #D4D4D4;border-radius:5px;">
+ <template if:true={showSpinner}>
+ <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
+ <div class="slds-spinner_container">
+ <div
+ role="status"
+ class="slds-spinner slds-spinner_medium slds-spinner_brand"
+ >
+ <span class="slds-assistive-text">Loading</span>
+ <div class="slds-spinner__dot-a"></div>
+ <div class="slds-spinner__dot-b"></div>
+ </div>
+ </div>
+ </template>
+ <c-common-toast></c-common-toast>
+ <div style="border: 1px solid #d4d4d4; border-radius: 5px">
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
+ <div>
+ <!-- <p style="font-size: 18px;"><strong>鍙栨秷鎷嗙洅</strong></p> -->
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>鍙栨秷鎷嗙洅</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </div>
+ </div>
+ <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>
+ </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;
+ "
+ >
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 16px">
+ <strong>BarCode褰曞叆</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </div>
- <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>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>鍙栨秷鎷嗙洅</strong>
- </p>
- </lightning-layout-item>
- </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;">
- <!-- <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>
- </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;">
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 16px">
- <strong>BarCode褰曞叆</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </div>
-
- <!-- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;"> -->
- <table>
- <colgroup>
- <col width="160px" />
- <col width="100px" />
- <col width="10px" />
- <col width="70px" />
- <col width="100px" />
- <col width="10px" />
- <col width="90px" />
- <col width="100px" />
- <col width="10px" />
- <col width="85px" />
- <col width="100px" />
- <col width="10px" />
- <col width="70px" />
- <col width="100px" />
- </colgroup>
- <tbody>
- <tr>
- <td></td>
- <td align="right" class="searchName">BarCode</td>
- <td style="width:600px"><lightning-textarea class="inputFont" name="BarCode" label=""
- onchange={handleChange}></lightning-textarea></td>
- <td align="right"></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>
- <!-- <lightning-button variant="brand" class='lexstyle' label="鑾峰彇鏄庣粏" title="鑾峰彇鏄庣粏" onclick={getDetails}
- ></lightning-button> -->
- </td>
- </tr>
- </tbody>
- </table>
- <!-- </div> -->
- </div>
+ <!-- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;"> -->
+ <table>
+ <colgroup>
+ <col width="160px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="70px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="90px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="85px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="70px" />
+ <col width="100px" />
+ </colgroup>
+ <tbody>
+ <tr>
+ <td></td>
+ <td align="right" class="searchName">BarCode</td>
+ <td style="width: 600px">
+ <lightning-textarea
+ class="inputFont"
+ name="BarCode"
+ label=""
+ onchange={handleChange}
+ ></lightning-textarea>
+ </td>
+ <td align="right"></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>
+ <!-- <lightning-button variant="brand" class='lexstyle' label="鑾峰彇鏄庣粏" title="鑾峰彇鏄庣粏" onclick={getDetails}
+ ></lightning-button> -->
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <!-- </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;">
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>鍙栨秷鎷嗙洅鏄庣粏</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </div>
- <div style="padding:10px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>鍙栨秷鎷嗙洅鏄庣粏</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </div>
+ <div style="padding: 10px">
+ <!-- <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>
+ <!-- </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;
+ "
+ >
+ <table>
+ <tr>
+ <td>
+ <lightning-layout>
+ <lightning-layout-item
+ padding="around-small"
+ >
+ <p style="font-size: 18px">
+ <strong>閿欒鏄庣粏</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </td>
+ </tr>
+ </table>
+ </div>
- <!-- <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>
- <!-- </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;">
- <table>
- <tr>
- <td>
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>閿欒鏄庣粏</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </td>
- </tr>
- </table>
- </div>
-
- <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; ">
- </lightning-datatable>
-
-
- </div>
- </div>
- </div>
-
-
-
- </div>
-
+ <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"
+ >
+ </lightning-datatable>
+ </div>
+ </div>
+ </div>
+ </div>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js b/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js
index 41e3760..49f7f59 100644
--- a/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js
+++ b/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js
@@ -1,84 +1,76 @@
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";
+//table css
+import { loadStyle } from 'lightning/platformResourceLoader';
+import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
const columns = [
{
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'Name__c',
- hideDefaultActions: true,
- wrapText:true
- // initialWidth: 350,
-
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'Name__c',
+ hideDefaultActions: true,
+ wrapText: true
+ // initialWidth: 350,
},
{
- label: '瑙勬牸',
- fieldName: 'ProductPacking_list_manual__c',
- hideDefaultActions: true,
- cellAttributes: { alignment: "right" },
- initialWidth: 50,
-
+ label: '瑙勬牸',
+ fieldName: 'ProductPacking_list_manual__c',
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'right' },
+ initialWidth: 50
},
{
- label: 'CFDA鐘舵��',
- fieldName: 'CFDA_Status__c',
- hideDefaultActions: true,
- initialWidth: 100,
- wrapText:true
-
+ label: 'CFDA鐘舵��',
+ fieldName: 'CFDA_Status__c',
+ hideDefaultActions: true,
+ initialWidth: 100,
+ wrapText: true
},
{
- label: '娉ㄥ唽璇佺紪鐮佸彿',
- fieldName: 'Report_Product_Approbation__c',
- hideDefaultActions: true,
- initialWidth: 200,
- wrapText:true
+ label: '娉ㄥ唽璇佺紪鐮佸彿',
+ fieldName: 'Report_Product_Approbation__c',
+ hideDefaultActions: true,
+ initialWidth: 200,
+ wrapText: true
},
{
- label: '娉ㄥ唽璇佹晥鏈�',
- fieldName: 'Report_Product_Expiration__c',
- hideDefaultActions: true,
- initialWidth: 110,
- wrapText:true
+ label: '娉ㄥ唽璇佹晥鏈�',
+ fieldName: 'Report_Product_Expiration__c',
+ hideDefaultActions: true,
+ initialWidth: 110,
+ wrapText: true
},
{
- label: 'BarCode',
- fieldName: 'Bar_Code__c',
- hideDefaultActions: true,
- wrapText:true
+ label: 'BarCode',
+ fieldName: 'Bar_Code__c',
+ hideDefaultActions: true,
+ wrapText: true
}
- ];
-
- const column = [
- {
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'Name__c',
- hideDefaultActions: true,
- wrapText:true
-
- },
- {
- label: 'BarCode',
- fieldName: 'Bar_Code__c',
- wrapText:true,
- hideDefaultActions: true,
- // initialWidth:600
+];
-
- }
- ,
+const column = [
{
- label: '閿欒鍘熷洜',
- fieldName: 'ErrorReason',
- hideDefaultActions: true,
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'Name__c',
+ hideDefaultActions: true,
+ wrapText: true
+ },
+ {
+ label: 'BarCode',
+ fieldName: 'Bar_Code__c',
+ wrapText: true,
+ hideDefaultActions: true
+ // initialWidth:600
+ },
+ {
+ label: '閿欒鍘熷洜',
+ fieldName: 'ErrorReason',
+ hideDefaultActions: true
}
- ];
-
+];
export default class LexCancelRemoveBox extends LightningElement {
columns = columns;
@@ -86,164 +78,175 @@
@track selectedRows = [];
@track data = [];
@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");
- this.stylesLoaded = true;
- })
- .catch((error) => {
- console.error("Error loading custom styles");
- });
- }
- }
-
-
-
+ if (!this.stylesLoaded) {
+ Promise.all([loadStyle(this, WrappedHeaderTable)])
+ .then(() => {
+ console.log('Custom styles loaded');
+ this.stylesLoaded = true;
+ })
+ .catch((error) => {
+ console.error('Error loading custom styles');
+ });
+ }
+ }
connectedCallback() {
- console.log('鍒濆鍖�');
- // this.showTable = false;
- oninit().then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result =' + JSON.stringify(result));
- if (result.status = 'Success') {
- console.log('result');
- this.agencyProType = result.entity.agencyProType;
- this.userWorkLocation = result.entity.userWorkLocation;
- this.accountName = result.entity.accountName;
- // this.data = JSON.parse(result.entity.codPageRecords);
- // this.showTable = true;
- } else {
- this.showMyToast('鍒濆鍖栧け璐�',result.msg,'error');
- }
- }).catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- });
+ console.log('鍒濆鍖�');
+ // this.showTable = false;
+ oninit()
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result =' + JSON.stringify(result));
+ if ((result.status = 'Success')) {
+ console.log('result');
+ this.agencyProType = result.entity.agencyProType;
+ this.userWorkLocation = result.entity.userWorkLocation;
+ this.accountName = result.entity.accountName;
+ // this.data = JSON.parse(result.entity.codPageRecords);
+ // this.showTable = true;
+ } else {
+ this.showMyToast('鍒濆鍖栧け璐�', result.msg, 'error');
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ });
}
//褰曞叆
- getDetails() {
- this.showSpinner = true;
- searchDeatail({
- accountName: this.accountName,
- userWorkLocation: this.userWorkLocation,
- agencyProType: this.agencyProType,
- barcode: this.barcode
- }).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.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.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.showTables = true;
- this.showSpinner = false;
- } else{
- this.showMyToast('鑾峰彇澶辫触',result.msg,'error');
- this.showSpinner = false;
- }
- }).catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- });
+ getDetails() {
+ this.showSpinner = true;
+ searchDeatail({
+ accountName: this.accountName,
+ userWorkLocation: this.userWorkLocation,
+ agencyProType: this.agencyProType,
+ barcode: this.barcode
+ })
+ .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.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.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.showTables = true;
+ this.showSpinner = false;
+ } else {
+ this.showMyToast('鑾峰彇澶辫触', result.msg, 'error');
+ this.showSpinner = false;
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ });
+ }
+ //鑾峰彇褰撳墠杈撳叆鍊�
+ handleChange(event) {
+ let value = event.detail.value;
+ console.log('value' + value);
+ this.barcode = value;
+ console.log('this.barcode' + this.barcode);
+ }
- }
- //鑾峰彇褰撳墠杈撳叆鍊�
- handleChange(event) {
- let value = event.detail.value;
- console.log('value' + value);
- this.barcode = value;
- console.log('this.barcode' + this.barcode);
- }
-
-
- saveConfirm() {
- let msg = "纭鍙栨秷鎷嗙洅鍚�";
- if (this.dataSize>0) {
- if (confirm(msg) == true) {
+ saveConfirm() {
+ let msg = '纭鍙栨秷鎷嗙洅鍚�';
+ if (this.dataSize > 0) {
+ if (confirm(msg) == true) {
+ this.CancelRemoveBox();
+ }
+ } else {
this.CancelRemoveBox();
}
- } else {
- this.CancelRemoveBox();
}
- }
- CancelRemoveBox(){
- this.showSpinner = true;
- saveConfirm({
- saveConsumableorderdetailsRecordsdummy: JSON.stringify(this.data),
- accountName: this.accountName,
- userWorkLocation: this.userWorkLocation,
- agencyProType: this.agencyProType
- }).then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result淇濆瓨 = ' + JSON.stringify(result));
- if (result.status == 'Success') {
- this.saveFLGbln = result.entity.saveFLGbln;
- // this.showSpinner = false;
- if(this.saveFLGbln){
- this.showMyToast(result.msg,'','success');
- this.showSpinner = false;
-
-
- }
- } else {
- this.showMyToast('鍙栨秷鎷嗙洅澶辫触',result.msg,'error');
- this.showSpinner = false;
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- });
-
- }
- showMyToast(title, message, variant) {
- console.log('show custom message');
- var iconName = '';
- var content = '';
- if(variant == 'success'){
- iconName = 'utility:check';
- }else{
- iconName = 'utility:error';
+ CancelRemoveBox() {
+ this.showSpinner = true;
+ saveConfirm({
+ saveConsumableorderdetailsRecordsdummy: JSON.stringify(this.data),
+ accountName: this.accountName,
+ userWorkLocation: this.userWorkLocation,
+ agencyProType: this.agencyProType
+ })
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result淇濆瓨 = ' + JSON.stringify(result));
+ if (result.status == 'Success') {
+ this.saveFLGbln = result.entity.saveFLGbln;
+ // this.showSpinner = false;
+ if (this.saveFLGbln) {
+ this.showMyToast(result.msg, '', 'success');
+ this.showSpinner = false;
+ }
+ } else {
+ this.showMyToast('鍙栨秷鎷嗙洅澶辫触', result.msg, 'error');
+ this.showSpinner = false;
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ });
}
- if(message != ''){
- content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
- }else{
- content = '<h2><strong>'+title+'<strong/></h2>';
+ showMyToast(title, message, variant) {
+ console.log('show custom message');
+ var iconName = '';
+ var content = '';
+ if (variant == 'success') {
+ iconName = 'utility:check';
+ } else {
+ iconName = 'utility:error';
+ }
+ if (message != '') {
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
+ } else {
+ content = '<h2><strong>' + title + '<strong/></h2>';
+ }
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
}
- this.template.querySelector('c-common-toast').showToast(variant,content,iconName,10000);
- }
-
-
-
-
-
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html
index 4406470..8e12258 100644
--- a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html
+++ b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html
@@ -3,55 +3,122 @@
<template>
<c-common-toast></c-common-toast>
<template if:true={isShowSpinner}>
- <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
-聽 聽 聽 聽 聽 聽 聽 聽 <span class="slds-assistive-text">Loading</span>
-聽 聽 聽 聽 聽 聽 聽 聽 <div class="slds-spinner__dot-a"></div>
-聽 聽 聽 聽 聽 聽 聽 聽 <div class="slds-spinner__dot-b"></div>
-聽 聽 聽 聽 </div>
+ <div
+ role="status"
+ class="slds-spinner slds-spinner_medium slds-spinner_brand"
+ >
+ 聽 聽 聽 聽 聽 聽 聽 聽 <span class="slds-assistive-text">Loading</span> 聽 聽
+ 聽 聽 聽 聽 聽 聽
+ <div class="slds-spinner__dot-a"></div>
+ 聽 聽 聽 聽 聽 聽 聽 聽
+ <div class="slds-spinner__dot-b"></div>
+ 聽 聽 聽 聽
+ </div>
</template>
-
<template if:false={isDetailsShow}>
<template if:false={isConInvoiceList}>
<!-- 鎼滅储瀹㈡埛鍚� -->
<template if:true={isModalOpen}>
- <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true"
- aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_medium"
- style="border: 1px solid #D4D4D4;">
+ <section
+ role="dialog"
+ tabindex="-1"
+ aria-labelledby="modal-heading-01"
+ aria-modal="true"
+ aria-describedby="modal-content-id-1"
+ class="slds-modal slds-fade-in-open slds-modal_medium"
+ style="border: 1px solid #d4d4d4"
+ >
<div class="slds-modal__container">
- <header class="slds-modal__header" style="background-color: #F3F3F3;">
- <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
- title="Close" onclick={closeModal}>
- <lightning-icon icon-name="utility:close" alternative-text="close" variant="inverse"
- size="small"></lightning-icon>
+ <header
+ class="slds-modal__header"
+ style="background-color: #f3f3f3"
+ >
+ <button
+ style=""
+ class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
+ title="Close"
+ onclick={closeModal}
+ >
+ <lightning-icon
+ icon-name="utility:close"
+ alternative-text="close"
+ variant="inverse"
+ size="small"
+ ></lightning-icon>
<span class="slds-assistive-text">Close</span>
</button>
- <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">缁忛攢鍟嗗尰闄㈡绱�</h2>
+ <h2
+ id="modal-heading-01"
+ class="slds-text-heading_medium slds-hyphenate"
+ >
+ 缁忛攢鍟嗗尰闄㈡绱�
+ </h2>
</header>
- <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1"
- style="border: 1px solid #F3F3F3;">
- <table style="width: 100%;">
+ <div
+ class="slds-modal__content slds-p-around_medium"
+ id="modal-content-id-1"
+ style="border: 1px solid #f3f3f3"
+ >
+ <table style="width: 100%">
<tbody>
<tr>
- <td style="width: 74px;">
- <div style="color:#696969;font-size:16px;text-align: left;">鍖婚櫌鍚嶇О</div>
+ <td style="width: 74px">
+ <div
+ style="
+ color: #696969;
+ font-size: 16px;
+ text-align: left;
+ "
+ >
+ 鍖婚櫌鍚嶇О
+ </div>
</td>
- <td style="width: 60%;"><lightning-input class="inputFont" label="鍖婚櫌鍚嶇О"
- variant="label-hidden" placeholder="璇疯緭鍏ュ尰闄㈠悕绉�" value={searchHospitalName}
- data-field="searchHospitalName" onchange={dataChange}></lightning-input></td>
- <td style="width: 10px;"></td>
- <td><button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- style="height: 32px;" label="鎼滅储" onclick={searchHospital}>鎼滅储</button></td>
+ <td style="width: 60%">
+ <lightning-input
+ class="inputFont"
+ label="鍖婚櫌鍚嶇О"
+ variant="label-hidden"
+ placeholder="璇疯緭鍏ュ尰闄㈠悕绉�"
+ value={searchHospitalName}
+ data-field="searchHospitalName"
+ onchange={dataChange}
+ ></lightning-input>
+ </td>
+ <td style="width: 10px"></td>
+ <td>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
+ style="height: 32px"
+ label="鎼滅储"
+ onclick={searchHospital}
+ >
+ 鎼滅储
+ </button>
+ </td>
</tr>
</tbody>
</table>
- <p style="height: 20px;"></p>
+ <p style="height: 20px"></p>
<!-- <p>宸查�夋嫨鍖婚櫌锛歿chooseHospital}</p> -->
<div
- style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div
+ style="
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
<lightning-layout>
- <lightning-layout-item padding="around-small">
+ <lightning-layout-item
+ padding="around-small"
+ >
<p style="font-size: 18px">
<strong>鎼滅储缁撴灉</strong>
</p>
@@ -59,109 +126,199 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>鎼滅储缁撴灉</strong></p> -->
</div>
- <div class="myTable" style="padding:10px;">
+ <div class="myTable" style="padding: 10px">
<!-- <lightning-datatable class="wrapped-header-datatable" key-field="id"
hide-checkbox-column="true" data={hospitalList} columns={hosCols}
onrowaction={chooseHos}></lightning-datatable> -->
- <lightning-datatable class="datatabel slds-border_top wrapped-header-datatable"
- key-field="id" data={hospitalList} columns={hospitalColumns} hide-checkbox-column="true"
- onrowaction={searchHandleRowAction}>
+ <lightning-datatable
+ class="datatabel slds-border_top wrapped-header-datatable"
+ key-field="id"
+ data={hospitalList}
+ columns={hospitalColumns}
+ hide-checkbox-column="true"
+ onrowaction={searchHandleRowAction}
+ >
</lightning-datatable>
</div>
</div>
</div>
<footer class="slds-modal__footer">
- <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" label="鍙栨秷"
- onclick={closeModal}>鍙栨秷</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
+ label="鍙栨秷"
+ onclick={closeModal}
+ >
+ 鍙栨秷
+ </button>
</footer>
</div>
</section>
<div class="slds-backdrop slds-backdrop_open"></div>
</template>
<div class="outerBorderCss">
- <div style="padding:5px;">
-
+ <div style="padding: 5px">
<div class="borderCss">
- <div style="padding:10px;">
+ <div style="padding: 10px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
<template if:false={EditAble}>
<lightning-layout multiple-rows="true">
- <lightning-layout-item size="2"></lightning-layout-item>
+ <lightning-layout-item
+ size="2"
+ ></lightning-layout-item>
<lightning-layout-item size="10">
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={SetEditAbleJs} disabled={isDisabledEdit}
- style="width: 150px;">缂栬緫</button>
+ onclick={SetEditAbleJs}
+ disabled={isDisabledEdit}
+ style="width: 150px"
+ >
+ 缂栬緫
+ </button>
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder buttonminMarginLeft"
- onclick={approvalJs} disabled={isDisabledEdit}
- style="width: 150px;">鎻愪氦</button>
+ onclick={approvalJs}
+ disabled={isDisabledEdit}
+ style="width: 150px"
+ >
+ 鎻愪氦
+ </button>
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder buttonminMarginLeft"
- onclick={openReportJs} disabled={isOpenReportDisabled}
- style="width: 150px;">鏄剧ず鏄庣粏</button>
+ onclick={openReportJs}
+ disabled={isOpenReportDisabled}
+ style="width: 150px"
+ >
+ 鏄剧ず鏄庣粏
+ </button>
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder buttonminMarginLeft"
- onclick={reopenJs} disabled={isDisabledReopen}
- style="width: 150px;">浣滃簾閲嶅紑</button>
+ onclick={reopenJs}
+ disabled={isDisabledReopen}
+ style="width: 150px"
+ >
+ 浣滃簾閲嶅紑
+ </button>
</lightning-layout-item>
</lightning-layout>
- <lightning-layout multiple-rows="true" style="margin-top: 20px;">
- <lightning-layout-item size="2"></lightning-layout-item>
+ <lightning-layout
+ multiple-rows="true"
+ style="margin-top: 20px"
+ >
+ <lightning-layout-item
+ size="2"
+ ></lightning-layout-item>
<lightning-layout-item size="10">
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={deleteButtonJs} disabled={isDisabledDelete}
- style="width: 150px;">鍒犻櫎</button>
+ onclick={deleteButtonJs}
+ disabled={isDisabledDelete}
+ style="width: 150px"
+ >
+ 鍒犻櫎
+ </button>
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder buttonminMarginLeft"
- disabled={isDisabledReopen} onclick={uploadOrder}
- style="width: 150px;">涓婁紶闄勪欢</button>
+ disabled={isDisabledReopen}
+ onclick={uploadOrder}
+ style="width: 150px"
+ >
+ 涓婁紶闄勪欢
+ </button>
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder buttonminMarginLeft"
- onclick={saveAttachmentJs} disabled={isDisabledReopen}
- style="width: 150px;">淇濆瓨闄勪欢</button>
+ onclick={saveAttachmentJs}
+ disabled={isDisabledReopen}
+ style="width: 150px"
+ >
+ 淇濆瓨闄勪欢
+ </button>
</lightning-layout-item>
</lightning-layout>
</template>
<!-- 涓婁紶闄勪欢寮圭獥 -->
<template if:true={showAttPop}>
- <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-02"
- aria-modal="true" aria-describedby="modal-content-id-2"
+ <section
+ role="dialog"
+ tabindex="-1"
+ aria-labelledby="modal-heading-02"
+ aria-modal="true"
+ aria-describedby="modal-content-id-2"
class="slds-modal slds-fade-in-open slds-modal_small"
- style="border: 1px solid #D4D4D4;">
+ style="border: 1px solid #d4d4d4"
+ >
<template if:true={showPopSpinner}>
- <lightning-spinner size="medium" variant="brand"></lightning-spinner>
+ <lightning-spinner
+ size="medium"
+ variant="brand"
+ ></lightning-spinner>
</template>
<div class="slds-modal__container">
- <header class="slds-modal__header" style="background-color: #F3F3F3;">
- <button style=""
+ <header
+ class="slds-modal__header"
+ style="
+ background-color: #f3f3f3;
+ "
+ >
+ <button
+ style=""
class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
- title="Close" onclick={closePop}>
- <lightning-icon icon-name="utility:close" alternative-text="close"
- variant="inverse" size="small"></lightning-icon>
- <span class="slds-assistive-text">Close</span>
+ title="Close"
+ onclick={closePop}
+ >
+ <lightning-icon
+ icon-name="utility:close"
+ alternative-text="close"
+ variant="inverse"
+ size="small"
+ ></lightning-icon>
+ <span
+ class="slds-assistive-text"
+ >Close</span
+ >
</button>
- <h2 id="modal-heading-02"
- class="slds-text-heading_medium slds-hyphenate">涓婁紶闄勪欢</h2>
+ <h2
+ id="modal-heading-02"
+ class="slds-text-heading_medium slds-hyphenate"
+ >
+ 涓婁紶闄勪欢
+ </h2>
</header>
- <div class="slds-modal__content slds-p-around_medium searchName"
- id="modal-content-id-2" style="border: 1px solid #F3F3F3;">
- <div class="slds-m-top_medium slds-m-bottom_x-large">
- <div class="slds-p-around_medium lgc-bg">
- <lightning-input class="fileUpload" type="file" label="闄勪欢涓婁紶"
+ <div
+ class="slds-modal__content slds-p-around_medium searchName"
+ id="modal-content-id-2"
+ style="
+ border: 1px solid #f3f3f3;
+ "
+ >
+ <div
+ class="slds-m-top_medium slds-m-bottom_x-large"
+ >
+ <div
+ class="slds-p-around_medium lgc-bg"
+ >
+ <lightning-input
+ class="fileUpload"
+ type="file"
+ label="闄勪欢涓婁紶"
accept=".xlsx, .xls, .csv, .png, .doc, .docx, .pdf"
- onchange={attChange}></lightning-input>
+ onchange={attChange}
+ ></lightning-input>
</div>
- <p class="fontWeight">宸查�夋嫨鏂囦欢锛歿fileName}
+ <p class="fontWeight">
+ 宸查�夋嫨鏂囦欢锛歿fileName}
- <template if:true={attDelBtn}>
- <a onclick={removeAtt}>绉婚櫎</a>
+ <template
+ if:true={attDelBtn}
+ >
+ <a
+ onclick={removeAtt}
+ >绉婚櫎</a
+ >
</template>
</p>
</div>
@@ -171,24 +328,49 @@
label="鍙栨秷" onclick={closePop}></lightning-button>
<lightning-button style="margin-left: 10px;" variant="neutral"
label="涓婁紶" onclick={handleFilesChange}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="margin-left: 10px;"
- label="鍙栨秷" onclick={closePop}>鍙栨秷</button>
- <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="margin-left: 10px;"
- label="涓婁紶" onclick={handleFilesChange}>涓婁紶</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
+ style="margin-left: 10px"
+ label="鍙栨秷"
+ onclick={closePop}
+ >
+ 鍙栨秷
+ </button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
+ style="margin-left: 10px"
+ label="涓婁紶"
+ onclick={handleFilesChange}
+ >
+ 涓婁紶
+ </button>
</footer>
</div>
</section>
- <div class="slds-backdrop slds-backdrop_open"></div>
+ <div
+ class="slds-backdrop slds-backdrop_open"
+ ></div>
</template>
<template if:true={EditAble}>
<lightning-layout>
- <lightning-layout-item size="1" padding="around-small"></lightning-layout-item>
- <lightning-layout-item size="2" padding="around-small"></lightning-layout-item>
- <lightning-layout-item padding="around-small">
+ <lightning-layout-item
+ size="1"
+ padding="around-small"
+ ></lightning-layout-item>
+ <lightning-layout-item
+ size="2"
+ padding="around-small"
+ ></lightning-layout-item>
+ <lightning-layout-item
+ padding="around-small"
+ >
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={SaveJs}>纭畾</button>
+ onclick={SaveJs}
+ >
+ 纭畾
+ </button>
</lightning-layout-item>
</lightning-layout>
</template>
@@ -225,7 +407,6 @@
</template>
</lightning-layout> -->
-
</div>
</div>
</div>
@@ -240,103 +421,180 @@
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding:7px;">
+ <div style="padding: 7px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
<!--鍙戠エ淇℃伅 鏄剧ず鐢� -->
<template if:false={isEditInvoice}>
- <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId}
- onload={handleLoad2}>
+ <lightning-record-edit-form
+ object-api-name="Consumable_order__c"
+ record-id={cocId}
+ onload={handleLoad2}
+ >
<!-- 鍙戠エ鍙� 鐘舵�� -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
- <lightning-layout-item class="hehe-layoutItem" size="5">
- <lightning-output-field field-name="Name"></lightning-output-field>
- </lightning-layout-item>
-
- <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;">
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ >
<lightning-output-field
- field-name="Invoice_status__c"></lightning-output-field>
+ field-name="Name"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ style="padding-left: 100px"
+ >
+ <lightning-output-field
+ field-name="Invoice_status__c"
+ ></lightning-output-field>
+ </lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
</lightning-layout>
<!-- 鍙戠エ鏃ユ湡 -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
- <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ >
<lightning-output-field
- field-name="Invoice_Date__c"></lightning-output-field>
+ field-name="Invoice_Date__c"
+ ></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
<!-- 浜岀骇缁忛攢鍟� -->
- <template if:true={isShowSecondaryDistributor}>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <template
+ if:true={isShowSecondaryDistributor}
+ >
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
- <lightning-layout multiple-rows="true">
- <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-layout
+ multiple-rows="true"
+ >
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ >
<lightning-output-field
- field-name="Order_Dealer_Info__c"></lightning-output-field>
+ field-name="Order_Dealer_Info__c"
+ ></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
</template>
<!-- 瀹㈡埛鍚� -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
- <lightning-layout-item class="hehe-layoutItem" size="5">
- <lightning-output-field field-name="ShipmentAccount__c"
- class="hideHelpText"></lightning-output-field>
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ >
+ <lightning-output-field
+ field-name="ShipmentAccount__c"
+ class="hideHelpText"
+ ></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
<!-- 绉戝 鍙戠エ绁ㄩ潰閲戦 -->
- <lightning-layout multiple-rows="true" style="height:35.5px">
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout
+ multiple-rows="true"
+ style="height: 35.5px"
+ >
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
- <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ >
<lightning-output-field
- field-name="Order_ForCustomerText__c"></lightning-output-field>
+ field-name="Order_ForCustomerText__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="5" class="readOnly" style="padding-left: 100px;">
- <lightning-input label="鍙戠エ绁ㄩ潰閲戦(鍏�)" value={sumPrice} read-only
- variant="label-inline"></lightning-input>
+ <lightning-layout-item
+ size="5"
+ class="readOnly"
+ style="padding-left: 100px"
+ >
+ <lightning-input
+ label="鍙戠エ绁ㄩ潰閲戦(鍏�)"
+ value={sumPrice}
+ read-only
+ variant="label-inline"
+ ></lightning-input>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
</lightning-layout>
<!-- 澶囨敞 -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ >
<lightning-output-field
- field-name="Invoice_Note__c"></lightning-output-field>
+ field-name="Invoice_Note__c"
+ ></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
<!-- 鍙戠エ闄勪欢 鏄庣粏闄勪欢 -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
- <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ >
<lightning-output-field
- field-name="Invoice_attachment__c"></lightning-output-field>
+ field-name="Invoice_attachment__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;">
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ style="padding-left: 100px"
+ >
<lightning-output-field
- field-name="Invoicedet_attachment__c"></lightning-output-field>
+ field-name="Invoicedet_attachment__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
</lightning-layout>
<!-- 闄勪欢棰勮 -->
@@ -344,30 +602,68 @@
<lightning-layout-item size="1">
</lightning-layout-item>
<lightning-layout-item size="10">
- <lightning-card class="attListTitle" variant="Narrow" title="闄勪欢鍒楄〃"
- icon-name="utility:attach">
-
- <lightning-layout slot="footer" multiple-rows="true">
- <template for:each={fileData} for:item="item" for:index="index">
- <lightning-layout-item padding="around-none" size="2"
+ <lightning-card
+ class="attListTitle"
+ variant="Narrow"
+ title="闄勪欢鍒楄〃"
+ icon-name="utility:attach"
+ >
+ <lightning-layout
+ slot="footer"
+ multiple-rows="true"
+ >
+ <template
+ for:each={fileData}
+ for:item="item"
+ for:index="index"
+ >
+ <lightning-layout-item
+ padding="around-none"
+ size="2"
key={item.recordId}
- style="text-align: left;padding:5px">
- <lightning-icon title={item.Title}
- style="margin-left: 20px;" icon-name="doctype:gform"
+ style="
+ text-align: left;
+ padding: 5px;
+ "
+ >
+ <lightning-icon
+ title={item.Title}
+ style="
+ margin-left: 20px;
+ "
+ icon-name="doctype:gform"
alternative-text={item.Title}
- size="large"></lightning-icon><br />
- <div title={item.Title} style="width: 100px;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;">
+ size="large"
+ ></lightning-icon
+ ><br />
+ <div
+ title={item.Title}
+ style="
+ width: 100px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+ "
+ >
{item.Title}
</div>
<p>
<!-- <a data-fileid ={item.documentId} onclick={previweAtt}> -->
- <a href={item.attUrl} target="_blank">
- 棰勮
- </a> 路
- <a href={item.downloadUrl}>
- 涓嬭浇
- </a> 路
- <a data-fileid={item.Id} onclick={deleteAtt}>
+ <a
+ href={item.attUrl}
+ target="_blank"
+ >
+ 棰勮 </a
+ > 路
+ <a
+ href={item.downloadUrl}
+ >
+ 涓嬭浇 </a
+ > 路
+ <a
+ data-fileid={item.Id}
+ onclick={deleteAtt}
+ >
鍒犻櫎
</a>
</p>
@@ -382,95 +678,177 @@
</template>
<!--鍙戠エ淇℃伅 缂栬緫鐢� -->
<template if:true={isEditInvoice}>
- <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId}
- onload={handleLoad2}>
+ <lightning-record-edit-form
+ object-api-name="Consumable_order__c"
+ record-id={cocId}
+ onload={handleLoad2}
+ >
<!-- 鍙戠エ鍙� 鐘舵�� -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
- <lightning-layout-item class="hehe-layoutItem" size="5">
- <lightning-input label="鍙戠エ鍙�" value={OrderCode} data-field="OrderCode"
- onchange={dataChange} variant="label-inline" required
- class="inputFont"></lightning-input>
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ >
+ <lightning-input
+ label="鍙戠エ鍙�"
+ value={OrderCode}
+ data-field="OrderCode"
+ onchange={dataChange}
+ variant="label-inline"
+ required
+ class="inputFont"
+ ></lightning-input>
</lightning-layout-item>
- <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;">
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ style="padding-left: 100px"
+ >
<lightning-output-field
- field-name="Invoice_status__c"></lightning-output-field>
+ field-name="Invoice_status__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
</lightning-layout>
<!-- 鍙戠エ鏃ユ湡 -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
- <lightning-layout-item class="hehe-layoutItem" size="5">
- <lightning-input type="date" label="鍙戠エ鏃ユ湡" variant="label-inline"
- value={InvoiceDate} onchange={invoiceDateChange} required
- class="inputFont"></lightning-input>
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ >
+ <lightning-input
+ type="date"
+ label="鍙戠エ鏃ユ湡"
+ variant="label-inline"
+ value={InvoiceDate}
+ onchange={invoiceDateChange}
+ required
+ class="inputFont"
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
<!-- 瀹㈡埛鍚� 浜岀骇缁忛攢鍟� -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
- <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ >
<div
- class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right">
- <lightning-icon size="x-small"
+ class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right"
+ >
+ <lightning-icon
+ size="x-small"
class="iconMargin slds-icon slds-input__icon slds-input__icon_right slds-icon-text-default hideHelpText"
- icon-name="utility:search"></lightning-icon>
- <lightning-input type="text" name="HospitalName" label="瀹㈡埛鍚�"
- value={HospitalName} variant="label-inline"
- onclick={searchHospitalNameModal} data-field="HospitalName"
- onchange={clearAgencyI} class="inputFont"></lightning-input>
+ icon-name="utility:search"
+ ></lightning-icon>
+ <lightning-input
+ type="text"
+ name="HospitalName"
+ label="瀹㈡埛鍚�"
+ value={HospitalName}
+ variant="label-inline"
+ onclick={searchHospitalNameModal}
+ data-field="HospitalName"
+ onchange={clearAgencyI}
+ class="inputFont"
+ ></lightning-input>
</div>
</lightning-layout-item>
- <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;">
- <lightning-combobox data-field="secondaryDistributor"
- name="secondaryDistributor" label="浜岀骇缁忛攢鍟�"
- value={secondaryDistributor} placeholder="璇烽�夋嫨..."
- options={provinceOptsMap} variant="label-inline"
- onchange={dataChange} class="inputFont"></lightning-combobox>
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ style="padding-left: 100px"
+ >
+ <lightning-combobox
+ data-field="secondaryDistributor"
+ name="secondaryDistributor"
+ label="浜岀骇缁忛攢鍟�"
+ value={secondaryDistributor}
+ placeholder="璇烽�夋嫨..."
+ options={provinceOptsMap}
+ variant="label-inline"
+ onchange={dataChange}
+ class="inputFont"
+ ></lightning-combobox>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
</lightning-layout>
<!-- 绉戝 缁忛攢鍟�(褰曞叆) -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
- <lightning-layout-item class="hehe-layoutItem" size="5">
- <lightning-input-field onchange={dataChange}
- data-field="ForCustomerText" value={ForCustomerText}
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ >
+ <lightning-input-field
+ onchange={dataChange}
+ data-field="ForCustomerText"
+ value={ForCustomerText}
field-name="Order_ForCustomerText__c"
- class="inputFont"></lightning-input-field>
+ class="inputFont"
+ ></lightning-input-field>
</lightning-layout-item>
- <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;">
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ style="padding-left: 100px"
+ >
<lightning-output-field
- field-name="Order_ForDealerText__c"></lightning-output-field>
+ field-name="Order_ForDealerText__c"
+ ></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
</lightning-layout>
<!-- 澶囨敞 -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
- <lightning-layout-item class="hehe-layoutItem" size="5">
- <lightning-input-field onchange={dataChange} data-field="InvoiceNote"
- value={InvoiceNote} field-name="Invoice_Note__c"
- class="inputFont"></lightning-input-field>
+ <lightning-layout-item
+ class="hehe-layoutItem"
+ size="5"
+ >
+ <lightning-input-field
+ onchange={dataChange}
+ data-field="InvoiceNote"
+ value={InvoiceNote}
+ field-name="Invoice_Note__c"
+ class="inputFont"
+ ></lightning-input-field>
</lightning-layout-item>
</lightning-layout>
-
</lightning-record-edit-form>
</template>
</div>
@@ -479,25 +857,31 @@
<!-- 鍑哄簱鍗曚竴瑙� -->
<div class="borderCss">
<div class="headerDorderCss">
-
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
<strong>鍑哄簱鍗曚竴瑙�</strong>
</p>
</lightning-layout-item>
- <lightning-layout-item size="2" padding="around-small">
+ <lightning-layout-item
+ size="2"
+ padding="around-small"
+ >
</lightning-layout-item>
<template if:false={hideCheckbox}>
- <lightning-layout-item padding="around-small">
+ <lightning-layout-item
+ padding="around-small"
+ >
<!-- <lightning-button label=" 妫�绱� "
onclick={InvoiceorderSearchJs}></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- onclick={InvoiceorderSearchJs}>妫�绱�</button>
+ onclick={InvoiceorderSearchJs}
+ >
+ 妫�绱�
+ </button>
</lightning-layout-item>
</template>
-
</lightning-layout>
</div>
@@ -520,13 +904,25 @@
<div style="padding: 7px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-datatable key-field="Id" data={outboundData} columns={outboundColumns}
- hide-checkbox-column={hideCheckbox} onrowselection={getSelectedRows}
- selected-rows={selectedRows} class="wrapped-header-datatable" data-field="outbound">
+ <lightning-datatable
+ key-field="Id"
+ data={outboundData}
+ columns={outboundColumns}
+ hide-checkbox-column={hideCheckbox}
+ onrowselection={getSelectedRows}
+ selected-rows={selectedRows}
+ class="wrapped-header-datatable"
+ data-field="outbound"
+ >
</lightning-datatable>
- <lightning-datatable key-field="id" data={outboundDataSumPrice}
- columns={outboundColumns} hide-checkbox-column hide-table-header
- class="wrapped-header-datatable">
+ <lightning-datatable
+ key-field="id"
+ data={outboundDataSumPrice}
+ columns={outboundColumns}
+ hide-checkbox-column
+ hide-table-header
+ class="wrapped-header-datatable"
+ >
</lightning-datatable>
</div>
</div>
@@ -536,7 +932,9 @@
<div class="borderCss">
<div class="headerDorderCss">
<lightning-layout>
- <lightning-layout-item padding="around-small">
+ <lightning-layout-item
+ padding="around-small"
+ >
<p style="font-size: 18px">
<strong>鍙戠エ鏄庣粏</strong>
</p>
@@ -546,9 +944,13 @@
<div style="padding: 7px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-datatable key-field="id" data={invoiceOrderdetail1Recoeds}
- columns={invoiceDetailsColumns} hide-checkbox-column
- class="wrapped-header-datatable">
+ <lightning-datatable
+ key-field="id"
+ data={invoiceOrderdetail1Recoeds}
+ columns={invoiceDetailsColumns}
+ hide-checkbox-column
+ class="wrapped-header-datatable"
+ >
</lightning-datatable>
</div>
</div>
@@ -605,21 +1007,25 @@
<template if:true={isConInvoiceList}>
<div class="outerBorderCss">
- <div style="padding:5px;">
+ <div style="padding: 5px">
<!-- 鏂板缓鍙戠エ -->
<div class="borderCss">
- <div style="padding:15px;">
+ <div style="padding: 15px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
<!-- <lightning-button label="鏂板缓鍙戠エ" onclick={newInvoiceJs}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={newInvoiceJs}>鏂板缓鍙戠エ</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ onclick={newInvoiceJs}
+ >
+ 鏂板缓鍙戠エ
+ </button>
</div>
</div>
</div>
<!-- 妫�绱㈡潯浠� -->
- <div class="borderCss" style="margin-top: 5px;">
+ <div class="borderCss" style="margin-top: 5px">
<div class="headerDorderCss">
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -632,77 +1038,150 @@
<div style="padding: 15px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
-
<lightning-layout multiple-rows>
<lightning-layout-item flexibility="auto">
<div class="slds-text-align_center">
- <div class="slds-grid slds-grid_vertical-align-center">
- <div class="slds-form-element__label ">鍑哄簱鏃� 浠�</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"
+ >
+ 鍑哄簱鏃� 浠�
+ </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 ">    鍒�
+ <!-- </br> -->
+ <div
+ class="slds-grid slds-grid_vertical-align-center"
+ >
+ <div
+ class="slds-form-element__label"
+ >
+     鍒�
</div>
- <lightning-input type="date" variant="label-hidden" label="鍒�"
- onchange={dataChange} data-field="deliveryToDate"
- value={deliveryToDate} class="inputFont"
- style="max-width: 150px;"></lightning-input>
+ <lightning-input
+ type="date"
+ variant="label-hidden"
+ label="鍒�"
+ onchange={dataChange}
+ data-field="deliveryToDate"
+ value={deliveryToDate}
+ class="inputFont"
+ style="max-width: 150px"
+ ></lightning-input>
</div>
</div>
</lightning-layout-item>
<lightning-layout-item flexibility="auto">
- <div class="slds-grid slds-grid_vertical-align-center">
- <div class="slds-form-element__label ">鍙戠エ鍙�</div>
- <lightning-input variant="label-hidden" label="鍙戠エ鍙�" onchange={dataChange}
- data-field="category1" value={category1} class="inputFont"
- style="max-width: 150px;"></lightning-input>
+ <div
+ class="slds-grid slds-grid_vertical-align-center"
+ >
+ <div
+ class="slds-form-element__label"
+ >
+ 鍙戠エ鍙�
+ </div>
+ <lightning-input
+ variant="label-hidden"
+ label="鍙戠エ鍙�"
+ onchange={dataChange}
+ data-field="category1"
+ value={category1}
+ class="inputFont"
+ style="max-width: 150px"
+ ></lightning-input>
</div>
</lightning-layout-item>
<lightning-layout-item flexibility="auto">
- <div class="slds-grid slds-grid_vertical-align-center">
- <div class="slds-form-element__label ">瀹㈡埛鍚�</div>
- <lightning-input variant="label-hidden" label="瀹㈡埛鍚�" onchange={dataChange}
- data-field="category2" value={category2} class="inputFont"
- style="max-width: 150px;"></lightning-input>
+ <div
+ class="slds-grid slds-grid_vertical-align-center"
+ >
+ <div
+ class="slds-form-element__label"
+ >
+ 瀹㈡埛鍚�
+ </div>
+ <lightning-input
+ variant="label-hidden"
+ label="瀹㈡埛鍚�"
+ onchange={dataChange}
+ data-field="category2"
+ value={category2}
+ class="inputFont"
+ style="max-width: 150px"
+ ></lightning-input>
</div>
</lightning-layout-item>
<lightning-layout-item flexibility="auto">
- <div class="slds-grid slds-grid_vertical-align-center">
- <div class="slds-form-element__label ">鐘舵��</div>
- <lightning-combobox data-field="invoiceStatus" name="invoiceStatus"
- label="鐘舵��" value={invoiceStatusValue} placeholder="璇烽�夋嫨..."
- options={Options} variant="label-hidden" onchange={dataChange}
- style="min-width: 100px;max-width: 200px;"
- class="inputFont"></lightning-combobox>
+ <div
+ class="slds-grid slds-grid_vertical-align-center"
+ >
+ <div
+ class="slds-form-element__label"
+ >
+ 鐘舵��
+ </div>
+ <lightning-combobox
+ data-field="invoiceStatus"
+ name="invoiceStatus"
+ label="鐘舵��"
+ value={invoiceStatusValue}
+ placeholder="璇烽�夋嫨..."
+ options={Options}
+ variant="label-hidden"
+ onchange={dataChange}
+ style="
+ min-width: 100px;
+ max-width: 200px;
+ "
+ class="inputFont"
+ ></lightning-combobox>
</div>
</lightning-layout-item>
<lightning-layout-item flexibility="auto">
- <div class="slds-grid slds-grid_vertical-align-center">
+ <div
+ class="slds-grid slds-grid_vertical-align-center"
+ >
<button
class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- onclick={invoiceCodeSearchJs} style="max-width: 110px;">妫�绱�</button>
+ onclick={invoiceCodeSearchJs}
+ style="max-width: 110px"
+ >
+ 妫�绱�
+ </button>
</div>
</lightning-layout-item>
<lightning-layout-item flexibility="auto">
- <div class="slds-grid slds-grid_vertical-align-center">
+ <div
+ class="slds-grid slds-grid_vertical-align-center"
+ >
<button
class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
- onclick={ClearJs} style="max-width: 110px;">娓呯┖</button>
+ onclick={ClearJs}
+ style="max-width: 110px"
+ >
+ 娓呯┖
+ </button>
</div>
</lightning-layout-item>
</lightning-layout>
-
</div>
</div>
</div>
<!-- 鍙戠エ涓�瑙� -->
- <div class="borderCss" style="margin-top: 5px;">
+ <div class="borderCss" style="margin-top: 5px">
<div class="headerDorderCss">
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -715,8 +1194,13 @@
<div style="padding: 7px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-datatable key-field="id" data={invoiceData} columns={invoiceColumns}
- hide-checkbox-column="true" class="wrapped-header-datatable">
+ <lightning-datatable
+ key-field="id"
+ data={invoiceData}
+ columns={invoiceColumns}
+ hide-checkbox-column="true"
+ class="wrapped-header-datatable"
+ >
</lightning-datatable>
</div>
</div>
@@ -728,21 +1212,25 @@
<template if:true={isDetailsShow}>
<div class="outerBorderCss">
- <div style="padding:5px;">
+ <div style="padding: 5px">
<!-- 纭畾 -->
<div class="borderCss">
- <div style="padding:10px;">
+ <div style="padding: 10px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
<!-- <lightning-button label="纭畾" onclick={detailsSaveJs}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={detailsSaveJs}>纭畾</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ onclick={detailsSaveJs}
+ >
+ 纭畾
+ </button>
</div>
</div>
</div>
<!-- 鍙戠エ淇℃伅 -->
- <div class="borderCss" style="margin-top: 5px;">
+ <div class="borderCss" style="margin-top: 5px">
<div class="headerDorderCss">
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -755,26 +1243,43 @@
<div style="padding: 7px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-record-edit-form object-api-name="Consumable_order__c"
- record-id={detailsInvoiceId} onload={handleLoad2}>
+ <lightning-record-edit-form
+ object-api-name="Consumable_order__c"
+ record-id={detailsInvoiceId}
+ onload={handleLoad2}
+ >
<lightning-layout multiple-rows="true">
- <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item size="5">
- <lightning-output-field field-name="Name"></lightning-output-field>
- </lightning-layout-item>
- </lightning-layout>
- <lightning-layout multiple-rows="true">
- <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item size="5" class="hehe-layoutItem">
- <lightning-output-field field-name="ShipmentAccount__c"
- class="hideHelpText"></lightning-output-field>
- </lightning-layout-item>
- </lightning-layout>
- <lightning-layout multiple-rows="true">
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
<lightning-output-field
- field-name="Order_ForCustomerText__c"></lightning-output-field>
+ field-name="Name"
+ ></lightning-output-field>
+ </lightning-layout-item>
+ </lightning-layout>
+ <lightning-layout multiple-rows="true">
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
+ <lightning-layout-item
+ size="5"
+ class="hehe-layoutItem"
+ >
+ <lightning-output-field
+ field-name="ShipmentAccount__c"
+ class="hideHelpText"
+ ></lightning-output-field>
+ </lightning-layout-item>
+ </lightning-layout>
+ <lightning-layout multiple-rows="true">
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
+ <lightning-layout-item size="5">
+ <lightning-output-field
+ field-name="Order_ForCustomerText__c"
+ ></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
</lightning-record-edit-form>
@@ -783,7 +1288,7 @@
</div>
<!-- 鍑哄簱鍗� -->
- <div class="borderCss" style="margin-top: 5px;">
+ <div class="borderCss" style="margin-top: 5px">
<div class="headerDorderCss">
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -796,17 +1301,28 @@
<div style="padding: 7px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={detailsCocId}>
+ <lightning-record-edit-form
+ object-api-name="Consumable_order__c"
+ record-id={detailsCocId}
+ >
<lightning-layout multiple-rows="true">
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Name"></lightning-output-field>
+ <lightning-output-field
+ field-name="Name"
+ ></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
<lightning-layout multiple-rows="true">
- <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item
+ size="1"
+ ></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field field-name="Outbound_Date__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Outbound_Date__c"
+ ></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
</lightning-record-edit-form>
@@ -815,7 +1331,7 @@
</div>
<!-- 鍑哄簱鍗曟槑缁� -->
- <div class="borderCss" style="margin-top: 5px;">
+ <div class="borderCss" style="margin-top: 5px">
<div class="headerDorderCss">
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -831,15 +1347,30 @@
<!-- <lightning-datatable class="datatabel slds-border_top" key-field="id"
data={detaisData} columns={detailsColumns}>
</lightning-datatable> -->
- <c-lex-custom-lightning-datatable key-field="Id" data={detailsData} columns={detailsColumns}
- onunitchange={handleUnitChange} onshipmentnumber={handleShipmentNumber}
- onrowselection={detailsGetSelectedRows} selected-rows={detailsSelectedRows}
- style="word-wrap:break-word; word-break:break-all; " class="wrapped-header-datatable"
- min-column-width="115">
+ <c-lex-custom-lightning-datatable
+ key-field="Id"
+ data={detailsData}
+ columns={detailsColumns}
+ onunitchange={handleUnitChange}
+ onshipmentnumber={handleShipmentNumber}
+ onrowselection={detailsGetSelectedRows}
+ selected-rows={detailsSelectedRows}
+ style="
+ word-wrap: break-word;
+ word-break: break-all;
+ "
+ class="wrapped-header-datatable"
+ min-column-width="115"
+ >
</c-lex-custom-lightning-datatable>
- <lightning-datatable class="datatabel slds-border_top wrapped-header-datatable"
- key-field="id" data={invoiceAllpriceData} columns={detailsColumns} hide-checkbox-column
- hide-table-header>
+ <lightning-datatable
+ class="datatabel slds-border_top wrapped-header-datatable"
+ key-field="id"
+ data={invoiceAllpriceData}
+ columns={detailsColumns}
+ hide-checkbox-column
+ hide-table-header
+ >
</lightning-datatable>
</div>
</div>
@@ -847,5 +1378,4 @@
</div>
</div>
</template>
-
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
index 032f8fc..495eb73 100644
--- a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
+++ b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
@@ -1,290 +1,291 @@
import { LightningElement, api, track, wire } from 'lwc';
-import { ShowToastEvent } from "lightning/platformShowToastEvent";
-import init from "@salesforce/apex/LexConInvoiceViewController.init";
-import save from "@salesforce/apex/LexConInvoiceViewController.save";
-import saveFile from "@salesforce/apex/LexConInvoiceViewController.saveFile";
-import saveAttachment from "@salesforce/apex/LexConInvoiceViewController.saveAttachment";
-import InvoiceorderSearch from "@salesforce/apex/LexConInvoiceViewController.InvoiceorderSearch";
-import deleteButton from "@salesforce/apex/LexConInvoiceViewController.deleteButton";
-import approval from "@salesforce/apex/LexConInvoiceViewController.approval";
-import conInvoiceListInit from "@salesforce/apex/LexConInvoiceList.init";
-import invoiceCodeSearch from "@salesforce/apex/LexConInvoiceList.invoiceCodeSearch";
-import hospitalInit from "@salesforce/apex/lexSearchAgencyHospitalController.init";
-import serContact from "@salesforce/apex/lexSearchAgencyHospitalController.serContact";
-import detailsInit from "@salesforce/apex/LexConInvoicedetailsController.init";
-import detailsSave from "@salesforce/apex/LexConInvoicedetailsController.save";
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import init from '@salesforce/apex/LexConInvoiceViewController.init';
+import save from '@salesforce/apex/LexConInvoiceViewController.save';
+import saveFile from '@salesforce/apex/LexConInvoiceViewController.saveFile';
+import saveAttachment from '@salesforce/apex/LexConInvoiceViewController.saveAttachment';
+import InvoiceorderSearch from '@salesforce/apex/LexConInvoiceViewController.InvoiceorderSearch';
+import deleteButton from '@salesforce/apex/LexConInvoiceViewController.deleteButton';
+import approval from '@salesforce/apex/LexConInvoiceViewController.approval';
+import conInvoiceListInit from '@salesforce/apex/LexConInvoiceList.init';
+import invoiceCodeSearch from '@salesforce/apex/LexConInvoiceList.invoiceCodeSearch';
+import hospitalInit from '@salesforce/apex/lexSearchAgencyHospitalController.init';
+import serContact from '@salesforce/apex/lexSearchAgencyHospitalController.serContact';
+import detailsInit from '@salesforce/apex/LexConInvoicedetailsController.init';
+import detailsSave from '@salesforce/apex/LexConInvoicedetailsController.save';
import deleteAtt from '@salesforce/apex/LexSummonsCreatController.deleteAtt';
-import { NavigationMixin } from "lightning/navigation";
-//table css
-import { loadStyle } from "lightning/platformResourceLoader";
-import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
+import { NavigationMixin } from 'lightning/navigation';
+//table css
+import { loadStyle } from 'lightning/platformResourceLoader';
+import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
import LexConInvoiceViewReport from '@salesforce/label/c.LexConInvoiceViewReport';
const hospitalColumns = [
{
- label: "",
- fieldName: "Id1",
- type: "button",
+ label: '',
+ fieldName: 'Id1',
+ type: 'button',
initialWidth: 90,
hideDefaultActions: true,
typeAttributes: {
- label: "閫夋嫨",
- name: "Id2",
- size: 1,
- },
+ label: '閫夋嫨',
+ name: 'Id2',
+ size: 1
+ }
},
{
- label: "鍖婚櫌鍚嶇О",
- fieldName: "Name",
+ label: '鍖婚櫌鍚嶇О',
+ fieldName: 'Name',
hideDefaultActions: true,
- wrapText: true,
+ wrapText: true
},
{
- label: "鐪佷唤",
- fieldName: "stateMasterName",
- hideDefaultActions: true,
+ label: '鐪佷唤',
+ fieldName: 'stateMasterName',
+ hideDefaultActions: true
}
];
const invoiceDetailsColumns = [
{
- label: "鍑哄簱鏃ユ湡",
- fieldName: "esdetProductOutDate",
+ label: '鍑哄簱鏃ユ湡',
+ fieldName: 'esdetProductOutDate',
hideDefaultActions: true,
- wrapText: true,
+ wrapText: true
},
{
- label: "鍑哄簱鍗曠紪鐮�",
- fieldName: "esdetInvoicedet1ODlinkName",
+ label: '鍑哄簱鍗曠紪鐮�',
+ fieldName: 'esdetInvoicedet1ODlinkName',
wrapText: true,
hideDefaultActions: true,
- wrapText: true,
+ wrapText: true
},
{
- label: "浜у搧鍨嬪彿",
- fieldName: "esdetAssetModelNo",
+ label: '浜у搧鍨嬪彿',
+ fieldName: 'esdetAssetModelNo',
hideDefaultActions: true,
wrapText: true,
- initialWidth: 400,
+ initialWidth: 400
},
{
- label: "鍗曚綅",
- fieldName: "esdetInvoiceUnit",
+ label: '鍗曚綅',
+ fieldName: 'esdetInvoiceUnit',
hideDefaultActions: true,
wrapText: true,
- initialWidth: 50,
+ initialWidth: 50
},
{
- label: "鍙戠エ鍗曚环",
- fieldName: "esdetInvoiceUnitprice",
+ label: '鍙戠エ鍗曚环',
+ fieldName: 'esdetInvoiceUnitprice',
hideDefaultActions: true,
wrapText: true,
- type: "number",
+ type: 'number',
typeAttributes: {
- minimumFractionDigits: 2,
- },
+ minimumFractionDigits: 2
+ }
},
{
- label: "鍙戠エ鏁伴噺",
- fieldName: "esdetInvoicedCount",
+ label: '鍙戠エ鏁伴噺',
+ fieldName: 'esdetInvoicedCount',
cellAttributes: { alignment: 'right' },
hideDefaultActions: true,
- wrapText: true,
+ wrapText: true
},
{
- label: "鍙戠エ绁ㄩ潰閲戦(鍏�)",
- fieldName: "esdetInvoicedProCostRMB",
+ label: '鍙戠エ绁ㄩ潰閲戦(鍏�)',
+ fieldName: 'esdetInvoicedProCostRMB',
hideDefaultActions: true,
wrapText: true,
cellAttributes: { alignment: 'right' },
- initialWidth:145,
- type: "number",
+ initialWidth: 145,
+ type: 'number',
typeAttributes: {
- minimumFractionDigits: 2,
- },
- },
+ minimumFractionDigits: 2
+ }
+ }
];
const invoiceColumns = [
{
- label: "鍙戠エ鏃ユ湡",
- fieldName: "Invoice_Date__c",
+ label: '鍙戠エ鏃ユ湡',
+ fieldName: 'Invoice_Date__c',
hideDefaultActions: true,
initialWidth: 150
},
{
- label: "鍙戠エ鍙�",
+ label: '鍙戠エ鍙�',
type: 'url',
- fieldName: "NameUrl",
+ fieldName: 'NameUrl',
typeAttributes: {
- label: { fieldName: "Name" },
+ label: { fieldName: 'Name' }
},
- hideDefaultActions: true,
+ hideDefaultActions: true
},
{
- label: "瀹㈡埛鍚�",
- fieldName: "ShipmentAccount__c",
+ label: '瀹㈡埛鍚�',
+ fieldName: 'ShipmentAccount__c',
hideDefaultActions: true,
- wrapText: true,
+ wrapText: true
},
{
- label: "鍙戠エ鐘舵��",
- fieldName: "Invoice_status__c",
+ label: '鍙戠エ鐘舵��',
+ fieldName: 'Invoice_status__c',
hideDefaultActions: true,
initialWidth: 100
},
{
- label: "鍙戠エ璐﹂潰閲戦(鍏�)",
- fieldName: "Invoice_total_amount__c",
+ label: '鍙戠エ璐﹂潰閲戦(鍏�)',
+ fieldName: 'Invoice_total_amount__c',
hideDefaultActions: true,
- type: "number",
+ type: 'number',
typeAttributes: {
- minimumFractionDigits: 2,
+ minimumFractionDigits: 2
},
initialWidth: 180
},
{
- label: "鍙戠エ闄勪欢",
- fieldName: "Invoice_attachment__c",
+ label: '鍙戠エ闄勪欢',
+ fieldName: 'Invoice_attachment__c',
type: 'boolean',
hideDefaultActions: true,
initialWidth: 120
},
{
- label: "鍙戠エ鏄庣粏闄勪欢",
- fieldName: "Invoicedet_attachment__c",
+ label: '鍙戠エ鏄庣粏闄勪欢',
+ fieldName: 'Invoicedet_attachment__c',
type: 'boolean',
hideDefaultActions: true,
initialWidth: 120
- },
+ }
];
const detailsColumns = [
{
- label: "浜у搧鍨嬪彿",
- fieldName: "esdAssetModelNo",
+ label: '浜у搧鍨嬪彿',
+ fieldName: 'esdAssetModelNo',
hideDefaultActions: true,
initialWidth: 200,
- wrapText: true,
+ wrapText: true
},
{
- label: "瑙勬牸",
- fieldName: "packingListManual",
+ label: '瑙勬牸',
+ fieldName: 'packingListManual',
hideDefaultActions: true,
initialWidth: 30
},
{
- label: "鍑鸿揣鍗曚环(鍏�)",
- fieldName: "esdDeliveryListRMB",
+ label: '鍑鸿揣鍗曚环(鍏�)',
+ fieldName: 'esdDeliveryListRMB',
hideDefaultActions: true,
- type: "number",
+ type: 'number',
typeAttributes: {
- minimumFractionDigits: 2,
- },
+ minimumFractionDigits: 2
+ }
},
{
- label: "鍑鸿揣鏁伴噺",
- fieldName: "esdShipmentCount",
- hideDefaultActions: true,
+ label: '鍑鸿揣鏁伴噺',
+ fieldName: 'esdShipmentCount',
+ hideDefaultActions: true
},
{
- label: "杩斿搧鏁伴噺",
- fieldName: "esdRrturnProCount",
- hideDefaultActions: true,
+ label: '杩斿搧鏁伴噺',
+ fieldName: 'esdRrturnProCount',
+ hideDefaultActions: true
},
{
- label: "鍑哄簱鍗曚綅",
- fieldName: "esdBoxPiece",
- hideDefaultActions: true,
+ label: '鍑哄簱鍗曚綅',
+ fieldName: 'esdBoxPiece',
+ hideDefaultActions: true
},
{
- label: "宸插彂绁ㄦ暟閲�",
- fieldName: "esdInvoicedProcount",
+ label: '宸插彂绁ㄦ暟閲�',
+ fieldName: 'esdInvoicedProcount',
hideDefaultActions: true,
- type: "number",
+ type: 'number',
typeAttributes: {
- minimumFractionDigits: 2,
- },
+ minimumFractionDigits: 2
+ }
},
{
- label: "杩樻病鍙戠エ鏁伴噺",
- fieldName: "esdInvoiceProNotCount",
+ label: '杩樻病鍙戠エ鏁伴噺',
+ fieldName: 'esdInvoiceProNotCount',
hideDefaultActions: true,
- type: "number",
+ type: 'number',
typeAttributes: {
- minimumFractionDigits: 2,
- },
+ minimumFractionDigits: 2
+ }
},
{
- label: "寮�绁ㄥ崟浣�",
+ label: '寮�绁ㄥ崟浣�',
hideDefaultActions: true,
- type: "customUnit",
+ type: 'customUnit',
typeAttributes: {
- unitValue: { fieldName: "unitValue" },
- unitOptions: { fieldName: "unitOptions" },
- recordId: { fieldName: "recordId" },
- isDisabled: { fieldName: "isDisabled" },
- },
+ unitValue: { fieldName: 'unitValue' },
+ unitOptions: { fieldName: 'unitOptions' },
+ recordId: { fieldName: 'recordId' },
+ isDisabled: { fieldName: 'isDisabled' }
+ }
},
{
- label: "鍙戠エ鍗曚环",
- fieldName: "esdInvoiceUnitprice",
+ label: '鍙戠エ鍗曚环',
+ fieldName: 'esdInvoiceUnitprice',
hideDefaultActions: true,
- type: "number",
+ type: 'number',
typeAttributes: {
- minimumFractionDigits: 2,
+ minimumFractionDigits: 2
},
initialWidth: 130
},
{
- label: "鍙戠エ鏁伴噺",
+ label: '鍙戠エ鏁伴噺',
//fieldName: "invoiceCount",
hideDefaultActions: true,
- type: "customShipment",
+ type: 'customShipment',
cellAttributes: { alignment: 'right' },
typeAttributes: {
- recordId: { fieldName: "recordId" },
- shipmentNumber: { fieldName: "shipmentNumber" },
- isConinvoice: { fieldName: "isConinvoice" },
- esdInvoiceProNotCount: { fieldName: "esdInvoiceProNotCount" },
- },
+ recordId: { fieldName: 'recordId' },
+ shipmentNumber: { fieldName: 'shipmentNumber' },
+ isConinvoice: { fieldName: 'isConinvoice' },
+ esdInvoiceProNotCount: { fieldName: 'esdInvoiceProNotCount' }
+ }
},
{
- label: "鍙戠エ绁ㄩ潰閲戦(鍏�)",
+ label: '鍙戠エ绁ㄩ潰閲戦(鍏�)',
cellAttributes: { alignment: 'right' },
- fieldName: "invoiceAllprice",
+ fieldName: 'invoiceAllprice',
hideDefaultActions: true,
- type: "number",
+ type: 'number',
initialWidth: 150,
typeAttributes: {
- minimumFractionDigits: 2,
- },
- },
-]
+ minimumFractionDigits: 2
+ }
+ }
+];
const customLabel = {
LexConInvoiceViewReport
-}
-export default class LexConInvoiceView extends NavigationMixin(LightningElement) {
-
+};
+export default class LexConInvoiceView extends NavigationMixin(
+ LightningElement
+) {
@track label = customLabel;
invoiceColumns = invoiceColumns;
detailsColumns = detailsColumns;
@track outboundColumns = [
{
- label: "鍑哄簱鏃ユ湡",
- fieldName: "esdOutboundDate",
+ label: '鍑哄簱鏃ユ湡',
+ fieldName: 'esdOutboundDate',
hideDefaultActions: true,
- wrapText: true,
+ wrapText: true
},
{
- label: "鍑哄簱鍗曠紪鐮�",
- fieldName: "esdNameUrl",
+ label: '鍑哄簱鍗曠紪鐮�',
+ fieldName: 'esdNameUrl',
type: 'url',
typeAttributes: {
- label: { fieldName: "esdName" },
- target: "_blank",
+ label: { fieldName: 'esdName' },
+ target: '_blank'
},
hideDefaultActions: true,
- wrapText: true,
+ wrapText: true
}
- ]
+ ];
@track outboundData = [];
@track outboundDataSumPrice = [];
@track invoiceData = [];
@@ -301,7 +302,7 @@
@track coc = {};
@track EditAble = false;
@track isChange = false;
- @track sumPrice = 0.00;
+ @track sumPrice = 0.0;
@track OrderCode = '';
@track ExistOutbound = false;
@track reopen = '';
@@ -313,7 +314,7 @@
@track detailsInvoiceId = '';
@track detailsCocId = '';
@track detailsData = [];
- @track invoiceAllprice = 0.00;
+ @track invoiceAllprice = 0.0;
//鐘舵��
@track invoiceStatusValue = '';
@track invoiceStatusOptions = [];
@@ -337,9 +338,9 @@
@track secondaryDistributor = '';
//瀹㈡埛鍚�
@track isModalOpen = false;
- @track HospitalName = "";
- @track HospitalInfo = "";
- @track searchHospitalName = "";
+ @track HospitalName = '';
+ @track HospitalInfo = '';
+ @track searchHospitalName = '';
@track isDisabledHospitalName = false;
@track agencyProType = '';
@track accountid = '';
@@ -375,47 +376,50 @@
//鏂囦欢涓婁紶
@track showLoadingSpinner = false;
@track showPopSpinner = false;
- @track UploadFile = "Upload File";
- @track fileName = "";
+ @track UploadFile = 'Upload File';
+ @track fileName = '';
@track fileData = [];
@track fileColumns = [
{
- label: "鏍囬",
- fieldName: "url",
- type: "url",
- typeAttributes: { label: { fieldName: "Title" }, target: "_blank" },
- hideDefaultActions: true,
+ label: '鏍囬',
+ fieldName: 'url',
+ type: 'url',
+ typeAttributes: { label: { fieldName: 'Title' }, target: '_blank' },
+ hideDefaultActions: true
},
{
- label: "鍒涘缓浜�",
- type: "url",
- fieldName: "CreatedByNameUrl",
- typeAttributes: { label: { fieldName: "CreatedByName" }, target: "_blank" },
- hideDefaultActions: true,
+ label: '鍒涘缓浜�',
+ type: 'url',
+ fieldName: 'CreatedByNameUrl',
+ typeAttributes: {
+ label: { fieldName: 'CreatedByName' },
+ target: '_blank'
+ },
+ hideDefaultActions: true
},
{
- label: "涓婁紶鏃ユ湡",
+ label: '涓婁紶鏃ユ湡',
type: 'date',
typeAttributes: {
- year: "numeric",
- month: "long",
- day: "2-digit",
- hour: "2-digit",
- minute: "2-digit"
+ year: 'numeric',
+ month: 'long',
+ day: '2-digit',
+ hour: '2-digit',
+ minute: '2-digit'
},
- fieldName: "CreatedDate",
- hideDefaultActions: true,
+ fieldName: 'CreatedDate',
+ hideDefaultActions: true
},
{
- label: "闄勪欢绫诲瀷",
- type: "customAttachmentType",
+ label: '闄勪欢绫诲瀷',
+ type: 'customAttachmentType',
typeAttributes: {
- typeValue: { fieldName: "typeValue" },
- typeOptions: { fieldName: "typeOptions" },
- recordId: { fieldName: "recordId" },
- isDisabledAttachment: { fieldName: "isDisabledAttachment" },
+ typeValue: { fieldName: 'typeValue' },
+ typeOptions: { fieldName: 'typeOptions' },
+ recordId: { fieldName: 'recordId' },
+ isDisabledAttachment: { fieldName: 'isDisabledAttachment' }
},
- hideDefaultActions: true,
+ hideDefaultActions: true
},
{
label: '',
@@ -428,7 +432,7 @@
},
initialWidth: 50,
hideDefaultActions: true
- },
+ }
];
filesUploaded = [];
fileContents;
@@ -441,19 +445,19 @@
if (!this.stylesLoaded) {
Promise.all([loadStyle(this, WrappedHeaderTable)])
.then(() => {
- console.log("Custom styles loaded");
+ console.log('Custom styles loaded');
this.stylesLoaded = true;
})
.catch((error) => {
- console.error("Error loading custom styles");
+ console.error('Error loading custom styles');
});
}
}
//鑾峰彇閾炬帴鍙傛暟
getQueryString(name) {
- console.log("getQueryString name " + name);
- let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+ console.log('getQueryString name ' + name);
+ let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
let r = window.location.search.substr(1).match(reg);
if (r != null) {
return decodeURIComponent(r[2]);
@@ -467,121 +471,178 @@
init() {
this.isShowSpinner = true;
- this.deliveryId = this.getQueryString("deliveryId");
- this.deliveryId = this.deliveryId == null ? "" : this.deliveryId;
- this.invoiceId = this.getQueryString("invoiceId");
- this.invoiceId = this.invoiceId == null ? "" : this.invoiceId;
- this.orderId = this.getQueryString("orderId");
- this.orderId = this.orderId == null ? "" : this.orderId;
- this.statusEdit = this.getQueryString("KeyWords");
- this.statusEdit = this.statusEdit == null ? "" : this.statusEdit;
- this.reopen = this.getQueryString("reopen");
- this.reopen = this.reopen == null ? "" : this.reopen;
- this.isNew = this.getQueryString("isNew");
- this.isNew = this.isNew == null ? "" : this.isNew;
- console.log('this.deliveryId = ' + this.deliveryId + ' this.invoiceId = ' + this.invoiceId + ' this.statusEdit = ' + this.statusEdit);
+ this.deliveryId = this.getQueryString('deliveryId');
+ this.deliveryId = this.deliveryId == null ? '' : this.deliveryId;
+ this.invoiceId = this.getQueryString('invoiceId');
+ this.invoiceId = this.invoiceId == null ? '' : this.invoiceId;
+ this.orderId = this.getQueryString('orderId');
+ this.orderId = this.orderId == null ? '' : this.orderId;
+ this.statusEdit = this.getQueryString('KeyWords');
+ this.statusEdit = this.statusEdit == null ? '' : this.statusEdit;
+ this.reopen = this.getQueryString('reopen');
+ this.reopen = this.reopen == null ? '' : this.reopen;
+ this.isNew = this.getQueryString('isNew');
+ this.isNew = this.isNew == null ? '' : this.isNew;
+ console.log(
+ 'this.deliveryId = ' +
+ this.deliveryId +
+ ' this.invoiceId = ' +
+ this.invoiceId +
+ ' this.statusEdit = ' +
+ this.statusEdit
+ );
if (this.invoiceId != '' && this.orderId != '') {
//杩涘叆coninvoiceDetails
detailsInit({
orderIdLwc: this.orderId,
invoiceIdLwc: this.invoiceId
- }).then((r) => {
- r = JSON.parse(JSON.stringify(r));
- if (r.status == "Success") {
- this.detailsInvoiceId = r.entity.invoicecode.Id;
- this.detailsCocId = r.entity.coc.Id;
- this.detailsData = r.entity.consumableorderdetails1Records;
- for (var i in this.detailsData) {
- this.detailsData[i]['Id'] = this.detailsData[i].esd.Id;
+ })
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ if (r.status == 'Success') {
+ this.detailsInvoiceId = r.entity.invoicecode.Id;
+ this.detailsCocId = r.entity.coc.Id;
+ this.detailsData =
+ r.entity.consumableorderdetails1Records;
+ for (var i in this.detailsData) {
+ 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].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;
- //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) {
- let unitOption = {};
- unitOption["label"] = this.detailsData[i].Invoice_UnitOptsMap[key];
- unitOption["value"] = key;
- unitOptions.push(unitOption);
+ 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;
+ //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) {
+ let unitOption = {};
+ 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]['shipmentNumber'] =
+ this.detailsData[i].invoiceCount;
+ this.detailsData[i]['isConinvoice'] = true;
+ 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.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]['isConinvoice'] = true;
- 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'];
- }
+ 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)
+ );
+
+ this.isShowSpinner = false;
+ this.isDetailsShow = true;
+ } else {
+ this.showMyToast('鍒濆鍖栧け璐�', r.msg, 'Error');
}
-
- 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))
-
+ })
+ .catch((error) => {
this.isShowSpinner = false;
- this.isDetailsShow = true;
- } else {
- this.showMyToast('鍒濆鍖栧け璐�', r.msg, 'Error');
- }
- }).catch((error) => {
- this.isShowSpinner = false;
- console.log("error = " + JSON.stringify(error));
- });
- } else if (this.deliveryId == '' && this.invoiceId == '' && this.isNew == '') {
+ console.log('error = ' + JSON.stringify(error));
+ });
+ } else if (
+ this.deliveryId == '' &&
+ this.invoiceId == '' &&
+ this.isNew == ''
+ ) {
console.log('conInvoiceListInit');
- conInvoiceListInit().then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log("conInvoiceListInit r = " + JSON.stringify(r));
- if (r.status == "Success") {
- this.ConInvoiceListAccountId = r.entity.accountid;
- this.ConInvoiceListUserWorkLocation = r.entity.userWorkLocation;
+ conInvoiceListInit()
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log('conInvoiceListInit r = ' + JSON.stringify(r));
+ if (r.status == 'Success') {
+ this.ConInvoiceListAccountId = r.entity.accountid;
+ this.ConInvoiceListUserWorkLocation =
+ r.entity.userWorkLocation;
- this.ConInvoiceListAgencyProType = r.entity.agencyProType;
- //if (this.ConInvoiceListAgencyProType != 'ET')
+ 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 = r.entity.raesList;
+ for (var i in this.invoiceData) {
+ this.invoiceData[i]['NameUrl'] =
+ '/lexconinvoiceview?invoiceId=' +
+ this.invoiceData[i].Id;
+ }
+ 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];
+ this.invoiceStatusOptions.push(object);
+ }
+ this.invoiceStatusOptions = [
+ ...this.invoiceStatusOptions
+ ];
+ console.log(
+ 'this.invoiceStatusOptions = ' +
+ JSON.stringify(this.invoiceStatusOptions)
+ );
+ this.isShowSpinner = false;
+ } else {
+ this.showMyToast('鍒濆鍖栧け璐�', r.msg, 'Error');
}
- 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];
- this.invoiceStatusOptions.push(object);
- }
- this.invoiceStatusOptions = [...this.invoiceStatusOptions];
- console.log("this.invoiceStatusOptions = " + JSON.stringify(this.invoiceStatusOptions));
- this.isShowSpinner = false;
- } else {
- this.showMyToast('鍒濆鍖栧け璐�', r.msg, 'Error');
- }
- }).catch((error) => {
- console.log("error = " + JSON.stringify(error));
- });
-
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ });
} else {
console.log('init');
this.isConInvoiceList = false;
@@ -589,226 +650,345 @@
invoiceId: this.invoiceId,
statusEdit: this.statusEdit,
deliveryId: this.deliveryId
- }).then((r) => {
- r = JSON.parse(JSON.stringify(r));
- 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))
- this.done = r.entity.done;
- this.accountid = r.entity.accountid;
- this.userWorkLocation = r.entity.userWorkLocation;
- 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.OrderCode = this.coc.Name;
- this.InvoiceDate = this.coc.Invoice_Date__c;
+ })
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ 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)
+ );
+ this.done = r.entity.done;
+ this.accountid = r.entity.accountid;
+ this.userWorkLocation = r.entity.userWorkLocation;
+ 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.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;
- if (this.outboundData[i].check)
- this.selectedRows.push(this.outboundData[i].esd.Id);
- }
- this.selectedRows = [...this.selectedRows];
- 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';
- if (this.isDisabledAttachment) {
- console.log('杩涘叆this.isDisabledAttachment')
- this.fileData[i]["isDisabledAttachment"] = true;
- }
- let typeOptions = [];
- for (var key in this.fileData[i].mailSelectOptsMap) {
- let typeOption = {};
- 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;
+ for (var i in this.outboundData) {
+ this.outboundData[i].Id =
+ this.outboundData[i].esd.Id;
+ if (this.outboundData[i].check)
+ this.selectedRows.push(
+ this.outboundData[i].esd.Id
+ );
}
- console.log('this.fileData = ' + JSON.stringify(this.fileData))
- }
+ this.selectedRows = [...this.selectedRows];
+ 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';
+ if (this.isDisabledAttachment) {
+ console.log(
+ '杩涘叆this.isDisabledAttachment'
+ );
+ this.fileData[i][
+ 'isDisabledAttachment'
+ ] = true;
+ }
+ let typeOptions = [];
+ for (var key in this.fileData[i]
+ .mailSelectOptsMap) {
+ let typeOption = {};
+ 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;
+ }
+ console.log(
+ 'this.fileData = ' +
+ JSON.stringify(this.fileData)
+ );
+ }
- //鍙戠エ鏄庣粏
- 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.HospitalName = r.entity.HospitalName;
- this.HospitalInfo = r.entity.HospitalInfo;
- this.agencyProType = r.entity.agencyProType;
- //if (this.agencyProType != 'ET')
+ //鍙戠エ鏄庣粏
+ 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.HospitalName = r.entity.HospitalName;
+ this.HospitalInfo = r.entity.HospitalInfo;
+ this.agencyProType = r.entity.agencyProType;
+ //if (this.agencyProType != 'ET')
this.isOpenReportDisabled = false;
- //绉戝
- 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;
- this.provinceOptsMap.push(object);
- }
- //鍑鸿揣涓�瑙坈olumns
+ //绉戝
+ 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;
+ this.provinceOptsMap.push(object);
+ }
+ //鍑鸿揣涓�瑙坈olumns
-
- if (this.EditAble) {
- let object1 = {
- label: '瀹㈡埛鍚�',
- fieldName: "hospitalName",
- hideDefaultActions: true,
- wrapText: true,
- };
- let object2 = {
- label: '鍑鸿揣閲戦(鍏�)',
- fieldName: "shipmentAmount",
- type: "number",
- typeAttributes: {
- minimumFractionDigits: 2,
- },
- hideDefaultActions: true,
- };
- let object3 = {
- label: '杩斿搧閲戦(鍏�)',
- fieldName: "returnAmount",
- type: "number",
- typeAttributes: {
- minimumFractionDigits: 2,
- },
- hideDefaultActions: true,
- };
- this.outboundColumns.push(object1)
- this.outboundColumns.push(object2)
- this.outboundColumns.push(object3)
- }
- let object4 = {
- label: '鏈彂绁ㄩ噾棰�(鍏�)',
- fieldName: "uninvoicedAmount",
- type: "number",
- typeAttributes: {
- minimumFractionDigits: 2,
- },
- hideDefaultActions: true,
- };
- this.outboundColumns.push(object4)
-
- //鍑鸿揣涓�瑙圖ata
- 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;
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;
+ let object1 = {
+ label: '瀹㈡埛鍚�',
+ fieldName: 'hospitalName',
+ hideDefaultActions: true,
+ wrapText: true
+ };
+ let object2 = {
+ label: '鍑鸿揣閲戦(鍏�)',
+ fieldName: 'shipmentAmount',
+ type: 'number',
+ typeAttributes: {
+ minimumFractionDigits: 2
+ },
+ hideDefaultActions: true
+ };
+ let object3 = {
+ label: '杩斿搧閲戦(鍏�)',
+ fieldName: 'returnAmount',
+ type: 'number',
+ typeAttributes: {
+ minimumFractionDigits: 2
+ },
+ hideDefaultActions: true
+ };
+ this.outboundColumns.push(object1);
+ this.outboundColumns.push(object2);
+ this.outboundColumns.push(object3);
}
- 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",
- typeAttributes: {
- label: { fieldName: "invoiceFaceAmount" },
- //target: "_blank",
- },
- hideDefaultActions: true,
- };
- this.outboundColumns.push(object5)
- index++;
+ let object4 = {
+ label: '鏈彂绁ㄩ噾棰�(鍏�)',
+ fieldName: 'uninvoicedAmount',
+ type: 'number',
+ typeAttributes: {
+ minimumFractionDigits: 2
+ },
+ hideDefaultActions: true
+ };
+ this.outboundColumns.push(object4);
+
+ //鍑鸿揣涓�瑙圖ata
+ 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;
+ 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;
}
- } else {
- console.log('杩涘叆 else')
- if (index == 0) {
- let object5 = {
- label: '鍙戠エ绁ㄩ潰閲戦(鍏�)',
- cellAttributes: { alignment: 'right' },
- fieldName: "invoiceFaceAmount",
- hideDefaultActions: true,
- type: "number",
- typeAttributes: {
- minimumFractionDigits: 2,
- },
- };
- this.outboundColumns.push(object5)
- index++;
+ 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',
+ typeAttributes: {
+ label: {
+ fieldName: 'invoiceFaceAmount'
+ }
+ //target: "_blank",
+ },
+ hideDefaultActions: true
+ };
+ this.outboundColumns.push(object5);
+ index++;
+ }
+ } else {
+ console.log('杩涘叆 else');
+ if (index == 0) {
+ let object5 = {
+ label: '鍙戠エ绁ㄩ潰閲戦(鍏�)',
+ cellAttributes: { alignment: 'right' },
+ fieldName: 'invoiceFaceAmount',
+ hideDefaultActions: true,
+ type: 'number',
+ typeAttributes: {
+ minimumFractionDigits: 2
+ }
+ };
+ 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')
- this.sumPrice = this.keepTwoDecimalStr(this.sumPrice);
- console.log('end keepTwoDecimalStr = ' + this.sumPrice)
- //鍔犳渶鍚庝竴琛屾樉绀洪噾棰�
- if (this.EditAble) {
- let lastOutboundData = {
- invoiceFaceAmount: this.sumPrice
+ //鍥涜垗浜斿叆
+ //this.sumPrice = this.sumPrice.toFixed(2);
+ //濡傛灉涓嶅洓鑸嶄簲鍏�
+ console.log('start keepTwoDecimalStr');
+ this.sumPrice = this.keepTwoDecimalStr(this.sumPrice);
+ console.log('end keepTwoDecimalStr = ' + this.sumPrice);
+ //鍔犳渶鍚庝竴琛屾樉绀洪噾棰�
+ if (this.EditAble) {
+ let lastOutboundData = {
+ invoiceFaceAmount: this.sumPrice
+ };
+ this.outboundDataSumPrice.push(lastOutboundData);
}
- this.outboundDataSumPrice.push(lastOutboundData);
+ this.outboundColumns = [...this.outboundColumns];
+
+ this.isEditInvoice = !(!this.EditAble || this.isChange);
+ if (
+ this.coc.SummonsForDirction__c == '閿�鍞粰浜岀骇缁忛攢鍟�'
+ )
+ this.isShowSecondaryDistributor = true;
+ if (
+ this.deliveryId == '' &&
+ !this.ExistOutbound &&
+ this.EditAble
+ )
+ this.hideCheckbox = false;
+ this.isShowSpinner = false;
+ this.showLoadingSpinner = false;
+ } else {
+ this.showMyToast('澶辫触', r.msg, 'Error');
}
- this.outboundColumns = [...this.outboundColumns];
-
-
- this.isEditInvoice = !(!this.EditAble || this.isChange);
- if (this.coc.SummonsForDirction__c == '閿�鍞粰浜岀骇缁忛攢鍟�')
- this.isShowSecondaryDistributor = true;
- if (this.deliveryId == '' && !this.ExistOutbound && this.EditAble)
- this.hideCheckbox = false;
- this.isShowSpinner = false;
- this.showLoadingSpinner = false;
- } else {
- this.showMyToast('澶辫触', r.msg, 'Error');
- }
- }).catch((error) => {
- console.log("error = " + JSON.stringify(error));
- });
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ });
}
-
}
-
//涓婁紶閰嶇疆鍗�
uploadOrder(event) {
@@ -839,7 +1019,11 @@
//鏄惁鏄剧ず闄勪欢绉婚櫎
get attDelBtn() {
- if (this.fileName != '' && this.fileName != null && this.fileName != '閫夋嫨涓�涓枃浠朵笂浼�') {
+ if (
+ this.fileName != '' &&
+ this.fileName != null &&
+ this.fileName != '閫夋嫨涓�涓枃浠朵笂浼�'
+ ) {
return true;
} else {
return false;
@@ -858,47 +1042,47 @@
s += '0';
}
return s;
- };
+ }
dataChange(event) {
- let fieldName = event.target.getAttribute("data-field");
+ let fieldName = event.target.getAttribute('data-field');
let value = event.detail.value;
- console.log("fieldName = " + fieldName + " value = " + value);
+ console.log('fieldName = ' + fieldName + ' value = ' + value);
switch (fieldName) {
- case "OrderCode":
+ case 'OrderCode':
this.OrderCode = value;
this.coc['Name'] = value;
break;
- case "ForCustomerText":
+ case 'ForCustomerText':
this.ForCustomerText = value;
this.coc['Order_ForCustomerText__c'] = value;
break;
- case "InvoiceDate":
+ case 'InvoiceDate':
this.InvoiceDate = value;
this.coc['Invoice_Date__c'] = value;
break;
- case "secondaryDistributor":
+ case 'secondaryDistributor':
this.secondaryDistributor = value;
break;
- case "deliveryFromDate":
+ case 'deliveryFromDate':
this.deliveryFromDate = value;
break;
- case "deliveryToDate":
+ case 'deliveryToDate':
this.deliveryToDate = value;
break;
- case "category1":
+ case 'category1':
this.category1 = value;
break;
- case "category2":
+ case 'category2':
this.category2 = value;
break;
- case "invoiceStatus":
+ case 'invoiceStatus':
this.invoiceStatusValue = value;
break;
- case "searchHospitalName":
+ case 'searchHospitalName':
this.searchHospitalName = value;
break;
- case "InvoiceNote":
+ case 'InvoiceNote':
this.InvoiceNote = value;
this.coc['Invoice_Note__c'] = value;
break;
@@ -913,58 +1097,68 @@
//鎼滅储瀹㈡埛鍚�
searchHospitalNameModal() {
- console.log("searchHospitalNameModal");
+ console.log('searchHospitalNameModal');
hospitalInit({
- ctype: this.agencyProType,
+ ctype: this.agencyProType
}).then((r) => {
r = JSON.parse(JSON.stringify(r));
- if (r.status == "Success") {
+ if (r.status == 'Success') {
this.hospitalList = r.entity.at;
for (var i in this.hospitalList) {
- this.hospitalList[i]["stateMasterName"] = this.hospitalList[i].State_Master__r.Name;
+ this.hospitalList[i]['stateMasterName'] =
+ this.hospitalList[i].State_Master__r.Name;
}
- console.log("hospitalInit r = " + JSON.stringify(this.hospitalList));
+ console.log(
+ 'hospitalInit r = ' + JSON.stringify(this.hospitalList)
+ );
this.isModalOpen = true;
}
});
}
searchHospital() {
- console.log("this.searchHospitalName = " + this.searchHospitalName);
+ console.log('this.searchHospitalName = ' + this.searchHospitalName);
serContact({
searchName: this.searchHospitalName,
- ctype: this.agencyProType,
+ ctype: this.agencyProType
}).then((r) => {
r = JSON.parse(JSON.stringify(r));
- if (r.status == "Success") {
+ if (r.status == 'Success') {
this.hospitalList = r.entity.at;
for (var i in this.hospitalList) {
- this.hospitalList[i]["stateMasterName"] =
+ this.hospitalList[i]['stateMasterName'] =
this.hospitalList[i].State_Master__r.Name;
}
- console.log("hospitalInit r = " + JSON.stringify(this.hospitalList));
+ console.log(
+ 'hospitalInit r = ' + JSON.stringify(this.hospitalList)
+ );
}
});
}
//閫夋嫨瀹㈡埛鍚�
searchHandleRowAction(event) {
- console.log("searchHandleRowAction");
+ console.log('searchHandleRowAction');
let row = event.detail.row;
this.HospitalInfo = row.Id;
this.HospitalName = row.Name;
- console.log("this.HospitalInfo = " + this.HospitalInfo + " this.HospitalName = " + this.HospitalName);
+ console.log(
+ 'this.HospitalInfo = ' +
+ this.HospitalInfo +
+ ' this.HospitalName = ' +
+ this.HospitalName
+ );
this.isModalOpen = false;
}
//褰撳鎴峰悕鏄┖鏃躲�傚鎴穒d涔熷彉涓虹┖
clearAgencyI(event) {
this.HospitalName = event.target.value;
- if (this.HospitalName == "" || this.HospitalName == null) {
- this.HospitalInfo = "";
+ if (this.HospitalName == '' || this.HospitalName == null) {
+ this.HospitalInfo = '';
}
- console.log("this.HospitalName = " + this.HospitalName);
- console.log("this.HospitalInfo = " + this.HospitalInfo);
+ console.log('this.HospitalName = ' + this.HospitalName);
+ console.log('this.HospitalInfo = ' + this.HospitalInfo);
}
closeModal() {
@@ -973,10 +1167,12 @@
SaveJs() {
this.isShowSpinner = true;
- let cloneData = this.outboundData
+ let cloneData = this.outboundData;
- debugger
- const selectedRows = this.template.querySelector("[data-field='outbound']").getSelectedRows();
+ debugger;
+ const selectedRows = this.template
+ .querySelector("[data-field='outbound']")
+ .getSelectedRows();
console.log('selectedRows = ' + JSON.stringify(selectedRows));
for (var i in cloneData) {
@@ -1011,7 +1207,10 @@
console.log('this.accountid = ' + this.accountid);
console.log('this.agencyProType = ' + this.agencyProType);
console.log('this.reopen = ' + this.reopen);
- console.log('this.invoiceOrderRecoedschangeLwc = ' + JSON.stringify(this.invoiceOrderRecoedschange));
+ console.log(
+ 'this.invoiceOrderRecoedschangeLwc = ' +
+ JSON.stringify(this.invoiceOrderRecoedschange)
+ );
save({
cocLwc: this.coc,
HospitalNameLwc: this.HospitalName,
@@ -1023,42 +1222,47 @@
accountidLwc: this.accountid,
agencyProTypeLwc: this.agencyProType,
reopenLwc: this.reopen,
- 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 == '') {
- this.isShowSpinner = false;
- console.log('save success');
- let url = "/lexconinvoiceview?invoiceId=" + r.entity.invoiceId;
- console.log('url = ' + url);
- this[NavigationMixin.Navigate]({
- type: "standard__webPage",
- attributes: {
- url: url,
- },
- });
- } else {
- this.showMyToast('淇濆瓨澶辫触', r.msg, 'Error');
- }
- }).catch((error) => {
- console.log("error = " + JSON.stringify(error));
- });
+ 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 == '') {
+ this.isShowSpinner = false;
+ console.log('save success');
+ let url =
+ '/lexconinvoiceview?invoiceId=' + r.entity.invoiceId;
+ console.log('url = ' + url);
+ this[NavigationMixin.Navigate]({
+ type: 'standard__webPage',
+ attributes: {
+ url: url
+ }
+ });
+ } else {
+ this.showMyToast('淇濆瓨澶辫触', r.msg, '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;
- // this.fileName = event.target.files[0].name;
- // this.handleSave();
- // }
- }
-
- handleSave() {
- console.log("saveFile");
+ // this.filesUploaded = event.target.files;
+ // this.fileName = event.target.files[0].name;
+ // this.handleSave();
+ // }
+ }
+
+ handleSave() {
+ console.log('saveFile');
if (this.filesUploaded.length > 0) {
this.showPopSpinner = true;
this.file = this.filesUploaded[0];
@@ -1070,72 +1274,74 @@
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) => {
- r = JSON.parse(JSON.stringify(r));
- console.log("r = " + JSON.stringify(r));
- if (r != '') {
- this.showPopSpinner = false;
- this.showMyToast('涓婁紶鎴愬姛', '', 'Success');
- this.closePop();
- this.init();
- } else {
- this.showMyToast('涓婁紶澶辫触', r.msg, 'Error');
- }
- }).catch((error) => {
- console.log("error = " + error.message);
- this.showMyToast('閿欒', '涓婁紶澶辫触', 'Error');
- });
+ base64Data: encodeURIComponent(this.fileContents)
+ })
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log('r = ' + JSON.stringify(r));
+ if (r != '') {
+ this.showPopSpinner = false;
+ this.showMyToast('涓婁紶鎴愬姛', '', 'Success');
+ this.closePop();
+ this.init();
+ } else {
+ this.showMyToast('涓婁紶澶辫触', r.msg, 'Error');
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + error.message);
+ this.showMyToast('閿欒', '涓婁紶澶辫触', 'Error');
+ });
}
-
handleTypeChange(event) {
- console.log("handleTypeChange");
+ console.log('handleTypeChange');
const typeDetail = event.detail;
- console.log("typeDetail = " + JSON.stringify(typeDetail));
+ console.log('typeDetail = ' + JSON.stringify(typeDetail));
for (var i in this.fileData) {
if (this.fileData[i].recordId == typeDetail.data.recordId) {
this.fileData[i].typeValue = typeDetail.data.typeValue;
this.fileData[i].mailSelectOptsin = typeDetail.data.typeValue;
}
}
- console.log("this.fileData = " + JSON.stringify(this.fileData));
+ console.log('this.fileData = ' + JSON.stringify(this.fileData));
}
newInvoiceJs() {
- let url = "/lexconinvoiceview?isNew=yes";
+ let url = '/lexconinvoiceview?isNew=yes';
console.log('url = ' + url);
this[NavigationMixin.Navigate]({
- type: "standard__webPage",
+ type: 'standard__webPage',
attributes: {
- url: url,
- },
+ url: url
+ }
});
}
saveAttachmentJs() {
- debugger
+ debugger;
this.showLoadingSpinner = true;
- let cloneData = this.deepClone(this.fileData)
+ let cloneData = this.deepClone(this.fileData);
for (var i in cloneData) {
delete cloneData[i].Id;
delete cloneData[i].recordId;
@@ -1152,74 +1358,96 @@
saveAttachment({
attachmentRecoedsLwc: JSON.stringify(cloneData),
invoiceId: this.invoiceId
- }).then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log("r = " + JSON.stringify(r));
- if (r.status == "Success") {
- this.showLoadingSpinner = false;
- this.isShowSpinner = true;
- // const event = new ShowToastEvent({
- // title: 'Success',
- // variant: 'Success',
- // message: '淇濆瓨鎴愬姛',
- // });
- // this.dispatchEvent(event);
- this.showMyToast('闄勪欢淇濆瓨鎴愬姛', '', 'Success');
- //this.init();
- setTimeout(function () {
- //1绉掑悗鎵ц鍒锋柊
- window.location.reload();
- }, 2000); //鍗曚綅鏄绉�
- // let url = "/lexconinvoiceview?invoiceId=" + this.invoiceId;
- // console.log('url = ' + url);
- // this[NavigationMixin.Navigate]({
- // type: "standard__webPage",
- // attributes: {
- // url: url,
- // },
- // });
- } else {
- this.showMyToast('涓婁紶澶辫触', r.msg, 'Error');
- }
- }).catch((error) => {
- console.log("error = " + error.message);
- this.showMyToast('閿欒', '涓婁紶澶辫触', 'Error');
- });
+ })
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log('r = ' + JSON.stringify(r));
+ if (r.status == 'Success') {
+ this.showLoadingSpinner = false;
+ this.isShowSpinner = true;
+ // const event = new ShowToastEvent({
+ // title: 'Success',
+ // variant: 'Success',
+ // message: '淇濆瓨鎴愬姛',
+ // });
+ // this.dispatchEvent(event);
+ this.showMyToast('闄勪欢淇濆瓨鎴愬姛', '', 'Success');
+ //this.init();
+ setTimeout(function () {
+ //1绉掑悗鎵ц鍒锋柊
+ window.location.reload();
+ }, 2000); //鍗曚綅鏄绉�
+ // let url = "/lexconinvoiceview?invoiceId=" + this.invoiceId;
+ // console.log('url = ' + url);
+ // this[NavigationMixin.Navigate]({
+ // type: "standard__webPage",
+ // attributes: {
+ // url: url,
+ // },
+ // });
+ } else {
+ this.showMyToast('涓婁紶澶辫触', r.msg, 'Error');
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + error.message);
+ this.showMyToast('閿欒', '涓婁紶澶辫触', 'Error');
+ });
}
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) => {
- r = JSON.parse(JSON.stringify(r));
- 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;
- }
- console.log("this.invoiceData = " + JSON.stringify(this.invoiceData));
- this.isShowSpinner = false;
- if (r.entity.raesListSize > 0) {
- this.showMyToast('鎼滅储鎴愬姛', '鍏辨绱㈠埌' + r.entity.raesListSize + '涓彂绁�', 'Success');
+ agencyProTypeLwc: this.ConInvoiceListAgencyProType
+ })
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ 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;
+ }
+ console.log(
+ 'this.invoiceData = ' + JSON.stringify(this.invoiceData)
+ );
+ this.isShowSpinner = false;
+ if (r.entity.raesListSize > 0) {
+ this.showMyToast(
+ '鎼滅储鎴愬姛',
+ '鍏辨绱㈠埌' + r.entity.raesListSize + '涓彂绁�',
+ 'Success'
+ );
+ } else {
+ this.showMyToast(
+ '鎼滅储澶辫触',
+ '娌℃湁鎼滅储鍒扮浉鍏冲彂绁�',
+ 'Error'
+ );
+ }
} else {
- this.showMyToast('鎼滅储澶辫触', '娌℃湁鎼滅储鍒扮浉鍏冲彂绁�', 'Error');
+ this.showMyToast('鎼滅储澶辫触', r.msg, 'Error');
}
- } else {
- this.showMyToast('鎼滅储澶辫触', r.msg, 'Error');
- }
- }).catch((error) => {
- console.log("error = " + error.message);
- this.showMyToast('閿欒', '鎼滅储澶辫触', 'Error');
- });
+ })
+ .catch((error) => {
+ console.log('error = ' + error.message);
+ this.showMyToast('閿欒', '鎼滅储澶辫触', 'Error');
+ });
}
ClearJs() {
@@ -1229,30 +1457,38 @@
this.category2 = '';
this.invoiceStatusValue = '';
this.isShowSpinner = true;
- conInvoiceListInit().then((r) => {
- r = JSON.parse(JSON.stringify(r));
- 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;
+ conInvoiceListInit()
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ 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;
+ }
+ console.log(
+ 'this.invoiceData = ' + JSON.stringify(this.invoiceData)
+ );
+ this.isShowSpinner = false;
+ } else {
+ this.showMyToast('鎼滅储澶辫触', r.msg, 'Error');
}
- console.log("this.invoiceData = " + JSON.stringify(this.invoiceData));
- this.isShowSpinner = false;
- } else {
- this.showMyToast('鎼滅储澶辫触', r.msg, 'Error');
- }
- }).catch((error) => {
- console.log("error = " + JSON.stringify(error));
- });
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ });
}
InvoiceorderSearchJs() {
this.isShowSpinner = true;
- debugger
- let cloneData = this.outboundData
- const selectedRows = this.template.querySelector("[data-field='outbound']").getSelectedRows();
+ debugger;
+ let cloneData = this.outboundData;
+ const selectedRows = this.template
+ .querySelector("[data-field='outbound']")
+ .getSelectedRows();
console.log('selectedRows ' + JSON.stringify(selectedRows));
for (var i in cloneData) {
let b = false;
@@ -1293,74 +1529,107 @@
agencyProTypeLwc: this.agencyProType,
HospitalInfoLwc: this.HospitalInfo,
SecondDealerLwc: this.secondaryDistributor,
- invoiceOrderRecoedsLwc: JSON.stringify(cloneData),
- }).then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log("r = " + JSON.stringify(r));
- if (r.status == "Success") {
- this.outboundData = r.entity.invoiceOrderRecoeds;
- 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.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;
- 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]['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;
- this.outboundData[i]['invoiceFaceAmountUrl'] = url;
-
- if (index == 0) {
- let object5 = {
- label: '鍙戠エ绁ㄩ潰閲戦(鍏�)',
- cellAttributes: { alignment: 'right' },
- type: 'url',
- fieldName: "invoiceFaceAmountUrl",
- typeAttributes: {
- label: { fieldName: "invoiceFaceAmount" },
- target: "_blank",
- },
- hideDefaultActions: true,
- };
- this.outboundColumns.push(object5)
- index++;
+ invoiceOrderRecoedsLwc: JSON.stringify(cloneData)
+ })
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log('r = ' + JSON.stringify(r));
+ if (r.status == 'Success') {
+ this.outboundData = r.entity.invoiceOrderRecoeds;
+ 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.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;
+ 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;
}
- } else {
- if (index == 0) {
- let object5 = {
- label: '鍙戠エ绁ㄩ潰閲戦(鍏�)',
- cellAttributes: { alignment: 'right' },
- fieldName: "invoiceFaceAmount",
- hideDefaultActions: true,
- };
- this.outboundColumns.push(object5)
- index++;
+ 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;
+ this.outboundData[i]['invoiceFaceAmountUrl'] = url;
+
+ if (index == 0) {
+ let object5 = {
+ label: '鍙戠エ绁ㄩ潰閲戦(鍏�)',
+ cellAttributes: { alignment: 'right' },
+ type: 'url',
+ fieldName: 'invoiceFaceAmountUrl',
+ typeAttributes: {
+ label: {
+ fieldName: 'invoiceFaceAmount'
+ },
+ target: '_blank'
+ },
+ hideDefaultActions: true
+ };
+ this.outboundColumns.push(object5);
+ index++;
+ }
+ } else {
+ if (index == 0) {
+ let object5 = {
+ label: '鍙戠エ绁ㄩ潰閲戦(鍏�)',
+ cellAttributes: { alignment: 'right' },
+ fieldName: 'invoiceFaceAmount',
+ hideDefaultActions: true
+ };
+ this.outboundColumns.push(object5);
+ index++;
+ }
}
+ //璁$畻鍙戠エ绁ㄩ潰閲戦
+ this.sumPrice += this.outboundData[i].needInvoiceCount;
}
- //璁$畻鍙戠エ绁ㄩ潰閲戦
- this.sumPrice += this.outboundData[i].needInvoiceCount;
+ console.log(
+ 'this.selectedRows = ' +
+ JSON.stringify(this.selectedRows)
+ );
+ this.isShowSpinner = false;
+ } else {
+ this.showMyToast('鎼滅储澶辫触', r.msg, 'Error');
}
- console.log('this.selectedRows = ' + JSON.stringify(this.selectedRows))
- this.isShowSpinner = false;
- } else {
- this.showMyToast('鎼滅储澶辫触', r.msg, 'Error');
- }
- }).catch((error) => {
- console.log("error = " + error.message);
- this.showMyToast('閿欒', '鎼滅储澶辫触', 'Error');
- });
+ })
+ .catch((error) => {
+ console.log('error = ' + error.message);
+ this.showMyToast('閿欒', '鎼滅储澶辫触', 'Error');
+ });
}
getSelectedRows(event) {
@@ -1384,37 +1653,43 @@
this.isShowSpinner = true;
deleteButton({
cocLwc: this.coc,
- 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('url = ' + url);
- this[NavigationMixin.Navigate]({
- type: "standard__webPage",
- attributes: {
- url: url,
- },
- });
- } else {
- this.showMyToast('鍒犻櫎澶辫触', r.msg, 'Error');
- }
- }).catch((error) => {
- console.log("error = " + error.message);
- });
+ 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('url = ' + url);
+ this[NavigationMixin.Navigate]({
+ type: 'standard__webPage',
+ attributes: {
+ url: url
+ }
+ });
+ } else {
+ this.showMyToast('鍒犻櫎澶辫触', r.msg, 'Error');
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + error.message);
+ });
}
SetEditAbleJs() {
let statusEditAbleJs = 'Redirect';
- let url = "/lexconinvoiceview?invoiceId=" + this.invoiceId + '&KeyWords=' + statusEditAbleJs;
+ let url =
+ '/lexconinvoiceview?invoiceId=' +
+ this.invoiceId +
+ '&KeyWords=' +
+ statusEditAbleJs;
console.log('url = ' + url);
this[NavigationMixin.Navigate]({
- type: "standard__webPage",
+ type: 'standard__webPage',
attributes: {
- url: url,
- },
+ url: url
+ }
});
}
@@ -1424,35 +1699,44 @@
outOrderStringListLwc: this.outOrderStringListLwc,
outordercountMapLwc: this.outordercountMapLwc,
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 = "/s/lexconinvoiceview?invoiceId=" + this.invoiceId;
- console.log('url = ' + url);
- window.open(url, '_self');
- // this[NavigationMixin.Navigate]({
- // type: "standard__webPage",
- // attributes: {
- // url: url,
- // },
- // });
- } else {
- this.showMyToast('閿欒', r.msg, 'Error');
- }
- }).catch((error) => {
- console.log("error = " + error.message);
- });
+ })
+ .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('url = ' + url);
+ window.open(url, '_self');
+ // this[NavigationMixin.Navigate]({
+ // type: "standard__webPage",
+ // attributes: {
+ // url: url,
+ // },
+ // });
+ } else {
+ this.showMyToast('閿欒', r.msg, 'Error');
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + error.message);
+ });
}
openReportJs() {
- console.log("openReportJs");
+ console.log('openReportJs');
let reportUrl = this.label.LexConInvoiceViewReport;
- let reportFilters = '[{"operator":"equals","value":"' + this.OrderCode + '","column":"FK_NAME"}]';
+ let reportFilters =
+ '[{"operator":"equals","value":"' +
+ this.OrderCode +
+ '","column":"FK_NAME"}]';
console.log('reportUrl = ' + reportUrl);
- let url = "/s/report/" + reportUrl + "?reportFilters=" + encodeURIComponent(reportFilters);
+ let url =
+ '/s/report/' +
+ reportUrl +
+ '?reportFilters=' +
+ encodeURIComponent(reportFilters);
window.open(url);
// this[NavigationMixin.Navigate]({
// type: "standard__webPage",
@@ -1467,13 +1751,18 @@
// statusEdit = 'Redirect';
// PageReference ref = new Pagereference('/ConInvoiceView?invoiceId=' + invoiceId + '&reopen=isreopen' + '&KeyWords=' + statusEdit);
let statusEditAbleJs = 'Redirect';
- let url = "/lexconinvoiceview?invoiceId=" + this.invoiceId + '&reopen=isreopen' + '&KeyWords=' + statusEditAbleJs;
+ let url =
+ '/lexconinvoiceview?invoiceId=' +
+ this.invoiceId +
+ '&reopen=isreopen' +
+ '&KeyWords=' +
+ statusEditAbleJs;
console.log('url = ' + url);
this[NavigationMixin.Navigate]({
- type: "standard__webPage",
+ type: 'standard__webPage',
attributes: {
- url: url,
- },
+ url: url
+ }
});
}
@@ -1493,26 +1782,36 @@
iconName = 'utility:error';
}
if (message != '') {
- content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
} else {
content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template.querySelector('c-common-toast').showToast(variant, content, iconName, 10000);
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
}
handleLoad() {
- console.log('handleLoad')
+ console.log('handleLoad');
try {
const style = document.createElement('style');
- style.innerText = '.hehe-layoutItem .slds-button__icon {display: none;}';
+ style.innerText =
+ '.hehe-layoutItem .slds-button__icon {display: none;}';
this.template.querySelector('.hideHelpText').appendChild(style);
const style2 = document.createElement('style');
- style2.innerText = '.hehe-layoutItem .slds-form-element__label {padding : 0px}';
+ style2.innerText =
+ '.hehe-layoutItem .slds-form-element__label {padding : 0px}';
this.template.querySelector('.hideHelpText').appendChild(style2);
const style3 = document.createElement('style');
- style3.innerText = '.readOnly .slds-form-element__label {padding-top: 7px;}';
+ style3.innerText =
+ '.readOnly .slds-form-element__label {padding-top: 7px;}';
this.template.querySelector('.hideHelpText').appendChild(style3);
} catch (error) {
console.log(error);
@@ -1531,17 +1830,19 @@
s += '0';
}
return s;
- };
+ }
handleLoad2() {
- console.log('handleLoad2')
+ console.log('handleLoad2');
try {
const style = document.createElement('style');
- style.innerText = '.hehe-layoutItem .slds-button__icon {display: none;}';
+ style.innerText =
+ '.hehe-layoutItem .slds-button__icon {display: none;}';
this.template.querySelector('.hideHelpText').appendChild(style);
const style2 = document.createElement('style');
- style2.innerText = '.hehe-layoutItem .slds-form-element__label {padding : 0px}';
+ style2.innerText =
+ '.hehe-layoutItem .slds-form-element__label {padding : 0px}';
this.template.querySelector('.hideHelpText').appendChild(style2);
} catch (error) {
console.log(error);
@@ -1549,120 +1850,203 @@
}
handleUnitChange(event) {
- console.log("handleUnitChange");
- this.invoiceAllpriceData[0].invoiceAllprice = 0.00;
+ console.log('handleUnitChange');
+ this.invoiceAllpriceData[0].invoiceAllprice = 0.0;
const unitDetail = event.detail;
- console.log("unitDetail = " + JSON.stringify(unitDetail));
+ console.log('unitDetail = ' + JSON.stringify(unitDetail));
for (var i in this.detailsData) {
if (this.detailsData[i].recordId == unitDetail.data.recordId) {
this.detailsData[i].unitValue = unitDetail.data.unitValue;
- this.detailsData[i].esd.Invoice_Unit__c = unitDetail.data.unitValue;
- if (this.detailsSelectedRows.indexOf(this.detailsData[i].recordId) == -1)
+ this.detailsData[i].esd.Invoice_Unit__c =
+ unitDetail.data.unitValue;
+ if (
+ this.detailsSelectedRows.indexOf(
+ this.detailsData[i].recordId
+ ) == -1
+ )
this.detailsSelectedRows.push(this.detailsData[i].recordId);
}
}
this.detailsSelectedRows = [...this.detailsSelectedRows];
-
- console.log('this.detailsSelectedRows = ' + JSON.stringify(this.detailsSelectedRows))
+ console.log(
+ 'this.detailsSelectedRows = ' +
+ JSON.stringify(this.detailsSelectedRows)
+ );
for (var i in this.detailsData) {
- this.detailsData[i].invoiceAllprice = 0.00;
+ this.detailsData[i].invoiceAllprice = 0.0;
for (var j in this.detailsSelectedRows) {
- console.log('this.detailsData[i].Id = ' + this.detailsData[i].Id);
- console.log('this.detailsSelectedRows[j] = ' + this.detailsSelectedRows[j]);
+ console.log(
+ 'this.detailsData[i].Id = ' + this.detailsData[i].Id
+ );
+ console.log(
+ 'this.detailsSelectedRows[j] = ' +
+ this.detailsSelectedRows[j]
+ );
if (this.detailsData[i].Id == this.detailsSelectedRows[j]) {
- this.detailsData[i].invoiceAllprice = this.amend(this.detailsData[i].shipmentNumber, this.detailsData[i].esdInvoiceUnitprice, '*');
- console.log('this.detailsData[i].invoiceAllprice = ' + this.detailsData[i].invoiceAllprice);
+ this.detailsData[i].invoiceAllprice = this.amend(
+ this.detailsData[i].shipmentNumber,
+ this.detailsData[i].esdInvoiceUnitprice,
+ '*'
+ );
+ console.log(
+ 'this.detailsData[i].invoiceAllprice = ' +
+ this.detailsData[i].invoiceAllprice
+ );
}
}
- this.invoiceAllpriceData[0].invoiceAllprice = this.amend(this.invoiceAllpriceData[0].invoiceAllprice, this.detailsData[i].invoiceAllprice, '+');
+ this.invoiceAllpriceData[0].invoiceAllprice = this.amend(
+ this.invoiceAllpriceData[0].invoiceAllprice,
+ this.detailsData[i].invoiceAllprice,
+ '+'
+ );
}
this.detailsData = [...this.detailsData];
this.invoiceAllpriceData = [...this.invoiceAllpriceData];
}
handleShipmentNumber(event) {
- console.log("handleShipmentNumber");
- this.invoiceAllpriceData[0].invoiceAllprice = 0.00;
+ console.log('handleShipmentNumber');
+ this.invoiceAllpriceData[0].invoiceAllprice = 0.0;
const numberDetail = event.detail;
- console.log('numberDetail = ' + JSON.stringify(numberDetail))
+ console.log('numberDetail = ' + JSON.stringify(numberDetail));
if (numberDetail.data.shipmentnumber == 0) {
- if (this.detailsSelectedRows.indexOf(numberDetail.data.recordId) != -1) {
- this.detailsSelectedRows.splice(this.detailsSelectedRows.indexOf(numberDetail.data.recordId), 1);
+ if (
+ this.detailsSelectedRows.indexOf(numberDetail.data.recordId) !=
+ -1
+ ) {
+ this.detailsSelectedRows.splice(
+ this.detailsSelectedRows.indexOf(
+ numberDetail.data.recordId
+ ),
+ 1
+ );
}
}
- console.log("start this.detailsSelectedRows = " + JSON.stringify(this.detailsSelectedRows));
- console.log("numberDetail = " + JSON.stringify(numberDetail));
+ console.log(
+ 'start this.detailsSelectedRows = ' +
+ JSON.stringify(this.detailsSelectedRows)
+ );
+ console.log('numberDetail = ' + JSON.stringify(numberDetail));
for (var i in this.detailsData) {
if (this.detailsData[i].recordId == numberDetail.data.recordId) {
- this.detailsData[i].shipmentNumber = Number(numberDetail.data.shipmentnumber);
- this.detailsData[i].invoiceCount = Number(numberDetail.data.shipmentnumber);
- if (this.detailsSelectedRows.indexOf(this.detailsData[i].recordId) == -1 && numberDetail.data.shipmentnumber != 0)
+ this.detailsData[i].shipmentNumber = Number(
+ numberDetail.data.shipmentnumber
+ );
+ this.detailsData[i].invoiceCount = Number(
+ numberDetail.data.shipmentnumber
+ );
+ if (
+ this.detailsSelectedRows.indexOf(
+ this.detailsData[i].recordId
+ ) == -1 &&
+ numberDetail.data.shipmentnumber != 0
+ )
this.detailsSelectedRows.push(this.detailsData[i].recordId);
}
}
- console.log("end this.detailsSelectedRows = " + JSON.stringify(this.detailsSelectedRows));
+ console.log(
+ 'end this.detailsSelectedRows = ' +
+ JSON.stringify(this.detailsSelectedRows)
+ );
this.detailsSelectedRows = [...this.detailsSelectedRows];
-
- console.log('this.detailsSelectedRows = ' + JSON.stringify(this.detailsSelectedRows));
+ console.log(
+ 'this.detailsSelectedRows = ' +
+ JSON.stringify(this.detailsSelectedRows)
+ );
for (var i in this.detailsData) {
- this.detailsData[i].invoiceAllprice = 0.00;
+ this.detailsData[i].invoiceAllprice = 0.0;
for (var j in this.detailsSelectedRows) {
- console.log('this.detailsData[i].Id = ' + this.detailsData[i].Id);
- console.log('this.detailsSelectedRows[j] = ' + this.detailsSelectedRows[j]);
+ console.log(
+ 'this.detailsData[i].Id = ' + this.detailsData[i].Id
+ );
+ console.log(
+ 'this.detailsSelectedRows[j] = ' +
+ this.detailsSelectedRows[j]
+ );
if (this.detailsData[i].Id == this.detailsSelectedRows[j]) {
- this.detailsData[i].invoiceAllprice = this.amend(this.detailsData[i].shipmentNumber, this.detailsData[i].esdInvoiceUnitprice, '*');
- console.log('this.detailsData[i].invoiceAllprice = ' + this.detailsData[i].invoiceAllprice);
+ this.detailsData[i].invoiceAllprice = this.amend(
+ this.detailsData[i].shipmentNumber,
+ this.detailsData[i].esdInvoiceUnitprice,
+ '*'
+ );
+ console.log(
+ 'this.detailsData[i].invoiceAllprice = ' +
+ this.detailsData[i].invoiceAllprice
+ );
}
}
- this.invoiceAllpriceData[0].invoiceAllprice = this.amend(this.invoiceAllpriceData[0].invoiceAllprice, this.detailsData[i].invoiceAllprice, '+');
+ this.invoiceAllpriceData[0].invoiceAllprice = this.amend(
+ this.invoiceAllpriceData[0].invoiceAllprice,
+ this.detailsData[i].invoiceAllprice,
+ '+'
+ );
}
this.detailsData = [...this.detailsData];
this.invoiceAllpriceData = [...this.invoiceAllpriceData];
}
detailsGetSelectedRows(event) {
- console.log("detailsGetSelectedRows ");
- this.invoiceAllpriceData[0].invoiceAllprice = 0.00;
+ console.log('detailsGetSelectedRows ');
+ this.invoiceAllpriceData[0].invoiceAllprice = 0.0;
let selectedRows = event.detail.selectedRows;
for (var i in this.detailsData) {
- this.detailsData[i].invoiceAllprice = 0.00;
+ this.detailsData[i].invoiceAllprice = 0.0;
for (var j in selectedRows) {
if (this.detailsData[i].Id == selectedRows[j].esd.Id) {
- this.detailsData[i].invoiceAllprice = this.amend(this.detailsData[i].shipmentNumber, this.detailsData[i].esdInvoiceUnitprice, '*');
- console.log('this.detailsData[i].invoiceAllprice = ' + this.detailsData[i].invoiceAllprice);
+ this.detailsData[i].invoiceAllprice = this.amend(
+ this.detailsData[i].shipmentNumber,
+ this.detailsData[i].esdInvoiceUnitprice,
+ '*'
+ );
+ console.log(
+ 'this.detailsData[i].invoiceAllprice = ' +
+ this.detailsData[i].invoiceAllprice
+ );
}
}
- this.invoiceAllpriceData[0].invoiceAllprice = this.amend(this.invoiceAllpriceData[0].invoiceAllprice, this.detailsData[i].invoiceAllprice, '+');
- console.log('this.invoiceAllpriceData[0].invoiceAllprice = ' + this.invoiceAllpriceData[0].invoiceAllprice);
+ this.invoiceAllpriceData[0].invoiceAllprice = this.amend(
+ this.invoiceAllpriceData[0].invoiceAllprice,
+ this.detailsData[i].invoiceAllprice,
+ '+'
+ );
+ console.log(
+ 'this.invoiceAllpriceData[0].invoiceAllprice = ' +
+ this.invoiceAllpriceData[0].invoiceAllprice
+ );
}
- console.log('start this.detailsData = ' + JSON.stringify(this.detailsData));
+ console.log(
+ 'start this.detailsData = ' + JSON.stringify(this.detailsData)
+ );
this.detailsData = [...this.detailsData];
- console.log('end this.detailsData = ' + JSON.stringify(this.detailsData));
+ console.log(
+ 'end this.detailsData = ' + JSON.stringify(this.detailsData)
+ );
this.invoiceAllpriceData = [...this.invoiceAllpriceData];
}
ComputePrice(index, number, price) {
- console.log("index = " + index);
- console.log("number = " + number);
- console.log("price = " + price);
- let shipmentAmount = this.amend(number, price, "*");
- console.log("shipmentAmount = " + shipmentAmount);
+ console.log('index = ' + index);
+ console.log('number = ' + number);
+ console.log('price = ' + price);
+ let shipmentAmount = this.amend(number, price, '*');
+ console.log('shipmentAmount = ' + shipmentAmount);
let sumPrice = 0.0;
this.data[index].shipmentAmount = shipmentAmount;
for (var i in this.data) {
- if (this.data[i].shipmentAmount) sumPrice += this.data[i].shipmentAmount;
+ if (this.data[i].shipmentAmount)
+ sumPrice += this.data[i].shipmentAmount;
}
- this.sumPrice = sumPrice + "鍏�";
+ this.sumPrice = sumPrice + '鍏�';
//瀛樹笅閫夋嫨琛岋紝涓嶄細琚竻绌�
if (this.selectedRows.indexOf(this.data[index].Id) == -1)
this.selectedRows.push(this.data[index].Id);
this.data = [...this.data];
- this.selectedRows = [...this.selectedRows]
- console.log("this.selectedRows = " + JSON.stringify(this.selectedRows));
- console.log("this.data = " + JSON.stringify(this.data));
+ this.selectedRows = [...this.selectedRows];
+ console.log('this.selectedRows = ' + JSON.stringify(this.selectedRows));
+ console.log('this.data = ' + JSON.stringify(this.data));
}
deepClone(obj) {
@@ -1673,7 +2057,9 @@
this.isShowSpinner = true;
let cloneData = this.deepClone(this.detailsData);
- let selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
+ let selectedRows = this.template
+ .querySelector('c-lex-custom-lightning-datatable')
+ .getSelectedRows();
console.log('selectedRows = ' + JSON.stringify(selectedRows));
for (var i in cloneData) {
@@ -1700,29 +2086,29 @@
}
console.log('cloneData = ' + JSON.stringify(cloneData));
-
-
detailsSave({
consumableorderdetails1RecordsLwc: JSON.stringify(cloneData),
invoiceIdLwc: this.invoiceId,
orderIdLwc: this.orderId
- }).then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log("r = " + JSON.stringify(r));
- if (r.status == "Success") {
- let url = "/lexconinvoiceview?invoiceId=" + this.invoiceId;
- this[NavigationMixin.Navigate]({
- type: "standard__webPage",
- attributes: {
- url: url,
- },
- });
- } else {
- this.showMyToast('淇濆瓨澶辫触', r.msg, 'Error');
- }
- }).catch((error) => {
- console.log("error = " + error.message);
- });
+ })
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log('r = ' + JSON.stringify(r));
+ if (r.status == 'Success') {
+ let url = '/lexconinvoiceview?invoiceId=' + this.invoiceId;
+ this[NavigationMixin.Navigate]({
+ type: 'standard__webPage',
+ attributes: {
+ url: url
+ }
+ });
+ } else {
+ this.showMyToast('淇濆瓨澶辫触', r.msg, 'Error');
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + error.message);
+ });
}
//num1 num2浼犲叆涓や釜鍊� symbol +-*/绗﹀彿
@@ -1734,27 +2120,27 @@
str2Length;
//瑙e喅鏁存暟娌℃湁灏忔暟鐐规柟娉�
try {
- str1Length = str1.split(".")[1].length;
+ str1Length = str1.split('.')[1].length;
} catch (error) {
str1Length = 0;
}
try {
- str2Length = str2.split(".")[1].length;
+ str2Length = str2.split('.')[1].length;
} catch (error) {
str2Length = 0;
}
var step = Math.pow(10, Math.max(str1Length, str2Length));
switch (symbol) {
- case "+":
+ case '+':
result = (num1 * step + num2 * step) / step;
break;
- case "-":
+ case '-':
result = (num1 * step - num2 * step) / step;
break;
- case "*":
+ case '*':
result = (num1 * step * (num2 * step)) / step / step;
break;
- case "/":
+ case '/':
result = (num1 * step) / (num2 * step);
break;
default:
@@ -1767,23 +2153,23 @@
deleteAtt(event) {
this.isShowSpinner = true;
//var recordId = event.detail.data.recordId;
- var recordId = event.target.getAttribute("data-fileid");
+ var recordId = event.target.getAttribute('data-fileid');
console.log('attid:' + recordId);
deleteAtt({
contentVersionId: recordId
- }).then(r => {
- r = JSON.parse(JSON.stringify(r));
- if (r.status == "Success") {
- this.showMyToast('鍒犻櫎鎴愬姛', '', 'Success');
- if (this.fileData.length == 1)
- window.location.reload();
- else
- this.init();
- } else {
- this.showMyToast('鍒犻櫎澶辫触', r.msg, 'Error');
- }
- }).catch(error => {
- this.showMyToast('閿欒', error.message, 'Error');
})
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ if (r.status == 'Success') {
+ this.showMyToast('鍒犻櫎鎴愬姛', '', 'Success');
+ if (this.fileData.length == 1) window.location.reload();
+ else this.init();
+ } else {
+ this.showMyToast('鍒犻櫎澶辫触', r.msg, 'Error');
+ }
+ })
+ .catch((error) => {
+ this.showMyToast('閿欒', error.message, 'Error');
+ });
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConsumable/lexConsumable.html b/force-app/main/default/lwc/lexConsumable/lexConsumable.html
index 33ba4d1..0b6d4b0 100644
--- a/force-app/main/default/lwc/lexConsumable/lexConsumable.html
+++ b/force-app/main/default/lwc/lexConsumable/lexConsumable.html
@@ -2,7 +2,10 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
+ <div
+ role="status"
+ class="slds-spinner slds-spinner_medium slds-spinner_brand"
+ >
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -11,36 +14,93 @@
</template>
<c-common-toast></c-common-toast>
<template if:true={showPage}>
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
- <div style="padding:10px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ "
+ >
+ <div style="padding: 10px">
<!-- 鎸夐挳 -->
<template if:true={showEditBtn}>
<!-- <lightning-button style="margin: 5px;" label="缂栬緫" disabled={disabledEditBtn} onclick={editOrder}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" disabled={disabledEditBtn} onclick={editOrder}>缂栬緫</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ disabled={disabledEditBtn}
+ onclick={editOrder}
+ >
+ 缂栬緫
+ </button>
</template>
<template if:true={showPrintSheetBtn}>
<!-- <lightning-button style="margin: 5px;" label="鎵撳嵃閰嶇疆鍗�" onclick={printOrder}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="鎵撳嵃閰嶇疆鍗�" onclick={printOrder}>鎵撳嵃閰嶇疆鍗�</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ style="margin: 5px"
+ label="鎵撳嵃閰嶇疆鍗�"
+ onclick={printOrder}
+ >
+ 鎵撳嵃閰嶇疆鍗�
+ </button>
</template>
<template if:true={showUploadSheetBtn}>
<!-- <lightning-button style="margin: 5px;" label="涓婁紶閰嶇疆鍗�" disabled={disabledUploadSheetBtn} onclick={uploadOrder}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="涓婁紶閰嶇疆鍗�" disabled={disabledUploadSheetBtn} onclick={uploadOrder}>涓婁紶閰嶇疆鍗�</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ style="margin: 5px"
+ label="涓婁紶閰嶇疆鍗�"
+ disabled={disabledUploadSheetBtn}
+ onclick={uploadOrder}
+ >
+ 涓婁紶閰嶇疆鍗�
+ </button>
</template>
<template if:true={showSubOrderbtn}>
<!-- <lightning-button style="margin: 5px;" label="鎻愪氦璁㈠崟" disabled={disabledSubOrderbtn} onclick={submitOrder}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="鎻愪氦璁㈠崟" disabled={disabledSubOrderbtn} onclick={submitOrder}>鎻愪氦璁㈠崟</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ style="margin: 5px"
+ label="鎻愪氦璁㈠崟"
+ disabled={disabledSubOrderbtn}
+ onclick={submitOrder}
+ >
+ 鎻愪氦璁㈠崟
+ </button>
</template>
<template if:true={showSaveOrderbtn1}>
<!-- <lightning-button style="margin: 5px;" label="淇濆瓨璁㈠崟" onclick={saveOrder}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="淇濆瓨璁㈠崟" onclick={saveOrder}>淇濆瓨璁㈠崟</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ style="margin: 5px"
+ label="淇濆瓨璁㈠崟"
+ onclick={saveOrder}
+ >
+ 淇濆瓨璁㈠崟
+ </button>
</template>
<template if:true={showSaveOrderbtn2}>
<!-- <lightning-button style="margin: 5px;" label="淇濆瓨璁㈠崟" onclick={orderCopy}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="淇濆瓨璁㈠崟" onclick={orderCopy}>淇濆瓨璁㈠崟</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ style="margin: 5px"
+ label="淇濆瓨璁㈠崟"
+ onclick={orderCopy}
+ >
+ 淇濆瓨璁㈠崟
+ </button>
</template>
<template if:true={showDeleteBtn}>
<!-- <lightning-button style="margin: 5px;" label="鍒犻櫎" disabled={disabledDeleteBtn} onclick={deleteOrder}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="鍒犻櫎" disabled={disabledDeleteBtn} onclick={deleteOrder}>鍒犻櫎</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ style="margin: 5px"
+ label="鍒犻櫎"
+ disabled={disabledDeleteBtn}
+ onclick={deleteOrder}
+ >
+ 鍒犻櫎
+ </button>
</template>
<!-- <template if:true={showOfferPriceInputBtn}>
<lightning-button style="margin: 5px;" label="鐗逛环閲戦褰曞叆" disabled={disabledOfferPriceInputBtn} onclick={inputOfferPrice}></lightning-button>
@@ -48,13 +108,32 @@
</template> -->
<template if:true={showReapplyBtn}>
<!-- <lightning-button style="margin: 5px;" label="鍐嶇敵璇�" onclick={reapplyOrder}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="鍐嶇敵璇�" onclick={reapplyOrder}>鍐嶇敵璇�</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ style="margin: 5px"
+ label="鍐嶇敵璇�"
+ onclick={reapplyOrder}
+ >
+ 鍐嶇敵璇�
+ </button>
</template>
- <p style="height: 10px;"></p>
+ <p style="height: 10px"></p>
<!-- 璁㈠崟淇℃伅 -->
<template if:false={editAble}>
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div
+ style="
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -64,21 +143,35 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>璁㈠崟淇℃伅</strong></p> -->
</div>
- <div style="padding:10px;">
- <lightning-record-view-form record-id={cocId} object-api-name="Consumable_order__c">
- <table style="width: 100%;">
+ <div style="padding: 10px">
+ <lightning-record-view-form
+ record-id={cocId}
+ object-api-name="Consumable_order__c"
+ >
+ <table style="width: 100%">
<tbody>
<tr>
<td style="width: 10%"></td>
- <td style="width: 40%;"><lightning-output-field class="outputfont" field-name="Name"></lightning-output-field></td>
- <td style="width: 40%;"><lightning-output-field field-name="Order_status__c"></lightning-output-field></td>
+ <td style="width: 40%">
+ <lightning-output-field
+ class="outputfont"
+ field-name="Name"
+ ></lightning-output-field>
+ </td>
+ <td style="width: 40%">
+ <lightning-output-field
+ field-name="Order_status__c"
+ ></lightning-output-field>
+ </td>
<td style="width: 10%"></td>
</tr>
<tr>
<td></td>
<td>
<template if:false={editAble}>
- <lightning-output-field field-name="Total_amount__c"></lightning-output-field>
+ <lightning-output-field
+ field-name="Total_amount__c"
+ ></lightning-output-field>
</template>
</td>
<td>
@@ -87,11 +180,14 @@
<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>
- </tr>
+ </tr>
<tr>
<td></td>
<!-- <td>
@@ -103,8 +199,12 @@
</template>
</td> -->
<td>
- <template if:true={showAttUploadDate}>
- <lightning-output-field field-name="Consumable_pdf_insert_day__c"></lightning-output-field>
+ <template
+ if:true={showAttUploadDate}
+ >
+ <lightning-output-field
+ field-name="Consumable_pdf_insert_day__c"
+ ></lightning-output-field>
</template>
</td>
<td></td>
@@ -122,8 +222,12 @@
<tr>
<td></td>
<td>
- <template if:true={showOrderDate}>
- <lightning-output-field field-name="Order_date__c"></lightning-output-field>
+ <template
+ if:true={showOrderDate}
+ >
+ <lightning-output-field
+ field-name="Order_date__c"
+ ></lightning-output-field>
</template>
</td>
<td></td>
@@ -132,26 +236,71 @@
<tr>
<td></td>
<td colspan="2">
- <lightning-card class="attListTitle" variant="Narrow" title="闄勪欢鍒楄〃" icon-name="utility:attach">
- <lightning-layout slot="footer" multiple-rows="true">
- <template for:each={attachmentRecoeds} for:item="item" for:index="index">
- <lightning-layout-item padding="around-none" size="2" key={item.recordId} style="text-align: left;padding:5px">
- <lightning-icon title={item.fileFullName} style="margin-left: 20px;" icon-name="doctype:gform" alternative-text={item.fileFullName} size="large"></lightning-icon><br/>
+ <lightning-card
+ class="attListTitle"
+ variant="Narrow"
+ title="闄勪欢鍒楄〃"
+ icon-name="utility:attach"
+ >
+ <lightning-layout
+ slot="footer"
+ multiple-rows="true"
+ >
+ <template
+ for:each={attachmentRecoeds}
+ for:item="item"
+ for:index="index"
+ >
+ <lightning-layout-item
+ padding="around-none"
+ size="2"
+ key={item.recordId}
+ style="
+ text-align: left;
+ padding: 5px;
+ "
+ >
+ <lightning-icon
+ title={item.fileFullName}
+ style="
+ margin-left: 20px;
+ "
+ icon-name="doctype:gform"
+ alternative-text={item.fileFullName}
+ size="large"
+ ></lightning-icon
+ ><br />
<!-- <span style="word-wrap:break-word; word-break:break-all;width:80px;display:flex;" title={item.fileFullName}>
{item.fileName}
</span> -->
- <div title={item.fileFullName} style="width: 100px;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;">
+ <div
+ title={item.fileFullName}
+ style="
+ width: 100px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+ "
+ >
{item.fileName}
</div>
<p>
<!-- <a data-fileid ={item.documentId} onclick={previweAtt}> -->
- <a href={item.attUrl} target="_blank">
- 棰勮
- </a> 路
- <a href={item.downloadUrl}>
- 涓嬭浇
- </a> 路
- <a data-fileid ={item.recordId} onclick={deleteAtt}>
+ <a
+ href={item.attUrl}
+ target="_blank"
+ >
+ 棰勮 </a
+ > 路
+ <a
+ href={item.downloadUrl}
+ >
+ 涓嬭浇 </a
+ > 路
+ <a
+ data-fileid={item.recordId}
+ onclick={deleteAtt}
+ >
鍒犻櫎
</a>
</p>
@@ -171,8 +320,15 @@
</template>
<!-- searchBlock -->
<template if:true={editAble}>
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
- <div style="padding:10px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div style="padding: 10px">
<table>
<tbody>
<!-- <tr>
@@ -208,62 +364,190 @@
<!-- <tr style="height: 10px;"></tr> -->
<tr>
<td>
- <div style="color:#696969;font-size:16px;">娑堣�楀搧鍚嶇О</div>
- </td>
- <td>
- <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>
- </td>
- <td>
- <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>
- <td >
- <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>
- <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>
- <td style="width: 100px;">
- <div style="color:#696969;font-size:16px;"><span style="color: red;">* </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
+ style="
+ color: #696969;
+ font-size: 16px;
+ "
+ >
+ 娑堣�楀搧鍚嶇О
</div>
</td>
- <td style="width: 30px;"></td>
- <td style="width:66px;">
- <template if:true={showHospital}>
- <div style="color:#696969;font-size:16px;"><span style="color: red;">* </span>鍖婚櫌</div>
- </template>
+ <td>
+ <lightning-input
+ class="inputFont"
+ variant="label-hidden"
+ label="娑堣�楀搧鍚嶇О"
+ value={category1}
+ onchange={category1Change}
+ ></lightning-input>
</td>
- <td colspan="4" style="padding-bottom:5px;padding-top:5px;">
+ <td></td>
+ <td>
+ <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>
+ </td>
+ <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>
+ </td>
+ <td></td>
+ <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>
+ </tr>
+ <tr style="height: 10px"></tr>
+ <tr>
+ <td style="width: 100px">
+ <div
+ style="
+ color: #696969;
+ font-size: 16px;
+ "
+ >
+ <span style="color: red"
+ >* </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: 30px"></td>
+ <td style="width: 66px">
<template if:true={showHospital}>
- <div class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right">
- <lightning-icon size="x-small" class="iconMargin slds-icon slds-input__icon slds-input__icon_right slds-icon-text-default" icon-name="utility:search" ></lightning-icon>
- <lightning-input class="inputFont" variant="label-hidden" label="鍖婚櫌" placeholder="璇烽�夋嫨鍖婚櫌" value={hospitalName} onclick={showSearchHos} onchange={changeHos}></lightning-input>
+ <div
+ style="
+ color: #696969;
+ font-size: 16px;
+ "
+ >
+ <span style="color: red"
+ >* </span
+ >鍖婚櫌
</div>
</template>
</td>
- <td style="width: 30px;"></td>
+ <td
+ colspan="4"
+ style="
+ padding-bottom: 5px;
+ padding-top: 5px;
+ "
+ >
+ <template if:true={showHospital}>
+ <div
+ class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right"
+ >
+ <lightning-icon
+ size="x-small"
+ class="iconMargin slds-icon slds-input__icon slds-input__icon_right slds-icon-text-default"
+ icon-name="utility:search"
+ ></lightning-icon>
+ <lightning-input
+ class="inputFont"
+ variant="label-hidden"
+ label="鍖婚櫌"
+ placeholder="璇烽�夋嫨鍖婚櫌"
+ value={hospitalName}
+ onclick={showSearchHos}
+ onchange={changeHos}
+ ></lightning-input>
+ </div>
+ </template>
+ </td>
+ <td style="width: 30px"></td>
<td colspan="2">
- <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="width:130px;height:32px;margin-right: 10px;" label="娑堣�楀搧鎼滅储" onclick={searchProduct}>娑堣�楀搧鎼滅储</button>
- <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="width:80px;height:32px;" label="娓呯┖" onclick={clear}>娓呯┖</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
+ style="
+ width: 130px;
+ height: 32px;
+ margin-right: 10px;
+ "
+ label="娑堣�楀搧鎼滅储"
+ onclick={searchProduct}
+ >
+ 娑堣�楀搧鎼滅储
+ </button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
+ style="
+ width: 80px;
+ height: 32px;
+ "
+ label="娓呯┖"
+ onclick={clear}
+ >
+ 娓呯┖
+ </button>
</td>
</tr>
</tbody>
@@ -273,31 +557,94 @@
</template>
<!-- 璀﹀憡鎻愰啋 -->
<template if:true={hasWarning}>
- <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
- <div style="border-bottom: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;color:#ff6a00;font-size:17px;">
- <lightning-icon style="margin: 3px;" icon-name="utility:warning" size="small"></lightning-icon>
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div
+ style="
+ border-bottom: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ color: #ff6a00;
+ font-size: 17px;
+ "
+ >
+ <lightning-icon
+ style="margin: 3px"
+ icon-name="utility:warning"
+ size="small"
+ ></lightning-icon>
<strong> 璀﹀憡</strong>
</div>
<template for:each={warningMsgs} for:item="msg">
- <p key={msg} style="color:#ff6a00;padding-left:7px;font-size:16px;margin-bottom:7px;"> 銉� {msg}</p>
+ <p
+ key={msg}
+ style="
+ color: #ff6a00;
+ padding-left: 7px;
+ font-size: 16px;
+ margin-bottom: 7px;
+ "
+ >
+ 銉� {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> 閿欒</strong>
</div>
<template for:each={errorMsgs} for:item="msg">
- <p key={msg} style="color:red;padding-left:7px;font-size:16px;margin-bottom:7px;"> 銉� {msg}</p>
+ <p
+ key={msg}
+ style="
+ color: red;
+ padding-left: 7px;
+ font-size: 16px;
+ margin-bottom: 7px;
+ "
+ >
+ 銉� {msg}
+ </p>
</template>
</div>
</template>
<!-- 娑堣�楀搧鏄庣粏 -->
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -307,24 +654,65 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>娑堣�楀搧鏄庣粏</strong></p> -->
</div>
- <div style="padding:10px;">
+ <div style="padding: 10px">
<template if:true={editAble}>
- <c-lex-custom-lightning-datatable class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all;" key-field="recordId" data={currentRecord} columns={cols}
- selected-rows={selectRows} onrowselection={checkRows} onchangevalue={conCountChange} onvalueblur={conCountBlur}
- default-sort-direction="asc" sorted-direction={sortDirection} sorted-by={sortedBy} onsort={onHandleSort}></c-lex-custom-lightning-datatable>
- <c-paginator onprevious={prePageClick} onnext={nextPageClick}
- onpageschange={pageSizeChange} onfirst={goFirstPage} onlast={goLastPage}
- page-size-options={pageSizeOptions} previous-button-disabled={previousButtonDisabled}
- next-button-disabled={nextButtonDisabled} record-start={recordStart}
- record-end={recordEnd} total-records={totalRecords}></c-paginator>
+ <c-lex-custom-lightning-datatable
+ class="wrapped-header-datatable"
+ style="
+ word-wrap: break-word;
+ word-break: break-all;
+ "
+ key-field="recordId"
+ data={currentRecord}
+ columns={cols}
+ selected-rows={selectRows}
+ onrowselection={checkRows}
+ onchangevalue={conCountChange}
+ onvalueblur={conCountBlur}
+ default-sort-direction="asc"
+ sorted-direction={sortDirection}
+ sorted-by={sortedBy}
+ onsort={onHandleSort}
+ ></c-lex-custom-lightning-datatable>
+ <c-paginator
+ onprevious={prePageClick}
+ onnext={nextPageClick}
+ onpageschange={pageSizeChange}
+ onfirst={goFirstPage}
+ onlast={goLastPage}
+ page-size-options={pageSizeOptions}
+ previous-button-disabled={previousButtonDisabled}
+ next-button-disabled={nextButtonDisabled}
+ record-start={recordStart}
+ record-end={recordEnd}
+ total-records={totalRecords}
+ ></c-paginator>
</template>
<template if:false={editAble}>
- <c-lex-custom-lightning-datatable class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all;" hide-checkbox-column key-field="recordId" data={consumableorderdetailsRecordsview} columns={cols}></c-lex-custom-lightning-datatable>
- <c-paginator onprevious={prePageClick} onnext={nextPageClick}
- onpageschange={pageSizeChange} onfirst={goFirstPage} onlast={goLastPage}
- page-size-options={pageSizeOptions} previous-button-disabled={previousButtonDisabled}
- next-button-disabled={nextButtonDisabled} record-start={recordStart}
- record-end={recordEnd} total-records={totalRecords}></c-paginator>
+ <c-lex-custom-lightning-datatable
+ class="wrapped-header-datatable"
+ style="
+ word-wrap: break-word;
+ word-break: break-all;
+ "
+ hide-checkbox-column
+ key-field="recordId"
+ data={consumableorderdetailsRecordsview}
+ columns={cols}
+ ></c-lex-custom-lightning-datatable>
+ <c-paginator
+ onprevious={prePageClick}
+ onnext={nextPageClick}
+ onpageschange={pageSizeChange}
+ onfirst={goFirstPage}
+ onlast={goLastPage}
+ page-size-options={pageSizeOptions}
+ previous-button-disabled={previousButtonDisabled}
+ next-button-disabled={nextButtonDisabled}
+ record-start={recordStart}
+ record-end={recordEnd}
+ total-records={totalRecords}
+ ></c-paginator>
</template>
</div>
</div>
@@ -349,27 +737,65 @@
</template> -->
<!-- 涓婁紶闄勪欢寮圭獥 -->
<template if:true={showAttPop}>
- <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_small" style="border: 1px solid #D4D4D4;">
+ <section
+ role="dialog"
+ tabindex="-1"
+ aria-labelledby="modal-heading-01"
+ aria-modal="true"
+ aria-describedby="modal-content-id-1"
+ class="slds-modal slds-fade-in-open slds-modal_small"
+ style="border: 1px solid #d4d4d4"
+ >
<template if:true={showPopSpinner}>
- <lightning-spinner size="medium" variant="brand"></lightning-spinner>
+ <lightning-spinner
+ size="medium"
+ variant="brand"
+ ></lightning-spinner>
</template>
<div class="slds-modal__container">
- <header class="slds-modal__header" style="background-color: #F3F3F3;">
- <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closePop}>
- <lightning-icon icon-name="utility:close"
+ <header
+ class="slds-modal__header"
+ style="background-color: #f3f3f3"
+ >
+ <button
+ style=""
+ class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
+ title="Close"
+ onclick={closePop}
+ >
+ <lightning-icon
+ icon-name="utility:close"
alternative-text="close"
variant="inverse"
- size="small" ></lightning-icon>
+ size="small"
+ ></lightning-icon>
<span class="slds-assistive-text">Close</span>
</button>
- <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">涓婁紶閰嶇疆鍗�</h2>
+ <h2
+ id="modal-heading-01"
+ class="slds-text-heading_medium slds-hyphenate"
+ >
+ 涓婁紶閰嶇疆鍗�
+ </h2>
</header>
- <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1" style="border: 1px solid #F3F3F3;">
+ <div
+ class="slds-modal__content slds-p-around_medium"
+ id="modal-content-id-1"
+ style="border: 1px solid #f3f3f3"
+ >
<div class="slds-m-top_medium slds-m-bottom_x-large">
<div class="slds-p-around_medium lgc-bg">
- <lightning-input class="fileUpload" type="file" label="闄勪欢涓婁紶" accept=".xlsx, .xls, .csv, .png, .doc, .docx, .pdf" onchange={attChange}></lightning-input>
+ <lightning-input
+ class="fileUpload"
+ type="file"
+ label="闄勪欢涓婁紶"
+ accept=".xlsx, .xls, .csv, .png, .doc, .docx, .pdf"
+ onchange={attChange}
+ ></lightning-input>
</div>
- <p style="font-size: 16px;">宸查�夋嫨鏂囦欢锛歿fileName}
+ <p style="font-size: 16px">
+ 宸查�夋嫨鏂囦欢锛歿fileName}
+
<template if:true={attDelBtn}>
<a onclick={removeAtt}>绉婚櫎</a>
</template>
@@ -379,8 +805,24 @@
<footer class="slds-modal__footer">
<!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="鍙栨秷" onclick={closePop}></lightning-button>
<lightning-button style="margin-left: 10px;" variant="neutral" label="涓婁紶" onclick={uploadAtt}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="margin-left: 10px;" variant="neutral" label="鍙栨秷" onclick={closePop}>鍙栨秷</button>
- <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="margin-left: 10px;" variant="neutral" label="涓婁紶" onclick={uploadAtt}>涓婁紶</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
+ style="margin-left: 10px"
+ variant="neutral"
+ label="鍙栨秷"
+ onclick={closePop}
+ >
+ 鍙栨秷
+ </button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
+ style="margin-left: 10px"
+ variant="neutral"
+ label="涓婁紶"
+ onclick={uploadAtt}
+ >
+ 涓婁紶
+ </button>
</footer>
</div>
</section>
@@ -388,35 +830,104 @@
</template>
<!-- 鎼滅储鍖婚櫌 -->
<template if:true={showAttHosPop}>
- <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_medium" style="border: 1px solid #D4D4D4;">
+ <section
+ role="dialog"
+ tabindex="-1"
+ aria-labelledby="modal-heading-01"
+ aria-modal="true"
+ aria-describedby="modal-content-id-1"
+ class="slds-modal slds-fade-in-open slds-modal_medium"
+ style="border: 1px solid #d4d4d4"
+ >
<div class="slds-modal__container">
- <header class="slds-modal__header" style="background-color: #F3F3F3;">
- <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closeHospitalPop}>
- <lightning-icon icon-name="utility:close"
+ <header
+ class="slds-modal__header"
+ style="background-color: #f3f3f3"
+ >
+ <button
+ style=""
+ class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
+ title="Close"
+ onclick={closeHospitalPop}
+ >
+ <lightning-icon
+ icon-name="utility:close"
alternative-text="close"
variant="inverse"
- size="small" ></lightning-icon>
+ size="small"
+ ></lightning-icon>
<span class="slds-assistive-text">Close</span>
</button>
- <h2 id="modal-heading-02" class="slds-text-heading_medium slds-hyphenate">缁忛攢鍟嗗尰闄㈡绱�</h2>
+ <h2
+ id="modal-heading-02"
+ class="slds-text-heading_medium slds-hyphenate"
+ >
+ 缁忛攢鍟嗗尰闄㈡绱�
+ </h2>
</header>
- <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-2" style="border: 1px solid #F3F3F3;">
- <table style="width: 100%;">
+ <div
+ class="slds-modal__content slds-p-around_medium"
+ id="modal-content-id-2"
+ style="border: 1px solid #f3f3f3"
+ >
+ <table style="width: 100%">
<tbody>
<tr>
- <td style="width: 74px;"><div style="color:#696969;font-size:16px;text-align: left;">鍖婚櫌鍚嶇О</div></td>
- <td style="width: 60%;"><lightning-input class="inputFont" label="鍖婚櫌鍚嶇О" variant="label-hidden" placeholder="璇疯緭鍏ュ尰闄㈠悕绉�" value={searchNameHos} onchange={searchNameHosChange}></lightning-input></td>
- <td style="width: 10px;"></td>
- <td><button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height: 32px;" label="鎼滅储" onclick={searchHos}>鎼滅储</button></td>
+ <td style="width: 74px">
+ <div
+ style="
+ color: #696969;
+ font-size: 16px;
+ text-align: left;
+ "
+ >
+ 鍖婚櫌鍚嶇О
+ </div>
+ </td>
+ <td style="width: 60%">
+ <lightning-input
+ class="inputFont"
+ label="鍖婚櫌鍚嶇О"
+ variant="label-hidden"
+ placeholder="璇疯緭鍏ュ尰闄㈠悕绉�"
+ value={searchNameHos}
+ onchange={searchNameHosChange}
+ ></lightning-input>
+ </td>
+ <td style="width: 10px"></td>
+ <td>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
+ style="height: 32px"
+ label="鎼滅储"
+ onclick={searchHos}
+ >
+ 鎼滅储
+ </button>
+ </td>
</tr>
</tbody>
</table>
- <p style="height: 20px;"></p>
+ <p style="height: 20px"></p>
<!-- <p>宸查�夋嫨鍖婚櫌锛歿chooseHospital}</p> -->
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div
+ style="
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
<lightning-layout>
- <lightning-layout-item padding="around-small">
+ <lightning-layout-item
+ padding="around-small"
+ >
<p style="font-size: 18px">
<strong>鎼滅储缁撴灉</strong>
</p>
@@ -424,14 +935,27 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>鎼滅储缁撴灉</strong></p> -->
</div>
- <div class="myTable" style="padding:10px;">
- <lightning-datatable class="wrapped-header-datatable" key-field="id" hide-checkbox-column="true" data={hospitalList} columns={hosCols} onrowaction={chooseHos}></lightning-datatable>
+ <div class="myTable" style="padding: 10px">
+ <lightning-datatable
+ class="wrapped-header-datatable"
+ key-field="id"
+ hide-checkbox-column="true"
+ data={hospitalList}
+ columns={hosCols}
+ onrowaction={chooseHos}
+ ></lightning-datatable>
</div>
</div>
</div>
<footer class="slds-modal__footer">
<!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="鍙栨秷" onclick={closeHospitalPop}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" label="鍙栨秷" onclick={closeHospitalPop}>鍙栨秷</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
+ label="鍙栨秷"
+ onclick={closeHospitalPop}
+ >
+ 鍙栨秷
+ </button>
<!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="纭" onclick={confirmHospital}></lightning-button> -->
</footer>
</div>
@@ -440,50 +964,132 @@
</template>
<!-- 鎼滅储鍚堝悓 -->
<template if:true={showConPop}>
- <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_medium" style="border: 1px solid #D4D4D4;">
+ <section
+ role="dialog"
+ tabindex="-1"
+ aria-labelledby="modal-heading-01"
+ aria-modal="true"
+ aria-describedby="modal-content-id-1"
+ class="slds-modal slds-fade-in-open slds-modal_medium"
+ style="border: 1px solid #d4d4d4"
+ >
<div class="slds-modal__container">
- <header class="slds-modal__header" style="background-color: #F3F3F3;">
- <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closeContractPop}>
- <lightning-icon icon-name="utility:close"
+ <header
+ class="slds-modal__header"
+ style="background-color: #f3f3f3"
+ >
+ <button
+ style=""
+ class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
+ title="Close"
+ onclick={closeContractPop}
+ >
+ <lightning-icon
+ icon-name="utility:close"
alternative-text="close"
variant="inverse"
- size="small" ></lightning-icon>
+ size="small"
+ ></lightning-icon>
<span class="slds-assistive-text">Close</span>
</button>
- <h2 id="modal-heading-03" class="slds-text-heading_medium slds-hyphenate">鍚堝悓妫�绱�</h2>
+ <h2
+ id="modal-heading-03"
+ class="slds-text-heading_medium slds-hyphenate"
+ >
+ 鍚堝悓妫�绱�
+ </h2>
</header>
- <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-3" style="border: 1px solid #F3F3F3;">
- <table style="width: 100%;">
+ <div
+ class="slds-modal__content slds-p-around_medium"
+ id="modal-content-id-3"
+ style="border: 1px solid #f3f3f3"
+ >
+ <table style="width: 100%">
<tbody>
<tr>
- <td style="width: 74px;"><div style="color:#696969;font-size:16px;text-align: left;">鍚堝悓鍚嶇О</div></td>
- <td style="width: 60%;"><lightning-input class="inputFont" label="鍚堝悓鍚嶇О" variant="label-hidden" placeholder="璇疯緭鍏ュ悎鍚屽悕绉�" value={searchNameCon} onchange={searchNameConChange}></lightning-input></td>
- <td style="width: 10px;"></td>
- <td><button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height: 32px;" label="鎼滅储" onclick={searchCon}>鎼滅储</button></td>
+ <td style="width: 74px">
+ <div
+ style="
+ color: #696969;
+ font-size: 16px;
+ text-align: left;
+ "
+ >
+ 鍚堝悓鍚嶇О
+ </div>
+ </td>
+ <td style="width: 60%">
+ <lightning-input
+ class="inputFont"
+ label="鍚堝悓鍚嶇О"
+ variant="label-hidden"
+ placeholder="璇疯緭鍏ュ悎鍚屽悕绉�"
+ value={searchNameCon}
+ onchange={searchNameConChange}
+ ></lightning-input>
+ </td>
+ <td style="width: 10px"></td>
+ <td>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
+ style="height: 32px"
+ label="鎼滅储"
+ onclick={searchCon}
+ >
+ 鎼滅储
+ </button>
+ </td>
<!-- <td><lightning-button label="鎼滅储" onclick={searchCon}></lightning-button></td> -->
</tr>
</tbody>
</table>
- <p style="height: 10px;"></p>
+ <p style="height: 10px"></p>
<!-- <p>宸查�夋嫨鍚堝悓锛歿chooseContract}</p> -->
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div
+ style="
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
<lightning-layout>
- <lightning-layout-item padding="around-small">
+ <lightning-layout-item
+ padding="around-small"
+ >
<p style="font-size: 18px">
<strong>鎼滅储缁撴灉</strong>
</p>
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding:20px;">
- <lightning-datatable class="wrapped-header-datatable" key-field="id" hide-checkbox-column="true" data={contractList} columns={conCols} onrowaction={chooseCon}></lightning-datatable>
+ <div style="padding: 20px">
+ <lightning-datatable
+ class="wrapped-header-datatable"
+ key-field="id"
+ hide-checkbox-column="true"
+ data={contractList}
+ columns={conCols}
+ onrowaction={chooseCon}
+ ></lightning-datatable>
</div>
</div>
</div>
<footer class="slds-modal__footer">
<!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="鍙栨秷" onclick={closeContractPop}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" label="鍙栨秷" onclick={closeContractPop}>鍙栨秷</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
+ label="鍙栨秷"
+ onclick={closeContractPop}
+ >
+ 鍙栨秷
+ </button>
<!-- <lightning-button style="margin-left: 10px;" variant="neutral" label="纭" onclick={confirmContract}></lightning-button> -->
</footer>
</div>
diff --git a/force-app/main/default/lwc/lexConsumable/lexConsumable.js b/force-app/main/default/lwc/lexConsumable/lexConsumable.js
index 9733513..4cb51c5 100644
--- a/force-app/main/default/lwc/lexConsumable/lexConsumable.js
+++ b/force-app/main/default/lwc/lexConsumable/lexConsumable.js
@@ -1,4 +1,4 @@
-import { LightningElement,wire,api,track } from 'lwc';
+import { LightningElement, wire, api, track } from 'lwc';
import { CurrentPageReference } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
@@ -19,1372 +19,1758 @@
import initContract from '@salesforce/apex/LexSearchContractController.init';
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";
+//table css
+import { loadStyle } from 'lightning/platformResourceLoader';
+import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
export default class LexConsumable extends NavigationMixin(LightningElement) {
-
- //椤甸潰鍩虹鏁版嵁
- @track editAble;
- @track pageType;
- @track esetId;
- @track keyWords;
- @track coc;
- @track cocId;
- @track userWorkLocation;
- @track accountName;
- @track accountid;
- @track specialCampaign = false;
- @track dealerProductId = [];
- @track category1;
- @track category3 = '';
- @track category4 = '';
- @track category5 = '';
- @track category_Goods;
- @track category3Option = [];
- @track category4Option = [];
- @track category5Option = [];
- @track consumableorderdetailsRecordsview = [];
- @track currentRecord = [];//鍒嗛〉
- @track selectRows = [];
- @track attachmentRecoeds = [];
- @track contactDealer = [];
- @track proLimitAndDate = [];
- @track agencyProType;
- @track agencyProType1;
- @track OSHFLG = false;
- @track bargainPrice;
- @track showOrderDate = false;
- @track showAttUploadDate = false;
- @track edoffersPrice = false;
- @track editDelCommitBtnDisabled = false;
- @track showEditBtn = false;
- @track disabledEditBtn = false;
- @track showPrintSheetBtn = false;
- @track showUploadSheetBtn = false;
- @track disabledUploadSheetBtn = false;
- @track showSubOrderbtn = false;
- @track disabledSubOrderbtn = false;
- @track showSaveOrderbtn1 = false;
- @track showSaveOrderbtn2 = false;
- @track showDeleteBtn = false;
- @track disabledDeleteBtn = false;
- @track showOfferPriceInputBtn = false;
- @track disabledOfferPriceInputBtn = false;
- @track showReapplyBtn = false;
- @track showHospital = false;
- @track showPage = false;
- @track cansee = false;
- @track showSpinner = true;
- @track showPopSpinner = false;
- stylesLoaded = false;
- //鏄惁涓�鐩存樉绀烘彁绀�
- @track isNoteStay = true;
- //鎺掑簭鐩稿叧
- @track sortDirection = 'asc';
- @track sortedBy;
- //鍒嗛〉
- @track currentPage = 1;
- @track pageSize = 10;
- // @track totalPage = 0;
- @track pageSizeOptions = [10, 25, 50, 100];
- @track recordStart = 0;
- @track recordEnd = 0;
- //鎶ラ敊鎻愰啋
- // @track hasError = false;
- @track errorMsgs = [];
- // @track hasWarning = false;
- @track warningMsgs = [];
- //闄勪欢涓婁紶
- @track showAttPop = false;
- @track filesUploaded = [];
- @track fileName;
- file;
- fileContents;
- fileReader;
- content;
- //鍖婚櫌鎼滅储
- @track showAttHosPop = false;
- @track hospitalList = [];
- @track searchNameHos;
- @track chooseHospital;
- @track chooseHospitalId;
- @track hospitalId;
- @track hospitalName;
- @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}
- ];
- //鍚堝悓鎼滅储
- @track contractLabel;
- @track showConPop = false;
- @track contractList = [];
- @track searchNameCon;
- @track chooseContract;
- @track chooseContractId;
- @track contractId;
- @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}
- ];
+ //椤甸潰鍩虹鏁版嵁
+ @track editAble;
+ @track pageType;
+ @track esetId;
+ @track keyWords;
+ @track coc;
+ @track cocId;
+ @track userWorkLocation;
+ @track accountName;
+ @track accountid;
+ @track specialCampaign = false;
+ @track dealerProductId = [];
+ @track category1;
+ @track category3 = '';
+ @track category4 = '';
+ @track category5 = '';
+ @track category_Goods;
+ @track category3Option = [];
+ @track category4Option = [];
+ @track category5Option = [];
+ @track consumableorderdetailsRecordsview = [];
+ @track currentRecord = []; //鍒嗛〉
+ @track selectRows = [];
+ @track attachmentRecoeds = [];
+ @track contactDealer = [];
+ @track proLimitAndDate = [];
+ @track agencyProType;
+ @track agencyProType1;
+ @track OSHFLG = false;
+ @track bargainPrice;
+ @track showOrderDate = false;
+ @track showAttUploadDate = false;
+ @track edoffersPrice = false;
+ @track editDelCommitBtnDisabled = false;
+ @track showEditBtn = false;
+ @track disabledEditBtn = false;
+ @track showPrintSheetBtn = false;
+ @track showUploadSheetBtn = false;
+ @track disabledUploadSheetBtn = false;
+ @track showSubOrderbtn = false;
+ @track disabledSubOrderbtn = false;
+ @track showSaveOrderbtn1 = false;
+ @track showSaveOrderbtn2 = false;
+ @track showDeleteBtn = false;
+ @track disabledDeleteBtn = false;
+ @track showOfferPriceInputBtn = false;
+ @track disabledOfferPriceInputBtn = false;
+ @track showReapplyBtn = false;
+ @track showHospital = false;
+ @track showPage = false;
+ @track cansee = false;
+ @track showSpinner = true;
+ @track showPopSpinner = false;
+ stylesLoaded = false;
+ //鏄惁涓�鐩存樉绀烘彁绀�
+ @track isNoteStay = true;
+ //鎺掑簭鐩稿叧
+ @track sortDirection = 'asc';
+ @track sortedBy;
+ //鍒嗛〉
+ @track currentPage = 1;
+ @track pageSize = 10;
+ // @track totalPage = 0;
+ @track pageSizeOptions = [10, 25, 50, 100];
+ @track recordStart = 0;
+ @track recordEnd = 0;
+ //鎶ラ敊鎻愰啋
+ // @track hasError = false;
+ @track errorMsgs = [];
+ // @track hasWarning = false;
+ @track warningMsgs = [];
+ //闄勪欢涓婁紶
+ @track showAttPop = false;
+ @track filesUploaded = [];
+ @track fileName;
+ file;
+ fileContents;
+ fileReader;
+ content;
+ //鍖婚櫌鎼滅储
+ @track showAttHosPop = false;
+ @track hospitalList = [];
+ @track searchNameHos;
+ @track chooseHospital;
+ @track chooseHospitalId;
+ @track hospitalId;
+ @track hospitalName;
+ @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
+ }
+ ];
+ //鍚堝悓鎼滅储
+ @track contractLabel;
+ @track showConPop = false;
+ @track contractList = [];
+ @track searchNameCon;
+ @track chooseContract;
+ @track chooseContractId;
+ @track contractId;
+ @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
+ }
+ ];
- //娑堣�楀搧鏁版嵁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});
- if(this.cansee){
- 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" },
- valueType: 'Number'
+ //娑堣�楀搧鏁版嵁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
+ });
+ if (this.cansee) {
+ 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' },
+ valueType: 'Number'
+ },
+ hideDefaultActions: true,
+ initialWidth: 80
+ });
+ } else {
+ 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:'allnumber',hideDefaultActions: true,initialWidth:105,sortable: true});
+ cols.push({
+ label: '鏈夋晥鏈熷簱瀛�(鐩�)',
+ type: 'customInventoryColor',
+ typeAttributes: {
+ value: { fieldName: 'allnumber' },
+ upperlimit: { fieldName: 'upperlimit' },
+ lowerlimit: { fieldName: 'lowerlimit' },
+ boxPrice: '鐩�'
},
- hideDefaultActions: true,initialWidth:80});
- }else{
- 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:'allnumber',hideDefaultActions: true,initialWidth:105,sortable: true});
- cols.push(
- {label:'鏈夋晥鏈熷簱瀛�(鐩�)',
- type: "customInventoryColor",
- typeAttributes: {
- 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" }});
- return cols;
- }
+ 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}
- ];
+ //闄勪欢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
+ }
+ ];
- //鍙栧緱鎵�鏈夎鍕鹃�夌殑浜у搧id
- getAllChecked(){
- this.selectRows = [];
- for(var i in this.currentRecord){
- if(this.currentRecord[i].check){
- this.selectRows.push(this.currentRecord[i].recordId);
- }
- }
- }
-
- //鍕鹃�夋搷浣�
- checkRows(event){
- this.selectRows = [];
- const selectedRows = event.detail.selectedRows;
- 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);
+ //鍙栧緱鎵�鏈夎鍕鹃�夌殑浜у搧id
+ getAllChecked() {
+ this.selectRows = [];
+ for (var i in this.currentRecord) {
+ if (this.currentRecord[i].check) {
+ this.selectRows.push(this.currentRecord[i].recordId);
}
- }
- if(count == 0){
- this.consumableorderdetailsRecordsview[i].check = false;
- }else{
- this.consumableorderdetailsRecordsview[i].check = true;
- this.selectRows.push(this.consumableorderdetailsRecordsview[i].recordId);
- }
- }
- for(var i in this.selectRows){
- 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]);
+ }
+ }
+
+ //鍕鹃�夋搷浣�
+ checkRows(event) {
+ this.selectRows = [];
+ const selectedRows = event.detail.selectedRows;
+ 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
+ );
+ }
}
- }
- }
- }
-
- //閲囪喘鏁伴噺鑾峰彇
- conCountChange(event){
- var recordId = event.detail.data.recordId;
- 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(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;
+ if (count == 0) {
+ this.consumableorderdetailsRecordsview[i].check = false;
+ } else {
+ this.consumableorderdetailsRecordsview[i].check = true;
+ this.selectRows.push(
+ this.consumableorderdetailsRecordsview[i].recordId
+ );
}
- }
- }
- this.getAllChecked();
- for(var i in this.currentRecord){
- if(this.currentRecord[i].recordId == recordId){
- console.log("currentRecord1:"+this.currentRecord[i].esd.Consumable_count__c);
- }
- }
- }
-
- //閲囪喘鏁伴噺澶辩劍
- conCountBlur(event){
- var conCount = event.detail.data.value;
- 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){
- if(parseInt(allnumber) + parseInt(conCount) > upperLimit){
- // window.alert("璇ヤ骇鍝佽璐暟閲忚秴鍑哄簱瀛樹笂闄愶紒");
- this.showMyToast('璇ヤ骇鍝佽璐暟閲忚秴鍑哄簱瀛樹笂闄愶紒','','error');
- }
- if(parseInt(allnumber) + parseInt(conCount) < lowerLimit){
- // window.alert("璇ヤ骇鍝佽璐暟閲忎綆浜庡簱瀛樹笅闄愶紒");
- this.showMyToast('璇ヤ骇鍝佽璐暟閲忎綆浜庡簱瀛樹笅闄愶紒','','error');
- }
- }
- }
-
- @wire(CurrentPageReference)
- getStateParameters(currentPageReference) {
- console.log('CurrentPageReference');
- if (currentPageReference) {
- this.pageType = currentPageReference.state?.type;
- this.esetId = currentPageReference.state?.ESetid;
- this.keyWords = currentPageReference.state?.KeyWords;
- console.log('type:'+this.pageType);
- console.log('esetId:'+this.esetId);
- console.log('keyWords:'+this.keyWords);
- }
- }
-
- renderedCallback(){
- if (!this.stylesLoaded) {
- Promise.all([loadStyle(this, WrappedHeaderTable)])
- .then(() => {
- console.log("Custom styles loaded");
- this.stylesLoaded = true;
- })
- .catch((error) => {
- console.error("Error loading custom styles");
- });
- }
- }
-
- //椤甸潰鍒濆鍖�
- connectedCallback(){
- this.showSpinner = true;
- 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.category3Option = result.category3Option;
- this.category4Option = result.category4Option;
- this.category5Option = result.category5Option;
- this.agencyProType = result.agencyProType;
- this.agencyProType1 = result.agencyProType1;
- this.OSHFLG = result.OSHFLG;
- this.hospitalName = result.hospitalName;
- this.contractName = result.contractName;
- this.contractLabel = '缁忛攢鍟嗘湁鏁堝悎鍚�';
- this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview;
- this.currentPage = 1;
- this.showCurrentReocrd();
- this.getAllChecked();
- this.attachmentRecoeds = result.attachmentRecoeds;
- 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;
- // var contractionName = '闀挎枃浠堕暱鏂囦欢闀挎枃浠堕暱鏂囦欢';
- if(contractionName.length > 25){
- 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';
- // 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.errorMsgs = result.errorMsgList;
- this.warningMsgs = result.warningMsgList;
- this.userWorkLocation = result.userWorkLocation;
- this.accountName = result.accountName;
- this.accountid = result.accountid;
- this.hospitalId = result.hospitalId;
- this.contractId = result.contractId;
- this.category_Goods = result.category_Goods;
- this.specialCampaign = result.specialCampaign;
- this.dealerProductId = result.dealerProductId;
- this.contactDealer = result.contactDealer;
- this.pageType = result.methodType;
- this.proLimitAndDate = result.proLimitAndDate;
- console.log("proLimitAndDate:"+JSON.stringify(this.proLimitAndDate));
- this.coc = result.coc;
- this.cocId = this.coc.Id;
- if(this.pageType == 'hospitalorder' && this.agencyProType != 'ET'){
- this.showHospital = true;
- }
- if(this.coc.Order_status__c == "宸叉彁浜�" || this.coc.Order_status__c == "鎵瑰噯"){
- this.showOrderDate = true;
- }
- if(this.coc.Consumable_pdf_insert_day__c != null){
- this.showAttUploadDate = true;
- }
- if(!(this.editAble || this.edoffersPrice)){
- this.showEditBtn = true;
- this.showOfferPriceInputBtn = true;
- }
- 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)){
- this.showPrintSheetBtn = true;
- this.showUploadSheetBtn = true;
- this.showSubOrderbtn = true;
- this.showDeleteBtn = true;
- }
- if((this.editDelCommitBtnDisabled || this.editAble || this.edoffersPrice) && this.coc.Order_status__c != "椹冲洖"){
- this.showSaveOrderbtn1 = true;
- }
- if(this.coc.Order_status__c == "椹冲洖" && this.editAble){
- this.showSaveOrderbtn2 = true;
- }
- 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');
+ }
+ for (var i in this.selectRows) {
+ 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]);
+ }
}
- })
- .catch(error=>{
+ }
+ }
+
+ //閲囪喘鏁伴噺鑾峰彇
+ conCountChange(event) {
+ var recordId = event.detail.data.recordId;
+ 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 (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.getAllChecked();
+ for (var i in this.currentRecord) {
+ if (this.currentRecord[i].recordId == recordId) {
+ console.log(
+ 'currentRecord1:' +
+ this.currentRecord[i].esd.Consumable_count__c
+ );
+ }
+ }
+ }
+
+ //閲囪喘鏁伴噺澶辩劍
+ conCountBlur(event) {
+ var conCount = event.detail.data.value;
+ 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
+ ) {
+ if (parseInt(allnumber) + parseInt(conCount) > upperLimit) {
+ // window.alert("璇ヤ骇鍝佽璐暟閲忚秴鍑哄簱瀛樹笂闄愶紒");
+ this.showMyToast('璇ヤ骇鍝佽璐暟閲忚秴鍑哄簱瀛樹笂闄愶紒', '', 'error');
+ }
+ if (parseInt(allnumber) + parseInt(conCount) < lowerLimit) {
+ // window.alert("璇ヤ骇鍝佽璐暟閲忎綆浜庡簱瀛樹笅闄愶紒");
+ this.showMyToast('璇ヤ骇鍝佽璐暟閲忎綆浜庡簱瀛樹笅闄愶紒', '', 'error');
+ }
+ }
+ }
+
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+ console.log('CurrentPageReference');
+ if (currentPageReference) {
+ this.pageType = currentPageReference.state?.type;
+ this.esetId = currentPageReference.state?.ESetid;
+ this.keyWords = currentPageReference.state?.KeyWords;
+ console.log('type:' + this.pageType);
+ console.log('esetId:' + this.esetId);
+ console.log('keyWords:' + this.keyWords);
+ }
+ }
+
+ renderedCallback() {
+ if (!this.stylesLoaded) {
+ Promise.all([loadStyle(this, WrappedHeaderTable)])
+ .then(() => {
+ console.log('Custom styles loaded');
+ this.stylesLoaded = true;
+ })
+ .catch((error) => {
+ console.error('Error loading custom styles');
+ });
+ }
+ }
+
+ //椤甸潰鍒濆鍖�
+ connectedCallback() {
+ this.showSpinner = true;
+ 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.category3Option = result.category3Option;
+ this.category4Option = result.category4Option;
+ this.category5Option = result.category5Option;
+ this.agencyProType = result.agencyProType;
+ this.agencyProType1 = result.agencyProType1;
+ this.OSHFLG = result.OSHFLG;
+ this.hospitalName = result.hospitalName;
+ this.contractName = result.contractName;
+ this.contractLabel = '缁忛攢鍟嗘湁鏁堝悎鍚�';
+ this.consumableorderdetailsRecordsview =
+ result.consumableorderdetailsRecordsview;
+ this.currentPage = 1;
+ this.showCurrentReocrd();
+ this.getAllChecked();
+ this.attachmentRecoeds = result.attachmentRecoeds;
+ 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;
+ // var contractionName = '闀挎枃浠堕暱鏂囦欢闀挎枃浠堕暱鏂囦欢';
+ if (contractionName.length > 25) {
+ 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';
+ // 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.errorMsgs = result.errorMsgList;
+ this.warningMsgs = result.warningMsgList;
+ this.userWorkLocation = result.userWorkLocation;
+ this.accountName = result.accountName;
+ this.accountid = result.accountid;
+ this.hospitalId = result.hospitalId;
+ this.contractId = result.contractId;
+ this.category_Goods = result.category_Goods;
+ this.specialCampaign = result.specialCampaign;
+ this.dealerProductId = result.dealerProductId;
+ this.contactDealer = result.contactDealer;
+ this.pageType = result.methodType;
+ this.proLimitAndDate = result.proLimitAndDate;
+ console.log(
+ 'proLimitAndDate:' +
+ JSON.stringify(this.proLimitAndDate)
+ );
+ this.coc = result.coc;
+ this.cocId = this.coc.Id;
+ if (
+ this.pageType == 'hospitalorder' &&
+ this.agencyProType != 'ET'
+ ) {
+ this.showHospital = true;
+ }
+ if (
+ this.coc.Order_status__c == '宸叉彁浜�' ||
+ this.coc.Order_status__c == '鎵瑰噯'
+ ) {
+ this.showOrderDate = true;
+ }
+ if (this.coc.Consumable_pdf_insert_day__c != null) {
+ this.showAttUploadDate = true;
+ }
+ if (!(this.editAble || this.edoffersPrice)) {
+ this.showEditBtn = true;
+ this.showOfferPriceInputBtn = true;
+ }
+ 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
+ )
+ ) {
+ this.showPrintSheetBtn = true;
+ this.showUploadSheetBtn = true;
+ this.showSubOrderbtn = true;
+ this.showDeleteBtn = true;
+ }
+ if (
+ (this.editDelCommitBtnDisabled ||
+ this.editAble ||
+ this.edoffersPrice) &&
+ this.coc.Order_status__c != '椹冲洖'
+ ) {
+ this.showSaveOrderbtn1 = true;
+ }
+ if (this.coc.Order_status__c == '椹冲洖' && this.editAble) {
+ this.showSaveOrderbtn2 = true;
+ }
+ 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'
+ );
+ }
+ })
+ .catch((error) => {
+ this.showSpinner = false;
+ console.log('error:' + error);
+ this.showMyToast('鍒濆鍖栭〉闈㈠け璐�', error, 'error');
+ });
+ }
+
+ //鎺掑簭
+ onHandleSort(event) {
+ //灏嗗凡缁忛�夊ソ浜嗙殑鏀惧埌鍓嶉潰锛屼笉杩涜鎺掑簭
+ console.log('sort');
+ if (this.editAble) {
+ const { fieldName: sortedBy, sortDirection } = event.detail;
+ const cloneData = [...this.currentRecord];
+ cloneData.sort(
+ this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1)
+ );
+ let index = 0;
+ let selectedRows = this.template
+ .querySelector('c-lex-custom-lightning-datatable')
+ .getSelectedRows();
+ let selectedRowsIds = [];
+ for (var i in selectedRows) {
+ selectedRowsIds.push(selectedRows[i].recordId);
+ }
+ console.log('selectedRowsIds = ' + JSON.stringify(selectedRowsIds));
+ for (var i = 0; i < cloneData.length; i++) {
+ if (selectedRowsIds.indexOf(cloneData[i].recordId) != -1) {
+ if (i != 0) {
+ let temp = cloneData[index];
+ cloneData[index] = cloneData[i];
+ cloneData[i] = temp;
+ }
+ index++;
+ }
+ }
+ this.currentRecord = cloneData;
+ this.sortDirection = sortDirection;
+ this.sortedBy = sortedBy;
+ } else {
+ const { fieldName: sortedBy, sortDirection } = event.detail;
+ const cloneData = [...this.currentRecord];
+ cloneData.sort(
+ this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1)
+ );
+ this.currentRecord = cloneData;
+ this.sortDirection = sortDirection;
+ this.sortedBy = sortedBy;
+ }
+ }
+
+ sortBy(field, reverse, primer) {
+ const key = primer
+ ? function (x) {
+ return primer(x[field]);
+ }
+ : function (x) {
+ return x[field];
+ };
+
+ return function (a, b) {
+ a = key(a);
+ b = key(b);
+ return reverse * ((a > b) - (b > a));
+ };
+ }
+
+ //鏄惁鏈夎鍛�
+ get hasWarning() {
+ if (this.warningMsgs == null || this.warningMsgs.length == 0) {
+ return false;
+ }
+ if (this.warningMsgs.length > 0) {
+ return true;
+ }
+ }
+
+ //鏄惁鏈夐敊璇�
+ get hasError() {
+ if (this.errorMsgs == null || this.errorMsgs.length == 0) {
+ return false;
+ }
+ if (this.errorMsgs.length > 0) {
+ return true;
+ }
+ }
+
+ //鐗逛环change浜嬩欢
+ offerPriceChange(event) {
+ this.coc.Offers_Price__c = event.detail.value;
+ }
+
+ //娑堣�楀搧鍚嶇Оchange浜嬩欢
+ category1Change(event) {
+ this.category1 = event.detail.value;
+ }
+
+ //绗笁鍒嗙被change浜嬩欢
+ category3Change(event) {
+ this.showSpinner = true;
+ this.category3 = event.detail.value;
+ this.category4 = '';
+ this.category5 = '';
+ 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);
+ this.showMyToast('鍔犺浇鍒嗙被澶辫触', result.errorMsg, 'error');
+ }
+ });
+ }
+
+ //绗洓鍒嗙被change浜嬩欢
+ category4Change(event) {
+ this.showSpinner = true;
+ this.category4 = event.detail.value;
+ this.category5 = '';
+ 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);
+ this.showMyToast('鍔犺浇鍒嗙被澶辫触', result.errorMsg, 'error');
+ }
+ });
+ }
+
+ //绗簲鍒嗙被change浜嬩欢
+ category5Change(event) {
+ this.category5 = event.detail.value;
+ }
+
+ //鎼滅储浜у搧
+ searchProduct(event) {
+ this.showSpinner = true;
+ searchConsumableorderdetails({
+ userWorkLocationStr: this.userWorkLocation,
+ agencyProTypeStr: this.agencyProType,
+ accountNameStr: this.accountName,
+ accountIdStr: this.accountid,
+ contractIdStr: this.contractId,
+ hospitalIdStr: this.hospitalId,
+ category1Str: this.category1,
+ category3Str: this.category3,
+ category4Str: this.category4,
+ category5Str: this.category5,
+ category_GoodStr: this.category_Goods,
+ specialCampaignStr: this.specialCampaign,
+ dealerProductIdStr: JSON.stringify(this.dealerProductId),
+ methodTypeStr: this.pageType,
+ editAbleStr: this.editAble,
+ consumableorderdetailsRecordsviewStr: JSON.stringify(
+ this.consumableorderdetailsRecordsview
+ ),
+ proLimitAndDateList: this.proLimitAndDate
+ })
+ .then((result) => {
+ if (result.result == 'Success') {
+ this.consumableorderdetailsRecordsview =
+ result.consumableorderdetailsRecordsview;
+ this.currentPage = 1;
+ this.currentRecord = [];
+ this.showCurrentReocrd();
+ this.getAllChecked();
+ this.showSpinner = false;
+ this.errorMsgs = result.errorMsgList;
+ this.warningMsgs = result.warningMsgList;
+ // this.hasError = result.hasError;
+ // this.hasWarning = result.hasWarning;
+ this.showMyToast('鎼滅储鎴愬姛', result.errorMsg, 'success');
+ } else {
+ this.showSpinner = false;
+ console.log('Error:' + result.errorMsg);
+ if (result.errorMsg == '娌℃湁鎼滅储鍒扮浉鍏虫暟鎹�') {
+ this.showMyToast(result.errorMsg, '', 'error');
+ } else {
+ this.showMyToast('鎼滅储澶辫触', result.errorMsg, 'error');
+ }
+ }
+ })
+ .catch((error) => {
+ console.log('Error:' + error);
+ });
+ }
+
+ //娓呴櫎鎼滅储鏍�
+ clear(event) {
+ this.category1 = '';
+ this.category3 = '';
+ this.category4 = '';
+ this.category5 = '';
+ this.showSpinner = true;
+ searchConsumableorderdetails({
+ userWorkLocationStr: this.userWorkLocation,
+ agencyProTypeStr: this.agencyProType,
+ accountNameStr: this.accountName,
+ accountIdStr: this.accountid,
+ contractIdStr: this.contractId,
+ hospitalIdStr: this.hospitalId,
+ category1Str: this.category1,
+ category3Str: this.category3,
+ category4Str: this.category4,
+ category5Str: this.category5,
+ category_GoodStr: this.category_Goods,
+ specialCampaignStr: this.specialCampaign,
+ dealerProductIdStr: JSON.stringify(this.dealerProductId),
+ methodTypeStr: this.pageType,
+ editAbleStr: this.editAble,
+ consumableorderdetailsRecordsviewStr: JSON.stringify(
+ this.consumableorderdetailsRecordsview
+ ),
+ proLimitAndDateList: this.proLimitAndDate
+ }).then((result) => {
+ if (result.result == 'Success') {
+ this.consumableorderdetailsRecordsview =
+ result.consumableorderdetailsRecordsview;
+ this.currentPage = 1;
+ this.currentRecord = [];
+ this.showCurrentReocrd();
+ this.getAllChecked();
+ this.showSpinner = false;
+ this.showMyToast('鎼滅储鎴愬姛', result.errorMsg, 'success');
+ } else {
+ this.showSpinner = false;
+ 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;
+ }
+ }
+
+ //閫夋嫨
+ check(event) {
+ let index = event.target.getAttribute('data-index');
+ this.consumableorderdetailsRecordsview[index].check =
+ event.target.checked;
+ }
+
+ //閲囪喘鏁伴噺change浜嬩欢
+ // consumableCountChange(event){
+ // let index = event.target.getAttribute("data-index");
+ // var value = event.target.value;
+ // this.consumableorderdetailsRecordsview[index].esd.Consumable_count__c = value;
+ // if(isNaN(value)){
+ // value=0.00;
+ // }
+ // if(value != null && value !=0 && value!=''){
+ // this.consumableorderdetailsRecordsview[index].check = true;
+ // }else{
+ // this.consumableorderdetailsRecordsview[index].check = false;
+ // }
+ // }
+
+ //淇濆瓨璁㈠崟
+ saveOrder(event) {
+ this.showSpinner = true;
+ console.log('start save');
+ save({
+ contractNameStr: this.contractName,
+ cocStr: JSON.stringify(this.coc),
+ agencyProTypeStr: this.agencyProType,
+ accountidStr: this.accountid,
+ consumableorderdetailsRecordsviewStr: JSON.stringify(
+ this.consumableorderdetailsRecordsview
+ ),
+ contactDealerStr: JSON.stringify(this.contactDealer),
+ methodTypeStr: this.pageType,
+ eSetIdStr: this.esetId,
+ hospitalIdStr: this.hospitalId,
+ contractIdStr: this.contractId,
+ agencyProType1Str: this.agencyProType1,
+ OSHFLGStr: this.OSHFLG
+ }).then((result) => {
this.showSpinner = false;
- console.log("error:"+error);
- this.showMyToast('鍒濆鍖栭〉闈㈠け璐�',error,'error');
- })
- }
-
- //鎺掑簭
- onHandleSort(event){
- //灏嗗凡缁忛�夊ソ浜嗙殑鏀惧埌鍓嶉潰锛屼笉杩涜鎺掑簭
- console.log('sort');
- if(this.editAble){
- const { fieldName: sortedBy, sortDirection } = event.detail;
- const cloneData = [...this.currentRecord];
- cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));
- let index = 0;
- let selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
- let selectedRowsIds = [];
- for(var i in selectedRows){
- selectedRowsIds.push(selectedRows[i].recordId);
- }
- console.log('selectedRowsIds = ' + JSON.stringify(selectedRowsIds));
- for(var i = 0;i < cloneData.length ; i++){
- if(selectedRowsIds.indexOf(cloneData[i].recordId) != -1){
- if(i != 0){
- let temp = cloneData[index];
- cloneData[index] = cloneData[i];
- cloneData[i] = temp;
- }
- index++;
+ if (result.result == 'Success') {
+ this.esetId = result.eSetId;
+ const config = {
+ type: 'standard__webPage',
+ attributes: {
+ url:
+ '/lexconsumable?ESetid=' +
+ this.esetId +
+ '&type=' +
+ this.pageType
+ }
+ };
+ this[NavigationMixin.Navigate](config);
+ } else {
+ this.showSpinner = false;
+ console.log('Error:' + result.errorMsg);
+ this.showMyToast('淇濆瓨澶辫触', result.errorMsg, 'error');
}
- }
- this.currentRecord = cloneData;
- this.sortDirection = sortDirection;
- this.sortedBy = sortedBy;
- }else{
- const { fieldName: sortedBy, sortDirection } = event.detail;
- const cloneData = [...this.currentRecord];
- cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));
- this.currentRecord = cloneData;
- this.sortDirection = sortDirection;
- this.sortedBy = sortedBy;
- }
- }
+ });
+ }
- sortBy(field, reverse, primer) {
- const key = primer
- ? function (x) {
- return primer(x[field]);
- }
- : function (x) {
- return x[field];
- };
-
- return function (a, b) {
- a = key(a);
- b = key(b);
- return reverse * ((a > b) - (b > a));
- };
- }
-
- //鏄惁鏈夎鍛�
- get hasWarning(){
- if(this.warningMsgs == null || this.warningMsgs.length == 0){
- return false;
- }
- if(this.warningMsgs.length > 0){
- return true;
- }
- }
-
- //鏄惁鏈夐敊璇�
- get hasError(){
- if(this.errorMsgs == null || this.errorMsgs.length == 0){
- return false;
- }
- if(this.errorMsgs.length > 0){
- return true;
- }
- }
-
- //鐗逛环change浜嬩欢
- offerPriceChange(event){
- this.coc.Offers_Price__c = event.detail.value;
- }
-
- //娑堣�楀搧鍚嶇Оchange浜嬩欢
- category1Change(event){
- this.category1 = event.detail.value;
- }
-
- //绗笁鍒嗙被change浜嬩欢
- category3Change(event){
- this.showSpinner = true;
- this.category3 = event.detail.value;
- this.category4 = '';
- this.category5 = '';
- 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);
- this.showMyToast('鍔犺浇鍒嗙被澶辫触',result.errorMsg,'error');
- }
- })
- }
-
- //绗洓鍒嗙被change浜嬩欢
- category4Change(event){
- this.showSpinner = true;
- this.category4 = event.detail.value;
- this.category5 = '';
- 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);
- this.showMyToast('鍔犺浇鍒嗙被澶辫触',result.errorMsg,'error');
- }
- })
- }
-
- //绗簲鍒嗙被change浜嬩欢
- category5Change(event){
- this.category5 = event.detail.value;
- }
-
- //鎼滅储浜у搧
- searchProduct(event){
- this.showSpinner = true;
- searchConsumableorderdetails({userWorkLocationStr:this.userWorkLocation,
- agencyProTypeStr:this.agencyProType,
- accountNameStr:this.accountName,
- accountIdStr:this.accountid,
- contractIdStr:this.contractId,
- hospitalIdStr:this.hospitalId,
- category1Str:this.category1,
- category3Str:this.category3,
- category4Str:this.category4,
- category5Str:this.category5,
- category_GoodStr:this.category_Goods,
- specialCampaignStr:this.specialCampaign,
- dealerProductIdStr:JSON.stringify(this.dealerProductId),
- methodTypeStr:this.pageType,
- editAbleStr:this.editAble,
- consumableorderdetailsRecordsviewStr:JSON.stringify(this.consumableorderdetailsRecordsview),
- proLimitAndDateList : this.proLimitAndDate
- })
- .then(result=>{
- if(result.result == 'Success'){
- this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview;
- this.currentPage = 1;
- this.currentRecord = [];
- this.showCurrentReocrd();
- this.getAllChecked();
- this.showSpinner = false;
- this.errorMsgs = result.errorMsgList;
- this.warningMsgs = result.warningMsgList;
- // this.hasError = result.hasError;
- // this.hasWarning = result.hasWarning;
- this.showMyToast('鎼滅储鎴愬姛',result.errorMsg,'success');
- }else{
- this.showSpinner = false;
- console.log("Error:"+result.errorMsg);
- if(result.errorMsg == '娌℃湁鎼滅储鍒扮浉鍏虫暟鎹�'){
- this.showMyToast(result.errorMsg,'','error');
- }else{
- this.showMyToast('鎼滅储澶辫触',result.errorMsg,'error');
- }
- }
- })
- .catch(error=>{
- console.log("Error:"+error);
- })
- }
-
- //娓呴櫎鎼滅储鏍�
- clear(event){
- this.category1 = '';
- this.category3 = '';
- this.category4 = '';
- this.category5 = '';
- this.showSpinner = true;
- searchConsumableorderdetails({
- userWorkLocationStr:this.userWorkLocation,
- agencyProTypeStr:this.agencyProType,
- accountNameStr:this.accountName,
- accountIdStr:this.accountid,
- contractIdStr:this.contractId,
- hospitalIdStr:this.hospitalId,
- category1Str:this.category1,
- category3Str:this.category3,
- category4Str:this.category4,
- category5Str:this.category5,
- category_GoodStr:this.category_Goods,
- specialCampaignStr:this.specialCampaign,
- dealerProductIdStr:JSON.stringify(this.dealerProductId),
- methodTypeStr:this.pageType,
- editAbleStr:this.editAble,
- consumableorderdetailsRecordsviewStr:JSON.stringify(this.consumableorderdetailsRecordsview),
- proLimitAndDateList : this.proLimitAndDate
- }).then(result=>{
- if(result.result == 'Success'){
- this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview;
- this.currentPage = 1;
- this.currentRecord = [];
- this.showCurrentReocrd();
- this.getAllChecked();
- this.showSpinner = false;
- this.showMyToast('鎼滅储鎴愬姛',result.errorMsg,'success');
- }else{
- this.showSpinner = false;
- 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;
- }
- }
-
- //閫夋嫨
- check(event){
- let index = event.target.getAttribute("data-index");
- this.consumableorderdetailsRecordsview[index].check = event.target.checked;
- }
-
- //閲囪喘鏁伴噺change浜嬩欢
- // consumableCountChange(event){
- // let index = event.target.getAttribute("data-index");
- // var value = event.target.value;
- // this.consumableorderdetailsRecordsview[index].esd.Consumable_count__c = value;
- // if(isNaN(value)){
- // value=0.00;
- // }
- // if(value != null && value !=0 && value!=''){
- // this.consumableorderdetailsRecordsview[index].check = true;
- // }else{
- // this.consumableorderdetailsRecordsview[index].check = false;
- // }
- // }
-
- //淇濆瓨璁㈠崟
- saveOrder(event){
- this.showSpinner = true;
- console.log('start save');
- save({
- contractNameStr:this.contractName,
- cocStr:JSON.stringify(this.coc),
- agencyProTypeStr:this.agencyProType,
- accountidStr:this.accountid,
- consumableorderdetailsRecordsviewStr:JSON.stringify(this.consumableorderdetailsRecordsview),
- contactDealerStr:JSON.stringify(this.contactDealer),
- methodTypeStr:this.pageType,
- eSetIdStr:this.esetId,
- hospitalIdStr : this.hospitalId,
- contractIdStr : this.contractId,
- agencyProType1Str : this.agencyProType1,
- OSHFLGStr : this.OSHFLG
- }).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
- }
- };
- this[NavigationMixin.Navigate](config);
- }else{
+ //淇濆瓨璁㈠崟锛堥┏鍥烇級
+ orderCopy(event) {
+ this.showSpinner = true;
+ ordrCopy({
+ contractNameStr: this.contractName,
+ cocStr: JSON.stringify(this.coc),
+ agencyProTypeStr: this.agencyProType,
+ accountidStr: this.accountid,
+ 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) => {
this.showSpinner = false;
- console.log("Error:"+result.errorMsg);
- this.showMyToast('淇濆瓨澶辫触',result.errorMsg,'error');
- }
- })
- }
-
- //淇濆瓨璁㈠崟锛堥┏鍥烇級
- orderCopy(event){
- this.showSpinner = true;
- ordrCopy({
- contractNameStr:this.contractName,
- cocStr:JSON.stringify(this.coc),
- agencyProTypeStr:this.agencyProType,
- accountidStr:this.accountid,
- 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=>{
- 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
- }
- };
- this[NavigationMixin.Navigate](config);
- }else{
- this.showSpinner = false;
- console.log("Error:"+result.errorMsg);
- this.showMyToast('淇濆瓨澶辫触',result.errorMsg,'error');
- }
- })
- }
-
- //缂栬緫
- editOrder(event){
- setEditAble({eSetidStr:this.esetId})
- .then(result=>{
- if(result.result == 'Success'){
- const config = {
- type: 'standard__webPage',
- attributes: {
- url: result.url
- }
- };
- this[NavigationMixin.Navigate](config);
- }else{
- this.showSpinner = false;
- console.log("Error:"+result.errorMsg);
- this.showMyToast('缂栬緫澶辫触',result.errorMsg,'error');
+ if (result.result == 'Success') {
+ this.esetId = result.eSetId;
+ const config = {
+ type: 'standard__webPage',
+ attributes: {
+ url:
+ '/lexconsumable?ESetid=' +
+ this.esetId +
+ '&type=' +
+ this.pageType
+ }
+ };
+ this[NavigationMixin.Navigate](config);
+ } else {
+ this.showSpinner = false;
+ console.log('Error:' + result.errorMsg);
+ this.showMyToast('淇濆瓨澶辫触', result.errorMsg, 'error');
}
- })
- }
+ });
+ }
- //鎵撳嵃閰嶇疆鍗�
- printOrder(event){
- var site = window.location.origin;
- const config = {
- type: 'standard__webPage',
- attributes: {
- url: site+'/consumable/PrintConsumblePDF?ESetid='+this.esetId
- }
- };
- this[NavigationMixin.Navigate](config);
- }
-
- //涓婁紶閰嶇疆鍗�
- uploadOrder(event){
- this.showAttPop = true;
- }
-
- //鎻愪氦璁㈠崟
- submitOrder(event){
- sorder({eSetidStr:this.esetId,accountidStr:this.accountid})
- .then(result=>{
- if(result.result == 'Success'){
- const config = {
- type: 'standard__webPage',
- attributes: {
- url: result.url
- }
- };
- this[NavigationMixin.Navigate](config);
- }else{
- this.showSpinner = false;
- this.errorMsgs = result.errorMsgList;
- this.warningMsgs = result.warningMsgList;
- console.log("Error:"+result.errorMsg);
- if(result.errorMsg.indexOf("璇蜂笂浼犺璐ч厤缃崟闄勪欢") != -1){
- result.errorMsg = '璇蜂笂浼犺璐ч厤缃崟闄勪欢';
- }
- this.showMyToast('鎻愪氦澶辫触',result.errorMsg,'error');
+ //缂栬緫
+ editOrder(event) {
+ setEditAble({ eSetidStr: this.esetId }).then((result) => {
+ if (result.result == 'Success') {
+ const config = {
+ type: 'standard__webPage',
+ attributes: {
+ url: result.url
+ }
+ };
+ this[NavigationMixin.Navigate](config);
+ } else {
+ this.showSpinner = false;
+ console.log('Error:' + result.errorMsg);
+ this.showMyToast('缂栬緫澶辫触', result.errorMsg, 'error');
}
- })
- .catch(error=>{
- console.log("Error:"+error);
- })
- }
+ });
+ }
- //鍒犻櫎璁㈠崟
- deleteOrder(event){
- if(!window.confirm('鍒犻櫎鏄笉鍙仮澶嶇殑锛屼綘纭瑕佸垹闄ゅ悧锛�')){
- return;
- }
- delConsumable({eSetidStr:this.esetId})
- .then(result=>{
- if(result.result == 'Success'){
- const config = {
- type: 'standard__webPage',
- attributes: {
- url: result.url
- }
+ //鎵撳嵃閰嶇疆鍗�
+ printOrder(event) {
+ var site = window.location.origin;
+ const config = {
+ type: 'standard__webPage',
+ attributes: {
+ url:
+ site + '/consumable/PrintConsumblePDF?ESetid=' + this.esetId
+ }
+ };
+ this[NavigationMixin.Navigate](config);
+ }
+
+ //涓婁紶閰嶇疆鍗�
+ uploadOrder(event) {
+ this.showAttPop = true;
+ }
+
+ //鎻愪氦璁㈠崟
+ submitOrder(event) {
+ sorder({ eSetidStr: this.esetId, accountidStr: this.accountid })
+ .then((result) => {
+ if (result.result == 'Success') {
+ const config = {
+ type: 'standard__webPage',
+ attributes: {
+ url: result.url
+ }
+ };
+ this[NavigationMixin.Navigate](config);
+ } else {
+ this.showSpinner = false;
+ this.errorMsgs = result.errorMsgList;
+ this.warningMsgs = result.warningMsgList;
+ console.log('Error:' + result.errorMsg);
+ if (result.errorMsg.indexOf('璇蜂笂浼犺璐ч厤缃崟闄勪欢') != -1) {
+ result.errorMsg = '璇蜂笂浼犺璐ч厤缃崟闄勪欢';
+ }
+ this.showMyToast('鎻愪氦澶辫触', result.errorMsg, 'error');
+ }
+ })
+ .catch((error) => {
+ console.log('Error:' + error);
+ });
+ }
+
+ //鍒犻櫎璁㈠崟
+ deleteOrder(event) {
+ if (!window.confirm('鍒犻櫎鏄笉鍙仮澶嶇殑锛屼綘纭瑕佸垹闄ゅ悧锛�')) {
+ return;
+ }
+ delConsumable({ eSetidStr: this.esetId }).then((result) => {
+ if (result.result == 'Success') {
+ const config = {
+ type: 'standard__webPage',
+ attributes: {
+ url: result.url
+ }
+ };
+ this[NavigationMixin.Navigate](config);
+ } else {
+ this.showSpinner = false;
+ console.log('Error:' + result.errorMsg);
+ this.showMyToast('鍒犻櫎澶辫触', result.errorMsg, 'error');
+ }
+ });
+ }
+
+ //鐗逛环閲戦褰曞叆
+ inputOfferPrice(event) {
+ this.edoffersPrice = true;
+ if (!(this.editAble || this.edoffersPrice)) {
+ this.showEditBtn = true;
+ this.showOfferPriceInputBtn = true;
+ } else {
+ this.showEditBtn = false;
+ this.showOfferPriceInputBtn = false;
+ }
+ if (
+ !(
+ this.editDelCommitBtnDisabled ||
+ this.editAble ||
+ this.edoffersPrice
+ )
+ ) {
+ this.showPrintSheetBtn = true;
+ this.showUploadSheetBtn = true;
+ this.showSubOrderbtn = true;
+ this.showDeleteBtn = true;
+ } else {
+ this.showPrintSheetBtn = false;
+ this.showUploadSheetBtn = false;
+ this.showSubOrderbtn = false;
+ this.showDeleteBtn = false;
+ }
+ if (
+ (this.editDelCommitBtnDisabled ||
+ this.editAble ||
+ this.edoffersPrice) &&
+ this.coc.Order_status__c != '椹冲洖'
+ ) {
+ this.showSaveOrderbtn1 = true;
+ } else {
+ this.showSaveOrderbtn1 = false;
+ }
+ }
+
+ //鍐嶇敵璇�
+ reapplyOrder(event) {
+ backOrder({ eSetidStr: this.esetId }).then((result) => {
+ if (result.result == 'Success') {
+ const config = {
+ type: 'standard__webPage',
+ attributes: {
+ url: result.url
+ }
+ };
+ this[NavigationMixin.Navigate](config);
+ } else {
+ this.showSpinner = false;
+ console.log('Error:' + result.errorMsg);
+ this.showMyToast('鍐嶇敵璇峰け璐�', result.errorMsg, 'error');
+ }
+ });
+ }
+
+ //闄勪欢change浜嬩欢
+ attChange(event) {
+ if (event.target.files.length > 0) {
+ this.filesUploaded = event.target.files;
+ this.fileName = event.target.files[0].name;
+ console.log('this.fileName:' + this.fileName);
+ }
+ }
+
+ //鏄惁鏄剧ず闄勪欢绉婚櫎
+ get attDelBtn() {
+ if (
+ this.fileName != '' &&
+ this.fileName != null &&
+ this.fileName != '璇烽�夋嫨涓�涓枃浠朵笂浼�'
+ ) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ //鍏抽棴闄勪欢寮圭獥
+ closePop() {
+ this.showAttPop = false;
+ this.filesUploaded = [];
+ this.fileName = null;
+ }
+
+ //绉婚櫎闄勪欢
+ removeAtt() {
+ this.filesUploaded = [];
+ this.fileName = '';
+ }
+
+ //涓婁紶闄勪欢
+ uploadAtt(event) {
+ if (this.filesUploaded.length > 0) {
+ this.file = this.filesUploaded[0];
+ if (this.file.size > this.MAX_FILE_SIZE) {
+ window.console.log('鏂囦欢杩囧ぇ');
+ return;
+ }
+ this.fileReader = new FileReader();
+
+ this.fileReader.onloadend = () => {
+ this.fileContents = this.fileReader.result;
+ let base64 = 'base64,';
+ this.content =
+ this.fileContents.indexOf(base64) + base64.length;
+ this.fileContents = this.fileContents.substring(this.content);
+ this.saveToFile();
};
- this[NavigationMixin.Navigate](config);
- }else{
- this.showSpinner = false;
- console.log("Error:"+result.errorMsg);
- this.showMyToast('鍒犻櫎澶辫触',result.errorMsg,'error');
- }
- })
- }
+ this.fileReader.readAsDataURL(this.file);
+ } else {
+ this.fileName = '璇烽�夋嫨涓�涓枃浠朵笂浼�';
+ }
+ }
- //鐗逛环閲戦褰曞叆
- inputOfferPrice(event){
- this.edoffersPrice = true;
- if(!(this.editAble || this.edoffersPrice)){
- this.showEditBtn = true;
- this.showOfferPriceInputBtn = true;
- }else{
- this.showEditBtn = false;
- this.showOfferPriceInputBtn = false;
- }
- if(!(this.editDelCommitBtnDisabled || this.editAble || this.edoffersPrice)){
- this.showPrintSheetBtn = true;
- this.showUploadSheetBtn = true;
- this.showSubOrderbtn = true;
- this.showDeleteBtn = true;
- }else{
- this.showPrintSheetBtn = false;
- this.showUploadSheetBtn = false;
- this.showSubOrderbtn = false;
- this.showDeleteBtn = false;
- }
- if((this.editDelCommitBtnDisabled || this.editAble || this.edoffersPrice) && this.coc.Order_status__c != "椹冲洖"){
- this.showSaveOrderbtn1 = true;
- }else{
- this.showSaveOrderbtn1 = false;
- }
- }
-
- //鍐嶇敵璇�
- reapplyOrder(event){
- backOrder({eSetidStr:this.esetId})
- .then(result=>{
- if(result.result == 'Success'){
- const config = {
- type: 'standard__webPage',
- attributes: {
- url: result.url
- }
- };
- this[NavigationMixin.Navigate](config);
- }else{
- this.showSpinner = false;
- console.log("Error:"+result.errorMsg);
- this.showMyToast('鍐嶇敵璇峰け璐�',result.errorMsg,'error');
- }
- })
- }
-
- //闄勪欢change浜嬩欢
- attChange(event){
- if(event.target.files.length > 0) {
- this.filesUploaded = event.target.files;
- this.fileName = event.target.files[0].name;
- console.log('this.fileName:'+this.fileName);
- }
- }
-
- //鏄惁鏄剧ず闄勪欢绉婚櫎
- get attDelBtn(){
- if(this.fileName != '' && this.fileName != null && this.fileName != '璇烽�夋嫨涓�涓枃浠朵笂浼�'){
- return true;
- }else{
- return false;
- }
- }
-
- //鍏抽棴闄勪欢寮圭獥
- closePop(){
- this.showAttPop = false;
- this.filesUploaded = [];
- this.fileName = null;
- }
-
- //绉婚櫎闄勪欢
- removeAtt(){
- this.filesUploaded = [];
- this.fileName = '';
- }
-
- //涓婁紶闄勪欢
- uploadAtt(event){
- if(this.filesUploaded.length > 0) {
- this.file = this.filesUploaded[0];
- if (this.file.size > this.MAX_FILE_SIZE) {
- window.console.log('鏂囦欢杩囧ぇ');
- return ;
- }
- this.fileReader= new FileReader();
-
- this.fileReader.onloadend = (() => {
- this.fileContents = this.fileReader.result;
- 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 = '璇烽�夋嫨涓�涓枃浠朵笂浼�';
- }
- }
-
- //璋冪敤涓婁紶闄勪欢鍚庡彴鏂规硶
- saveToFile() {
- this.showPopSpinner = true;
- 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);
- this.showMyToast('涓婁紶澶辫触',result.errorMsg,'error');
- }
- })
- .catch(error => {
- this.showPopSpinner = false;
- this.showMyToast('涓婁紶澶辫触',error,'error');
- });
- }
-
- //鍒犻櫎闄勪欢
- deleteAtt(event){
- this.showSpinner = true;
- var recordId = event.target.getAttribute("data-fileid");
- console.log('attid:'+recordId);
- deleteAtt({contentVersionId : recordId, cocId : this.esetId})
- .then(result=>{
- this.showSpinner = false;
- if(result.result == 'Success'){
- window.location.reload();
- }else{
- console.log("Error:"+result.errorMsg);
- this.showMyToast('鍒犻櫎澶辫触',result.errorMsg,'error');
- }
- })
- .catch(error=>{
- this.showSpinner = false;
- console.log("Error:"+error);
- this.showMyToast('鍒犻櫎澶辫触',JSON.stringify(error),'error');
- })
- }
-
- //棰勮闄勪欢
- previweAtt(event){
- var recordId = event.target.getAttribute("data-fileid");
- console.log(recordId);
- this[NavigationMixin.Navigate]({
- type:'standard__namedPage',
- attributes:{
- pageName:'filePreview'
- },
- state:{
- recordIds: recordId,
- selectedRecordId: recordId
- }
- });
- }
-
- //鎵撳紑鎼滅储寮圭獥锛屽苟鍒濆鍖栧脊绐�
- showSearchHos(event){
- initHospital()
- .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;
- }
- }
- }else{
- console.log("Error:"+result.errorMsg);
- this.showMyToast('鍒濆鍖栨绱㈠尰闄㈤〉闈㈠け璐�',result.errorMsg,'error');
- }
- })
- .catch(error=>{
- console.log("Error:"+error);
- this.showMyToast('鍒濆鍖栨绱㈠尰闄㈤〉闈㈠け璐�',error,'error');
- })
- }
-
- //妫�绱㈠尰闄�
- searchHos(event){
- 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;
- }
- }
- }else{
- console.log("Error:"+result.errorMsg);
- this.showMyToast('鎼滅储澶辫触',result.errorMsg,'error');
- }
- })
- .catch(error=>{
- console.log("Error:"+error);
- this.showMyToast('鎼滅储澶辫触',error,'error');
- })
- }
-
- //鍖婚櫌鍚嶇Оchange
- searchNameHosChange(event){
- this.searchNameHos = event.detail.value;
- }
-
- //鍏抽棴寮圭獥
- closeHospitalPop(){
- this.showAttHosPop = false;
- this.chooseHospital = '';
- this.chooseHospitalId = '';
- }
-
- // //閫夋嫨鍖婚櫌
- // chooseHos(event){
- // var hosName = event.target.getAttribute("data-name");
- // var hosid = event.target.getAttribute("data-hosid");
- // console.log('hos:'+hosName+'---'+hosid);
- // this.chooseHospital = hosName;
- // this.chooseHospitalId = hosid;
- // }
-
- changeHos(event){
- this.hospitalName = event.detail.value;
- }
-
- changeCon(event){
- this.contractName = event.detail.value;
- }
-
- chooseHos(event){
- const row = event.detail.row;
- this.chooseHospitalId = row.Id;
- this.chooseHospital = row.Name;
- console.log('row.Id:'+row.Id);
- console.log('row.Name:'+row.Name);
- this.confirmHospital();
- }
-
- //纭閫夋嫨鍖婚櫌
- confirmHospital(){
- if(this.chooseHospital != '' && this.chooseHospital != null){
- this.hospitalId = this.chooseHospitalId;
- this.tempidHp = this.chooseHospitalId;
- this.hospitalName = this.chooseHospital;
- this.closeHospitalPop();
- //娑堥櫎璀﹀憡
- var arr = [];
- for(var i in this.warningMsgs){
- if(this.warningMsgs[i] != '璇烽�夋嫨鍖婚櫌'){
- arr.push(this.warningMsgs[i]);
- }
- }
- this.warningMsgs = arr;
- if(this.tempidHp != 'tempId' && this.tempidHp != ''){
- searchorderdetails({
- methodTypeStr : this.pageType,
- accountIdStr : this.accountid,
- hospitalIdStr : this.hospitalId,
- contractIdStr : this.contractId,
- userWorkLocationStr : this.userWorkLocation,
- accountNameStr : this.accountName,
- proLimitAndDateList : this.proLimitAndDate,
- editAbleStr : this.editAble
- }).then(result=>{
- if(result.result == 'Success'){
- this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview;
- this.currentPage = 1;
- this.currentRecord = [];
- this.showCurrentReocrd();
- this.getAllChecked();
- this.showMyToast('鎼滅储鎴愬姛',result.errorMsg,'success');
- }else{
- console.log("Error:"+result.errorMsg);
- if(result.errorMsg == '娌℃湁鎼滅储鍒扮浉鍏虫暟鎹�'){
- this.showMyToast(result.errorMsg,'','error');
- }else{
- this.showMyToast('鎼滅储浜у搧澶辫触',result.errorMsg,'error');
- }
- }
+ //璋冪敤涓婁紶闄勪欢鍚庡彴鏂规硶
+ saveToFile() {
+ this.showPopSpinner = true;
+ 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);
+ this.showMyToast('涓婁紶澶辫触', result.errorMsg, 'error');
+ }
})
- .catch(error=>{
- console.log("Error:"+error);
- this.showMyToast('鎼滅储浜у搧澶辫触',error,'error');
+ .catch((error) => {
+ this.showPopSpinner = false;
+ this.showMyToast('涓婁紶澶辫触', error, 'error');
+ });
+ }
+
+ //鍒犻櫎闄勪欢
+ deleteAtt(event) {
+ this.showSpinner = true;
+ var recordId = event.target.getAttribute('data-fileid');
+ console.log('attid:' + recordId);
+ deleteAtt({ contentVersionId: recordId, cocId: this.esetId })
+ .then((result) => {
+ this.showSpinner = false;
+ if (result.result == 'Success') {
+ window.location.reload();
+ } else {
+ console.log('Error:' + result.errorMsg);
+ this.showMyToast('鍒犻櫎澶辫触', result.errorMsg, 'error');
+ }
})
- this.tempidHp = 'tempId';
- }
- }else{
- this.showMyToast('璇烽�夋嫨鍖婚櫌','','error');
- }
- }
+ .catch((error) => {
+ this.showSpinner = false;
+ console.log('Error:' + error);
+ this.showMyToast('鍒犻櫎澶辫触', JSON.stringify(error), 'error');
+ });
+ }
- //鎵撳紑鍚堝悓妫�绱㈠脊绐楀苟鍒濆鍖�
- showSearchCon(){
- initContract({ctype:this.agencyProType1})
- .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;
- }
+ //棰勮闄勪欢
+ previweAtt(event) {
+ var recordId = event.target.getAttribute('data-fileid');
+ console.log(recordId);
+ this[NavigationMixin.Navigate]({
+ type: 'standard__namedPage',
+ attributes: {
+ pageName: 'filePreview'
+ },
+ state: {
+ recordIds: recordId,
+ selectedRecordId: recordId
}
- }else{
- console.log("Error:"+result.errorMsg);
- this.showMyToast('鍒濆鍖栨绱㈠悎鍚岄〉闈㈠け璐�',result.errorMsg,'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=>{
- 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;
- }
- }
- }else{
- console.log("Error:"+result.errorMsg);
- this.showMyToast('鎼滅储澶辫触',result.errorMsg,'error');
- }
- })
- .catch(error=>{
- console.log("Error:"+error);
- this.showMyToast('鎼滅储澶辫触',error,'error');
- })
- }
-
- searchNameConChange(event){
- this.searchNameCon = event.detail.value;
- }
-
- //鍏抽棴寮圭獥
- closeContractPop(){
- this.showConPop = false;
- this.chooseContract = '';
- this.chooseContractId = '';
- }
-
- //閫夋嫨鍚堝悓
- // chooseCon(event){
- // var conName = event.target.getAttribute("data-name");
- // var conid = event.target.getAttribute("data-hosid");
- // console.log('hos:'+conName+'---'+conid);
- // this.chooseContract = conName;
- // this.chooseContractId = conid;
- // }
-
- chooseCon(event){
- const row = event.detail.row;
- this.chooseContractId = row.Id;
- this.chooseContract = row.Name;
- console.log('row.Id:'+row.Id);
- console.log('row.Name:'+row.Name);
- this.confirmContract();
- }
-
- //纭閫夋嫨鍚堝悓
- confirmContract(){
- if(this.chooseContract != '' && this.chooseContract != null){
- this.contractId = this.chooseContractId;
- this.tempidPp = this.chooseContractId;
- this.contractName = this.chooseContract;
- this.closeContractPop();
- if(this.tempidPp != 'tempId' && this.tempidPp != '' && this.contractId != '' && this.pageType == 'promotionorder'){
- searchorderdetails({
- methodTypeStr : this.pageType,
- accountIdStr : this.accountid,
- hospitalIdStr : this.hospitalId,
- contractIdStr : this.contractId,
- userWorkLocationStr : this.userWorkLocation,
- accountNameStr : this.accountName,
- proLimitAndDateList : this.proLimitAndDate,
- editAbleStr : this.editAble
- }).then(result=>{
- if(result.result == 'Success'){
- this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview;
- this.currentPage = 1;
- this.currentRecord = [];
- this.showCurrentReocrd();
- this.getAllChecked();
- this.showMyToast('鎼滅储鎴愬姛',result.errorMsg,'success');
- }else{
- console.log("Error:"+result.errorMsg);
- if(result.errorMsg == '娌℃湁鎼滅储鍒扮浉鍏虫暟鎹�'){
- this.showMyToast(result.errorMsg,'','error');
- }else{
- this.showMyToast('鎼滅储浜у搧澶辫触',result.errorMsg,'error');
- }
- }
+ //鎵撳紑鎼滅储寮圭獥锛屽苟鍒濆鍖栧脊绐�
+ showSearchHos(event) {
+ initHospital()
+ .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;
+ }
+ }
+ } else {
+ console.log('Error:' + result.errorMsg);
+ this.showMyToast(
+ '鍒濆鍖栨绱㈠尰闄㈤〉闈㈠け璐�',
+ result.errorMsg,
+ 'error'
+ );
+ }
})
- .catch(error=>{
- console.log("Error:"+error);
- this.showMyToast('鎼滅储浜у搧澶辫触',error,'error');
+ .catch((error) => {
+ console.log('Error:' + error);
+ this.showMyToast('鍒濆鍖栨绱㈠尰闄㈤〉闈㈠け璐�', error, 'error');
+ });
+ }
+
+ //妫�绱㈠尰闄�
+ searchHos(event) {
+ 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;
+ }
+ }
+ } else {
+ console.log('Error:' + result.errorMsg);
+ this.showMyToast('鎼滅储澶辫触', result.errorMsg, 'error');
+ }
})
- this.tempidPp = 'tempId';
- }
- }else{
- this.showMyToast('璇烽�夋嫨鍚堝悓','','error');
- }
- }
+ .catch((error) => {
+ console.log('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';
- }else{
- iconName = 'utility:error';
- }
- if(message != ''){
- content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
- }else{
- content = '<h2><strong>'+title+'<strong/></h2>';
- }
- this.template.querySelector('c-common-toast').
- showToast(variant,content,iconName,10000);
- // var mode;
- // if(this.isNoteStay){
- // mode ='sticky';
- // }else{
- // mode = 'dismissable';
- // }
- // const evt = new ShowToastEvent({
- // title: title,
- // message: message,
- // variant: variant,
- // mode: mode
- // });
- // this.dispatchEvent(evt);
- }
+ //鍖婚櫌鍚嶇Оchange
+ searchNameHosChange(event) {
+ this.searchNameHos = event.detail.value;
+ }
- //鍒嗛〉
- showCurrentReocrd(){
- var startIndex = 0;
- var endIndex = 0;
- console.log('len:'+this.consumableorderdetailsRecordsview.length);
- if(this.consumableorderdetailsRecordsview != null && this.consumableorderdetailsRecordsview.length > 0){
- var currentRecord = [];
- var currentCount = 0;
- var mu = this.consumableorderdetailsRecordsview.length % this.pageSize;
- if(this.currentPage == this.totalPage){
- if(mu != 0){
- currentCount = mu;
- }else{
- currentCount = this.pageSize;
+ //鍏抽棴寮圭獥
+ closeHospitalPop() {
+ this.showAttHosPop = false;
+ this.chooseHospital = '';
+ this.chooseHospitalId = '';
+ }
+
+ // //閫夋嫨鍖婚櫌
+ // chooseHos(event){
+ // var hosName = event.target.getAttribute("data-name");
+ // var hosid = event.target.getAttribute("data-hosid");
+ // console.log('hos:'+hosName+'---'+hosid);
+ // this.chooseHospital = hosName;
+ // this.chooseHospitalId = hosid;
+ // }
+
+ changeHos(event) {
+ this.hospitalName = event.detail.value;
+ }
+
+ changeCon(event) {
+ this.contractName = event.detail.value;
+ }
+
+ chooseHos(event) {
+ const row = event.detail.row;
+ this.chooseHospitalId = row.Id;
+ this.chooseHospital = row.Name;
+ console.log('row.Id:' + row.Id);
+ console.log('row.Name:' + row.Name);
+ this.confirmHospital();
+ }
+
+ //纭閫夋嫨鍖婚櫌
+ confirmHospital() {
+ if (this.chooseHospital != '' && this.chooseHospital != null) {
+ this.hospitalId = this.chooseHospitalId;
+ this.tempidHp = this.chooseHospitalId;
+ this.hospitalName = this.chooseHospital;
+ this.closeHospitalPop();
+ //娑堥櫎璀﹀憡
+ var arr = [];
+ for (var i in this.warningMsgs) {
+ if (this.warningMsgs[i] != '璇烽�夋嫨鍖婚櫌') {
+ arr.push(this.warningMsgs[i]);
+ }
}
- }else{
- currentCount = this.pageSize;
- }
- console.log('this.totalPage:'+this.totalPage);
- console.log('this.pageSize:'+this.pageSize);
- console.log('mu:'+mu);
- console.log('currentCount:'+currentCount);
- startIndex = (this.currentPage - 1) * this.pageSize;
- endIndex = parseInt(startIndex) + parseInt(currentCount) - 1;
- console.log('startIndex:'+startIndex);
- console.log('endIndex:'+endIndex);
- if(this.editAble){
- for(var i in this.currentRecord){
- if(this.currentRecord[i].check){
- currentRecord.push(this.currentRecord[i]);
- }
+ this.warningMsgs = arr;
+ if (this.tempidHp != 'tempId' && this.tempidHp != '') {
+ searchorderdetails({
+ methodTypeStr: this.pageType,
+ accountIdStr: this.accountid,
+ hospitalIdStr: this.hospitalId,
+ contractIdStr: this.contractId,
+ userWorkLocationStr: this.userWorkLocation,
+ accountNameStr: this.accountName,
+ proLimitAndDateList: this.proLimitAndDate,
+ editAbleStr: this.editAble
+ })
+ .then((result) => {
+ if (result.result == 'Success') {
+ this.consumableorderdetailsRecordsview =
+ result.consumableorderdetailsRecordsview;
+ this.currentPage = 1;
+ this.currentRecord = [];
+ this.showCurrentReocrd();
+ this.getAllChecked();
+ this.showMyToast(
+ '鎼滅储鎴愬姛',
+ result.errorMsg,
+ 'success'
+ );
+ } else {
+ console.log('Error:' + result.errorMsg);
+ if (result.errorMsg == '娌℃湁鎼滅储鍒扮浉鍏虫暟鎹�') {
+ this.showMyToast(result.errorMsg, '', 'error');
+ } else {
+ this.showMyToast(
+ '鎼滅储浜у搧澶辫触',
+ result.errorMsg,
+ 'error'
+ );
+ }
+ }
+ })
+ .catch((error) => {
+ console.log('Error:' + error);
+ this.showMyToast('鎼滅储浜у搧澶辫触', error, 'error');
+ });
+ this.tempidHp = 'tempId';
}
- }
- 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){
- count++;
- }
+ } else {
+ this.showMyToast('璇烽�夋嫨鍖婚櫌', '', 'error');
+ }
+ }
+
+ //鎵撳紑鍚堝悓妫�绱㈠脊绐楀苟鍒濆鍖�
+ showSearchCon() {
+ initContract({ ctype: this.agencyProType1 })
+ .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;
+ }
+ }
+ } else {
+ console.log('Error:' + result.errorMsg);
+ this.showMyToast(
+ '鍒濆鍖栨绱㈠悎鍚岄〉闈㈠け璐�',
+ result.errorMsg,
+ '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) => {
+ 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;
+ }
+ }
+ } else {
+ console.log('Error:' + result.errorMsg);
+ this.showMyToast('鎼滅储澶辫触', result.errorMsg, 'error');
+ }
+ })
+ .catch((error) => {
+ console.log('Error:' + error);
+ this.showMyToast('鎼滅储澶辫触', error, 'error');
+ });
+ }
+
+ searchNameConChange(event) {
+ this.searchNameCon = event.detail.value;
+ }
+
+ //鍏抽棴寮圭獥
+ closeContractPop() {
+ this.showConPop = false;
+ this.chooseContract = '';
+ this.chooseContractId = '';
+ }
+
+ //閫夋嫨鍚堝悓
+ // chooseCon(event){
+ // var conName = event.target.getAttribute("data-name");
+ // var conid = event.target.getAttribute("data-hosid");
+ // console.log('hos:'+conName+'---'+conid);
+ // this.chooseContract = conName;
+ // this.chooseContractId = conid;
+ // }
+
+ chooseCon(event) {
+ const row = event.detail.row;
+ this.chooseContractId = row.Id;
+ this.chooseContract = row.Name;
+ console.log('row.Id:' + row.Id);
+ console.log('row.Name:' + row.Name);
+ this.confirmContract();
+ }
+
+ //纭閫夋嫨鍚堝悓
+ confirmContract() {
+ if (this.chooseContract != '' && this.chooseContract != null) {
+ this.contractId = this.chooseContractId;
+ this.tempidPp = this.chooseContractId;
+ this.contractName = this.chooseContract;
+ this.closeContractPop();
+ if (
+ this.tempidPp != 'tempId' &&
+ this.tempidPp != '' &&
+ this.contractId != '' &&
+ this.pageType == 'promotionorder'
+ ) {
+ searchorderdetails({
+ methodTypeStr: this.pageType,
+ accountIdStr: this.accountid,
+ hospitalIdStr: this.hospitalId,
+ contractIdStr: this.contractId,
+ userWorkLocationStr: this.userWorkLocation,
+ accountNameStr: this.accountName,
+ proLimitAndDateList: this.proLimitAndDate,
+ editAbleStr: this.editAble
+ })
+ .then((result) => {
+ if (result.result == 'Success') {
+ this.consumableorderdetailsRecordsview =
+ result.consumableorderdetailsRecordsview;
+ this.currentPage = 1;
+ this.currentRecord = [];
+ this.showCurrentReocrd();
+ this.getAllChecked();
+ this.showMyToast(
+ '鎼滅储鎴愬姛',
+ result.errorMsg,
+ 'success'
+ );
+ } else {
+ console.log('Error:' + result.errorMsg);
+ if (result.errorMsg == '娌℃湁鎼滅储鍒扮浉鍏虫暟鎹�') {
+ this.showMyToast(result.errorMsg, '', 'error');
+ } else {
+ this.showMyToast(
+ '鎼滅储浜у搧澶辫触',
+ result.errorMsg,
+ 'error'
+ );
+ }
+ }
+ })
+ .catch((error) => {
+ console.log('Error:' + error);
+ this.showMyToast('鎼滅储浜у搧澶辫触', error, 'error');
+ });
+ this.tempidPp = 'tempId';
}
- if(count == 0){
- currentRecord.push(this.consumableorderdetailsRecordsview[i]);
+ } else {
+ this.showMyToast('璇烽�夋嫨鍚堝悓', '', 'error');
+ }
+ }
+
+ showMyToast(title, message, variant) {
+ console.log('show custom message');
+ var iconName = '';
+ var content = '';
+ if (variant == 'success') {
+ iconName = 'utility:check';
+ } else {
+ iconName = 'utility:error';
+ }
+ if (message != '') {
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
+ } else {
+ content = '<h2><strong>' + title + '<strong/></h2>';
+ }
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
+ // var mode;
+ // if(this.isNoteStay){
+ // mode ='sticky';
+ // }else{
+ // mode = 'dismissable';
+ // }
+ // const evt = new ShowToastEvent({
+ // title: title,
+ // message: message,
+ // variant: variant,
+ // mode: mode
+ // });
+ // this.dispatchEvent(evt);
+ }
+
+ //鍒嗛〉
+ showCurrentReocrd() {
+ var startIndex = 0;
+ var endIndex = 0;
+ console.log('len:' + this.consumableorderdetailsRecordsview.length);
+ if (
+ this.consumableorderdetailsRecordsview != null &&
+ this.consumableorderdetailsRecordsview.length > 0
+ ) {
+ var currentRecord = [];
+ var currentCount = 0;
+ var mu =
+ this.consumableorderdetailsRecordsview.length % this.pageSize;
+ if (this.currentPage == this.totalPage) {
+ if (mu != 0) {
+ currentCount = mu;
+ } else {
+ currentCount = this.pageSize;
+ }
+ } else {
+ currentCount = this.pageSize;
}
- }
- this.recordStart = startIndex + 1;
- this.recordEnd = endIndex + 1;
- this.currentRecord = currentRecord;
- }else{
- this.currentPage = 0;
- this.currentRecord = [];
- }
- }
+ console.log('this.totalPage:' + this.totalPage);
+ console.log('this.pageSize:' + this.pageSize);
+ console.log('mu:' + mu);
+ console.log('currentCount:' + currentCount);
+ startIndex = (this.currentPage - 1) * this.pageSize;
+ endIndex = parseInt(startIndex) + parseInt(currentCount) - 1;
+ console.log('startIndex:' + startIndex);
+ console.log('endIndex:' + endIndex);
+ if (this.editAble) {
+ for (var i in this.currentRecord) {
+ if (this.currentRecord[i].check) {
+ currentRecord.push(this.currentRecord[i]);
+ }
+ }
+ }
+ 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
+ ) {
+ count++;
+ }
+ }
+ if (count == 0) {
+ currentRecord.push(
+ this.consumableorderdetailsRecordsview[i]
+ );
+ }
+ }
+ this.recordStart = startIndex + 1;
+ this.recordEnd = endIndex + 1;
+ this.currentRecord = currentRecord;
+ } else {
+ this.currentPage = 0;
+ this.currentRecord = [];
+ }
+ }
- get prePage(){
- return this.currentPage - 1;
- }
+ get prePage() {
+ return this.currentPage - 1;
+ }
- get nextPage(){
- return this.currentPage + 1;
- }
+ get nextPage() {
+ return this.currentPage + 1;
+ }
- get totalPage(){
- 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;
- }
- }
+ get totalPage() {
+ 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
+ );
+ }
+ }
- get totalRecords(){
- return this.consumableorderdetailsRecordsview.length;
- }
+ get totalRecords() {
+ return this.consumableorderdetailsRecordsview.length;
+ }
- //绗竴椤�
- goFirstPage(){
- this.currentPage = 1;
- this.showCurrentReocrd();
- }
+ //绗竴椤�
+ goFirstPage() {
+ this.currentPage = 1;
+ this.showCurrentReocrd();
+ }
- //鏈�鍚庝竴椤�
- goLastPage(){
- this.currentPage = this.totalPage;
- this.showCurrentReocrd();
- }
+ //鏈�鍚庝竴椤�
+ goLastPage() {
+ this.currentPage = this.totalPage;
+ this.showCurrentReocrd();
+ }
- //涓婁竴椤�
- prePageClick(){
- this.currentPage = this.currentPage - 1;
- this.showCurrentReocrd();
- }
+ //涓婁竴椤�
+ prePageClick() {
+ this.currentPage = this.currentPage - 1;
+ this.showCurrentReocrd();
+ }
- //涓嬩竴椤�
- nextPageClick(){
- this.currentPage = this.currentPage + 1;
- this.showCurrentReocrd();
- }
+ //涓嬩竴椤�
+ nextPageClick() {
+ this.currentPage = this.currentPage + 1;
+ this.showCurrentReocrd();
+ }
- //page size change
- pageSizeChange(event){
- console.log('pagesize:'+event.detail);
- this.pageSize = event.detail;
- this.currentPage = 1;
- this.currentRecord = [];
- this.showCurrentReocrd();
- }
-
- //涓婁竴椤垫寜閽槸鍚isable
- get previousButtonDisabled() {
- return this.currentPage == 1 || this.currentPage == 0;
- }
+ //page size change
+ pageSizeChange(event) {
+ console.log('pagesize:' + event.detail);
+ this.pageSize = event.detail;
+ this.currentPage = 1;
+ this.currentRecord = [];
+ this.showCurrentReocrd();
+ }
- //涓嬩竴椤垫寜閽槸鍚isable
- get nextButtonDisabled() {
- return this.currentPage == this.totalPage;
- }
+ //涓婁竴椤垫寜閽槸鍚isable
+ get previousButtonDisabled() {
+ return this.currentPage == 1 || this.currentPage == 0;
+ }
+
+ //涓嬩竴椤垫寜閽槸鍚isable
+ get nextButtonDisabled() {
+ return this.currentPage == this.totalPage;
+ }
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.html b/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.html
index f657066..a55dcb4 100644
--- a/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.html
+++ b/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.html
@@ -11,23 +11,50 @@
<div class="borderCss">
<div class="headerDorderCss">
<lightning-layout>
- <lightning-layout-item padding="around-small" size="2">
- <lightning-icon icon-name="action:priority" alternative-text="priority" title="priority"
- size="x-small" style="float: left;"></lightning-icon>
- <p style="font-size: 18px; margin-left: 5px;float: left;">
+ <lightning-layout-item
+ padding="around-small"
+ size="2"
+ >
+ <lightning-icon
+ icon-name="action:priority"
+ alternative-text="priority"
+ title="priority"
+ size="x-small"
+ style="float: left"
+ ></lightning-icon>
+ <p
+ style="
+ font-size: 18px;
+ margin-left: 5px;
+ float: left;
+ "
+ >
<strong>閿�閲忓墠鍗�</strong>
</p>
</lightning-layout-item>
- <lightning-layout-item size="7"></lightning-layout-item>
- <lightning-layout-item padding="around-small" size="3">
- <lightning-combobox name="progress" label="璐㈠勾" value={fiscalYearOption}
- variant="label-hidden" options={fiscalYearOptions} onchange={dataChange}
- data-field="fiscalYearOption" class="inputFont" style="
- min-width: 250px;
- max-width: 250px;
- margin-left: 10px;
- float: left;
- "></lightning-combobox>
+ <lightning-layout-item
+ size="7"
+ ></lightning-layout-item>
+ <lightning-layout-item
+ padding="around-small"
+ size="3"
+ >
+ <lightning-combobox
+ name="progress"
+ label="璐㈠勾"
+ value={fiscalYearOption}
+ variant="label-hidden"
+ options={fiscalYearOptions}
+ onchange={dataChange}
+ data-field="fiscalYearOption"
+ class="inputFont"
+ style="
+ min-width: 250px;
+ max-width: 250px;
+ margin-left: 10px;
+ float: left;
+ "
+ ></lightning-combobox>
</lightning-layout-item>
</lightning-layout>
</div>
@@ -36,9 +63,14 @@
class="wrapped-header-datatable">
</lightning-datatable> -->
- <c-lex-custom-lightning-datatable key-field="Id" data={topAccountData} columns={topColumns}
- hide-checkbox-column style="word-wrap: break-word; word-break: break-all"
- class="wrapped-header-datatable">
+ <c-lex-custom-lightning-datatable
+ key-field="Id"
+ data={topAccountData}
+ columns={topColumns}
+ hide-checkbox-column
+ style="word-wrap: break-word; word-break: break-all"
+ class="wrapped-header-datatable"
+ >
</c-lex-custom-lightning-datatable>
</div>
</div>
@@ -71,16 +103,29 @@
<p style="font-size: 18px; margin-left: 5px;float: left;">
<strong>閿�閲忓墠鍗�</strong>
</p> -->
- <lightning-icon icon-name="standard:account" alternative-text="Account" title="瀹㈡埛"
- size="small" style="float: left;margin-top:3px"></lightning-icon>
- <lightning-combobox name="progress" label="瀹㈡埛" value={viewOption} variant="label-hidden"
- options={listViewOptions} onchange={dataChange} data-field="viewOption"
- class="inputFont" style="
- min-width: 250px;
- max-width: 250px;
- margin-left: 10px;
- float: left;
- "></lightning-combobox>
+ <lightning-icon
+ icon-name="standard:account"
+ alternative-text="Account"
+ title="瀹㈡埛"
+ size="small"
+ style="float: left; margin-top: 3px"
+ ></lightning-icon>
+ <lightning-combobox
+ name="progress"
+ label="瀹㈡埛"
+ value={viewOption}
+ variant="label-hidden"
+ options={listViewOptions}
+ onchange={dataChange}
+ data-field="viewOption"
+ class="inputFont"
+ style="
+ min-width: 250px;
+ max-width: 250px;
+ margin-left: 10px;
+ float: left;
+ "
+ ></lightning-combobox>
</lightning-layout-item>
</lightning-layout>
</div>
@@ -91,17 +136,31 @@
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
<div class="slds-m-top_small slds-m-bottom_medium">
- <lightning-datatable key-field="id" data={pageRecords} columns={columns}
- hide-checkbox-column default-sort-direction={defaultSortDirection}
- sorted-direction={sortDirection} sorted-by={sortedBy} onsort={onHandleSort}
- class="wrapped-header-datatable grayBackground">
+ <lightning-datatable
+ key-field="id"
+ data={pageRecords}
+ columns={columns}
+ hide-checkbox-column
+ default-sort-direction={defaultSortDirection}
+ sorted-direction={sortDirection}
+ sorted-by={sortedBy}
+ onsort={onHandleSort}
+ class="wrapped-header-datatable grayBackground"
+ >
</lightning-datatable>
- <c-paginator onprevious={handlePrevious} onnext={handleNext}
- onpageschange={handlePageschange} onfirst={handleFirst} onlast={handleLast}
+ <c-paginator
+ onprevious={handlePrevious}
+ onnext={handleNext}
+ onpageschange={handlePageschange}
+ onfirst={handleFirst}
+ onlast={handleLast}
page-size-options={pageSizeOptions}
previous-button-disabled={previousButtonDisabled}
- next-button-disabled={nextButtonDisabled} record-start={recordStart}
- record-end={recordEnd} total-records={totalRecords}></c-paginator>
+ next-button-disabled={nextButtonDisabled}
+ record-start={recordStart}
+ record-end={recordEnd}
+ total-records={totalRecords}
+ ></c-paginator>
</div>
</div>
</div>
@@ -117,13 +176,19 @@
<div></div>
<strong style="font-size: 20px">{accountDataInfo.name}</strong>
<p>
- <lightning-formatted-url value="/lexconsumableaccount" label="杩斿洖鍒楄〃"></lightning-formatted-url>
+ <lightning-formatted-url
+ value="/lexconsumableaccount"
+ label="杩斿洖鍒楄〃"
+ ></lightning-formatted-url>
</p>
</lightning-layout-item>
<lightning-layout-item size="9"></lightning-layout-item>
<lightning-layout-item size="1">
<p>
- <lightning-formatted-url value={printUrl} label="鍙墦鍗拌鍥�"></lightning-formatted-url>
+ <lightning-formatted-url
+ value={printUrl}
+ label="鍙墦鍗拌鍥�"
+ ></lightning-formatted-url>
</p>
</lightning-layout-item>
</lightning-layout>
@@ -155,76 +220,124 @@
<lightning-layout-item size="1">
</lightning-layout-item>
<lightning-layout-item size="4">
- <lightning-input type="text" label="瀹㈡埛鍚�" value={accountDataInfo.name}
- variant="label-inline" read-only style="
- border-bottom: 1px solid #dde4e9;
- " class="adjustHeight"></lightning-input>
- </lightning-layout-item>
- <lightning-layout-item size="1">
- </lightning-layout-item>
- <lightning-layout-item size="4">
- <lightning-input type="text" label="瀹㈡埛鎵�鏈変汉" value={accountDataInfo.ownerName}
- variant="label-inline" read-only style="
- border-bottom: 1px solid #dde4e9;
- "></lightning-input>
- </lightning-layout-item>
- </lightning-layout>
-
- <lightning-layout multiple-rows="true">
- <lightning-layout-item size="1">
- </lightning-layout-item>
- <lightning-layout-item size="4">
- <lightning-input type="text" label="鍒悕1" value={accountDataInfo.site}
- variant="label-inline" read-only style="
- border-bottom: 1px solid #dde4e9;
- "></lightning-input>
- </lightning-layout-item>
- <lightning-layout-item size="1">
- </lightning-layout-item>
- <lightning-layout-item size="4">
- <lightning-input type="text" label="鏈夋晥/鏃犳晥" value={accountDataInfo.isActive}
- variant="label-inline" read-only style="
- border-bottom: 1px solid #dde4e9;
- "></lightning-input>
- </lightning-layout-item>
- </lightning-layout>
-
- <lightning-layout multiple-rows="true">
- <lightning-layout-item size="1">
- </lightning-layout-item>
- <lightning-layout-item size="4">
- <lightning-input type="text" label="鍒悕2" value={accountDataInfo.aliasName2}
- variant="label-inline" read-only style="
- border-bottom: 1px solid #dde4e9;
- "></lightning-input>
- </lightning-layout-item>
- <lightning-layout-item size="1">
- </lightning-layout-item>
- <lightning-layout-item size="4">
- <lightning-input type="text" label="绂佺敤鐞嗙敱" value={accountDataInfo.banOnUseReason}
- variant="label-inline" read-only style="
- border-bottom: 1px solid #dde4e9;
- "></lightning-input>
- </lightning-layout-item>
- </lightning-layout>
-
- <lightning-layout multiple-rows="true">
- <lightning-layout-item size="1">
- </lightning-layout-item>
- <lightning-layout-item size="4">
- <lightning-input type="text" label="鏀垮簻绛夌礆" value={accountDataInfo.grade}
- variant="label-inline" read-only style="
- border-bottom: 1px solid #dde4e9;
- "></lightning-input>
- </lightning-layout-item>
- <lightning-layout-item size="1">
- </lightning-layout-item>
- <lightning-layout-item size="4">
- <lightning-input type="text" label="鍖婚櫌鎵�灞炴�ц川"
- value={accountDataInfo.attributeType} variant="label-inline" read-only
+ <lightning-input
+ type="text"
+ label="瀹㈡埛鍚�"
+ value={accountDataInfo.name}
+ variant="label-inline"
+ read-only
style="
border-bottom: 1px solid #dde4e9;
- "></lightning-input>
+ "
+ class="adjustHeight"
+ ></lightning-input>
+ </lightning-layout-item>
+ <lightning-layout-item size="1">
+ </lightning-layout-item>
+ <lightning-layout-item size="4">
+ <lightning-input
+ type="text"
+ label="瀹㈡埛鎵�鏈変汉"
+ value={accountDataInfo.ownerName}
+ variant="label-inline"
+ read-only
+ style="
+ border-bottom: 1px solid #dde4e9;
+ "
+ ></lightning-input>
+ </lightning-layout-item>
+ </lightning-layout>
+
+ <lightning-layout multiple-rows="true">
+ <lightning-layout-item size="1">
+ </lightning-layout-item>
+ <lightning-layout-item size="4">
+ <lightning-input
+ type="text"
+ label="鍒悕1"
+ value={accountDataInfo.site}
+ variant="label-inline"
+ read-only
+ style="
+ border-bottom: 1px solid #dde4e9;
+ "
+ ></lightning-input>
+ </lightning-layout-item>
+ <lightning-layout-item size="1">
+ </lightning-layout-item>
+ <lightning-layout-item size="4">
+ <lightning-input
+ type="text"
+ label="鏈夋晥/鏃犳晥"
+ value={accountDataInfo.isActive}
+ variant="label-inline"
+ read-only
+ style="
+ border-bottom: 1px solid #dde4e9;
+ "
+ ></lightning-input>
+ </lightning-layout-item>
+ </lightning-layout>
+
+ <lightning-layout multiple-rows="true">
+ <lightning-layout-item size="1">
+ </lightning-layout-item>
+ <lightning-layout-item size="4">
+ <lightning-input
+ type="text"
+ label="鍒悕2"
+ value={accountDataInfo.aliasName2}
+ variant="label-inline"
+ read-only
+ style="
+ border-bottom: 1px solid #dde4e9;
+ "
+ ></lightning-input>
+ </lightning-layout-item>
+ <lightning-layout-item size="1">
+ </lightning-layout-item>
+ <lightning-layout-item size="4">
+ <lightning-input
+ type="text"
+ label="绂佺敤鐞嗙敱"
+ value={accountDataInfo.banOnUseReason}
+ variant="label-inline"
+ read-only
+ style="
+ border-bottom: 1px solid #dde4e9;
+ "
+ ></lightning-input>
+ </lightning-layout-item>
+ </lightning-layout>
+
+ <lightning-layout multiple-rows="true">
+ <lightning-layout-item size="1">
+ </lightning-layout-item>
+ <lightning-layout-item size="4">
+ <lightning-input
+ type="text"
+ label="鏀垮簻绛夌礆"
+ value={accountDataInfo.grade}
+ variant="label-inline"
+ read-only
+ style="
+ border-bottom: 1px solid #dde4e9;
+ "
+ ></lightning-input>
+ </lightning-layout-item>
+ <lightning-layout-item size="1">
+ </lightning-layout-item>
+ <lightning-layout-item size="4">
+ <lightning-input
+ type="text"
+ label="鍖婚櫌鎵�灞炴�ц川"
+ value={accountDataInfo.attributeType}
+ variant="label-inline"
+ read-only
+ style="
+ border-bottom: 1px solid #dde4e9;
+ "
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -240,11 +353,16 @@
<lightning-layout-item size="1">
</lightning-layout-item>
<lightning-layout-item size="4">
- <lightning-input type="text" label="鍖婚櫌涓撲笟鍖哄垎"
- value={accountDataInfo.specialityType} variant="label-inline" read-only
+ <lightning-input
+ type="text"
+ label="鍖婚櫌涓撲笟鍖哄垎"
+ value={accountDataInfo.specialityType}
+ variant="label-inline"
+ read-only
style="
border-bottom: 1px solid #dde4e9;
- "></lightning-input>
+ "
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
</div>
@@ -266,18 +384,30 @@
<lightning-layout-item size="1">
</lightning-layout-item>
<lightning-layout-item size="4">
- <lightning-input type="text" label="鐪�" value={accountDataInfo.stateMasterName}
- variant="label-inline" read-only style="
+ <lightning-input
+ type="text"
+ label="鐪�"
+ value={accountDataInfo.stateMasterName}
+ variant="label-inline"
+ read-only
+ style="
border-bottom: 1px solid #dde4e9;
- "></lightning-input>
+ "
+ ></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="1">
</lightning-layout-item>
<lightning-layout-item size="4">
- <lightning-input type="text" label="鐢佃瘽" value={accountDataInfo.phone}
- variant="label-inline" read-only style="
+ <lightning-input
+ type="text"
+ label="鐢佃瘽"
+ value={accountDataInfo.phone}
+ variant="label-inline"
+ read-only
+ style="
border-bottom: 1px solid #dde4e9;
- "></lightning-input>
+ "
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -285,18 +415,30 @@
<lightning-layout-item size="1">
</lightning-layout-item>
<lightning-layout-item size="4">
- <lightning-input type="text" label="甯�" value={accountDataInfo.cityMasterName}
- variant="label-inline" read-only style="
+ <lightning-input
+ type="text"
+ label="甯�"
+ value={accountDataInfo.cityMasterName}
+ variant="label-inline"
+ read-only
+ style="
border-bottom: 1px solid #dde4e9;
- "></lightning-input>
+ "
+ ></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="1">
</lightning-layout-item>
<lightning-layout-item size="4">
- <lightning-input type="text" label="鐢佃瘽2" value={accountDataInfo.phoneCall}
- variant="label-inline" read-only style="
+ <lightning-input
+ type="text"
+ label="鐢佃瘽2"
+ value={accountDataInfo.phoneCall}
+ variant="label-inline"
+ read-only
+ style="
border-bottom: 1px solid #dde4e9;
- "></lightning-input>
+ "
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -304,18 +446,30 @@
<lightning-layout-item size="1">
</lightning-layout-item>
<lightning-layout-item size="4">
- <lightning-input type="text" label="鍘�/鍖�" value={accountDataInfo.town}
- variant="label-inline" read-only style="
+ <lightning-input
+ type="text"
+ label="鍘�/鍖�"
+ value={accountDataInfo.town}
+ variant="label-inline"
+ read-only
+ style="
border-bottom: 1px solid #dde4e9;
- "></lightning-input>
+ "
+ ></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="1">
</lightning-layout-item>
<lightning-layout-item size="4">
- <lightning-input type="text" label="浼犵湡" value={accountDataInfo.fax}
- variant="label-inline" read-only style="
+ <lightning-input
+ type="text"
+ label="浼犵湡"
+ value={accountDataInfo.fax}
+ variant="label-inline"
+ read-only
+ style="
border-bottom: 1px solid #dde4e9;
- "></lightning-input>
+ "
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -323,18 +477,30 @@
<lightning-layout-item size="1">
</lightning-layout-item>
<lightning-layout-item size="4">
- <lightning-input type="text" label="琛楅亾" value={accountDataInfo.street}
- variant="label-inline" read-only style="
+ <lightning-input
+ type="text"
+ label="琛楅亾"
+ value={accountDataInfo.street}
+ variant="label-inline"
+ read-only
+ style="
border-bottom: 1px solid #dde4e9;
- "></lightning-input>
+ "
+ ></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="1">
</lightning-layout-item>
<lightning-layout-item size="4">
- <lightning-input type="text" label="閭紪" value={accountDataInfo.postalCode}
- variant="label-inline" read-only style="
+ <lightning-input
+ type="text"
+ label="閭紪"
+ value={accountDataInfo.postalCode}
+ variant="label-inline"
+ read-only
+ style="
border-bottom: 1px solid #dde4e9;
- "></lightning-input>
+ "
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -342,10 +508,16 @@
<lightning-layout-item size="1">
</lightning-layout-item>
<lightning-layout-item size="4">
- <lightning-input type="text" label="鍦板潃" value={accountDataInfo.address}
- variant="label-inline" read-only style="
+ <lightning-input
+ type="text"
+ label="鍦板潃"
+ value={accountDataInfo.address}
+ variant="label-inline"
+ read-only
+ style="
border-bottom: 1px solid #dde4e9;
- "></lightning-input>
+ "
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
</div>
@@ -367,10 +539,16 @@
<lightning-layout-item size="1">
</lightning-layout-item>
<lightning-layout-item size="4">
- <lightning-input type="text" label="姣嶅叕鍙�" value={accountDataInfo.parentName}
- variant="label-inline" read-only style="
+ <lightning-input
+ type="text"
+ label="姣嶅叕鍙�"
+ value={accountDataInfo.parentName}
+ variant="label-inline"
+ read-only
+ style="
border-bottom: 1px solid #dde4e9;
- "></lightning-input>
+ "
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
</div>
@@ -380,5 +558,4 @@
</div>
</div>
</template>
-
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js b/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js
index 2b81ce8..0585f10 100644
--- a/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js
+++ b/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js
@@ -1,28 +1,28 @@
-import { LightningElement, wire, api, track } from "lwc";
-import { ShowToastEvent } from "lightning/platformShowToastEvent";
-import init from "@salesforce/apex/LexConsumableAccountController.init";
-import changeFiscalYearView from "@salesforce/apex/LexConsumableAccountController.changeFiscalYearView";
-import changelistView from "@salesforce/apex/LexConsumableAccountController.changelistView";
-import accountInit from "@salesforce/apex/LexConsumableAccountInfoController.init";
+import { LightningElement, wire, api, track } from 'lwc';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import init from '@salesforce/apex/LexConsumableAccountController.init';
+import changeFiscalYearView from '@salesforce/apex/LexConsumableAccountController.changeFiscalYearView';
+import changelistView from '@salesforce/apex/LexConsumableAccountController.changelistView';
+import accountInit from '@salesforce/apex/LexConsumableAccountInfoController.init';
//table css
-import { loadStyle } from "lightning/platformResourceLoader";
-import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
+import { loadStyle } from 'lightning/platformResourceLoader';
+import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
const columns = [
{
- label: "瀹㈡埛鍚�",
- fieldName: "NameUrl",
+ label: '瀹㈡埛鍚�',
+ fieldName: 'NameUrl',
hideDefaultActions: true,
wrapText: true,
initialWidth: 200,
sortable: true,
- type: "url",
+ type: 'url',
typeAttributes: {
label: {
- fieldName: "Name",
+ fieldName: 'Name'
},
- target:"_blank"
- },
+ target: '_blank'
+ }
},
// {
// label: "鐪�",
@@ -39,39 +39,39 @@
// },
// },
{
- label: "鐪�",
- fieldName: "StateMasterName",
+ label: '鐪�',
+ fieldName: 'StateMasterName',
hideDefaultActions: true,
wrapText: true,
- sortable: true,
+ sortable: true
},
{
- label: "閿�鍞湰閮ㄥ尰闄�",
- fieldName: "Salesdepartment_HP__c",
+ label: '閿�鍞湰閮ㄥ尰闄�',
+ fieldName: 'Salesdepartment_HP__c',
hideDefaultActions: true,
sortable: true,
- wrapText: true,
+ wrapText: true
},
{
- label: "鍒涘缓鏃ユ湡",
- fieldName: "CreatedDate",
+ label: '鍒涘缓鏃ユ湡',
+ fieldName: 'CreatedDate',
hideDefaultActions: true,
sortable: true,
wrapText: true,
- type: "date",
+ type: 'date',
typeAttributes: {
- timeZone: "Asia/Shanghai",
- day: "numeric",
- month: "numeric",
- year: "numeric",
- },
+ timeZone: 'Asia/Shanghai',
+ day: 'numeric',
+ month: 'numeric',
+ year: 'numeric'
+ }
},
{
- label: "鏈夋晥/鏃犳晥",
- fieldName: "Is_Active__c",
+ label: '鏈夋晥/鏃犳晥',
+ fieldName: 'Is_Active__c',
hideDefaultActions: true,
sortable: true,
- wrapText: true,
+ wrapText: true
},
// {
// label: "瀹㈡埛璁板綍绫诲瀷",
@@ -82,11 +82,11 @@
// initialWidth: 130,
// },
{
- label: "鏀垮簻绛夌骇",
- fieldName: "Grade__c",
+ label: '鏀垮簻绛夌骇',
+ fieldName: 'Grade__c',
hideDefaultActions: true,
sortable: true,
- wrapText: true,
+ wrapText: true
},
// {
// label: "OCSM鍒嗙被(鍖婚櫌)",
@@ -110,40 +110,40 @@
// },
// },
{
- label: "甯�",
- fieldName: "CityMasterName",
+ label: '甯�',
+ fieldName: 'CityMasterName',
hideDefaultActions: true,
sortable: true,
- wrapText: true,
+ wrapText: true
},
{
- label: "鍘�/鍖�",
- fieldName: "Town__c",
+ label: '鍘�/鍖�',
+ fieldName: 'Town__c',
hideDefaultActions: true,
sortable: true,
- wrapText: true,
+ wrapText: true
},
{
- label: "瀹㈡埛鐢佃瘽",
- fieldName: "Phone",
+ label: '瀹㈡埛鐢佃瘽',
+ fieldName: 'Phone',
hideDefaultActions: true,
sortable: true,
- wrapText: true,
- },
+ wrapText: true
+ }
];
const topColumns = [
{
- label: "瀹㈡埛鍚�",
+ label: '瀹㈡埛鍚�',
hideDefaultActions: true,
- fieldName : "accountName",
+ fieldName: 'accountName',
wrapText: true,
- type: "customShowAccountUrl",
+ type: 'customShowAccountUrl',
typeAttributes: {
- accountName: { fieldName: "accountName" },
- accountUrl: { fieldName: "accountUrl" },
- isDisable: { fieldName: "isDisable" },
- },
+ accountName: { fieldName: 'accountName' },
+ accountUrl: { fieldName: 'accountUrl' },
+ isDisable: { fieldName: 'isDisable' }
+ }
},
// {
// label: "甯�",
@@ -158,36 +158,36 @@
// },
// },
{
- label: "甯�",
- fieldName: "CityMasterName",
+ label: '甯�',
+ fieldName: 'CityMasterName',
hideDefaultActions: true,
- wrapText: true,
+ wrapText: true
},
{
- label: "鍘�/鍖�",
- fieldName: "Town__c",
+ label: '鍘�/鍖�',
+ fieldName: 'Town__c',
hideDefaultActions: true,
- wrapText: true,
+ wrapText: true
},
{
- label: "閿�閲忓崰姣�",
- fieldName: "proportion",
+ label: '閿�閲忓崰姣�',
+ fieldName: 'proportion',
hideDefaultActions: true,
wrapText: true,
initialWidth: 100,
- cellAttributes: { alignment: "right" },
+ cellAttributes: { alignment: 'right' }
},
{
- label: "鎿嶄綔",
- fieldName: "Town__c",
+ label: '鎿嶄綔',
+ fieldName: 'Town__c',
type: 'weeklyReport',
initialWidth: 150,
typeAttributes: {
- recordId: { fieldName: "Id" },
- hospitalName: { fieldName: "Name" },
- isShowButton: { fieldName: "isShowButton" },
+ recordId: { fieldName: 'Id' },
+ hospitalName: { fieldName: 'Name' },
+ isShowButton: { fieldName: 'isShowButton' }
},
- hideDefaultActions: true,
+ hideDefaultActions: true
}
];
export default class LexConsumableAccount extends LightningElement {
@@ -195,13 +195,13 @@
topColumns = topColumns;
@track isShowSpinner = false;
@track pageRecords = [];
- @track accountId = "";
- @track agencyProType = "";
- @track agencyProTypestr = "";
+ @track accountId = '';
+ @track agencyProType = '';
+ @track agencyProTypestr = '';
@track listViewOptions = [
{
- label: "01. 鍖婚櫌_Hospital",
- value: "01. 鍖婚櫌_Hospital",
+ label: '01. 鍖婚櫌_Hospital',
+ value: '01. 鍖婚櫌_Hospital'
},
// {
// label: "61. 鍖婚櫌_Hospital鑽夋涓殑鍖婚櫌",
@@ -212,22 +212,22 @@
// value: "62. 鍖婚櫌_Hospital鐢宠涓殑鍖婚櫌",
// },
{
- label: "63. 鍖婚櫌_Hospital涓婂懆鍒涘缓鐨勫尰闄�",
- value: "63. 鍖婚櫌_Hospital涓婂懆鍒涘缓鐨勫尰闄�",
- },
+ label: '63. 鍖婚櫌_Hospital涓婂懆鍒涘缓鐨勫尰闄�',
+ value: '63. 鍖婚櫌_Hospital涓婂懆鍒涘缓鐨勫尰闄�'
+ }
];
- @track viewOption = "01. 鍖婚櫌_Hospital";
+ @track viewOption = '01. 鍖婚櫌_Hospital';
@track isShowAccountInfo = false;
@track topAccountData = [];
//鍓嶇鎺掑簭
- defaultSortDirection = "asc";
- sortDirection = "asc";
+ defaultSortDirection = 'asc';
+ sortDirection = 'asc';
sortedBy;
//鍒嗛〉start
- @track sortBy = "";
+ @track sortBy = '';
@track pageSize = 10;
error;
records;
@@ -243,31 +243,30 @@
@track recordEnd = 0;
//end
- @track AccId = "";
- @track printUrl = "";
+ @track AccId = '';
+ @track printUrl = '';
@track accountDataInfo = {
- name: "",
- ownerName: "",
- site: "",
- isActive: "",
- aliasName2: "",
- banOnUseReason: "",
- grade: "",
- attributeType: "",
- oCMCategory: "",
- specialityType: "",
- stateMasterName: "",
- phone: "",
- cityMasterName: "",
- phoneCall: "",
- town: "",
- fax: "",
- street: "",
- postalCode: "",
- address: "",
- parentName: "",
+ name: '',
+ ownerName: '',
+ site: '',
+ isActive: '',
+ aliasName2: '',
+ banOnUseReason: '',
+ grade: '',
+ attributeType: '',
+ oCMCategory: '',
+ specialityType: '',
+ stateMasterName: '',
+ phone: '',
+ cityMasterName: '',
+ phoneCall: '',
+ town: '',
+ fax: '',
+ street: '',
+ postalCode: '',
+ address: '',
+ parentName: ''
};
-
stylesLoaded = false;
@@ -275,7 +274,7 @@
@track fiscalYearOptions = [
{ label: '鏈储骞�', value: 'thisYear' },
{ label: '涓婁竴璐㈠勾', value: 'lastYear' },
- { label: '涓婁竴璐㈠勾+鏈储骞�', value: 'allYear' },
+ { label: '涓婁竴璐㈠勾+鏈储骞�', value: 'allYear' }
];
@track fiscalYearOption = 'thisYear';
@track topInfo = [];
@@ -284,19 +283,19 @@
if (!this.stylesLoaded) {
Promise.all([loadStyle(this, WrappedHeaderTable)])
.then(() => {
- console.log("Custom styles loaded");
+ console.log('Custom styles loaded');
this.stylesLoaded = true;
})
.catch((error) => {
- console.error("Error loading custom styles");
+ console.error('Error loading custom styles');
});
}
}
//鑾峰彇閾炬帴鍙傛暟
getQueryString(name) {
- console.log("getQueryString name " + name);
- let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+ console.log('getQueryString name ' + name);
+ let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
let r = window.location.search.substr(1).match(reg);
if (r != null) {
return decodeURIComponent(r[2]);
@@ -306,153 +305,245 @@
connectedCallback() {
this.isShowSpinner = true;
- this.AccId = this.getQueryString("AccId");
- this.AccId = this.AccId == null ? "" : this.AccId;
- if (this.AccId != "") {
- console.log("this.AccId = " + this.AccId);
+ this.AccId = this.getQueryString('AccId');
+ this.AccId = this.AccId == null ? '' : this.AccId;
+ if (this.AccId != '') {
+ console.log('this.AccId = ' + this.AccId);
accountInit({
- accId: this.AccId,
- }).then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log("r = " + JSON.stringify(r));
- if (r.status == "Success") {
- console.log('r.entity.obj = ' + JSON.stringify(r.entity.obj))
- this.accountDataInfo.name = r.entity.obj.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.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.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.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.address = r.entity.obj.Address__c;
- this.accountDataInfo.parentName = r.entity.obj.Parent == null ? "" : r.entity.obj.Parent.Name;
- console.log('this.accountDataInfo = ' + JSON.stringify(this.accountDataInfo))
- this.printUrl = "/lexconsumableaccountinfoprint?AccId=" + this.AccId;
- this.isShowAccountInfo = true;
- this.isShowSpinner = false;
- } else {
- console.log("r = " + JSON.stringify(r));
- this.showMyToast('Error', r.msg, 'Error');
- }
- }).catch((error) => {
- console.log("error = " + JSON.stringify(error));
- this.showMyToast('Error', '鍒濆鍖栧け璐�', 'Error');
- });
+ accId: this.AccId
+ })
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log('r = ' + JSON.stringify(r));
+ if (r.status == 'Success') {
+ console.log(
+ 'r.entity.obj = ' + JSON.stringify(r.entity.obj)
+ );
+ this.accountDataInfo.name = r.entity.obj.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.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.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.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.address = r.entity.obj.Address__c;
+ this.accountDataInfo.parentName =
+ r.entity.obj.Parent == null
+ ? ''
+ : r.entity.obj.Parent.Name;
+ console.log(
+ 'this.accountDataInfo = ' +
+ JSON.stringify(this.accountDataInfo)
+ );
+ this.printUrl =
+ '/lexconsumableaccountinfoprint?AccId=' +
+ this.AccId;
+ this.isShowAccountInfo = true;
+ this.isShowSpinner = false;
+ } else {
+ console.log('r = ' + JSON.stringify(r));
+ this.showMyToast('Error', r.msg, 'Error');
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showMyToast('Error', '鍒濆鍖栧け璐�', 'Error');
+ });
} else {
init({
pageSizeLWC: this.pageSize,
pageTokenLWC: this.currentPageToken,
fiscalYear: this.fiscalYearOption
- }).then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log("r = " + JSON.stringify(r));
- if (r.status == "Success") {
- //鍒嗛〉
- this.nextPageToken = r.entity.paginatedAccounts.nextPageToken;
- this.totalRecords = r.entity.paginatedAccounts.totalRecords;
- this.recordStart = r.entity.paginatedAccounts.recordStart;
- this.recordEnd = r.entity.paginatedAccounts.recordEnd;
- this.totalPages = Math.ceil(
- r.entity.paginatedAccounts.totalRecords / this.pageSize
- );
- console.log("this.totalPages = " + this.totalPages);
- this.paginationVisibility = this.totalPages > 1 ? true : false;
+ })
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log('r = ' + JSON.stringify(r));
+ if (r.status == 'Success') {
+ //鍒嗛〉
+ this.nextPageToken =
+ r.entity.paginatedAccounts.nextPageToken;
+ this.totalRecords =
+ r.entity.paginatedAccounts.totalRecords;
+ this.recordStart =
+ r.entity.paginatedAccounts.recordStart;
+ this.recordEnd = r.entity.paginatedAccounts.recordEnd;
+ this.totalPages = Math.ceil(
+ r.entity.paginatedAccounts.totalRecords /
+ this.pageSize
+ );
+ console.log('this.totalPages = ' + this.totalPages);
+ this.paginationVisibility =
+ this.totalPages > 1 ? true : false;
- this.pageRecords = r.entity.pageRecords;
- this.accountId = r.entity.accountId;
- this.agencyProType = r.entity.agencyProType;
- this.agencyProTypestr = r.entity.agencyProTypestr;
- console.log("this.agencyProTypestr = " + this.agencyProTypestr);
- for (var i in this.pageRecords) {
- this.pageRecords[i]["Is_Active__c"] = this.pageRecords[i].Is_Active__c.replace('鍔�','鏁�');
- this.pageRecords[i]["NameUrl"] = "/s/lexconsumableaccount?AccId=" + this.pageRecords[i].Id;
- this.pageRecords[i]["StateMasterName"] = this.pageRecords[i].State_Master__r.Name;
- this.pageRecords[i]["StateMasterUrl"] = "/" + this.pageRecords[i].State_Master__c;
- this.pageRecords[i]["CityMasterName"] = this.pageRecords[i].City_Master__r.Name;
- this.pageRecords[i]["CityMasterNameUrl"] = "/" + this.pageRecords[i].City_Master__c;
- this.pageRecords[i]["RecordTypeName"] = this.pageRecords[i].RecordType.Name;
- }
- console.log(
- "this.listViewOptions = " + JSON.stringify(this.listViewOptions)
- );
-
- console.log('r.entity.topInfo = ' + JSON.stringify(r.entity.topInfo))
- //top10瀹㈡埛
- this.topInfo = r.entity.topInfo;
- console.log("this.topInfo = " + JSON.stringify(this.topInfo));
- this.topAccountData = this.topInfo.acList;
- console.log(
- "this.topAccountData = " + JSON.stringify(this.topAccountData)
- );
- console.log('9/3 = ' + this.keepTwoDecimalStr(this.amend(9, 3, '/').toFixed(2)));
- let total = 100;
- try {
- for (var i in this.topAccountData) {
- console.log('i = ' + i);
- this.topAccountData[i]["accountName"] = this.topAccountData[i].Name;
- this.topAccountData[i]["accountUrl"] = "/s/lexconsumableaccount?AccId=" + this.topAccountData[i].Id;
- this.topAccountData[i]["isDisable"] = false;
- this.topAccountData[i]["StateMasterName"] = this.topAccountData[i].State_Master__r.Name;
- this.topAccountData[i]["StateMasterUrl"] = "/" + this.topAccountData[i].State_Master__c;
- this.topAccountData[i]["CityMasterName"] = this.topAccountData[i].City_Master__r.Name;
- this.topAccountData[i]["CityMasterNameUrl"] = "/" + this.topAccountData[i].City_Master__c;
- this.topAccountData[i]["RecordTypeName"] = this.topAccountData[i].RecordType.Name;
- this.topAccountData[i]["isShowButton"] = true;
- let number = this.keepTwoDecimalStr((this.amend(this.topInfo.deList[i], this.topInfo.saleAmount, '/') * 100).toFixed(2));
- total -= number;
- this.topAccountData[i]["proportion"] = number + '%';
+ this.pageRecords = r.entity.pageRecords;
+ this.accountId = r.entity.accountId;
+ this.agencyProType = r.entity.agencyProType;
+ this.agencyProTypestr = r.entity.agencyProTypestr;
+ console.log(
+ 'this.agencyProTypestr = ' + this.agencyProTypestr
+ );
+ for (var i in this.pageRecords) {
+ this.pageRecords[i]['Is_Active__c'] =
+ this.pageRecords[i].Is_Active__c.replace(
+ '鍔�',
+ '鏁�'
+ );
+ this.pageRecords[i]['NameUrl'] =
+ '/s/lexconsumableaccount?AccId=' +
+ this.pageRecords[i].Id;
+ this.pageRecords[i]['StateMasterName'] =
+ this.pageRecords[i].State_Master__r.Name;
+ this.pageRecords[i]['StateMasterUrl'] =
+ '/' + this.pageRecords[i].State_Master__c;
+ this.pageRecords[i]['CityMasterName'] =
+ this.pageRecords[i].City_Master__r.Name;
+ this.pageRecords[i]['CityMasterNameUrl'] =
+ '/' + this.pageRecords[i].City_Master__c;
+ this.pageRecords[i]['RecordTypeName'] =
+ this.pageRecords[i].RecordType.Name;
}
+ console.log(
+ 'this.listViewOptions = ' +
+ JSON.stringify(this.listViewOptions)
+ );
- console.log('this.topAccountData = ' + JSON.stringify(this.topAccountData));
-
- //鍏朵粬
- if (total != 100) {
- this.topAccountData.push({
- accountName: '...',
- accountUrl: '/s/lexconsumableaccount',
- isDisable: true,
- proportion: total.toFixed(2) + '%',
- CityMasterName: '...',
- CityMasterNameUrl: '/lexconsumableaccount',
- Town__c: '...',
- isShowButton: false
- })
- } else {
- let title = '';
- for (var key in this.fiscalYearOptions) {
- if (this.fiscalYearOption == this.fiscalYearOptions[key].value)
- title = this.fiscalYearOptions[key].label;
+ console.log(
+ 'r.entity.topInfo = ' +
+ JSON.stringify(r.entity.topInfo)
+ );
+ //top10瀹㈡埛
+ this.topInfo = r.entity.topInfo;
+ console.log(
+ 'this.topInfo = ' + JSON.stringify(this.topInfo)
+ );
+ this.topAccountData = this.topInfo.acList;
+ console.log(
+ 'this.topAccountData = ' +
+ JSON.stringify(this.topAccountData)
+ );
+ console.log(
+ '9/3 = ' +
+ this.keepTwoDecimalStr(
+ this.amend(9, 3, '/').toFixed(2)
+ )
+ );
+ let total = 100;
+ try {
+ for (var i in this.topAccountData) {
+ console.log('i = ' + i);
+ this.topAccountData[i]['accountName'] =
+ this.topAccountData[i].Name;
+ this.topAccountData[i]['accountUrl'] =
+ '/s/lexconsumableaccount?AccId=' +
+ this.topAccountData[i].Id;
+ this.topAccountData[i]['isDisable'] = false;
+ this.topAccountData[i]['StateMasterName'] =
+ this.topAccountData[i].State_Master__r.Name;
+ this.topAccountData[i]['StateMasterUrl'] =
+ '/' +
+ this.topAccountData[i].State_Master__c;
+ this.topAccountData[i]['CityMasterName'] =
+ this.topAccountData[i].City_Master__r.Name;
+ this.topAccountData[i]['CityMasterNameUrl'] =
+ '/' + this.topAccountData[i].City_Master__c;
+ this.topAccountData[i]['RecordTypeName'] =
+ this.topAccountData[i].RecordType.Name;
+ this.topAccountData[i]['isShowButton'] = true;
+ let number = this.keepTwoDecimalStr(
+ (
+ this.amend(
+ this.topInfo.deList[i],
+ this.topInfo.saleAmount,
+ '/'
+ ) * 100
+ ).toFixed(2)
+ );
+ total -= number;
+ this.topAccountData[i]['proportion'] =
+ number + '%';
}
- this.showMyToast(title, '鏃犳暟鎹�', 'Error');
- }
- this.isShowSpinner = false;
- } catch (error) {
- console.log('error = ' + error.message)
- }
- } else {
- console.log("r = " + JSON.stringify(r));
- this.showMyToast('Error', r.msg, 'Error');
- }
- }).catch((error) => {
- console.log("error = " + JSON.stringify(error));
- this.showMyToast('Error', '閿�閲忓墠鍗佸鎴峰垵濮嬪寲澶辫触', 'Error');
- });
+ console.log(
+ 'this.topAccountData = ' +
+ JSON.stringify(this.topAccountData)
+ );
+
+ //鍏朵粬
+ if (total != 100) {
+ this.topAccountData.push({
+ accountName: '...',
+ accountUrl: '/s/lexconsumableaccount',
+ isDisable: true,
+ proportion: total.toFixed(2) + '%',
+ CityMasterName: '...',
+ CityMasterNameUrl: '/lexconsumableaccount',
+ Town__c: '...',
+ isShowButton: false
+ });
+ } else {
+ let title = '';
+ for (var key in this.fiscalYearOptions) {
+ if (
+ this.fiscalYearOption ==
+ this.fiscalYearOptions[key].value
+ )
+ title =
+ this.fiscalYearOptions[key].label;
+ }
+ this.showMyToast(title, '鏃犳暟鎹�', 'Error');
+ }
+ this.isShowSpinner = false;
+ } catch (error) {
+ console.log('error = ' + error.message);
+ }
+ } else {
+ console.log('r = ' + JSON.stringify(r));
+ this.showMyToast('Error', r.msg, 'Error');
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showMyToast(
+ 'Error',
+ '閿�閲忓墠鍗佸鎴峰垵濮嬪寲澶辫触',
+ 'Error'
+ );
+ });
}
}
amend(num1, num2, symbol) {
+ console.log('num1 = ' + num1);
+ console.log('num2 = ' + num2);
+ console.log('symbol = ' + symbol);
var str1 = num1.toString(),
str2 = num2.toString(),
result,
@@ -460,28 +551,28 @@
str2Length;
//瑙e喅鏁存暟娌℃湁灏忔暟鐐规柟娉�
try {
- str1Length = str1.split(".")[1].length;
+ str1Length = str1.split('.')[1].length;
} catch (error) {
str1Length = 0;
}
try {
- str2Length = str2.split(".")[1].length;
+ str2Length = str2.split('.')[1].length;
} catch (error) {
str2Length = 0;
}
var step = Math.pow(10, Math.max(str1Length, str2Length));
console.log(step);
switch (symbol) {
- case "+":
+ case '+':
result = (num1 * step + num2 * step) / step;
break;
- case "-":
+ case '-':
result = (num1 * step - num2 * step) / step;
break;
- case "*":
+ case '*':
result = (num1 * step * (num2 * step)) / step / step;
break;
- case "/":
+ case '/':
result = (num1 * step) / (num2 * step);
break;
default:
@@ -489,7 +580,6 @@
}
return result;
}
-
keepTwoDecimalStr(num) {
const result = Number(num.toString().match(/^\d+(?:\.\d{0,2})?/));
@@ -503,12 +593,12 @@
s += '0';
}
return s;
- };
+ }
dataChange(event) {
- let fieldName = event.target.getAttribute("data-field");
+ let fieldName = event.target.getAttribute('data-field');
let value = event.detail.value;
- console.log("fieldName = " + fieldName + " value = " + value);
+ console.log('fieldName = ' + fieldName + ' value = ' + value);
switch (fieldName) {
case 'viewOption':
this.viewOption = value;
@@ -525,64 +615,88 @@
this.isShowSpinner = true;
changeFiscalYearView({
fiscalYear: this.fiscalYearOption
- }).then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log("r = " + JSON.stringify(r));
- if (r.status == "Success") {
- //top10瀹㈡埛
- this.topInfo = r.entity.topInfo;
- console.log("this.topInfo = " + JSON.stringify(this.topInfo));
- this.topAccountData = this.topInfo.acList;
- console.log(
- "this.topAccountData = " + JSON.stringify(this.topAccountData)
- );
- let total = 100;
- for (var i in this.topAccountData) {
- console.log('i = ' + i);
- this.topAccountData[i]["accountName"] = this.topAccountData[i].Name;
- this.topAccountData[i]["accountUrl"] = "/s/lexconsumableaccount?AccId=" + this.topAccountData[i].Id;
- this.topAccountData[i]["isDisable"] = false;
- this.topAccountData[i]["StateMasterName"] = this.topAccountData[i].State_Master__r.Name;
- this.topAccountData[i]["StateMasterUrl"] = "/" + this.topAccountData[i].State_Master__c;
- this.topAccountData[i]["CityMasterName"] = this.topAccountData[i].City_Master__r.Name;
- this.topAccountData[i]["CityMasterNameUrl"] = "/" + this.topAccountData[i].City_Master__c;
- this.topAccountData[i]["RecordTypeName"] = this.topAccountData[i].RecordType.Name;
- this.topAccountData[i]["isShowButton"] = true;
- let number = this.keepTwoDecimalStr((this.amend(this.topInfo.deList[i], this.topInfo.saleAmount, '/') * 100).toFixed(2));
- total -= number;
- this.topAccountData[i]["proportion"] = number + '%';
- }
-
- // //鍏朵粬
- if (total != 100) {
- this.topAccountData.push({
- accountName: '...',
- accountUrl: '/s/lexconsumableaccount',
- isDisable: true,
- proportion: total.toFixed(2) + '%',
- CityMasterName: '...',
- CityMasterNameUrl: '/lexconsumableaccount',
- Town__c: '...',
- isShowButton: false
- })
- } else {
- let title = '';
- for (var key in this.fiscalYearOptions) {
- if (this.fiscalYearOption == this.fiscalYearOptions[key].value)
- title = this.fiscalYearOptions[key].label;;
+ })
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log('r = ' + JSON.stringify(r));
+ if (r.status == 'Success') {
+ //top10瀹㈡埛
+ this.topInfo = r.entity.topInfo;
+ console.log(
+ 'this.topInfo = ' + JSON.stringify(this.topInfo)
+ );
+ this.topAccountData = this.topInfo.acList;
+ console.log(
+ 'this.topAccountData = ' +
+ JSON.stringify(this.topAccountData)
+ );
+ let total = 100;
+ for (var i in this.topAccountData) {
+ console.log('i = ' + i);
+ this.topAccountData[i]['accountName'] =
+ this.topAccountData[i].Name;
+ this.topAccountData[i]['accountUrl'] =
+ '/s/lexconsumableaccount?AccId=' +
+ this.topAccountData[i].Id;
+ this.topAccountData[i]['isDisable'] = false;
+ this.topAccountData[i]['StateMasterName'] =
+ this.topAccountData[i].State_Master__r.Name;
+ this.topAccountData[i]['StateMasterUrl'] =
+ '/' + this.topAccountData[i].State_Master__c;
+ this.topAccountData[i]['CityMasterName'] =
+ this.topAccountData[i].City_Master__r.Name;
+ this.topAccountData[i]['CityMasterNameUrl'] =
+ '/' + this.topAccountData[i].City_Master__c;
+ this.topAccountData[i]['RecordTypeName'] =
+ this.topAccountData[i].RecordType.Name;
+ this.topAccountData[i]['isShowButton'] = true;
+ let number = this.keepTwoDecimalStr(
+ (
+ this.amend(
+ this.topInfo.deList[i],
+ this.topInfo.saleAmount,
+ '/'
+ ) * 100
+ ).toFixed(2)
+ );
+ total -= number;
+ this.topAccountData[i]['proportion'] = number + '%';
}
- this.showMyToast(title, '鏃犳暟鎹�', 'Error');
- }
- this.isShowSpinner = false;
- } else {
- console.log("r = " + JSON.stringify(r));
- this.showMyToast('Error', r.msg, 'Error');
- }
- }).catch((error) => {
- console.log("error = " + JSON.stringify(error));
- this.showMyToast('Error', '閿�閲忓墠鍗佸鎴峰垵濮嬪寲澶辫触', 'Error');
- });
+ // //鍏朵粬
+ if (total != 100) {
+ this.topAccountData.push({
+ accountName: '...',
+ accountUrl: '/s/lexconsumableaccount',
+ isDisable: true,
+ proportion: total.toFixed(2) + '%',
+ CityMasterName: '...',
+ CityMasterNameUrl: '/lexconsumableaccount',
+ Town__c: '...',
+ isShowButton: false
+ });
+ } else {
+ let title = '';
+ for (var key in this.fiscalYearOptions) {
+ if (
+ this.fiscalYearOption ==
+ this.fiscalYearOptions[key].value
+ )
+ title = this.fiscalYearOptions[key].label;
+ }
+ this.showMyToast(title, '鏃犳暟鎹�', 'Error');
+ }
+
+ this.isShowSpinner = false;
+ } else {
+ console.log('r = ' + JSON.stringify(r));
+ this.showMyToast('Error', r.msg, 'Error');
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showMyToast('Error', '閿�閲忓墠鍗佸鎴峰垵濮嬪寲澶辫触', 'Error');
+ });
}
changelistView() {
@@ -594,40 +708,54 @@
pageSizeLWC: this.pageSize,
pageTokenLWC: this.currentPageToken,
sortFieldLWC: this.sortBy,
- sortOrderLWC: this.sortDirection,
+ sortOrderLWC: this.sortDirection
})
.then((r) => {
r = JSON.parse(JSON.stringify(r));
- console.log("r = " + JSON.stringify(r));
- if (r.status == "Success") {
+ console.log('r = ' + JSON.stringify(r));
+ if (r.status == 'Success') {
//鍒嗛〉
- this.nextPageToken = r.entity.paginatedAccounts.nextPageToken;
+ this.nextPageToken =
+ r.entity.paginatedAccounts.nextPageToken;
this.totalRecords = r.entity.paginatedAccounts.totalRecords;
this.recordStart = r.entity.paginatedAccounts.recordStart;
this.recordEnd = r.entity.paginatedAccounts.recordEnd;
this.totalPages = Math.ceil(
r.entity.paginatedAccounts.totalRecords / this.pageSize
);
- console.log("this.totalPages = " + this.totalPages);
- this.paginationVisibility = this.totalPages > 1 ? true : false;
+ console.log('this.totalPages = ' + this.totalPages);
+ this.paginationVisibility =
+ this.totalPages > 1 ? true : false;
this.pageRecords = r.entity.pageRecords;
- console.log("this.pageRecords = " + JSON.stringify(this.pageRecords));
+ console.log(
+ 'this.pageRecords = ' + JSON.stringify(this.pageRecords)
+ );
for (var i in this.pageRecords) {
- this.pageRecords[i]["Is_Active__c"] = this.pageRecords[i].Is_Active__c.replace('鍔�','鏁�');
- this.pageRecords[i]["NameUrl"] = "/s/lexconsumableaccount?AccId=" + this.pageRecords[i].Id;
- this.pageRecords[i]["StateMasterName"] = this.pageRecords[i].State_Master__r.Name;
- this.pageRecords[i]["StateMasterUrl"] = "/" + this.pageRecords[i].State_Master__c;
- this.pageRecords[i]["CityMasterName"] = this.pageRecords[i].City_Master__r.Name;
- this.pageRecords[i]["CityMasterNameUrl"] = "/" + this.pageRecords[i].City_Master__c;
- this.pageRecords[i]["RecordTypeName"] = this.pageRecords[i].RecordType.Name;
+ this.pageRecords[i]['Is_Active__c'] = this.pageRecords[
+ i
+ ].Is_Active__c.replace('鍔�', '鏁�');
+ this.pageRecords[i]['NameUrl'] =
+ '/s/lexconsumableaccount?AccId=' +
+ this.pageRecords[i].Id;
+ this.pageRecords[i]['StateMasterName'] =
+ this.pageRecords[i].State_Master__r.Name;
+ this.pageRecords[i]['StateMasterUrl'] =
+ '/' + this.pageRecords[i].State_Master__c;
+ this.pageRecords[i]['CityMasterName'] =
+ this.pageRecords[i].City_Master__r.Name;
+ this.pageRecords[i]['CityMasterNameUrl'] =
+ '/' + this.pageRecords[i].City_Master__c;
+ this.pageRecords[i]['RecordTypeName'] =
+ this.pageRecords[i].RecordType.Name;
}
this.isShowSpinner = false;
} else {
this.showMyToast('Error', r.msg, 'Error');
}
- }).catch((error) => {
- console.log('error = ' + JSON.stringify(error.message))
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error.message));
});
}
@@ -642,21 +770,28 @@
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) {
const key = primer
? function (x) {
- return primer(x[field]);
- }
+ return primer(x[field]);
+ }
: function (x) {
- return x[field];
- };
+ return x[field];
+ };
return function (a, b) {
a = key(a);
@@ -668,26 +803,26 @@
onHandleSort(event) {
this.sortBy = event.detail.fieldName;
switch (this.sortBy) {
- case "NameUrl":
- this.sortBy = "Name";
+ case 'NameUrl':
+ this.sortBy = 'Name';
break;
- case "StateMasterUrl":
- this.sortBy = "State_Master__r.Name";
+ case 'StateMasterUrl':
+ this.sortBy = 'State_Master__r.Name';
break;
- case "RecordTypeName":
- this.sortBy = "RecordType.Name";
+ case 'RecordTypeName':
+ this.sortBy = 'RecordType.Name';
break;
- case "CityMasterNameUrl":
- this.sortBy = "City_Master__r.Name";
+ case 'CityMasterNameUrl':
+ this.sortBy = 'City_Master__r.Name';
break;
}
this.sortDirection = event.detail.sortDirection;
this.currentPageToken = 0;
- console.log("this.sortBy = " + this.sortBy);
- console.log("this.sortDirection = " + this.sortDirection);
+ console.log('this.sortBy = ' + this.sortBy);
+ console.log('this.sortDirection = ' + this.sortDirection);
this.changelistView();
const { fieldName: sortedBy, sortDirection } = event.detail;
- this.sortByMethod(sortedBy, sortDirection === "asc" ? 1 : -1);
+ this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1);
this.sortDirection = sortDirection;
this.sortedBy = sortedBy;
}
diff --git a/force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.html b/force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.html
index 884c635..360e326 100644
--- a/force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.html
+++ b/force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.html
@@ -1,8 +1,8 @@
<template>
<lightning-layout multiple-rows="true">
<lightning-layout-item size="2">
- <strong style="font-size: 20px;">娑堣�楀搧绠$悊绯荤粺</strong>
- <div style="height: 20px;"></div>
+ <strong style="font-size: 20px">娑堣�楀搧绠$悊绯荤粺</strong>
+ <div style="height: 20px"></div>
<strong>{accountDataInfo.name}</strong>
</lightning-layout-item>
<lightning-layout-item size="9"></lightning-layout-item>
@@ -16,24 +16,33 @@
</lightning-layout>
<div class="outerBorderCss">
- <div style="padding:5px;">
+ <div style="padding: 5px">
<div class="borderCss">
- <div style="padding:10px;border-bottom:1px solid #DDE4E9">
- <div lwc:dom="manual" class="resultDiv">
- </div>
- <p style="font-size: 15px;"><strong>瀹㈡埛淇℃伅</strong></p>
+ <div style="padding: 10px; border-bottom: 1px solid #dde4e9">
+ <div lwc:dom="manual" class="resultDiv"></div>
+ <p style="font-size: 15px"><strong>瀹㈡埛淇℃伅</strong></p>
<div draggable="false">
<div class="slds-m-top_small slds-m-bottom_medium">
<lightning-layout multiple-rows="true">
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="瀹㈡埛鍚�" value={accountDataInfo.name}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="瀹㈡埛鍚�"
+ value={accountDataInfo.name}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="瀹㈡埛鎵�鏈変汉" value={accountDataInfo.ownerName}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="瀹㈡埛鎵�鏈変汉"
+ value={accountDataInfo.ownerName}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -41,12 +50,22 @@
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="鍒悕1" value={accountDataInfo.site}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="鍒悕1"
+ value={accountDataInfo.site}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="鏈夋晥/鏃犳晥" value={accountDataInfo.isActive}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="鏈夋晥/鏃犳晥"
+ value={accountDataInfo.isActive}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -54,12 +73,22 @@
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="鍒悕2" value={accountDataInfo.aliasName2}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="鍒悕2"
+ value={accountDataInfo.aliasName2}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="绂佺敤鐞嗙敱" value={accountDataInfo.banOnUseReason}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="绂佺敤鐞嗙敱"
+ value={accountDataInfo.banOnUseReason}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -67,13 +96,22 @@
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="鏀垮簻绛夌礆" value={accountDataInfo.grade}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="鏀垮簻绛夌礆"
+ value={accountDataInfo.grade}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="鍖婚櫌鎵�灞炴�ц川"
- value={accountDataInfo.attributeType} variant="label-inline"
- read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="鍖婚櫌鎵�灞炴�ц川"
+ value={accountDataInfo.attributeType}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -81,36 +119,53 @@
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="OCSM鍒嗙被(鍖婚櫌)"
- value={accountDataInfo.oCMCategory} variant="label-inline"
- read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="OCSM鍒嗙被(鍖婚櫌)"
+ value={accountDataInfo.oCMCategory}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="鍖婚櫌涓撲笟鍖哄垎"
- value={accountDataInfo.specialityType} variant="label-inline"
- read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="鍖婚櫌涓撲笟鍖哄垎"
+ value={accountDataInfo.specialityType}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
</div>
</div>
</div>
- <div style="padding:10px;border-bottom:1px solid #DDE4E9">
- <div lwc:dom="manual" class="resultDiv">
- </div>
- <p style="font-size: 15px;"><strong>鍦板潃淇℃伅</strong></p>
+ <div style="padding: 10px; border-bottom: 1px solid #dde4e9">
+ <div lwc:dom="manual" class="resultDiv"></div>
+ <p style="font-size: 15px"><strong>鍦板潃淇℃伅</strong></p>
<div draggable="false">
<div class="slds-m-top_small slds-m-bottom_medium">
<lightning-layout multiple-rows="true">
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="鐪�" value={accountDataInfo.stateMasterName}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="鐪�"
+ value={accountDataInfo.stateMasterName}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="鐢佃瘽" value={accountDataInfo.phone}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="鐢佃瘽"
+ value={accountDataInfo.phone}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -118,12 +173,22 @@
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="甯�" value={accountDataInfo.cityMasterName}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="甯�"
+ value={accountDataInfo.cityMasterName}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="鐢佃瘽2" value={accountDataInfo.phoneCall}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="鐢佃瘽2"
+ value={accountDataInfo.phoneCall}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -131,12 +196,22 @@
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="鍘�/鍖�" value={accountDataInfo.town}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="鍘�/鍖�"
+ value={accountDataInfo.town}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="浼犵湡" value={accountDataInfo.fax}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="浼犵湡"
+ value={accountDataInfo.fax}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -144,12 +219,22 @@
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="琛楅亾" value={accountDataInfo.street}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="琛楅亾"
+ value={accountDataInfo.street}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="閭紪" value={accountDataInfo.postalCode}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="閭紪"
+ value={accountDataInfo.postalCode}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
@@ -157,32 +242,40 @@
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="鍦板潃" value={accountDataInfo.address}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="鍦板潃"
+ value={accountDataInfo.address}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
</div>
</div>
</div>
- <div style="padding:10px;border-bottom:1px solid #DDE4E9">
- <div lwc:dom="manual" class="resultDiv">
- </div>
- <p style="font-size: 15px;"><strong>绯荤粺淇℃伅</strong></p>
+ <div style="padding: 10px; border-bottom: 1px solid #dde4e9">
+ <div lwc:dom="manual" class="resultDiv"></div>
+ <p style="font-size: 15px"><strong>绯荤粺淇℃伅</strong></p>
<div draggable="false">
<div class="slds-m-top_small slds-m-bottom_medium">
<lightning-layout multiple-rows="true">
<lightning-layout-item size="2">
</lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-input type="text" label="姣嶅叕鍙�" value={accountDataInfo.parentName}
- variant="label-inline" read-only></lightning-input>
+ <lightning-input
+ type="text"
+ label="姣嶅叕鍙�"
+ value={accountDataInfo.parentName}
+ variant="label-inline"
+ read-only
+ ></lightning-input>
</lightning-layout-item>
</lightning-layout>
</div>
</div>
</div>
-
</div>
</div>
</div>
diff --git a/force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.js b/force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.js
index 03621bb..ab29dde 100644
--- a/force-app/main/default/lwc/lexConsumableAccountInfoPrint/lexConsumableAccountInfoPrint.js
+++ b/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]);
@@ -38,48 +38,73 @@
return null;
}
- connectedCallback(){
- this.AccId = this.getQueryString("AccId");
+ connectedCallback() {
+ 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) => {
- 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.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.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.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.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.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.isShowAccountInfo = true;
- this.isShowSpinner = false;
- } else {
- console.log('r = ' + JSON.stringify(r))
- this.showToast('Error', r.msg);
- }
- }).catch((error) => {
- console.log('error = ' + JSON.stringify(error))
- this.showToast('Error', r.msg);
})
+ .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.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.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.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.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.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.isShowAccountInfo = true;
+ this.isShowSpinner = false;
+ } else {
+ console.log('r = ' + JSON.stringify(r));
+ this.showToast('Error', r.msg);
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showToast('Error', r.msg);
+ });
}
}
@@ -93,11 +118,11 @@
this.dispatchEvent(event);
}
- printPage(){
+ printPage() {
window.print();
}
- closePage(){
- window.location.href = "/s/lexconsumableaccount";
+ closePage() {
+ window.location.href = '/s/lexconsumableaccount';
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.html b/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.html
index 03feeaa..a30c83d 100644
--- a/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.html
+++ b/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.html
@@ -2,7 +2,10 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
+ <div
+ role="status"
+ class="slds-spinner slds-spinner_medium slds-spinner_brand"
+ >
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -11,23 +14,53 @@
</template>
<c-common-toast></c-common-toast>
<template if:true={showPage}>
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
- <div style="padding:10px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ "
+ >
+ <div style="padding: 10px">
<!-- 鎸夐挳 -->
<!-- <lightning-button style="margin: 5px;" label="鍗忚璁㈣揣" onclick={agreementorder}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin-right: 150px;" onclick={agreementorder}>鍗忚璁㈣揣</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ style="margin-right: 150px"
+ onclick={agreementorder}
+ >
+ 鍗忚璁㈣揣
+ </button>
<template if:true={showHop}>
<!-- <lightning-button style="margin: 5px;" label="鍖婚櫌鐗逛环" onclick={hospitalorder}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin-right: 150px;" onclick={hospitalorder}>鍖婚櫌鐗逛环</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ style="margin-right: 150px"
+ onclick={hospitalorder}
+ >
+ 鍖婚櫌鐗逛环
+ </button>
</template>
<template if:true={hasSpecial}>
<!-- <lightning-button style="margin: 5px;" label="淇冮攢璁㈣揣" onclick={promotionorder}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={promotionorder}>淇冮攢璁㈣揣</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ onclick={promotionorder}
+ >
+ 淇冮攢璁㈣揣
+ </button>
</template>
- <p style="height: 10px;"></p>
+ <p style="height: 10px"></p>
<!-- 鎼滅储 -->
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -37,42 +70,103 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>妫�绱㈡潯浠�</strong></p> -->
</div>
- <div style="padding:10px;">
+ <div style="padding: 10px">
<table>
<tbody>
<tr>
- <td style="width:10px;"></td>
- <td style="width:122px;">
- <div style="color:#696969;font-size:16px;">娑堣�楀搧璁㈠崟鍚嶇О</div>
+ <td style="width: 10px"></td>
+ <td style="width: 122px">
+ <div
+ style="
+ color: #696969;
+ font-size: 16px;
+ "
+ >
+ 娑堣�楀搧璁㈠崟鍚嶇О
+ </div>
</td>
- <td >
- <lightning-input class="inputFont" type="text" label="娑堣�楀搧璁㈠崟鍚嶇О" value={category1} variant="label-hidden" onchange={category1Change}></lightning-input>
+ <td>
+ <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>
+ <td>
+ <lightning-input
+ class="inputFont"
+ type="date"
+ name="orderDate"
+ value={orderDate}
+ label="璁㈠崟鏃ユ湡"
+ variant="label-hidden"
+ onchange={orderDateChange}
+ ></lightning-input>
</td>
- <td style="width:30px;"></td>
- <td style="width: 74px;">
- <div style="color:#696969;font-size:16px;">璁㈠崟鐘舵��</div>
+ <td style="width: 30px"></td>
+ <td style="width: 74px">
+ <div
+ style="
+ color: #696969;
+ font-size: 16px;
+ "
+ >
+ 璁㈠崟鐘舵��
+ </div>
</td>
- <td style="width: 250px;">
- <lightning-combobox class="inputFont" name="orderStatus" label="璁㈠崟鐘舵��" value={orderStatus} placeholder="璇烽�夋嫨..." options={provinceOpts} variant="label-hidden" onchange={orderStatusChange}></lightning-combobox>
+ <td style="width: 250px">
+ <lightning-combobox
+ class="inputFont"
+ name="orderStatus"
+ label="璁㈠崟鐘舵��"
+ value={orderStatus}
+ placeholder="璇烽�夋嫨..."
+ options={provinceOpts}
+ variant="label-hidden"
+ onchange={orderStatusChange}
+ ></lightning-combobox>
</td>
</tr>
</tbody>
</table>
- <p style="height:10px;"></p>
+ <p style="height: 10px"></p>
<table>
<tbody>
<tr>
<td></td>
- <td style="width:325px;">
- <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="margin-right: 20px;height:32px;width: 150px;" onclick={searchProduct}>鎼滅储</button>
- <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="height:32px;width: 150px;" onclick={clear}>娓呯┖</button>
+ <td style="width: 325px">
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
+ style="
+ margin-right: 20px;
+ height: 32px;
+ width: 150px;
+ "
+ onclick={searchProduct}
+ >
+ 鎼滅储
+ </button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
+ style="height: 32px; width: 150px"
+ onclick={clear}
+ >
+ 娓呯┖
+ </button>
</td>
</tr>
</tbody>
@@ -80,8 +174,15 @@
</div>
</div>
<!-- 璁㈣揣鏄庣粏 -->
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -91,9 +192,15 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>璁㈣揣鏄庣粏</strong></p> -->
</div>
- <div style="padding:10px;">
+ <div style="padding: 10px">
<div class="table-container">
- <lightning-datatable class="wrapped-header-datatable" key-field="id" hide-checkbox-column="true" data={raesList} columns={cols}></lightning-datatable>
+ <lightning-datatable
+ class="wrapped-header-datatable"
+ key-field="id"
+ hide-checkbox-column="true"
+ data={raesList}
+ columns={cols}
+ ></lightning-datatable>
</div>
</div>
</div>
diff --git a/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.js b/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.js
index 2cf3248..0281ae7 100644
--- a/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.js
+++ b/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.js
@@ -1,14 +1,15 @@
-import { LightningElement,wire,api,track } from 'lwc';
+import { LightningElement, wire, api, track } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
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";
+//table css
+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 = '';
@@ -28,12 +29,12 @@
//鏄惁涓�鐩存樉绀烘彁绀�
@track isNoteStay = true;
- connectedCallback(){
+ connectedCallback() {
this.showSpinner = true;
initPage()
- .then(result=>{
+ .then((result) => {
this.isNoteStay = result.isNoteStay;
- if(result.result == 'Success'){
+ if (result.result == 'Success') {
this.provinceOpts = result.provinceOpts;
this.title = result.title;
this.raesList = result.raesList;
@@ -43,64 +44,68 @@
this.hasHop = result.hasHop;
this.hasSpecial = result.hasSpecial;
this.cols = result.cols;
- if(this.hasHop == true && this.agencyProType == 'ENG'){
+ if (this.hasHop == true && this.agencyProType == 'ENG') {
this.showHop = true;
}
- 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;
+ 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]['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{
+ } else {
this.showSpinner = false;
- console.log("Error:"+result.errorMsg);
+ console.log('Error:' + result.errorMsg);
const evt = new ShowToastEvent({
- title : '鍒濆鍖栭〉闈㈠け璐�',
+ title: '鍒濆鍖栭〉闈㈠け璐�',
message: result.errorMsg,
variant: 'error'
});
this.dispatchEvent(evt);
}
})
- .catch(error=>{
+ .catch((error) => {
this.showSpinner = false;
- console.log("Error:"+error);
- })
+ console.log('Error:' + error);
+ });
}
- renderedCallback(){
+ 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');
});
}
}
- category1Change(event){
+ category1Change(event) {
this.category1 = event.detail.value;
- console.log('category1:'+this.category1);
+ console.log('category1:' + this.category1);
}
-
- orderDateChange(event){
+
+ orderDateChange(event) {
this.orderDate = event.detail.value;
- console.log('orderDate:'+this.orderDate);
+ console.log('orderDate:' + this.orderDate);
}
- orderStatusChange(event){
+ orderStatusChange(event) {
this.orderStatus = event.detail.value;
- console.log('orderStatus:'+this.orderStatus);
+ console.log('orderStatus:' + this.orderStatus);
}
- agreementorder(event){
+ agreementorder(event) {
const config = {
type: 'standard__webPage',
attributes: {
@@ -110,7 +115,7 @@
this[NavigationMixin.Navigate](config);
}
- hospitalorder(event){
+ hospitalorder(event) {
const config = {
type: 'standard__webPage',
attributes: {
@@ -120,7 +125,7 @@
this[NavigationMixin.Navigate](config);
}
- promotionorder(event){
+ promotionorder(event) {
const config = {
type: 'standard__webPage',
attributes: {
@@ -130,80 +135,106 @@
this[NavigationMixin.Navigate](config);
}
- searchProduct(event){
+ 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=>{
- 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]['nameUrl'] = '/s/lexconsumable?ESetid='+this.raesList[i].Id;
+ 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.showSpinner = false;
- this.showMyToast('鎼滅储鎴愬姛',result.errorMsg,'success');
- }else{
- this.showSpinner = false;
- this.raesList = result.raesList;
- console.log("Error:"+result.errorMsg);
- if(result.errorMsg == '娌℃湁鎼滅储鍒扮浉鍏宠鍗�'){
- this.showMyToast(result.errorMsg,'','error');
- }else{
- this.showMyToast('鎼滅储澶辫触',result.errorMsg,'error');
- }
- this.dispatchEvent(evt);
+ 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);
+ if (result.errorMsg == '娌℃湁鎼滅储鍒扮浉鍏宠鍗�') {
+ this.showMyToast(result.errorMsg, '', 'error');
+ } else {
+ this.showMyToast('鎼滅储澶辫触', result.errorMsg, 'error');
+ }
+ this.dispatchEvent(evt);
+ }
+ });
}
- clear(event){
+ 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=>{
- 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]['nameUrl'] = '/s/lexconsumable?ESetid='+this.raesList[i].Id;
+ 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.showMyToast('鎼滅储鎴愬姛',result.errorMsg,'success');
- }else{
- this.raesList = result.raesList;
- console.log("Error:"+result.errorMsg);
- if(result.errorMsg == '娌℃湁鎼滅储鍒扮浉鍏宠鍗�'){
- this.showMyToast(result.errorMsg,'','error');
- }else{
- this.showMyToast('鎼滅储澶辫触',result.errorMsg,'error');
- }
- this.dispatchEvent(evt);
+ 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);
+ if (result.errorMsg == '娌℃湁鎼滅储鍒扮浉鍏宠鍗�') {
+ this.showMyToast(result.errorMsg, '', 'error');
+ } else {
+ this.showMyToast('鎼滅储澶辫触', result.errorMsg, 'error');
+ }
+ this.dispatchEvent(evt);
+ }
+ });
}
showMyToast(title, message, variant) {
console.log('show custom message');
var iconName = '';
var content = '';
- if(variant == 'success'){
- iconName = 'utility:check';
- }else{
- iconName = 'utility:error';
+ if (variant == 'success') {
+ iconName = 'utility:check';
+ } else {
+ iconName = 'utility:error';
}
- if(message != ''){
- content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
- }else{
- content = '<h2><strong>'+title+'<strong/></h2>';
+ if (message != '') {
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
+ } else {
+ content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template.querySelector('c-common-toast').
- showToast(variant,content,iconName,10000);
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
// var mode;
// if(this.isNoteStay){
// mode ='sticky';
@@ -217,5 +248,5 @@
// mode: mode
// });
// this.dispatchEvent(evt);
- }
+ }
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCssUtility/lexCssUtility.css b/force-app/main/default/lwc/lexCssUtility/lexCssUtility.css
index bf67af1..01d3be0 100644
--- a/force-app/main/default/lwc/lexCssUtility/lexCssUtility.css
+++ b/force-app/main/default/lwc/lexCssUtility/lexCssUtility.css
@@ -1,84 +1,80 @@
/* .lexstyle{ */
- /* font-size: 13px;
+/* font-size: 13px;
width: 80% !important;
/* width:50px; */
- /* --sds-c-button-text-color:red; */
- /* 鑳屾櫙棰滆壊 */
- /* --slds-c-button-brand-color-background:rgb(8,16,132); */
- /* 瀛椾綋棰滆壊 */
- /* --slds-c-button-brand-text-color:#FFFFFF; */
- /* --slds-c-button-brand-text-color-hover:#ccc; */
+/* --sds-c-button-text-color:red; */
+/* 鑳屾櫙棰滆壊 */
+/* --slds-c-button-brand-color-background:rgb(8,16,132); */
+/* 瀛椾綋棰滆壊 */
+/* --slds-c-button-brand-text-color:#FFFFFF; */
+/* --slds-c-button-brand-text-color-hover:#ccc; */
/* } */
-
/* button杈规 */
-.lexBorder{
+.lexBorder {
font-size: 18px;
font-family: 'sans-serif';
- font-weight:500;
- color:#0A81DF;
+ font-weight: 500;
+ 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{
+.lexsearchStyle {
font-size: 18px;
font-family: 'sans-serif';
- font-weight:500;
+ font-weight: 500;
width: 160px;
height: 36px;
border-radius: 4px;
opacity: 1;
- background:#090F84;
- color:#FFFFFF;
+ background: #090f84;
+ color: #ffffff;
}
-.lexclearStyle{
+.lexclearStyle {
font-size: 18px;
font-family: 'sans-serif';
- font-weight:500;
+ font-weight: 500;
width: 160px;
height: 36px;
border-radius: 4px;
opacity: 1;
- background: #FFFFFF;
- border:1px solid #4d4d4d;
- color:#333333;
-
+ background: #ffffff;
+ border: 1px solid #4d4d4d;
+ color: #333333;
}
-
/* button杈规 */
-.lexBorderWidth{
+.lexBorderWidth {
font-size: 18px;
font-family: 'sans-serif';
- font-weight:500;
- color:#0A81DF;;
+ font-weight: 500;
+ 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{
- margin-left:150px;
+.buttonMarginLeft {
+ margin-left: 150px;
}
/* button鐭窛绂� */
-.buttonminMarginLeft{
- margin-left:50px;
+.buttonminMarginLeft {
+ margin-left: 50px;
}
*:disabled {
@@ -87,36 +83,34 @@
}
/* 搴撳瓨鐩樼偣鍙樺寲鏄庣粏 */
-.changeDetail{
- width:250px;
- height:36px;
+.changeDetail {
+ width: 250px;
+ height: 36px;
font-size: 18px;
font-family: 'sans-serif';
- font-weight:500;
- color:#0A81DF;;
+ font-weight: 500;
+ color: #0a81df;
border-radius: 4px;
opacity: 1;
- background: #FFFFFF;
+ background: #ffffff;
box-sizing: border-box;
border-style: rgb(212, 212, 212);
}
/* 妫�绱㈡潯浠跺瓧浣� */
-.searchName{
+.searchName {
font-size: 16px;
font-family: 'sans-serif';
- font-weight:500;
-
+ font-weight: 500;
}
-
/* input 瀛椾綋澶у皬 by Link */
.inputFont {
font-size: 14px;
- --lwc-fontSize2:14px;
+ --lwc-fontSize2: 14px;
}
/* spinner_container By Link */
-.slds-spinner_container{
- position:fixed;
+.slds-spinner_container {
+ position: fixed;
top: 123px;
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.html b/force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.html
index a910547..d930dd5 100644
--- a/force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.html
+++ b/force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.html
@@ -12,5 +12,4 @@
disabled={isDisabledAttachment}
></lightning-combobox>
</div>
-
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.js b/force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.js
index 0a6be95..2bd4799 100644
--- a/force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.js
+++ b/force-app/main/default/lwc/lexCustomAttachmentTypeComp/lexCustomAttachmentTypeComp.js
@@ -1,4 +1,4 @@
-import { LightningElement,api } from 'lwc';
+import { LightningElement, api } from 'lwc';
export default class LexCustomAttachmentTypeComp extends LightningElement {
@api typeValue;
@@ -6,20 +6,31 @@
@api recordId;
@api isDisabledAttachment;
- connectedCallback(){
- console.log('typeValue = ' + this.typeValue + ' typeOptions = ' + this.typeOptions + ' recordId' + this.recordId + ' isDisabledAttachment=' + this.isDisabledAttachment);
+ connectedCallback() {
+ console.log(
+ 'typeValue = ' +
+ this.typeValue +
+ ' typeOptions = ' +
+ this.typeOptions +
+ ' recordId' +
+ this.recordId +
+ ' isDisabledAttachment=' +
+ this.isDisabledAttachment
+ );
}
- handleDataChange(event){
+ handleDataChange(event) {
console.log('typeValue = ' + event.target.value);
this.typeValue = event.target.value;
- this.dispatchEvent(new CustomEvent('typechange', {
- composed: true,
- bubbles: true,
- cancelable: true,
- detail: {
- data: { typeValue: this.typeValue, recordId: this.recordId }
- }
- }));
+ this.dispatchEvent(
+ new CustomEvent('typechange', {
+ composed: true,
+ bubbles: true,
+ cancelable: true,
+ detail: {
+ data: { typeValue: this.typeValue, recordId: this.recordId }
+ }
+ })
+ );
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.html b/force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.html
index bed3e16..7ce19b5 100644
--- a/force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.html
+++ b/force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.html
@@ -1,10 +1,10 @@
<template>
<lightning-input
- style="width:90%;"
- variant="label-hidden"
- type='text'
- value = {DiffReason}
- onblur={diffReasonBlur}>
-
+ style="width: 90%"
+ variant="label-hidden"
+ type="text"
+ value={DiffReason}
+ onblur={diffReasonBlur}
+ >
</lightning-input>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.js b/force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.js
index 97cd01a..7a017c3 100644
--- a/force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.js
+++ b/force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.js
@@ -1,28 +1,31 @@
-import { LightningElement,api, track } from 'lwc';
+import { LightningElement, api, track } from 'lwc';
export default class LexCustomDiffReasonComp extends LightningElement {
@api prodId;
@api boxPiece;
@track DiffReason = '';
-
- connectedCallback(){
- console.log('ProdId'+this.prodId);
+ connectedCallback() {
+ console.log('ProdId' + this.prodId);
}
- diffReasonBlur(event){
- console.log('LexCustomDiffReasonComp')
+ diffReasonBlur(event) {
+ console.log('LexCustomDiffReasonComp');
this.DiffReason = event.target.value;
- this.dispatchEvent(new CustomEvent('diffreasons', {
- composed: true,
- bubbles: true,
- cancelable: true,
- detail: {
- data: { DiffReason: this.DiffReason, ProdId: this.prodId ,boxPiece:this.boxPiece}
- }
- }));
+ this.dispatchEvent(
+ new CustomEvent('diffreasons', {
+ composed: true,
+ bubbles: true,
+ cancelable: true,
+ detail: {
+ data: {
+ DiffReason: this.DiffReason,
+ ProdId: this.prodId,
+ boxPiece: this.boxPiece
+ }
+ }
+ })
+ );
}
-
-
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html b/force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html
index 98db636..b46df6e 100644
--- a/force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html
+++ b/force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html
@@ -1,16 +1,19 @@
<template>
<template if:true={showNormal}>
- <div style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;text-align: right;padding-right:10px;">
+ <div
+ style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;text-align: right;padding-right:10px;">
<lightning-formatted-number value={value}></lightning-formatted-number>
</div>
</template>
<template if:true={showRed}>
- <div style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;background-color:red;text-align: right;padding-right:10px;">
+ <div
+ style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;background-color:red;text-align: right;padding-right:10px;">
<lightning-formatted-number value={value}></lightning-formatted-number>
</div>
</template>
<template if:true={showYellow}>
- <div style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;background-color:yellow;text-align: right;padding-right:10px;">
+ <div
+ style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;background-color:yellow;text-align: right;padding-right:10px;">
<lightning-formatted-number value={value}></lightning-formatted-number>
</div>
</template>
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/customAgencyOppInput.html b/force-app/main/default/lwc/lexCustomLightningDatatable/customAgencyOppInput.html
index 45c7582..c459a30 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customAgencyOppInput.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customAgencyOppInput.html
@@ -1,3 +1,8 @@
<template>
- <c-lex-agency-opp-cus-cell input-value={typeAttributes.inputValue} record-id={typeAttributes.recordId} field-name={typeAttributes.fieldName} show-type={typeAttributes.showType}></c-lex-agency-opp-cus-cell>
+ <c-lex-agency-opp-cus-cell
+ input-value={typeAttributes.inputValue}
+ record-id={typeAttributes.recordId}
+ field-name={typeAttributes.fieldName}
+ show-type={typeAttributes.showType}
+ ></c-lex-agency-opp-cus-cell>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/customInventoryColor.html b/force-app/main/default/lwc/lexCustomLightningDatatable/customInventoryColor.html
index 0ad4f99..62072c1 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customInventoryColor.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customInventoryColor.html
@@ -1,3 +1,8 @@
<template>
- <c-lex-custom-inventory-color value={typeAttributes.value} upperlimit={typeAttributes.upperlimit} lowerlimit={typeAttributes.lowerlimit} box-price = {typeAttributes.boxPrice}></c-lex-custom-inventory-color>
+ <c-lex-custom-inventory-color
+ value={typeAttributes.value}
+ upperlimit={typeAttributes.upperlimit}
+ lowerlimit={typeAttributes.lowerlimit}
+ box-price={typeAttributes.boxPrice}
+ ></c-lex-custom-inventory-color>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/customOutboundCount.html b/force-app/main/default/lwc/lexCustomLightningDatatable/customOutboundCount.html
index b513653..9708b97 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customOutboundCount.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customOutboundCount.html
@@ -1,7 +1,8 @@
<template>
<c-custom-outbound-count-comp
- is-disable={typeAttributes.isDisable}
- record-id={typeAttributes.recordId}
- count={typeAttributes.count}>
+ is-disable={typeAttributes.isDisable}
+ record-id={typeAttributes.recordId}
+ count={typeAttributes.count}
+ >
</c-custom-outbound-count-comp>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/customOutputGoods.html b/force-app/main/default/lwc/lexCustomLightningDatatable/customOutputGoods.html
index 3dedf49..d01de0b 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customOutputGoods.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customOutputGoods.html
@@ -1,3 +1,7 @@
<template>
- <c-custom-output-good output-value={typeAttributes.outputValue} output-type={typeAttributes.type} record-id={typeAttributes.recordId}></c-custom-output-good>
+ <c-custom-output-good
+ output-value={typeAttributes.outputValue}
+ output-type={typeAttributes.type}
+ record-id={typeAttributes.recordId}
+ ></c-custom-output-good>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/customReturnGoodInput.html b/force-app/main/default/lwc/lexCustomLightningDatatable/customReturnGoodInput.html
index 00045c0..e5c8790 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customReturnGoodInput.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customReturnGoodInput.html
@@ -1,3 +1,7 @@
<template>
- <c-lex-return-good-cus-input input-value={typeAttributes.inputValue} box-price={typeAttributes.boxPrice} record-id={typeAttributes.recordId}></c-lex-return-good-cus-input>
+ <c-lex-return-good-cus-input
+ input-value={typeAttributes.inputValue}
+ box-price={typeAttributes.boxPrice}
+ record-id={typeAttributes.recordId}
+ ></c-lex-return-good-cus-input>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentAmount.html b/force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentAmount.html
index 6b8fb9f..f967e12 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentAmount.html
+++ b/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}>
-
+ shipment-amount={typeAttributes.shipmentAmount}
+ record-id={typeAttributes.recordId}
+ >
</c-custom-shipment-Amount-comp>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentNumber.html b/force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentNumber.html
index af207b0..9ba3e9b 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentNumber.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentNumber.html
@@ -1,11 +1,10 @@
<template>
<c-custom-shipment-number-comp
- style="border-color: red;"
- record-id={typeAttributes.recordId}
- shipment-number={typeAttributes.shipmentNumber}
- is-coninvoice={typeAttributes.isConinvoice}
- esd-invoice-pro-not-count={typeAttributes.esdInvoiceProNotCount}
+ 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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/customShippingUnitPrice.html b/force-app/main/default/lwc/lexCustomLightningDatatable/customShippingUnitPrice.html
index 56d603a..4cea6e3 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customShippingUnitPrice.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customShippingUnitPrice.html
@@ -1,8 +1,7 @@
<template>
<c-custom-shipping-unit-price-comp
- record-id={typeAttributes.recordId}
- shipping-unit-price={typeAttributes.shippingUnitPrice}
+ record-id={typeAttributes.recordId}
+ shipping-unit-price={typeAttributes.shippingUnitPrice}
>
-
</c-custom-shipping-unit-price-comp>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/customTableCellIcon.html b/force-app/main/default/lwc/lexCustomLightningDatatable/customTableCellIcon.html
index 854b613..ede64bb 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customTableCellIcon.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customTableCellIcon.html
@@ -1,3 +1,6 @@
<template>
- <c-lex-table-cell-icon icon-name={typeAttributes.iconName} record-id={typeAttributes.recordId}></c-lex-table-cell-icon>
+ <c-lex-table-cell-icon
+ icon-name={typeAttributes.iconName}
+ record-id={typeAttributes.recordId}
+ ></c-lex-table-cell-icon>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/customTableInput.html b/force-app/main/default/lwc/lexCustomLightningDatatable/customTableInput.html
index 7c38c74..3fa0cc1 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customTableInput.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customTableInput.html
@@ -1,3 +1,10 @@
<template>
- <c-lex-custom-table-input input-value={typeAttributes.inputValue} record-id={typeAttributes.recordId} value-type={typeAttributes.valueType} upper-limit={typeAttributes.upperLimit} lower-limit={typeAttributes.lowerLimit} allnumber={typeAttributes.allnumber}></c-lex-custom-table-input>
+ <c-lex-custom-table-input
+ input-value={typeAttributes.inputValue}
+ record-id={typeAttributes.recordId}
+ value-type={typeAttributes.valueType}
+ upper-limit={typeAttributes.upperLimit}
+ lower-limit={typeAttributes.lowerLimit}
+ allnumber={typeAttributes.allnumber}
+ ></c-lex-custom-table-input>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/customdeleteReason.html b/force-app/main/default/lwc/lexCustomLightningDatatable/customdeleteReason.html
index 667aeb4..bf62016 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customdeleteReason.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customdeleteReason.html
@@ -1,8 +1,6 @@
<!-- sldsValidatorIgnore -->
<!-- sldsValidatorIgnore -->
<template>
- <c-custom-delete-reason-comp
- record-id={typeAttributes.recordId}
- >
+ <c-custom-delete-reason-comp record-id={typeAttributes.recordId}>
</c-custom-delete-reason-comp>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomDiffReason.html b/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomDiffReason.html
index f520c11..06d33ea 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomDiffReason.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomDiffReason.html
@@ -1,5 +1,7 @@
<template>
<c-lex-custom-diff-reason-comp
- prod-id={typeAttributes.ProdId} box-piece ={typeAttributes.boxPiece}>
+ prod-id={typeAttributes.ProdId}
+ box-piece={typeAttributes.boxPiece}
+ >
</c-lex-custom-diff-reason-comp>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.html b/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.html
index 27e0f69..0440d2c 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.html
@@ -1,3 +1 @@
-<template>
-
-</template>
\ No newline at end of file
+<template> </template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.js b/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.js
index 1f46c88..930abca 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.js
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.js
@@ -16,84 +16,104 @@
import customMyDrCheckBoxTemplate from './customMyDrCheckBox.html';
import customdeleteReasonTemplate from './customdeleteReason.html';
import customAccountUrlTemplate from './customaccountUrl.html';
-import { loadStyle} from 'lightning/platformResourceLoader';
+import { loadStyle } from 'lightning/platformResourceLoader';
import LexCustomDataTable from '@salesforce/resourceUrl/LexCustomDataTable';
export default class LexCustomLightningDatatable extends LightningDatatable {
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 : {
+ 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:{
+ customOutputGood: {
template: customOutputGoodsTemplate,
- typeAttributes:['outputValue','type','recordId'],
+ typeAttributes: ['outputValue', 'type', 'recordId']
},
- customReturnGoodInput:{
+ customReturnGoodInput: {
template: customReturnGoodInputTemplate,
- typeAttributes:['inputValue','boxPrice','recordId'],
+ typeAttributes: ['inputValue', 'boxPrice', 'recordId']
},
- customInventoryColor:{
+ customInventoryColor: {
template: customInventoryColorTemplate,
- typeAttributes:['value','upperlimit','lowerlimit','boxPrice'],
+ typeAttributes: ['value', 'upperlimit', 'lowerlimit', 'boxPrice']
},
- tableCellIcon:{
+ tableCellIcon: {
template: customTableCellIconTemplate,
- typeAttributes:['iconName','recordId'],
+ typeAttributes: ['iconName', 'recordId']
},
- outboundCount:{
+ outboundCount: {
template: customOutboundCountTemplate,
- typeAttributes:['isDisable','recordId','Count'],
+ typeAttributes: ['isDisable', 'recordId', 'Count']
},
- weeklyReport:{
+ weeklyReport: {
template: customWeeklyReportTemplate,
- typeAttributes:['recordId','hospitalName','isShowButton'],
+ typeAttributes: ['recordId', 'hospitalName', 'isShowButton']
},
- agencyOppInput:{
+ agencyOppInput: {
template: customAgencyOppInputTemplate,
- typeAttributes:['inputValue','recordId','fieldName','showType'],
+ typeAttributes: ['inputValue', 'recordId', 'fieldName', 'showType']
},
- MyDrCheckBox:{
+ MyDrCheckBox: {
template: customMyDrCheckBoxTemplate,
- typeAttributes:['recordId','isCheckedMyDr'],
+ typeAttributes: ['recordId', 'isCheckedMyDr']
},
- deleteReason:{
+ deleteReason: {
template: customdeleteReasonTemplate,
- typeAttributes:['recordId'],
+ typeAttributes: ['recordId']
},
- customShowAccountUrl:{
+ 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(() => {});
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomTableInput/lexCustomTableInput.html b/force-app/main/default/lwc/lexCustomTableInput/lexCustomTableInput.html
index be0a1af..fe4ab90 100644
--- a/force-app/main/default/lwc/lexCustomTableInput/lexCustomTableInput.html
+++ b/force-app/main/default/lwc/lexCustomTableInput/lexCustomTableInput.html
@@ -1,8 +1,22 @@
<template>
<template if:true={showInputType}>
- <lightning-input type="number" name="cusInput" label="cusInput" variant="label-hidden" value={inputValue} onchange={valueChange} onblur={blurInput}></lightning-input>
+ <lightning-input
+ type="number"
+ name="cusInput"
+ label="cusInput"
+ variant="label-hidden"
+ value={inputValue}
+ onchange={valueChange}
+ onblur={blurInput}
+ ></lightning-input>
</template>
<template if:false={showInputType}>
- <lightning-input name="cusInput" label="cusInput" variant="label-hidden" value={inputValue} onchange={valueChange}></lightning-input>
+ <lightning-input
+ name="cusInput"
+ label="cusInput"
+ variant="label-hidden"
+ value={inputValue}
+ onchange={valueChange}
+ ></lightning-input>
</template>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomTableInput/lexCustomTableInput.js b/force-app/main/default/lwc/lexCustomTableInput/lexCustomTableInput.js
index 739a642..f0b14a7 100644
--- a/force-app/main/default/lwc/lexCustomTableInput/lexCustomTableInput.js
+++ b/force-app/main/default/lwc/lexCustomTableInput/lexCustomTableInput.js
@@ -1,4 +1,4 @@
-import { LightningElement,api } from 'lwc';
+import { LightningElement, api } from 'lwc';
export default class LexCustomTableInput extends LightningElement {
@api inputValue;
@@ -8,37 +8,55 @@
@api lowerLimit;
@api allnumber;
- get showInputType(){
- if(this.valueType == 'Number'){
+ get showInputType() {
+ if (this.valueType == 'Number') {
return true;
- }else{
+ } else {
return false;
}
}
- valueChange(event){
+ valueChange(event) {
this.inputValue = event.target.value;
- this.dispatchEvent(new CustomEvent('changevalue', {
- composed: true,
- bubbles: true,
- cancelable: true,
- detail: {
- data: { value: this.inputValue, recordId: this.recordId }
- }
- }));
+ 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', {
- composed: true,
- bubbles: true,
- cancelable: true,
- detail: {
- data: { value: this.inputValue, upperLimit: this.upperLimit, lowerLimit: this.lowerLimit, allnumber: this.allnumber }
- }
- }));
+ blurInput(event) {
+ console.log('value1:' + event.target.value);
+ 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
+ }
+ }
+ })
+ );
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.html b/force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.html
index 5a4d467..070615c 100644
--- a/force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.html
+++ b/force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.html
@@ -3,8 +3,14 @@
<lightning-spinner size="medium" variant="brand"></lightning-spinner>
</template>
<c-common-toast></c-common-toast>
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ "
+ >
+ <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -13,10 +19,17 @@
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding:10px;">
+ <div style="padding: 10px">
<!-- 鎼滅储 -->
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:10px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ margin-bottom: 10px;
+ "
+ >
+ <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -25,37 +38,63 @@
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding:10px;">
+ <div style="padding: 10px">
<!-- 绗竴琛� -->
- <table style="margin-bottom: 20px;">
+ <table style="margin-bottom: 20px">
<tbody>
<tr>
- <td style="width: 100px;">
- <div style="font-size:16px;">缁忛攢鍟嗗尰闄�</div>
+ <td style="width: 100px">
+ <div style="font-size: 16px">
+ 缁忛攢鍟嗗尰闄�
+ </div>
</td>
- <td style="width: 230px;">
- <lightning-input class="inputFont" variant="label-hidden" value={accSearch} onchange={accSearchChange}></lightning-input>
+ <td style="width: 230px">
+ <lightning-input
+ class="inputFont"
+ variant="label-hidden"
+ value={accSearch}
+ onchange={accSearchChange}
+ ></lightning-input>
</td>
- <td style="width: 30px;"></td>
- <td style="width: 74px;">
- <div style="font-size:16px;">閿�鍞媴褰�</div>
+ <td style="width: 30px"></td>
+ <td style="width: 74px">
+ <div style="font-size: 16px">閿�鍞媴褰�</div>
</td>
- <td style="width: 230px;">
- <lightning-input class="inputFont" variant="label-hidden" value={aooSearch} onchange={aooSearchChange}></lightning-input>
+ <td style="width: 230px">
+ <lightning-input
+ class="inputFont"
+ variant="label-hidden"
+ value={aooSearch}
+ onchange={aooSearchChange}
+ ></lightning-input>
</td>
- <td style="width: 30px;"></td>
- <td style="width: 32px;">
- <span style="font-size:16px;">鏄剧ず</span>
+ <td style="width: 30px"></td>
+ <td style="width: 32px">
+ <span style="font-size: 16px">鏄剧ず</span>
</td>
- <td style="width: 50px;">
- <lightning-combobox class="inputFont" variant="label-hidden" value={limits} options={limitOpts} onchange={limitsChange}></lightning-combobox>
+ <td style="width: 50px">
+ <lightning-combobox
+ class="inputFont"
+ variant="label-hidden"
+ value={limits}
+ options={limitOpts}
+ onchange={limitsChange}
+ ></lightning-combobox>
</td>
- <td style="width: 48px;">
- <span style="font-size:16px;">鏉℃暟鎹�</span>
+ <td style="width: 48px">
+ <span style="font-size: 16px">鏉℃暟鎹�</span>
</td>
- <td style="width: 30px;"></td>
- <td style="width: 64px;">
- <a href="#" onclick={expandAll} style="text-decoration: underline;font-size:16px;">鍏ㄩ儴灞曞紑</a>
+ <td style="width: 30px"></td>
+ <td style="width: 64px">
+ <a
+ href="#"
+ onclick={expandAll}
+ style="
+ text-decoration: underline;
+ font-size: 16px;
+ "
+ >鍏ㄩ儴灞曞紑</a
+ >
</td>
<td></td>
</tr>
@@ -65,22 +104,53 @@
<table>
<tbody>
<tr>
- <td style="width: 100px;">
- <div style="font-size:16px;">鏁版嵁瀛楁</div>
+ <td style="width: 100px">
+ <div style="font-size: 16px">鏁版嵁瀛楁</div>
</td>
<td>
- <lightning-combobox class="inputFont" variant="label-hidden" value={numtext1} options={textOpts} onchange={numtext1Change}></lightning-combobox>
+ <lightning-combobox
+ class="inputFont"
+ variant="label-hidden"
+ value={numtext1}
+ options={textOpts}
+ onchange={numtext1Change}
+ ></lightning-combobox>
</td>
<td>
- <lightning-combobox style="margin-left:10px;" class="inputFont" variant="label-hidden" value={numtext2} options={equalOpts} onchange={numtext2Change}></lightning-combobox>
+ <lightning-combobox
+ style="margin-left: 10px"
+ class="inputFont"
+ variant="label-hidden"
+ value={numtext2}
+ options={equalOpts}
+ onchange={numtext2Change}
+ ></lightning-combobox>
</td>
<td>
- <lightning-input style="margin-left:10px;" class="inputFont" variant="label-hidden" value={numtext} onchange={numtextChange}></lightning-input>
+ <lightning-input
+ style="margin-left: 10px"
+ class="inputFont"
+ variant="label-hidden"
+ value={numtext}
+ onchange={numtextChange}
+ ></lightning-input>
</td>
- <td style="width: 30px;"></td>
+ <td style="width: 30px"></td>
<td>
- <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height: 32px;" onclick={search}>妫�绱�</button>
- <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height: 32px;" onclick={save}>淇濆瓨</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
+ style="height: 32px"
+ onclick={search}
+ >
+ 妫�绱�
+ </button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
+ style="height: 32px"
+ onclick={save}
+ >
+ 淇濆瓨
+ </button>
</td>
</tr>
</tbody>
@@ -88,8 +158,14 @@
</div>
</div>
<!-- 鏁版嵁灞曠ず -->
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ "
+ >
+ <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -98,14 +174,32 @@
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding:10px;">
- <c-lex-custom-lightning-datatable key-field="recordId" columns={colms} data={datas} oninputchange={agencyOppInputChange} class="wrapped-header-datatable"
- default-sort-direction={defaultSortDirection} sorted-direction={sortDirection}
- sorted-by={sortedBy} onsort={onHandleSort} hide-checkbox-column={hidecheckboxcolumn}></c-lex-custom-lightning-datatable>
- <c-paginator onprevious={handlePrevious} onnext={handleNext} onpageschange={handlePageschange}
- onfirst={handleFirst} onlast={handleLast} page-size-options={pageSizeOptions}
- previous-button-disabled={previousButtonDisabled} next-button-disabled={nextButtonDisabled}
- record-start={recordStart} record-end={recordEnd} total-records={totalRecords}></c-paginator>
+ <div style="padding: 10px">
+ <c-lex-custom-lightning-datatable
+ key-field="recordId"
+ columns={colms}
+ data={datas}
+ oninputchange={agencyOppInputChange}
+ class="wrapped-header-datatable"
+ default-sort-direction={defaultSortDirection}
+ sorted-direction={sortDirection}
+ sorted-by={sortedBy}
+ onsort={onHandleSort}
+ hide-checkbox-column={hidecheckboxcolumn}
+ ></c-lex-custom-lightning-datatable>
+ <c-paginator
+ onprevious={handlePrevious}
+ onnext={handleNext}
+ onpageschange={handlePageschange}
+ onfirst={handleFirst}
+ onlast={handleLast}
+ page-size-options={pageSizeOptions}
+ previous-button-disabled={previousButtonDisabled}
+ next-button-disabled={nextButtonDisabled}
+ record-start={recordStart}
+ record-end={recordEnd}
+ total-records={totalRecords}
+ ></c-paginator>
<!-- <lightning-layout multiple-rows="true">
<lightning-layout-item size="6">
<table id="tableLeft" >
diff --git a/force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.js b/force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.js
index 5c1c630..6525803 100644
--- a/force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.js
+++ b/force-app/main/default/lwc/lexDealerInquiryModifyState/lexDealerInquiryModifyState.js
@@ -5,13 +5,11 @@
// import { loadScript , loadStyle } from 'lightning/platformResourceLoader';
// 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";
-
+//table css
+import { loadStyle } from 'lightning/platformResourceLoader';
+import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
export default class LexDealerInquiryModifyState extends LightningElement {
-
@track showSpinner = true;
//琛ㄥご鏍峰紡
stylesLoaded = false;
@@ -28,7 +26,7 @@
@track strRtColumus = '';
//鍒嗛〉start
- @track sortBy = "";
+ @track sortBy = '';
//@track sortDirection = "asc";
@track pageSize = 10;
error;
@@ -44,17 +42,14 @@
@track recordStart = 0;
@track recordEnd = 0;
//end
- defaultSortDirection = "asc";
- sortDirection = "asc";
- sortedBy;
+ defaultSortDirection = 'asc';
+ sortDirection = 'asc';
+ sortedBy;
@track hidecheckboxcolumn = true;
@track changeFlg;
@track canEdit;
@track saveType;
@track sortKey;
-
-
-
// @track colmLeft = [
// {label:"OCSM璇环缂栫爜",fieldName:"field1",hideDefaultActions: true},
@@ -120,234 +115,366 @@
@track colms = [
{
- label: "OCSM璇环缂栫爜", fieldName: "OCSM_Opportunity_No__c", hideDefaultActions: true, wrapText: true, initialWidth: 140,sortable: true,
+ label: 'OCSM璇环缂栫爜',
+ fieldName: 'OCSM_Opportunity_No__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 140,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "OCSM_Opportunity_No__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'OCSM_Opportunity_No__c' },
showType: 'outputField'
- },
+ }
},
{
- label: "OCSM璇环", fieldName: "Change_To_Opportunity_T__c", hideDefaultActions: true, wrapText: true, initialWidth: 100,sortable: true,
+ label: 'OCSM璇环',
+ fieldName: 'Change_To_Opportunity_T__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 100,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Change_To_Opportunity_T__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Change_To_Opportunity_T__c' },
showType: 'outputField'
- },
+ }
},
{
- label: "绉戝鍒嗙被", fieldName: "Strategic_department_Class_Name__c", hideDefaultActions: true, wrapText: true, initialWidth: 105,sortable: true,
+ label: '绉戝鍒嗙被',
+ fieldName: 'Strategic_department_Class_Name__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 105,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Strategic_department_Class_Name__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Strategic_department_Class_Name__c' },
showType: 'outputField'
- },
+ }
},
{
- label: "鐘舵��1", fieldName: "Oly_Inquiry_Status1__c", hideDefaultActions: true, wrapText: true, initialWidth: 100,sortable: true,
+ label: '鐘舵��1',
+ fieldName: 'Oly_Inquiry_Status1__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 100,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Oly_Inquiry_Status1__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Oly_Inquiry_Status1__c' },
showType: 'outputField'
- },
+ }
},
{
- label: "Oly璇环闃舵", fieldName: "Oly_Inquiry_Stage__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
+ label: 'Oly璇环闃舵',
+ fieldName: 'Oly_Inquiry_Stage__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 110,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Oly_Inquiry_Stage__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Oly_Inquiry_Stage__c' },
showType: 'outputField'
- },
+ }
},
{
- label: "棰勬祴OCSM绛剧害鏃�", fieldName: "Oly_Forecasted_Date__c", hideDefaultActions: true, wrapText: true, initialWidth: 150,sortable: true,
+ label: '棰勬祴OCSM绛剧害鏃�',
+ fieldName: 'Oly_Forecasted_Date__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 150,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Oly_Forecasted_Date__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Oly_Forecasted_Date__c' },
showType: 'outputField'
- },
+ }
},
{
- label: "鏄惁涓婃湀棰勬祴璇环", fieldName: "Oly_Forecast_last_month__c", hideDefaultActions: true, wrapText: true, initialWidth: 150,sortable: true,
+ label: '鏄惁涓婃湀棰勬祴璇环',
+ fieldName: 'Oly_Forecast_last_month__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 150,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Oly_Forecast_last_month__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Oly_Forecast_last_month__c' },
showType: 'outputField'
- },
+ }
},
{
- label: "鏄惁鏈湀棰勬祴璇环", fieldName: "Oly_Forecast_this_month__c", hideDefaultActions: true, wrapText: true, initialWidth: 150,sortable: true,
+ label: '鏄惁鏈湀棰勬祴璇环',
+ fieldName: 'Oly_Forecast_this_month__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 150,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Oly_Forecast_this_month__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Oly_Forecast_this_month__c' },
showType: 'outputField'
- },
+ }
},
{
- label: "鏄惁娆℃湀棰勬祴璇环", fieldName: "Oly_NM_Forecast__c", hideDefaultActions: true, wrapText: true, initialWidth: 150,sortable: true,
+ label: '鏄惁娆℃湀棰勬祴璇环',
+ fieldName: 'Oly_NM_Forecast__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 150,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Oly_NM_Forecast__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Oly_NM_Forecast__c' },
showType: 'outputField'
- },
+ }
},
{
- label: "鎺堟潈鐢宠缂栫爜", fieldName: "Oly_Authorized_DB_No__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
+ label: '鎺堟潈鐢宠缂栫爜',
+ fieldName: 'Oly_Authorized_DB_No__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 110,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Oly_Authorized_DB_No__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Oly_Authorized_DB_No__c' },
showType: 'outputField'
- },
+ }
},
// -----------------------------------------------
{
- label: "璇环鍚�", fieldName: "NameLink", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
+ label: '璇环鍚�',
+ fieldName: 'NameLink',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 110,
+ sortable: true,
type: 'url',
typeAttributes: { label: { fieldName: 'Name' }, target: '_blank' }
},
{
- label: "缁忛攢鍟嗚浠风紪鐮�", fieldName: "Agency_Opportunity_No__c", hideDefaultActions: true, wrapText: true, initialWidth: 130,sortable: true,
+ label: '缁忛攢鍟嗚浠风紪鐮�',
+ fieldName: 'Agency_Opportunity_No__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 130,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Agency_Opportunity_No__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Agency_Opportunity_No__c' },
showType: 'outputField'
- },
+ }
},
{
- label: "缁忛攢鍟嗗尰闄�", fieldName: "Agency_Hospital__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
+ label: '缁忛攢鍟嗗尰闄�',
+ fieldName: 'Agency_Hospital__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 110,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Agency_Hospital__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Agency_Hospital__c' },
showType: 'inputField'
- },
+ }
},
{
- label: "绉戝鍒嗙被", fieldName: "Department_Cateogy__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
+ label: '绉戝鍒嗙被',
+ fieldName: 'Department_Cateogy__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 110,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Department_Cateogy__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Department_Cateogy__c' },
showType: 'inputField'
- },
+ }
},
{
- label: "绉戝鍚嶇О", fieldName: "Department_Name_Text__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
+ label: '绉戝鍚嶇О',
+ fieldName: 'Department_Name_Text__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 110,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Department_Cateogy__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Department_Cateogy__c' },
showType: 'inputField'
- },
+ }
},
{
- label: "甯�", fieldName: "Hospital_City_Master__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
+ label: '甯�',
+ fieldName: 'Hospital_City_Master__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 110,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Hospital_City_Master__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Hospital_City_Master__c' },
showType: 'outputField'
- },
+ }
},
{
- label: "浜у搧鍖哄垎1", fieldName: "Product_Category1_P__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
+ label: '浜у搧鍖哄垎1',
+ fieldName: 'Product_Category1_P__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 110,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Product_Category1_P__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Product_Category1_P__c' },
showType: 'inputField'
- },
+ }
},
{
- label: "浜у搧鍖哄垎2", fieldName: "Product_Category2_P__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
+ label: '浜у搧鍖哄垎2',
+ fieldName: 'Product_Category2_P__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 110,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Product_Category2_P__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Product_Category2_P__c' },
showType: 'inputField'
- },
+ }
},
{
- label: "浜у搧鍖哄垎3", fieldName: "Product_Category3_P__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
+ label: '浜у搧鍖哄垎3',
+ fieldName: 'Product_Category3_P__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 110,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Product_Category3_P__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Product_Category3_P__c' },
showType: 'inputField'
- },
+ }
},
{
- label: "瀹㈡埛浜哄憳", fieldName: "Agency_Contact__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
+ label: '瀹㈡埛浜哄憳',
+ fieldName: 'Agency_Contact__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 110,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Agency_Contact__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Agency_Contact__c' },
showType: 'inputField'
- },
+ }
},
{
- label: "閿�鍞媴褰�", fieldName: "Agency_PersonName__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
+ label: '閿�鍞媴褰�',
+ fieldName: 'Agency_PersonName__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 110,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Agency_PersonName__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Agency_PersonName__c' },
showType: 'outputField'
- },
+ }
},
{
- label: "鍖婚櫌閲囪喘棰勭畻(涓嶅惈绋�,鍏�)", fieldName: "Amount__c", hideDefaultActions: true, wrapText: true, initialWidth: 200,sortable: true,
+ label: '鍖婚櫌閲囪喘棰勭畻(涓嶅惈绋�,鍏�)',
+ fieldName: 'Amount__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 200,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Amount__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Amount__c' },
showType: 'inputField'
- },
-
+ }
},
{
- label: "璁㈣揣閲戦(涓嶅惈绋�,鍏�)", fieldName: "OCMSale_Price__c", hideDefaultActions: true, wrapText: true, initialWidth: 190,sortable: true,
+ label: '璁㈣揣閲戦(涓嶅惈绋�,鍏�)',
+ fieldName: 'OCMSale_Price__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 190,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "OCMSale_Price__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'OCMSale_Price__c' },
showType: 'inputField'
- },
+ }
},
{
- label: "棰勬祴涓嶰CSM绛剧害鏃�", fieldName: "Close_Forecasted_Date__c", hideDefaultActions: true, wrapText: true, initialWidth: 190,sortable: true,
+ label: '棰勬祴涓嶰CSM绛剧害鏃�',
+ fieldName: 'Close_Forecasted_Date__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 190,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Close_Forecasted_Date__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Close_Forecasted_Date__c' },
showType: 'inputField'
- },
+ }
},
{
- label: "棰勬祴鎷涙爣鏃�", fieldName: "Bid_Planned_Date__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
+ label: '棰勬祴鎷涙爣鏃�',
+ fieldName: 'Bid_Planned_Date__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 110,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "Bid_Planned_Date__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'Bid_Planned_Date__c' },
showType: 'inputField'
- },
+ }
},
{
- label: "璇环闃舵", fieldName: "StageName__c", hideDefaultActions: true, wrapText: true, initialWidth: 110,sortable: true,
+ label: '璇环闃舵',
+ fieldName: 'StageName__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 110,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "StageName__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'StageName__c' },
showType: 'inputField'
- },
-
+ }
},
{
- label: "鏄惁OCSM鍏变韩璇环", fieldName: "OCM_Change_To_Opportunity_Flg__c", hideDefaultActions: true, wrapText: true, initialWidth: 190,sortable: true,
+ label: '鏄惁OCSM鍏变韩璇环',
+ fieldName: 'OCM_Change_To_Opportunity_Flg__c',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 190,
+ sortable: true,
typeAttributes: {
- recordId: { fieldName: "recordId" },
- inputValue: { fieldName: "OCM_Change_To_Opportunity_Flg__c" },
+ recordId: { fieldName: 'recordId' },
+ inputValue: { fieldName: 'OCM_Change_To_Opportunity_Flg__c' },
showType: 'inputField'
- },
+ }
}
];
@track datas = [];
-
renderedCallback() {
if (!this.stylesLoaded) {
Promise.all([loadStyle(this, WrappedHeaderTable)])
.then(() => {
- console.log("Custom styles loaded");
+ console.log('Custom styles loaded');
this.stylesLoaded = true;
})
.catch((error) => {
- console.error("Error loading custom styles");
+ console.error('Error loading custom styles');
});
}
}
@@ -356,15 +483,14 @@
connectedCallback() {
this.loader = true;
this.init();
-
}
- init(){
+ init() {
this.showSpinner = true;
- init({
+ init({
pageSizeLWC: this.pageSize,
pageTokenLWC: this.currentPageToken
})
- .then(result => {
+ .then((result) => {
if (result.result == 'Success') {
console.log('result==>' + JSON.stringify(result));
//鍒嗛〉start
@@ -372,10 +498,13 @@
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;
- console.log('this.sortDirection = ' + this.sortDirection);
+ this.paginationVisibility =
+ this.totalPages > 1 ? true : false;
+ console.log('this.sortDirection = ' + this.sortDirection);
this.loader = false;
//鍒嗛〉end
this.limits = result.limits;
@@ -391,35 +520,66 @@
this.changeFlg = result.oppRecords.changeFlg;
for (var i in this.datas) {
this.datas[i]['recordId'] = this.datas[i].opp.Id;
- this.datas[i]['OCSM_Opportunity_No__c'] = this.datas[i].opp.OCSM_Opportunity_No__c;
- this.datas[i]['Change_To_Opportunity_T__c'] = this.datas[i].opp.Change_To_Opportunity_T__c;
- this.datas[i]['Strategic_department_Class_Name__c'] = this.datas[i].opp.Strategic_department_Class_Name__c;
- this.datas[i]['Oly_Inquiry_Status1__c'] = this.datas[i].opp.Oly_Inquiry_Status1__c;
- this.datas[i]['Oly_Inquiry_Stage__c'] = this.datas[i].opp.Oly_Inquiry_Stage__c;
- this.datas[i]['Oly_Forecasted_Date__c'] = this.datas[i].opp.Oly_Forecasted_Date__c;
- this.datas[i]['Oly_Forecast_last_month__c'] = this.datas[i].opp.Oly_Forecast_last_month__c;
- this.datas[i]['Oly_Forecast_this_month__c'] = this.datas[i].opp.Oly_Forecast_this_month__c;
- this.datas[i]['Oly_NM_Forecast__c'] = this.datas[i].opp.Oly_NM_Forecast__c;
- this.datas[i]['Oly_Authorized_DB_No__c'] = this.datas[i].opp.Oly_Authorized_DB_No__c;
+ this.datas[i]['OCSM_Opportunity_No__c'] =
+ this.datas[i].opp.OCSM_Opportunity_No__c;
+ this.datas[i]['Change_To_Opportunity_T__c'] =
+ this.datas[i].opp.Change_To_Opportunity_T__c;
+ this.datas[i]['Strategic_department_Class_Name__c'] =
+ this.datas[
+ i
+ ].opp.Strategic_department_Class_Name__c;
+ this.datas[i]['Oly_Inquiry_Status1__c'] =
+ this.datas[i].opp.Oly_Inquiry_Status1__c;
+ this.datas[i]['Oly_Inquiry_Stage__c'] =
+ this.datas[i].opp.Oly_Inquiry_Stage__c;
+ this.datas[i]['Oly_Forecasted_Date__c'] =
+ this.datas[i].opp.Oly_Forecasted_Date__c;
+ this.datas[i]['Oly_Forecast_last_month__c'] =
+ this.datas[i].opp.Oly_Forecast_last_month__c;
+ this.datas[i]['Oly_Forecast_this_month__c'] =
+ this.datas[i].opp.Oly_Forecast_this_month__c;
+ this.datas[i]['Oly_NM_Forecast__c'] =
+ this.datas[i].opp.Oly_NM_Forecast__c;
+ this.datas[i]['Oly_Authorized_DB_No__c'] =
+ this.datas[i].opp.Oly_Authorized_DB_No__c;
// -------
this.datas[i]['Name'] = this.datas[i].AgcOpp.Name;
- this.datas[i]['Agency_Opportunity_No__c'] = this.datas[i].AgcOpp.Agency_Opportunity_No__c;
- this.datas[i]['Agency_Hospital__c'] = this.datas[i].AgcOpp.Agency_Hospital__c;
- this.datas[i]['Department_Cateogy__c'] = this.datas[i].AgcOpp.Department_Cateogy__c;
- this.datas[i]['Department_Name_Text__c'] = this.datas[i].AgcOpp.Department_Name_Text__c;
- this.datas[i]['Hospital_City_Master__c'] = this.datas[i].AgcOpp.Hospital_City_Master__c;
- this.datas[i]['Product_Category1_P__c'] = this.datas[i].AgcOpp.Product_Category1_P__c;
- this.datas[i]['Product_Category2_P__c'] = this.datas[i].AgcOpp.Product_Category2_P__c;
- this.datas[i]['Product_Category3_P__c'] = this.datas[i].AgcOpp.Product_Category3_P__c;
- this.datas[i]['Agency_Contact__c'] = this.datas[i].AgcOpp.Agency_Contact__c;
- this.datas[i]['Agency_PersonName__c'] = this.datas[i].AgcOpp.Agency_PersonName__c;
- this.datas[i]['Amount__c'] = this.datas[i].AgcOpp.Amount__c;
- this.datas[i]['OCMSale_Price__c'] = this.datas[i].AgcOpp.OCMSale_Price__c;
- this.datas[i]['Close_Forecasted_Date__c'] = this.datas[i].AgcOpp.Close_Forecasted_Date__c;
- this.datas[i]['Bid_Planned_Date__c'] = this.datas[i].AgcOpp.Bid_Planned_Date__c;
- this.datas[i]['StageName__c'] = this.datas[i].AgcOpp.StageName__c;
- this.datas[i]['OCM_Change_To_Opportunity_Flg__c'] = this.datas[i].AgcOpp.OCM_Change_To_Opportunity_Flg__c;
- this.datas[i]['NameLink'] = '/s/agency-opportunity/'+this.datas[i].opp.Id;
+ this.datas[i]['Agency_Opportunity_No__c'] =
+ this.datas[i].AgcOpp.Agency_Opportunity_No__c;
+ this.datas[i]['Agency_Hospital__c'] =
+ this.datas[i].AgcOpp.Agency_Hospital__c;
+ this.datas[i]['Department_Cateogy__c'] =
+ this.datas[i].AgcOpp.Department_Cateogy__c;
+ this.datas[i]['Department_Name_Text__c'] =
+ this.datas[i].AgcOpp.Department_Name_Text__c;
+ this.datas[i]['Hospital_City_Master__c'] =
+ this.datas[i].AgcOpp.Hospital_City_Master__c;
+ this.datas[i]['Product_Category1_P__c'] =
+ this.datas[i].AgcOpp.Product_Category1_P__c;
+ this.datas[i]['Product_Category2_P__c'] =
+ this.datas[i].AgcOpp.Product_Category2_P__c;
+ this.datas[i]['Product_Category3_P__c'] =
+ this.datas[i].AgcOpp.Product_Category3_P__c;
+ this.datas[i]['Agency_Contact__c'] =
+ this.datas[i].AgcOpp.Agency_Contact__c;
+ this.datas[i]['Agency_PersonName__c'] =
+ this.datas[i].AgcOpp.Agency_PersonName__c;
+ this.datas[i]['Amount__c'] =
+ this.datas[i].AgcOpp.Amount__c;
+ this.datas[i]['OCMSale_Price__c'] =
+ this.datas[i].AgcOpp.OCMSale_Price__c;
+ this.datas[i]['Close_Forecasted_Date__c'] =
+ this.datas[i].AgcOpp.Close_Forecasted_Date__c;
+ this.datas[i]['Bid_Planned_Date__c'] =
+ this.datas[i].AgcOpp.Bid_Planned_Date__c;
+ this.datas[i]['StageName__c'] =
+ this.datas[i].AgcOpp.StageName__c;
+ this.datas[i]['OCM_Change_To_Opportunity_Flg__c'] =
+ this.datas[
+ i
+ ].AgcOpp.OCM_Change_To_Opportunity_Flg__c;
+ this.datas[i]['NameLink'] =
+ '/s/agency-opportunity/' + this.datas[i].opp.Id;
}
this.showMyToast(result.Msg, '', 'success');
this.showSpinner = false;
@@ -428,12 +588,15 @@
this.showMyToast('鍒濆鍖栭〉闈㈠け璐�', result.Msg, 'error');
}
})
- .catch(error => {
+ .catch((error) => {
this.showSpinner = false;
- console.log("Error:" + JSON.stringify(error));
- this.showMyToast('鍒濆鍖栭〉闈㈠け璐�', JSON.stringify(error), 'error');
- })
-
+ console.log('Error:' + JSON.stringify(error));
+ this.showMyToast(
+ '鍒濆鍖栭〉闈㈠け璐�',
+ JSON.stringify(error),
+ 'error'
+ );
+ });
}
// renderedCallback() {
@@ -473,14 +636,16 @@
var inputValue = event.detail.data.inputValue;
var recordId = event.detail.data.recordId;
var fieldName = event.detail.data.fieldName;
- console.log("valueChange:" + recordId + '---' + fieldName + '---' + inputValue);
+ console.log(
+ 'valueChange:' + recordId + '---' + fieldName + '---' + inputValue
+ );
for (var i in this.datas) {
if (this.datas[i]['recordId'] == recordId) {
this.datas[i]['fieldName'] = inputValue;
- this.datas[i]['changeFlg'] = this.changeFlg;
+ this.datas[i]['changeFlg'] = this.changeFlg;
}
}
- console.log(" this.datas==>" + JSON.stringify(this.datas));
+ console.log(' this.datas==>' + JSON.stringify(this.datas));
}
accSearchChange(event) {
@@ -507,31 +672,31 @@
this.numtext = event.detail.value;
}
- expandAll() {
+ expandAll() {}
- }
-
- search(){
+ search() {
console.log('鎼滅储');
this.showSpinner = true;
- if(this.changeFlg == 1){
- if (window.confirm('鐢婚潰涓婄殑鏁版嵁鏈夊彉鍖栵紝瑕佷繚瀛樻墍鍋氱殑鍙樻洿鍚楋紵\n鐐瑰嚮 [纭畾] 淇濆瓨骞舵绱n鐐瑰嚮 [鍙栨秷] 鍙绱紝鏀惧純淇濆瓨')) {
+ if (this.changeFlg == 1) {
+ if (
+ window.confirm(
+ '鐢婚潰涓婄殑鏁版嵁鏈夊彉鍖栵紝瑕佷繚瀛樻墍鍋氱殑鍙樻洿鍚楋紵\n鐐瑰嚮 [纭畾] 淇濆瓨骞舵绱n鐐瑰嚮 [鍙栨秷] 鍙绱紝鏀惧純淇濆瓨'
+ )
+ ) {
this.save();
this.searchOpp();
this.showSpinner = false;
- }else{
+ } else {
console.log('鎼滅储1');
this.searchOpp();
this.showSpinner = false;
}
- }else{
+ } else {
this.searchOpp();
this.showSpinner = false;
-
-
}
}
- searchOpp(){
+ searchOpp() {
console.log('this.accSearch==>' + this.accSearch);
console.log('this.aooSearch==>' + this.aooSearch);
console.log('this.numtext==>' + this.numtext);
@@ -544,91 +709,118 @@
aooSearch: this.aooSearch,
numtext: this.numtext,
numtext1: this.numtext1,
- numtext2: this.numtext2,
- }).then((result) => {
- if (result.result == 'Success') {
- //鍒嗛〉Start
- // this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
- // this.totalRecords = result.entity.paginatedAccounts.totalRecords;
- // this.recordStart = result.entity.paginatedAccounts.recordStart;
- // this.recordEnd = result.entity.paginatedAccounts.recordEnd;
- // this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize);
- // console.log('this.totalPages = ' + this.totalPages);
- // this.paginationVisibility = this.totalPages > 1 ? true : false;
- //鍒嗛〉End
- this.datas = result.oppRecords;
- //change flag
- // this.changeFlg= result.oppRecords.changeFlg;
- 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]['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;
-
+ numtext2: this.numtext2
+ })
+ .then((result) => {
+ if (result.result == 'Success') {
+ //鍒嗛〉Start
+ // this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
+ // this.totalRecords = result.entity.paginatedAccounts.totalRecords;
+ // this.recordStart = result.entity.paginatedAccounts.recordStart;
+ // this.recordEnd = result.entity.paginatedAccounts.recordEnd;
+ // this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize);
+ // console.log('this.totalPages = ' + this.totalPages);
+ // this.paginationVisibility = this.totalPages > 1 ? true : false;
+ //鍒嗛〉End
+ this.datas = result.oppRecords;
+ //change flag
+ // this.changeFlg= result.oppRecords.changeFlg;
+ 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]['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.showSpinner = false;
+ this.showMyToast('鎼滅储鎴愬姛', result.Msg, 'success');
+ } else {
+ this.showSpinner = false;
+ this.showMyToast('鎼滅储澶辫触', result.Msg, 'error');
}
+ })
+ .catch((error) => {
this.showSpinner = false;
- this.showMyToast('鎼滅储鎴愬姛', result.Msg, 'success');
-
- } else {
- this.showSpinner = false;
- this.showMyToast('鎼滅储澶辫触', result.Msg, 'error');
-
- }
- }).catch((error) => {
- this.showSpinner = false;
- console.log('error = ' + JSON.stringify(error));
- });
+ console.log('error = ' + JSON.stringify(error));
+ });
}
save() {
this.showSpinner = true;
save({
oppRecordsLWC: this.datas,
- sortKeyLWC:this.sortKey
-
- }).then((result) => {
- if (result.result == 'Success') {
- this.datas = result.oppRecords;
- console.log('result==>' + JSON.stringify(result));
+ sortKeyLWC: this.sortKey
+ })
+ .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) => {
this.showSpinner = false;
- this.showMyToast('淇濆瓨鎴愬姛', '', 'success');
-
- } else {
- this.showSpinner = false;
- this.showMyToast('淇濆瓨澶辫触', result.Msg, 'error');
-
- }
- }).catch((error) => {
- this.showSpinner = false;
- console.log('error = ' + JSON.stringify(error));
- });
-
+ console.log('error = ' + JSON.stringify(error));
+ });
}
showMyToast(title, message, variant) {
@@ -641,12 +833,18 @@
iconName = 'utility:error';
}
if (message != '') {
- content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
} else {
content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template.querySelector('c-common-toast').
- showToast(variant, content, iconName, 10000);
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
}
//鎺掑簭
sortByMethod(field, reverse, primer) {
@@ -665,55 +863,71 @@
};
}
- onHandleSort(event) {
- console.log("Sort");
- console.log("this.changeFlg"+this.changeFlg);
- if(this.changeFlg == 1){
- if (window.confirm('鐢婚潰涓婄殑鏁版嵁鏈夊彉鍖栵紝瑕佷繚瀛樻墍鍋氱殑鍙樻洿鍚楋紵\n鐐瑰嚮 [纭畾] 淇濆瓨骞舵帓搴廫n鐐瑰嚮 [鍙栨秷] 鍙帓搴忥紝鏀惧純淇濆瓨')){
+ onHandleSort(event) {
+ console.log('Sort');
+ console.log('this.changeFlg' + this.changeFlg);
+ if (this.changeFlg == 1) {
+ 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;
this.sortKey = this.sortBy;
this.save();
- }else{
+ } else {
this.sortBy = event.detail.fieldName;
- console.log('this.sortBy==>'+this.sortBy);
+ 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;
}
- }else{
+ } else {
this.sortBy = event.detail.fieldName;
- console.log('this.sortBy==>'+this.sortBy);
+ 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;
}
- }
- //鍒嗛〉
- handlePaginatorChange(event) {
+ }
+ //鍒嗛〉
+ handlePaginatorChange(event) {
this.recordsToDisplay = event.detail.recordsToDisplay;
this.preSelected = event.detail.preSelected;
if (this.recordsToDisplay && this.recordsToDisplay > 0) {
@@ -723,12 +937,14 @@
}
}
handlePrevious() {
- this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize);
+ this.currentPageToken =
+ Number(this.currentPageToken) - Number(this.pageSize);
this.init();
}
handleNext() {
- this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize);
+ this.currentPageToken =
+ Number(this.currentPageToken) + Number(this.pageSize);
this.init();
}
handleFirst() {
@@ -737,7 +953,8 @@
}
handleLast() {
- this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
+ this.currentPageToken =
+ this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
this.init();
}
diff --git a/force-app/main/default/lwc/lexInventory/lexInventory.html b/force-app/main/default/lwc/lexInventory/lexInventory.html
index 18b0886..8e14dd9 100644
--- a/force-app/main/default/lwc/lexInventory/lexInventory.html
+++ b/force-app/main/default/lwc/lexInventory/lexInventory.html
@@ -2,7 +2,10 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner class="spinner-container" size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
+ <div
+ role="status"
+ class="slds-spinner slds-spinner_medium slds-spinner_brand"
+ >
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -11,20 +14,46 @@
</template>
<c-common-toast></c-common-toast>
<template if:true={showcount}>
- <div style="border: 1px solid #D4D4D4;border-radius:5px;">
- <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
- <div style="margin:12px;">
- <p style="font-size: 18px;float:left"><strong>搴撳瓨鐩樼偣</strong></p>
+ <div style="border: 1px solid #d4d4d4; border-radius: 5px">
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
+ <div style="margin: 12px">
+ <p style="font-size: 18px; float: left">
+ <strong>搴撳瓨鐩樼偣</strong>
+ </p>
</div>
- <div style="margin-left:400px;margin-bottom:12px;">
+ <div style="margin-left: 400px; margin-bottom: 12px">
<!-- <lightning-button class = 'lexstyle' label="鐩樼偣纭" title="鐩樼偣纭" onclick={saveConfirm}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="鐩樼偣纭" onclick={saveConfirm}>鐩樼偣纭</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ label="鐩樼偣纭"
+ onclick={saveConfirm}
+ >
+ 鐩樼偣纭
+ </button>
</div>
</div>
- <div style="padding:10px;">
- <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div style="padding: 10px">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
<table>
<colgroup>
<col width="160px" />
@@ -45,13 +74,28 @@
<tbody>
<tr>
<td></td>
- <td align="right" class="searchName">BarCode</td>
- <td style="width:600px"><lightning-textarea class="inputFont" name="BarCode" label=""
- onchange={handleChange}></lightning-textarea></td>
+ <td align="right" class="searchName">
+ BarCode
+ </td>
+ <td style="width: 600px">
+ <lightning-textarea
+ class="inputFont"
+ name="BarCode"
+ label=""
+ onchange={handleChange}
+ ></lightning-textarea>
+ </td>
<td align="right"></td>
<td></td>
- <td style="width:200px">
- <button style="margin-top:14px;" class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="鑾峰彇鏄庣粏" onclick={barcodeEntrys}>鑾峰彇鏄庣粏</button>
+ <td style="width: 200px">
+ <button
+ style="margin-top: 14px"
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ label="鑾峰彇鏄庣粏"
+ onclick={barcodeEntrys}
+ >
+ 鑾峰彇鏄庣粏
+ </button>
<!-- <lightning-button class = 'lexstyle' label="BarCode褰曞叆" title="BarCode褰曞叆"
onclick={barcodeEntrys} style="width: 300px;"></lightning-button> -->
</td>
@@ -61,8 +105,20 @@
</div>
</div>
- <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
<!-- <p style="font-size: 16px;"><strong>鍦ㄥ簱鍟嗗搧搴撳瓨涓�瑙�</strong></p> -->
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -72,122 +128,222 @@
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding:10px;">
-
- <div style="height: 300px;">
+ <div style="padding: 10px">
+ <div style="height: 300px">
<template if:true={showTable}>
- <c-lex-custom-lightning-datatable key-field="key" data={data} columns={columns}
- ondiffreasons={diffreasons} onrowselection={getSelectedRows}
- selected-rows={selectedRows} class="wrapped-header-datatable">
+ <c-lex-custom-lightning-datatable
+ key-field="key"
+ data={data}
+ columns={columns}
+ ondiffreasons={diffreasons}
+ onrowselection={getSelectedRows}
+ selected-rows={selectedRows}
+ class="wrapped-header-datatable"
+ >
</c-lex-custom-lightning-datatable>
</template>
-
-
</div>
-
</div>
</div>
- <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
<table>
<tr>
<td>
<!-- <p style="font-size: 16px;"><strong>璋冩暣鏄庣粏</strong></p> -->
<lightning-layout>
- <lightning-layout-item padding="around-small">
+ <lightning-layout-item
+ padding="around-small"
+ >
<p style="font-size: 18px">
<strong>璋冩暣鏄庣粏</strong>
</p>
</lightning-layout-item>
</lightning-layout>
-
</td>
<template if:true={showbutton}>
- <td align="center">
+ <td align="center">
<!-- <lightning-button variant="brand" class='count' label="涓嬭浇鏈鐩樼偣搴撳瓨鍙樺寲鏄庣粏" title="涓嬭浇鏈鐩樼偣搴撳瓨鍙樺寲鏄庣粏"
onclick={exportData} style="width: 150px;"></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch changeDetail" label="涓嬭浇鏈鐩樼偣搴撳瓨鍙樺寲鏄庣粏" onclick={exportData}>涓嬭浇鏈鐩樼偣搴撳瓨鍙樺寲鏄庣粏</button>
- </td>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch changeDetail"
+ label="涓嬭浇鏈鐩樼偣搴撳瓨鍙樺寲鏄庣粏"
+ onclick={exportData}
+ >
+ 涓嬭浇鏈鐩樼偣搴撳瓨鍙樺寲鏄庣粏
+ </button>
+ </td>
</template>
</tr>
</table>
</div>
<!-- <template if:true={showTable}> -->
- <div style="padding:10px;">
- <lightning-datatable key-field="id" data={pageCodeRecords} columns={column}
- hide-checkbox-column={hidecheckbox} class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all; ">
+ <div style="padding: 10px">
+ <lightning-datatable
+ key-field="id"
+ data={pageCodeRecords}
+ columns={column}
+ hide-checkbox-column={hidecheckbox}
+ class="wrapped-header-datatable"
+ style="word-wrap: break-word; word-break: break-all"
+ >
</lightning-datatable>
- <c-paginator onprevious={handlePrevious} onnext={handleNext} onpageschange={handlePageschange}
- onfirst={handleFirst} onlast={handleLast} page-size-options={pageSizeOptions}
- previous-button-disabled={previousButtonDisabled} next-button-disabled={nextButtonDisabled}
- record-start={recordStart} record-end={recordEnd}
- total-records={totalRecords}></c-paginator>
+ <c-paginator
+ onprevious={handlePrevious}
+ onnext={handleNext}
+ onpageschange={handlePageschange}
+ onfirst={handleFirst}
+ onlast={handleLast}
+ page-size-options={pageSizeOptions}
+ previous-button-disabled={previousButtonDisabled}
+ next-button-disabled={nextButtonDisabled}
+ record-start={recordStart}
+ record-end={recordEnd}
+ total-records={totalRecords}
+ ></c-paginator>
</div>
<!-- </template> -->
</div>
</div>
-
-
</div>
</template>
-
<template if:true={EditAble}>
- <div style="border: 1px solid #D4D4D4;border-radius:5px;">
- <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
- <div style="border: 1px solid #D4D4D4;border-radius:5px;">
- <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:6px;">
- <p style="font-size: 19px;"><strong>鐩樼偣鎯呭喌涓�瑙�</strong></p>
+ <div style="border: 1px solid #d4d4d4; border-radius: 5px">
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
+ <div style="border: 1px solid #d4d4d4; border-radius: 5px">
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 6px;
+ "
+ >
+ <p style="font-size: 19px">
+ <strong>鐩樼偣鎯呭喌涓�瑙�</strong>
+ </p>
</div>
<div class="acc-container">
- <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={conId}
- onload={handleLoad2} class="hideHelpText">
- <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
+ <lightning-record-edit-form
+ object-api-name="Consumable_order__c"
+ record-id={conId}
+ onload={handleLoad2}
+ class="hideHelpText"
+ >
+ <div
+ class="slds-modal__content slds-p-around_medium"
+ id="modal-content-id-1"
+ >
<div class="slds-grid">
<div class="slds-col slds-size_1-of-2">
- <lightning-output-field field-name="Name"
- class="hehe-layoutItem" style="padding-left:20px;"></lightning-output-field>
+ <lightning-output-field
+ field-name="Name"
+ class="hehe-layoutItem"
+ style="padding-left: 20px"
+ ></lightning-output-field>
</div>
<div class="slds-col slds-size_1-of-2">
- <lightning-output-field field-name="Inventory_date__c"
- class="hehe-layoutItem"></lightning-output-field>
+ <lightning-output-field
+ field-name="Inventory_date__c"
+ class="hehe-layoutItem"
+ ></lightning-output-field>
</div>
</div>
</div>
</lightning-record-edit-form>
</div>
</div>
- <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-top:10px">
- <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:6px;">
- <lightning-accordion allow-multiple-sections-open class="slds-m-around_medium"
- active-section-name={activeSections}>
- <lightning-accordion-section name="dataExpand" label="鐩樼偣鏄庣粏" class="accordionClass">
- <lightning-datatable key-field="id" data={detailData} columns={dcolumns}
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-top: 10px;
+ "
+ >
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 6px;
+ "
+ >
+ <lightning-accordion
+ allow-multiple-sections-open
+ class="slds-m-around_medium"
+ active-section-name={activeSections}
+ >
+ <lightning-accordion-section
+ name="dataExpand"
+ label="鐩樼偣鏄庣粏"
+ class="accordionClass"
+ >
+ <lightning-datatable
+ key-field="id"
+ data={detailData}
+ columns={dcolumns}
hide-checkbox-column={hidecheckbox}
- class="wrapped-header-datatable accordionClass2">
+ class="wrapped-header-datatable accordionClass2"
+ >
</lightning-datatable>
</lightning-accordion-section>
</lightning-accordion>
-
-
</div>
</div>
- <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-top:10px">
- <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:6px;">
- <lightning-accordion allow-multiple-sections-open class="slds-m-around_medium"
- active-section-name={activeSections}>
- <lightning-accordion-section name="dataExpand" label="鍦ㄥ簱璋冩暣鏄庣粏" class="accordionClass">
- <lightning-datatable key-field="id" data={adjustdata} columns={stockadjustcolumns}
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-top: 10px;
+ "
+ >
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 6px;
+ "
+ >
+ <lightning-accordion
+ allow-multiple-sections-open
+ class="slds-m-around_medium"
+ active-section-name={activeSections}
+ >
+ <lightning-accordion-section
+ name="dataExpand"
+ label="鍦ㄥ簱璋冩暣鏄庣粏"
+ class="accordionClass"
+ >
+ <lightning-datatable
+ key-field="id"
+ data={adjustdata}
+ columns={stockadjustcolumns}
hide-checkbox-column={hidecheckbox}
- class="wrapped-header-datatable accordionClass2">
+ class="wrapped-header-datatable accordionClass2"
+ >
</lightning-datatable>
</lightning-accordion-section>
</lightning-accordion>
-
</div>
</div>
</div>
</div>
-
</template>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexInventory/lexInventory.js b/force-app/main/default/lwc/lexInventory/lexInventory.js
index 9a35fb2..07ed955 100644
--- a/force-app/main/default/lwc/lexInventory/lexInventory.js
+++ b/force-app/main/default/lwc/lexInventory/lexInventory.js
@@ -1,765 +1,857 @@
-import { LightningElement, wire, api, track } from "lwc";
-import oninit from "@salesforce/apex/LexInventoryController.init";
+import { LightningElement, wire, api, track } from 'lwc';
+import oninit from '@salesforce/apex/LexInventoryController.init';
// import sheetjs from '@salesforce/resourceUrl/sheetjs';
-import barcodeEntry from "@salesforce/apex/LexInventoryController.searchConsumableorderdetails";
-import save from "@salesforce/apex/LexInventoryController.save";
-import datainit from "@salesforce/apex/LexInventoryListController.init";
-import { ShowToastEvent } from "lightning/platformShowToastEvent";
-import { NavigationMixin } from "lightning/navigation";
+import barcodeEntry from '@salesforce/apex/LexInventoryController.searchConsumableorderdetails';
+import save from '@salesforce/apex/LexInventoryController.save';
+import datainit from '@salesforce/apex/LexInventoryListController.init';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { NavigationMixin } from 'lightning/navigation';
-//table css
-import { loadStyle } from "lightning/platformResourceLoader";
-import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
+//table css
+import { loadStyle } from 'lightning/platformResourceLoader';
+import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
//搴撳瓨鐩樼偣涓婚〉闈㈡暟鎹�
const columns = [
- {
- label: "鏄惁鐩樼偣",
- fieldName: "iscount",
- hideDefaultActions: true,
- initialWidth: 80,
-
- },
- {
- label: "娑堣�楀搧鍚嶇О",
- fieldName: "Name__c",
- hideDefaultActions: true,
- // initialWidth: 400,
- wrapText:true
-
- },
- {
- label: "瑙勬牸",
- initialWidth: 50,
- fieldName: "Packing_list_manual__c",
- cellAttributes: { alignment: "right" },
- hideDefaultActions: true,
-
-
- },
- {
- label: "鍗曚綅",
- fieldName: "boxPiece",
- initialWidth: 50,
- hideDefaultActions: true,
-
-
- },
- {
- label: "鏈夋晥鏈熷唴搴撳瓨",
- fieldName: "limitCount",
- initialWidth: 120,
- hideDefaultActions: true,
- cellAttributes: { alignment: "right" },
- },
+ {
+ label: '鏄惁鐩樼偣',
+ fieldName: 'iscount',
+ hideDefaultActions: true,
+ initialWidth: 80
+ },
+ {
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'Name__c',
+ hideDefaultActions: true,
+ // initialWidth: 400,
+ wrapText: true
+ },
+ {
+ label: '瑙勬牸',
+ initialWidth: 50,
+ fieldName: 'Packing_list_manual__c',
+ cellAttributes: { alignment: 'right' },
+ hideDefaultActions: true
+ },
+ {
+ label: '鍗曚綅',
+ fieldName: 'boxPiece',
+ initialWidth: 50,
+ hideDefaultActions: true
+ },
+ {
+ label: '鏈夋晥鏈熷唴搴撳瓨',
+ fieldName: 'limitCount',
+ initialWidth: 120,
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'right' }
+ },
- {
- label: "杩囨湡搴撳瓨",
- initialWidth: 100,
- fieldName: "overlimitCount",
- hideDefaultActions: true,
- cellAttributes: { alignment: "right" },
-
-
- },
- {
- label: "鐩樼偣",
- initialWidth: 50,
- fieldName: "Pandian",
- hideDefaultActions: true,
- cellAttributes: { alignment: "right" },
-
-
- },
- {
- label: "涓㈠け",
- initialWidth: 50,
- fieldName: "Diff",
- hideDefaultActions: true,
- cellAttributes: { alignment: "right" },
-
-
- },
- {
- label: "瀵诲洖",
- initialWidth: 50,
- fieldName: "refind",
- hideDefaultActions: true,
- cellAttributes: { alignment: "right" },
-
-
- },
- {
- label: "宸紓鍘熷洜",
- // fieldName: "DiffReason",
- initialWidth: 200,
- hideDefaultActions: true,
- type: "customDiffReason",
- typeAttributes: {
- DiffReason: { fieldName: "DiffReason" },
- ProdId: { fieldName: "ProdId" },
- boxPiece: { fieldName: "boxPiece" }
-
- },
-
- },
+ {
+ label: '杩囨湡搴撳瓨',
+ initialWidth: 100,
+ fieldName: 'overlimitCount',
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'right' }
+ },
+ {
+ label: '鐩樼偣',
+ initialWidth: 50,
+ fieldName: 'Pandian',
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'right' }
+ },
+ {
+ label: '涓㈠け',
+ initialWidth: 50,
+ fieldName: 'Diff',
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'right' }
+ },
+ {
+ label: '瀵诲洖',
+ initialWidth: 50,
+ fieldName: 'refind',
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'right' }
+ },
+ {
+ label: '宸紓鍘熷洜',
+ // fieldName: "DiffReason",
+ initialWidth: 200,
+ hideDefaultActions: true,
+ type: 'customDiffReason',
+ typeAttributes: {
+ DiffReason: { fieldName: 'DiffReason' },
+ ProdId: { fieldName: 'ProdId' },
+ boxPiece: { fieldName: 'boxPiece' }
+ }
+ }
];
//璋冩暣鏄庣粏
const column = [
- {
- label: "娑堣�楀搧鍚嶇О",
- fieldName: "Name__c",
- wrapText: true,
- hideDefaultActions: true,
- // initialWidth: 550
- },
- {
- label: "鍗曚綅",
- fieldName: "Box_Piece__c",
- hideDefaultActions: true,
- initialWidth: 50,
-
- },
- {
- label: "BarCode",
- fieldName: "Bar_Code__c",
- hideDefaultActions: true,
- wrapText: true,
- // initialWidth: 300,
- },
- {
- label: "璋冩暣鍘熷洜",
- fieldName: "DiffReason",
- hideDefaultActions: true,
- wrapText: true,
- // initialWidth:
-
- },
+ {
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'Name__c',
+ wrapText: true,
+ hideDefaultActions: true
+ // initialWidth: 550
+ },
+ {
+ label: '鍗曚綅',
+ fieldName: 'Box_Piece__c',
+ hideDefaultActions: true,
+ initialWidth: 50
+ },
+ {
+ label: 'BarCode',
+ fieldName: 'Bar_Code__c',
+ hideDefaultActions: true,
+ wrapText: true
+ // initialWidth: 300,
+ },
+ {
+ label: '璋冩暣鍘熷洜',
+ fieldName: 'DiffReason',
+ hideDefaultActions: true,
+ wrapText: true
+ // initialWidth:
+ }
];
//鐩樼偣鏄庣粏
const dcolumns = [
- {
- label: "娑堣�楀搧鍚嶇О",
- fieldName: "Name__c",
- hideDefaultActions: true,
- // initialWidth: 250,
- wrapText: true,
-
-
- },
- {
- label: "搴撳瓨",
- fieldName: "Count_Sum__c",
- hideDefaultActions: true,
- initialWidth: 100,
- cellAttributes: { alignment: "right" },
-
- },
- {
- label: "鐩樼偣",
- fieldName: "inventory_sum__c",
- hideDefaultActions: true,
- initialWidth: 100,
- cellAttributes: { alignment: "right" },
-
- },
- {
- label: "涓㈠け",
- fieldName: "Diff__c",
- hideDefaultActions: true,
- initialWidth: 100,
- cellAttributes: { alignment: "right" },
-
- },
- {
- label: "瀵诲洖",
- fieldName: "Product_Refind__c",
- hideDefaultActions: true,
- initialWidth: 100,
- cellAttributes: { alignment: "right" },
-
- },
- {
- label: "宸紓鍘熷洜",
- fieldName: "Lose_reason__c",
- hideDefaultActions: true,
-
- },
+ {
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'Name__c',
+ hideDefaultActions: true,
+ // initialWidth: 250,
+ wrapText: true
+ },
+ {
+ label: '搴撳瓨',
+ fieldName: 'Count_Sum__c',
+ hideDefaultActions: true,
+ initialWidth: 100,
+ cellAttributes: { alignment: 'right' }
+ },
+ {
+ label: '鐩樼偣',
+ fieldName: 'inventory_sum__c',
+ hideDefaultActions: true,
+ initialWidth: 100,
+ cellAttributes: { alignment: 'right' }
+ },
+ {
+ label: '涓㈠け',
+ fieldName: 'Diff__c',
+ hideDefaultActions: true,
+ initialWidth: 100,
+ cellAttributes: { alignment: 'right' }
+ },
+ {
+ label: '瀵诲洖',
+ fieldName: 'Product_Refind__c',
+ hideDefaultActions: true,
+ initialWidth: 100,
+ cellAttributes: { alignment: 'right' }
+ },
+ {
+ label: '宸紓鍘熷洜',
+ fieldName: 'Lose_reason__c',
+ hideDefaultActions: true
+ }
];
//鍦ㄥ簱璋冩暣鏄庣粏
const stockadjustcolumns = [
- {
- label: "娑堣�楀搧鍚嶇О",
- fieldName: "Name__c",
- wrapText: true,
- hideDefaultActions: true,
-
- },
- {
- label: "浜у搧鍨嬪彿",
- fieldName: "Asset_Model_No__c",
- hideDefaultActions: true,
-
- },
- {
- label: "宸紓鍘熷洜",
- fieldName: "Lose_reason__c",
- hideDefaultActions: true,
- initialWidth: 150,
-
- },
- {
- label: "鏄惁涓㈠け",
- type: "boolean",
- fieldName: "Lose_Flag__c",
- hideDefaultActions: true,
-
- },
+ {
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'Name__c',
+ wrapText: true,
+ hideDefaultActions: true
+ },
+ {
+ label: '浜у搧鍨嬪彿',
+ fieldName: 'Asset_Model_No__c',
+ hideDefaultActions: true
+ },
+ {
+ label: '宸紓鍘熷洜',
+ fieldName: 'Lose_reason__c',
+ hideDefaultActions: true,
+ initialWidth: 150
+ },
+ {
+ label: '鏄惁涓㈠け',
+ type: 'boolean',
+ fieldName: 'Lose_Flag__c',
+ hideDefaultActions: true
+ }
];
export default class LexInventory extends NavigationMixin(LightningElement) {
- columns = columns;
- column = column;
- stockadjustcolumns = stockadjustcolumns;
- dcolumns = dcolumns;
- @track data = [];
- @track codPageRecords = [];
- @track pageCodeRecords = [];
- @track accountName;
- @track agencyProType;
- @track userWorkLocation;
- @track accountid
- @track pandiandetailsMap
- @track reSet
- @track reSet1
+ columns = columns;
+ column = column;
+ stockadjustcolumns = stockadjustcolumns;
+ dcolumns = dcolumns;
+ @track data = [];
+ @track codPageRecords = [];
+ @track pageCodeRecords = [];
+ @track accountName;
+ @track agencyProType;
+ @track userWorkLocation;
+ @track accountid;
+ @track pandiandetailsMap;
+ @track reSet;
+ @track reSet1;
- @track showTable = false;
- @track showbutton = false;
- @track barcode = "";
- @track ConsumableorderdetailsRecordsview = [];
- @track consumableorderdetailsRecords = [];
- @track showcount = true;
+ @track showTable = false;
+ @track showbutton = false;
+ @track barcode = '';
+ @track ConsumableorderdetailsRecordsview = [];
+ @track consumableorderdetailsRecords = [];
+ @track showcount = true;
- @track iSinventory = false
- @track numberDetail;
- @track hidecheckbox = true;
- //鍒嗛〉start
- @track sortBy = "";
- @track sortDirection = "asc";
- @track pageSize = 10;
- error;
- records;
- currentPageToken = 0;
- nextPageToken = this.pageSize;
- @track totalRecords = 0;
- @track loader = false;
- @track pageNumber = 1;
- @track paginationVisibility = false;
- @track totalPages = 1;
- pageSizeOptions = [10, 25, 50, 100];
- @track recordStart = 0;
- @track recordEnd = 0;
- //end
+ @track iSinventory = false;
+ @track numberDetail;
+ @track hidecheckbox = true;
+ //鍒嗛〉start
+ @track sortBy = '';
+ @track sortDirection = 'asc';
+ @track pageSize = 10;
+ error;
+ records;
+ currentPageToken = 0;
+ nextPageToken = this.pageSize;
+ @track totalRecords = 0;
+ @track loader = false;
+ @track pageNumber = 1;
+ @track paginationVisibility = false;
+ @track totalPages = 1;
+ pageSizeOptions = [10, 25, 50, 100];
+ @track recordStart = 0;
+ @track recordEnd = 0;
+ //end
+ //鍔犺浇妗�
+ // @track casesSpinner = true;
+ @track showSpinner = true;
- //鍔犺浇妗�
- // @track casesSpinner = true;
- @track showSpinner = true;
+ //row
+ @track selectedRows = [];
+ //inventoryList
+ @track isSummonsFlag;
+ //灞曞紑鏍�
+ activeSections = ['dataExpand'];
+ columnHeader = ['娑堣�楀搧鍚嶇О', '鍗曚綅', 'BarCode', '璋冩暣鍘熷洜'];
+ //纭涓�瑙�
+ @track eSetId = '';
+ @track EditAble = false;
+ @track selectedData;
+ @track conId;
+ @track detailData = [];
+ @track adjustdata = [];
+ @track detalipan = [];
- //row
- @track selectedRows = [];
- //inventoryList
- @track isSummonsFlag;
- //灞曞紑鏍�
- activeSections = ["dataExpand"];
- columnHeader = ["娑堣�楀搧鍚嶇О", "鍗曚綅", "BarCode", "璋冩暣鍘熷洜"];
- //纭涓�瑙�
- @track eSetId = "";
- @track EditAble = false;
- @track selectedData;
- @track conId;
- @track detailData = [];
- @track adjustdata = [];
- @track detalipan = [];
+ //瀵煎嚭csv
+ xlsDataHeader = ['娑堣�楀搧鍚嶇О', '鍗曚綅', 'barCode', '璋冩暣鍘熷洜'];
-
- //瀵煎嚭csv
- xlsDataHeader = ['娑堣�楀搧鍚嶇О', '鍗曚綅', 'barCode', '璋冩暣鍘熷洜'];
-
- //鑾峰彇閾炬帴鍙傛暟
- getQueryString(name) {
- 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]);
- }
- return null;
- }
- renderedCallback() {
+ //鑾峰彇閾炬帴鍙傛暟
+ getQueryString(name) {
+ 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]);
+ }
+ return null;
+ }
+ 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('===>鍒濆鍖�');
- connectedCallback() {
- console.log("===>鍒濆鍖�");
+ //鑾峰彇ESetid
+ this.eSetId = this.getQueryString('eSetId');
+ this.eSetId = this.eSetId == null ? '' : this.eSetId;
+ console.log(' this.eSetId' + this.eSetId);
+ if (this.eSetId == '') {
+ this.EditAble = false;
+ this.init();
+ } else {
+ this.inits();
+ this.showcount = false;
+ this.EditAble = true;
+ }
+ }
+ init() {
+ this.showSpinner = true;
+ oninit()
+ .then((result) => {
+ console.log('1112' + JSON.stringify(result));
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result.status = ' + result.status);
+ console.log(
+ 'ConsumableorderdetailsRecordsview= ' +
+ result.entity.ConsumableorderdetailsRecordsview
+ );
+ this.ConsumableorderdetailsRecordsview = JSON.parse(
+ result.entity.ConsumableorderdetailsRecordsview
+ );
+ this.consumableorderdetailsRecords =
+ result.entity.consumableorderdetailsRecords;
+ console.log(
+ 'consumableorderdetailsRecords= ' +
+ result.entity.consumableorderdetailsRecords
+ );
+ console.log(
+ '浼犲弬绫诲瀷',
+ typeof this.consumableorderdetailsRecords
+ );
+ if (result.status == 'Success') {
+ this.data = [];
+ this.data = this.ConsumableorderdetailsRecordsview[0];
+ console.log('this.data ==>' + JSON.stringify(this.data));
+ for (let i in this.data) {
+ this.data[i]['key'] =
+ this.data[i]['ProdId'] + this.data[i]['boxPiece'];
+ this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
+ this.data[i]['Packing_list_manual__c'] =
+ this.data[i].Prod.Packing_list_manual__c;
+ }
+ this.accountName = result.entity.accountName;
+ this.agencyProType = result.entity.agencyProType;
+ this.userWorkLocation = result.entity.userWorkLocation;
+ this.showSpinner = false;
+ this.accountid = result.entity.accountid;
+ this.showTable = true;
+ } else {
+ this.showMyToast('鍒濆鍖栧け璐�', result.msg, 'error');
+ this.showSpinner = false;
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showSpinner = false;
+ });
+ //榛樿灞曞紑鏍�
+ this.activeSections = ['dataExpand'];
+ this.showTable = false;
+ this.showbutton = false;
+ }
- //鑾峰彇ESetid
- this.eSetId = this.getQueryString("eSetId");
- this.eSetId = this.eSetId == null ? "" : this.eSetId;
- console.log(" this.eSetId" + this.eSetId);
- if (this.eSetId == "") {
- this.EditAble = false;
- this.init();
- } else {
- this.inits();
- this.showcount = false;
- this.EditAble = true;
- }
+ //褰曞叆barcode
+ barcodeEntrys() {
+ console.log('Test');
+ this.showTable = false;
+ this.showbutton = false;
+ this.showSpinner = true;
- }
- init() {
+ //鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
+ const selectedRows = this.template
+ .querySelector('c-lex-custom-lightning-datatable')
+ .getSelectedRows();
+ console.log('selectedRows========> ' + JSON.stringify(selectedRows));
+ for (var i in this.data) {
+ this.data[i]['check'] = false;
+ }
+ for (var i in this.data) {
+ for (var j in selectedRows) {
+ if (
+ this.data[i].ProdId + this.data[i]['boxPiece'] ==
+ selectedRows[j].ProdId + selectedRows[j]['boxPiece']
+ ) {
+ this.data[i]['check'] = true;
+ }
+ // console.log('this.data[i].ProdId+this.data[i]["boxPiece"]'+this.data[i].ProdId+this.data[i]["boxPiece"]);
+ console.log(
+ 'selectedRows[j].ProdId+this.data[i]["boxPiece"]' +
+ selectedRows[j].ProdId +
+ selectedRows[j]['boxPiece']
+ );
+ }
+ }
+ // if(this.barcode == ''||this.barcode == null){
+ // this.showMyToast('鑾峰彇澶辫触','璇疯緭鍏arCode鍙�','error');
- this.showSpinner = true;
- oninit()
- .then((result) => {
- console.log("1112" + JSON.stringify(result));
- result = JSON.parse(JSON.stringify(result));
- console.log("result.status = " + result.status);
- console.log("ConsumableorderdetailsRecordsview= " + result.entity.ConsumableorderdetailsRecordsview);
- this.ConsumableorderdetailsRecordsview = JSON.parse(result.entity.ConsumableorderdetailsRecordsview);
- this.consumableorderdetailsRecords = result.entity.consumableorderdetailsRecords;
- console.log("consumableorderdetailsRecords= " + result.entity.consumableorderdetailsRecords);
- console.log("浼犲弬绫诲瀷", typeof this.consumableorderdetailsRecords);
- if (result.status == "Success") {
- this.data = [];
- this.data = this.ConsumableorderdetailsRecordsview[0];
- console.log("this.data ==>" + JSON.stringify(this.data));
- for (let i in this.data) {
- this.data[i]["key"] = this.data[i]["ProdId"] + this.data[i]["boxPiece"];
- this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
- this.data[i]["Packing_list_manual__c"] = this.data[i].Prod.Packing_list_manual__c;
- }
- this.accountName = result.entity.accountName;
- this.agencyProType = result.entity.agencyProType;
- this.userWorkLocation = result.entity.userWorkLocation;
- this.showSpinner = false;
- this.accountid = result.entity.accountid;
- this.showTable = true;
- } else {
- this.showMyToast('鍒濆鍖栧け璐�',result.msg,'error');
- this.showSpinner = false;
- }
- })
- .catch((error) => {
- console.log("error = " + JSON.stringify(error));
- this.showSpinner = false;
- });
- //榛樿灞曞紑鏍�
- this.activeSections = ["dataExpand"];
- this.showTable = false;
- this.showbutton = false;
- }
+ // }
+ console.log('this.data--->' + JSON.stringify(this.data));
+ console.log('this.currentPageToken' + this.currentPageToken);
+ this.selectedRows = [];
+ barcodeEntry({
+ accountName: this.accountName,
+ agencyProType: this.agencyProType,
+ userWorkLocation: this.userWorkLocation,
+ barcode: this.barcode,
+ consumableorderdetailsRecordsLWC: JSON.stringify(this.data),
+ pageSizeLWC: this.pageSize,
+ pageTokenLWC: this.currentPageToken,
+ sortFieldLWC: this.sortBy,
+ sortOrderLWC: this.sortDirection
+ })
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result ===>' + JSON.stringify(result));
+ if (result.status == 'Success1') {
+ //鍒嗛〉start
+ this.nextPageToken =
+ result.entity.paginatedAccounts.nextPageToken;
+ this.totalRecords =
+ result.entity.paginatedAccounts.totalRecords;
+ this.recordStart =
+ result.entity.paginatedAccounts.recordStart;
+ this.recordEnd = result.entity.paginatedAccounts.recordEnd;
+ this.totalPages = Math.ceil(
+ result.entity.paginatedAccounts.totalRecords /
+ this.pageSize
+ );
+ console.log('this.totalPages = ' + this.totalPages);
+ this.paginationVisibility =
+ this.totalPages > 1 ? true : false;
+ console.log('this.sortDirection = ' + this.sortDirection);
+ //鍒嗛〉end
+ this.codPageRecords = JSON.parse(
+ result.entity.codPageRecords
+ );
+ for (var i in this.codPageRecords) {
+ this.codPageRecords[i]['Name__c'] =
+ this.codPageRecords[i].Prod.Name__c;
+ this.codPageRecords[i]['Box_Piece__c'] =
+ this.codPageRecords[i].orderdetails2.Box_Piece__c;
+ this.codPageRecords[i]['Bar_Code__c'] =
+ this.codPageRecords[i].orderdetails2.Bar_Code__c;
+ }
+ this.pageCodeRecords = result.entity.pageCodeRecords;
+ for (var i in this.pageCodeRecords) {
+ this.pageCodeRecords[i]['Name__c'] =
+ this.pageCodeRecords[i].Prod.Name__c;
+ this.pageCodeRecords[i]['Box_Piece__c'] =
+ this.pageCodeRecords[i].orderdetails2.Box_Piece__c;
+ this.pageCodeRecords[i]['Bar_Code__c'] =
+ this.pageCodeRecords[i].orderdetails2.Bar_Code__c;
+ }
+ this.data = JSON.parse(
+ result.entity.consumableorderdetailsRecords
+ );
+ for (var i in this.data) {
+ this.data[i]['key'] =
+ this.data[i]['ProdId'] + this.data[i]['boxPiece'];
+ this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
+ this.data[i]['Packing_list_manual__c'] =
+ this.data[i].Prod.Packing_list_manual__c;
+ if (this.data[i]['check']) {
+ this.selectedRows.push(
+ this.data[i].ProdId + this.data[i]['boxPiece']
+ );
+ console.log('selectedRows:' + this.selectedRows);
+ }
+ }
+ this.iSinventory = result.entity.iSinventory;
+ this.pandiandetailsMap = result.entity.pandiandetailsMap;
+ this.reSet = result.entity.reSet1;
+ console.log('iSinventory:' + this.iSinventory);
+ this.showTable = true;
+ this.showbutton = true;
+ this.showSpinner = false;
+ console.log('result褰曞叆= ' + JSON.stringify(result));
+ } else {
+ if (result.status == 'Sucess') {
+ //鍒嗛〉start
+ this.nextPageToken =
+ result.entity.paginatedAccounts.nextPageToken;
+ this.totalRecords =
+ result.entity.paginatedAccounts.totalRecords;
+ this.recordStart =
+ result.entity.paginatedAccounts.recordStart;
+ this.recordEnd =
+ result.entity.paginatedAccounts.recordEnd;
+ this.totalPages = Math.ceil(
+ result.entity.paginatedAccounts.totalRecords /
+ this.pageSize
+ );
+ console.log('this.totalPages = ' + this.totalPages);
+ this.paginationVisibility =
+ this.totalPages > 1 ? true : false;
+ console.log(
+ 'this.sortDirection = ' + this.sortDirection
+ );
+ //鍒嗛〉end
+ this.codPageRecords = JSON.parse(
+ result.entity.codPageRecords
+ );
+ for (var i in this.codPageRecords) {
+ this.codPageRecords[i]['Name__c'] =
+ this.codPageRecords[i].Prod.Name__c;
+ this.codPageRecords[i]['Box_Piece__c'] =
+ this.codPageRecords[
+ i
+ ].orderdetails2.Box_Piece__c;
+ this.codPageRecords[i]['Bar_Code__c'] =
+ this.codPageRecords[
+ i
+ ].orderdetails2.Bar_Code__c;
+ }
+ this.pageCodeRecords = result.entity.pageCodeRecords;
+ for (var i in this.pageCodeRecords) {
+ this.pageCodeRecords[i]['Name__c'] =
+ this.pageCodeRecords[i].Prod.Name__c;
+ this.pageCodeRecords[i]['Box_Piece__c'] =
+ this.pageCodeRecords[
+ i
+ ].orderdetails2.Box_Piece__c;
+ this.pageCodeRecords[i]['Bar_Code__c'] =
+ this.pageCodeRecords[
+ i
+ ].orderdetails2.Bar_Code__c;
+ }
+ this.data = JSON.parse(
+ result.entity.consumableorderdetailsRecords
+ );
+ for (var i in this.data) {
+ this.data[i]['key'] =
+ this.data[i]['ProdId'] +
+ this.data[i]['boxPiece'];
+ this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
+ this.data[i]['Packing_list_manual__c'] =
+ this.data[i].Prod.Packing_list_manual__c;
+ if (this.data[i]['check']) {
+ this.selectedRows.push(
+ this.data[i].ProdId +
+ this.data[i]['boxPiece']
+ );
+ console.log(
+ 'selectedRows:' + this.selectedRows
+ );
+ }
+ }
+ this.iSinventory = result.entity.iSinventory;
+ this.pandiandetailsMap =
+ result.entity.pandiandetailsMap;
+ this.reSet = result.entity.reSet;
+ console.log('iSinventory:' + this.iSinventory);
+ this.showTable = true;
+ this.showbutton = true;
+ this.showSpinner = false;
+ console.log('result褰曞叆= ' + JSON.stringify(result));
+ } else {
+ console.log('Error:' + result.msg);
+ this.showMyToast(result.msg, '', 'error');
+ this.showSpinner = false;
+ this.showTable = true;
+ }
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ });
+ }
+ //鑾峰彇褰撳墠杈撳叆鍊�
+ handleChange(event) {
+ let value = event.detail.value;
+ console.log('value' + value);
+ this.barcode = value;
+ }
- //褰曞叆barcode
- barcodeEntrys() {
- console.log('Test');
- this.showTable = false;
- this.showbutton = false;
- this.showSpinner = true;
-
- //鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
- const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
- console.log('selectedRows========> ' + JSON.stringify(selectedRows));
- for (var i in this.data) {
- this.data[i]["check"] = false;
- }
- for (var i in this.data) {
- for (var j in selectedRows) {
- if (this.data[i].ProdId+this.data[i]["boxPiece"] == selectedRows[j].ProdId+ selectedRows[j]["boxPiece"]) {
- this.data[i]["check"] = true;
- }
- // console.log('this.data[i].ProdId+this.data[i]["boxPiece"]'+this.data[i].ProdId+this.data[i]["boxPiece"]);
- console.log('selectedRows[j].ProdId+this.data[i]["boxPiece"]'+selectedRows[j].ProdId+selectedRows[j]["boxPiece"]);
+ getSelectedRows(event) {
+ let selectedRowsEvent = event.detail.selectedRows;
+ this.selectedRows = [];
+ for (var i in this.data) {
+ for (var j in selectedRowsEvent) {
+ if (
+ this.data[i].ProdId + this.data[i]['boxPiece'] ==
+ selectedRowsEvent[j].ProdId +
+ selectedRowsEvent[j]['boxPiece']
+ ) {
+ this.selectedRows.push(
+ selectedRowsEvent[j].ProdId + this.data[i]['boxPiece']
+ );
+ }
+ }
+ // for (var i in selectedRowsEvent) {
+ // this.selectedRows.push(selectedRowsEvent[i].ProdId+this.data[i]["boxPiece"]);
+ // }
+ }
+ }
+ //瀵煎嚭涓篶sv
+ exportData() {
+ // Prepare a html table
+ let doc = '<table>';
+ // Add styles for the table
+ doc += '<style>';
+ doc += 'table,th,td{';
+ doc += ' border: 1px solid;';
+ doc += ' border-collapse: collapse;';
+ doc += ' font-weight: normal;';
+ doc += ' text-align: left;';
+ doc += '}';
+ doc += '</style>';
+ // Add all the Table Headers
+ doc += '<tr>';
+ this.columnHeader.forEach((element) => {
+ doc += '<th style="font-weight: bold";>' + element + '</th>';
+ });
+ doc += '</tr>';
+ // Add the data rows
+ this.codPageRecords.forEach((record) => {
+ doc += '<tr>';
+ doc += '<td>' + record.Name__c + '</td>';
+ doc += '<td>' + record.Box_Piece__c + '</td>';
+ doc += '<td>' + record.Bar_Code__c + '</td>';
+ doc += '<td>' + record.DiffReason + '</td>';
+ doc += '</tr>';
+ });
+ doc += '</table>';
+ console.log('doc' + doc);
+ var bom = '\uFEFF';
+ // link.href = 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv);
+ var element =
+ 'data:application/vnd.ms-excel,' + encodeURIComponent(bom + doc);
+ let downloadElement = document.createElement('a');
+ downloadElement.href = element;
+ downloadElement.target = '_self';
+ // 璁剧疆鍝嶅簲澶寸鐢ㄧ紦瀛�
+ // downloadElement.setAttribute('data-turbolinks-cache-control', 'no-cache');
+ // downloadElement.setAttribute('data-turbolinks-track', 'reload');
+ // use .csv as extension on below line if you want to export data as csv
+ downloadElement.download = '鍦ㄥ簱璋冩暣涓�瑙�.xls';
+ document.body.appendChild(downloadElement);
+ downloadElement.click();
+ }
- }
- }
- // if(this.barcode == ''||this.barcode == null){
- // this.showMyToast('鑾峰彇澶辫触','璇疯緭鍏arCode鍙�','error');
+ //鑷畾涔塪ataType
- // }
- console.log('this.data--->'+JSON.stringify(this.data));
- console.log('this.currentPageToken'+this.currentPageToken);
- this.selectedRows = [];
- barcodeEntry({
- accountName: this.accountName,
- agencyProType: this.agencyProType,
- userWorkLocation: this.userWorkLocation,
- barcode: this.barcode,
- consumableorderdetailsRecordsLWC: JSON.stringify(this.data),
- pageSizeLWC: this.pageSize,
- pageTokenLWC: this.currentPageToken,
- sortFieldLWC: this.sortBy,
- sortOrderLWC: this.sortDirection
+ diffreasons(event) {
+ const numberDetail = event.detail;
+ // this.numberDetail = numberDetail;
+ console.log('numberDetail' + JSON.stringify(numberDetail));
+ for (var i in this.data) {
+ console.log('this.data[i]["key"]' + this.data[i]['key']);
+ console.log(
+ 'numberDetail.data.ProdId+numberDetail.data.boxPiece' +
+ numberDetail.data.ProdId +
+ numberDetail.data.boxPiece
+ );
- })
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log("result ===>" + JSON.stringify(result));
- if (result.status == "Success1") {
- //鍒嗛〉start
- this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
- this.totalRecords = result.entity.paginatedAccounts.totalRecords;
- this.recordStart = result.entity.paginatedAccounts.recordStart;
- this.recordEnd = result.entity.paginatedAccounts.recordEnd;
- this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize);
- console.log('this.totalPages = ' + this.totalPages);
- this.paginationVisibility = this.totalPages > 1 ? true : false;
- console.log('this.sortDirection = ' + this.sortDirection);
- //鍒嗛〉end
- this.codPageRecords = JSON.parse(result.entity.codPageRecords);
- for (var i in this.codPageRecords) {
- this.codPageRecords[i]["Name__c"] = this.codPageRecords[i].Prod.Name__c;
- this.codPageRecords[i]["Box_Piece__c"] = this.codPageRecords[i].orderdetails2.Box_Piece__c;
- this.codPageRecords[i]["Bar_Code__c"] = this.codPageRecords[i].orderdetails2.Bar_Code__c;
- }
- this.pageCodeRecords = result.entity.pageCodeRecords;
- for (var i in this.pageCodeRecords) {
- this.pageCodeRecords[i]["Name__c"] = this.pageCodeRecords[i].Prod.Name__c;
- this.pageCodeRecords[i]["Box_Piece__c"] = this.pageCodeRecords[i].orderdetails2.Box_Piece__c;
- this.pageCodeRecords[i]["Bar_Code__c"] = this.pageCodeRecords[i].orderdetails2.Bar_Code__c;
- }
- this.data = JSON.parse(result.entity.consumableorderdetailsRecords);
- for (var i in this.data) {
- this.data[i]["key"] = this.data[i]["ProdId"] + this.data[i]["boxPiece"];
- this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
- this.data[i]["Packing_list_manual__c"] = this.data[i].Prod.Packing_list_manual__c;
- if (this.data[i]["check"]) {
- this.selectedRows.push(this.data[i].ProdId + this.data[i]["boxPiece"]);
- console.log("selectedRows:" + this.selectedRows);
- }
- }
- this.iSinventory = result.entity.iSinventory;
- this.pandiandetailsMap = result.entity.pandiandetailsMap;
- this.reSet = result.entity.reSet1;
- console.log("iSinventory:" + this.iSinventory);
- this.showTable = true;
- this.showbutton = true;
- this.showSpinner = false;
- console.log("result褰曞叆= " + JSON.stringify(result));
- }
- else {
- if (result.status == "Sucess") {
- //鍒嗛〉start
- this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
- this.totalRecords = result.entity.paginatedAccounts.totalRecords;
- this.recordStart = result.entity.paginatedAccounts.recordStart;
- this.recordEnd = result.entity.paginatedAccounts.recordEnd;
- this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize);
- console.log('this.totalPages = ' + this.totalPages);
- this.paginationVisibility = this.totalPages > 1 ? true : false;
- console.log('this.sortDirection = ' + this.sortDirection);
- //鍒嗛〉end
- this.codPageRecords = JSON.parse(result.entity.codPageRecords);
- for (var i in this.codPageRecords) {
- this.codPageRecords[i]["Name__c"] = this.codPageRecords[i].Prod.Name__c;
- this.codPageRecords[i]["Box_Piece__c"] = this.codPageRecords[i].orderdetails2.Box_Piece__c;
- this.codPageRecords[i]["Bar_Code__c"] = this.codPageRecords[i].orderdetails2.Bar_Code__c;
- }
- this.pageCodeRecords = result.entity.pageCodeRecords;
- for (var i in this.pageCodeRecords) {
- this.pageCodeRecords[i]["Name__c"] = this.pageCodeRecords[i].Prod.Name__c;
- this.pageCodeRecords[i]["Box_Piece__c"] = this.pageCodeRecords[i].orderdetails2.Box_Piece__c;
- this.pageCodeRecords[i]["Bar_Code__c"] = this.pageCodeRecords[i].orderdetails2.Bar_Code__c;
- }
- this.data = JSON.parse(result.entity.consumableorderdetailsRecords);
- for (var i in this.data) {
- this.data[i]["key"] = this.data[i]["ProdId"] + this.data[i]["boxPiece"];
- this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
- this.data[i]["Packing_list_manual__c"] = this.data[i].Prod.Packing_list_manual__c;
- if (this.data[i]["check"]) {
- this.selectedRows.push(this.data[i].ProdId + this.data[i]["boxPiece"]);
- console.log("selectedRows:" + this.selectedRows);
- }
- }
- this.iSinventory = result.entity.iSinventory;
- this.pandiandetailsMap = result.entity.pandiandetailsMap;
- this.reSet = result.entity.reSet;
- console.log("iSinventory:" + this.iSinventory);
- this.showTable = true;
- this.showbutton = true;
- this.showSpinner = false;
- console.log("result褰曞叆= " + JSON.stringify(result));
- } else {
- console.log('Error:' + result.msg);
- this.showMyToast(result.msg,'','error');
- this.showSpinner = false;
- this.showTable = true;
- }
- }
- })
- .catch((error) => {
- console.log("error = " + JSON.stringify(error));
- });
- }
- //鑾峰彇褰撳墠杈撳叆鍊�
- handleChange(event) {
- let value = event.detail.value;
- console.log("value" + value);
- this.barcode = value;
- }
+ if (
+ this.data[i]['key'] ==
+ numberDetail.data.ProdId + numberDetail.data.boxPiece
+ ) {
+ this.data[i]['DiffReason'] = numberDetail.data.DiffReason;
+ }
+ }
+ console.log(' this.data==>' + JSON.stringify(this.data));
+ }
- getSelectedRows(event) {
- let selectedRowsEvent = event.detail.selectedRows;
- this.selectedRows = [];
- for (var i in this.data) {
- for (var j in selectedRowsEvent) {
- if (this.data[i].ProdId+this.data[i]["boxPiece"] == selectedRowsEvent[j].ProdId+ selectedRowsEvent[j]["boxPiece"]) {
- this.selectedRows.push(selectedRowsEvent[j].ProdId+this.data[i]["boxPiece"])
- }
- }
- // for (var i in selectedRowsEvent) {
- // this.selectedRows.push(selectedRowsEvent[i].ProdId+this.data[i]["boxPiece"]);
- // }
- }
- }
- //瀵煎嚭涓篶sv
- exportData() {
- // Prepare a html table
- let doc = '<table>';
- // Add styles for the table
- doc += '<style>';
- doc += 'table,th,td{';
- doc += ' border: 1px solid;';
- doc += ' border-collapse: collapse;';
- doc += ' font-weight: normal;';
- doc += ' text-align: left;';
- doc += '}';
- doc += '</style>';
- // Add all the Table Headers
- doc += '<tr>';
- this.columnHeader.forEach(element => {
- doc += '<th style="font-weight: bold";>' + element + '</th>'
- });
- doc += '</tr>';
- // Add the data rows
- this.codPageRecords.forEach(record => {
- doc += '<tr>';
- doc += '<td>' + record.Name__c + '</td>';
- doc += '<td>' + record.Box_Piece__c + '</td>';
- doc += '<td>' + record.Bar_Code__c + '</td>';
- doc += '<td>' + record.DiffReason + '</td>';
- doc += '</tr>';
- });
- doc += '</table>';
- console.log('doc' + doc);
- var bom = "\uFEFF";
- var element = 'data:application/vnd.ms-excel,' + encodeURIComponent(bom + doc);
- let downloadElement = document.createElement('a');
- downloadElement.href = element;
- downloadElement.target = '_self';
- // use .csv as extension on below line if you want to export data as csv
- downloadElement.download = '鍦ㄥ簱璋冩暣涓�瑙�.xls';
- document.body.appendChild(downloadElement);
- downloadElement.click();
- }
+ saveConfirm() {
+ console.log('杩涘叆鐩樼偣纭');
+ console.log('reSet' + this.reSet);
+ this.showSpinner = true;
+ console.log('pandiandetailsMap' + this.pandiandetailsMap);
+ //鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
+ const selectedRows = this.template
+ .querySelector('c-lex-custom-lightning-datatable')
+ .getSelectedRows();
+ console.log('selectedRows========> ' + JSON.stringify(selectedRows));
+ for (var i in this.data) {
+ this.data[i]['check'] = false;
+ }
+ for (var i in this.data) {
+ for (var j in selectedRows) {
+ if (
+ this.data[i].ProdId + this.data[i]['boxPiece'] ==
+ selectedRows[j].ProdId + selectedRows[j]['boxPiece']
+ ) {
+ this.data[i]['check'] = true;
+ }
+ // console.log('this.data[i].ProdId+this.data[i]["boxPiece"]'+this.data[i].ProdId+this.data[i]["boxPiece"]);
+ console.log(
+ 'selectedRows[j].ProdId+this.data[i]["boxPiece"]' +
+ selectedRows[j].ProdId +
+ selectedRows[j]['boxPiece']
+ );
+ }
+ }
+ // var el = this.template.querySelector("c-lex-custom-lightning-datatable");
+ // var selected = el.getSelectedRows();
+ // this.selectedData = selected;
+ // console.log("閫変腑鏁版嵁" + JSON.stringify(this.selectedData));
+ // console.log("reset" + JSON.stringify(this.reSet));
+ // console.log("reset1" + JSON.stringify(this.reSet1));
+ // console.log("r" + JSON.stringify(this.reSet1));
- //鑷畾涔塪ataType
+ save({
+ iSinventory: this.iSinventory,
+ consumableorderdetailsRecordsLWC: JSON.stringify(this.data),
+ accountid: this.accountid,
+ agencyProType: this.agencyProType,
+ reSet: this.reSet,
+ pandiandetailsMap: this.pandiandetailsMap
+ })
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result = ' + JSON.stringify(result));
+ console.log('111111');
- diffreasons(event) {
- const numberDetail = event.detail;
- // this.numberDetail = numberDetail;
- console.log("numberDetail" + JSON.stringify(numberDetail));
- for (var i in this.data) {
- console.log('this.data[i]["key"]' + this.data[i]["key"]);
- console.log('numberDetail.data.ProdId+numberDetail.data.boxPiece' + numberDetail.data.ProdId + numberDetail.data.boxPiece);
+ if (result.status == 'Success') {
+ let url = '/lexinventory?ESetid=' + result.entity.eSetId;
+ this[NavigationMixin.Navigate]({
+ type: 'standard__webPage',
+ attributes: {
+ url: url
+ }
+ });
+ this.showSpinner = false;
+ console.log('Id' + this.eSetId);
+ // this.EditAble = true;
+ // this.showcount = false;
+ } else {
+ this.showMyToast('鐩樼偣澶辫触', result.msg, 'error');
+ this.showSpinner = false;
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showSpinner = false;
+ });
+ }
- if (this.data[i]["key"] == numberDetail.data.ProdId + numberDetail.data.boxPiece) {
- this.data[i]["DiffReason"] = numberDetail.data.DiffReason;
- }
- }
- console.log(" this.data==>" + JSON.stringify(this.data));
- }
+ inits() {
+ this.showSpinner = true;
+ datainit({
+ eSetId: this.eSetId
+ })
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('鐩樼偣涓�瑙�===>' + JSON.stringify(result));
- saveConfirm() {
- console.log("杩涘叆鐩樼偣纭");
- console.log('reSet' + this.reSet);
- this.showSpinner = true;
- console.log('pandiandetailsMap' + this.pandiandetailsMap);
- //鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
- const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
- console.log('selectedRows========> ' + JSON.stringify(selectedRows));
- for (var i in this.data) {
- this.data[i]["check"] = false;
- }
- for (var i in this.data) {
- for (var j in selectedRows) {
- if (this.data[i].ProdId+this.data[i]["boxPiece"] == selectedRows[j].ProdId+ selectedRows[j]["boxPiece"]) {
- this.data[i]["check"] = true;
- }
- // console.log('this.data[i].ProdId+this.data[i]["boxPiece"]'+this.data[i].ProdId+this.data[i]["boxPiece"]);
- console.log('selectedRows[j].ProdId+this.data[i]["boxPiece"]'+selectedRows[j].ProdId+selectedRows[j]["boxPiece"]);
+ for (var i in result.entity.qs) {
+ this.conId = result.entity.qs[i].Id;
+ }
+ console.log('this.conId' + typeof this.conId);
+ this.detailData = JSON.parse(
+ result.entity.consumableorderdetailsRecords
+ );
+ if (result.entity.ConsumableorderdetailsRecordsError != null) {
+ this.adjustdata = JSON.parse(
+ result.entity.ConsumableorderdetailsRecordsError
+ );
+ for (let i in this.detailData) {
+ this.detailData[i].Name__c =
+ this.detailData[i].Prod.Name__c;
+ this.detailData[i].Count_Sum__c =
+ this.detailData[i].orderdetails1.Count_Sum__c;
+ this.detailData[i].inventory_sum__c =
+ this.detailData[i].orderdetails1.inventory_sum__c;
+ this.detailData[i].Diff__c =
+ this.detailData[i].orderdetails1.Diff__c;
+ this.detailData[i].Product_Refind__c =
+ this.detailData[i].orderdetails1.Product_Refind__c;
+ this.detailData[i].Lose_reason__c =
+ this.detailData[i].orderdetails1.Lose_reason__c;
+ }
+ for (let i in this.adjustdata) {
+ this.adjustdata[i].Name__c =
+ this.adjustdata[i].Prod.Name__c;
+ this.adjustdata[i].Asset_Model_No__c =
+ this.adjustdata[i].Prod.Asset_Model_No__c;
+ this.adjustdata[i].Lose_reason__c =
+ this.adjustdata[i].orderdetails2.Lose_reason__c;
+ this.adjustdata[i].Lose_Flag__c =
+ this.adjustdata[i].orderdetails2.Lose_Flag__c;
+ }
+ }
+ this.showSpinner = false;
+ console.log('result鐩樼偣Id' + JSON.stringify(this.conId));
+ console.log('璋冩暣鏄庣粏' + JSON.stringify(this.adjustdata));
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showSpinner = false;
+ });
+ }
+ //鍒嗛〉
+ handlePrevious() {
+ this.currentPageToken =
+ Number(this.currentPageToken) - Number(this.pageSize);
+ this.barcodeEntrys();
+ }
- }
- }
+ handleNext() {
+ console.log('111');
+ this.currentPageToken =
+ Number(this.currentPageToken) + Number(this.pageSize);
+ this.barcodeEntrys();
+ }
+ handleFirst() {
+ this.currentPageToken = 0;
+ this.barcodeEntrys();
+ }
- // var el = this.template.querySelector("c-lex-custom-lightning-datatable");
- // var selected = el.getSelectedRows();
- // this.selectedData = selected;
- // console.log("閫変腑鏁版嵁" + JSON.stringify(this.selectedData));
- // console.log("reset" + JSON.stringify(this.reSet));
- // console.log("reset1" + JSON.stringify(this.reSet1));
- // console.log("r" + JSON.stringify(this.reSet1));
+ handleLast() {
+ this.currentPageToken =
+ this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
+ this.barcodeEntrys();
+ }
- save({
- iSinventory: this.iSinventory,
- consumableorderdetailsRecordsLWC:JSON.stringify(this.data),
- accountid: this.accountid,
- agencyProType: this.agencyProType,
- reSet: this.reSet,
- pandiandetailsMap: this.pandiandetailsMap
- })
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log("result = " + JSON.stringify(result));
- console.log("111111");
+ handlePageschange(event) {
+ console.log(event.detail);
+ this.pageSize = event.detail;
+ this.currentPageToken = 0;
+ this.barcodeEntrys();
+ }
+ get previousButtonDisabled() {
+ return this.currentPageToken === 0;
+ }
- if (result.status == "Success") {
- let url = "/lexinventory?ESetid=" + result.entity.eSetId;
- this[NavigationMixin.Navigate]({
- type: "standard__webPage",
- attributes: {
- url: url,
- },
- });
- this.showSpinner = false;
- console.log("Id" + this.eSetId);
- // this.EditAble = true;
- // this.showcount = false;
- } else {
- this.showMyToast('鐩樼偣澶辫触',result.msg,'error');
- this.showSpinner = false;
- }
- })
- .catch((error) => {
- console.log("error = " + JSON.stringify(error));
- this.showSpinner = false;
- });
- }
+ get nextButtonDisabled() {
+ return this.nextPageToken === undefined;
+ }
- inits() {
- this.showSpinner = true
- datainit({
- eSetId: this.eSetId,
- })
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('鐩樼偣涓�瑙�===>' + JSON.stringify(result));
-
- for (var i in result.entity.qs) {
- this.conId = result.entity.qs[i].Id;
- }
- console.log("this.conId" + typeof this.conId);
- this.detailData = JSON.parse(result.entity.consumableorderdetailsRecords);
- if (result.entity.ConsumableorderdetailsRecordsError != null) {
- this.adjustdata = JSON.parse(
- result.entity.ConsumableorderdetailsRecordsError
- );
- for (let i in this.detailData) {
- this.detailData[i].Name__c = this.detailData[i].Prod.Name__c;
- this.detailData[i].Count_Sum__c = this.detailData[i].orderdetails1.Count_Sum__c;
- this.detailData[i].inventory_sum__c = this.detailData[i].orderdetails1.inventory_sum__c;
- this.detailData[i].Diff__c = this.detailData[i].orderdetails1.Diff__c;
- this.detailData[i].Product_Refind__c = this.detailData[i].orderdetails1.Product_Refind__c;
- this.detailData[i].Lose_reason__c = this.detailData[i].orderdetails1.Lose_reason__c;
- }
- for (let i in this.adjustdata) {
- this.adjustdata[i].Name__c = this.adjustdata[i].Prod.Name__c;
- this.adjustdata[i].Asset_Model_No__c = this.adjustdata[i].Prod.Asset_Model_No__c;
- this.adjustdata[i].Lose_reason__c = this.adjustdata[i].orderdetails2.Lose_reason__c;
- this.adjustdata[i].Lose_Flag__c = this.adjustdata[i].orderdetails2.Lose_Flag__c;
- }
- }
- this.showSpinner = false;
- console.log("result鐩樼偣Id" + JSON.stringify(this.conId));
- console.log("璋冩暣鏄庣粏" + JSON.stringify(this.adjustdata));
- })
- .catch((error) => {
- console.log("error = " + JSON.stringify(error));
- this.showSpinner = false;
- });
- }
- //鍒嗛〉
- handlePrevious() {
- this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize);
- this.barcodeEntrys();
- }
-
- handleNext() {
- console.log('111');
- this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize);
- this.barcodeEntrys();
- }
- handleFirst() {
- this.currentPageToken = 0;
- this.barcodeEntrys();
- }
-
- handleLast() {
- this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
- this.barcodeEntrys();
- }
-
- handlePageschange(event) {
- console.log(event.detail);
- this.pageSize = event.detail;
- this.currentPageToken = 0;
- this.barcodeEntrys();
- }
- get previousButtonDisabled() {
- return this.currentPageToken === 0;
- }
-
- get nextButtonDisabled() {
- return this.nextPageToken === undefined;
- }
-
- handleLoad2() {
- console.log('handleLoad2')
+ handleLoad2() {
+ console.log('handleLoad2');
try {
const style2 = document.createElement('style');
- style2.innerText = '.hehe-layoutItem .slds-form-element__label {padding : 0px}';
+ style2.innerText =
+ '.hehe-layoutItem .slds-form-element__label {padding : 0px}';
this.template.querySelector('.hideHelpText').appendChild(style2);
} catch (error) {
console.log(error);
}
}
- showMyToast(title, message, variant) {
+ showMyToast(title, message, variant) {
console.log('show custom message');
var iconName = '';
var content = '';
- if(variant == 'success'){
- iconName = 'utility:check';
- }else{
- iconName = 'utility:error';
+ if (variant == 'success') {
+ iconName = 'utility:check';
+ } else {
+ iconName = 'utility:error';
}
- if(message != ''){
- content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
- }else{
- content = '<h2><strong>'+title+'<strong/></h2>';
+ if (message != '') {
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
+ } else {
+ content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template.querySelector('c-common-toast').showToast(variant,content,iconName,10000);
- }
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
+ }
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.html b/force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.html
index bd7f8ea..c3fe048 100644
--- a/force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.html
+++ b/force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.html
@@ -1,9 +1,23 @@
<template>
<c-common-toast></c-common-toast>
<template if:true={isShowReminder}>
- <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;color:#ff6a00;font-size:18px;">
- <lightning-icon style="margin: 2px;" icon-name="custom:custom53" size="small"></lightning-icon>
- <strong style="padding-top: 2px;"> 鎻愰啋锛歿msg}</strong>
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ color: #ff6a00;
+ font-size: 18px;
+ "
+ >
+ <lightning-icon
+ style="margin: 2px"
+ icon-name="custom:custom53"
+ size="small"
+ ></lightning-icon>
+ <strong style="padding-top: 2px"
+ > 鎻愰啋锛歿msg}</strong
+ >
</div>
</template>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.js b/force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.js
index f154617..404f38f 100644
--- a/force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.js
+++ b/force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.js
@@ -1,4 +1,4 @@
-import { LightningElement,track} from 'lwc';
+import { LightningElement, track } from 'lwc';
import initReminder from '@salesforce/apex/LexLicenceReminderController.initReminder';
export default class LexLicenceReminder extends LightningElement {
@@ -6,47 +6,63 @@
@track isShowReminder = false;
@track msg = '';
- connectedCallback(){
+ connectedCallback() {
initReminder()
- .then(result=>{
- if (result.result == 'Success') {
- this.days = result.days;
- this.isShowReminder = result.isShowReminder;
- if(this.days > 0){
- this.msg = '鎮ㄧ殑鍖荤枟鍣ㄦ缁忚惀浼佷笟璁稿彲璇佽繕鏈�'+this.days+'澶╁氨鍒版湡浜嗭紒';
- }else if(this.days == 0){
- this.msg = '鎮ㄧ殑鍖荤枟鍣ㄦ缁忚惀浼佷笟璁稿彲璇佷粖澶╁氨鍒版湡浜嗭紒';
- }else if(this.days < 0){
- var days = this.days * -1
- this.msg = '鎮ㄧ殑鍖荤枟鍣ㄦ缁忚惀浼佷笟璁稿彲璇佸凡缁忚繃鏈�'+days+'澶╀簡锛�';
+ .then((result) => {
+ if (result.result == 'Success') {
+ this.days = result.days;
+ this.isShowReminder = result.isShowReminder;
+ if (this.days > 0) {
+ this.msg =
+ '鎮ㄧ殑鍖荤枟鍣ㄦ缁忚惀浼佷笟璁稿彲璇佽繕鏈�' +
+ this.days +
+ '澶╁氨鍒版湡浜嗭紒';
+ } else if (this.days == 0) {
+ this.msg = '鎮ㄧ殑鍖荤枟鍣ㄦ缁忚惀浼佷笟璁稿彲璇佷粖澶╁氨鍒版湡浜嗭紒';
+ } else if (this.days < 0) {
+ var days = this.days * -1;
+ this.msg =
+ '鎮ㄧ殑鍖荤枟鍣ㄦ缁忚惀浼佷笟璁稿彲璇佸凡缁忚繃鏈�' +
+ days +
+ '澶╀簡锛�';
+ }
+ } else {
+ console.log('Error:' + result.errorMsg);
+ this.showMyToast(result.errorMsg, '', 'error');
}
- } else {
- console.log("Error:" + result.errorMsg);
- this.showMyToast(result.errorMsg, '', 'error');
- }
- })
- .catch(error => {
- console.log("Error:" + JSON.stringify(error));
- this.showMyToast('鍒濆鍖栨彁閱掑け璐�', JSON.stringify(error), 'error');
- })
+ })
+ .catch((error) => {
+ console.log('Error:' + JSON.stringify(error));
+ this.showMyToast(
+ '鍒濆鍖栨彁閱掑け璐�',
+ JSON.stringify(error),
+ 'error'
+ );
+ });
}
showMyToast(title, message, variant) {
console.log('show custom message');
var iconName = '';
var content = '';
- if(variant == 'success'){
- iconName = 'utility:check';
- }else{
- iconName = 'utility:error';
+ if (variant == 'success') {
+ iconName = 'utility:check';
+ } else {
+ iconName = 'utility:error';
}
- if(message != ''){
- content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
- }else{
- content = '<h2><strong>'+title+'<strong/></h2>';
+ if (message != '') {
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
+ } else {
+ content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template.querySelector('c-common-toast').
- showToast(variant,content,iconName,10000);
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
// var mode;
// if(this.isNoteStay){
// mode ='sticky';
diff --git a/force-app/main/default/lwc/lexLookup/lexLookup.html b/force-app/main/default/lwc/lexLookup/lexLookup.html
index 0a059dd..a1c9da2 100644
--- a/force-app/main/default/lwc/lexLookup/lexLookup.html
+++ b/force-app/main/default/lwc/lexLookup/lexLookup.html
@@ -1,67 +1,139 @@
<template>
<div class={getFormElementClass}>
<label lwc:if={label} class={getLabelClass} for="combobox">
- <abbr lwc:if={required} title="required" class="slds-required">*</abbr>
+ <abbr lwc:if={required} title="required" class="slds-required"
+ >*</abbr
+ >
{label}
</label>
<div class="slds-form-element__control">
<div class={getContainerClass}>
- <div class={getDropdownClass} aria-expanded={isListboxOpen} aria-haspopup="listbox" aria-owns="listbox"
- role="combobox">
+ <div
+ class={getDropdownClass}
+ aria-expanded={isListboxOpen}
+ aria-haspopup="listbox"
+ aria-owns="listbox"
+ role="combobox"
+ >
<!-- Search input start -->
<div class={getComboboxClass} role="none">
<template lwc:if={isSingleEntry}>
- <lightning-icon icon-name={getSelectIconName} size="small"
- alternative-text="Selected item icon" class={getSelectIconClass}>
+ <lightning-icon
+ icon-name={getSelectIconName}
+ size="small"
+ alternative-text="Selected item icon"
+ class={getSelectIconClass}
+ >
</lightning-icon>
</template>
<!-- Text input -->
- <input type="text" class={getInputClass} aria-autocomplete="list" aria-controls="listbox"
- aria-activedescendant={_focusedResultIndex} autocomplete="off" role="textbox" id="combobox"
- placeholder={placeholder} value={getInputValue} title={getInputTitle}
- readonly={isInputReadonly} disabled={disabled} onfocus={handleFocus} onblur={handleBlur}
- oninput={handleInput} onkeydown={handleKeyDown} />
+ <input
+ type="text"
+ class={getInputClass}
+ aria-autocomplete="list"
+ aria-controls="listbox"
+ aria-activedescendant={_focusedResultIndex}
+ autocomplete="off"
+ role="textbox"
+ id="combobox"
+ placeholder={placeholder}
+ value={getInputValue}
+ title={getInputTitle}
+ readonly={isInputReadonly}
+ disabled={disabled}
+ onfocus={handleFocus}
+ onblur={handleBlur}
+ oninput={handleInput}
+ onkeydown={handleKeyDown}
+ />
<!-- Search icon -->
- <lightning-icon icon-name="utility:search" size="x-small" alternative-text="Search icon"
- class={getSearchIconClass}></lightning-icon>
+ <lightning-icon
+ icon-name="utility:search"
+ size="x-small"
+ alternative-text="Search icon"
+ class={getSearchIconClass}
+ ></lightning-icon>
<!-- Clear selection button icon for single entry lookups -->
<template lwc:if={isSingleEntry}>
- <button title="Remove selected option" type="button" onclick={handleClearSelection}
- class={getClearSelectionButtonClass} disabled={disabled}>
- <lightning-icon icon-name="utility:close" size="x-small"
+ <button
+ title="Remove selected option"
+ type="button"
+ onclick={handleClearSelection}
+ class={getClearSelectionButtonClass}
+ disabled={disabled}
+ >
+ <lightning-icon
+ icon-name="utility:close"
+ size="x-small"
alternative-text="Remove selected option"
- class="slds-button__icon"></lightning-icon>
+ class="slds-button__icon"
+ ></lightning-icon>
</button>
</template>
</div>
<!-- Search input end -->
<!-- Result list box start -->
- <div id="listbox" role="listbox" aria-label={label} onmousedown={handleComboboxMouseDown}
- onmouseup={handleComboboxMouseUp} class={getListboxClass}>
- <ul class="slds-listbox slds-listbox_vertical" role="presentation">
+ <div
+ id="listbox"
+ role="listbox"
+ aria-label={label}
+ onmousedown={handleComboboxMouseDown}
+ onmouseup={handleComboboxMouseUp}
+ class={getListboxClass}
+ >
+ <ul
+ class="slds-listbox slds-listbox_vertical"
+ role="presentation"
+ >
<!-- Spinner to display when waiting for results of search -->
<div lwc:if={loading}>
- <lightning-spinner alternative-text="Loading" size="small"></lightning-spinner>
+ <lightning-spinner
+ alternative-text="Loading"
+ size="small"
+ ></lightning-spinner>
</div>
<!-- Result list start -->
- <template for:each={searchResultsLocalState} for:item="item" for:index="index"
- lwc:if={hasResults}>
- <li key={item.result.id} role="presentation" class="slds-listbox__item">
- <div class={item.classes} role="option" id={index} aria-label={item.result.title}
- onclick={handleResultClick} data-recordid={item.result.id}>
- <span class="slds-media__figure slds-listbox__option-icon">
- <lightning-icon icon-name={item.result.icon} size="small"
- alternative-text="Result item icon"></lightning-icon>
+ <template
+ for:each={searchResultsLocalState}
+ for:item="item"
+ for:index="index"
+ lwc:if={hasResults}
+ >
+ <li
+ key={item.result.id}
+ role="presentation"
+ class="slds-listbox__item"
+ >
+ <div
+ class={item.classes}
+ role="option"
+ id={index}
+ aria-label={item.result.title}
+ onclick={handleResultClick}
+ data-recordid={item.result.id}
+ >
+ <span
+ class="slds-media__figure slds-listbox__option-icon"
+ >
+ <lightning-icon
+ icon-name={item.result.icon}
+ size="small"
+ alternative-text="Result item icon"
+ ></lightning-icon>
</span>
<span class="slds-media__body">
- <span class="slds-listbox__option-text slds-listbox__option-text_entity">
- <lightning-formatted-rich-text value={item.result.titleFormatted}
- disable-linkify>
+ <span
+ class="slds-listbox__option-text slds-listbox__option-text_entity"
+ >
+ <lightning-formatted-rich-text
+ value={item.result.titleFormatted}
+ disable-linkify
+ >
</lightning-formatted-rich-text>
</span>
<!-- <span lwc:if={item.result.subtitleFormatted}
@@ -79,25 +151,53 @@
<!-- No results start -->
<template lwc:else>
<li role="presentation">
- <span class="slds-media slds-listbox__option_entity" role="option">
- <span lwc:if={loading} class="slds-media__body">Loading...</span>
- <span lwc:else class="slds-media__body">No results.</span>
+ <span
+ class="slds-media slds-listbox__option_entity"
+ role="option"
+ >
+ <span
+ lwc:if={loading}
+ class="slds-media__body"
+ >Loading...</span
+ >
+ <span lwc:else class="slds-media__body"
+ >No results.</span
+ >
</span>
</li>
</template>
<!-- No results end -->
<!-- Create new records -->
- <template for:each={newRecordOptions} for:item="newRecord">
- <li key={newRecord.value} role="presentation" class="slds-listbox__item">
- <div class="slds-media slds-media_center slds-listbox__option slds-listbox__option_entity"
- onclick={handleNewRecordClick} data-sobject={newRecord.value} role="option">
- <span class="slds-media__figure slds-listbox__option-icon">
- <lightning-icon icon-name="utility:add" size="small"
- alternative-text={newRecord.label}></lightning-icon>
+ <template
+ for:each={newRecordOptions}
+ for:item="newRecord"
+ >
+ <li
+ key={newRecord.value}
+ role="presentation"
+ class="slds-listbox__item"
+ >
+ <div
+ class="slds-media slds-media_center slds-listbox__option slds-listbox__option_entity"
+ onclick={handleNewRecordClick}
+ data-sobject={newRecord.value}
+ role="option"
+ >
+ <span
+ class="slds-media__figure slds-listbox__option-icon"
+ >
+ <lightning-icon
+ icon-name="utility:add"
+ size="small"
+ alternative-text={newRecord.label}
+ ></lightning-icon>
</span>
<span class="slds-media__body">
- <span class="slds-listbox__option-text">{newRecord.label}</span>
+ <span
+ class="slds-listbox__option-text"
+ >{newRecord.label}</span
+ >
</span>
</div>
</li>
@@ -111,14 +211,28 @@
<!-- Multi-selection start -->
<template lwc:if={isMultiEntry}>
- <div id="selection" role="listbox" aria-label={label} aria-orientation="horizontal">
- <ul class="slds-listbox slds-listbox_inline slds-var-p-top_xxx-small" role="group"
- aria-label="Selected options">
+ <div
+ id="selection"
+ role="listbox"
+ aria-label={label}
+ aria-orientation="horizontal"
+ >
+ <ul
+ class="slds-listbox slds-listbox_inline slds-var-p-top_xxx-small"
+ role="group"
+ aria-label="Selected options"
+ >
<template for:each={selection} for:item="item">
<li key={item.id} role="presentation">
- <lightning-pill label={item.title} title={item.title}
- onremove={handleRemoveSelectedItem} name={item.id}>
- <lightning-icon icon-name={item.icon}></lightning-icon>
+ <lightning-pill
+ label={item.title}
+ title={item.title}
+ onremove={handleRemoveSelectedItem}
+ name={item.id}
+ >
+ <lightning-icon
+ icon-name={item.icon}
+ ></lightning-icon>
</lightning-pill>
</li>
</template>
@@ -129,7 +243,11 @@
<!-- Errors start -->
<template for:each={_errors} for:item="error">
- <div key={error.id} role="alert" class="slds-form-element__label slds-var-m-top_xx-small form-error">
+ <div
+ key={error.id}
+ role="alert"
+ class="slds-form-element__label slds-var-m-top_xx-small form-error"
+ >
{error.message}
</div>
</template>
diff --git a/force-app/main/default/lwc/lexLookup/lexLookup.js b/force-app/main/default/lwc/lexLookup/lexLookup.js
index 7d2ef23..05e2a9e 100644
--- a/force-app/main/default/lwc/lexLookup/lexLookup.js
+++ b/force-app/main/default/lwc/lexLookup/lexLookup.js
@@ -11,7 +11,8 @@
const VARIANT_LABEL_INLINE = 'label-inline';
const VARIANT_LABEL_HIDDEN = 'label-hidden';
-const REGEX_SOSL_RESERVED = /(\?|&|\||!|\{|\}|\[|\]|\(|\)|\^|~|\*|:|"|\+|-|\\)/g;
+const REGEX_SOSL_RESERVED =
+ /(\?|&|\||!|\{|\}|\[|\]|\(|\)|\^|~|\*|:|"|\+|-|\\)/g;
const REGEX_EXTRA_TRAP = /(\$|\\)/g;
export default class LexLookup extends NavigationMixin(LightningElement) {
@@ -45,15 +46,13 @@
_curSelection = [];
_focusedResultIndex = null;
-
-
-
-
// PUBLIC FUNCTIONS AND GETTERS/SETTERS
@api
set selection(initialSelection) {
if (initialSelection) {
- this._curSelection = Array.isArray(initialSelection) ? initialSelection : [initialSelection];
+ this._curSelection = Array.isArray(initialSelection)
+ ? initialSelection
+ : [initialSelection];
this.processSelectionUpdate(false);
}
}
@@ -93,9 +92,13 @@
let resultsLocal = JSON.parse(JSON.stringify(results));
// Remove selected items from search results
const selectedIds = this._curSelection.map((sel) => sel.id);
- resultsLocal = resultsLocal.filter((result) => selectedIds.indexOf(result.id) === -1);
+ resultsLocal = resultsLocal.filter(
+ (result) => selectedIds.indexOf(result.id) === -1
+ );
// Format results
- const cleanSearchTerm = this._searchTerm.replace(REGEX_SOSL_RESERVED, '.?').replace(REGEX_EXTRA_TRAP, '\\$1');
+ const cleanSearchTerm = this._searchTerm
+ .replace(REGEX_SOSL_RESERVED, '.?')
+ .replace(REGEX_EXTRA_TRAP, '\\$1');
const regex = new RegExp(`(${cleanSearchTerm})`, 'gi');
this._searchResults = resultsLocal.map((result) => {
// Format title and subtitle
@@ -124,7 +127,8 @@
result,
state: {},
get classes() {
- let cls = 'slds-media slds-media_center slds-listbox__option slds-listbox__option_entity';
+ let cls =
+ 'slds-media slds-media_center slds-listbox__option slds-listbox__option_entity';
if (result.subtitleFormatted) {
cls += ' slds-listbox__option_has-meta';
}
@@ -139,7 +143,7 @@
@api
getSelection() {
- console.log('get selection:' +this._curSelection);
+ console.log('get selection:' + this._curSelection);
return this._curSelection;
}
@@ -156,9 +160,11 @@
this.template.querySelector('input')?.blur();
}
- connectedCallback(){
+ connectedCallback() {
console.log('LexLookup accountValue = ' + this.accountValue);
- console.log('isDisabledForDealerText = ' + this.isDisabledForDealerText);
+ console.log(
+ 'isDisabledForDealerText = ' + this.isDisabledForDealerText
+ );
}
// INTERNAL FUNCTIONS
@@ -166,7 +172,10 @@
this._searchTerm = newSearchTerm;
// Compare clean new search term with current one and abort if identical
- const newCleanSearchTerm = newSearchTerm.trim().replace(REGEX_SOSL_RESERVED, '?').toLowerCase();
+ const newCleanSearchTerm = newSearchTerm
+ .trim()
+ .replace(REGEX_SOSL_RESERVED, '?')
+ .toLowerCase();
if (this._cleanSearchTerm === newCleanSearchTerm) {
return;
}
@@ -175,7 +184,10 @@
this._cleanSearchTerm = newCleanSearchTerm;
// Ignore search terms that are too small after removing special characters
- if (newCleanSearchTerm.replace(/\?/g, '').length < this.minSearchTermLength) {
+ if (
+ newCleanSearchTerm.replace(/\?/g, '').length <
+ this.minSearchTermLength
+ ) {
this.setSearchResults(this._defaultSearchResults);
return;
}
@@ -195,7 +207,9 @@
detail: {
searchTerm: this._cleanSearchTerm,
rawSearchTerm: newSearchTerm,
- selectedIds: this._curSelection.map((element) => element.id)
+ selectedIds: this._curSelection.map(
+ (element) => element.id
+ )
}
});
this.dispatchEvent(searchEvent);
@@ -229,7 +243,9 @@
// If selection was changed by user, notify parent components
if (isUserInteraction) {
const selectedIds = this._curSelection.map((sel) => sel.id);
- this.dispatchEvent(new CustomEvent('selectionchange', { detail: selectedIds }));
+ this.dispatchEvent(
+ new CustomEvent('selectionchange', { detail: selectedIds })
+ );
}
}
@@ -261,12 +277,18 @@
this._focusedResultIndex = this._searchResults.length - 1;
}
event.preventDefault();
- } else if (event.keyCode === KEY_ENTER && this._hasFocus && this._focusedResultIndex >= 0) {
+ } else if (
+ event.keyCode === KEY_ENTER &&
+ this._hasFocus &&
+ this._focusedResultIndex >= 0
+ ) {
// If the user presses enter, and the box is open, and we have used arrows,
// treat this just like a click on the listbox item
const selectedId = this._searchResults[this._focusedResultIndex].id;
- console.log('selectedid:'+selectedId);
- this.template.querySelector(`[data-recordid="${selectedId}"]`).click();
+ console.log('selectedid:' + selectedId);
+ this.template
+ .querySelector(`[data-recordid="${selectedId}"]`)
+ .click();
event.preventDefault();
}
}
@@ -275,7 +297,9 @@
const recordId = event.currentTarget.dataset.recordid;
// Save selection
- const selectedItem = this._searchResults.find((result) => result.id === recordId);
+ const selectedItem = this._searchResults.find(
+ (result) => result.id === recordId
+ );
if (!selectedItem) {
return;
}
@@ -319,7 +343,7 @@
});
this.dispatchEvent(blurEvent);
this._hasFocus = false;
- if(!this.hasSelection()){
+ if (!this.hasSelection()) {
this._searchTerm = '';
}
}
@@ -329,7 +353,9 @@
return;
}
const recordId = event.currentTarget.name;
- this._curSelection = this._curSelection.filter((item) => item.id !== recordId);
+ this._curSelection = this._curSelection.filter(
+ (item) => item.id !== recordId
+ );
// Process selection update
this.processSelectionUpdate(true);
}
@@ -344,7 +370,9 @@
handleNewRecordClick(event) {
const objectApiName = event.currentTarget.dataset.sobject;
- const selection = this.newRecordOptions.find((option) => option.value === objectApiName);
+ const selection = this.newRecordOptions.find(
+ (option) => option.value === objectApiName
+ );
const preNavigateCallback = selection.preNavigateCallback
? selection.preNavigateCallback
@@ -370,11 +398,15 @@
}
get isListboxOpen() {
- const isSearchTermValid = this._cleanSearchTerm && this._cleanSearchTerm.length >= this.minSearchTermLength;
+ const isSearchTermValid =
+ this._cleanSearchTerm &&
+ this._cleanSearchTerm.length >= this.minSearchTermLength;
return (
this._hasFocus &&
this.isSelectionAllowed() &&
- (isSearchTermValid || this.hasResults || this.newRecordOptions?.length > 0)
+ (isSearchTermValid ||
+ this.hasResults ||
+ this.newRecordOptions?.length > 0)
);
}
@@ -403,7 +435,8 @@
}
get getDropdownClass() {
- let css = 'slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click ';
+ let css =
+ 'slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click ';
if (this.isListboxOpen) {
css += 'slds-is-open';
}
@@ -415,11 +448,16 @@
if (this._hasFocus && this.hasResults) {
css += 'slds-has-focus ';
}
- if (this._errors.length > 0 || (this._isDirty && this.required && !this.hasSelection())) {
+ if (
+ this._errors.length > 0 ||
+ (this._isDirty && this.required && !this.hasSelection())
+ ) {
css += 'has-custom-error ';
}
if (!this.isMultiEntry) {
- css += 'slds-combobox__input-value ' + (this.hasSelection() ? 'has-custom-border' : '');
+ css +=
+ 'slds-combobox__input-value ' +
+ (this.hasSelection() ? 'has-custom-border' : '');
}
return css;
}
@@ -429,7 +467,9 @@
if (this.isMultiEntry) {
css += 'slds-input-has-icon_right';
} else {
- css += this.hasSelection() ? 'slds-input-has-icon_left-right' : 'slds-input-has-icon_right';
+ css += this.hasSelection()
+ ? 'slds-input-has-icon_left-right'
+ : 'slds-input-has-icon_right';
}
return css;
}
@@ -450,23 +490,32 @@
}
get getSelectIconName() {
- if(this._curSelection[0])
- console.log('this._curSelection[0].icon = ' + this._curSelection[0].icon);
- return this.hasSelection() ? this._curSelection[0].icon : 'standard:default';
+ if (this._curSelection[0])
+ console.log(
+ 'this._curSelection[0].icon = ' + this._curSelection[0].icon
+ );
+ return this.hasSelection()
+ ? this._curSelection[0].icon
+ : 'standard:default';
}
get getSelectIconClass() {
- return 'slds-combobox__input-entity-icon ' + (this.hasSelection() ? '' : 'slds-hide');
+ return (
+ 'slds-combobox__input-entity-icon ' +
+ (this.hasSelection() ? '' : 'slds-hide')
+ );
}
get getInputValue() {
if (this.isMultiEntry) {
return this._searchTerm;
}
- if(this.accountValue != ''){
+ if (this.accountValue != '') {
return this.accountValue;
}
- return this.hasSelection() ? this._curSelection[0].title : this._searchTerm;
+ return this.hasSelection()
+ ? this._curSelection[0].title
+ : this._searchTerm;
}
get getInputTitle() {
@@ -479,7 +528,9 @@
get getListboxClass() {
return (
'slds-dropdown ' +
- (this.scrollAfterNItems ? `slds-dropdown_length-with-icon-${this.scrollAfterNItems} ` : '') +
+ (this.scrollAfterNItems
+ ? `slds-dropdown_length-with-icon-${this.scrollAfterNItems} `
+ : '') +
'slds-dropdown_fluid'
);
}
diff --git a/force-app/main/default/lwc/lexNewOrder/lexNewOrder.html b/force-app/main/default/lwc/lexNewOrder/lexNewOrder.html
index 44f8281..ff944f9 100644
--- a/force-app/main/default/lwc/lexNewOrder/lexNewOrder.html
+++ b/force-app/main/default/lwc/lexNewOrder/lexNewOrder.html
@@ -2,6 +2,20 @@
<template if:true={showSpinner}>
<lightning-spinner size="medium" variant="brand"></lightning-spinner>
</template>
- <div onclick={handleClick} style="width:200px;height:30px;background:#515151;font-weight:bold;font-size:16px Arial;color:white;border-radius: 5px 10px 10px 5px;;padding:5px 9px;cursor:pointer">鏂板缓娑堣�楀搧璁㈠崟</div>
-
+ <div
+ onclick={handleClick}
+ style="
+ width: 200px;
+ height: 30px;
+ background: #515151;
+ font-weight: bold;
+ font-size: 16px Arial;
+ color: white;
+ border-radius: 5px 10px 10px 5px;
+ padding: 5px 9px;
+ cursor: pointer;
+ "
+ >
+ 鏂板缓娑堣�楀搧璁㈠崟
+ </div>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewOrder/lexNewOrder.js b/force-app/main/default/lwc/lexNewOrder/lexNewOrder.js
index 7363f96..73ae356 100644
--- a/force-app/main/default/lwc/lexNewOrder/lexNewOrder.js
+++ b/force-app/main/default/lwc/lexNewOrder/lexNewOrder.js
@@ -1,25 +1,23 @@
import { LightningElement, track } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
-export default class LexNewOrder extends NavigationMixin(LightningElement) {
- @track showSpinner = true;
-
+export default class LexNewOrder extends NavigationMixin(LightningElement) {
+ @track showSpinner = true;
+
handleClick(event) {
- this.showSpinner = true;
+ this.showSpinner = true;
var rtId = event.target.id;
// this.clickedButtonLabel = event.target.label;
this[NavigationMixin.Navigate]({
type: 'standard__objectPage',
attributes: {
- objectApiName: 'Consumable_order__c',
- actionName: 'new'
+ objectApiName: 'Consumable_order__c',
+ actionName: 'new'
},
state: {
useRecordTypeCheck: 1
- }
+ }
});
this.showSpinner = false;
}
-
-
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.css b/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.css
index 7156e21..419ea5e 100644
--- a/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.css
+++ b/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.css
@@ -1,30 +1,30 @@
@import 'c/lexCssUtility';
-.outerBorderCss{
- border: 1px solid #D4D4D4;
- border-radius : 5px;
- border-top : 3px solid #565959;
+.outerBorderCss {
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ border-top: 3px solid #565959;
}
-.borderCss{
- border: 1px solid #D4D4D4;
- border-radius : 5px;
- margin-bottom : 7px;
- border-top : 3px solid #565959;
+.borderCss {
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ border-top: 3px solid #565959;
}
-.headerDorderCss{
+.headerDorderCss {
border-top: 1px solid #565959;
- border-bottom: 1px solid #D4D4D4;
- padding:3px;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
}
-.centerCss{
+.centerCss {
text-align: center;
}
-.centerCss .left{
+.centerCss .left {
margin-left: 100px;
}
-.floatLeft{
+.floatLeft {
float: left;
}
-.fontWeight{
+.fontWeight {
margin-left: 5px;
- font-size:16px;
+ font-size: 16px;
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.html b/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.html
index 76b9b05..d0cee60 100644
--- a/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.html
+++ b/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.html
@@ -3,11 +3,17 @@
<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>
<div class="outerBorderCss">
<div style="padding: 5px">
@@ -16,11 +22,22 @@
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false" class="centerCss searchName">
<lightning-layout multiple-rows="true">
- <lightning-layout-item size="4" style="display: flex;align-items: center;">
- <lightning-input class="floatLeft" label="" name="file uploader"
- onchange={handleFilesChange} type="file" accept={acceptedType}
- variant="label-hidden"></lightning-input>
- <div class="slds-text-body_small floatLeft fontWeight">
+ <lightning-layout-item
+ size="4"
+ style="display: flex; align-items: center"
+ >
+ <lightning-input
+ class="floatLeft"
+ label=""
+ name="file uploader"
+ onchange={handleFilesChange}
+ type="file"
+ accept={acceptedType}
+ variant="label-hidden"
+ ></lightning-input>
+ <div
+ class="slds-text-body_small floatLeft fontWeight"
+ >
{fileName}
</div>
</lightning-layout-item>
@@ -29,8 +46,12 @@
label="璇诲彇csv鏂囦欢"
onclick={getCsvFile}
></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={getCsvFile}>璇诲彇csv鏂囦欢</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ onclick={getCsvFile}
+ >
+ 璇诲彇csv鏂囦欢
+ </button>
</lightning-layout-item>
<lightning-layout-item size="4">
<!-- <lightning-button
@@ -38,13 +59,18 @@
onclick={dataImport}
disabled={saveFLGbln}
></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={dataImport} disabled={saveFLGbln}>瀵煎叆鏁版嵁</button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ onclick={dataImport}
+ disabled={saveFLGbln}
+ >
+ 瀵煎叆鏁版嵁
+ </button>
</lightning-layout-item>
</lightning-layout>
</div>
- <div class="borderCss" style="margin-top: 10px;">
+ <div class="borderCss" style="margin-top: 10px">
<div class="headerDorderCss">
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -57,9 +83,17 @@
<div style="padding: 7px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-datatable key-field="id" data={data} columns={columns} hide-checkbox-column
- default-sort-direction={defaultSortDirection} sorted-direction={sortDirection}
- sorted-by={sortedBy} onsort={onHandleSort} class="wrapped-header-datatable">
+ <lightning-datatable
+ key-field="id"
+ data={data}
+ columns={columns}
+ hide-checkbox-column
+ default-sort-direction={defaultSortDirection}
+ sorted-direction={sortDirection}
+ sorted-by={sortedBy}
+ onsort={onHandleSort}
+ class="wrapped-header-datatable"
+ >
</lightning-datatable>
</div>
</div>
diff --git a/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.js b/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.js
index 0200238..9378d25 100644
--- a/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.js
+++ b/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.js
@@ -1,78 +1,78 @@
-import { LightningElement, api, track, wire } from "lwc";
-import { ShowToastEvent } from "lightning/platformShowToastEvent";
-import init from "@salesforce/apex/LexOutboundorderImportController.init";
-import importCSVFile from "@salesforce/apex/LexOutboundorderImportController.importCSVFile";
-import dataImport from "@salesforce/apex/LexOutboundorderImportController.dataImport";
-//table css
-import { loadStyle } from "lightning/platformResourceLoader";
-import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
+import { LightningElement, api, track, wire } from 'lwc';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import init from '@salesforce/apex/LexOutboundorderImportController.init';
+import importCSVFile from '@salesforce/apex/LexOutboundorderImportController.importCSVFile';
+import dataImport from '@salesforce/apex/LexOutboundorderImportController.dataImport';
+//table css
+import { loadStyle } from 'lightning/platformResourceLoader';
+import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
const columns = [
{
- label: "鍑哄簱鍗曞悕绉�",
- fieldName: "orderName",
+ label: '鍑哄簱鍗曞悕绉�',
+ fieldName: 'orderName',
hideDefaultActions: true,
initialWidth: 200,
- wrapText: true,
+ wrapText: true
},
{
- label: "鐩殑",
- fieldName: "orderSummonsForDirction",
+ label: '鐩殑',
+ fieldName: 'orderSummonsForDirction',
hideDefaultActions: true,
- wrapText: true,
+ wrapText: true
},
{
- label: "鍖婚櫌缂栫爜",
- fieldName: "hospitalCode",
+ label: '鍖婚櫌缂栫爜',
+ fieldName: 'hospitalCode',
hideDefaultActions: true,
- wrapText: true,
+ wrapText: true
},
{
- label: "鍖婚櫌鍚嶇О",
- fieldName: "hospitalName",
+ label: '鍖婚櫌鍚嶇О',
+ fieldName: 'hospitalName',
hideDefaultActions: true,
wrapText: true,
initialWidth: 300
},
{
- label: "绉戝",
- fieldName: "orderOrderForCustomerText",
+ label: '绉戝',
+ fieldName: 'orderOrderForCustomerText',
hideDefaultActions: true,
- wrapText: true,
+ wrapText: true
},
{
- label: "浜岀骇缁忛攢鍟�",
- fieldName: "agencyName",
+ label: '浜岀骇缁忛攢鍟�',
+ fieldName: 'agencyName',
hideDefaultActions: true,
- wrapText: true,
+ wrapText: true
},
{
- label: "鍑哄簱/閿�鍞棩鏈�",
- fieldName: "orderOutboundDate",
+ label: '鍑哄簱/閿�鍞棩鏈�',
+ fieldName: 'orderOutboundDate',
hideDefaultActions: true,
- wrapText: true,
- },
+ wrapText: true
+ }
];
export default class LexOutboundorderImport extends LightningElement {
@track isShowSpinner = true;
//鏂囦欢涓婁紶
@track showLoadingSpinner = 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: "鍒涘缓浜�",
- fieldName: "CreatedByName",
- hideDefaultActions: true,
- },
+ label: '鍒涘缓浜�',
+ fieldName: 'CreatedByName',
+ hideDefaultActions: true
+ }
];
filesUploaded = [];
fileContents;
@@ -80,7 +80,7 @@
content;
MAX_FILE_SIZE = 1500000;
get acceptedType() {
- return [".csv"];
+ return ['.csv'];
}
//鍒楄〃
@@ -88,11 +88,11 @@
@track data = [];
//鏁版嵁
- @track accountid = "";
- @track userWorkLocation = "";
- @track agencyProType = "";
- @track accountName = "";
- @track sqlagencyProType = "";
+ @track accountid = '';
+ @track userWorkLocation = '';
+ @track agencyProType = '';
+ @track accountName = '';
+ @track sqlagencyProType = '';
@track csvRecordStr = [];
@track saveFLGbln = false;
@track secondAgencyMap = {};
@@ -103,35 +103,37 @@
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((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log("r = " + JSON.stringify(r));
- if (r.status == "Success") {
- this.accountid = r.entity.accountid;
- this.userWorkLocation = r.entity.userWorkLocation;
- this.agencyProType = r.entity.agencyProType;
- console.log('this.agencyProType = ' + this.agencyProType);
- this.accountName = r.entity.accountName;
- this.sqlagencyProType = r.entity.sqlagencyProType;
- this.isShowSpinner = false;
- } else {
- console.log("r = " + JSON.stringify(r));
- this.showMyToast('鍒濆鍖栧け璐�', r.msg, 'Error')
- }
- }).catch((error) => {
- console.log("error = " + JSON.stringify(error));
- this.showMyToast('閿欒', '鍒濆鍖栧け璐�', 'Error')
- });
+ init()
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log('r = ' + JSON.stringify(r));
+ if (r.status == 'Success') {
+ this.accountid = r.entity.accountid;
+ this.userWorkLocation = r.entity.userWorkLocation;
+ this.agencyProType = r.entity.agencyProType;
+ console.log('this.agencyProType = ' + this.agencyProType);
+ this.accountName = r.entity.accountName;
+ this.sqlagencyProType = r.entity.sqlagencyProType;
+ this.isShowSpinner = false;
+ } else {
+ console.log('r = ' + JSON.stringify(r));
+ this.showMyToast('鍒濆鍖栧け璐�', r.msg, 'Error');
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showMyToast('閿欒', '鍒濆鍖栧け璐�', 'Error');
+ });
}
getCsvFile() {
@@ -140,7 +142,7 @@
if (this.filesUploaded.length > 0) {
this.file = this.filesUploaded[0];
if (this.file.size > this.MAX_FILE_SIZE) {
- window.console.log("鏂囦欢杩囧ぇ");
+ window.console.log('鏂囦欢杩囧ぇ');
this.isShowSpinner = false;
return;
}
@@ -148,66 +150,78 @@
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);
- console.log('getCsvFile')
+ console.log('getCsvFile');
this.importCSVFile();
};
this.fileReader.readAsDataURL(this.file);
} else {
- this.fileName = "閫夋嫨涓�涓猚sv鏂囦欢涓婁紶";
- this.showMyToast('涓婁紶澶辫触', '閫夋嫨涓�涓猚sv鏂囦欢涓婁紶', 'Error')
+ this.fileName = '閫夋嫨涓�涓猚sv鏂囦欢涓婁紶';
+ this.showMyToast('涓婁紶澶辫触', '閫夋嫨涓�涓猚sv鏂囦欢涓婁紶', 'Error');
}
}
importCSVFile() {
- console.log('importCSVFile')
+ console.log('importCSVFile');
console.log('this.sqlagencyProType = ' + this.sqlagencyProType);
console.log('this.userWorkLocation = ' + this.userWorkLocation);
console.log('this.accountName = ' + this.accountName);
- console.log('encodeURIComponent(this.fileContents) = ' + encodeURIComponent(this.fileContents));
+ console.log(
+ 'encodeURIComponent(this.fileContents) = ' +
+ encodeURIComponent(this.fileContents)
+ );
importCSVFile({
base64DataLwc: encodeURIComponent(this.fileContents),
sqlagencyProTypeLwc: this.sqlagencyProType,
userWorkLocationLwc: this.userWorkLocation,
- accountNameLwc: this.accountName,
- }).then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log("r = " + JSON.stringify(r));
- if (r.status == "Success" && r.msg == "") {
- console.log("importCSVFile success");
- this.saveFLGbln = r.entity.saveFLGbln;
- this.csvRecordStr = r.entity.csvRecordStr;
- this.secondAgencyMap = r.entity.secondAgencyMap;
- this.hospitalSysMap = r.entity.hospitalSysMap;
- this.data = r.entity.orderRecords;
- for (var i in this.data) {
- this.data[i]['orderName'] = this.data[i].order.Name;
- this.data[i]['orderSummonsForDirction'] = this.data[i].order.SummonsForDirction__c;
- this.data[i]['orderOrderForCustomerText'] = this.data[i].order.Order_ForCustomerText__c;
- this.data[i]['orderOutboundDate'] = this.data[i].order.Outbound_Date__c;
+ accountNameLwc: this.accountName
+ })
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log('r = ' + JSON.stringify(r));
+ if (r.status == 'Success' && r.msg == '') {
+ console.log('importCSVFile success');
+ this.saveFLGbln = r.entity.saveFLGbln;
+ this.csvRecordStr = r.entity.csvRecordStr;
+ this.secondAgencyMap = r.entity.secondAgencyMap;
+ this.hospitalSysMap = r.entity.hospitalSysMap;
+ this.data = r.entity.orderRecords;
+ for (var i in this.data) {
+ this.data[i]['orderName'] = this.data[i].order.Name;
+ this.data[i]['orderSummonsForDirction'] =
+ this.data[i].order.SummonsForDirction__c;
+ this.data[i]['orderOrderForCustomerText'] =
+ this.data[i].order.Order_ForCustomerText__c;
+ this.data[i]['orderOutboundDate'] =
+ this.data[i].order.Outbound_Date__c;
+ }
+ this.isShowSpinner = false;
+ } else if (r.msg != '') {
+ console.log('r.msg = ' + JSON.stringify(r.msg));
+ this.saveFLGbln = r.entity.saveFLGbln;
+ this.data = r.entity.orderRecords;
+ for (var i in this.data) {
+ this.data[i]['orderName'] = this.data[i].order.Name;
+ this.data[i]['orderSummonsForDirction'] =
+ this.data[i].order.SummonsForDirction__c;
+ this.data[i]['orderOrderForCustomerText'] =
+ this.data[i].order.Order_ForCustomerText__c;
+ this.data[i]['orderOutboundDate'] =
+ this.data[i].order.Outbound_Date__c;
+ }
+ this.showMyToast('瀵煎叆澶辫触', r.msg, 'Error');
+ } else {
+ console.log('r.msg = ' + JSON.stringify(r.msg));
+ this.showMyToast('瀵煎叆澶辫触', r.msg, 'Error');
}
- this.isShowSpinner = false;
- } else if (r.msg != "") {
- console.log("r.msg = " + JSON.stringify(r.msg));
- this.saveFLGbln = r.entity.saveFLGbln;
- this.data = r.entity.orderRecords;
- for (var i in this.data) {
- this.data[i]['orderName'] = this.data[i].order.Name;
- this.data[i]['orderSummonsForDirction'] = this.data[i].order.SummonsForDirction__c;
- this.data[i]['orderOrderForCustomerText'] = this.data[i].order.Order_ForCustomerText__c;
- this.data[i]['orderOutboundDate'] = this.data[i].order.Outbound_Date__c;
- }
- this.showMyToast('瀵煎叆澶辫触', r.msg, 'Error')
- } else {
- console.log("r.msg = " + JSON.stringify(r.msg));
- this.showMyToast('瀵煎叆澶辫触', r.msg, 'Error')
- }
- }).catch((error) => {
- console.log("error = " + JSON.stringify(error.message));
- this.showMyToast('瀵煎叆閿欒', '瀵煎叆澶辫触', 'Error')
- });
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error.message));
+ this.showMyToast('瀵煎叆閿欒', '瀵煎叆澶辫触', 'Error');
+ });
}
dataImport() {
@@ -229,29 +243,31 @@
accountidLwc: this.accountid,
agencyProTypeLwc: this.agencyProType,
secondAgencyMapLwc: this.secondAgencyMap,
- hospitalSysMapLwc: this.hospitalSysMap,
- }).then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log("r = " + JSON.stringify(r));
- if (r.status == "Success" && r.msg == "") {
- this.saveFLGbln = true;
- console.log("dataImport success");
- this.showMyToast('鎴愬姛', '淇濆瓨鎴愬姛', 'Success')
- } else if (r.msg != "") {
- console.log("r.msg = " + JSON.stringify(r.msg));
- this.showMyToast('淇濆瓨澶辫触', r.msg, 'Error')
- } else {
- console.log("r.msg = " + JSON.stringify(r.msg));
- this.showMyToast('淇濆瓨澶辫触', r.msg, 'Error')
- }
- }).catch((error) => {
- console.log("error = " + JSON.stringify(error.message));
- this.showMyToast('閿欒', '淇濆瓨澶辫触', 'Error')
- });
+ hospitalSysMapLwc: this.hospitalSysMap
+ })
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log('r = ' + JSON.stringify(r));
+ if (r.status == 'Success' && r.msg == '') {
+ this.saveFLGbln = true;
+ console.log('dataImport success');
+ this.showMyToast('鎴愬姛', '淇濆瓨鎴愬姛', 'Success');
+ } else if (r.msg != '') {
+ console.log('r.msg = ' + JSON.stringify(r.msg));
+ this.showMyToast('淇濆瓨澶辫触', r.msg, 'Error');
+ } else {
+ console.log('r.msg = ' + JSON.stringify(r.msg));
+ this.showMyToast('淇濆瓨澶辫触', r.msg, 'Error');
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error.message));
+ this.showMyToast('閿欒', '淇濆瓨澶辫触', 'Error');
+ });
}
handleFilesChange(event) {
- console.log("handleFilesChange");
+ console.log('handleFilesChange');
if (event.target.files.length > 0) {
this.filesUploaded = event.target.files;
this.fileName = event.target.files[0].name;
@@ -269,10 +285,17 @@
iconName = 'utility:error';
}
if (message != '') {
- content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
} else {
content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template.querySelector('c-common-toast').showToast(variant, content, iconName, 10000);
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.html b/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.html
index 75c65de..ba371d6 100644
--- a/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.html
+++ b/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.html
@@ -1,131 +1,212 @@
<template>
<template if:true={showSpinner}>
- <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
- <div class="slds-spinner_container">
- <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
- <span class="slds-assistive-text">Loading</span>
- <div class="slds-spinner__dot-a"></div>
- <div class="slds-spinner__dot-b"></div>
+ <!-- <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>
- </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="margin: 12px;">
- <p style="font-size: 18px;float:left"><strong>杩囨湡搴撳瓨閿�瀛�</strong></p>
- </div>
- <div style="margin-left:400px;margin-bottom:12px;">
- <!-- <lightning-button variant="brand" class = 'lexstyle' label="閿�瀛樼‘璁�" title="閿�瀛樼‘璁�" onclick={saveConfirm}></lightning-button> -->
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="閿�瀛樼‘璁�" onclick={saveConfirm}>閿�瀛樼‘璁�</button>
- </div>
-</div>
-
-<div style="padding:10px;">
- <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
- <table>
- <colgroup>
- <col width="160px" />
- <col width="100px" />
- <col width="10px" />
- <col width="70px" />
- <col width="100px" />
- <col width="10px" />
- <col width="90px" />
- <col width="100px" />
- <col width="10px" />
- <col width="85px" />
- <col width="100px" />
- <col width="10px" />
- <col width="70px" />
- <col width="100px" />
- </colgroup>
- <tbody>
- <tr>
- <td></td>
- <td align="right" class="searchName">BarCode</td>
- <td style="width:600px"><lightning-textarea class="inputFont" name="BarCode" label=""
- onchange={handleChange}></lightning-textarea></td>
- <td align="right"></td>
- <td></td>
- <td style="width:200px">
- <button style="margin-top:14px;" class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="鑾峰彇鏄庣粏" onclick={barcodeEntrys}>鑾峰彇鏄庣粏</button>
- <!-- <lightning-button class='lexstyle' label="BarCode褰曞叆" title="BarCode褰曞叆" onclick={barcodeEntrys}
- style="width: 150px;"></lightning-button> -->
- </td>
- </tr>
- </tbody>
- </table>
+ </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="margin: 12px">
+ <p style="font-size: 18px; float: left">
+ <strong>杩囨湡搴撳瓨閿�瀛�</strong>
+ </p>
+ </div>
+ <div style="margin-left: 400px; margin-bottom: 12px">
+ <!-- <lightning-button variant="brand" class = 'lexstyle' label="閿�瀛樼‘璁�" title="閿�瀛樼‘璁�" onclick={saveConfirm}></lightning-button> -->
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ label="閿�瀛樼‘璁�"
+ onclick={saveConfirm}
+ >
+ 閿�瀛樼‘璁�
+ </button>
+ </div>
</div>
- </div>
- <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:5px;">
- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
- <!-- <p style="font-size: 16px;"><strong>杩囨湡搴撳瓨涓�瑙�</strong></p> -->
- <table>
- <tr>
- <td>
- <!-- <p style="font-size: 16px;"><strong>閿�瀛樻槑缁�</strong></p> -->
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>杩囨湡搴撳瓨涓�瑙�</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </td>
- </tr>
- </table>
- </div>
- <div style="padding:10px;">
-
- <!-- <div style="height: 300px;"> -->
- <template if:true={showTable}>
- <c-lex-custom-lightning-datatable key-field="key" data={data} columns={columns}
- onrowselection={getSelectedRows}
- selected-rows={selectedRows} class="wrapped-header-datatable">
- </c-lex-custom-lightning-datatable>
- </template>
- <!-- 鍔犺浇妗� -->
-
- <!-- <div if:true={casesSpinner} class="slds-spinner_inline spinner-padding"
- style="margin-top:10px;">
- <lightning-spinner variant="brand" alternative-text="Loading Cases" size="medium">
- </lightning-spinner>
- </div> -->
-
- <!-- </div> -->
-
- </div>
- </div>
-
- <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:5px;">
- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
- <table>
- <tr>
- <td>
- <!-- <p style="font-size: 16px;"><strong>閿�瀛樻槑缁�</strong></p> -->
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>閿�瀛樻槑缁�</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </td>
- </tr>
- </table>
+ <div style="padding: 10px">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
+ <table>
+ <colgroup>
+ <col width="160px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="70px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="90px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="85px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="70px" />
+ <col width="100px" />
+ </colgroup>
+ <tbody>
+ <tr>
+ <td></td>
+ <td align="right" class="searchName">
+ BarCode
+ </td>
+ <td style="width: 600px">
+ <lightning-textarea
+ class="inputFont"
+ name="BarCode"
+ label=""
+ onchange={handleChange}
+ ></lightning-textarea>
+ </td>
+ <td align="right"></td>
+ <td></td>
+ <td style="width: 200px">
+ <button
+ style="margin-top: 14px"
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ label="鑾峰彇鏄庣粏"
+ onclick={barcodeEntrys}
+ >
+ 鑾峰彇鏄庣粏
+ </button>
+ <!-- <lightning-button class='lexstyle' label="BarCode褰曞叆" title="BarCode褰曞叆" onclick={barcodeEntrys}
+ style="width: 150px;"></lightning-button> -->
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
</div>
- <div style="padding:10px;">
- <lightning-datatable
- key-field="id" data={overduePageRecords} 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
+ style="
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-bottom: 5px;
+ "
+ >
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
+ <!-- <p style="font-size: 16px;"><strong>杩囨湡搴撳瓨涓�瑙�</strong></p> -->
+ <table>
+ <tr>
+ <td>
+ <!-- <p style="font-size: 16px;"><strong>閿�瀛樻槑缁�</strong></p> -->
+ <lightning-layout>
+ <lightning-layout-item
+ padding="around-small"
+ >
+ <p style="font-size: 18px">
+ <strong>杩囨湡搴撳瓨涓�瑙�</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div style="padding: 10px">
+ <!-- <div style="height: 300px;"> -->
+ <template if:true={showTable}>
+ <c-lex-custom-lightning-datatable
+ key-field="key"
+ data={data}
+ columns={columns}
+ onrowselection={getSelectedRows}
+ selected-rows={selectedRows}
+ class="wrapped-header-datatable"
+ >
+ </c-lex-custom-lightning-datatable>
+ </template>
+ <!-- 鍔犺浇妗� -->
+
+ <!-- <div if:true={casesSpinner} class="slds-spinner_inline spinner-padding"
+ style="margin-top:10px;">
+ <lightning-spinner variant="brand" alternative-text="Loading Cases" size="medium">
+ </lightning-spinner>
+ </div> -->
+
+ <!-- </div> -->
+ </div>
+ </div>
+
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-bottom: 5px;
+ "
+ >
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
+ <table>
+ <tr>
+ <td>
+ <!-- <p style="font-size: 16px;"><strong>閿�瀛樻槑缁�</strong></p> -->
+ <lightning-layout>
+ <lightning-layout-item
+ padding="around-small"
+ >
+ <p style="font-size: 18px">
+ <strong>閿�瀛樻槑缁�</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <div style="padding: 10px">
+ <lightning-datatable
+ key-field="id"
+ data={overduePageRecords}
+ 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>
-</div>
-</div>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.js b/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.js
index 88325a0..92f0d0e 100644
--- a/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.js
+++ b/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.js
@@ -4,350 +4,397 @@
import save from '@salesforce/apex/LexOverdueStockController.save';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
-//table css
-import { loadStyle } from "lightning/platformResourceLoader";
-import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
-
+//table css
+import { loadStyle } from 'lightning/platformResourceLoader';
+import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
//杩囨湡搴撳瓨涓�瑙�
const columns = [
- {
- label: '鏄惁閿�瀛�',
- fieldName: 'iscount',
- type: 'checkbox',
- hideDefaultActions: true,
- initialWidth: 80,
- },
- {
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'prodname',
- type: 'prodname',
- wrapText: true,
- initialWidth: 350,
+ {
+ label: '鏄惁閿�瀛�',
+ fieldName: 'iscount',
+ type: 'checkbox',
+ hideDefaultActions: true,
+ initialWidth: 80
+ },
+ {
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'prodname',
+ type: 'prodname',
+ wrapText: true,
+ initialWidth: 350,
- hideDefaultActions: true
+ hideDefaultActions: true
+ },
+ {
+ label: '鍗曚綅',
+ fieldName: 'boxPiece',
+ hideDefaultActions: true
+ // initialWidth: 250,
+ },
+ {
+ label: '杩囨湡鏁伴噺',
+ fieldName: 'overlimitCount',
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'right' }
- },
- {
- label: '鍗曚綅',
- fieldName: 'boxPiece',
- hideDefaultActions: true,
- // initialWidth: 250,
-
- },
- {
- label: '杩囨湡鏁伴噺',
- fieldName: 'overlimitCount',
- hideDefaultActions: true,
- cellAttributes: { alignment: 'right' }
-
- // initialWidth: 250,
-
- },
- {
- label: '閿�瀛樻暟閲�',
- fieldName: 'pandian',
- hideDefaultActions: true,
- cellAttributes: { alignment: 'right' }
- // initialWidth: 250,
- // cellAttributes: { alignment: 'center' }
- }
+ // initialWidth: 250,
+ },
+ {
+ label: '閿�瀛樻暟閲�',
+ fieldName: 'pandian',
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'right' }
+ // initialWidth: 250,
+ // cellAttributes: { alignment: 'center' }
+ }
];
//閿�瀛樻槑缁�
const column = [
-
- {
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'Name__c',
- type: 'Name',
- wrapText: true,
- // initialWidth : 300,
- hideDefaultActions: true,
- cellAttributes: { alignment: 'left' }
- },
- {
- label: '鍗曚綅',
- fieldName: 'Box_Piece__c',
- initialWidth: 80,
- hideDefaultActions: true
- },
- {
- label: 'BarCode',
- fieldName: 'Bar_Code__c',
- wrapText: true,
- hideDefaultActions: true,
- // initialWidth: 500,
- },
- {
- label: '浣跨敤鏈熼檺',
- fieldName: 'Sterilization_limit__c',
- hideDefaultActions: true,
- // initialWidth : 250
- }
- ,
- {
- label: '閿�瀛樺師鍥�',
- fieldName: 'diffReason',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 160
- }
+ {
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'Name__c',
+ type: 'Name',
+ wrapText: true,
+ // initialWidth : 300,
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'left' }
+ },
+ {
+ label: '鍗曚綅',
+ fieldName: 'Box_Piece__c',
+ initialWidth: 80,
+ hideDefaultActions: true
+ },
+ {
+ label: 'BarCode',
+ fieldName: 'Bar_Code__c',
+ wrapText: true,
+ hideDefaultActions: true
+ // initialWidth: 500,
+ },
+ {
+ label: '浣跨敤鏈熼檺',
+ fieldName: 'Sterilization_limit__c',
+ hideDefaultActions: true
+ // initialWidth : 250
+ },
+ {
+ label: '閿�瀛樺師鍥�',
+ fieldName: 'diffReason',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 160
+ }
];
-
export default class LexOverdueStock extends NavigationMixin(LightningElement) {
- columns = columns
- column = column
- @track data = [];
- @track overduePageRecords = [];
- @track iSinventory = false
+ columns = columns;
+ column = column;
+ @track data = [];
+ @track overduePageRecords = [];
+ @track iSinventory = false;
+ //鍔犺浇妗�
+ // @track casesSpinner = true;
+ @track showSpinner = true;
+ //鏄剧ず鍙�
+ @track showbutton = false;
+ @track showTable = false;
+ @track showTables = false;
+ //閿�瀛樹竴瑙堟暟鎹�
+ @track accountName;
+ @track agencyProType;
+ @track userWorkLocation;
+ @track barcode = '';
+ @track orderDetZaiku;
+ @track selectedRows = [];
+ @track codPageRecordsLWC;
+ @track Id;
+ @track overdueList = [];
- //鍔犺浇妗�
- // @track casesSpinner = true;
- @track showSpinner = true;
- //鏄剧ず鍙�
- @track showbutton = false
- @track showTable = false;
- @track showTables = false;
- //閿�瀛樹竴瑙堟暟鎹�
- @track accountName;
- @track agencyProType;
- @track userWorkLocation;
- @track barcode = ''
- @track orderDetZaiku
- @track selectedRows = [];
- @track codPageRecordsLWC;
- @track Id;
- @track overdueList = [];
+ renderedCallback() {
+ if (!this.stylesLoaded) {
+ Promise.all([loadStyle(this, WrappedHeaderTable)])
+ .then(() => {
+ console.log('Custom styles loaded');
+ this.stylesLoaded = true;
+ })
+ .catch((error) => {
+ console.error('Error loading custom styles');
+ });
+ }
+ }
+ //鍒濆鍖�
+ connectedCallback() {
+ console.log('鍒濆鍖�');
+ this.showSpinner = true;
- renderedCallback() {
- if (!this.stylesLoaded) {
- Promise.all([loadStyle(this, WrappedHeaderTable)])
- .then(() => {
- console.log("Custom styles loaded");
- this.stylesLoaded = true;
+ init()
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result =' + JSON.stringify(result));
+ console.log('result 1=' + result.entity.codPageRecords);
+ if ((result.status = 'Success')) {
+ this.data = JSON.parse(result.entity.codPageRecords);
+ this.codPageRecordsLWC = result.entity.codPageRecords;
+ console.log('this.data' + this.data);
+ this.accountName = result.entity.accountName;
+ this.agencyProType = result.entity.agencyProType;
+ this.userWorkLocation = result.entity.userWorkLocation;
+ for (var i in this.data) {
+ this.data[i]['key'] =
+ this.data[i]['prodid'] + this.data[i]['boxPiece'];
+ }
+ this.showTable = true;
+ // this.casesSpinner = false;
+ this.showSpinner = false;
+ } else {
+ this.showMyToast('鍒濆鍖栧け璐�', result.msg, 'error');
+ this.showSpinner = false;
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showSpinner = false;
+ });
+ }
+ //barcode褰曞叆
+ barcodeEntrys() {
+ this.showSpinner = true;
+ this.showTable = false;
+ console.log('code' + this.barcode);
+ console.log(' this.accountName' + this.accountName);
+ console.log(' this.barcode' + this.barcode);
+ const selectedRows = this.template
+ .querySelector('c-lex-custom-lightning-datatable')
+ .getSelectedRows();
+ console.log('selectedRows========> ' + JSON.stringify(selectedRows));
+ for (var i in this.data) {
+ this.data[i]['check'] = false;
+ }
+ for (var i in this.data) {
+ for (var j in selectedRows) {
+ if (
+ this.data[i].prodid + this.data[i]['boxPiece'] ==
+ selectedRows[j].prodid + selectedRows[j]['boxPiece']
+ ) {
+ this.data[i]['check'] = true;
+ }
+ }
+ }
+ barcodeEntry({
+ accountNameLWC: this.accountName,
+ agencyProTypeLWC: this.agencyProType,
+ userWorkLocationLWC: this.userWorkLocation,
+ barcodeLWC: this.barcode,
+ codPageRecordsLWC: JSON.stringify(this.data)
})
- .catch((error) => {
- console.error("Error loading custom styles");
- });
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ if (result.status == 'Success') {
+ this.overduePageRecords = JSON.parse(
+ result.entity.overduePageRecords
+ );
+ this.overdueList = result.entity.overdueList;
+ this.iSinventory = result.entity.iSinventory;
+ console.log('result褰曞叆' + JSON.stringify(result));
+ console.log(
+ 'overdueList==>' + JSON.stringify(this.overdueList)
+ );
+ for (let i in this.overduePageRecords) {
+ if (this.overduePageRecords[i].Prod != null) {
+ this.overduePageRecords[i]['Name__c'] =
+ this.overduePageRecords[i].Prod.Name__c;
+ }
+ this.overduePageRecords[i]['Bar_Code__c'] =
+ this.overduePageRecords[
+ i
+ ].orderdetails2.Bar_Code__c;
+ this.overduePageRecords[i]['Box_Piece__c'] =
+ this.overduePageRecords[
+ i
+ ].orderdetails2.Box_Piece__c;
+ this.overduePageRecords[i]['Sterilization_limit__c'] =
+ this.overduePageRecords[
+ i
+ ].orderdetails2.Sterilization_limit__c;
+ }
+ this.data = JSON.parse(result.entity.codPageRecords);
+ console.log(' this.data' + JSON.stringify(this.data));
+ for (var i in this.data) {
+ this.data[i]['key'] =
+ this.data[i]['prodid'] + this.data[i]['boxPiece'];
+ }
+ for (var i in this.data) {
+ if (this.data[i]['check']) {
+ this.selectedRows.push(
+ this.data[i].prodid + this.data[i]['boxPiece']
+ );
+ console.log('selectedRows:' + this.selectedRows);
+ }
+ }
+ this.showSpinner = false;
+ this.showTable = true;
+ } else {
+ if (result.status == 'Success1') {
+ this.overduePageRecords = JSON.parse(
+ result.entity.overduePageRecords
+ );
+ this.overdueList = result.entity.overdueList;
+ this.iSinventory = result.entity.iSinventory;
+ console.log('result褰曞叆' + JSON.stringify(result));
+ console.log(
+ 'overdueList==>' + JSON.stringify(this.overdueList)
+ );
+ for (let i in this.overduePageRecords) {
+ if (this.overduePageRecords[i].Prod != null) {
+ this.overduePageRecords[i]['Name__c'] =
+ this.overduePageRecords[i].Prod.Name__c;
+ }
+ this.overduePageRecords[i]['Bar_Code__c'] =
+ this.overduePageRecords[
+ i
+ ].orderdetails2.Bar_Code__c;
+ this.overduePageRecords[i]['Box_Piece__c'] =
+ this.overduePageRecords[
+ i
+ ].orderdetails2.Box_Piece__c;
+ this.overduePageRecords[i][
+ 'Sterilization_limit__c'
+ ] =
+ this.overduePageRecords[
+ i
+ ].orderdetails2.Sterilization_limit__c;
+ }
+ this.data = JSON.parse(result.entity.codPageRecords);
+ console.log(' this.data' + JSON.stringify(this.data));
+ for (var i in this.data) {
+ this.data[i]['key'] =
+ this.data[i]['prodid'] +
+ this.data[i]['boxPiece'];
+ }
+ for (var i in this.data) {
+ if (this.data[i]['check']) {
+ this.selectedRows.push(
+ this.data[i].prodid +
+ this.data[i]['boxPiece']
+ );
+ console.log(
+ 'selectedRows:' + this.selectedRows
+ );
+ }
+ }
+ this.showSpinner = false;
+ // this.showTables = true;
+ this.showTable = true;
+ } else {
+ console.log('Error:' + result.msg);
+ this.showMyToast(result.msg, '', 'error');
+ this.showSpinner = false;
+ this.showTable = true;
+ }
+
+ // this.showMyToast('鑾峰彇澶辫触', result.msg, 'error');
+ // this.showSpinner = false;
+ }
+ })
+ .catch((error) => {
+ this.showSpinner = false;
+ console.log('error = ' + JSON.stringify(error));
+ });
}
- }
-
-
- //鍒濆鍖�
- connectedCallback() {
- console.log('鍒濆鍖�');
- this.showSpinner = true;
-
- init().then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result =' + JSON.stringify(result));
- console.log('result 1=' + result.entity.codPageRecords);
- if (result.status = 'Success') {
- this.data = JSON.parse(result.entity.codPageRecords);
- this.codPageRecordsLWC = result.entity.codPageRecords;
- console.log('this.data' + this.data);
- this.accountName = result.entity.accountName;
- this.agencyProType = result.entity.agencyProType;
- this.userWorkLocation = result.entity.userWorkLocation;
+ //鑾峰彇褰撳墠杈撳叆鍊�
+ handleChange(event) {
+ let value = event.detail.value;
+ console.log('value' + value);
+ this.barcode = value;
+ console.log('this.barcode' + this.barcode);
+ }
+ getSelectedRows(event) {
+ let selectedRowsEvent = event.detail.selectedRows;
+ this.selectedRows = [];
+ for (var i in selectedRowsEvent) {
+ this.selectedRows.push(
+ selectedRowsEvent[i].prodid + this.data[i]['boxPiece']
+ );
+ }
+ console.log('this.selectedRows==>' + this.selectedRows);
+ }
+ //淇濆瓨
+ saveConfirm() {
+ console.log('杩涘叆閿�瀛樼‘璁�');
+ this.showSpinner = true;
+ //鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
+ const selectedRows = this.template
+ .querySelector('c-lex-custom-lightning-datatable')
+ .getSelectedRows();
+ console.log('selectedRows========> ' + JSON.stringify(selectedRows));
for (var i in this.data) {
- this.data[i]["key"] = this.data[i]["prodid"] + this.data[i]["boxPiece"];
- }
- this.showTable = true;
- // this.casesSpinner = false;
- this.showSpinner = false;
- } else {
- this.showMyToast('鍒濆鍖栧け璐�', result.msg, 'error');
- this.showSpinner = false;
- }
- }).catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- this.showSpinner = false;
- });
- }
- //barcode褰曞叆
- barcodeEntrys() {
- this.showSpinner = true;
- this.showTable = false;
- console.log('code' + this.barcode);
- console.log(' this.accountName' + this.accountName);
- console.log(' this.barcode' + this.barcode);
- const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
- console.log('selectedRows========> ' + JSON.stringify(selectedRows));
- for (var i in this.data) {
- this.data[i]["check"] = false;
- }
- for (var i in this.data) {
- for (var j in selectedRows) {
- if (this.data[i].prodid + this.data[i]["boxPiece"] == selectedRows[j].prodid + selectedRows[j]["boxPiece"]) {
- this.data[i]["check"] = true;
- }
- }
- }
- barcodeEntry({
- accountNameLWC: this.accountName,
- agencyProTypeLWC: this.agencyProType,
- userWorkLocationLWC: this.userWorkLocation,
- barcodeLWC: this.barcode,
- codPageRecordsLWC: JSON.stringify(this.data)
- }).then((result) => {
- result = JSON.parse(JSON.stringify(result));
- if (result.status == 'Success') {
- this.overduePageRecords = JSON.parse(result.entity.overduePageRecords);
- this.overdueList = result.entity.overdueList;
- this.iSinventory = result.entity.iSinventory;
- console.log('result褰曞叆' + JSON.stringify(result));
- console.log('overdueList==>' + JSON.stringify(this.overdueList));
- for (let i in this.overduePageRecords) {
- if (this.overduePageRecords[i].Prod != null) {
- this.overduePageRecords[i]['Name__c'] = this.overduePageRecords[i].Prod.Name__c;
-
- }
- this.overduePageRecords[i]['Bar_Code__c'] = this.overduePageRecords[i].orderdetails2.Bar_Code__c;
- this.overduePageRecords[i]['Box_Piece__c'] = this.overduePageRecords[i].orderdetails2.Box_Piece__c;
- this.overduePageRecords[i]['Sterilization_limit__c'] = this.overduePageRecords[i].orderdetails2.Sterilization_limit__c;
- }
- this.data = JSON.parse(result.entity.codPageRecords);
- console.log(' this.data' + JSON.stringify(this.data));
- for (var i in this.data) {
- this.data[i]["key"] = this.data[i]["prodid"] + this.data[i]["boxPiece"];
+ this.data[i]['check'] = false;
}
for (var i in this.data) {
- if (this.data[i]['check']) {
- this.selectedRows.push(this.data[i].prodid + this.data[i]["boxPiece"]);
- console.log("selectedRows:" + this.selectedRows);
- }
- }
- this.showSpinner = false;
- this.showTable = true;
- } else {
- if (result.status == 'Success1') {
- this.overduePageRecords = JSON.parse(result.entity.overduePageRecords);
- this.overdueList = result.entity.overdueList;
- this.iSinventory = result.entity.iSinventory;
- console.log('result褰曞叆' + JSON.stringify(result));
- console.log('overdueList==>' + JSON.stringify(this.overdueList));
- for (let i in this.overduePageRecords) {
- if (this.overduePageRecords[i].Prod != null) {
- this.overduePageRecords[i]['Name__c'] = this.overduePageRecords[i].Prod.Name__c;
-
+ for (var j in selectedRows) {
+ if (
+ this.data[i].prodid + this.data[i]['boxPiece'] ==
+ selectedRows[j].prodid + selectedRows[j]['boxPiece']
+ ) {
+ this.data[i]['check'] = true;
+ }
}
- this.overduePageRecords[i]['Bar_Code__c'] = this.overduePageRecords[i].orderdetails2.Bar_Code__c;
- this.overduePageRecords[i]['Box_Piece__c'] = this.overduePageRecords[i].orderdetails2.Box_Piece__c;
- this.overduePageRecords[i]['Sterilization_limit__c'] = this.overduePageRecords[i].orderdetails2.Sterilization_limit__c;
- }
- this.data = JSON.parse(result.entity.codPageRecords);
- console.log(' this.data' + JSON.stringify(this.data));
- for (var i in this.data) {
- this.data[i]["key"] = this.data[i]["prodid"] + this.data[i]["boxPiece"];
- }
- for (var i in this.data) {
- if (this.data[i]['check']) {
- this.selectedRows.push(this.data[i].prodid + this.data[i]["boxPiece"]);
- console.log("selectedRows:" + this.selectedRows);
- }
- }
- this.showSpinner = false;
- // this.showTables = true;
- this.showTable = true;
- }else {
- console.log('Error:' + result.msg);
- this.showMyToast(result.msg,'','error');
- this.showSpinner = false;
- this.showTable = true;
-
}
-
- // this.showMyToast('鑾峰彇澶辫触', result.msg, 'error');
- // this.showSpinner = false;
- }
-
- }).catch((error) => {
- this.showSpinner = false;
- console.log('error = ' + JSON.stringify(error));
- });
-
- }
- //鑾峰彇褰撳墠杈撳叆鍊�
- handleChange(event) {
- let value = event.detail.value;
- console.log('value' + value);
- this.barcode = value;
- console.log('this.barcode' + this.barcode);
- }
- getSelectedRows(event) {
- let selectedRowsEvent = event.detail.selectedRows;
- this.selectedRows = [];
- for (var i in selectedRowsEvent) {
- this.selectedRows.push(selectedRowsEvent[i].prodid+this.data[i]["boxPiece"]);
- }
- console.log('this.selectedRows==>'+this.selectedRows);
-
- }
- //淇濆瓨
- saveConfirm() {
- console.log('杩涘叆閿�瀛樼‘璁�');
- this.showSpinner = true;
- //鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
- const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
- console.log('selectedRows========> ' + JSON.stringify(selectedRows));
- for (var i in this.data) {
- this.data[i]["check"] = false;
- }
- for (var i in this.data) {
- for (var j in selectedRows) {
- if (this.data[i].prodid+this.data[i]["boxPiece"] == selectedRows[j].prodid+ selectedRows[j]["boxPiece"]) {
- this.data[i]["check"] = true;
- }
- }
- }
- save({
- iSinventory: this.iSinventory,
- saveCodPageRecords: JSON.stringify(this.data),
- // saveoverdueList:JSON.stringify(this.overdueList)
- saveoverdueList: this.overdueList
- }).then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result淇濆瓨 = ' + JSON.stringify(result));
- if (result.status == 'Success') {
- this[NavigationMixin.Navigate]({
- type: 'standard__recordPage',
- attributes: {
- recordId: result.entity.Id,
- objectApiName: 'Consumable_order__c',
- actionName: 'view'
- }
- });
- this.showSpinner = false;
- } else {
- this.showMyToast('閿�瀛樺け璐�', result.msg, 'error');
- this.showSpinner = false;
-
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- this.showSpinner = false;
- });
- }
-
- showMyToast(title, message, variant) {
- console.log('show custom message');
- var iconName = '';
- var content = '';
- if (variant == 'success') {
- iconName = 'utility:check';
- } else {
- iconName = 'utility:error';
+ save({
+ iSinventory: this.iSinventory,
+ saveCodPageRecords: JSON.stringify(this.data),
+ // saveoverdueList:JSON.stringify(this.overdueList)
+ saveoverdueList: this.overdueList
+ })
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result淇濆瓨 = ' + JSON.stringify(result));
+ if (result.status == 'Success') {
+ this[NavigationMixin.Navigate]({
+ type: 'standard__recordPage',
+ attributes: {
+ recordId: result.entity.Id,
+ objectApiName: 'Consumable_order__c',
+ actionName: 'view'
+ }
+ });
+ this.showSpinner = false;
+ } else {
+ this.showMyToast('閿�瀛樺け璐�', result.msg, 'error');
+ this.showSpinner = false;
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showSpinner = false;
+ });
}
- if (message != '') {
- content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
- } else {
- content = '<h2><strong>' + title + '<strong/></h2>';
- }
- this.template.querySelector('c-common-toast').showToast(variant, content, iconName, 10000);
- }
+ showMyToast(title, message, variant) {
+ console.log('show custom message');
+ var iconName = '';
+ var content = '';
+ if (variant == 'success') {
+ iconName = 'utility:check';
+ } else {
+ iconName = 'utility:error';
+ }
+ if (message != '') {
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
+ } else {
+ content = '<h2><strong>' + title + '<strong/></h2>';
+ }
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
+ }
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.html b/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.html
index b6a3c31..4dd6031 100644
--- a/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.html
+++ b/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.html
@@ -2,9 +2,21 @@
<template if:true={showSpinner}>
<lightning-spinner size="medium" variant="brand"></lightning-spinner>
</template>
- <c-common-toast></c-common-toast>
- <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;">
+ <c-common-toast></c-common-toast>
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
<!-- <p style="font-size: 18px;"><strong>缁忛攢鍟嗗簱瀛樹笂涓嬮檺缂栬緫</strong></p> -->
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -14,69 +26,142 @@
</lightning-layout-item>
</lightning-layout>
- <table class="slds-table slds-table_cell-buffer slds-table_bordered">
+ <table
+ class="slds-table slds-table_cell-buffer slds-table_bordered"
+ >
<thead>
<tr class="">
<!-- <th class="slds-size_3-of-10" scope="col">
<div class="slds-truncate" title="Name">S.No</div>
</th> -->
<th scope="col" align="center">
- <div class="slds-truncate" style="font-size:16px;" title="Name">浜у搧鍨嬪彿</div>
- </th>
- <th scope="col">
- <div class="slds-truncate" style="font-size:16px;" title="First Name">
- 搴撳瓨涓嬮檺
+ <div
+ class="slds-truncate"
+ style="font-size: 16px"
+ title="Name"
+ >
+ 浜у搧鍨嬪彿
</div>
</th>
<th scope="col">
- <div class="slds-truncate" style="font-size:16px;" title="Last Name">搴撳瓨涓婇檺</div>
+ <div
+ class="slds-truncate"
+ style="font-size: 16px"
+ title="First Name"
+ >
+ 搴撳瓨涓嬮檺
+ </div>
</th>
<th scope="col">
- <div class="slds-truncate" style="font-size:16px;" title="Last Name">鎿嶄綔</div>
+ <div
+ class="slds-truncate"
+ style="font-size: 16px"
+ title="Last Name"
+ >
+ 搴撳瓨涓婇檺
+ </div>
+ </th>
+ <th scope="col">
+ <div
+ class="slds-truncate"
+ style="font-size: 16px"
+ title="Last Name"
+ >
+ 鎿嶄綔
+ </div>
</th>
</tr>
</thead>
<tbody>
- <template for:each = {invRecords} for:item = "inv" for:index="indexVar">
+ <template
+ for:each={invRecords}
+ for:item="inv"
+ for:index="indexVar"
+ >
<tr key={inv.key} class="slds-hint-parent">
<td>
<div>
- <lightning-input key={inv.key} data-id={inv.key} data-index={indexVar} name="productNumber" label="productNumber" value={inv.productNumber} variant="label-hidden" onchange={handleProductChange}></lightning-input>
+ <lightning-input
+ key={inv.key}
+ data-id={inv.key}
+ data-index={indexVar}
+ name="productNumber"
+ label="productNumber"
+ value={inv.productNumber}
+ variant="label-hidden"
+ onchange={handleProductChange}
+ ></lightning-input>
</div>
</td>
<td>
<div>
- <lightning-input key={inv.key} data-id={inv.key} data-index={indexVar} name="inventory1" label="inventory1" value={inv.inventory1} variant="label-hidden" onchange={handleProductChange}></lightning-input>
+ <lightning-input
+ key={inv.key}
+ data-id={inv.key}
+ data-index={indexVar}
+ name="inventory1"
+ label="inventory1"
+ value={inv.inventory1}
+ variant="label-hidden"
+ onchange={handleProductChange}
+ ></lightning-input>
</div>
</td>
<td>
<div>
- <lightning-input key={inv.key} data-id={inv.key} data-index={indexVar} name="inventory2" label="inventory2" value={inv.inventory2} variant="label-hidden" onchange={handleProductChange}></lightning-input>
+ <lightning-input
+ key={inv.key}
+ data-id={inv.key}
+ data-index={indexVar}
+ name="inventory2"
+ label="inventory2"
+ value={inv.inventory2}
+ variant="label-hidden"
+ onchange={handleProductChange}
+ ></lightning-input>
</div>
</td>
<td>
- <a name={indexVar} data-id={inv.key} onclick={removeRow}>
- <lightning-icon icon-name="utility:delete" alternative-text="delete" size="small"></lightning-icon>
+ <a
+ name={indexVar}
+ data-id={inv.key}
+ onclick={removeRow}
+ >
+ <lightning-icon
+ icon-name="utility:delete"
+ alternative-text="delete"
+ size="small"
+ ></lightning-icon>
</a>
</td>
</tr>
</template>
- <tr>
+ <tr>
<td></td>
<td>
<!-- <lightning-button label="琛屽鍔�" onclick={addRow} class="slds-m-left_x-small lexBorder"></lightning-button> -->
- <button class="slds-m-left_x-small slds-button slds-button_neutral slds-button_stretch lexBorder" label="琛屽鍔�" onclick={addRow}>琛屽鍔�</button>
+ <button
+ class="slds-m-left_x-small slds-button slds-button_neutral slds-button_stretch lexBorder"
+ label="琛屽鍔�"
+ onclick={addRow}
+ >
+ 琛屽鍔�
+ </button>
</td>
- <td>
+ <td>
<!-- <lightning-button label="淇濆瓨" onclick={handleClick} class="slds-m-left_x-small lexBorder"></lightning-button> -->
- <button class="slds-m-left_x-small slds-button slds-button_neutral slds-button_stretch lexBorder" label="淇濆瓨" onclick={handleClick}>淇濆瓨</button>
+ <button
+ class="slds-m-left_x-small slds-button slds-button_neutral slds-button_stretch lexBorder"
+ label="淇濆瓨"
+ onclick={handleClick}
+ >
+ 淇濆瓨
+ </button>
</td>
<td></td>
-
</tr>
</tbody>
- </table>
-
+ </table>
</div>
- </div>
+ </div>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.js b/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.js
index 025f40b..c0fea80 100644
--- a/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.js
+++ b/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.js
@@ -1,9 +1,11 @@
import { LightningElement, wire, api, track } from 'lwc';
-import oninit from "@salesforce/apex/LexProductLimitEditController.init";
-import save from "@salesforce/apex/LexUpAccountProLimit.upAccount";
+import oninit from '@salesforce/apex/LexProductLimitEditController.init';
+import save from '@salesforce/apex/LexUpAccountProLimit.upAccount';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
-import { NavigationMixin } from "lightning/navigation";
-export default class LexProductLimitEdit extends NavigationMixin(LightningElement) {
+import { NavigationMixin } from 'lightning/navigation';
+export default class LexProductLimitEdit extends NavigationMixin(
+ LightningElement
+) {
@track invRecords = [];
@track accountid;
@track upstring = '';
@@ -11,8 +13,8 @@
@track showSpinner = true;
//鑾峰彇閾炬帴鍙傛暟
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]);
@@ -24,47 +26,48 @@
this.showSpinner = true;
console.log(' === connectedCallback === ');
//鑾峰彇accountid userPro_Type
- this.accountid = this.getQueryString("accountid");
- this.accountid = this.accountid == null ? "" : this.accountid;
- this.userPro_Type = this.getQueryString("userPro_Type");
- this.userPro_Type = this.userPro_Type == null ? "" : this.userPro_Type;
+ this.accountid = this.getQueryString('accountid');
+ this.accountid = this.accountid == null ? '' : this.accountid;
+ this.userPro_Type = this.getQueryString('userPro_Type');
+ this.userPro_Type = this.userPro_Type == null ? '' : this.userPro_Type;
//鑾峰彇鏁版嵁
oninit({
accountid: this.accountid,
userPro_Type: this.userPro_Type
-
- }).then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result' + JSON.stringify(result));
- if (result.status == 'Success') {
- console.log('11===>' + result.entity.product_Limit);
- console.log('11===>' + typeof (result.entity.product_Limit));
- let str = result.entity.product_Limit;
- var arr = str.split(',');
- console.log('arr==>' + arr);
- console.log('arr==>' + arr.length);
- console.log('arr==>' + typeof (arr));
- for (var i in arr) {
- var arry = arr[i].split('|');
- this.invRecords.push({
- productNumber: arry[0],
- inventory1: arry[1],
- inventory2: arry[2]
- });
+ })
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result' + JSON.stringify(result));
+ if (result.status == 'Success') {
+ console.log('11===>' + result.entity.product_Limit);
+ console.log('11===>' + typeof result.entity.product_Limit);
+ let str = result.entity.product_Limit;
+ var arr = str.split(',');
+ console.log('arr==>' + arr);
+ console.log('arr==>' + arr.length);
+ console.log('arr==>' + typeof arr);
+ for (var i in arr) {
+ var arry = arr[i].split('|');
+ this.invRecords.push({
+ productNumber: arry[0],
+ inventory1: arry[1],
+ inventory2: arry[2]
+ });
+ }
+ this.showSpinner = false;
+ console.log(
+ 'this.invRecords' + JSON.stringify(this.invRecords)
+ );
+ } else {
+ this.showSpinner = false;
+ console.log('error = ' + JSON.stringify(error));
}
+ })
+ .catch((error) => {
this.showSpinner = false;
- console.log('this.invRecords' + JSON.stringify(this.invRecords));
- } else {
- this.showSpinner = false;
- console.log("error = " + JSON.stringify(error));
-
- }
- }).catch((error) => {
- this.showSpinner = false;
- console.log("error = " + JSON.stringify(error));
- });
+ console.log('error = ' + JSON.stringify(error));
+ });
// this.inventoryTempRecords();
-
}
addRow() {
@@ -73,7 +76,7 @@
inventory1: '',
inventory2: '',
id: ++this.keyIndex
- }
+ };
this.invRecords = [...this.invRecords, Object.create(objRow)];
}
removeRow(event) {
@@ -89,30 +92,59 @@
console.log('淇濆瓨');
console.log('this.invRecords' + JSON.stringify(this.invRecords));
for (var i in this.invRecords) {
- console.log('inven1' + this.invRecords[i]["inventory1"]);
- console.log('鏁板瓧1' + this.isNum(this.invRecords[i]["inventory1"]));
- console.log('inven2' + this.invRecords[i]["inventory2"]);
- console.log('鏁板瓧2' + this.isNum(this.invRecords[i]["inventory2"]));
- if (this.invRecords[i]["inventory1"] == '' || this.invRecords[i]["inventory1"] == null || this.invRecords[i]["inventory2"] == null || this.invRecords[i]["inventory2"] == '') {
- this.showMyToast('淇濆瓨澶辫触', '杈撳叆鏍煎紡涓嶆纭�,璇疯緭鍏ユ暟瀛�', 'error');
+ console.log('inven1' + this.invRecords[i]['inventory1']);
+ console.log('鏁板瓧1' + this.isNum(this.invRecords[i]['inventory1']));
+ console.log('inven2' + this.invRecords[i]['inventory2']);
+ console.log('鏁板瓧2' + this.isNum(this.invRecords[i]['inventory2']));
+ if (
+ this.invRecords[i]['inventory1'] == '' ||
+ this.invRecords[i]['inventory1'] == null ||
+ this.invRecords[i]['inventory2'] == null ||
+ this.invRecords[i]['inventory2'] == ''
+ ) {
+ this.showMyToast(
+ '淇濆瓨澶辫触',
+ '杈撳叆鏍煎紡涓嶆纭�,璇疯緭鍏ユ暟瀛�',
+ 'error'
+ );
this.showSpinner = false;
return;
}
- if( this.isNum(this.invRecords[i]["inventory1"]) == false || this.isNum(this.invRecords[i]["inventory2"]) == false){
- this.showMyToast('淇濆瓨澶辫触', '杈撳叆鏍煎紡涓嶆纭�,璇疯緭鍏ユ暟瀛�', 'error');
+ if (
+ this.isNum(this.invRecords[i]['inventory1']) == false ||
+ this.isNum(this.invRecords[i]['inventory2']) == false
+ ) {
+ this.showMyToast(
+ '淇濆瓨澶辫触',
+ '杈撳叆鏍煎紡涓嶆纭�,璇疯緭鍏ユ暟瀛�',
+ 'error'
+ );
this.showSpinner = false;
return;
-
}
- if (Number(this.invRecords[i]["inventory1"]) > Number(this.invRecords[i]["inventory2"])) {
- this.showMyToast('淇濆瓨澶辫触', this.invRecords[i]["productNumber"] + '搴撳瓨涓嬮檺澶т簬涓婇檺', 'error');
+ if (
+ Number(this.invRecords[i]['inventory1']) >
+ Number(this.invRecords[i]['inventory2'])
+ ) {
+ this.showMyToast(
+ '淇濆瓨澶辫触',
+ this.invRecords[i]['productNumber'] + '搴撳瓨涓嬮檺澶т簬涓婇檺',
+ 'error'
+ );
this.showSpinner = false;
return;
}
}
- let dataStr = ''
+ let dataStr = '';
for (var i in this.invRecords) {
- dataStr = dataStr + this.invRecords[i]["productNumber"] + '|' + this.invRecords[i]["inventory1"] + '|' + this.invRecords[i]["inventory2"] + ',';
+ dataStr =
+ dataStr +
+ this.invRecords[i]['productNumber'] +
+ '|' +
+ this.invRecords[i]['inventory1'] +
+ '|' +
+ this.invRecords[i]['inventory2'] +
+ ',';
}
console.log('dataStr==>' + dataStr);
this.upstring = dataStr.substring(0, dataStr.lastIndexOf(','));
@@ -121,26 +153,26 @@
accountId: this.accountid,
productLimit: this.upstring,
userPro_Type: this.userPro_Type
- }).then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result===>' + JSON.stringify(result));
- if (result.status == 'Success') {
- this.showMyToast('淇濆瓨鎴愬姛', '', 'success');
+ })
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result===>' + JSON.stringify(result));
+ if (result.status == 'Success') {
+ this.showMyToast('淇濆瓨鎴愬姛', '', 'success');
+ this.showSpinner = false;
+ // setTimeout(this.toLexToppage(),5000 );
+ setTimeout(() => {
+ this.toLexToppage();
+ }, 500);
+ } else {
+ this.showMyToast('淇濆瓨澶辫触', result.msg, 'error');
+ this.showSpinner = false;
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
this.showSpinner = false;
- // setTimeout(this.toLexToppage(),5000 );
- setTimeout(() => {
- this.toLexToppage();
- }, 500);
-
- } else {
- this.showMyToast('淇濆瓨澶辫触', result.msg, 'error');
- this.showSpinner = false;
-
- }
- }).catch((error) => {
- console.log("error = " + JSON.stringify(error));
- this.showSpinner = false;
- });
+ });
this.inventoryTempRecords();
console.log('Save ==> ' + JSON.stringify(toSaveList));
@@ -148,15 +180,16 @@
handleProductChange(event) {
if (event.target.name == 'productNumber') {
- this.invRecords[event.currentTarget.dataset.index].productNumber = event.target.value;
+ this.invRecords[event.currentTarget.dataset.index].productNumber =
+ event.target.value;
console.log('===>invrecords' + JSON.stringify(this.invRecords));
- }
- else if (event.target.name == 'inventory1') {
- this.invRecords[event.currentTarget.dataset.index].inventory1 = event.target.value;
+ } else if (event.target.name == 'inventory1') {
+ this.invRecords[event.currentTarget.dataset.index].inventory1 =
+ event.target.value;
console.log('===>invrecords' + JSON.stringify(this.invRecords));
- }
- else if (event.target.name == 'inventory2') {
- this.invRecords[event.currentTarget.dataset.index].inventory2 = event.target.value;
+ } else if (event.target.name == 'inventory2') {
+ this.invRecords[event.currentTarget.dataset.index].inventory2 =
+ event.target.value;
console.log('===>invrecords' + JSON.stringify(this.invRecords));
}
}
@@ -164,7 +197,7 @@
//鏁板瓧楠岃瘉
isNum(num) {
var reNum = /^[0-9]+$/;
- return (reNum.test(num));
+ return reNum.test(num);
}
showMyToast(title, message, variant) {
console.log('show custom message');
@@ -176,11 +209,18 @@
iconName = 'utility:error';
}
if (message != '') {
- content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
} else {
content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template.querySelector('c-common-toast').showToast(variant, content, iconName, 10000);
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
}
toLexToppage() {
this[NavigationMixin.Navigate]({
diff --git a/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html b/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html
index b8546a2..9a67917 100644
--- a/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html
+++ b/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html
@@ -1,141 +1,231 @@
<template>
- <template if:true={showSpinner}>
- <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
- <div class="slds-spinner_container">
- <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
- <span class="slds-assistive-text">Loading</span>
- <div class="slds-spinner__dot-a"></div>
- <div class="slds-spinner__dot-b"></div>
- </div>
- </div>
- </template>
- <c-common-toast></c-common-toast>
- <div style="border: 1px solid #D4D4D4;border-radius:5px;">
+ <template if:true={showSpinner}>
+ <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
+ <div class="slds-spinner_container">
+ <div
+ role="status"
+ class="slds-spinner slds-spinner_medium slds-spinner_brand"
+ >
+ <span class="slds-assistive-text">Loading</span>
+ <div class="slds-spinner__dot-a"></div>
+ <div class="slds-spinner__dot-b"></div>
+ </div>
+ </div>
+ </template>
+ <c-common-toast></c-common-toast>
+ <div style="border: 1px solid #d4d4d4; border-radius: 5px">
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
+ <div>
+ <!-- <p style="font-size: 18px;"><strong>鎷嗙洅</strong></p> -->
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>鎷嗙洅</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </div>
+ </div>
+ <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>-->
+ <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;
+ "
+ >
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 16px">
+ <strong>BarCode褰曞叆</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </div>
- <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>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>鎷嗙洅</strong>
- </p>
- </lightning-layout-item>
- </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;">
- <!-- <lightning-button variant="brand" class='lexstyle' style="margin-left:10px;" label="鎷嗙洅纭" title="鎷嗙洅纭" onclick={saveConfirm}></lightning-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;">
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 16px">
- <strong>BarCode褰曞叆</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </div>
-
- <!-- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;"> -->
- <table>
- <colgroup>
- <col width="160px" />
- <col width="100px" />
- <col width="10px" />
- <col width="70px" />
- <col width="100px" />
- <col width="10px" />
- <col width="90px" />
- <col width="100px" />
- <col width="10px" />
- <col width="85px" />
- <col width="100px" />
- <col width="10px" />
- <col width="70px" />
- <col width="100px" />
- </colgroup>
- <tbody>
- <tr>
- <td></td>
- <td align="right" class="searchName">BarCode</td>
- <td style="width:600px"><lightning-textarea class="inputFont" name="BarCode" label=""
- onchange={handleChange}></lightning-textarea></td>
- <td align="right"></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>
- <!-- <lightning-button variant="brand" class='lexstyle' label="鑾峰彇鏄庣粏" title="鑾峰彇鏄庣粏" onclick={getDetails}
- ></lightning-button> -->
- </td>
- </tr>
- </tbody>
- </table>
- <!-- </div> -->
- </div>
+ <!-- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;"> -->
+ <table>
+ <colgroup>
+ <col width="160px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="70px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="90px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="85px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="70px" />
+ <col width="100px" />
+ </colgroup>
+ <tbody>
+ <tr>
+ <td></td>
+ <td align="right" class="searchName">BarCode</td>
+ <td style="width: 600px">
+ <lightning-textarea
+ class="inputFont"
+ name="BarCode"
+ label=""
+ onchange={handleChange}
+ ></lightning-textarea>
+ </td>
+ <td align="right"></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>
+ <!-- <lightning-button variant="brand" class='lexstyle' label="鑾峰彇鏄庣粏" title="鑾峰彇鏄庣粏" onclick={getDetails}
+ ></lightning-button> -->
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <!-- </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;">
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>鎷嗙洅鏄庣粏</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </div>
- <div style="padding:10px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ margin-top: 10px;
+ "
+ >
+ <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">
+ <strong>鎷嗙洅鏄庣粏</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </div>
+ <div style="padding: 10px">
+ <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"
+ >
+ </lightning-datatable>
+ </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;
+ "
+ >
+ <table>
+ <tr>
+ <td>
+ <lightning-layout>
+ <lightning-layout-item
+ padding="around-small"
+ >
+ <p style="font-size: 18px">
+ <strong>閿欒鏄庣粏</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </td>
+ </tr>
+ </table>
+ </div>
- <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; ">
- </lightning-datatable>
- </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;">
- <table>
- <tr>
- <td>
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>閿欒鏄庣粏</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </td>
- </tr>
- </table>
- </div>
+ <div style="padding: 10px">
+ <!-- <template if:true={showTables}> -->
- <div style="padding:10px;">
- <!-- <template if:true={showTables}> -->
-
- <!-- <c-lex-custom-lightning-datatable key-field="id" data={errorDetail} columns={column}
- onrowselection={getSelectedRows} hide-checkbox-column="true"
- selected-rows={selectedRows}>
- </c-lex-custom-lightning-datatable> -->
- <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; ">
- </lightning-datatable>
- <!-- </template> -->
-
-
- </div>
- </div>
- </div>
-
-
-
- </div>
-
+ <!-- <c-lex-custom-lightning-datatable key-field="id" data={errorDetail} columns={column}
+ onrowselection={getSelectedRows} hide-checkbox-column="true"
+ selected-rows={selectedRows}>
+ </c-lex-custom-lightning-datatable> -->
+ <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"
+ >
+ </lightning-datatable>
+ <!-- </template> -->
+ </div>
+ </div>
+ </div>
+ </div>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js b/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js
index 440d3e2..2620c5f 100644
--- a/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js
+++ b/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js
@@ -4,248 +4,253 @@
import saveconfirm from '@salesforce/apex/LexRemoveBoxController.removeBoxConfirm';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
// import { NavigationMixin } from 'lightning/navigation';
-//table css
-import { loadStyle } from "lightning/platformResourceLoader";
-import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
+//table css
+import { loadStyle } from 'lightning/platformResourceLoader';
+import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
const columns = [
- {
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'Name__c',
- wrapText:true,
- hideDefaultActions: true,
- // initialWidth: 400,
-
- },
- {
- label: '瑙勬牸',
- fieldName: 'ProductPacking_list_manual__c',
- hideDefaultActions: true,
- initialWidth: 50,
- cellAttributes: { alignment: "right" },
-
-
- },
- {
- label: 'CFDA鐘舵��',
- fieldName: 'CFDA_Status__c',
- hideDefaultActions: true,
- initialWidth: 100,
- wrapText:true,
-
- },
- {
- label: '娉ㄥ唽璇佺紪鐮佸彿',
- fieldName: 'Report_Product_Approbation__c',
- hideDefaultActions: true,
- initialWidth: 200,
- wrapText:true,
- },
- {
- label: '娉ㄥ唽璇佹晥鏈�',
- fieldName: 'Report_Product_Expiration__c',
- hideDefaultActions: true,
- initialWidth: 110,
- wrapText:true,
- },
- {
- label: 'BarCode',
- fieldName: 'Bar_Code__c',
- hideDefaultActions: true,
- wrapText:true,
- // initialWidth:600,
- }
+ {
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'Name__c',
+ wrapText: true,
+ hideDefaultActions: true
+ // initialWidth: 400,
+ },
+ {
+ label: '瑙勬牸',
+ fieldName: 'ProductPacking_list_manual__c',
+ hideDefaultActions: true,
+ initialWidth: 50,
+ cellAttributes: { alignment: 'right' }
+ },
+ {
+ label: 'CFDA鐘舵��',
+ fieldName: 'CFDA_Status__c',
+ hideDefaultActions: true,
+ initialWidth: 100,
+ wrapText: true
+ },
+ {
+ label: '娉ㄥ唽璇佺紪鐮佸彿',
+ fieldName: 'Report_Product_Approbation__c',
+ hideDefaultActions: true,
+ initialWidth: 200,
+ wrapText: true
+ },
+ {
+ label: '娉ㄥ唽璇佹晥鏈�',
+ fieldName: 'Report_Product_Expiration__c',
+ hideDefaultActions: true,
+ initialWidth: 110,
+ wrapText: true
+ },
+ {
+ label: 'BarCode',
+ fieldName: 'Bar_Code__c',
+ hideDefaultActions: true,
+ wrapText: true
+ // initialWidth:600,
+ }
];
const column = [
- {
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'Name__c',
- hideDefaultActions: true,
- wrapText:true,
-
- },
- {
- label: 'BarCode',
- fieldName: 'Bar_Code__c',
- hideDefaultActions: true,
- wrapText:true,
- // initialWidth:600,
-
-
- }
- ,
- {
- label: '閿欒鍘熷洜',
- fieldName: 'ErrorReason',
- hideDefaultActions: true,
- wrapText:true,
- }
+ {
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'Name__c',
+ hideDefaultActions: true,
+ wrapText: true
+ },
+ {
+ label: 'BarCode',
+ fieldName: 'Bar_Code__c',
+ hideDefaultActions: true,
+ wrapText: true
+ // initialWidth:600,
+ },
+ {
+ label: '閿欒鍘熷洜',
+ fieldName: 'ErrorReason',
+ hideDefaultActions: true,
+ wrapText: true
+ }
];
-
-
-
export default class LexRemoveBox extends LightningElement {
- columns = columns;
- column = column;
- @track selectedRows = [];
- @track data = [];
- @track errorDetail = [];
+ columns = columns;
+ column = column;
+ @track selectedRows = [];
+ @track data = [];
+ @track errorDetail = [];
- // 鏄剧ず
- @track showTable = false
- @track accountName
- @track userWorkLocation
- @track agencyProType
- @track barcode = ''
- @track saveFLGbln = false
- @track dataSize = 0;
+ // 鏄剧ず
+ @track showTable = false;
+ @track accountName;
+ @track userWorkLocation;
+ @track agencyProType;
+ @track barcode = '';
+ @track saveFLGbln = false;
+ @track dataSize = 0;
- //鍔犺浇妗�
- @track showSpinner = false
+ //鍔犺浇妗�
+ @track showSpinner = false;
- renderedCallback() {
- if (!this.stylesLoaded) {
- Promise.all([loadStyle(this, WrappedHeaderTable)])
- .then(() => {
- console.log("Custom styles loaded");
- this.stylesLoaded = true;
+ renderedCallback() {
+ if (!this.stylesLoaded) {
+ Promise.all([loadStyle(this, WrappedHeaderTable)])
+ .then(() => {
+ console.log('Custom styles loaded');
+ this.stylesLoaded = true;
+ })
+ .catch((error) => {
+ console.error('Error loading custom styles');
+ });
+ }
+ }
+
+ //鍒濆鍖�
+ connectedCallback() {
+ console.log('鍒濆鍖�');
+ this.showTable = false;
+
+ init()
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result =' + JSON.stringify(result));
+ if ((result.status = 'Success')) {
+ console.log('result');
+ this.agencyProType = result.entity.agencyProType;
+ this.userWorkLocation = result.entity.userWorkLocation;
+ this.accountName = result.entity.accountName;
+ // this.data = JSON.parse(result.entity.codPageRecords);
+ // this.showTable = true;
+ } else {
+ this.showMyToast('鍒濆鍖栧け璐�', result.msg, 'error');
+ }
})
.catch((error) => {
- console.error("Error loading custom styles");
+ console.log('error = ' + JSON.stringify(error));
});
}
-}
-
- //鍒濆鍖�
- connectedCallback() {
- console.log('鍒濆鍖�');
- this.showTable = false;
-
- init().then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result =' + JSON.stringify(result));
- if (result.status = 'Success') {
- console.log('result');
- this.agencyProType = result.entity.agencyProType;
- this.userWorkLocation = result.entity.userWorkLocation;
- this.accountName = result.entity.accountName;
- // this.data = JSON.parse(result.entity.codPageRecords);
- // this.showTable = true;
- } else {
- this.showMyToast('鍒濆鍖栧け璐�',result.msg,'error');
- }
- }).catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- });
- }
- //褰曞叆
- getDetails() {
- searchDeatail({
- accountName: this.accountName,
- userWorkLocation: this.userWorkLocation,
- agencyProType: this.agencyProType,
- barcode: this.barcode
- }).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.dataSize = result.entity.dataSize;
- console.log('this.dataSize'+this.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;
- }
- 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.showTables = true;
- this.showTable = true;
- } else{
- console.log('result.msg = ' + result.msg);
- this.showMyToast('鑾峰彇澶辫触',result.msg,'error');
- }
- }).catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- });
-
- }
- //鑾峰彇褰撳墠杈撳叆鍊�
- handleChange(event) {
- let value = event.detail.value;
- console.log('value' + value);
- this.barcode = value;
- console.log('this.barcode' + this.barcode);
- }
- saveConfirm() {
- console.log('杩涘叆纭');
- let msg = "纭鎷嗙洅鍚�";
- if (this.dataSize>0) {
- if (confirm(msg) == true) {
+ //褰曞叆
+ getDetails() {
+ searchDeatail({
+ accountName: this.accountName,
+ userWorkLocation: this.userWorkLocation,
+ agencyProType: this.agencyProType,
+ barcode: this.barcode
+ })
+ .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.dataSize = result.entity.dataSize;
+ console.log('this.dataSize' + this.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;
+ }
+ 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.showTables = true;
+ this.showTable = true;
+ } else {
+ console.log('result.msg = ' + result.msg);
+ this.showMyToast('鑾峰彇澶辫触', result.msg, 'error');
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ });
+ }
+ //鑾峰彇褰撳墠杈撳叆鍊�
+ handleChange(event) {
+ let value = event.detail.value;
+ console.log('value' + value);
+ this.barcode = value;
+ console.log('this.barcode' + this.barcode);
+ }
+ saveConfirm() {
+ console.log('杩涘叆纭');
+ let msg = '纭鎷嗙洅鍚�';
+ if (this.dataSize > 0) {
+ if (confirm(msg) == true) {
+ this.removeBox();
+ }
+ } else {
this.removeBox();
}
- } else {
- this.removeBox();
}
-
- }
- removeBox(){
- this.showSpinner = true;
- saveconfirm({
- saveConsumableorderdetailsRecordsdummy: JSON.stringify(this.data),
- accountName: this.accountName,
- userWorkLocation: this.userWorkLocation,
- agencyProType: this.agencyProType
- }).then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result淇濆瓨 = ' + JSON.stringify(result));
- if (result.status == 'Success') {
- this.saveFLGbln = result.entity.saveFLGbln;
- // this.showSpinner = false;
- if(this.saveFLGbln){
- this.showMyToast(result.msg,'','success');
- this.showSpinner = false;
- }
- } else {
- console.log('result.msg = ' + result.msg);
- this.showMyToast('鎷嗙洅澶辫触',result.msg,'error');
- this.showSpinner = false;
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- });
-
-
- }
- showMyToast(title, message, variant) {
- console.log('show custom message');
- var iconName = '';
- var content = '';
- if(variant == 'success'){
- iconName = 'utility:check';
- }else{
- iconName = 'utility:error';
+ removeBox() {
+ this.showSpinner = true;
+ saveconfirm({
+ saveConsumableorderdetailsRecordsdummy: JSON.stringify(this.data),
+ accountName: this.accountName,
+ userWorkLocation: this.userWorkLocation,
+ agencyProType: this.agencyProType
+ })
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result淇濆瓨 = ' + JSON.stringify(result));
+ if (result.status == 'Success') {
+ this.saveFLGbln = result.entity.saveFLGbln;
+ // this.showSpinner = false;
+ if (this.saveFLGbln) {
+ this.showMyToast(result.msg, '', 'success');
+ this.showSpinner = false;
+ }
+ } else {
+ console.log('result.msg = ' + result.msg);
+ this.showMyToast('鎷嗙洅澶辫触', result.msg, 'error');
+ this.showSpinner = false;
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ });
}
- if(message != ''){
- content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
- }else{
- content = '<h2><strong>'+title+'<strong/></h2>';
+ showMyToast(title, message, variant) {
+ console.log('show custom message');
+ var iconName = '';
+ var content = '';
+ if (variant == 'success') {
+ iconName = 'utility:check';
+ } else {
+ iconName = 'utility:error';
+ }
+ if (message != '') {
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
+ } else {
+ content = '<h2><strong>' + title + '<strong/></h2>';
+ }
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
}
- this.template.querySelector('c-common-toast').showToast(variant,content,iconName,10000);
- }
-
-
-
-
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.html b/force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.html
index 848a41b..f30bfdf 100644
--- a/force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.html
+++ b/force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.html
@@ -1,10 +1,18 @@
<template>
<template if:true={showInputOrText}>
- <lightning-input type="number" variant="label-hidden" value={inputValue} onchange={changeInputValue}></lightning-input>
+ <lightning-input
+ type="number"
+ variant="label-hidden"
+ value={inputValue}
+ onchange={changeInputValue}
+ ></lightning-input>
</template>
<template if:false={showInputOrText}>
- <div style="text-align: right;">
- <lightning-formatted-number style="margin-left: 10px;" value={inputValue}></lightning-formatted-number>
+ <div style="text-align: right">
+ <lightning-formatted-number
+ style="margin-left: 10px"
+ value={inputValue}
+ ></lightning-formatted-number>
</div>
</template>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.js b/force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.js
index 84d7bf9..81d837e 100644
--- a/force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.js
+++ b/force-app/main/default/lwc/lexReturnGoodCusInput/lexReturnGoodCusInput.js
@@ -1,31 +1,37 @@
-import { LightningElement,api,track } from 'lwc';
+import { LightningElement, api, track } from 'lwc';
export default class LexReturnGoodCusInput extends LightningElement {
@api boxPrice;
@api inputValue;
@api recordId;
- get showInputOrText(){
- if(this.boxPrice == '鐩�'){
+ get showInputOrText() {
+ if (this.boxPrice == '鐩�') {
return false;
- }else{
+ } else {
return true;
}
}
- connectedCallback(){
- console.log('inputValue:'+this.inputValue+this.boxPrice);
+ connectedCallback() {
+ console.log('inputValue:' + this.inputValue + this.boxPrice);
}
- changeInputValue(event){
+ changeInputValue(event) {
this.inputValue = event.detail.value;
- this.dispatchEvent(new CustomEvent('changereturncount', {
- composed: true,
- bubbles: true,
- cancelable: true,
- detail: {
- data: { value: this.inputValue, boxPrice: this.boxPrice, recordId:this.recordId}
- }
- }));
+ this.dispatchEvent(
+ new CustomEvent('changereturncount', {
+ composed: true,
+ bubbles: true,
+ cancelable: true,
+ detail: {
+ data: {
+ value: this.inputValue,
+ boxPrice: this.boxPrice,
+ recordId: this.recordId
+ }
+ }
+ })
+ );
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html b/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html
index d2c33e0..5f770e0 100644
--- a/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html
+++ b/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html
@@ -8,6 +8,7 @@
<div style="padding: 15px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
+
<!-- <div class="slds-m-top_small slds-m-bottom_medium"> -->
<!-- <lightning-button label="鏂板缓鍑哄簱鍗�" onclick={neworderhead}
class="slds-m-left_x-small" disabled></lightning-button>
@@ -28,22 +29,33 @@
<lightning-layout multiple-rows>
<lightning-layout-item size="6">
<div class="slds-text-align_center">
- <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 lexBorder lexBorderWidth"
- onclick={neworderhead}>
+ onclick={neworderhead}
+ >
鏂板缓鍑哄簱鍗�
</button>
聽
- <div class="slds-form-element__label searchName" style="visibility: hidden">
+ <div
+ class="slds-form-element__label searchName"
+ style="visibility: hidden"
+ >
鍑哄簱鏃� 浠�
</div>
- <div class="slds-form-element__label searchName" style="visibility: hidden">
+ <div
+ class="slds-form-element__label searchName"
+ style="visibility: hidden"
+ >
 鍒�
</div>
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder lexBorderWidth"
- onclick={editProductLimit} style="margin-left: 4px;">
+ onclick={editProductLimit}
+ style="margin-left: 4px"
+ >
涓婁紶宸插嚭搴撲竴瑙�
</button>
</div>
@@ -73,26 +85,46 @@
<div class="slds-text-align_center">
<lightning-layout multiple-rows>
<lightning-layout-item size="6">
- <div class="slds-grid slds-grid_vertical-align-center">
- <div class="slds-form-element__label searchName">
+ <div
+ class="slds-grid slds-grid_vertical-align-center"
+ >
+ <div
+ class="slds-form-element__label searchName"
+ >
鍑哄簱鏃� 浠�
</div>
- <lightning-input type="date" variant="label-hidden" label="鍑哄簱鏃� 浠�"
- onchange={dataChange} data-field="deliveryFromDate"
- value={deliveryFromDate} class="inputFont"
- style="max-width: 150px;"></lightning-input>
+ <lightning-input
+ type="date"
+ variant="label-hidden"
+ label="鍑哄簱鏃� 浠�"
+ onchange={dataChange}
+ data-field="deliveryFromDate"
+ value={deliveryFromDate}
+ class="inputFont"
+ style="max-width: 150px"
+ ></lightning-input>
</div>
</lightning-layout-item>
<lightning-layout-item size="6">
- <div class="slds-grid slds-grid_vertical-align-center">
- <div class="slds-form-element__label searchName">
+ <div
+ class="slds-grid slds-grid_vertical-align-center"
+ >
+ <div
+ class="slds-form-element__label searchName"
+ >
鍒�
</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>
</lightning-layout-item>
</lightning-layout>
@@ -101,46 +133,73 @@
<lightning-layout-item size="3">
<div class="slds-text-align_center">
- <div class="slds-grid slds-grid_vertical-align-center">
- <div class="slds-form-element__label searchName">
+ <div
+ class="slds-grid slds-grid_vertical-align-center"
+ >
+ <div
+ class="slds-form-element__label searchName"
+ >
鍑哄簱鍗曞彿
</div>
- <lightning-input variant="label-hidden" label="鍑哄簱鍗曞彿" onchange={dataChange}
- data-field="deliveryOrderNo" value={deliveryOrderNo} class="inputFont"
- style="max-width: 150px;"></lightning-input>
+ <lightning-input
+ variant="label-hidden"
+ label="鍑哄簱鍗曞彿"
+ onchange={dataChange}
+ data-field="deliveryOrderNo"
+ value={deliveryOrderNo}
+ class="inputFont"
+ style="max-width: 150px"
+ ></lightning-input>
</div>
</div>
</lightning-layout-item>
<lightning-layout-item>
<div class="slds-text-align_center">
- <div class="slds-grid slds-grid_vertical-align-center">
- <div class="slds-form-element__label searchName">
+ <div
+ class="slds-grid slds-grid_vertical-align-center"
+ >
+ <div
+ class="slds-form-element__label searchName"
+ >
瀹㈡埛鍚�
</div>
- <lightning-input variant="label-hidden" label="瀹㈡埛鍚�" onchange={dataChange}
- data-field="contactName" value={contactName} class="inputFont"
- style="max-width: 150px;"></lightning-input>
+ <lightning-input
+ variant="label-hidden"
+ label="瀹㈡埛鍚�"
+ onchange={dataChange}
+ data-field="contactName"
+ value={contactName}
+ class="inputFont"
+ style="max-width: 150px"
+ ></lightning-input>
</div>
</div>
</lightning-layout-item>
</lightning-layout>
- <lightning-layout multiple-rows style="margin-top: 20px">
+ <lightning-layout
+ multiple-rows
+ style="margin-top: 20px"
+ >
<lightning-layout-item size="6">
<lightning-layout multiple-rows>
<lightning-layout-item size="6">
<button
- class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- onclick={searchConsumableorderdetailsJs} style="min-width: 180px;">
+ class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
+ onclick={searchConsumableorderdetailsJs}
+ style="min-width: 180px"
+ >
杩樻病鍑哄簱鐨勫嚭搴撳崟
</button>
</lightning-layout-item>
<lightning-layout-item size="6">
<button
- class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- onclick={searchOrderInstatusJs} style="min-width: 215px;">
+ class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
+ onclick={searchOrderInstatusJs}
+ style="min-width: 215px"
+ >
宸插嚭搴撴湭寮�绁ㄧ殑鍑哄簱鍗�
</button>
</lightning-layout-item>
@@ -148,15 +207,21 @@
</lightning-layout-item>
<lightning-layout-item size="3">
- <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- onclick={searchConsumableorFinishJs} style="min-width: 225px">
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
+ onclick={searchConsumableorFinishJs}
+ style="min-width: 225px"
+ >
宸插嚭搴撳凡寮�绁ㄧ殑鍑哄簱鍗�
</button>
</lightning-layout-item>
<lightning-layout-item>
- <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
- onclick={clearJs} style="width: 206px;">
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
+ onclick={clearJs}
+ style="width: 206px"
+ >
娓呯┖
</button>
</lightning-layout-item>
@@ -168,12 +233,21 @@
<div class="borderCss">
<template if:true={isShowSpinner}>
<div class="slds-spinner_container">
- 聽 聽 聽 聽 聽 聽 <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
- 聽 聽 聽 聽 聽 聽 聽 聽 <span class="slds-assistive-text">Loading</span>
- 聽 聽 聽 聽 聽 聽 聽 聽 <div class="slds-spinner__dot-a"></div>
- 聽 聽 聽 聽 聽 聽 聽 聽 <div class="slds-spinner__dot-b"></div>
- 聽 聽 聽 聽 </div>
- 聽 聽 聽 聽 </div>
+ 聽 聽 聽 聽 聽 聽
+ <div
+ 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>
<div class="headerDorderCss">
<lightning-layout>
@@ -186,10 +260,17 @@
</div>
<template if:true={showTable}>
<div style="padding: 7px; height: 500px">
- <lightning-datatable key-field="id" data={data} columns={columns}
- hide-checkbox-column default-sort-direction={defaultSortDirection}
- sorted-direction={sortDirection} sorted-by={sortedBy} onsort={onHandleSort}
- class="wrapped-header-datatable">
+ <lightning-datatable
+ key-field="id"
+ data={data}
+ columns={columns}
+ hide-checkbox-column
+ default-sort-direction={defaultSortDirection}
+ sorted-direction={sortDirection}
+ sorted-by={sortedBy}
+ onsort={onHandleSort}
+ class="wrapped-header-datatable"
+ >
</lightning-datatable>
</div>
</template>
diff --git a/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js b/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js
index 17153ab..e57180a 100644
--- a/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js
+++ b/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js
@@ -1,14 +1,14 @@
import { LightningElement, wire, api, track } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
-import init from '@salesforce/apex/LexSaleAndDeliveryController.init';//cleanUp
+import init from '@salesforce/apex/LexSaleAndDeliveryController.init'; //cleanUp
import cleanUp from '@salesforce/apex/LexSaleAndDeliveryController.cleanUp';
-import { ShowToastEvent } from "lightning/platformShowToastEvent";
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import searchOrderInstatus from '@salesforce/apex/LexSaleAndDeliveryController.searchOrderInstatus';
import searchConsumableorderdetails from '@salesforce/apex/LexSaleAndDeliveryController.searchConsumableorderdetails';
import searchConsumableorFinish from '@salesforce/apex/LexSaleAndDeliveryController.searchConsumableorFinish';
-//table css
-import { loadStyle } from "lightning/platformResourceLoader";
-import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
+//table css
+import { loadStyle } from 'lightning/platformResourceLoader';
+import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
const columns = [
{
@@ -17,7 +17,7 @@
type: 'date',
hideDefaultActions: true,
sortable: true,
- wrapText: true,
+ wrapText: true
},
{
label: '鍑哄簱鍗曞彿',
@@ -31,7 +31,7 @@
},
hideDefaultActions: true,
sortable: true,
- wrapText: true,
+ wrapText: true
},
{
label: '瀹㈡埛鍚�',
@@ -44,31 +44,31 @@
label: '绉戝',
fieldName: 'Order_ForCustomerText__c',
hideDefaultActions: true,
- wrapText: true,
+ wrapText: true
},
{
label: '鍑哄簱鍗曠姸鎬�',
fieldName: 'SummonsStatus_c__c',
hideDefaultActions: true,
sortable: true,
- wrapText: true,
+ wrapText: true
},
{
label: '寮�绁ㄧ姸鎬�',
fieldName: 'Billed_Status__c',
hideDefaultActions: true,
sortable: true,
- wrapText: true,
+ wrapText: true
},
{
label: '鏈彂绁ㄩ噾棰�(鍏�)',
fieldName: 'InvoiceNotPro_money__c',
hideDefaultActions: true,
- type: "number",
+ type: 'number',
typeAttributes: {
- minimumFractionDigits: 2,
+ minimumFractionDigits: 2
},
- wrapText: true,
+ wrapText: true
},
{
label: '鍒涘缓鏃ユ湡',
@@ -76,18 +76,20 @@
hideDefaultActions: true,
sortable: true,
wrapText: true,
- type: "date",
+ type: 'date',
typeAttributes: {
- timeZone: "Asia/Shanghai",
- day: "numeric",
- month: "numeric",
- year: "numeric",
- hour: "2-digit",
- minute: "2-digit"
- },
+ timeZone: 'Asia/Shanghai',
+ day: 'numeric',
+ month: 'numeric',
+ year: 'numeric',
+ hour: '2-digit',
+ minute: '2-digit'
+ }
}
];
-export default class LexSaleAndDelivery extends NavigationMixin(LightningElement) {
+export default class LexSaleAndDelivery extends NavigationMixin(
+ LightningElement
+) {
columns = columns;
@track isShowSpinner = true;
@track message = '';
@@ -108,49 +110,48 @@
sortDirection = 'asc';
sortedBy;
-
stylesLoaded = false;
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() {
- init().then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
- this.userinfoId = r.entity.userinfoId;
- this.accountid = r.entity.accountid;
- this.agencyProType = r.entity.agencyProType;
- this.userWorkLocation = r.entity.userWorkLocation;
- this.data = r.entity.raesList;
- for (var i in this.data) {
- this.data[i]['url'] = '/s/lexsummonscreat?ESetid=' + this.data[i].Id;
+ init()
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log('r = ' + JSON.stringify(r));
+ if (r.status == 'Success') {
+ this.userinfoId = r.entity.userinfoId;
+ this.accountid = r.entity.accountid;
+ this.agencyProType = r.entity.agencyProType;
+ this.userWorkLocation = r.entity.userWorkLocation;
+ this.data = r.entity.raesList;
+ for (var i in this.data) {
+ this.data[i]['url'] =
+ '/s/lexsummonscreat?ESetid=' + this.data[i].Id;
+ }
+ console.log('this.data = ' + JSON.stringify(this.data));
+ this.isShowSpinner = false;
+ this.showTable = true;
+ } else {
+ console.log('r = ' + JSON.stringify(r));
+ this.showMyToast('鍒濆鍖栧け璐�', r.msg, 'Error');
}
- console.log('this.data = ' + JSON.stringify(this.data));
- this.isShowSpinner = false;
- this.showTable = true;
-
- } else {
- console.log('r = ' + JSON.stringify(r))
- this.showMyToast('鍒濆鍖栧け璐�', r.msg,'Error');
- }
- }).catch((error) => {
- console.log('error = ' + JSON.stringify(error))
- this.showMyToast('閿欒', '鍒濆鍖栧け璐�','Error');
- })
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showMyToast('閿欒', '鍒濆鍖栧け璐�', 'Error');
+ });
}
-
-
//鏂板缓鍑哄簱鍗�
neworderhead() {
@@ -175,29 +176,32 @@
userWorkLocation: this.userWorkLocation,
category1: this.deliveryOrderNo,
category2: this.contactName
- }).then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
- this.data = r.entity.raesList;
- for (var i in this.data) {
- this.data[i]['url'] = '/s/lexsummonscreat?ESetid=' + this.data[i].Id;
- }
- this.message = r.msg;
- if (this.message == '娌℃湁鎼滅储鍒扮浉鍏冲嚭搴撳崟') {
- this.showMyToast('鎼滅储澶辫触', this.message,'Error');
- } else {
- this.showMyToast('鎼滅储鎴愬姛', this.message,'Success');
- }
- this.isShowSpinner = false;
- //this.isCssLoaded = true
- this.showTable = true;
- } else {
- this.showMyToast('閿欒', r.msg,'Error');
- }
- }).catch((error) => {
- console.log('error = ' + JSON.stringify(error))
})
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log('r = ' + JSON.stringify(r));
+ if (r.status == 'Success') {
+ this.data = r.entity.raesList;
+ for (var i in this.data) {
+ this.data[i]['url'] =
+ '/s/lexsummonscreat?ESetid=' + this.data[i].Id;
+ }
+ this.message = r.msg;
+ if (this.message == '娌℃湁鎼滅储鍒扮浉鍏冲嚭搴撳崟') {
+ this.showMyToast('鎼滅储澶辫触', this.message, 'Error');
+ } else {
+ this.showMyToast('鎼滅储鎴愬姛', this.message, 'Success');
+ }
+ this.isShowSpinner = false;
+ //this.isCssLoaded = true
+ this.showTable = true;
+ } else {
+ this.showMyToast('閿欒', r.msg, 'Error');
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ });
}
//杩樻病鍑哄簱鐨勫嚭搴撳崟
@@ -215,29 +219,36 @@
userWorkLocation: this.userWorkLocation,
category1: this.deliveryOrderNo,
category2: this.contactName
- }).then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
- this.data = r.entity.raesList;
- for (var i in this.data) {
- this.data[i]['url'] = '/s/lexsummonscreat?ESetid=' + this.data[i].Id;
- }
- this.message = r.msg;
- if (this.message == '娌℃湁鎼滅储鍒扮浉鍏冲嚭搴撳崟') {
- this.showMyToast('鎼滅储澶辫触', this.message,'Error');
- } else {
- this.showMyToast('鎼滅储鎴愬姛', this.message,'Success');
- }
- this.isShowSpinner = false;
- this.showTable = true;
- } else {
- this.showMyToast('鎼滅储澶辫触', r.msg,'Error');
- }
- }).catch((error) => {
- console.log('error = ' + JSON.stringify(error))
- this.showMyToast('鎼滅储澶辫触', '鎼滅储杩樻病鍑哄簱鐨勫嚭搴撳崟鍑洪敊','Error');
})
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log('r = ' + JSON.stringify(r));
+ if (r.status == 'Success') {
+ this.data = r.entity.raesList;
+ for (var i in this.data) {
+ this.data[i]['url'] =
+ '/s/lexsummonscreat?ESetid=' + this.data[i].Id;
+ }
+ this.message = r.msg;
+ if (this.message == '娌℃湁鎼滅储鍒扮浉鍏冲嚭搴撳崟') {
+ this.showMyToast('鎼滅储澶辫触', this.message, 'Error');
+ } else {
+ this.showMyToast('鎼滅储鎴愬姛', this.message, 'Success');
+ }
+ this.isShowSpinner = false;
+ this.showTable = true;
+ } else {
+ this.showMyToast('鎼滅储澶辫触', r.msg, 'Error');
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showMyToast(
+ '鎼滅储澶辫触',
+ '鎼滅储杩樻病鍑哄簱鐨勫嚭搴撳崟鍑洪敊',
+ 'Error'
+ );
+ });
}
//宸插嚭搴撳凡寮�绁ㄧ殑鍑哄簱鍗�
@@ -253,29 +264,36 @@
userWorkLocation: this.userWorkLocation,
category1: this.deliveryOrderNo,
category2: this.contactName
- }).then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
- this.data = r.entity.raesList;
- for (var i in this.data) {
- this.data[i]['url'] = '/s/lexsummonscreat?ESetid=' + this.data[i].Id;
- }
- this.message = r.msg;
- if (this.message == '娌℃湁鎼滅储鍒扮浉鍏冲嚭搴撳崟') {
- this.showMyToast('鎼滅储澶辫触', this.message,'Error');
- } else {
- this.showMyToast('鎼滅储鎴愬姛', this.message,'Success');
- }
- this.isShowSpinner = false;
- this.showTable = true;
- } else {
- this.showMyToast('鎼滅储澶辫触', r.msg,'Error');
- }
- }).catch((error) => {
- console.log('error = ' + JSON.stringify(error))
- this.showMyToast('鎼滅储澶辫触', '鎼滅储宸插嚭搴撳凡寮�绁ㄧ殑鍑哄簱鍗曞嚭閿�','Error');
})
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log('r = ' + JSON.stringify(r));
+ if (r.status == 'Success') {
+ this.data = r.entity.raesList;
+ for (var i in this.data) {
+ this.data[i]['url'] =
+ '/s/lexsummonscreat?ESetid=' + this.data[i].Id;
+ }
+ this.message = r.msg;
+ if (this.message == '娌℃湁鎼滅储鍒扮浉鍏冲嚭搴撳崟') {
+ this.showMyToast('鎼滅储澶辫触', this.message, 'Error');
+ } else {
+ this.showMyToast('鎼滅储鎴愬姛', this.message, 'Success');
+ }
+ this.isShowSpinner = false;
+ this.showTable = true;
+ } else {
+ this.showMyToast('鎼滅储澶辫触', r.msg, 'Error');
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showMyToast(
+ '鎼滅储澶辫触',
+ '鎼滅储宸插嚭搴撳凡寮�绁ㄧ殑鍑哄簱鍗曞嚭閿�',
+ 'Error'
+ );
+ });
}
//娓呯┖
@@ -289,30 +307,33 @@
cleanUp({
accountid: this.accountid,
agencyProType: this.agencyProType,
- userWorkLocation: this.userWorkLocation,
- }).then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
- this.data = r.entity.raesList;
- for (var i in this.data) {
- this.data[i]['url'] = '/s/lexsummonscreat?ESetid=' + this.data[i].Id;
- }
- this.message = r.msg;
- if (this.message == '娌℃湁鎼滅储鍒扮浉鍏冲嚭搴撳崟') {
- this.showMyToast('鎼滅储澶辫触', this.message,'Error');
- } else {
- this.showMyToast('鎼滅储鎴愬姛', this.message,'Success');
- }
- this.isShowSpinner = false;
- this.showTable = true;
- } else {
- this.showMyToast('鎼滅储澶辫触', r.msg,'Error');
- }
- }).catch((error) => {
- console.log('error = ' + JSON.stringify(error))
- this.showMyToast('鎼滅储澶辫触', '鎼滅储澶辫触','Error');
+ userWorkLocation: this.userWorkLocation
})
+ .then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log('r = ' + JSON.stringify(r));
+ if (r.status == 'Success') {
+ this.data = r.entity.raesList;
+ for (var i in this.data) {
+ this.data[i]['url'] =
+ '/s/lexsummonscreat?ESetid=' + this.data[i].Id;
+ }
+ this.message = r.msg;
+ if (this.message == '娌℃湁鎼滅储鍒扮浉鍏冲嚭搴撳崟') {
+ this.showMyToast('鎼滅储澶辫触', this.message, 'Error');
+ } else {
+ this.showMyToast('鎼滅储鎴愬姛', this.message, 'Success');
+ }
+ this.isShowSpinner = false;
+ this.showTable = true;
+ } else {
+ this.showMyToast('鎼滅储澶辫触', r.msg, 'Error');
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showMyToast('鎼滅储澶辫触', '鎼滅储澶辫触', 'Error');
+ });
}
//Capture the event fired from the paginator component
@@ -339,11 +360,11 @@
sortBy(field, reverse, primer) {
const key = primer
? function (x) {
- return primer(x[field]);
- }
+ return primer(x[field]);
+ }
: function (x) {
- return x[field];
- };
+ return x[field];
+ };
return function (a, b) {
a = key(a);
@@ -352,27 +373,25 @@
};
}
-
dataChange(event) {
- let fieldName = event.target.getAttribute("data-field");
+ let fieldName = event.target.getAttribute('data-field');
let value = event.detail.value;
switch (fieldName) {
case 'deliveryFromDate':
this.deliveryFromDate = value;
- break
+ break;
case 'deliveryToDate':
this.deliveryToDate = value;
- break
+ break;
case 'deliveryOrderNo':
this.deliveryOrderNo = value;
- break
+ break;
case 'contactName':
this.contactName = value;
- break
+ break;
default:
console.log('no data');
}
-
}
editProductLimit() {
@@ -395,11 +414,18 @@
iconName = 'utility:error';
}
if (message != '') {
- content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
} else {
content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template.querySelector('c-common-toast').showToast(variant, content, iconName, 10000);
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
}
@track isModalOpen = false;
diff --git a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
index 728b39d..76f7619 100644
--- a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
+++ b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
@@ -844,6 +844,7 @@
//disable
+ debugger
if (Object.values(r.entity.coc).length > 0) {
this.cocLwc = r.entity.coc;
console.log("this.cocLwc = " + JSON.stringify(this.cocLwc));
@@ -854,6 +855,12 @@
this.cocId = coc.Id;
console.log('cocId = ' + this.cocId);
coc.SummonsStatus = coc.SummonsStatus_c__c;
+ console.log('this.cocLwc.Arrive_Order__c = ' + this.cocLwc.Arrive_Order__c)
+ if(this.cocLwc.Arrive_Order__c == null){
+ this.isBarcode = true;
+ }else{
+ this.isBarcode = false;
+ }
if (coc.SummonsStatus_c__c == "宸插畬鎴�") {
this.isEditDisabled = true;
}
@@ -2046,10 +2053,45 @@
this.salesOrderdetails = r.entity.orderdetails;
console.log('this.salesOrderdetails = ' + JSON.stringify(this.salesOrderdetails))
this.salesData = r.entity.consumableorderdetailsRecords;
+ console.log('this.salesData = ' + JSON.stringify(this.salesData))
this.salesErrorData = r.entity.consumableorderdetailsRecordserror;
this.salesOrderpieceorboxMap = r.entity.orderpieceorboxMap;
this.salesOrderpriceMap = r.entity.orderpriceMap;
this.salesOrderagencypriceMap = r.entity.orderagencypriceMap;
+ for (var i in this.salesData) {
+ this.salesData[i]["Id"] = this.salesData[i].orderdetails2.Id;
+ this.salesData[i]["Consumable_order_minor__c"] = this.salesData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesData[i].orderdetails2.Consumable_order_minor__r.Name : '';
+ this.salesData[i]["ConsumableorderminorUrl"] = this.salesData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesData[i].orderdetails2.Consumable_order_minor__c : '';
+ this.salesData[i]["orderdetails2Name"] = this.salesData[i].orderdetails2.Name;
+ this.salesData[i]["orderdetails2NameUrl"] = "/" + this.salesData[i].orderdetails2.Id;
+ this.salesData[i]["Box_Piece__c"] = this.salesData[i].orderdetails2.Box_Piece__c;
+ this.salesData[i]["ProdName"] = this.salesData[i].Prod.Name;
+ this.salesData[i]["Deliver_date__c"] = this.salesData[i].orderdetails2.Deliver_date__c;
+ this.salesData[i]["Bar_Code__c"] = this.salesData[i].orderdetails2.Bar_Code__c;
+ this.salesData[i]["Sterilization_limit__c"] = this.salesData[i].orderdetails2.Sterilization_limit__c;
+ if (this.salesData[i]["Box_Piece__c"] == '鐩�') {
+ console.log('this.salesData[i] = ' + JSON.stringify(this.salesData[i]))
+ this.salesData[i]["outboundCount"] = this.salesData[i].outboundCount;
+ } else {
+ for (var j in this.salesOrderdetails) {
+ console.log('this.salesOrderdetails[j].Consumable_product__c = ' + this.salesOrderdetails[j].Consumable_product__c);
+ console.log('this.salesData[i].orderdetails2.Consumable_product__c = ' + this.salesData[i].orderdetails2.Consumable_product__c);
+ if (this.salesOrderdetails[j].Consumable_product__c == this.salesData[i].orderdetails2.Consumable_product__c) {
+ this.salesData[i]["outboundCount"] = this.salesOrderdetails[j].Shipment_Count__c;
+ }
+ }
+ }
+ }
+ for (var i in this.salesErrorData) {
+ this.salesErrorData[i]["Id"] = this.salesErrorData[i].orderdetails2.Id;
+ this.salesErrorData[i]["Consumable_order_minor__c"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesErrorData[i].orderdetails2.Consumable_order_minor__r.Name : '';
+ this.salesErrorData[i]["ConsumableorderminorUrl"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesErrorData[i].orderdetails2.Consumable_order_minor__c : '';
+ this.salesErrorData[i]["orderdetails2Name"] = this.salesErrorData[i].orderdetails2.Name;
+ this.salesErrorData[i]["ProdName"] = this.salesErrorData[i].Prod.Name;
+ this.salesErrorData[i]["Box_Piece__c"] = this.salesErrorData[i].orderdetails2.Box_Piece__c;
+ this.salesErrorData[i]["Bar_Code__c"] = this.salesErrorData[i].orderdetails2.Bar_Code__c;
+ this.salesErrorData[i]["Sterilization_limit__c"] = this.salesErrorData[i].orderdetails2.Sterilization_limit__c;
+ }
this.isShowSpinner = false;
} else {
console.log("r.msg = " + r.msg);
diff --git a/force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.html b/force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.html
index 6a27e23..eca5e11 100644
--- a/force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.html
+++ b/force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.html
@@ -1,3 +1,7 @@
<template>
- <lightning-button-icon icon-name={iconName} onclick={iconClick} style="text-align: center;"></lightning-button-icon>
+ <lightning-button-icon
+ icon-name={iconName}
+ onclick={iconClick}
+ style="text-align: center"
+ ></lightning-button-icon>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.js b/force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.js
index 1931b2a..9df4a22 100644
--- a/force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.js
+++ b/force-app/main/default/lwc/lexTableCellIcon/lexTableCellIcon.js
@@ -1,22 +1,24 @@
-import { LightningElement,api } from 'lwc';
+import { LightningElement, api } from 'lwc';
export default class LexTableCellIcon extends LightningElement {
@api iconName;
@api recordId;
- connectedCallback(){
- console.log("recordId0:"+this.recordId);
+ connectedCallback() {
+ console.log('recordId0:' + this.recordId);
}
- iconClick(){
- console.log("recordId:"+this.recordId);
- this.dispatchEvent(new CustomEvent('clickicon', {
- composed: true,
- bubbles: true,
- cancelable: true,
- detail: {
- data: {recordId:this.recordId}
- }
- }));
+ iconClick() {
+ console.log('recordId:' + this.recordId);
+ this.dispatchEvent(
+ new CustomEvent('clickicon', {
+ composed: true,
+ bubbles: true,
+ cancelable: true,
+ detail: {
+ data: { recordId: this.recordId }
+ }
+ })
+ );
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexTopPage/lexTopPage.html b/force-app/main/default/lwc/lexTopPage/lexTopPage.html
index e7b4de8..2f6a06d 100644
--- a/force-app/main/default/lwc/lexTopPage/lexTopPage.html
+++ b/force-app/main/default/lwc/lexTopPage/lexTopPage.html
@@ -2,7 +2,10 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
+ <div
+ role="status"
+ class="slds-spinner slds-spinner_medium slds-spinner_brand"
+ >
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -28,8 +31,15 @@
</div> -->
<!-- 鏈叏閮ㄥ彂璐ц鍗曟槑缁� -->
<template if:true={over_view}>
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -39,15 +49,29 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>鏈叏閮ㄥ彂璐ц鍗曟槑缁�</strong></p> -->
</div>
- <div style="padding:10px;">
- <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 style="padding: 10px">
+ <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>
</template>
<!-- 浣跨敤鏈熼檺灏忎簬涓�骞寸殑浜у搧 -->
<template if:true={overlimit}>
- <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">
@@ -57,8 +81,14 @@
</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="prodName" data={overlimitdateorderdetails} columns={colm3}></lightning-datatable>
+ <div style="padding: 10px">
+ <lightning-datatable
+ class="wrapped-header-datatable"
+ hide-checkbox-column
+ key-field="prodName"
+ data={overlimitdateorderdetails}
+ columns={colm3}
+ ></lightning-datatable>
</div>
</div>
</template>
@@ -147,8 +177,15 @@
</div>
</div> -->
<!--缁忛攢鍟嗗簱瀛樹笂涓嬮檺 -->
- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
- <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-top: 3px solid #51606e;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -158,12 +195,24 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>缁忛攢鍟嗗簱瀛樹笂涓嬮檺</strong></p> -->
</div>
- <div style="padding:10px;">
+ <div style="padding: 10px">
<div lwc:dom="manual" id="resultDiv" class="resultDiv"></div>
- <lightning-datatable class="wrapped-header-datatable" hide-checkbox-column key-field="prodName" data={productLimitRecords} columns={colm4}></lightning-datatable>
- <p style="height: 10px;"></p>
- <div draggable="false" >
- <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="width: 220px;" onclick={editProductLimit}>缁忛攢鍟嗕骇鍝佷笂涓嬮檺缂栬緫</button>
+ <lightning-datatable
+ class="wrapped-header-datatable"
+ hide-checkbox-column
+ key-field="prodName"
+ data={productLimitRecords}
+ columns={colm4}
+ ></lightning-datatable>
+ <p style="height: 10px"></p>
+ <div draggable="false">
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ style="width: 220px"
+ onclick={editProductLimit}
+ >
+ 缁忛攢鍟嗕骇鍝佷笂涓嬮檺缂栬緫
+ </button>
</div>
</div>
</div>
@@ -194,24 +243,65 @@
</div> -->
<!-- 璁㈠崟鍚勭鏁伴噺淇℃伅寮圭獥 -->
<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>
diff --git a/force-app/main/default/lwc/lexTopPage/lexTopPage.js b/force-app/main/default/lwc/lexTopPage/lexTopPage.js
index 777d6e7..2af5fa4 100644
--- a/force-app/main/default/lwc/lexTopPage/lexTopPage.js
+++ b/force-app/main/default/lwc/lexTopPage/lexTopPage.js
@@ -11,9 +11,9 @@
import initNotArrDetAll from '@salesforce/apex/LexConsumableGoodsInfo.initNotArrDetAll';
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";
+//table css
+import { loadStyle } from 'lightning/platformResourceLoader';
+import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
export default class LexTopPage extends NavigationMixin(LightningElement) {
@track title = [];
@@ -48,12 +48,12 @@
@track showTable = false;
@track hidecheckboxcolumn = true;
//鎺掑簭
- defaultSortDirection = "asc";
- sortDirection = "asc";
+ defaultSortDirection = 'asc';
+ sortDirection = 'asc';
sortedBy;
//鍒嗛〉start
- @track sortBy = "";
+ @track sortBy = '';
@track pageSize = 10;
error;
records;
@@ -76,212 +76,256 @@
@track colms = [
{
label: '娑堣�楀搧璁㈠崟鍚嶇О',
- type: "customOutputGood",
+ type: 'customOutputGood',
typeAttributes: {
- outputValue: { fieldName: "Name" },
+ outputValue: { fieldName: 'Name' },
type: 'Title',
- recordId: { fieldName: "Id" }
+ recordId: { fieldName: 'Id' }
},
- hideDefaultActions: true,initialWidth: 200
+ hideDefaultActions: true,
+ initialWidth: 200
},
- { label: 'SAP鍚堝悓鍙�', fieldName: 'ContractNo__c', hideDefaultActions: true,initialWidth:180},
+ {
+ label: 'SAP鍚堝悓鍙�',
+ fieldName: 'ContractNo__c',
+ hideDefaultActions: true,
+ initialWidth: 180
+ },
{
label: '璁㈠崟鎬绘暟',
- type: "customOutputGood",
+ 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
+ hideDefaultActions: true,
+ initialWidth: 100
},
{
label: '宸插埌璐ф暟閲�',
- type: "customOutputGood",
+ 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
+ hideDefaultActions: true,
+ initialWidth: 110
},
{
label: '寰呯郴缁熸搷浣滃叆搴撴暟閲�',
- type: "customOutputGood",
+ 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
+ hideDefaultActions: true,
+ initialWidth: 180
},
{
label: '杩樻病鍙戣揣鏁伴噺',
- type: "customOutputGood",
+ 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
+ hideDefaultActions: true,
+ initialWidth: 120
},
{
label: '鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁�',
- type: "customOutputGood",
+ 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
+ hideDefaultActions: true,
+ initialWidth: 180
},
- { label: '鏈�鏂板彂璐ф棩鏈�', fieldName: 'Shipment_date__c', hideDefaultActions: true , initialWidth: 140},
- { label: '棣栨鍙戣揣鏃ユ湡', fieldName: 'First_Delivery__c', hideDefaultActions: true , initialWidth: 140}
+ {
+ 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: 60,cellAttributes: { alignment: "center" }}
+ {
+ label: '鏁伴噺',
+ fieldName: 'recordCount',
+ hideDefaultActions: true,
+ initialWidth: 60,
+ cellAttributes: { alignment: 'center' }
+ }
];
//浣跨敤鏈熼檺灏忎簬涓�骞寸殑浜у搧col
@track colm3 = [
{ label: '浜у搧鍨嬪彿', fieldName: 'prodName', hideDefaultActions: true },
- { label: '鏁伴噺', fieldName: 'countid', hideDefaultActions: true ,cellAttributes: { alignment: "left" }},
- { label: '鍗曚綅', fieldName: 'BoxPiece', hideDefaultActions: true ,cellAttributes: { alignment: "left" }}
+ {
+ label: '鏁伴噺',
+ fieldName: 'countid',
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'left' }
+ },
+ {
+ label: '鍗曚綅',
+ fieldName: 'BoxPiece',
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'left' }
+ }
];
//缁忛攢鍟嗗簱瀛樹笂涓嬮檺col
@track colm4 = [
{ label: '浜у搧鍨嬪彿', fieldName: 'prodName', hideDefaultActions: true },
- { label: '搴撳瓨涓嬮檺', fieldName: 'limitLow', hideDefaultActions: true ,cellAttributes: { alignment: "left" }},
- { label: '搴撳瓨涓婇檺', fieldName: 'limitUp', hideDefaultActions: true ,cellAttributes: { alignment: "left" }}
+ {
+ label: '搴撳瓨涓嬮檺',
+ fieldName: 'limitLow',
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'left' }
+ },
+ {
+ label: '搴撳瓨涓婇檺',
+ fieldName: 'limitUp',
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'left' }
+ }
];
@track columns = [
{
- label: "娑堣�楀搧鍚嶇О",
- fieldName: "Name__c",
- type: "Name",
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'Name__c',
+ type: 'Name',
sortable: true,
hideDefaultActions: true,
wrapText: true,
- cellAttributes: { alignment: "left" }
+ cellAttributes: { alignment: 'left' }
},
{
- label: "瑙勬牸",
- fieldName: "packing_list",
- cellAttributes: { alignment: "right" },
+ label: '瑙勬牸',
+ fieldName: 'packing_list',
+ cellAttributes: { alignment: 'right' },
initialWidth: 50,
wrapText: true,
- hideDefaultActions: true,
+ hideDefaultActions: true
},
{
- label: "绗笁鍒嗙被",
- fieldName: "Category3__c",
+ label: '绗笁鍒嗙被',
+ fieldName: 'Category3__c',
initialWidth: 85,
- cellAttributes: { alignment: "left" },
+ cellAttributes: { alignment: 'left' },
hideDefaultActions: true,
- wrapText: true,
+ wrapText: true
},
{
- label: "绗洓鍒嗙被",
- fieldName: "Category4__c",
- cellAttributes: { alignment: "left" },
+ label: '绗洓鍒嗙被',
+ fieldName: 'Category4__c',
+ cellAttributes: { alignment: 'left' },
+ initialWidth: 85,
+ hideDefaultActions: true,
+ wrapText: true
+ },
+ {
+ label: '绗簲鍒嗙被',
+ fieldName: 'Category5__c',
+ cellAttributes: { alignment: 'left' },
initialWidth: 85,
hideDefaultActions: true,
wrapText: true,
-
+ sortable: true
},
{
- label: "绗簲鍒嗙被",
- fieldName: "Category5__c",
- cellAttributes: { alignment: "left" },
- initialWidth: 85,
- hideDefaultActions: true,
- wrapText: true,
- sortable: true,
-
- },
- {
- label: "CFDA鐘舵��",
- fieldName: "SFDA_Status__c",
- cellAttributes: { alignment: "left" },
+ label: 'CFDA鐘舵��',
+ fieldName: 'SFDA_Status__c',
+ cellAttributes: { alignment: 'left' },
initialWidth: 80,
- hideDefaultActions: true,
+ hideDefaultActions: true
},
{
- label: "娉ㄥ唽璇佺紪鐮佸彿",
- fieldName: "approbation_No",
- cellAttributes: { alignment: "left" },
+ label: '娉ㄥ唽璇佺紪鐮佸彿',
+ fieldName: 'approbation_No',
+ cellAttributes: { alignment: 'left' },
wrapText: true,
initialWidth: 155,
- hideDefaultActions: true,
+ hideDefaultActions: true
},
{
- label: "娉ㄥ唽璇佹晥鏈�",
- fieldName: "expiration_Date",
- cellAttributes: { alignment: "left" },
+ label: '娉ㄥ唽璇佹晥鏈�',
+ fieldName: 'expiration_Date',
+ cellAttributes: { alignment: 'left' },
wrapText: true,
hideDefaultActions: true,
initialWidth: 100
},
{
- label: "浜у搧鏁伴噺涓嬮檺",
- fieldName: "lowerlimit",
- cellAttributes: { alignment: "right" },
+ label: '浜у搧鏁伴噺涓嬮檺',
+ fieldName: 'lowerlimit',
+ cellAttributes: { alignment: 'right' },
wrapText: true,
hideDefaultActions: true,
initialWidth: 100
},
{
- label: "浣跨敤鏈熼檺",
- fieldName: "guaranteeperiod",
- cellAttributes: { alignment: "left" },
+ label: '浣跨敤鏈熼檺',
+ fieldName: 'guaranteeperiod',
+ cellAttributes: { alignment: 'left' },
hideDefaultActions: true,
initialWidth: 95
},
{
label: '鏈夋晥鏈熷唴搴撳瓨',
- type: "customInventoryColor",
- cellAttributes: { alignment: "right" },
+ type: 'customInventoryColor',
+ cellAttributes: { alignment: 'right' },
typeAttributes: {
- value: { fieldName: "limitCount" },
- upperlimit: { fieldName: "upperlimit" },
- lowerlimit: { fieldName: "lowerlimit" },
- boxPrice: { fieldName: "BoxPiece" },
+ value: { fieldName: 'limitCount' },
+ upperlimit: { fieldName: 'upperlimit' },
+ lowerlimit: { fieldName: 'lowerlimit' },
+ boxPrice: { fieldName: 'BoxPiece' }
},
hideDefaultActions: true,
initialWidth: 95
},
{
- label: "杩囨湡搴撳瓨",
- fieldName: "overlimitCount",
+ label: '杩囨湡搴撳瓨',
+ fieldName: 'overlimitCount',
hideDefaultActions: true,
- cellAttributes: { alignment: "right" },
+ cellAttributes: { alignment: 'right' },
initialWidth: 75
},
{
- label: "鍗曚綅",
- fieldName: "BoxPiece",
- cellAttributes: { alignment: "left" },
+ label: '鍗曚綅',
+ fieldName: 'BoxPiece',
+ cellAttributes: { alignment: 'left' },
initialWidth: 50,
wrapText: true,
- hideDefaultActions: true,
- },
-
+ hideDefaultActions: true
+ }
];
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');
});
}
}
@@ -294,20 +338,23 @@
this.showSpinner = true;
initPage({
pageSizeLWC: this.pageSize,
- pageTokenLWC: this.currentPageToken,
+ pageTokenLWC: this.currentPageToken
})
- .then(result => {
+ .then((result) => {
this.isNoteStay = result.isNoteStay;
- console.log('isNoteStay:'+result.isNoteStay);
+ console.log('isNoteStay:' + result.isNoteStay);
if (result.result == 'Success') {
//鍒嗛〉start
this.nextPageToken = result.paginatedAccounts.nextPageToken;
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
@@ -318,81 +365,117 @@
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.column = result.column;
this.accountInfo = result.accountInfo;
this.accountId = result.accountInfo.Id;
this.pageRecords = result.pageRecords;
- this.overlimitdateorderdetails = result.overlimitdateorderdetails;
+ this.overlimitdateorderdetails =
+ result.overlimitdateorderdetails;
this.over_view = result.over_view;
this.overlimit = result.overlimit;
this.hasHos = result.hasHos;
this.product_Limit = result.product_Limit;
console.log('result==>' + JSON.stringify(result));
for (var i in this.pageRecords) {
- this.pageRecords[i]["Name__c"] = this.pageRecords[i].Prod.Name__c;
- this.pageRecords[i]["Category3__c"] = this.pageRecords[i].Prod.Category3__c;
- this.pageRecords[i]["Category4__c"] = this.pageRecords[i].Prod.Category3__c;
- this.pageRecords[i]["Category5__c"] = this.pageRecords[i].Prod.Category3__c;
- this.pageRecords[i]["SFDA_Status__c"] = this.pageRecords[i].Prod.SFDA_Status__c;
+ this.pageRecords[i]['Name__c'] =
+ this.pageRecords[i].Prod.Name__c;
+ this.pageRecords[i]['Category3__c'] =
+ this.pageRecords[i].Prod.Category3__c;
+ this.pageRecords[i]['Category4__c'] =
+ this.pageRecords[i].Prod.Category3__c;
+ this.pageRecords[i]['Category5__c'] =
+ this.pageRecords[i].Prod.Category3__c;
+ this.pageRecords[i]['SFDA_Status__c'] =
+ this.pageRecords[i].Prod.SFDA_Status__c;
}
//hasHos = true 鍖婚櫌鐗逛环
if (this.hasHos) {
let object1 = {
- label: "鍖婚櫌鐗逛环",
- fieldName: "hospitalSpecialOffer",
+ label: '鍖婚櫌鐗逛环',
+ fieldName: 'hospitalSpecialOffer',
hideDefaultActions: true,
type: 'boolean',
- cellAttributes: { alignment: "left" },
+ cellAttributes: { alignment: 'left' },
initialWidth: 75
-
};
this.columns.push(object1);
console.log(' this.columns' + this.columns);
for (var j in this.pageRecords) {
- this.pageRecords[j]["Name__c"] = this.pageRecords[j].Prod.Name__c;
- this.pageRecords[j]["Category3__c"] = this.pageRecords[j].Prod.Category3__c;
- this.pageRecords[j]["Category4__c"] = this.pageRecords[j].Prod.Category3__c;
- this.pageRecords[j]["Category5__c"] = this.pageRecords[j].Prod.Category3__c;
- this.pageRecords[j]["SFDA_Status__c"] = this.pageRecords[j].Prod.SFDA_Status__c;
- this.pageRecords[j]["hospitalSpecialOffer__c"] = this.pageRecords[j].hospitalSpecialOffer;
+ this.pageRecords[j]['Name__c'] =
+ this.pageRecords[j].Prod.Name__c;
+ this.pageRecords[j]['Category3__c'] =
+ this.pageRecords[j].Prod.Category3__c;
+ this.pageRecords[j]['Category4__c'] =
+ this.pageRecords[j].Prod.Category3__c;
+ this.pageRecords[j]['Category5__c'] =
+ this.pageRecords[j].Prod.Category3__c;
+ this.pageRecords[j]['SFDA_Status__c'] =
+ this.pageRecords[j].Prod.SFDA_Status__c;
+ this.pageRecords[j]['hospitalSpecialOffer__c'] =
+ this.pageRecords[j].hospitalSpecialOffer;
}
}
this.showTable = true;
- if (this.product_Limit != null && this.product_Limit != '') {
- var records = this.product_Limit.split(",");
+ if (
+ this.product_Limit != null &&
+ this.product_Limit != ''
+ ) {
+ var records = this.product_Limit.split(',');
for (var i in records) {
- var parms = records[i].split("|");
+ var parms = records[i].split('|');
var record = new Object();
- record["prodName"] = parms[0];
- record["limitLow"] = parms[1];
- record["limitUp"] = parms[2];
+ record['prodName'] = parms[0];
+ record['limitLow'] = parms[1];
+ record['limitUp'] = parms[2];
this.productLimitRecords.push(record);
}
}
// this.productLimitRecords = records;
- console.log("productLimitRecords:" + JSON.stringify(this.productLimitRecords));
- console.log("product_Limit:" + this.product_Limit);
- this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview;
+ console.log(
+ 'productLimitRecords:' +
+ JSON.stringify(this.productLimitRecords)
+ );
+ console.log('product_Limit:' + this.product_Limit);
+ this.consumableorderdetailsRecordsview =
+ result.consumableorderdetailsRecordsview;
//add by WangXueqin 2023/05/05
this.userPro_Type = result.userPro_Type;
console.log('this.accountId:' + this.accountId);
- console.log('this.accountInfo:' + JSON.stringify(this.accountInfo));
+ console.log(
+ 'this.accountInfo:' + JSON.stringify(this.accountInfo)
+ );
this.showSpinner = false;
this.showPage = true;
// this.showMyToast('鍒濆鍖栭〉闈㈡垚鍔�', '', 'success');
} else {
this.showPage = true;
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'
+ );
+ });
}
//鐐瑰嚮閾炬帴
@@ -400,7 +483,9 @@
var outputValue = event.detail.data.value;
var outputType = event.detail.data.type;
var recordId = event.detail.data.recordId;
- console.log("click:" + outputValue + "---" + outputType + "---" + recordId);
+ console.log(
+ 'click:' + outputValue + '---' + outputType + '---' + recordId
+ );
if (outputType == 'Title') {
const config = {
type: 'standard__webPage',
@@ -411,120 +496,146 @@
this[NavigationMixin.Navigate](config);
} else if (outputType == 'TotalNum') {
this.popTitle = '鎵�鏈変骇鍝佷竴瑙�';
- initTotalNum({ ordId: recordId, type: '' })
- .then(result => {
+ initTotalNum({ ordId: recordId, type: '' }).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'
+ );
+ }
+ });
+ } else if (outputType == 'ArrDet') {
+ if (recordId == '1') {
+ this.popTitle = '鎵�鏈夊凡鍒拌揣浜у搧涓�瑙�';
+ initArrDetAll({ type: '' }).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 == 'ArrDet') {
- if (recordId == '1') {
- this.popTitle = '鎵�鏈夊凡鍒拌揣浜у搧涓�瑙�';
- initArrDetAll({ type: '' })
- .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');
- }
- })
+ });
} else {
this.popTitle = '宸插埌璐т骇鍝佷竴瑙�';
- 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');
- }
- })
+ 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'
+ );
+ }
+ });
}
} else if (outputType == 'DeliveryDet') {
if (recordId == '1') {
this.popTitle = '鎵�鏈夊凡鍙戣揣杩樻病鍒拌揣浜у搧涓�瑙�';
- initDeliveryDetAll({ type: '' })
- .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');
- }
- })
+ initDeliveryDetAll({ type: '' }).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'
+ );
+ }
+ });
} else {
this.popTitle = '鏈埌璐т骇鍝佷竴瑙�';
- 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');
- }
- })
+ 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'
+ );
+ }
+ });
}
} else if (outputType == 'NotArrDet') {
if (recordId == '1') {
this.popTitle = '鎵�鏈夎繕娌″彂璐т骇鍝佷竴瑙�';
- initNotArrDetAll({ type: '' })
- .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');
- }
- })
+ initNotArrDetAll({ type: '' }).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'
+ );
+ }
+ });
} else {
this.popTitle = '杩樻病鍙戣揣鏁伴噺';
- 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');
- }
- })
+ 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'
+ );
+ }
+ });
}
-
} else if (outputType == 'MoreThan7') {
if (recordId == '1') {
this.popTitle = '鎵�鏈夊彂璐т竷澶╄繕鏈埌璐ф暟';
- initMoreThan7All({ type: '' })
- .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');
- }
- })
+ initMoreThan7All({ type: '' }).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'
+ );
+ }
+ });
} else {
this.popTitle = '鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁�';
- 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');
- }
- })
+ 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'
+ );
+ }
+ });
}
}
}
@@ -536,7 +647,11 @@
editProductLimit(event) {
//add by Wang Xueqin 2023/05/05
- let url = "/lexproductlimitedit?accountid=" + this.accountId + "&userPro_Type=" + this.userPro_Type;
+ let url =
+ '/LexProductLimitEdit?accountid=' +
+ this.accountId +
+ '&userPro_Type=' +
+ this.userPro_Type;
const config = {
type: 'standard__webPage',
attributes: {
@@ -564,18 +679,24 @@
console.log('show custom message');
var iconName = '';
var content = '';
- if(variant == 'success'){
- iconName = 'utility:check';
- }else{
- iconName = 'utility:error';
+ if (variant == 'success') {
+ iconName = 'utility:check';
+ } else {
+ iconName = 'utility:error';
}
- if(message != ''){
- content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
- }else{
- content = '<h2><strong>'+title+'<strong/></h2>';
+ if (message != '') {
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
+ } else {
+ content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template.querySelector('c-common-toast').
- showToast(variant,content,iconName,10000);
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
// var mode;
// if(this.isNoteStay){
// mode ='sticky';
@@ -589,17 +710,17 @@
// mode: mode
// });
// this.dispatchEvent(evt);
- }
+ }
//鎺掑簭
sortByMethod(field, reverse, primer) {
const key = primer
? function (x) {
- return primer(x[field]);
- }
+ return primer(x[field]);
+ }
: function (x) {
- return x[field];
- };
+ return x[field];
+ };
return function (a, b) {
a = key(a);
@@ -609,15 +730,17 @@
}
onHandleSort(event) {
- console.log("Sort");
+ console.log('Sort');
this.sortBy = event.detail.fieldName;
this.sortDirection = event.detail.sortDirection;
this.currentPageToken = 0;
- console.log('this.sortBy = ' + this.sortBy)
- console.log('this.sortDirection = ' + this.sortDirection)
+ console.log('this.sortBy = ' + this.sortBy);
+ console.log('this.sortDirection = ' + this.sortDirection);
const { fieldName: sortedBy, sortDirection } = event.detail;
const cloneData = [...this.pageRecords];
- cloneData.sort(this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1));
+ cloneData.sort(
+ this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1)
+ );
this.pageRecords = cloneData;
this.sortDirection = sortDirection;
this.sortedBy = sortedBy;
@@ -633,12 +756,14 @@
}
}
handlePrevious() {
- this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize);
+ this.currentPageToken =
+ Number(this.currentPageToken) - Number(this.pageSize);
this.init();
}
handleNext() {
- this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize);
+ this.currentPageToken =
+ Number(this.currentPageToken) + Number(this.pageSize);
this.init();
}
handleFirst() {
@@ -647,7 +772,8 @@
}
handleLast() {
- this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
+ this.currentPageToken =
+ this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
this.init();
}
diff --git a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
index 6c29ff9..181806f 100644
--- a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
+++ b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
@@ -2,7 +2,10 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
+ <div
+ role="status"
+ class="slds-spinner slds-spinner_medium slds-spinner_brand"
+ >
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -10,8 +13,14 @@
</div>
</template>
<c-common-toast></c-common-toast>
- <div style="border: 1px solid #D4D4D4;border-radius:5px;">
- <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div style="border: 1px solid #d4d4d4; border-radius: 5px">
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
<!-- <p style="font-size: 18px;"><strong>搴撳瓨绠$悊</strong></p> -->
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -21,9 +30,21 @@
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding:10px;">
- <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:10px;">
+ <div style="padding: 10px">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 10px;
+ "
+ >
<!-- <lightning-button variant="brand" class = 'lexstyle' style="margin:12px;" label="搴撳瓨鐩樼偣" title="搴撳瓨鐩樼偣"
onclick={inventoryCount}></lightning-button>
<lightning-button variant="brand" class = 'lexstyle' style="margin: 12px;" label="杩囨湡搴撳瓨閿�瀛�" title="杩囨湡搴撳瓨閿�瀛�"
@@ -31,21 +52,58 @@
<lightning-button variant="brand" class = 'lexstyle' style="margin: 12px;" label="鎷嗙洅" title="鎷嗙洅" onclick={removeBox}></lightning-button>
<lightning-button variant="brand" class = 'lexstyle' style="margin: 12px;" label="鍙栨秷鎷嗙洅" title="鍙栨秷鎷嗙洅"
onclick={cancelremoveBox}></lightning-button> -->
- <button style="margin-left:5px"
- class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="搴撳瓨鐩樼偣"
- onclick={inventoryCount}>搴撳瓨鐩樼偣</button>
- <button class="slds-button slds-button_neutral slds-button_stretch lexButtoun" label="杩囨湡搴撳瓨閿�瀛�"
- style="margin-left:60px;" onclick={handleExpired}>杩囨湡搴撳瓨閿�瀛�</button>
- <button class="slds-button slds-button_neutral slds-button_stretch lexButtoun" label="鎷嗙洅"
- style="margin-left:60px;" onclick={removeBox}>鎷嗙洅</button>
- <button class="slds-button slds-button_neutral slds-button_stretch lexButtoun" label="鍙栨秷鎷嗙洅"
- style="margin-left:60px;" onclick={cancelremoveBox}>鍙栨秷鎷嗙洅</button>
+ <button
+ style="margin-left: 5px"
+ class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ label="搴撳瓨鐩樼偣"
+ onclick={inventoryCount}
+ >
+ 搴撳瓨鐩樼偣
+ </button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexButtoun"
+ label="杩囨湡搴撳瓨閿�瀛�"
+ style="margin-left: 60px"
+ onclick={handleExpired}
+ >
+ 杩囨湡搴撳瓨閿�瀛�
+ </button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexButtoun"
+ label="鎷嗙洅"
+ style="margin-left: 60px"
+ onclick={removeBox}
+ >
+ 鎷嗙洅
+ </button>
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexButtoun"
+ label="鍙栨秷鎷嗙洅"
+ style="margin-left: 60px"
+ onclick={cancelremoveBox}
+ >
+ 鍙栨秷鎷嗙洅
+ </button>
</div>
</div>
- <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:30px;">
- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;height:115px">
- <table style="margin-top:10px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ margin-top: 30px;
+ "
+ >
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ height: 115px;
+ "
+ >
+ <table style="margin-top: 10px">
<colgroup>
<col width="160px" />
<col width="100px" />
@@ -66,57 +124,129 @@
</colgroup>
<tbody>
<tr>
- <td style="width:10px;"></td>
- <td style="width:250px">
- <div style="width:90px;margin-left:12px;" class="searchName">娑堣�楀搧鍚嶇О</div>
+ <td style="width: 10px"></td>
+ <td style="width: 250px">
+ <div
+ style="width: 90px; margin-left: 12px"
+ class="searchName"
+ >
+ 娑堣�楀搧鍚嶇О
+ </div>
</td>
- <td style="width: 21%;">
- <lightning-input class="searchName" type="text" name="Name" label="娑堣�楀搧鍚嶇О"
- value={Name} variant="label-hidden" onchange={dataChange}
- data-field="Name"></lightning-input>
+ <td style="width: 21%">
+ <lightning-input
+ class="searchName"
+ type="text"
+ name="Name"
+ label="娑堣�楀搧鍚嶇О"
+ value={Name}
+ variant="label-hidden"
+ onchange={dataChange}
+ data-field="Name"
+ ></lightning-input>
</td>
- <td style="width:150px">
- <div style="width:90px;text-align:center;" class="searchName">绗�3鍒嗙被</div>
+ <td style="width: 150px">
+ <div
+ style="width: 90px; text-align: center"
+ class="searchName"
+ >
+ 绗�3鍒嗙被
+ </div>
</td>
- <td style="width: 21%;">
- <lightning-combobox class="inputFont" style="margin-left:5px;" name="CategoryThree"
- label="绗�3鍒嗙被" value={value} placeholder="璇烽�夋嫨..." options={category3Options}
- variant="label-hidden" data-field="CategoryThree"
- onchange={dataChange}></lightning-combobox>
+ <td style="width: 21%">
+ <lightning-combobox
+ class="inputFont"
+ style="margin-left: 5px"
+ name="CategoryThree"
+ label="绗�3鍒嗙被"
+ value={value}
+ placeholder="璇烽�夋嫨..."
+ options={category3Options}
+ variant="label-hidden"
+ data-field="CategoryThree"
+ onchange={dataChange}
+ ></lightning-combobox>
</td>
- <td style="width:150px">
- <div style="width:90px;text-align:center;" class="searchName">绗�4鍒嗙被</div>
+ <td style="width: 150px">
+ <div
+ style="width: 90px; text-align: center"
+ class="searchName"
+ >
+ 绗�4鍒嗙被
+ </div>
</td>
- <td style="width: 21%;">
- <lightning-combobox class="inputFont" name="CategoryFour" label="绗�4鍒嗙被" value={value}
- placeholder="璇烽�夋嫨..." options={category4Options} variant="label-hidden"
- data-field="CategoryFour" onchange={dataChange}></lightning-combobox>
+ <td style="width: 21%">
+ <lightning-combobox
+ class="inputFont"
+ name="CategoryFour"
+ label="绗�4鍒嗙被"
+ value={value}
+ placeholder="璇烽�夋嫨..."
+ options={category4Options}
+ variant="label-hidden"
+ data-field="CategoryFour"
+ onchange={dataChange}
+ ></lightning-combobox>
</td>
- <td style="width:150px">
- <div style="width:90px;text-align:center;" class="searchName">绗�5鍒嗙被</div>
+ <td style="width: 150px">
+ <div
+ style="width: 90px; text-align: center"
+ class="searchName"
+ >
+ 绗�5鍒嗙被
+ </div>
</td>
- <td style="width: 21%;">
- <lightning-combobox class="inputFont" name="CategoryFive" label="绗�5鍒嗙被" value={value}
- placeholder="璇烽�夋嫨..." options={category5Options} variant="label-hidden"
- data-field="CategoryFive" onchange={dataChange}></lightning-combobox>
+ <td style="width: 21%">
+ <lightning-combobox
+ class="inputFont"
+ name="CategoryFive"
+ label="绗�5鍒嗙被"
+ value={value}
+ placeholder="璇烽�夋嫨..."
+ options={category5Options}
+ variant="label-hidden"
+ data-field="CategoryFive"
+ onchange={dataChange}
+ ></lightning-combobox>
</td>
- <td style="width: 1%;"></td>
+ <td style="width: 1%"></td>
</tr>
</tbody>
</table>
<br />
- <div style="float:right;margin-right:10px;"> <button
- class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" label="娑堣�楀搧鎼滅储"
- onclick={searchOrderDetail}>娑堣�楀搧鎼滅储</button>
- <button style="margin-left:10px;"
- class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" label="娓呯┖"
- onclick={clearAll}>娓呯┖</button>
+ <div style="float: right; margin-right: 10px">
+ <button
+ class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
+ label="娑堣�楀搧鎼滅储"
+ onclick={searchOrderDetail}
+ >
+ 娑堣�楀搧鎼滅储
+ </button>
+ <button
+ style="margin-left: 10px"
+ class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
+ label="娓呯┖"
+ onclick={clearAll}
+ >
+ 娓呯┖
+ </button>
</div>
-
</div>
</div>
- <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div
+ style="
+ border: 1px solid #d4d4d4;
+ border-radius: 5px;
+ margin-bottom: 7px;
+ "
+ >
+ <div
+ style="
+ border-top: 3px solid #51606e;
+ border-bottom: 1px solid #d4d4d4;
+ padding: 3px;
+ "
+ >
<!-- <p style="font-size: 16px;"><strong>搴撳瓨璇︽儏</strong></p> -->
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -126,22 +256,36 @@
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding:10px;">
+ <div style="padding: 10px">
<template if:true={showTable}>
- <c-lex-custom-lightning-datatable key-field="id" data={data} columns={columns}
- default-sort-direction={defaultSortDirection} sorted-direction={sortDirection}
- sorted-by={sortedBy} onsort={onHandleSort} hide-checkbox-column={hidecheckboxcolumn}
- class="wrapped-header-datatable">
+ <c-lex-custom-lightning-datatable
+ key-field="id"
+ data={data}
+ columns={columns}
+ default-sort-direction={defaultSortDirection}
+ sorted-direction={sortDirection}
+ sorted-by={sortedBy}
+ onsort={onHandleSort}
+ hide-checkbox-column={hidecheckboxcolumn}
+ class="wrapped-header-datatable"
+ >
</c-lex-custom-lightning-datatable>
</template>
- <c-paginator onprevious={handlePrevious} onnext={handleNext} onpageschange={handlePageschange}
- onfirst={handleFirst} onlast={handleLast} page-size-options={pageSizeOptions}
- previous-button-disabled={previousButtonDisabled} next-button-disabled={nextButtonDisabled}
- record-start={recordStart} record-end={recordEnd} total-records={totalRecords}></c-paginator>
+ <c-paginator
+ onprevious={handlePrevious}
+ onnext={handleNext}
+ onpageschange={handlePageschange}
+ onfirst={handleFirst}
+ onlast={handleLast}
+ page-size-options={pageSizeOptions}
+ previous-button-disabled={previousButtonDisabled}
+ next-button-disabled={nextButtonDisabled}
+ record-start={recordStart}
+ record-end={recordEnd}
+ total-records={totalRecords}
+ ></c-paginator>
</div>
</div>
</div>
-
-
</div>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
index 08547a6..ff6c1ae 100644
--- a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
+++ b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
@@ -1,335 +1,366 @@
import { LightningElement, wire, api, track } from 'lwc';
-import oninit from "@salesforce/apex/LexInventoryViewController.init";
-import { ShowToastEvent } from "lightning/platformShowToastEvent";
-import searchOrder from "@salesforce/apex/LexInventoryViewController.searchConsumableorderdetails";
-import categoryAllload from "@salesforce/apex/LexInventoryViewController.categoryAllload";
-import { NavigationMixin } from "lightning/navigation";
+import oninit from '@salesforce/apex/LexInventoryViewController.init';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import searchOrder from '@salesforce/apex/LexInventoryViewController.searchConsumableorderdetails';
+import categoryAllload from '@salesforce/apex/LexInventoryViewController.categoryAllload';
+import { NavigationMixin } from 'lightning/navigation';
-//table css
-import { loadStyle } from "lightning/platformResourceLoader";
-import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
+//table css
+import { loadStyle } from 'lightning/platformResourceLoader';
+import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
+export default class LexinventoryViewLWC extends NavigationMixin(
+ LightningElement
+) {
+ //鍒嗛〉start
+ @track sortBy = '';
+ //@track sortDirection = "asc";
+ @track pageSize = 10;
+ error;
+ records;
+ currentPageToken = 0;
+ nextPageToken = this.pageSize;
+ @track totalRecords = 0;
+ @track loader = false;
+ @track pageNumber = 1;
+ @track paginationVisibility = false;
+ @track totalPages = 1;
+ pageSizeOptions = [10, 25, 50, 100];
+ @track recordStart = 0;
+ @track recordEnd = 0;
+ //end
-export default class LexinventoryViewLWC extends NavigationMixin(LightningElement) {
- //鍒嗛〉start
- @track sortBy = "";
- //@track sortDirection = "asc";
- @track pageSize = 10;
- error;
- records;
- currentPageToken = 0;
- nextPageToken = this.pageSize;
- @track totalRecords = 0;
- @track loader = false;
- @track pageNumber = 1;
- @track paginationVisibility = false;
- @track totalPages = 1;
- pageSizeOptions = [10,25,50,100];
- @track recordStart = 0;
- @track recordEnd = 0;
- //end
+ @track data = [];
+ @track message = '';
+ @track Name;
+ @track CategoryThree;
- @track data = [];
- @track message = "";
- @track Name;
- @track CategoryThree;
+ @track category3Options = [];
+ @track CategoryFour;
+ @track category4Options = [];
+ @track CategoryFive;
+ @track category5Options = [];
+ @track orderDetZaikuList = [];
+ @track accountName;
+ @track agencyProType;
+ @track userWorkLocation;
+ @track value = '';
+ @track showTable = false;
+ @track hidecheckboxcolumn = true;
+ @track check = false;
+ @track productkucun;
+ //鍔犺浇
+ @track showSpinner = false;
+ @track showSpinners = false;
+ //鍖婚櫌鐗逛环
+ @track hasHos = false;
+ //琛ㄥご鏍峰紡
+ stylesLoaded = false;
- @track category3Options = [];
- @track CategoryFour;
- @track category4Options = [];
- @track CategoryFive;
- @track category5Options = [];
- @track orderDetZaikuList = [];
- @track accountName;
- @track agencyProType;
- @track userWorkLocation;
- @track value = "";
- @track showTable = false;
- @track hidecheckboxcolumn = true;
- @track check = false;
- @track productkucun;
- //鍔犺浇
- @track showSpinner = false;
- @track showSpinners = false;
- //鍖婚櫌鐗逛环
- @track hasHos = false;
- //琛ㄥご鏍峰紡
- stylesLoaded = false;
+ @track columns = [
+ {
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'Name__c',
+ type: 'Name',
+ sortable: true,
+ hideDefaultActions: true,
+ initialWidth: 300,
+ wrapText: true,
+ cellAttributes: { alignment: 'left' }
+ },
+ {
+ label: '绗笁鍒嗙被',
+ fieldName: 'Category3__c',
+ initialWidth: 120,
+ cellAttributes: { alignment: 'left' },
+ hideDefaultActions: true,
+ sortable: true,
+ wrapText: true
+ },
+ {
+ label: '绗洓鍒嗙被',
+ fieldName: 'Category4__c',
+ cellAttributes: { alignment: 'left' },
+ initialWidth: 120,
+ hideDefaultActions: true,
+ wrapText: true,
+ sortable: true
+ },
+ {
+ label: '绗簲鍒嗙被',
+ fieldName: 'Category5__c',
+ cellAttributes: { alignment: 'left' },
+ initialWidth: 120,
+ hideDefaultActions: true,
+ wrapText: true,
+ sortable: true
+ },
+ {
+ label: '瑙勬牸',
+ fieldName: 'packing_list',
+ cellAttributes: { alignment: 'right' },
+ initialWidth: 55,
+ wrapText: true,
+ hideDefaultActions: true
+ },
+ {
+ label: '鍗曚綅',
+ fieldName: 'BoxPiece',
+ cellAttributes: { alignment: 'left' },
+ initialWidth: 55,
+ wrapText: true,
+ hideDefaultActions: true
+ },
+ {
+ label: '娉ㄥ唽璇佺紪鐮佸彿',
+ fieldName: 'approbation_No',
+ cellAttributes: { alignment: 'left' },
+ wrapText: true,
+ initialWidth: 200,
+ hideDefaultActions: true
+ },
+ {
+ label: '娉ㄥ唽鏈夋晥鏈�',
+ fieldName: 'expiration_Date',
+ cellAttributes: { alignment: 'left' },
+ wrapText: true,
+ hideDefaultActions: true,
+ initialWidth: 110
+ },
+ {
+ label: 'CFDA鐘舵��',
+ fieldName: 'SFDA_Status__c',
+ cellAttributes: { alignment: 'left' },
+ initialWidth: 95,
+ wrapText: true,
+ hideDefaultActions: true
+ },
+ {
+ label: '浣跨敤鏈熼檺',
+ fieldName: 'guaranteeperiod',
+ cellAttributes: { alignment: 'left' },
+ hideDefaultActions: true,
+ initialWidth: 105
+ },
+ {
+ label: '鏈夋晥鏈熷唴搴撳瓨',
+ type: 'customInventoryColor',
+ fieldName: 'limitCount',
+ sortable: true,
+ cellAttributes: { alignment: 'right' },
+ typeAttributes: {
+ value: { fieldName: 'limitCount' },
+ upperlimit: { fieldName: 'upperlimit' },
+ lowerlimit: { fieldName: 'lowerlimit' },
+ boxPrice: { fieldName: 'BoxPiece' }
+ },
+ hideDefaultActions: true,
+ initialWidth: 150
+ },
- @track columns = [
- {
- label: "娑堣�楀搧鍚嶇О",
- fieldName: "Name__c",
- type: "Name",
- sortable: true,
- hideDefaultActions: true,
- initialWidth: 300,
- wrapText: true,
- cellAttributes: { alignment: "left" }
- },
- {
- label: "绗笁鍒嗙被",
- fieldName: "Category3__c",
- initialWidth: 120,
- cellAttributes: { alignment: "left" },
- hideDefaultActions: true,
- sortable: true,
- wrapText: true,
- },
- {
- label: "绗洓鍒嗙被",
- fieldName: "Category4__c",
- cellAttributes: { alignment: "left" },
- initialWidth: 120,
- hideDefaultActions: true,
- wrapText: true,
- sortable: true,
-
- },
- {
- label: "绗簲鍒嗙被",
- fieldName: "Category5__c",
- cellAttributes: { alignment: "left" },
- initialWidth: 120,
- hideDefaultActions: true,
- wrapText: true,
- sortable: true,
-
- },
-
- {
- label: "瑙勬牸",
- fieldName: "packing_list",
- cellAttributes: { alignment: "right" },
- initialWidth: 55,
- wrapText: true,
- hideDefaultActions: true,
- },
- {
- label: "鍗曚綅",
- fieldName: "BoxPiece",
- cellAttributes: { alignment: "left" },
- initialWidth: 55,
- wrapText: true,
- hideDefaultActions: true,
- },
- {
- label: "娉ㄥ唽璇佺紪鐮佸彿",
- fieldName: "approbation_No",
- cellAttributes: { alignment: "left" },
- wrapText: true,
- initialWidth: 200,
- hideDefaultActions: true,
- },
- {
- label: "娉ㄥ唽鏈夋晥鏈�",
- fieldName: "expiration_Date",
- cellAttributes: { alignment: "left" },
- wrapText: true,
- hideDefaultActions: true,
- initialWidth: 110
- },
- {
- label: "CFDA鐘舵��",
- fieldName: "SFDA_Status__c",
- cellAttributes: { alignment: "left" },
- initialWidth: 95,
- wrapText: true,
- hideDefaultActions: true,
- },
- {
- label: "浣跨敤鏈熼檺",
- fieldName: "guaranteeperiod",
- cellAttributes: { alignment: "left" },
- hideDefaultActions: true,
- initialWidth: 105
- },
- {
- label:'鏈夋晥鏈熷唴搴撳瓨',
- type: "customInventoryColor",
- fieldName: "limitCount",
- sortable: true,
- cellAttributes: {alignment: "right" },
- typeAttributes: {
- value: { fieldName:"limitCount"},
- upperlimit: { fieldName: "upperlimit" },
- lowerlimit: { fieldName: "lowerlimit" },
- boxPrice:{ fieldName: "BoxPiece" },
- },
- hideDefaultActions: true,
- initialWidth:150
- },
+ {
+ label: '杩囨湡搴撳瓨',
+ fieldName: 'overlimitCount',
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'right' },
+ initialWidth: 80
+ }
+ ];
+ defaultSortDirection = 'asc';
+ sortDirection = 'asc';
+ sortedBy;
- {
- label: "杩囨湡搴撳瓨",
- fieldName: "overlimitCount",
- hideDefaultActions: true,
- cellAttributes: { alignment: "right" },
- initialWidth:80
- }
- ];
- defaultSortDirection = "asc";
- sortDirection = "asc";
- sortedBy;
-
-
-
renderedCallback() {
if (!this.stylesLoaded) {
Promise.all([loadStyle(this, WrappedHeaderTable)])
.then(() => {
- console.log("Custom styles loaded");
+ console.log('Custom styles loaded');
this.stylesLoaded = true;
})
.catch((error) => {
- console.error("Error loading custom styles");
+ console.error('Error loading custom styles');
});
}
}
-
- connectedCallback() {
- this.loader = true;
- this.init();
- }
+ connectedCallback() {
+ this.loader = true;
+ this.init();
+ }
- init() {
- this.showSpinner = true;
- oninit({
- pageSizeLWC: this.pageSize,
- pageTokenLWC: this.currentPageToken,
- sortFieldLWC: this.sortBy,
- sortOrderLWC: this.sortDirection
- }).then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log("result.pageRecords = " + JSON.stringify(result.entity.pageRecords));
- console.log("result.consumableorderdetailsRecords = " + JSON.stringify(result.entity.consumableorderdetailsRecords));
- console.log("result.status = " + result.status);
- console.log("result = " + JSON.stringify(result));
- console.log("result 1= " + JSON.stringify(result.entity));
- console.log("result 2= " + JSON.stringify(result.entity.pageRecords));
- if (result.status == "Success") {
- console.log('result.entity.paginatedAccounts = ' + JSON.stringify(result.entity.paginatedAccounts));
- this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
- this.totalRecords = result.entity.paginatedAccounts.totalRecords;
- this.recordStart = result.entity.paginatedAccounts.recordStart;
- this.recordEnd = result.entity.paginatedAccounts.recordEnd;
- this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize);
- console.log('this.totalPages = ' + this.totalPages);
- this.paginationVisibility = this.totalPages > 1 ? true : false;
+ init() {
+ this.showSpinner = true;
+ oninit({
+ pageSizeLWC: this.pageSize,
+ pageTokenLWC: this.currentPageToken,
+ sortFieldLWC: this.sortBy,
+ sortOrderLWC: this.sortDirection
+ })
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log(
+ 'result.pageRecords = ' +
+ JSON.stringify(result.entity.pageRecords)
+ );
+ console.log(
+ 'result.consumableorderdetailsRecords = ' +
+ JSON.stringify(
+ result.entity.consumableorderdetailsRecords
+ )
+ );
+ console.log('result.status = ' + result.status);
+ console.log('result = ' + JSON.stringify(result));
+ console.log('result 1= ' + JSON.stringify(result.entity));
+ console.log(
+ 'result 2= ' + JSON.stringify(result.entity.pageRecords)
+ );
+ if (result.status == 'Success') {
+ console.log(
+ 'result.entity.paginatedAccounts = ' +
+ JSON.stringify(result.entity.paginatedAccounts)
+ );
+ this.nextPageToken =
+ result.entity.paginatedAccounts.nextPageToken;
+ this.totalRecords =
+ result.entity.paginatedAccounts.totalRecords;
+ this.recordStart =
+ result.entity.paginatedAccounts.recordStart;
+ this.recordEnd = result.entity.paginatedAccounts.recordEnd;
+ this.totalPages = Math.ceil(
+ result.entity.paginatedAccounts.totalRecords /
+ this.pageSize
+ );
+ console.log('this.totalPages = ' + this.totalPages);
+ this.paginationVisibility =
+ this.totalPages > 1 ? true : false;
- this.loader = false;
- this.data = result.entity.pageRecords;
- this.productkucun = result.entity.productkucun;
+ this.loader = false;
+ this.data = result.entity.pageRecords;
+ this.productkucun = result.entity.productkucun;
- for (var i in this.data) {
- this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
- this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c;
- this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c;
- this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c;
- this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c;
- }
- this.showTable = true;
- this.orderDetZaikuList = result.entity.orderDetZaikuList;
- this.accountName = result.entity.accountName;
- this.agencyProType = result.entity.agencyProType;
- this.userWorkLocation = result.entity.userWorkLocation;
- let option1ValueTemp = [];
- for (var key in result.entity.categoryOptionMap) {
- let object = {};
- object['label'] = result.entity.categoryOptionMap[key];
- object['value'] = key;
- option1ValueTemp.push(object);
- }
- this.category3Options = option1ValueTemp;
- console.log(' this.optionscatone===>' + JSON.stringify(this.optionscatone));
- let option2ValueTemp = [];
- for (var key in result.entity.category4OptionMap) {
- let object = {};
- object["label"] = result.entity.category4OptionMap[key];
- object["value"] = key;
- option2ValueTemp.push(object);
- }
- this.category4Options = option2ValueTemp;
- let option3ValueTemp = [];
- for (var key in result.entity.category5OptionMap) {
- let object = {};
- object["label"] = result.entity.category5OptionMap[key];
- object["value"] = key;
- option3ValueTemp.push(object);
- }
- this.category5Options = option3ValueTemp;
- this.hasHos = result.entity.hasHos;
- console.log('this.hasHos'+this.hasHos);
- //棰滆壊鏍囪
-
- //hasHos = true 鍖婚櫌鐗逛环
- if (this.hasHos) {
- let object1 = {
- label: "鍖婚櫌鐗逛环",
- fieldName: "hospitalSpecialOffer__c",
- hideDefaultActions: true,
- type:'boolean',
- cellAttributes: { alignment: "left" },
- initialWidth:80
+ for (var i in this.data) {
+ this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
+ this.data[i]['Category3__c'] =
+ this.data[i].Prod.Category3__c;
+ this.data[i]['Category4__c'] =
+ this.data[i].Prod.Category4__c;
+ this.data[i]['Category5__c'] =
+ this.data[i].Prod.Category5__c;
+ this.data[i]['SFDA_Status__c'] =
+ this.data[i].Prod.SFDA_Status__c;
+ }
+ this.showTable = true;
+ this.orderDetZaikuList = result.entity.orderDetZaikuList;
+ this.accountName = result.entity.accountName;
+ this.agencyProType = result.entity.agencyProType;
+ this.userWorkLocation = result.entity.userWorkLocation;
+ let option1ValueTemp = [];
+ for (var key in result.entity.categoryOptionMap) {
+ let object = {};
+ object['label'] = result.entity.categoryOptionMap[key];
+ object['value'] = key;
+ option1ValueTemp.push(object);
+ }
+ this.category3Options = option1ValueTemp;
+ console.log(
+ ' this.optionscatone===>' +
+ JSON.stringify(this.optionscatone)
+ );
+ let option2ValueTemp = [];
+ for (var key in result.entity.category4OptionMap) {
+ let object = {};
+ object['label'] = result.entity.category4OptionMap[key];
+ object['value'] = key;
+ option2ValueTemp.push(object);
+ }
+ this.category4Options = option2ValueTemp;
+ let option3ValueTemp = [];
+ for (var key in result.entity.category5OptionMap) {
+ let object = {};
+ object['label'] = result.entity.category5OptionMap[key];
+ object['value'] = key;
+ option3ValueTemp.push(object);
+ }
+ this.category5Options = option3ValueTemp;
+ this.hasHos = result.entity.hasHos;
+ console.log('this.hasHos' + this.hasHos);
+ //棰滆壊鏍囪
- };
- this.columns.push(object1);
- console.log(' this.columns'+ this.columns);
- for (var j in this.data) {
- this.data[j]["Name__c"] = this.data[j].Prod.Name__c;
- this.data[j]["Category3__c"] = this.data[j].Prod.Category3__c;
- this.data[j]["Category4__c"] = this.data[j].Prod.Category4__c;
- this.data[j]["Category5__c"] = this.data[j].Prod.Category5__c;
- this.data[j]["SFDA_Status__c"] = this.data[j].Prod.SFDA_Status__c;
- this.data[j]["hospitalSpecialOffer__c"] = this.data[j].hospitalSpecialOffer;
- console.log('this.data[j].hospitalSpecialOffer__c'+this.data[j].hospitalSpecialOffer);
- }
+ //hasHos = true 鍖婚櫌鐗逛环
+ if (this.hasHos) {
+ let object1 = {
+ label: '鍖婚櫌鐗逛环',
+ fieldName: 'hospitalSpecialOffer__c',
+ hideDefaultActions: true,
+ type: 'boolean',
+ cellAttributes: { alignment: 'left' },
+ initialWidth: 80
+ };
+ this.columns.push(object1);
+ console.log(' this.columns' + this.columns);
+ for (var j in this.data) {
+ this.data[j]['Name__c'] = this.data[j].Prod.Name__c;
+ this.data[j]['Category3__c'] =
+ this.data[j].Prod.Category3__c;
+ this.data[j]['Category4__c'] =
+ this.data[j].Prod.Category4__c;
+ this.data[j]['Category5__c'] =
+ this.data[j].Prod.Category5__c;
+ this.data[j]['SFDA_Status__c'] =
+ this.data[j].Prod.SFDA_Status__c;
+ this.data[j]['hospitalSpecialOffer__c'] =
+ this.data[j].hospitalSpecialOffer;
+ console.log(
+ 'this.data[j].hospitalSpecialOffer__c' +
+ this.data[j].hospitalSpecialOffer
+ );
+ }
+ }
+ this.showSpinner = false;
+ } else {
+ // this.showToast("Error",'Error', result.msg);
+ this.showMyToast('鍒濆鍖栧け璐�', result.msg, 'error');
}
- this.showSpinner = false;
- } else {
- // this.showToast("Error",'Error', result.msg);
- this.showMyToast('鍒濆鍖栧け璐�',result.msg,'error');
- }
- }).catch((error) => {
- this.loader = false;
- this.showSpinner = false;
- console.log("error = " + JSON.stringify(error));
- });
- }
+ })
+ .catch((error) => {
+ this.loader = false;
+ this.showSpinner = false;
+ console.log('error = ' + JSON.stringify(error));
+ });
+ }
- handleChange(event) {
- let fieldName = event.target.getAttribute("data-field");
- let value = event.detail.value;
- console.log("======>fieldName" + fieldName);
- console.log("======>value" + value);
- switch (fieldName) {
- case "Name":
- this.Name = value;
- break;
- case "CategoryThree":
- this.CategoryThree = value;
- break;
- case "CategoryFour":
- this.CategoryFour = value;
- break;
- case "CategoryFive":
- this.CategoryFive = value;
- break;
- default:
- console.log("no data");
- }
- }
- dataChange(event) {
- let fieldName = event.target.getAttribute("data-field");
+ handleChange(event) {
+ let fieldName = event.target.getAttribute('data-field');
let value = event.detail.value;
- console.log("fieldName = " + fieldName + " value = " + value);
+ console.log('======>fieldName' + fieldName);
+ console.log('======>value' + value);
switch (fieldName) {
- case "Name":
- this.Name = value;
- break;
- case "CategoryThree":
+ case 'Name':
+ this.Name = value;
+ break;
+ case 'CategoryThree':
+ this.CategoryThree = value;
+ break;
+ case 'CategoryFour':
+ this.CategoryFour = value;
+ break;
+ case 'CategoryFive':
+ this.CategoryFive = value;
+ break;
+ default:
+ console.log('no data');
+ }
+ }
+ dataChange(event) {
+ let fieldName = event.target.getAttribute('data-field');
+ let value = event.detail.value;
+ console.log('fieldName = ' + fieldName + ' value = ' + value);
+ switch (fieldName) {
+ case 'Name':
+ this.Name = value;
+ break;
+ case 'CategoryThree':
this.CategoryThree = value;
//璋冪敤鍚庡彴鏄剧ず绗洓浜斿垎绫�
this.showAllCate();
@@ -338,7 +369,7 @@
this.CategoryFive = '';
}
break;
- case "CategoryFour":
+ case 'CategoryFour':
this.CategoryFour = value;
//璋冪敤鍚庡彴鏄剧ず绗簲鍒嗙被
this.showCate();
@@ -346,215 +377,242 @@
this.CategoryFive = '';
}
break;
- case "CategoryFive":
+ case 'CategoryFive':
this.CategoryFive = value;
break;
}
}
-
- showAllCate() {
+ showAllCate() {
categoryAllload({
category3LWC: this.CategoryThree,
- agencyProTypeLWC:this.agencyProType
- }).then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log("result = " + JSON.stringify(result));
- if (result.status == "Success") {
- this.category4Options = [];
- this.category5Options = [];
- //绗�4鍒嗙被
- for (var key in result.entity.category4OptionMap) {
- let object = {};
- object["label"] = result.entity.category4OptionMap[key];
- object["value"] = key;
- this.category4Options.push(object);
+ agencyProTypeLWC: this.agencyProType
+ })
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result = ' + JSON.stringify(result));
+ if (result.status == 'Success') {
+ this.category4Options = [];
+ this.category5Options = [];
+ //绗�4鍒嗙被
+ for (var key in result.entity.category4OptionMap) {
+ let object = {};
+ object['label'] = result.entity.category4OptionMap[key];
+ object['value'] = key;
+ this.category4Options.push(object);
+ }
+ console.log(
+ 'this.category4Options = ' +
+ JSON.stringify(this.category4Options)
+ );
+ //绗�5鍒嗙被
+ for (var key in result.entity.category5OptionMap) {
+ let object = {};
+ object['label'] = result.entity.category5OptionMap[key];
+ object['value'] = key;
+ this.category5Options.push(object);
+ }
+ } else {
+ console.log('result = ' + JSON.stringify(result));
+ this.showMyToast(result.msg, '', 'error');
}
- console.log("this.category4Options = " + JSON.stringify(this.category4Options));
- //绗�5鍒嗙被
- for (var key in result.entity.category5OptionMap) {
- let object = {};
- object["label"] = result.entity.category5OptionMap[key];
- object["value"] = key;
- this.category5Options.push(object);
+ })
+ .catch((error) => {
+ console.log('error' + JSON.stringify(error));
+ });
+ }
+
+ searchOrderDetail() {
+ this.showTable = false;
+ this.showSpinner = true;
+ searchOrder({
+ category1: this.Name,
+ Category3: this.CategoryThree,
+ Category4: this.CategoryFour,
+ Category5: this.CategoryFive,
+ orderDetZaikuListLWC: JSON.stringify(this.orderDetZaikuList),
+ accountName: this.accountName,
+ agencyProType: this.agencyProType,
+ userWorkLocation: this.userWorkLocation,
+ pageSizeLWC: this.pageSize,
+ pageTokenLWC: this.currentPageToken,
+ productkucunLWC: this.productkucun
+
+ // sortFieldLWC: this.sortBy,
+ // sortOrderLWC: this.sortDirection
+ })
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ if (result.status == 'Success') {
+ this.nextPageToken =
+ result.entity.paginatedAccounts.nextPageToken;
+ this.totalRecords =
+ result.entity.paginatedAccounts.totalRecords;
+ this.recordStart =
+ result.entity.paginatedAccounts.recordStart;
+ this.recordEnd = result.entity.paginatedAccounts.recordEnd;
+ this.totalPages = Math.ceil(
+ result.entity.paginatedAccounts.totalRecords /
+ this.pageSize
+ );
+ console.log(
+ 'result.entity.paginatedAccounts = ' +
+ JSON.stringify(result.entity.paginatedAccounts)
+ );
+ console.log('this.totalPages = ' + this.totalPages);
+ this.paginationVisibility =
+ this.totalPages > 1 ? true : false;
+ console.log('this.sortDirection = ' + this.sortDirection);
+ // this.showToast("Success",'鎼滅储鎴愬姛', result.msg);
+ // this.showMyToast('鎼滅储鎴愬姛',result.msg,'success');
+ this.data = result.entity.pageRecords;
+ console.log('鎼滅储Data==>' + JSON.stringify(this.data));
+ for (var i in this.data) {
+ this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
+ this.data[i]['Category3__c'] =
+ this.data[i].Prod.Category3__c;
+ this.data[i]['Category4__c'] =
+ this.data[i].Prod.Category4__c;
+ this.data[i]['Category5__c'] =
+ this.data[i].Prod.Category5__c;
+ this.data[i]['SFDA_Status__c'] =
+ this.data[i].Prod.SFDA_Status__c;
+ this.data[i]['hospitalSpecialOffer__c'] =
+ this.data[i].hospitalSpecialOffer;
+ this.data[i]['guaranteeperiod'] =
+ this.data[i].guaranteeperiod;
+ }
+ this.data = [...this.data];
+ console.log('this.data = ' + JSON.stringify(this.data));
+ this.showTable = true;
+ this.showSpinner = false;
+ } else {
+ this.nextPageToken = this.pageSize;
+ this.totalRecords = 0;
+ this.recordStart = 0;
+ this.recordEnd = 0;
+ this.totalPages = 0;
+
+ // this.showToast("Error",'Error', result.msg);
+ // this.showMyToast('鎼滅储澶辫触',result.msg,'error');
+ this.showSpinner = false;
}
- } else {
- console.log("result = " + JSON.stringify(result));
- this.showMyToast(result.msg,'','error');
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showSpinner = false;
+ });
+ }
+ inventoryCount() {
+ this[NavigationMixin.Navigate]({
+ type: 'standard__webPage',
+ attributes: {
+ url: '/lexinventory'
}
- }).catch((error) => {
- console.log("error" + JSON.stringify(error));
});
}
- searchOrderDetail() {
- this.showTable = false;
- this.showSpinner = true;
- searchOrder({
- category1: this.Name,
- Category3: this.CategoryThree,
- Category4: this.CategoryFour,
- Category5: this.CategoryFive,
- orderDetZaikuListLWC: JSON.stringify(this.orderDetZaikuList),
- accountName: this.accountName,
- agencyProType: this.agencyProType,
- userWorkLocation: this.userWorkLocation,
- pageSizeLWC: this.pageSize,
- pageTokenLWC: this.currentPageToken,
- productkucunLWC: this.productkucun
-
- // sortFieldLWC: this.sortBy,
- // sortOrderLWC: this.sortDirection
- })
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- if (result.status == "Success") {
- this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
- this.totalRecords = result.entity.paginatedAccounts.totalRecords;
- this.recordStart = result.entity.paginatedAccounts.recordStart;
- this.recordEnd = result.entity.paginatedAccounts.recordEnd;
- this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize);
- console.log('result.entity.paginatedAccounts = ' + JSON.stringify(result.entity.paginatedAccounts));
- console.log('this.totalPages = ' + this.totalPages);
- this.paginationVisibility = this.totalPages > 1 ? true : false;
- console.log('this.sortDirection = ' + this.sortDirection);
- // this.showToast("Success",'鎼滅储鎴愬姛', result.msg);
- // this.showMyToast('鎼滅储鎴愬姛',result.msg,'success');
- this.data = result.entity.pageRecords;
- console.log('鎼滅储Data==>'+JSON.stringify(this.data));
- for (var i in this.data) {
- this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
- this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c;
- this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c;
- this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c;
- this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c;
- this.data[i]["hospitalSpecialOffer__c"] = this.data[i].hospitalSpecialOffer;
- this.data[i]["guaranteeperiod"] = this.data[i].guaranteeperiod;
- }
- this.data = [...this.data];
- console.log('this.data = ' + JSON.stringify(this.data));
- this.showTable = true;
- this.showSpinner = false;
- } else {
- this.nextPageToken = this.pageSize;
- this.totalRecords = 0;
- this.recordStart = 0;
- this.recordEnd = 0;
- this.totalPages =0;
+ handleExpired() {
+ console.log('杩囨湡搴撳瓨鍛㈤攢瀛�');
+ this[NavigationMixin.Navigate]({
+ type: 'standard__webPage',
+ attributes: {
+ url: '/lexoverduestock'
+ }
+ });
+ }
+ removeBox() {
+ this[NavigationMixin.Navigate]({
+ type: 'standard__webPage',
+ attributes: {
+ url: '/lexremovebox'
+ }
+ });
+ }
+ cancelremoveBox() {
+ this[NavigationMixin.Navigate]({
+ type: 'standard__webPage',
+ attributes: {
+ url: '/lexcancelremovebox'
+ }
+ });
+ }
- // this.showToast("Error",'Error', result.msg);
- // this.showMyToast('鎼滅储澶辫触',result.msg,'error');
- this.showSpinner = false;
- }
- })
- .catch((error) => {
- console.log("error = " + JSON.stringify(error));
- this.showSpinner = false;
- });
- }
- inventoryCount() {
- this[NavigationMixin.Navigate]({
- type: 'standard__webPage',
- attributes: {
- url: '/lexinventory'
- }
- });
- }
+ clearAll() {
+ this.showSpinner = true;
+ this.showTable = false;
+ this.Name = '';
+ this.CategoryThree = '';
+ this.CategoryFour = '';
+ this.CategoryFive = '';
+ this.template.querySelectorAll('lightning-combobox').forEach((each) => {
+ each.value = null;
+ });
+ console.log(' this.CategoryThree' + this.CategoryThree);
+ console.log('鏁版嵁鍒楄〃' + this.data);
+ searchOrder({
+ category1: this.Name,
+ Category3: this.CategoryThree,
+ Category4: this.CategoryFour,
+ Category5: this.CategoryFive,
+ orderDetZaikuListLWC: JSON.stringify(this.orderDetZaikuList),
+ accountName: this.accountName,
+ agencyProType: this.agencyProType,
+ userWorkLocation: this.userWorkLocation,
+ pageSizeLWC: this.pageSize,
+ pageTokenLWC: this.currentPageToken
+ })
+ .then((result) => {
+ console.log('result鎼滅储 = ' + JSON.stringify(result));
+ result = JSON.parse(JSON.stringify(result));
+ if (result.status == 'Success') {
+ this.nextPageToken =
+ result.entity.paginatedAccounts.nextPageToken;
+ this.totalRecords =
+ result.entity.paginatedAccounts.totalRecords;
+ this.recordStart =
+ result.entity.paginatedAccounts.recordStart;
+ this.recordEnd = result.entity.paginatedAccounts.recordEnd;
+ this.totalPages = Math.ceil(
+ result.entity.paginatedAccounts.totalRecords /
+ this.pageSize
+ );
+ console.log('this.totalPages = ' + this.totalPages);
+ this.paginationVisibility =
+ this.totalPages > 1 ? true : false;
+ console.log('this.sortDirection = ' + this.sortDirection);
+ this.data = result.entity.pageRecords;
- handleExpired() {
- console.log('杩囨湡搴撳瓨鍛㈤攢瀛�');
- this[NavigationMixin.Navigate]({
- type: 'standard__webPage',
- attributes: {
- url: '/lexoverduestock'
- }
- });
+ for (var i in this.data) {
+ this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
+ this.data[i]['Category3__c'] =
+ this.data[i].Prod.Category3__c;
+ this.data[i]['Category4__c'] =
+ this.data[i].Prod.Category4__c;
+ this.data[i]['Category5__c'] =
+ this.data[i].Prod.Category5__c;
+ this.data[i]['SFDA_Status__c'] =
+ this.data[i].Prod.SFDA_Status__c;
+ this.data[i]['guaranteeperiod'] =
+ this.data[i].guaranteeperiod;
+ }
+ this.showSpinner = false;
+ this.showTable = true;
+ // this.showMyToast('鎼滅储鎴愬姛',result.msg,'success');
+ // this.showToast("Success",'鎼滅储鎴愬姛', result.msg);
+ } else {
+ // this.showToast("Error", 'Error',result.msg);
+ // this.showMyToast('鎼滅储澶辫触',result.msg,'error');
+ this.showSpinner = false;
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showSpinner = false;
+ });
+ }
- }
- removeBox() {
- this[NavigationMixin.Navigate]({
- type: 'standard__webPage',
- attributes: {
- url: '/lexremovebox'
- }
- });
-
- }
- cancelremoveBox() {
- this[NavigationMixin.Navigate]({
- type: 'standard__webPage',
- attributes: {
- url: '/lexcancelremovebox'
- }
- });
-
- }
-
- clearAll() {
- this.showSpinner = true;
- this.showTable = false;
- this.Name = '';
- this.CategoryThree = '';
- this.CategoryFour = '';
- this.CategoryFive = '';
- this.template.querySelectorAll("lightning-combobox").forEach((each) => {
- each.value = null;
- });
- console.log(' this.CategoryThree' + this.CategoryThree);
- console.log('鏁版嵁鍒楄〃' + this.data);
- searchOrder({
- category1: this.Name,
- Category3: this.CategoryThree,
- Category4: this.CategoryFour,
- Category5: this.CategoryFive,
- orderDetZaikuListLWC: JSON.stringify(this.orderDetZaikuList),
- accountName: this.accountName,
- agencyProType: this.agencyProType,
- userWorkLocation: this.userWorkLocation,
- pageSizeLWC: this.pageSize,
- pageTokenLWC: this.currentPageToken,
- })
- .then((result) => {
- console.log("result鎼滅储 = " + JSON.stringify(result));
- result = JSON.parse(JSON.stringify(result));
- if (result.status == "Success") {
-
- this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
- this.totalRecords = result.entity.paginatedAccounts.totalRecords;
- this.recordStart = result.entity.paginatedAccounts.recordStart;
- this.recordEnd = result.entity.paginatedAccounts.recordEnd;
- this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize);
- console.log('this.totalPages = ' + this.totalPages);
- this.paginationVisibility = this.totalPages > 1 ? true : false;
- console.log('this.sortDirection = ' + this.sortDirection);
- this.data = result.entity.pageRecords;
-
- for (var i in this.data) {
- this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
- this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c;
- this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c;
- this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c;
- this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c;
- this.data[i]["guaranteeperiod"] = this.data[i].guaranteeperiod;
- }
- this.showSpinner = false;
- this.showTable = true;
- // this.showMyToast('鎼滅储鎴愬姛',result.msg,'success');
- // this.showToast("Success",'鎼滅储鎴愬姛', result.msg);
- } else {
- // this.showToast("Error", 'Error',result.msg);
- // this.showMyToast('鎼滅储澶辫触',result.msg,'error');
- this.showSpinner = false;
-
- }
- })
- .catch((error) => {
- console.log("error = " + JSON.stringify(error));
- this.showSpinner = false;
- });
- }
-
- sortByMethod(field, reverse, primer) {
+ sortByMethod(field, reverse, primer) {
const key = primer
? function (x) {
return primer(x[field]);
@@ -570,86 +628,98 @@
};
}
- onHandleSort(event) {
- console.log("Sort");
- this.sortBy = event.detail.fieldName;
- this.sortDirection = event.detail.sortDirection;
- this.currentPageToken = 0;
- console.log('this.sortBy = ' + this.sortBy)
- console.log('this.sortDirection = ' + this.sortDirection)
- // if('limitCount' != this.sortBy)
- // this.searchOrderDetail();
- // else{
- // const { fieldName: sortedBy, sortDirection } = event.detail;
- // const cloneData = [...this.data];
- // cloneData.sort(this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1));
- // this.data = cloneData;
- // this.sortDirection = sortDirection;
- // this.sortedBy = sortedBy;
- // }
- const { fieldName: sortedBy, sortDirection } = event.detail;
- const cloneData = [...this.data];
- cloneData.sort(this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1));
- this.data = cloneData;
- this.sortDirection = sortDirection;
- this.sortedBy = sortedBy;
- }
- handlePaginatorChange(event) {
- this.recordsToDisplay = event.detail.recordsToDisplay;
- this.preSelected = event.detail.preSelected;
- if (this.recordsToDisplay && this.recordsToDisplay > 0) {
- this.rowNumberOffset = this.recordsToDisplay[0].rowNumber - 1;
- } else {
- this.rowNumberOffset = 0;
- }
- }
+ onHandleSort(event) {
+ console.log('Sort');
+ this.sortBy = event.detail.fieldName;
+ this.sortDirection = event.detail.sortDirection;
+ this.currentPageToken = 0;
+ console.log('this.sortBy = ' + this.sortBy);
+ console.log('this.sortDirection = ' + this.sortDirection);
+ // if('limitCount' != this.sortBy)
+ // this.searchOrderDetail();
+ // else{
+ // const { fieldName: sortedBy, sortDirection } = event.detail;
+ // const cloneData = [...this.data];
+ // cloneData.sort(this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1));
+ // this.data = cloneData;
+ // this.sortDirection = sortDirection;
+ // this.sortedBy = sortedBy;
+ // }
+ const { fieldName: sortedBy, sortDirection } = event.detail;
+ const cloneData = [...this.data];
+ cloneData.sort(
+ this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1)
+ );
+ this.data = cloneData;
+ this.sortDirection = sortDirection;
+ this.sortedBy = sortedBy;
+ }
+ handlePaginatorChange(event) {
+ this.recordsToDisplay = event.detail.recordsToDisplay;
+ this.preSelected = event.detail.preSelected;
+ if (this.recordsToDisplay && this.recordsToDisplay > 0) {
+ this.rowNumberOffset = this.recordsToDisplay[0].rowNumber - 1;
+ } else {
+ this.rowNumberOffset = 0;
+ }
+ }
- handlePrevious() {
- this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize);
- this.searchOrderDetail();
- }
+ handlePrevious() {
+ this.currentPageToken =
+ Number(this.currentPageToken) - Number(this.pageSize);
+ this.searchOrderDetail();
+ }
- handleNext() {
- this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize);
- this.searchOrderDetail();
- }
- handleFirst() {
- this.currentPageToken = 0;
- this.searchOrderDetail();
- }
+ handleNext() {
+ this.currentPageToken =
+ Number(this.currentPageToken) + Number(this.pageSize);
+ this.searchOrderDetail();
+ }
+ handleFirst() {
+ this.currentPageToken = 0;
+ this.searchOrderDetail();
+ }
- handleLast() {
- this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
- this.searchOrderDetail();
- }
+ handleLast() {
+ this.currentPageToken =
+ this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
+ this.searchOrderDetail();
+ }
- handlePageschange(event) {
- console.log(event.detail);
- this.pageSize = event.detail;
- this.currentPageToken = 0;
- this.searchOrderDetail();
- }
- get previousButtonDisabled() {
- return this.currentPageToken === 0;
- }
+ handlePageschange(event) {
+ console.log(event.detail);
+ this.pageSize = event.detail;
+ this.currentPageToken = 0;
+ this.searchOrderDetail();
+ }
+ get previousButtonDisabled() {
+ return this.currentPageToken === 0;
+ }
- get nextButtonDisabled() {
- return this.nextPageToken === undefined;
- }
- showMyToast(title, message, variant) {
+ get nextButtonDisabled() {
+ return this.nextPageToken === undefined;
+ }
+ showMyToast(title, message, variant) {
console.log('show custom message');
var iconName = '';
var content = '';
- if(variant == 'success'){
- iconName = 'utility:check';
- }else{
- iconName = 'utility:error';
+ if (variant == 'success') {
+ iconName = 'utility:check';
+ } else {
+ iconName = 'utility:error';
}
- if(message != ''){
- content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
- }else{
- content = '<h2><strong>'+title+'<strong/></h2>';
+ if (message != '') {
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
+ } else {
+ content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template.querySelector('c-common-toast').showToast(variant,content,iconName,10000);
- }
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
+ }
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.html b/force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.html
index 8294ccc..93200b0 100644
--- a/force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.html
+++ b/force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.html
@@ -1,13 +1,32 @@
<template>
<template if:true={records}>
- <div class="slds-grid slds-grid_vertical-align-center slds-grid_align-spread">
- <div class="slds-col"><!--RECORDS PER PAGE-->
- <div style={paginationVisibility} class="slds-list_inline slds-p-bottom_xx-small customSelect">
- <label class="slds-text-color_weak slds-p-horizontal_x-small" for="recordsPerPage">Page Size:</label>
+ <div
+ class="slds-grid slds-grid_vertical-align-center slds-grid_align-spread"
+ >
+ <div class="slds-col">
+ <!--RECORDS PER PAGE-->
+ <div
+ style={paginationVisibility}
+ class="slds-list_inline slds-p-bottom_xx-small customSelect"
+ >
+ <label
+ class="slds-text-color_weak slds-p-horizontal_x-small"
+ for="recordsPerPage"
+ >Page Size:</label
+ >
<div class="slds-select_container">
- <select class="slds-select" id="recordsPerPage" onchange={handleRecordsPerPage}>
- <template for:each={pageSizeOptions} for:item="option">
- <option key={option} value={option}>{option}</option>
+ <select
+ class="slds-select"
+ id="recordsPerPage"
+ onchange={handleRecordsPerPage}
+ >
+ <template
+ for:each={pageSizeOptions}
+ for:item="option"
+ >
+ <option key={option} value={option}>
+ {option}
+ </option>
</template>
</select>
</div>
@@ -22,59 +41,101 @@
</div> -->
</div>
- <div class="slds-grid slds-grid_vertical-align-center slds-grid_align-spread">
- <div class="slds-col">
+ <div
+ class="slds-grid slds-grid_vertical-align-center slds-grid_align-spread"
+ >
+ <div class="slds-col">
<div class="slds-col slds-p-bottom_xx-small">
<span>
- <label class="slds-text-color_weak slds-p-horizontal_x-small" >Total: {filtredNum}</label>
- </span>
+ <label
+ class="slds-text-color_weak slds-p-horizontal_x-small"
+ >Total: {filtredNum}</label
+ >
+ </span>
<span>
- <label class="slds-text-color_weak slds-p-horizontal_x-small" >Selected: {totalSelected}</label>
- </span>
+ <label
+ class="slds-text-color_weak slds-p-horizontal_x-small"
+ >Selected: {totalSelected}</label
+ >
+ </span>
</div>
</div>
- </div>
-
+ </div>
- <div class="slds-grid slds-grid_vertical-align-center slds-grid_align-spread" >
+ <div
+ class="slds-grid slds-grid_vertical-align-center slds-grid_align-spread"
+ >
<div class="slds-col" style={tableHeightStyle}>
- <lightning-datatable key-field={keyField}
- hide-checkbox-column = {hidecheckboxcolumn}
- data={recordsToDisplay}
+ <lightning-datatable
+ key-field={keyField}
+ hide-checkbox-column={hidecheckboxcolumn}
+ data={recordsToDisplay}
columns={columns}
- max-row-selection={maxRowSelection}
- onrowselection={getSelectedRows}
- selected-rows={preSelected}
+ max-row-selection={maxRowSelection}
+ onrowselection={getSelectedRows}
+ selected-rows={preSelected}
default-sort-direction={defaultSortDirection}
sorted-direction={sortDirection}
sorted-by={sortedBy}
onsort={handelSort}
- show-row-number-column = {showrownumber}>
- </lightning-datatable>
+ show-row-number-column={showrownumber}
+ >
+ </lightning-datatable>
</div>
- </div>
+ </div>
- <div class="slds-grid slds-grid_vertical-align-center slds-grid_align-spread" style="padding-top: 0.5em;">
+ <div
+ class="slds-grid slds-grid_vertical-align-center slds-grid_align-spread"
+ style="padding-top: 0.5em"
+ >
<div class="slds-col"></div>
<div class="slds-col"></div>
<!--PAGE NAVIGATION-->
<div class="slds-col">
- <div style={paginationVisibility}>
- <div class="slds-col slds-p-bottom_xx-small">
+ <div style={paginationVisibility}>
+ <div class="slds-col slds-p-bottom_xx-small">
<span>
- <lightning-button-icon icon-name="utility:chevronleft" variant="bare" size="medium" alternative-text="Previous Page" onclick={previousPage}></lightning-button-icon>
+ <lightning-button-icon
+ icon-name="utility:chevronleft"
+ variant="bare"
+ size="medium"
+ alternative-text="Previous Page"
+ onclick={previousPage}
+ ></lightning-button-icon>
</span>
- <label class="slds-text-color_weak slds-p-horizontal_x-small" for="pageNum">Page:</label>
- <input type="number" id="pageNum" value={pageNumber} maxlength="4" onkeypress={handlePageNumberChange} class="customInput" title="Go to a Page"></input>
- <span> of <b id="totalPages">{totalPages}</b></span>
+ <label
+ class="slds-text-color_weak slds-p-horizontal_x-small"
+ for="pageNum"
+ >Page:</label
+ >
+ <input
+ type="number"
+ id="pageNum"
+ value={pageNumber}
+ maxlength="4"
+ onkeypress={handlePageNumberChange}
+ class="customInput"
+ title="Go to a Page"
+ />
+ <span
+ > of <b id="totalPages"
+ >{totalPages}</b
+ ></span
+ >
<span>
<template if:true={pageNumber}></template>
- <lightning-button-icon icon-name="utility:chevronright" variant="bare" size="medium" alternative-text="Next Page" onclick={nextPage} class="slds-p-horizontal_x-small"></lightning-button-icon>
- </span>
+ <lightning-button-icon
+ icon-name="utility:chevronright"
+ variant="bare"
+ size="medium"
+ alternative-text="Next Page"
+ onclick={nextPage}
+ class="slds-p-horizontal_x-small"
+ ></lightning-button-icon>
+ </span>
</div>
</div>
- </div>
+ </div>
</div>
-
- </template>
+ </template>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.js b/force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.js
index a6ede92..b201755 100644
--- a/force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.js
+++ b/force-app/main/default/lwc/lwcDatatableUtility/lwcDatatableUtility.js
@@ -1,35 +1,34 @@
-import { LightningElement, api,track } from 'lwc';
+import { LightningElement, api, track } from 'lwc';
import customUnitTemplate from './templates/customUnit.html';
import customShipmentNumberTemplate from './templates/customShipmentNumber.html';
import customShippingUnitPriceTemplate from './templates/customShippingUnitPrice.html';
const DELAY = 300;
-const recordsPerPage = [5,10,25,50,75,100];
+const recordsPerPage = [5, 10, 25, 50, 75, 100];
const pageNumber = 1;
const SHOWDIV = 'visibility:visible';
-const HIDEDIV = 'visibility:hidden';
+const HIDEDIV = 'visibility:hidden';
const DEFAULTHEIGHT = '300';
export default class LwcDatatableUtility extends LightningElement {
-
static customTypes = {
customUnit: {
template: customUnitTemplate,
standardCellLayout: true,
- typeAttributes: ['Id'],
+ typeAttributes: ['Id']
},
customShipment: {
template: customShipmentNumberTemplate,
standardCellLayout: true,
- typeAttributes: ['Id'],
+ typeAttributes: ['Id']
},
customShipmentUnitPrice: {
template: customShippingUnitPriceTemplate,
standardCellLayout: true,
- typeAttributes: ['Id'],
+ typeAttributes: ['Id']
}
// Other types here
- }
+ };
// Input Attributes from Parent Componant
@api keyField = 'Id';
@@ -38,32 +37,32 @@
@api pageSizeOptions = recordsPerPage; //Page size options; valid values are array of integers
@api totalRecords; //Total no.of records; valid type is Integer
@api records; //All records available in the data table; valid type is Array
- @api maxRowSelection; //All records available in the data table; valid type is Array
+ @api maxRowSelection; //All records available in the data table; valid type is Array
@api columns = []; //Records to be displayed on the page
@api hidecheckboxcolumn = false;
@api showrownumber = false;
-
- tableHeightStyle = 'height: '+ DEFAULTHEIGHT +'px;'; // Set Default Height as 300px
+
+ tableHeightStyle = 'height: ' + DEFAULTHEIGHT + 'px;'; // Set Default Height as 300px
@api
get tableHeight() {
return this.tableHeightStyle;
}
set tableHeight(value) {
- this.tableHeightStyle = 'height: '+ value +'px;';
- }
+ this.tableHeightStyle = 'height: ' + value + 'px;';
+ }
pageSize; //No.of records to be displayed per page
totalPages; //Total no.of pages
pageNumber = pageNumber; //Page number
searchKey; //Search Input
- paginationVisibility = SHOWDIV;
+ paginationVisibility = SHOWDIV;
rowNumberOffset; //Row number
preSelected; //preSelectedOnDisplay
recordsToDisplay = []; //Records to be displayed on the page
-
+
filteredRecords = []; //Filtered records available in the data table; valid type is Array
- selectedRecords = []; //OverallSelected records in the data table; valid type is Array
+ selectedRecords = []; //OverallSelected records in the data table; valid type is Array
pageSelectedRecords = []; //Page Selected rows in the data table; valid type is Array
filtredNum; // Total no.of Filtered records; valid type is Integer
totalSelected = 0;
@@ -71,95 +70,98 @@
//SORT
defaultSortDirection = 'asc';
sortDirection = 'asc';
- sortedBy;
+ sortedBy;
//Called after the component finishes inserting to DOM
connectedCallback() {
console.log('杩涘叆 瀛愮粍浠� connectedCallback ');
- console.log('this.records = ' + JSON.stringify(this.records));
+ console.log('this.records = ' + JSON.stringify(this.records));
console.log('keyField = ' + this.keyField);
- if(this.pageSizeOptions && this.pageSizeOptions.length > 0)
+ if (this.pageSizeOptions && this.pageSizeOptions.length > 0)
this.pageSize = this.pageSizeOptions[0];
- else{
+ else {
this.pageSize = this.totalRecords;
this.showPagination = false;
}
- this.paginationVisibility = this.showPagination === false ? HIDEDIV : SHOWDIV;
- this.filteredRecords = this.records;
+ this.paginationVisibility =
+ this.showPagination === false ? HIDEDIV : SHOWDIV;
+ this.filteredRecords = this.records;
this.filtredNum = this.totalRecords;
this.setRecordsOnPage();
}
- handleRecordsPerPage(event){
+ handleRecordsPerPage(event) {
this.pageSize = event.target.value;
this.setRecordsOnPage();
}
- handlePageNumberChange(event){
- if(event.keyCode === 13){
+ handlePageNumberChange(event) {
+ if (event.keyCode === 13) {
this.pageNumber = event.target.value;
this.setRecordsOnPage();
}
}
-
- previousPage(){
- this.pageNumber = this.pageNumber-1;
+
+ previousPage() {
+ this.pageNumber = this.pageNumber - 1;
this.setRecordsOnPage();
}
- nextPage(){
- this.pageNumber = this.pageNumber+1;
+ nextPage() {
+ this.pageNumber = this.pageNumber + 1;
this.setRecordsOnPage();
}
@api
- setRecordsOnPage(){
+ setRecordsOnPage() {
this.recordsToDisplay = [];
- if(!this.pageSize)
- this.pageSize = this.filtredNum;
+ if (!this.pageSize) this.pageSize = this.filtredNum;
- this.totalPages = Math.ceil(this.filtredNum/this.pageSize);
+ this.totalPages = Math.ceil(this.filtredNum / this.pageSize);
this.setPaginationControls();
- for(let i=(this.pageNumber-1)*this.pageSize; i < this.pageNumber*this.pageSize; i++){
- if(i === this.filtredNum) break;
+ for (
+ let i = (this.pageNumber - 1) * this.pageSize;
+ i < this.pageNumber * this.pageSize;
+ i++
+ ) {
+ if (i === this.filtredNum) break;
this.recordsToDisplay.push(this.filteredRecords[i]);
}
this.preSelected = [];
this.selectedRecords.forEach((item) => {
- if(item.selected)
- this.preSelected.push(item.Id);
- })
+ if (item.selected) this.preSelected.push(item.Id);
+ });
let paginatedRecords = new Object();
paginatedRecords.recordsToDisplay = this.recordsToDisplay;
paginatedRecords.preSelected = this.preSelected;
- if(this.maxRowSelection === '1' ){
+ if (this.maxRowSelection === '1') {
this.totalSelected = 0;
- }
- if(this.selectedRecords && this.selectedRecords.length > 0){
+ }
+ if (this.selectedRecords && this.selectedRecords.length > 0) {
this.refreshCurrentData = true;
- }
+ }
}
- setPaginationControls(){
+ setPaginationControls() {
// Previous/Next buttons visibility by Total pages
- if(this.totalPages === 1){
+ if (this.totalPages === 1) {
this.showPrevious = HIDEDIV;
this.showNext = HIDEDIV;
- }else if(this.totalPages > 1){
- this.showPrevious = SHOWDIV;
- this.showNext = SHOWDIV;
+ } else if (this.totalPages > 1) {
+ this.showPrevious = SHOWDIV;
+ this.showNext = SHOWDIV;
}
// Previous/Next buttons visibility by Page number
- if(this.pageNumber <= 1){
+ if (this.pageNumber <= 1) {
this.pageNumber = 1;
this.showPrevious = HIDEDIV;
- }else if(this.pageNumber >= this.totalPages){
+ } else if (this.pageNumber >= this.totalPages) {
this.pageNumber = this.totalPages;
this.showNext = HIDEDIV;
}
// Previous/Next buttons visibility by Pagination visibility
- if(this.paginationVisibility === HIDEDIV){
+ if (this.paginationVisibility === HIDEDIV) {
this.showPrevious = HIDEDIV;
this.showNext = HIDEDIV;
}
@@ -168,7 +170,7 @@
handleKeyChange(event) {
window.clearTimeout(this.delayTimeout);
const searchKey = event.target.value;
- if(searchKey){
+ if (searchKey) {
this.delayTimeout = setTimeout(() => {
//this.paginationVisibility = HIDEDIV;
this.setPaginationControls();
@@ -177,97 +179,119 @@
//Use other field name here in place of 'Name' field if you want to search by other field
//this.recordsToDisplay = this.records.filter(rec => rec.includes(searchKey));
//Search with any column value (Updated as per the feedback)
- this.filteredRecords = this.records.filter(rec => JSON.stringify(rec).toLowerCase().includes(searchKey.toLowerCase()));
- this.filtredNum = this.filteredRecords.length;
+ this.filteredRecords = this.records.filter((rec) =>
+ JSON.stringify(rec)
+ .toLowerCase()
+ .includes(searchKey.toLowerCase())
+ );
+ this.filtredNum = this.filteredRecords.length;
this.setRecordsOnPage();
}, DELAY);
- }else{
- this.filteredRecords = this.records;
- this.filtredNum = this.totalRecords;
+ } else {
+ this.filteredRecords = this.records;
+ this.filtredNum = this.totalRecords;
this.paginationVisibility = SHOWDIV;
this.setRecordsOnPage();
- }
+ }
}
handelRowsSelected(selectedRows) {
console.log(selectedRows.length);
this.totalSelected = 0;
this.pageSelectedRecords = [];
- if(this.maxRowSelection != '1' && this.recordsToDisplay &&
- this.recordsToDisplay.length > 0 &&
- ((selectedRows.length === 0 && !this.refreshCurrentData) || selectedRows.length > 0) ){
- this.recordsToDisplay.forEach((item)=>{
- var row = new Object();
- row.Id = item.Id;
- if(selectedRows.includes(item.Id)){
+ if (
+ this.maxRowSelection != '1' &&
+ this.recordsToDisplay &&
+ this.recordsToDisplay.length > 0 &&
+ ((selectedRows.length === 0 && !this.refreshCurrentData) ||
+ selectedRows.length > 0)
+ ) {
+ this.recordsToDisplay.forEach((item) => {
+ var row = new Object();
+ row.Id = item.Id;
+ if (selectedRows.includes(item.Id)) {
row.selected = true;
- }else{
+ } else {
row.selected = false;
}
- this.pageSelectedRecords.push(row) ;
- });
+ this.pageSelectedRecords.push(row);
+ });
}
// To store previous row Selection
- if(this.selectedRecords.length == 0 ){
+ if (this.selectedRecords.length == 0) {
this.selectedRecords = this.pageSelectedRecords;
}
- this.selectedRecords = this.mergeObjectArray(this.selectedRecords, this.pageSelectedRecords, "Id");
- if(this.maxRowSelection === '1' && selectedRows && selectedRows.length > 0){
+ this.selectedRecords = this.mergeObjectArray(
+ this.selectedRecords,
+ this.pageSelectedRecords,
+ 'Id'
+ );
+ if (
+ this.maxRowSelection === '1' &&
+ selectedRows &&
+ selectedRows.length > 0
+ ) {
this.totalSelected = 1;
- }else{
- let i=0;
- this.selectedRecords.forEach(item => {
- if(item.selected){
+ } else {
+ let i = 0;
+ this.selectedRecords.forEach((item) => {
+ if (item.selected) {
i++;
this.totalSelected = i;
}
- })
- //this.totalSelected = this.totalSelected ===1 && selectedRows.length ===0? 0: this.totalSelected;
+ });
+ //this.totalSelected = this.totalSelected ===1 && selectedRows.length ===0? 0: this.totalSelected;
}
- const filterSelected = this.selectedRecords.filter(({ selected }) => selected === true );
- this.dispatchEvent(new CustomEvent('setselectedrecords', {detail: filterSelected})); //Send records to display on table to the parent component
+ const filterSelected = this.selectedRecords.filter(
+ ({ selected }) => selected === true
+ );
+ this.dispatchEvent(
+ new CustomEvent('setselectedrecords', { detail: filterSelected })
+ ); //Send records to display on table to the parent component
this.refreshCurrentData = false;
}
- mergeObjectArray(firstArray, secondArray, prop){
- var reduced = firstArray.filter( aitem => ! secondArray.find ( bitem => aitem[prop] === bitem[prop]) )
+ mergeObjectArray(firstArray, secondArray, prop) {
+ var reduced = firstArray.filter(
+ (aitem) => !secondArray.find((bitem) => aitem[prop] === bitem[prop])
+ );
//let arr3 = arr1.map((item, i) => Object.assign({}, item, arr2[i]));
return reduced.concat(secondArray);
- }
+ }
getSelectedRows(event) {
const selectedRows = event.detail.selectedRows;
let selectedRecordIds = [];
// Display that fieldName of the selected rows
- for (let i = 0; i < selectedRows.length; i++){
+ for (let i = 0; i < selectedRows.length; i++) {
selectedRecordIds.push(selectedRows[i].Id);
- }
- this.handelRowsSelected(selectedRecordIds);
- }
+ }
+ this.handelRowsSelected(selectedRecordIds);
+ }
- handelSort(event){
+ handelSort(event) {
const { fieldName: sortedBy, sortDirection } = event.detail;
const cloneData = [...this.filteredRecords];
cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));
- this.filteredRecords = cloneData;
+ this.filteredRecords = cloneData;
this.sortDirection = sortDirection;
- this.sortedBy = sortedBy;
+ this.sortedBy = sortedBy;
this.setRecordsOnPage();
- }
+ }
sortBy(field, reverse, primer) {
const key = primer
- ? function(x) {
+ ? function (x) {
return primer(x[field]);
}
- : function(x) {
+ : function (x) {
return x[field];
};
- return function(a, b) {
+ return function (a, b) {
a = key(a);
b = key(b);
return reverse * ((a > b) - (b > a));
};
- }
+ }
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/myCustomTypeDatatable/customName.html b/force-app/main/default/lwc/myCustomTypeDatatable/customName.html
index f33c4ea..8292ef2 100644
--- a/force-app/main/default/lwc/myCustomTypeDatatable/customName.html
+++ b/force-app/main/default/lwc/myCustomTypeDatatable/customName.html
@@ -1,6 +1,7 @@
<template>
- <lightning-badge
+ <lightning-badge
label={typeAttributes.accountName}
- icon-name="standard:account">
+ icon-name="standard:account"
+ >
</lightning-badge>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/myCustomTypeDatatable/customNumber.html b/force-app/main/default/lwc/myCustomTypeDatatable/customNumber.html
index ae6203e..4bcd167 100644
--- a/force-app/main/default/lwc/myCustomTypeDatatable/customNumber.html
+++ b/force-app/main/default/lwc/myCustomTypeDatatable/customNumber.html
@@ -1,6 +1,12 @@
<template>
<div class="slds-p-around_x-small">
- <lightning-formatted-number value={value} class="slds-float_right"></lightning-formatted-number>
- <lightning-icon icon-name={typeAttributes.status} alternative-text="Employer Status"></lightning-icon>
+ <lightning-formatted-number
+ value={value}
+ class="slds-float_right"
+ ></lightning-formatted-number>
+ <lightning-icon
+ icon-name={typeAttributes.status}
+ alternative-text="Employer Status"
+ ></lightning-icon>
</div>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/myCustomTypeDatatable/customUnit.html b/force-app/main/default/lwc/myCustomTypeDatatable/customUnit.html
index 169416c..52ecbd1 100644
--- a/force-app/main/default/lwc/myCustomTypeDatatable/customUnit.html
+++ b/force-app/main/default/lwc/myCustomTypeDatatable/customUnit.html
@@ -4,5 +4,5 @@
<select>
<option value="鐩�">鐩�</option>
<option value="涓�">涓�</option>
- </select>
+ </select>
</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/myCustomTypeDatatable/myCustomTypeDatatable.html b/force-app/main/default/lwc/myCustomTypeDatatable/myCustomTypeDatatable.html
index ba53413..0440d2c 100644
--- a/force-app/main/default/lwc/myCustomTypeDatatable/myCustomTypeDatatable.html
+++ b/force-app/main/default/lwc/myCustomTypeDatatable/myCustomTypeDatatable.html
@@ -1,2 +1 @@
-<template>
-</template>
\ No newline at end of file
+<template> </template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/myCustomTypeDatatable/myCustomTypeDatatable.js b/force-app/main/default/lwc/myCustomTypeDatatable/myCustomTypeDatatable.js
index 5d161b7..d1ea9cd 100644
--- a/force-app/main/default/lwc/myCustomTypeDatatable/myCustomTypeDatatable.js
+++ b/force-app/main/default/lwc/myCustomTypeDatatable/myCustomTypeDatatable.js
@@ -1,4 +1,4 @@
-import { LightningElement,api,wire,track } from 'lwc';
+import { LightningElement, api, wire, track } from 'lwc';
import LightningDatatable from 'lightning/datatable';
import customUnitTemplate from './customUnit.html';
import customShipmentNumberTemplate from './customShipmentNumber.html';
@@ -6,10 +6,7 @@
import customNameTemplate from './customName.html';
import customNumberTemplate from './customNumber.html';
-
-export default class MyCustomTypeDatatable extends LightningDatatable {
-
-
+export default class MyCustomTypeDatatable extends LightningDatatable {
// static customTypes = {
// customUnit: {
// template: customUnitTemplate,
@@ -24,18 +21,18 @@
// //typeAttributes: ['value'],
// }
// // Other types here
- // }
+ // }
static customTypes = {
customName: {
template: customNameTemplate,
standardCellLayout: true,
- typeAttributes: ['accountName'],
+ typeAttributes: ['accountName']
}
// Other types here
- }
+ };
- connectedCallback(){
- console.log('MyCustomTypeDatatable enter')
+ connectedCallback() {
+ console.log('MyCustomTypeDatatable enter');
}
}
\ No newline at end of file
diff --git a/force-app/main/default/permissionsets/Community_LEX_PS.permissionset-meta.xml b/force-app/main/default/permissionsets/Community_LEX_PS.permissionset-meta.xml
index 449d434..4e2c37d 100644
--- a/force-app/main/default/permissionsets/Community_LEX_PS.permissionset-meta.xml
+++ b/force-app/main/default/permissionsets/Community_LEX_PS.permissionset-meta.xml
@@ -13,7 +13,15 @@
<enabled>true</enabled>
</classAccesses>
<classAccesses>
+ <apexClass>LexBTReportController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
<apexClass>LexCancelRemoveBoxController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexCancelRemoveBoxControllerTest</apexClass>
<enabled>true</enabled>
</classAccesses>
<classAccesses>
@@ -26,6 +34,10 @@
</classAccesses>
<classAccesses>
<apexClass>LexConInvoicedetailsController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexConsumApply_FromQISCtl</apexClass>
<enabled>true</enabled>
</classAccesses>
<classAccesses>
@@ -53,7 +65,15 @@
<enabled>true</enabled>
</classAccesses>
<classAccesses>
+ <apexClass>LexContractAuthorizeController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
<apexClass>LexDealerInquiryModifyStateController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexEquipmentRentalApply_FromQISCtl</apexClass>
<enabled>true</enabled>
</classAccesses>
<classAccesses>
@@ -61,7 +81,23 @@
<enabled>true</enabled>
</classAccesses>
<classAccesses>
+ <apexClass>LexInventoryHeaderClearStatusController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexInventoryHeaderController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
<apexClass>LexInventoryListController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexInventoryListControllerTest</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexInventoryListTest</apexClass>
<enabled>true</enabled>
</classAccesses>
<classAccesses>
@@ -69,7 +105,51 @@
<enabled>true</enabled>
</classAccesses>
<classAccesses>
+ <apexClass>LexInventoryViewControllerTest</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexInventoryViewTest</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
<apexClass>LexLicenceReminderController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexLicenceReminderControllerTest</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexLostSubmitApprovalController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexMeetingCostsController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexNewAndEditBasePIPLController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexNewAndEditContactPIPLController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexNewAndEditLeadPIPLController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexNewAndEditReportPIPLController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexNewSICustomNewController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexNoReportApplicationController</apexClass>
<enabled>true</enabled>
</classAccesses>
<classAccesses>
@@ -81,11 +161,47 @@
<enabled>true</enabled>
</classAccesses>
<classAccesses>
+ <apexClass>LexPaymentPlanLoadController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexPrintInspectupReportController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
<apexClass>LexProductLimitEditController</apexClass>
<enabled>true</enabled>
</classAccesses>
<classAccesses>
+ <apexClass>LexProductLimitEditControllerTest</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexProductLimitEditTest</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
<apexClass>LexRemoveBoxController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexRemoveBoxControllerTest</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexRentalApplySetSelectSubstitute</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexSIAbortBtnController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexSINewQuoteEntryController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexSISearchSetProductController</apexClass>
<enabled>true</enabled>
</classAccesses>
<classAccesses>
@@ -97,11 +213,35 @@
<enabled>true</enabled>
</classAccesses>
<classAccesses>
+ <apexClass>LexSearchAgencyHospitalTest</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
<apexClass>LexSearchContractController</apexClass>
<enabled>true</enabled>
</classAccesses>
<classAccesses>
<apexClass>LexSearchHospitalController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexSearchProductController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexSearchProductCsController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexSearchProductIraiController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexSearchSetProductController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexStockCancelController</apexClass>
<enabled>true</enabled>
</classAccesses>
<classAccesses>
@@ -113,7 +253,23 @@
<enabled>true</enabled>
</classAccesses>
<classAccesses>
+ <apexClass>LexTopPageControllerTest</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexTransferApplyController</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
<apexClass>LexUpAccountProLimit</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexUpAccountProLimitControllerTest</apexClass>
+ <enabled>true</enabled>
+ </classAccesses>
+ <classAccesses>
+ <apexClass>LexUpAccountProLimitTest</apexClass>
<enabled>true</enabled>
</classAccesses>
<classAccesses>
@@ -121,13 +277,13 @@
<enabled>true</enabled>
</classAccesses>
<classAccesses>
- <apexClass>lexSearchAgencyHospitalController</apexClass>
+ <apexClass>LexUtilityTest</apexClass>
<enabled>true</enabled>
</classAccesses>
- <flowAccesses>
+ <classAccesses>
+ <apexClass>LexVisitReportCancelController</apexClass>
<enabled>true</enabled>
- <flow>CommunityWeeklyReport</flow>
- </flowAccesses>
+ </classAccesses>
<hasActivationRequired>false</hasActivationRequired>
<label>Community LEX PS</label>
<objectPermissions>
diff --git a/force-app/main/default/triggers/ContentDocumentLink.trigger b/force-app/main/default/triggers/ContentDocumentLink.trigger
index 368da2a..2ea867a 100644
--- a/force-app/main/default/triggers/ContentDocumentLink.trigger
+++ b/force-app/main/default/triggers/ContentDocumentLink.trigger
@@ -1,8 +1,8 @@
trigger ContentDocumentLink on ContentDocumentLink (before delete, after insert) {
- if((!Test.isRunningTest())&&UserInfo.getUserId()==System.Label.ByPassTrigger){
- return;
- }
+ // if((!Test.isRunningTest())&&UserInfo.getUserId()==System.Label.ByPassTrigger){
+ // return;
+ // }
system.debug('enter ContentDocumentLink');
system.debug('Trigger.new = ' + (List<ContentDocumentLink>) Trigger.new);
system.debug('Trigger.old = ' + (List<ContentDocumentLink>) Trigger.old);
diff --git a/force-app/main/default/triggers/ContentDocumentTrigger.trigger b/force-app/main/default/triggers/ContentDocumentTrigger.trigger
index 68a2e4e..319adf6 100644
--- a/force-app/main/default/triggers/ContentDocumentTrigger.trigger
+++ b/force-app/main/default/triggers/ContentDocumentTrigger.trigger
@@ -1,7 +1,7 @@
trigger ContentDocumentTrigger on ContentDocument(before delete) {
- if((!Test.isRunningTest())&&UserInfo.getUserId()==System.Label.ByPassTrigger){
- return;
- }
+ // if((!Test.isRunningTest())&&UserInfo.getUserId()==System.Label.ByPassTrigger){
+ // return;
+ // }
System.debug('enter ContentDocumentTrigger');
// system.debug('Trigger.new = ' + (List<ContentDocument>) Trigger.new);
// system.debug('Trigger.old = ' + (List<ContentDocument>) Trigger.old);
diff --git a/manifest/LEXC01packagelexcommunitynew.xml b/manifest/LEXC01packagelexcommunitynew.xml
index 6f55697..6bb0960 100644
--- a/manifest/LEXC01packagelexcommunitynew.xml
+++ b/manifest/LEXC01packagelexcommunitynew.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>LexArriveGoodsMainController</members>
@@ -86,20 +86,16 @@
<members>lexinventoryViewLWC</members>
<members>lwcDatatableUtility</members>
<members>myCustomTypeDatatable</members>
- <members>paginator</members>
+ <members>paginator</members>
<members>navigateToRecord</members>
<name>LightningComponentBundle</name>
</types>
<types>
+ <members>invoiceStart</members>
<members>View_Weekly_Report</members>
<members>LexConInvoiceViewReport</members>
<members>LexArrivegsDetailsPageHelpText</members>
- <members>invoiceStart</members>
- <name>customlabel</name>
- </types>
- <types>
- <members>Community_LEX_PS</members>
- <name>PermissionSet</name>
+ <name>CustomLabel</name>
</types>
<version>57.0</version>
-</Package>
+</Package>
\ No newline at end of file
diff --git a/manifest/LEXC02packagelexcommunityupdate.xml b/manifest/LEXC02packagelexcommunityupdate.xml
index 521e3c1..39b7ddd 100644
--- a/manifest/LEXC02packagelexcommunityupdate.xml
+++ b/manifest/LEXC02packagelexcommunityupdate.xml
@@ -1,10 +1,34 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
- <members>lexCancelRemoveBox</members>
- <members>lexRemoveBox</members>
- <members>lexinventoryViewLWC</members>
+ <members>ArriveGoodsController</members>
+ <members>ArriveGoodsControllerTest</members>
+ <members>LexArriveGoodsController</members>
+ <members>DealerInquiryModifyStateController</members>
+ <name>ApexClass</name>
+ </types>
+ <types>
+ <members>DealerInquiryModifyState</members>
+ <name>ApexPage</name>
+ </types>
+ <types>
+ <members>CreateTarget</members>
+ <members>WeeklyReport</members>
+ <members>RetrospectiveWeeklyReport</members>
+ <name>AuraDefinitionBundle</name>
+ </types>
+ <types>
+ <members>lexArriveGoods</members>
<name>LightningComponentBundle</name>
</types>
+ <types>
+ <members>ConsumableOrderDetail2Trigger</members>
+ <members>ArriveGoodsController</members>
+ <name>ApexTrigger</name>
+ </types>
+ <types>
+ <members>Community_LEX_PS</members>
+ <name>PermissionSet</name>
+ </types>
<version>57.0</version>
-</Package>
+</Package>
\ No newline at end of file
--
Gitblit v1.9.1